@tsocial/tvweb-sdk.vib 5.14.0-alpha.20 → 5.14.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,7 +73,7 @@ var TM={};void 0!==TM.asn1&&TM.asn1||(TM.asn1={}),TM.asn1.ASN1Util=new function(
73
73
  *
74
74
  * This source code is licensed under the MIT license found in the
75
75
  * LICENSE file in the root directory of this source tree.
76
- */function _V(e){if("object"==Xm(e)&&null!==e){var t=e.$$typeof;switch(t){case cV:switch(e=e.type){case mV:case gV:case lV:case fV:case dV:case yV:return e;default:switch(e=e&&e.$$typeof){case hV:case vV:case kV:case wV:case pV:return e;default:return t}}case uV:return t}}}function xV(e){return _V(e)===gV}var TV={AsyncMode:mV,ConcurrentMode:gV,ContextConsumer:hV,ContextProvider:pV,Element:cV,ForwardRef:vV,Fragment:lV,Lazy:kV,Memo:wV,Portal:uV,Profiler:fV,StrictMode:dV,Suspense:yV,isAsyncMode:function(e){return xV(e)||_V(e)===mV},isConcurrentMode:xV,isContextConsumer:function(e){return _V(e)===hV},isContextProvider:function(e){return _V(e)===pV},isElement:function(e){return"object"==Xm(e)&&null!==e&&e.$$typeof===cV},isForwardRef:function(e){return _V(e)===vV},isFragment:function(e){return _V(e)===lV},isLazy:function(e){return _V(e)===kV},isMemo:function(e){return _V(e)===wV},isPortal:function(e){return _V(e)===uV},isProfiler:function(e){return _V(e)===fV},isStrictMode:function(e){return _V(e)===dV},isSuspense:function(e){return _V(e)===yV},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===lV||e===gV||e===fV||e===dV||e===yV||e===bV||"object"==Xm(e)&&null!==e&&(e.$$typeof===kV||e.$$typeof===wV||e.$$typeof===pV||e.$$typeof===hV||e.$$typeof===vV||e.$$typeof===EV||e.$$typeof===SV||e.$$typeof===BV||e.$$typeof===CV)},typeOf:_V},AV=(RF((function(e,t){})),RF((function(e){e.exports=TV}))),IV={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},PV={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},RV={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},NV={};function OV(e){return AV.isMemo(e)?RV:NV[e.$$typeof]||IV}NV[AV.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},NV[AV.Memo]=RV;var DV=Object.defineProperty,LV=Object.getOwnPropertyNames,MV=Object.getOwnPropertySymbols,FV=Object.getOwnPropertyDescriptor,UV=Object.getPrototypeOf,jV=Object.prototype,VV=function e(t,r,n){if("string"!=typeof r){if(jV){var o=UV(r);o&&o!==jV&&e(t,o,n)}var a=LV(r);MV&&(a=a.concat(MV(r)));for(var i=OV(t),s=OV(r),c=0;c<a.length;++c){var u=a[c];if(!(PV[u]||n&&n[u]||s&&s[u]||i&&i[u])){var l=FV(r,u);try{DV(t,u,l)}catch(e){}}}}return t};function zV(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===tF(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,t){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(t){e(t.filter((function(e){return"video"===e.kind.toLowerCase()||"videoinput"===e.kind.toLowerCase()})).map((function(e){return{deviceId:null!=e.deviceId?e.deviceId:"",groupId:e.groupId,kind:"videoinput",label:e.label,toJSON:function(){return this}}})))}))}catch(e){return t(e)}}))}var qV,HV,KV,WV,GV,QV=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],XV=function(e){if(!e)return{isVirtual:!1};var t=e.getTracks();if(!t||!t.length)return{isVirtual:!1};var r=t[0].label,n=r&&QV.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},YV=function(e,t){return!e||1===navigator.maxTouchPoints||navigator.plugins.length>0&&!t},$V=function(){var e,t;return{updateTime:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start";"start"===n?e=r:"end"===n&&(t=r)},getStart:function(){return e},getEnd:function(){return t}}},ZV=aI.Errors,JV=aw.div(qV||(qV=uF(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: #000;\n display: flex;\n justify-content: center;\n z-index: ",";\n ","\n"])),1e3,(function(e){return e.checkCameraMode&&"opacity: 0;"})),ez=aw.video(HV||(HV=uF(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),tz=aw.div(KV||(KV=uF(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),rz=aw(tz)(WV||(WV=uF(["\n z-index: ",";\n position: fixed;\n top: 20px;\n right: 20px;\n width: 20px;\n cursor: pointer;\n"])),2e3),nz=aw.div(GV||(GV=uF(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),oz=dv.createRef(),az=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(r,n){e.call(navigator,t,r,n)}))}}:null}();function iz(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,a=e.onVideoPlayed,i=e.flipHorizontal,s=e.videoSettings,c=e.refVideo,u=e.onError,l=e.closeButton,d=e.videoClassName,f=e.scale,p=e.defaultCameraId,h=e.onWarning,m=dv.useRef(),g=hN.useSDKSettings().lang,v=KN.useSDKTracking().sendEvent,y=QN.useAsset("ic_close.png"),b=lF(dv.useState(""),2),w=b[0],k=b[1],C=dv.useRef(!1),E=dv.useRef(!1),S=dv.useRef(!1),B=dv.useRef(),_=dv.useRef([]),x=dv.useRef(""),T=dv.useCallback((function(e){u&&u(e)}),[u]),A=dv.useCallback((function(){try{var e;clearInterval(m.current),(null==c||null===(e=c.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(c.current.srcObject.getTracks().forEach((function(e){return e.stop()})),c.current.srcObject=null)}catch(e){}clearTimeout(B)}),[c]);function I(){return P.apply(this,arguments)}function P(){return(P=nF(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,zV();case 3:t=e.sent,_.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),KM.addExifData("device_info.camera_list",JSON.stringify(_.current.map((function(e){return e.label})))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}m.current||(m.current=setInterval((function(){document.getElementById("tv-camera-".concat(m.current))||A()}),1e3)),dv.useEffect((function(){return function(){S.current=!0}}),[]);var R=dv.useCallback((function(){B.current||(B.current=setTimeout((function(){C.current||(k(ZV.camera_timeout.msg[g]),T(ZV.camera_timeout))}),2e4))}),[g,T]),N=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){var n,o,a,i,c,u,l,d,f,p,m=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=m.length>1&&void 0!==m[1]&&m[1],o={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return h&&h("too_many_request_to_camera"),e.abrupt("return",new Promise((function(e){return e(null)})));case 5:return window.tv_last_req_camera_complete=!1,o=OF.isMobile?OF.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},a=$V(),i=a.updateTime,c=a.getStart,u=a.getEnd,e.prev=8,l=s||o,i(performance.now(),"start"),YV(OF.isMobile,OF.isIOS)&&r&&(l={}),n&&(l={}),KM.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),d={audio:!1,video:sF(sF({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)},e.next=17,az.getUserMedia(d);case 17:return f=e.sent,e.next=20,I();case 20:if(R(),f){e.next=25;break}return k(ZV.not_supported.msg[g]),T(ZV.not_supported),e.abrupt("return",null);case 25:i(performance.now(),"end"),window.tv_last_req_camera_complete=!0,u()-c()<1600?v({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):v({tag:"cam_permission",event:"user_activity.allow",log:{}});try{p=f.getVideoTracks()[0].getSettings(),KM.addExifData("device_info.camera_label_dimension.got","".concat(p.width,"x").concat(p.height))}catch(e){}return e.abrupt("return",f);case 32:e.prev=32,e.t0=e.catch(8),i(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k(ZV.no_permission.msg[g]),T(ZV.no_permission),E.current=!0,v({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):E.current&&("NotReadableError"===e.t0.name?(T(ZV.not_readable),k(ZV.not_readable.msg[g])):(k(e.t0.message),T({code:e.t0.name||e.t0.code,message:e.t0.message})));case 36:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 38:case"end":return e.stop()}}),e,null,[[8,32]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,T,h,R,v]),O=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var t,r,n,o,i,s,u,l,d,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>0&&void 0!==h[0]?h[0]:p,o=h.length>1&&void 0!==h[1]&&h[1],!(null!=(i=c.current)&&null!==(t=i.srcObject)&&void 0!==t&&t.id&&null!=i&&null!==(r=i.srcObject)&&void 0!==r&&r.active&&C.current)){e.next=5;break}return e.abrupt("return");case 5:return i.oncanplaythrough=function(){var e,t,r;i.play(),KM.addExifData("device_info.camera_label",null===(e=s)||void 0===e||null===(t=e.getVideoTracks())||void 0===t||null===(r=t[0])||void 0===r?void 0:r.label),C.current=!0,k("");var n=window.innerWidth,o=window.innerHeight,c=CO.analyzeVideoAndWindowSizes(i),u=c.lostX,l=void 0===u?0:u,d=c.lostY,f=void 0===d?0:d,p=Math.min(n,Math.floor(n-2*l)),h=Math.min(o,Math.floor(o-2*f));a&&a({clientWidth:n,clientHeight:o,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,N(n,o);case 8:s=e.sent,u=XV(s),l=u.deviceLabel,(d=u.isVirtual)&&(x.current+="".concat(l,", "),(f=_.current.filter((function(e){return!x.current.includes(e.label)})))[0]&&f[0].deviceId&&O(f[0].deviceId)),s||E.current||(KM.addExifData("device_info.camera_label_retry","yes"),E.current=!0,O(n,!0)),s&&S.current&&(c.current.srcObject=s,A()),!s||S.current||d||(i.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,N,a,p,A]);dv.useEffect((function(){function e(){return(e=nF(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:return e.next=4,zV();case 4:t=e.sent,(r=t.filter((function(e){return"videoinput"===e.kind&&e.label.includes("back")&&e.label.includes("0")}))).length>0&&(n=r[0].deviceId,A(),O(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return C.current?function(){}:(!az||OF.browserName&&["facebook"].includes(OF.browserName.toLowerCase())||OF.getUA.includes("Zalo iOS")?(k(ZV.not_supported.msg[g]),T(ZV.not_supported)):t&&(OF.isAndroid&&!1===r?function(){e.apply(this,arguments)}():O()),function(){S.current&&A()})}),[c,g,r,O,A,T]);var D=dv.useCallback((function(){A(),n&&n(),v({tag:"result",event:"user_activity.cancel",log:{}})}),[n,A,v]);return dv.createElement(JV,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!w)return null;var e=ZV.no_permission.msg[g];return w===e&&OF.isIOS?dv.createElement(nz,null,w," ",dv.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):dv.createElement(nz,null,w)}(),dv.createElement(ez,{ref:c,playsInline:!0,muted:!0,flipHorizontal:i,className:d,scale:f}),o,l?dv.cloneElement(l,{onClick:D,"data-testid":"close-camera"}):dv.createElement(rz,{onClick:D,"data-testid":"close-camera"},dv.createElement("img",{src:y,alt:""})))}iz.propTypes={checkCameraMode:Lv.bool,frontCamera:Lv.bool,onClose:Lv.func,onError:Lv.func,onVideoPlayed:Lv.func,children:Lv.node,flipHorizontal:Lv.bool,videoSettings:Lv.object,refVideo:Lv.object,closeButton:Lv.node,videoClassName:Lv.string,scale:Lv.number,defaultCameraId:Lv.string,onWarning:Lv.func},iz.defaultProps={checkCameraMode:!1,frontCamera:!0,onClose:null,onError:null,onVideoPlayed:null,children:null,flipHorizontal:!1,videoSettings:null,refVideo:null,closeButton:null,videoClassName:"",scale:1,defaultCameraId:void 0,onWarning:null};var sz,cz=function(e,t,r){var n=function(t){ag(o,dv.Component);var n=fg(o);function o(){var e;return Zm(this,o),(e=n.apply(this,arguments)).updateDebounced=iV(e.forceUpdate,250,r),e}return eg(o,[{key:"shouldComponentUpdate",value:function(){return this.updateDebounced(),!1}},{key:"componentWillUnmount",value:function(){this.updateDebounced.cancel()}},{key:"render",value:function(){return dv.createElement(e,Object.assign({},this.props))}}]),o}();return n.displayName="debounceRender(".concat(e.displayName||e.name||"Component",")"),VV(n,e)}(iz),uz=dv.forwardRef((function(e,t){return dv.createElement(cz,aF({},e,{refVideo:t||oz}))})),lz=sw(sz||(sz=uF(["\n .popup-content {\n margin: auto;\n background: #fff;\n width: 100%;\n padding: 5px;\n border: 1px solid #d7d7d7;\n max-width: 568px;\n border-radius: 10px;\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n border-radius: 5px\n }\n\n .popup-overlay {\n background: rgba(0, 0, 0, .5);\n padding: 10px;\n }\n\n [data-popup=tooltip].popup-overlay {\n background: transparent\n }\n\n .popup-arrow {\n -webkit-filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n color: #fff;\n stroke-width: 2px;\n stroke: #d7d7d7;\n stroke-dasharray: 30px;\n stroke-dashoffset: -54px;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0\n }\n"]))),dz=["open","children","overlayStyle"],fz=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=cF(e,dz);return dv.createElement(dv.Fragment,null,t&&dv.createElement(dv.Fragment,null,dv.createElement(Kj,aF({overlayStyle:sF(sF({},n),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),dv.createElement(lz,null)))};fz.propTypes={open:Lv.bool,children:Lv.node,overlayStyle:Lv.shape({})},fz.defaultProps={open:!1,children:null,overlayStyle:{}};var pz="default";function hz(e){var t=e.className,r=e.width,n=e.height,o=e.type,a=e.strokeStyles,i=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=dv.useMemo((function(){var e;return sF((oF(e={},pz,{fill:"none",strokeWidth:i,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),oF(e,"error",{fill:"rgba(234,50,35, 0.1)",strokeWidth:i,stroke:"#ea3223"}),e),a)}),[i,a]),l=s+.8*i,d=u[o];return dv.createElement("svg",{width:r,height:n,className:t},dv.createElement("rect",{x:i/2,y:i/2,rx:s,ry:s,width:r-i,height:n-i,style:d}),dv.createElement("path",{d:"M0,".concat(l," Q0,0 ").concat(l,",0 L0,0 Z"),style:c}),dv.createElement("path",{d:"M0,".concat(n-l," Q0,").concat(n," ").concat(l,",").concat(n," L0,").concat(n," Z"),style:c}),dv.createElement("path",{d:"M".concat(r-l,",").concat(n," Q").concat(r,",").concat(n," ").concat(r,",").concat(n-l," L").concat(r,",").concat(n," Z"),style:c}),dv.createElement("path",{d:"M".concat(r-l,",0 Q").concat(r,",0 ").concat(r,",").concat(l," L").concat(r,",0 Z"),style:c}))}hz.propTypes={className:Lv.string,width:Lv.number,height:Lv.number,strokeWidth:Lv.number,strokeStyles:Lv.shape({}),type:Lv.oneOf([pz,"error"]),radius:Lv.number,paddingStyle:Lv.shape({})},hz.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:pz,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var mz,gz,vz,yz,bz,wz,kz,Cz,Ez,Sz,Bz,_z,xz,Tz,Az,Iz,Pz,Rz,Nz=Hb([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],cw(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),500,cw(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),500),Oz=(Hb([".slide-horizontal{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}.slide-vertical{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],cw(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),cw(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20)),cw(["from,to{opacity:1;}50%{opacity:0;}"])),Dz=(Hb([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],Oz),aw.div(mz||(mz=uF(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ","; // must be higher than BASE_Z_INDEX and lower than other layers\n"])),1001)),Lz=Hb([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],cw(["from{background:#000;}to{}"]),300),Mz=aw.div(gz||(gz=uF(["\n ","\n"])),Lz),Fz=Hb([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],cw(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"])),Uz=["width","height","type"],jz=aw(hz)(vz||(vz=uF([""]))),Vz=aw.img(yz||(yz=uF(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),zz=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return dv.createElement(Mz,null,dv.createElement(IF,null,dv.createElement(_F,{key:r,timeout:{enter:300,exit:0},classNames:"splash",unmountOnExit:!1},dv.createElement(Dz,null))))},qz=aw.div(bz||(bz=uF(["\n ","\n ","\n"])),Nz,Fz),Hz=aw.img(wz||(wz=uF(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),Kz=aw.div(kz||(kz=uF(["\n cursor: pointer;\n text-align: center;\n width: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),60,1020,OF.isMobile?Hb(["top:",";"],(function(e){return e.y})):Hb(["bottom:","px;"],10)),Wz=aw.div(Cz||(Cz=uF(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ","px;\n height: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),100,100,1020),Gz=aw.div(Ez||(Ez=uF(["\n color: #fff;\n text-align: center;\n"]))),Qz=aw.div(Sz||(Sz=uF(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),Xz=aw.div(Bz||(Bz=uF(["\n display: flex;\n align-items: center;\n"]))),Yz=aw(Gz)(_z||(_z=uF(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),$z=aw(Gz)(xz||(xz=uF(["\n font-size: 20px;\n margin-left: 10px;\n color: green;\n position: absolute;\n left: 0;\n top: 10px;\n background: white;\n z-index: ",";\n"])),1030),Zz=aw(Gz)(Tz||(Tz=uF(["\n position: absolute;\n font-size: 16px;\n text-align: center;\n color: #fff;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),Jz=aw(Zz)(Az||(Az=uF(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),eq=aw(Gz)(Iz||(Iz=uF(["\n position: absolute;\n font-size: 18px;\n text-align: center;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),tq=(aw.div(Pz||(Pz=uF(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),function(e){var t=e.width,r=e.height,n=e.type,o=cF(e,Uz),a=QN.useAsset("id_card_frame.png"),i=QN.useAsset("id_card_frame_error.png");return dv.createElement(qz,{width:t,height:r},dv.createElement(Vz,{src:"error"===n?i:a,width:t,height:r}),dv.createElement(jz,aF({width:t,height:r,type:n},o)))}),rq={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},nq=aw.div(Rz||(Rz=uF(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),oq=function(e){var t=e.contentStyle,r=hN.useSDKSettings(),n=r.lang,o=r.warmupMessage,a=o?o[n]:rq.WARMUP_INTRO[n];return dv.createElement(fz,{open:!0,contentStyle:t},dv.createElement(nq,{className:"warmup-message"},a))};oq.propTypes={contentStyle:Lv.shape({})},oq.defaultProps={contentStyle:{}};var aq,iq,sq,cq={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},uq=aI.IDCardMessage,lq=aw.div(aq||(aq=uF(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),dq=aw.div(iq||(iq=uF(["\n text-align: center;\n font-size: 1rem;\n"]))),fq=aw.button(sq||(sq=uF(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),pq=function(e){var t=e.onOk,r=e.maxSessionTime,n=hN.useSDKSettings().lang;return dv.createElement(lq,null,dv.createElement(dq,{className:"popup-message"},Rj(uq.TIMEOUT_INSTRUCTION[n])({x:r})),dv.createElement(fq,{className:"popup-button",onClick:t},cq.BTN_OK[n]))};pq.propTypes={onOk:Lv.func,maxSessionTime:Lv.number},pq.defaultProps={onOk:function(){},maxSessionTime:30};var hq=function(){var e=lF(dv.useState(!1),2),t=e[0],r=e[1],n=lF(dv.useState(null),2),o=n[0],a=n[1],i=lF(dv.useState({}),2),s=i[0],c=i[1];return{showPopup:dv.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),a(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},mq="SESSION_TIMEOUT",gq="QR_INSTRUCTIONS",vq=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yq=/^\w*$/,bq=oU(Object,"create"),wq=Object.prototype.hasOwnProperty,kq=Object.prototype.hasOwnProperty;function Cq(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Cq.prototype.clear=function(){this.__data__=bq?bq(null):{},this.size=0},Cq.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Cq.prototype.get=function(e){var t=this.__data__;if(bq){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return wq.call(t,e)?t[e]:void 0},Cq.prototype.has=function(e){var t=this.__data__;return bq?void 0!==t[e]:kq.call(t,e)},Cq.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=bq&&void 0===t?"__lodash_hash_undefined__":t,this};var Eq=Cq,Sq=function(e,t){for(var r=e.length;r--;)if(sU(e[r][0],t))return r;return-1},Bq=Array.prototype.splice;function _q(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}_q.prototype.clear=function(){this.__data__=[],this.size=0},_q.prototype.delete=function(e){var t=this.__data__,r=Sq(t,e);return!(r<0||(r==t.length-1?t.pop():Bq.call(t,r,1),--this.size,0))},_q.prototype.get=function(e){var t=this.__data__,r=Sq(t,e);return r<0?void 0:t[r][1]},_q.prototype.has=function(e){return Sq(this.__data__,e)>-1},_q.prototype.set=function(e,t){var r=this.__data__,n=Sq(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var xq=_q,Tq=oU(MF,"Map"),Aq=function(e,t){var r=e.__data__;return function(e){var t=Xm(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map};function Iq(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Iq.prototype.clear=function(){this.size=0,this.__data__={hash:new Eq,map:new(Tq||xq),string:new Eq}},Iq.prototype.delete=function(e){var t=Aq(this,e).delete(e);return this.size-=t?1:0,t},Iq.prototype.get=function(e){return Aq(this,e).get(e)},Iq.prototype.has=function(e){return Aq(this,e).has(e)},Iq.prototype.set=function(e,t){var r=Aq(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};var Pq=Iq;function Rq(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Rq.Cache||Pq),r}Rq.Cache=Pq;var Nq=Rq,Oq=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dq=/\\(\\)?/g,Lq=function(e){var t=Nq((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Oq,(function(e,r,n,o){t.push(n?o.replace(Dq,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),Mq=function(e,t){return PU(e)?e:function(e,t){if(PU(e))return!1;var r=Xm(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!gj(e))||yq.test(e)||!vq.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Lq(wj(e))},Fq=function(e){if("string"==typeof e||gj(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Uq=function(e,t,r){var n=null==e?void 0:function(e,t){for(var r=0,n=(t=Mq(t,e)).length;null!=e&&r<n;)e=e[Fq(t[r++])];return r&&r==n?e:void 0}(e,t);return void 0===n?r:n},jq=aI.Errors;function Vq(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function zq(e,t){return Math.sqrt(Vq(e,t))}function qq(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=window,o=n.cv,a=t.width,i=t.height,s=r;s<1&&(s=parseInt(.5*(i+a)*s,10));var c=o.imread(t),u=new o.Mat;return o.copyMakeBorder(c,u,s,s,s,s,o.BORDER_CONSTANT,new o.Scalar(0,0,0,255)),c.delete(),{mat:u,margin:s}}function Hq(e,t){var r=window.cv,n=lF(t.map((function(e){return e.location})),4),o=n[0],a=n[1],i=n[2],s=n[3],c=zq(i,s),u=zq(a,o),l=Math.max(c,u),d=zq(a,i),f=zq(o,s),p=Math.max(d,f),h=[o.x,o.y,a.x,a.y,i.x,i.y,s.x,s.y],m=[0,0,l-1,0,l-1,p-1,0,p-1],g=r.imread(e),v=new r.Mat,y=new r.Size(l,p),b=r.matFromArray(4,1,r.CV_32FC2,h),w=r.matFromArray(4,1,r.CV_32FC2,m),k=r.getPerspectiveTransform(b,w);r.warpPerspective(g,v,k,y,r.INTER_LINEAR,r.BORDER_CONSTANT,new r.Scalar);var C=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),w.delete(),C}function Kq(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},o={x:r.x-e.x,y:r.y-e.y},a=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),i=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(a*i))/Math.PI}function Wq(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;t.forEach((function(e){var t=e.location,r=t.x,n=t.y;o=Math.min(o,r),a=Math.min(a,n),i=Math.max(i,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&a/n>=c&&(n-s)/n>=c&&(r-i)/r>=c}function Gq(){return Qq.apply(this,arguments)}function Qq(){return(Qq=nF(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=t.canvas,n=t.paddingPercent,o=void 0===n?.04:n,a=r.width,i=r.height,s=Math.floor(a*o),c=Math.floor(i*o),u=a-2*s,l=i-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(r,s,c,u,l,0,0,u,l),e.abrupt("return",zD.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xq(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,a=Kq(e[r].location,e[n].location,e[o].location);if(a<70||a>110)return!1}return!0}function Yq(e){return $q.apply(this,arguments)}function $q(){return($q=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.blazefaceModel,n=t.predictedIdCardCanvas,o=t.frontSide,a=n.width,i=n.height,s=Math.floor(a/3),c=Math.floor(4*i/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(i/5),s,c,0,0,s,c),e.next=12,jO.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=lF(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4||IO.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[jO.SIZE,jO.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",jq.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",jq.id_detector_error_front_side_multiple_faces);case 20:e.next=24;break;case 22:if(!(p>0)){e.next=24;break}return e.abrupt("return",jq.id_detector_error_back_side_has_faces);case 24:return e.abrupt("return",null);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Zq=function(e){var t=Uq(e,"card.corners");if(t&&Array.isArray(t)&&t.length>0){var r=Uq(t,"[0].location"),n=r.x,o=r.y;return"".concat(n,":").concat(o)}return"-1:-1"},Jq=function(e,t,r){e.current=[].concat(dF(e.current),[t]),e.current.length>r&&e.current.shift()},eH=function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=t.currentWorkingCanvas,u=t.refVirtualWorkingCanvas,l=t.refCountVirtualFrames,d=t.refVirtualFrames,f=t.refWorkingCanvas,(p=t.refCardResult).current.corners&&Array.isArray(p.current.corners)){e.next=3;break}return e.abrupt("return");case 3:return h=lF(p.current.corners,3),m=h[0],g=h[1],v=h[2],y=(null==g||null===(r=g.location)||void 0===r?void 0:r.x)-(null==m||null===(n=m.location)||void 0===n?void 0:n.x)-100,b=(null==v||null===(o=v.location)||void 0===o?void 0:o.y)-(null==g||null===(a=g.location)||void 0===a?void 0:a.y)-100,w=performance.now(),(k=u.current).width=y,k.height=b,(C=k.getContext("2d")).drawImage(c,(null==m||null===(i=m.location)||void 0===i?void 0:i.x)+50,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+50,y,b,0,0,y,b),e.next=14,new Promise((function(e){k.toBlob(function(){var t=nF(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,MN.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(dF(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 14:return w=Math.floor(performance.now()-w),E=180-w>0?180-w:0,e.next=18,new Promise((function(e){return setTimeout(e,E)}));case 18:if(!(l.current<3)){e.next=29;break}return _=performance.now(),x=f.current,C.drawImage(x,(null==m||null===(S=m.location)||void 0===S?void 0:S.x)+50,(null==m||null===(B=m.location)||void 0===B?void 0:B.y)+50,y,b,0,0,y,b),e.next=24,new Promise((function(e){k.toBlob(function(){var t=nF(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,MN.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(dF(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 24:if(!(l.current<2)){e.next=26;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _=Math.floor(performance.now()-_),t=180-_>0?180-_:0,e.next=4,new Promise((function(e){return setTimeout(e,t)}));case 4:case"end":return e.stop()}}),e)}))(),"t0",26);case 26:l.current+=1,e.next=18;break;case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),tH=function(e,t){return!(0!==t.length&&!t.includes("vn.national_id"))||t.map((function(e){return e.replace("vn.","")})).some((function(t){var r;return(null===(r=e.split("."))||void 0===r?void 0:r.filter((function(e){return"front"!==e&&"back"!==e&&"vn"!==e}))).some((function(e){return e===t}))}))},rH=/\s/,nH=/^\s+/,oH=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&rH.test(e.charAt(t)););return t}(e)+1).replace(nH,""):e},aH=/^[-+]0x[0-9a-f]+$/i,iH=/^0b[01]+$/i,sH=/^0o[0-7]+$/i,cH=parseInt,uH=function(e){if("number"==typeof e)return e;if(gj(e))return NaN;if(WF(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=WF(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=oH(e);var r=iH.test(e);return r||sH.test(e)?cH(e.slice(2),r?2:8):aH.test(e)?NaN:+e},lH=function(e){var t=function(e){return e?1/0===(e=uH(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),r=t%1;return t==t?r?t-r:t:0},dH=function(e){return function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=lH(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}(2,e)},fH=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=uH(r))==r?r:0),void 0!==t&&(t=(t=uH(t))==t?t:0),function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}(uH(e),t,r)},pH="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function hH(){return(hH=nF(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.url,n=void 0===r?pH:r,e.abrupt("return",new Promise((function(e,t){var r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("type","text/javascript"),r.setAttribute("id","opencvjs"),r.addEventListener("load",nF(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!window.cv||!window.cv.getBuildInformation){t.next=4;break}e(),t.next=12;break;case 4:if(!(window.cv instanceof Promise)){t.next=11;break}return t.next=7,window.cv;case 7:window.cv=t.sent,e(),t.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return t.stop()}}),t)})))),r.addEventListener("error",(function(){t()})),r.src=n;var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(r,o)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var mH=dH((function(){return hH.apply(this,arguments)})),gH={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},vH={vn:.4,ph:.5},yH={0:"top-left",1:"top-right",2:"bottom-right",3:"bottom-left",4:"cccd.front",5:"passport",6:"cmnd_old.front",7:"cmnd_old.back",8:"cmnd_new.front",9:"cmnd_new.back",10:"cccd_new.front",11:"cccd_new.back",12:"aadhaar_front",13:"aadhaar_back",14:"voter_front",15:"voter_back",16:"pan",17:"dl",18:"india_spassport",19:"aadhaar_letter",20:"pan_back",21:"passport_back",22:"unseen",23:"other",24:"BUREAU OF INTERNAL REVENUE",25:"COMMISSION ON ELECTIONS",26:"COVID VACCINATION CARD",27:"DRIVERS LICENSE",28:"HEALTH INSURANCE PHILHEALTH",29:"PAG-IBIG LOYALTY CARD",30:"PASSPORT",31:"PHILIPPINE IDENTIFICATION CARD",32:"POSTAL IDENTITY CARD",33:"PROFESSIONAL IDENTIFICATION CARD",34:"RESIDENT IDENTIFICATION CARD",35:"SOCIAL SECURITY SYSTEM",36:"UNIFIED MULTI PURPOSE ID",37:"VN_biz_license",38:"new_voter_front"};function bH(e){var t,r,n,o,a,i=e.card,s=e.corners,c=i.box,u={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},l=c[2]-c[0],d=c[1]-c[3],f=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=fF(e))){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){throw e})),f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){s=!0,a=e})),f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}(s);try{for(f.s();!(a=f.n()).done;){var p=a.value;switch(p.label){case"top-left":t||(t=p.location);break;case"top-right":r||(r=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":o||(o=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![t,r,n,o].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(t.x+n.x)/2,y:(t.y+n.y)/2},m={x:(r.x+o.x)/2,y:(r.y+o.y)/2},g=Vq(u,h),v=Vq(u,m);return Math.sqrt(g)>(l+d)/8||Math.sqrt(v)>(l+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var wH=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.country=t||"vn",this.defaultModelUrl=gH[this.country]||gH.vn}var t,r,n,o,a,i,s,c,u;return t=e,(r=[{key:"load",value:(u=nF(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.opencvUrl,n=t.modelUrl,e.next=3,Promise.all([mH({url:r}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"predictDummyInput",value:(c=nF(regeneratorRuntime.mark((function e(){var t,r,n,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,n=r.tidy((function(){var e=r.zeros(o.inputShape,"float32");return o.model.predict(e)})),e.abrupt("return",Promise.all([n[this.out_score_name].data()]));case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"loadModel",value:(s=nF(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,SL.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,SL.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,a=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),i=lF(a,3),this.out_score_name=i[0],this.out_class_name=i[1],this.out_box_name=i[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"loadResource",value:(i=nF(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,SL.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"dispose",value:(a=nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.model&&this.model.dispose();case 1:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"predict",value:(o=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x,T,A,I,P,R=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=R.length>1&&void 0!==R[1]?R[1]:{},n=r.imgMargin,o=r.detectThreshold,a=void 0===o?.3:o,i=r.maxNumReturns,s=void 0===i?100:i,c=window,u=c.cv,l={},d=t.width,f=t.height,l.originalWidth=d,l.originalHeight=f,p=qq({canvas:t,imgMargin:"number"==typeof n?n:vH[this.country]}),h=p.margin,m=p.mat,g=this.inputShape.slice(1,3),v=lF(g,2),y=v[0],b=v[1],w=new u.Mat,u.resize(m,w,new u.Size(y,b),0,0,u.INTER_AREA),k=m.cols/y,C=m.rows/b,(E=document.createElement("canvas")).width=y,E.height=b,E.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(w.data),w.cols,w.rows),0,0),m.delete(),w.delete(),l.canvas=E,l.margin=h,S=performance.now(),e.next=25,this.detect(E,{detectThreshold:a,maxNumReturns:s});case 25:if(B=e.sent,_=Math.floor(performance.now()-S),x={inputImage:l,card:null,exeTime:_},T=[[],[],[],[]],A=[],I=[],B.forEach((function(e){var t=lF(e.box,4),r=t[0],n=t[1],o=t[2],a=t[3];e.clazz<=3?T[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:fH(Math.floor((a+n)/2*k-h),0,d),y:fH(Math.floor((r+o)/2*C-h),0,f)},scaledLocation:{x:fH(Math.floor((a+n)/2),0,E.width),y:fH(Math.floor((r+o)/2),0,E.height)}}):I.push({label:e.label,score:e.score,box:[fH(Math.floor(r*C-h),0,f),fH(Math.floor(n*k-h),0,d),fH(Math.floor(o*C-h),0,f),fH(Math.floor(a*k-h),0,d)]})})),T.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),A.push(e[0]))})),!(I.length>0&&4===A.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),A.sort((function(e,t){return e.clazz-t.clazz})),P=I[0],e.prev=37,bH({card:P,corners:A})){e.next=41;break}return console.debug("Not qualified.",P,A),e.abrupt("return",x);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",x);case 46:return P.corners=A,x.card=P,e.abrupt("return",x);case 49:return e.abrupt("return",x);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return o.apply(this,arguments)})},{key:"detect",value:(n=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B=this,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.length>1&&void 0!==_[1]?_[1]:{},n=r.detectThreshold,o=r.maxNumReturns,a=window,i=a.tf,s=t.width,c=t.height,u=i.tidy((function(){var e=i.expandDims(i.cast(i.image.resizeBilinear(i.browser.fromPixels(t),B.inputShape.slice(1,3)),"float32"));return B.model.predict(e)})),e.next=7,Promise.all([u[this.out_score_name].data(),u[this.out_class_name].data(),u[this.out_box_name].array()]);case 7:l=e.sent,d=lF(l,3),f=d[0],p=d[1],h=lF(d[2],1),m=h[0],g=Math.min(f.length,o),v=[];try{for(y=0;y<g;y++)b=f[y],w=p[y],b>n&&(C=null!==(k=yH[Math.round(w)])&&void 0!==k?k:"NA",E=m[y],S=[E[0]*c,E[3]*s,E[2]*c,E[1]*s],v.push({score:b,clazz:w,box:S,label:C}))}catch(e){console.log(e)}return e.abrupt("return",v.length>=5?v:[]);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,r),e}();function kH(){return(kH=nF(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.blazefaceModelUrl,n=t.tfScriptUrls,o=t.closeEyesModelUrl,a=new GM(o),e.next=4,SL.loadTensorFlow(n);case 4:return e.next=6,SL.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[SL.loadBlazefaceModel({modelUrl:r}),a.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=lF(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:a});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var CH=dH((function(){return kH.apply(this,arguments)})),EH=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._onDecodeError,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._calculateScanRegion,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"environment";Zm(this,t),this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=r,this._legacyCanvasSize=t.DEFAULT_CANVAS_SIZE,this._preferredCamera=a,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof n?(this._legacyCanvasSize=n,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=n,"number"==typeof o?(this._legacyCanvasSize=o,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=o,this._scanRegion=this._calculateScanRegion(e),this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;var i=!1;e.hidden&&(e.hidden=!1,i=!0),document.body.contains(e)||(document.body.appendChild(e),i=!0),requestAnimationFrame((function(){var t=window.getComputedStyle(e);"none"===t.display&&(e.style.setProperty("display","block","important"),i=!0),"visible"!==t.visibility&&(e.style.setProperty("visibility","visible","important"),i=!0),i&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity=0,e.style.width=0,e.style.height=0)})),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),this._qrEnginePromise=t.createQrEngine()}return eg(t,[{key:"hasFlash",value:function(){var e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((function(t){var r=t.stream;return console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=r,r.getVideoTracks()[0]}))).then((function(e){return"torch"in e.getSettings()})).catch((function(){return!1})).finally((function(){if(e){var t,r=kg(e.getTracks());try{for(r.s();!(t=r.n()).done;){var n=t.value;n.stop(),e.removeTrack(n)}}catch(e){r.e(e)}finally{r.f()}}}))}},{key:"isFlashOn",value:function(){return this._flashOn}},{key:"toggleFlash",value:function(){return this._flashOn?this.turnFlashOff():this.turnFlashOn()}},{key:"turnFlashOn",value:function(){var t=this;return this._flashOn?Promise.resolve():(this._flashOn=!0,!this._active||this._paused?Promise.resolve():this.hasFlash().then((function(e){return e?t.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]}):Promise.reject("No flash available")})).catch((function(){throw t._flashOn=!1,e})))}},{key:"turnFlashOff",value:function(){if(this._flashOn)return this._flashOn=!1,this._restartVideoStream()}},{key:"destroy",value:function(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.stop(),t._postWorkerMessage(this._qrEnginePromise,"close")}},{key:"start",value:function(){var e=this;return this._active&&!this._paused?Promise.resolve():("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,document.hidden?Promise.resolve():(this._paused=!1,this.$video.srcObject?(this.$video.play(),Promise.resolve()):this._getCameraStream().then((function(t){var r=t.stream,n=t.facingMode;e.$video.srcObject=r,e.$video.play(),e._setVideoMirror(n),e._flashOn&&(e._flashOn=!1,e.turnFlashOn().catch((function(){})))})).catch((function(t){throw e._active=!1,t}))))}},{key:"stop",value:function(){this.pause(),this._active=!1}},{key:"pause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._paused=!0,!this._active)return Promise.resolve(!0);this.$video.pause();var r=function(){var t,r=kg(e.$video.srcObject?e.$video.srcObject.getTracks():[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.stop(),e.$video.srcObject.removeTrack(n)}}catch(e){r.e(e)}finally{r.f()}e.$video.srcObject=null};return t?(r(),Promise.resolve(!0)):new Promise((function(e){return setTimeout(e,300)})).then((function(){return!!e._paused&&(r(),!0)}))}},{key:"setCamera",value:function(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}},{key:"setGrayscaleWeights",value:function(e,r,n){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:r,blue:n,useIntegerApproximation:o})}},{key:"setInversionMode",value:function(e){t._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}},{key:"_onPlay",value:function(){this._scanRegion=this._calculateScanRegion(this.$video),this._scanFrame()}},{key:"_onLoadedMetaData",value:function(){this._scanRegion=this._calculateScanRegion(this.$video)}},{key:"_onVisibilityChange",value:function(){document.hidden?this.pause():this._active&&this.start()}},{key:"_calculateScanRegion",value:function(e){var t=Math.min(e.videoWidth,e.videoHeight),r=Math.round(2/3*t);return{x:Math.round((e.videoWidth-r)/2),y:Math.round((e.videoHeight-r)/2),width:r,height:r,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}},{key:"_scanFrame",value:function(){var e=this;if(!this._active||this.$video.paused||this.$video.ended)return!1;requestAnimationFrame((function(){e.$video.readyState<=1?e._scanFrame():e._qrEnginePromise.then((function(r){return t.scanImage(e.$video,e._scanRegion,r,e.$canvas)})).then(e._onDecode,(function(r){e._active&&(-1!==(r.message||r).indexOf("service unavailable")&&(e._qrEnginePromise=t.createQrEngine()),e._onDecodeError(r))})).then((function(){return e._scanFrame()}))}))}},{key:"_onDecodeError",value:function(e){e!==t.NO_QR_CODE_FOUND&&console.log(e)}},{key:"_getCameraStream",value:function(){var e=this;if(!navigator.mediaDevices)return Promise.reject("Camera not found.");var t="environment"===this._preferredCamera||"user"===this._preferredCamera?"facingMode":"deviceId",r=[{width:{min:1024}},{width:{min:768}},{}];return[].concat(mg(r.map((function(r){return Object.assign({},r,tg({},t,{exact:e._preferredCamera}))}))),r).reduceRight((function(t,r){return function(){return navigator.mediaDevices.getUserMedia({video:r,audio:!1}).then((function(t){return{stream:t,facingMode:e._getFacingMode(t)||(r.facingMode?e._preferredCamera:"environment"===e._preferredCamera?"user":"environment")}})).catch(t)}}),(function(){return Promise.reject("Camera not found.")}))()}},{key:"_restartVideoStream",value:function(){var e=this,t=this._paused;return this.pause(!0).then((function(r){if(r&&!t&&e._active)return e.start()}))}},{key:"_setVideoMirror",value:function(e){var t="user"===e?-1:1;this.$video.style.transform="scaleX("+t+")"}},{key:"_getFacingMode",value:function(e){var t=e.getVideoTracks()[0];return t?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}}],[{key:"hasCamera",value:function(){return t.listCameras(!1).then((function(e){return!!e.length})).catch((function(){return!1}))}},{key:"listCameras",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!navigator.mediaDevices)return Promise.resolve([]);var t=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((function(e){return t=e})).catch((function(){})):Promise.resolve()).then((function(){return navigator.mediaDevices.enumerateDevices()})).then((function(e){return e.filter((function(e){return"videoinput"===e.kind})).map((function(e,t){return{id:e.deviceId,label:e.label||(0===t?"Default Camera":"Camera ".concat(t+1))}}))})).finally((function(){if(t){var e,r=kg(t.getTracks());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.stop(),t.removeTrack(n)}}catch(e){r.e(e)}finally{r.f()}}}))}},{key:"scanImage",value:function(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],c=o instanceof Worker,u=Promise.all([o||t.createQrEngine(),t._loadImage(e)]).then((function(e){var s,u,l=hg(e,2),d=l[0],f=l[1];return o=d,s=hg(r._drawToCanvas(f,n,a,i),2),a=s[0],u=s[1],o instanceof Worker?(c||o.postMessage({type:"inversionMode",data:"both"}),new Promise((function(e,r){var n,i,s;i=function(a){"qrResult"===a.data.type&&(o.removeEventListener("message",i),o.removeEventListener("error",s),clearTimeout(n),null!==a.data.data?e(a.data.data):r(t.NO_QR_CODE_FOUND))},s=function(e){o.removeEventListener("message",i),o.removeEventListener("error",s),clearTimeout(n);var t=e?e.message||e:"Unknown Error";r("Scanner error: "+t)},o.addEventListener("message",i),o.addEventListener("error",s),n=setTimeout((function(){return s("timeout")}),1e4);var c=u.getImageData(0,0,a.width,a.height);o.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise((function(e,r){var n=setTimeout((function(){return r("Scanner error: timeout")}),1e4);o.detect(a).then((function(n){n.length?e(n[0].rawValue):r(t.NO_QR_CODE_FOUND)})).catch((function(e){return r("Scanner error: "+(e.message||e))})).finally((function(){return clearTimeout(n)}))}))}));return n&&s&&(u=u.catch((function(){return t.scanImage(e,null,o,a,i)}))),u=u.finally((function(){c||t._postWorkerMessage(o,"close")}))}},{key:"createQrEngine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.WORKER_PATH;return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((function(t){return-1!==t.indexOf("qr_code")?new BarcodeDetector({formats:["qr_code"]}):new Worker(e)}))}},{key:"_drawToCanvas",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];r=r||document.createElement("canvas");var o=t&&t.x?t.x:0,a=t&&t.y?t.y:0,i=t&&t.width?t.width:e.width||e.videoWidth,s=t&&t.height?t.height:e.height||e.videoHeight;if(!n){var c=t&&t.downScaledWidth?t.downScaledWidth:i,u=t&&t.downScaledHeight?t.downScaledHeight:s;r.width!==c&&(r.width=c),r.height!==u&&(r.height=u)}var l=r.getContext("2d",{alpha:!1});return l.imageSmoothingEnabled=!1,l.drawImage(e,o,a,i,s,0,0,r.width,r.height),[r,l]}},{key:"_loadImage",value:function(e){if(e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||window.ImageBitmap&&e instanceof window.ImageBitmap||window.OffscreenCanvas&&e instanceof window.OffscreenCanvas)return Promise.resolve(e);if(e instanceof Image)return t._awaitImageLoad(e).then((function(){return e}));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){var r=new Image;return e instanceof File||e instanceof Blob?r.src=URL.createObjectURL(e):r.src=e,t._awaitImageLoad(r).then((function(){return(e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(r.src),r}))}return Promise.reject("Unsupported image type.")}},{key:"_awaitImageLoad",value:function(e){return new Promise((function(t,r){var n,o;e.complete&&0!==e.naturalWidth?t():(n=function(){e.removeEventListener("load",n),e.removeEventListener("error",o),t()},o=function(){e.removeEventListener("load",n),e.removeEventListener("error",o),r("Image load error")},e.addEventListener("load",n),e.addEventListener("error",o))}))}},{key:"_postWorkerMessage",value:function(e,t,r){return Promise.resolve(e).then((function(e){e instanceof Worker&&e.postMessage({type:t,data:r})}))}}]),t}();function SH(){return BH.apply(this,arguments)}function BH(){return(BH=nF(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return EH.WORKER_PATH=YM(),e.next=3,EH.createQrEngine(EH.WORKER_PATH);case 3:return t=e.sent,e.abrupt("return",{qrEngine:t});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _H(){return xH.apply(this,arguments)}function xH(){return(xH=nF(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([SH()]);case 2:return t=e.sent,r=lF(t,1),n=r[0].qrEngine,e.abrupt("return",{qrScannerResources:{engine:n,canvas:document.createElement("canvas")},noModel:!0});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}EH.DEFAULT_CANVAS_SIZE=400,EH.NO_QR_CODE_FOUND="No QR code found",EH.WORKER_PATH="qr-scanner-worker.min.js";var TH="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function AH(){return(AH=nF(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=nF(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="detect.prototxt",r="detect.caffemodel",n="sr.prototxt",i="sr.caffemodel",o){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return u=[a(t),a(r),a(n),a(i)],e.next=11,Promise.all(u);case 11:l=e.sent,d=lF(l,4),f=d[0],p=d[1],h=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",p,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",h,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),o=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?TH:r,a=function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(t));case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:return o=e.sent,e.abrupt("return",new Uint8Array(o));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,i();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",_H());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var IH=dH((function(){return AH.apply(this,arguments)}));function PH(e){return RH.apply(this,arguments)}function RH(){return(RH=nF(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,e.abrupt("return",new Promise((function(e,t){setTimeout(t,900),r.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NH(e){return OH.apply(this,arguments)}function OH(){return(OH=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,n=!0,e.prev=2,o=performance.now(),e.next=6,PH({idCardModel:r});case 6:(a=performance.now())-o+.6*(a-o)>900&&(n=!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n=!1;case 13:return e.abrupt("return",{fastEnough:n});case 14:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function DH(){return(DH=nF(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,a=t.tfScriptUrls,i=t.wechatQRModelsUrl,s=h.length>1?h[1]:void 0,e.next=4,CH({blazefaceModelUrl:o,tfScriptUrls:a});case 4:return c=e.sent,u=c.blazefaceModel,l=!0,d=new wH(s),e.prev=8,e.next=11,d.load({opencvUrl:r,modelUrl:n});case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(8),e.abrupt("return",{ableToUseModel:!1});case 16:return e.next=18,IH({modelUrl:i});case 18:return e.prev=18,e.next=21,NH({idCardModel:d});case 21:f=e.sent,p=f.fastEnough,l=p,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),l=!1;case 29:return e.abrupt("return",{ableToUseModel:l,idCardModel:d,blazefaceModel:u});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var LH=dH((function(){return DH.apply(this,arguments)})),MH=aI.Errors;function FH(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=dv.useRef(null);null===a.current&&(a.current=document.createElement("canvas"));var i=dv.useRef(!1),s=dv.useRef(FD.createResizer({width:960,height:640})),c=dv.useRef(null),u=dv.useRef([{id:null,frames:[]}]),l=dv.useCallback((function(){!0===i.current&&(i.current=!1)}),[]),d=dv.useCallback((function(){u.current=[{id:null,frames:[]}]}),[]),f=dv.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),p=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,n,a,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,a=u.current,i=n.resize({srcCanvas:r}),c=i.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var r,n,s,u,l,d,f,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:if(r=o.frameCaptureIntervalMs,n=void 0===r?180:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:s=c.current,u=t.current,i.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=a.current).width=f,m.height=h,g=m.getContext("2d");case 13:return v=performance.now(),g.drawImage(u,l,d,f,h,0,0,f,h),e.next=18,p({workingCanvas:m});case 18:if(v=Math.floor(performance.now()-v),i.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,YN.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return dv.useEffect((function(){var e=t.current;function o(){return(o=nF(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=CO.analyzeVideoAndWindowSizes(e,n),t.next=3,h();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return r&&n&&function(){o.apply(this,arguments)}(),function(){l()}}),[r,n,t,l,f,h]),{refWorkingCanvas:a,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var UH=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,a=e.settings,i=e.shouldStartTimers,s=e.sessionTime,c=dv.useRef(),u=lF(dv.useState(0),2),l=u[0],d=u[1],f=dv.useCallback((function(){clearInterval(c.current)}),[]),p=dv.useCallback((function(){d((function(e){return e+1}))}),[]);return dv.useEffect((function(){if(i){var e=a.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var a=s-(t+=1);a<=u&&r&&r({curTimeLeft:a}),t>0&&t%e==0&&o&&o(),0===a&&(f(),n&&n())}),1e3)}return function(){f()}}),[i,t,r,f,n,o,l,a,s]),{stopTimers:f,startTimers:p}};KM.initExifData();var jH,VH,zH,qH=aI.IDCardMessage,HH=dv.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,a=e.refVideo,i=e.frontSide,s=e.cardList,c=e.settings,u=e.onCaptureDone,l=e.onUISpacingChange,d=e.outputEncryptionSettings,f=lF(dv.useState({}),2),p=f[0],h=f[1],m=p.yDescription,g=p.yMessage,v=p.yCaptureButton,y=QN.useAsset("ic_camera.svg"),b=QN.useAsset("ic_loading.png"),w=lF(dv.useState(""),2),k=w[0],C=w[1],E=hN.useSDKSettings(),S=E.debug,B=E.lang,_=lF(dv.useState(null),2),x=_[0],T=_[1],A=lF(dv.useState(""),2),I=A[0],P=A[1],R=lF(dv.useState(null),2),N=R[0],O=R[1],D=hq(),L=D.showPopup,M=D.popupShown,F=D.popupType,U=dv.useCallback((function(e){P(null===e?"":Rj(e.msg[B])({side:i?cq.FRONT[B]:cq.BACK[B]}))}),[B,i]),j=dv.useCallback((function(){T(""),L({popupType:mq})}),[L]),V=dv.useCallback((function(){T(""),u.apply(void 0,arguments)}),[u]),z=dv.useCallback((function(e){var t=e.curTimeLeft;T(Rj(qH.REMAINING_TIME[B])({x:t}))}),[B]),q=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onModelErrorChange,i=e.frontSide,s=e.cardList,c=e.onDebugInfoChange,u=e.onAboutToTimeout,l=e.onSessionTimeout,d=e.onCaptureDone,f=e.outputEncryptionSettings,p=e.quality,h=dv.useRef(!1),m=lF(dv.useState(!1),2),g=m[0],v=m[1],y=dv.useRef((function(){})),b=KN.useSDKTracking().sendEvent,w=dv.useRef(),k=dv.useRef(),C=dv.useRef(),E=hN.useSDKSettings(),S=E.debug,B=E.lang,_=E.enableAntiDebug,x=XM(),T=x.startMotion,A=x.stopMotion,I=x.motionData,P=x.orientationData;dv.useEffect((function(){_&&BL.enableAntiDebug()}),[_]);var R=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b({tag:i?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,y.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[b,i]),N=dv.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(void 0,t);var n=Uq(t,"0.code");n&&n!==w.current&&(b({tag:i?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),w.current=n)}),[a,i,b]),O=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.cardList,i=e.onError,s=e.frontSide,c=e.onAutoCaptureSuccess,u=e.quality,l=dv.useRef(null);null===l.current&&(l.current=document.createElement("canvas"));var d=dv.useRef(0),f=dv.useRef([]),p=dv.useRef(null);null===p.current&&(p.current=document.createElement("canvas"));var h=dv.useRef({}),m=dv.useRef([]),g=dv.useRef(""),v=dv.useRef(!1),y=dv.useRef(null),b=lF(dv.useState(!1),2),w=b[0],k=b[1],C=dv.useRef({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),E=dv.useRef({imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}),S=dv.useRef(!1),B=dv.useRef(!1),_=dv.useRef(null),x=dv.useRef(!1),T=dv.useRef({}),A=hN.useSDKSettings(),I=A.customUrls,P=A.country;dv.useEffect((function(){var e=!1;function t(){return(t=nF(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||w){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,LH(I,P);case 4:return T.current=t.sent,t.next=7,SL.initTensorFlow();case 7:_.current=o.enableBlurCheck&&T.current.ableToUseModel,t.next=11;break;case 10:_.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:k(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[w,o,I,P]);var R=dv.useCallback((function(e){return eH({currentWorkingCanvas:e,refVirtualWorkingCanvas:p,refCountVirtualFrames:d,refVirtualFrames:f,refWorkingCanvas:l,refCardResult:h})}),[]),N=dv.useCallback((function(){!0===v.current&&(v.current=!1)}),[]),O=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,n,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,a=o.blurThreshold,i=C.current,s=E.current,!(r<a&&wO.hasBetterCardBlurScore(r,i.blurScore))){e.next=17;break}if(!x.current){e.next=9;break}i.imageBlob=s.imageBlob,e.next=13;break;case 9:return e.next=11,CO.takePicture({canvas:l.current,quality:u});case 11:i.imageBlob=e.sent,i.captureTime=Date.now();case 13:i.takenAt=(new Date).getTime(),i.blurScore=r,i.detectedCard=n,i.captureType="auto";case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,u]),D=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,B.current=!0,o=E.current,!wO.hasBetterCardBlurScore(r,o.blurScore)){e.next=14;break}return e.next=6,CO.takePicture({canvas:l.current,quality:u});case 6:o.imageBlob=e.sent,o.captureDuration+=Date.now()-o.captureTime,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,o.captureCount++,o.captureType="manual",x.current=!0;case 14:B.current=!1;case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u]),L=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.waitForBestImageTimeMs,r=o.enableVirtualCamHashes,null===(n=C.current).imageBlob){e.next=11;break}if(!((new Date).getTime()-n.takenAt>t)){e.next=11;break}if(!r){e.next=8;break}return e.next=8,R(l.current);case 8:return e.next=10,c(n);case 10:N();case 11:case"end":return e.stop()}}),e)}))),[c,o,N,R]),M=dv.useCallback((function(){S.current=!0}),[]),F=dv.useCallback((function(){return new Promise((function(e){S.current=!1;var t=setInterval((function(){B.current||(clearInterval(t),e())}),150)}))}),[]),U=dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t=o.blurThreshold,r=o.enableVirtualCamHashes,n=E.current;n.captureTime=Date.now(),_.current?(M(),setTimeout((function(){F().then(nF(regeneratorRuntime.mark((function o(){var a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(wO.hasBetterCardBlurScore(n.blurScore,t)||(n.error=MH.id_detector_error_blur),a=l.current,null!==n.imageBlob){o.next=6;break}CO.takePicture({canvas:a,quality:u}).then(function(){var t=nF(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),!r){t.next=5;break}return t.next=5,R(a);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.next=10;break;case 6:if(!r){o.next=9;break}return o.next=9,R(a);case 9:e(n);case 10:case"end":return o.stop()}}),o)}))))}),2e3)):CO.takePicture({canvas:l.current,quality:u}).then(function(){var t=nF(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),!r){t.next=5;break}return t.next=5,R(l.current);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),[o,M,F,u,R]),j=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var r,n,c,u,p,b,k,B,_,A,I,R,N,M,F,U,j,V,z,q,H;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&w&&!v.current){e.next=2;break}return e.abrupt("return");case 2:C.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},E.current={imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0},r=o.enableAutoCapture,n=o.enableBlurCheck,c=o.enableIdDetection,u=o.country,p=T.current,b=p.idCardModel,k=p.blazefaceModel,B=p.ableToUseModel,_=y.current,A=t.current,v.current=!0,I=_.cropX,R=_.cropY,N=_.cropWidth,M=_.cropHeight,F=_.cropWidthWithoutPadding,U=_.cropHeightWithoutPadding,(j=l.current).width=N,j.height=M,V=j.getContext("2d"),z=document.createElement("canvas"),q=z.getContext("2d"),H=function(){var e=nF(regeneratorRuntime.mark((function e(){var t,l,p,y,w,_,T,K;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(V.drawImage(A,I,R,N,M,0,0,N,M),t=performance.now(),x.current=!1,!c||!B){e.next=68;break}return l=null,e.next=7,b.predict(j,{detectThreshold:.3});case 7:if(p=e.sent,null==o||!o.trackCardCoordinates||E.current.imageBlob||C.current.imageBlob||Jq(m,Zq(p),null==o?void 0:o.trackCardCoordinatesMaxLength),!p.card){e.next=64;break}if(h.current=p.card,!E.current.imageBlob&&f.current.length>0&&(f.current=[],d.current=0),!Wq({corners:p.card.corners,width:N,height:M})){e.next=61;break}if(!Xq(p.card.corners)){e.next=58;break}if(y=Hq(j,p.card.corners),w=IO.rectAreaRatio({small:{area:y.width*y.height},big:{area:F*U}}),!Uq(o,"enableCardTypeCheck")||"vn"!==u){e.next=25;break}_=Uq(p,"card.label",""),g.current=_,tH(_,a)||(l=MH.not_allowed_card_types),e.next=56;break;case 25:if(!(w<.5)){e.next=29;break}l=MH.id_detector_card_too_small,e.next=56;break;case 29:if(!(w>.95)){e.next=33;break}l=MH.id_detector_error_incomplete,e.next=56;break;case 33:return z.width=y.width,z.height=y.height,q.putImageData(y,0,0),e.next=38,Gq({canvas:z});case 38:if(!e.sent){e.next=43;break}l=MH.glare_detected,e.next=56;break;case 43:if("ph"===P){e.next=47;break}return e.next=46,Yq({blazefaceModel:k,predictedIdCardCanvas:z,frontSide:s});case 46:l=e.sent;case 47:if(l){e.next=56;break}if(!n){e.next=56;break}if(T=wO.calculateIdCardBlurScore({canvas:z}),!S.current){e.next=53;break}return e.next=53,D({blurScore:T,detectedCard:p.card});case 53:if(!r){e.next=56;break}return e.next=56,O({blurScore:T,detectedCard:p.card});case 56:e.next=59;break;case 58:l=MH.id_detector_validate_angle_error;case 59:e.next=62;break;case 61:l=MH.id_detector_error_incomplete;case 62:e.next=65;break;case 64:l=MH.id_detector_no_cards;case 65:return i(l),e.next=68,L();case 68:return t=Math.floor(performance.now()-t),K=180-t>0?180-t:0,e.next=72,new Promise((function(e){return setTimeout(e,K)}));case 72:v.current&&window.requestAnimationFrame(H);case 73:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(H);case 19:case"end":return e.stop()}}),e)}))),[o,w,t,i,L,s,a,D,O,P]);dv.useEffect((function(){var e=t.current;function o(){return(o=nF(regeneratorRuntime.mark((function t(){var r,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(y.current=CO.analyzeVideoAndWindowSizes(e,n,.05),r=y.current,o=r.cropWidth,a=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(a)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,j();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&w&&function(){o.apply(this,arguments)}()}),[r,n,t,N,j,w]);var V=dv.useCallback((function(){N()}),[N]);return dv.useEffect((function(){return V}),[V]),{refWorkingCanvas:l,refCardLabel:g,stopCheckFrame:N,checkFrame:j,warmupDone:w,takePictureManually:U,refAbleToRunBurstMode:_,refVirtualFrames:f,refCardCoordinates:m}}({refVideo:r,shouldStart:t,cropArea:n,cardList:s,settings:o,onError:N,frontSide:i,onAutoCaptureSuccess:R,quality:p}),D=O.refWorkingCanvas,L=O.refCardLabel,M=O.stopCheckFrame,F=O.checkFrame,U=O.warmupDone,j=O.takePictureManually,V=O.refAbleToRunBurstMode,z=O.refVirtualFrames,q=O.refCardCoordinates,H=FH({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),K=H.stopCheckFrame,W=H.splitVideos,G=H.resetRecordedVideos,Q=H.checkFrame;!function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,a=e.onChange;dv.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,i=n.current,s=t[t.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==i?void 0:i.width,"canvas.height":null==i?void 0:i.height};a&&a(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[a,t,r,n,o])}({debug:S,refRecordedVideos:H.refRecordedVideos,refWorkingCanvas:D,refVideo:r,onChange:c});var X=dv.useCallback((function(){K(),M(),G(),l()}),[G,K,M,l]),Y=dv.useCallback((function(){W()}),[W]),$=UH({lang:B,onAboutToTimeout:u,onSessionTimeout:X,onVideoTimeLimitReached:Y,settings:o,shouldStartTimers:U&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),Z=$.stopTimers,J=$.startTimers,ee=dv.useCallback((function(){h.current=!1}),[]),te=dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee(),J(),e.next=4,Promise.all([Q(),F()]);case 4:case"end":return e.stop()}}),e)}))),[ee,J,Q,F]),re=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var t,r,n,a,s,c,u,l,p,m,g,y,w,E,S,B,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_.length>0&&void 0!==_[0]?_[0]:{},r=t.imageBlob,n=t.error,a=t.detectedCard,s=t.captureTime,c=t.captureCount,u=t.captureDuration,l=t.captureType,!h.current){e.next=3;break}return e.abrupt("return");case 3:return h.current=!0,v(!0),K(),M(),Z(),N(null),p=null==o?void 0:o.enableVirtualCamHashes,m={},p&&(g=z).current.length>0&&(m=g.current.reduce((function(e,t,r){return sF(sF({},e),{},oF({},"hash".concat(r+1),t))}),m)),y=null==o?void 0:o.trackCardCoordinates,w="[".concat(q.current.toString(),"]"),A(),KM.preWriteExif({mode:KM.MODE.ID_CARD,motionData:I,orientationData:P,startTime:k.current,endTime:Date.now()}),e.next=18,KM.writeExif({mode:KM.MODE.ID_CARD,imageData:sF(sF({detectedCard:a,captureTime:s,blob:r},p?{vCam:m}:{}),{},{captureCount:c,captureDuration:u,captureType:l},y?{cardTracking:w}:{}),enableExifData:null==o?void 0:o.enableExifData});case 18:if(E=e.sent,!f||!f.key){e.next=24;break}return B=f.key,e.next=23,TL.encrypt({blob:E,key:B});case 23:S=e.sent;case 24:d({image:{blob:E,encrypted:S,detectedCard:a},error:n,recordedVideos:[]}),v(!1),b({tag:i?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-C.current)/1e3}});case 27:case"end":return e.stop()}}),e)}))),[K,M,Z,N,d,i,b,f,I,P,A,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,null==o?void 0:o.trackCardCoordinates,z,q]);y.current=re;var ne=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),Z(),K(),V.current||M(),e.next=6,j();case 6:return t=e.sent,e.next=9,re(t);case 9:v(!1),b({tag:i?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[j,re,Z,V,K,M,b,i]);return dv.useEffect((function(){t&&(b({tag:i?"id_front":"id_back",event:"user_activity.start",log:{}}),k.current=Date.now(),T())}),[b,i,t,T]),dv.useEffect((function(){U&&(b({tag:i?"id_front":"id_back",event:"user_activity.show",log:{}}),b({tag:i?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-k.current}}),C.current=performance.now())}),[b,i,U]),{refCardLabel:L,warmupDone:U,isProcessing:g,takePictureManually:ne,restartSession:te,resetIsProcessingImageBlobTaken:ee}}({shouldStart:!0,refVideo:a,cropArea:N,settings:c,onModelErrorChange:U,frontSide:i,cardList:s,onDebugInfoChange:C,onSessionTimeout:j,onCaptureDone:V,onAboutToTimeout:z,outputEncryptionSettings:d}),H=q.refCardLabel,K=q.warmupDone,W=q.isProcessing,G=q.takePictureManually,Q=q.restartSession,X=q.resetIsProcessingImageBlobTaken,Y=dv.useCallback((function(){L({popupType:null}),X()}),[L,X]),$=dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Y(),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q,Y]);dv.useEffect((function(){if(o){var e,t,r,a,i,s,c,u=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,p=o.lostY,m=o.clientHeight;n?(i=.7*(s=d-165),r=(c=(e=p+10)+45)+20,a=(t=c+s+10)+60):(i=OF.isMobile?u-6:Math.floor(.7*u),r=(c=(e=p+10)+50)+20,a=(t=c+(s=Math.floor(Math.min(i/1.5,m-2*p-80-100)))+10)+60);var g=Math.floor((u-i)/2)+f;O({x:g,y:c,width:i,height:s,surroundStyle:{opacity:.6,background:"#000"}});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:a};h(v),l(v)}}),[o,n,l]);var Z=dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(""),e.next=3,G();case 3:case"end":return e.stop()}}),e)}))),[G]);return dv.useImperativeHandle(t,(function(){return{restartSession:$}}),[$]),dv.createElement(dv.Fragment,null,!K&&dv.createElement(oq,null),S&&dv.createElement($z,null,k),W&&dv.createElement(Wz,null,dv.createElement("img",{src:b,alt:"",className:"spin"})),N&&dv.createElement(Fj,{x:"".concat(N.x,"px"),y:"".concat(N.y,"px"),width:"".concat(N.width,"px"),height:"".concat(N.height,"px"),surroundStyle:N.surroundStyle},dv.createElement(tq,{width:N.width,height:N.height,type:I?"error":pz})),!I&&dv.createElement(Zz,{y:"".concat(m,"px"),className:"description"},r),dv.createElement("div",{style:{position:"fixed",bottom:0,left:0,color:"#fff",padding:30}},H.current),I&&dv.createElement(Jz,{y:"".concat(m,"px")},I),!W&&(!(null!=c&&c.disableCaptureButtonIfAlert)||!I)&&dv.createElement(Kz,{onClick:Z,y:"".concat(v,"px")},dv.createElement("img",{src:y,alt:""})),x&&dv.createElement(eq,{key:x,className:"message",y:"".concat(g,"px")},x),dv.createElement(fz,{open:M},F===mq&&dv.createElement(pq,{onOk:$,maxSessionTime:null==c?void 0:c.idCardSessionTime})))}));HH.propTypes={usePortraitMask:Lv.bool,description:Lv.string,windowAndVideoInfo:Lv.shape({}),refVideo:Lv.shape({}),frontSide:Lv.bool,cardList:Lv.bool,settings:Lv.shape({}),onCaptureDone:Lv.func,onUISpacingChange:Lv.func,outputEncryptionSettings:Lv.shape({})},HH.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,cardList:[],settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var KH,WH,GH=aw.div(jH||(jH=uF(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: 8px;\n top: ",";\n position: absolute;\n z-index: ",";\n color: #fff;\n padding: 10px;\n margin: 0 10px;\n max-width: 275px;\n text-align: center;\n"])),(function(e){return e.background}),(function(e){return e.y}),1020),QH=aw.div(VH||(VH=uF(["\n width: 0;\n height: 0;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n border-bottom: ",";\n position: absolute;\n left: 50%;\n top: ",";\n transform: translateX(-50%);\n"])),(function(e){return"".concat(e.arrowSize,"px solid ").concat(e.color)}),(function(e){return"".concat(e.top,"px")})),XH=function(e){var t=e.children,r=e.y;return dv.createElement(GH,{y:r,background:"#00ce78"},dv.createElement(QH,{arrowSize:10,top:-10,color:"#00ce78"}),t)},YH=aw.div(zH||(zH=uF(["\n text-align: center;\n position: absolute;\n font-size: 18px;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),$H={QR_INSTRUCTIONS_TEXT:{en:dv.createElement("span",null,"Please follow the instructions below to scan QR code:",dv.createElement("br",null),dv.createElement("br",null)," Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),vi:dv.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên CCCD. Canh vừa mã QR vào 4 góc khung hình để quét mã")},QR_INSTRUCTIONS_START_BUTTON:{en:"Scan QR code",vi:"Tiến hành quét mã QR"},QR_INSTRUCTIONS_COUNTDOWN:{en:"Start in <%= x %> s",vi:"Bắt đầu trong <%= x %> giây"},QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR"},REMAINING_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"},SESSION_TIMEOUT_POPUP_DESCRIPTION:{en:dv.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",dv.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn."),vi:dv.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",dv.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn.")},SESSION_TIMEOUT_POPUP_RETRY_BUTTON:{en:"Retry",vi:"Thực hiện lại"},SESSION_TIMEOUT_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"}},ZH=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,a=e.mr,i=e.mx,s=e.my,c=e.pt,u=e.pb,l=e.pl,d=e.pr,f=e.px,p=e.py,h=t.props.style||{},m={};return null!==i&&(m.marginLeft=i,m.marginRight=i),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==a&&(m.marginRight=a),null!==f&&(m.paddingLeft=f,m.paddingRight=f),null!==p&&(m.paddingTop=p,m.paddingBottom=p),null!==c&&(m.paddingTop=c),null!==u&&(m.paddingBottom=u),null!==l&&(m.paddingLeft=l),null!==d&&(m.paddingRight=d),dv.cloneElement(t,{style:sF(sF({},h),m)})};ZH.propTypes={mt:Lv.string,ml:Lv.string,mr:Lv.string,mb:Lv.string,mx:Lv.string,my:Lv.string,pt:Lv.string,pl:Lv.string,pr:Lv.string,pb:Lv.string,px:Lv.string,py:Lv.string},ZH.defaultProps={mt:null,ml:null,mr:null,mb:null,mx:null,my:null,pt:null,pl:null,pr:null,pb:null,px:null,py:null};var JH,eK,tK,rK=aw.button(KH||(KH=uF(["\n width: 100%;\n max-width: 294px;\n height: 66px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 3px;\n color: #fff;\n font-weight: normal;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),nK=aw.a(WH||(WH=uF(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),oK=aw.div(JH||(JH=uF(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),aK=aw.div(eK||(eK=uF(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),iK=aw.div(tK||(tK=uF(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),sK=function(e){var t=e.onRetry,r=e.onSkip,n=hN.useSDKSettings().lang;return dv.createElement(oK,null,dv.createElement(ZH,{mt:"25px"},dv.createElement(aK,null,$H.QR_INVALID_POPUP_TITLE[n])),dv.createElement(ZH,{mt:"30px"},dv.createElement(iK,null,$H.QR_INVALID_POPUP_DESCRIPTION[n])),dv.createElement(ZH,{mt:"30px"},dv.createElement(rK,{onClick:t},$H.QR_INVALID_POPUP_RETRY_BUTTON[n])),dv.createElement(ZH,{my:"20px"},dv.createElement(nK,{onClick:r},$H.QR_INVALID_POPUP_SKIP_BUTTON[n])))};sK.propTypes={onRetry:Lv.func,onSkip:Lv.func},sK.defaultProps={onRetry:function(){},onSkip:function(){}};var cK,uK,lK,dK,fK,pK,hK,mK=["children","ratio","padding"],gK=aw.div(cK||(cK=uF(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),vK=aw.div(uK||(uK=uF(["\n position: absolute;\n top: ",";\n left: ",";\n right: ",";\n bottom: ",";\n"])),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding})),yK=function(e){var t=e.children,r=e.ratio,n=e.padding,o=cF(e,mK);return dv.createElement(gK,aF({ratio:r},o),dv.createElement(vK,{padding:n},t))};yK.propTypes={children:Lv.node,ratio:Lv.number,padding:Lv.string},yK.defaultProps={children:null,ratio:4/3,padding:"0"};var bK=aw.div(lK||(lK=uF(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),wK=aw.div(dK||(dK=uF(["\n background: #e7e6e6;\n width: 100%;\n"]))),kK=aw.img(fK||(fK=uF(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),CK=aw.div(pK||(pK=uF(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n line-height: 20px;\n"])),(function(e){return e.theme.tsSecondary})),EK=aw(CK)(hK||(hK=uF(["\n white-space: nowrap;\n"]))),SK=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=hN.useSDKSettings().lang,a=QN.useAsset("qr_code_banner.png"),i=dv.useRef(n),s=lF(dv.useState((function(){return Rj($H.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),c=s[0],u=s[1],l=KN.useSDKTracking().sendEvent,d=dv.useRef(!1);return dv.useEffect((function(){l({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[l]),dv.useEffect((function(){var e=Rj($H.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){i.current--,u(e({x:i.current})),i.current<=0&&(clearInterval(t),d.current||l({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),r&&r())}),1e3);return function(){clearInterval(t)}}),[o,r]),dv.createElement(bK,null,dv.createElement(wK,null,dv.createElement(yK,{ratio:1.6},dv.createElement(kK,{src:a}))),dv.createElement(ZH,{mt:"30px"},dv.createElement(CK,null,$H.QR_INSTRUCTIONS_TEXT[o])),dv.createElement(ZH,{mt:"30px"},dv.createElement(rK,{onClick:function(){l({tag:"id_qr",event:"user_activity.click_start",log:{}}),d.current=!0,t()}},$H.QR_INSTRUCTIONS_START_BUTTON[o])),dv.createElement(ZH,{my:"20px"},dv.createElement(EK,null,c)))};SK.propTypes={onClickStart:Lv.func,onTimeout:Lv.func,timeout:Lv.number},SK.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var BK=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function _K(e){var t=e.canvas,r=e.qrModel,n=window.cv,o=n.imread(t,n.IMREAD_GRAYSCALE);return r.detectAndDecode(o).get(0)}var xK=function(){var e=nF(regeneratorRuntime.mark((function e(t,r){var n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,IH();case 2:if(n=e.sent,o=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return a=document.createElement("canvas"),i=a.getContext("2d"),e.next=11,new Promise((function(e){var r=URL.createObjectURL(t),n=new Image;n.onload=function(){var t=n.width,o=n.height;a.width=t/2,a.height=o/2,i.drawImage(n,t/2,0,a.width,a.height,0,0,a.width,a.height),URL.revokeObjectURL(r),e()},n.src=r}));case 11:return e.next=13,_K({canvas:a,qrModel:o});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,KM.writeExif({mode:"",imageData:{blob:t,result:s,type:"qr_from_front_image"},enableExifData:!0});case 18:if(c=e.sent,!r||!r.key){e.next=24;break}return l=r.key,e.next=23,TL.encrypt({imageBlobWithExif:c,key:l});case 23:u=e.sent;case 24:return e.abrupt("return",{result:s,validateResult:{valid:!0},image:{blob:c,encrypted:u},recordedVideos:[]});case 25:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),TK=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(RF((function(e,t){var r;r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height||!this.data[t*this.width+e])},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,o){for(var a=t;a<t+n;a++)for(var i=e;i<e+r;i++)this.set(i,a,!!o)},e}();t.BitMatrix=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.addOrSubtractGF=function(e,t){return e^t};var o=function(){function e(e,t,r){this.primitive=e,this.size=t,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var o=1,a=0;a<this.size;a++)this.expTable[a]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,t){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===t)return this.zero;var r=new Uint8ClampedArray(e+1);return r[0]=t,new n.default(this,r)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=function(){function e(e,t){if(0===t.length)throw new Error("No coefficients.");this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;if(n===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-n);for(var o=0;o<this.coefficients.length;o++)this.coefficients[o]=t[n+o]}}else this.coefficients=t}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(t){var r;if(this.isZero())return t;if(t.isZero())return this;var o=this.coefficients,a=t.coefficients;o.length>a.length&&(o=(r=[a,o])[0],a=r[1]);for(var i=new Uint8ClampedArray(a.length),s=a.length-o.length,c=0;c<s;c++)i[c]=a[c];for(c=s;c<a.length;c++)i[c]=n.addOrSubtractGF(o[c-s],a[c]);return new e(this.field,i)},e.prototype.multiply=function(t){if(0===t)return this.field.zero;if(1===t)return this;for(var r=this.coefficients.length,n=new Uint8ClampedArray(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,n)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var r=this.coefficients,o=r.length,a=t.coefficients,i=a.length,s=new Uint8ClampedArray(o+i-1),c=0;c<o;c++)for(var u=r[c],l=0;l<i;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,a[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new Error("Invalid degree less than 0");if(0===r)return this.field.zero;for(var n=this.coefficients.length,o=new Uint8ClampedArray(n+t),a=0;a<n;a++)o[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,o)},e.prototype.evaluateAt=function(e){var t=0;if(0===e)return this.getCoefficient(0);var r=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){t=n.addOrSubtractGF(t,e)})),t;t=this.coefficients[0];for(var o=1;o<r;o++)t=n.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[o]);return t},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(5),a=r(11),i=r(12);function s(e){var t=i.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=a.extract(e,s),u=o.decode(c.matrix);if(u)return{binaryData:u.bytes,data:u.text,chunks:u.chunks,version:u.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:"attemptBoth"};function u(e,t,r,o){void 0===o&&(o={});var a=c;Object.keys(a||{}).forEach((function(e){a[e]=o[e]||a[e]}));var i="attemptBoth"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,u="onlyInvert"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,l=n.binarize(e,t,r,i),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==a.inversionAttempts&&"invertFirst"!==a.inversionAttempts||(p=s(u?d:f)),p}u.default=u,t.default=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r){return e<t?t:e>r?r:e}var a=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,i){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new a(t,r),c=0;c<t;c++)for(var u=0;u<r;u++){var l=e[4*(u*t+c)+0],d=e[4*(u*t+c)+1],f=e[4*(u*t+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(t/8),h=Math.ceil(r/8),m=new a(p,h),g=0;g<h;g++)for(var v=0;v<p;v++){var y=0,b=1/0,w=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var k=s.get(8*v+c,8*g+u);y+=k,b=Math.min(b,k),w=Math.max(w,k)}var C=y/Math.pow(8,2);if(w-b<=24&&(C=b/2,g>0&&v>0)){var E=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<E&&(C=E)}m.set(v,g,C)}var S=n.BitMatrix.createEmpty(t,r),B=null;for(i&&(B=n.BitMatrix.createEmpty(t,r)),g=0;g<h;g++)for(v=0;v<p;v++){for(var _=o(v,2,p-3),x=o(g,2,h-3),T=(y=0,-2);T<=2;T++)for(var A=-2;A<=2;A++)y+=m.get(_+T,x+A);var I=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var P=s.get(c,u);S.set(c,u,P<=I),i&&B.set(c,u,!(P<=I))}}return i?{binarized:S,inverted:B}:{binarized:S}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),a=r(9),i=r(10);function s(e,t){for(var r=e^t,n=0;r;)n++,r&=r-1;return n}function c(e,t){return t<<1|e}var u=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],l=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e,t,r){for(var o=l[r.dataMask],a=e.height,i=function(e){var t=17+4*e.versionNumber,r=n.BitMatrix.createEmpty(t,t);r.setRegion(0,0,9,9,!0),r.setRegion(t-8,0,8,9,!0),r.setRegion(0,t-8,9,8,!0);for(var o=0,a=e.alignmentPatternCenters;o<a.length;o++)for(var i=a[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===i&&6===u||6===i&&u===t-7||i===t-7&&6===u||r.setRegion(i-2,u-2,5,5,!0)}return r.setRegion(6,9,1,t-17,!0),r.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),s=[],u=0,d=0,f=!0,p=a-1;p>0;p-=2){6===p&&p--;for(var h=0;h<a;h++)for(var m=f?a-1-h:h,g=0;g<2;g++){var v=p-g;if(!i.get(v,m)){d++;var y=e.get(v,m);o({y:m,x:v})&&(y=!y),u=c(y,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var t=function(e){var t=e.height,r=Math.floor((t-17)/4);if(r<=6)return i.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var a=t-9;a>=t-11;a--)n=c(e.get(a,o),n);var u=0;for(a=5;a>=0;a--)for(o=t-9;o>=t-11;o--)u=c(e.get(a,o),u);for(var l,d=1/0,f=0,p=i.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var m=s(n,h.infoBits);m<d&&(l=h,d=m),(m=s(u,h.infoBits))<d&&(l=h,d=m)}return d<=3?l:void 0}(e);if(!t)return null;var r=function(e){for(var t=0,r=0;r<=8;r++)6!==r&&(t=c(e.get(r,8),t));for(var n=7;n>=0;n--)6!==n&&(t=c(e.get(8,n),t));var o=e.height,a=0;for(n=o-1;n>=o-7;n--)a=c(e.get(8,n),a);for(r=o-8;r<o;r++)a=c(e.get(r,8),a);for(var i=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,m=p.formatInfo;if(h===t||h===a)return m;var g=s(t,h);g<i&&(l=m,i=g),t!==a&&(g=s(a,h))<i&&(l=m,i=g)}return i<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],a=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),a+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<a)return null;e=e.slice(0,a);for(var i=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<i;s++)for(var c=0,u=o;c<u.length;c++)u[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var l=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)o[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=o;f<p.length;f++)p[f].codewords.push(e.shift());return o}(d(e,t,r),t,r.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,t){return e+t.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,m=n;h<m.length;h++){var g=m[h],v=a.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[p++]=v[y]}try{return o.decode(f,t.versionNumber)}catch(e){return null}}t.decode=function(e){if(null==e)return null;var t=f(e);if(t)return t;for(var r=0;r<e.width;r++)for(var n=r+1;n<e.height;n++)e.get(r,n)!==e.get(n,r)&&(e.set(r,n,!e.get(r,n)),e.set(n,r,!e.get(n,r)));return f(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o,a=r(7),i=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],a=e.readBits(o);a>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var i=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+i,48+s,48+c),n+=i.toString()+s.toString()+c.toString(),a-=3}if(2===a){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");i=Math.floor(u/10),s=u%10,r.push(48+i,48+s),n+=i.toString()+s.toString()}else if(1===a){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+u),n+=u.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(o||(o={}));var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(e,t){for(var r=[],n="",o=[9,11,13][t],a=e.readBits(o);a>=2;){var i=e.readBits(11),s=Math.floor(i/45),u=i%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],a-=2}return 1===a&&(s=e.readBits(6),r.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:r,text:n}}function l(e,t){for(var r=[],n="",o=[8,16,16][t],a=e.readBits(o),i=0;i<a;i++){var s=e.readBits(8);r.push(s)}try{n+=decodeURIComponent(r.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:r,text:n}}function d(e,t){for(var r=[],n="",o=[8,10,12][t],a=e.readBits(o),s=0;s<a;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,r.push(u>>8,255&u),n+=String.fromCharCode(i.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,i,c,f,p=new a.BitStream(e),h=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};p.available()>=4;){var g=p.readBits(4);if(g===o.Terminator)return m;if(g===o.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===o.Numeric){var v=s(p,h);m.text+=v.text,(r=m.bytes).push.apply(r,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===o.Alphanumeric){var y=u(p,h);m.text+=y.text,(i=m.bytes).push.apply(i,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===o.Byte){var b=l(p,h);m.text+=b.text,(c=m.bytes).push.apply(c,b.bytes),m.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(g===o.Kanji){var w=d(p,h);m.text+=w.text,(f=m.bytes).push.apply(f,w.bytes),m.chunks.push({type:n.Kanji,bytes:w.bytes,text:w.text})}}if(0===p.available()||0===p.readBits(p.available()))return m}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e<r?e:r,o=255>>8-n<<(a=r-n);t=(this.bytes[this.byteOffset]&o)>>a,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var a;e>0&&(o=255>>(a=8-e)<<a,t=t<<e|(this.bytes[this.byteOffset]&o)>>a,this.bitOffset+=e)}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var a=new n.default(285,256,0),i=new o.default(a,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=i.evaluateAt(a.exp(u+a.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(a,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var a=t,i=r,s=e.zero,c=e.one;i.degree()>=n/2;){var u=a,l=s;if(s=c,(a=i).isZero())return null;i=u;for(var d=e.zero,f=a.getCoefficient(a.degree()),p=e.inverse(f);i.degree()>=a.degree()&&!i.isZero();){var h=i.degree()-a.degree(),m=e.multiply(i.getCoefficient(i.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),i=i.addOrSubtract(a.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),i.degree()>=a.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),i.multiply(v)]}(a,a.buildMonomial(t,1),d,t);if(null===f)return null;var p=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),o=0,a=1;a<e.size&&o<r;a++)0===t.evaluateAt(a)&&(n[o]=e.inverse(a),o++);return o!==r?null:n}(a,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,a=new Array(o),i=0;i<o;i++){for(var s=e.inverse(r[i]),c=1,u=0;u<o;u++)i!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));a[i]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(a[i]=e.multiply(a[i],s))}return a}(a,f[1],p),m=0;m<p.length;m++){var g=r.length-1-a.log(p[m]);if(g<0)return null;r[g]=n.addOrSubtractGF(r[g],h[m])}return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r,n){var o=e.x-t.x+r.x-n.x,a=e.y-t.y+r.y-n.y;if(0===o&&0===a)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:r.x-t.x,a22:r.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var i=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=i*u-s*c,d=(o*u-s*a)/l,f=(i*a-o*c)/l;return{a11:t.x-e.x+d*t.x,a12:t.y-e.y+d*t.y,a13:d,a21:n.x-e.x+f*n.x,a22:n.y-e.y+f*n.y,a23:f,a31:e.x,a32:e.y,a33:1}}t.extract=function(e,t){for(var r=function(e,t,r,n){var a=o({x:3.5,y:3.5},t,r,n);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}(0,{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),a=function(e,t){return{a11:e.a11*t.a11+e.a21*t.a12+e.a31*t.a13,a12:e.a12*t.a11+e.a22*t.a12+e.a32*t.a13,a13:e.a13*t.a11+e.a23*t.a12+e.a33*t.a13,a21:e.a11*t.a21+e.a21*t.a22+e.a31*t.a23,a22:e.a12*t.a21+e.a22*t.a22+e.a32*t.a23,a23:e.a13*t.a21+e.a23*t.a22+e.a33*t.a23,a31:e.a11*t.a31+e.a21*t.a32+e.a31*t.a33,a32:e.a12*t.a31+e.a22*t.a32+e.a32*t.a33,a33:e.a13*t.a31+e.a23*t.a32+e.a33*t.a33}}(o(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft),r),i=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=a.a13*e+a.a23*t+a.a33;return{x:(a.a11*e+a.a21*t+a.a31)/r,y:(a.a12*e+a.a22*t+a.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);i.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:i,mappingFunction:s}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function o(e){return e.reduce((function(e,t){return e+t}))}function a(e,t,r,o){var a,i,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(t.y-e.y)>Math.abs(t.x-e.x);l?(a=Math.floor(e.y),i=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(a=Math.floor(e.x),i=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-a),f=Math.abs(c-i),p=Math.floor(-d/2),h=a<s?1:-1,m=i<c?1:-1,g=!0,v=a,y=i;v!==s+h;v+=h){var b=l?y:v,w=l?v:y;if(r.get(b,w)!==g&&(g=!g,u.push({x:b,y:w}),u.length===o+1))break;if((p+=f)>0){if(y===c)break;y+=m,p-=d}}for(var k=[],C=0;C<o;C++)u[C]&&u[C+1]?k.push(n(u[C],u[C+1])):k.push(0);return k}function i(e,t,r,n){var o,i=t.y-e.y,s=t.x-e.x,c=a(e,t,r,Math.ceil(n/2)),u=a(e,{x:e.x-s,y:e.y-i},r,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(o=u.concat(l)).concat.apply(o,c)}function s(e,t){var r=o(e)/o(t),n=0;return t.forEach((function(t,o){n+=Math.pow(e[o]-t*r,2)})),{averageSize:r,error:n}}function c(e,t,r){try{var n=i(e,{x:-1,y:e.y},r,t.length),o=i(e,{x:e.x,y:-1},r,t.length),a=i(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=i(e,{x:Math.min(r.width,e.x+e.y)+1,y:Math.min(r.height,e.y+e.x)+1},r,t.length),u=s(n,t),l=s(o,t),d=s(a,t),f=s(c,t),p=Math.sqrt(u.error*u.error+l.error*l.error+d.error*d.error+f.error*f.error),h=(u.averageSize+l.averageSize+d.averageSize+f.averageSize)/4;return p+(Math.pow(u.averageSize-h,2)+Math.pow(l.averageSize-h,2)+Math.pow(d.averageSize-h,2)+Math.pow(f.averageSize-h,2))/h}catch(e){return 1/0}}function u(e,t){for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r--;for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n++;for(var o=(r+n)/2,a=Math.round(t.y);e.get(Math.round(o),a);)a--;for(var i=Math.round(t.y);e.get(Math.round(o),i);)i++;return{x:o,y:(a+i)/2}}function l(e,t,r,a,s){var u,l,d;try{u=function(e,t,r,a){var s=(o(i(e,r,a,5))/7+o(i(e,t,a,5))/7+o(i(r,e,a,5))/7+o(i(t,e,a,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,t)/s),u=Math.round(n(e,r)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(a,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-a.x+s.x,p=r.y-a.y+s.y,h=(n(a,s)+n(a,r))/2/d,m=1-3/h,g={x:a.x+m*(f-a.x),y:a.y+m*(p-a.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,a=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(a)))return o([t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1]),{x:r,y:a,score:c({x:Math.floor(r),y:Math.floor(a)},[1,1,1],e)+n({x:r,y:a},g)}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));return{alignmentPattern:h>=15&&v.length?v[0]:g,dimension:l}}t.locate=function(e){for(var t=[],r=[],a=[],i=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var a=e.get(t,n);if(a===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=a;var l=o(u)/7,d=Math.abs(u[0]-l)<l&&Math.abs(u[1]-l)<l&&Math.abs(u[2]-3*l)<3*l&&Math.abs(u[3]-l)<l&&Math.abs(u[4]-l)<l&&!a,f=o(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&a;if(d){var h=t-u[3]-u[4],m=h-u[2],g={startX:m,endX:h,y:n};(v=r.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||h>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&h>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:r.push({top:g,bottom:g})}if(p){var v,y=t-u[4],b=y-u[3];g={startX:b,y:n,endX:y},(v=i.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||y>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&y>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:i.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)l(d);t.push.apply(t,r.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),r=r.filter((function(e){return e.bottom.y===n})),a.push.apply(a,i.filter((function(e){return e.bottom.y!==n}))),i=i.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);t.push.apply(t,r.filter((function(e){return e.bottom.y-e.top.y>=2}))),a.push.apply(a,i);var f=t.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],i=o(a)/a.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:i}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score})).map((function(e,t,r){if(t>4)return null;var n=r.filter((function(e,r){return t!==r})).map((function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}})).sort((function(e,t){return e.score-t.score}));if(n.length<2)return null;var o=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:o}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));if(0===f.length)return null;var p=function(e,t,r){var o,a,i,s,c,u,l,d=n(e,t),f=n(t,r),p=n(e,r);return f>=d&&f>=p?(c=(o=[t,e,r])[0],u=o[1],l=o[2]):p>=f&&p>=d?(c=(a=[e,t,r])[0],u=a[1],l=a[2]):(c=(i=[e,r,t])[0],u=i[1],l=i[2]),(l.x-u.x)*(c.y-u.y)-(l.y-u.y)*(c.x-u.x)<0&&(c=(s=[l,c])[0],l=s[1]),{bottomLeft:c,topLeft:u,topRight:l}}(f[0].points[0],f[0].points[1],f[0].points[2]),h=p.topRight,m=p.topLeft,g=p.bottomLeft,v=l(e,a,h,m,g),y=[];v&&y.push({alignmentPattern:{x:v.alignmentPattern.x,y:v.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:v.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),w=u(e,m),k=u(e,g),C=l(e,a,b,w,k);return C&&y.push({alignmentPattern:{x:C.alignmentPattern.x,y:C.alignmentPattern.y},bottomLeft:{x:k.x,y:k.y},topLeft:{x:w.x,y:w.y},topRight:{x:b.x,y:b.y},dimension:C.dimension}),0===y.length?null:y}}]).default},e.exports=r()})));function AK(e){return IK.apply(this,arguments)}function IK(){return(IK=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(a=n.getContext("2d"),o=a.getImageData(0,0,n.width,n.height)),!(i=TK(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",i.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function PK(e){return RK.apply(this,arguments)}function RK(){return(RK=nF(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.canvas,n=t.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),EH.scanImage(r,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var NK,OK,DK,LK,MK,FK,UK=function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,a=r,!n){e.next=6;break}return e.next=5,FD.blobToCanvas({blob:n});case 5:a=e.sent;case 6:return i=a.getContext("2d"),e.next=9,AK({imageData:i.getImageData(0,0,a.width,a.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,PK({canvas:a,qrScannerResources:o});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function jK(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,a=e.onCaptureDone,i=e.outputEncryptionSettings,s=lF(dv.useState(null),2),c=s[0],u=s[1],l=QN.useAsset("qr_capture_cursor.png"),d=lF(dv.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=hN.useSDKSettings().lang,v=KN.useSDKTracking().sendEvent,y=hq(),b=y.showPopup,w=y.popupShown,k=y.popupType,C=lF(dv.useState(!1),2),E=C[0],S=C[1],B=lF(dv.useState(null),2),_=B[0],x=B[1],T=QN.useAsset("ic_loading.png"),A=dv.useRef();dv.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),dv.useEffect((function(){b({popupType:gq})}),[b]),dv.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,a=OF.isMobile?Math.min(e-6,145):145,i=a,s=o+10,c=s+90,l=c+40,d=l+i+20,f=Math.floor((e-a)/2)+n;u({x:f,y:l,width:a,height:i,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var I=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onSessionTimeout,i=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=lF(dv.useState(!1),2),l=u[0],d=u[1],f=dv.useRef((function(){})),p=dv.useRef((function(){})),h=hN.useSDKSettings().lang,m=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.onResult,i=e.outputEncryptionSettings,s=dv.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=dv.useRef(!1),u=dv.useRef(null),l=lF(dv.useState(!1),2),d=l[0],f=l[1],p=dv.useRef({}),h=hN.useSDKSettings(),m=h.customUrls,g=h.qrSettings;dv.useEffect((function(){function e(){return(e=nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d){e.next=5;break}return e.next=3,IH({modelUrl:null==m?void 0:m.wechatQRModelsUrl});case 3:p.current=e.sent,f(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[d,m]);var v=dv.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),y=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var r,n,l,f,h,m,y,b,w,k,C,E,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d&&o&&!c.current){e.next=2;break}return e.abrupt("return");case 2:r=p.current,n=r.qrModel,l=r.qrScannerResources,f=r.noModel,h=u.current,m=t.current,c.current=!0,y=h.cropX,b=h.cropY,w=h.cropWidth,k=h.cropHeight,(C=s.current).width=w,C.height=k,E=C.getContext("2d"),S=function(){var e=nF(regeneratorRuntime.mark((function e(){var t,r,o,u,d,p,h,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E.drawImage(m,y,b,w,k,0,0,w,k),t=performance.now(),f){e.next=8;break}return e.next=5,_K({canvas:C,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,UK({canvas:C,qrScannerResources:l});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=27;break}return v(),_=r.match(BK),o={valid:Boolean(_)},e.next=17,CO.takePicture({canvas:s.current});case 17:return u=e.sent,e.next=20,KM.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:"boolean"!=typeof(null==g?void 0:g.enableExif)||(null==g?void 0:g.enableExif)});case 20:if(d=e.sent,!i||!i.key){e.next=26;break}return h=i.key,e.next=25,TL.encrypt({blob:d,key:h});case 25:p=e.sent;case 26:a({result:r,validateResult:o,image:{blob:d,encrypted:p}});case 27:return B=180-t>0?180-t:0,e.next=30,new Promise((function(e){return setTimeout(e,B)}));case 30:c.current&&window.requestAnimationFrame(S);case 31:case"end":return e.stop()}var _}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(S);case 13:case"end":return e.stop()}}),e)}))),[d,o,t,v,null==g?void 0:g.enableExif,i,a]),b=dv.useCallback((function(){v()}),[v]);return dv.useEffect((function(){var e=t.current;r||b(),d&&r&&n&&e&&e.videoWidth>0&&(u.current=CO.analyzeVideoAndWindowSizes(e,n,0),y())}),[r,n,t,v,y,d,b]),dv.useEffect((function(){return b}),[b]),{refWorkingCanvas:s,stopCheckFrame:v,checkFrame:y,warmupDone:d}}({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:dv.useCallback((function(){f.current.apply(f,arguments)}),[]),outputEncryptionSettings:c}),g=m.stopCheckFrame,v=m.checkFrame,y=m.warmupDone,b=FH({refVideo:r,shouldStart:t&&y,cropArea:n,settings:o}),w=b.stopCheckFrame,k=b.refRecordedVideos,C=b.splitVideos,E=b.resetRecordedVideos,S=b.checkFrame;f.current=dv.useCallback((function(e){d(!0),w(),g(),p.current(),i(sF(sF({},e),{},{recordedVideos:k.current})),d(!1)}),[w,i,k,g]);var B=dv.useCallback((function(){w(),g();var e=dF(k.current);a({recordedVideos:e}),E()}),[E,w,g,a,k]),_=dv.useCallback((function(){C()}),[C]),x=UH({lang:h,onAboutToTimeout:s,onSessionTimeout:B,onVideoTimeLimitReached:_,settings:o,shouldStartTimers:t&&y,sessionTime:null==o?void 0:o.scanQrLimitTimeSecond}),T=x.stopTimers,A=x.startTimers;return p.current=T,{isProcessing:l,restartSession:dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(),e.next=3,Promise.all([S(),v()]);case 3:case"end":return e.stop()}}),e)}))),[S,v,A]),refRecordedVideos:k,warmupDone:y}}({shouldStart:E,refVideo:n,cropArea:c,settings:o,onSessionTimeout:dv.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),a(e)}),[a,v]),onCaptureDone:dv.useCallback((function(e){var t=e.validateResult.valid;x("");var r=performance.now();t?(v({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-A.current)/1e3}}),a(e)):(b({popupType:"QR_INVALID"}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,a,v]),onAboutToTimeout:dv.useCallback((function(e){var t=e.curTimeLeft;x(Rj($H.REMAINING_TIME[g])({x:t}))}),[g]),outputEncryptionSettings:i}),P=I.isProcessing,R=I.restartSession,N=I.warmupDone,O=dv.useCallback((function(){b({popupType:null})}),[b]),D=dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(),A.current=performance.now(),v({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,R();case 5:case"end":return e.stop()}}),e)}))),[R,O,v]),L=dv.useCallback((function(){O(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),a()}),[O,a,v]),M=dv.useCallback((function(){O(),setTimeout((function(){S(!0)}),200)}),[O]);return dv.createElement(dv.Fragment,null,!N&&dv.createElement(oq,{contentStyle:{maxWidth:"300px"}}),c&&dv.createElement(Fj,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},dv.createElement("div",null,dv.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),dv.createElement(XH,{y:"".concat(h,"px")},$H.QR_TOOLTIP[g]),_&&dv.createElement(YH,{key:_,className:"message",y:"".concat(m,"px")},_),P&&dv.createElement(Wz,null,dv.createElement("img",{src:T,alt:"",className:"spin"})),dv.createElement(fz,{contentStyle:{maxWidth:"332px"},open:w},"QR_INVALID"===k&&dv.createElement(sK,{onRetry:D,onSkip:L}),k===gq&&dv.createElement(SK,{onClickStart:M,onTimeout:M})))}jK.propTypes={windowAndVideoInfo:Lv.shape({}),onUISpacingChange:Lv.func,refVideo:Lv.shape({}),settings:Lv.shape({}),onCaptureDone:Lv.func,outputEncryptionSettings:Lv.shape({})},jK.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var VK,zK,qK,HK,KK,WK="SUCCESS",GK=(oF(NK={},WK,"52,206,95"),oF(NK,"WARNING","255,148,50"),NK),QK=(oF(OK={},WK,"✓"),oF(OK,"WARNING","!"),OK),XK=aw.div(DK||(DK=uF(["\n font-weight: normal;\n"]))),YK=aw.div(LK||(LK=uF(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return Hb(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],GK[e.type],GK[e.type],GK[e.type])})),$K=aw.div(MK||(MK=uF(["\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n margin-right: 8px;\n font-weight: bold;\n"])),(function(e){return Hb(["rgb(",")"],GK[e.type])})),ZK=aw.div(FK||(FK=uF(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),JK=function(e){var t=e.children,r=e.type,n=e.className;return dv.createElement(XK,{className:n},dv.createElement(YK,{type:r}),dv.createElement(ZK,null,dv.createElement($K,{type:r},QK[r]),t),dv.createElement(YK,{type:r}))};JK.propTypes={children:Lv.node,type:Lv.string,className:Lv.string},JK.defaultProps={children:null,type:WK,className:""};var eW=aw.div(VK||(VK=uF(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),tW=aw.div(zK||(zK=uF(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),rW=aw.button(qK||(qK=uF(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),nW=aw.img(HK||(HK=uF(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),oW=aw.div(KK||(KK=uF(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),aW=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,a=e.hasValidQR,i=e.frontSide,s=lF(dv.useState(null),2),c=s[0],u=s[1],l=hN.useSDKSettings().lang,d=KN.useSDKTracking().sendEvent;return dv.useEffect((function(){d({tag:i?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[i,d]),dv.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),dv.createElement(eW,null,null!==a&&dv.createElement(ZH,{mb:"20px"},dv.createElement("div",null,dv.createElement(JK,{type:a?WK:"WARNING"},a?cq.CONFIRM_POPUP_VALID_QR[l]:cq.CONFIRM_POPUP_INVALID_QR[l]))),dv.createElement(yK,{ratio:1.5},dv.createElement(nW,{src:c})),o&&dv.createElement(tW,{className:"confirm-popup-error-message"},o.msg[l]),dv.createElement(oW,null,dv.createElement(rW,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},cq.BTN_TRY_AGAIN[l]),dv.createElement(rW,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},cq.BTN_USE_THIS_PICTURE[l])))};aW.propTypes={imageTaken:Lv.shape({}),error:Lv.shape({msg:Lv.shape({})}),onConfirm:Lv.func,onTryAgain:Lv.func,hasValidQR:Lv.bool,frontSide:Lv.bool},aW.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var iW,sW={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},cW=sw(iW||(iW=uF(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),uW=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons","isLoading","cardList"];function lW(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,a=e.defaultCameraId,i=e.globalStyle,s=e.styledComponent,c=e.frontCamera,u=e.scannerTypeCons,l=e.isLoading,d=e.cardList,f=cF(e,uW),p=f.numberOfCaptures,h=f.stepNumber,m=f.frontSide,g=f.titleIcon,v=f.title,y=f.description,b=f.scannerType,w=f.usePortraitMask,k=f.shouldShowSpinner,C=f.handleQRCaptureDone,E=f.handleIDCardCaptureDone,S=f.handleRestartSession,B=f.refIDCardReader,_=f.handleClickConfirm,x=f.popupType,T=f.popupShown,A=f.popupProps,I=dv.useRef(null),P=lF(dv.useState(null),2),R=P[0],N=P[1],O=lF(dv.useState(!1),2),D=O[0],L=O[1],M=QN.useAsset("ic_loading.png"),F=lF(dv.useState({}),2),U=F[0],j=F[1],V=U.yTitle,z=dv.useCallback((function(e){N(e),L(!0)}),[]);dv.useEffect((function(){L(!1)}),[c]);var q=QN.useAsset(g),H=s.CloseCameraButton;return dv.createElement(rw,{theme:sW},dv.createElement(qz,null,dv.createElement(uz,{key:c,frontCamera:c,onVideoPlayed:z,onClose:t,flipHorizontal:c,ref:I,onError:r,defaultCameraId:a,closeButton:H||null},D&&dv.createElement(dv.Fragment,null,b===u.ID_CARD&&dv.createElement(HH,{key:h,ref:B,windowAndVideoInfo:R,refVideo:I,settings:n,onCaptureDone:E,onUISpacingChange:j,frontSide:m,cardList:d,description:y,usePortraitMask:w,outputEncryptionSettings:o}),b===u.QR_CODE&&dv.createElement(jK,{key:h,refVideo:I,windowAndVideoInfo:R,settings:n,onCaptureDone:C,onUISpacingChange:j,outputEncryptionSettings:o})),dv.createElement(zz,{keyForTransition:p}),dv.createElement(Qz,{y:"".concat(V,"px")},dv.createElement(IF,null,dv.createElement(_F,{key:v,timeout:{enter:500,exit:500},classNames:"flipY",unmountOnExit:!0},dv.createElement(Xz,null,g&&dv.createElement(Hz,{src:q,alt:""}),dv.createElement(Yz,{className:"title"},v))))),(k||l)&&dv.createElement(Wz,null,dv.createElement("img",{src:M,alt:"",className:"spin"}))),dv.createElement(fz,{open:T},"CONFIRM"===x&&dv.createElement(aW,aF({},A,{onConfirm:_,onTryAgain:S,frontSide:m})))),dv.createElement(i,null))}var dW={cardList:Lv.arrayOf(Lv.string),settings:Lv.shape({}),onClose:Lv.func,onError:Lv.func,outputEncryptionSettings:Lv.shape({}),defaultCameraId:Lv.string,globalStyle:Lv.shape({}),styledComponent:Lv.shape({CloseCameraButton:Lv.node}),frontCamera:Lv.bool,scannerTypeCons:Lv.shape({}).isRequired,isLoading:Lv.bool},fW={cardList:[],settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:cW,styledComponent:{CloseCameraButton:null},frontCamera:!1,isLoading:!1};lW.propTypes=dW,lW.defaultProps=fW;var pW=aI.IDCardSide,hW=aI.IDCardType,mW=aI.Errors,gW={ID_CARD:"id_card",QR_CODE:"qr_code"},vW=[{scannerType:gW.ID_CARD,title:"Mặt trước CMND/CCCD",description:"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:aI.IDCardSide.FRONT,cardType:hW.VN,enableConfirmPopup:!0},{scannerType:gW.ID_CARD,title:"Mặt sau CMND/CCCD",description:"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:aI.IDCardSide.BACK,cardType:hW.VN,enableConfirmPopup:!0}],yW={scannerType:gW.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},bW=function(){return Promise.resolve({card_label:""})},wW=function(e){var t=e.settings,r=e.onError,n=e.detectIdCard,o=void 0===n?bW:n,a=e.outputEncryptionSettings,i=e.steps,s=e.onStepDone,c=hN.useSDKSettings().lang,u=null!=i?i:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",r="ph"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||"en"===t,n={scannerType:gW.ID_CARD,title:r?"Capture Front Side of ID Card":"Mặt trước CMND/CCCD",description:r?"":"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:aI.IDCardSide.FRONT,cardType:hW.VN,enableConfirmPopup:!0},o={scannerType:gW.ID_CARD,title:r?"Capture Back Side of ID Card":"Mặt sau CMND/CCCD",description:r?"":"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:aI.IDCardSide.BACK,cardType:hW.VN,enableConfirmPopup:!0};return e?[n,o]:[n]}(Uq(t,"hasBackCard",!0),c,Uq(t,"country")),l=lF(dv.useState(0),2),d=l[0],f=l[1],p=lF(dv.useState(u[d]),2),h=p[0],m=p[1],g=lF(dv.useState(0),2),v=g[0],y=g[1],b=lF(dv.useState(!1),2),w=b[0],k=b[1],C=dv.useRef({}),E=dv.useRef([]),S=dv.useRef(null),B=dv.useRef(),_=dv.useRef(null),x=hq(),T=x.showPopup,A=x.popupShown,I=x.popupType,P=x.props,R=h.scannerType,N=h.title,O=h.titleIcon,D=h.cardSide,L=h.description,M=h.usePortraitMask,F=h.cardType,U=h.enableConfirmPopup,j=dv.useCallback((function(e){e>=u.length||setTimeout((function(){f(e),m(u[e])}),200)}),[u]),V=dv.useCallback((function(){j(d+1)}),[j,d]),z=dv.useCallback((function(){setTimeout((function(){m((function(e){return sF(sF({},e),yW)}))}),200)}),[]),q=dv.useCallback((function(){T({popupType:null})}),[T]),H=dv.useCallback((function(){if(q(),S.current=null,R===gW.QR_CODE)j(d);else if(R===gW.ID_CARD){var e=null;_.current===pW.FRONT?e=0:_.current===pW.BACK&&(e=1),null!==e&&j(e),B.current.restartSession()}}),[j,d,q,R]),K=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={stepNumber:d,cardSide:D,cardType:F,image:C.current,recordedVideos:null!=t&&t.enableRecording?E.current:[]},(R===gW.QR_CODE||null!==(r=S.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=S.current),k(!0),e.next=5,s(n);case 5:(o=e.sent)?(_.current=o,k(!1)):(k(!1),S.current=null,V());case 7:case"end":return e.stop()}}),e)}))),[t,d,s,V,R,k,D,F]),W=dv.useCallback((function(e){var t;if(S.current=e,e&&e.recordedVideos){var r,n=e.recordedVideos;(r=E.current).push.apply(r,dF(n))}y((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);U?T({popupType:"CONFIRM",props:{hasValidQR:o,imageTaken:C.current}}):K()}),[T,U,K]),G=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(n){var i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.image,s=n.error,c=n.recordedVideos,C.current=i,E.current=c,y((function(e){return e+1})),D!==aI.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!OF.isMobile){e.next=28;break}if(l=null==i||null===(u=i.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return k(!0),e.prev=9,e.next=12,o({image:i,cardType:F,cardSide:D});case 12:d=e.sent,l=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(mW.detect_id_card_error);case 19:k(!1);case 20:if(!l||!"vn.cccd_new.front".includes(l)){e.next=28;break}return k(!0),e.next=24,xK(C.current.blob,a);case 24:return(f=e.sent)?W(f):z(),k(!1),e.abrupt("return");case 28:U?T({popupType:"CONFIRM",props:{imageTaken:C.current,error:s}}):K();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[U,T,D,t,F,o,K,z,r,W,a,k]),Q=dv.useCallback((function(){q(),K()}),[K,q]);return{numberOfCaptures:v,stepNumber:d,titleIcon:O,title:N,description:L,frontSide:D===pW.FRONT,scannerType:R,usePortraitMask:M,shouldShowSpinner:w,handleQRCaptureDone:W,handleIDCardCaptureDone:G,handleRestartSession:H,refIDCardReader:B,handleClickConfirm:Q,showPopup:T,popupType:I,popupShown:A,popupProps:P}};function kW(e){var t=this.__data__=new xq(e);this.size=t.size}kW.prototype.clear=function(){this.__data__=new xq,this.size=0},kW.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},kW.prototype.get=function(e){return this.__data__.get(e)},kW.prototype.has=function(e){return this.__data__.has(e)},kW.prototype.set=function(e,t){var r=this.__data__;if(r instanceof xq){var n=r.__data__;if(!Tq||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Pq(n)}return r.set(e,t),this.size=r.size,this};var CW=kW,EW=function(e,t,r){(void 0!==r&&!sU(e[t],r)||void 0===r&&!(t in e))&&iU(e,t,r)},SW=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var s=a[++n];if(!1===t(o[s],s,o))break}return e},BW=RF((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?MF.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}})),_W=MF.Uint8Array,xW=function(e,t){var r=t?function(e){var t=new e.constructor(e.byteLength);return new _W(t).set(new _W(e)),t}(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},TW=Object.create,AW=function(){function e(){}return function(t){if(!WF(t))return{};if(TW)return TW(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),IW=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},PW=function(e,t,r,n,o,a,i){var s=IW(e,r),c=IW(t,r),u=i.get(c);if(u)EW(e,r,u);else{var l=a?a(s,c,r+"",e,t,i):void 0,d=void 0===l;if(d){var f=PU(c),p=!f&&NU(c),h=!f&&!p&&jU(c);l=c,f||p||h?PU(s)?l=s:function(e){return BU(e)&&wU(e)}(s)?l=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(s):p?(d=!1,l=BW(c,!0)):h?(d=!1,l=xW(c,!0)):l=[]:rj(c)||IU(c)?(l=s,IU(s)?l=function(e){return lU(e,GU(e))}(s):WF(s)&&!GF(s)||(l=function(e){return"function"!=typeof e.constructor||HU(e)?{}:AW(YU(e))}(c))):d=!1}d&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),EW(e,r,l)}},RW=function e(t,r,n,o,a){t!==r&&SW(r,(function(i,s){if(a||(a=new CW),WF(i))PW(t,r,s,n,e,o,a);else{var c=o?o(IW(t,s),i,s+"",t,r,a):void 0;void 0===c&&(c=i),EW(t,s,c)}}),GU)},NW=SU((function(e,t,r){RW(e,t,r)})),OW={data:{country:"vn",settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},track_card_coordinates:{enable:!1,max_length:150},card_type_check:{enable:!1},blur_check:{enable:!0,threshold_web:.82},disable_capture_button_if_alert:!1,exif_data_settings:{enable:!0},id_detection:{enable:!0},limit_time_settings:{enable:!0,limit_time_second:30,video_partial_length_seconds:15},save_frame_settings:{enable:!1,frames_interval_ms:190,quality_web:80},scan_qr_settings:{enable:!0,limit_time_second:20},virtual_cam_hashes:{web:!1,mobile:!1}}}}}};function DW(e){var t=e.clientSettings,r=lF(dv.useState(null),2),n=r[0],o=r[1];return dv.useEffect((function(){var e=NW(OW,t),r=Uq(e,"data.settings.sdk_settings.id_detection_settings.card_type_check.enable"),n=Uq(e,"data.country"),a=Uq(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),i=Uq(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.enable"),s=Uq(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.max_length"),c=Uq(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),u=Uq(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),l=Uq(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),d=Uq(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),f=Uq(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),p=Uq(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),h=Uq(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),m=Uq(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),g=Uq(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),v=Uq(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),y=Uq(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),b=Uq(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),w=Uq(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),k=Uq(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),C=Uq(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(OF.isMobile?"mobile":"web")),E=Uq(e,"data.card_types[0].has_back_side",!0);o({country:n,enableRecording:a,trackCardCoordinates:i,trackCardCoordinatesMaxLength:s,enableCardTypeCheck:r,frameCaptureIntervalMs:c,idCardSessionTime:d,maxRecordingTimePerVideo:f,saveFrameQuality:u,enableTimers:l,enableAutoCapture:p,waitForBestImageTimeMs:h,enableBlurCheck:m,blurThreshold:g,disableCaptureButtonIfAlert:v,enableIdDetection:y,enableScanQr:b,scanQrLimitTimeSecond:w,enableExifData:k,enableVirtualCamHashes:C,hasBackCard:E})}),[t]),{settings:n}}var LW,MW="landscape",FW="portrait",UW="desktop",jW=aI.Errors,VW=aw.div(LW||(LW=uF(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function zW(e){var t=e.children,r=hN.useSDKSettings().lang,n=jW.wrong_orientation.msg[r],o=function(){var e=dv.useRef(window.matchMedia("(orientation: portrait)")),t=dv.useRef(e.current.matches?FW:MW),r=lF(dv.useState(t.current),2),n=r[0],o=r[1];return dv.useEffect((function(){function t(e){e.matches?o(FW):o(MW)}return e.current.addEventListener("change",t),function(){e.current.removeEventListener("change",t)}}),[]),OF.isMobile?{curOrientation:n,initOrientation:t.current}:{curOrientation:UW}}().curOrientation;return dv.createElement(dv.Fragment,null,o===MW&&dv.createElement(fz,{open:!0},dv.createElement(VW,null,n)),(o===FW||o===UW)&&dv.createElement(dv.Fragment,null,t))}function qW(e){var t=e.logCredentials,r=e.clientSettings,n=e.uiOnlyComponent,o=e.onError,a=e.detectIdCard,i=e.outputEncryptionSettings,s=e.steps,c=e.onStepDone,u=DW({clientSettings:r}).settings,l=aF({},wW({settings:u,onError:o,detectIdCard:a,outputEncryptionSettings:i,steps:s,onStepDone:c}));return dv.createElement(zW,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:sF({},t)}},dv.createElement(n,aF({},e,{settings:u,scannerTypeCons:gW},l))))}var HW={logCredentials:Lv.shape({}),clientSettings:Lv.shape({}),uiOnlyComponent:Lv.func,onError:Lv.func,onStepDone:Lv.func,steps:Lv.arrayOf(Lv.shape({})),detectIdCard:Lv.func,outputEncryptionSettings:Lv.shape({})};qW.propTypes=HW,qW.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:lW,onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var KW=function(e){var t=aF({},e),r=t.clientSettings,n=t.onError,o=t.onStepDone,a=t.logCredentials,i=t.uiOnlyComponent,s=t.detectIdCard,c=t.outputEncryptionSettings,u=t.steps,l=DW({clientSettings:r}).settings,d=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o(sF(sF({},t),{},{restartSession:null==f?void 0:f.handleRestartSession}));case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,null==f?void 0:f.handleRestartSession]),f=aF({},wW({settings:l,onError:n,detectIdCard:s,outputEncryptionSettings:c,steps:u,onStepDone:d}));return dv.createElement(zW,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:sF({},a)}},dv.createElement(i,aF({},t,{onStepDone:d,settings:l,scannerTypeCons:gW},f))))};KW.propTypes={clientSettings:Lv.shape({}),onError:Lv.func,onStepDone:Lv.func,logCredentials:Lv.shape({}),readIDCardUIOnlyComponent:Lv.func,uiOnlyComponent:Lv.func,sdkAdapter:Lv.shape({}),steps:Lv.arrayOf(Lv.shape({})),detectIdCard:Lv.func,outputEncryptionSettings:Lv.shape({})},KW.defaultProps={clientSettings:void 0,onError:function(){},onStepDone:function(){},logCredentials:{enable:!0},readIDCardUIOnlyComponent:qW,uiOnlyComponent:lW,sdkAdapter:null,steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null},Lv.shape({});var WW=n((function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){var n={MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0};e.exports={BROWSER_TYPES:{CHROME:"Chrome",FIREFOX:"Firefox",OPERA:"Opera",YANDEX:"Yandex",SAFARI:"Safari",INTERNET_EXPLORER:"Internet Explorer",EDGE:"Edge",CHROMIUM:"Chromium",IE:"IE",MOBILE_SAFARI:"Mobile Safari",EDGE_CHROMIUM:"Edge Chromium"},DEVICE_TYPES:n,OS_TYPES:{IOS:"iOS",ANDROID:"Android",WINDOWS_PHONE:"Windows Phone",WINDOWS:"Windows",MAC_OS:"Mac OS"},defaultData:{isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1}}},function(e,t,r){var n,o=r(2),a=r(0),i=a.BROWSER_TYPES,s=a.OS_TYPES,c=a.DEVICE_TYPES,u=r(4),l=u.checkType,d=u.broPayload,f=u.mobilePayload,p=u.wearPayload,h=u.consolePayload,m=u.stvPayload,g=u.getNavigatorInstance,v=u.isIOS13Check,y=new o,b=y.getBrowser(),w=y.getDevice(),k=y.getEngine(),C=y.getOS(),E=y.getUA(),S=i.CHROME,B=i.CHROMIUM,_=i.IE,x=i.INTERNET_EXPLORER,T=i.OPERA,A=i.FIREFOX,I=i.SAFARI,P=i.EDGE,R=i.YANDEX,N=i.MOBILE_SAFARI,O=c.MOBILE,D=c.TABLET,L=c.SMART_TV,M=c.BROWSER,F=c.WEARABLE,U=c.CONSOLE,j=s.ANDROID,V=s.WINDOWS_PHONE,z=s.IOS,q=s.WINDOWS,H=s.MAC_OS,K=function(){return C.name===s.WINDOWS&&"10"===C.version&&("string"==typeof E&&-1!==E.indexOf("Edg/"))},W=function(){return b.name===P},G=function(){return v("iPad")},Q=w.type===L,X=w.type===U,Y=w.type===F,$=b.name===N||G(),Z=b.name===B,J=function(){switch(w.type){case O:case D:return!0;default:return!1}}()||G(),ee=w.type===O,te=w.type===D||G(),re=w.type===M,ne=C.name===j,oe=C.name===V,ae=C.name===z||G(),ie=b.name===S,se=b.name===A,ce=b.name===I||b.name===N,ue=b.name===T,le=b.name===x||b.name===_,de=C.version?C.version:"none",fe=C.name?C.name:"none",pe=b.major,he=b.version,me=b.name,ge=w.vendor?w.vendor:"none",ve=w.model?w.model:"none",ye=k.name,be=k.version,we=E,ke=W()||K(),Ce=b.name===R,Ee=w.type,Se=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Be=G(),_e=v("iPhone"),xe=v("iPod"),Te=function(){var e=g(),t=e&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)}(),Ae=K(),Ie=W(),Pe=C.name===q,Re=C.name===H,Ne=l(w.type);e.exports={deviceDetect:function(){var e=Ne.isBrowser,t=Ne.isMobile,r=Ne.isTablet,n=Ne.isSmartTV,o=Ne.isConsole,a=Ne.isWearable;return e?d(e,b,k,C,E):n?m(n,k,C,E):o?h(o,k,C,E):t||r?f(Ne,w,C,E):a?p(a,k,C,E):void 0},isSmartTV:Q,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ae,isChrome:ie,isFirefox:se,isSafari:ce,isOpera:ue,isIE:le,osVersion:de,osName:fe,fullBrowserVersion:pe,browserVersion:he,browserName:me,mobileVendor:ge,mobileModel:ve,engineName:ye,engineVersion:be,getUA:we,isEdge:ke,isYandex:Ce,deviceType:Ee,isIOS13:Se,isIPad13:Be,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Ie,isWindows:Pe,isMacOs:Re}},function(e,t,r){var n;
76
+ */function _V(e){if("object"==Xm(e)&&null!==e){var t=e.$$typeof;switch(t){case cV:switch(e=e.type){case mV:case gV:case lV:case fV:case dV:case yV:return e;default:switch(e=e&&e.$$typeof){case hV:case vV:case kV:case wV:case pV:return e;default:return t}}case uV:return t}}}function xV(e){return _V(e)===gV}var TV={AsyncMode:mV,ConcurrentMode:gV,ContextConsumer:hV,ContextProvider:pV,Element:cV,ForwardRef:vV,Fragment:lV,Lazy:kV,Memo:wV,Portal:uV,Profiler:fV,StrictMode:dV,Suspense:yV,isAsyncMode:function(e){return xV(e)||_V(e)===mV},isConcurrentMode:xV,isContextConsumer:function(e){return _V(e)===hV},isContextProvider:function(e){return _V(e)===pV},isElement:function(e){return"object"==Xm(e)&&null!==e&&e.$$typeof===cV},isForwardRef:function(e){return _V(e)===vV},isFragment:function(e){return _V(e)===lV},isLazy:function(e){return _V(e)===kV},isMemo:function(e){return _V(e)===wV},isPortal:function(e){return _V(e)===uV},isProfiler:function(e){return _V(e)===fV},isStrictMode:function(e){return _V(e)===dV},isSuspense:function(e){return _V(e)===yV},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===lV||e===gV||e===fV||e===dV||e===yV||e===bV||"object"==Xm(e)&&null!==e&&(e.$$typeof===kV||e.$$typeof===wV||e.$$typeof===pV||e.$$typeof===hV||e.$$typeof===vV||e.$$typeof===EV||e.$$typeof===SV||e.$$typeof===BV||e.$$typeof===CV)},typeOf:_V},AV=(RF((function(e,t){})),RF((function(e){e.exports=TV}))),IV={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},PV={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},RV={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},NV={};function OV(e){return AV.isMemo(e)?RV:NV[e.$$typeof]||IV}NV[AV.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},NV[AV.Memo]=RV;var DV=Object.defineProperty,LV=Object.getOwnPropertyNames,MV=Object.getOwnPropertySymbols,FV=Object.getOwnPropertyDescriptor,UV=Object.getPrototypeOf,jV=Object.prototype,VV=function e(t,r,n){if("string"!=typeof r){if(jV){var o=UV(r);o&&o!==jV&&e(t,o,n)}var a=LV(r);MV&&(a=a.concat(MV(r)));for(var i=OV(t),s=OV(r),c=0;c<a.length;++c){var u=a[c];if(!(PV[u]||n&&n[u]||s&&s[u]||i&&i[u])){var l=FV(r,u);try{DV(t,u,l)}catch(e){}}}}return t};function zV(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===tF(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,t){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(t){e(t.filter((function(e){return"video"===e.kind.toLowerCase()||"videoinput"===e.kind.toLowerCase()})).map((function(e){return{deviceId:null!=e.deviceId?e.deviceId:"",groupId:e.groupId,kind:"videoinput",label:e.label,toJSON:function(){return this}}})))}))}catch(e){return t(e)}}))}var qV,HV,KV,WV,GV,QV=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],XV=function(e){if(!e)return{isVirtual:!1};var t=e.getTracks();if(!t||!t.length)return{isVirtual:!1};var r=t[0].label,n=r&&QV.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},YV=function(e,t){return!e||1===navigator.maxTouchPoints||navigator.plugins.length>0&&!t},$V=function(){var e,t;return{updateTime:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start";"start"===n?e=r:"end"===n&&(t=r)},getStart:function(){return e},getEnd:function(){return t}}},ZV=aI.Errors,JV=aw.div(qV||(qV=uF(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: #000;\n display: flex;\n justify-content: center;\n z-index: ",";\n ","\n"])),1e3,(function(e){return e.checkCameraMode&&"opacity: 0;"})),ez=aw.video(HV||(HV=uF(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),tz=aw.div(KV||(KV=uF(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),rz=aw(tz)(WV||(WV=uF(["\n z-index: ",";\n position: fixed;\n top: 20px;\n right: 20px;\n width: 20px;\n cursor: pointer;\n"])),2e3),nz=aw.div(GV||(GV=uF(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),oz=dv.createRef(),az=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(r,n){e.call(navigator,t,r,n)}))}}:null}();function iz(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,a=e.onVideoPlayed,i=e.flipHorizontal,s=e.videoSettings,c=e.refVideo,u=e.onError,l=e.closeButton,d=e.videoClassName,f=e.scale,p=e.defaultCameraId,h=e.onWarning,m=dv.useRef(),g=hN.useSDKSettings().lang,v=KN.useSDKTracking().sendEvent,y=QN.useAsset("ic_close.png"),b=lF(dv.useState(""),2),w=b[0],k=b[1],C=dv.useRef(!1),E=dv.useRef(!1),S=dv.useRef(!1),B=dv.useRef(),_=dv.useRef([]),x=dv.useRef(""),T=dv.useCallback((function(e){u&&u(e)}),[u]),A=dv.useCallback((function(){try{var e;clearInterval(m.current),(null==c||null===(e=c.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(c.current.srcObject.getTracks().forEach((function(e){return e.stop()})),c.current.srcObject=null)}catch(e){}clearTimeout(B)}),[c]);function I(){return P.apply(this,arguments)}function P(){return(P=nF(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,zV();case 3:t=e.sent,_.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),KM.addExifData("device_info.camera_list",JSON.stringify(_.current.map((function(e){return e.label})))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}m.current||(m.current=setInterval((function(){document.getElementById("tv-camera-".concat(m.current))||A()}),1e3)),dv.useEffect((function(){return function(){S.current=!0}}),[]);var R=dv.useCallback((function(){B.current||(B.current=setTimeout((function(){C.current||(k(ZV.camera_timeout.msg[g]),T(ZV.camera_timeout))}),2e4))}),[g,T]),N=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){var n,o,a,i,c,u,l,d,f,p,m=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=m.length>1&&void 0!==m[1]&&m[1],o={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return h&&h("too_many_request_to_camera"),e.abrupt("return",new Promise((function(e){return e(null)})));case 5:return window.tv_last_req_camera_complete=!1,o=OF.isMobile?OF.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},a=$V(),i=a.updateTime,c=a.getStart,u=a.getEnd,e.prev=8,l=s||o,i(performance.now(),"start"),YV(OF.isMobile,OF.isIOS)&&r&&(l={}),n&&(l={}),KM.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),d={audio:!1,video:sF(sF({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)},e.next=17,az.getUserMedia(d);case 17:return f=e.sent,e.next=20,I();case 20:if(R(),f){e.next=25;break}return k(ZV.not_supported.msg[g]),T(ZV.not_supported),e.abrupt("return",null);case 25:i(performance.now(),"end"),window.tv_last_req_camera_complete=!0,u()-c()<1600?v({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):v({tag:"cam_permission",event:"user_activity.allow",log:{}});try{p=f.getVideoTracks()[0].getSettings(),KM.addExifData("device_info.camera_label_dimension.got","".concat(p.width,"x").concat(p.height))}catch(e){}return e.abrupt("return",f);case 32:e.prev=32,e.t0=e.catch(8),i(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k(ZV.no_permission.msg[g]),T(ZV.no_permission),E.current=!0,v({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):E.current&&("NotReadableError"===e.t0.name?(T(ZV.not_readable),k(ZV.not_readable.msg[g])):(k(e.t0.message),T({code:e.t0.name||e.t0.code,message:e.t0.message})));case 36:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 38:case"end":return e.stop()}}),e,null,[[8,32]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,T,h,R,v]),O=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var t,r,n,o,i,s,u,l,d,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>0&&void 0!==h[0]?h[0]:p,o=h.length>1&&void 0!==h[1]&&h[1],!(null!=(i=c.current)&&null!==(t=i.srcObject)&&void 0!==t&&t.id&&null!=i&&null!==(r=i.srcObject)&&void 0!==r&&r.active&&C.current)){e.next=5;break}return e.abrupt("return");case 5:return i.oncanplaythrough=function(){var e,t,r;i.play(),KM.addExifData("device_info.camera_label",null===(e=s)||void 0===e||null===(t=e.getVideoTracks())||void 0===t||null===(r=t[0])||void 0===r?void 0:r.label),C.current=!0,k("");var n=window.innerWidth,o=window.innerHeight,c=CO.analyzeVideoAndWindowSizes(i),u=c.lostX,l=void 0===u?0:u,d=c.lostY,f=void 0===d?0:d,p=Math.min(n,Math.floor(n-2*l)),h=Math.min(o,Math.floor(o-2*f));a&&a({clientWidth:n,clientHeight:o,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,N(n,o);case 8:s=e.sent,u=XV(s),l=u.deviceLabel,(d=u.isVirtual)&&(x.current+="".concat(l,", "),(f=_.current.filter((function(e){return!x.current.includes(e.label)})))[0]&&f[0].deviceId&&O(f[0].deviceId)),s||E.current||(KM.addExifData("device_info.camera_label_retry","yes"),E.current=!0,O(n,!0)),s&&S.current&&(c.current.srcObject=s,A()),!s||S.current||d||(i.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,N,a,p,A]);dv.useEffect((function(){function e(){return(e=nF(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:return e.next=4,zV();case 4:t=e.sent,(r=t.filter((function(e){return"videoinput"===e.kind&&e.label.includes("back")&&e.label.includes("0")}))).length>0&&(n=r[0].deviceId,A(),O(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return C.current?function(){}:(!az||OF.browserName&&["facebook"].includes(OF.browserName.toLowerCase())||OF.getUA.includes("Zalo iOS")?(k(ZV.not_supported.msg[g]),T(ZV.not_supported)):t&&(OF.isAndroid&&!1===r?function(){e.apply(this,arguments)}():O()),function(){S.current&&A()})}),[c,g,r,O,A,T]);var D=dv.useCallback((function(){A(),n&&n(),v({tag:"result",event:"user_activity.cancel",log:{}})}),[n,A,v]);return dv.createElement(JV,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!w)return null;var e=ZV.no_permission.msg[g];return w===e&&OF.isIOS?dv.createElement(nz,null,w," ",dv.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):dv.createElement(nz,null,w)}(),dv.createElement(ez,{ref:c,playsInline:!0,muted:!0,flipHorizontal:i,className:d,scale:f}),o,l?dv.cloneElement(l,{onClick:D,"data-testid":"close-camera"}):dv.createElement(rz,{onClick:D,"data-testid":"close-camera"},dv.createElement("img",{src:y,alt:""})))}iz.propTypes={checkCameraMode:Lv.bool,frontCamera:Lv.bool,onClose:Lv.func,onError:Lv.func,onVideoPlayed:Lv.func,children:Lv.node,flipHorizontal:Lv.bool,videoSettings:Lv.object,refVideo:Lv.object,closeButton:Lv.node,videoClassName:Lv.string,scale:Lv.number,defaultCameraId:Lv.string,onWarning:Lv.func},iz.defaultProps={checkCameraMode:!1,frontCamera:!0,onClose:null,onError:null,onVideoPlayed:null,children:null,flipHorizontal:!1,videoSettings:null,refVideo:null,closeButton:null,videoClassName:"",scale:1,defaultCameraId:void 0,onWarning:null};var sz,cz=function(e,t,r){var n=function(t){ag(o,dv.Component);var n=fg(o);function o(){var e;return Zm(this,o),(e=n.apply(this,arguments)).updateDebounced=iV(e.forceUpdate,250,r),e}return eg(o,[{key:"shouldComponentUpdate",value:function(){return this.updateDebounced(),!1}},{key:"componentWillUnmount",value:function(){this.updateDebounced.cancel()}},{key:"render",value:function(){return dv.createElement(e,Object.assign({},this.props))}}]),o}();return n.displayName="debounceRender(".concat(e.displayName||e.name||"Component",")"),VV(n,e)}(iz),uz=dv.forwardRef((function(e,t){return dv.createElement(cz,aF({},e,{refVideo:t||oz}))})),lz=sw(sz||(sz=uF(["\n .popup-content {\n margin: auto;\n background: #fff;\n width: 100%;\n padding: 5px;\n border: 1px solid #d7d7d7;\n max-width: 568px;\n border-radius: 10px;\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n border-radius: 5px\n }\n\n .popup-overlay {\n background: rgba(0, 0, 0, .5);\n padding: 10px;\n }\n\n [data-popup=tooltip].popup-overlay {\n background: transparent\n }\n\n .popup-arrow {\n -webkit-filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n color: #fff;\n stroke-width: 2px;\n stroke: #d7d7d7;\n stroke-dasharray: 30px;\n stroke-dashoffset: -54px;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0\n }\n"]))),dz=["open","children","overlayStyle"],fz=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=cF(e,dz);return dv.createElement(dv.Fragment,null,t&&dv.createElement(dv.Fragment,null,dv.createElement(Kj,aF({overlayStyle:sF(sF({},n),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),dv.createElement(lz,null)))};fz.propTypes={open:Lv.bool,children:Lv.node,overlayStyle:Lv.shape({})},fz.defaultProps={open:!1,children:null,overlayStyle:{}};var pz="default";function hz(e){var t=e.className,r=e.width,n=e.height,o=e.type,a=e.strokeStyles,i=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=dv.useMemo((function(){var e;return sF((oF(e={},pz,{fill:"none",strokeWidth:i,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),oF(e,"error",{fill:"rgba(234,50,35, 0.1)",strokeWidth:i,stroke:"#ea3223"}),e),a)}),[i,a]),l=s+.8*i,d=u[o];return dv.createElement("svg",{width:r,height:n,className:t},dv.createElement("rect",{x:i/2,y:i/2,rx:s,ry:s,width:r-i,height:n-i,style:d}),dv.createElement("path",{d:"M0,".concat(l," Q0,0 ").concat(l,",0 L0,0 Z"),style:c}),dv.createElement("path",{d:"M0,".concat(n-l," Q0,").concat(n," ").concat(l,",").concat(n," L0,").concat(n," Z"),style:c}),dv.createElement("path",{d:"M".concat(r-l,",").concat(n," Q").concat(r,",").concat(n," ").concat(r,",").concat(n-l," L").concat(r,",").concat(n," Z"),style:c}),dv.createElement("path",{d:"M".concat(r-l,",0 Q").concat(r,",0 ").concat(r,",").concat(l," L").concat(r,",0 Z"),style:c}))}hz.propTypes={className:Lv.string,width:Lv.number,height:Lv.number,strokeWidth:Lv.number,strokeStyles:Lv.shape({}),type:Lv.oneOf([pz,"error"]),radius:Lv.number,paddingStyle:Lv.shape({})},hz.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:pz,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var mz,gz,vz,yz,bz,wz,kz,Cz,Ez,Sz,Bz,_z,xz,Tz,Az,Iz,Pz,Rz,Nz=Hb([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],cw(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),500,cw(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),500),Oz=(Hb([".slide-horizontal{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}.slide-vertical{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],cw(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),cw(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20)),cw(["from,to{opacity:1;}50%{opacity:0;}"])),Dz=(Hb([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],Oz),aw.div(mz||(mz=uF(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ","; // must be higher than BASE_Z_INDEX and lower than other layers\n"])),1001)),Lz=Hb([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],cw(["from{background:#000;}to{}"]),300),Mz=aw.div(gz||(gz=uF(["\n ","\n"])),Lz),Fz=Hb([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],cw(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"])),Uz=["width","height","type"],jz=aw(hz)(vz||(vz=uF([""]))),Vz=aw.img(yz||(yz=uF(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),zz=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return dv.createElement(Mz,null,dv.createElement(IF,null,dv.createElement(_F,{key:r,timeout:{enter:300,exit:0},classNames:"splash",unmountOnExit:!1},dv.createElement(Dz,null))))},qz=aw.div(bz||(bz=uF(["\n ","\n ","\n"])),Nz,Fz),Hz=aw.img(wz||(wz=uF(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),Kz=aw.div(kz||(kz=uF(["\n cursor: pointer;\n text-align: center;\n width: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),60,1020,OF.isMobile?Hb(["top:",";"],(function(e){return e.y})):Hb(["bottom:","px;"],10)),Wz=aw.div(Cz||(Cz=uF(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ","px;\n height: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),100,100,1020),Gz=aw.div(Ez||(Ez=uF(["\n color: #fff;\n text-align: center;\n"]))),Qz=aw.div(Sz||(Sz=uF(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),Xz=aw.div(Bz||(Bz=uF(["\n display: flex;\n align-items: center;\n"]))),Yz=aw(Gz)(_z||(_z=uF(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),$z=aw(Gz)(xz||(xz=uF(["\n font-size: 20px;\n margin-left: 10px;\n color: green;\n position: absolute;\n left: 0;\n top: 10px;\n background: white;\n z-index: ",";\n"])),1030),Zz=aw(Gz)(Tz||(Tz=uF(["\n position: absolute;\n font-size: 16px;\n text-align: center;\n color: #fff;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),Jz=aw(Zz)(Az||(Az=uF(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),eq=aw(Gz)(Iz||(Iz=uF(["\n position: absolute;\n font-size: 18px;\n text-align: center;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),tq=(aw.div(Pz||(Pz=uF(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),function(e){var t=e.width,r=e.height,n=e.type,o=cF(e,Uz),a=QN.useAsset("id_card_frame.png"),i=QN.useAsset("id_card_frame_error.png");return dv.createElement(qz,{width:t,height:r},dv.createElement(Vz,{src:"error"===n?i:a,width:t,height:r}),dv.createElement(jz,aF({width:t,height:r,type:n},o)))}),rq={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},nq=aw.div(Rz||(Rz=uF(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),oq=function(e){var t=e.contentStyle,r=hN.useSDKSettings(),n=r.lang,o=r.warmupMessage,a=o?o[n]:rq.WARMUP_INTRO[n];return dv.createElement(fz,{open:!0,contentStyle:t},dv.createElement(nq,{className:"warmup-message"},a))};oq.propTypes={contentStyle:Lv.shape({})},oq.defaultProps={contentStyle:{}};var aq,iq,sq,cq={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},uq=aI.IDCardMessage,lq=aw.div(aq||(aq=uF(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),dq=aw.div(iq||(iq=uF(["\n text-align: center;\n font-size: 1rem;\n"]))),fq=aw.button(sq||(sq=uF(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),pq=function(e){var t=e.onOk,r=e.maxSessionTime,n=hN.useSDKSettings().lang;return dv.createElement(lq,null,dv.createElement(dq,{className:"popup-message"},Rj(uq.TIMEOUT_INSTRUCTION[n])({x:r})),dv.createElement(fq,{className:"popup-button",onClick:t},cq.BTN_OK[n]))};pq.propTypes={onOk:Lv.func,maxSessionTime:Lv.number},pq.defaultProps={onOk:function(){},maxSessionTime:30};var hq=function(){var e=lF(dv.useState(!1),2),t=e[0],r=e[1],n=lF(dv.useState(null),2),o=n[0],a=n[1],i=lF(dv.useState({}),2),s=i[0],c=i[1];return{showPopup:dv.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),a(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},mq="SESSION_TIMEOUT",gq="QR_INSTRUCTIONS",vq=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yq=/^\w*$/,bq=oU(Object,"create"),wq=Object.prototype.hasOwnProperty,kq=Object.prototype.hasOwnProperty;function Cq(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Cq.prototype.clear=function(){this.__data__=bq?bq(null):{},this.size=0},Cq.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Cq.prototype.get=function(e){var t=this.__data__;if(bq){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return wq.call(t,e)?t[e]:void 0},Cq.prototype.has=function(e){var t=this.__data__;return bq?void 0!==t[e]:kq.call(t,e)},Cq.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=bq&&void 0===t?"__lodash_hash_undefined__":t,this};var Eq=Cq,Sq=function(e,t){for(var r=e.length;r--;)if(sU(e[r][0],t))return r;return-1},Bq=Array.prototype.splice;function _q(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}_q.prototype.clear=function(){this.__data__=[],this.size=0},_q.prototype.delete=function(e){var t=this.__data__,r=Sq(t,e);return!(r<0||(r==t.length-1?t.pop():Bq.call(t,r,1),--this.size,0))},_q.prototype.get=function(e){var t=this.__data__,r=Sq(t,e);return r<0?void 0:t[r][1]},_q.prototype.has=function(e){return Sq(this.__data__,e)>-1},_q.prototype.set=function(e,t){var r=this.__data__,n=Sq(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var xq=_q,Tq=oU(MF,"Map"),Aq=function(e,t){var r=e.__data__;return function(e){var t=Xm(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map};function Iq(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Iq.prototype.clear=function(){this.size=0,this.__data__={hash:new Eq,map:new(Tq||xq),string:new Eq}},Iq.prototype.delete=function(e){var t=Aq(this,e).delete(e);return this.size-=t?1:0,t},Iq.prototype.get=function(e){return Aq(this,e).get(e)},Iq.prototype.has=function(e){return Aq(this,e).has(e)},Iq.prototype.set=function(e,t){var r=Aq(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};var Pq=Iq;function Rq(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Rq.Cache||Pq),r}Rq.Cache=Pq;var Nq=Rq,Oq=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dq=/\\(\\)?/g,Lq=function(e){var t=Nq((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Oq,(function(e,r,n,o){t.push(n?o.replace(Dq,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),Mq=function(e,t){return PU(e)?e:function(e,t){if(PU(e))return!1;var r=Xm(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!gj(e))||yq.test(e)||!vq.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Lq(wj(e))},Fq=function(e){if("string"==typeof e||gj(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Uq=function(e,t,r){var n=null==e?void 0:function(e,t){for(var r=0,n=(t=Mq(t,e)).length;null!=e&&r<n;)e=e[Fq(t[r++])];return r&&r==n?e:void 0}(e,t);return void 0===n?r:n},jq=aI.Errors;function Vq(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function zq(e,t){return Math.sqrt(Vq(e,t))}function qq(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=window,o=n.cv,a=t.width,i=t.height,s=r;s<1&&(s=parseInt(.5*(i+a)*s,10));var c=o.imread(t),u=new o.Mat;return o.copyMakeBorder(c,u,s,s,s,s,o.BORDER_CONSTANT,new o.Scalar(0,0,0,255)),c.delete(),{mat:u,margin:s}}function Hq(e,t){var r=window.cv,n=lF(t.map((function(e){return e.location})),4),o=n[0],a=n[1],i=n[2],s=n[3],c=zq(i,s),u=zq(a,o),l=Math.max(c,u),d=zq(a,i),f=zq(o,s),p=Math.max(d,f),h=[o.x,o.y,a.x,a.y,i.x,i.y,s.x,s.y],m=[0,0,l-1,0,l-1,p-1,0,p-1],g=r.imread(e),v=new r.Mat,y=new r.Size(l,p),b=r.matFromArray(4,1,r.CV_32FC2,h),w=r.matFromArray(4,1,r.CV_32FC2,m),k=r.getPerspectiveTransform(b,w);r.warpPerspective(g,v,k,y,r.INTER_LINEAR,r.BORDER_CONSTANT,new r.Scalar);var C=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),w.delete(),C}function Kq(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},o={x:r.x-e.x,y:r.y-e.y},a=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),i=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(a*i))/Math.PI}function Wq(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;t.forEach((function(e){var t=e.location,r=t.x,n=t.y;o=Math.min(o,r),a=Math.min(a,n),i=Math.max(i,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&a/n>=c&&(n-s)/n>=c&&(r-i)/r>=c}function Gq(){return Qq.apply(this,arguments)}function Qq(){return(Qq=nF(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=t.canvas,n=t.paddingPercent,o=void 0===n?.04:n,a=r.width,i=r.height,s=Math.floor(a*o),c=Math.floor(i*o),u=a-2*s,l=i-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(r,s,c,u,l,0,0,u,l),e.abrupt("return",zD.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xq(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,a=Kq(e[r].location,e[n].location,e[o].location);if(a<70||a>110)return!1}return!0}function Yq(e){return $q.apply(this,arguments)}function $q(){return($q=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.blazefaceModel,n=t.predictedIdCardCanvas,o=t.frontSide,a=n.width,i=n.height,s=Math.floor(a/3),c=Math.floor(4*i/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(i/5),s,c,0,0,s,c),e.next=12,jO.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=lF(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4||IO.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[jO.SIZE,jO.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",jq.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",jq.id_detector_error_front_side_multiple_faces);case 20:e.next=24;break;case 22:if(!(p>0)){e.next=24;break}return e.abrupt("return",jq.id_detector_error_back_side_has_faces);case 24:return e.abrupt("return",null);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Zq=function(e){var t=Uq(e,"card.corners");if(t&&Array.isArray(t)&&t.length>0){var r=Uq(t,"[0].location"),n=r.x,o=r.y;return"".concat(n,":").concat(o)}return"-1:-1"},Jq=function(e,t,r){e.current=[].concat(dF(e.current),[t]),e.current.length>r&&e.current.shift()},eH=function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=t.currentWorkingCanvas,u=t.refVirtualWorkingCanvas,l=t.refCountVirtualFrames,d=t.refVirtualFrames,f=t.refWorkingCanvas,(p=t.refCardResult).current.corners&&Array.isArray(p.current.corners)){e.next=3;break}return e.abrupt("return");case 3:return h=lF(p.current.corners,3),m=h[0],g=h[1],v=h[2],y=(null==g||null===(r=g.location)||void 0===r?void 0:r.x)-(null==m||null===(n=m.location)||void 0===n?void 0:n.x)-100,b=(null==v||null===(o=v.location)||void 0===o?void 0:o.y)-(null==g||null===(a=g.location)||void 0===a?void 0:a.y)-100,w=performance.now(),(k=u.current).width=y,k.height=b,(C=k.getContext("2d")).drawImage(c,(null==m||null===(i=m.location)||void 0===i?void 0:i.x)+50,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+50,y,b,0,0,y,b),e.next=14,new Promise((function(e){k.toBlob(function(){var t=nF(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,MN.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(dF(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 14:return w=Math.floor(performance.now()-w),E=180-w>0?180-w:0,e.next=18,new Promise((function(e){return setTimeout(e,E)}));case 18:if(!(l.current<3)){e.next=29;break}return _=performance.now(),x=f.current,C.drawImage(x,(null==m||null===(S=m.location)||void 0===S?void 0:S.x)+50,(null==m||null===(B=m.location)||void 0===B?void 0:B.y)+50,y,b,0,0,y,b),e.next=24,new Promise((function(e){k.toBlob(function(){var t=nF(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,MN.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(dF(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 24:if(!(l.current<2)){e.next=26;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _=Math.floor(performance.now()-_),t=180-_>0?180-_:0,e.next=4,new Promise((function(e){return setTimeout(e,t)}));case 4:case"end":return e.stop()}}),e)}))(),"t0",26);case 26:l.current+=1,e.next=18;break;case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),tH=function(e,t){return!(0!==t.length&&!t.includes("vn.national_id"))||t.map((function(e){return e.replace("vn.","")})).some((function(t){var r;return(null===(r=e.split("."))||void 0===r?void 0:r.filter((function(e){return"front"!==e&&"back"!==e&&"vn"!==e}))).some((function(e){return e===t}))}))},rH=/\s/,nH=/^\s+/,oH=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&rH.test(e.charAt(t)););return t}(e)+1).replace(nH,""):e},aH=/^[-+]0x[0-9a-f]+$/i,iH=/^0b[01]+$/i,sH=/^0o[0-7]+$/i,cH=parseInt,uH=function(e){if("number"==typeof e)return e;if(gj(e))return NaN;if(WF(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=WF(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=oH(e);var r=iH.test(e);return r||sH.test(e)?cH(e.slice(2),r?2:8):aH.test(e)?NaN:+e},lH=function(e){var t=function(e){return e?1/0===(e=uH(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}(e),r=t%1;return t==t?r?t-r:t:0},dH=function(e){return function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=lH(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}(2,e)},fH=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=uH(r))==r?r:0),void 0!==t&&(t=(t=uH(t))==t?t:0),function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}(uH(e),t,r)},pH="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function hH(){return(hH=nF(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.url,n=void 0===r?pH:r,e.abrupt("return",new Promise((function(e,t){var r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("type","text/javascript"),r.setAttribute("id","opencvjs"),r.addEventListener("load",nF(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!window.cv||!window.cv.getBuildInformation){t.next=4;break}e(),t.next=12;break;case 4:if(!(window.cv instanceof Promise)){t.next=11;break}return t.next=7,window.cv;case 7:window.cv=t.sent,e(),t.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return t.stop()}}),t)})))),r.addEventListener("error",(function(){t()})),r.src=n;var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(r,o)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var mH=dH((function(){return hH.apply(this,arguments)})),gH={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},vH={vn:.4,ph:.5},yH={0:"top-left",1:"top-right",2:"bottom-right",3:"bottom-left",4:"cccd.front",5:"passport",6:"cmnd_old.front",7:"cmnd_old.back",8:"cmnd_new.front",9:"cmnd_new.back",10:"cccd_new.front",11:"cccd_new.back",12:"aadhaar_front",13:"aadhaar_back",14:"voter_front",15:"voter_back",16:"pan",17:"dl",18:"india_spassport",19:"aadhaar_letter",20:"pan_back",21:"passport_back",22:"unseen",23:"other",24:"BUREAU OF INTERNAL REVENUE",25:"COMMISSION ON ELECTIONS",26:"COVID VACCINATION CARD",27:"DRIVERS LICENSE",28:"HEALTH INSURANCE PHILHEALTH",29:"PAG-IBIG LOYALTY CARD",30:"PASSPORT",31:"PHILIPPINE IDENTIFICATION CARD",32:"POSTAL IDENTITY CARD",33:"PROFESSIONAL IDENTIFICATION CARD",34:"RESIDENT IDENTIFICATION CARD",35:"SOCIAL SECURITY SYSTEM",36:"UNIFIED MULTI PURPOSE ID",37:"VN_biz_license",38:"new_voter_front"};function bH(e){var t,r,n,o,a,i=e.card,s=e.corners,c=i.box,u={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},l=c[2]-c[0],d=c[1]-c[3],f=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=fF(e))){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){throw e})),f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){s=!0,a=e})),f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}(s);try{for(f.s();!(a=f.n()).done;){var p=a.value;switch(p.label){case"top-left":t||(t=p.location);break;case"top-right":r||(r=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":o||(o=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![t,r,n,o].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(t.x+n.x)/2,y:(t.y+n.y)/2},m={x:(r.x+o.x)/2,y:(r.y+o.y)/2},g=Vq(u,h),v=Vq(u,m);return Math.sqrt(g)>(l+d)/8||Math.sqrt(v)>(l+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var wH=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.country=t||"vn",this.defaultModelUrl=gH[this.country]||gH.vn}var t,r,n,o,a,i,s,c,u;return t=e,(r=[{key:"load",value:(u=nF(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.opencvUrl,n=t.modelUrl,e.next=3,Promise.all([mH({url:r}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"predictDummyInput",value:(c=nF(regeneratorRuntime.mark((function e(){var t,r,n,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,n=r.tidy((function(){var e=r.zeros(o.inputShape,"float32");return o.model.predict(e)})),e.abrupt("return",Promise.all([n[this.out_score_name].data()]));case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"loadModel",value:(s=nF(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,SL.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,SL.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,a=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),i=lF(a,3),this.out_score_name=i[0],this.out_class_name=i[1],this.out_box_name=i[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"loadResource",value:(i=nF(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,SL.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"dispose",value:(a=nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.model&&this.model.dispose();case 1:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"predict",value:(o=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x,T,A,I,P,R=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=R.length>1&&void 0!==R[1]?R[1]:{},n=r.imgMargin,o=r.detectThreshold,a=void 0===o?.3:o,i=r.maxNumReturns,s=void 0===i?100:i,c=window,u=c.cv,l={},d=t.width,f=t.height,l.originalWidth=d,l.originalHeight=f,p=qq({canvas:t,imgMargin:"number"==typeof n?n:vH[this.country]}),h=p.margin,m=p.mat,g=this.inputShape.slice(1,3),v=lF(g,2),y=v[0],b=v[1],w=new u.Mat,u.resize(m,w,new u.Size(y,b),0,0,u.INTER_AREA),k=m.cols/y,C=m.rows/b,(E=document.createElement("canvas")).width=y,E.height=b,E.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(w.data),w.cols,w.rows),0,0),m.delete(),w.delete(),l.canvas=E,l.margin=h,S=performance.now(),e.next=25,this.detect(E,{detectThreshold:a,maxNumReturns:s});case 25:if(B=e.sent,_=Math.floor(performance.now()-S),x={inputImage:l,card:null,exeTime:_},T=[[],[],[],[]],A=[],I=[],B.forEach((function(e){var t=lF(e.box,4),r=t[0],n=t[1],o=t[2],a=t[3];e.clazz<=3?T[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:fH(Math.floor((a+n)/2*k-h),0,d),y:fH(Math.floor((r+o)/2*C-h),0,f)},scaledLocation:{x:fH(Math.floor((a+n)/2),0,E.width),y:fH(Math.floor((r+o)/2),0,E.height)}}):I.push({label:e.label,score:e.score,box:[fH(Math.floor(r*C-h),0,f),fH(Math.floor(n*k-h),0,d),fH(Math.floor(o*C-h),0,f),fH(Math.floor(a*k-h),0,d)]})})),T.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),A.push(e[0]))})),!(I.length>0&&4===A.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),A.sort((function(e,t){return e.clazz-t.clazz})),P=I[0],e.prev=37,bH({card:P,corners:A})){e.next=41;break}return console.debug("Not qualified.",P,A),e.abrupt("return",x);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",x);case 46:return P.corners=A,x.card=P,e.abrupt("return",x);case 49:return e.abrupt("return",x);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return o.apply(this,arguments)})},{key:"detect",value:(n=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B=this,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.length>1&&void 0!==_[1]?_[1]:{},n=r.detectThreshold,o=r.maxNumReturns,a=window,i=a.tf,s=t.width,c=t.height,u=i.tidy((function(){var e=i.expandDims(i.cast(i.image.resizeBilinear(i.browser.fromPixels(t),B.inputShape.slice(1,3)),"float32"));return B.model.predict(e)})),e.next=7,Promise.all([u[this.out_score_name].data(),u[this.out_class_name].data(),u[this.out_box_name].array()]);case 7:l=e.sent,d=lF(l,3),f=d[0],p=d[1],h=lF(d[2],1),m=h[0],g=Math.min(f.length,o),v=[];try{for(y=0;y<g;y++)b=f[y],w=p[y],b>n&&(C=null!==(k=yH[Math.round(w)])&&void 0!==k?k:"NA",E=m[y],S=[E[0]*c,E[3]*s,E[2]*c,E[1]*s],v.push({score:b,clazz:w,box:S,label:C}))}catch(e){console.log(e)}return e.abrupt("return",v.length>=5?v:[]);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,r),e}();function kH(){return(kH=nF(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.blazefaceModelUrl,n=t.tfScriptUrls,o=t.closeEyesModelUrl,a=new GM(o),e.next=4,SL.loadTensorFlow(n);case 4:return e.next=6,SL.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[SL.loadBlazefaceModel({modelUrl:r}),a.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=lF(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:a});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var CH=dH((function(){return kH.apply(this,arguments)})),EH=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._onDecodeError,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._calculateScanRegion,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"environment";Zm(this,t),this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=r,this._legacyCanvasSize=t.DEFAULT_CANVAS_SIZE,this._preferredCamera=a,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof n?(this._legacyCanvasSize=n,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=n,"number"==typeof o?(this._legacyCanvasSize=o,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=o,this._scanRegion=this._calculateScanRegion(e),this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;var i=!1;e.hidden&&(e.hidden=!1,i=!0),document.body.contains(e)||(document.body.appendChild(e),i=!0),requestAnimationFrame((function(){var t=window.getComputedStyle(e);"none"===t.display&&(e.style.setProperty("display","block","important"),i=!0),"visible"!==t.visibility&&(e.style.setProperty("visibility","visible","important"),i=!0),i&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity=0,e.style.width=0,e.style.height=0)})),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),this._qrEnginePromise=t.createQrEngine()}return eg(t,[{key:"hasFlash",value:function(){var e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((function(t){var r=t.stream;return console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=r,r.getVideoTracks()[0]}))).then((function(e){return"torch"in e.getSettings()})).catch((function(){return!1})).finally((function(){if(e){var t,r=kg(e.getTracks());try{for(r.s();!(t=r.n()).done;){var n=t.value;n.stop(),e.removeTrack(n)}}catch(e){r.e(e)}finally{r.f()}}}))}},{key:"isFlashOn",value:function(){return this._flashOn}},{key:"toggleFlash",value:function(){return this._flashOn?this.turnFlashOff():this.turnFlashOn()}},{key:"turnFlashOn",value:function(){var t=this;return this._flashOn?Promise.resolve():(this._flashOn=!0,!this._active||this._paused?Promise.resolve():this.hasFlash().then((function(e){return e?t.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]}):Promise.reject("No flash available")})).catch((function(){throw t._flashOn=!1,e})))}},{key:"turnFlashOff",value:function(){if(this._flashOn)return this._flashOn=!1,this._restartVideoStream()}},{key:"destroy",value:function(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.stop(),t._postWorkerMessage(this._qrEnginePromise,"close")}},{key:"start",value:function(){var e=this;return this._active&&!this._paused?Promise.resolve():("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,document.hidden?Promise.resolve():(this._paused=!1,this.$video.srcObject?(this.$video.play(),Promise.resolve()):this._getCameraStream().then((function(t){var r=t.stream,n=t.facingMode;e.$video.srcObject=r,e.$video.play(),e._setVideoMirror(n),e._flashOn&&(e._flashOn=!1,e.turnFlashOn().catch((function(){})))})).catch((function(t){throw e._active=!1,t}))))}},{key:"stop",value:function(){this.pause(),this._active=!1}},{key:"pause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._paused=!0,!this._active)return Promise.resolve(!0);this.$video.pause();var r=function(){var t,r=kg(e.$video.srcObject?e.$video.srcObject.getTracks():[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.stop(),e.$video.srcObject.removeTrack(n)}}catch(e){r.e(e)}finally{r.f()}e.$video.srcObject=null};return t?(r(),Promise.resolve(!0)):new Promise((function(e){return setTimeout(e,300)})).then((function(){return!!e._paused&&(r(),!0)}))}},{key:"setCamera",value:function(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}},{key:"setGrayscaleWeights",value:function(e,r,n){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:r,blue:n,useIntegerApproximation:o})}},{key:"setInversionMode",value:function(e){t._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}},{key:"_onPlay",value:function(){this._scanRegion=this._calculateScanRegion(this.$video),this._scanFrame()}},{key:"_onLoadedMetaData",value:function(){this._scanRegion=this._calculateScanRegion(this.$video)}},{key:"_onVisibilityChange",value:function(){document.hidden?this.pause():this._active&&this.start()}},{key:"_calculateScanRegion",value:function(e){var t=Math.min(e.videoWidth,e.videoHeight),r=Math.round(2/3*t);return{x:Math.round((e.videoWidth-r)/2),y:Math.round((e.videoHeight-r)/2),width:r,height:r,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}},{key:"_scanFrame",value:function(){var e=this;if(!this._active||this.$video.paused||this.$video.ended)return!1;requestAnimationFrame((function(){e.$video.readyState<=1?e._scanFrame():e._qrEnginePromise.then((function(r){return t.scanImage(e.$video,e._scanRegion,r,e.$canvas)})).then(e._onDecode,(function(r){e._active&&(-1!==(r.message||r).indexOf("service unavailable")&&(e._qrEnginePromise=t.createQrEngine()),e._onDecodeError(r))})).then((function(){return e._scanFrame()}))}))}},{key:"_onDecodeError",value:function(e){e!==t.NO_QR_CODE_FOUND&&console.log(e)}},{key:"_getCameraStream",value:function(){var e=this;if(!navigator.mediaDevices)return Promise.reject("Camera not found.");var t="environment"===this._preferredCamera||"user"===this._preferredCamera?"facingMode":"deviceId",r=[{width:{min:1024}},{width:{min:768}},{}];return[].concat(mg(r.map((function(r){return Object.assign({},r,tg({},t,{exact:e._preferredCamera}))}))),r).reduceRight((function(t,r){return function(){return navigator.mediaDevices.getUserMedia({video:r,audio:!1}).then((function(t){return{stream:t,facingMode:e._getFacingMode(t)||(r.facingMode?e._preferredCamera:"environment"===e._preferredCamera?"user":"environment")}})).catch(t)}}),(function(){return Promise.reject("Camera not found.")}))()}},{key:"_restartVideoStream",value:function(){var e=this,t=this._paused;return this.pause(!0).then((function(r){if(r&&!t&&e._active)return e.start()}))}},{key:"_setVideoMirror",value:function(e){var t="user"===e?-1:1;this.$video.style.transform="scaleX("+t+")"}},{key:"_getFacingMode",value:function(e){var t=e.getVideoTracks()[0];return t?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}}],[{key:"hasCamera",value:function(){return t.listCameras(!1).then((function(e){return!!e.length})).catch((function(){return!1}))}},{key:"listCameras",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!navigator.mediaDevices)return Promise.resolve([]);var t=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((function(e){return t=e})).catch((function(){})):Promise.resolve()).then((function(){return navigator.mediaDevices.enumerateDevices()})).then((function(e){return e.filter((function(e){return"videoinput"===e.kind})).map((function(e,t){return{id:e.deviceId,label:e.label||(0===t?"Default Camera":"Camera ".concat(t+1))}}))})).finally((function(){if(t){var e,r=kg(t.getTracks());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.stop(),t.removeTrack(n)}}catch(e){r.e(e)}finally{r.f()}}}))}},{key:"scanImage",value:function(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],c=o instanceof Worker,u=Promise.all([o||t.createQrEngine(),t._loadImage(e)]).then((function(e){var s,u,l=hg(e,2),d=l[0],f=l[1];return o=d,s=hg(r._drawToCanvas(f,n,a,i),2),a=s[0],u=s[1],o instanceof Worker?(c||o.postMessage({type:"inversionMode",data:"both"}),new Promise((function(e,r){var n,i,s;i=function(a){"qrResult"===a.data.type&&(o.removeEventListener("message",i),o.removeEventListener("error",s),clearTimeout(n),null!==a.data.data?e(a.data.data):r(t.NO_QR_CODE_FOUND))},s=function(e){o.removeEventListener("message",i),o.removeEventListener("error",s),clearTimeout(n);var t=e?e.message||e:"Unknown Error";r("Scanner error: "+t)},o.addEventListener("message",i),o.addEventListener("error",s),n=setTimeout((function(){return s("timeout")}),1e4);var c=u.getImageData(0,0,a.width,a.height);o.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise((function(e,r){var n=setTimeout((function(){return r("Scanner error: timeout")}),1e4);o.detect(a).then((function(n){n.length?e(n[0].rawValue):r(t.NO_QR_CODE_FOUND)})).catch((function(e){return r("Scanner error: "+(e.message||e))})).finally((function(){return clearTimeout(n)}))}))}));return n&&s&&(u=u.catch((function(){return t.scanImage(e,null,o,a,i)}))),u=u.finally((function(){c||t._postWorkerMessage(o,"close")}))}},{key:"createQrEngine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.WORKER_PATH;return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((function(t){return-1!==t.indexOf("qr_code")?new BarcodeDetector({formats:["qr_code"]}):new Worker(e)}))}},{key:"_drawToCanvas",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];r=r||document.createElement("canvas");var o=t&&t.x?t.x:0,a=t&&t.y?t.y:0,i=t&&t.width?t.width:e.width||e.videoWidth,s=t&&t.height?t.height:e.height||e.videoHeight;if(!n){var c=t&&t.downScaledWidth?t.downScaledWidth:i,u=t&&t.downScaledHeight?t.downScaledHeight:s;r.width!==c&&(r.width=c),r.height!==u&&(r.height=u)}var l=r.getContext("2d",{alpha:!1});return l.imageSmoothingEnabled=!1,l.drawImage(e,o,a,i,s,0,0,r.width,r.height),[r,l]}},{key:"_loadImage",value:function(e){if(e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||window.ImageBitmap&&e instanceof window.ImageBitmap||window.OffscreenCanvas&&e instanceof window.OffscreenCanvas)return Promise.resolve(e);if(e instanceof Image)return t._awaitImageLoad(e).then((function(){return e}));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){var r=new Image;return e instanceof File||e instanceof Blob?r.src=URL.createObjectURL(e):r.src=e,t._awaitImageLoad(r).then((function(){return(e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(r.src),r}))}return Promise.reject("Unsupported image type.")}},{key:"_awaitImageLoad",value:function(e){return new Promise((function(t,r){var n,o;e.complete&&0!==e.naturalWidth?t():(n=function(){e.removeEventListener("load",n),e.removeEventListener("error",o),t()},o=function(){e.removeEventListener("load",n),e.removeEventListener("error",o),r("Image load error")},e.addEventListener("load",n),e.addEventListener("error",o))}))}},{key:"_postWorkerMessage",value:function(e,t,r){return Promise.resolve(e).then((function(e){e instanceof Worker&&e.postMessage({type:t,data:r})}))}}]),t}();function SH(){return BH.apply(this,arguments)}function BH(){return(BH=nF(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return EH.WORKER_PATH=YM(),e.next=3,EH.createQrEngine(EH.WORKER_PATH);case 3:return t=e.sent,e.abrupt("return",{qrEngine:t});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _H(){return xH.apply(this,arguments)}function xH(){return(xH=nF(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([SH()]);case 2:return t=e.sent,r=lF(t,1),n=r[0].qrEngine,e.abrupt("return",{qrScannerResources:{engine:n,canvas:document.createElement("canvas")},noModel:!0});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}EH.DEFAULT_CANVAS_SIZE=400,EH.NO_QR_CODE_FOUND="No QR code found",EH.WORKER_PATH="qr-scanner-worker.min.js";var TH="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function AH(){return(AH=nF(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=nF(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="detect.prototxt",r="detect.caffemodel",n="sr.prototxt",i="sr.caffemodel",o){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return u=[a(t),a(r),a(n),a(i)],e.next=11,Promise.all(u);case 11:l=e.sent,d=lF(l,4),f=d[0],p=d[1],h=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",p,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",h,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),o=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?TH:r,a=function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(t));case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:return o=e.sent,e.abrupt("return",new Uint8Array(o));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,i();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",_H());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var IH=dH((function(){return AH.apply(this,arguments)}));function PH(e){return RH.apply(this,arguments)}function RH(){return(RH=nF(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,e.abrupt("return",new Promise((function(e,t){setTimeout(t,900),r.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NH(e){return OH.apply(this,arguments)}function OH(){return(OH=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,n=!0,e.prev=2,o=performance.now(),e.next=6,PH({idCardModel:r});case 6:(a=performance.now())-o+.6*(a-o)>900&&(n=!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n=!1;case 13:return e.abrupt("return",{fastEnough:n});case 14:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function DH(){return(DH=nF(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,a=t.tfScriptUrls,i=t.wechatQRModelsUrl,s=h.length>1?h[1]:void 0,e.next=4,CH({blazefaceModelUrl:o,tfScriptUrls:a});case 4:return c=e.sent,u=c.blazefaceModel,l=!0,d=new wH(s),e.prev=8,e.next=11,d.load({opencvUrl:r,modelUrl:n});case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(8),e.abrupt("return",{ableToUseModel:!1});case 16:return e.next=18,IH({modelUrl:i});case 18:return e.prev=18,e.next=21,NH({idCardModel:d});case 21:f=e.sent,p=f.fastEnough,l=p,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),l=!1;case 29:return e.abrupt("return",{ableToUseModel:l,idCardModel:d,blazefaceModel:u});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var LH=dH((function(){return DH.apply(this,arguments)})),MH=aI.Errors;function FH(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=dv.useRef(null);null===a.current&&(a.current=document.createElement("canvas"));var i=dv.useRef(!1),s=dv.useRef(FD.createResizer({width:960,height:640})),c=dv.useRef(null),u=dv.useRef([{id:null,frames:[]}]),l=dv.useCallback((function(){!0===i.current&&(i.current=!1)}),[]),d=dv.useCallback((function(){u.current=[{id:null,frames:[]}]}),[]),f=dv.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),p=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,n,a,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,a=u.current,i=n.resize({srcCanvas:r}),c=i.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var r,n,s,u,l,d,f,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:if(r=o.frameCaptureIntervalMs,n=void 0===r?180:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:s=c.current,u=t.current,i.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=a.current).width=f,m.height=h,g=m.getContext("2d");case 13:return v=performance.now(),g.drawImage(u,l,d,f,h,0,0,f,h),e.next=18,p({workingCanvas:m});case 18:if(v=Math.floor(performance.now()-v),i.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,YN.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return dv.useEffect((function(){var e=t.current;function o(){return(o=nF(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=CO.analyzeVideoAndWindowSizes(e,n),t.next=3,h();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return r&&n&&function(){o.apply(this,arguments)}(),function(){l()}}),[r,n,t,l,f,h]),{refWorkingCanvas:a,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var UH=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,a=e.settings,i=e.shouldStartTimers,s=e.sessionTime,c=dv.useRef(),u=lF(dv.useState(0),2),l=u[0],d=u[1],f=dv.useCallback((function(){clearInterval(c.current)}),[]),p=dv.useCallback((function(){d((function(e){return e+1}))}),[]);return dv.useEffect((function(){if(i){var e=a.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var a=s-(t+=1);a<=u&&r&&r({curTimeLeft:a}),t>0&&t%e==0&&o&&o(),0===a&&(f(),n&&n())}),1e3)}return function(){f()}}),[i,t,r,f,n,o,l,a,s]),{stopTimers:f,startTimers:p}};KM.initExifData();var jH,VH,zH,qH=aI.IDCardMessage,HH=dv.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,a=e.refVideo,i=e.frontSide,s=e.cardList,c=e.settings,u=e.onCaptureDone,l=e.onUISpacingChange,d=e.outputEncryptionSettings,f=lF(dv.useState({}),2),p=f[0],h=f[1],m=p.yDescription,g=p.yMessage,v=p.yCaptureButton,y=QN.useAsset("ic_camera.svg"),b=QN.useAsset("ic_loading.png"),w=lF(dv.useState(""),2),k=w[0],C=w[1],E=hN.useSDKSettings(),S=E.debug,B=E.lang,_=lF(dv.useState(null),2),x=_[0],T=_[1],A=lF(dv.useState(""),2),I=A[0],P=A[1],R=lF(dv.useState(null),2),N=R[0],O=R[1],D=hq(),L=D.showPopup,M=D.popupShown,F=D.popupType,U=dv.useCallback((function(e){P(null===e?"":Rj(e.msg[B])({side:i?cq.FRONT[B]:cq.BACK[B]}))}),[B,i]),j=dv.useCallback((function(){T(""),L({popupType:mq})}),[L]),V=dv.useCallback((function(){T(""),u.apply(void 0,arguments)}),[u]),z=dv.useCallback((function(e){var t=e.curTimeLeft;T(Rj(qH.REMAINING_TIME[B])({x:t}))}),[B]),q=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onModelErrorChange,i=e.frontSide,s=e.cardList,c=e.onDebugInfoChange,u=e.onAboutToTimeout,l=e.onSessionTimeout,d=e.onCaptureDone,f=e.outputEncryptionSettings,p=e.quality,h=dv.useRef(!1),m=lF(dv.useState(!1),2),g=m[0],v=m[1],y=dv.useRef((function(){})),b=KN.useSDKTracking().sendEvent,w=dv.useRef(),k=dv.useRef(),C=dv.useRef(),E=hN.useSDKSettings(),S=E.debug,B=E.lang,_=E.enableAntiDebug,x=XM(),T=x.startMotion,A=x.stopMotion,I=x.motionData,P=x.orientationData;dv.useEffect((function(){_&&BL.enableAntiDebug()}),[_]);var R=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b({tag:i?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,y.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[b,i]),N=dv.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(void 0,t);var n=Uq(t,"0.code");n&&n!==w.current&&(b({tag:i?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),w.current=n)}),[a,i,b]),O=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.cardList,i=e.onError,s=e.frontSide,c=e.onAutoCaptureSuccess,u=e.quality,l=dv.useRef(null);null===l.current&&(l.current=document.createElement("canvas"));var d=dv.useRef(0),f=dv.useRef([]),p=dv.useRef(null);null===p.current&&(p.current=document.createElement("canvas"));var h=dv.useRef({}),m=dv.useRef([]),g=dv.useRef(""),v=dv.useRef(!1),y=dv.useRef(!1),b=dv.useRef(!1),w=dv.useRef(null),k=lF(dv.useState(!1),2),C=k[0],E=k[1],S=dv.useRef({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),B=dv.useRef({imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}),_=dv.useRef(!1),x=dv.useRef(!1),T=dv.useRef(null),A=dv.useRef(!1),I=dv.useRef({}),P=hN.useSDKSettings(),R=P.customUrls,N=P.country;dv.useEffect((function(){var e=!1;function t(){return(t=nF(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||C){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,LH(R,N);case 4:return I.current=t.sent,t.next=7,SL.initTensorFlow();case 7:T.current=o.enableBlurCheck&&I.current.ableToUseModel,t.next=11;break;case 10:T.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:E(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[C,o,R,N]);var O=dv.useCallback((function(e){return eH({currentWorkingCanvas:e,refVirtualWorkingCanvas:p,refCountVirtualFrames:d,refVirtualFrames:f,refWorkingCanvas:l,refCardResult:h})}),[]),D=dv.useCallback((function(){!0===b.current&&(b.current=!1)}),[]),L=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,n,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,a=o.blurThreshold,i=S.current,s=B.current,v.current=!1,!(r<a&&wO.hasBetterCardBlurScore(r,i.blurScore))){e.next=18;break}if(!A.current){e.next=10;break}i.imageBlob=s.imageBlob,e.next=14;break;case 10:return e.next=12,CO.takePicture({canvas:l.current,quality:u});case 12:i.imageBlob=e.sent,i.captureTime=Date.now();case 14:i.takenAt=(new Date).getTime(),i.blurScore=r,i.detectedCard=n,i.captureType="auto";case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,u]),M=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,x.current=!0,o=B.current,!wO.hasBetterCardBlurScore(r,o.blurScore)){e.next=14;break}return e.next=6,CO.takePicture({canvas:l.current,quality:u});case 6:o.imageBlob=e.sent,o.captureDuration+=Date.now()-o.captureTime,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,o.captureCount++,o.captureType="manual",A.current=!0;case 14:x.current=!1;case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u]),F=dv.useCallback((function(){var e=o.waitForBestImageTimeMs,t=S.current;null!==t.imageBlob&&(new Date).getTime()-t.takenAt>e&&(v.current=!0)}),[o]),U=dv.useCallback((function(){_.current=!0}),[]),j=dv.useCallback((function(){return new Promise((function(e){_.current=!1;var t=setInterval((function(){x.current||(clearInterval(t),e())}),150)}))}),[]),V=dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t=o.blurThreshold,r=o.enableVirtualCamHashes,n=B.current;n.captureTime=Date.now(),T.current?(U(),setTimeout((function(){j().then(nF(regeneratorRuntime.mark((function o(){var a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(wO.hasBetterCardBlurScore(n.blurScore,t)||(n.error=MH.id_detector_error_blur),a=l.current,null!==n.imageBlob){o.next=6;break}CO.takePicture({canvas:a,quality:u}).then(function(){var t=nF(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),!r){t.next=5;break}return t.next=5,O(a);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.next=10;break;case 6:if(!r){o.next=9;break}return o.next=9,O(a);case 9:e(n);case 10:case"end":return o.stop()}}),o)}))))}),2e3)):CO.takePicture({canvas:l.current,quality:u}).then(function(){var t=nF(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),!r){t.next=5;break}return t.next=5,O(l.current);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),[o,U,j,u,O]),z=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var r,n,u,p,k,E,x,T,P,R,U,j,V,z,q,H,K,W,G,Q,X,Y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&C&&!b.current){e.next=2;break}return e.abrupt("return");case 2:S.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},B.current={imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0},r=o.enableAutoCapture,n=o.enableBlurCheck,u=o.enableIdDetection,p=o.country,k=o.enableVirtualCamHashes,E=I.current,x=E.idCardModel,T=E.blazefaceModel,P=E.ableToUseModel,R=w.current,U=t.current,b.current=!0,j=R.cropX,V=R.cropY,z=R.cropWidth,q=R.cropHeight,H=R.cropWidthWithoutPadding,K=R.cropHeightWithoutPadding,(W=l.current).width=z,W.height=q,G=W.getContext("2d"),Q=document.createElement("canvas"),X=Q.getContext("2d"),Y=function(){var e=nF(regeneratorRuntime.mark((function e(){var t,w,C,E,I,R,$,Z;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(G.drawImage(U,j,V,z,q,0,0,z,q),t=performance.now(),A.current=!1,!u||!P){e.next=68;break}return w=null,e.next=7,x.predict(W,{detectThreshold:.3});case 7:if(C=e.sent,null==o||!o.trackCardCoordinates||B.current.imageBlob||S.current.imageBlob||Jq(m,Zq(C),null==o?void 0:o.trackCardCoordinatesMaxLength),!C.card){e.next=65;break}if(!v.current&&r||(h.current=C.card),!v.current&&!B.current.imageBlob&&f.current.length>0&&(f.current=[],d.current=0,v.current=!1,y.current=!1),v.current&&!y.current&&(k&&setTimeout(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(y.current=!0,!k){e.next=4;break}return e.next=4,O(l.current);case 4:return e.next=6,c(S.current);case 6:D();case 7:case"end":return e.stop()}}),e)}))),0),v.current=!1,y.current=!1),!Wq({corners:C.card.corners,width:z,height:q})){e.next=62;break}if(!Xq(C.card.corners)){e.next=59;break}if(E=Hq(W,C.card.corners),I=IO.rectAreaRatio({small:{area:E.width*E.height},big:{area:H*K}}),!Uq(o,"enableCardTypeCheck")||"vn"!==p){e.next=26;break}R=Uq(C,"card.label",""),g.current=R,tH(R,a)||(w=MH.not_allowed_card_types),e.next=57;break;case 26:if(!(I<.5)){e.next=30;break}w=MH.id_detector_card_too_small,e.next=57;break;case 30:if(!(I>.95)){e.next=34;break}w=MH.id_detector_error_incomplete,e.next=57;break;case 34:return Q.width=E.width,Q.height=E.height,X.putImageData(E,0,0),e.next=39,Gq({canvas:Q});case 39:if(!e.sent){e.next=44;break}w=MH.glare_detected,e.next=57;break;case 44:if("ph"===N){e.next=48;break}return e.next=47,Yq({blazefaceModel:T,predictedIdCardCanvas:Q,frontSide:s});case 47:w=e.sent;case 48:if(w){e.next=57;break}if(!n){e.next=57;break}if($=wO.calculateIdCardBlurScore({canvas:Q}),!_.current){e.next=54;break}return e.next=54,M({blurScore:$,detectedCard:C.card});case 54:if(!r){e.next=57;break}return e.next=57,L({blurScore:$,detectedCard:C.card});case 57:e.next=60;break;case 59:w=MH.id_detector_validate_angle_error;case 60:e.next=63;break;case 62:w=MH.id_detector_error_incomplete;case 63:e.next=66;break;case 65:w=MH.id_detector_no_cards;case 66:i(w),F();case 68:return t=Math.floor(performance.now()-t),Z=180-t>0?180-t:0,e.next=72,new Promise((function(e){return setTimeout(e,Z)}));case 72:b.current&&window.requestAnimationFrame(Y);case 73:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(Y);case 19:case"end":return e.stop()}}),e)}))),[o,C,t,i,F,c,D,N,O,s,a,M,L]);dv.useEffect((function(){var e=t.current;function o(){return(o=nF(regeneratorRuntime.mark((function t(){var r,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(w.current=CO.analyzeVideoAndWindowSizes(e,n,.05),r=w.current,o=r.cropWidth,a=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(a)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,z();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&C&&function(){o.apply(this,arguments)}()}),[r,n,t,D,z,C]);var q=dv.useCallback((function(){D()}),[D]);return dv.useEffect((function(){return q}),[q]),{refWorkingCanvas:l,refCardLabel:g,stopCheckFrame:D,checkFrame:z,warmupDone:C,takePictureManually:V,refAbleToRunBurstMode:T,refVirtualFrames:f,refCardCoordinates:m}}({refVideo:r,shouldStart:t,cropArea:n,cardList:s,settings:o,onError:N,frontSide:i,onAutoCaptureSuccess:R,quality:p}),D=O.refWorkingCanvas,L=O.refCardLabel,M=O.stopCheckFrame,F=O.checkFrame,U=O.warmupDone,j=O.takePictureManually,V=O.refAbleToRunBurstMode,z=O.refVirtualFrames,q=O.refCardCoordinates,H=FH({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),K=H.stopCheckFrame,W=H.splitVideos,G=H.resetRecordedVideos,Q=H.checkFrame;!function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,a=e.onChange;dv.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,i=n.current,s=t[t.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==i?void 0:i.width,"canvas.height":null==i?void 0:i.height};a&&a(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[a,t,r,n,o])}({debug:S,refRecordedVideos:H.refRecordedVideos,refWorkingCanvas:D,refVideo:r,onChange:c});var X=dv.useCallback((function(){K(),M(),G(),l()}),[G,K,M,l]),Y=dv.useCallback((function(){W()}),[W]),$=UH({lang:B,onAboutToTimeout:u,onSessionTimeout:X,onVideoTimeLimitReached:Y,settings:o,shouldStartTimers:U&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),Z=$.stopTimers,J=$.startTimers,ee=dv.useCallback((function(){h.current=!1}),[]),te=dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee(),J(),e.next=4,Promise.all([Q(),F()]);case 4:case"end":return e.stop()}}),e)}))),[ee,J,Q,F]),re=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var t,r,n,a,s,c,u,l,p,m,g,y,w,E,S,B,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_.length>0&&void 0!==_[0]?_[0]:{},r=t.imageBlob,n=t.error,a=t.detectedCard,s=t.captureTime,c=t.captureCount,u=t.captureDuration,l=t.captureType,!h.current){e.next=3;break}return e.abrupt("return");case 3:return h.current=!0,v(!0),K(),M(),Z(),N(null),p=null==o?void 0:o.enableVirtualCamHashes,m={},p&&(g=z).current.length>0&&(m=g.current.reduce((function(e,t,r){return sF(sF({},e),{},oF({},"hash".concat(r+1),t))}),m)),y=null==o?void 0:o.trackCardCoordinates,w="[".concat(q.current.toString(),"]"),A(),KM.preWriteExif({mode:KM.MODE.ID_CARD,motionData:I,orientationData:P,startTime:k.current,endTime:Date.now()}),e.next=18,KM.writeExif({mode:KM.MODE.ID_CARD,imageData:sF(sF({detectedCard:a,captureTime:s,blob:r},p?{vCam:m}:{}),{},{captureCount:c,captureDuration:u,captureType:l},y?{cardTracking:w}:{}),enableExifData:null==o?void 0:o.enableExifData});case 18:if(E=e.sent,!f||!f.key){e.next=24;break}return B=f.key,e.next=23,TL.encrypt({blob:E,key:B});case 23:S=e.sent;case 24:d({image:{blob:E,encrypted:S,detectedCard:a},error:n,recordedVideos:[]}),v(!1),b({tag:i?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-C.current)/1e3}});case 27:case"end":return e.stop()}}),e)}))),[K,M,Z,N,d,i,b,f,I,P,A,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,null==o?void 0:o.trackCardCoordinates,z,q]);y.current=re;var ne=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),Z(),K(),V.current||M(),e.next=6,j();case 6:return t=e.sent,e.next=9,re(t);case 9:v(!1),b({tag:i?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[j,re,Z,V,K,M,b,i]);return dv.useEffect((function(){t&&(b({tag:i?"id_front":"id_back",event:"user_activity.start",log:{}}),k.current=Date.now(),T())}),[b,i,t,T]),dv.useEffect((function(){U&&(b({tag:i?"id_front":"id_back",event:"user_activity.show",log:{}}),b({tag:i?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-k.current}}),C.current=performance.now())}),[b,i,U]),{refCardLabel:L,warmupDone:U,isProcessing:g,takePictureManually:ne,restartSession:te,resetIsProcessingImageBlobTaken:ee}}({shouldStart:!0,refVideo:a,cropArea:N,settings:c,onModelErrorChange:U,frontSide:i,cardList:s,onDebugInfoChange:C,onSessionTimeout:j,onCaptureDone:V,onAboutToTimeout:z,outputEncryptionSettings:d}),H=q.refCardLabel,K=q.warmupDone,W=q.isProcessing,G=q.takePictureManually,Q=q.restartSession,X=q.resetIsProcessingImageBlobTaken,Y=dv.useCallback((function(){L({popupType:null}),X()}),[L,X]),$=dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Y(),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q,Y]);dv.useEffect((function(){if(o){var e,t,r,a,i,s,c,u=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,p=o.lostY,m=o.clientHeight;n?(i=.7*(s=d-165),r=(c=(e=p+10)+45)+20,a=(t=c+s+10)+60):(i=OF.isMobile?u-6:Math.floor(.7*u),r=(c=(e=p+10)+50)+20,a=(t=c+(s=Math.floor(Math.min(i/1.5,m-2*p-80-100)))+10)+60);var g=Math.floor((u-i)/2)+f;O({x:g,y:c,width:i,height:s,surroundStyle:{opacity:.6,background:"#000"}});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:a};h(v),l(v)}}),[o,n,l]);var Z=dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(""),e.next=3,G();case 3:case"end":return e.stop()}}),e)}))),[G]);return dv.useImperativeHandle(t,(function(){return{restartSession:$}}),[$]),dv.createElement(dv.Fragment,null,!K&&dv.createElement(oq,null),S&&dv.createElement($z,null,k),W&&dv.createElement(Wz,null,dv.createElement("img",{src:b,alt:"",className:"spin"})),N&&dv.createElement(Fj,{x:"".concat(N.x,"px"),y:"".concat(N.y,"px"),width:"".concat(N.width,"px"),height:"".concat(N.height,"px"),surroundStyle:N.surroundStyle},dv.createElement(tq,{width:N.width,height:N.height,type:I?"error":pz})),!I&&dv.createElement(Zz,{y:"".concat(m,"px"),className:"description"},r),dv.createElement("div",{style:{position:"fixed",bottom:0,left:0,color:"#fff",padding:30}},H.current),I&&dv.createElement(Jz,{y:"".concat(m,"px")},I),!W&&(!(null!=c&&c.disableCaptureButtonIfAlert)||!I)&&dv.createElement(Kz,{onClick:Z,y:"".concat(v,"px")},dv.createElement("img",{src:y,alt:""})),x&&dv.createElement(eq,{key:x,className:"message",y:"".concat(g,"px")},x),dv.createElement(fz,{open:M},F===mq&&dv.createElement(pq,{onOk:$,maxSessionTime:null==c?void 0:c.idCardSessionTime})))}));HH.propTypes={usePortraitMask:Lv.bool,description:Lv.string,windowAndVideoInfo:Lv.shape({}),refVideo:Lv.shape({}),frontSide:Lv.bool,cardList:Lv.bool,settings:Lv.shape({}),onCaptureDone:Lv.func,onUISpacingChange:Lv.func,outputEncryptionSettings:Lv.shape({})},HH.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,cardList:[],settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var KH,WH,GH=aw.div(jH||(jH=uF(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: 8px;\n top: ",";\n position: absolute;\n z-index: ",";\n color: #fff;\n padding: 10px;\n margin: 0 10px;\n max-width: 275px;\n text-align: center;\n"])),(function(e){return e.background}),(function(e){return e.y}),1020),QH=aw.div(VH||(VH=uF(["\n width: 0;\n height: 0;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n border-bottom: ",";\n position: absolute;\n left: 50%;\n top: ",";\n transform: translateX(-50%);\n"])),(function(e){return"".concat(e.arrowSize,"px solid ").concat(e.color)}),(function(e){return"".concat(e.top,"px")})),XH=function(e){var t=e.children,r=e.y;return dv.createElement(GH,{y:r,background:"#00ce78"},dv.createElement(QH,{arrowSize:10,top:-10,color:"#00ce78"}),t)},YH=aw.div(zH||(zH=uF(["\n text-align: center;\n position: absolute;\n font-size: 18px;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),$H={QR_INSTRUCTIONS_TEXT:{en:dv.createElement("span",null,"Please follow the instructions below to scan QR code:",dv.createElement("br",null),dv.createElement("br",null)," Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),vi:dv.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên CCCD. Canh vừa mã QR vào 4 góc khung hình để quét mã")},QR_INSTRUCTIONS_START_BUTTON:{en:"Scan QR code",vi:"Tiến hành quét mã QR"},QR_INSTRUCTIONS_COUNTDOWN:{en:"Start in <%= x %> s",vi:"Bắt đầu trong <%= x %> giây"},QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR"},REMAINING_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"},SESSION_TIMEOUT_POPUP_DESCRIPTION:{en:dv.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",dv.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn."),vi:dv.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",dv.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn.")},SESSION_TIMEOUT_POPUP_RETRY_BUTTON:{en:"Retry",vi:"Thực hiện lại"},SESSION_TIMEOUT_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"}},ZH=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,a=e.mr,i=e.mx,s=e.my,c=e.pt,u=e.pb,l=e.pl,d=e.pr,f=e.px,p=e.py,h=t.props.style||{},m={};return null!==i&&(m.marginLeft=i,m.marginRight=i),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==a&&(m.marginRight=a),null!==f&&(m.paddingLeft=f,m.paddingRight=f),null!==p&&(m.paddingTop=p,m.paddingBottom=p),null!==c&&(m.paddingTop=c),null!==u&&(m.paddingBottom=u),null!==l&&(m.paddingLeft=l),null!==d&&(m.paddingRight=d),dv.cloneElement(t,{style:sF(sF({},h),m)})};ZH.propTypes={mt:Lv.string,ml:Lv.string,mr:Lv.string,mb:Lv.string,mx:Lv.string,my:Lv.string,pt:Lv.string,pl:Lv.string,pr:Lv.string,pb:Lv.string,px:Lv.string,py:Lv.string},ZH.defaultProps={mt:null,ml:null,mr:null,mb:null,mx:null,my:null,pt:null,pl:null,pr:null,pb:null,px:null,py:null};var JH,eK,tK,rK=aw.button(KH||(KH=uF(["\n width: 100%;\n max-width: 294px;\n height: 66px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 3px;\n color: #fff;\n font-weight: normal;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),nK=aw.a(WH||(WH=uF(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),oK=aw.div(JH||(JH=uF(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),aK=aw.div(eK||(eK=uF(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),iK=aw.div(tK||(tK=uF(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),sK=function(e){var t=e.onRetry,r=e.onSkip,n=hN.useSDKSettings().lang;return dv.createElement(oK,null,dv.createElement(ZH,{mt:"25px"},dv.createElement(aK,null,$H.QR_INVALID_POPUP_TITLE[n])),dv.createElement(ZH,{mt:"30px"},dv.createElement(iK,null,$H.QR_INVALID_POPUP_DESCRIPTION[n])),dv.createElement(ZH,{mt:"30px"},dv.createElement(rK,{onClick:t},$H.QR_INVALID_POPUP_RETRY_BUTTON[n])),dv.createElement(ZH,{my:"20px"},dv.createElement(nK,{onClick:r},$H.QR_INVALID_POPUP_SKIP_BUTTON[n])))};sK.propTypes={onRetry:Lv.func,onSkip:Lv.func},sK.defaultProps={onRetry:function(){},onSkip:function(){}};var cK,uK,lK,dK,fK,pK,hK,mK=["children","ratio","padding"],gK=aw.div(cK||(cK=uF(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),vK=aw.div(uK||(uK=uF(["\n position: absolute;\n top: ",";\n left: ",";\n right: ",";\n bottom: ",";\n"])),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding})),yK=function(e){var t=e.children,r=e.ratio,n=e.padding,o=cF(e,mK);return dv.createElement(gK,aF({ratio:r},o),dv.createElement(vK,{padding:n},t))};yK.propTypes={children:Lv.node,ratio:Lv.number,padding:Lv.string},yK.defaultProps={children:null,ratio:4/3,padding:"0"};var bK=aw.div(lK||(lK=uF(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),wK=aw.div(dK||(dK=uF(["\n background: #e7e6e6;\n width: 100%;\n"]))),kK=aw.img(fK||(fK=uF(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),CK=aw.div(pK||(pK=uF(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n line-height: 20px;\n"])),(function(e){return e.theme.tsSecondary})),EK=aw(CK)(hK||(hK=uF(["\n white-space: nowrap;\n"]))),SK=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=hN.useSDKSettings().lang,a=QN.useAsset("qr_code_banner.png"),i=dv.useRef(n),s=lF(dv.useState((function(){return Rj($H.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),c=s[0],u=s[1],l=KN.useSDKTracking().sendEvent,d=dv.useRef(!1);return dv.useEffect((function(){l({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[l]),dv.useEffect((function(){var e=Rj($H.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){i.current--,u(e({x:i.current})),i.current<=0&&(clearInterval(t),d.current||l({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),r&&r())}),1e3);return function(){clearInterval(t)}}),[o,r]),dv.createElement(bK,null,dv.createElement(wK,null,dv.createElement(yK,{ratio:1.6},dv.createElement(kK,{src:a}))),dv.createElement(ZH,{mt:"30px"},dv.createElement(CK,null,$H.QR_INSTRUCTIONS_TEXT[o])),dv.createElement(ZH,{mt:"30px"},dv.createElement(rK,{onClick:function(){l({tag:"id_qr",event:"user_activity.click_start",log:{}}),d.current=!0,t()}},$H.QR_INSTRUCTIONS_START_BUTTON[o])),dv.createElement(ZH,{my:"20px"},dv.createElement(EK,null,c)))};SK.propTypes={onClickStart:Lv.func,onTimeout:Lv.func,timeout:Lv.number},SK.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var BK=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function _K(e){var t=e.canvas,r=e.qrModel,n=window.cv,o=n.imread(t,n.IMREAD_GRAYSCALE);return r.detectAndDecode(o).get(0)}var xK=function(){var e=nF(regeneratorRuntime.mark((function e(t,r){var n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,IH();case 2:if(n=e.sent,o=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return a=document.createElement("canvas"),i=a.getContext("2d"),e.next=11,new Promise((function(e){var r=URL.createObjectURL(t),n=new Image;n.onload=function(){var t=n.width,o=n.height;a.width=t/2,a.height=o/2,i.drawImage(n,t/2,0,a.width,a.height,0,0,a.width,a.height),URL.revokeObjectURL(r),e()},n.src=r}));case 11:return e.next=13,_K({canvas:a,qrModel:o});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,KM.writeExif({mode:"",imageData:{blob:t,result:s,type:"qr_from_front_image"},enableExifData:!0});case 18:if(c=e.sent,!r||!r.key){e.next=24;break}return l=r.key,e.next=23,TL.encrypt({imageBlobWithExif:c,key:l});case 23:u=e.sent;case 24:return e.abrupt("return",{result:s,validateResult:{valid:!0},image:{blob:c,encrypted:u},recordedVideos:[]});case 25:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),TK=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(RF((function(e,t){var r;r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height||!this.data[t*this.width+e])},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,o){for(var a=t;a<t+n;a++)for(var i=e;i<e+r;i++)this.set(i,a,!!o)},e}();t.BitMatrix=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.addOrSubtractGF=function(e,t){return e^t};var o=function(){function e(e,t,r){this.primitive=e,this.size=t,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var o=1,a=0;a<this.size;a++)this.expTable[a]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,t){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===t)return this.zero;var r=new Uint8ClampedArray(e+1);return r[0]=t,new n.default(this,r)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=function(){function e(e,t){if(0===t.length)throw new Error("No coefficients.");this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;if(n===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-n);for(var o=0;o<this.coefficients.length;o++)this.coefficients[o]=t[n+o]}}else this.coefficients=t}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(t){var r;if(this.isZero())return t;if(t.isZero())return this;var o=this.coefficients,a=t.coefficients;o.length>a.length&&(o=(r=[a,o])[0],a=r[1]);for(var i=new Uint8ClampedArray(a.length),s=a.length-o.length,c=0;c<s;c++)i[c]=a[c];for(c=s;c<a.length;c++)i[c]=n.addOrSubtractGF(o[c-s],a[c]);return new e(this.field,i)},e.prototype.multiply=function(t){if(0===t)return this.field.zero;if(1===t)return this;for(var r=this.coefficients.length,n=new Uint8ClampedArray(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,n)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var r=this.coefficients,o=r.length,a=t.coefficients,i=a.length,s=new Uint8ClampedArray(o+i-1),c=0;c<o;c++)for(var u=r[c],l=0;l<i;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,a[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new Error("Invalid degree less than 0");if(0===r)return this.field.zero;for(var n=this.coefficients.length,o=new Uint8ClampedArray(n+t),a=0;a<n;a++)o[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,o)},e.prototype.evaluateAt=function(e){var t=0;if(0===e)return this.getCoefficient(0);var r=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){t=n.addOrSubtractGF(t,e)})),t;t=this.coefficients[0];for(var o=1;o<r;o++)t=n.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[o]);return t},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(5),a=r(11),i=r(12);function s(e){var t=i.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=a.extract(e,s),u=o.decode(c.matrix);if(u)return{binaryData:u.bytes,data:u.text,chunks:u.chunks,version:u.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:"attemptBoth"};function u(e,t,r,o){void 0===o&&(o={});var a=c;Object.keys(a||{}).forEach((function(e){a[e]=o[e]||a[e]}));var i="attemptBoth"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,u="onlyInvert"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,l=n.binarize(e,t,r,i),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==a.inversionAttempts&&"invertFirst"!==a.inversionAttempts||(p=s(u?d:f)),p}u.default=u,t.default=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r){return e<t?t:e>r?r:e}var a=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,i){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new a(t,r),c=0;c<t;c++)for(var u=0;u<r;u++){var l=e[4*(u*t+c)+0],d=e[4*(u*t+c)+1],f=e[4*(u*t+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(t/8),h=Math.ceil(r/8),m=new a(p,h),g=0;g<h;g++)for(var v=0;v<p;v++){var y=0,b=1/0,w=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var k=s.get(8*v+c,8*g+u);y+=k,b=Math.min(b,k),w=Math.max(w,k)}var C=y/Math.pow(8,2);if(w-b<=24&&(C=b/2,g>0&&v>0)){var E=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<E&&(C=E)}m.set(v,g,C)}var S=n.BitMatrix.createEmpty(t,r),B=null;for(i&&(B=n.BitMatrix.createEmpty(t,r)),g=0;g<h;g++)for(v=0;v<p;v++){for(var _=o(v,2,p-3),x=o(g,2,h-3),T=(y=0,-2);T<=2;T++)for(var A=-2;A<=2;A++)y+=m.get(_+T,x+A);var I=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var P=s.get(c,u);S.set(c,u,P<=I),i&&B.set(c,u,!(P<=I))}}return i?{binarized:S,inverted:B}:{binarized:S}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),a=r(9),i=r(10);function s(e,t){for(var r=e^t,n=0;r;)n++,r&=r-1;return n}function c(e,t){return t<<1|e}var u=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],l=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e,t,r){for(var o=l[r.dataMask],a=e.height,i=function(e){var t=17+4*e.versionNumber,r=n.BitMatrix.createEmpty(t,t);r.setRegion(0,0,9,9,!0),r.setRegion(t-8,0,8,9,!0),r.setRegion(0,t-8,9,8,!0);for(var o=0,a=e.alignmentPatternCenters;o<a.length;o++)for(var i=a[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===i&&6===u||6===i&&u===t-7||i===t-7&&6===u||r.setRegion(i-2,u-2,5,5,!0)}return r.setRegion(6,9,1,t-17,!0),r.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),s=[],u=0,d=0,f=!0,p=a-1;p>0;p-=2){6===p&&p--;for(var h=0;h<a;h++)for(var m=f?a-1-h:h,g=0;g<2;g++){var v=p-g;if(!i.get(v,m)){d++;var y=e.get(v,m);o({y:m,x:v})&&(y=!y),u=c(y,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var t=function(e){var t=e.height,r=Math.floor((t-17)/4);if(r<=6)return i.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var a=t-9;a>=t-11;a--)n=c(e.get(a,o),n);var u=0;for(a=5;a>=0;a--)for(o=t-9;o>=t-11;o--)u=c(e.get(a,o),u);for(var l,d=1/0,f=0,p=i.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var m=s(n,h.infoBits);m<d&&(l=h,d=m),(m=s(u,h.infoBits))<d&&(l=h,d=m)}return d<=3?l:void 0}(e);if(!t)return null;var r=function(e){for(var t=0,r=0;r<=8;r++)6!==r&&(t=c(e.get(r,8),t));for(var n=7;n>=0;n--)6!==n&&(t=c(e.get(8,n),t));var o=e.height,a=0;for(n=o-1;n>=o-7;n--)a=c(e.get(8,n),a);for(r=o-8;r<o;r++)a=c(e.get(r,8),a);for(var i=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,m=p.formatInfo;if(h===t||h===a)return m;var g=s(t,h);g<i&&(l=m,i=g),t!==a&&(g=s(a,h))<i&&(l=m,i=g)}return i<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],a=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),a+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<a)return null;e=e.slice(0,a);for(var i=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<i;s++)for(var c=0,u=o;c<u.length;c++)u[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var l=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)o[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=o;f<p.length;f++)p[f].codewords.push(e.shift());return o}(d(e,t,r),t,r.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,t){return e+t.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,m=n;h<m.length;h++){var g=m[h],v=a.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[p++]=v[y]}try{return o.decode(f,t.versionNumber)}catch(e){return null}}t.decode=function(e){if(null==e)return null;var t=f(e);if(t)return t;for(var r=0;r<e.width;r++)for(var n=r+1;n<e.height;n++)e.get(r,n)!==e.get(n,r)&&(e.set(r,n,!e.get(r,n)),e.set(n,r,!e.get(n,r)));return f(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o,a=r(7),i=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],a=e.readBits(o);a>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var i=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+i,48+s,48+c),n+=i.toString()+s.toString()+c.toString(),a-=3}if(2===a){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");i=Math.floor(u/10),s=u%10,r.push(48+i,48+s),n+=i.toString()+s.toString()}else if(1===a){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+u),n+=u.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(o||(o={}));var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(e,t){for(var r=[],n="",o=[9,11,13][t],a=e.readBits(o);a>=2;){var i=e.readBits(11),s=Math.floor(i/45),u=i%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],a-=2}return 1===a&&(s=e.readBits(6),r.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:r,text:n}}function l(e,t){for(var r=[],n="",o=[8,16,16][t],a=e.readBits(o),i=0;i<a;i++){var s=e.readBits(8);r.push(s)}try{n+=decodeURIComponent(r.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:r,text:n}}function d(e,t){for(var r=[],n="",o=[8,10,12][t],a=e.readBits(o),s=0;s<a;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,r.push(u>>8,255&u),n+=String.fromCharCode(i.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,i,c,f,p=new a.BitStream(e),h=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};p.available()>=4;){var g=p.readBits(4);if(g===o.Terminator)return m;if(g===o.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===o.Numeric){var v=s(p,h);m.text+=v.text,(r=m.bytes).push.apply(r,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===o.Alphanumeric){var y=u(p,h);m.text+=y.text,(i=m.bytes).push.apply(i,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===o.Byte){var b=l(p,h);m.text+=b.text,(c=m.bytes).push.apply(c,b.bytes),m.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(g===o.Kanji){var w=d(p,h);m.text+=w.text,(f=m.bytes).push.apply(f,w.bytes),m.chunks.push({type:n.Kanji,bytes:w.bytes,text:w.text})}}if(0===p.available()||0===p.readBits(p.available()))return m}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e<r?e:r,o=255>>8-n<<(a=r-n);t=(this.bytes[this.byteOffset]&o)>>a,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var a;e>0&&(o=255>>(a=8-e)<<a,t=t<<e|(this.bytes[this.byteOffset]&o)>>a,this.bitOffset+=e)}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var a=new n.default(285,256,0),i=new o.default(a,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=i.evaluateAt(a.exp(u+a.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(a,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var a=t,i=r,s=e.zero,c=e.one;i.degree()>=n/2;){var u=a,l=s;if(s=c,(a=i).isZero())return null;i=u;for(var d=e.zero,f=a.getCoefficient(a.degree()),p=e.inverse(f);i.degree()>=a.degree()&&!i.isZero();){var h=i.degree()-a.degree(),m=e.multiply(i.getCoefficient(i.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),i=i.addOrSubtract(a.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),i.degree()>=a.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),i.multiply(v)]}(a,a.buildMonomial(t,1),d,t);if(null===f)return null;var p=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),o=0,a=1;a<e.size&&o<r;a++)0===t.evaluateAt(a)&&(n[o]=e.inverse(a),o++);return o!==r?null:n}(a,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,a=new Array(o),i=0;i<o;i++){for(var s=e.inverse(r[i]),c=1,u=0;u<o;u++)i!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));a[i]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(a[i]=e.multiply(a[i],s))}return a}(a,f[1],p),m=0;m<p.length;m++){var g=r.length-1-a.log(p[m]);if(g<0)return null;r[g]=n.addOrSubtractGF(r[g],h[m])}return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r,n){var o=e.x-t.x+r.x-n.x,a=e.y-t.y+r.y-n.y;if(0===o&&0===a)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:r.x-t.x,a22:r.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var i=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=i*u-s*c,d=(o*u-s*a)/l,f=(i*a-o*c)/l;return{a11:t.x-e.x+d*t.x,a12:t.y-e.y+d*t.y,a13:d,a21:n.x-e.x+f*n.x,a22:n.y-e.y+f*n.y,a23:f,a31:e.x,a32:e.y,a33:1}}t.extract=function(e,t){for(var r=function(e,t,r,n){var a=o({x:3.5,y:3.5},t,r,n);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}(0,{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),a=function(e,t){return{a11:e.a11*t.a11+e.a21*t.a12+e.a31*t.a13,a12:e.a12*t.a11+e.a22*t.a12+e.a32*t.a13,a13:e.a13*t.a11+e.a23*t.a12+e.a33*t.a13,a21:e.a11*t.a21+e.a21*t.a22+e.a31*t.a23,a22:e.a12*t.a21+e.a22*t.a22+e.a32*t.a23,a23:e.a13*t.a21+e.a23*t.a22+e.a33*t.a23,a31:e.a11*t.a31+e.a21*t.a32+e.a31*t.a33,a32:e.a12*t.a31+e.a22*t.a32+e.a32*t.a33,a33:e.a13*t.a31+e.a23*t.a32+e.a33*t.a33}}(o(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft),r),i=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=a.a13*e+a.a23*t+a.a33;return{x:(a.a11*e+a.a21*t+a.a31)/r,y:(a.a12*e+a.a22*t+a.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);i.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:i,mappingFunction:s}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function o(e){return e.reduce((function(e,t){return e+t}))}function a(e,t,r,o){var a,i,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(t.y-e.y)>Math.abs(t.x-e.x);l?(a=Math.floor(e.y),i=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(a=Math.floor(e.x),i=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-a),f=Math.abs(c-i),p=Math.floor(-d/2),h=a<s?1:-1,m=i<c?1:-1,g=!0,v=a,y=i;v!==s+h;v+=h){var b=l?y:v,w=l?v:y;if(r.get(b,w)!==g&&(g=!g,u.push({x:b,y:w}),u.length===o+1))break;if((p+=f)>0){if(y===c)break;y+=m,p-=d}}for(var k=[],C=0;C<o;C++)u[C]&&u[C+1]?k.push(n(u[C],u[C+1])):k.push(0);return k}function i(e,t,r,n){var o,i=t.y-e.y,s=t.x-e.x,c=a(e,t,r,Math.ceil(n/2)),u=a(e,{x:e.x-s,y:e.y-i},r,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(o=u.concat(l)).concat.apply(o,c)}function s(e,t){var r=o(e)/o(t),n=0;return t.forEach((function(t,o){n+=Math.pow(e[o]-t*r,2)})),{averageSize:r,error:n}}function c(e,t,r){try{var n=i(e,{x:-1,y:e.y},r,t.length),o=i(e,{x:e.x,y:-1},r,t.length),a=i(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=i(e,{x:Math.min(r.width,e.x+e.y)+1,y:Math.min(r.height,e.y+e.x)+1},r,t.length),u=s(n,t),l=s(o,t),d=s(a,t),f=s(c,t),p=Math.sqrt(u.error*u.error+l.error*l.error+d.error*d.error+f.error*f.error),h=(u.averageSize+l.averageSize+d.averageSize+f.averageSize)/4;return p+(Math.pow(u.averageSize-h,2)+Math.pow(l.averageSize-h,2)+Math.pow(d.averageSize-h,2)+Math.pow(f.averageSize-h,2))/h}catch(e){return 1/0}}function u(e,t){for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r--;for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n++;for(var o=(r+n)/2,a=Math.round(t.y);e.get(Math.round(o),a);)a--;for(var i=Math.round(t.y);e.get(Math.round(o),i);)i++;return{x:o,y:(a+i)/2}}function l(e,t,r,a,s){var u,l,d;try{u=function(e,t,r,a){var s=(o(i(e,r,a,5))/7+o(i(e,t,a,5))/7+o(i(r,e,a,5))/7+o(i(t,e,a,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,t)/s),u=Math.round(n(e,r)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(a,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-a.x+s.x,p=r.y-a.y+s.y,h=(n(a,s)+n(a,r))/2/d,m=1-3/h,g={x:a.x+m*(f-a.x),y:a.y+m*(p-a.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,a=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(a)))return o([t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1]),{x:r,y:a,score:c({x:Math.floor(r),y:Math.floor(a)},[1,1,1],e)+n({x:r,y:a},g)}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));return{alignmentPattern:h>=15&&v.length?v[0]:g,dimension:l}}t.locate=function(e){for(var t=[],r=[],a=[],i=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var a=e.get(t,n);if(a===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=a;var l=o(u)/7,d=Math.abs(u[0]-l)<l&&Math.abs(u[1]-l)<l&&Math.abs(u[2]-3*l)<3*l&&Math.abs(u[3]-l)<l&&Math.abs(u[4]-l)<l&&!a,f=o(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&a;if(d){var h=t-u[3]-u[4],m=h-u[2],g={startX:m,endX:h,y:n};(v=r.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||h>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&h>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:r.push({top:g,bottom:g})}if(p){var v,y=t-u[4],b=y-u[3];g={startX:b,y:n,endX:y},(v=i.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||y>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&y>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:i.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)l(d);t.push.apply(t,r.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),r=r.filter((function(e){return e.bottom.y===n})),a.push.apply(a,i.filter((function(e){return e.bottom.y!==n}))),i=i.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);t.push.apply(t,r.filter((function(e){return e.bottom.y-e.top.y>=2}))),a.push.apply(a,i);var f=t.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],i=o(a)/a.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:i}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score})).map((function(e,t,r){if(t>4)return null;var n=r.filter((function(e,r){return t!==r})).map((function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}})).sort((function(e,t){return e.score-t.score}));if(n.length<2)return null;var o=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:o}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));if(0===f.length)return null;var p=function(e,t,r){var o,a,i,s,c,u,l,d=n(e,t),f=n(t,r),p=n(e,r);return f>=d&&f>=p?(c=(o=[t,e,r])[0],u=o[1],l=o[2]):p>=f&&p>=d?(c=(a=[e,t,r])[0],u=a[1],l=a[2]):(c=(i=[e,r,t])[0],u=i[1],l=i[2]),(l.x-u.x)*(c.y-u.y)-(l.y-u.y)*(c.x-u.x)<0&&(c=(s=[l,c])[0],l=s[1]),{bottomLeft:c,topLeft:u,topRight:l}}(f[0].points[0],f[0].points[1],f[0].points[2]),h=p.topRight,m=p.topLeft,g=p.bottomLeft,v=l(e,a,h,m,g),y=[];v&&y.push({alignmentPattern:{x:v.alignmentPattern.x,y:v.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:v.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),w=u(e,m),k=u(e,g),C=l(e,a,b,w,k);return C&&y.push({alignmentPattern:{x:C.alignmentPattern.x,y:C.alignmentPattern.y},bottomLeft:{x:k.x,y:k.y},topLeft:{x:w.x,y:w.y},topRight:{x:b.x,y:b.y},dimension:C.dimension}),0===y.length?null:y}}]).default},e.exports=r()})));function AK(e){return IK.apply(this,arguments)}function IK(){return(IK=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(a=n.getContext("2d"),o=a.getImageData(0,0,n.width,n.height)),!(i=TK(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",i.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function PK(e){return RK.apply(this,arguments)}function RK(){return(RK=nF(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.canvas,n=t.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),EH.scanImage(r,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var NK,OK,DK,LK,MK,FK,UK=function(){var e=nF(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,a=r,!n){e.next=6;break}return e.next=5,FD.blobToCanvas({blob:n});case 5:a=e.sent;case 6:return i=a.getContext("2d"),e.next=9,AK({imageData:i.getImageData(0,0,a.width,a.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,PK({canvas:a,qrScannerResources:o});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function jK(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,a=e.onCaptureDone,i=e.outputEncryptionSettings,s=lF(dv.useState(null),2),c=s[0],u=s[1],l=QN.useAsset("qr_capture_cursor.png"),d=lF(dv.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=hN.useSDKSettings().lang,v=KN.useSDKTracking().sendEvent,y=hq(),b=y.showPopup,w=y.popupShown,k=y.popupType,C=lF(dv.useState(!1),2),E=C[0],S=C[1],B=lF(dv.useState(null),2),_=B[0],x=B[1],T=QN.useAsset("ic_loading.png"),A=dv.useRef();dv.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),dv.useEffect((function(){b({popupType:gq})}),[b]),dv.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,a=OF.isMobile?Math.min(e-6,145):145,i=a,s=o+10,c=s+90,l=c+40,d=l+i+20,f=Math.floor((e-a)/2)+n;u({x:f,y:l,width:a,height:i,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var I=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onSessionTimeout,i=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=lF(dv.useState(!1),2),l=u[0],d=u[1],f=dv.useRef((function(){})),p=dv.useRef((function(){})),h=hN.useSDKSettings().lang,m=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.onResult,i=e.outputEncryptionSettings,s=dv.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=dv.useRef(!1),u=dv.useRef(null),l=lF(dv.useState(!1),2),d=l[0],f=l[1],p=dv.useRef({}),h=hN.useSDKSettings(),m=h.customUrls,g=h.qrSettings;dv.useEffect((function(){function e(){return(e=nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d){e.next=5;break}return e.next=3,IH({modelUrl:null==m?void 0:m.wechatQRModelsUrl});case 3:p.current=e.sent,f(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[d,m]);var v=dv.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),y=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var r,n,l,f,h,m,y,b,w,k,C,E,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d&&o&&!c.current){e.next=2;break}return e.abrupt("return");case 2:r=p.current,n=r.qrModel,l=r.qrScannerResources,f=r.noModel,h=u.current,m=t.current,c.current=!0,y=h.cropX,b=h.cropY,w=h.cropWidth,k=h.cropHeight,(C=s.current).width=w,C.height=k,E=C.getContext("2d"),S=function(){var e=nF(regeneratorRuntime.mark((function e(){var t,r,o,u,d,p,h,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E.drawImage(m,y,b,w,k,0,0,w,k),t=performance.now(),f){e.next=8;break}return e.next=5,_K({canvas:C,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,UK({canvas:C,qrScannerResources:l});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=27;break}return v(),_=r.match(BK),o={valid:Boolean(_)},e.next=17,CO.takePicture({canvas:s.current});case 17:return u=e.sent,e.next=20,KM.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:"boolean"!=typeof(null==g?void 0:g.enableExif)||(null==g?void 0:g.enableExif)});case 20:if(d=e.sent,!i||!i.key){e.next=26;break}return h=i.key,e.next=25,TL.encrypt({blob:d,key:h});case 25:p=e.sent;case 26:a({result:r,validateResult:o,image:{blob:d,encrypted:p}});case 27:return B=180-t>0?180-t:0,e.next=30,new Promise((function(e){return setTimeout(e,B)}));case 30:c.current&&window.requestAnimationFrame(S);case 31:case"end":return e.stop()}var _}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(S);case 13:case"end":return e.stop()}}),e)}))),[d,o,t,v,null==g?void 0:g.enableExif,i,a]),b=dv.useCallback((function(){v()}),[v]);return dv.useEffect((function(){var e=t.current;r||b(),d&&r&&n&&e&&e.videoWidth>0&&(u.current=CO.analyzeVideoAndWindowSizes(e,n,0),y())}),[r,n,t,v,y,d,b]),dv.useEffect((function(){return b}),[b]),{refWorkingCanvas:s,stopCheckFrame:v,checkFrame:y,warmupDone:d}}({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:dv.useCallback((function(){f.current.apply(f,arguments)}),[]),outputEncryptionSettings:c}),g=m.stopCheckFrame,v=m.checkFrame,y=m.warmupDone,b=FH({refVideo:r,shouldStart:t&&y,cropArea:n,settings:o}),w=b.stopCheckFrame,k=b.refRecordedVideos,C=b.splitVideos,E=b.resetRecordedVideos,S=b.checkFrame;f.current=dv.useCallback((function(e){d(!0),w(),g(),p.current(),i(sF(sF({},e),{},{recordedVideos:k.current})),d(!1)}),[w,i,k,g]);var B=dv.useCallback((function(){w(),g();var e=dF(k.current);a({recordedVideos:e}),E()}),[E,w,g,a,k]),_=dv.useCallback((function(){C()}),[C]),x=UH({lang:h,onAboutToTimeout:s,onSessionTimeout:B,onVideoTimeLimitReached:_,settings:o,shouldStartTimers:t&&y,sessionTime:null==o?void 0:o.scanQrLimitTimeSecond}),T=x.stopTimers,A=x.startTimers;return p.current=T,{isProcessing:l,restartSession:dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(),e.next=3,Promise.all([S(),v()]);case 3:case"end":return e.stop()}}),e)}))),[S,v,A]),refRecordedVideos:k,warmupDone:y}}({shouldStart:E,refVideo:n,cropArea:c,settings:o,onSessionTimeout:dv.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),a(e)}),[a,v]),onCaptureDone:dv.useCallback((function(e){var t=e.validateResult.valid;x("");var r=performance.now();t?(v({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-A.current)/1e3}}),a(e)):(b({popupType:"QR_INVALID"}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,a,v]),onAboutToTimeout:dv.useCallback((function(e){var t=e.curTimeLeft;x(Rj($H.REMAINING_TIME[g])({x:t}))}),[g]),outputEncryptionSettings:i}),P=I.isProcessing,R=I.restartSession,N=I.warmupDone,O=dv.useCallback((function(){b({popupType:null})}),[b]),D=dv.useCallback(nF(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(),A.current=performance.now(),v({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,R();case 5:case"end":return e.stop()}}),e)}))),[R,O,v]),L=dv.useCallback((function(){O(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),a()}),[O,a,v]),M=dv.useCallback((function(){O(),setTimeout((function(){S(!0)}),200)}),[O]);return dv.createElement(dv.Fragment,null,!N&&dv.createElement(oq,{contentStyle:{maxWidth:"300px"}}),c&&dv.createElement(Fj,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},dv.createElement("div",null,dv.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),dv.createElement(XH,{y:"".concat(h,"px")},$H.QR_TOOLTIP[g]),_&&dv.createElement(YH,{key:_,className:"message",y:"".concat(m,"px")},_),P&&dv.createElement(Wz,null,dv.createElement("img",{src:T,alt:"",className:"spin"})),dv.createElement(fz,{contentStyle:{maxWidth:"332px"},open:w},"QR_INVALID"===k&&dv.createElement(sK,{onRetry:D,onSkip:L}),k===gq&&dv.createElement(SK,{onClickStart:M,onTimeout:M})))}jK.propTypes={windowAndVideoInfo:Lv.shape({}),onUISpacingChange:Lv.func,refVideo:Lv.shape({}),settings:Lv.shape({}),onCaptureDone:Lv.func,outputEncryptionSettings:Lv.shape({})},jK.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var VK,zK,qK,HK,KK,WK="SUCCESS",GK=(oF(NK={},WK,"52,206,95"),oF(NK,"WARNING","255,148,50"),NK),QK=(oF(OK={},WK,"✓"),oF(OK,"WARNING","!"),OK),XK=aw.div(DK||(DK=uF(["\n font-weight: normal;\n"]))),YK=aw.div(LK||(LK=uF(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return Hb(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],GK[e.type],GK[e.type],GK[e.type])})),$K=aw.div(MK||(MK=uF(["\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n margin-right: 8px;\n font-weight: bold;\n"])),(function(e){return Hb(["rgb(",")"],GK[e.type])})),ZK=aw.div(FK||(FK=uF(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),JK=function(e){var t=e.children,r=e.type,n=e.className;return dv.createElement(XK,{className:n},dv.createElement(YK,{type:r}),dv.createElement(ZK,null,dv.createElement($K,{type:r},QK[r]),t),dv.createElement(YK,{type:r}))};JK.propTypes={children:Lv.node,type:Lv.string,className:Lv.string},JK.defaultProps={children:null,type:WK,className:""};var eW=aw.div(VK||(VK=uF(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),tW=aw.div(zK||(zK=uF(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),rW=aw.button(qK||(qK=uF(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),nW=aw.img(HK||(HK=uF(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),oW=aw.div(KK||(KK=uF(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),aW=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,a=e.hasValidQR,i=e.frontSide,s=lF(dv.useState(null),2),c=s[0],u=s[1],l=hN.useSDKSettings().lang,d=KN.useSDKTracking().sendEvent;return dv.useEffect((function(){d({tag:i?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[i,d]),dv.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),dv.createElement(eW,null,null!==a&&dv.createElement(ZH,{mb:"20px"},dv.createElement("div",null,dv.createElement(JK,{type:a?WK:"WARNING"},a?cq.CONFIRM_POPUP_VALID_QR[l]:cq.CONFIRM_POPUP_INVALID_QR[l]))),dv.createElement(yK,{ratio:1.5},dv.createElement(nW,{src:c})),o&&dv.createElement(tW,{className:"confirm-popup-error-message"},o.msg[l]),dv.createElement(oW,null,dv.createElement(rW,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},cq.BTN_TRY_AGAIN[l]),dv.createElement(rW,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},cq.BTN_USE_THIS_PICTURE[l])))};aW.propTypes={imageTaken:Lv.shape({}),error:Lv.shape({msg:Lv.shape({})}),onConfirm:Lv.func,onTryAgain:Lv.func,hasValidQR:Lv.bool,frontSide:Lv.bool},aW.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var iW,sW={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},cW=sw(iW||(iW=uF(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),uW=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons","isLoading","cardList"];function lW(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,a=e.defaultCameraId,i=e.globalStyle,s=e.styledComponent,c=e.frontCamera,u=e.scannerTypeCons,l=e.isLoading,d=e.cardList,f=cF(e,uW),p=f.numberOfCaptures,h=f.stepNumber,m=f.frontSide,g=f.titleIcon,v=f.title,y=f.description,b=f.scannerType,w=f.usePortraitMask,k=f.shouldShowSpinner,C=f.handleQRCaptureDone,E=f.handleIDCardCaptureDone,S=f.handleRestartSession,B=f.refIDCardReader,_=f.handleClickConfirm,x=f.popupType,T=f.popupShown,A=f.popupProps,I=dv.useRef(null),P=lF(dv.useState(null),2),R=P[0],N=P[1],O=lF(dv.useState(!1),2),D=O[0],L=O[1],M=QN.useAsset("ic_loading.png"),F=lF(dv.useState({}),2),U=F[0],j=F[1],V=U.yTitle,z=dv.useCallback((function(e){N(e),L(!0)}),[]);dv.useEffect((function(){L(!1)}),[c]);var q=QN.useAsset(g),H=s.CloseCameraButton;return dv.createElement(rw,{theme:sW},dv.createElement(qz,null,dv.createElement(uz,{key:c,frontCamera:c,onVideoPlayed:z,onClose:t,flipHorizontal:c,ref:I,onError:r,defaultCameraId:a,closeButton:H||null},D&&dv.createElement(dv.Fragment,null,b===u.ID_CARD&&dv.createElement(HH,{key:h,ref:B,windowAndVideoInfo:R,refVideo:I,settings:n,onCaptureDone:E,onUISpacingChange:j,frontSide:m,cardList:d,description:y,usePortraitMask:w,outputEncryptionSettings:o}),b===u.QR_CODE&&dv.createElement(jK,{key:h,refVideo:I,windowAndVideoInfo:R,settings:n,onCaptureDone:C,onUISpacingChange:j,outputEncryptionSettings:o})),dv.createElement(zz,{keyForTransition:p}),dv.createElement(Qz,{y:"".concat(V,"px")},dv.createElement(IF,null,dv.createElement(_F,{key:v,timeout:{enter:500,exit:500},classNames:"flipY",unmountOnExit:!0},dv.createElement(Xz,null,g&&dv.createElement(Hz,{src:q,alt:""}),dv.createElement(Yz,{className:"title"},v))))),(k||l)&&dv.createElement(Wz,null,dv.createElement("img",{src:M,alt:"",className:"spin"}))),dv.createElement(fz,{open:T},"CONFIRM"===x&&dv.createElement(aW,aF({},A,{onConfirm:_,onTryAgain:S,frontSide:m})))),dv.createElement(i,null))}var dW={cardList:Lv.arrayOf(Lv.string),settings:Lv.shape({}),onClose:Lv.func,onError:Lv.func,outputEncryptionSettings:Lv.shape({}),defaultCameraId:Lv.string,globalStyle:Lv.shape({}),styledComponent:Lv.shape({CloseCameraButton:Lv.node}),frontCamera:Lv.bool,scannerTypeCons:Lv.shape({}).isRequired,isLoading:Lv.bool},fW={cardList:[],settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:cW,styledComponent:{CloseCameraButton:null},frontCamera:!1,isLoading:!1};lW.propTypes=dW,lW.defaultProps=fW;var pW=aI.IDCardSide,hW=aI.IDCardType,mW=aI.Errors,gW={ID_CARD:"id_card",QR_CODE:"qr_code"},vW=[{scannerType:gW.ID_CARD,title:"Mặt trước CMND/CCCD",description:"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:aI.IDCardSide.FRONT,cardType:hW.VN,enableConfirmPopup:!0},{scannerType:gW.ID_CARD,title:"Mặt sau CMND/CCCD",description:"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:aI.IDCardSide.BACK,cardType:hW.VN,enableConfirmPopup:!0}],yW={scannerType:gW.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},bW=function(){return Promise.resolve({card_label:""})},wW=function(e){var t=e.settings,r=e.onError,n=e.detectIdCard,o=void 0===n?bW:n,a=e.outputEncryptionSettings,i=e.steps,s=e.onStepDone,c=hN.useSDKSettings().lang,u=null!=i?i:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",r="ph"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||"en"===t,n={scannerType:gW.ID_CARD,title:r?"Capture Front Side of ID Card":"Mặt trước CMND/CCCD",description:r?"":"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:aI.IDCardSide.FRONT,cardType:hW.VN,enableConfirmPopup:!0},o={scannerType:gW.ID_CARD,title:r?"Capture Back Side of ID Card":"Mặt sau CMND/CCCD",description:r?"":"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:aI.IDCardSide.BACK,cardType:hW.VN,enableConfirmPopup:!0};return e?[n,o]:[n]}(Uq(t,"hasBackCard",!0),c,Uq(t,"country")),l=lF(dv.useState(0),2),d=l[0],f=l[1],p=lF(dv.useState(u[d]),2),h=p[0],m=p[1],g=lF(dv.useState(0),2),v=g[0],y=g[1],b=lF(dv.useState(!1),2),w=b[0],k=b[1],C=dv.useRef({}),E=dv.useRef([]),S=dv.useRef(null),B=dv.useRef(),_=dv.useRef(null),x=hq(),T=x.showPopup,A=x.popupShown,I=x.popupType,P=x.props,R=h.scannerType,N=h.title,O=h.titleIcon,D=h.cardSide,L=h.description,M=h.usePortraitMask,F=h.cardType,U=h.enableConfirmPopup,j=dv.useCallback((function(e){e>=u.length||setTimeout((function(){f(e),m(u[e])}),200)}),[u]),V=dv.useCallback((function(){j(d+1)}),[j,d]),z=dv.useCallback((function(){setTimeout((function(){m((function(e){return sF(sF({},e),yW)}))}),200)}),[]),q=dv.useCallback((function(){T({popupType:null})}),[T]),H=dv.useCallback((function(){if(q(),S.current=null,R===gW.QR_CODE)j(d);else if(R===gW.ID_CARD){var e=null;_.current===pW.FRONT?e=0:_.current===pW.BACK&&(e=1),null!==e&&j(e),B.current.restartSession()}}),[j,d,q,R]),K=dv.useCallback(nF(regeneratorRuntime.mark((function e(){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={stepNumber:d,cardSide:D,cardType:F,image:C.current,recordedVideos:null!=t&&t.enableRecording?E.current:[]},(R===gW.QR_CODE||null!==(r=S.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=S.current),k(!0),e.next=5,s(n);case 5:(o=e.sent)?(_.current=o,k(!1)):(k(!1),S.current=null,V());case 7:case"end":return e.stop()}}),e)}))),[t,d,s,V,R,k,D,F]),W=dv.useCallback((function(e){var t;if(S.current=e,e&&e.recordedVideos){var r,n=e.recordedVideos;(r=E.current).push.apply(r,dF(n))}y((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);U?T({popupType:"CONFIRM",props:{hasValidQR:o,imageTaken:C.current}}):K()}),[T,U,K]),G=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(n){var i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.image,s=n.error,c=n.recordedVideos,C.current=i,E.current=c,y((function(e){return e+1})),D!==aI.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!OF.isMobile){e.next=28;break}if(l=null==i||null===(u=i.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return k(!0),e.prev=9,e.next=12,o({image:i,cardType:F,cardSide:D});case 12:d=e.sent,l=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(mW.detect_id_card_error);case 19:k(!1);case 20:if(!l||!"vn.cccd_new.front".includes(l)){e.next=28;break}return k(!0),e.next=24,xK(C.current.blob,a);case 24:return(f=e.sent)?W(f):z(),k(!1),e.abrupt("return");case 28:U?T({popupType:"CONFIRM",props:{imageTaken:C.current,error:s}}):K();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[U,T,D,t,F,o,K,z,r,W,a,k]),Q=dv.useCallback((function(){q(),K()}),[K,q]);return{numberOfCaptures:v,stepNumber:d,titleIcon:O,title:N,description:L,frontSide:D===pW.FRONT,scannerType:R,usePortraitMask:M,shouldShowSpinner:w,handleQRCaptureDone:W,handleIDCardCaptureDone:G,handleRestartSession:H,refIDCardReader:B,handleClickConfirm:Q,showPopup:T,popupType:I,popupShown:A,popupProps:P}};function kW(e){var t=this.__data__=new xq(e);this.size=t.size}kW.prototype.clear=function(){this.__data__=new xq,this.size=0},kW.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},kW.prototype.get=function(e){return this.__data__.get(e)},kW.prototype.has=function(e){return this.__data__.has(e)},kW.prototype.set=function(e,t){var r=this.__data__;if(r instanceof xq){var n=r.__data__;if(!Tq||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Pq(n)}return r.set(e,t),this.size=r.size,this};var CW=kW,EW=function(e,t,r){(void 0!==r&&!sU(e[t],r)||void 0===r&&!(t in e))&&iU(e,t,r)},SW=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var s=a[++n];if(!1===t(o[s],s,o))break}return e},BW=RF((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?MF.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}})),_W=MF.Uint8Array,xW=function(e,t){var r=t?function(e){var t=new e.constructor(e.byteLength);return new _W(t).set(new _W(e)),t}(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},TW=Object.create,AW=function(){function e(){}return function(t){if(!WF(t))return{};if(TW)return TW(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),IW=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},PW=function(e,t,r,n,o,a,i){var s=IW(e,r),c=IW(t,r),u=i.get(c);if(u)EW(e,r,u);else{var l=a?a(s,c,r+"",e,t,i):void 0,d=void 0===l;if(d){var f=PU(c),p=!f&&NU(c),h=!f&&!p&&jU(c);l=c,f||p||h?PU(s)?l=s:function(e){return BU(e)&&wU(e)}(s)?l=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(s):p?(d=!1,l=BW(c,!0)):h?(d=!1,l=xW(c,!0)):l=[]:rj(c)||IU(c)?(l=s,IU(s)?l=function(e){return lU(e,GU(e))}(s):WF(s)&&!GF(s)||(l=function(e){return"function"!=typeof e.constructor||HU(e)?{}:AW(YU(e))}(c))):d=!1}d&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),EW(e,r,l)}},RW=function e(t,r,n,o,a){t!==r&&SW(r,(function(i,s){if(a||(a=new CW),WF(i))PW(t,r,s,n,e,o,a);else{var c=o?o(IW(t,s),i,s+"",t,r,a):void 0;void 0===c&&(c=i),EW(t,s,c)}}),GU)},NW=SU((function(e,t,r){RW(e,t,r)})),OW={data:{country:"vn",settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},track_card_coordinates:{enable:!1,max_length:150},card_type_check:{enable:!1},blur_check:{enable:!0,threshold_web:.82},disable_capture_button_if_alert:!1,exif_data_settings:{enable:!0},id_detection:{enable:!0},limit_time_settings:{enable:!0,limit_time_second:30,video_partial_length_seconds:15},save_frame_settings:{enable:!1,frames_interval_ms:190,quality_web:80},scan_qr_settings:{enable:!0,limit_time_second:20},virtual_cam_hashes:{web:!1,mobile:!1}}}}}};function DW(e){var t=e.clientSettings,r=lF(dv.useState(null),2),n=r[0],o=r[1];return dv.useEffect((function(){var e=NW(OW,t),r=Uq(e,"data.settings.sdk_settings.id_detection_settings.card_type_check.enable"),n=Uq(e,"data.country"),a=Uq(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),i=Uq(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.enable"),s=Uq(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.max_length"),c=Uq(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),u=Uq(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),l=Uq(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),d=Uq(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),f=Uq(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),p=Uq(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),h=Uq(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),m=Uq(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),g=Uq(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),v=Uq(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),y=Uq(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),b=Uq(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),w=Uq(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),k=Uq(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),C=Uq(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(OF.isMobile?"mobile":"web")),E=Uq(e,"data.card_types[0].has_back_side",!0);o({country:n,enableRecording:a,trackCardCoordinates:i,trackCardCoordinatesMaxLength:s,enableCardTypeCheck:r,frameCaptureIntervalMs:c,idCardSessionTime:d,maxRecordingTimePerVideo:f,saveFrameQuality:u,enableTimers:l,enableAutoCapture:p,waitForBestImageTimeMs:h,enableBlurCheck:m,blurThreshold:g,disableCaptureButtonIfAlert:v,enableIdDetection:y,enableScanQr:b,scanQrLimitTimeSecond:w,enableExifData:k,enableVirtualCamHashes:C,hasBackCard:E})}),[t]),{settings:n}}var LW,MW="landscape",FW="portrait",UW="desktop",jW=aI.Errors,VW=aw.div(LW||(LW=uF(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function zW(e){var t=e.children,r=hN.useSDKSettings().lang,n=jW.wrong_orientation.msg[r],o=function(){var e=dv.useRef(window.matchMedia("(orientation: portrait)")),t=dv.useRef(e.current.matches?FW:MW),r=lF(dv.useState(t.current),2),n=r[0],o=r[1];return dv.useEffect((function(){function t(e){e.matches?o(FW):o(MW)}return e.current.addEventListener("change",t),function(){e.current.removeEventListener("change",t)}}),[]),OF.isMobile?{curOrientation:n,initOrientation:t.current}:{curOrientation:UW}}().curOrientation;return dv.createElement(dv.Fragment,null,o===MW&&dv.createElement(fz,{open:!0},dv.createElement(VW,null,n)),(o===FW||o===UW)&&dv.createElement(dv.Fragment,null,t))}function qW(e){var t=e.logCredentials,r=e.clientSettings,n=e.uiOnlyComponent,o=e.onError,a=e.detectIdCard,i=e.outputEncryptionSettings,s=e.steps,c=e.onStepDone,u=DW({clientSettings:r}).settings,l=aF({},wW({settings:u,onError:o,detectIdCard:a,outputEncryptionSettings:i,steps:s,onStepDone:c}));return dv.createElement(zW,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:sF({},t)}},dv.createElement(n,aF({},e,{settings:u,scannerTypeCons:gW},l))))}var HW={logCredentials:Lv.shape({}),clientSettings:Lv.shape({}),uiOnlyComponent:Lv.func,onError:Lv.func,onStepDone:Lv.func,steps:Lv.arrayOf(Lv.shape({})),detectIdCard:Lv.func,outputEncryptionSettings:Lv.shape({})};qW.propTypes=HW,qW.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:lW,onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var KW=function(e){var t=aF({},e),r=t.clientSettings,n=t.onError,o=t.onStepDone,a=t.logCredentials,i=t.uiOnlyComponent,s=t.detectIdCard,c=t.outputEncryptionSettings,u=t.steps,l=DW({clientSettings:r}).settings,d=dv.useCallback(function(){var e=nF(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o(sF(sF({},t),{},{restartSession:null==f?void 0:f.handleRestartSession}));case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,null==f?void 0:f.handleRestartSession]),f=aF({},wW({settings:l,onError:n,detectIdCard:s,outputEncryptionSettings:c,steps:u,onStepDone:d}));return dv.createElement(zW,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:sF({},a)}},dv.createElement(i,aF({},t,{onStepDone:d,settings:l,scannerTypeCons:gW},f))))};KW.propTypes={clientSettings:Lv.shape({}),onError:Lv.func,onStepDone:Lv.func,logCredentials:Lv.shape({}),readIDCardUIOnlyComponent:Lv.func,uiOnlyComponent:Lv.func,sdkAdapter:Lv.shape({}),steps:Lv.arrayOf(Lv.shape({})),detectIdCard:Lv.func,outputEncryptionSettings:Lv.shape({})},KW.defaultProps={clientSettings:void 0,onError:function(){},onStepDone:function(){},logCredentials:{enable:!0},readIDCardUIOnlyComponent:qW,uiOnlyComponent:lW,sdkAdapter:null,steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null},Lv.shape({});var WW=n((function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){var n={MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0};e.exports={BROWSER_TYPES:{CHROME:"Chrome",FIREFOX:"Firefox",OPERA:"Opera",YANDEX:"Yandex",SAFARI:"Safari",INTERNET_EXPLORER:"Internet Explorer",EDGE:"Edge",CHROMIUM:"Chromium",IE:"IE",MOBILE_SAFARI:"Mobile Safari",EDGE_CHROMIUM:"Edge Chromium"},DEVICE_TYPES:n,OS_TYPES:{IOS:"iOS",ANDROID:"Android",WINDOWS_PHONE:"Windows Phone",WINDOWS:"Windows",MAC_OS:"Mac OS"},defaultData:{isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1}}},function(e,t,r){var n,o=r(2),a=r(0),i=a.BROWSER_TYPES,s=a.OS_TYPES,c=a.DEVICE_TYPES,u=r(4),l=u.checkType,d=u.broPayload,f=u.mobilePayload,p=u.wearPayload,h=u.consolePayload,m=u.stvPayload,g=u.getNavigatorInstance,v=u.isIOS13Check,y=new o,b=y.getBrowser(),w=y.getDevice(),k=y.getEngine(),C=y.getOS(),E=y.getUA(),S=i.CHROME,B=i.CHROMIUM,_=i.IE,x=i.INTERNET_EXPLORER,T=i.OPERA,A=i.FIREFOX,I=i.SAFARI,P=i.EDGE,R=i.YANDEX,N=i.MOBILE_SAFARI,O=c.MOBILE,D=c.TABLET,L=c.SMART_TV,M=c.BROWSER,F=c.WEARABLE,U=c.CONSOLE,j=s.ANDROID,V=s.WINDOWS_PHONE,z=s.IOS,q=s.WINDOWS,H=s.MAC_OS,K=function(){return C.name===s.WINDOWS&&"10"===C.version&&("string"==typeof E&&-1!==E.indexOf("Edg/"))},W=function(){return b.name===P},G=function(){return v("iPad")},Q=w.type===L,X=w.type===U,Y=w.type===F,$=b.name===N||G(),Z=b.name===B,J=function(){switch(w.type){case O:case D:return!0;default:return!1}}()||G(),ee=w.type===O,te=w.type===D||G(),re=w.type===M,ne=C.name===j,oe=C.name===V,ae=C.name===z||G(),ie=b.name===S,se=b.name===A,ce=b.name===I||b.name===N,ue=b.name===T,le=b.name===x||b.name===_,de=C.version?C.version:"none",fe=C.name?C.name:"none",pe=b.major,he=b.version,me=b.name,ge=w.vendor?w.vendor:"none",ve=w.model?w.model:"none",ye=k.name,be=k.version,we=E,ke=W()||K(),Ce=b.name===R,Ee=w.type,Se=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Be=G(),_e=v("iPhone"),xe=v("iPod"),Te=function(){var e=g(),t=e&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)}(),Ae=K(),Ie=W(),Pe=C.name===q,Re=C.name===H,Ne=l(w.type);e.exports={deviceDetect:function(){var e=Ne.isBrowser,t=Ne.isMobile,r=Ne.isTablet,n=Ne.isSmartTV,o=Ne.isConsole,a=Ne.isWearable;return e?d(e,b,k,C,E):n?m(n,k,C,E):o?h(o,k,C,E):t||r?f(Ne,w,C,E):a?p(a,k,C,E):void 0},isSmartTV:Q,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ae,isChrome:ie,isFirefox:se,isSafari:ce,isOpera:ue,isIE:le,osVersion:de,osName:fe,fullBrowserVersion:pe,browserVersion:he,browserName:me,mobileVendor:ge,mobileModel:ve,engineName:ye,engineVersion:be,getUA:we,isEdge:ke,isYandex:Ce,deviceType:Ee,isIOS13:Se,isIPad13:Be,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Ie,isWindows:Pe,isMacOs:Re}},function(e,t,r){var n;
77
77
  /*!
78
78
  * UAParser.js v0.7.18
79
79
  * Lightweight JavaScript-based User-Agent string parser
@@ -81,4 +81,4 @@ var TM={};void 0!==TM.asn1&&TM.asn1||(TM.asn1={}),TM.asn1.ASN1Util=new function(
81
81
  *
82
82
  * Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
83
83
  * Dual licensed under GPLv2 or MIT
84
- */!function(o,a){var i="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",m="console",g="mobile",v="tablet",y="smarttv",b="wearable",w={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:a},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},k={rgx:function(e,t){for(var r,n,o,s,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(o=0;o<p.length;o++)l=u[++n],typeof(s=p[o])===c&&s.length>0?2==s.length?typeof s[1]==i?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==i||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):a:this[s[0]]=l?s[1].call(this,l,s[2]):a:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):a):this[s]=l||a;d+=2}},str:function(e,t){for(var r in t)if(typeof t[r]===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(w.has(t[r][n],e))return"?"===r?a:r}else if(w.has(t[r],e))return"?"===r?a:r;return e}},C={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},E={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,p],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],p],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[l,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[l,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[l,p],[/(QQ)\/([\d\.]+)/i],[l,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[l,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,p],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[l,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,l],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[p,k.str,C.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],p],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,w.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",w.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,w.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,f,[d,v]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[d,v]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[f,u,[d,v]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[u,[f,"Amazon"],[d,v]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[u,k.str,C.device.amazon.model],[f,"Amazon"],[d,g]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[d,g]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[d,g]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[f,u,[d,g]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[d,g]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[u,[f,"Asus"],[d,v]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[d,v]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[u,[f,"Sony"],[d,g]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[d,m]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[d,m]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[d,m]],[/(sprint\s(\w+))/i],[[f,k.str,C.device.sprint.vendor],[u,k.str,C.device.sprint.model],[d,g]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[f,u,[d,v]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[d,g]],[/(nexus\s9)/i],[u,[f,"HTC"],[d,v]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[u,[f,"Huawei"],[d,g]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[d,g]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[d,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[d,g]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[u,[f,"Motorola"],[d,g]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[d,v]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,w.trim],[u,w.trim],[d,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[d,y]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[d,y]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[f,"Samsung"],u,[d,v]],[/smart-tv.+(samsung)/i],[f,[d,y],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[d,g]],[/sie-(\w*)/i],[u,[f,"Siemens"],[d,g]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[d,g]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[u,[f,"Acer"],[d,v]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[d,v]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[d,v]],[/(lg) netcast\.tv/i],[f,u,[d,y]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[d,g]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[d,v]],[/linux;.+((jolla));/i],[f,u,[d,g]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[d,b]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[d,g]],[/crkey/i],[[u,"Chromecast"],[f,"Google"]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[d,b]],[/android.+;\s(pixel c)\s/i],[u,[f,"Google"],[d,v]],[/android.+;\s(pixel xl|pixel)\s/i],[u,[f,"Google"],[d,g]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,g]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,v]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[d,v]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[u,[f,"OnePlus"],[d,g]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[d,v]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[d,v]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[d,v]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[d,v]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[d,v]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[d,v]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[d,g]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[d,v]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[d,v]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[d,v]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[d,v]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[d,v]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[d,g]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[d,g]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[d,v]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[u,[f,"MachSpeed"],[d,v]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[d,v]],[/android.+(KS(.+))\s+build/i],[u,[f,"Amazon"],[d,v]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[d,v]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[d,w.lowerize],f,u],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,p],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[p,k.str,C.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,k.str,C.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],p],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[l,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],p],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],p],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[l,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,p],[/(haiku)\s(\w+)/i],[l,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[l,p]]},S=function(e,t){if("object"==typeof e&&(t=e,e=a),!(this instanceof S))return new S(e,t).getResult();var r=e||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),n=t?w.extend(E,t):E;return this.getBrowser=function(){var e={name:a,version:a};return k.rgx.call(e,r,n.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:a};return k.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:a,model:a,type:a};return k.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:a,version:a};return k.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:a,version:a};return k.rgx.call(e,r,n.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=e,this},this};S.VERSION="0.7.18",S.BROWSER={NAME:l,MAJOR:"major",VERSION:p},S.CPU={ARCHITECTURE:h},S.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:m,MOBILE:g,SMARTTV:y,TABLET:v,WEARABLE:b,EMBEDDED:"embedded"},S.ENGINE={NAME:l,VERSION:p},S.OS={NAME:l,VERSION:p},typeof t!==s?(typeof e!==s&&e.exports&&(t=e.exports=S),t.UAParser=S):r(3)?(n=function(){return S}.call(t,r,t,e))===a||(e.exports=n):o&&(o.UAParser=S);var B=o&&(o.jQuery||o.Zepto);if(typeof B!==s){var _=new S;B.ua=_.getResult(),B.ua.get=function(){return _.getUA()},B.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),a=o.DEVICE_TYPES,i=o.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case a.MOBILE:return{isMobile:!0};case a.TABLET:return{isTablet:!0};case a.SMART_TV:return{isSmartTV:!0};case a.CONSOLE:return{isConsole:!0};case a.WEARABLE:return{isWearable:!0};case a.BROWSER:return{isBrowser:!0};default:return i}},broPayload:function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:o}},mobilePayload:function(e,t,r,o){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:o})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])})),GW=/^\s+|\s+$/g,QW=/^[-+]0x[0-9a-f]+$/i,XW=/^0b[01]+$/i,YW=/^0o[0-7]+$/i,$W=parseInt,ZW="object"==typeof t&&t&&t.Object===Object&&t,JW="object"==typeof self&&self&&self.Object===Object&&self,eG=ZW||JW||Function("return this")(),tG=Object.prototype.toString,rG=Math.max,nG=Math.min,oG=function(){return eG.Date.now()};function aG(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function iG(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==tG.call(e)}(e))return NaN;if(aG(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=aG(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(GW,"");var r=XW.test(e);return r||YW.test(e)?$W(e.slice(2),r?2:8):QW.test(e)?NaN:+e}var sG=function(e,t,r){var n,o,a,i,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var r=n,a=o;return n=o=void 0,u=t,i=e.apply(a,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):i}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=a}function g(){var e=oG();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?nG(r,a-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,i)}function y(){var e=oG(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),i}return t=iG(t)||0,aG(r)&&(l=!!r.leading,a=(d="maxWait"in r)?rG(iG(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?i:v(oG())},y};function cG(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===Xm(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,t){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(t){e(t.filter((function(e){return"video"===e.kind.toLowerCase()||"videoinput"===e.kind.toLowerCase()})).map((function(e){return{deviceId:null!=e.deviceId?e.deviceId:"",groupId:e.groupId,kind:"videoinput",label:e.label,toJSON:function(){return this}}})))}))}catch(e){return t(e)}}))}var uG,lG,dG,fG,pG,hG=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],mG=function(e){if(!e)return{isVirtual:!1};var t=e.getTracks();if(!t||!t.length)return{isVirtual:!1};var r=t[0].label,n=r&&hG.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},gG=function(e,t){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0&&!t)},vG=function(){var e,t;return{updateTime:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start";"start"===n?e=r:"end"===n&&(t=r)},getStart:function(){return e},getEnd:function(){return t}}},yG=aI.Errors,bG=aw.div(uG||(uG=pg(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: #000;\n display: flex;\n justify-content: center;\n z-index: ",";\n ","\n"])),1e3,(function(e){return e.checkCameraMode&&"opacity: 0;"})),wG=aw.video(lG||(lG=pg(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),kG=aw.div(dG||(dG=pg(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),CG=aw(kG)(fG||(fG=pg(["\n z-index: ",";\n position: fixed;\n top: 20px;\n right: 20px;\n width: 20px;\n cursor: pointer;\n"])),2e3),EG=aw.div(pG||(pG=pg(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),SG=dv.createRef(),BG=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(r,n){e.call(navigator,t,r,n)}))}}:null}();function _G(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,a=e.onVideoPlayed,i=e.flipHorizontal,s=e.videoSettings,c=e.refVideo,u=e.onError,l=e.closeButton,d=e.videoClassName,f=e.scale,p=e.defaultCameraId,h=e.onWarning,m=dv.useRef(),g=hN.useSDKSettings().lang,v=KN.useSDKTracking().sendEvent,y=QN.useAsset("ic_close.png"),b=hg(dv.useState(""),2),w=b[0],k=b[1],C=dv.useRef(!1),E=dv.useRef(!1),S=dv.useRef(!1),B=dv.useRef(),_=dv.useRef([]),x=dv.useRef(""),T=dv.useCallback((function(e){u&&u(e)}),[u]),A=dv.useCallback((function(){try{var e;clearInterval(m.current),(null==c||null===(e=c.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(c.current.srcObject.getTracks().forEach((function(e){return e.stop()})),c.current.srcObject=null)}catch(e){}clearTimeout(B)}),[c]);function I(){return P.apply(this,arguments)}function P(){return(P=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,cG();case 3:t=e.sent,_.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),KM.addExifData("device_info.camera_list",JSON.stringify(_.current.map((function(e){return e.label})))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}m.current||(m.current=setInterval((function(){document.getElementById("tv-camera-".concat(m.current))||A()}),1e3)),dv.useEffect((function(){return function(){S.current=!0}}),[]);var R=dv.useCallback((function(){B.current||(B.current=setTimeout((function(){C.current||(k(yG.camera_timeout.msg[g]),T(yG.camera_timeout))}),2e4))}),[g,T]),N=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var n,o,a,i,c,u,l,d,f,p,m=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=m.length>1&&void 0!==m[1]&&m[1],o={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return h&&h("too_many_request_to_camera"),e.abrupt("return",new Promise((function(e){return e(null)})));case 5:return window.tv_last_req_camera_complete=!1,o=WW.isMobile?WW.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},a=vG(),i=a.updateTime,c=a.getStart,u=a.getEnd,e.prev=8,l=s||o,i(performance.now(),"start"),gG(WW.isMobile,WW.isIOS)&&r&&(l={}),n&&(l={}),KM.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),d={audio:!1,video:og(og({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)},e.next=17,BG.getUserMedia(d);case 17:return f=e.sent,e.next=20,I();case 20:if(R(),f){e.next=25;break}return k(yG.not_supported.msg[g]),T(yG.not_supported),e.abrupt("return",null);case 25:i(performance.now(),"end"),window.tv_last_req_camera_complete=!0,u()-c()<1600?v({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):v({tag:"cam_permission",event:"user_activity.allow",log:{}});try{p=f.getVideoTracks()[0].getSettings(),KM.addExifData("device_info.camera_label_dimension.got","".concat(p.width,"x").concat(p.height))}catch(e){}return e.abrupt("return",f);case 32:e.prev=32,e.t0=e.catch(8),i(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k(yG.no_permission.msg[g]),T(yG.no_permission),E.current=!0,v({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):E.current&&("NotReadableError"===e.t0.name?(T(yG.not_readable),k(yG.not_readable.msg[g])):(k(e.t0.message),T({code:e.t0.name||e.t0.code,message:e.t0.message})));case 36:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 38:case"end":return e.stop()}}),e,null,[[8,32]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,T,h,R,v]),O=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t,r,n,o,i,s,u,l,d,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>0&&void 0!==h[0]?h[0]:p,o=h.length>1&&void 0!==h[1]&&h[1],!(null!=(i=c.current)&&null!==(t=i.srcObject)&&void 0!==t&&t.id&&null!=i&&null!==(r=i.srcObject)&&void 0!==r&&r.active&&C.current)){e.next=5;break}return e.abrupt("return");case 5:return i.oncanplaythrough=function(){var e,t,r;i.play(),KM.addExifData("device_info.camera_label",null===(e=s)||void 0===e||null===(t=e.getVideoTracks())||void 0===t||null===(r=t[0])||void 0===r?void 0:r.label),C.current=!0,k("");var n=window.innerWidth,o=window.innerHeight,c=CO.analyzeVideoAndWindowSizes(i),u=c.lostX,l=void 0===u?0:u,d=c.lostY,f=void 0===d?0:d,p=Math.min(n,Math.floor(n-2*l)),h=Math.min(o,Math.floor(o-2*f));a&&a({clientWidth:n,clientHeight:o,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,N(n,o);case 8:s=e.sent,u=mG(s),l=u.deviceLabel,(d=u.isVirtual)&&(x.current+="".concat(l,", "),(f=_.current.filter((function(e){return!x.current.includes(e.label)})))[0]&&f[0].deviceId&&O(f[0].deviceId)),s||E.current||(KM.addExifData("device_info.camera_label_retry","yes"),E.current=!0,O(n,!0)),s&&S.current&&(c.current.srcObject=s,A()),!s||S.current||d||(i.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,N,a,p,A]);dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:return e.next=4,cG();case 4:t=e.sent,(r=t.filter((function(e){return"videoinput"===e.kind&&e.label.includes("back")&&e.label.includes("0")}))).length>0&&(n=r[0].deviceId,A(),O(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return C.current?function(){}:(!BG||WW.browserName&&["facebook"].includes(WW.browserName.toLowerCase())||WW.getUA.includes("Zalo iOS")?(k(yG.not_supported.msg[g]),T(yG.not_supported)):t&&(WW.isAndroid&&!1===r?function(){e.apply(this,arguments)}():O()),function(){S.current&&A()})}),[c,g,r,O,A,T]);var D=dv.useCallback((function(){A(),n&&n(),v({tag:"result",event:"user_activity.cancel",log:{}})}),[n,A,v]);return dv.createElement(bG,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!w)return null;var e=yG.no_permission.msg[g];return w===e&&WW.isIOS?dv.createElement(EG,null,w," ",dv.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):dv.createElement(EG,null,w)}(),dv.createElement(wG,{ref:c,playsInline:!0,muted:!0,flipHorizontal:i,className:d,scale:f}),o,l?dv.cloneElement(l,{onClick:D,"data-testid":"close-camera"}):dv.createElement(CG,{onClick:D,"data-testid":"close-camera"},dv.createElement("img",{src:y,alt:""})))}_G.propTypes={checkCameraMode:Lv.bool,frontCamera:Lv.bool,onClose:Lv.func,onError:Lv.func,onVideoPlayed:Lv.func,children:Lv.node,flipHorizontal:Lv.bool,videoSettings:Lv.object,refVideo:Lv.object,closeButton:Lv.node,videoClassName:Lv.string,scale:Lv.number,defaultCameraId:Lv.string,onWarning:Lv.func},_G.defaultProps={checkCameraMode:!1,frontCamera:!0,onClose:null,onError:null,onVideoPlayed:null,children:null,flipHorizontal:!1,videoSettings:null,refVideo:null,closeButton:null,videoClassName:"",scale:1,defaultCameraId:void 0,onWarning:null};var xG,TG,AG,IG=function(e,t,r){class n extends dv.Component{constructor(){super(...arguments),this.updateDebounced=sG(this.forceUpdate,t,r)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return dv.createElement(e,Object.assign({},this.props))}}return n.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,zy(n,e)}(_G,250),PG=dv.forwardRef((function(e,t){return dv.createElement(_G,rg({},e,{refVideo:t||SG}))})),RG=dv.forwardRef((function(e,t){return dv.createElement(IG,rg({},e,{refVideo:t||SG}))})),NG=aw.table(xG||(xG=pg(["\n width: 100%;\n height: 100%;\n td {\n text-align: center;\n vertical-align: middle;\n padding: 0;\n border: 0;\n }\n border-spacing: 0;\n table-layout: auto;\n border-collapse: collapse;\n"]))),OG=aw.div(TG||(TG=pg(["\n position: relative;\n"]))),DG=Array.from(Array(3).keys()),LG=Array.from(Array(3).keys());function MG(e){var t=e.children,r=e.x,n=e.y,o=e.width,a=e.height,i=e.className,s=e.surroundStyle;return dv.createElement(NG,{className:i},dv.createElement("tbody",null,DG.map((function(e,i){return dv.createElement("tr",{key:e,style:{height:0===i?n:"auto"},"data-testid":"row"},LG.map((function(e,n){var c=1===i&&1===n,u="auto";return c?u=o:0===n&&(u=r),dv.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:og({width:u,height:c?a:"auto"},c?{}:s)},c?dv.createElement(OG,{style:{width:u,height:a}},t):null)})))}))))}MG.propTypes={children:Lv.node,x:Lv.string,y:Lv.string,width:Lv.string,height:Lv.string,className:Lv.string,surroundStyle:Lv.object},MG.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var FG=aw(MG)(AG||(AG=pg(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n"])));function UG(e){var t=e.className;return dv.createElement("svg",{className:t,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},dv.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),dv.createElement("desc",null,"Created with sketchtool."),dv.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},dv.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},dv.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},dv.createElement("g",{id:"Group-2"},dv.createElement("g",{id:"camera"},dv.createElement("path",{d:"M21,3 L17,3 L15,0 L9,0 L7,3 L3,3 C1.34314575,3 0,4.34314575 0,6 L0,18 C0,19.6568542 1.34314575,21 3,21 L21,21 C22.6568542,21 24,19.6568542 24,18 L24,6 C24,4.34314575 22.6568542,3 21,3 Z M12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.7614237,7 17,9.23857625 17,12 C17,14.7614237 14.7614237,17 12,17 L12,17 Z",id:"Shape"})))))))}UG.propTypes={className:Lv.string},UG.defaultProps={className:""};var jG=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},VG="object"==typeof t&&t&&t.Object===Object&&t,zG="object"==typeof self&&self&&self.Object===Object&&self,qG=VG||zG||Function("return this")(),HG=function(){return qG.Date.now()},KG=/\s/;var WG=function(e){for(var t=e.length;t--&&KG.test(e.charAt(t)););return t},GG=/^\s+/;var QG=function(e){return e?e.slice(0,WG(e)+1).replace(GG,""):e},XG=qG.Symbol,YG=Object.prototype,$G=YG.hasOwnProperty,ZG=YG.toString,JG=XG?XG.toStringTag:void 0;var eQ=function(e){var t=$G.call(e,JG),r=e[JG];try{e[JG]=void 0;var n=!0}catch(e){}var o=ZG.call(e);return n&&(t?e[JG]=r:delete e[JG]),o},tQ=Object.prototype.toString;var rQ=function(e){return tQ.call(e)},nQ=XG?XG.toStringTag:void 0;var oQ=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":nQ&&nQ in Object(e)?eQ(e):rQ(e)};var aQ=function(e){return null!=e&&"object"==typeof e};var iQ=function(e){return"symbol"==typeof e||aQ(e)&&"[object Symbol]"==oQ(e)},sQ=/^[-+]0x[0-9a-f]+$/i,cQ=/^0b[01]+$/i,uQ=/^0o[0-7]+$/i,lQ=parseInt;var dQ=function(e){if("number"==typeof e)return e;if(iQ(e))return NaN;if(jG(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=jG(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=QG(e);var r=cQ.test(e);return r||uQ.test(e)?lQ(e.slice(2),r?2:8):sQ.test(e)?NaN:+e},fQ=Math.max,pQ=Math.min;var hQ=function(e,t,r){var n,o,a,i,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var r=n,a=o;return n=o=void 0,u=t,i=e.apply(a,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):i}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=a}function g(){var e=HG();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?pQ(r,a-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,i)}function y(){var e=HG(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return clearTimeout(s),s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),i}return t=dQ(t)||0,jG(r)&&(l=!!r.leading,a=(d="maxWait"in r)?fQ(dQ(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?i:v(HG())},y};var mQ=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return jG(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),hQ(e,t,{leading:n,maxWait:t,trailing:o})};var gQ=function(e){if(!jG(e))return!1;var t=oQ(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},vQ=qG["__core-js_shared__"],yQ=function(){var e=/[^.]+$/.exec(vQ&&vQ.keys&&vQ.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var bQ=function(e){return!!yQ&&yQ in e},wQ=Function.prototype.toString;var kQ=function(e){if(null!=e){try{return wQ.call(e)}catch(e){}try{return e+""}catch(e){}}return""},CQ=/^\[object .+?Constructor\]$/,EQ=Function.prototype,SQ=Object.prototype,BQ=EQ.toString,_Q=SQ.hasOwnProperty,xQ=RegExp("^"+BQ.call(_Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var TQ=function(e){return!(!jG(e)||bQ(e))&&(gQ(e)?xQ:CQ).test(kQ(e))};var AQ=function(e,t){return null==e?void 0:e[t]};var IQ=function(e,t){var r=AQ(e,t);return TQ(r)?r:void 0},PQ=function(){try{var e=IQ(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var RQ=function(e,t,r){"__proto__"==t&&PQ?PQ(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r};var NQ=function(e,t){return e===t||e!=e&&t!=t},OQ=Object.prototype.hasOwnProperty;var DQ=function(e,t,r){var n=e[t];OQ.call(e,t)&&NQ(n,r)&&(void 0!==r||t in e)||RQ(e,t,r)};var LQ=function(e,t,r,n){var o=!r;r||(r={});for(var a=-1,i=t.length;++a<i;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?RQ(r,s,c):DQ(r,s,c)}return r};var MQ=function(e){return e};var FQ=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},UQ=Math.max;var jQ=function(e,t,r){return t=UQ(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=UQ(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),FQ(e,this,s)}};var VQ=function(e){return function(){return e}},zQ=PQ?function(e,t){return PQ(e,"toString",{configurable:!0,enumerable:!1,value:VQ(t),writable:!0})}:MQ,qQ=Date.now;var HQ=function(e){var t=0,r=0;return function(){var n=qQ(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(zQ);var KQ=function(e,t){return HQ(jQ(e,t,MQ),e+"")};var WQ=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var GQ=function(e){return null!=e&&WQ(e.length)&&!gQ(e)},QQ=/^(?:0|[1-9]\d*)$/;var XQ=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&QQ.test(e))&&e>-1&&e%1==0&&e<t};var YQ=function(e,t,r){if(!jG(r))return!1;var n=typeof t;return!!("number"==n?GQ(r)&&XQ(t,r.length):"string"==n&&t in r)&&NQ(r[t],e)};var $Q=function(e){return KQ((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,i&&YQ(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,a)}return t}))};var ZQ=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n};var JQ=function(e){return aQ(e)&&"[object Arguments]"==oQ(e)},eX=Object.prototype,tX=eX.hasOwnProperty,rX=eX.propertyIsEnumerable,nX=JQ(function(){return arguments}())?JQ:function(e){return aQ(e)&&tX.call(e,"callee")&&!rX.call(e,"callee")},oX=Array.isArray;var aX=function(){return!1},iX=n((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?qG.Buffer:void 0,a=(o?o.isBuffer:void 0)||aX;e.exports=a})),sX={};sX["[object Float32Array]"]=sX["[object Float64Array]"]=sX["[object Int8Array]"]=sX["[object Int16Array]"]=sX["[object Int32Array]"]=sX["[object Uint8Array]"]=sX["[object Uint8ClampedArray]"]=sX["[object Uint16Array]"]=sX["[object Uint32Array]"]=!0,sX["[object Arguments]"]=sX["[object Array]"]=sX["[object ArrayBuffer]"]=sX["[object Boolean]"]=sX["[object DataView]"]=sX["[object Date]"]=sX["[object Error]"]=sX["[object Function]"]=sX["[object Map]"]=sX["[object Number]"]=sX["[object Object]"]=sX["[object RegExp]"]=sX["[object Set]"]=sX["[object String]"]=sX["[object WeakMap]"]=!1;var cX=function(e){return aQ(e)&&WQ(e.length)&&!!sX[oQ(e)]};var uX=function(e){return function(t){return e(t)}},lX=n((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&VG.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a})),dX=lX&&lX.isTypedArray,fX=dX?uX(dX):cX,pX=Object.prototype.hasOwnProperty;var hX=function(e,t){var r=oX(e),n=!r&&nX(e),o=!r&&!n&&iX(e),a=!r&&!n&&!o&&fX(e),i=r||n||o||a,s=i?ZQ(e.length,String):[],c=s.length;for(var u in e)!t&&!pX.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||XQ(u,c))||s.push(u);return s},mX=Object.prototype;var gX=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||mX)};var vX=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},yX=Object.prototype.hasOwnProperty;var bX=function(e){if(!jG(e))return vX(e);var t=gX(e),r=[];for(var n in e)("constructor"!=n||!t&&yX.call(e,n))&&r.push(n);return r};var wX=function(e){return GQ(e)?hX(e,!0):bX(e)},kX=$Q((function(e,t,r,n){LQ(t,wX(t),e,n)}));var CX=function(e,t){return function(r){return e(t(r))}},EX=CX(Object.getPrototypeOf,Object),SX=Function.prototype,BX=Object.prototype,_X=SX.toString,xX=BX.hasOwnProperty,TX=_X.call(Object);var AX=function(e){if(!aQ(e)||"[object Object]"!=oQ(e))return!1;var t=EX(e);if(null===t)return!0;var r=xX.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&_X.call(r)==TX};var IX=function(e){if(!aQ(e))return!1;var t=oQ(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!AX(e)},PX=KQ((function(e,t){try{return FQ(e,void 0,t)}catch(e){return IX(e)?e:new Error(e)}}));var RX=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o};var NX=function(e,t){return RX(t,(function(t){return e[t]}))},OX=Object.prototype,DX=OX.hasOwnProperty;var LX=function(e,t,r,n){return void 0===e||NQ(e,OX[r])&&!DX.call(n,r)?t:e},MX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var FX=function(e){return"\\"+MX[e]},UX=CX(Object.keys,Object),jX=Object.prototype.hasOwnProperty;var VX=function(e){if(!gX(e))return UX(e);var t=[];for(var r in Object(e))jX.call(e,r)&&"constructor"!=r&&t.push(r);return t};var zX=function(e){return GQ(e)?hX(e):VX(e)},qX=/<%=([\s\S]+?)%>/g;var HX=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),KX=XG?XG.prototype:void 0,WX=KX?KX.toString:void 0;var GX=function e(t){if("string"==typeof t)return t;if(oX(t))return RX(t,e)+"";if(iQ(t))return WX?WX.call(t):"";var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r};var QX=function(e){return null==e?"":GX(e)},XX=/[&<>"']/g,YX=RegExp(XX.source);var $X={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:qX,variable:"",imports:{_:{escape:function(e){return(e=QX(e))&&YX.test(e)?e.replace(XX,HX):e}}}},ZX=/\b__p \+= '';/g,JX=/\b(__p \+=) '' \+/g,eY=/(__e\(.*?\)|\b__t\)) \+\n'';/g,tY=/[()=,{}\[\]\/\s]/,rY=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nY=/($^)/,oY=/['\n\r\u2028\u2029\\]/g,aY=Object.prototype.hasOwnProperty;var iY=function(e,t,r){var n=$X.imports._.templateSettings||$X;r&&YQ(e,t,r)&&(t=void 0),e=QX(e),t=kX({},t,n,LX);var o,a,i=kX({},t.imports,n.imports,LX),s=zX(i),c=NX(i,s),u=0,l=t.interpolate||nY,d="__p += '",f=RegExp((t.escape||nY).source+"|"+l.source+"|"+(l===qX?rY:nY).source+"|"+(t.evaluate||nY).source+"|$","g"),p=aY.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,i,s,c){return n||(n=i),d+=e.slice(u,c).replace(oY,FX),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var h=aY.call(t,"variable")&&t.variable;if(h){if(tY.test(h))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(ZX,""):d).replace(JX,"$1").replace(eY,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=PX((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(m.source=d,IX(m))throw m;return m},sY=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cY=/^\w*$/;var uY=function(e,t){if(oX(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!iQ(e))||(cY.test(e)||!sY.test(e)||null!=t&&e in Object(t))},lY=IQ(Object,"create");var dY=function(){this.__data__=lY?lY(null):{},this.size=0};var fY=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},pY=Object.prototype.hasOwnProperty;var hY=function(e){var t=this.__data__;if(lY){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return pY.call(t,e)?t[e]:void 0},mY=Object.prototype.hasOwnProperty;var gY=function(e){var t=this.__data__;return lY?void 0!==t[e]:mY.call(t,e)};var vY=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=lY&&void 0===t?"__lodash_hash_undefined__":t,this};function yY(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}yY.prototype.clear=dY,yY.prototype.delete=fY,yY.prototype.get=hY,yY.prototype.has=gY,yY.prototype.set=vY;var bY=yY;var wY=function(){this.__data__=[],this.size=0};var kY=function(e,t){for(var r=e.length;r--;)if(NQ(e[r][0],t))return r;return-1},CY=Array.prototype.splice;var EY=function(e){var t=this.__data__,r=kY(t,e);return!(r<0)&&(r==t.length-1?t.pop():CY.call(t,r,1),--this.size,!0)};var SY=function(e){var t=this.__data__,r=kY(t,e);return r<0?void 0:t[r][1]};var BY=function(e){return kY(this.__data__,e)>-1};var _Y=function(e,t){var r=this.__data__,n=kY(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function xY(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}xY.prototype.clear=wY,xY.prototype.delete=EY,xY.prototype.get=SY,xY.prototype.has=BY,xY.prototype.set=_Y;var TY=xY,AY=IQ(qG,"Map");var IY=function(){this.size=0,this.__data__={hash:new bY,map:new(AY||TY),string:new bY}};var PY=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var RY=function(e,t){var r=e.__data__;return PY(t)?r["string"==typeof t?"string":"hash"]:r.map};var NY=function(e){var t=RY(this,e).delete(e);return this.size-=t?1:0,t};var OY=function(e){return RY(this,e).get(e)};var DY=function(e){return RY(this,e).has(e)};var LY=function(e,t){var r=RY(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function MY(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}MY.prototype.clear=IY,MY.prototype.delete=NY,MY.prototype.get=OY,MY.prototype.has=DY,MY.prototype.set=LY;var FY=MY;function UY(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(UY.Cache||FY),r}UY.Cache=FY;var jY=UY;var VY=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zY=/\\(\\)?/g,qY=function(e){var t=jY(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(VY,(function(e,r,n,o){t.push(n?o.replace(zY,"$1"):r||e)})),t}));var HY=function(e,t){return oX(e)?e:uY(e,t)?[e]:qY(QX(e))};var KY=function(e){if("string"==typeof e||iQ(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var WY=function(e,t){for(var r=0,n=(t=HY(t,e)).length;null!=e&&r<n;)e=e[KY(t[r++])];return r&&r==n?e:void 0};var GY=function(e,t,r){var n=null==e?void 0:WY(e,t);return void 0===n?r:n},QY=aI.Errors;function XY(e){var t=e.livenessSettings,r=e.apiClient,n=e.apiCheck,o=e.onError,a=hg(dv.useState({face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,take_one_picture_time_ms:3e3,limit_time_liveness_check:{enable:!1,limit_time_second:45},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5},exif_data_settings:{enable:!0},record_video:{enable:!1}}),2),i=a[0],s=a[1];return dv.useEffect((function(){t&&Object.keys(t).length>0?s((function(e){return og(og({},e),t)})):n&&r.clientSettings().then((function(e){if(e&&e.data){var t,r=GY(e,"data.settings.sdk_settings.active_liveness_settings"),n=GY(e,"data.settings.sdk_settings.liveness_settings"),a=GY(r,"save_encoded_frames",{});a.enable&&(t={enable:!0,framesIntervalTime:a.frames_interval_ms,framesBatchLength:a.frames_batch_len});var i=GY(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});s(og(og(og({},r),n),{},{captureFrameSettings:t,exif_data_settings:i}))}e&&e.errors&&o(QY.server_error)})).catch((function(e){o(e)}))}),[t,r,o,n]),i}var YY=function(e){var t=e.curStep,r=e.faceDirection,n=GY(t,"stepTimeConstraints.delayTime");return!!n&&(null===t.firstFrameSpottedAt?(t.name===r&&(t.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-t.firstFrameSpottedAt<n)};var $Y=function(e){return e?Infinity===(e=dQ(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var ZY=function(e){var t=$Y(e),r=t%1;return t==t?r?t-r:t:0};var JY=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=ZY(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}};var e$=function(e){return JY(2,e)},t$=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.closeEyesModelUrl,n=void 0===r?WM:r,e.next=3,SL.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function r$(){return(r$=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.blazefaceModelUrl,n=t.tfScriptUrls,o=t.closeEyesModelUrl,a=new GM(o),e.next=4,SL.loadTensorFlow(n);case 4:return e.next=6,SL.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[SL.loadBlazefaceModel({modelUrl:r}),a.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=hg(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:a});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var n$,o$=e$((function(){return r$.apply(this,arguments)})),a$=[],i$=function(){a$=[]},s$=function(e,t,r){r&&i$(),a$.push({id:null});var n=a$.length-1;t.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?a$[n].id=e.data.file_id:a$[n].id=-1}))},c$=function(e,t,r){r&&i$(),a$.push({id:null});var n=a$.length-1;t.uploadFiles({frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?a$[n].id=e.data.file_id:a$[n].id=-1}))},u$=function(){return new Promise((function(e){var t=setInterval((function(){a$.every((function(e){return e.id}))&&(e(),clearInterval(t))}),200)}))},l$=function(e){return e.enable?a$.some((function(e){return-1===e.id}))?null:a$:[]},d$=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.steps,n=t.apiClient,o=t.FaceDirection,a=t.outputEncryptionSettings,i=t.video,s=[],r.forEach((function(e){var t=e.name,r=e.image,i=e.frontalFaceImage;if(t!==o.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:r.leftRightScore,gesture:t})};a&&a.key?s.push(n.httpClient.post("/v1/images",og({base64:r.encrypted.hex},c),{"X-TV-Key":a.key})):s.push(n.uploadImage(og({file:r.blob},c)))}else s.push(Promise.resolve({data:{image_id:null}}));if(i.blob){var u={label:"portrait",metadata:JSON.stringify({gesture_score:i.leftRightScore,gesture:o.FRONTAL})};a&&a.key?s.push(n.httpClient.post("/v1/images",og({base64:i.encrypted.hex},u),{"X-TV-Key":a.key})):s.push(n.uploadImage(og({file:i.blob},u)))}else s.push(Promise.resolve({data:{image_id:null}}))})),c=i?n.uploadFile({file:i,label:"video"}):Promise.resolve({data:{file_id:null}}),e.next=6,Promise.all([c].concat(s));case 6:return u=e.sent,l=gg(p=u)||vg(p)||yg(p)||wg(),d=l[0],f=l.slice(1),r.forEach((function(e,t){e.image.imageId=f[2*t].data.image_id,e.frontalFaceImage.imageId=f[2*t+1].data.image_id})),e.abrupt("return",d);case 12:case"end":return e.stop()}var p}),e)})));return function(t){return e.apply(this,arguments)}}(),f$=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.faceVerificationFlowData,o=t.onLivenessDetectionDone,a=t.captureFrameSettings,i=t.FaceDirection,s=t.onError,c=t.outputEncryptionSettings,u=t.video,e.prev=1,l=n.current.steps,e.next=5,d$({steps:l,apiClient:r,FaceDirection:i,outputEncryptionSettings:c,video:u});case 5:if(0!==(d=l.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=10;break}o({error:"wrong_face_movement"}),e.next=27;break;case 10:return e.next=12,u$();case 12:if(f=l$(a)){e.next=17;break}o({error:"network_error"}),e.next=27;break;case 17:return p=r.verifyFaceLiveness({images:d.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:l.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:f}),h=r.requestVerifyPortrait({image:{id:d[d.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([p,h]);case 21:m=e.sent,g=hg(m,2),v=g[0],y=g[1],b=!0===v.data.is_live,o({apiCheckPassed:b,verifyFaceLivenessResult:v.data,verifyFacePortraitResult:y.data,frontalFaces:d.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:l.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){var t=e.name,r=e.image;return{name:t,blob:r.blob,id:r.imageId}}))});case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(1),s({error:e.t0});case 32:case"end":return e.stop()}}),e,null,[[1,29]])})));return function(t){return e.apply(this,arguments)}}(),p$=[],h$=null,m$=!1,g$=function(){return p$},v$=function(){m$=!0,p$=[];try{h$ instanceof MediaStream&&(h$.getTracks().forEach((function(e){return e.stop()})),h$=null)}catch(e){}};function y$(e,t,r){if(e.data.size>0){var n=new Blob([e.data],{type:"video/mp4"});p$.push(n),t()}else console.error("No video have recored!"),r()}function b$(e,t,r,n){if(e&&n){var o=n.cropX,a=n.cropY,i=n.cropWidth,s=n.cropHeight;e.drawImage(t,o,a,i,s,0,0,r,r),m$||requestAnimationFrame((function(){return b$(e,t,r,n)}))}}function w$(e){return k$.apply(this,arguments)}function k$(){return(k$=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.outputImagesSize,n=t.videoEl,o=t.resultAnalyzeVideoAndWindowSizes,v$(),(i=document.createElement("canvas")).width=r,i.height=r,s=i.getContext("2d"),e.prev=6,c={width:{min:360,ideal:400},height:{min:360,ideal:400}},u={mimeType:"video/webm"},e.prev=9,h$=null==n||null===(l=n.captureStream())||void 0===l?void 0:l.clone(),d=h$.getVideoTracks()[0],e.next=14,d.applyConstraints(c);case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(9);case 18:MediaRecorder.isTypeSupported("video/mp4")&&(m$=!1,b$(s,n,r,o),h$=i.captureStream(25),u={mimeType:"video/mp4",videoBitsPerSecond:25e5}),a=new MediaRecorder(h$,u),f=function(){return new Promise((function(e,t){a.ondataavailable=function(r){return y$(r,e,t)},"inactive"!==a.state&&a.stop()}))},p=function(){var e=$m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f();case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),h=function(){"inactive"!==a.state&&a.stop()},a.stopVideoRecording=p,a.discardRecording=h,e.next=29;break;case 27:e.prev=27,e.t1=e.catch(6);case 29:return e.abrupt("return",{mediaRecorder:a});case 30:case"end":return e.stop()}}),e,null,[[6,27],[9,16]])})))).apply(this,arguments)}var C$,E$,S$,B$,_$,x$,T$,A$=FO.faceTracker(),I$=new AL,P$=aI.Mode,R$=aI.FaceDirection,N$=aI.Errors,O$=aI.Messages,D$=aI.TrackLivenessEvents,L$={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(n$={},tg(n$,aI.FaceDirection.UP,{delayTime:0}),tg(n$,aI.FaceDirection.LEFT,{delayTime:0}),tg(n$,aI.FaceDirection.RIGHT,{delayTime:0}),tg(n$,aI.FaceDirection.FRONTAL,{delayTime:2e3}),n$),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}},M$=function(e){var t=e.apiCredentials,r=e.sdkAdapter,n=$D.useApiClient({apiCredentials:t}).apiClient;return{apiClient:r instanceof eF?r:n,apiClientFromUtils:n}};function F$(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,r=e.mode,n=e.bgCameraMask,o=e.bgCameraMaskRed,a=e.surroundStyle,i=e.cropAreaDimension,s=e.customInstructions,c=e.customIcon,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=void 0===l?L$.customStepTimeConstraints:l,f=e.onLivenessDetectionDone,p=e.onError,h=e.frontalMinSize,m=e.waitingTimeToGetBetterFrames,g=void 0===m?500:m,v=e.captureFrameSettings,y=void 0===v?L$.captureFrameSettings:v,b=e.livenessSettings,w=e.setRemainingTime,k=void 0===w?L$.setRemainingTime:w,C=e.onProcessing,E=void 0===C?L$.onProcessing:C,S=e.customErrors,B=e.customMessages,_=e.apiCredentials,x=void 0===_?{}:_,T=e.onFramesCaptured,A=void 0===T?L$.onFramesCaptured:T,I=e.initFirstGestureTimeout,P=void 0===I?2e3:I,R=e.outputEncryptionSettings,N=e.cameraScale,O=void 0===N?1:N,D=e.passiveModeAuto,L=void 0!==D&&D,M=e.sendCustomEvent,F=e.sdkAdapter,U=void 0===F?null:F,j=dv.useState(!1),V=hg(j,2),z=V[0],q=V[1],H=dv.useState(!1),K=hg(H,2),W=K[0],G=K[1],Q=dv.useState(!1),X=hg(Q,2),Y=X[0],$=X[1],Z=dv.useState(!1),J=hg(Z,2),ee=J[0],te=J[1],re=dv.useRef(null),ne=hN.useSDKSettings(),oe=ne.lang,ae=ne.assetRoot,ie=ne.customUrls,se=r===P$.ACTIVE,ce=dv.useReducer((function(e){return e+1}),0),ue=hg(ce,2),le=(ue[0],ue[1]),de=dv.useRef(null),fe=dv.useRef(!1),pe=dv.useState(!1),he=hg(pe,2),me=he[0],ge=he[1],ve=dv.useRef({}),ye=M$({apiCredentials:x,sdkAdapter:U}),be=ye.apiClient,we=ye.apiClientFromUtils,ke=KN.useSDKTracking(),Ce=ke.sendEvent,Ee=XM(),Se=Ee.startMotion,Be=Ee.stopMotion,_e=Ee.motionData,xe=Ee.orientationData,Te=dv.useRef(null);null===Te.current&&(Te.current=FO.initFaceVerificationData({assetRoot:ae,customInstructions:s,customIcon:c,customDirectionIcon:u,customStepTimeConstraints:d}));var Ae=dv.useState(),Ie=hg(Ae,2),Pe=Ie[0],Re=Ie[1],Ne=dv.useCallback((function(e){Re(e)}),[]),Oe=dv.useMemo((function(){return mQ(Ne,500)}),[Ne]),De=dv.useRef([]),Le=dv.useRef(),Me=XY({livenessSettings:b,apiClient:we,apiCheck:t,onError:p}),Fe=Me.face_tracking_setting,Ue=Me.flow_interval_time_ms,je=Me.limit_time_liveness_check,Ve=Me.terminate_if_no_face,ze=Me.close_eye_detector,qe=void 0===ze?{}:ze,He=Me.captureFrameSettings,Ke=void 0===He?y:He,We=Me.exif_data_settings,Ge=Me.take_one_picture_time_ms,Qe=Me.record_video,Xe=null==Qe?void 0:Qe.enable,Ye=dv.useRef(""),$e=dv.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==D$?void 0:D$.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===Ye.current)return;Ye.current=r}Ce(e),M&&M(e)}}),[M,Ce]),Ze=dv.useMemo((function(){return mQ((function(e){$e(e)}),2e3)}),[$e]),Je=dv.useRef(0),et=dv.useRef(),tt=dv.useRef();dv.useEffect((function(){$e({tag:"selfie",event:null==D$?void 0:D$.start_camera,log:{}})}),[$e]),dv.useEffect((function(){return I$.start(),KM.initExifData(),function(){I$.stop()}}),[]),dv.useEffect((function(){var e=!1;function t(){return(t=$m(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(me){t.next=13;break}return Le.current=performance.now(),t.next=4,o$(ie);case 4:return ve.current=t.sent,t.next=7,SL.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){t.next=9;break}return t.abrupt("return");case 9:ge(!0),$e({tag:"selfie",event:null==D$?void 0:D$.show_warmup,log:{}}),$e({tag:"selfie",event:null==D$?void 0:D$.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Le.current}}),Le.current=null;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[me,ie,$e]);var rt=dv.useCallback((function(){var e;k(""),Te.current.curStepIndex=Te.current.steps.length,$(!1),I$.stop(),null===(e=tt.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;Te.current=FO.initFaceVerificationData({assetRoot:ae,customInstructions:s,customIcon:c,customDirectionIcon:u}),I$.start(),Je.current=0,et.current=null,De.current=[],te(!1),i$(),null===(e=tt.current)||void 0===e||e.start(),le()}),Ue)}),[ae,s,c,u,Ue,k]),nt=dv.useMemo((function(){return og(og({},N$),S)}),[S]),ot=dv.useMemo((function(){return og(og({},O$),B)}),[B]),at=400;dv.useEffect((function(){if(W&&je.enable&&ee){var e=je.limit_time_second+1,t=je.remain_time_show||10,r=je.format||"s";I$.start("limit",(function(n){var o=e-n;if(Te.current.curStepIndex<Te.current.steps.length){if(o<=t&&o>=1){var a=iY(ot.REMAIN_TIME[oe]),i=o;switch(r){case"mm:ss":i=o.toString().padStart(5,"00:00");break;case"ss":i=o.toString().padStart(2,"0")}k(a({x:i}))}if(0===o){var s,c={};Object.keys(null===(s=nt.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=iY(null===(t=nt.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:je.limit_time_second})})),Re(og(og({},nt.liveness_terminated_time_out),{},{msg:c,duration:Ue})),$e({tag:"selfie",event:null==D$?void 0:D$.show_alert,log:{alert:"liveness_terminated_time_out,"}}),rt()}}}))}}),[rt,k,W,oe,Ue,je.enable,je.limit_time_second,ee,nt.liveness_terminated_time_out,ot.REMAIN_TIME,je.format,je.remain_time_show,$e]);var it=dv.useCallback((function(e){var t,r,o=e.clientWidth,s=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;WW.isMobile?r=t=c:t=r=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=n;de.current={x:f,y:p,width:t,height:r,image:h,surroundStyle:a},"object"===Xm(i)?de.current=og(og({},de.current),i):"function"==typeof i&&(de.current=og(og({},de.current),i({clientWidth:o,clientHeight:s,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:WW.isMobile,width:t,height:r}))),le(),G(!0)}),[n,a,i]),st=dv.useState(3),ct=hg(st,2),ut=ct[0],lt=ct[1],dt=dv.useState(!1),ft=hg(dt,2),pt=ft[0],ht=ft[1],mt=dv.useRef(!1),gt=dv.useCallback((function(e){ht(e),mt.current=e}),[]),vt=dv.useRef(null),yt=dv.useRef([]),bt=dv.useCallback((function(){lt(3),clearInterval(vt.current),gt(!0);var e=function(){var e=$m(regeneratorRuntime.mark((function e(r){var n,o,a,i,s,c,u,l,d,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r-1!=0){e.next=27;break}return clearInterval(vt.current),o=yt.current,E(),q(!0),e.next=7,null===(n=tt.current)||void 0===n?void 0:n.stopVideoRecording();case 7:return Be(),KM.preWriteExif({mode:KM.MODE.SELFIE,motionData:_e,orientationData:xe,startTime:Date.now()-1e3*I$.duration("from_1st_frame"),endTime:Date.now()}),a=o.map((function(e){return FD.resizeBlobImg(e.blob,at,at)})),e.next=12,Promise.all(a);case 12:return i=e.sent,s=i.map((function(e,t){return KM.writeExif({mode:KM.MODE.SELFIE,imageData:og(og({},o[t]),{},{blob:e,gesture:"frontal"}),enableExifData:We.enable})})),e.next=16,Promise.all(s);case 16:if(c=e.sent,u={},!R||!R.key){e.next=25;break}return l=R.key,d=c.map((function(e){return TL.encrypt({blob:e,key:l})})),e.next=23,Promise.all(d);case 23:h=e.sent,u={frontalFacesEncrypted:h};case 25:t?(g=mg(De.current),v=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:R$.FRONTAL})}},y=o.map((function(e,t){return be.uploadImage(og({file:c[t]},v(e.leftRightScore)))})),R&&R.key&&(y=o.map((function(e,t){return we.httpClient.post("/v1/images",og({base64:u.frontalFacesEncrypted[t].hex},v(e.leftRightScore)),{"X-TV-Key":R.key})}))),Promise.all(y).then((function(e){return be.verifyFaceLiveness({images:e.map((function(e){return{id:e.data.image_id}})),videos:[{frames:g}]})})).then((function(e){f({apiCheckPassed:e.data.is_live,verifyFaceLivenessResult:e.data})})).catch((function(e){p({error:e})}))):U instanceof eF?(q(!0),m=og(og({mode:P$.PASSIVE,imageAddedExif:c,frontalFaceImages:o},u),{},{capturedFrames:De.current,steps:Te.current.steps}),f(m),q(!1)):(f(og(og({frontalFaces:c},u),{},{capturedFrames:De.current,video:g$()})),v$()),q(!1);case 27:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();vt.current=setInterval((function(){lt((function(t){return e(t),t-1}))}),Ge/3)}),[Ge,gt,t,f,be,we,p,E,R,Be,_e,xe,We.enable,U]),wt=dv.useRef({});dv.useEffect((function(){wt.current.isFirstValidFrameFoundRef=ee}),[ee]),dv.useEffect((function(){var e,r=re.current,a=function(){var e=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Te.current.steps,r=[],t.map((function(e){return r.push({name:e.name,blob:e.image.blob,captureTime:e.image.captureTime,gesture:e.name}),e.frontalFaceImage.blob&&r.push({name:e.name,blob:e.frontalFaceImage.blob,captureTime:e.frontalFaceImage.captureTime,gesture:R$.FRONTAL}),0})),n=r.map((function(e){return FD.resizeBlobImg(e.blob,at,at)})),e.next=6,Promise.all(n);case 6:return o=e.sent,a="0",y.framesBatchLength>0&&(i="".concat(Math.floor(De.current.length/y.framesBatchLength),"x").concat(y.framesBatchLength),s=De.current.length%y.framesBatchLength>0?"+".concat(De.current.length%y.framesBatchLength):"",a="".concat(De.current.length,":").concat(i).concat(s)),c=o.map((function(e,t){return KM.writeExif({mode:KM.MODE.SELFIE,imageData:og(og({},r[t]),{},{blob:e,frames:a}),enableExifData:We.enable})})),e.next=12,Promise.all(c);case 12:return u=e.sent,l=r.map((function(e,t){return{name:e.name,blob:u[t]}})),e.next=16,Promise.all(t.map(function(){var e=$m(regeneratorRuntime.mark((function e(r,n){var o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=l.filter((function(e){return e.name===r.name})),t[n].image.blob=o[0].blob,r.frontalFaceImage.blob&&(t[n].frontalFaceImage.blob=o[1].blob),!R||!R.key){e.next=12;break}return a=R.key,e.next=7,TL.encrypt({blob:o[0].blob,key:a});case 7:if(t[n].image.encrypted=e.sent,!r.frontalFaceImage.blob){e.next=12;break}return e.next=11,TL.encrypt({blob:o[1].blob,key:a});case 11:t[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),i=function(){var e=$m(regeneratorRuntime.mark((function e(){var r,n,o,i,s,c,u,l,d,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Te.current.steps,o=n[Te.current.curStepIndex],tg(r={},aI.FaceDirection.UP,null==D$?void 0:D$.capture_up_face),tg(r,aI.FaceDirection.LEFT,null==D$?void 0:D$.capture_left_face),tg(r,aI.FaceDirection.RIGHT,null==D$?void 0:D$.capture_right_face),tg(r,aI.FaceDirection.FRONTAL,null==D$?void 0:D$.capture_frontal_face),$e({tag:"selfie",event:r[o.name],log:{time_capture_in_seconds:((performance.now()-Le.current)/1e3).toFixed(1)}}),Te.current.curStepIndex++,Le.current=performance.now(),Fe.enable&&"each_gesture"===Fe.limit_for&&(Je.current=0),Te.current.curStepIndex!==n.length){e.next=48;break}if(je.enable&&k(""),!f){e.next=48;break}return Ke.enable&&Ke.framesBatchLength>0&&De.current.length%Ke.framesBatchLength>0&&(A(De.current.slice(De.current.length%Ke.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t?s$(De.current.slice(De.current.length%Ke.framesBatchLength*-1),we):U instanceof eF&&c$(De.current.slice(De.current.length%Ke.framesBatchLength*-1),be)),$e({tag:"selfie",event:null==D$?void 0:D$.finish_capture,log:{time_capture_in_seconds:I$.duration("from_1st_frame")}}),E(),q(!0),e.next=16,null===(i=tt.current)||void 0===i?void 0:i.stopVideoRecording();case 16:return Be(),KM.preWriteExif({mode:KM.MODE.SELFIE,motionData:_e,orientationData:xe,startTime:Date.now()-1e3*I$.duration("from_1st_frame"),endTime:Date.now()}),e.next=20,a();case 20:if(t){e.next=40;break}if(d=n.filter((function(e){return e.name!==R$.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),m=n.filter((function(e){return e.name!==R$.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),g=n.filter((function(e){return e.name!==R$.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),v=null===(s=n.find((function(e){return e.name===R$.FRONTAL})))||void 0===s||null===(c=s.image)||void 0===c?void 0:c.blob,y=null===(u=n.find((function(e){return e.name===R$.FRONTAL})))||void 0===u||null===(l=u.image)||void 0===l?void 0:l.encrypted,!v||!h){e.next=32;break}return e.next=29,FD.scaleImage(v,{minSize:h});case 29:e.t0=e.sent,e.next=33;break;case 32:e.t0=null;case 33:b=e.t0,v&&m.push(v),y&&g.push(y),$e({tag:"result",event:null==D$?void 0:D$.liveness_detection_done,log:{result_object:{steps:d,frontalFaces:m,frontalScaledImage:b}}}),f(U instanceof eF?{mode:P$.ACTIVE,faceVerificationFlowData:Te,captureFrameSettings:Ke,FaceDirection:R$,capturedFrames:De.current}:{steps:d,frontalFaces:m,frontalFacesEncrypted:g,frontalScaledImage:b,capturedFrames:De.current}),e.next=47;break;case 40:if(!(U instanceof eF)){e.next=45;break}f({mode:P$.ACTIVE,faceVerificationFlowData:Te,captureFrameSettings:Ke,FaceDirection:R$,capturedFrames:De.current,video:g$().length?g$()[0]:null}),v$(),e.next=47;break;case 45:return e.next=47,f$({apiClient:be,faceVerificationFlowData:Te,onLivenessDetectionDone:f,captureFrameSettings:Ke,FaceDirection:R$,onError:p,outputEncryptionSettings:R,video:g$().length?g$()[0]:null});case 47:q(!1);case 48:le();case 49:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=hQ((function(){var e=Te.current,t=e.curStepIndex,r=e.steps,n=r[t],o=null!==(null==n?void 0:n.image.blob),a=null!==(null==n?void 0:n.frontalFaceImage.blob),s=r.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(a||![1].includes(t)||s>=1)?(fe.current=!1,i(),c=!0):fe.current=!(!o||a),$(!1),c}),g);function c(e){return u.apply(this,arguments)}function u(){return(u=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.blurScore,a=t.leftRightScore,c=t.isEyeClose,u=Te.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!YY({faceDirection:r,curStep:f})){e.next=6;break}return e.abrupt("return");case 6:if(!c){e.next=8;break}return e.abrupt("return");case 8:if(r!==R$.FRONTAL||null!==f.frontalFaceImage.blurScore&&!wO.hasBetterBlurScore(o,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=o,e.next=12,CO.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=a,f.frontalFaceImage.captureTime=Date.now(),fe.current&&(fe.current=!1,i());case 17:if(f.name!==r||null!==f.image.blurScore&&!wO.hasBetterBlurScore(o,f.image.blurScore)){e.next=29;break}return $(!0),f.image.blurScore=o,e.next=22,CO.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=a,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(h),s();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,t,r){return m.apply(this,arguments)}function m(){return(m=$m(regeneratorRuntime.mark((function e(t,r,n){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!0===mt.current&&t===R$.FRONTAL&&yt.current.length<3)){e.next=5;break}return e.next=3,CO.takePicture({canvas:r});case 3:o=e.sent,yt.current.push({blob:o,leftRightScore:n,captureTime:Date.now()});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e,r,n,o){if(De.current.length&&Date.now()-De.current[De.current.length-1].time<Ke.framesIntervalTime)return null;if(Ke.enable&&!o){var a=e.topLeft,i=e.bottomRight,s=[].concat(mg(a),mg(i)),c=A$(e,0===De.current.length),u=c.score,l=c.time,d=r.toDataURL("image/jpeg",.8);return De.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:De.current.length,bbox:s,original_bbox:s}),Ke.framesBatchLength>0&&De.current.length%Ke.framesBatchLength==0&&A&&(A(De.current.slice(-Ke.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t?s$(De.current.slice(-Ke.framesBatchLength),we,De.current.length===Ke.framesBatchLength):U instanceof eF&&c$(De.current.slice(-Ke.framesBatchLength),be,De.current.length===Ke.framesBatchLength)),u}return null}function b(e){var t=e.trackingScore,r=e.isFirstValidFrameFoundRef;if(!Fe.enable||null===t||!r)return!0;var n=Fe.web_warning_threshold,o=Fe.web_terminate_threshold,a=Fe.max_warning_time;return t<n||(t<o&&Je.current<a?(Je.current++,Je.current===a?(Re(og(og({},nt.liveness_terminated_face_tracking),{},{duration:Ue})),$e({tag:"selfie",event:null==D$?void 0:D$.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):Re(og(og({},nt.liveness_too_fast),{},{duration:1500})),!0):(Re(og(og({},nt.liveness_terminated),{},{duration:Ue})),$e({tag:"selfie",event:null==D$?void 0:D$.show_alert,log:{alert:"liveness_terminated"}}),rt(),!1))}function w(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(Ve.enable&&r){var n=Ve.max_time_ms;et.current&&t||(et.current={time:Date.now(),frame:0}),t&&et.current.frame++;var o=et.current.time;t&&Date.now()-o>=n&&(Re(og(og({},nt.liveness_terminated_no_face),{},{duration:Ue})),$e({tag:"selfie",event:null==D$?void 0:D$.show_alert,log:{alert:"liveness_terminated_no_face"}}),rt())}}function C(e,t){return S.apply(this,arguments)}function S(){return(S=$m(regeneratorRuntime.mark((function t(a,i){var s,u,f,p,h,m,g,y,k,E,S,B,_,x,T,A,I,P,R,N,D,M,F,U,j,V,z,q,H,K,W,G,Q,X,Y,$,Z;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==i?void 0:i.width)&&0!==(null==i?void 0:i.height)){t.next=2;break}return t.abrupt("return");case 2:return p=wt.current.isFirstValidFrameFoundRef,h=a.cropX,m=a.cropY,g=a.cropWidth,y=a.cropHeight,i.getContext("2d").drawImage(r,h,m,g,y,-(at*O-at)/2/O,-(at*O-at)/2/O,at,at),k=ve.current,E=k.blazefaceModel,S=k.closeEyesModel,t.next=9,Promise.all([wO.calculateBlurScore(i),jO.getModelPredictions({model:E,sCanvas:i})]);case 9:return B=t.sent,_=hg(B,2),x=_[0],T=_[1],t.next=15,FO.validatePredictions({predictions:T,width:jO.SIZE,height:jO.SIZE});case 15:if(I=t.sent,P=I.error,R=I.fullFace,N=I.faceRatio,D=I.faceNotFrontalMinThreshold,A=P,de.current.image=n,F=null,U=null,j=null,V=null,z=Te.current,q=z.curStepIndex,H=z.steps,!R){t.next=44;break}return K=H[q],W=K&&K.name===R$.FRONTAL,j=R.landmarks,t.next=33,FO.calculateFaceDirection({landmarks:j,getPerfectFrontal:W});case 33:if((G=t.sent)&&(F=G.gesture,U=G.leftRightScore),Q=(null==qe?void 0:qe.web_timeout)+d[aI.FaceDirection.FRONTAL].delayTime/1e3,!(W&&null!=qe&&qe.enable&&(-1===I$.duration("limit_close_eye")||I$.duration("limit_close_eye")<Q))){t.next=44;break}return-1===I$.duration("limit_close_eye")&&I$.start("limit_close_eye"),t.next=40,S.predict(i,j,null==qe?void 0:qe.web_threshold);case 40:X=t.sent,Y=X.isEyeClose,(V=Y)&&!A&&(A=N$.close_eye);case 44:if($="no_face"===(null===(s=A)||void 0===s?void 0:s.code)||"partial_face"===(null===(u=A)||void 0===u?void 0:u.code),Z=q<H.length,w({noFace:$&&Z,isFirstValidFrameFoundRef:p}),null!==(f=A)&&void 0!==f&&f.code&&Ze({tag:"selfie",event:null==D$?void 0:D$.show_alert,log:{alert:A.code}}),A&&!("face_too_small"===A.code&&F!==R$.FRONTAL&&N>=D)){t.next=70;break}if(se||v(T[0],i,j),!se){t.next=58;break}if(p||(te(!0),Le.current=performance.now(),I$.start("from_1st_frame")),!b({trackingScore:v(T[0],i,j,q>=H.length),isFirstValidFrameFoundRef:p})){t.next=56;break}return t.next=56,c({faceDirection:F,canvas:i,blurScore:x,leftRightScore:U,isEyeClose:V});case 56:t.next=68;break;case 58:if(F===R$.FRONTAL){t.next=63;break}M=nt.not_frontal_face,de.current.image=o,t.next=68;break;case 63:if(A){t.next=68;break}return p||(te(!0),I$.start("from_1st_frame")),L&&!mt.current&&0===yt.current.length&&setTimeout((function(){bt()}),500),t.next=68,l(F,i,U);case 68:t.next=71;break;case 70:q<H.length&&(M=nt[A.code],de.current.image=o);case 71:Oe(M),-1!==e&&(e=requestAnimationFrame((function(){return C(a,i)})));case 73:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function B(){return(B=$m(regeneratorRuntime.mark((function e(){var t,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=CO.analyzeVideoAndWindowSizes(r,de.current),(n=document.createElement("canvas")).width=at,n.height=at,(o=n.getContext("2d")).translate(at,0),o.scale(-1*O,1*O),!Xe||!r){e.next=13;break}return e.next=10,w$({outputImagesSize:at,videoEl:r,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:a=e.t0,i=a.mediaRecorder,tt.current=i,tt.current&&tt.current.start(),C(t,n);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return W&&me&&setTimeout((function(){!function(){B.apply(this,arguments)}()}),P),function(){cancelAnimationFrame(e),e=-1}}),[P,W,oe,se,be,we,t,n,o,f,p,h,g,Ke,E,Fe,je.enable,k,Oe,d,Ue,rt,Ve,nt,me,$e,A,R,O,bt,L,qe.enable,qe.web_threshold,qe.web_timeout,_e,xe,Be,We.enable,Ze,y.framesBatchLength,U,Xe]),dv.useEffect((function(){Pe&&(clearInterval(vt.current),gt(!1),yt.current=[]),Se()}),[Pe,gt,Se]);var kt=Te.current,Ct=kt.curStepIndex,Et=kt.steps,St=dv.useMemo((function(){return Et.find((function(e){return e.name===aI.FaceDirection.FRONTAL}))}),[Et]),Bt=fe.current?St:Et[Ct],_t=Bt&&ee?Bt.instructions[oe]:null,xt=Bt&&ee?Bt.directionIcon:"",Tt=Bt?Bt.directionIconAnimation:"";return{countdownToTakePicture:ut,cropArea:de,curStepIndex:Ct,directionIcon:xt,directionIconAnimation:Tt,faceDetectionError:Pe,handleTriggerPassiveMode:bt,handleVideoPlayed:it,instructions:_t,isActiveMode:se,refVideo:re,showCountdown:pt,steps:Et,videoPlayed:W,activeCapturing:Y,isFirstValidFrameFound:ee,warmupDone:me,motionData:_e,orientationData:xe,showLoading:z}}var U$=(tg(C$={},aI.FaceDirection.LEFT,90),tg(C$,aI.FaceDirection.RIGHT,270),tg(C$,aI.FaceDirection.UP,180),tg(C$,aI.FaceDirection.DOWN,0),C$),j$=cw(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),V$=aw.div(E$||(E$=pg(["\n width: 200px;\n height: 200px;\n position: relative;\n transform: scale(0.48);\n\n .top,\n .right,\n .bottom,\n .left {\n position: absolute;\n }\n\n .top {\n top: 0;\n left: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .right {\n right: 0;\n top: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .bottom {\n bottom: 0;\n left: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n\n .left {\n left: 0;\n top: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n"])),U$[aI.FaceDirection.DOWN],U$[aI.FaceDirection.LEFT],U$[aI.FaceDirection.UP],U$[aI.FaceDirection.RIGHT]),z$=aw.div(S$||(S$=pg(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var t,r=e.direction;return null!==(t=U$[r])&&void 0!==t?t:0})),q$=aw.span(B$||(B$=pg(["\n display: flex;\n margin: 4px 0;\n width: 100%;\n height: 15px;\n animation: "," 1s infinite;\n animation-direction: alternate;\n\n &::before,\n &::after {\n content: '';\n height: 100%;\n width: 50%;\n background: rgba(255, 255, 255, 0.8);\n }\n\n &::before {\n transform: skewY(32deg);\n }\n\n &::after {\n width: 50%;\n transform: skewY(-32deg);\n }\n"])),j$),H$=aw(q$)(_$||(_$=pg(["\n animation-delay: 0s;\n"]))),K$=aw(q$)(x$||(x$=pg(["\n animation-delay: 0.5s;\n"]))),W$=aw(q$)(T$||(T$=pg(["\n animation-delay: 1s;\n"])));function G$(e){var t=e.type;return t!==aI.FaceDirection.FRONTAL?dv.createElement(z$,{direction:t},dv.createElement(H$,null),dv.createElement(K$,null),dv.createElement(W$,null)):dv.createElement(V$,null,dv.createElement(z$,{className:"top"},dv.createElement(H$,null),dv.createElement(K$,null),dv.createElement(W$,null)),dv.createElement(z$,{className:"right"},dv.createElement(H$,null),dv.createElement(K$,null),dv.createElement(W$,null)),dv.createElement(z$,{className:"bottom"},dv.createElement(H$,null),dv.createElement(K$,null),dv.createElement(W$,null)),dv.createElement(z$,{className:"left"},dv.createElement(H$,null),dv.createElement(K$,null),dv.createElement(W$,null)))}G$.propTypes={type:Lv.oneOf([aI.FaceDirection.LEFT,aI.FaceDirection.RIGHT,aI.FaceDirection.UP,aI.FaceDirection.FRONTAL])},G$.defaultProps={type:aI.FaceDirection.LEFT};var Q$,X$=aI.ErrorDuration;function Y$(e){var t=e.children,r=e.errorMsg,n=e.className;return dv.isValidElement(t)?r?dv.createElement("div",{className:n},dv.cloneElement(t,{errorMsg:r})):null:r?dv.createElement("div",{className:n},r):null}function $$(e){var t=e.children,r=e.className,n=e.error,o=dv.useRef(0),a=dv.useRef(""),i=hN.useSDKSettings().lang,s=dv.useRef(X$.SHORT),c=n||{},u=c.msg,l=c.duration,d=void 0===l?X$.SHORT:l,f=null==u?void 0:u[i];return Date.now()-o.current>=s.current?(o.current=Date.now(),s.current=d,a.current=f,Y$({children:t,errorMsg:f,className:r})):Y$({children:t,errorMsg:a.current,className:r})}$$.propTypes={children:Lv.node,className:Lv.string},$$.defaultProps={className:""};var Z$=aw.circle(Q$||(Q$=pg(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function J$(e){var t=e.className,r=e.style,n=e.radius,o=e.strokeWidth,a=e.progress,i=e.hasError,s=e.activeColor,c=e.innerPadding,u=e.outsideRingColor,l=e.outsideRingOpacity,d=e.insideRingColor,f=e.insideRingWidth,p=e.insideRingStrokeDash,h=e.errorRingWidth,m=e.errorRingColor,g=e.dashedRingColor,v=e.dashedRingOpacity,y=e.dashedRingWidth,b=e.dashedRingLineThick,w=e.dashedRingLineSpacing,k=e.dashedInsideRingColor,C=e.dashedInsideRingWidth,E=e.showOutsideRing,S=e.showInsideRing,B=e.showDashedRing,_=2*n,x=2*n,T=n-2*o,A=2*Math.PI*T,I=A-a/100*A,P=T-y/2-o/2-c,R=2*Math.PI*P,N=R-a/100*R,O=P-C/2-y/2,D=2*Math.PI*O,L=D-a/100*D,M=O-f/2-C/2,F=O-h/2-C/2;return dv.createElement("svg",{className:t,style:r,width:_,height:x,viewBox:"0 0 ".concat(_," ").concat(x),fill:"none",xmlns:"http://www.w3.org/2000/svg"},E?dv.createElement(dv.Fragment,null,dv.createElement("circle",{"data-testid":"outsideRing",opacity:l,cx:n,cy:n,r:T,stroke:u}),dv.createElement(Z$,{"data-testid":"outsideAnimateRing",cx:n,cy:n,r:T,stroke:s,strokeWidth:o,strokeLinecap:"round",strokeDasharray:"".concat(A," ").concat(A),style:{strokeDashoffset:I}})):null,B?dv.createElement(dv.Fragment,null,dv.createElement("circle",{"data-testid":"dashedRing",opacity:v,cx:n,cy:n,r:P,stroke:g,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)}),dv.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},dv.createElement("circle",{cx:n,cy:n,r:P,stroke:s,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)})),dv.createElement("g",{mask:"url(#mask0)"},dv.createElement(Z$,{"data-testid":"dashedAnimateRing",cx:n,cy:n,r:P,stroke:s,strokeWidth:y,strokeDasharray:"".concat(R," ").concat(R),style:{strokeDashoffset:N}})),dv.createElement("circle",{"data-testid":"dashedInsideRing",opacity:v,cx:n,cy:n,r:O,stroke:k,strokeWidth:C}),dv.createElement(Z$,{"data-testid":"dashedInsideAnimateRing",cx:n,cy:n,r:O,stroke:s,strokeWidth:C,strokeLinecap:"round",strokeDasharray:"".concat(D," ").concat(D),style:{strokeDashoffset:L}})):null,S?dv.createElement("circle",{"data-testid":"insideRing",strokeDasharray:p,cx:n,cy:n,r:M,stroke:d,strokeWidth:f}):null,i?dv.createElement("circle",{"data-testid":"errorRing",strokeDasharray:p,cx:n,cy:n,r:F,stroke:m,strokeWidth:h}):null)}function eZ(e){var t=e.className;return dv.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dv.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}function tZ(){return(tZ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}J$.propTypes={className:Lv.string,style:Lv.shape({}),radius:Lv.number,strokeWidth:Lv.number,progress:Lv.number,hasError:Lv.bool,activeColor:Lv.string,innerPadding:Lv.number,outsideRingColor:Lv.string,outsideRingOpacity:Lv.number,insideRingColor:Lv.string,insideRingWidth:Lv.number,insideRingStrokeDash:Lv.string,errorRingColor:Lv.string,errorRingWidth:Lv.number,dashedRingColor:Lv.string,dashedRingOpacity:Lv.number,dashedRingWidth:Lv.number,dashedRingLineThick:Lv.number,dashedRingLineSpacing:Lv.number,dashedInsideRingColor:Lv.string,dashedInsideRingWidth:Lv.number,showOutsideRing:Lv.bool,showDashedRing:Lv.bool,showInsideRing:Lv.bool},J$.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,hasError:!1,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:3,insideRingStrokeDash:"0",errorRingColor:"#df0000",errorRingWidth:3,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!0,showDashedRing:!0,showInsideRing:!0},eZ.propTypes={className:Lv.string},eZ.defaultProps={className:""};var rZ,nZ,oZ="undefined"!=typeof window?dv.useLayoutEffect:dv.useEffect,aZ={popupContent:{tooltip:{position:"absolute",zIndex:999},modal:{position:"relative",margin:"auto"}},popupArrow:{height:"8px",width:"16px",position:"absolute",background:"transparent",color:"#FFF",zIndex:-1},overlay:{tooltip:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",zIndex:999},modal:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",display:"flex",zIndex:999}}},iZ=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],sZ=function(e,t,r,n,o){var a=o.offsetX,i=o.offsetY,s=n?8:0,c=r.split(" "),u=e.top+e.height/2,l=e.left+e.width/2,d=t.height,f=t.width,p=u-d/2,h=l-f/2,m="",g="0%",v="0%";switch(c[0]){case"top":p-=d/2+e.height/2+s,m="rotate(180deg) translateX(50%)",g="100%",v="50%";break;case"bottom":p+=d/2+e.height/2+s,m="rotate(0deg) translateY(-100%) translateX(-50%)",v="50%";break;case"left":h-=f/2+e.width/2+s,m=" rotate(90deg) translateY(50%) translateX(-25%)",v="100%",g="50%";break;case"right":h+=f/2+e.width/2+s,m="rotate(-90deg) translateY(-150%) translateX(25%)",g="50%"}switch(c[1]){case"top":p=e.top,g=e.height/2+"px";break;case"bottom":p=e.top-d+e.height,g=d-e.height/2+"px";break;case"left":h=e.left,v=e.width/2+"px";break;case"right":h=e.left-f+e.width,v=f-e.width/2+"px"}return{top:p="top"===c[0]?p-i:p+i,left:h="left"===c[0]?h-a:h+a,transform:m,arrowLeft:v,arrowTop:g}},cZ=function(e,t,r,n,o,a){var i=o.offsetX,s=o.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=function(e){var t={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var r=document.querySelector(e);null!==r&&(t=r.getBoundingClientRect())}return t}(a),d=Array.isArray(r)?r:[r];for((a||Array.isArray(r))&&(d=[].concat(d,iZ));u<d.length;){var f={top:(c=sZ(e,t,d[u],n,{offsetX:i,offsetY:s})).top,left:c.left,width:t.width,height:t.height};if(!(f.top<=l.top||f.left<=l.left||f.top+f.height>=l.top+l.height||f.left+f.width>=l.left+l.width))break;u++}return c},uZ=0,lZ=dv.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,o=e.onOpen,a=void 0===o?function(){}:o,i=e.onClose,s=void 0===i?function(){}:i,c=e.defaultOpen,u=void 0!==c&&c,l=e.open,d=void 0===l?void 0:l,f=e.disabled,p=void 0!==f&&f,h=e.nested,m=void 0!==h&&h,g=e.closeOnDocumentClick,v=void 0===g||g,y=e.repositionOnResize,b=void 0===y||y,w=e.closeOnEscape,k=void 0===w||w,C=e.on,E=void 0===C?["click"]:C,S=e.contentStyle,B=void 0===S?{}:S,_=e.arrowStyle,x=void 0===_?{}:_,T=e.overlayStyle,A=void 0===T?{}:T,I=e.className,P=void 0===I?"":I,R=e.position,N=void 0===R?"bottom center":R,O=e.modal,D=void 0!==O&&O,L=e.lockScroll,M=void 0!==L&&L,F=e.arrow,U=void 0===F||F,j=e.offsetX,V=void 0===j?0:j,z=e.offsetY,q=void 0===z?0:z,H=e.mouseEnterDelay,K=void 0===H?100:H,W=e.mouseLeaveDelay,G=void 0===W?100:W,Q=e.keepTooltipInside,X=void 0!==Q&&Q,Y=e.children,$=dv.useState(d||u),Z=$[0],J=$[1],ee=dv.useRef(null),te=dv.useRef(null),re=dv.useRef(null),ne=dv.useRef(null),oe=dv.useRef("popup-"+ ++uZ),ae=!!D||!n,ie=dv.useRef(0);oZ((function(){return Z?(ne.current=document.activeElement,ye(),me(),pe()):he(),function(){clearTimeout(ie.current)}}),[Z]),dv.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return a(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ae&&(null===(t=ne.current)||void 0===t||t.focus()),setTimeout((function(){return s(e)}),0))},ue=function(e){null==e||e.stopPropagation(),Z?ce(e):se(e)},le=function(e){clearTimeout(ie.current),ie.current=setTimeout((function(){return se(e)}),K)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(ie.current),ie.current=setTimeout((function(){return ce(e)}),G)},pe=function(){ae&&M&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ae&&M&&(document.getElementsByTagName("body")[0].style.overflow="auto")},me=function(){var e,t=null==te||null===(e=te.current)||void 0===e?void 0:e.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),r=Array.prototype.slice.call(t)[0];null==r||r.focus()};dv.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var ge,ve,ye=function(){if(!ae&&Z&&(null==ee?void 0:ee.current)&&(null==ee?void 0:ee.current)&&(null==te?void 0:te.current)){var e,t,r=ee.current.getBoundingClientRect(),n=te.current.getBoundingClientRect(),o=cZ(r,n,N,U,{offsetX:V,offsetY:q},X);if(te.current.style.top=o.top+window.scrollY+"px",te.current.style.left=o.left+window.scrollX+"px",U&&re.current)re.current.style.transform=o.transform,re.current.style.setProperty("-ms-transform",o.transform),re.current.style.setProperty("-webkit-transform",o.transform),re.current.style.top=(null===(e=x.top)||void 0===e?void 0:e.toString())||o.arrowTop,re.current.style.left=(null===(t=x.left)||void 0===t?void 0:t.toString())||o.arrowLeft}};ge=ce,void 0===(ve=k)&&(ve=!0),dv.useEffect((function(){if(ve){var e=function(e){"Escape"===e.key&&ge(e)};return document.addEventListener("keyup",e),function(){ve&&document.removeEventListener("keyup",e)}}}),[ge,ve]),function(e,t){void 0===t&&(t=!0),dv.useEffect((function(){if(t){var r=function(t){if(9===t.keyCode){var r,n=null==e||null===(r=e.current)||void 0===r?void 0:r.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),o=Array.prototype.slice.call(n);if(1===o.length)return void t.preventDefault();var a=o[0],i=o[o.length-1];t.shiftKey&&document.activeElement===a?(t.preventDefault(),i.focus()):document.activeElement===i&&(t.preventDefault(),a.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])}(te,Z&&ae),function(e,t){void 0===t&&(t=!0),dv.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])}(ye,b),function(e,t,r){void 0===r&&(r=!0),dv.useEffect((function(){if(r){var n=function(r){var n=Array.isArray(e)?e:[e],o=!1;n.forEach((function(e){e.current&&!e.current.contains(r.target)||(o=!0)})),r.stopPropagation(),o||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){r&&(document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n))}}}),[e,t,r])}(n?[te,ee]:[te],ce,v&&!m);var be,we=function(){return dv.createElement("div",Object.assign({},(e=ae?aZ.popupContent.modal:aZ.popupContent.tooltip,t={className:"popup-content "+(""!==P?P.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:tZ({},e,B,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!D&&E.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ae?"dialog":"tooltip",id:oe.current}),U&&!ae&&dv.createElement("div",{ref:re,style:aZ.popupArrow},dv.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==P?P.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:tZ({position:"absolute"},x)},dv.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},ke=!(E.indexOf("hover")>=0),Ce=ae?aZ.overlay.modal:aZ.overlay.tooltip,Ee=[ke&&dv.createElement("div",{key:"O","data-testid":"overlay","data-popup":ae?"modal":"tooltip",className:"popup-overlay "+(""!==P?P.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:tZ({},Ce,A,{pointerEvents:v&&m||ae?"auto":"none"}),onClick:v&&m?ce:void 0,tabIndex:-1},ae&&we()),!ae&&we()];return dv.createElement(dv.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":oe.current},t=Array.isArray(E)?E:[E],r=0,o=t.length;r<o;r++)switch(t[r]){case"click":e.onClick=ue;break;case"right-click":e.onContextMenu=de;break;case"hover":e.onMouseEnter=le,e.onMouseLeave=fe;break;case"focus":e.onFocus=le,e.onBlur=fe}if("function"==typeof n){var a=n(Z);return!!n&&dv.cloneElement(a,e)}return!!n&&dv.cloneElement(n,e)}(),Z&&rI.createPortal(Ee,(null===(be=document.getElementById("popup-root"))&&((be=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(be)),be)))})),dZ=sw(rZ||(rZ=pg(["\n .popup-content {\n margin: auto;\n background: #fff;\n width: 100%;\n padding: 5px;\n border: 1px solid #d7d7d7;\n max-width: 568px;\n border-radius: 10px;\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n border-radius: 5px\n }\n\n .popup-overlay {\n background: rgba(0, 0, 0, .5);\n padding: 10px;\n }\n\n [data-popup=tooltip].popup-overlay {\n background: transparent\n }\n\n .popup-arrow {\n -webkit-filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n color: #fff;\n stroke-width: 2px;\n stroke: #d7d7d7;\n stroke-dasharray: 30px;\n stroke-dashoffset: -54px;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0\n }\n"]))),fZ=["open","children","overlayStyle"],pZ=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=lg(e,fZ);return dv.createElement(dv.Fragment,null,t&&dv.createElement(dv.Fragment,null,dv.createElement(lZ,rg({overlayStyle:og(og({},n),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),dv.createElement(dZ,null)))};pZ.propTypes={open:Lv.bool,children:Lv.node,overlayStyle:Lv.shape({})},pZ.defaultProps={open:!1,children:null,overlayStyle:{}};var hZ={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},mZ=aw.div(nZ||(nZ=pg(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),gZ=function(e){var t=e.contentStyle,r=hN.useSDKSettings(),n=r.lang,o=r.warmupMessage,a=o?o[n]:hZ.WARMUP_INTRO[n];return dv.createElement(pZ,{open:!0,contentStyle:t},dv.createElement(mZ,{className:"warmup-message"},a))};gZ.propTypes={contentStyle:Lv.shape({})},gZ.defaultProps={contentStyle:{}};var vZ=Hb([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],cw(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),500,cw(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),500),yZ=Object.freeze({__proto__:null,animationDuration:500,default:vZ}),bZ=Hb([".slide-horizontal{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}.slide-vertical{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],cw(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),cw(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20)),wZ=Object.freeze({__proto__:null,default:bZ}),kZ=Hb([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],cw(["from,to{opacity:1;}50%{opacity:0;}"])),CZ=Object.freeze({__proto__:null,default:kZ});function EZ(){return(EZ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function SZ(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function BZ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function _Z(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var xZ=!1,TZ=dv.createContext(null),AZ="entering",IZ="entered",PZ=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var o,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(o="exited",n.appearStatus=AZ):o=IZ:o=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",n.state={status:o},n.nextCallback=null,n}BZ(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==AZ&&r!==IZ&&(t=AZ):r!==AZ&&r!==IZ||(t="exiting")}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},r.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===AZ?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,o=this.props.nodeRef?[n]:[rI.findDOMNode(this),n],a=o[0],i=o[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!r||xZ?this.safeSetState({status:IZ},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,i),this.safeSetState({status:AZ},(function(){t.props.onEntering(a,i),t.onTransitionEnd(c,(function(){t.safeSetState({status:IZ},(function(){t.props.onEntered(a,i)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:rI.findDOMNode(this);t&&!xZ?(this.props.onExit(n),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:rI.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=o[0],i=o[1];this.props.addEndListener(a,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,r=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,SZ(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return dv.createElement(TZ.Provider,{value:null},"function"==typeof r?r(e,n):dv.cloneElement(dv.Children.only(r),n))},t}(dv.Component);function RZ(){}PZ.contextType=TZ,PZ.propTypes={},PZ.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:RZ,onEntering:RZ,onEntered:RZ,onExit:RZ,onExiting:RZ,onExited:RZ},PZ.UNMOUNTED="unmounted",PZ.EXITED="exited",PZ.ENTERING=AZ,PZ.ENTERED=IZ,PZ.EXITING="exiting";var NZ,OZ,DZ=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(r,n)||("string"==typeof r.className?r.className=r.className+" "+n:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+n)));var r,n}))},LZ=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.remove(n):"string"==typeof r.className?r.className=_Z(r.className,n):r.setAttribute("class",_Z(r.className&&r.className.baseVal||"",n)));var r,n}))},MZ=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1];t.removeClasses(o,"exit"),t.addClass(o,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1]?"appear":"enter";t.addClass(o,a,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1]?"appear":"enter";t.removeClasses(o,a),t.addClass(o,a,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,o=n?""+(n&&r?r+"-":"")+e:r[e];return{baseClassName:o,activeClassName:n?o+"-active":r[e+"Active"],doneClassName:n?o+"-done":r[e+"Done"]}},t}BZ(t,e);var r=t.prototype;return r.addClass=function(e,t,r){var n=this.getClassNames(t)[r+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&o&&(n+=" "+o),"active"===r&&e&&e.scrollTop,n&&(this.appliedClasses[t][r]=n,DZ(e,n))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,o=r.active,a=r.done;this.appliedClasses[t]={},n&&LZ(e,n),o&&LZ(e,o),a&&LZ(e,a)},r.render=function(){var e=this.props,t=(e.classNames,SZ(e,["classNames"]));return dv.createElement(PZ,EZ({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(dv.Component);MZ.defaultProps={classNames:""},MZ.propTypes={};var FZ,UZ,jZ="out-in",VZ="in-out",zZ=function(e,t,r){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),r()}},qZ=((NZ={})[jZ]=function(e){var t=e.current,r=e.changeState;return dv.cloneElement(t,{in:!1,onExited:zZ(t,"onExited",(function(){r(AZ,null)}))})},NZ[VZ]=function(e){var t=e.current,r=e.changeState,n=e.children;return[t,dv.cloneElement(n,{in:!0,onEntered:zZ(n,"onEntered",(function(){r(AZ)}))})]},NZ),HZ=((OZ={})[jZ]=function(e){var t=e.children,r=e.changeState;return dv.cloneElement(t,{in:!0,onEntered:zZ(t,"onEntered",(function(){r(IZ,dv.cloneElement(t,{in:!0}))}))})},OZ[VZ]=function(e){var t=e.current,r=e.children,n=e.changeState;return[dv.cloneElement(t,{in:!1,onExited:zZ(t,"onExited",(function(){n(IZ,dv.cloneElement(r,{in:!0}))}))}),dv.cloneElement(r,{in:!0})]},OZ),KZ=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).state={status:IZ,current:null},t.appeared=!1,t.changeState=function(e,r){void 0===r&&(r=t.state.current),t.setState({status:e,current:r})},t}BZ(t,e);var r=t.prototype;return r.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===AZ&&e.mode===VZ?{status:AZ}:!t.current||(r=t.current,n=e.children,r===n||dv.isValidElement(r)&&dv.isValidElement(n)&&null!=r.key&&r.key===n.key)?{current:dv.cloneElement(e.children,{in:!0})}:{status:"exiting"};var r,n},r.render=function(){var e,t=this.props,r=t.children,n=t.mode,o=this.state,a=o.status,i=o.current,s={children:r,current:i,changeState:this.changeState,status:a};switch(a){case AZ:e=HZ[n](s);break;case"exiting":e=qZ[n](s);break;case IZ:e=i}return dv.createElement(TZ.Provider,{value:{isMounting:!this.appeared}},e)},t}(dv.Component);KZ.propTypes={},KZ.defaultProps={mode:jZ};var WZ=aw.div(FZ||(FZ=pg(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ","; // must be higher than BASE_Z_INDEX and lower than other layers\n"])),1001),GZ=Hb([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],cw(["from{background:#000;}to{}"]),300),QZ=aw.div(UZ||(UZ=pg(["\n ","\n"])),GZ),XZ=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return dv.createElement(QZ,null,dv.createElement(KZ,null,dv.createElement(MZ,{key:r,timeout:{enter:300,exit:0},classNames:"splash",unmountOnExit:!1},dv.createElement(WZ,null))))},YZ=Object.freeze({__proto__:null,default:XZ}),$Z=Hb([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],cw(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"])),ZZ=Object.freeze({__proto__:null,default:$Z}),JZ="default",eJ="error";function tJ(e){var t=e.className,r=e.width,n=e.height,o=e.type,a=e.strokeStyles,i=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=dv.useMemo((function(){var e;return og((tg(e={},JZ,{fill:"none",strokeWidth:i,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),tg(e,eJ,{fill:"rgba(234,50,35, 0.1)",strokeWidth:i,stroke:"#ea3223"}),e),a)}),[i,a]),l=s+.8*i,d=u[o];return dv.createElement("svg",{width:r,height:n,className:t},dv.createElement("rect",{x:i/2,y:i/2,rx:s,ry:s,width:r-i,height:n-i,style:d}),dv.createElement("path",{d:"M0,".concat(l," Q0,0 ").concat(l,",0 L0,0 Z"),style:c}),dv.createElement("path",{d:"M0,".concat(n-l," Q0,").concat(n," ").concat(l,",").concat(n," L0,").concat(n," Z"),style:c}),dv.createElement("path",{d:"M".concat(r-l,",").concat(n," Q").concat(r,",").concat(n," ").concat(r,",").concat(n-l," L").concat(r,",").concat(n," Z"),style:c}),dv.createElement("path",{d:"M".concat(r-l,",0 Q").concat(r,",0 ").concat(r,",").concat(l," L").concat(r,",0 Z"),style:c}))}tJ.propTypes={className:Lv.string,width:Lv.number,height:Lv.number,strokeWidth:Lv.number,strokeStyles:Lv.shape({}),type:Lv.oneOf([JZ,eJ]),radius:Lv.number,paddingStyle:Lv.shape({})},tJ.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:JZ,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var rJ,nJ,oJ,aJ,iJ,sJ,cJ,uJ,lJ,dJ,fJ,pJ,hJ,mJ,gJ,vJ,yJ,bJ,wJ,kJ,CJ,EJ,SJ,BJ,_J,xJ,TJ,AJ,IJ,PJ,RJ,NJ,OJ=["width","height","type"],DJ=aw(tJ)(rJ||(rJ=pg([""]))),LJ=aw.img(nJ||(nJ=pg(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),MJ=XZ,FJ=aw.div(oJ||(oJ=pg(["\n ","\n ","\n"])),vZ,$Z),UJ=aw.img(aJ||(aJ=pg(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),jJ=aw.div(iJ||(iJ=pg(["\n cursor: pointer;\n text-align: center;\n width: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),60,1020,WW.isMobile?Hb(["top:",";"],(function(e){return e.y})):Hb(["bottom:","px;"],10)),VJ=aw.div(sJ||(sJ=pg(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ","px;\n height: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),100,100,1020),zJ=aw.div(cJ||(cJ=pg(["\n color: #fff;\n text-align: center;\n"]))),qJ=aw.div(uJ||(uJ=pg(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),HJ=aw.div(lJ||(lJ=pg(["\n display: flex;\n align-items: center;\n"]))),KJ=aw(zJ)(dJ||(dJ=pg(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),WJ=aw(zJ)(fJ||(fJ=pg(["\n font-size: 20px;\n margin-left: 10px;\n color: green;\n position: absolute;\n left: 0;\n top: 10px;\n background: white;\n z-index: ",";\n"])),1030),GJ=aw(zJ)(pJ||(pJ=pg(["\n position: absolute;\n font-size: 16px;\n text-align: center;\n color: #fff;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),QJ=aw(GJ)(hJ||(hJ=pg(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),XJ=aw(zJ)(mJ||(mJ=pg(["\n position: absolute;\n font-size: 18px;\n text-align: center;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),YJ=(aw.div(gJ||(gJ=pg(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),function(e){var t=e.width,r=e.height,n=e.type,o=lg(e,OJ),a=QN.useAsset("id_card_frame.png"),i=QN.useAsset("id_card_frame_error.png");return dv.createElement(FJ,{width:t,height:r},dv.createElement(LJ,{src:n===eJ?i:a,width:t,height:r}),dv.createElement(DJ,rg({width:t,height:r,type:n},o)))}),$J=Object.freeze({__proto__:null,CloseCameraButton:function(e){var t=e.className,r=e.onClick,n=QN.useAsset("ic_close.png");return dv.createElement(CG,{className:t,onClick:r},dv.createElement("img",{src:n,alt:""}))}}),ZJ=CZ,JJ=wZ,e3=ZZ,t3=Hb(["z-index:",";color:#ffffff;"],1020),r3=aw.div(vJ||(vJ=pg(["\n ","\n"])),t3),n3=aw($$)(yJ||(yJ=pg(["\n ","\n ","\n ","\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n white-space: pre-wrap;\n text-align: center;\n max-width: 80%;\n"])),t3,(function(e){var t=e.top;return t&&Hb(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&Hb(["bottom:","px;"],t)}),(function(e){return e.centerY&&Hb(["top:50%;transform:translateY(-50%);"])})),o3=aw(r3)(bJ||(bJ=pg(["\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var t=e.top;return t&&Hb(["top:","px;"],t)})),a3=aw(r3)(wJ||(wJ=pg(["\n position: absolute;\n ","\n ","\n font-size: ",";\n text-shadow: 2px 2px 4px #000000;\n"])),(function(e){var t=e.top;return t&&Hb(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&Hb(["bottom:","px;"],t)}),(function(){return WW.isMobile?"20px":"22px"})),i3=aw.div(kJ||(kJ=pg(["\n height: ",";\n position: absolute;\n ","\n ","\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),(function(){return WW.isMobile?"50px":"70px"}),(function(e){var t=e.top;return t&&Hb(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&Hb(["bottom:","px;"],t)}),1020),s3=aw.div(CJ||(CJ=pg(["\n width: ",";\n height: ",";\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid #ffffff;\n font-size: 16px;\n color: #fff;\n font-weight: 700;\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: 50%;\n }\n"])),(function(){return WW.isMobile?"40px":"50px"}),(function(){return WW.isMobile?"40px":"50px"}),(function(e){return!e.active&&Hb(["opacity:0.6;"])})),c3=aw.div(EJ||(EJ=pg(["\n color: #ffffff;\n height: 70px;\n position: absolute;\n bottom: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),1020),u3=aw.div(SJ||(SJ=pg(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),l3=aw.div(BJ||(BJ=pg(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #ffffff;\n font-size: 140px;\n opacity: 0.6;\n"]))),d3=aw.div(_J||(_J=pg(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n ",";\n ",";\n"])),JJ.default,ZJ.default),f3=aw(J$)(xJ||(xJ=pg(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),p3=aw(eZ)(TJ||(TJ=pg(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.color;return null!=t?t:"rgba(0, 0, 0, 0.6)"})),h3=aw.div(AJ||(AJ=pg(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),m3=cw(["from{opacity:1;}to{opacity:0;}"]),g3=aw.div(IJ||(IJ=pg(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n border-radius: 50%;\n"])),m3),v3=aw.div(PJ||(PJ=pg(["\n ","\n"])),e3.default),y3=WW.isMobile?{width:{ideal:640}}:null,b3={background:"#000000",opacity:.6};function w3(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,a=e.onError,i=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=e.onProcessing,f=e.customErrors,p=e.livenessSettings,h=e.apiCredentials,m=e.outputEncryptionSettings,g=e.cameraScale,v=e.defaultCameraId,y=e.passiveModeAuto,b=e.offsetFaceY,w=e.styledComponent,k=e.sdkAdapter,C=e.isLoading,E=e.frontalMinSize,S=QN.useAsset("bg_camera_mask.png"),B=QN.useAsset("bg_camera_mask_red.png"),_=QN.useAsset("ic_loading.png"),x=hg(dv.useState({}),2),T=x[0],A=x[1],I=T.yFaceDetectionError,P=T.yFaceVerificationStepsWrapper,R=hg(dv.useState(""),2),N=R[0],O=R[1],D=dv.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,o=t+25,i=o+30;A({yFaceDetectionError:o,yFaceVerificationStepsWrapper:i+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(i);return 0!==b&&(u+b<s||u+b+r>c)?a({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=b,{y:u}}),[b,a]),L=F$({apiCheck:t,mode:r,bgCameraMask:S,bgCameraMaskRed:B,surroundStyle:b3,onLivenessDetectionDone:n,onError:a,cropAreaDimension:D,customDirectionIcon:u,captureFrameSettings:i,onFramesCaptured:s,livenessSettings:p,setRemainingTime:O,customStepTimeConstraints:l,onProcessing:d,customErrors:f,apiCredentials:h,outputEncryptionSettings:m,cameraScale:g,passiveModeAuto:y,sdkAdapter:k,frontalMinSize:E}),M=L.countdownToTakePicture,F=L.cropArea,U=L.curStepIndex,j=L.directionIcon,V=L.directionIconAnimation,z=L.faceDetectionError,q=L.handleTriggerPassiveMode,H=L.handleVideoPlayed,K=L.instructions,W=L.isActiveMode,G=L.refVideo,Q=L.showCountdown,X=L.steps,Y=L.videoPlayed,$=L.activeCapturing,Z=L.isFirstValidFrameFound,J=L.warmupDone,ee=L.showLoading;dv.useEffect((function(){var e;"string"==typeof(null===(e=X[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(X.map((function(e){return t=e.directionIcon,new Promise((function(e){var r=new Image;r.onload=e,r.onerror=e,r.src=t}));var t})))}),[X]);var te=w.CloseCameraButton;return dv.createElement(v3,null,dv.createElement(RG,{frontCamera:c,onVideoPlayed:H,onClose:o,flipHorizontal:c,ref:G,videoSettings:y3,onError:a,scale:g,defaultCameraId:v,closeButton:te||null},!J&&dv.createElement(gZ,null),Y?dv.createElement(dv.Fragment,null,dv.createElement(n3,{top:I-15,className:"face-detection-error",error:z}),F.current?dv.createElement(FG,{x:"".concat(F.current.x,"px"),y:"".concat(F.current.y,"px"),width:"".concat(F.current.width,"px"),height:"".concat(F.current.height,"px"),surroundStyle:F.current.surroundStyle},dv.createElement(p3,null),dv.createElement(f3,{progress:U/X.length*100,hasError:!!z,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:1,insideRingStrokeDash:"2"}),Q?dv.createElement(l3,null,M):null,W?dv.createElement(dv.Fragment,null,dv.createElement(d3,null,function(e,t){return e?"string"==typeof e?dv.createElement("img",{className:t,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}(j,V)),$&&dv.createElement(g3,null)):null,z&&dv.createElement(h3,null)):null,W?dv.createElement(dv.Fragment,null,N&&dv.createElement(o3,{top:P-30},N),K?dv.createElement(dv.Fragment,null,dv.createElement(a3,{top:P+5,className:"instructions"},K),dv.createElement(i3,{top:P+35},X.map((function(e,t){var r=e.name,n=e.image.objUrl;return dv.createElement(s3,{key:r,active:U>=t,className:"step-item"},n?dv.createElement("img",{src:n,alt:""}):dv.createElement("span",null,t+1))})))):null):dv.createElement(dv.Fragment,null,!Z||z||y?null:dv.createElement(c3,null,dv.createElement(u3,{onClick:q},dv.createElement(UG,null))))):null,(ee||C)&&dv.createElement(VJ,null,dv.createElement("img",{src:_,alt:"",className:"spin"}))))}w3.propTypes={apiCheck:Lv.bool,frontalMinSize:Lv.number,mode:Lv.string,onLivenessDetectionDone:Lv.func,onClose:Lv.func,onError:Lv.func,captureFrameSettings:Lv.shape({}),onFramesCaptured:Lv.func,frontCamera:Lv.bool,customDirectionIcon:Lv.shape({}),customStepTimeConstraints:Lv.shape({}),onProcessing:Lv.func,customErrors:Lv.shape({}),livenessSettings:Lv.shape({}),apiCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string}),outputEncryptionSettings:Lv.shape({}),cameraScale:Lv.number,defaultCameraId:Lv.string,passiveModeAuto:Lv.bool,offsetFaceY:Lv.number,styledComponent:Lv.shape({CloseCameraButton:Lv.node}),sdkAdapter:Lv.shape({}),isLoading:Lv.bool},w3.defaultProps={apiCheck:!1,frontalMinSize:null,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(RJ={},tg(RJ,aI.FaceDirection.LEFT,dv.createElement(G$,{type:aI.FaceDirection.LEFT})),tg(RJ,aI.FaceDirection.RIGHT,dv.createElement(G$,{type:aI.FaceDirection.RIGHT})),tg(RJ,aI.FaceDirection.UP,dv.createElement(G$,{type:aI.FaceDirection.UP})),tg(RJ,aI.FaceDirection.FRONTAL,dv.createElement(G$,{type:aI.FaceDirection.FRONTAL})),RJ),customStepTimeConstraints:(NJ={},tg(NJ,aI.FaceDirection.UP,{delayTime:0}),tg(NJ,aI.FaceDirection.LEFT,{delayTime:0}),tg(NJ,aI.FaceDirection.RIGHT,{delayTime:0}),tg(NJ,aI.FaceDirection.FRONTAL,{delayTime:2e3}),NJ),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null},sdkAdapter:null,isLoading:!1};var k3,C3=Object.freeze({__proto__:null,Text:r3,FaceDetectionError:n3,CountdownTime:o3,FaceVerificationInstructions:a3,FaceVerificationStepsWrapper:i3,StepItem:s3,BottomButtonsOverlay:c3,Button:u3,CountDownOverlay:l3,InstructionsOverlay:d3,LivenessStyledComponent:$J,default:w3,useLivenessDetection:F$}),E3=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.frontCamera,r=void 0===t||t,n=document.createElement("div");document.body.appendChild(n);var o=function(){rI.unmountComponentAtNode(n)};return new Promise((function(e){rI.render(dv.createElement(hN.SDKSettingsProvider,{value:{lang:"en"}},dv.createElement(RG,{checkCameraMode:!0,frontCamera:r,onVideoPlayed:function(){o(),e(null)},onClose:o,onError:function(t){o(),e(t)}})),n)}))},S3=aw.input(k3||(k3=pg(["\n display: none;\n"]))),B3=dv.forwardRef((function(e,t){var r=e.useFileBrowse,n=e.accept,o=e.frontCamera,a=e.onCaptureDone,i=e.outputEncryptionSettings,s=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.target.files,!a){e.next=8;break}if(n=r[0],!i||!i.key){e.next=7;break}return e.next=6,TL.encrypt({blob:n,key:i.key});case 6:o=e.sent;case 7:a({file:n,encrypted:o});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[a,i]);return dv.createElement(S3,rg({ref:t,type:"file",accept:n,onChange:s},r?{}:{capture:o?"user":"environment"}))}));B3.propTypes={useFileBrowse:Lv.bool,accept:Lv.string,frontCamera:Lv.bool,onCaptureDone:Lv.func,outputEncryptionSettings:Lv.shape({key:Lv.string})},B3.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var _3,x3="landscape",T3="portrait",A3="desktop",I3=aI.Errors,P3=aw.div(_3||(_3=pg(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function R3(e){var t=e.children,r=hN.useSDKSettings().lang,n=I3.wrong_orientation.msg[r],o=function(){var e=dv.useRef(window.matchMedia("(orientation: portrait)")),t=dv.useRef(e.current.matches?T3:x3),r=hg(dv.useState(t.current),2),n=r[0],o=r[1];return dv.useEffect((function(){function t(e){e.matches?o(T3):o(x3)}return e.current.addEventListener("change",t),function(){e.current.removeEventListener("change",t)}}),[]),WW.isMobile?{curOrientation:n,initOrientation:t.current}:{curOrientation:A3}}().curOrientation;return dv.createElement(dv.Fragment,null,o===x3&&dv.createElement(pZ,{open:!0},dv.createElement(P3,null,n)),(o===T3||o===A3)&&dv.createElement(dv.Fragment,null,t))}var N3={LOADING:0,FAR_FACE:1,CLOSE_FACE:2,START_FLASHING:3,STOP_DECTECTING:4},O3="far_face",D3="close_face",L3="flashing",M3=WW.isMobile?200:400;function F3(){return(F3=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]?u[0]:{},r=t.tfScriptUrls,n=t.closeEyesModelUrl,o=new GM(n),e.next=4,SL.loadTensorFlow(r);case 4:return e.next=6,SL.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return a=[SL.loadFaceDetectionModel({detectorConfig:{runtime:"mediapipe",solutionPath:r.mediaPipeUrl}}),o.load()],e.next=9,Promise.all(a);case 9:return i=e.sent,s=hg(i,1),c=s[0].faceDetector,e.abrupt("return",{faceDetector:c,closeEyesModel:o});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var U3=e$((function(){return F3.apply(this,arguments)})),j3=function(e){var t=e.width,r=e.height,n=e.cameraScale,o=e.debug,a=hg(dv.useState(null),2),i=a[0],s=a[1];return dv.useEffect((function(){var e=document.createElement("canvas");e.width=t,e.height=r;var a=e.getContext("2d");return a.translate(t,0),a.scale(-1*n,1*n),o&&(document.body.appendChild(e),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.zIndex="9999"),s(e),function(){o&&document.body.removeChild(e)}}),[n,o,r,t]),i},V3=function(e){switch(e){case"partial_face":return"please_move_face_into_center_frame";case"no_face":case"face_out_of_box":return"face_not_found";case"face_too_small":return"please_move_face_closer";case"face_too_large":return"please_move_face_farther";case"eye_close":return"please_open_your_eyes";case"face_not_frontal":return"please_look_straight_at_the_camera";case"multiple_faces":return"please_only_one_face";case"face_too_high":return"please_move_face_down";default:return""}},z3=function(e,t){var r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.beginPath(),r.lineWidth="1",r.strokeStyle="red",r.rect(0,0,e.width,e.height),r.stroke(),r.closePath(),Object.entries(t).forEach((function(e,t){var n=hg(e,2),o=n[0],a=n[1];r.beginPath(),r.fillStyle="red",r.font="16px",r.fillText("".concat(o,": ").concat(a),10,20+20*t),r.closePath()}))},q3=dv.createContext(!1),H3=function(e){var t=e.children,r=e.debug;return dv.createElement(q3.Provider,{value:r},t)};H3.defaultProps={debug:!1,children:null},H3.propTypes={debug:Lv.bool,children:Lv.node};var K3=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.getContext("2d"),o=e.width;n.strokeStyle="blue",n.fillStyle="blue",n.lineWidth=1,t.forEach((function(e){e.landmarks.forEach((function(e){n.beginPath(),n.arc(r?o-e[0]:e[0],e[1],2,0,2*Math.PI),n.fill(),n.closePath()})),n.beginPath();var t={x:r?o-e.bottomRight[0]:e.bottomRight[0],y:e.topLeft[1],width:e.bottomRight[0]-e.topLeft[0],height:e.bottomRight[1]-e.topLeft[1]};n.rect(t.x,t.y,t.width,t.height),n.stroke(),n.closePath()}))},W3=function(e,t){return{topLeft:[e.topLeft[0]*t,e.topLeft[1]*t],bottomRight:[e.bottomRight[0]*t,e.bottomRight[1]*t],probability:e.probability,landmarks:e.landmarks.map((function(e){return[e[0]*t,e[1]*t]}))}};function G3(e){var t=e.cameraScale,r=void 0===t?1:t,n=e.isVideoPlaying,o=e.step,a=e.cropArea,i=e.videoRef,s=e.onCloseFaceDetected,c=e.onMovingCloseFace,u=e.onFarFaceDetected,l=e.onFarFullFaceDetected,d=e.onFlashingFramesCaptured,f=e.frameInterval,p=void 0===f?180:f,h=e.useFaceDetectorWhenFlashing,m=e.onFaceError,g=e.onError,v=e.faceSettings,y=e.ovalBoundingRect,b=e.isOvalTransitioning,w=e.closeEyesSettings,k=e.maskSettings,C=e.imageSettings,E=k.ovalPadding,S=k.chinToMaskBottomPadding,B=C.imageScale,_=w.enable,x=w.timeout,T=dv.useContext(q3),A=function(e){var t=e.cropArea,r=e.scale,n=void 0===r?1:r,o=e.video;return dv.useMemo((function(){var e=t.width,r=t.height,a=null!=o?o:{},i=a.videoWidth,s=void 0===i?Number.MAX_SAFE_INTEGER:i,c=a.videoHeight,u=void 0===c?Number.MAX_SAFE_INTEGER:c,l=Math.min(e,r)/200,d=e/l*n,f=r/l*n;return d>s||f>u?{width:WW.isMobile?s:u,height:u}:{width:d,height:f}}),[t,n,o])}({cropArea:a,scale:B,video:i.current}),I=function(e){var t=e.cropArea,r=e.ovalBoundingRect,n=e.ovalPadding,o=e.baseCanvasSize;return dv.useMemo((function(){var e,a,i,s,c=t.width,u=t.height,l=t.x,d=t.y,f=Math.min(c,u)/o,p=c/f,h=u/f,m=null!==(e=null==r?void 0:r.left)&&void 0!==e?e:0,g=null!==(a=null==r?void 0:r.top)&&void 0!==a?a:0,v=null!==(i=null==r?void 0:r.right)&&void 0!==i?i:c,y=null!==(s=null==r?void 0:r.bottom)&&void 0!==s?s:u;return{left:Math.max((m-l-n.left)/f,0),right:Math.min((v-l+n.right)/f,p-0),top:Math.max((g-d-n.top)/f,0),bottom:Math.min((y-d+n.bottom)/f,h-0)}}),[t,null==r?void 0:r.bottom,null==r?void 0:r.left,null==r?void 0:r.right,null==r?void 0:r.top,n.bottom,n.left,n.right,n.top,o])}({cropArea:a,ovalBoundingRect:y,ovalPadding:E,baseCanvasSize:Math.min(A.width,A.height)}),P=v.minFarFaceRatio,R=v.maxFarFaceRatio,N=v.closeFaceRatio,O=j3({width:A.width,height:A.height,cameraScale:r,debug:!1}),D=A.height/A.width,L=j3({width:M3,height:M3*D,cameraScale:r,debug:T}),M=function(e){var t=e.width,r=e.height,n=e.debug,o=dv.useRef(null),a=dv.useMemo((function(){var e=document.createElement("canvas");return e.width=t,e.height=r,e.style.position="fixed",e.style.bottom="0",e.style.left="0",e.style.zIndex="99999",o.current=e,n&&document.body.appendChild(e),e}),[r,t,n]);return dv.useEffect((function(){return function(){n&&document.body.removeChild(o.current)}}),[n]),a}({width:160,height:150,debug:T}),F=function(e){var t=e.videoRef,r=e.cropArea;return dv.useMemo((function(){return t.current?0===Object.keys(r).length?{}:CO.analyzeVideoAndWindowSizes(t.current,r):{}}),[t,r])}({videoRef:i,cropArea:a}),U=function(e,t){var r=hg(dv.useState({}),2),n=r[0],o=r[1],a=Object.keys(n).length>0;return dv.useEffect((function(){var r=!1;return function(){var n=$m(regeneratorRuntime.mark((function n(){var a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,U3(e);case 3:if(a=n.sent,!r){n.next=6;break}return n.abrupt("return");case 6:o(a),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(0),t({error:n.t0}),console.error(n.t0);case 13:case"end":return n.stop()}}),n,null,[[0,9]])})));return function(){return n.apply(this,arguments)}}()(),function(){r=!0}}),[a,e,t]),[n,a]}(hN.useSDKSettings().customUrls,g),j=hg(U,2),V=j[0],z=j[1],q=dv.useRef(null),H=function(e){var t=e.timeout,r=dv.useRef(null),n=dv.useCallback((function(){r.current=performance.now()}),[]),o=dv.useCallback((function(){return null===r.current?(n(),!1):performance.now()-r.current>t}),[n,t]);return{markTime:n,checkIfEllapsed:o}}({timeout:1e3*x}),K=H.markTime,W=H.checkIfEllapsed,G=z&&n,Q=hg(dv.useState(""),2),X=Q[0],Y=Q[1],$=V.closeEyesModel,Z=V.faceDetector,J=dv.useMemo((function(){return mQ(Y,1e3)}),[]),ee=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t,r){var n,a,f,p,v,y,w,k,C,E,B,x,A,O,D,F,U,j,V,z,q,H,G,Q,X,Y,ee,te,re,ne,oe,ae;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(null==r?void 0:r.width)&&0!==(null==r?void 0:r.height)){e.next=3;break}return e.abrupt("return");case 3:if(null!==i.current){e.next=5;break}return e.abrupt("return");case 5:if(!b){e.next=7;break}return e.abrupt("return");case 7:if(o!==N3.STOP_DECTECTING){e.next=9;break}return e.abrupt("return");case 9:if(n=t.cropX,a=t.cropY,f=t.cropWidth,p=t.cropHeight,v=r.width,y=r.height,r.getContext("2d").drawImage(i.current,n,a,f,p,0,0,v,y),w=M3/v,T&&L.getContext("2d").drawImage(i.current,n,a,f,p,0,0,v*w,y*w),h||o!==N3.START_FLASHING){e.next=21;break}if("function"!=typeof d){e.next=20;break}return e.next=20,d(null,r,null);case 20:return e.abrupt("return");case 21:return e.next=23,Z.estimateFaces(r);case 23:return k=e.sent,C=FO.faceDetectorToBlazefacePredictions(k),e.next=27,FO.validatePredictions({predictions:C,width:v,height:y});case 27:return E=e.sent,B=E.fullFace,x=E.ratio,A=[[I.left,I.top],[I.right,I.bottom]],e.next=33,FO.validatePredictions({predictions:C,cropAreaCoordinates:A});case 33:if(O=e.sent,D=O.error,F=O.fullFace,U=O.faceRatio,T&&(j={left:I.left*w,top:I.top*w,right:I.right*w,bottom:I.bottom*w},ie={x:j.left,y:j.top,width:j.right-j.left,height:j.bottom-j.top},se="red",ce=void 0,(ce=L.getContext("2d")).strokeStyle=se,ce.lineWidth=1,ce.beginPath(),ce.rect(ie.x,ie.y,ie.width,ie.height),ce.stroke(),ce.closePath(),V=C.map((function(e){return W3(e,w)})),K3(L,V,!0)),z=aI.FaceDirection.FRONTAL,!F){e.next=44;break}return e.next=42,FO.calculateFaceDirection({landmarks:F.landmarks,upDownBound:{lower:.35,upper:.7}});case 42:H=e.sent,z=null!==(q=null==H?void 0:H.gesture)&&void 0!==q?q:"";case 44:if(!B||o!==N3.FAR_FACE){e.next=48;break}if("function"!=typeof u){e.next=48;break}return e.next=48,u(C[0],r,B.landmarks);case 48:if(!B||o!==N3.CLOSE_FACE){e.next=52;break}if("function"!=typeof c){e.next=52;break}return e.next=52,c(C[0],r,B.landmarks);case 52:if(G=null==D?void 0:D.code,e.prev=53,G!==aI.Errors.no_face.code){e.next=56;break}throw new Error("no_face");case 56:if(!(G===aI.Errors.multiple_faces.code||C.length>1)){e.next=61;break}if(Q=FO.calculateFaceArea(C[0]),X=FO.calculateFaceArea(C[1]),!(Q<=2*X)){e.next=61;break}throw new Error("multiple_faces");case 61:if(z===aI.FaceDirection.FRONTAL){e.next=63;break}throw new Error("face_not_frontal");case 63:if(G!==aI.Errors.partial_face.code){e.next=68;break}if(Y=FO.cropFaceInsideBox([C[0].topLeft,C[0].bottomRight],A),!(IO.rectEdgeRatio(Y,A)>.95)){e.next=68;break}throw new Error("face_too_large");case 68:if(o!==N3.FAR_FACE){e.next=73;break}if(!(U>R)){e.next=71;break}throw new Error("face_too_large");case 71:if(!(U<P)){e.next=73;break}throw new Error("face_too_small");case 73:if(o!==N3.CLOSE_FACE){e.next=76;break}if(!(U<N)){e.next=76;break}throw new Error("face_too_small");case 76:if(!(Array.isArray(C)&&C.length>0&&I.bottom-C[0].bottomRight[1]>S)){e.next=78;break}throw new Error("face_too_high");case 78:if(G!==aI.Errors.face_out_of_box.code){e.next=85;break}if(o!==N3.FAR_FACE){e.next=82;break}if(!(U>=P&&U<=R)){e.next=82;break}throw new Error("");case 82:if(o!==N3.CLOSE_FACE){e.next=85;break}if(!(U>=N)){e.next=85;break}throw new Error("");case 85:e.next=90;break;case 87:e.prev=87,e.t0=e.catch(53),G=e.t0.message;case 90:if(!_){e.next=100;break}if(G){e.next=99;break}return e.next=94,$.predict(r,B.landmarks);case 94:ee=e.sent,te=W(),ee.isEyeClose&&!te&&(G="eye_close"),e.next=100;break;case 99:K();case 100:if(T&&z3(M,{ratio:null!==(re=null==x?void 0:x.toFixed(3))&&void 0!==re?re:"undefined",error:G,ovalFaceRatio:null!==(ne=null==U?void 0:U.toFixed(3))&&void 0!==ne?ne:"undefined",ovalError:null!==(oe=null==D?void 0:D.code)&&void 0!==oe?oe:"undefined",step:o===N3.FAR_FACE?"far":"close"}),ae=V3(G),J(ae),!ae){e.next=108;break}if("function"!=typeof m){e.next=107;break}return e.next=107,m({error:G,currentStep:o});case 107:return e.abrupt("return");case 108:if(!(B&&o===N3.FAR_FACE&&P<=U&&U<=R)){e.next=113;break}if("function"!=typeof u){e.next=113;break}return e.next=112,l(C[0],r,B.landmarks);case 112:return e.abrupt("return");case 113:if(!(B&&o===N3.CLOSE_FACE&&U>=N)){e.next=118;break}if("function"!=typeof s){e.next=118;break}return e.next=117,s(C[0],r,B.landmarks);case 117:return e.abrupt("return");case 118:if(!(B&&o===N3.START_FLASHING&&U>=N)){e.next=123;break}if("function"!=typeof d){e.next=123;break}return e.next=122,d(C[0],r,B.landmarks);case 122:return e.abrupt("return");case 123:e.next=129;break;case 125:e.prev=125,e.t1=e.catch(0),console.error(e.t1),g({error:e.t1});case 129:case"end":return e.stop()}var ie,se,ce}),e,null,[[0,125],[53,87]])})));return function(t,r){return e.apply(this,arguments)}}(),[L,M,T,i,b,o,Z,I.left,I.top,I.right,I.bottom,J,P,R,N,d,u,m,l,c,s,g,S,h,_,$,W,K]);return dv.useEffect((function(){var e=null,t=!1;return G&&function r(){e=requestAnimationFrame(function(){var e=$m(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=2;break}return e.abrupt("return");case 2:if(null!==i.current){e.next=4;break}return e.abrupt("return");case 4:if(null===q.current&&(q.current=n),!(n-q.current<p)){e.next=9;break}return r(),e.abrupt("return");case 9:return q.current=n,e.next=12,ee(F,O);case 12:r();case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}(),function(){t=!0,cancelAnimationFrame(e)}}),[O,F,ee,G,i,p]),{warmupDone:z,faceError:X}}var Q3,X3,Y3="rgba(0,0,0,0.6)",$3=function(e){var t=e.onVideoPlayed,r=hg(dv.useState(!1),2),n=r[0],o=r[1],a=hg(dv.useState({}),2),i=a[0],s=a[1];return{onVideoPlayed:dv.useCallback((function(e){var r,n,a,i,c,u,l,d=(i=(r=e).videoAreaWidth,c=r.videoAreaHeight,u=r.lostX,l=r.lostY,WW.isMobile?(n=i,a=c):(n=window.innerHeight,a=window.innerHeight),{width:n,height:a,x:Math.max(Math.round((i-n)/2+u),0),y:Math.max(Math.round((c-a)/2+l),0)});s(d),o(!0),"function"==typeof t&&t(e)}),[t]),cropArea:i,isPlaying:n}},Z3=function(e,t,r,n){var o=t.toDataURL("image/jpeg",.8);return e?{label:"portrait",base64:o.split(",")[1],landmarks:r,index:n}:{label:"portrait",base64:o.split(",")[1],index:n}},J3=function(){var e=$m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",30);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e0=function(e){var t=e.className;return dv.createElement("svg",{className:t,width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dv.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",fill:"#0276F1"}),dv.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 36.1124C30.6895 36.1124 36.1124 30.6895 36.1124 24C36.1124 17.3105 30.6895 11.8876 24 11.8876C17.3105 11.8876 11.8876 17.3105 11.8876 24C11.8876 30.6895 17.3105 36.1124 24 36.1124ZM24 38C31.732 38 38 31.732 38 24C38 16.268 31.732 10 24 10C16.268 10 10 16.268 10 24C10 31.732 16.268 38 24 38Z",fill:"white"}),dv.createElement("path",{d:"M18.1465 20.169C18.1465 19.6236 18.5886 19.1815 19.134 19.1815C19.6793 19.1815 20.1214 19.6236 20.1214 20.169V22.1439C20.1214 22.6893 19.6793 23.1314 19.134 23.1314C18.5886 23.1314 18.1465 22.6893 18.1465 22.1439V20.169Z",fill:"white"}),dv.createElement("path",{d:"M28.0213 20.169C28.0213 19.6236 28.4634 19.1815 29.0087 19.1815C29.5541 19.1815 29.9962 19.6236 29.9962 20.169V22.1439C29.9962 22.6893 29.5541 23.1314 29.0087 23.1314C28.4634 23.1314 28.0213 22.6893 28.0213 22.1439V20.169Z",fill:"white"}),dv.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0714 19.1135C24.654 19.1135 25.1262 19.5858 25.1262 20.1683V24.6119C25.1262 25.7398 24.2119 26.6542 23.084 26.6542H22.5902C22.0077 26.6542 21.5354 26.1819 21.5354 25.5994C21.5354 25.0168 22.0077 24.5446 22.5902 24.5446H23.0166V20.1683C23.0166 19.5858 23.4889 19.1135 24.0714 19.1135Z",fill:"white"}),dv.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.8537 27.4214C29.2114 27.8813 29.1285 28.544 28.6687 28.9016C26.6697 30.4564 24.6954 30.8255 23.0184 30.5817C21.3833 30.344 20.0946 29.5339 19.3755 28.8149C18.9636 28.403 18.9636 27.7351 19.3755 27.3232C19.7875 26.9113 20.4553 26.9113 20.8672 27.3232C21.3002 27.7562 22.184 28.3286 23.322 28.4941C24.4181 28.6534 25.8176 28.4466 27.3735 27.2364C27.8334 26.8788 28.4961 26.9616 28.8537 27.4214Z",fill:"white"}),dv.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",stroke:"#DAEAFB"}))};e0.defaultProps={className:""},e0.propTypes={className:Lv.string};var t0,r0=aw.div(Q3||(Q3=pg(["\n --color: #0276f1;\n\n & .indicator {\n color: var(--color);\n }\n\n & .gauge {\n background-color: var(--color);\n }\n"]))),n0=aw.div(X3||(X3=pg(["\n height: 10px;\n position: relative;\n background: #daeafb;\n border-radius: 100px;\n margin-block-end: 8px;\n\n & > span {\n display: block;\n height: 100%;\n border-radius: 100px;\n width: 0;\n overflow: hidden;\n }\n"]))),o0=function(e){var t=e.value,r=e.className;return dv.createElement(r0,{className:r},dv.createElement(n0,null,dv.createElement("span",{className:"gauge",style:{width:"".concat(t,"%")}})),dv.createElement("div",null,dv.createElement("span",{className:"indicator"},"• ",t,"%")))};o0.defaultProps={value:0,className:""},o0.propTypes={value:Lv.number,className:Lv.string};var a0,i0=aw.b(t0||(t0=pg(["\n color: #1d1d1d;\n padding: 8px 12px;\n background: #fafafa;\n border: 1px solid rgba(29, 29, 29, 0.04);\n border-radius: 100px;\n display: flex;\n align-items: center;\n flex-direction: row;\n font-size: 16px;\n"]))),s0=function(e){var t=e.children,r=e.className;return dv.createElement(i0,{className:r},t)};s0.defaultProps={children:null,className:""},s0.propTypes={children:Lv.node,className:Lv.string};var c0,u0=aw.span(a0||(a0=pg(["\n color: #1d1d1d;\n font-weight: bold;\n background: rgba(255, 255, 255, 0.8);\n border-radius: 12px;\n padding: 12px 16px;\n max-width: 200px;\n text-align: center;\n display: inline-block;\n"]))),l0=function(e){var t=e.children,r=e.className;return dv.createElement(u0,{className:r},t)};l0.defaultProps={children:null,className:""},l0.propTypes={children:Lv.node,className:Lv.string};var d0,f0,p0=aw.div(c0||(c0=pg(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1001;\n\n background-color: ",";\n"])),(function(e){return e.$overlay?"white":"transparent"})),h0=function(e){var t=e.children,r=e.overlay;return dv.createElement(p0,{$overlay:r},r&&dv.createElement(gZ,null),dv.createElement("div",{style:{visibility:r?"hidden":"visible"}},t))};h0.defaultProps={children:null,overlay:!1},h0.propTypes={children:Lv.node,overlay:Lv.bool};var m0={width:210,height:300},g0={width:WW.isMobile?window.innerWidth:window.innerHeight,height:window.innerHeight},v0=aw.ellipse(d0||(d0=pg(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),y0=aw.rect(f0||(f0=pg(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),b0=dv.forwardRef((function(e,t){var r=e.className,n=e.scale,o=e.debug,a=e.width,i=e.height,s=e.padding,c=e.verticalOffset,u={left:a/2-m0.width/2-s.left,top:i/2-m0.height/2-s.top+c,right:a/2+m0.width/2+s.right,bottom:i/2+m0.height/2+s.bottom+c};return dv.createElement("svg",{className:r,viewBox:"0 0 ".concat(a," ").concat(i),width:a,height:i},dv.createElement("mask",{id:"OVAL_MASK"},dv.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),dv.createElement(v0,{ref:t,cx:a/2,cy:i/2+c,rx:m0.width/2,ry:m0.height/2,$scale:n})),dv.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),o&&dv.createElement("rect",{x:"0",y:"0",width:a,height:i,stroke:"red",fill:"none"}),o&&dv.createElement(y0,{x:u.left,y:u.top,width:u.right-u.left,height:u.bottom-u.top,$scale:n,fill:"none",stroke:"red",strokeWidth:.5}))}));b0.propTypes={className:Lv.string,scale:Lv.oneOfType([Lv.number,Lv.string]),debug:Lv.bool,width:Lv.number,height:Lv.number,padding:Lv.oneOfType([Lv.number,Lv.shape({top:Lv.number,right:Lv.number,bottom:Lv.number,left:Lv.number})]),verticalOffset:Lv.number},b0.defaultProps={className:"",scale:1,debug:!1,width:g0.width,height:g0.height,padding:0,verticalOffset:0};var w0={en:{face_authentication:"Face authentication",hold_still:"Hold still",uploading:"Uploading",start:"Start",continue:"Continue",retry:"Retry","face_authentication.successful":"Successful face authentication","face_authentication.unsuccessful":"Unsuccessful face authentication",move_face_into_frame:"Fit your face into the oval",face_not_found:"No face detected",processing_result:"Processing result",please_move_face_into_center_frame:"Please fit your face in the oval",please_move_face_closer:"Please move your face a bit closer",please_move_face_farther:"Please move your face a bit further",please_open_your_eyes:"Please open your eyes",please_look_straight_at_the_camera:"Please hold your device at eye level",please_only_one_face:"Multiple faces detected",please_move_face_down:"Please move your face down a little","timeout.remaining":"Remaining time: <%= remain %> seconds","timeout.expired":"You need to complete within <%= timeout %> seconds. Please try again.",move_face_closer:"Move your face closer"},vi:{face_authentication:"Xác thực khuôn mặt",hold_still:"Giữ yên",uploading:"Đang tải lên",start:"Bắt đầu",continue:"Tiếp tục",retry:"Thử lại","face_authentication.successful":"Xác thực khuôn mặt thành công","face_authentication.unsuccessful":"Xác thực khuôn mặt không thành công",move_face_into_frame:"Đưa mặt vào khung",face_not_found:"Không tìm thấy khuôn mặt",processing_result:"Đang xử lý kết quả",please_move_face_into_center_frame:"Đưa khuôn mặt vào giữa hình oval",please_move_face_closer:"Đưa khuôn mặt lại gần một chút",please_move_face_farther:"Đưa khuôn mặt ra xa một chút",please_open_your_eyes:"Vui lòng mở to mắt",please_look_straight_at_the_camera:"Vui lòng đưa thiết bị ngang tầm mắt",please_only_one_face:"Có nhiều mặt trong khung hình",please_move_face_down:"Đưa khuôn mặt xuống một chút","timeout.remaining":"Thời gian còn lại: <%= remain %> giây","timeout.expired":"Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại.",move_face_closer:"Đưa mặt lại gần"}},k0=dv.createContext({}),C0=function(e){var t,r=e.children,n=hN.useSDKSettings().lang;return dv.createElement(k0.Provider,{value:null!==(t=w0[n])&&void 0!==t?t:w0.vi},r)};C0.propTypes={children:Lv.node.isRequired};var E0,S0=function(){var e=dv.useContext(k0);return dv.useCallback((function(t,r){var n,o;return r?iY(null!==(n=e[t])&&void 0!==n?n:t)(r):null!==(o=e[t])&&void 0!==o?o:t}),[e])},B0=function(e,t){var r=dv.useRef(e);dv.useEffect((function(){r.current=e}),[e]),dv.useEffect((function(){t&&"function"==typeof r.current&&r.current()}),[t])},_0=Object.freeze({READY:"READY",RUNNING:"RUNNING",STOPPED:"STOPPED"}),x0=aw.span(E0||(E0=pg(["\n display: inline-block;\n margin-block-start: 10px;\n color: red;\n text-align: center;\n max-width: 350px;\n"]))),T0=function(e){var t=e.onTimeout,r=e.timeout,n=e.shouldStart,o=e.shouldStop,a=S0(),i=function(e){var t=e.startTime,r=void 0===t?3:t,n=e.onCountDownDone,o=e.autoRestartAfter,a=void 0===o?-1:o,i=hg(dv.useState(r),2),s=i[0],c=i[1],u=hg(dv.useState(_0.READY),2),l=u[0],d=u[1],f=dv.useRef(),p=dv.useCallback((function(){d(_0.RUNNING),f.current=setInterval((function(){c((function(e){return e-1}))}),1e3)}),[]),h=dv.useCallback((function(){d(_0.READY),c(r),clearInterval(f.current)}),[r]);return dv.useEffect((function(){var e=null;return 0===s&&(d(_0.STOPPED),clearInterval(f.current),"function"==typeof n&&n(),-1!==a&&(e=setTimeout((function(){h(),p()}),1e3*a))),function(){clearTimeout(e)}}),[s,n,a,h,p]),{state:l,countdown:s,startCountDown:p,stopCountDown:h}}({startTime:r,onCountDownDone:t,autoRestartAfter:3}),s=i.countdown,c=i.startCountDown,u=i.stopCountDown;return B0(c,n),B0(u,o),dv.createElement(dv.Fragment,null,s>0&&s<10&&dv.createElement(x0,null,a("timeout.remaining",{remain:s})),0===s&&dv.createElement(x0,null,a("timeout.expired",{timeout:r})))};T0.propTypes={onTimeout:Lv.func.isRequired,timeout:Lv.number.isRequired,shouldStart:Lv.bool.isRequired,shouldStop:Lv.bool.isRequired};var A0={8:[" r rrr"," r rr"," r r rr "," r rrr "," r r r "," rr r rr"," rr r "," rr rrr"," rr r"," rrr r"," r rrr "," r r r "," r r rr"," r r r "," r rrr r"," r r "," rrr r "," r rr r"," rrr rrr"," r r "," rr r "," r rrr "," r rr "," r r rr"," r r r"," r r r"," r rr r"," r r r "," r rr r"," r rr rr"," rr rr "," rr rr"," r rrr"," r r"," r rrr"," r rr "," r rr r "," rr r "," rr r r "," r r "," rr r "," rr r "," r r r"," rr rr"," rr "," r rr "," rrr r r"," r r r"," rrr rr"," r rr"," rrr "," rr rrr"," r r "," rrr "," r r "," r r r"," r rr "," rr rr "," rrr r"," rr r r"," r r r r"," rr rrr "," rrr rr "," rrr r"," rrr rr"," r rr "," rrr r "," rr rr"," rr rr r"," r rr "," rr r"," r r rr"," r r r"," r r rrr"," rr r r"," rrr r "," rr r r"," r r "," rr r "," rr rr "," r r "],9:[" r r r "," r r r"," rrr r r "," r rrr "," r r rr"," rr r "," r r r "," r rrr "," rr rr "," rr r r "," r r rrr"," r r r r"," r rr r"," rr r r"," r rr "," rrr r "," r rr r"," rr rr "," rr r r"," rr r rr"," rr rrr "," r r r"," r r r "," rr rr r"," r rr r"," rrr rrr "," rr r r"," r r r "," rrr "," r r rr"," r r rrr"," r r r rr"," r r r "," rrr rr"," r rrr r "," rrr r "," rrr r "," rrr r "," r rr r r"," rr r r "," rr r r"," r r r"," rr rr r"," rr r r r"," r r r "," r r rr "," rr r r "," r rr r "," rr rr "," rr r "," rr r"," r r r"," rrr r"," r rr "," r r "," r r "," rrr r "," r rr "," r rr r "," r rr rr"," rr r "," r r rr "," rrr rr"," r rrr "," rrr rrr"," r rr "," r r rrr"," r rrr r"," r r rr r"," rr rr r "," r rrr "," r r rr"," rr r "," r r r "," r r r r "," r r "," r rr rr "," r rrr "," r rr "," rr rrr "," r r "," r r r r"," rr rr r"," r rr rr"," r r r "," rr rr"," r r rrr "," r r r "," rr rr rr"," r rr rrr"," rr rr "," rr r rr"," rrr rr "," rrr rr "," rr rrr "," r rrr"," rr r r"," rrr rr "," rrr rr"," rrr r r"," rr rr"," r rrr r"," r rr "," rr rrr"," rr r r"," r rr r"," r r rr "," r rr rr"," r rrr rr"," rrr r r"," r rr"," r r rr "," r r r"," rrr rrr"," rr r "," rr rr "," r r rr"," rr rrr r"," rrr r rr"," r rr r "," r r r"," r rr r"," rrr r r"," rr r rr"," rr r rrr"," r r "," r rrr"," rrr r "," r r r r"," rr rrr"," r r "," rr r "," rr r rr "," r rrr r"," rr r "," rrr r"," r rr r "," r rr r"," r rr "," r r rr"," r r r "," rr rrr"," rr rr "," r rrr "," rrr rr r"," r r rr"," rr r r "," r r r r"," r r r"],10:[" r rr r"," rrr rrr "," rr r rr "," r r rrr"," r rr r"," r r rr "," r rrr rr"," r r rr "," rr r r"," r r rr "," rr rrr "," r rr r r"," rr r rr "," r r r r "," r rrr "," r rr rr "," rr rr r"," rr r r "," r rrr r"," r r r "," r r r"," rrr r "," r r r"," rr r rrr"," r r r rr"," r rr rr"," r rr r "," rrr r r "," rr rr r"," r r rr"," r r r r"," rrr r rrr"," r r r r "," r r rrr "," r rrr rr "," rrr r"," r rrr "," r r r "," r rrr r "," r rr rrr"," r rrr rrr"," rr r r "," rr r r "," rrr r rr"," rr rrr "," rrr r "," rrr rr r"," rrr r "," r rrr r "," r r rrr r"," r r r r "," rrr r r "," rrr rrr "," rr r rr "," r r r rr"," rr r r r"," rr rr "," r rr rr "," rr rrr r"," rr rr "," r rr r "," r rrr r"," r r r r"," rr rrr "," r r "," rr r r "," rrr rr r"," rr r rr"," r rr r"," r r r"," rr r rr r"," r r rr r"," rrr rrr "," r r r r "," r r rrr "," rr r "," rrr r r "," r r rr "," r r r r "," r rrr r"," rr rrr "," r rrr rr"," rr r rr"," r r r "," r r rr r"," r r r r"," rr rr "," rrr rr "," r r r"," rr rr "," rr rrr"," r rr r"," r r rrr"," rr rr "," r rrr rr"," rr r "," r rr r "," rr r "," rr rr r "," rr rr r r"," r rrr r "," r rrr "," r rrr "," r rr rr"," rr rr rr"," rr rrr "," r r rr "," rr r r"," rr r "," rr r rr"," r rr rrr "," rr rrr r"," rr r r "," rr r rr "," r rrr "," r rr r r"," r r r "," rr rr r "," r r rr "," r rr r "," r rr r "," r rr r r"," rrr rrr"," rr r r rr"," rrr rr "," r rr rr r"," rr r r r"," r rr r"," r rr rr "," r r r "," r r rr r "," rrr r rr"," r r "," r rrr r "," r r rr r"," r r r r"," r rrr r r"," rr r rrr "," rrr rr "," r r rrr"," r r r "," rr r rr"," r rr r"," r r "," rrr r r "," rr rrr r"," rrr rr "," rr r r "," r r r r"," rrr r "," r rr rrr"," r rr r "," rrr r r"," rr r r"," r r r "," r r rrr"," rr r "," rr rr r"," r r r r"," r rr "," r rr rr "," rr r r "," rr r rrr"," rr rr r"," rrr rrr"," r r rrr"," r r r"," r r r "," rrr r r"," r rr r "," r rr rr"," rr rrr r "," r r r r"," rr r r r "," r rr r "," rr r r "," r rr "," r rr rr"," r rr rrr"," rrr r rr "," r r rrr "," r r r rr"," r r r "," r rrr r"," rr r "," rr rr"," r rr r "," rr r rr"," rr r rrr"," r rr r rr"," r r r "," r r r rr "," rr r r r"," r r r rr"," rr rr rr "," rrr r r"," r rr r r"," rr rr r "," rr r r"," r rr "," rrr rr r"," r r r "," r r rr "," rr rr r"," rrr rr rr"," r rrr "," rr rr rr"," rrr r r"," rrr r rr"," r r r "," rr rrr"," rrr rr "," rr rrr rr"," r r r"," r rrr "," r r rr"," r rr "," rr rr "," rrr r r r"," r rrr"," r r r rrr"," rrr rr"," r r rr "," r rrr r"," rr r r"," rrr r r"," rr rr rrr"," r r r r"," rrr r "," r r r r"," r r rr"," r rr rr"," rrr rr r "," r r r r r"," r r r "," r r r "," r rr r "," r r rr rr"," rrr r "," rr rr r "," r rr r r "," rr r r r"," rr rr r"," rr rrr "," rrr rrr r"," r r rrr "," r r rr"," rr r r"," rr r rr"," r r rr"," r r rr "," rrr r "," r rrr r"," r rr "," r r r "," r r r r"," rr r r "," rr rr "," rrr r r"," r rr "," rr r r"," rrr rr "," r r rr"," r r rr"," r r rr r"," r r r "," rrr rrr"," rrr rr"," r rr rr"," r r rr "," rr r r "," r rr r"," r r rrr"," rr rr rr"],11:[" rrr rrr "," r r r r r"," r r rrr"," r rr rr "," r rr rrr"," r r r r r"," rr r rrr"," rrr rrr r"," rr r r "," rr rrr rrr"," r rrr rrr"," r r r "," rr rrr r"," r rrr "," rr r rrr "," r rr rr"," rrr rr r"," rr r r "," r rrr rr"," r r rrr r"," rr r r r"," rrr r r"," r r rrr "," r rr rr r"," rr rrr r"," rrr r rrr"," rr rr r"," r rrr r "," r rr rrr "," r r rr"," rr r r "," r r r r "," r rr rr"," r rr r"," rrr rr "," rrr rr r "," rr r r r"," rr rrr rr"," rrr rr "," r rrr "," r rr r "," rrr rrr"," r rr rr rr"," r r r rr "," rr r rr rr"," r rr r "," r r r "," r rrr r "," rrr r r r"," rrr r rr "," r r r "," rr r rrr "," rrr r r"," rr rr r "," rr r r "," r rr r rrr"," r r r r"," rr r rrr "," r rr r"," r r rr"," rr r r "," rr r r"," r r r rr"," rrr r rr "," r r r r"," r rr r rr "," r r rr "," r r rr r"," r rrr rr "," r r r "," r rr r "," rr r r r"," rr r r r"," r rrr rr "," rr rrr "," rrr r r "," rrr r rr "," rr r rr"," rr rrr r"," r r rrr "," r r rr r "," r rr rr r "," rr r r r "," r r r "," rr r r "," r r r rrr "," rrr rr r"," r rr r "," rr rr r "," rr rr rr "," rrr r r "," rrr rr r r"," r r rrr "," r rr r rr"," rr rrr rr"," rr rr rr r"," r r r"," r rrr r"," rr r r r"," r r rrr "," r rr r rr"," rrr r r "," r rr r "," r rr rr "," r rr rr "," rr rrr rr "," rr rr rr "," rr r rr "," r r r r r"," rr rr rrr"," r r rr r "," r r r "," r r r r"," rr r rrr"," r rr r "," r r rr"," rrr r r"," rr rr r "," rrr r rr"," r r rr r"," rr rr r r"," r r r r "," r r rrr rr"," r rr "," r r r r "," rrr r rrr"," rrr r r r"," rr r rrr r"," rr rr r r"," rrr r r "," r rr r r "," rrr rr "," rr r rr"," r r rrr"," r r r r r "," r rrr r r"," r r rr r"," r r rrr "," r r rrr r "," r r r rr"," r rr rr "," rr rr rr "," r rrr r "," r rr rrr"," r r r r"," rrr r "," rr rr "," rr rrr "," rrr r r"," r rr r r "," r r rr "," r r rr "," r rr rr "," r r rr "," rr rr rr"," r rr "," rr r rr "," r rr r r "," r r r r"," r r r "," r rr rr "," rrr r r "," rr r r "," r r rr "," rr r rr r "," rr rrr"," rr rr rrr "," rr rr r"," r r r r "," rr r rrr"," rr rrr "," rr r r "," r rr r "," rr r r "," rr rrr r r"," rr r "," r r r rr "," rr rr rr "," rrr r "," r r rr r"," rr r r r "," rr r r r "," rrr r r"," rrr r rr"," r r r r "," rr rr r "," rrr rr "," r rr rrr"," r rr rr"," r rrr r r"," r rrr "," r rrr r"," rrr rrr r"," r r r "," r r rr "," r r rrr"," rr rr r"," r r rrr"," rrr rrr r "," rr r r r"," rrr rrr"," r r rrr r"," rr r r rr"," r r r "," rr rrr r "," rr rr r "," r r r "," r rrr "," r r r r "," r rrr r"," r r rr r "," r rr rrr "," rr r rrr"," rrr rr"," rrr r r r"," rrr rr r"," r rr r "," rr rr r r"," r r rrr "," r r r rr"," r r rrr "," rrr rr r "," rr rrr r"," rrr r rr"," r r rr rr"," rr rr "," r rr r"," r rr "," rrr r r "," r r rr "," r rrr r"," r rr r"," r r rr r"," r rr r r"," rr r rr"," rrr r rr"," r r rr"," r rrr rrr"," r rrr rr "," r r r r "," rrr r rr"," r r r r "," rrr rr rr"," r r rr rrr"," r r r r"," r rrr "," rr r r r"," rr rrr "," rr r r r"," rr r rrr "," rr r r"," r r r r"," rr rrr r"," rrr r r "," r r r "," r rr r r r"," r rr rrr r"," r r r r"," r r r rr r"," rrr r r r"," r r rrr"," rr rrr "," r r r r"," r r r"," r r rr rr"," rrr rr r"," r r rr "," r r r rr"," r rr r r "," r r r rr"," r rrr rr"," r r r"," r r rr"," r rrr r "," rr rr r "," rrr r "," rr rr r "," r r r r "," r r rr "," rrr r rr"," r rr r "," rr r r r r"," r r r r "," rr r r "," rrr rr "," rr rr rrr"," rr r rr"," r rrr rrr"," r rr r "," rr rr rr"," rr r r "," r rr rr "," r r r r "," r r r "," rr r rr "," r r rr "," r r r rr"," rr r r r "," r r rr "," r r r rr"," r r rrr"," rr rr r r"," r rrr rr r"," r rr rr"," r r rr "," r rr r r"," rr rr r "," r r rrr r"," r rrr rr "," rr rrr "," rrr r r "," rrr r r"," rrr rr "," rr r "," r rrr r rr"," r rrr r"," r rr r r "," rr r rr "," r r rr r r"," r rr r r"," rr r r "," r r r rr"," rrr rrr r"," rrr r r"," r rr r rr"," rr r r r "," rr r r "," rrr rrr "," r r rr"," r r rrr"," r r r r"," rr rr "," r r r r"," rrr rr rr"," rrr r "," r r r r r"," rrr r rrr"," rr rr "," rrr rrr "," r rrr r r "," rr r rr "," rr rr r"," rr r r"," rr r rr r"," r r r r "," r r rr r"," rrr rrr "," rr rrr r "," r rr rrr "," r rrr r"," rr r r"," r rrr "," r rr r "," rrr rrr "," rr r rr r"," rr rrr r "," rr rr rr"," rr r r"," r rr rr r"," r rrr rr"," rr r r "," r r r r "," rr r rr"," r r r r"," r rrr rr"," rr r rrr"," r r r rr "," rrr r rr r"," rrr r "," r rr r r"," r rr rrr"," rr rr rr"," r r rr rr"," r rr rr "," rr r rr"," r rr rr r"," r rrr r "," r rrr r "," rr r rrr"," r r rr "," r r r rr"," r r rrr "," r r r "," rr r r rr"," rr rr rr"," r rrr r "," rr rr "," r rr r r"," rr r r rrr"," rrr r "," r rr rr "," r rr r "," r r r rrr"," r r r rr"," rrr rr rr"," r rr rrr "," r rr rr r"," rrr r r rr"," r r r r"," r rr rrr"," r r rrr r"," r rr r r"," r rrr r r"," r r rr r"," rr rrr "," r rr r "," rr rrr r "," r r r r"," rr rr "," r rr rr"," r rr r "," r r rr r"," rr r rr"," rrr rr r "," rr rr rr"," r rr r "," r r r r rr"," rrr r r "," r r rrr "," rrr r rrr "," r r "," r r r "," r r r r"," r rr r"," r rrr r "," r r rr rr"," rrr rr r"," r rr r rr"," r rrr rr"," rr rrr r"," rr r r r"," rr rr r r "," r r rr r"," r rrr r "," r r r rr "," rrr rr r "," r rr r "," r r r r "," rrr rrr rr"," rrr r r "," r r r "," rr rr rrr"," r r r "," rr r rr "," rr r rr r"," rr rr r"," r rrr rrr "," r rr r r"," r rrr r r"," rrr r rr "," rr r r r"," r r r "," rrr rr rrr"," rr r rr "," rrr rr "," rr r rr "," rr r r rr"," rr r r "," r rr r r"," r rr r r"," r r rr r "," r r rr "," r r rr rr "," rr r r"," rrr rr r"," rr r r rr"," r rrr r"," rr r rr r"," r r r r r"," rr r r "," rr rr r"," r r r "," rr r "," r rr r"," r r r rrr"," rr r rr "," rr rr r "," r r rr "," r rr rrr"," r rrr rr"," r rr r r"," r r rrr "," r rr rr "," r rr rr"," rr rrr rr"," r r r "," rr rr r "," r r r r "," rrr r r r "," rr r rr "," rrr rr rr "," r r rr "," r r r rrr"," r r r rr "," rrr rrr "," rr rr r"," r r rr r"," r r r rrr"," r r rr r "," r r r r"," rr rr r rr"," rr r r rr "," r rrr r "," r rr rr"],12:[" rr rr rr r"," r r r rr"," r rr r r "," rr r r rr "," r rr r r"," rrr r r "," r r rr "," rrr rr r "," rr r rr "," rr rr r "," r r r r "," rr r rr r "," r r r rr"," rr rr r rr "," rr r rr "," rrr rr "," r rr r rr"," rrr rr rrr"," r rrr rr "," rr rr r "," r rr r r"," rrr rr rr "," rr r r r "," rrr r r "," r r rr "," r rr rr rr"," r rrr r "," rr rr r"," rr r r r "," rr rr r rr"," rr r r r"," r rr rr"," r r r r"," r rrr rr "," rr r rr "," rrr r r "," r rr rrr"," r rrr rrr "," r rrr rrr "," rr r r rrr"," r rr r r r"," r r r r rr"," r rrr "," r r rr rrr"," rrr r rr r"," r rrr r "," r rr r"," r rrr r "," rr rr r"," r rr r "," rrr r rr"," rr rr "," rrr r rr "," r rr rr r"," r rrr r r "," r r rr rr"," r rr rr r"," rr r r r "," rr r rrr r"," rr r r r"," r r rr rrr"," r rrr rr r"," rr rr r "," r rr r r "," r r r r"," rr rr r r"," rr r rrr"," rr r rr r"," r r r rr "," r rr r "," r rrr r r"," rrr r rr r"," r rrr rr rr"," r rr r r r"," r rr r rr"," rrr r r "," rr rrr rr "," rrr rr "," rrr rrr r"," rrr rr rr"," rrr rr rr"," r r rr rr"," rr r rr "," rr r r "," r rrr r r"," rr rr r "," rr rr rr "," rr r r "," rr r r "," rr rrr r "," rr rr rrr"," rrr r rr "," r r rr rr "," rr r r r "," rrr rr "," r rr r rr"," r r r r r"," r rr r r"," r r rr rr"," r rrr r r "," r rrr r r r"," r r rrr r"," rr r rr r"," r rr r rr "," rrr r r"," rrr r r "," rrr rrr r "," r r r rr "," rr r rr "," r rr rrr"," r rr r "," r r rr "," r r r r"," r r r r r "," r r rrr r"," rr r rr r"," r rr r rr "," r rr rr "," r r r r"," r r r r"," r r r r "," rr r r "," r r r r "," r rr rr "," rr rr r "," rr r rr rr "," rrr rr r "," r r rr r "," rr r rrr "," r rrr rrr"," rr rrr r "," r rr rrr rr"," rr r r"," rr r rr rr"," rr r r"," rrr r r "," r r rrr r "," r rr r rr r"," rrr rr r "," rr rrr r r"," r rrr r r"," rrr rrr rr "," rr rrr rr "," rr r r r"," r rrr r r"," rr r rr"," rr r r r rr"," rr rr r r"," rr rrr rr"," rr r r r"," rrr r rrr "," r r rrr r "," rrr rr r "," rr r r rrr"," r rr rr rrr"," rr r r "," r r rr r "," r rr rrr"," r r r rr rr"," r r rrr "," r r rrr "," rr rrr rrr"," r r rrr "," rr r rr r r"," rr rr rrr"," rrr r rr "," rr rr rr"," r r r r rr"," rr r rrr"," r rr r r r"," rr r r rr "," rrr rrr r"," rrr rr rr "," r r r r "," rr r rrr "," r rrr r r"," r rr r "," rr r r "," r r r rr"," r rrr rr "," r r r r r r"," r r rrr "," rr r rr"," rr r r r "," rr rrr r "," rr rrr r"," r r r "," rrr r rr"," rr rr r"," r rr r "," r rr r "," rr rr rr"," r rr rrr "," r rrr r r"," rr rr r r"," rrr rrr "," r rrr rrr"," rr r rrr r"," rr rr r r"," r rr r r"," r r rrr r"," r r r r"," rr rrr rrr "," r rr r r "," rr rr "," rr r rr "," r rr rrr r"," rr r r r "," rr r r r "," r rr r rr"," r rrr rr r"," rr r r r"," r rr r rrr"," rr r r r r"," rrr rrr r"," r rr rrr "," r r rrr r"," r r rr rr "," r r r r"," rr rr rr "," r rr r r "," r rr rr r"," rrr rrr rr"," rr rrr r r"," r rr r r"," r rr r rrr"," r r rr r"," r r r r r "," r r r r r "," r r r rr"," r r rr r "," r r rr rr"," r r r rrr r"," rr r rr rr"," r r rr r"," r r rr rr"," r r r r"," r r rrr r"," r rrr r rrr"," r r rr rr"," r r r rr"," r rr r "," r rr rrr "," r r r "," rrr r r rr"," r rrr r "," r r r r "," r rr r r"," r r rr r"," r r r rr "," rrr r r"," rr r r "," rrr r r r "," rr r r "," rr rr r "," r rr r r "," r r r rrr"," r rr rr r"," r r r r "," r r r "," r r rrr r r"," r rr r rr"," r rr r "," rrr r r "," r rr rr rr"," r rr r rr"," rr rrr "," rr rrr rr "," rrr r rr "," rrr r rr r"," r r rr rrr "," r r r r r"," rrr r rrr r"," rr r r rr "," rrr r r"," r rr r r"," rr rr r "," rr rr rrr "," r r r rrr"," rr rr rr "," rrr r rrr"," r rr rr r "," r rrr r "," r r rr "," rr r r r "," r r rr "," r r r r "," r rrr r"," rr rrr r "," rr rrr rr "," rr r r r"," rrr rr r"," r r r r rr"," r r rr r"," rrr rr r "," rr rrr rrr"," r rr rr "," rr rr "," r r rrr "," r r rr r"," r r rr r "," r r rr r r "," r r rr rrr"," r rrr rrr"," rrr r r "," r r r r r"," rr rr r rr"," rr r rrr "," rr r r r "," r r r rr"," rrr rr rrr"," r r r rrr"," r r rr r"," r r rr r "," r rrr rr"," r r rrr rr"," r r rr r r"," rr rr r r "," r rrr r"," rrr rr r r"," r rrr rr"," r rrr rr "," r rr r "," rrr r r r"," r r r r r"," r r r r"," r r r r r"," rr r r r"," r r r rr "," rrr rr r "," r rr rr r"," r rrr rr "," r rrr r rr "," rrr r r rr "," rrr rr "," rr r rr r"," r r r "," r rr r "," r rrr r"," rrr r rr r"," rr r rr"," r r rr r r"," r rrr r "," rr r r r"," rr r r "," r r rrr r"," rr rr r r r"," rrr rrr "," rr r r rrr"," rrr rr r"," r rr rrr "," rr r r "," rrr r r "," rr rrr r "," rr r r "," r rrr rrr"," r r rr "," rr rr rrr "," rrr rrr "," rrr r r r "," rrr r r r "," r r r rr"," r r rr r "," r rrr r "," r rr r r"," r r rr "," rr r rrr "," rr rr rr r "," r r r rrr"," r rr rr rr"," r rrr r rr"," rr r r rr"," r r r r"," rr rr rrr "," r rrr r r"," r rr r r r "," r r rr "," r rr r r "," rr rr r "," r rr r "," r rrr rr r"," r r rrr rr"," r r r "," r r r rr"," r r r rrr"," rr r r "," r r rrr "," r r r "," r r r r "," rr rr rr"," r rrr rr"," rr r rrr"," r rr rr r"," r r rr r"," rrr rr r"," r r r r rrr"," r rr rr "," r rr rrr "," rrr rrr r "," rr r r rr"," r r r r "," r r r "," rr rrr r"," r r r r "," rr r r "," r r rr r"," rrr r r r "," rr rr r r "," rrr r r r"," r r r r "," r rr r r"," rrr r "," rr r rr"," r rr rr "," rr rrr "," r r rr r"," rr rr rr"," rrr r rr"," rr r rr "," rrr rr rr"," rrr rr rrr "," r r rr r "," r r r rr "," r rrr r "," r r rrr "," rrr r rr "," rr r rr rr"," r r rr r"," r rr r r r"," r r rr r "," rr rr rrr"," rrr rr rr r"," r rr r "," r r r rr"," rrr rr r"," rr r rrr "," r rr rr r"," r r r rr r"," r rr r "," r r r r r "," rr r rr r "," r r rr r"," rr r r rr"," r r rrr"," r r r rr "," r r r rrr"," rr r rrr"," rrr r r "," r rrr r "," rr rrr rr"," r rr rr "," rr r rrr"," rr r rr "," r r r r r"," rr rr rr "," rr rrr rr"," rr r r "," r r r r "," rr r rr "," rrr r rr "," r rrr r r "," rr r r r r"," r rr r rr"," r rrr rr "," rr rr rr r"," r r r r"," rr rr r "," r r r r "," rr r rr r"," rr r rr r "," r r rr r "," rr rr rr "," rrr r r "," rr r r rr"," r r r "," rr r rrr"," rr r rrr "," r rrr r"," rrr r rrr"," rrr r r r"," rrr r r r"," r r r r"," r rr r rr "," rr r r r "," rr r r r"," r rrr rrr"," rr rr r rrr"," rr r r r "," rr rrr rr r"," rr r r r "," r r rrr r "," rr rrr rrr"," r r r r r "," r rrr rr"," rrr rr r "," r rr r r rr"," rrr r r r "," r rrr "," r rrr r "," r r rrr r"," r rrr r r"," rrr rr r"," rr r r rr r"," rr rr rrr"," r r r r r"," r r rrr "," rr r r r r"," r rr r r "," rr rr rrr r"," r rr rr "," rr rr r "," r r r r "," r rr r r "," rr rr r rr"," r r r "," rrr rrr r "," rr r rrr "," r rr r rr"," rrr rr rr "," rr rr rrr "," rr rr r r"," rr r r r "," r r r r"," rrr r "," r r r"," r rrr r"," r r r r"," r r rr r "," r r rr "," r r r "," rr r r "," r rr rrr"," r r r r "," r r rrr rr"," r r r r r"," r rrr rr"," rr r r r"," r rr rr "," r r rrr rr "," rrr r r r"," r rr r r "," r r rrr "," r rr r"," rr r r rr"," r r r rrr "," r r r r "," rrr r r r"," rr rrr r r"," rrr r rrr"," r rr rrr"," r rr r rrr"," rr rr r "," r rrr r r "," r rr rr"," r rr "," rrr r r rr"," rr rr r "," rr r rr "," r r r rr"," rrr r r "," rrr r r "," r r r r "," r r rrr r"," r r rr r"," r rr r r"," rr rrr r"," r r rr rrr"," r rr r r "," r rrr rrr "," rr rr r rr"," rrr rr r r "," r r r rr r"," rr rrr "," r rrr rrr"," rr rrr r "," rr r r r r"," rrr r rr rr"," r rrr rr"," r rrr r"," rr rr rrr"," r rr rrr "," r r rrr "," r rr rr "," rr rrr r"," r r r rr "," r r r rr "," rr rr rr "," rr r rr rr"," rrr rrr r r"," r rr rr"," r rr r rr "," rrr rr rr"," r r r rrr "," rr rr r r"," r r r rrr "," rrr rr rrr"," r r r r "," rr rr rr "," rr rrr r"," rr r r r "," rrr r rrr"," r rrr r "," rrr r r r"," rrr rr r r"," rrr rr r"," rr rrr r "," rr r r rr"," r r r "," rrr rrr r"," rr r r r"," r r rr "," r r r r rr"," r rrr rr r "," rr rr rr r"," r r rr "," r r r rr r"," r r rr r r"," r rr rr "," r rrr rr "," r r rr rr r"," r r rrr rrr"," rr rrr r "," r r r r r "," r r rr "," r rr r r"," r r rr r"," r r r r"," r rr r "," r r rrr rr"," rrr r rr r "," rrr r rrr"," r rrr rr "," r r rr r "," r rr rrr r"," r rr r r "," rr rr r r "," rr rr r "," r r r r r"," rr r rrr r "," r r rrr "," rr rrr rr"," r r r r"," rrr r r r"," r r r "," r rr rrr"," rr rrr rr"," rr rrr "," r r rr r rr"," r r r r r"," r r r rr "," r r rrr "," r rr rrr r"," rr rr r "," r r r "," r rr rr "," r r r "," r rr rr "," r r r r r"," r r r r "," r r rrr"," r r rr "," r r rr rr "," r rr rr rr "," r r r r"," r r r r"," r rr r "," rr r rr r "," rr rr r"," rr rrr r rr"," rrr rr rr"," r rrr r "," rrr rr r "," r r rrr"," r rr r "," rr rr r"," rrr r rr "," rr r rr r"," r r rrr r "," rr rr r r "," r rr r r"," r rr rr r"," r rr r rr "," rrr r rr"," r r r rrr"," rr r rr r"," rrr rr r"," rr r rrr r"," r rr r r"," rr r rr "," rr rr rr"," r r r r rr "," rr rr rr rr"," rr rrr r"," r rrr rr "," r r rr r"," r r r rrr"," r r rr r "," r r r rr "," r r r rr r "," r rrr r rr"," rrr rr rr "," rrr rrr rr"," r r rr rr"," r r rr "," r rr r r"," rr r r rr "," rr r r rr"," rr rr rr r"," rr r rr"," rr r r r "," r rrr rr "," rr r rr "," rr r rrr"," r rr r r"," rr r rr "," r rrr rrr "," rr r rr r"," rrr rrr "," r r rrr r"," rrr rr r r"," rr r r"," rr rrr rr"," rr r r r"," rr rrr "," rr r rrr rr"," rr r rr "," r rr rrr "," r r rr r r"," rr r r "," r r r "," r r rrr"," r r rr "," r r rrr"," rr r rr r "," rr rr r"," rr rrr r "," r r r "," r r r r"," rr rr r r"," r r r r "," r rr rr r "," rr rr rr "," rrr r rr"," r r rrr "," rrr rrr"," r r r r "," r r r r "," r rr rrr "," r rr rrr r"," rr r r rrr"," r r rrr "," rr r r r"," r r rr"," r rr rr r "," rrr r rr "," rrr r rrr "," rr r rrr "," rr r rrr "," r r r r r"," rrr rrr r"," r r rrr "," r rr r r "," rrr r r r r"," rr r r rrr "," rrr r "," rrr rr "," rrr rrr r "," rr r r r r"," r rr rr rr"," rr rrr r "," r r rr "," r r r r r"," rr rr r "," r r r r "," rr r r r"," rrr rrr "," r r rr r"," r rrr rr"," r r r r "," r r r r "," r r r r "," r rrr r "," r r r rrr"," r rrr r r"," r r rrr r "," r rrr "," r r r rr "," r rr rr "," r r r rr r"," r rr r rrr "," r rrr r r"," r rr rr "," r r r r "," r r rrr r"," rrr r r"," r r r rr"," r r r rrr "," r r r rr"," rr r r rr "," rr r r rr"," r rr rr"," rrr r r rr"," rrr r r "," rrr r rr "," rr rr rrr"," rr rrr r"," r r r rr"," rr r rr "," r r r rr"," r rr rr r r"," r rr r r "," r rr r rr"," r r rr rr"," r r rr rr "," rrr r rrr "," r r rrr "," rr r r r"," rr rrr r r "," rrr rr r rr"," r rr rrr "," r rr r rr"," r r r rrr "," rr r r "," rrr r rrr "," rrr r r r"," rrr r r r"," r r r rr "," r r r r rr"," r rr r r"," rrr r r rr"," rr rr r "," rrr rrr r"," rrr r rr"," r rr rr r"," r rr rr r "," r rr rrr r "," r rr rr"," rr rrr r r"," rr r rr rrr"," rr r r "," r rr r"," r rr r r "," rrr rr r "," r r rr rr "," r rr r "," rr r r rr"," rr r rrr "," rrr r r "," r rrr rrr r"," r r rr r"," r rr rrr "," rrr r rr"," r r r rr "," r rr rr"," rr r rr "," rrr rr r r"," rr r r "," r rrr r "," r r rr rr"," rrr r r"," rr r rr r"," rr r r rr"," r r r rr "," r r rr"," rrr rrr rr"," r r r r r"," rrr rrr "," r r r rr"," rrr r r "," rrr rrr "," rr rr rr"," rrr rr r "," r r r r "," r rrr r "," rrr r r rrr"," r rrr r "," rrr r rr "," r r r r "," rr r "," rr rr rr "," r rr r r "," r r r rr "," r r r r r"," rrr rrr rrr"," r r rr r r"," r r rr rr"," r r r r "," rr rr r r"," r rr rr r"," rrr rr "," rrr r r"," r rr rrr"," r r rr "," rr rr rr "," r r rr r "," r r rr r "," r rr r "," r r rrr"," r r r rr r"," r rrr r rr"," rr rr r r"," rr r rrr r"," rr r rr r"," r rr rr "," rrr r rrr"," r r r rr"," r r rr"," rr r r r"," rr rr r r "," rr rr r r"," rrr rr rr"," r rr rr "," r rrr rr r"," r r rr "," r rrr r r "," r rr r r r"," r r r rrr"," rr r r r r "," rr rr rr"," rr rrr "," r rrr r rr"," r r rr r "," r rr r rrr"," r r rr "," r rr r "," r rr rr r "," rr r rr"]},I0=function(e){return dv.createElement("svg",rg({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),dv.createElement("path",{d:"M17.2434 6.06389L17.2438 6.06352C17.4385 5.86879 17.7519 5.86879 17.9467 6.06352C18.1314 6.24826 18.1314 6.57168 17.9467 6.75642L13.0567 11.6464L12.7031 12L13.0567 12.3535L17.9467 17.2435C18.1414 17.4383 18.1414 17.7517 17.9467 17.9464C17.7519 18.1412 17.4385 18.1412 17.2438 17.9464L12.3538 13.0564L12.0002 12.7029L11.6467 13.0564L6.75666 17.9464C6.56192 18.1412 6.24851 18.1412 6.05377 17.9464C5.85903 17.7517 5.85903 17.4383 6.05377 17.2435L10.9438 12.3535L11.2973 12L10.9438 11.6464L6.05377 6.75642C5.85903 6.56168 5.85903 6.24826 6.05377 6.05352C6.24851 5.85879 6.56192 5.85879 6.75666 6.05352L11.6467 10.9435L11.9999 11.2967L12.3534 10.9439L17.2434 6.06389Z",fill:"#5E5E5E",stroke:"#1D1D1D"}))},P0=function(e){var t,r=(tg(t={},O3,0),tg(t,D3,0),tg(t,L3,0),t);return e.forEach((function(e){r[e.type]+=1})),r},R0=dv.createContext({}),N0=function(e){var t=e.apiCredentials,r=e.children,n=$D.useApiClient({apiCredentials:t}).apiClient;return dv.createElement(R0.Provider,{value:n},r)};N0.propTypes={apiCredentials:Lv.shape({accessKey:Lv.string.isRequired,secretKey:Lv.string.isRequired,apiUrl:Lv.string.isRequired}),children:Lv.node.isRequired},N0.defaultProps={apiCredentials:{}};var O0,D0,L0=function(){return dv.useContext(R0)},M0=(O0=[],D0=null,{uploadFrameBatch:function(e,t){D0!==e[e.length-1]&&(D0=e[e.length-1],O0.push(t.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})})))},getAllUploadedBatches:function(){var e=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(O0);case 2:if(!(t=e.sent).some((function(e){var t;return void 0===(null==e||null===(t=e.data)||void 0===t?void 0:t.file_id)}))){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",t.map((function(e){return{id:e.data.file_id}})));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),resetUploadBatches:function(){O0.length=0}}),F0=dv.createContext({}),U0={},j0=function(e){var t=e.children,r=e.clientSettings,n=e.apiCheck,o=hg(dv.useState({}),2),a=o[0],i=o[1],s=L0();dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof s.clientSettings){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,s.clientSettings();case 4:t=e.sent,i(t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[s]);var c=U0;return Object.keys(r).length>0?c=r:n&&(c=a),dv.createElement(F0.Provider,{value:c},t)};j0.propTypes={children:Lv.node.isRequired,clientSettings:Lv.shape({}),apiCheck:Lv.bool},j0.defaultProps={clientSettings:{},apiCheck:!1};var V0,z0,q0,H0,K0,W0,G0,Q0,X0,Y0,$0,Z0=function(){return dv.useContext(F0)},J0={captureFrameSettings:{enable:!1,framesIntervalTime:0,framesBatchLength:10},livenessSettings:{timeout:30,enableFarStep:!0},flashSettings:{flashColor:"rgb(255, 0, 0)",colorsLength:10,delayBetweenColors:120,framesPerColor:4,flashIntensity:1,useFaceDetectorWhenFlashing:!1},maskSettings:{smallScale:WW.isMobile?.65:.6,largeScale:WW.isMobile?.9:.85,ovalPadding:{left:WW.isMobile?20:30,right:WW.isMobile?20:30,top:(WW.isMobile,0),bottom:(WW.isMobile,20)},ovalVerticalOffset:WW.isMobile?60:0,chinToMaskBottomPadding:(WW.isMobile,20)},faceSettings:{minFarFaceRatio:WW.isMobile?.85:.8,maxFarFaceRatio:(WW.isMobile,.9),closeFaceRatio:WW.isMobile?.95:.82},closeEyesSettings:{enable:!1,timeout:5},exifSettings:{enable:!0},imageSettings:{imageScale:1,imageQuality:1}},e2=function(){var e=Z0();return dv.useMemo((function(){return{captureFrameSettings:{enable:GY(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.enable",J0.captureFrameSettings.enable),framesIntervalTime:GY(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_interval_time",J0.captureFrameSettings.framesIntervalTime),framesBatchLength:GY(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_batch_length",J0.captureFrameSettings.framesBatchLength)},livenessSettings:{timeout:GY(e,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.timeout",J0.livenessSettings.timeout),enableFarStep:GY(e,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.enable_far_step",J0.livenessSettings.enableFarStep)},flashSettings:{flashColor:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_color",J0.flashSettings.flashColor),colorsLength:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.colors_length",J0.flashSettings.colorsLength),delayBetweenColors:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.delay_between_colors",J0.flashSettings.delayBetweenColors),framesPerColor:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.frames_per_color",J0.flashSettings.framesPerColor),flashIntensity:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_intensity",J0.flashSettings.flashIntensity),useFaceDetectorWhenFlashing:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.use_face_detector_when_flashing",J0.flashSettings.useFaceDetectorWhenFlashing)},maskSettings:{smallScale:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.small_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.small_scale",J0.maskSettings.smallScale),largeScale:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.large_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.large_scale",J0.maskSettings.largeScale),ovalPadding:{left:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.left":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.left",J0.maskSettings.ovalPadding.left),right:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.right":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.right",J0.maskSettings.ovalPadding.right),top:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.top":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.top",J0.maskSettings.ovalPadding.top),bottom:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.bottom":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.bottom",J0.maskSettings.ovalPadding.bottom)},ovalVerticalOffset:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_vertical_offset":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_vertical_offset",J0.maskSettings.ovalVerticalOffset),chinToMaskBottomPadding:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.chin_to_mask_bottom_padding":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.chin_to_mask_bottom_padding",J0.maskSettings.chinToMaskBottomPadding)},faceSettings:{minFarFaceRatio:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.min_far_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.min_far_face_ratio",J0.faceSettings.minFarFaceRatio),maxFarFaceRatio:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.max_far_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.max_far_face_ratio",J0.faceSettings.maxFarFaceRatio),closeFaceRatio:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.close_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.close_face_ratio",J0.faceSettings.closeFaceRatio)},closeEyesSettings:{enable:GY(e,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.enable",J0.closeEyesSettings.enable),timeout:GY(e,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.timeout",J0.closeEyesSettings.timeout)},exifSettings:{enable:GY(e,"data.settings.sdk_settings.flash_liveness_settings.exif_data_settings.enable",J0.exifSettings.enable)},imageSettings:{imageScale:GY(e,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_scale",J0.imageSettings.imageScale),imageQuality:GY(e,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_quality",J0.imageSettings.imageQuality)}}}),[e])},t2=function(e){return Array.isArray(e)?e.map((function(e){var t=e.base64,r=e.label,n=e.index,o=e.metadata;return{base64:t,label:r,index:n,metadata:JSON.stringify(o)}})):e},r2=(aw.div(V0||(V0=pg(["\n color: #ffffff;\n"]))),aw(b0)(z0||(z0=pg(["\n z-index: 2010;\n width: 100%;\n height: 100%;\n opacity: 1;\n margin: 0;\n"])))),n2=aw(s0)(q0||(q0=pg(["\n margin-block-start: 12px;\n z-index: ",";\n\n & svg {\n margin-inline-end: 8px;\n width: 24px;\n height: 24px;\n }\n\n color: ",";\n background: ",";\n\n ","\n"])),1002,(function(e){var t=e.theme;return e.$flashing?t.instruction.flashing.color:"#1d1d1d"}),(function(e){var t=e.theme;return e.$flashing?t.instruction.flashing.backgroundColor:"#fafafa"}),(function(e){return e.$flashing?Hb(["transform:translateY(45vh);padding:12px 16px;font-size:24px;"]):""})),o2=aw.div(H0||(H0=pg(["\n width: 100vw;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n background-color: ",";\n opacity: ",";\n z-index: ",";\n"])),(function(e){return e.$backgroundColor}),(function(e){return e.$intensity}),1001),a2=aw.div(K0||(K0=pg(["\n background: red;\n opacity: 0.2;\n width: 100vw;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n"]))),i2=aw(o0)(W0||(W0=pg(["\n margin-block-start: 10px;\n width: 300px;\n\n z-index: 1002;\n"]))),s2=aw.div(G0||(G0=pg(["\n position: fixed;\n z-index: ",";\n top: 0;\n left: 50%;\n transform: translate(-50%);\n min-width: 250px;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n"])),1002),c2=aw.div(Q0||(Q0=pg(["\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n"]))),u2=WW.isMobile?{width:{ideal:640},whiteBalanceMode:"none"}:null;function l2(e){var t=e.onFlashDone,r=e.apiCheck,n=e.onClose,o=e.onError,a=e.frontCamera,i=e.styledComponent,s=e.onFramesCaptured,c=e2(),u=c.maskSettings,l=c.flashSettings,d=c.faceSettings,f=c.closeEyesSettings,p=c.livenessSettings,h=c.captureFrameSettings,m=c.exifSettings,g=c.imageSettings;if(u.smallScale>u.largeScale)throw new Error("smallScale must be smaller than largeScale");var v,y,b,w,k=L0(),C=h.framesIntervalTime,E=dv.useRef(),S=(v=dv.useRef(),y=KN.useSDKTracking().sendEvent,dv.useCallback((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=performance.now();if("object"===Xm(r)){var o=og({},r);v.current&&(o.interval_vs_previous_in_ms=n-v.current),v.current=n,y({tag:e,event:t,log:o})}if("function"==typeof r){var a=r({lastTimeLog:v.current});v.current=n,y({tag:e,event:t,log:a})}}),[y])),B=S0(),_=dv.useContext(q3),x=l.colorsLength,T=l.framesPerColor,A=l.delayBetweenColors,I=l.useFaceDetectorWhenFlashing,P=l.flashIntensity,R=l.flashColor,N=(b=x,dv.useMemo((function(){var e=A0[b];return e[Math.floor(Math.random()*e.length)]}),[b])),O=function(e){var t=hg(dv.useState(e),2),r=t[0],n=t[1];return dv.useEffect((function(){!function(){var t=$m(regeneratorRuntime.mark((function t(){var r,o,a,i,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Promise.all([60,J3()]);case 3:r=t.sent,o=hg(r,2),a=o[0],i=o[1],s=Math.max(1e3/a,1e3/i,e),n(s),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(0),console.error(t.t0),n(20);case 15:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(){return t.apply(this,arguments)}}()()}),[e]),r}(C),D=dv.useRef(null),L=function(){var e,t=hg(dv.useState(null),2),r=t[0],n=t[1],o=hg(dv.useState(!1),2),a=o[0],i=o[1],s=dv.useRef(null);return dv.useEffect((function(){if(!s.current)return function(){};var e=s.current,t=function(){n(e.getBoundingClientRect()),i(!1)},r=function(){i(!0)};return e.addEventListener("transitionstart",r),e.addEventListener("transitionend",t),function(){e.removeEventListener("transitionstart",r),e.removeEventListener("transitionend",t)}}),[]),[s,null!=r?r:null===(e=s.current)||void 0===e?void 0:e.getBoundingClientRect(),a,i]}(),M=hg(L,4),F=M[0],U=M[1],j=M[2],V=M[3],z=hg(dv.useState(0),2),q=z[0],H=z[1],K=hg(dv.useState(N3.LOADING),2),W=K[0],G=K[1],Q=hg(dv.useState(""),2),X=Q[0],Y=Q[1],$=dv.useRef({frames:[],images:[],total:tg({},O3,0)}),Z=function(e){var t=e.mode,r=e.enableWriteExif,n=dv.useRef(Date.now()),o=dv.useCallback((function(){if(r){var e=Date.now();KM.preWriteExif({mode:t,startTime:n.current,endTime:e})}}),[t,r]),a=dv.useCallback((function(e,t){r&&KM.addExifData(e,t)}),[r]),i=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(n){var o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.imageData){e.next=3;break}return e.abrupt("return",null);case 3:if(r){e.next=5;break}return e.abrupt("return",o.blob);case 5:return e.next=7,KM.writeExif({mode:t,imageData:o,enableExifData:!0});case 7:return a=e.sent,e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[t,r]);return dv.useEffect((function(){r&&KM.initExifData()}),[r]),{prepareExifData:o,writeExifData:i,addExifData:a}}({mode:KM.MODE.SELFIE,enableWriteExif:m.enable}),J=Z.prepareExifData,ee=Z.writeExifData,te=Z.addExifData,re=dv.useCallback((function(){Y(B("move_face_into_frame"))}),[B]),ne=$3({onVideoPlayed:re}),oe=ne.onVideoPlayed,ae=ne.cropArea,ie=ne.isPlaying,se=function(e,t,r){var n=e.smallScale,o=e.largeScale,a=e.ovalPadding,i=t.width/t.height,s=n/o,c=n*r.height,u=o*r.height,l=a.top+a.bottom,d=a.left+a.right,f=c-l,p=u-l;if(parseFloat((p*i).toFixed(2))+d>r.width){var h=((r.width-d)/t.width).toFixed(2);return{smallScale:(h*s).toFixed(2),largeScale:h}}return{smallScale:(f/t.height).toFixed(2),largeScale:(p/t.height).toFixed(2)}}(u,m0,{width:ae.width,height:ae.height}),ce=se.smallScale,ue=se.largeScale,le=dv.useMemo((function(){return hQ((function(){$.current.frames=[],$.current.images=[],$.current.total[O3]=0,M0.resetUploadBatches(),p.enableFarStep&&(H(ce),G(N3.FAR_FACE)),Y(B("move_face_into_frame"))}),200,{leading:!0})}),[H,ce,B,p.enableFarStep]),de=function(e){var t=e.offset,r=e.ovalPadding,n=e.largeScale,o=e.ovalHeight,a=e.maskHeight,i=o/2+r.bottom;return(i+t)*n>a/2?a/2/n-i:t}({offset:u.ovalVerticalOffset,ovalPadding:u.ovalPadding,largeScale:ue,maskHeight:ae.height,ovalHeight:m0.height}),fe=dv.useCallback($m(regeneratorRuntime.mark((function e(){var n,a,i,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(G(N3.STOP_DECTECTING),Y(""),S("selfie_flash","user_activity.finish_flash"),S("selfie_flash","user_activity",(function(e){return{flash_liveness_in_ms:e.lastTimeLog-E.current}})),n=$.current.frames,h.enable&&h.framesBatchLength>0&&0!==(a=n.length%h.framesBatchLength)&&(i=n.slice(-1*a),"function"==typeof s&&s(i),r&&M0.uploadFrameBatch(t2(i),k)),c=P0(n),!p.enableFarStep){e.next=12;break}return $.current.images[0].frames=$.current.total[O3],e.next=11,$.current.images[0].blob;case 11:$.current.images[0].blob=e.sent;case 12:return $.current.images[1].frames=c[D3],e.next=15,$.current.images[1].blob;case 15:return $.current.images[1].blob=e.sent,J(),te("selfie_type",aI.Mode.FLASH),e.next=20,Promise.all([ee({imageData:$.current.images[0]}),ee({imageData:$.current.images[1]})]);case 20:if(u=e.sent,l=hg(u,2),d=l[0],f=l[1],p.enableFarStep&&($.current.images[0].blob=d),$.current.images[1].blob=f,$.current.images=$.current.images.filter((function(e){return!!e})),e.prev=27,"function"!=typeof t){e.next=31;break}return e.next=31,t({images:$.current.images,frames:$.current.frames},{colors:N,flashColor:R});case 31:e.next=36;break;case 33:e.prev=33,e.t0=e.catch(27),o({error:e.t0});case 36:case"end":return e.stop()}}),e,null,[[27,33]])}))),[S,h.enable,h.framesBatchLength,p.enableFarStep,J,te,ee,s,r,k,t,N,R,o]),pe=function(e){var t=e.colors,r=e.onFlashDone,n=e.framesPerColor,o=e.flashColor,a=hg(dv.useState(null),2),i=a[0],s=a[1],c=dv.useMemo((function(){return t.split("").reduce((function(e,t){return e+t.repeat(n)}),"")}),[t,n]),u=" "===c[i]?Y3:o,l=dv.useCallback((function(){s((function(e){return e+1}))}),[]),d=dv.useCallback((function(){s(0)}),[]);return dv.useEffect((function(){i>c.length-1&&(s(null),"function"==typeof r&&r())}),[i,c.length,r]),{colorIndex:i,currentColor:u,goToNextColor:l,startFlashing:d}}({colors:N,onFlashDone:fe,framesPerColor:T,flashColor:R}),he=pe.currentColor,me=pe.colorIndex,ge=pe.startFlashing,ve=pe.goToNextColor,ye=dv.useCallback((function(){$.current.total[O3]+=1}),[]),be=dv.useCallback((function(e,t){$.current.images[0]||($.current.images[0]={blob:CO.takePicture({canvas:t,quality:g.imageQuality}),gesture:"frontal",capture_time:Date.now(),step:O3}),H(ue),V(!0),G(N3.CLOSE_FACE),Y(B("move_face_closer"))}),[ue,V,B,g.imageQuality]),we=dv.useCallback((function(e,t){$.current.images[1]||($.current.images[1]={blob:CO.takePicture({canvas:t,quality:g.imageQuality}),gesture:"frontal",capture_time:Date.now(),step:D3}),rI.unstable_batchedUpdates((function(){G(N3.START_FLASHING),ge()}))}),[g.imageQuality,ge]),ke=null!==me&&W===N3.START_FLASHING,Ce=dv.useCallback((function(e,t,n){var o=$.current.frames,a=Z3(e,t,n,o.length);if(a.metadata={color:he,type:L3},o.push(a),h.enable&&h.framesBatchLength>0&&o.length%h.framesBatchLength==0){var i=o.slice(-1*h.framesBatchLength);"function"==typeof s&&s(i),r&&M0.uploadFrameBatch(t2(i),k)}ke&&ve()}),[r,k,h.enable,h.framesBatchLength,he,ve,ke,s]),Ee=dv.useCallback((function(e){var t=e.error;"no_face"!==t&&"multiple_faces"!==t||le()}),[le]),Se=dv.useCallback((function(e,t,n){var o=$.current.frames,a=Z3(e,t,n,o.length);if(a.metadata={color:"",type:D3},o.push(a),h.enable&&h.framesBatchLength>0&&o.length%h.framesBatchLength==0){var i=o.slice(-1*h.framesBatchLength);"function"==typeof s&&s(i),r&&M0.uploadFrameBatch(t2(i),k)}}),[r,k,h.enable,h.framesBatchLength,s]),Be=dv.useMemo((function(){return null===me?O:me%T==0?Math.max(A,O):O}),[me,A,O,T]),_e=G3({onError:o,isVideoPlaying:ie,step:W,cropArea:ae,videoRef:D,onCloseFaceDetected:we,onFarFullFaceDetected:be,onFlashingFramesCaptured:Ce,frameInterval:Be,useFaceDetectorWhenFlashing:I,onFaceError:Ee,onMovingCloseFace:Se,onFarFaceDetected:ye,faceSettings:d,ovalBoundingRect:U,isOvalTransitioning:j,maskSettings:u,closeEyesSettings:f,imageSettings:g}),xe=_e.faceError,Te=_e.warmupDone;w=D.current,dv.useEffect((function(){return function(){var e;w&&(null===(e=w.srcObject)||void 0===e||e.getTracks().forEach((function(e){e.stop()})))}}),[w]);B0((function(){p.enableFarStep?(G(N3.FAR_FACE),H(ce)):(G(N3.CLOSE_FACE),H(ue)),E.current||(E.current=performance.now())}),Te&&ie),B0((function(){return S("selfie_flash","user_activity.start")}),!0),B0((function(){return S("selfie_flash","user_activity.start_far")}),W===N3.FAR_FACE),B0((function(){return S("selfie_flash","user_activity.start_close")}),W===N3.CLOSE_FACE),B0((function(){return S("selfie_flash","user_activity.start_flash")}),W===N3.START_FLASHING);var Ae=null===me?0:Math.min(Math.round((me+1)/(N.length*T)*100),100),Ie=i.CloseCameraButton;return dv.createElement(dv.Fragment,null,dv.createElement(PG,{frontCamera:a,onVideoPlayed:oe,onClose:n,flipHorizontal:a,ref:D,onError:o,videoSettings:u2,closeButton:null!=Ie?Ie:dv.createElement(I0,{style:{position:"fixed",top:10,right:10,zIndex:1001,cursor:"pointer"}})},dv.createElement(h0,{overlay:!Te||!ie},""!==xe&&dv.createElement(a2,null),W!==N3.STOP_DECTECTING&&dv.createElement(FG,{x:"".concat(Math.round(ae.x),"px"),y:"".concat(Math.round(ae.y),"px"),width:"".concat(ae.width,"px"),height:"".concat(ae.height,"px"),surroundStyle:{background:"white"}},dv.createElement(r2,{ref:F,scale:q,debug:_,width:ae.width,height:ae.height,padding:u.ovalPadding,verticalOffset:de}),dv.createElement(c2,null,""!==xe&&W!==N3.FLASHING&&dv.createElement(l0,null,B(xe)))))),dv.createElement(s2,null,W!==N3.LOADING&&X&&dv.createElement(n2,{$flashing:W===N3.START_FLASHING},W===N3.START_FLASHING?B("hold_still"):dv.createElement(dv.Fragment,null,dv.createElement(e0,null)," ",X)),dv.createElement(T0,{onTimeout:le,timeout:p.timeout,shouldStart:Te&&ie,shouldStop:W===N3.START_FLASHING}),W===N3.START_FLASHING&&dv.createElement(i2,{value:Ae,max:100})),W===N3.START_FLASHING&&dv.createElement(o2,{$backgroundColor:he,$intensity:P}))}var d2=aw.div(X0||(X0=pg(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n\n z-index: 1001;\n"]))),f2=aw.div(Y0||(Y0=pg(["\n & > img {\n width: 100%;\n }\n\n ","\n"])),$Z),p2=aw.p($0||($0=pg(["\n color: #1d1d1d;\n font-size: 20px;\n"]))),h2=function(){var e=QN.useAsset("loader.jpg"),t=S0();return dv.createElement(d2,null,dv.createElement(f2,null,dv.createElement("img",{src:e,className:"spin",alt:"loading-icon"})),dv.createElement(p2,null,t("processing_result")))};var m2=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Array.isArray(e)?e.map((function(e,r){var n,o,a;return{name:e.step,image:{blob:e.blob,id:null!==(n=null===(o=t[r])||void 0===o||null===(a=o.data)||void 0===a?void 0:a.image_id)&&void 0!==n?n:null}}})):[]},g2=function(e){var t=QN.useAsset(e);dv.useEffect((function(){!function(e){new Promise((function(t,r){var n=new Image;n.onload=t,n.onerror=r,n.src=e}))}(t)}),[t])},v2=["apiCheck","onLivenessDetectionDone"],y2=function(e){var t,r=e.apiCheck,n=e.onLivenessDetectionDone,o=lg(e,v2),a=hg(dv.useState(!1),2),i=a[0],s=a[1],c=(t=L0(),{verifyFlashLiveness:dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(r){var n,o,a,i,s,c,u,l,d,f,p,h,m,g,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.colors,o=r.videos,a=r.images,i=r.flashSettings,s=r.frameInterval,c=r.enableFarStep,u=r.flashColor,e.prev=1,e.next=4,Promise.all(a.map((function(e){return t.uploadImage({label:"portrait",file:e})})));case 4:return l=e.sent,d=[t.verifyFaceLiveness({images:l.map((function(e){var t;return{id:null==e||null===(t=e.data)||void 0===t?void 0:t.image_id,label:"portrait"}})),videos:o,metadata:{flash_color:u,colors:n,frames_per_color:i.framesPerColor,frame_interval:s,delay_between_colors:i.delayBetweenColors,use_face_detector_when_flashing:i.useFaceDetectorWhenFlashing},selfie_type:aI.Mode.FLASH})],c&&d.push(t.requestVerifyPortrait({image:{id:null===(f=l[0])||void 0===f||null===(p=f.data)||void 0===p?void 0:p.image_id},selfie_type:aI.Mode.FLASH})),e.next=9,Promise.all(d);case 9:return h=e.sent,m=hg(h,2),g=m[0],v=m[1],e.abrupt("return",{uploadedImages:l,faceLivenessResult:g,portraitResult:v});case 16:return e.prev=16,e.t0=e.catch(1),console.error(e.t0),e.abrupt("return",{});case 20:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),[t])}).verifyFlashLiveness,u=e2(),l=u.captureFrameSettings,d=u.flashSettings,f=u.livenessSettings,p=l.framesIntervalTime,h=f.enableFarStep,m=e.onError;g2("loader.jpg");var g=function(){var e=$m(regeneratorRuntime.mark((function e(t,o){var a,i,u,f,g,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=4;break}return e.next=3,n({capturedFrames:t.frames,steps:m2(t.images)});case 3:return e.abrupt("return");case 4:if(e.prev=4,s(!0),i=null,!l.enable){e.next=13;break}return e.next=10,M0.getAllUploadedBatches();case 10:i=e.sent,e.next=14;break;case 13:i=[{frames:t2(t.frames)}];case 14:return e.next=16,c({videos:i,images:t.images.map((function(e){return e.blob})),flashSettings:d,frameInterval:p,colors:o.colors,flashColor:o.flashColor,enableFarStep:h});case 16:if(u=e.sent,f=u.uploadedImages,g=u.faceLivenessResult,v=u.portraitResult,M0.resetUploadBatches(),s(!1),!g.errors){e.next=24;break}throw g.errors;case 24:if(null==v||!v.errors){e.next=26;break}throw v.errors;case 26:return e.next=28,n({capturedFrames:t.frames,steps:m2(t.images,f),apiCheckPassed:g.data.is_live,verifyFaceLivenessResult:g.data,verifyPortraitResult:null!==(a=null==v?void 0:v.data)&&void 0!==a?a:null});case 28:e.next=35;break;case 30:e.prev=30,e.t0=e.catch(4),console.error(e.t0),s(!1),m({error:e.t0});case 35:case"end":return e.stop()}}),e,null,[[4,30]])})));return function(t,r){return e.apply(this,arguments)}}();return dv.createElement(dv.Fragment,null,dv.createElement(l2,rg({},o,{apiCheck:r,onFlashDone:g})),i&&dv.createElement(h2,null))},b2=function(e){var t=e.value,r=e.children,n=Z0(),o=GY(n,"data.settings.sdk_settings.server_log_settings.enable"),a=null!=o?o:null==t?void 0:t.enable;return dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og(og({},t),{},{enable:a})}},r)};b2.propTypes={value:Lv.shape({enable:Lv.bool,accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string}).isRequired,children:Lv.node.isRequired};var w2={instruction:{flashing:{color:"white",backgroundColor:"#E54D2E"}}},k2=function(e){var t=e.apiCheck,r=e.debug,n=e.clientSettings,o=e.apiCredentials,a=e.logCredentials;return dv.createElement(H3,{debug:r},dv.createElement(N0,{apiCredentials:o},dv.createElement(j0,{apiCheck:t,clientSettings:n},dv.createElement(R3,null,dv.createElement(rw,{theme:w2},dv.createElement(C0,null,dv.createElement(b2,{value:og({enable:!0},a)},dv.createElement(y2,e))))))))};k2.propTypes={apiCheck:Lv.bool,apiCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string}),onLivenessDetectionDone:Lv.func,onClose:Lv.func,onError:Lv.func,onFramesCaptured:Lv.func,frontCamera:Lv.bool,styledComponent:Lv.shape({CloseCameraButton:Lv.node}),clientSettings:Lv.shape({}),logCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string,userId:Lv.string,logSignature:Lv.shape({logUrl:Lv.string,timestamp:Lv.string,signature:Lv.string})})},k2.defaultProps={apiCheck:!1,apiCredentials:{},onLivenessDetectionDone:function(){},onClose:function(){},onError:function(){},onFramesCaptured:function(){},frontCamera:!0,styledComponent:{CloseCameraButton:null},clientSettings:{},logCredentials:{}};var C2=["logCredentials","clientSettings","livenessSettings","livenessComponent"];function E2(e){var t=e.logCredentials,r=void 0===t?{enable:!0}:t,n=e.clientSettings,o=e.livenessSettings,a=e.livenessComponent,i=void 0===a?w3:a,s=lg(e,C2);if(s.mode===aI.Mode.FLASH){var c=s.styledComponent,u=s.frontCamera,l=s.onFramesCaptured,d=s.onError,f=s.onClose,p=s.apiCheck,h=s.apiCredentials,m=s.onLivenessDetectionDone,g=s.debug;return dv.createElement(k2,{styledComponent:c,frontCamera:u,onFramesCaptured:l,onError:d,onClose:f,apiCheck:p,apiCredentials:h,onLivenessDetectionDone:m,logCredentials:r,clientSettings:n,debug:g})}var v=GY(n,"data.settings.sdk_settings",{});return dv.createElement(R3,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og({},r)}},dv.createElement(i,rg({},s,{livenessSettings:og(og(og({},o),null==v?void 0:v.active_liveness_settings),null==v?void 0:v.liveness_settings)}))))}var S2,B2,_2,x2={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},T2=aI.IDCardMessage,A2=aw.div(S2||(S2=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),I2=aw.div(B2||(B2=pg(["\n text-align: center;\n font-size: 1rem;\n"]))),P2=aw.button(_2||(_2=pg(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),R2=function(e){var t=e.onOk,r=e.maxSessionTime,n=hN.useSDKSettings().lang;return dv.createElement(A2,null,dv.createElement(I2,{className:"popup-message"},iY(T2.TIMEOUT_INSTRUCTION[n])({x:r})),dv.createElement(P2,{className:"popup-button",onClick:t},x2.BTN_OK[n]))};R2.propTypes={onOk:Lv.func,maxSessionTime:Lv.number},R2.defaultProps={onOk:function(){},maxSessionTime:30};var N2=function(){var e=hg(dv.useState(!1),2),t=e[0],r=e[1],n=hg(dv.useState(null),2),o=n[0],a=n[1],i=hg(dv.useState({}),2),s=i[0],c=i[1];return{showPopup:dv.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),a(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},O2="SESSION_TIMEOUT",D2="CONFIRM",L2="QR_INVALID",M2="QR_INSTRUCTIONS",F2=aI.Errors;function U2(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function j2(e,t){return Math.sqrt(U2(e,t))}function V2(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=window,o=n.cv,a=t.width,i=t.height,s=r;s<1&&(s=parseInt(.5*(i+a)*s,10));var c=o.imread(t),u=new o.Mat;return o.copyMakeBorder(c,u,s,s,s,s,o.BORDER_CONSTANT,new o.Scalar(0,0,0,255)),c.delete(),{mat:u,margin:s}}function z2(e,t){var r=window.cv,n=hg(t.map((function(e){return e.location})),4),o=n[0],a=n[1],i=n[2],s=n[3],c=j2(i,s),u=j2(a,o),l=Math.max(c,u),d=j2(a,i),f=j2(o,s),p=Math.max(d,f),h=[o.x,o.y,a.x,a.y,i.x,i.y,s.x,s.y],m=[0,0,l-1,0,l-1,p-1,0,p-1],g=r.imread(e),v=new r.Mat,y=new r.Size(l,p),b=r.matFromArray(4,1,r.CV_32FC2,h),w=r.matFromArray(4,1,r.CV_32FC2,m),k=r.getPerspectiveTransform(b,w);r.warpPerspective(g,v,k,y,r.INTER_LINEAR,r.BORDER_CONSTANT,new r.Scalar);var C=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),w.delete(),C}function q2(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},o={x:r.x-e.x,y:r.y-e.y},a=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),i=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(a*i))/Math.PI}function H2(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;t.forEach((function(e){var t=e.location,r=t.x,n=t.y;o=Math.min(o,r),a=Math.min(a,n),i=Math.max(i,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&a/n>=c&&(n-s)/n>=c&&(r-i)/r>=c}function K2(){return W2.apply(this,arguments)}function W2(){return(W2=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=t.canvas,n=t.paddingPercent,o=void 0===n?.04:n,a=r.width,i=r.height,s=Math.floor(a*o),c=Math.floor(i*o),u=a-2*s,l=i-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(r,s,c,u,l,0,0,u,l),e.abrupt("return",zD.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G2(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,a=q2(e[r].location,e[n].location,e[o].location);if(a<70||a>110)return!1}return!0}function Q2(e){return X2.apply(this,arguments)}function X2(){return(X2=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.blazefaceModel,n=t.predictedIdCardCanvas,o=t.frontSide,a=n.width,i=n.height,s=Math.floor(a/3),c=Math.floor(4*i/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(i/5),s,c,0,0,s,c),e.next=12,jO.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=hg(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4)&&!(IO.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[jO.SIZE,jO.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",F2.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",F2.id_detector_error_front_side_multiple_faces);case 20:e.next=24;break;case 22:if(!(p>0)){e.next=24;break}return e.abrupt("return",F2.id_detector_error_back_side_has_faces);case 24:return e.abrupt("return",null);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Y2=function(e){var t=GY(e,"card.corners");if(t&&Array.isArray(t)&&t.length>0){var r=GY(t,"[0].location"),n=r.x,o=r.y;return"".concat(n,":").concat(o)}return"-1:-1"},$2=function(e,t,r){e.current=[].concat(mg(e.current),[t]),e.current.length>r&&e.current.shift()},Z2=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=t.currentWorkingCanvas,u=t.refVirtualWorkingCanvas,l=t.refCountVirtualFrames,d=t.refVirtualFrames,f=t.refWorkingCanvas,(p=t.refCardResult).current.corners&&Array.isArray(p.current.corners)){e.next=3;break}return e.abrupt("return");case 3:return h=hg(p.current.corners,3),m=h[0],g=h[1],v=h[2],y=(null==g||null===(r=g.location)||void 0===r?void 0:r.x)-(null==m||null===(n=m.location)||void 0===n?void 0:n.x)-100,b=(null==v||null===(o=v.location)||void 0===o?void 0:o.y)-(null==g||null===(a=g.location)||void 0===a?void 0:a.y)-100,w=performance.now(),(k=u.current).width=y,k.height=b,(C=k.getContext("2d")).drawImage(c,(null==m||null===(i=m.location)||void 0===i?void 0:i.x)+50,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+50,y,b,0,0,y,b),e.next=14,new Promise((function(e){k.toBlob(function(){var t=$m(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,MN.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(mg(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 14:return w=Math.floor(performance.now()-w),E=180-w>0?180-w:0,e.next=18,new Promise((function(e){return setTimeout(e,E)}));case 18:if(!(l.current<3)){e.next=29;break}return _=performance.now(),x=f.current,C.drawImage(x,(null==m||null===(S=m.location)||void 0===S?void 0:S.x)+50,(null==m||null===(B=m.location)||void 0===B?void 0:B.y)+50,y,b,0,0,y,b),e.next=24,new Promise((function(e){k.toBlob(function(){var t=$m(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,MN.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(mg(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 24:if(!(l.current<2)){e.next=26;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _=Math.floor(performance.now()-_),t=180-_>0?180-_:0,e.next=4,new Promise((function(e){return setTimeout(e,t)}));case 4:case"end":return e.stop()}}),e)}))(),"t0",26);case 26:l.current+=1,e.next=18;break;case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J2=function(e,t){return!(0!==t.length&&!t.includes("vn.national_id"))||t.map((function(e){return e.replace("vn.","")})).some((function(t){var r;return(null===(r=e.split("."))||void 0===r?void 0:r.filter((function(e){return"front"!==e&&"back"!==e&&"vn"!==e}))).some((function(e){return e===t}))}))};var e1=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e};var t1=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=dQ(r))==r?r:0),void 0!==t&&(t=(t=dQ(t))==t?t:0),e1(dQ(e),t,r)},r1="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function n1(){return(n1=$m(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.url,n=void 0===r?r1:r,e.abrupt("return",new Promise((function(e,t){var r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("type","text/javascript"),r.setAttribute("id","opencvjs"),r.addEventListener("load",$m(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!window.cv||!window.cv.getBuildInformation){t.next=4;break}e(),t.next=12;break;case 4:if(!(window.cv instanceof Promise)){t.next=11;break}return t.next=7,window.cv;case 7:window.cv=t.sent,e(),t.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return t.stop()}}),t)})))),r.addEventListener("error",(function(){t()})),r.src=n;var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(r,o)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var o1=e$((function(){return n1.apply(this,arguments)})),a1={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},i1={vn:.4,ph:.5},s1={0:"top-left",1:"top-right",2:"bottom-right",3:"bottom-left",4:"cccd.front",5:"passport",6:"cmnd_old.front",7:"cmnd_old.back",8:"cmnd_new.front",9:"cmnd_new.back",10:"cccd_new.front",11:"cccd_new.back",12:"aadhaar_front",13:"aadhaar_back",14:"voter_front",15:"voter_back",16:"pan",17:"dl",18:"india_spassport",19:"aadhaar_letter",20:"pan_back",21:"passport_back",22:"unseen",23:"other",24:"BUREAU OF INTERNAL REVENUE",25:"COMMISSION ON ELECTIONS",26:"COVID VACCINATION CARD",27:"DRIVERS LICENSE",28:"HEALTH INSURANCE PHILHEALTH",29:"PAG-IBIG LOYALTY CARD",30:"PASSPORT",31:"PHILIPPINE IDENTIFICATION CARD",32:"POSTAL IDENTITY CARD",33:"PROFESSIONAL IDENTIFICATION CARD",34:"RESIDENT IDENTIFICATION CARD",35:"SOCIAL SECURITY SYSTEM",36:"UNIFIED MULTI PURPOSE ID",37:"VN_biz_license",38:"new_voter_front"};function c1(e){var t,r,n,o,a,i=e.card,s=e.corners,c=i.box,u={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},l=c[2]-c[0],d=c[1]-c[3],f=kg(s);try{for(f.s();!(a=f.n()).done;){var p=a.value;switch(p.label){case"top-left":t||(t=p.location);break;case"top-right":r||(r=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":o||(o=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![t,r,n,o].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(t.x+n.x)/2,y:(t.y+n.y)/2},m={x:(r.x+o.x)/2,y:(r.y+o.y)/2},g=U2(u,h),v=U2(u,m);return Math.sqrt(g)>(l+d)/8||Math.sqrt(v)>(l+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var u1=function(){function e(t){Zm(this,e),this.country=t||"vn",this.defaultModelUrl=a1[this.country]||a1.vn}var t,r,n,o,a,i,s;return eg(e,[{key:"load",value:(s=$m(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.opencvUrl,n=t.modelUrl,e.next=3,Promise.all([o1({url:r}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"predictDummyInput",value:(i=$m(regeneratorRuntime.mark((function e(){var t,r,n,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,n=r.tidy((function(){var e=r.zeros(o.inputShape,"float32");return o.model.predict(e)})),e.abrupt("return",Promise.all([n[this.out_score_name].data()]));case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadModel",value:(a=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,SL.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,SL.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,a=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),i=hg(a,3),this.out_score_name=i[0],this.out_class_name=i[1],this.out_box_name=i[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"loadResource",value:(o=$m(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,SL.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"dispose",value:(n=$m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.model&&this.model.dispose();case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"predict",value:(r=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x,T,A,I,P,R=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=R.length>1&&void 0!==R[1]?R[1]:{},n=r.imgMargin,o=r.detectThreshold,a=void 0===o?.3:o,i=r.maxNumReturns,s=void 0===i?100:i,c=window,u=c.cv,l={},d=t.width,f=t.height,l.originalWidth=d,l.originalHeight=f,p=V2({canvas:t,imgMargin:"number"==typeof n?n:i1[this.country]}),h=p.margin,m=p.mat,g=this.inputShape.slice(1,3),v=hg(g,2),y=v[0],b=v[1],w=new u.Mat,u.resize(m,w,new u.Size(y,b),0,0,u.INTER_AREA),k=m.cols/y,C=m.rows/b,(E=document.createElement("canvas")).width=y,E.height=b,E.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(w.data),w.cols,w.rows),0,0),m.delete(),w.delete(),l.canvas=E,l.margin=h,S=performance.now(),e.next=25,this.detect(E,{detectThreshold:a,maxNumReturns:s});case 25:if(B=e.sent,_=Math.floor(performance.now()-S),x={inputImage:l,card:null,exeTime:_},T=[[],[],[],[]],A=[],I=[],B.forEach((function(e){var t=hg(e.box,4),r=t[0],n=t[1],o=t[2],a=t[3];e.clazz<=3?T[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:t1(Math.floor((a+n)/2*k-h),0,d),y:t1(Math.floor((r+o)/2*C-h),0,f)},scaledLocation:{x:t1(Math.floor((a+n)/2),0,E.width),y:t1(Math.floor((r+o)/2),0,E.height)}}):I.push({label:e.label,score:e.score,box:[t1(Math.floor(r*C-h),0,f),t1(Math.floor(n*k-h),0,d),t1(Math.floor(o*C-h),0,f),t1(Math.floor(a*k-h),0,d)]})})),T.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),A.push(e[0]))})),!(I.length>0&&4===A.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),A.sort((function(e,t){return e.clazz-t.clazz})),P=I[0],e.prev=37,c1({card:P,corners:A})){e.next=41;break}return console.debug("Not qualified.",P,A),e.abrupt("return",x);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",x);case 46:return P.corners=A,x.card=P,e.abrupt("return",x);case 49:return e.abrupt("return",x);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return r.apply(this,arguments)})},{key:"detect",value:(t=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B=this,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.length>1&&void 0!==_[1]?_[1]:{},n=r.detectThreshold,o=r.maxNumReturns,a=window,i=a.tf,s=t.width,c=t.height,u=i.tidy((function(){var e=i.expandDims(i.cast(i.image.resizeBilinear(i.browser.fromPixels(t),B.inputShape.slice(1,3)),"float32"));return B.model.predict(e)})),e.next=7,Promise.all([u[this.out_score_name].data(),u[this.out_class_name].data(),u[this.out_box_name].array()]);case 7:l=e.sent,d=hg(l,3),f=d[0],p=d[1],h=hg(d[2],1),m=h[0],g=Math.min(f.length,o),v=[];try{for(y=0;y<g;y++)b=f[y],w=p[y],b>n&&(C=null!==(k=s1[Math.round(w)])&&void 0!==k?k:"NA",E=m[y],S=[E[0]*c,E[3]*s,E[2]*c,E[1]*s],v.push({score:b,clazz:w,box:S,label:C}))}catch(e){console.log(e)}return e.abrupt("return",v.length>=5?v:[]);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();class l1{static hasCamera(){return l1.listCameras(!1).then((e=>!!e.length)).catch((()=>!1))}static listCameras(e=!1){if(!navigator.mediaDevices)return Promise.resolve([]);let t=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((e=>t=e)).catch((()=>{})):Promise.resolve()).then((()=>navigator.mediaDevices.enumerateDevices())).then((e=>e.filter((e=>"videoinput"===e.kind)).map(((e,t)=>({id:e.deviceId,label:e.label||(0===t?"Default Camera":`Camera ${t+1}`)}))))).finally((()=>{if(t)for(const e of t.getTracks())e.stop(),t.removeTrack(e)}))}constructor(e,t,r=this._onDecodeError,n=this._calculateScanRegion,o="environment"){this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=t,this._legacyCanvasSize=l1.DEFAULT_CANVAS_SIZE,this._preferredCamera=o,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof r?(this._legacyCanvasSize=r,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=r,"number"==typeof n?(this._legacyCanvasSize=n,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=n,this._scanRegion=this._calculateScanRegion(e),this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let a=!1;e.hidden&&(e.hidden=!1,a=!0),document.body.contains(e)||(document.body.appendChild(e),a=!0),requestAnimationFrame((()=>{const t=window.getComputedStyle(e);"none"===t.display&&(e.style.setProperty("display","block","important"),a=!0),"visible"!==t.visibility&&(e.style.setProperty("visibility","visible","important"),a=!0),a&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity=0,e.style.width=0,e.style.height=0)})),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),this._qrEnginePromise=l1.createQrEngine()}hasFlash(){let e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((({stream:t})=>(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=t,t.getVideoTracks()[0])))).then((e=>"torch"in e.getSettings())).catch((()=>!1)).finally((()=>{if(e)for(const t of e.getTracks())t.stop(),e.removeTrack(t)}))}isFlashOn(){return this._flashOn}toggleFlash(){return this._flashOn?this.turnFlashOff():this.turnFlashOn()}turnFlashOn(){return this._flashOn?Promise.resolve():(this._flashOn=!0,!this._active||this._paused?Promise.resolve():this.hasFlash().then((e=>e?this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]}):Promise.reject("No flash available"))).catch((()=>{throw this._flashOn=!1,e})))}turnFlashOff(){if(this._flashOn)return this._flashOn=!1,this._restartVideoStream()}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.stop(),l1._postWorkerMessage(this._qrEnginePromise,"close")}start(){return this._active&&!this._paused?Promise.resolve():("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,document.hidden?Promise.resolve():(this._paused=!1,this.$video.srcObject?(this.$video.play(),Promise.resolve()):this._getCameraStream().then((({stream:e,facingMode:t})=>{this.$video.srcObject=e,this.$video.play(),this._setVideoMirror(t),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch((()=>{})))})).catch((e=>{throw this._active=!1,e}))))}stop(){this.pause(),this._active=!1}pause(e=!1){if(this._paused=!0,!this._active)return Promise.resolve(!0);this.$video.pause();const t=()=>{const e=this.$video.srcObject?this.$video.srcObject.getTracks():[];for(const t of e)t.stop(),this.$video.srcObject.removeTrack(t);this.$video.srcObject=null};return e?(t(),Promise.resolve(!0)):new Promise((e=>setTimeout(e,300))).then((()=>!!this._paused&&(t(),!0)))}setCamera(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}static scanImage(e,t=null,r=null,n=null,o=!1,a=!1){const i=r instanceof Worker;let s=Promise.all([r||l1.createQrEngine(),l1._loadImage(e)]).then((([e,a])=>{let s;return r=e,[n,s]=this._drawToCanvas(a,t,n,o),r instanceof Worker?(i||r.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,t)=>{let o,a,i;a=n=>{"qrResult"===n.data.type&&(r.removeEventListener("message",a),r.removeEventListener("error",i),clearTimeout(o),null!==n.data.data?e(n.data.data):t(l1.NO_QR_CODE_FOUND))},i=e=>{r.removeEventListener("message",a),r.removeEventListener("error",i),clearTimeout(o);const n=e?e.message||e:"Unknown Error";t("Scanner error: "+n)},r.addEventListener("message",a),r.addEventListener("error",i),o=setTimeout((()=>i("timeout")),1e4);const c=s.getImageData(0,0,n.width,n.height);r.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise(((e,t)=>{const o=setTimeout((()=>t("Scanner error: timeout")),1e4);r.detect(n).then((r=>{r.length?e(r[0].rawValue):t(l1.NO_QR_CODE_FOUND)})).catch((e=>t("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(o)))}))}));return t&&a&&(s=s.catch((()=>l1.scanImage(e,null,r,n,o)))),s=s.finally((()=>{i||l1._postWorkerMessage(r,"close")})),s}setGrayscaleWeights(e,t,r,n=!0){l1._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:t,blue:r,useIntegerApproximation:n})}setInversionMode(e){l1._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=l1.WORKER_PATH){return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((t=>-1!==t.indexOf("qr_code")?new BarcodeDetector({formats:["qr_code"]}):new Worker(e)))}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video)}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){const t=Math.min(e.videoWidth,e.videoHeight),r=Math.round(2/3*t);return{x:Math.round((e.videoWidth-r)/2),y:Math.round((e.videoHeight-r)/2),width:r,height:r,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_scanFrame(){if(!this._active||this.$video.paused||this.$video.ended)return!1;requestAnimationFrame((()=>{this.$video.readyState<=1?this._scanFrame():this._qrEnginePromise.then((e=>l1.scanImage(this.$video,this._scanRegion,e,this.$canvas))).then(this._onDecode,(e=>{if(!this._active)return;-1!==(e.message||e).indexOf("service unavailable")&&(this._qrEnginePromise=l1.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==l1.NO_QR_CODE_FOUND&&console.log(e)}_getCameraStream(){if(!navigator.mediaDevices)return Promise.reject("Camera not found.");const e="environment"===this._preferredCamera||"user"===this._preferredCamera?"facingMode":"deviceId",t=[{width:{min:1024}},{width:{min:768}},{}];return[...t.map((t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}}))),...t].reduceRight(((e,t)=>()=>navigator.mediaDevices.getUserMedia({video:t,audio:!1}).then((e=>({stream:e,facingMode:this._getFacingMode(e)||(t.facingMode?this._preferredCamera:"environment"===this._preferredCamera?"user":"environment")}))).catch(e)),(()=>Promise.reject("Camera not found.")))()}_restartVideoStream(){const e=this._paused;return this.pause(!0).then((t=>{if(t&&!e&&this._active)return this.start()}))}_setVideoMirror(e){const t="user"===e?-1:1;this.$video.style.transform="scaleX("+t+")"}_getFacingMode(e){const t=e.getVideoTracks()[0];return t?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}static _drawToCanvas(e,t=null,r=null,n=!1){r=r||document.createElement("canvas");const o=t&&t.x?t.x:0,a=t&&t.y?t.y:0,i=t&&t.width?t.width:e.width||e.videoWidth,s=t&&t.height?t.height:e.height||e.videoHeight;if(!n){const e=t&&t.downScaledWidth?t.downScaledWidth:i,n=t&&t.downScaledHeight?t.downScaledHeight:s;r.width!==e&&(r.width=e),r.height!==n&&(r.height=n)}const c=r.getContext("2d",{alpha:!1});return c.imageSmoothingEnabled=!1,c.drawImage(e,o,a,i,s,0,0,r.width,r.height),[r,c]}static _loadImage(e){if(e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||window.ImageBitmap&&e instanceof window.ImageBitmap||window.OffscreenCanvas&&e instanceof window.OffscreenCanvas)return Promise.resolve(e);if(e instanceof Image)return l1._awaitImageLoad(e).then((()=>e));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){const t=new Image;return e instanceof File||e instanceof Blob?t.src=URL.createObjectURL(e):t.src=e,l1._awaitImageLoad(t).then((()=>((e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(t.src),t)))}return Promise.reject("Unsupported image type.")}static _awaitImageLoad(e){return new Promise(((t,r)=>{if(e.complete&&0!==e.naturalWidth)t();else{let n,o;n=()=>{e.removeEventListener("load",n),e.removeEventListener("error",o),t()},o=()=>{e.removeEventListener("load",n),e.removeEventListener("error",o),r("Image load error")},e.addEventListener("load",n),e.addEventListener("error",o)}}))}static _postWorkerMessage(e,t,r){return Promise.resolve(e).then((e=>{e instanceof Worker&&e.postMessage({type:t,data:r})}))}}function d1(){return f1.apply(this,arguments)}function f1(){return(f1=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l1.WORKER_PATH=YM(),e.next=3,l1.createQrEngine(l1.WORKER_PATH);case 3:return t=e.sent,e.abrupt("return",{qrEngine:t});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p1(){return h1.apply(this,arguments)}function h1(){return(h1=$m(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([d1()]);case 2:return t=e.sent,r=hg(t,1),n=r[0].qrEngine,e.abrupt("return",{qrScannerResources:{engine:n,canvas:document.createElement("canvas")},noModel:!0});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}l1.DEFAULT_CANVAS_SIZE=400,l1.NO_QR_CODE_FOUND="No QR code found",l1.WORKER_PATH="qr-scanner-worker.min.js";var m1="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function g1(){return(g1=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=$m(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="detect.prototxt",r="detect.caffemodel",n="sr.prototxt",i="sr.caffemodel",o){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return u=[a(t),a(r),a(n),a(i)],e.next=11,Promise.all(u);case 11:l=e.sent,d=hg(l,4),f=d[0],p=d[1],h=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",p,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",h,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),o=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?m1:r,a=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(t));case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:return o=e.sent,e.abrupt("return",new Uint8Array(o));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,i();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",p1());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var v1=e$((function(){return g1.apply(this,arguments)}));function y1(e){return b1.apply(this,arguments)}function b1(){return(b1=$m(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,e.abrupt("return",new Promise((function(e,t){setTimeout(t,900),r.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w1(e){return k1.apply(this,arguments)}function k1(){return(k1=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,n=!0,e.prev=2,o=performance.now(),e.next=6,y1({idCardModel:r});case 6:(a=performance.now())-o+.6*(a-o)>900&&(n=!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n=!1;case 13:return e.abrupt("return",{fastEnough:n});case 14:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function C1(){return(C1=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,a=t.tfScriptUrls,i=t.wechatQRModelsUrl,s=h.length>1?h[1]:void 0,e.next=4,o$({blazefaceModelUrl:o,tfScriptUrls:a});case 4:return c=e.sent,u=c.blazefaceModel,l=!0,d=new u1(s),e.prev=8,e.next=11,d.load({opencvUrl:r,modelUrl:n});case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(8),e.abrupt("return",{ableToUseModel:!1});case 16:return e.next=18,v1({modelUrl:i});case 18:return e.prev=18,e.next=21,w1({idCardModel:d});case 21:f=e.sent,p=f.fastEnough,l=p,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),l=!1;case 29:return e.abrupt("return",{ableToUseModel:l,idCardModel:d,blazefaceModel:u});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var E1=e$((function(){return C1.apply(this,arguments)})),S1=aI.Errors;function B1(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=dv.useRef(null);null===a.current&&(a.current=document.createElement("canvas"));var i=dv.useRef(!1),s=dv.useRef(FD.createResizer({width:960,height:640})),c=dv.useRef(null),u=dv.useRef([{id:null,frames:[]}]),l=dv.useCallback((function(){!0===i.current&&(i.current=!1)}),[]),d=dv.useCallback((function(){u.current=[{id:null,frames:[]}]}),[]),f=dv.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),p=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,a,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,a=u.current,i=n.resize({srcCanvas:r}),c=i.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=dv.useCallback($m(regeneratorRuntime.mark((function e(){var r,n,s,u,l,d,f,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:if(r=o.frameCaptureIntervalMs,n=void 0===r?180:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:s=c.current,u=t.current,i.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=a.current).width=f,m.height=h,g=m.getContext("2d");case 13:return v=performance.now(),g.drawImage(u,l,d,f,h,0,0,f,h),e.next=18,p({workingCanvas:m});case 18:if(v=Math.floor(performance.now()-v),i.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,YN.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return dv.useEffect((function(){var e=t.current;function o(){return(o=$m(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=CO.analyzeVideoAndWindowSizes(e,n),t.next=3,h();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return r&&n&&function(){o.apply(this,arguments)}(),function(){l()}}),[r,n,t,l,f,h]),{refWorkingCanvas:a,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var _1=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,a=e.settings,i=e.shouldStartTimers,s=e.sessionTime,c=dv.useRef(),u=hg(dv.useState(0),2),l=u[0],d=u[1],f=dv.useCallback((function(){clearInterval(c.current)}),[]),p=dv.useCallback((function(){d((function(e){return e+1}))}),[]);return dv.useEffect((function(){if(i){var e=a.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var a=s-(t+=1);a<=u&&r&&r({curTimeLeft:a}),t>0&&t%e==0&&o&&o(),0===a&&(f(),n&&n())}),1e3)}return function(){f()}}),[i,t,r,f,n,o,l,a,s]),{stopTimers:f,startTimers:p}};KM.initExifData();var x1,T1,A1,I1=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onModelErrorChange,i=e.frontSide,s=e.cardList,c=e.onDebugInfoChange,u=e.onAboutToTimeout,l=e.onSessionTimeout,d=e.onCaptureDone,f=e.outputEncryptionSettings,p=e.quality,h=dv.useRef(!1),m=hg(dv.useState(!1),2),g=m[0],v=m[1],y=dv.useRef((function(){})),b=KN.useSDKTracking().sendEvent,w=dv.useRef(),k=dv.useRef(),C=dv.useRef(),E=hN.useSDKSettings(),S=E.debug,B=E.lang,_=E.enableAntiDebug,x=XM(),T=x.startMotion,A=x.stopMotion,I=x.motionData,P=x.orientationData;dv.useEffect((function(){_&&BL.enableAntiDebug()}),[_]);var R=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b({tag:i?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,y.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[b,i]),N=dv.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(void 0,t);var n=GY(t,"0.code");n&&n!==w.current&&(b({tag:i?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),w.current=n)}),[a,i,b]),O=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.cardList,i=e.onError,s=e.frontSide,c=e.onAutoCaptureSuccess,u=e.quality,l=dv.useRef(null);null===l.current&&(l.current=document.createElement("canvas"));var d=dv.useRef(0),f=dv.useRef([]),p=dv.useRef(null);null===p.current&&(p.current=document.createElement("canvas"));var h=dv.useRef({}),m=dv.useRef([]),g=dv.useRef(""),v=dv.useRef(!1),y=dv.useRef(null),b=hg(dv.useState(!1),2),w=b[0],k=b[1],C=dv.useRef({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),E=dv.useRef({imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}),S=dv.useRef(!1),B=dv.useRef(!1),_=dv.useRef(null),x=dv.useRef(!1),T=dv.useRef({}),A=hN.useSDKSettings(),I=A.customUrls,P=A.country;dv.useEffect((function(){var e=!1;function t(){return(t=$m(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||w){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,E1(I,P);case 4:return T.current=t.sent,t.next=7,SL.initTensorFlow();case 7:_.current=o.enableBlurCheck&&T.current.ableToUseModel,t.next=11;break;case 10:_.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:k(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[w,o,I,P]);var R=dv.useCallback((function(e){return Z2({currentWorkingCanvas:e,refVirtualWorkingCanvas:p,refCountVirtualFrames:d,refVirtualFrames:f,refWorkingCanvas:l,refCardResult:h})}),[]),N=dv.useCallback((function(){!0===v.current&&(v.current=!1)}),[]),O=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,a=o.blurThreshold,i=C.current,s=E.current,!(r<a&&wO.hasBetterCardBlurScore(r,i.blurScore))){e.next=17;break}if(!x.current){e.next=9;break}i.imageBlob=s.imageBlob,e.next=13;break;case 9:return e.next=11,CO.takePicture({canvas:l.current,quality:u});case 11:i.imageBlob=e.sent,i.captureTime=Date.now();case 13:i.takenAt=(new Date).getTime(),i.blurScore=r,i.detectedCard=n,i.captureType="auto";case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,u]),D=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,B.current=!0,o=E.current,!wO.hasBetterCardBlurScore(r,o.blurScore)){e.next=14;break}return e.next=6,CO.takePicture({canvas:l.current,quality:u});case 6:o.imageBlob=e.sent,o.captureDuration+=Date.now()-o.captureTime,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,o.captureCount++,o.captureType="manual",x.current=!0;case 14:B.current=!1;case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u]),L=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.waitForBestImageTimeMs,r=o.enableVirtualCamHashes,null===(n=C.current).imageBlob){e.next=11;break}if(!((new Date).getTime()-n.takenAt>t)){e.next=11;break}if(!r){e.next=8;break}return e.next=8,R(l.current);case 8:return e.next=10,c(n);case 10:N();case 11:case"end":return e.stop()}}),e)}))),[c,o,N,R]),M=dv.useCallback((function(){S.current=!0}),[]),F=dv.useCallback((function(){return new Promise((function(e){S.current=!1;var t=setInterval((function(){B.current||(clearInterval(t),e())}),150)}))}),[]),U=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t=o.blurThreshold,r=o.enableVirtualCamHashes,n=E.current;n.captureTime=Date.now(),_.current?(M(),setTimeout((function(){F().then($m(regeneratorRuntime.mark((function o(){var a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(wO.hasBetterCardBlurScore(n.blurScore,t)||(n.error=S1.id_detector_error_blur),a=l.current,null!==n.imageBlob){o.next=6;break}CO.takePicture({canvas:a,quality:u}).then(function(){var t=$m(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),!r){t.next=5;break}return t.next=5,R(a);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.next=10;break;case 6:if(!r){o.next=9;break}return o.next=9,R(a);case 9:e(n);case 10:case"end":return o.stop()}}),o)}))))}),2e3)):CO.takePicture({canvas:l.current,quality:u}).then(function(){var t=$m(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),!r){t.next=5;break}return t.next=5,R(l.current);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),[o,M,F,u,R]),j=dv.useCallback($m(regeneratorRuntime.mark((function e(){var r,n,c,u,p,b,k,B,_,A,I,R,N,M,F,U,j,V,z,q,H;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&w&&!v.current){e.next=2;break}return e.abrupt("return");case 2:C.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},E.current={imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0},r=o.enableAutoCapture,n=o.enableBlurCheck,c=o.enableIdDetection,u=o.country,p=T.current,b=p.idCardModel,k=p.blazefaceModel,B=p.ableToUseModel,_=y.current,A=t.current,v.current=!0,I=_.cropX,R=_.cropY,N=_.cropWidth,M=_.cropHeight,F=_.cropWidthWithoutPadding,U=_.cropHeightWithoutPadding,(j=l.current).width=N,j.height=M,V=j.getContext("2d"),z=document.createElement("canvas"),q=z.getContext("2d"),H=function(){var e=$m(regeneratorRuntime.mark((function e(){var t,l,p,y,w,_,T,K;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(V.drawImage(A,I,R,N,M,0,0,N,M),t=performance.now(),x.current=!1,!c||!B){e.next=68;break}return l=null,e.next=7,b.predict(j,{detectThreshold:.3});case 7:if(p=e.sent,null==o||!o.trackCardCoordinates||E.current.imageBlob||C.current.imageBlob||$2(m,Y2(p),null==o?void 0:o.trackCardCoordinatesMaxLength),!p.card){e.next=64;break}if(h.current=p.card,!E.current.imageBlob&&f.current.length>0&&(f.current=[],d.current=0),!H2({corners:p.card.corners,width:N,height:M})){e.next=61;break}if(!G2(p.card.corners)){e.next=58;break}if(y=z2(j,p.card.corners),w=IO.rectAreaRatio({small:{area:y.width*y.height},big:{area:F*U}}),!GY(o,"enableCardTypeCheck")||"vn"!==u){e.next=25;break}_=GY(p,"card.label",""),g.current=_,J2(_,a)||(l=S1.not_allowed_card_types),e.next=56;break;case 25:if(!(w<.5)){e.next=29;break}l=S1.id_detector_card_too_small,e.next=56;break;case 29:if(!(w>.95)){e.next=33;break}l=S1.id_detector_error_incomplete,e.next=56;break;case 33:return z.width=y.width,z.height=y.height,q.putImageData(y,0,0),e.next=38,K2({canvas:z});case 38:if(!e.sent){e.next=43;break}l=S1.glare_detected,e.next=56;break;case 43:if("ph"===P){e.next=47;break}return e.next=46,Q2({blazefaceModel:k,predictedIdCardCanvas:z,frontSide:s});case 46:l=e.sent;case 47:if(l){e.next=56;break}if(!n){e.next=56;break}if(T=wO.calculateIdCardBlurScore({canvas:z}),!S.current){e.next=53;break}return e.next=53,D({blurScore:T,detectedCard:p.card});case 53:if(!r){e.next=56;break}return e.next=56,O({blurScore:T,detectedCard:p.card});case 56:e.next=59;break;case 58:l=S1.id_detector_validate_angle_error;case 59:e.next=62;break;case 61:l=S1.id_detector_error_incomplete;case 62:e.next=65;break;case 64:l=S1.id_detector_no_cards;case 65:return i(l),e.next=68,L();case 68:return t=Math.floor(performance.now()-t),K=180-t>0?180-t:0,e.next=72,new Promise((function(e){return setTimeout(e,K)}));case 72:v.current&&window.requestAnimationFrame(H);case 73:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(H);case 19:case"end":return e.stop()}}),e)}))),[o,w,t,i,L,s,a,D,O,P]);dv.useEffect((function(){var e=t.current;function o(){return(o=$m(regeneratorRuntime.mark((function t(){var r,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(y.current=CO.analyzeVideoAndWindowSizes(e,n,.05),r=y.current,o=r.cropWidth,a=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(a)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,j();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&w&&function(){o.apply(this,arguments)}()}),[r,n,t,N,j,w]);var V=dv.useCallback((function(){N()}),[N]);return dv.useEffect((function(){return V}),[V]),{refWorkingCanvas:l,refCardLabel:g,stopCheckFrame:N,checkFrame:j,warmupDone:w,takePictureManually:U,refAbleToRunBurstMode:_,refVirtualFrames:f,refCardCoordinates:m}}({refVideo:r,shouldStart:t,cropArea:n,cardList:s,settings:o,onError:N,frontSide:i,onAutoCaptureSuccess:R,quality:p}),D=O.refWorkingCanvas,L=O.refCardLabel,M=O.stopCheckFrame,F=O.checkFrame,U=O.warmupDone,j=O.takePictureManually,V=O.refAbleToRunBurstMode,z=O.refVirtualFrames,q=O.refCardCoordinates,H=B1({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),K=H.stopCheckFrame,W=H.splitVideos,G=H.resetRecordedVideos,Q=H.checkFrame;!function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,a=e.onChange;dv.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,i=n.current,s=t[t.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==i?void 0:i.width,"canvas.height":null==i?void 0:i.height};a&&a(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[a,t,r,n,o])}({debug:S,refRecordedVideos:H.refRecordedVideos,refWorkingCanvas:D,refVideo:r,onChange:c});var X=dv.useCallback((function(){K(),M(),G(),l()}),[G,K,M,l]),Y=dv.useCallback((function(){W()}),[W]),$=_1({lang:B,onAboutToTimeout:u,onSessionTimeout:X,onVideoTimeLimitReached:Y,settings:o,shouldStartTimers:U&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),Z=$.stopTimers,J=$.startTimers,ee=dv.useCallback((function(){h.current=!1}),[]),te=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee(),J(),e.next=4,Promise.all([Q(),F()]);case 4:case"end":return e.stop()}}),e)}))),[ee,J,Q,F]),re=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t,r,n,a,s,c,u,l,p,m,g,y,w,E,S,B,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_.length>0&&void 0!==_[0]?_[0]:{},r=t.imageBlob,n=t.error,a=t.detectedCard,s=t.captureTime,c=t.captureCount,u=t.captureDuration,l=t.captureType,!h.current){e.next=3;break}return e.abrupt("return");case 3:return h.current=!0,v(!0),K(),M(),Z(),N(null),p=null==o?void 0:o.enableVirtualCamHashes,m={},p&&(g=z).current.length>0&&(m=g.current.reduce((function(e,t,r){return og(og({},e),{},tg({},"hash".concat(r+1),t))}),m)),y=null==o?void 0:o.trackCardCoordinates,w="[".concat(q.current.toString(),"]"),A(),KM.preWriteExif({mode:KM.MODE.ID_CARD,motionData:I,orientationData:P,startTime:k.current,endTime:Date.now()}),e.next=18,KM.writeExif({mode:KM.MODE.ID_CARD,imageData:og(og({detectedCard:a,captureTime:s,blob:r},p?{vCam:m}:{}),{},{captureCount:c,captureDuration:u,captureType:l},y?{cardTracking:w}:{}),enableExifData:null==o?void 0:o.enableExifData});case 18:if(E=e.sent,!f||!f.key){e.next=24;break}return B=f.key,e.next=23,TL.encrypt({blob:E,key:B});case 23:S=e.sent;case 24:d({image:{blob:E,encrypted:S,detectedCard:a},error:n,recordedVideos:[]}),v(!1),b({tag:i?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-C.current)/1e3}});case 27:case"end":return e.stop()}}),e)}))),[K,M,Z,N,d,i,b,f,I,P,A,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,null==o?void 0:o.trackCardCoordinates,z,q]);y.current=re;var ne=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),Z(),K(),V.current||M(),e.next=6,j();case 6:return t=e.sent,e.next=9,re(t);case 9:v(!1),b({tag:i?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[j,re,Z,V,K,M,b,i]);return dv.useEffect((function(){t&&(b({tag:i?"id_front":"id_back",event:"user_activity.start",log:{}}),k.current=Date.now(),T())}),[b,i,t,T]),dv.useEffect((function(){U&&(b({tag:i?"id_front":"id_back",event:"user_activity.show",log:{}}),b({tag:i?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-k.current}}),C.current=performance.now())}),[b,i,U]),{refCardLabel:L,warmupDone:U,isProcessing:g,takePictureManually:ne,restartSession:te,resetIsProcessingImageBlobTaken:ee}},P1=aI.IDCardMessage,R1=dv.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,a=e.refVideo,i=e.frontSide,s=e.cardList,c=e.settings,u=e.onCaptureDone,l=e.onUISpacingChange,d=e.outputEncryptionSettings,f=hg(dv.useState({}),2),p=f[0],h=f[1],m=p.yDescription,g=p.yMessage,v=p.yCaptureButton,y=QN.useAsset("ic_camera.svg"),b=QN.useAsset("ic_loading.png"),w=hg(dv.useState(""),2),k=w[0],C=w[1],E=hN.useSDKSettings(),S=E.debug,B=E.lang,_=hg(dv.useState(null),2),x=_[0],T=_[1],A=hg(dv.useState(""),2),I=A[0],P=A[1],R=hg(dv.useState(null),2),N=R[0],O=R[1],D=N2(),L=D.showPopup,M=D.popupShown,F=D.popupType,U=dv.useCallback((function(e){P(null===e?"":iY(e.msg[B])({side:i?x2.FRONT[B]:x2.BACK[B]}))}),[B,i]),j=dv.useCallback((function(){T(""),L({popupType:O2})}),[L]),V=dv.useCallback((function(){T(""),u.apply(void 0,arguments)}),[u]),z=dv.useCallback((function(e){var t=e.curTimeLeft;T(iY(P1.REMAINING_TIME[B])({x:t}))}),[B]),q=I1({shouldStart:!0,refVideo:a,cropArea:N,settings:c,onModelErrorChange:U,frontSide:i,cardList:s,onDebugInfoChange:C,onSessionTimeout:j,onCaptureDone:V,onAboutToTimeout:z,outputEncryptionSettings:d}),H=q.refCardLabel,K=q.warmupDone,W=q.isProcessing,G=q.takePictureManually,Q=q.restartSession,X=q.resetIsProcessingImageBlobTaken,Y=dv.useCallback((function(){L({popupType:null}),X()}),[L,X]),$=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Y(),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q,Y]);dv.useEffect((function(){if(o){var e,t,r,a,i,s,c,u=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,p=o.lostY,m=o.clientHeight;n?(i=.7*(s=d-165),r=(c=(e=p+10)+45)+20,a=(t=c+s+10)+60):(i=WW.isMobile?u-6:Math.floor(.7*u),r=(c=(e=p+10)+50)+20,a=(t=c+(s=Math.floor(Math.min(i/1.5,m-2*p-80-100)))+10)+60);var g=Math.floor((u-i)/2)+f;O({x:g,y:c,width:i,height:s,surroundStyle:{opacity:.6,background:"#000"}});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:a};h(v),l(v)}}),[o,n,l]);var Z=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(""),e.next=3,G();case 3:case"end":return e.stop()}}),e)}))),[G]);return dv.useImperativeHandle(t,(function(){return{restartSession:$}}),[$]),dv.createElement(dv.Fragment,null,!K&&dv.createElement(gZ,null),S&&dv.createElement(WJ,null,k),W&&dv.createElement(VJ,null,dv.createElement("img",{src:b,alt:"",className:"spin"})),N&&dv.createElement(FG,{x:"".concat(N.x,"px"),y:"".concat(N.y,"px"),width:"".concat(N.width,"px"),height:"".concat(N.height,"px"),surroundStyle:N.surroundStyle},dv.createElement(YJ,{width:N.width,height:N.height,type:I?eJ:JZ})),!I&&dv.createElement(GJ,{y:"".concat(m,"px"),className:"description"},r),dv.createElement("div",{style:{position:"fixed",bottom:0,left:0,color:"#fff",padding:30}},H.current),I&&dv.createElement(QJ,{y:"".concat(m,"px")},I),!W&&(!(null!=c&&c.disableCaptureButtonIfAlert)||!I)&&dv.createElement(jJ,{onClick:Z,y:"".concat(v,"px")},dv.createElement("img",{src:y,alt:""})),x&&dv.createElement(XJ,{key:x,className:"message",y:"".concat(g,"px")},x),dv.createElement(pZ,{open:M},F===O2&&dv.createElement(R2,{onOk:$,maxSessionTime:null==c?void 0:c.idCardSessionTime})))}));R1.propTypes={usePortraitMask:Lv.bool,description:Lv.string,windowAndVideoInfo:Lv.shape({}),refVideo:Lv.shape({}),frontSide:Lv.bool,cardList:Lv.bool,settings:Lv.shape({}),onCaptureDone:Lv.func,onUISpacingChange:Lv.func,outputEncryptionSettings:Lv.shape({})},R1.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,cardList:[],settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var N1,O1,D1=aw.div(x1||(x1=pg(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: 8px;\n top: ",";\n position: absolute;\n z-index: ",";\n color: #fff;\n padding: 10px;\n margin: 0 10px;\n max-width: 275px;\n text-align: center;\n"])),(function(e){return e.background}),(function(e){return e.y}),1020),L1=aw.div(T1||(T1=pg(["\n width: 0;\n height: 0;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n border-bottom: ",";\n position: absolute;\n left: 50%;\n top: ",";\n transform: translateX(-50%);\n"])),(function(e){return"".concat(e.arrowSize,"px solid ").concat(e.color)}),(function(e){return"".concat(e.top,"px")})),M1=function(e){var t=e.children,r=e.y;return dv.createElement(D1,{y:r,background:"#00ce78"},dv.createElement(L1,{arrowSize:10,top:-10,color:"#00ce78"}),t)},F1=aw.div(A1||(A1=pg(["\n text-align: center;\n position: absolute;\n font-size: 18px;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),U1={QR_INSTRUCTIONS_TEXT:{en:dv.createElement("span",null,"Please follow the instructions below to scan QR code:",dv.createElement("br",null),dv.createElement("br",null)," Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),vi:dv.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên CCCD. Canh vừa mã QR vào 4 góc khung hình để quét mã")},QR_INSTRUCTIONS_START_BUTTON:{en:"Scan QR code",vi:"Tiến hành quét mã QR"},QR_INSTRUCTIONS_COUNTDOWN:{en:"Start in <%= x %> s",vi:"Bắt đầu trong <%= x %> giây"},QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR"},REMAINING_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"},SESSION_TIMEOUT_POPUP_DESCRIPTION:{en:dv.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",dv.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn."),vi:dv.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",dv.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn.")},SESSION_TIMEOUT_POPUP_RETRY_BUTTON:{en:"Retry",vi:"Thực hiện lại"},SESSION_TIMEOUT_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"}},j1=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,a=e.mr,i=e.mx,s=e.my,c=e.pt,u=e.pb,l=e.pl,d=e.pr,f=e.px,p=e.py,h=t.props.style||{},m={};return null!==i&&(m.marginLeft=i,m.marginRight=i),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==a&&(m.marginRight=a),null!==f&&(m.paddingLeft=f,m.paddingRight=f),null!==p&&(m.paddingTop=p,m.paddingBottom=p),null!==c&&(m.paddingTop=c),null!==u&&(m.paddingBottom=u),null!==l&&(m.paddingLeft=l),null!==d&&(m.paddingRight=d),dv.cloneElement(t,{style:og(og({},h),m)})};j1.propTypes={mt:Lv.string,ml:Lv.string,mr:Lv.string,mb:Lv.string,mx:Lv.string,my:Lv.string,pt:Lv.string,pl:Lv.string,pr:Lv.string,pb:Lv.string,px:Lv.string,py:Lv.string},j1.defaultProps={mt:null,ml:null,mr:null,mb:null,mx:null,my:null,pt:null,pl:null,pr:null,pb:null,px:null,py:null};var V1,z1,q1,H1=aw.button(N1||(N1=pg(["\n width: 100%;\n max-width: 294px;\n height: 66px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 3px;\n color: #fff;\n font-weight: normal;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),K1=aw.a(O1||(O1=pg(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),W1=aw.div(V1||(V1=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),G1=aw.div(z1||(z1=pg(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),Q1=aw.div(q1||(q1=pg(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),X1=function(e){var t=e.onRetry,r=e.onSkip,n=hN.useSDKSettings().lang;return dv.createElement(W1,null,dv.createElement(j1,{mt:"25px"},dv.createElement(G1,null,U1.QR_INVALID_POPUP_TITLE[n])),dv.createElement(j1,{mt:"30px"},dv.createElement(Q1,null,U1.QR_INVALID_POPUP_DESCRIPTION[n])),dv.createElement(j1,{mt:"30px"},dv.createElement(H1,{onClick:t},U1.QR_INVALID_POPUP_RETRY_BUTTON[n])),dv.createElement(j1,{my:"20px"},dv.createElement(K1,{onClick:r},U1.QR_INVALID_POPUP_SKIP_BUTTON[n])))};X1.propTypes={onRetry:Lv.func,onSkip:Lv.func},X1.defaultProps={onRetry:function(){},onSkip:function(){}};var Y1,$1,Z1,J1,e5,t5,r5,n5=["children","ratio","padding"],o5=aw.div(Y1||(Y1=pg(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),a5=aw.div($1||($1=pg(["\n position: absolute;\n top: ",";\n left: ",";\n right: ",";\n bottom: ",";\n"])),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding})),i5=function(e){var t=e.children,r=e.ratio,n=e.padding,o=lg(e,n5);return dv.createElement(o5,rg({ratio:r},o),dv.createElement(a5,{padding:n},t))};i5.propTypes={children:Lv.node,ratio:Lv.number,padding:Lv.string},i5.defaultProps={children:null,ratio:4/3,padding:"0"};var s5=aw.div(Z1||(Z1=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),c5=aw.div(J1||(J1=pg(["\n background: #e7e6e6;\n width: 100%;\n"]))),u5=aw.img(e5||(e5=pg(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),l5=aw.div(t5||(t5=pg(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n line-height: 20px;\n"])),(function(e){return e.theme.tsSecondary})),d5=aw(l5)(r5||(r5=pg(["\n white-space: nowrap;\n"]))),f5=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=hN.useSDKSettings().lang,a=QN.useAsset("qr_code_banner.png"),i=dv.useRef(n),s=hg(dv.useState((function(){return iY(U1.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),c=s[0],u=s[1],l=KN.useSDKTracking().sendEvent,d=dv.useRef(!1);dv.useEffect((function(){l({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[l]),dv.useEffect((function(){var e=iY(U1.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){i.current--,u(e({x:i.current})),i.current<=0&&(clearInterval(t),d.current||l({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),r&&r())}),1e3);return function(){clearInterval(t)}}),[o,r]);return dv.createElement(s5,null,dv.createElement(c5,null,dv.createElement(i5,{ratio:1.6},dv.createElement(u5,{src:a}))),dv.createElement(j1,{mt:"30px"},dv.createElement(l5,null,U1.QR_INSTRUCTIONS_TEXT[o])),dv.createElement(j1,{mt:"30px"},dv.createElement(H1,{onClick:function(){l({tag:"id_qr",event:"user_activity.click_start",log:{}}),d.current=!0,t()}},U1.QR_INSTRUCTIONS_START_BUTTON[o])),dv.createElement(j1,{my:"20px"},dv.createElement(d5,null,c)))};f5.propTypes={onClickStart:Lv.func,onTimeout:Lv.func,timeout:Lv.number},f5.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var p5=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function h5(e){var t=e.canvas,r=e.qrModel,n=window.cv,o=n.imread(t,n.IMREAD_GRAYSCALE);return r.detectAndDecode(o).get(0)}var m5=function(){var e=$m(regeneratorRuntime.mark((function e(t,r){var n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v1();case 2:if(n=e.sent,o=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return a=document.createElement("canvas"),i=a.getContext("2d"),e.next=11,new Promise((function(e){var r=URL.createObjectURL(t),n=new Image;n.onload=function(){var t=n.width,o=n.height;a.width=t/2,a.height=o/2,i.drawImage(n,t/2,0,a.width,a.height,0,0,a.width,a.height),URL.revokeObjectURL(r),e()},n.src=r}));case 11:return e.next=13,h5({canvas:a,qrModel:o});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,KM.writeExif({mode:"",imageData:{blob:t,result:s,type:"qr_from_front_image"},enableExifData:!0});case 18:if(c=e.sent,!r||!r.key){e.next=24;break}return l=r.key,e.next=23,TL.encrypt({imageBlobWithExif:c,key:l});case 23:u=e.sent;case 24:return e.abrupt("return",{result:s,validateResult:{valid:!0},image:{blob:c,encrypted:u},recordedVideos:[]});case 25:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),g5=r(n((function(e,t){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height||!this.data[t*this.width+e])},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,o){for(var a=t;a<t+n;a++)for(var i=e;i<e+r;i++)this.set(i,a,!!o)},e}();t.BitMatrix=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.addOrSubtractGF=function(e,t){return e^t};var o=function(){function e(e,t,r){this.primitive=e,this.size=t,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var o=1,a=0;a<this.size;a++)this.expTable[a]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,t){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===t)return this.zero;var r=new Uint8ClampedArray(e+1);return r[0]=t,new n.default(this,r)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=function(){function e(e,t){if(0===t.length)throw new Error("No coefficients.");this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;if(n===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-n);for(var o=0;o<this.coefficients.length;o++)this.coefficients[o]=t[n+o]}}else this.coefficients=t}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(t){var r;if(this.isZero())return t;if(t.isZero())return this;var o=this.coefficients,a=t.coefficients;o.length>a.length&&(o=(r=[a,o])[0],a=r[1]);for(var i=new Uint8ClampedArray(a.length),s=a.length-o.length,c=0;c<s;c++)i[c]=a[c];for(c=s;c<a.length;c++)i[c]=n.addOrSubtractGF(o[c-s],a[c]);return new e(this.field,i)},e.prototype.multiply=function(t){if(0===t)return this.field.zero;if(1===t)return this;for(var r=this.coefficients.length,n=new Uint8ClampedArray(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,n)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var r=this.coefficients,o=r.length,a=t.coefficients,i=a.length,s=new Uint8ClampedArray(o+i-1),c=0;c<o;c++)for(var u=r[c],l=0;l<i;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,a[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new Error("Invalid degree less than 0");if(0===r)return this.field.zero;for(var n=this.coefficients.length,o=new Uint8ClampedArray(n+t),a=0;a<n;a++)o[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,o)},e.prototype.evaluateAt=function(e){var t=0;if(0===e)return this.getCoefficient(0);var r=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){t=n.addOrSubtractGF(t,e)})),t;t=this.coefficients[0];for(var o=1;o<r;o++)t=n.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[o]);return t},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(5),a=r(11),i=r(12);function s(e){var t=i.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=a.extract(e,s),u=o.decode(c.matrix);if(u)return{binaryData:u.bytes,data:u.text,chunks:u.chunks,version:u.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:"attemptBoth"};function u(e,t,r,o){void 0===o&&(o={});var a=c;Object.keys(a||{}).forEach((function(e){a[e]=o[e]||a[e]}));var i="attemptBoth"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,u="onlyInvert"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,l=n.binarize(e,t,r,i),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==a.inversionAttempts&&"invertFirst"!==a.inversionAttempts||(p=s(u?d:f)),p}u.default=u,t.default=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r){return e<t?t:e>r?r:e}var a=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,i){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new a(t,r),c=0;c<t;c++)for(var u=0;u<r;u++){var l=e[4*(u*t+c)+0],d=e[4*(u*t+c)+1],f=e[4*(u*t+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(t/8),h=Math.ceil(r/8),m=new a(p,h),g=0;g<h;g++)for(var v=0;v<p;v++){var y=0,b=1/0,w=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var k=s.get(8*v+c,8*g+u);y+=k,b=Math.min(b,k),w=Math.max(w,k)}var C=y/Math.pow(8,2);if(w-b<=24&&(C=b/2,g>0&&v>0)){var E=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<E&&(C=E)}m.set(v,g,C)}var S=n.BitMatrix.createEmpty(t,r),B=null;for(i&&(B=n.BitMatrix.createEmpty(t,r)),g=0;g<h;g++)for(v=0;v<p;v++){for(var _=o(v,2,p-3),x=o(g,2,h-3),T=(y=0,-2);T<=2;T++)for(var A=-2;A<=2;A++)y+=m.get(_+T,x+A);var I=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var P=s.get(c,u);S.set(c,u,P<=I),i&&B.set(c,u,!(P<=I))}}return i?{binarized:S,inverted:B}:{binarized:S}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),a=r(9),i=r(10);function s(e,t){for(var r=e^t,n=0;r;)n++,r&=r-1;return n}function c(e,t){return t<<1|e}var u=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],l=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e,t,r){for(var o=l[r.dataMask],a=e.height,i=function(e){var t=17+4*e.versionNumber,r=n.BitMatrix.createEmpty(t,t);r.setRegion(0,0,9,9,!0),r.setRegion(t-8,0,8,9,!0),r.setRegion(0,t-8,9,8,!0);for(var o=0,a=e.alignmentPatternCenters;o<a.length;o++)for(var i=a[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===i&&6===u||6===i&&u===t-7||i===t-7&&6===u||r.setRegion(i-2,u-2,5,5,!0)}return r.setRegion(6,9,1,t-17,!0),r.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),s=[],u=0,d=0,f=!0,p=a-1;p>0;p-=2){6===p&&p--;for(var h=0;h<a;h++)for(var m=f?a-1-h:h,g=0;g<2;g++){var v=p-g;if(!i.get(v,m)){d++;var y=e.get(v,m);o({y:m,x:v})&&(y=!y),u=c(y,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var t=function(e){var t=e.height,r=Math.floor((t-17)/4);if(r<=6)return i.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var a=t-9;a>=t-11;a--)n=c(e.get(a,o),n);var u=0;for(a=5;a>=0;a--)for(o=t-9;o>=t-11;o--)u=c(e.get(a,o),u);for(var l,d=1/0,f=0,p=i.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var m=s(n,h.infoBits);m<d&&(l=h,d=m),(m=s(u,h.infoBits))<d&&(l=h,d=m)}return d<=3?l:void 0}(e);if(!t)return null;var r=function(e){for(var t=0,r=0;r<=8;r++)6!==r&&(t=c(e.get(r,8),t));for(var n=7;n>=0;n--)6!==n&&(t=c(e.get(8,n),t));var o=e.height,a=0;for(n=o-1;n>=o-7;n--)a=c(e.get(8,n),a);for(r=o-8;r<o;r++)a=c(e.get(r,8),a);for(var i=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,m=p.formatInfo;if(h===t||h===a)return m;var g=s(t,h);g<i&&(l=m,i=g),t!==a&&(g=s(a,h))<i&&(l=m,i=g)}return i<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],a=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),a+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<a)return null;e=e.slice(0,a);for(var i=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<i;s++)for(var c=0,u=o;c<u.length;c++)u[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var l=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)o[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=o;f<p.length;f++)p[f].codewords.push(e.shift());return o}(d(e,t,r),t,r.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,t){return e+t.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,m=n;h<m.length;h++){var g=m[h],v=a.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[p++]=v[y]}try{return o.decode(f,t.versionNumber)}catch(e){return null}}t.decode=function(e){if(null==e)return null;var t=f(e);if(t)return t;for(var r=0;r<e.width;r++)for(var n=r+1;n<e.height;n++)e.get(r,n)!==e.get(n,r)&&(e.set(r,n,!e.get(r,n)),e.set(n,r,!e.get(n,r)));return f(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o,a=r(7),i=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],a=e.readBits(o);a>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var i=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+i,48+s,48+c),n+=i.toString()+s.toString()+c.toString(),a-=3}if(2===a){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");i=Math.floor(u/10),s=u%10,r.push(48+i,48+s),n+=i.toString()+s.toString()}else if(1===a){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+u),n+=u.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(o||(o={}));var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(e,t){for(var r=[],n="",o=[9,11,13][t],a=e.readBits(o);a>=2;){var i=e.readBits(11),s=Math.floor(i/45),u=i%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],a-=2}return 1===a&&(s=e.readBits(6),r.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:r,text:n}}function l(e,t){for(var r=[],n="",o=[8,16,16][t],a=e.readBits(o),i=0;i<a;i++){var s=e.readBits(8);r.push(s)}try{n+=decodeURIComponent(r.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:r,text:n}}function d(e,t){for(var r=[],n="",o=[8,10,12][t],a=e.readBits(o),s=0;s<a;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,r.push(u>>8,255&u),n+=String.fromCharCode(i.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,i,c,f,p=new a.BitStream(e),h=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};p.available()>=4;){var g=p.readBits(4);if(g===o.Terminator)return m;if(g===o.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===o.Numeric){var v=s(p,h);m.text+=v.text,(r=m.bytes).push.apply(r,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===o.Alphanumeric){var y=u(p,h);m.text+=y.text,(i=m.bytes).push.apply(i,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===o.Byte){var b=l(p,h);m.text+=b.text,(c=m.bytes).push.apply(c,b.bytes),m.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(g===o.Kanji){var w=d(p,h);m.text+=w.text,(f=m.bytes).push.apply(f,w.bytes),m.chunks.push({type:n.Kanji,bytes:w.bytes,text:w.text})}}if(0===p.available()||0===p.readBits(p.available()))return m}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e<r?e:r,o=255>>8-n<<(a=r-n);t=(this.bytes[this.byteOffset]&o)>>a,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var a;if(e>0)o=255>>(a=8-e)<<a,t=t<<e|(this.bytes[this.byteOffset]&o)>>a,this.bitOffset+=e}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var a=new n.default(285,256,0),i=new o.default(a,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=i.evaluateAt(a.exp(u+a.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(a,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var a=t,i=r,s=e.zero,c=e.one;i.degree()>=n/2;){var u=a,l=s;if(s=c,(a=i).isZero())return null;i=u;for(var d=e.zero,f=a.getCoefficient(a.degree()),p=e.inverse(f);i.degree()>=a.degree()&&!i.isZero();){var h=i.degree()-a.degree(),m=e.multiply(i.getCoefficient(i.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),i=i.addOrSubtract(a.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),i.degree()>=a.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),i.multiply(v)]}(a,a.buildMonomial(t,1),d,t);if(null===f)return null;var p=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),o=0,a=1;a<e.size&&o<r;a++)0===t.evaluateAt(a)&&(n[o]=e.inverse(a),o++);return o!==r?null:n}(a,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,a=new Array(o),i=0;i<o;i++){for(var s=e.inverse(r[i]),c=1,u=0;u<o;u++)i!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));a[i]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(a[i]=e.multiply(a[i],s))}return a}(a,f[1],p),m=0;m<p.length;m++){var g=r.length-1-a.log(p[m]);if(g<0)return null;r[g]=n.addOrSubtractGF(r[g],h[m])}return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r,n){var o=e.x-t.x+r.x-n.x,a=e.y-t.y+r.y-n.y;if(0===o&&0===a)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:r.x-t.x,a22:r.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var i=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=i*u-s*c,d=(o*u-s*a)/l,f=(i*a-o*c)/l;return{a11:t.x-e.x+d*t.x,a12:t.y-e.y+d*t.y,a13:d,a21:n.x-e.x+f*n.x,a22:n.y-e.y+f*n.y,a23:f,a31:e.x,a32:e.y,a33:1}}t.extract=function(e,t){for(var r=function(e,t,r,n){var a=o(e,t,r,n);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}({x:3.5,y:3.5},{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),a=function(e,t){return{a11:e.a11*t.a11+e.a21*t.a12+e.a31*t.a13,a12:e.a12*t.a11+e.a22*t.a12+e.a32*t.a13,a13:e.a13*t.a11+e.a23*t.a12+e.a33*t.a13,a21:e.a11*t.a21+e.a21*t.a22+e.a31*t.a23,a22:e.a12*t.a21+e.a22*t.a22+e.a32*t.a23,a23:e.a13*t.a21+e.a23*t.a22+e.a33*t.a23,a31:e.a11*t.a31+e.a21*t.a32+e.a31*t.a33,a32:e.a12*t.a31+e.a22*t.a32+e.a32*t.a33,a33:e.a13*t.a31+e.a23*t.a32+e.a33*t.a33}}(o(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft),r),i=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=a.a13*e+a.a23*t+a.a33;return{x:(a.a11*e+a.a21*t+a.a31)/r,y:(a.a12*e+a.a22*t+a.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);i.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:i,mappingFunction:s}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function o(e){return e.reduce((function(e,t){return e+t}))}function a(e,t,r,o){var a,i,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(t.y-e.y)>Math.abs(t.x-e.x);l?(a=Math.floor(e.y),i=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(a=Math.floor(e.x),i=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-a),f=Math.abs(c-i),p=Math.floor(-d/2),h=a<s?1:-1,m=i<c?1:-1,g=!0,v=a,y=i;v!==s+h;v+=h){var b=l?y:v,w=l?v:y;if(r.get(b,w)!==g&&(g=!g,u.push({x:b,y:w}),u.length===o+1))break;if((p+=f)>0){if(y===c)break;y+=m,p-=d}}for(var k=[],C=0;C<o;C++)u[C]&&u[C+1]?k.push(n(u[C],u[C+1])):k.push(0);return k}function i(e,t,r,n){var o,i=t.y-e.y,s=t.x-e.x,c=a(e,t,r,Math.ceil(n/2)),u=a(e,{x:e.x-s,y:e.y-i},r,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(o=u.concat(l)).concat.apply(o,c)}function s(e,t){var r=o(e)/o(t),n=0;return t.forEach((function(t,o){n+=Math.pow(e[o]-t*r,2)})),{averageSize:r,error:n}}function c(e,t,r){try{var n=i(e,{x:-1,y:e.y},r,t.length),o=i(e,{x:e.x,y:-1},r,t.length),a=i(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=i(e,{x:Math.min(r.width,e.x+e.y)+1,y:Math.min(r.height,e.y+e.x)+1},r,t.length),u=s(n,t),l=s(o,t),d=s(a,t),f=s(c,t),p=Math.sqrt(u.error*u.error+l.error*l.error+d.error*d.error+f.error*f.error),h=(u.averageSize+l.averageSize+d.averageSize+f.averageSize)/4;return p+(Math.pow(u.averageSize-h,2)+Math.pow(l.averageSize-h,2)+Math.pow(d.averageSize-h,2)+Math.pow(f.averageSize-h,2))/h}catch(e){return 1/0}}function u(e,t){for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r--;for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n++;for(var o=(r+n)/2,a=Math.round(t.y);e.get(Math.round(o),a);)a--;for(var i=Math.round(t.y);e.get(Math.round(o),i);)i++;return{x:o,y:(a+i)/2}}function l(e,t,r,a,s){var u,l,d;try{u=function(e,t,r,a){var s=(o(i(e,r,a,5))/7+o(i(e,t,a,5))/7+o(i(r,e,a,5))/7+o(i(t,e,a,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,t)/s),u=Math.round(n(e,r)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(a,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-a.x+s.x,p=r.y-a.y+s.y,h=(n(a,s)+n(a,r))/2/d,m=1-3/h,g={x:a.x+m*(f-a.x),y:a.y+m*(p-a.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,a=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(a))){var i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1];return o(i),{x:r,y:a,score:c({x:Math.floor(r),y:Math.floor(a)},[1,1,1],e)+n({x:r,y:a},g)}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));return{alignmentPattern:h>=15&&v.length?v[0]:g,dimension:l}}t.locate=function(e){for(var t=[],r=[],a=[],i=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var a=e.get(t,n);if(a===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=a;var l=o(u)/7,d=Math.abs(u[0]-l)<l&&Math.abs(u[1]-l)<l&&Math.abs(u[2]-3*l)<3*l&&Math.abs(u[3]-l)<l&&Math.abs(u[4]-l)<l&&!a,f=o(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&a;if(d){var h=t-u[3]-u[4],m=h-u[2],g={startX:m,endX:h,y:n};(v=r.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||h>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&h>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:r.push({top:g,bottom:g})}if(p){var v,y=t-u[4],b=y-u[3];g={startX:b,y:n,endX:y},(v=i.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||y>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&y>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:i.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)l(d);t.push.apply(t,r.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),r=r.filter((function(e){return e.bottom.y===n})),a.push.apply(a,i.filter((function(e){return e.bottom.y!==n}))),i=i.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);t.push.apply(t,r.filter((function(e){return e.bottom.y-e.top.y>=2}))),a.push.apply(a,i);var f=t.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],i=o(a)/a.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:i}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score})).map((function(e,t,r){if(t>4)return null;var n=r.filter((function(e,r){return t!==r})).map((function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}})).sort((function(e,t){return e.score-t.score}));if(n.length<2)return null;var o=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:o}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));if(0===f.length)return null;var p=function(e,t,r){var o,a,i,s,c,u,l,d=n(e,t),f=n(t,r),p=n(e,r);return f>=d&&f>=p?(c=(o=[t,e,r])[0],u=o[1],l=o[2]):p>=f&&p>=d?(c=(a=[e,t,r])[0],u=a[1],l=a[2]):(c=(i=[e,r,t])[0],u=i[1],l=i[2]),(l.x-u.x)*(c.y-u.y)-(l.y-u.y)*(c.x-u.x)<0&&(c=(s=[l,c])[0],l=s[1]),{bottomLeft:c,topLeft:u,topRight:l}}(f[0].points[0],f[0].points[1],f[0].points[2]),h=p.topRight,m=p.topLeft,g=p.bottomLeft,v=l(e,a,h,m,g),y=[];v&&y.push({alignmentPattern:{x:v.alignmentPattern.x,y:v.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:v.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),w=u(e,m),k=u(e,g),C=l(e,a,b,w,k);return C&&y.push({alignmentPattern:{x:C.alignmentPattern.x,y:C.alignmentPattern.y},bottomLeft:{x:k.x,y:k.y},topLeft:{x:w.x,y:w.y},topRight:{x:b.x,y:b.y},dimension:C.dimension}),0===y.length?null:y}}]).default},e.exports=r()})));function v5(e){return y5.apply(this,arguments)}function y5(){return(y5=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(a=n.getContext("2d"),o=a.getImageData(0,0,n.width,n.height)),!(i=g5(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",i.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b5(e){return w5.apply(this,arguments)}function w5(){return(w5=$m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.canvas,n=t.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),l1.scanImage(r,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var k5=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,a=r,!n){e.next=6;break}return e.next=5,FD.blobToCanvas({blob:n});case 5:a=e.sent;case 6:return i=a.getContext("2d"),e.next=9,v5({imageData:i.getImageData(0,0,a.width,a.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,b5({canvas:a,qrScannerResources:o});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var C5,E5,S5,B5,_5,x5,T5=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onSessionTimeout,i=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=hg(dv.useState(!1),2),l=u[0],d=u[1],f=dv.useRef((function(){})),p=dv.useRef((function(){})),h=hN.useSDKSettings().lang,m=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.onResult,i=e.outputEncryptionSettings,s=dv.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=dv.useRef(!1),u=dv.useRef(null),l=hg(dv.useState(!1),2),d=l[0],f=l[1],p=dv.useRef({}),h=hN.useSDKSettings(),m=h.customUrls,g=h.qrSettings;dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d){e.next=5;break}return e.next=3,v1({modelUrl:null==m?void 0:m.wechatQRModelsUrl});case 3:p.current=e.sent,f(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[d,m]);var v=dv.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),y=dv.useCallback($m(regeneratorRuntime.mark((function e(){var r,n,l,f,h,m,y,b,w,k,C,E,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d&&o&&!c.current){e.next=2;break}return e.abrupt("return");case 2:r=p.current,n=r.qrModel,l=r.qrScannerResources,f=r.noModel,h=u.current,m=t.current,c.current=!0,y=h.cropX,b=h.cropY,w=h.cropWidth,k=h.cropHeight,(C=s.current).width=w,C.height=k,E=C.getContext("2d"),S=function(){var e=$m(regeneratorRuntime.mark((function e(){var t,r,o,u,d,p,h,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E.drawImage(m,y,b,w,k,0,0,w,k),t=performance.now(),f){e.next=8;break}return e.next=5,h5({canvas:C,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,k5({canvas:C,qrScannerResources:l});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=27;break}return v(),_=void 0,_=r.match(p5),o={valid:Boolean(_)},e.next=17,CO.takePicture({canvas:s.current});case 17:return u=e.sent,e.next=20,KM.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:"boolean"!=typeof(null==g?void 0:g.enableExif)||(null==g?void 0:g.enableExif)});case 20:if(d=e.sent,!i||!i.key){e.next=26;break}return h=i.key,e.next=25,TL.encrypt({blob:d,key:h});case 25:p=e.sent;case 26:a({result:r,validateResult:o,image:{blob:d,encrypted:p}});case 27:return B=180-t>0?180-t:0,e.next=30,new Promise((function(e){return setTimeout(e,B)}));case 30:c.current&&window.requestAnimationFrame(S);case 31:case"end":return e.stop()}var _}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(S);case 13:case"end":return e.stop()}}),e)}))),[d,o,t,v,null==g?void 0:g.enableExif,i,a]),b=dv.useCallback((function(){v()}),[v]);return dv.useEffect((function(){var e=t.current;r||b(),d&&r&&n&&e&&e.videoWidth>0&&(u.current=CO.analyzeVideoAndWindowSizes(e,n,0),y())}),[r,n,t,v,y,d,b]),dv.useEffect((function(){return b}),[b]),{refWorkingCanvas:s,stopCheckFrame:v,checkFrame:y,warmupDone:d}}({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:dv.useCallback((function(){f.current.apply(f,arguments)}),[]),outputEncryptionSettings:c}),g=m.stopCheckFrame,v=m.checkFrame,y=m.warmupDone,b=B1({refVideo:r,shouldStart:t&&y,cropArea:n,settings:o}),w=b.stopCheckFrame,k=b.refRecordedVideos,C=b.splitVideos,E=b.resetRecordedVideos,S=b.checkFrame;f.current=dv.useCallback((function(e){d(!0),w(),g(),p.current(),i(og(og({},e),{},{recordedVideos:k.current})),d(!1)}),[w,i,k,g]);var B=dv.useCallback((function(){w(),g();var e=mg(k.current);a({recordedVideos:e}),E()}),[E,w,g,a,k]),_=dv.useCallback((function(){C()}),[C]),x=_1({lang:h,onAboutToTimeout:s,onSessionTimeout:B,onVideoTimeLimitReached:_,settings:o,shouldStartTimers:t&&y,sessionTime:null==o?void 0:o.scanQrLimitTimeSecond}),T=x.stopTimers,A=x.startTimers;return p.current=T,{isProcessing:l,restartSession:dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(),e.next=3,Promise.all([S(),v()]);case 3:case"end":return e.stop()}}),e)}))),[S,v,A]),refRecordedVideos:k,warmupDone:y}};function A5(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,a=e.onCaptureDone,i=e.outputEncryptionSettings,s=hg(dv.useState(null),2),c=s[0],u=s[1],l=QN.useAsset("qr_capture_cursor.png"),d=hg(dv.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=hN.useSDKSettings().lang,v=KN.useSDKTracking().sendEvent,y=N2(),b=y.showPopup,w=y.popupShown,k=y.popupType,C=hg(dv.useState(!1),2),E=C[0],S=C[1],B=hg(dv.useState(null),2),_=B[0],x=B[1],T=QN.useAsset("ic_loading.png"),A=dv.useRef();dv.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),dv.useEffect((function(){b({popupType:M2})}),[b]),dv.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,a=WW.isMobile?Math.min(e-6,145):145,i=a,s=o+10,c=s+90,l=c+40,d=l+i+20,f=Math.floor((e-a)/2)+n;u({x:f,y:l,width:a,height:i,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var I=dv.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),a(e)}),[a,v]),P=dv.useCallback((function(e){var t=e.validateResult.valid;x("");var r=performance.now();t?(v({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-A.current)/1e3}}),a(e)):(b({popupType:L2}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,a,v]),R=dv.useCallback((function(e){var t=e.curTimeLeft;x(iY(U1.REMAINING_TIME[g])({x:t}))}),[g]),N=T5({shouldStart:E,refVideo:n,cropArea:c,settings:o,onSessionTimeout:I,onCaptureDone:P,onAboutToTimeout:R,outputEncryptionSettings:i}),O=N.isProcessing,D=N.restartSession,L=N.warmupDone,M=dv.useCallback((function(){b({popupType:null})}),[b]),F=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(),A.current=performance.now(),v({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,D();case 5:case"end":return e.stop()}}),e)}))),[D,M,v]),U=dv.useCallback((function(){M(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),a()}),[M,a,v]),j=dv.useCallback((function(){M(),setTimeout((function(){S(!0)}),200)}),[M]);return dv.createElement(dv.Fragment,null,!L&&dv.createElement(gZ,{contentStyle:{maxWidth:"300px"}}),c&&dv.createElement(FG,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},dv.createElement("div",null,dv.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),dv.createElement(M1,{y:"".concat(h,"px")},U1.QR_TOOLTIP[g]),_&&dv.createElement(F1,{key:_,className:"message",y:"".concat(m,"px")},_),O&&dv.createElement(VJ,null,dv.createElement("img",{src:T,alt:"",className:"spin"})),dv.createElement(pZ,{contentStyle:{maxWidth:"332px"},open:w},k===L2&&dv.createElement(X1,{onRetry:F,onSkip:U}),k===M2&&dv.createElement(f5,{onClickStart:j,onTimeout:j})))}A5.propTypes={windowAndVideoInfo:Lv.shape({}),onUISpacingChange:Lv.func,refVideo:Lv.shape({}),settings:Lv.shape({}),onCaptureDone:Lv.func,outputEncryptionSettings:Lv.shape({})},A5.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var I5,P5,R5,N5,O5,D5="SUCCESS",L5="WARNING",M5=(tg(C5={},D5,"52,206,95"),tg(C5,L5,"255,148,50"),C5),F5=(tg(E5={},D5,"✓"),tg(E5,L5,"!"),E5),U5=aw.div(S5||(S5=pg(["\n font-weight: normal;\n"]))),j5=aw.div(B5||(B5=pg(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return Hb(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],M5[e.type],M5[e.type],M5[e.type])})),V5=aw.div(_5||(_5=pg(["\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n margin-right: 8px;\n font-weight: bold;\n"])),(function(e){return Hb(["rgb(",")"],M5[e.type])})),z5=aw.div(x5||(x5=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),q5=function(e){var t=e.children,r=e.type,n=e.className;return dv.createElement(U5,{className:n},dv.createElement(j5,{type:r}),dv.createElement(z5,null,dv.createElement(V5,{type:r},F5[r]),t),dv.createElement(j5,{type:r}))};q5.propTypes={children:Lv.node,type:Lv.string,className:Lv.string},q5.defaultProps={children:null,type:D5,className:""};var H5=aw.div(I5||(I5=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),K5=aw.div(P5||(P5=pg(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),W5=aw.button(R5||(R5=pg(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),G5=aw.img(N5||(N5=pg(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),Q5=aw.div(O5||(O5=pg(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),X5=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,a=e.hasValidQR,i=e.frontSide,s=hg(dv.useState(null),2),c=s[0],u=s[1],l=hN.useSDKSettings().lang,d=KN.useSDKTracking().sendEvent;return dv.useEffect((function(){d({tag:i?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[i,d]),dv.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),dv.createElement(H5,null,null!==a&&dv.createElement(j1,{mb:"20px"},dv.createElement("div",null,dv.createElement(q5,{type:a?D5:L5},a?x2.CONFIRM_POPUP_VALID_QR[l]:x2.CONFIRM_POPUP_INVALID_QR[l]))),dv.createElement(i5,{ratio:1.5},dv.createElement(G5,{src:c})),o&&dv.createElement(K5,{className:"confirm-popup-error-message"},o.msg[l]),dv.createElement(Q5,null,dv.createElement(W5,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},x2.BTN_TRY_AGAIN[l]),dv.createElement(W5,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},x2.BTN_USE_THIS_PICTURE[l])))};X5.propTypes={imageTaken:Lv.shape({}),error:Lv.shape({msg:Lv.shape({})}),onConfirm:Lv.func,onTryAgain:Lv.func,hasValidQR:Lv.bool,frontSide:Lv.bool},X5.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var Y5,$5={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},Z5=sw(Y5||(Y5=pg(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),J5=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons","isLoading","cardList"];function e4(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,a=e.defaultCameraId,i=e.globalStyle,s=e.styledComponent,c=e.frontCamera,u=e.scannerTypeCons,l=e.isLoading,d=e.cardList,f=lg(e,J5),p=f.numberOfCaptures,h=f.stepNumber,m=f.frontSide,g=f.titleIcon,v=f.title,y=f.description,b=f.scannerType,w=f.usePortraitMask,k=f.shouldShowSpinner,C=f.handleQRCaptureDone,E=f.handleIDCardCaptureDone,S=f.handleRestartSession,B=f.refIDCardReader,_=f.handleClickConfirm,x=f.popupType,T=f.popupShown,A=f.popupProps,I=dv.useRef(null),P=hg(dv.useState(null),2),R=P[0],N=P[1],O=hg(dv.useState(!1),2),D=O[0],L=O[1],M=QN.useAsset("ic_loading.png"),F=hg(dv.useState({}),2),U=F[0],j=F[1],V=U.yTitle,z=dv.useCallback((function(e){N(e),L(!0)}),[]);dv.useEffect((function(){L(!1)}),[c]);var q=QN.useAsset(g),H=s.CloseCameraButton;return dv.createElement(rw,{theme:$5},dv.createElement(FJ,null,dv.createElement(RG,{key:c,frontCamera:c,onVideoPlayed:z,onClose:t,flipHorizontal:c,ref:I,onError:r,defaultCameraId:a,closeButton:H||null},D&&dv.createElement(dv.Fragment,null,b===u.ID_CARD&&dv.createElement(R1,{key:h,ref:B,windowAndVideoInfo:R,refVideo:I,settings:n,onCaptureDone:E,onUISpacingChange:j,frontSide:m,cardList:d,description:y,usePortraitMask:w,outputEncryptionSettings:o}),b===u.QR_CODE&&dv.createElement(A5,{key:h,refVideo:I,windowAndVideoInfo:R,settings:n,onCaptureDone:C,onUISpacingChange:j,outputEncryptionSettings:o})),dv.createElement(MJ,{keyForTransition:p}),dv.createElement(qJ,{y:"".concat(V,"px")},dv.createElement(KZ,null,dv.createElement(MZ,{key:v,timeout:{enter:500,exit:500},classNames:"flipY",unmountOnExit:!0},dv.createElement(HJ,null,g&&dv.createElement(UJ,{src:q,alt:""}),dv.createElement(KJ,{className:"title"},v))))),(k||l)&&dv.createElement(VJ,null,dv.createElement("img",{src:M,alt:"",className:"spin"}))),dv.createElement(pZ,{open:T},x===D2&&dv.createElement(X5,rg({},A,{onConfirm:_,onTryAgain:S,frontSide:m})))),dv.createElement(i,null))}var t4={cardList:Lv.arrayOf(Lv.string),settings:Lv.shape({}),onClose:Lv.func,onError:Lv.func,outputEncryptionSettings:Lv.shape({}),defaultCameraId:Lv.string,globalStyle:Lv.shape({}),styledComponent:Lv.shape({CloseCameraButton:Lv.node}),frontCamera:Lv.bool,scannerTypeCons:Lv.shape({}).isRequired,isLoading:Lv.bool},r4={cardList:[],settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:Z5,styledComponent:{CloseCameraButton:null},frontCamera:!1,isLoading:!1};e4.propTypes=t4,e4.defaultProps=r4;var n4=aI.IDCardSide,o4=aI.IDCardType,a4=aI.Errors,i4={ID_CARD:"id_card",QR_CODE:"qr_code"},s4=(aI.IDCardSide.FRONT,o4.VN,aI.IDCardSide.BACK,o4.VN,{scannerType:i4.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""}),c4=function(){return Promise.resolve({card_label:""})},u4=function(e){var t=e.settings,r=e.onError,n=e.detectIdCard,o=void 0===n?c4:n,a=e.outputEncryptionSettings,i=e.steps,s=e.onStepDone,c=hN.useSDKSettings().lang,u=null!=i?i:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",r="ph"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||"en"===t,n={scannerType:i4.ID_CARD,title:r?"Capture Front Side of ID Card":"Mặt trước CMND/CCCD",description:r?"":"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:aI.IDCardSide.FRONT,cardType:o4.VN,enableConfirmPopup:!0},o={scannerType:i4.ID_CARD,title:r?"Capture Back Side of ID Card":"Mặt sau CMND/CCCD",description:r?"":"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:aI.IDCardSide.BACK,cardType:o4.VN,enableConfirmPopup:!0};return e?[n,o]:[n]}(GY(t,"hasBackCard",!0),c,GY(t,"country")),l=hg(dv.useState(0),2),d=l[0],f=l[1],p=hg(dv.useState(u[d]),2),h=p[0],m=p[1],g=hg(dv.useState(0),2),v=g[0],y=g[1],b=hg(dv.useState(!1),2),w=b[0],k=b[1],C=dv.useRef({}),E=dv.useRef([]),S=dv.useRef(null),B=dv.useRef(),_=dv.useRef(null),x=N2(),T=x.showPopup,A=x.popupShown,I=x.popupType,P=x.props,R=h.scannerType,N=h.title,O=h.titleIcon,D=h.cardSide,L=h.description,M=h.usePortraitMask,F=h.cardType,U=h.enableConfirmPopup,j=dv.useCallback((function(e){e>=u.length||setTimeout((function(){f(e),m(u[e])}),200)}),[u]),V=dv.useCallback((function(){j(d+1)}),[j,d]),z=dv.useCallback((function(){setTimeout((function(){m((function(e){return og(og({},e),s4)}))}),200)}),[]),q=dv.useCallback((function(){T({popupType:null})}),[T]),H=dv.useCallback((function(){if(q(),S.current=null,R===i4.QR_CODE)j(d);else if(R===i4.ID_CARD){var e=null;_.current===n4.FRONT?e=0:_.current===n4.BACK&&(e=1),null!==e&&j(e),B.current.restartSession()}}),[j,d,q,R]),K=dv.useCallback($m(regeneratorRuntime.mark((function e(){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={stepNumber:d,cardSide:D,cardType:F,image:C.current,recordedVideos:null!=t&&t.enableRecording?E.current:[]},(R===i4.QR_CODE||null!==(r=S.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=S.current),k(!0),e.next=5,s(n);case 5:(o=e.sent)?(_.current=o,k(!1)):(k(!1),S.current=null,V());case 7:case"end":return e.stop()}}),e)}))),[t,d,s,V,R,k,D,F]),W=dv.useCallback((function(e){var t;if(S.current=e,e&&e.recordedVideos){var r,n=e.recordedVideos;(r=E.current).push.apply(r,mg(n))}y((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);U?T({popupType:D2,props:{hasValidQR:o,imageTaken:C.current}}):K()}),[T,U,K]),G=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(n){var i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.image,s=n.error,c=n.recordedVideos,C.current=i,E.current=c,y((function(e){return e+1})),D!==aI.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!WW.isMobile){e.next=28;break}if(l=null==i||null===(u=i.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return k(!0),e.prev=9,e.next=12,o({image:i,cardType:F,cardSide:D});case 12:d=e.sent,l=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(a4.detect_id_card_error);case 19:k(!1);case 20:if(!l||!"vn.cccd_new.front".includes(l)){e.next=28;break}return k(!0),e.next=24,m5(C.current.blob,a);case 24:return(f=e.sent)?W(f):z(),k(!1),e.abrupt("return");case 28:U?T({popupType:D2,props:{imageTaken:C.current,error:s}}):K();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[U,T,D,t,F,o,K,z,r,W,a,k]),Q=dv.useCallback((function(){q(),K()}),[K,q]);return{numberOfCaptures:v,stepNumber:d,titleIcon:O,title:N,description:L,frontSide:D===n4.FRONT,scannerType:R,usePortraitMask:M,shouldShowSpinner:w,handleQRCaptureDone:W,handleIDCardCaptureDone:G,handleRestartSession:H,refIDCardReader:B,handleClickConfirm:Q,showPopup:T,popupType:I,popupShown:A,popupProps:P}};var l4=function(){this.__data__=new TY,this.size=0};var d4=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var f4=function(e){return this.__data__.get(e)};var p4=function(e){return this.__data__.has(e)};var h4=function(e,t){var r=this.__data__;if(r instanceof TY){var n=r.__data__;if(!AY||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new FY(n)}return r.set(e,t),this.size=r.size,this};function m4(e){var t=this.__data__=new TY(e);this.size=t.size}m4.prototype.clear=l4,m4.prototype.delete=d4,m4.prototype.get=f4,m4.prototype.has=p4,m4.prototype.set=h4;var g4=m4;var v4=function(e,t,r){(void 0!==r&&!NQ(e[t],r)||void 0===r&&!(t in e))&&RQ(e,t,r)};var y4=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),s=i.length;s--;){var c=i[e?s:++o];if(!1===r(a[c],c,a))break}return t}}(),b4=n((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?qG.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}})),w4=qG.Uint8Array;var k4=function(e){var t=new e.constructor(e.byteLength);return new w4(t).set(new w4(e)),t};var C4=function(e,t){var r=t?k4(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)};var E4=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t},S4=Object.create,B4=function(){function e(){}return function(t){if(!jG(t))return{};if(S4)return S4(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();var _4=function(e){return"function"!=typeof e.constructor||gX(e)?{}:B4(EX(e))};var x4=function(e){return aQ(e)&&GQ(e)};var T4=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var A4=function(e){return LQ(e,wX(e))};var I4=function(e,t,r,n,o,a,i){var s=T4(e,r),c=T4(t,r),u=i.get(c);if(u)v4(e,r,u);else{var l=a?a(s,c,r+"",e,t,i):void 0,d=void 0===l;if(d){var f=oX(c),p=!f&&iX(c),h=!f&&!p&&fX(c);l=c,f||p||h?oX(s)?l=s:x4(s)?l=E4(s):p?(d=!1,l=b4(c,!0)):h?(d=!1,l=C4(c,!0)):l=[]:AX(c)||nX(c)?(l=s,nX(s)?l=A4(s):jG(s)&&!gQ(s)||(l=_4(c))):d=!1}d&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),v4(e,r,l)}};var P4=function e(t,r,n,o,a){t!==r&&y4(r,(function(i,s){if(a||(a=new g4),jG(i))I4(t,r,s,n,e,o,a);else{var c=o?o(T4(t,s),i,s+"",t,r,a):void 0;void 0===c&&(c=i),v4(t,s,c)}}),wX)},R4=$Q((function(e,t,r){P4(e,t,r)})),N4={data:{country:"vn",settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},track_card_coordinates:{enable:!1,max_length:150},card_type_check:{enable:!1},blur_check:{enable:!0,threshold_web:.82},disable_capture_button_if_alert:!1,exif_data_settings:{enable:!0},id_detection:{enable:!0},limit_time_settings:{enable:!0,limit_time_second:30,video_partial_length_seconds:15},save_frame_settings:{enable:!1,frames_interval_ms:190,quality_web:80},scan_qr_settings:{enable:!0,limit_time_second:20},virtual_cam_hashes:{web:!1,mobile:!1}}}}}};function O4(e){var t=e.clientSettings,r=hg(dv.useState(null),2),n=r[0],o=r[1];return dv.useEffect((function(){var e=R4(N4,t),r=GY(e,"data.settings.sdk_settings.id_detection_settings.card_type_check.enable"),n=GY(e,"data.country"),a=GY(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),i=GY(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.enable"),s=GY(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.max_length"),c=GY(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),u=GY(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),l=GY(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),d=GY(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),f=GY(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),p=GY(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),h=GY(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),m=GY(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),g=GY(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),v=GY(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),y=GY(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),b=GY(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),w=GY(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),k=GY(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),C=GY(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(WW.isMobile?"mobile":"web")),E=GY(e,"data.card_types[0].has_back_side",!0);o({country:n,enableRecording:a,trackCardCoordinates:i,trackCardCoordinatesMaxLength:s,enableCardTypeCheck:r,frameCaptureIntervalMs:c,idCardSessionTime:d,maxRecordingTimePerVideo:f,saveFrameQuality:u,enableTimers:l,enableAutoCapture:p,waitForBestImageTimeMs:h,enableBlurCheck:m,blurThreshold:g,disableCaptureButtonIfAlert:v,enableIdDetection:y,enableScanQr:b,scanQrLimitTimeSecond:w,enableExifData:k,enableVirtualCamHashes:C,hasBackCard:E})}),[t]),{settings:n}}function D4(e){var t=e.logCredentials,r=e.clientSettings,n=e.uiOnlyComponent,o=e.onError,a=e.detectIdCard,i=e.outputEncryptionSettings,s=e.steps,c=e.onStepDone,u=O4({clientSettings:r}).settings,l=rg({},u4({settings:u,onError:o,detectIdCard:a,outputEncryptionSettings:i,steps:s,onStepDone:c}));return dv.createElement(R3,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og({},t)}},dv.createElement(n,rg({},e,{settings:u,scannerTypeCons:i4},l))))}var L4={logCredentials:Lv.shape({}),clientSettings:Lv.shape({}),uiOnlyComponent:Lv.func,onError:Lv.func,onStepDone:Lv.func,steps:Lv.arrayOf(Lv.shape({})),detectIdCard:Lv.func,outputEncryptionSettings:Lv.shape({})};D4.propTypes=L4,D4.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:e4,onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var M4=function(e){var t=rg({},e),r=t.clientSettings,n=t.onError,o=t.onStepDone,a=t.logCredentials,i=t.uiOnlyComponent,s=t.detectIdCard,c=t.outputEncryptionSettings,u=t.steps,l=O4({clientSettings:r}).settings,d=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o(og(og({},t),{},{restartSession:null==f?void 0:f.handleRestartSession}));case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,null==f?void 0:f.handleRestartSession]),f=rg({},u4({settings:l,onError:n,detectIdCard:s,outputEncryptionSettings:c,steps:u,onStepDone:d}));return dv.createElement(R3,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og({},a)}},dv.createElement(i,rg({},t,{onStepDone:d,settings:l,scannerTypeCons:i4},f))))};function F4(e){var t=e.sdkAdapter;return t instanceof eF?dv.createElement(M4,og({sdkAdapter:t},e)):dv.createElement(D4,e)}M4.propTypes={clientSettings:Lv.shape({}),onError:Lv.func,onStepDone:Lv.func,logCredentials:Lv.shape({}),readIDCardUIOnlyComponent:Lv.func,uiOnlyComponent:Lv.func,sdkAdapter:Lv.shape({}),steps:Lv.arrayOf(Lv.shape({})),detectIdCard:Lv.func,outputEncryptionSettings:Lv.shape({})},M4.defaultProps={clientSettings:void 0,onError:function(){},onStepDone:function(){},logCredentials:{enable:!0},readIDCardUIOnlyComponent:D4,uiOnlyComponent:e4,sdkAdapter:null,steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var U4={sdkAdapter:Lv.shape({})};F4.propTypes=U4,F4.defaultProps={sdkAdapter:null};var j4=aI.IDCardSide,V4=aI.Errors;function z4(e){return q4.apply(this,arguments)}function q4(){return(q4=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.cardType,o=t.cardSide,a=t.apiClient,i=t.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(o)},!i||!i.key){e.next=4;break}return e.abrupt("return",a.httpClient.post("/v1/images",og({base64:r.encrypted.hex},s),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",a.uploadImage(og({file:r.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H4(e){return K4.apply(this,arguments)}function K4(){return(K4=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.apiClient,o=t.rawString,a=t.outputEncryptionSettings,i={label:"qr_code",metadata:JSON.stringify({raw:o})},!a||!a.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",og({base64:r.encrypted.hex},i),{"X-TV-Key":a.key}));case 4:return e.abrupt("return",n.uploadImage(og({file:r.blob},i)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W4(e){return G4.apply(this,arguments)}function G4(){return(G4=$m(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.imageId,n=t.cardType,o=t.apiClient,e.abrupt("return",o.requestVerifyIDCard({card_type:n,image1:{id:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q4(e){return X4.apply(this,arguments)}function X4(){return(X4=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.cardType,o=t.frontCardId,a=t.isCapturingFrontSide,i=t.backCardId,s=t.recordedVideos,c=t.qrImageId,u=s.filter((function(e){return null!==e.id})),l=s.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=5,Promise.all(l.map((function(e){return r.fileService.request({frames:e.frames})})));case 5:return d=e.sent,f={card_type:n,image:{id:o},image2:a?void 0:{id:i},videos:[].concat(mg(u.map((function(e){return{id:e.id}}))),mg(d.map((function(e){return{id:e.data.file_id}}))))},c&&(f.qr1_images=[{id:c}]),e.abrupt("return",r.detectIDTampering(f));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y4(e){return $4.apply(this,arguments)}function $4(){return($4=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,n=t.apiClient,o=t.frontCardId,a=t.backCardId,i=t.isCapturingFrontSide,s=t.qrImageId,c={card_type:r,image1:i?{id:o}:{id:a}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Z4(e){return J4.apply(this,arguments)}function J4(){return(J4=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,o=t.frontCardId,a=t.qrImageId,i=t.onError,s=t.recordedVideos,c=t.apiClient,u=t.cardType,l=t.cardSide,d=t.qrScannedResult,f=t.outputEncryptionSettings,l!==j4.BACK||o){e.next=4;break}return i(V4.missing_front_id_card),e.abrupt("return");case 4:return p=[z4({image:n,cardType:u,cardSide:l,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&p.push(H4({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(p);case 8:if(h=e.sent,m=hg(h,2),g=m[0],v=m[1],!g.errors){e.next=15;break}return i(og(og({},V4.upload_error),{},{details:g.errors})),e.abrupt("return");case 15:return y=g.data.image_id,b=(null==v||null===(r=v.data)||void 0===r?void 0:r.image_id)||a,(C=l===j4.FRONT)?w=y:(w=o,k=y),e.next=21,W4({imageId:y,cardType:u,apiClient:c});case 21:if(!(E=e.sent).errors){e.next=25;break}return i(og(og({},V4.sanity_check_error),{},{details:E.errors})),e.abrupt("return");case 25:return e.next=27,Y4({cardType:u,apiClient:c,frontCardId:w,backCardId:k,isCapturingFrontSide:C,qrImageId:b});case 27:if(!(S=e.sent).errors){e.next=31;break}return i(og(og({},V4.read_id_card_error),{},{details:S.errors})),e.abrupt("return");case 31:return e.next=33,Q4({apiClient:c,cardType:u,frontCardId:w,isCapturingFrontSide:C,backCardId:k,recordedVideos:s,qrImageId:b});case 33:if(!(B=e.sent).errors){e.next=37;break}return i(og(og({},V4.detect_id_tampering_error),{},{details:B.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:E.data,tamperingInfo:B.data,cardInfo:S.data,qrImageId:b});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var e8=["readIDCardUIOnlyComponent"],t8=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],r8=aI.Errors,n8=function(e){var t=e.readIDCardUIOnlyComponent,r=lg(e,e8),n=r.onError,o=r.onStepDone,a=r.apiCredentials,i=r.logCredentials,s=r.outputEncryptionSettings,c=lg(r,t8),u=hg(dv.useState(null),2),l=u[0],d=u[1],f=$D.useApiClient({apiCredentials:a,logCredentials:i}).apiClient,p=dv.useRef(""),h=dv.useRef("");dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.clientSettings();case 2:t=e.sent,d(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[f]);var m=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,a,i,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,a=t.cardSide,i=t.recordedVideos,c=t.qrScannedResult,u=t.image,l=null,e.prev=2,e.next=5,Z4({image:u,cardSide:a,frontCardId:p.current,qrImageId:h.current,onError:n,apiClient:f,cardType:r,recordedVideos:i,qrScannedResult:c,outputEncryptionSettings:s});case 5:l=e.sent,a===aI.IDCardSide.FRONT&&(p.current=l.cardInfo.image1.id),h.current=l.qrImageId,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n(og(og({},r8.api_call_error),{},{details:e.t0}));case 13:l&&o(og(og({},t),{},{apiResult:l}));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),[f,n,o,s]);return l&&dv.createElement(t,rg({logCredentials:i,onError:n,onStepDone:m,outputEncryptionSettings:s},c,{clientSettings:l}))};function o8(){return(o8=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.tfScriptUrls,a=t.blazefaceModelUrl,i=t.closeEyesModelUrl,s=new u1,e.prev=2,SL.loadTensorFlow(o).then((function(){SL.loadBlazefaceModel({modelUrl:a})})),e.next=6,Promise.all([t$({closeEyesModelUrl:i}),s.loadResource({modelUrl:n}),o1({url:r})]);case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}n8.propTypes={onError:Lv.func,onStepDone:Lv.func,apiCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string}),logCredentials:Lv.shape({}),outputEncryptionSettings:Lv.shape({}),readIDCardUIOnlyComponent:Lv.func},n8.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:F4};var a8=e$((function(){return o8.apply(this,arguments)})),i8={id_card_sanity:3,portrait_sanity:3,face_liveness_with_card_tampering_ocr:3,compare_faces:3},s8={card_sanity:!0,card_tampering:!0,card_ocr:!0,face_sanity:!0,face_liveness:!0,compare_faces:!0,search_face:!0,index_face:!0},c8="ID_CARD",u8="FACE_LIVENESS",l8="IDLE",d8={},f8={REACH_RETRY_LIMIT:{en:"You have reached the retry limit. Please try again later.",vi:"Bạn đã vượt quá số lần thử. Vui lòng thử lại sau."},FAIL_STEP:{en:"Please try again at step: <%= step %>.",vi:"Vui lòng thử lại ở bước: <%= step %>."},FAIL_FRONT_CARD_SANITY:{en:"The front side of your ID card failed sanity check.",vi:"Hình ảnh Mặt trước của GTTT không đạt chất lượng yêu cầu."},FAIL_FRONT_CARD_TAMPERING:{en:"The front side of your ID card failed tampering check.",vi:"Hình ảnh Mặt trước của GTTT không hợp lệ."},FAIL_FRONT_CARD_OCR:{en:"Cannot read information on the front side of your ID card.",vi:"Không đọc được thông tin từ hình ảnh Mặt trước của GTTT."},FAIL_BACK_CARD_SANITY:{en:"The back side of your ID card failed sanity check.",vi:"Hình ảnh Mặt sau của GTTT không đạt chất lượng yêu cầu."},FAIL_BACK_CARD_TAMPERING:{en:"The back side of your ID card failed tampering check.",vi:"Hình ảnh Mặt sau của GTTT không hợp lệ."},FAIL_BACK_CARD_OCR:{en:"Cannot read information on the back side of your ID card.",vi:"Không đọc được thông tin từ hình ảnh Mặt sau của GTTT."},FAIL_FACE_SANITY:{en:"Selfie step failed sanity check.",vi:"Hình ảnh khuôn mặt không đạt chất lượng yêu cầu."},FAIL_FACE_LIVENESS:{en:"Selfie step failed liveness check.",vi:"Hình ảnh khuôn mặt không hợp lệ."},FAIL_COMPARE_FACE:{en:"Failed compare faces between ID photo and selfie.",vi:"Hình ảnh khuôn mặt trên GTTT không giống hình chụp chân dung"},RETRY_BUTTON:{en:"Retry",vi:"Thử lại"},STOP_BUTTON:{en:"Stop",vi:"Dừng"},FRONT_CARD:{en:"Front Card",vi:"Mặt trước"},BACK_CARD:{en:"Back Card",vi:"Mặt sau"},ID_CARD:{en:"ID Card",vi:"Thẻ ID"},FACE_LIVENESS:{en:"Face Liveness",vi:"Nhận diện khuôn mặt"}},p8=$Q((function(e,t,r,n){P4(e,t,r,n)})),h8=["restartSession"],m8=["detectIDTamperingBackground","readIDCardBackground"],g8=["restartSession"],v8=["detectIDTamperingBackground","readIDCardBackground"];function y8(e){if(!function(e){return"object"===Xm(e)&&"function"==typeof e.then}(e))return"pending";var t={};return Promise.race([e,t]).then((function(e){return e===t?"pending":"fulfilled"}),(function(){return"rejected"}))}var b8,w8,k8,C8=function(e,t){return null===t?e:t},E8=function(e,t){if(!GY(t,"face_sanity"))return!1;var r=GY(e,"verifyFacePortraitResult.status",""),n=GY(e,"verifyFacePortraitResult.portrait_sanity.verdict","");return"success"!==r||"good"!==n},S8=function(){var e=$m(regeneratorRuntime.mark((function e(t,r,n){var o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x,T,A,I,P,R,N,O,D,L,M,F,U,j,V,z,q,H;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=!1,!GY(r,"card_tampering")){e.next=29;break}return a=GY(t.current,"frontCard.apiResult.detectIDTamperingBackground"),e.next=5,y8(a);case 5:if("fulfilled"!==e.sent){e.next=15;break}return e.next=9,GY(t.current,"frontCard.apiResult.detectIDTamperingBackground");case 9:d=e.sent,f=d.result,p=d.message,h=x8(f,r),t.current=og(og({},t.current),{},{frontCard:og(og({},null!==(i=null===(s=t.current)||void 0===s?void 0:s.frontCard)&&void 0!==i?i:{}),{},{apiResult:og(og({},null!==(c=null===(u=t.current)||void 0===u||null===(l=u.frontCard)||void 0===l?void 0:l.apiResult)&&void 0!==c?c:{}),{},{tamperingInfo:og(og({},null==f?void 0:f.data),{},{message:GY(p,h?"error":"success")})})})}),o=o||h;case 15:if(!n){e.next=29;break}return m=GY(t.current,"backCard.apiResult.detectIDTamperingBackground"),e.next=19,y8(m);case 19:if("fulfilled"!==e.sent){e.next=29;break}return e.next=23,GY(t.current,"backCard.apiResult.detectIDTamperingBackground");case 23:k=e.sent,C=k.result,E=k.message,S=x8(C,r),t.current=og(og({},t.current),{},{backCard:og(og({},null!==(g=null===(v=t.current)||void 0===v?void 0:v.backCard)&&void 0!==g?g:{}),{},{apiResult:og(og({},null!==(y=null===(b=t.current)||void 0===b||null===(w=b.backCard)||void 0===w?void 0:w.apiResult)&&void 0!==y?y:{}),{},{tamperingInfo:og(og({},null==C?void 0:C.data),{},{message:GY(E,S?"error":"success")})})})}),o=o||S;case 29:if(!GY(r,"card_ocr")){e.next=57;break}return B=GY(t.current,"frontCard.apiResult.readIDCardBackground"),e.next=33,y8(B);case 33:if("fulfilled"!==e.sent){e.next=43;break}return e.next=37,GY(t.current,"frontCard.apiResult.readIDCardBackground");case 37:P=e.sent,R=P.result,N=P.message,O="success"===GY(R,"data.status",""),t.current=og(og({},t.current),{},{frontCard:og(og({},null!==(_=null===(x=t.current)||void 0===x?void 0:x.frontCard)&&void 0!==_?_:{}),{},{apiResult:og(og({},null!==(T=null===(A=t.current)||void 0===A||null===(I=A.frontCard)||void 0===I?void 0:I.apiResult)&&void 0!==T?T:{}),{},{cardInfo:og(og({},null==R?void 0:R.data),{},{message:GY(N,O?"success":"error")})})})}),o=o||x8(R,r);case 43:if(!n){e.next=57;break}return D=GY(t.current,"backCard.apiResult.readIDCardBackground"),e.next=47,y8(D);case 47:if("fulfilled"!==e.sent){e.next=57;break}return e.next=51,GY(t.current,"backCard.apiResult.readIDCardBackground");case 51:V=e.sent,z=V.result,q=V.message,H="success"===GY(z,"data.status",""),t.current=og(og({},t.current),{},{backCard:og(og({},null!==(L=null===(M=t.current)||void 0===M?void 0:M.backCard)&&void 0!==L?L:{}),{},{apiResult:og(og({},null!==(F=null===(U=t.current)||void 0===U||null===(j=U.backCard)||void 0===j?void 0:j.apiResult)&&void 0!==F?F:{}),{},{cardInfo:og(og({},null==z?void 0:z.data),{},{message:GY(q,H?"success":"error")})})})}),o=o||x8(z,r);case 57:return e.abrupt("return",o);case 58:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),B8=function(e){var t=GY(e,"verifyFaceLivenessResult.is_live",!1),r=GY(e,"verifyFaceLivenessResult.status","");return!t||"success"!==r},_8=function(e,t){if(!GY(t,"card_sanity"))return!1;var r=GY(e,"apiResult.sanityResult.status",""),n=GY(e,"apiResult.sanityResult.card_sanity.verdict","");return"success"!==r||"good"!==n},x8=function(e,t){return!!GY(e,"errors")||(GY(t,"card_tampering")&&Object.prototype.hasOwnProperty.call(null==e?void 0:e.data,"card_tampering")?"success"!==GY(e,"data.status","")||"good"!==GY(e,"data.card_tampering.verdict",""):!(!GY(t,"card_ocr")||!Object.prototype.hasOwnProperty.call(null==e?void 0:e.data,"card_information"))&&"success"!==GY(e,"data.status",""))},T8=function(e){var t,r=GY(e,"compare_faces",[]);return"matched"!==(null===(t=r[0])||void 0===t?void 0:t.result)||1!==r.filter((function(e){return"matched"===(null==e?void 0:e.result)})).length||e.errors},A8=function(){var e=$m(regeneratorRuntime.mark((function e(t,r,n){var o,a,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=!1,!GY(r,"card_tampering")){e.next=18;break}return e.next=4,GY(t.current,"frontCard.apiResult.detectIDTamperingBackground");case 4:if(a=e.sent,i=a.result,s=a.message,c=x8(i,r),o=o||c,t.current=og(og({},t.current),{},{frontCard:og(og({},t.current.frontCard),{},{apiResult:og(og({},t.current.frontCard.apiResult),{},{tamperingInfo:og(og({},null==i?void 0:i.data),{},{message:GY(s,c?"error":"success")})})})}),!n){e.next=18;break}return e.next=13,GY(t.current,"backCard.apiResult.detectIDTamperingBackground");case 13:u=e.sent,l=u.result,d=x8(l,r),o=o||d,t.current=og(og({},t.current),{},{backCard:og(og({},t.current.backCard),{},{apiResult:og(og({},t.current.backCard.apiResult),{},{tamperingInfo:og(og({},null==l?void 0:l.data),{},{message:GY(s,d?"error":"success")})})})});case 18:if(!GY(r,"card_ocr")){e.next=35;break}return e.next=21,GY(t.current,"frontCard.apiResult.readIDCardBackground");case 21:if(f=e.sent,p=f.result,h=f.message,m="success"===GY(p,"data.status",""),o=o||!m,t.current=og(og({},t.current),{},{frontCard:og(og({},t.current.frontCard),{},{apiResult:og(og({},t.current.frontCard.apiResult),{},{cardInfo:og(og({},null==p?void 0:p.data),{},{message:GY(h,m?"success":"error")})})})}),!n){e.next=35;break}return e.next=30,GY(t.current,"backCard.apiResult.readIDCardBackground");case 30:g=e.sent,v=g.result,y="success"===GY(v,"data.status",""),o=o||!y,t.current=og(og({},t.current),{},{backCard:og(og({},t.current.backCard),{},{apiResult:og(og({},t.current.backCard.apiResult),{},{cardInfo:og(og({},null==v?void 0:v.data),{},{message:GY(h,y?"success":"error")})})})});case 35:return e.abrupt("return",o);case 36:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),I8=function e(t){for(var r in t)"message"===r||"step"===r?delete t[r]:"object"===Xm(t[r])&&e(t[r]);return t},P8=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=I8(t.current),n=GY(r,"frontCard",{}),n.restartSession,o=lg(n,h8),a=GY(r,"frontCard.apiResult",{}),a.detectIDTamperingBackground,a.readIDCardBackground,i=lg(a,m8),s=GY(r,"backCard",{}),s.restartSession,c=lg(s,g8),u=GY(r,"backCard.apiResult",{}),u.detectIDTamperingBackground,u.readIDCardBackground,l=lg(u,v8),e.abrupt("return",og(og(og({},r),GY(r,"frontCard",null)?{frontCard:og(og({},o),{},{apiResult:i})}:{}),GY(r,"backCard",null)?{backCard:og(og({},c),{},{apiResult:l})}:{}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),R8=function(e,t,r){var n=[];if(GY(e,"frontCard.apiResult.sanityResult")&&"good"!==GY(e,"frontCard.apiResult.sanityResult.card_sanity.verdict","")){var o=GY(e,"frontCard.apiResult.sanityResult.message",null);null!=o&&o[r]?n.push(o[r]):n.push(f8.FAIL_FRONT_CARD_SANITY[r])}if(GY(e,"frontCard.apiResult.tamperingInfo")&&"good"!==GY(e,"frontCard.apiResult.tamperingInfo.card_tampering.verdict","")){var a=GY(e,"frontCard.apiResult.tamperingInfo.message",null);null!=a&&a[r]?n.push(a[r]):n.push(f8.FAIL_FRONT_CARD_TAMPERING[r])}if(GY(e,"frontCard.apiResult.cardInfo")&&"success"!==GY(e,"frontCard.apiResult.cardInfo.status","")){var i=GY(e,"frontCard.apiResult.cardInfo.message",null);null!=i&&i[r]?n.push(i[r]):n.push(f8.FAIL_FRONT_CARD_OCR[r])}if(GY(e,"backCard.apiResult.sanityResult")&&"good"!==GY(e,"backCard.apiResult.sanityResult.card_sanity.verdict","")){var s=GY(e,"backCard.apiResult.sanityResult.message",null);null!=s&&s[r]?n.push(s[r]):n.push(f8.FAIL_BACK_CARD_SANITY[r])}if(GY(e,"backCard.apiResult.tamperingInfo")&&"good"!==GY(e,"backCard.apiResult.tamperingInfo.card_tampering.verdict","")){var c=GY(e,"backCard.apiResult.tamperingInfo.message",null);null!=c&&c[r]?n.push(c[r]):n.push(f8.FAIL_BACK_CARD_TAMPERING[r])}if(GY(e,"backCard.apiResult.cardInfo")&&"success"!==GY(e,"backCard.apiResult.cardInfo.status","")){var u=GY(e,"backCard.apiResult.cardInfo.message",null);null!=u&&u[r]?n.push(u[r]):n.push(f8.FAIL_BACK_CARD_OCR[r])}if(GY(e,"faceLiveness.verifyFacePortraitResult")&&"good"!==GY(e,"faceLiveness.verifyFacePortraitResult.portrait_sanity.verdict","")){var l=GY(e,"faceLiveness.verifyFacePortraitResult.message",null);null!=l&&l[r]?n.push(l[r]):n.push(f8.FAIL_FACE_SANITY[r])}if(GY(e,"faceLiveness.verifyFaceLivenessResult")&&!GY(e,"faceLiveness.verifyFaceLivenessResult.is_live",!1)){var d=GY(e,"faceLiveness.verifyFaceLivenessResult.message",null);null!=d&&d[r]?n.push(d[r]):n.push(f8.FAIL_FACE_LIVENESS[r])}if(GY(e,"compareFaces",null)&&T8(GY(e,"compareFaces"))){var f=GY(e,"compareFaces.message",null);null!=f&&f[r]?n.push(f[r]):n.push(f8.FAIL_COMPARE_FACE[r])}return{retryAt:t,results:n}},N8=function(e){var t=GY(e,"frontCard.apiResult.cardInfo.card_information",[]).find((function(e){return"id"===e.field}));return GY(t,"value","")},O8=["livenessMode","sdkAdapter","onError","services","hasBackCard"],D8=aI.Errors,L8=aI.IDCardSide,M8=aI.FaceDirection,F8=aI.Mode;function U8(e){return j8.apply(this,arguments)}function j8(){return(j8=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x,T,A,I,P,R,N,O,D,L,M,F,U,j,V,z,q;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.hasBackCard,a=t.stepResult,i=t.frontCardId,s=t.qrImageId,c=t.sdkAdapter,u=t.onError,l=t.checkFinishAndFailCardTamperingOrOCR,d=t.refEkycResult,f=t.handleFailCardTamperingOCRBackground,p=t.services,c instanceof eF){e.next=3;break}return e.abrupt("return",a);case 3:if(h=a.cardSide,m=a.cardType,g=a.recordedVideos,v=a.qrScannedResult,y=a.image,h!==L8.BACK||i){e.next=7;break}return u(D8.missing_front_id_card),e.abrupt("return",!1);case 7:return b=c.uploadImage,w=c.uploadFiles,k=c.requestVerifyIDCard,C=c.detectIDTampering,E=c.readIDCard,S=[b({file:null==y?void 0:y.blob,label:"id_card.".concat(m,".").concat(h)})],v&&v.image&&v.result&&S.push(b({file:v.image.blob,label:"qr_code",rawString:v.result})),e.next=12,Promise.all(S);case 12:if(B=e.sent,_=hg(B,2),x=_[0],T=_[1],!x.errors){e.next=19;break}return u(og(og({},D8.upload_error),{},{details:x.reason})),e.abrupt("return",!1);case 19:if(A=null==x||null===(r=x.data)||void 0===r?void 0:r.image_id,I=(null==T||null===(n=T.data)||void 0===n?void 0:n.image_data)||s,h===L8.FRONT?P=A:(P=i,R=A),N={qrImageId:I,frontCardId:P,backCardId:R},!GY(p,"card_sanity")){e.next=32;break}return e.next=26,k({card_type:m,image1:{id:h===L8.FRONT?P:R}});case 26:if(O=e.sent,D=O.result,L=O.message,"good"===GY(D,"data.card_sanity.verdict","")&&!D.errors){e.next=31;break}return e.abrupt("return",og(og({},a),{},{apiResult:og(og({},N),{},{sanityResult:og(og({},null==D?void 0:D.data),{},{message:GY(L,"error")}),failSanity:!0})}));case 31:N=og(og({},N),{},{sanityResult:og(og({},null==D?void 0:D.data),{},{message:GY(L,"success")})});case 32:if(h!==L8.BACK){e.next=40;break}if("function"!=typeof l||"function"!=typeof f){e.next=40;break}return e.next=36,l(d,p,o);case 36:if(!e.sent){e.next=40;break}return f(),e.abrupt("return",og(og({},a),{},{apiResult:og(og({},N),{},{failSanity:!0})}));case 40:if(!GY(p,"card_tampering")){e.next=51;break}if(F=og({card_type:m,image:{id:P}},h===L8.FRONT?{image2:void 0,level:"1"}:{image2:{id:R},level:"concurrent"}),I&&(F.qr1_images=[{id:I}]),!(g.length>0)){e.next=50;break}return U=g.filter((function(e){return null!==e.id})),j=g.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=48,Promise.all(j.map((function(e){return w({frames:e.frames})})));case 48:V=e.sent,F.videos=[].concat(mg(U.map((function(e){return{id:e.id}}))),mg(V.map((function(e){return{id:e.data.file_id}}))));case 50:M=C(F);case 51:return GY(p,"card_ocr")&&(q={card_type:m,image1:h===L8.FRONT?{id:P}:{id:R}},I&&(q.qr1_images={id:I}),z=E(q)),e.abrupt("return",og(og({},a),{},{apiResult:og(og({},N),{},{detectIDTamperingBackground:M,readIDCardBackground:z})}));case 53:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V8(e){return z8.apply(this,arguments)}function z8(){return(z8=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepResult,n=t.sdkAdapter,o=t.services,a=r.faceVerificationFlowData,i=r.captureFrameSettings,s=r.capturedFrames,c=n.uploadImage,u=n.verifyFaceLiveness,l=n.requestVerifyPortrait,d=a.current.steps,f=[],d.forEach((function(e){var t=e.name,r=e.image,n=e.frontalFaceImage;t!==M8.FRONTAL?f.push(c({file:r.blob,label:"portrait",metadata:JSON.stringify({gesture_score:r.leftRightScore,gesture:t})})):f.push(Promise.resolve({data:{image_id:null}})),n.blob?f.push(c({file:n.blob,label:"portrait",metadata:JSON.stringify({gesture_score:n.leftRightScore,gesture:M8.FRONTAL})})):f.push(Promise.resolve({data:{image_id:null}}))})),e.next=8,Promise.all(f);case 8:if(p=e.sent,d.forEach((function(e,t){e.image.imageId=p[2*t].data.image_id,e.frontalFaceImage.imageId=p[2*t+1].data.image_id})),0!==(h=d.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=13;break}return e.abrupt("return",{error:"wrong_face_movement"});case 13:return e.next=15,u$();case 15:if(m=l$(i)){e.next=18;break}return e.abrupt("return",{error:"network_error"});case 18:if(g={frontalFaces:h.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:d.filter((function(e){return e.image.imageId&&e.name!==M8.FRONTAL})).map((function(e){var t=e.name,r=e.image;return{name:t,blob:r.blob,id:r.imageId}})),capturedFrames:s},!GY(o,"face_sanity")){e.next=28;break}return e.next=22,l({image:{id:h[h.length-1].frontalFaceImage.imageId}});case 22:if(v=e.sent,y=v.result,b=v.message,"good"===GY(y,"data.portrait_sanity.verdict","")&&!GY(y,"errors")){e.next=27;break}return e.abrupt("return",og(og({},g),{},{verifyFacePortraitResult:og(og({},y.data),{},{message:GY(b,"error")})}));case 27:g=og(og({},g),{},{verifyFacePortraitResult:og(og({},y.data),{},{message:GY(b,"success")})});case 28:if(!GY(o,"face_liveness")){e.next=36;break}return e.next=31,u({images:h.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:d.filter((function(e){return e.image.imageId&&e.name!==M8.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:m});case 31:w=e.sent,k=w.result,C=w.message,E=GY(k,"data.is_live"),g=og(og({},g),{},{verifyFaceLivenessResult:og(og({},k.data),{},{message:GY(C,E?"success":"error")})});case 36:return e.abrupt("return",g);case 37:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q8(e){return H8.apply(this,arguments)}function H8(){return(H8=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepResult,n=t.sdkAdapter,o=t.services,a=r.imageAddedExif,i=r.frontalFaceImages,s=r.capturedFrames,c=n.uploadImage,u=n.verifyFaceLiveness,l=n.requestVerifyPortrait,d=i.map((function(e,t){return c({file:a[t],label:"portrait",metadata:{gesture_score:e.leftRightScore,gesture:M8.FRONTAL}})})),e.next=6,Promise.all(d);case 6:if(f=e.sent,p=f.map((function(e){var t;return{id:null==e||null===(t=e.data)||void 0===t?void 0:t.image_id}})),h={images:p,capturedFrames:s,frontalFaces:a.map((function(e,t){var r;return{blob:e,id:null===(r=p[t])||void 0===r?void 0:r.id}}))},!GY(o,"face_sanity")){e.next=17;break}return e.next=12,l({image:{id:p[p.length-1].id}});case 12:if(m=e.sent,g=m.result,"good"===GY(g,"data.portrait_sanity.verdict","")&&!GY(g,"errors")){e.next=16;break}return e.abrupt("return",og(og({},r),{},{verifyFacePortraitResult:g.data}));case 16:h=og(og({},h),{},{verifyFacePortraitResult:g.data});case 17:return e.next=19,u({images:p.map((function(e){return{id:e.id}}))});case 19:return v=e.sent,y=v.result,e.abrupt("return",og(og({},h),{},{verifyFaceLivenessResult:y.data}));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K8(e){return W8.apply(this,arguments)}function W8(){return(W8=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.stepResult,n=t.sdkAdapter,o=t.services,(a=r.mode)!==F8.ACTIVE){e.next=4;break}return e.abrupt("return",V8({stepResult:r,sdkAdapter:n,services:o}));case 4:if(a!==F8.PASSIVE){e.next=6;break}return e.abrupt("return",q8({stepResult:r,sdkAdapter:n,services:o}));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G8(e){return Q8.apply(this,arguments)}function Q8(){return(Q8=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.livenessMode,n=t.sdkAdapter,t.onError,o=t.services,a=t.hasBackCard,i=lg(t,O8),n instanceof eF){e.next=3;break}return e.abrupt("return",i);case 3:if(s=n.compareFaces,c=n.searchFaces,u=n.indexFaces,l=GY(t,"frontCard.apiResult.frontCardId",null),d=GY(t,"backCard.apiResult.backCardId",null),f=null,p=GY(t,"faceLiveness.frontalFaces",[]),f=null===(r=p[p.length-1])||void 0===r?void 0:r.id,l&&(!a||d)&&f){e.next=11;break}return e.abrupt("return");case 11:if(h=og({},i),!GY(o,"compare_faces")){e.next=21;break}return e.next=15,s({image1:{id:l},image2:{id:f}});case 15:if(m=e.sent,g=m.result,v=m.message,!T8(GY(g,"data"))){e.next=20;break}return e.abrupt("return",og(og({},h),{},{step:c8,compareFaces:og(og({},null==g?void 0:g.data),{},{message:v})}));case 20:h=og(og({},h),{},{compareFaces:og(og({},null==g?void 0:g.data),{},{message:v})});case 21:if(!GY(o,"search_face")){e.next=30;break}return e.next=24,c({image:{id:f}});case 24:if(y=e.sent,b=y.result,!((w=GY(b,"data.faces",null))||Array.isArray(w)&&w.length)){e.next=29;break}return e.abrupt("return",og(og({},h),{},{searchFaces:null==b?void 0:b.data}));case 29:h=og(og({},h),{},{searchFaces:null==b?void 0:b.data});case 30:if(!GY(o,"index_face")){e.next=37;break}return k=N8(t),e.next=34,u({image:og({id:f},k?{metadata:JSON.stringify({id:N8(t)})}:{})});case 34:C=e.sent,E=C.result,h=og(og({},h),{},{indexFaces:null==E?void 0:E.data});case 37:return e.abrupt("return",h);case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var X8,Y8,$8=aw.div(b8||(b8=pg(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Z8=aw.button(w8||(w8=pg(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: #0276f1;\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"]))),J8=aw.div(k8||(k8=pg(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),e6=function(e){var t=e.onRetry,r=e.onStop,n=e.children,o=hN.useSDKSettings().lang;return dv.createElement($8,null,n,dv.createElement(J8,null,dv.createElement(Z8,{onClick:r},f8.STOP_BUTTON[o]),dv.createElement(Z8,{onClick:t},f8.RETRY_BUTTON[o])))};e6.propTypes={children:Lv.node,onRetry:Lv.func,onStop:Lv.func},e6.defaultProps={children:null,onRetry:function(){},onStop:function(){}};var t6=aw.div(X8||(X8=pg(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),r6=aw.button(Y8||(Y8=pg(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: #0276f1;\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"]))),n6=function(e){var t=e.onStop,r=e.children,n=hN.useSDKSettings().lang;return dv.createElement(t6,null,r,dv.createElement(r6,{onClick:t},f8.STOP_BUTTON[n]))};n6.propTypes={children:Lv.node,onStop:Lv.func},n6.defaultProps={children:null,onStop:function(){}};var o6="FAIL_CARD_SANITY",a6="FAIL_FACE_SANITY",i6="FAIL_LIVENESS_TAMPERING_OCR_RETRY_ID",s6="FAIL_LIVENESS_TAMPERING_OCR_RETRY_FACE",c6="FAIL_COMPARE_FACES",u6="RESET_ACTIONS",l6="SET_STEP",d6={currentStep:null,readIdCardKey:0,faceLivenessKey:0,cardSanityTrials:-1,compareFacesTrials:-1,portraitSanityTrials:-1,faceLivenessCardTamperingOCRTrials:-1};function f6(e,t){switch(t.type){case o6:return og(og({},e),{},{cardSanityTrials:e.cardSanityTrials+1});case a6:return og(og({},e),{},{portraitSanityTrials:e.portraitSanityTrials+1,faceLivenessKey:e.faceLivenessKey+1});case i6:return og(og({},e),{},{readIdCardKey:e.readIdCardKey+1,faceLivenessCardTamperingOCRTrials:e.faceLivenessCardTamperingOCRTrials+1,currentStep:c8});case s6:return og(og({},e),{},{faceLivenessKey:e.faceLivenessKey+1,faceLivenessCardTamperingOCRTrials:e.faceLivenessCardTamperingOCRTrials+1,currentStep:u8});case c6:return og(og({},e),{},{compareFacesTrials:e.compareFacesTrials+1,readIdCardKey:e.readIdCardKey+1,faceLivenessKey:e.faceLivenessKey+1,currentStep:c8});case l6:return og(og({},e),{},{currentStep:t.payload});case u6:return d6;default:return e}}var p6=aI.IDCardSide,h6=aI.Errors,m6={padding:50,paddingBottom:20},g6=function(e){var t=e.content,r=e.lang,n=e.isStopPopup,o=void 0!==n&&n;return dv.createElement(dv.Fragment,null,dv.createElement("div",{style:m6},t.results.map((function(e,t){return dv.createElement("div",{key:t},e)}))),o?null:dv.createElement("div",{style:{padding:50,paddingBottom:0,color:"red"}},function(e,t){var r=Array.isArray(t)?t.map((function(t){return f8[t][e]})).join(", "):f8[t][e];return iY(f8.FAIL_STEP[e])({step:r})}(r,t.retryAt)))};function v6(e){var t=hN.useSDKSettings().lang,r=e.onDoneEkyc,n=e.readIDCardProps,o=e.livenessDetectionProps,a=e.onError,i=e.onClose,s=e.sdkAdapter,c=e.flow,u=void 0===c?aI.EkycFlow.FULL_FLOW:c,l=s.clientSettings,d=hg(dv.useState(!1),2),f=d[0],p=d[1],h=hg(dv.useState(!1),2),m=h[0],g=h[1],v=hg(dv.useState(null),2),y=v[0],b=v[1],w=hg(dv.useState(!1),2),k=w[0],C=w[1],E=hg(dv.useReducer(f6,d6),2),S=E[0],B=E[1],_=S.currentStep,x=S.readIdCardKey,T=S.faceLivenessKey,A=S.cardSanityTrials,I=S.compareFacesTrials,P=S.portraitSanityTrials,R=S.faceLivenessCardTamperingOCRTrials,N=dv.useRef(d8),O=dv.useRef(),D=dv.useRef(),L=dv.useRef(),M=dv.useRef(""),F=dv.useRef(""),U=dv.useMemo((function(){return function(e){var t=GY(e,"data.settings.sdk_settings.sdk_adapter.services",null),r=GY(e,"data.settings.sdk_settings.sdk_adapter.retries",null),n=p8(s8,t,C8),o=p8(i8,r,C8);return{cardSanityRetries:o.id_card_sanity,portraitSanityRetries:o.portrait_sanity,faceLivenessCardTamperingOCRRetries:o.face_liveness_with_card_tampering_ocr,compareFacesRetries:o.compare_faces,services:n}}(y)}),[y]),j=U.cardSanityRetries,V=U.portraitSanityRetries,z=U.faceLivenessCardTamperingOCRRetries,q=U.compareFacesRetries,H=U.services,K=dv.useMemo((function(){return u===aI.EkycFlow.FULL_FLOW||u===aI.EkycFlow.ID_CARD}),[u]),W=dv.useMemo((function(){return u===aI.EkycFlow.FULL_FLOW||u===aI.EkycFlow.FACE}),[u]),G=GY(y,"data.card_types[0].has_back_side",!0),Q=2===GY(n,"steps",[]).length||G;dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l();case 2:t=e.sent,b(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[l,s]),dv.useEffect((function(){B(K?{type:l6,payload:c8}:{type:l6,payload:u8})}),[K]),dv.useEffect((function(){(A>=j||P>=V||I>=q||R>=z)&&g(!0)}),[j,A,I,q,V,P,z,R,r]);var X=dv.useCallback((function(){B({type:"RESET_ACTIONS"}),p(!1),g(!1),N.current=d8,O.current=null,D.current=null}),[]);dv.useEffect((function(){return function(){return X()}}),[X]);var Y=dv.useCallback((function(){A+1<j?(D.current=R8(N.current,c8,t),O.current=function(){B({type:o6}),C(!1),"function"==typeof L.current&&L.current()},p(!0)):g(!0)}),[j,A,t]),$=dv.useCallback((function(){R+1<z?(D.current=R8(N.current,c8,t),O.current=function(){B({type:i6}),C(!1)},p(!0)):g(!0)}),[z,R,t]),Z=dv.useCallback((function(){P+1<V?(D.current=R8(N.current,u8,t),O.current=function(){B({type:a6}),C(!1)},p(!0)):g(!0)}),[V,P,t]),J=dv.useCallback((function(e,r){R+1<z?(D.current=R8(N.current,e,t),O.current=e===c8?function(){B({type:i6}),r||(N.current=d8)}:function(){B({type:s6})},p(!0)):g(!0)}),[z,R,t]),ee=dv.useCallback((function(){I+1<q?(D.current=R8(N.current,[c8,u8],t),O.current=function(){B({type:c6}),N.current=d8,C(!1)},p(!0)):g(!0)}),[q,I,t]),te=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!K){e.next=6;break}return e.next=3,A8(N,H,Q);case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",c8);case 6:if(!t){e.next=8;break}return e.abrupt("return",u8);case 8:return e.abrupt("return",!1);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[K,H,Q]),re=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,G8(og(og({},N.current),{},{livenessMode:o.mode,sdkAdapter:s,onError:a,services:H,hasBackCard:Q}));case 3:if(!(t=e.sent)){e.next=12;break}if(N.current=og(og({},N.current),t),!GY(t,"step",null)){e.next=10;break}ee(),e.next=12;break;case 10:return P8(N).then((function(e){r(e)})),e.abrupt("return");case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),a(og(og({},h6.api_call_error),{},{details:e.t0}));case 17:case"end":return e.stop()}}),e,null,[[0,14]])}))),[Q,o.mode,s,a,H,ee,r]),ne=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var n,o,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof GY(t,"restartSession")&&(L.current=t.restartSession),C(!0),_!==c8){e.next=62;break}if(GY(t,"cardSide")!==p6.FRONT){e.next=33;break}return e.next=6,U8({stepResult:t,frontCardId:M.current,qrImageId:F.current,onError:a,sdkAdapter:s,services:H});case 6:if(!(n=e.sent)){e.next=12;break}M.current=n.apiResult.frontCardId,F.current=n.apiResult.qrImageId,e.next=14;break;case 12:return C(!1),e.abrupt("return",!0);case 14:if(N.current=og(og({},N.current),{},{frontCard:n}),!_8(n,H)){e.next=18;break}return Y(),e.abrupt("return",p6.FRONT);case 18:if(Q){e.next=31;break}if(!W){e.next=23;break}B({type:l6,payload:u8}),e.next=31;break;case 23:return e.next=25,A8(N,H,Q);case 25:if(!e.sent){e.next=29;break}return $(),e.abrupt("return");case 29:return P8(N).then((function(e){r(e)})),e.abrupt("return");case 31:e.next=60;break;case 33:if(GY(t,"cardSide")!==p6.BACK){e.next=60;break}return e.next=36,S8(N,H,Q);case 36:if(!e.sent){e.next=41;break}$(),e.next=60;break;case 41:return e.next=43,U8({hasBackCard:Q,stepResult:t,frontCardId:M.current,qrImageId:F.current,sdkAdapter:s,onError:a,refEkycResult:N,services:H,checkFinishAndFailCardTamperingOrOCR:S8,handleFailCardTamperingOCRBackground:$});case 43:if(o=e.sent,N.current=og(og({},N.current),{},{backCard:o}),!_8(o,H)){e.next=48;break}return Y(),e.abrupt("return",p6.BACK);case 48:if(!W){e.next=52;break}B({type:l6,payload:u8}),e.next=60;break;case 52:return e.next=54,A8(N,H,Q);case 54:if(!e.sent){e.next=58;break}return $(),e.abrupt("return");case 58:return P8(N).then((function(e){r(e)})),e.abrupt("return");case 60:e.next=89;break;case 62:if(_!==u8){e.next=89;break}if(!K){e.next=77;break}return e.next=66,S8(N,H,Q);case 66:if(!e.sent){e.next=70;break}return $(),C(!1),e.abrupt("return");case 70:return e.next=72,A8(N,H,Q);case 72:if(!e.sent){e.next=77;break}return B({type:i6}),C(!1),e.abrupt("return");case 77:return e.next=79,K8({stepResult:t,sdkAdapter:s,services:H});case 79:if(i=e.sent,N.current=og(og({},N.current),{},{faceLiveness:i}),!E8(i,H)){e.next=85;break}Z(),e.next=89;break;case 85:return e.next=87,te(B8(i));case 87:(c=e.sent)?J(c,!B8(i)):K?re():P8(N).then((function(e){r(e)}));case 89:C(!1);case 90:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[Q,H,_,s,K,W,r,a,Y,$,Z,te,re,J]),oe=dv.useCallback((function(){p(!1),O.current()}),[]),ae=dv.useCallback((function(){p(!1),g(!1),P8(N).then((function(e){r(e),B({type:l6,payload:l8})}))}),[r]);return dv.createElement(dv.Fragment,null,_===c8?dv.createElement(F4,rg({},n,e,{onStepDone:ne,sdkAdapter:s,onError:a,onClose:i,clientSettings:y,key:x,isLoading:k})):null,_===u8?dv.createElement(E2,rg({},o,e,{onLivenessDetectionDone:ne,sdkAdapter:s,onError:a,onClose:i,clientSettings:y,key:T,isLoading:k})):null,dv.createElement(pZ,{open:f||m},f&&dv.createElement(e6,{onRetry:oe,onStop:ae},dv.createElement(g6,{content:D.current,lang:t})),m&&dv.createElement(n6,{onStop:ae},dv.createElement(g6,{content:D.current,lang:t,isStopPopup:!0}))))}function y6(e){var t=e.logCredentials,r=e.ekycFlowComponent;return dv.createElement(R3,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og({},t)}},dv.createElement(r,e)))}v6.propTypes={sdkAdapter:Lv.shape({}),onDoneEkyc:Lv.func,onError:Lv.func,onClose:Lv.func,readIDCardProps:Lv.shape({}),livenessDetectionProps:Lv.shape({})},v6.defaultProps={sdkAdapter:null,onDoneEkyc:function(){},onError:function(){},onClose:function(){},readIDCardProps:{},livenessDetectionProps:{}},y6.propTypes={logCredentials:Lv.shape({}),clientSettings:Lv.shape({}),ekycFlowComponent:Lv.func},y6.defaultProps={logCredentials:void 0,clientSettings:void 0,ekycFlowComponent:v6};var b6,w6,k6,C6,E6,S6,B6,_6,x6=F$,T6=lg(C3,["useLivenessDetection"]);function A6(e){var t=e.className;return dv.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dv.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}A6.propTypes={className:Lv.string},A6.defaultProps={className:""};var I6,P6,R6,N6,O6,D6,L6,M6,F6,U6,j6=UG,V6=CZ,z6=wZ,q6=YZ.default,H6=T6.FaceDetectionError,K6=T6.FaceVerificationInstructions,W6=T6.FaceVerificationStepsWrapper,G6=T6.StepItem,Q6=T6.BottomButtonsOverlay,X6=T6.Button,Y6=T6.CountDownOverlay,$6=T6.InstructionsOverlay,Z6=T6.CountdownTime,J6=aw(J$)(b6||(b6=pg(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),e9=aw(A6)(w6||(w6=pg(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.color;return null!=t?t:"rgba(0, 0, 0, 0.6)"})),t9=aw.div(k6||(k6=pg(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),r9=aw(K6)(C6||(C6=pg(["\n font-size: 20px;\n"]))),n9=aw($6)(E6||(E6=pg(["\n ",";\n ",";\n"])),z6.default,V6.default),o9=aw(Z6)(S6||(S6=pg(["\n background-color: unset;\n color: #ffffff;\n font-size: 20px;\n"]))),a9=WW.isMobile?{width:640}:null,i9={background:"#000000",opacity:.6};function s9(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,a=e.onError,i=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customStepTimeConstraints,l=e.onProcessing,d=e.customErrors,f=e.customMessages,p=e.livenessSettings,h=e.customInstructions,m=e.apiCredentials,g=QN.useAsset("bg_camera_mask.png"),v=QN.useAsset("bg_camera_mask_red.png"),y=hg(dv.useState({}),2),b=y[0],w=y[1],k=b.yFaceVerificationStepsWrapper,C=hg(dv.useState(""),2),E=C[0],S=C[1],B=hg(dv.useState(!1),2),_=B[0],x=B[1],T=dv.useCallback((function(e){var t=e.lostY,r=e.height,n=t+25,o=n+30;return w({yFaceDetectionError:n,yFaceVerificationStepsWrapper:o+r+20}),{y:Math.floor(o)}}),[]),A=x6({apiCheck:t,mode:r,bgCameraMask:g,bgCameraMaskRed:v,surroundStyle:i9,onLivenessDetectionDone:n,onError:a,cropAreaDimension:T,captureFrameSettings:i,onFramesCaptured:s,livenessSettings:p,setRemainingTime:S,customStepTimeConstraints:u,onProcessing:l,customErrors:d,customMessages:f,customInstructions:h,apiCredentials:m}),I=A.countdownToTakePicture,P=A.cropArea,R=A.curStepIndex,N=A.directionIcon,O=A.faceDetectionError,D=A.handleTriggerPassiveMode,L=A.handleVideoPlayed,M=A.instructions,F=A.isActiveMode,U=A.refVideo,j=A.showCountdown,V=A.steps,z=A.videoPlayed,q=A.directionIconAnimation,H=A.isFirstValidFrameFound,K=A.warmupDone;dv.useEffect((function(){Promise.all(V.map((function(e){return t=e.directionIcon,new Promise((function(e){var r=new Image;r.onload=e,r.onerror=e,r.src=t}));var t}))).then((function(){return x(!0)}))}),[V]);var W=dv.useRef(!1);return dv.useEffect((function(){H||(W.current=!1)}),[H]),O&&"liveness_terminated_time_out"===O.code&&(W.current=!0),dv.createElement(RG,{frontCamera:c,onVideoPlayed:L,onClose:o,flipHorizontal:c,ref:U,videoSettings:a9,onError:a},!K&&dv.createElement(gZ,null),z&&_?dv.createElement(dv.Fragment,null,dv.createElement(q6,{keyForTransition:R}),dv.createElement(H6,{top:k,className:"face-detection-error",error:O}),E&&dv.createElement(o9,{top:P.current.y-20},E),P.current?dv.createElement(FG,{x:"".concat(P.current.x,"px"),y:"".concat(P.current.y,"px"),width:"".concat(P.current.width,"px"),height:"".concat(P.current.height,"px"),surroundStyle:P.current.surroundStyle},dv.createElement(e9,null),dv.createElement(J6,{progress:R/V.length*100,hasError:!!O,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:2,insideRingStrokeDash:"none"}),j?dv.createElement(Y6,null,I):null,F?dv.createElement(n9,null,N?dv.createElement("img",{className:q,src:N,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):null):null,O&&dv.createElement(t9,null)):null,F?dv.createElement(dv.Fragment,null,M?dv.createElement(r9,{top:k-30,className:"instructions"},M):null,H&&!W.current&&dv.createElement(W6,{top:k+35},V.map((function(e,t){var r=e.name,n=e.image.objUrl;return dv.createElement(G6,{key:r,active:R>=t,className:"step-item"},n?dv.createElement("img",{src:n,alt:""}):dv.createElement("span",null,t+1))})))):dv.createElement(dv.Fragment,null,O?null:dv.createElement(Q6,null,dv.createElement(X6,{onClick:D},dv.createElement(j6,null))))):null)}function c9(e){return dv.createElement(E2,rg({},e,{livenessComponent:s9}))}s9.propTypes={apiCheck:Lv.bool,mode:Lv.string,onLivenessDetectionDone:Lv.func,onClose:Lv.func,onError:Lv.func,captureFrameSettings:Lv.shape({}),onFramesCaptured:Lv.func,frontCamera:Lv.bool,customStepTimeConstraints:Lv.shape({}),onProcessing:Lv.func,customErrors:Lv.shape({}),customMessages:Lv.shape({}),livenessSettings:Lv.shape({}),customInstructions:Lv.shape({}),apiCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string})},s9.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customStepTimeConstraints:(B6={},tg(B6,aI.FaceDirection.UP,{delayTime:0}),tg(B6,aI.FaceDirection.LEFT,{delayTime:0}),tg(B6,aI.FaceDirection.RIGHT,{delayTime:0}),tg(B6,aI.FaceDirection.FRONTAL,{delayTime:2e3}),B6),onProcessing:function(){},customErrors:{no_face:{code:"no_face",msg:{en:"Face is not detected.",vi:"Không nhận diện được khuôn mặt."}},multiple_faces:{code:"multiple_faces",msg:{en:"There are more than one face in the frame",vi:"Nhiều khuôn mặt xuất hiện trong khung hình"}},face_too_small:{code:"face_too_small",msg:{en:"The face is too small",vi:"Khuôn mặt quá nhỏ"}},face_too_large:{code:"face_too_large",msg:{en:"The face is too big",vi:"Khuôn mặt quá lớn"}},face_out_of_box:{code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt nằm ngoài khung ảnh"}},liveness_terminated_time_out:{code:"liveness_terminated_time_out",msg:{en:"The face verification need to be completed in <%= x %> seconds.\nPlease try again.",vi:"Xác thực khuôn mặt cần thực hiện trong <%= x %> giây.\nVui lòng thử lại."}}},customMessages:{REMAIN_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Kết thúc sau <%= x %>"}},customInstructions:(_6={},tg(_6,aI.FaceDirection.LEFT,{en:"Please turn to the left",vi:"Vui lòng quay trái"}),tg(_6,aI.FaceDirection.RIGHT,{en:"Please turn to the right",vi:"Vui lòng quay phải"}),tg(_6,aI.FaceDirection.UP,{en:"Please look up",vi:"Vui lòng nhìn lên"}),tg(_6,aI.FaceDirection.FRONTAL,{en:"Please look straight to camera",vi:"Vui lòng nhìn thẳng vào camera"}),_6),livenessSettings:{face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,limit_time_liveness_check:{enable:!0,limit_time_second:45,remain_time_show:15,format:"mm:ss"},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3}},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""}};var u9,l9=yZ,d9=ZZ,f9=YZ,p9=l9.animationDuration,h9=f9.default,m9=aw.div(I6||(I6=pg(["\n ","\n ","\n"])),l9.default,d9.default),g9=aw.img(P6||(P6=pg(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),v9=aw.div(R6||(R6=pg(["\n cursor: pointer;\n text-align: center;\n width: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),60,1020,WW.isMobile?Hb(["top:",";"],(function(e){return e.y})):Hb(["bottom:","px;"],10)),y9=function(){return dv.createElement("div",{className:"box_loader",id:"vib-v2018-loading"},dv.createElement("div",{className:"loader"},dv.createElement("div",{className:"inner one"}),dv.createElement("div",{className:"inner two"}),dv.createElement("div",{className:"inner three"})))},b9=aw.div(N6||(N6=pg(["\n color: #fff;\n text-align: center;\n"]))),w9=aw.div(O6||(O6=pg(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),k9=aw.div(D6||(D6=pg(["\n display: flex;\n align-items: center;\n"]))),C9=aw(b9)(L6||(L6=pg(["\n font-size: 16px;\n margin-left: 10px;\n color: #fff;\n"]))),E9=aw.div(M6||(M6=pg(["\n margin: 0 auto;\n padding: 0 5px;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),S9=aw(b9)(F6||(F6=pg(["\n text-align: center;\n background: ",";\n padding: 5px 10px;\n font-size: 18px;\n"])),(function(e){return e.theme.dangerColor})),B9=function(e){var t=e.children,r=e.y;return dv.createElement(E9,{y:r},dv.createElement(S9,null,t))},_9=aw(tJ)(U6||(U6=pg(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),x9=aI.Errors,T9={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},A9=og(og({},x9),{},{id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Take a photo of your ID card's <%= side %> side. Make sure the image of the card fits in the frame, (minimum 50% of frame).",vi:"Mặt <%= side %> CMND/CCCD cần nằm gọn trong khung hình, chiếm tối thiểu 50%."}},id_detector_validate_angle_error:{code:"id_detector_validate_angle_error",msg:{en:"Please put your ID card straight, not be oblique",vi:"Vui lòng đặt giấy tờ thẳng góc, không bị xô lệch khi chụp"}},id_detector_card_too_small:{code:"id_detector_card_too_small",msg:{en:"Please hold your ID card closer",vi:"Vui lòng đưa CMND/CCCD lại gần hơn"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please hold your ID card further",vi:"Vui lòng đưa CMND/CCCD ra xa hơn"}},id_detector_error_front_side_no_faces:{code:"id_detector_error_front_side_no_faces",msg:{en:"Take a photo of your ID card's front side",vi:"Vui lòng chụp ảnh mặt trước của CMND/CCCD"}},id_detector_error_front_side_multiple_faces:{code:"id_detector_error_front_side_multiple_faces",msg:{en:"Please remove other items out of the frame",vi:"Vui lòng không để lẫn vật thể khác trong khung chụp hình"}},glare_detected:{code:"glare_detected",msg:{en:"Your photo ID is glare. Please adjust the shooting angle.",vi:"Ảnh chụp bị lóa sáng. Vui lòng chụp lại"}}}),I9=dv.forwardRef((function(e,t){var r,n=e.usePortraitMask,o=e.windowAndVideoInfo,a=e.refVideo,i=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=hg(dv.useState({}),2),f=d[0],p=d[1],h=f.yErrorMessage,m=f.yCaptureButton,g=QN.useAsset("ic_camera.svg"),v=hN.useSDKSettings().lang,y=hg(dv.useState(""),2),b=y[0],w=y[1],k=hg(dv.useState(null),2),C=k[0],E=k[1],S=_L.useThemeContext().dangerColor,B=dv.useRef((function(){})),_=dv.useCallback((function(e){w(null===e?"":iY(A9[e.code].msg[v])({side:i?T9.FRONT[v]:T9.BACK[v]}))}),[v,i]),x=dv.useCallback((function(){B.current()}),[]),T=I1({shouldStart:!0,refVideo:a,cropArea:C,settings:s,onModelErrorChange:_,frontSide:i,onSessionTimeout:x,onCaptureDone:c,outputEncryptionSettings:l}),A=T.warmupDone,I=T.isProcessing,P=T.takePictureManually,R=T.restartSession,N=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R();case 2:case"end":return e.stop()}}),e)}))),[R]);B.current=N,dv.useEffect((function(){if(o){var e,t,r,a,i,s,c=o.videoAreaWidth,l=o.videoAreaHeight,d=o.lostX,f=o.lostY,h=o.clientHeight;n?(a=.7*(i=l-165),r=(s=(e=f+10)+45)+i+70):(a=WW.isMobile?c-6:Math.floor(.7*c),i=Math.floor(Math.min(a/1.5,h-2*f-80-135)),r=(t=(s=(e=f+10)+(WW.isMobile?90:50))+i+10)+88);var m=Math.floor((c-a)/2)+d;E({x:m,y:s,width:a,height:i,surroundStyle:{opacity:.6,background:"#000"}});var g={yTitle:e,yErrorMessage:t,yCaptureButton:r};p(g),u(g)}}),[o,n,u]);var O=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,P();case 2:case"end":return e.stop()}}),e)}))),[P]);return dv.useImperativeHandle(t,(function(){return{restartSession:N}}),[N]),dv.createElement(dv.Fragment,null,!A&&dv.createElement(gZ,null),I&&dv.createElement(y9,null),C&&dv.createElement(FG,{x:"".concat(C.x,"px"),y:"".concat(C.y,"px"),width:"".concat(C.width,"px"),height:"".concat(C.height,"px"),surroundStyle:C.surroundStyle},dv.createElement(_9,{strokeStyles:(r={},tg(r,JZ,{fill:"none",strokeWidth:1,stroke:"#fff"}),tg(r,eJ,{fill:"rgba(255, 0, 0, 0.1)",strokeWidth:3,stroke:S}),r),strokeWidth:3,errorColor:S,width:C.width,height:C.height,type:b?eJ:JZ})),b&&dv.createElement(B9,{y:"".concat(h,"px")},b),!I&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!b)&&dv.createElement(v9,{onClick:O,y:"".concat(m,"px")},dv.createElement("img",{src:g,alt:""})))}));I9.propTypes={usePortraitMask:Lv.bool,windowAndVideoInfo:Lv.shape({}),refVideo:Lv.shape({}),frontSide:Lv.bool,settings:Lv.shape({}),onCaptureDone:Lv.func,onUISpacingChange:Lv.func,outputEncryptionSettings:Lv.shape({})},I9.defaultProps={usePortraitMask:!1,windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var P9,R9,N9,O9,D9,L9,M9=aw.div(u9||(u9=pg(["\n z-index: ",";\n padding: 10px;\n margin: 0 10px;\n color: #fff;\n position: absolute;\n top: ",";\n font-size: 16px;\n text-align: center;\n max-width: 400px;\n"])),1020,(function(e){return e.y})),F9={QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR."}},U9=aw.button(P9||(P9=pg(["\n background: ",";\n height: 45px;\n border-radius: 5px;\n border: 0;\n padding: 0 20px;\n color: #000;\n cursor: pointer;\n font-size: 16px;\n font-weight: 600;\n"])),(function(e){return e.theme.primaryColor})),j9=aw.a(R9||(R9=pg(["\n text-decoration: underline;\n font-size: 16px;\n color: #000;\n cursor: pointer;\n"]))),V9=aw.div(N9||(N9=pg(["\n padding: 20px;\n"]))),z9=aw.div(O9||(O9=pg(["\n color: #000;\n font-size: 20px;\n"]))),q9=aw.div(D9||(D9=pg(["\n color: #000;\n font-size: 16px;\n"]))),H9=aw.div(L9||(L9=pg(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n"]))),K9=function(e){var t=e.onRetry,r=e.onSkip,n=hN.useSDKSettings().lang;return dv.createElement(V9,null,dv.createElement(j1,{mt:"15px"},dv.createElement(z9,null,F9.QR_INVALID_POPUP_TITLE[n])),dv.createElement(j1,{mt:"20px"},dv.createElement(q9,null,F9.QR_INVALID_POPUP_DESCRIPTION[n])),dv.createElement(j1,{mt:"30px"},dv.createElement(H9,null,dv.createElement(j1,{mr:"30px"},dv.createElement(j9,{onClick:r},F9.QR_INVALID_POPUP_SKIP_BUTTON[n])),dv.createElement(U9,{onClick:t},F9.QR_INVALID_POPUP_RETRY_BUTTON[n]))))};K9.propTypes={onRetry:Lv.func,onSkip:Lv.func},K9.defaultProps={onRetry:function(){},onSkip:function(){}};var W9,G9="CONFIRM",Q9="QR_INVALID",X9=["children","onClose"],Y9=aw.button(W9||(W9=pg(["\n position: absolute;\n top: 20px;\n right: 20px;\n border: 0;\n padding: 0;\n background: none;\n cursor: pointer;\n\n img {\n width: 16px;\n height: 16px;\n }\n"]))),$9=WW.isMobile?{contentStyle:{maxWidth:"100%",height:"100%",borderRadius:0},overlayStyle:{padding:0}}:{},Z9=function(e){var t=e.children,r=e.onClose,n=lg(e,X9),o=QN.useAsset("ic_close_black.png");return dv.createElement(pZ,rg({},$9,n),t,dv.createElement(Y9,{onClick:r},dv.createElement("img",{src:o,alt:""})))};Z9.propTypes={children:Lv.node,onClose:Lv.func},Z9.defaultProps={children:null,onClose:function(){}};var J9,e7,t7,r7;function n7(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,a=e.onCaptureDone,i=hg(dv.useState(null),2),s=i[0],c=i[1],u=QN.useAsset("qr_capture_cursor.png"),l=hg(dv.useState({}),2),d=l[0],f=l[1],p=d.yTooltip,h=hN.useSDKSettings().lang,m=KN.useSDKTracking().sendEvent,g=N2(),v=g.showPopup,y=g.popupShown,b=g.popupType,w=dv.useRef();dv.useEffect((function(){m({tag:"id_qr",event:"user_activity.start",log:{}}),w.current=performance.now()}),[m]),dv.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,a=WW.isMobile?Math.min(e-6,145):145,i=a,s=o+140,u=s+i+20,l=Math.floor((e-a)/2)+n;c({x:l,y:s,width:a,height:i,surroundStyle:{opacity:.6,background:"#000"}});var d={yTooltip:u};f(d),r(d)}}),[t,r]);var k=dv.useCallback((function(){m({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),a()}),[a,m]),C=dv.useCallback((function(e){var t=e.validateResult.valid,r=performance.now();t?(m({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-w.current)/1e3}}),a(e)):(v({popupType:Q9}),m({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[v,a,m]),E=T5({shouldStart:!0,refVideo:n,cropArea:s,settings:o,onSessionTimeout:k,onCaptureDone:C}),S=E.isProcessing,B=E.restartSession,_=E.warmupDone,x=dv.useCallback((function(){v({popupType:null})}),[v]),T=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(),w.current=performance.now(),m({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,B();case 5:case"end":return e.stop()}}),e)}))),[B,x,m]),A=dv.useCallback((function(){x(),m({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),a()}),[x,a,m]);return dv.createElement(dv.Fragment,null,!_&&dv.createElement(gZ,null),s&&dv.createElement(FG,{x:"".concat(s.x,"px"),y:"".concat(s.y,"px"),width:"".concat(s.width,"px"),height:"".concat(s.height,"px"),surroundStyle:s.surroundStyle},dv.createElement("div",null,dv.createElement("img",{src:u,width:s.width,height:s.height,alt:""}))),dv.createElement(M9,{y:"".concat(p,"px")},F9.QR_TOOLTIP[h]),S&&dv.createElement(y9,null),dv.createElement(Z9,{open:y,onClose:A},b===Q9&&dv.createElement(K9,{onRetry:T,onSkip:A})))}n7.propTypes={windowAndVideoInfo:Lv.shape({}),onUISpacingChange:Lv.func,refVideo:Lv.shape({}),settings:Lv.shape({}),onCaptureDone:Lv.func},n7.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){}};var o7=aw.div(J9||(J9=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),a7=aw.div(e7||(e7=pg(["\n text-align: center;\n font-size: 1rem;\n color: ",";\n margin-top: 10px;\n"])),(function(e){return e.theme.dangerColor})),i7=aw.img(t7||(t7=pg(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),s7=aw.div(r7||(r7=pg(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n gap: 10px;\n"]))),c7=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,a=e.hasValidQR,i=hg(dv.useState(null),2),s=i[0],c=i[1],u=hN.useSDKSettings().lang;return dv.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),c(e)),function(){URL.revokeObjectURL(e)}}),[t]),dv.createElement(o7,null,null!==a&&dv.createElement(j1,{mb:"20px"},dv.createElement("div",null,dv.createElement(q5,{type:a?D5:L5},a?T9.CONFIRM_POPUP_VALID_QR[u]:T9.CONFIRM_POPUP_INVALID_QR[u]))),dv.createElement(i5,{ratio:1.5},dv.createElement(i7,{src:s})),o&&dv.createElement(a7,{className:"confirm-popup-error-message"},o.msg[u]),dv.createElement(s7,null,dv.createElement(j9,{onClick:n},T9.BTN_TRY_AGAIN[u]),dv.createElement(U9,{onClick:r},T9.BTN_USE_THIS_PICTURE[u])))};c7.propTypes={imageTaken:Lv.shape({}),error:Lv.shape({msg:Lv.shape({})}),onConfirm:Lv.func,onTryAgain:Lv.func,hasValidQR:Lv.bool},c7.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null};var u7,l7={primaryColor:"#FDB913",dangerColor:"#FF0000"},d7=sw(u7||(u7=pg(['\n ///////////////// Loading Icon (provided by VIB) //////////////////////\n .loader {\n position: fixed;\n top: calc(50% - 32px);\n left: calc(50% - 32px);\n width: 64px;\n height: 64px;\n border-radius: 50%;\n perspective: 800px;\n z-index: 999999\n }\n\n .box_loader::before {\n /* background-color:rgba(0,0,0,.8); */\n width: 100%;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n content: "";\n display: block;\n z-index: 999995;\n }\n\n .inner {\n position: absolute;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border-radius: 50%\n }\n\n .inner.one {\n left: 0;\n top: 0;\n animation: rotate-one 1s linear infinite;\n border-bottom: 3px solid #fdb913\n }\n\n .inner.two {\n right: 0;\n top: 0;\n animation: rotate-two 1s linear infinite;\n border-right: 3px solid #f47920\n }\n\n .inner.three {\n right: 0;\n bottom: 0;\n animation: rotate-three 1s linear infinite;\n border-top: 3px solid #f7941d\n }\n\n @keyframes rotate-one {\n 0% {\n transform: rotateX(35deg) rotateY(-45deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg)\n }\n }\n\n @keyframes rotate-two {\n 0% {\n transform: rotateX(50deg) rotateY(10deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg)\n }\n }\n\n @keyframes rotate-three {\n 0% {\n transform: rotateX(35deg) rotateY(55deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg)\n }\n }\n ///////////////////////////////////////////////////////////\n']))),f7=aI.IDCardSide,p7=aI.IDCardType,h7=aI.Errors,m7="id_card",g7="qr_code",v7=[{scannerType:m7,title:"Chụp mặt trước CMND/CCCD",titleIcon:"id_card_front.svg",cardSide:aI.IDCardSide.FRONT,cardType:p7.VN,frontCamera:!1,enableConfirmPopup:!1},{scannerType:m7,title:"Chụp mặt sau CMND/CCCD",titleIcon:"id_card_back.svg",cardSide:aI.IDCardSide.BACK,cardType:p7.VN,frontCamera:!1,enableConfirmPopup:!1}],y7={scannerType:g7,frontCamera:!1,cardSide:aI.IDCardSide.FRONT,cardType:p7.VN};function b7(e){var t=e.onClose,r=e.onError,n=e.clientSettings,o=e.detectIdCard,a=e.onStepDone,i=e.steps,s=e.outputEncryptionSettings,c=hg(dv.useState(0),2),u=c[0],l=c[1],d=hg(dv.useState(i[u]),2),f=d[0],p=d[1],h=dv.useRef(null),m=hg(dv.useState(null),2),g=m[0],v=m[1],y=hg(dv.useState(!1),2),b=y[0],w=y[1],k=hg(dv.useState(0),2),C=k[0],E=k[1],S=dv.useRef(),B=f.scannerType,_=f.frontCamera,x=f.title,T=f.titleIcon,A=f.cardSide,I=f.usePortraitMask,P=f.cardType,R=f.enableConfirmPopup,N=A===f7.FRONT,O=QN.useAsset(T),D=N2(),L=D.showPopup,M=D.popupShown,F=D.popupType,U=D.props,j=hg(dv.useState(!1),2),V=j[0],z=j[1],q=dv.useRef(null),H=dv.useRef(null),K=dv.useRef([]),W=O4({clientSettings:n}).settings,G=hg(dv.useState({}),2),Q=G[0],X=G[1],Y=Q.yTitle,$=KN.useSDKTracking().sendEvent,Z=dv.useCallback((function(e){v(e),w(!0)}),[]);dv.useEffect((function(){w(!1)}),[_]);var J=dv.useCallback((function(){L({popupType:null})}),[L]),ee=dv.useCallback((function(e){e>=i.length||setTimeout((function(){l(e),p(i[e])}),200)}),[i]),te=dv.useCallback((function(){ee(u+1)}),[ee,u]),re=dv.useCallback((function(){setTimeout((function(){p((function(e){return og(og({},y7),{},{enableConfirmPopup:e.enableConfirmPopup})}))}),200)}),[]),ne=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={stepNumber:u,cardSide:A,cardType:P,image:q.current,recordedVideos:null!=W&&W.enableRecording?K.current:[]},(B===g7||null!==(t=H.current)&&void 0!==t&&t.result)&&(r.qrScannedResult=H.current),z(!0),e.next=5,a(r);case 5:$({tag:"result",event:"sdk_mode.read_id_card_one_side",log:{result_object:r}}),z(!1),H.current=null,te();case 9:case"end":return e.stop()}}),e)}))),[W,u,a,te,B,$,A,P]),oe=dv.useCallback((function(){J(),H.current=null,B===g7?ee(u):B===m7&&($({tag:N?"id_front":"id_back",event:"user_activity.retry",log:{}}),S.current.restartSession())}),[ee,u,J,B,N,$]),ae=dv.useCallback((function(){J(),$({tag:N?"id_front":"id_back",event:"user_activity.submit",log:{}}),ne()}),[ne,J,$,N]),ie=dv.useCallback((function(e){var t;if(H.current=e,e){var r,n=e.recordedVideos;(r=K.current).push.apply(r,mg(n))}E((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);R?L({popupType:G9,props:{hasValidQR:o,imageTaken:q.current}}):ne()}),[L,R,ne]),se=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var n,a,i,c,u,l,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,a=t.error,i=t.recordedVideos,q.current=n,K.current=i,E((function(e){return e+1})),A!==aI.IDCardSide.FRONT){e.next=28;break}if(!W.enableScanQr||!WW.isMobile){e.next=28;break}if(u=null==n||null===(c=n.detectedCard)||void 0===c?void 0:c.label){e.next=20;break}return z(!0),e.prev=9,e.next=12,o({image:n,cardType:P,cardSide:A});case 12:l=e.sent,u=l.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(h7.detect_id_card_error);case 19:z(!1);case 20:if(!u||!"vn.cccd_new.front".includes(u)){e.next=28;break}return z(!0),e.next=24,m5(q.current.blob,s);case 24:return(d=e.sent)?ie(d):re(),z(!1),e.abrupt("return");case 28:R?L({popupType:G9,props:{imageTaken:q.current,error:a}}):ne();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[R,L,A,W,P,o,ne,re,r,ie,s]);return dv.createElement(rw,{theme:l7},dv.createElement(m9,null,dv.createElement(RG,{key:_,frontCamera:_,onVideoPlayed:Z,onClose:t,flipHorizontal:_,ref:h,onError:r},b&&dv.createElement(dv.Fragment,null,B===m7&&dv.createElement(I9,{key:u,ref:S,windowAndVideoInfo:g,refVideo:h,settings:W,onCaptureDone:se,onUISpacingChange:X,frontSide:N,usePortraitMask:I,outputEncryptionSettings:s}),B===g7&&dv.createElement(n7,{key:u,refVideo:h,windowAndVideoInfo:g,settings:W,onCaptureDone:ie,onUISpacingChange:X})),dv.createElement(h9,{keyForTransition:C}),dv.createElement(w9,{y:"".concat(Y,"px")},dv.createElement(KZ,null,dv.createElement(MZ,{key:x,timeout:{enter:p9,exit:p9},classNames:"flipY",unmountOnExit:!0},dv.createElement(k9,null,T&&dv.createElement(g9,{src:O,alt:""}),dv.createElement(C9,{className:"title"},x))))),V&&dv.createElement(y9,null)),dv.createElement(pZ,{open:M},F===G9&&dv.createElement(c7,rg({},U,{onConfirm:ae,onTryAgain:oe})))),dv.createElement(d7,null))}b7.propTypes={onClose:Lv.func,onError:Lv.func,clientSettings:Lv.shape({}),detectIdCard:Lv.func,onStepDone:Lv.func,steps:Lv.arrayOf(Lv.shape({})),outputEncryptionSettings:Lv.shape({})},b7.defaultProps={onClose:function(){},onError:function(){},clientSettings:{},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:v7,outputEncryptionSettings:null};var w7=["tracking","clientSettings"];function k7(e){var t=e.tracking,r=e.clientSettings,n=lg(e,w7),o=dv.useMemo((function(){return GY(r,"data.settings.sdk_settings.server_log_settings.enable",null==t?void 0:t.enable)}),[r,t]);return dv.createElement(R3,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og(og({},t),{},{enable:o})}},dv.createElement(b7,rg({},n,{clientSettings:r}))))}k7.propTypes={tracking:Lv.shape({}),clientSettings:Lv.shape({})},k7.defaultProps={tracking:void 0,clientSettings:void 0};var C7=aI.Errors,E7=function(e){var t=e.onClose,r=e.onError,n=e.detectIdCard,o=e.steps,a=e.onStepDone,i=e.apiCredentials,s=e.tracking,c=hg(dv.useState(null),2),u=c[0],l=c[1],d=$D.useApiClient({apiCredentials:i,tracking:s}).apiClient,f=dv.useRef(""),p=dv.useRef("");dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.clientSettings();case 2:t=e.sent,l(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[d]);var h=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var n,i,s,c,u,l,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.stepNumber,i=t.recordedVideos,s=t.qrScannedResult,c=t.image,u=o[n],l=u.cardType,h=u.cardSide,m=null,e.prev=3,e.next=6,Z4({image:c,cardSide:h,frontCardId:f.current,qrImageId:p.current,onError:r,apiClient:d,cardType:l,recordedVideos:i,qrScannedResult:s});case 6:m=e.sent,h===aI.IDCardSide.FRONT&&(f.current=m.cardInfo.image1.id),p.current=m.qrImageId,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),r(og(og({},C7.api_call_error),{},{details:e.t0}));case 14:m&&a(og(og({},t),{},{apiResult:m}));case 15:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t){return e.apply(this,arguments)}}(),[d,r,o,a]);return u&&dv.createElement(k7,{tracking:s,onClose:t,onError:r,clientSettings:u,detectIdCard:n,onStepDone:h,steps:o})};E7.propTypes={onClose:Lv.func,onError:Lv.func,detectIdCard:Lv.func,onStepDone:Lv.func,steps:Lv.arrayOf(Lv.shape({})),apiCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string}),tracking:Lv.shape({})},E7.defaultProps={onClose:function(){},onError:function(){},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:v7,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},tracking:void 0};var S7=function(e){ag(r,ZM);var t=fg(r);function r(e){return Zm(this,r),t.call(this,og(og({},e),{},{baseComponent:{checkCamera:E3,LivenessDetection:E2,NativeCamera:B3,ReadIDCardUIOnly:F4,ReadIDCardWithApiCall:n8,EkycFlow:y6,warmUpReadIdCard:E1,preloadEKYCResources:a8,getListCamera:cG,FlashLiveness:k2},component:{LivenessDetection:c9,ReadIDCardUIOnly:k7,ReadIDCardWithApiCall:E7}}))}return r}();exports.APIUtils=$D,exports.AntiDebugUtils=BL,exports.AssetUtils=QN,exports.AsyncUtils=YN,exports.BaseTVWebSDK=ZM,exports.BlurUtils=wO,exports.CameraUtils=CO,exports.CloseEyesDetector=GM,exports.CommonUtils=SO,exports.Constants=aI,exports.CoordinateUtils=IO,exports.CryptoUtils=TL,exports.DEFAULT_CLOSE_EYE_MODEL=WM,exports.ExifUtils=KM,exports.FaceUtils=FO,exports.GlareUtils=zD,exports.HashUtils=MN,exports.ImageUtils=FD,exports.LoadResourceUtils=iL,exports.LocalStorageUtils=NN,exports.ModelUtils=SL,exports.PredictionUtils=jO,exports.SDK=S7,exports.SDKAdapter=eF,exports.SDKTimer=AL,exports.ScannerType=gW,exports.SettingsContext=hN,exports.ThemeUtils=_L,exports.TimeUtils=IN,exports.TrackingContext=KN,exports.UserAgentUtils=xN,exports.defaultClientSettings=OW,exports.defaultReadIDCardSteps=vW,exports.getCustomUrlsBySettings=uN,exports.getQrScannerWorkerPath=YM,exports.getSDKVersion=function(){return"5.14.0-alpha.19"},exports.requestMotionPermission=QM,exports.useDeviceMotion=XM;
84
+ */!function(o,a){var i="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",m="console",g="mobile",v="tablet",y="smarttv",b="wearable",w={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:a},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},k={rgx:function(e,t){for(var r,n,o,s,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(o=0;o<p.length;o++)l=u[++n],typeof(s=p[o])===c&&s.length>0?2==s.length?typeof s[1]==i?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==i||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):a:this[s[0]]=l?s[1].call(this,l,s[2]):a:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):a):this[s]=l||a;d+=2}},str:function(e,t){for(var r in t)if(typeof t[r]===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(w.has(t[r][n],e))return"?"===r?a:r}else if(w.has(t[r],e))return"?"===r?a:r;return e}},C={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},E={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,p],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],p],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[l,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[l,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[l,p],[/(QQ)\/([\d\.]+)/i],[l,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[l,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,p],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[l,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,l],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[p,k.str,C.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],p],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,w.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",w.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,w.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,f,[d,v]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[d,v]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[f,u,[d,v]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[u,[f,"Amazon"],[d,v]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[u,k.str,C.device.amazon.model],[f,"Amazon"],[d,g]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[d,g]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[d,g]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[f,u,[d,g]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[d,g]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[u,[f,"Asus"],[d,v]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[d,v]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[u,[f,"Sony"],[d,g]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[d,m]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[d,m]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[d,m]],[/(sprint\s(\w+))/i],[[f,k.str,C.device.sprint.vendor],[u,k.str,C.device.sprint.model],[d,g]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[f,u,[d,v]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[d,g]],[/(nexus\s9)/i],[u,[f,"HTC"],[d,v]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[u,[f,"Huawei"],[d,g]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[d,g]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[d,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[d,g]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[u,[f,"Motorola"],[d,g]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[d,v]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,w.trim],[u,w.trim],[d,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[d,y]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[d,y]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[f,"Samsung"],u,[d,v]],[/smart-tv.+(samsung)/i],[f,[d,y],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[d,g]],[/sie-(\w*)/i],[u,[f,"Siemens"],[d,g]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[d,g]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[u,[f,"Acer"],[d,v]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[d,v]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[d,v]],[/(lg) netcast\.tv/i],[f,u,[d,y]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[d,g]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[d,v]],[/linux;.+((jolla));/i],[f,u,[d,g]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[d,b]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[d,g]],[/crkey/i],[[u,"Chromecast"],[f,"Google"]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[d,b]],[/android.+;\s(pixel c)\s/i],[u,[f,"Google"],[d,v]],[/android.+;\s(pixel xl|pixel)\s/i],[u,[f,"Google"],[d,g]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,g]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,v]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[d,v]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[u,[f,"OnePlus"],[d,g]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[d,v]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[d,v]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[d,v]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[d,v]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[d,v]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[d,v]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[d,g]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[d,v]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[d,v]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[d,v]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[d,v]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[d,v]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[d,g]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[d,g]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[d,v]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[u,[f,"MachSpeed"],[d,v]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[d,v]],[/android.+(KS(.+))\s+build/i],[u,[f,"Amazon"],[d,v]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[d,v]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[d,w.lowerize],f,u],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,p],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[p,k.str,C.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,k.str,C.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],p],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[l,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],p],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],p],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[l,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,p],[/(haiku)\s(\w+)/i],[l,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[l,p]]},S=function(e,t){if("object"==typeof e&&(t=e,e=a),!(this instanceof S))return new S(e,t).getResult();var r=e||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),n=t?w.extend(E,t):E;return this.getBrowser=function(){var e={name:a,version:a};return k.rgx.call(e,r,n.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:a};return k.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:a,model:a,type:a};return k.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:a,version:a};return k.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:a,version:a};return k.rgx.call(e,r,n.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=e,this},this};S.VERSION="0.7.18",S.BROWSER={NAME:l,MAJOR:"major",VERSION:p},S.CPU={ARCHITECTURE:h},S.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:m,MOBILE:g,SMARTTV:y,TABLET:v,WEARABLE:b,EMBEDDED:"embedded"},S.ENGINE={NAME:l,VERSION:p},S.OS={NAME:l,VERSION:p},typeof t!==s?(typeof e!==s&&e.exports&&(t=e.exports=S),t.UAParser=S):r(3)?(n=function(){return S}.call(t,r,t,e))===a||(e.exports=n):o&&(o.UAParser=S);var B=o&&(o.jQuery||o.Zepto);if(typeof B!==s){var _=new S;B.ua=_.getResult(),B.ua.get=function(){return _.getUA()},B.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),a=o.DEVICE_TYPES,i=o.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case a.MOBILE:return{isMobile:!0};case a.TABLET:return{isTablet:!0};case a.SMART_TV:return{isSmartTV:!0};case a.CONSOLE:return{isConsole:!0};case a.WEARABLE:return{isWearable:!0};case a.BROWSER:return{isBrowser:!0};default:return i}},broPayload:function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:o}},mobilePayload:function(e,t,r,o){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:o})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])})),GW=/^\s+|\s+$/g,QW=/^[-+]0x[0-9a-f]+$/i,XW=/^0b[01]+$/i,YW=/^0o[0-7]+$/i,$W=parseInt,ZW="object"==typeof t&&t&&t.Object===Object&&t,JW="object"==typeof self&&self&&self.Object===Object&&self,eG=ZW||JW||Function("return this")(),tG=Object.prototype.toString,rG=Math.max,nG=Math.min,oG=function(){return eG.Date.now()};function aG(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function iG(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==tG.call(e)}(e))return NaN;if(aG(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=aG(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(GW,"");var r=XW.test(e);return r||YW.test(e)?$W(e.slice(2),r?2:8):QW.test(e)?NaN:+e}var sG=function(e,t,r){var n,o,a,i,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var r=n,a=o;return n=o=void 0,u=t,i=e.apply(a,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):i}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=a}function g(){var e=oG();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?nG(r,a-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,i)}function y(){var e=oG(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),i}return t=iG(t)||0,aG(r)&&(l=!!r.leading,a=(d="maxWait"in r)?rG(iG(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?i:v(oG())},y};function cG(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===Xm(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,t){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(t){e(t.filter((function(e){return"video"===e.kind.toLowerCase()||"videoinput"===e.kind.toLowerCase()})).map((function(e){return{deviceId:null!=e.deviceId?e.deviceId:"",groupId:e.groupId,kind:"videoinput",label:e.label,toJSON:function(){return this}}})))}))}catch(e){return t(e)}}))}var uG,lG,dG,fG,pG,hG=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],mG=function(e){if(!e)return{isVirtual:!1};var t=e.getTracks();if(!t||!t.length)return{isVirtual:!1};var r=t[0].label,n=r&&hG.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},gG=function(e,t){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0&&!t)},vG=function(){var e,t;return{updateTime:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start";"start"===n?e=r:"end"===n&&(t=r)},getStart:function(){return e},getEnd:function(){return t}}},yG=aI.Errors,bG=aw.div(uG||(uG=pg(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: #000;\n display: flex;\n justify-content: center;\n z-index: ",";\n ","\n"])),1e3,(function(e){return e.checkCameraMode&&"opacity: 0;"})),wG=aw.video(lG||(lG=pg(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),kG=aw.div(dG||(dG=pg(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),CG=aw(kG)(fG||(fG=pg(["\n z-index: ",";\n position: fixed;\n top: 20px;\n right: 20px;\n width: 20px;\n cursor: pointer;\n"])),2e3),EG=aw.div(pG||(pG=pg(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),SG=dv.createRef(),BG=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(r,n){e.call(navigator,t,r,n)}))}}:null}();function _G(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,a=e.onVideoPlayed,i=e.flipHorizontal,s=e.videoSettings,c=e.refVideo,u=e.onError,l=e.closeButton,d=e.videoClassName,f=e.scale,p=e.defaultCameraId,h=e.onWarning,m=dv.useRef(),g=hN.useSDKSettings().lang,v=KN.useSDKTracking().sendEvent,y=QN.useAsset("ic_close.png"),b=hg(dv.useState(""),2),w=b[0],k=b[1],C=dv.useRef(!1),E=dv.useRef(!1),S=dv.useRef(!1),B=dv.useRef(),_=dv.useRef([]),x=dv.useRef(""),T=dv.useCallback((function(e){u&&u(e)}),[u]),A=dv.useCallback((function(){try{var e;clearInterval(m.current),(null==c||null===(e=c.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(c.current.srcObject.getTracks().forEach((function(e){return e.stop()})),c.current.srcObject=null)}catch(e){}clearTimeout(B)}),[c]);function I(){return P.apply(this,arguments)}function P(){return(P=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,cG();case 3:t=e.sent,_.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),KM.addExifData("device_info.camera_list",JSON.stringify(_.current.map((function(e){return e.label})))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}m.current||(m.current=setInterval((function(){document.getElementById("tv-camera-".concat(m.current))||A()}),1e3)),dv.useEffect((function(){return function(){S.current=!0}}),[]);var R=dv.useCallback((function(){B.current||(B.current=setTimeout((function(){C.current||(k(yG.camera_timeout.msg[g]),T(yG.camera_timeout))}),2e4))}),[g,T]),N=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var n,o,a,i,c,u,l,d,f,p,m=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=m.length>1&&void 0!==m[1]&&m[1],o={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return h&&h("too_many_request_to_camera"),e.abrupt("return",new Promise((function(e){return e(null)})));case 5:return window.tv_last_req_camera_complete=!1,o=WW.isMobile?WW.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},a=vG(),i=a.updateTime,c=a.getStart,u=a.getEnd,e.prev=8,l=s||o,i(performance.now(),"start"),gG(WW.isMobile,WW.isIOS)&&r&&(l={}),n&&(l={}),KM.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),d={audio:!1,video:og(og({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)},e.next=17,BG.getUserMedia(d);case 17:return f=e.sent,e.next=20,I();case 20:if(R(),f){e.next=25;break}return k(yG.not_supported.msg[g]),T(yG.not_supported),e.abrupt("return",null);case 25:i(performance.now(),"end"),window.tv_last_req_camera_complete=!0,u()-c()<1600?v({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):v({tag:"cam_permission",event:"user_activity.allow",log:{}});try{p=f.getVideoTracks()[0].getSettings(),KM.addExifData("device_info.camera_label_dimension.got","".concat(p.width,"x").concat(p.height))}catch(e){}return e.abrupt("return",f);case 32:e.prev=32,e.t0=e.catch(8),i(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k(yG.no_permission.msg[g]),T(yG.no_permission),E.current=!0,v({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):E.current&&("NotReadableError"===e.t0.name?(T(yG.not_readable),k(yG.not_readable.msg[g])):(k(e.t0.message),T({code:e.t0.name||e.t0.code,message:e.t0.message})));case 36:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 38:case"end":return e.stop()}}),e,null,[[8,32]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,T,h,R,v]),O=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t,r,n,o,i,s,u,l,d,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>0&&void 0!==h[0]?h[0]:p,o=h.length>1&&void 0!==h[1]&&h[1],!(null!=(i=c.current)&&null!==(t=i.srcObject)&&void 0!==t&&t.id&&null!=i&&null!==(r=i.srcObject)&&void 0!==r&&r.active&&C.current)){e.next=5;break}return e.abrupt("return");case 5:return i.oncanplaythrough=function(){var e,t,r;i.play(),KM.addExifData("device_info.camera_label",null===(e=s)||void 0===e||null===(t=e.getVideoTracks())||void 0===t||null===(r=t[0])||void 0===r?void 0:r.label),C.current=!0,k("");var n=window.innerWidth,o=window.innerHeight,c=CO.analyzeVideoAndWindowSizes(i),u=c.lostX,l=void 0===u?0:u,d=c.lostY,f=void 0===d?0:d,p=Math.min(n,Math.floor(n-2*l)),h=Math.min(o,Math.floor(o-2*f));a&&a({clientWidth:n,clientHeight:o,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,N(n,o);case 8:s=e.sent,u=mG(s),l=u.deviceLabel,(d=u.isVirtual)&&(x.current+="".concat(l,", "),(f=_.current.filter((function(e){return!x.current.includes(e.label)})))[0]&&f[0].deviceId&&O(f[0].deviceId)),s||E.current||(KM.addExifData("device_info.camera_label_retry","yes"),E.current=!0,O(n,!0)),s&&S.current&&(c.current.srcObject=s,A()),!s||S.current||d||(i.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,N,a,p,A]);dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:return e.next=4,cG();case 4:t=e.sent,(r=t.filter((function(e){return"videoinput"===e.kind&&e.label.includes("back")&&e.label.includes("0")}))).length>0&&(n=r[0].deviceId,A(),O(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return C.current?function(){}:(!BG||WW.browserName&&["facebook"].includes(WW.browserName.toLowerCase())||WW.getUA.includes("Zalo iOS")?(k(yG.not_supported.msg[g]),T(yG.not_supported)):t&&(WW.isAndroid&&!1===r?function(){e.apply(this,arguments)}():O()),function(){S.current&&A()})}),[c,g,r,O,A,T]);var D=dv.useCallback((function(){A(),n&&n(),v({tag:"result",event:"user_activity.cancel",log:{}})}),[n,A,v]);return dv.createElement(bG,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!w)return null;var e=yG.no_permission.msg[g];return w===e&&WW.isIOS?dv.createElement(EG,null,w," ",dv.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):dv.createElement(EG,null,w)}(),dv.createElement(wG,{ref:c,playsInline:!0,muted:!0,flipHorizontal:i,className:d,scale:f}),o,l?dv.cloneElement(l,{onClick:D,"data-testid":"close-camera"}):dv.createElement(CG,{onClick:D,"data-testid":"close-camera"},dv.createElement("img",{src:y,alt:""})))}_G.propTypes={checkCameraMode:Lv.bool,frontCamera:Lv.bool,onClose:Lv.func,onError:Lv.func,onVideoPlayed:Lv.func,children:Lv.node,flipHorizontal:Lv.bool,videoSettings:Lv.object,refVideo:Lv.object,closeButton:Lv.node,videoClassName:Lv.string,scale:Lv.number,defaultCameraId:Lv.string,onWarning:Lv.func},_G.defaultProps={checkCameraMode:!1,frontCamera:!0,onClose:null,onError:null,onVideoPlayed:null,children:null,flipHorizontal:!1,videoSettings:null,refVideo:null,closeButton:null,videoClassName:"",scale:1,defaultCameraId:void 0,onWarning:null};var xG,TG,AG,IG=function(e,t,r){class n extends dv.Component{constructor(){super(...arguments),this.updateDebounced=sG(this.forceUpdate,t,r)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return dv.createElement(e,Object.assign({},this.props))}}return n.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,zy(n,e)}(_G,250),PG=dv.forwardRef((function(e,t){return dv.createElement(_G,rg({},e,{refVideo:t||SG}))})),RG=dv.forwardRef((function(e,t){return dv.createElement(IG,rg({},e,{refVideo:t||SG}))})),NG=aw.table(xG||(xG=pg(["\n width: 100%;\n height: 100%;\n td {\n text-align: center;\n vertical-align: middle;\n padding: 0;\n border: 0;\n }\n border-spacing: 0;\n table-layout: auto;\n border-collapse: collapse;\n"]))),OG=aw.div(TG||(TG=pg(["\n position: relative;\n"]))),DG=Array.from(Array(3).keys()),LG=Array.from(Array(3).keys());function MG(e){var t=e.children,r=e.x,n=e.y,o=e.width,a=e.height,i=e.className,s=e.surroundStyle;return dv.createElement(NG,{className:i},dv.createElement("tbody",null,DG.map((function(e,i){return dv.createElement("tr",{key:e,style:{height:0===i?n:"auto"},"data-testid":"row"},LG.map((function(e,n){var c=1===i&&1===n,u="auto";return c?u=o:0===n&&(u=r),dv.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:og({width:u,height:c?a:"auto"},c?{}:s)},c?dv.createElement(OG,{style:{width:u,height:a}},t):null)})))}))))}MG.propTypes={children:Lv.node,x:Lv.string,y:Lv.string,width:Lv.string,height:Lv.string,className:Lv.string,surroundStyle:Lv.object},MG.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var FG=aw(MG)(AG||(AG=pg(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n"])));function UG(e){var t=e.className;return dv.createElement("svg",{className:t,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},dv.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),dv.createElement("desc",null,"Created with sketchtool."),dv.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},dv.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},dv.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},dv.createElement("g",{id:"Group-2"},dv.createElement("g",{id:"camera"},dv.createElement("path",{d:"M21,3 L17,3 L15,0 L9,0 L7,3 L3,3 C1.34314575,3 0,4.34314575 0,6 L0,18 C0,19.6568542 1.34314575,21 3,21 L21,21 C22.6568542,21 24,19.6568542 24,18 L24,6 C24,4.34314575 22.6568542,3 21,3 Z M12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.7614237,7 17,9.23857625 17,12 C17,14.7614237 14.7614237,17 12,17 L12,17 Z",id:"Shape"})))))))}UG.propTypes={className:Lv.string},UG.defaultProps={className:""};var jG=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},VG="object"==typeof t&&t&&t.Object===Object&&t,zG="object"==typeof self&&self&&self.Object===Object&&self,qG=VG||zG||Function("return this")(),HG=function(){return qG.Date.now()},KG=/\s/;var WG=function(e){for(var t=e.length;t--&&KG.test(e.charAt(t)););return t},GG=/^\s+/;var QG=function(e){return e?e.slice(0,WG(e)+1).replace(GG,""):e},XG=qG.Symbol,YG=Object.prototype,$G=YG.hasOwnProperty,ZG=YG.toString,JG=XG?XG.toStringTag:void 0;var eQ=function(e){var t=$G.call(e,JG),r=e[JG];try{e[JG]=void 0;var n=!0}catch(e){}var o=ZG.call(e);return n&&(t?e[JG]=r:delete e[JG]),o},tQ=Object.prototype.toString;var rQ=function(e){return tQ.call(e)},nQ=XG?XG.toStringTag:void 0;var oQ=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":nQ&&nQ in Object(e)?eQ(e):rQ(e)};var aQ=function(e){return null!=e&&"object"==typeof e};var iQ=function(e){return"symbol"==typeof e||aQ(e)&&"[object Symbol]"==oQ(e)},sQ=/^[-+]0x[0-9a-f]+$/i,cQ=/^0b[01]+$/i,uQ=/^0o[0-7]+$/i,lQ=parseInt;var dQ=function(e){if("number"==typeof e)return e;if(iQ(e))return NaN;if(jG(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=jG(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=QG(e);var r=cQ.test(e);return r||uQ.test(e)?lQ(e.slice(2),r?2:8):sQ.test(e)?NaN:+e},fQ=Math.max,pQ=Math.min;var hQ=function(e,t,r){var n,o,a,i,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var r=n,a=o;return n=o=void 0,u=t,i=e.apply(a,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):i}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=a}function g(){var e=HG();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?pQ(r,a-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,i)}function y(){var e=HG(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return clearTimeout(s),s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),i}return t=dQ(t)||0,jG(r)&&(l=!!r.leading,a=(d="maxWait"in r)?fQ(dQ(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?i:v(HG())},y};var mQ=function(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return jG(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),hQ(e,t,{leading:n,maxWait:t,trailing:o})};var gQ=function(e){if(!jG(e))return!1;var t=oQ(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},vQ=qG["__core-js_shared__"],yQ=function(){var e=/[^.]+$/.exec(vQ&&vQ.keys&&vQ.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var bQ=function(e){return!!yQ&&yQ in e},wQ=Function.prototype.toString;var kQ=function(e){if(null!=e){try{return wQ.call(e)}catch(e){}try{return e+""}catch(e){}}return""},CQ=/^\[object .+?Constructor\]$/,EQ=Function.prototype,SQ=Object.prototype,BQ=EQ.toString,_Q=SQ.hasOwnProperty,xQ=RegExp("^"+BQ.call(_Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var TQ=function(e){return!(!jG(e)||bQ(e))&&(gQ(e)?xQ:CQ).test(kQ(e))};var AQ=function(e,t){return null==e?void 0:e[t]};var IQ=function(e,t){var r=AQ(e,t);return TQ(r)?r:void 0},PQ=function(){try{var e=IQ(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var RQ=function(e,t,r){"__proto__"==t&&PQ?PQ(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r};var NQ=function(e,t){return e===t||e!=e&&t!=t},OQ=Object.prototype.hasOwnProperty;var DQ=function(e,t,r){var n=e[t];OQ.call(e,t)&&NQ(n,r)&&(void 0!==r||t in e)||RQ(e,t,r)};var LQ=function(e,t,r,n){var o=!r;r||(r={});for(var a=-1,i=t.length;++a<i;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?RQ(r,s,c):DQ(r,s,c)}return r};var MQ=function(e){return e};var FQ=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},UQ=Math.max;var jQ=function(e,t,r){return t=UQ(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=UQ(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),FQ(e,this,s)}};var VQ=function(e){return function(){return e}},zQ=PQ?function(e,t){return PQ(e,"toString",{configurable:!0,enumerable:!1,value:VQ(t),writable:!0})}:MQ,qQ=Date.now;var HQ=function(e){var t=0,r=0;return function(){var n=qQ(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(zQ);var KQ=function(e,t){return HQ(jQ(e,t,MQ),e+"")};var WQ=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var GQ=function(e){return null!=e&&WQ(e.length)&&!gQ(e)},QQ=/^(?:0|[1-9]\d*)$/;var XQ=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&QQ.test(e))&&e>-1&&e%1==0&&e<t};var YQ=function(e,t,r){if(!jG(r))return!1;var n=typeof t;return!!("number"==n?GQ(r)&&XQ(t,r.length):"string"==n&&t in r)&&NQ(r[t],e)};var $Q=function(e){return KQ((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,i&&YQ(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,a)}return t}))};var ZQ=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n};var JQ=function(e){return aQ(e)&&"[object Arguments]"==oQ(e)},eX=Object.prototype,tX=eX.hasOwnProperty,rX=eX.propertyIsEnumerable,nX=JQ(function(){return arguments}())?JQ:function(e){return aQ(e)&&tX.call(e,"callee")&&!rX.call(e,"callee")},oX=Array.isArray;var aX=function(){return!1},iX=n((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?qG.Buffer:void 0,a=(o?o.isBuffer:void 0)||aX;e.exports=a})),sX={};sX["[object Float32Array]"]=sX["[object Float64Array]"]=sX["[object Int8Array]"]=sX["[object Int16Array]"]=sX["[object Int32Array]"]=sX["[object Uint8Array]"]=sX["[object Uint8ClampedArray]"]=sX["[object Uint16Array]"]=sX["[object Uint32Array]"]=!0,sX["[object Arguments]"]=sX["[object Array]"]=sX["[object ArrayBuffer]"]=sX["[object Boolean]"]=sX["[object DataView]"]=sX["[object Date]"]=sX["[object Error]"]=sX["[object Function]"]=sX["[object Map]"]=sX["[object Number]"]=sX["[object Object]"]=sX["[object RegExp]"]=sX["[object Set]"]=sX["[object String]"]=sX["[object WeakMap]"]=!1;var cX=function(e){return aQ(e)&&WQ(e.length)&&!!sX[oQ(e)]};var uX=function(e){return function(t){return e(t)}},lX=n((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&VG.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a})),dX=lX&&lX.isTypedArray,fX=dX?uX(dX):cX,pX=Object.prototype.hasOwnProperty;var hX=function(e,t){var r=oX(e),n=!r&&nX(e),o=!r&&!n&&iX(e),a=!r&&!n&&!o&&fX(e),i=r||n||o||a,s=i?ZQ(e.length,String):[],c=s.length;for(var u in e)!t&&!pX.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||XQ(u,c))||s.push(u);return s},mX=Object.prototype;var gX=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||mX)};var vX=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},yX=Object.prototype.hasOwnProperty;var bX=function(e){if(!jG(e))return vX(e);var t=gX(e),r=[];for(var n in e)("constructor"!=n||!t&&yX.call(e,n))&&r.push(n);return r};var wX=function(e){return GQ(e)?hX(e,!0):bX(e)},kX=$Q((function(e,t,r,n){LQ(t,wX(t),e,n)}));var CX=function(e,t){return function(r){return e(t(r))}},EX=CX(Object.getPrototypeOf,Object),SX=Function.prototype,BX=Object.prototype,_X=SX.toString,xX=BX.hasOwnProperty,TX=_X.call(Object);var AX=function(e){if(!aQ(e)||"[object Object]"!=oQ(e))return!1;var t=EX(e);if(null===t)return!0;var r=xX.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&_X.call(r)==TX};var IX=function(e){if(!aQ(e))return!1;var t=oQ(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!AX(e)},PX=KQ((function(e,t){try{return FQ(e,void 0,t)}catch(e){return IX(e)?e:new Error(e)}}));var RX=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o};var NX=function(e,t){return RX(t,(function(t){return e[t]}))},OX=Object.prototype,DX=OX.hasOwnProperty;var LX=function(e,t,r,n){return void 0===e||NQ(e,OX[r])&&!DX.call(n,r)?t:e},MX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var FX=function(e){return"\\"+MX[e]},UX=CX(Object.keys,Object),jX=Object.prototype.hasOwnProperty;var VX=function(e){if(!gX(e))return UX(e);var t=[];for(var r in Object(e))jX.call(e,r)&&"constructor"!=r&&t.push(r);return t};var zX=function(e){return GQ(e)?hX(e):VX(e)},qX=/<%=([\s\S]+?)%>/g;var HX=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),KX=XG?XG.prototype:void 0,WX=KX?KX.toString:void 0;var GX=function e(t){if("string"==typeof t)return t;if(oX(t))return RX(t,e)+"";if(iQ(t))return WX?WX.call(t):"";var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r};var QX=function(e){return null==e?"":GX(e)},XX=/[&<>"']/g,YX=RegExp(XX.source);var $X={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:qX,variable:"",imports:{_:{escape:function(e){return(e=QX(e))&&YX.test(e)?e.replace(XX,HX):e}}}},ZX=/\b__p \+= '';/g,JX=/\b(__p \+=) '' \+/g,eY=/(__e\(.*?\)|\b__t\)) \+\n'';/g,tY=/[()=,{}\[\]\/\s]/,rY=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nY=/($^)/,oY=/['\n\r\u2028\u2029\\]/g,aY=Object.prototype.hasOwnProperty;var iY=function(e,t,r){var n=$X.imports._.templateSettings||$X;r&&YQ(e,t,r)&&(t=void 0),e=QX(e),t=kX({},t,n,LX);var o,a,i=kX({},t.imports,n.imports,LX),s=zX(i),c=NX(i,s),u=0,l=t.interpolate||nY,d="__p += '",f=RegExp((t.escape||nY).source+"|"+l.source+"|"+(l===qX?rY:nY).source+"|"+(t.evaluate||nY).source+"|$","g"),p=aY.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,i,s,c){return n||(n=i),d+=e.slice(u,c).replace(oY,FX),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var h=aY.call(t,"variable")&&t.variable;if(h){if(tY.test(h))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(ZX,""):d).replace(JX,"$1").replace(eY,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=PX((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(m.source=d,IX(m))throw m;return m},sY=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cY=/^\w*$/;var uY=function(e,t){if(oX(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!iQ(e))||(cY.test(e)||!sY.test(e)||null!=t&&e in Object(t))},lY=IQ(Object,"create");var dY=function(){this.__data__=lY?lY(null):{},this.size=0};var fY=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},pY=Object.prototype.hasOwnProperty;var hY=function(e){var t=this.__data__;if(lY){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return pY.call(t,e)?t[e]:void 0},mY=Object.prototype.hasOwnProperty;var gY=function(e){var t=this.__data__;return lY?void 0!==t[e]:mY.call(t,e)};var vY=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=lY&&void 0===t?"__lodash_hash_undefined__":t,this};function yY(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}yY.prototype.clear=dY,yY.prototype.delete=fY,yY.prototype.get=hY,yY.prototype.has=gY,yY.prototype.set=vY;var bY=yY;var wY=function(){this.__data__=[],this.size=0};var kY=function(e,t){for(var r=e.length;r--;)if(NQ(e[r][0],t))return r;return-1},CY=Array.prototype.splice;var EY=function(e){var t=this.__data__,r=kY(t,e);return!(r<0)&&(r==t.length-1?t.pop():CY.call(t,r,1),--this.size,!0)};var SY=function(e){var t=this.__data__,r=kY(t,e);return r<0?void 0:t[r][1]};var BY=function(e){return kY(this.__data__,e)>-1};var _Y=function(e,t){var r=this.__data__,n=kY(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function xY(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}xY.prototype.clear=wY,xY.prototype.delete=EY,xY.prototype.get=SY,xY.prototype.has=BY,xY.prototype.set=_Y;var TY=xY,AY=IQ(qG,"Map");var IY=function(){this.size=0,this.__data__={hash:new bY,map:new(AY||TY),string:new bY}};var PY=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var RY=function(e,t){var r=e.__data__;return PY(t)?r["string"==typeof t?"string":"hash"]:r.map};var NY=function(e){var t=RY(this,e).delete(e);return this.size-=t?1:0,t};var OY=function(e){return RY(this,e).get(e)};var DY=function(e){return RY(this,e).has(e)};var LY=function(e,t){var r=RY(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function MY(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}MY.prototype.clear=IY,MY.prototype.delete=NY,MY.prototype.get=OY,MY.prototype.has=DY,MY.prototype.set=LY;var FY=MY;function UY(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(UY.Cache||FY),r}UY.Cache=FY;var jY=UY;var VY=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zY=/\\(\\)?/g,qY=function(e){var t=jY(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(VY,(function(e,r,n,o){t.push(n?o.replace(zY,"$1"):r||e)})),t}));var HY=function(e,t){return oX(e)?e:uY(e,t)?[e]:qY(QX(e))};var KY=function(e){if("string"==typeof e||iQ(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t};var WY=function(e,t){for(var r=0,n=(t=HY(t,e)).length;null!=e&&r<n;)e=e[KY(t[r++])];return r&&r==n?e:void 0};var GY=function(e,t,r){var n=null==e?void 0:WY(e,t);return void 0===n?r:n},QY=aI.Errors;function XY(e){var t=e.livenessSettings,r=e.apiClient,n=e.apiCheck,o=e.onError,a=hg(dv.useState({face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,take_one_picture_time_ms:3e3,limit_time_liveness_check:{enable:!1,limit_time_second:45},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5},exif_data_settings:{enable:!0},record_video:{enable:!1}}),2),i=a[0],s=a[1];return dv.useEffect((function(){t&&Object.keys(t).length>0?s((function(e){return og(og({},e),t)})):n&&r.clientSettings().then((function(e){if(e&&e.data){var t,r=GY(e,"data.settings.sdk_settings.active_liveness_settings"),n=GY(e,"data.settings.sdk_settings.liveness_settings"),a=GY(r,"save_encoded_frames",{});a.enable&&(t={enable:!0,framesIntervalTime:a.frames_interval_ms,framesBatchLength:a.frames_batch_len});var i=GY(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});s(og(og(og({},r),n),{},{captureFrameSettings:t,exif_data_settings:i}))}e&&e.errors&&o(QY.server_error)})).catch((function(e){o(e)}))}),[t,r,o,n]),i}var YY=function(e){var t=e.curStep,r=e.faceDirection,n=GY(t,"stepTimeConstraints.delayTime");return!!n&&(null===t.firstFrameSpottedAt?(t.name===r&&(t.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-t.firstFrameSpottedAt<n)};var $Y=function(e){return e?Infinity===(e=dQ(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var ZY=function(e){var t=$Y(e),r=t%1;return t==t?r?t-r:t:0};var JY=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=ZY(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}};var e$=function(e){return JY(2,e)},t$=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.closeEyesModelUrl,n=void 0===r?WM:r,e.next=3,SL.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function r$(){return(r$=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.blazefaceModelUrl,n=t.tfScriptUrls,o=t.closeEyesModelUrl,a=new GM(o),e.next=4,SL.loadTensorFlow(n);case 4:return e.next=6,SL.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[SL.loadBlazefaceModel({modelUrl:r}),a.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=hg(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:a});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var n$,o$=e$((function(){return r$.apply(this,arguments)})),a$=[],i$=function(){a$=[]},s$=function(e,t,r){r&&i$(),a$.push({id:null});var n=a$.length-1;t.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?a$[n].id=e.data.file_id:a$[n].id=-1}))},c$=function(e,t,r){r&&i$(),a$.push({id:null});var n=a$.length-1;t.uploadFiles({frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?a$[n].id=e.data.file_id:a$[n].id=-1}))},u$=function(){return new Promise((function(e){var t=setInterval((function(){a$.every((function(e){return e.id}))&&(e(),clearInterval(t))}),200)}))},l$=function(e){return e.enable?a$.some((function(e){return-1===e.id}))?null:a$:[]},d$=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.steps,n=t.apiClient,o=t.FaceDirection,a=t.outputEncryptionSettings,i=t.video,s=[],r.forEach((function(e){var t=e.name,r=e.image,i=e.frontalFaceImage;if(t!==o.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:r.leftRightScore,gesture:t})};a&&a.key?s.push(n.httpClient.post("/v1/images",og({base64:r.encrypted.hex},c),{"X-TV-Key":a.key})):s.push(n.uploadImage(og({file:r.blob},c)))}else s.push(Promise.resolve({data:{image_id:null}}));if(i.blob){var u={label:"portrait",metadata:JSON.stringify({gesture_score:i.leftRightScore,gesture:o.FRONTAL})};a&&a.key?s.push(n.httpClient.post("/v1/images",og({base64:i.encrypted.hex},u),{"X-TV-Key":a.key})):s.push(n.uploadImage(og({file:i.blob},u)))}else s.push(Promise.resolve({data:{image_id:null}}))})),c=i?n.uploadFile({file:i,label:"video"}):Promise.resolve({data:{file_id:null}}),e.next=6,Promise.all([c].concat(s));case 6:return u=e.sent,l=gg(p=u)||vg(p)||yg(p)||wg(),d=l[0],f=l.slice(1),r.forEach((function(e,t){e.image.imageId=f[2*t].data.image_id,e.frontalFaceImage.imageId=f[2*t+1].data.image_id})),e.abrupt("return",d);case 12:case"end":return e.stop()}var p}),e)})));return function(t){return e.apply(this,arguments)}}(),f$=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.faceVerificationFlowData,o=t.onLivenessDetectionDone,a=t.captureFrameSettings,i=t.FaceDirection,s=t.onError,c=t.outputEncryptionSettings,u=t.video,e.prev=1,l=n.current.steps,e.next=5,d$({steps:l,apiClient:r,FaceDirection:i,outputEncryptionSettings:c,video:u});case 5:if(0!==(d=l.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=10;break}o({error:"wrong_face_movement"}),e.next=27;break;case 10:return e.next=12,u$();case 12:if(f=l$(a)){e.next=17;break}o({error:"network_error"}),e.next=27;break;case 17:return p=r.verifyFaceLiveness({images:d.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:l.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:f}),h=r.requestVerifyPortrait({image:{id:d[d.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([p,h]);case 21:m=e.sent,g=hg(m,2),v=g[0],y=g[1],b=!0===v.data.is_live,o({apiCheckPassed:b,verifyFaceLivenessResult:v.data,verifyFacePortraitResult:y.data,frontalFaces:d.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:l.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){var t=e.name,r=e.image;return{name:t,blob:r.blob,id:r.imageId}}))});case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(1),s({error:e.t0});case 32:case"end":return e.stop()}}),e,null,[[1,29]])})));return function(t){return e.apply(this,arguments)}}(),p$=[],h$=null,m$=!1,g$=function(){return p$},v$=function(){m$=!0,p$=[];try{h$ instanceof MediaStream&&(h$.getTracks().forEach((function(e){return e.stop()})),h$=null)}catch(e){}};function y$(e,t,r){if(e.data.size>0){var n=new Blob([e.data],{type:"video/mp4"});p$.push(n),t()}else console.error("No video have recored!"),r()}function b$(e,t,r,n){if(e&&n){var o=n.cropX,a=n.cropY,i=n.cropWidth,s=n.cropHeight;e.drawImage(t,o,a,i,s,0,0,r,r),m$||requestAnimationFrame((function(){return b$(e,t,r,n)}))}}function w$(e){return k$.apply(this,arguments)}function k$(){return(k$=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.outputImagesSize,n=t.videoEl,o=t.resultAnalyzeVideoAndWindowSizes,v$(),(i=document.createElement("canvas")).width=r,i.height=r,s=i.getContext("2d"),e.prev=6,c={width:{min:360,ideal:400},height:{min:360,ideal:400}},u={mimeType:"video/webm"},e.prev=9,h$=null==n||null===(l=n.captureStream())||void 0===l?void 0:l.clone(),d=h$.getVideoTracks()[0],e.next=14,d.applyConstraints(c);case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(9);case 18:MediaRecorder.isTypeSupported("video/mp4")&&(m$=!1,b$(s,n,r,o),h$=i.captureStream(25),u={mimeType:"video/mp4",videoBitsPerSecond:25e5}),a=new MediaRecorder(h$,u),f=function(){return new Promise((function(e,t){a.ondataavailable=function(r){return y$(r,e,t)},"inactive"!==a.state&&a.stop()}))},p=function(){var e=$m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f();case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),h=function(){"inactive"!==a.state&&a.stop()},a.stopVideoRecording=p,a.discardRecording=h,e.next=29;break;case 27:e.prev=27,e.t1=e.catch(6);case 29:return e.abrupt("return",{mediaRecorder:a});case 30:case"end":return e.stop()}}),e,null,[[6,27],[9,16]])})))).apply(this,arguments)}var C$,E$,S$,B$,_$,x$,T$,A$=FO.faceTracker(),I$=new AL,P$=aI.Mode,R$=aI.FaceDirection,N$=aI.Errors,O$=aI.Messages,D$=aI.TrackLivenessEvents,L$={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(n$={},tg(n$,aI.FaceDirection.UP,{delayTime:0}),tg(n$,aI.FaceDirection.LEFT,{delayTime:0}),tg(n$,aI.FaceDirection.RIGHT,{delayTime:0}),tg(n$,aI.FaceDirection.FRONTAL,{delayTime:2e3}),n$),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}},M$=function(e){var t=e.apiCredentials,r=e.sdkAdapter,n=$D.useApiClient({apiCredentials:t}).apiClient;return{apiClient:r instanceof eF?r:n,apiClientFromUtils:n}};function F$(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,r=e.mode,n=e.bgCameraMask,o=e.bgCameraMaskRed,a=e.surroundStyle,i=e.cropAreaDimension,s=e.customInstructions,c=e.customIcon,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=void 0===l?L$.customStepTimeConstraints:l,f=e.onLivenessDetectionDone,p=e.onError,h=e.frontalMinSize,m=e.waitingTimeToGetBetterFrames,g=void 0===m?500:m,v=e.captureFrameSettings,y=void 0===v?L$.captureFrameSettings:v,b=e.livenessSettings,w=e.setRemainingTime,k=void 0===w?L$.setRemainingTime:w,C=e.onProcessing,E=void 0===C?L$.onProcessing:C,S=e.customErrors,B=e.customMessages,_=e.apiCredentials,x=void 0===_?{}:_,T=e.onFramesCaptured,A=void 0===T?L$.onFramesCaptured:T,I=e.initFirstGestureTimeout,P=void 0===I?2e3:I,R=e.outputEncryptionSettings,N=e.cameraScale,O=void 0===N?1:N,D=e.passiveModeAuto,L=void 0!==D&&D,M=e.sendCustomEvent,F=e.sdkAdapter,U=void 0===F?null:F,j=dv.useState(!1),V=hg(j,2),z=V[0],q=V[1],H=dv.useState(!1),K=hg(H,2),W=K[0],G=K[1],Q=dv.useState(!1),X=hg(Q,2),Y=X[0],$=X[1],Z=dv.useState(!1),J=hg(Z,2),ee=J[0],te=J[1],re=dv.useRef(null),ne=hN.useSDKSettings(),oe=ne.lang,ae=ne.assetRoot,ie=ne.customUrls,se=r===P$.ACTIVE,ce=dv.useReducer((function(e){return e+1}),0),ue=hg(ce,2),le=(ue[0],ue[1]),de=dv.useRef(null),fe=dv.useRef(!1),pe=dv.useState(!1),he=hg(pe,2),me=he[0],ge=he[1],ve=dv.useRef({}),ye=M$({apiCredentials:x,sdkAdapter:U}),be=ye.apiClient,we=ye.apiClientFromUtils,ke=KN.useSDKTracking(),Ce=ke.sendEvent,Ee=XM(),Se=Ee.startMotion,Be=Ee.stopMotion,_e=Ee.motionData,xe=Ee.orientationData,Te=dv.useRef(null);null===Te.current&&(Te.current=FO.initFaceVerificationData({assetRoot:ae,customInstructions:s,customIcon:c,customDirectionIcon:u,customStepTimeConstraints:d}));var Ae=dv.useState(),Ie=hg(Ae,2),Pe=Ie[0],Re=Ie[1],Ne=dv.useCallback((function(e){Re(e)}),[]),Oe=dv.useMemo((function(){return mQ(Ne,500)}),[Ne]),De=dv.useRef([]),Le=dv.useRef(),Me=XY({livenessSettings:b,apiClient:we,apiCheck:t,onError:p}),Fe=Me.face_tracking_setting,Ue=Me.flow_interval_time_ms,je=Me.limit_time_liveness_check,Ve=Me.terminate_if_no_face,ze=Me.close_eye_detector,qe=void 0===ze?{}:ze,He=Me.captureFrameSettings,Ke=void 0===He?y:He,We=Me.exif_data_settings,Ge=Me.take_one_picture_time_ms,Qe=Me.record_video,Xe=null==Qe?void 0:Qe.enable,Ye=dv.useRef(""),$e=dv.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==D$?void 0:D$.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===Ye.current)return;Ye.current=r}Ce(e),M&&M(e)}}),[M,Ce]),Ze=dv.useMemo((function(){return mQ((function(e){$e(e)}),2e3)}),[$e]),Je=dv.useRef(0),et=dv.useRef(),tt=dv.useRef();dv.useEffect((function(){$e({tag:"selfie",event:null==D$?void 0:D$.start_camera,log:{}})}),[$e]),dv.useEffect((function(){return I$.start(),KM.initExifData(),function(){I$.stop()}}),[]),dv.useEffect((function(){var e=!1;function t(){return(t=$m(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(me){t.next=13;break}return Le.current=performance.now(),t.next=4,o$(ie);case 4:return ve.current=t.sent,t.next=7,SL.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){t.next=9;break}return t.abrupt("return");case 9:ge(!0),$e({tag:"selfie",event:null==D$?void 0:D$.show_warmup,log:{}}),$e({tag:"selfie",event:null==D$?void 0:D$.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Le.current}}),Le.current=null;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[me,ie,$e]);var rt=dv.useCallback((function(){var e;k(""),Te.current.curStepIndex=Te.current.steps.length,$(!1),I$.stop(),null===(e=tt.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;Te.current=FO.initFaceVerificationData({assetRoot:ae,customInstructions:s,customIcon:c,customDirectionIcon:u}),I$.start(),Je.current=0,et.current=null,De.current=[],te(!1),i$(),null===(e=tt.current)||void 0===e||e.start(),le()}),Ue)}),[ae,s,c,u,Ue,k]),nt=dv.useMemo((function(){return og(og({},N$),S)}),[S]),ot=dv.useMemo((function(){return og(og({},O$),B)}),[B]),at=400;dv.useEffect((function(){if(W&&je.enable&&ee){var e=je.limit_time_second+1,t=je.remain_time_show||10,r=je.format||"s";I$.start("limit",(function(n){var o=e-n;if(Te.current.curStepIndex<Te.current.steps.length){if(o<=t&&o>=1){var a=iY(ot.REMAIN_TIME[oe]),i=o;switch(r){case"mm:ss":i=o.toString().padStart(5,"00:00");break;case"ss":i=o.toString().padStart(2,"0")}k(a({x:i}))}if(0===o){var s,c={};Object.keys(null===(s=nt.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=iY(null===(t=nt.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:je.limit_time_second})})),Re(og(og({},nt.liveness_terminated_time_out),{},{msg:c,duration:Ue})),$e({tag:"selfie",event:null==D$?void 0:D$.show_alert,log:{alert:"liveness_terminated_time_out,"}}),rt()}}}))}}),[rt,k,W,oe,Ue,je.enable,je.limit_time_second,ee,nt.liveness_terminated_time_out,ot.REMAIN_TIME,je.format,je.remain_time_show,$e]);var it=dv.useCallback((function(e){var t,r,o=e.clientWidth,s=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;WW.isMobile?r=t=c:t=r=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=n;de.current={x:f,y:p,width:t,height:r,image:h,surroundStyle:a},"object"===Xm(i)?de.current=og(og({},de.current),i):"function"==typeof i&&(de.current=og(og({},de.current),i({clientWidth:o,clientHeight:s,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:WW.isMobile,width:t,height:r}))),le(),G(!0)}),[n,a,i]),st=dv.useState(3),ct=hg(st,2),ut=ct[0],lt=ct[1],dt=dv.useState(!1),ft=hg(dt,2),pt=ft[0],ht=ft[1],mt=dv.useRef(!1),gt=dv.useCallback((function(e){ht(e),mt.current=e}),[]),vt=dv.useRef(null),yt=dv.useRef([]),bt=dv.useCallback((function(){lt(3),clearInterval(vt.current),gt(!0);var e=function(){var e=$m(regeneratorRuntime.mark((function e(r){var n,o,a,i,s,c,u,l,d,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r-1!=0){e.next=27;break}return clearInterval(vt.current),o=yt.current,E(),q(!0),e.next=7,null===(n=tt.current)||void 0===n?void 0:n.stopVideoRecording();case 7:return Be(),KM.preWriteExif({mode:KM.MODE.SELFIE,motionData:_e,orientationData:xe,startTime:Date.now()-1e3*I$.duration("from_1st_frame"),endTime:Date.now()}),a=o.map((function(e){return FD.resizeBlobImg(e.blob,at,at)})),e.next=12,Promise.all(a);case 12:return i=e.sent,s=i.map((function(e,t){return KM.writeExif({mode:KM.MODE.SELFIE,imageData:og(og({},o[t]),{},{blob:e,gesture:"frontal"}),enableExifData:We.enable})})),e.next=16,Promise.all(s);case 16:if(c=e.sent,u={},!R||!R.key){e.next=25;break}return l=R.key,d=c.map((function(e){return TL.encrypt({blob:e,key:l})})),e.next=23,Promise.all(d);case 23:h=e.sent,u={frontalFacesEncrypted:h};case 25:t?(g=mg(De.current),v=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:R$.FRONTAL})}},y=o.map((function(e,t){return be.uploadImage(og({file:c[t]},v(e.leftRightScore)))})),R&&R.key&&(y=o.map((function(e,t){return we.httpClient.post("/v1/images",og({base64:u.frontalFacesEncrypted[t].hex},v(e.leftRightScore)),{"X-TV-Key":R.key})}))),Promise.all(y).then((function(e){return be.verifyFaceLiveness({images:e.map((function(e){return{id:e.data.image_id}})),videos:[{frames:g}]})})).then((function(e){f({apiCheckPassed:e.data.is_live,verifyFaceLivenessResult:e.data})})).catch((function(e){p({error:e})}))):U instanceof eF?(q(!0),m=og(og({mode:P$.PASSIVE,imageAddedExif:c,frontalFaceImages:o},u),{},{capturedFrames:De.current,steps:Te.current.steps}),f(m),q(!1)):(f(og(og({frontalFaces:c},u),{},{capturedFrames:De.current,video:g$()})),v$()),q(!1);case 27:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();vt.current=setInterval((function(){lt((function(t){return e(t),t-1}))}),Ge/3)}),[Ge,gt,t,f,be,we,p,E,R,Be,_e,xe,We.enable,U]),wt=dv.useRef({});dv.useEffect((function(){wt.current.isFirstValidFrameFoundRef=ee}),[ee]),dv.useEffect((function(){var e,r=re.current,a=function(){var e=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Te.current.steps,r=[],t.map((function(e){return r.push({name:e.name,blob:e.image.blob,captureTime:e.image.captureTime,gesture:e.name}),e.frontalFaceImage.blob&&r.push({name:e.name,blob:e.frontalFaceImage.blob,captureTime:e.frontalFaceImage.captureTime,gesture:R$.FRONTAL}),0})),n=r.map((function(e){return FD.resizeBlobImg(e.blob,at,at)})),e.next=6,Promise.all(n);case 6:return o=e.sent,a="0",y.framesBatchLength>0&&(i="".concat(Math.floor(De.current.length/y.framesBatchLength),"x").concat(y.framesBatchLength),s=De.current.length%y.framesBatchLength>0?"+".concat(De.current.length%y.framesBatchLength):"",a="".concat(De.current.length,":").concat(i).concat(s)),c=o.map((function(e,t){return KM.writeExif({mode:KM.MODE.SELFIE,imageData:og(og({},r[t]),{},{blob:e,frames:a}),enableExifData:We.enable})})),e.next=12,Promise.all(c);case 12:return u=e.sent,l=r.map((function(e,t){return{name:e.name,blob:u[t]}})),e.next=16,Promise.all(t.map(function(){var e=$m(regeneratorRuntime.mark((function e(r,n){var o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=l.filter((function(e){return e.name===r.name})),t[n].image.blob=o[0].blob,r.frontalFaceImage.blob&&(t[n].frontalFaceImage.blob=o[1].blob),!R||!R.key){e.next=12;break}return a=R.key,e.next=7,TL.encrypt({blob:o[0].blob,key:a});case 7:if(t[n].image.encrypted=e.sent,!r.frontalFaceImage.blob){e.next=12;break}return e.next=11,TL.encrypt({blob:o[1].blob,key:a});case 11:t[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),i=function(){var e=$m(regeneratorRuntime.mark((function e(){var r,n,o,i,s,c,u,l,d,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Te.current.steps,o=n[Te.current.curStepIndex],tg(r={},aI.FaceDirection.UP,null==D$?void 0:D$.capture_up_face),tg(r,aI.FaceDirection.LEFT,null==D$?void 0:D$.capture_left_face),tg(r,aI.FaceDirection.RIGHT,null==D$?void 0:D$.capture_right_face),tg(r,aI.FaceDirection.FRONTAL,null==D$?void 0:D$.capture_frontal_face),$e({tag:"selfie",event:r[o.name],log:{time_capture_in_seconds:((performance.now()-Le.current)/1e3).toFixed(1)}}),Te.current.curStepIndex++,Le.current=performance.now(),Fe.enable&&"each_gesture"===Fe.limit_for&&(Je.current=0),Te.current.curStepIndex!==n.length){e.next=48;break}if(je.enable&&k(""),!f){e.next=48;break}return Ke.enable&&Ke.framesBatchLength>0&&De.current.length%Ke.framesBatchLength>0&&(A(De.current.slice(De.current.length%Ke.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t?s$(De.current.slice(De.current.length%Ke.framesBatchLength*-1),we):U instanceof eF&&c$(De.current.slice(De.current.length%Ke.framesBatchLength*-1),be)),$e({tag:"selfie",event:null==D$?void 0:D$.finish_capture,log:{time_capture_in_seconds:I$.duration("from_1st_frame")}}),E(),q(!0),e.next=16,null===(i=tt.current)||void 0===i?void 0:i.stopVideoRecording();case 16:return Be(),KM.preWriteExif({mode:KM.MODE.SELFIE,motionData:_e,orientationData:xe,startTime:Date.now()-1e3*I$.duration("from_1st_frame"),endTime:Date.now()}),e.next=20,a();case 20:if(t){e.next=40;break}if(d=n.filter((function(e){return e.name!==R$.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),m=n.filter((function(e){return e.name!==R$.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),g=n.filter((function(e){return e.name!==R$.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),v=null===(s=n.find((function(e){return e.name===R$.FRONTAL})))||void 0===s||null===(c=s.image)||void 0===c?void 0:c.blob,y=null===(u=n.find((function(e){return e.name===R$.FRONTAL})))||void 0===u||null===(l=u.image)||void 0===l?void 0:l.encrypted,!v||!h){e.next=32;break}return e.next=29,FD.scaleImage(v,{minSize:h});case 29:e.t0=e.sent,e.next=33;break;case 32:e.t0=null;case 33:b=e.t0,v&&m.push(v),y&&g.push(y),$e({tag:"result",event:null==D$?void 0:D$.liveness_detection_done,log:{result_object:{steps:d,frontalFaces:m,frontalScaledImage:b}}}),f(U instanceof eF?{mode:P$.ACTIVE,faceVerificationFlowData:Te,captureFrameSettings:Ke,FaceDirection:R$,capturedFrames:De.current}:{steps:d,frontalFaces:m,frontalFacesEncrypted:g,frontalScaledImage:b,capturedFrames:De.current}),e.next=47;break;case 40:if(!(U instanceof eF)){e.next=45;break}f({mode:P$.ACTIVE,faceVerificationFlowData:Te,captureFrameSettings:Ke,FaceDirection:R$,capturedFrames:De.current,video:g$().length?g$()[0]:null}),v$(),e.next=47;break;case 45:return e.next=47,f$({apiClient:be,faceVerificationFlowData:Te,onLivenessDetectionDone:f,captureFrameSettings:Ke,FaceDirection:R$,onError:p,outputEncryptionSettings:R,video:g$().length?g$()[0]:null});case 47:q(!1);case 48:le();case 49:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=hQ((function(){var e=Te.current,t=e.curStepIndex,r=e.steps,n=r[t],o=null!==(null==n?void 0:n.image.blob),a=null!==(null==n?void 0:n.frontalFaceImage.blob),s=r.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(a||![1].includes(t)||s>=1)?(fe.current=!1,i(),c=!0):fe.current=!(!o||a),$(!1),c}),g);function c(e){return u.apply(this,arguments)}function u(){return(u=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.blurScore,a=t.leftRightScore,c=t.isEyeClose,u=Te.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!YY({faceDirection:r,curStep:f})){e.next=6;break}return e.abrupt("return");case 6:if(!c){e.next=8;break}return e.abrupt("return");case 8:if(r!==R$.FRONTAL||null!==f.frontalFaceImage.blurScore&&!wO.hasBetterBlurScore(o,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=o,e.next=12,CO.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=a,f.frontalFaceImage.captureTime=Date.now(),fe.current&&(fe.current=!1,i());case 17:if(f.name!==r||null!==f.image.blurScore&&!wO.hasBetterBlurScore(o,f.image.blurScore)){e.next=29;break}return $(!0),f.image.blurScore=o,e.next=22,CO.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=a,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(h),s();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,t,r){return m.apply(this,arguments)}function m(){return(m=$m(regeneratorRuntime.mark((function e(t,r,n){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!0===mt.current&&t===R$.FRONTAL&&yt.current.length<3)){e.next=5;break}return e.next=3,CO.takePicture({canvas:r});case 3:o=e.sent,yt.current.push({blob:o,leftRightScore:n,captureTime:Date.now()});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e,r,n,o){if(De.current.length&&Date.now()-De.current[De.current.length-1].time<Ke.framesIntervalTime)return null;if(Ke.enable&&!o){var a=e.topLeft,i=e.bottomRight,s=[].concat(mg(a),mg(i)),c=A$(e,0===De.current.length),u=c.score,l=c.time,d=r.toDataURL("image/jpeg",.8);return De.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:De.current.length,bbox:s,original_bbox:s}),Ke.framesBatchLength>0&&De.current.length%Ke.framesBatchLength==0&&A&&(A(De.current.slice(-Ke.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t?s$(De.current.slice(-Ke.framesBatchLength),we,De.current.length===Ke.framesBatchLength):U instanceof eF&&c$(De.current.slice(-Ke.framesBatchLength),be,De.current.length===Ke.framesBatchLength)),u}return null}function b(e){var t=e.trackingScore,r=e.isFirstValidFrameFoundRef;if(!Fe.enable||null===t||!r)return!0;var n=Fe.web_warning_threshold,o=Fe.web_terminate_threshold,a=Fe.max_warning_time;return t<n||(t<o&&Je.current<a?(Je.current++,Je.current===a?(Re(og(og({},nt.liveness_terminated_face_tracking),{},{duration:Ue})),$e({tag:"selfie",event:null==D$?void 0:D$.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):Re(og(og({},nt.liveness_too_fast),{},{duration:1500})),!0):(Re(og(og({},nt.liveness_terminated),{},{duration:Ue})),$e({tag:"selfie",event:null==D$?void 0:D$.show_alert,log:{alert:"liveness_terminated"}}),rt(),!1))}function w(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(Ve.enable&&r){var n=Ve.max_time_ms;et.current&&t||(et.current={time:Date.now(),frame:0}),t&&et.current.frame++;var o=et.current.time;t&&Date.now()-o>=n&&(Re(og(og({},nt.liveness_terminated_no_face),{},{duration:Ue})),$e({tag:"selfie",event:null==D$?void 0:D$.show_alert,log:{alert:"liveness_terminated_no_face"}}),rt())}}function C(e,t){return S.apply(this,arguments)}function S(){return(S=$m(regeneratorRuntime.mark((function t(a,i){var s,u,f,p,h,m,g,y,k,E,S,B,_,x,T,A,I,P,R,N,D,M,F,U,j,V,z,q,H,K,W,G,Q,X,Y,$,Z;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==i?void 0:i.width)&&0!==(null==i?void 0:i.height)){t.next=2;break}return t.abrupt("return");case 2:return p=wt.current.isFirstValidFrameFoundRef,h=a.cropX,m=a.cropY,g=a.cropWidth,y=a.cropHeight,i.getContext("2d").drawImage(r,h,m,g,y,-(at*O-at)/2/O,-(at*O-at)/2/O,at,at),k=ve.current,E=k.blazefaceModel,S=k.closeEyesModel,t.next=9,Promise.all([wO.calculateBlurScore(i),jO.getModelPredictions({model:E,sCanvas:i})]);case 9:return B=t.sent,_=hg(B,2),x=_[0],T=_[1],t.next=15,FO.validatePredictions({predictions:T,width:jO.SIZE,height:jO.SIZE});case 15:if(I=t.sent,P=I.error,R=I.fullFace,N=I.faceRatio,D=I.faceNotFrontalMinThreshold,A=P,de.current.image=n,F=null,U=null,j=null,V=null,z=Te.current,q=z.curStepIndex,H=z.steps,!R){t.next=44;break}return K=H[q],W=K&&K.name===R$.FRONTAL,j=R.landmarks,t.next=33,FO.calculateFaceDirection({landmarks:j,getPerfectFrontal:W});case 33:if((G=t.sent)&&(F=G.gesture,U=G.leftRightScore),Q=(null==qe?void 0:qe.web_timeout)+d[aI.FaceDirection.FRONTAL].delayTime/1e3,!(W&&null!=qe&&qe.enable&&(-1===I$.duration("limit_close_eye")||I$.duration("limit_close_eye")<Q))){t.next=44;break}return-1===I$.duration("limit_close_eye")&&I$.start("limit_close_eye"),t.next=40,S.predict(i,j,null==qe?void 0:qe.web_threshold);case 40:X=t.sent,Y=X.isEyeClose,(V=Y)&&!A&&(A=N$.close_eye);case 44:if($="no_face"===(null===(s=A)||void 0===s?void 0:s.code)||"partial_face"===(null===(u=A)||void 0===u?void 0:u.code),Z=q<H.length,w({noFace:$&&Z,isFirstValidFrameFoundRef:p}),null!==(f=A)&&void 0!==f&&f.code&&Ze({tag:"selfie",event:null==D$?void 0:D$.show_alert,log:{alert:A.code}}),A&&!("face_too_small"===A.code&&F!==R$.FRONTAL&&N>=D)){t.next=70;break}if(se||v(T[0],i,j),!se){t.next=58;break}if(p||(te(!0),Le.current=performance.now(),I$.start("from_1st_frame")),!b({trackingScore:v(T[0],i,j,q>=H.length),isFirstValidFrameFoundRef:p})){t.next=56;break}return t.next=56,c({faceDirection:F,canvas:i,blurScore:x,leftRightScore:U,isEyeClose:V});case 56:t.next=68;break;case 58:if(F===R$.FRONTAL){t.next=63;break}M=nt.not_frontal_face,de.current.image=o,t.next=68;break;case 63:if(A){t.next=68;break}return p||(te(!0),I$.start("from_1st_frame")),L&&!mt.current&&0===yt.current.length&&setTimeout((function(){bt()}),500),t.next=68,l(F,i,U);case 68:t.next=71;break;case 70:q<H.length&&(M=nt[A.code],de.current.image=o);case 71:Oe(M),-1!==e&&(e=requestAnimationFrame((function(){return C(a,i)})));case 73:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function B(){return(B=$m(regeneratorRuntime.mark((function e(){var t,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=CO.analyzeVideoAndWindowSizes(r,de.current),(n=document.createElement("canvas")).width=at,n.height=at,(o=n.getContext("2d")).translate(at,0),o.scale(-1*O,1*O),!Xe||!r){e.next=13;break}return e.next=10,w$({outputImagesSize:at,videoEl:r,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:a=e.t0,i=a.mediaRecorder,tt.current=i,tt.current&&tt.current.start(),C(t,n);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return W&&me&&setTimeout((function(){!function(){B.apply(this,arguments)}()}),P),function(){cancelAnimationFrame(e),e=-1}}),[P,W,oe,se,be,we,t,n,o,f,p,h,g,Ke,E,Fe,je.enable,k,Oe,d,Ue,rt,Ve,nt,me,$e,A,R,O,bt,L,qe.enable,qe.web_threshold,qe.web_timeout,_e,xe,Be,We.enable,Ze,y.framesBatchLength,U,Xe]),dv.useEffect((function(){Pe&&(clearInterval(vt.current),gt(!1),yt.current=[]),Se()}),[Pe,gt,Se]);var kt=Te.current,Ct=kt.curStepIndex,Et=kt.steps,St=dv.useMemo((function(){return Et.find((function(e){return e.name===aI.FaceDirection.FRONTAL}))}),[Et]),Bt=fe.current?St:Et[Ct],_t=Bt&&ee?Bt.instructions[oe]:null,xt=Bt&&ee?Bt.directionIcon:"",Tt=Bt?Bt.directionIconAnimation:"";return{countdownToTakePicture:ut,cropArea:de,curStepIndex:Ct,directionIcon:xt,directionIconAnimation:Tt,faceDetectionError:Pe,handleTriggerPassiveMode:bt,handleVideoPlayed:it,instructions:_t,isActiveMode:se,refVideo:re,showCountdown:pt,steps:Et,videoPlayed:W,activeCapturing:Y,isFirstValidFrameFound:ee,warmupDone:me,motionData:_e,orientationData:xe,showLoading:z}}var U$=(tg(C$={},aI.FaceDirection.LEFT,90),tg(C$,aI.FaceDirection.RIGHT,270),tg(C$,aI.FaceDirection.UP,180),tg(C$,aI.FaceDirection.DOWN,0),C$),j$=cw(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),V$=aw.div(E$||(E$=pg(["\n width: 200px;\n height: 200px;\n position: relative;\n transform: scale(0.48);\n\n .top,\n .right,\n .bottom,\n .left {\n position: absolute;\n }\n\n .top {\n top: 0;\n left: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .right {\n right: 0;\n top: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .bottom {\n bottom: 0;\n left: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n\n .left {\n left: 0;\n top: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n"])),U$[aI.FaceDirection.DOWN],U$[aI.FaceDirection.LEFT],U$[aI.FaceDirection.UP],U$[aI.FaceDirection.RIGHT]),z$=aw.div(S$||(S$=pg(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var t,r=e.direction;return null!==(t=U$[r])&&void 0!==t?t:0})),q$=aw.span(B$||(B$=pg(["\n display: flex;\n margin: 4px 0;\n width: 100%;\n height: 15px;\n animation: "," 1s infinite;\n animation-direction: alternate;\n\n &::before,\n &::after {\n content: '';\n height: 100%;\n width: 50%;\n background: rgba(255, 255, 255, 0.8);\n }\n\n &::before {\n transform: skewY(32deg);\n }\n\n &::after {\n width: 50%;\n transform: skewY(-32deg);\n }\n"])),j$),H$=aw(q$)(_$||(_$=pg(["\n animation-delay: 0s;\n"]))),K$=aw(q$)(x$||(x$=pg(["\n animation-delay: 0.5s;\n"]))),W$=aw(q$)(T$||(T$=pg(["\n animation-delay: 1s;\n"])));function G$(e){var t=e.type;return t!==aI.FaceDirection.FRONTAL?dv.createElement(z$,{direction:t},dv.createElement(H$,null),dv.createElement(K$,null),dv.createElement(W$,null)):dv.createElement(V$,null,dv.createElement(z$,{className:"top"},dv.createElement(H$,null),dv.createElement(K$,null),dv.createElement(W$,null)),dv.createElement(z$,{className:"right"},dv.createElement(H$,null),dv.createElement(K$,null),dv.createElement(W$,null)),dv.createElement(z$,{className:"bottom"},dv.createElement(H$,null),dv.createElement(K$,null),dv.createElement(W$,null)),dv.createElement(z$,{className:"left"},dv.createElement(H$,null),dv.createElement(K$,null),dv.createElement(W$,null)))}G$.propTypes={type:Lv.oneOf([aI.FaceDirection.LEFT,aI.FaceDirection.RIGHT,aI.FaceDirection.UP,aI.FaceDirection.FRONTAL])},G$.defaultProps={type:aI.FaceDirection.LEFT};var Q$,X$=aI.ErrorDuration;function Y$(e){var t=e.children,r=e.errorMsg,n=e.className;return dv.isValidElement(t)?r?dv.createElement("div",{className:n},dv.cloneElement(t,{errorMsg:r})):null:r?dv.createElement("div",{className:n},r):null}function $$(e){var t=e.children,r=e.className,n=e.error,o=dv.useRef(0),a=dv.useRef(""),i=hN.useSDKSettings().lang,s=dv.useRef(X$.SHORT),c=n||{},u=c.msg,l=c.duration,d=void 0===l?X$.SHORT:l,f=null==u?void 0:u[i];return Date.now()-o.current>=s.current?(o.current=Date.now(),s.current=d,a.current=f,Y$({children:t,errorMsg:f,className:r})):Y$({children:t,errorMsg:a.current,className:r})}$$.propTypes={children:Lv.node,className:Lv.string},$$.defaultProps={className:""};var Z$=aw.circle(Q$||(Q$=pg(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function J$(e){var t=e.className,r=e.style,n=e.radius,o=e.strokeWidth,a=e.progress,i=e.hasError,s=e.activeColor,c=e.innerPadding,u=e.outsideRingColor,l=e.outsideRingOpacity,d=e.insideRingColor,f=e.insideRingWidth,p=e.insideRingStrokeDash,h=e.errorRingWidth,m=e.errorRingColor,g=e.dashedRingColor,v=e.dashedRingOpacity,y=e.dashedRingWidth,b=e.dashedRingLineThick,w=e.dashedRingLineSpacing,k=e.dashedInsideRingColor,C=e.dashedInsideRingWidth,E=e.showOutsideRing,S=e.showInsideRing,B=e.showDashedRing,_=2*n,x=2*n,T=n-2*o,A=2*Math.PI*T,I=A-a/100*A,P=T-y/2-o/2-c,R=2*Math.PI*P,N=R-a/100*R,O=P-C/2-y/2,D=2*Math.PI*O,L=D-a/100*D,M=O-f/2-C/2,F=O-h/2-C/2;return dv.createElement("svg",{className:t,style:r,width:_,height:x,viewBox:"0 0 ".concat(_," ").concat(x),fill:"none",xmlns:"http://www.w3.org/2000/svg"},E?dv.createElement(dv.Fragment,null,dv.createElement("circle",{"data-testid":"outsideRing",opacity:l,cx:n,cy:n,r:T,stroke:u}),dv.createElement(Z$,{"data-testid":"outsideAnimateRing",cx:n,cy:n,r:T,stroke:s,strokeWidth:o,strokeLinecap:"round",strokeDasharray:"".concat(A," ").concat(A),style:{strokeDashoffset:I}})):null,B?dv.createElement(dv.Fragment,null,dv.createElement("circle",{"data-testid":"dashedRing",opacity:v,cx:n,cy:n,r:P,stroke:g,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)}),dv.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},dv.createElement("circle",{cx:n,cy:n,r:P,stroke:s,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)})),dv.createElement("g",{mask:"url(#mask0)"},dv.createElement(Z$,{"data-testid":"dashedAnimateRing",cx:n,cy:n,r:P,stroke:s,strokeWidth:y,strokeDasharray:"".concat(R," ").concat(R),style:{strokeDashoffset:N}})),dv.createElement("circle",{"data-testid":"dashedInsideRing",opacity:v,cx:n,cy:n,r:O,stroke:k,strokeWidth:C}),dv.createElement(Z$,{"data-testid":"dashedInsideAnimateRing",cx:n,cy:n,r:O,stroke:s,strokeWidth:C,strokeLinecap:"round",strokeDasharray:"".concat(D," ").concat(D),style:{strokeDashoffset:L}})):null,S?dv.createElement("circle",{"data-testid":"insideRing",strokeDasharray:p,cx:n,cy:n,r:M,stroke:d,strokeWidth:f}):null,i?dv.createElement("circle",{"data-testid":"errorRing",strokeDasharray:p,cx:n,cy:n,r:F,stroke:m,strokeWidth:h}):null)}function eZ(e){var t=e.className;return dv.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dv.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}function tZ(){return(tZ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}J$.propTypes={className:Lv.string,style:Lv.shape({}),radius:Lv.number,strokeWidth:Lv.number,progress:Lv.number,hasError:Lv.bool,activeColor:Lv.string,innerPadding:Lv.number,outsideRingColor:Lv.string,outsideRingOpacity:Lv.number,insideRingColor:Lv.string,insideRingWidth:Lv.number,insideRingStrokeDash:Lv.string,errorRingColor:Lv.string,errorRingWidth:Lv.number,dashedRingColor:Lv.string,dashedRingOpacity:Lv.number,dashedRingWidth:Lv.number,dashedRingLineThick:Lv.number,dashedRingLineSpacing:Lv.number,dashedInsideRingColor:Lv.string,dashedInsideRingWidth:Lv.number,showOutsideRing:Lv.bool,showDashedRing:Lv.bool,showInsideRing:Lv.bool},J$.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,hasError:!1,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:3,insideRingStrokeDash:"0",errorRingColor:"#df0000",errorRingWidth:3,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!0,showDashedRing:!0,showInsideRing:!0},eZ.propTypes={className:Lv.string},eZ.defaultProps={className:""};var rZ,nZ,oZ="undefined"!=typeof window?dv.useLayoutEffect:dv.useEffect,aZ={popupContent:{tooltip:{position:"absolute",zIndex:999},modal:{position:"relative",margin:"auto"}},popupArrow:{height:"8px",width:"16px",position:"absolute",background:"transparent",color:"#FFF",zIndex:-1},overlay:{tooltip:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",zIndex:999},modal:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",display:"flex",zIndex:999}}},iZ=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],sZ=function(e,t,r,n,o){var a=o.offsetX,i=o.offsetY,s=n?8:0,c=r.split(" "),u=e.top+e.height/2,l=e.left+e.width/2,d=t.height,f=t.width,p=u-d/2,h=l-f/2,m="",g="0%",v="0%";switch(c[0]){case"top":p-=d/2+e.height/2+s,m="rotate(180deg) translateX(50%)",g="100%",v="50%";break;case"bottom":p+=d/2+e.height/2+s,m="rotate(0deg) translateY(-100%) translateX(-50%)",v="50%";break;case"left":h-=f/2+e.width/2+s,m=" rotate(90deg) translateY(50%) translateX(-25%)",v="100%",g="50%";break;case"right":h+=f/2+e.width/2+s,m="rotate(-90deg) translateY(-150%) translateX(25%)",g="50%"}switch(c[1]){case"top":p=e.top,g=e.height/2+"px";break;case"bottom":p=e.top-d+e.height,g=d-e.height/2+"px";break;case"left":h=e.left,v=e.width/2+"px";break;case"right":h=e.left-f+e.width,v=f-e.width/2+"px"}return{top:p="top"===c[0]?p-i:p+i,left:h="left"===c[0]?h-a:h+a,transform:m,arrowLeft:v,arrowTop:g}},cZ=function(e,t,r,n,o,a){var i=o.offsetX,s=o.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=function(e){var t={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var r=document.querySelector(e);null!==r&&(t=r.getBoundingClientRect())}return t}(a),d=Array.isArray(r)?r:[r];for((a||Array.isArray(r))&&(d=[].concat(d,iZ));u<d.length;){var f={top:(c=sZ(e,t,d[u],n,{offsetX:i,offsetY:s})).top,left:c.left,width:t.width,height:t.height};if(!(f.top<=l.top||f.left<=l.left||f.top+f.height>=l.top+l.height||f.left+f.width>=l.left+l.width))break;u++}return c},uZ=0,lZ=dv.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,o=e.onOpen,a=void 0===o?function(){}:o,i=e.onClose,s=void 0===i?function(){}:i,c=e.defaultOpen,u=void 0!==c&&c,l=e.open,d=void 0===l?void 0:l,f=e.disabled,p=void 0!==f&&f,h=e.nested,m=void 0!==h&&h,g=e.closeOnDocumentClick,v=void 0===g||g,y=e.repositionOnResize,b=void 0===y||y,w=e.closeOnEscape,k=void 0===w||w,C=e.on,E=void 0===C?["click"]:C,S=e.contentStyle,B=void 0===S?{}:S,_=e.arrowStyle,x=void 0===_?{}:_,T=e.overlayStyle,A=void 0===T?{}:T,I=e.className,P=void 0===I?"":I,R=e.position,N=void 0===R?"bottom center":R,O=e.modal,D=void 0!==O&&O,L=e.lockScroll,M=void 0!==L&&L,F=e.arrow,U=void 0===F||F,j=e.offsetX,V=void 0===j?0:j,z=e.offsetY,q=void 0===z?0:z,H=e.mouseEnterDelay,K=void 0===H?100:H,W=e.mouseLeaveDelay,G=void 0===W?100:W,Q=e.keepTooltipInside,X=void 0!==Q&&Q,Y=e.children,$=dv.useState(d||u),Z=$[0],J=$[1],ee=dv.useRef(null),te=dv.useRef(null),re=dv.useRef(null),ne=dv.useRef(null),oe=dv.useRef("popup-"+ ++uZ),ae=!!D||!n,ie=dv.useRef(0);oZ((function(){return Z?(ne.current=document.activeElement,ye(),me(),pe()):he(),function(){clearTimeout(ie.current)}}),[Z]),dv.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return a(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ae&&(null===(t=ne.current)||void 0===t||t.focus()),setTimeout((function(){return s(e)}),0))},ue=function(e){null==e||e.stopPropagation(),Z?ce(e):se(e)},le=function(e){clearTimeout(ie.current),ie.current=setTimeout((function(){return se(e)}),K)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(ie.current),ie.current=setTimeout((function(){return ce(e)}),G)},pe=function(){ae&&M&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ae&&M&&(document.getElementsByTagName("body")[0].style.overflow="auto")},me=function(){var e,t=null==te||null===(e=te.current)||void 0===e?void 0:e.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),r=Array.prototype.slice.call(t)[0];null==r||r.focus()};dv.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var ge,ve,ye=function(){if(!ae&&Z&&(null==ee?void 0:ee.current)&&(null==ee?void 0:ee.current)&&(null==te?void 0:te.current)){var e,t,r=ee.current.getBoundingClientRect(),n=te.current.getBoundingClientRect(),o=cZ(r,n,N,U,{offsetX:V,offsetY:q},X);if(te.current.style.top=o.top+window.scrollY+"px",te.current.style.left=o.left+window.scrollX+"px",U&&re.current)re.current.style.transform=o.transform,re.current.style.setProperty("-ms-transform",o.transform),re.current.style.setProperty("-webkit-transform",o.transform),re.current.style.top=(null===(e=x.top)||void 0===e?void 0:e.toString())||o.arrowTop,re.current.style.left=(null===(t=x.left)||void 0===t?void 0:t.toString())||o.arrowLeft}};ge=ce,void 0===(ve=k)&&(ve=!0),dv.useEffect((function(){if(ve){var e=function(e){"Escape"===e.key&&ge(e)};return document.addEventListener("keyup",e),function(){ve&&document.removeEventListener("keyup",e)}}}),[ge,ve]),function(e,t){void 0===t&&(t=!0),dv.useEffect((function(){if(t){var r=function(t){if(9===t.keyCode){var r,n=null==e||null===(r=e.current)||void 0===r?void 0:r.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),o=Array.prototype.slice.call(n);if(1===o.length)return void t.preventDefault();var a=o[0],i=o[o.length-1];t.shiftKey&&document.activeElement===a?(t.preventDefault(),i.focus()):document.activeElement===i&&(t.preventDefault(),a.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])}(te,Z&&ae),function(e,t){void 0===t&&(t=!0),dv.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])}(ye,b),function(e,t,r){void 0===r&&(r=!0),dv.useEffect((function(){if(r){var n=function(r){var n=Array.isArray(e)?e:[e],o=!1;n.forEach((function(e){e.current&&!e.current.contains(r.target)||(o=!0)})),r.stopPropagation(),o||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){r&&(document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n))}}}),[e,t,r])}(n?[te,ee]:[te],ce,v&&!m);var be,we=function(){return dv.createElement("div",Object.assign({},(e=ae?aZ.popupContent.modal:aZ.popupContent.tooltip,t={className:"popup-content "+(""!==P?P.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:tZ({},e,B,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!D&&E.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ae?"dialog":"tooltip",id:oe.current}),U&&!ae&&dv.createElement("div",{ref:re,style:aZ.popupArrow},dv.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==P?P.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:tZ({position:"absolute"},x)},dv.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},ke=!(E.indexOf("hover")>=0),Ce=ae?aZ.overlay.modal:aZ.overlay.tooltip,Ee=[ke&&dv.createElement("div",{key:"O","data-testid":"overlay","data-popup":ae?"modal":"tooltip",className:"popup-overlay "+(""!==P?P.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:tZ({},Ce,A,{pointerEvents:v&&m||ae?"auto":"none"}),onClick:v&&m?ce:void 0,tabIndex:-1},ae&&we()),!ae&&we()];return dv.createElement(dv.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":oe.current},t=Array.isArray(E)?E:[E],r=0,o=t.length;r<o;r++)switch(t[r]){case"click":e.onClick=ue;break;case"right-click":e.onContextMenu=de;break;case"hover":e.onMouseEnter=le,e.onMouseLeave=fe;break;case"focus":e.onFocus=le,e.onBlur=fe}if("function"==typeof n){var a=n(Z);return!!n&&dv.cloneElement(a,e)}return!!n&&dv.cloneElement(n,e)}(),Z&&rI.createPortal(Ee,(null===(be=document.getElementById("popup-root"))&&((be=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(be)),be)))})),dZ=sw(rZ||(rZ=pg(["\n .popup-content {\n margin: auto;\n background: #fff;\n width: 100%;\n padding: 5px;\n border: 1px solid #d7d7d7;\n max-width: 568px;\n border-radius: 10px;\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n border-radius: 5px\n }\n\n .popup-overlay {\n background: rgba(0, 0, 0, .5);\n padding: 10px;\n }\n\n [data-popup=tooltip].popup-overlay {\n background: transparent\n }\n\n .popup-arrow {\n -webkit-filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n color: #fff;\n stroke-width: 2px;\n stroke: #d7d7d7;\n stroke-dasharray: 30px;\n stroke-dashoffset: -54px;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0\n }\n"]))),fZ=["open","children","overlayStyle"],pZ=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=lg(e,fZ);return dv.createElement(dv.Fragment,null,t&&dv.createElement(dv.Fragment,null,dv.createElement(lZ,rg({overlayStyle:og(og({},n),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),dv.createElement(dZ,null)))};pZ.propTypes={open:Lv.bool,children:Lv.node,overlayStyle:Lv.shape({})},pZ.defaultProps={open:!1,children:null,overlayStyle:{}};var hZ={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},mZ=aw.div(nZ||(nZ=pg(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),gZ=function(e){var t=e.contentStyle,r=hN.useSDKSettings(),n=r.lang,o=r.warmupMessage,a=o?o[n]:hZ.WARMUP_INTRO[n];return dv.createElement(pZ,{open:!0,contentStyle:t},dv.createElement(mZ,{className:"warmup-message"},a))};gZ.propTypes={contentStyle:Lv.shape({})},gZ.defaultProps={contentStyle:{}};var vZ=Hb([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],cw(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),500,cw(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),500),yZ=Object.freeze({__proto__:null,animationDuration:500,default:vZ}),bZ=Hb([".slide-horizontal{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}.slide-vertical{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],cw(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),cw(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20)),wZ=Object.freeze({__proto__:null,default:bZ}),kZ=Hb([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],cw(["from,to{opacity:1;}50%{opacity:0;}"])),CZ=Object.freeze({__proto__:null,default:kZ});function EZ(){return(EZ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function SZ(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function BZ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function _Z(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var xZ=!1,TZ=dv.createContext(null),AZ="entering",IZ="entered",PZ=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var o,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(o="exited",n.appearStatus=AZ):o=IZ:o=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",n.state={status:o},n.nextCallback=null,n}BZ(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==AZ&&r!==IZ&&(t=AZ):r!==AZ&&r!==IZ||(t="exiting")}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},r.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===AZ?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,o=this.props.nodeRef?[n]:[rI.findDOMNode(this),n],a=o[0],i=o[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!r||xZ?this.safeSetState({status:IZ},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,i),this.safeSetState({status:AZ},(function(){t.props.onEntering(a,i),t.onTransitionEnd(c,(function(){t.safeSetState({status:IZ},(function(){t.props.onEntered(a,i)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:rI.findDOMNode(this);t&&!xZ?(this.props.onExit(n),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:rI.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=o[0],i=o[1];this.props.addEndListener(a,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,r=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,SZ(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return dv.createElement(TZ.Provider,{value:null},"function"==typeof r?r(e,n):dv.cloneElement(dv.Children.only(r),n))},t}(dv.Component);function RZ(){}PZ.contextType=TZ,PZ.propTypes={},PZ.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:RZ,onEntering:RZ,onEntered:RZ,onExit:RZ,onExiting:RZ,onExited:RZ},PZ.UNMOUNTED="unmounted",PZ.EXITED="exited",PZ.ENTERING=AZ,PZ.ENTERED=IZ,PZ.EXITING="exiting";var NZ,OZ,DZ=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(r,n)||("string"==typeof r.className?r.className=r.className+" "+n:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+n)));var r,n}))},LZ=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.remove(n):"string"==typeof r.className?r.className=_Z(r.className,n):r.setAttribute("class",_Z(r.className&&r.className.baseVal||"",n)));var r,n}))},MZ=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1];t.removeClasses(o,"exit"),t.addClass(o,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1]?"appear":"enter";t.addClass(o,a,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1]?"appear":"enter";t.removeClasses(o,a),t.addClass(o,a,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,o=n?""+(n&&r?r+"-":"")+e:r[e];return{baseClassName:o,activeClassName:n?o+"-active":r[e+"Active"],doneClassName:n?o+"-done":r[e+"Done"]}},t}BZ(t,e);var r=t.prototype;return r.addClass=function(e,t,r){var n=this.getClassNames(t)[r+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&o&&(n+=" "+o),"active"===r&&e&&e.scrollTop,n&&(this.appliedClasses[t][r]=n,DZ(e,n))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,o=r.active,a=r.done;this.appliedClasses[t]={},n&&LZ(e,n),o&&LZ(e,o),a&&LZ(e,a)},r.render=function(){var e=this.props,t=(e.classNames,SZ(e,["classNames"]));return dv.createElement(PZ,EZ({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(dv.Component);MZ.defaultProps={classNames:""},MZ.propTypes={};var FZ,UZ,jZ="out-in",VZ="in-out",zZ=function(e,t,r){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),r()}},qZ=((NZ={})[jZ]=function(e){var t=e.current,r=e.changeState;return dv.cloneElement(t,{in:!1,onExited:zZ(t,"onExited",(function(){r(AZ,null)}))})},NZ[VZ]=function(e){var t=e.current,r=e.changeState,n=e.children;return[t,dv.cloneElement(n,{in:!0,onEntered:zZ(n,"onEntered",(function(){r(AZ)}))})]},NZ),HZ=((OZ={})[jZ]=function(e){var t=e.children,r=e.changeState;return dv.cloneElement(t,{in:!0,onEntered:zZ(t,"onEntered",(function(){r(IZ,dv.cloneElement(t,{in:!0}))}))})},OZ[VZ]=function(e){var t=e.current,r=e.children,n=e.changeState;return[dv.cloneElement(t,{in:!1,onExited:zZ(t,"onExited",(function(){n(IZ,dv.cloneElement(r,{in:!0}))}))}),dv.cloneElement(r,{in:!0})]},OZ),KZ=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).state={status:IZ,current:null},t.appeared=!1,t.changeState=function(e,r){void 0===r&&(r=t.state.current),t.setState({status:e,current:r})},t}BZ(t,e);var r=t.prototype;return r.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===AZ&&e.mode===VZ?{status:AZ}:!t.current||(r=t.current,n=e.children,r===n||dv.isValidElement(r)&&dv.isValidElement(n)&&null!=r.key&&r.key===n.key)?{current:dv.cloneElement(e.children,{in:!0})}:{status:"exiting"};var r,n},r.render=function(){var e,t=this.props,r=t.children,n=t.mode,o=this.state,a=o.status,i=o.current,s={children:r,current:i,changeState:this.changeState,status:a};switch(a){case AZ:e=HZ[n](s);break;case"exiting":e=qZ[n](s);break;case IZ:e=i}return dv.createElement(TZ.Provider,{value:{isMounting:!this.appeared}},e)},t}(dv.Component);KZ.propTypes={},KZ.defaultProps={mode:jZ};var WZ=aw.div(FZ||(FZ=pg(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ","; // must be higher than BASE_Z_INDEX and lower than other layers\n"])),1001),GZ=Hb([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],cw(["from{background:#000;}to{}"]),300),QZ=aw.div(UZ||(UZ=pg(["\n ","\n"])),GZ),XZ=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return dv.createElement(QZ,null,dv.createElement(KZ,null,dv.createElement(MZ,{key:r,timeout:{enter:300,exit:0},classNames:"splash",unmountOnExit:!1},dv.createElement(WZ,null))))},YZ=Object.freeze({__proto__:null,default:XZ}),$Z=Hb([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],cw(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"])),ZZ=Object.freeze({__proto__:null,default:$Z}),JZ="default",eJ="error";function tJ(e){var t=e.className,r=e.width,n=e.height,o=e.type,a=e.strokeStyles,i=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=dv.useMemo((function(){var e;return og((tg(e={},JZ,{fill:"none",strokeWidth:i,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),tg(e,eJ,{fill:"rgba(234,50,35, 0.1)",strokeWidth:i,stroke:"#ea3223"}),e),a)}),[i,a]),l=s+.8*i,d=u[o];return dv.createElement("svg",{width:r,height:n,className:t},dv.createElement("rect",{x:i/2,y:i/2,rx:s,ry:s,width:r-i,height:n-i,style:d}),dv.createElement("path",{d:"M0,".concat(l," Q0,0 ").concat(l,",0 L0,0 Z"),style:c}),dv.createElement("path",{d:"M0,".concat(n-l," Q0,").concat(n," ").concat(l,",").concat(n," L0,").concat(n," Z"),style:c}),dv.createElement("path",{d:"M".concat(r-l,",").concat(n," Q").concat(r,",").concat(n," ").concat(r,",").concat(n-l," L").concat(r,",").concat(n," Z"),style:c}),dv.createElement("path",{d:"M".concat(r-l,",0 Q").concat(r,",0 ").concat(r,",").concat(l," L").concat(r,",0 Z"),style:c}))}tJ.propTypes={className:Lv.string,width:Lv.number,height:Lv.number,strokeWidth:Lv.number,strokeStyles:Lv.shape({}),type:Lv.oneOf([JZ,eJ]),radius:Lv.number,paddingStyle:Lv.shape({})},tJ.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:JZ,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var rJ,nJ,oJ,aJ,iJ,sJ,cJ,uJ,lJ,dJ,fJ,pJ,hJ,mJ,gJ,vJ,yJ,bJ,wJ,kJ,CJ,EJ,SJ,BJ,_J,xJ,TJ,AJ,IJ,PJ,RJ,NJ,OJ=["width","height","type"],DJ=aw(tJ)(rJ||(rJ=pg([""]))),LJ=aw.img(nJ||(nJ=pg(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),MJ=XZ,FJ=aw.div(oJ||(oJ=pg(["\n ","\n ","\n"])),vZ,$Z),UJ=aw.img(aJ||(aJ=pg(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),jJ=aw.div(iJ||(iJ=pg(["\n cursor: pointer;\n text-align: center;\n width: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),60,1020,WW.isMobile?Hb(["top:",";"],(function(e){return e.y})):Hb(["bottom:","px;"],10)),VJ=aw.div(sJ||(sJ=pg(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ","px;\n height: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),100,100,1020),zJ=aw.div(cJ||(cJ=pg(["\n color: #fff;\n text-align: center;\n"]))),qJ=aw.div(uJ||(uJ=pg(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),HJ=aw.div(lJ||(lJ=pg(["\n display: flex;\n align-items: center;\n"]))),KJ=aw(zJ)(dJ||(dJ=pg(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),WJ=aw(zJ)(fJ||(fJ=pg(["\n font-size: 20px;\n margin-left: 10px;\n color: green;\n position: absolute;\n left: 0;\n top: 10px;\n background: white;\n z-index: ",";\n"])),1030),GJ=aw(zJ)(pJ||(pJ=pg(["\n position: absolute;\n font-size: 16px;\n text-align: center;\n color: #fff;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),QJ=aw(GJ)(hJ||(hJ=pg(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),XJ=aw(zJ)(mJ||(mJ=pg(["\n position: absolute;\n font-size: 18px;\n text-align: center;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),YJ=(aw.div(gJ||(gJ=pg(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),function(e){var t=e.width,r=e.height,n=e.type,o=lg(e,OJ),a=QN.useAsset("id_card_frame.png"),i=QN.useAsset("id_card_frame_error.png");return dv.createElement(FJ,{width:t,height:r},dv.createElement(LJ,{src:n===eJ?i:a,width:t,height:r}),dv.createElement(DJ,rg({width:t,height:r,type:n},o)))}),$J=Object.freeze({__proto__:null,CloseCameraButton:function(e){var t=e.className,r=e.onClick,n=QN.useAsset("ic_close.png");return dv.createElement(CG,{className:t,onClick:r},dv.createElement("img",{src:n,alt:""}))}}),ZJ=CZ,JJ=wZ,e3=ZZ,t3=Hb(["z-index:",";color:#ffffff;"],1020),r3=aw.div(vJ||(vJ=pg(["\n ","\n"])),t3),n3=aw($$)(yJ||(yJ=pg(["\n ","\n ","\n ","\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n white-space: pre-wrap;\n text-align: center;\n max-width: 80%;\n"])),t3,(function(e){var t=e.top;return t&&Hb(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&Hb(["bottom:","px;"],t)}),(function(e){return e.centerY&&Hb(["top:50%;transform:translateY(-50%);"])})),o3=aw(r3)(bJ||(bJ=pg(["\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var t=e.top;return t&&Hb(["top:","px;"],t)})),a3=aw(r3)(wJ||(wJ=pg(["\n position: absolute;\n ","\n ","\n font-size: ",";\n text-shadow: 2px 2px 4px #000000;\n"])),(function(e){var t=e.top;return t&&Hb(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&Hb(["bottom:","px;"],t)}),(function(){return WW.isMobile?"20px":"22px"})),i3=aw.div(kJ||(kJ=pg(["\n height: ",";\n position: absolute;\n ","\n ","\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),(function(){return WW.isMobile?"50px":"70px"}),(function(e){var t=e.top;return t&&Hb(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&Hb(["bottom:","px;"],t)}),1020),s3=aw.div(CJ||(CJ=pg(["\n width: ",";\n height: ",";\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid #ffffff;\n font-size: 16px;\n color: #fff;\n font-weight: 700;\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: 50%;\n }\n"])),(function(){return WW.isMobile?"40px":"50px"}),(function(){return WW.isMobile?"40px":"50px"}),(function(e){return!e.active&&Hb(["opacity:0.6;"])})),c3=aw.div(EJ||(EJ=pg(["\n color: #ffffff;\n height: 70px;\n position: absolute;\n bottom: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),1020),u3=aw.div(SJ||(SJ=pg(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),l3=aw.div(BJ||(BJ=pg(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #ffffff;\n font-size: 140px;\n opacity: 0.6;\n"]))),d3=aw.div(_J||(_J=pg(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n ",";\n ",";\n"])),JJ.default,ZJ.default),f3=aw(J$)(xJ||(xJ=pg(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),p3=aw(eZ)(TJ||(TJ=pg(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.color;return null!=t?t:"rgba(0, 0, 0, 0.6)"})),h3=aw.div(AJ||(AJ=pg(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),m3=cw(["from{opacity:1;}to{opacity:0;}"]),g3=aw.div(IJ||(IJ=pg(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n border-radius: 50%;\n"])),m3),v3=aw.div(PJ||(PJ=pg(["\n ","\n"])),e3.default),y3=WW.isMobile?{width:{ideal:640}}:null,b3={background:"#000000",opacity:.6};function w3(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,a=e.onError,i=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=e.onProcessing,f=e.customErrors,p=e.livenessSettings,h=e.apiCredentials,m=e.outputEncryptionSettings,g=e.cameraScale,v=e.defaultCameraId,y=e.passiveModeAuto,b=e.offsetFaceY,w=e.styledComponent,k=e.sdkAdapter,C=e.isLoading,E=e.frontalMinSize,S=QN.useAsset("bg_camera_mask.png"),B=QN.useAsset("bg_camera_mask_red.png"),_=QN.useAsset("ic_loading.png"),x=hg(dv.useState({}),2),T=x[0],A=x[1],I=T.yFaceDetectionError,P=T.yFaceVerificationStepsWrapper,R=hg(dv.useState(""),2),N=R[0],O=R[1],D=dv.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,o=t+25,i=o+30;A({yFaceDetectionError:o,yFaceVerificationStepsWrapper:i+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(i);return 0!==b&&(u+b<s||u+b+r>c)?a({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=b,{y:u}}),[b,a]),L=F$({apiCheck:t,mode:r,bgCameraMask:S,bgCameraMaskRed:B,surroundStyle:b3,onLivenessDetectionDone:n,onError:a,cropAreaDimension:D,customDirectionIcon:u,captureFrameSettings:i,onFramesCaptured:s,livenessSettings:p,setRemainingTime:O,customStepTimeConstraints:l,onProcessing:d,customErrors:f,apiCredentials:h,outputEncryptionSettings:m,cameraScale:g,passiveModeAuto:y,sdkAdapter:k,frontalMinSize:E}),M=L.countdownToTakePicture,F=L.cropArea,U=L.curStepIndex,j=L.directionIcon,V=L.directionIconAnimation,z=L.faceDetectionError,q=L.handleTriggerPassiveMode,H=L.handleVideoPlayed,K=L.instructions,W=L.isActiveMode,G=L.refVideo,Q=L.showCountdown,X=L.steps,Y=L.videoPlayed,$=L.activeCapturing,Z=L.isFirstValidFrameFound,J=L.warmupDone,ee=L.showLoading;dv.useEffect((function(){var e;"string"==typeof(null===(e=X[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(X.map((function(e){return t=e.directionIcon,new Promise((function(e){var r=new Image;r.onload=e,r.onerror=e,r.src=t}));var t})))}),[X]);var te=w.CloseCameraButton;return dv.createElement(v3,null,dv.createElement(RG,{frontCamera:c,onVideoPlayed:H,onClose:o,flipHorizontal:c,ref:G,videoSettings:y3,onError:a,scale:g,defaultCameraId:v,closeButton:te||null},!J&&dv.createElement(gZ,null),Y?dv.createElement(dv.Fragment,null,dv.createElement(n3,{top:I-15,className:"face-detection-error",error:z}),F.current?dv.createElement(FG,{x:"".concat(F.current.x,"px"),y:"".concat(F.current.y,"px"),width:"".concat(F.current.width,"px"),height:"".concat(F.current.height,"px"),surroundStyle:F.current.surroundStyle},dv.createElement(p3,null),dv.createElement(f3,{progress:U/X.length*100,hasError:!!z,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:1,insideRingStrokeDash:"2"}),Q?dv.createElement(l3,null,M):null,W?dv.createElement(dv.Fragment,null,dv.createElement(d3,null,function(e,t){return e?"string"==typeof e?dv.createElement("img",{className:t,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}(j,V)),$&&dv.createElement(g3,null)):null,z&&dv.createElement(h3,null)):null,W?dv.createElement(dv.Fragment,null,N&&dv.createElement(o3,{top:P-30},N),K?dv.createElement(dv.Fragment,null,dv.createElement(a3,{top:P+5,className:"instructions"},K),dv.createElement(i3,{top:P+35},X.map((function(e,t){var r=e.name,n=e.image.objUrl;return dv.createElement(s3,{key:r,active:U>=t,className:"step-item"},n?dv.createElement("img",{src:n,alt:""}):dv.createElement("span",null,t+1))})))):null):dv.createElement(dv.Fragment,null,!Z||z||y?null:dv.createElement(c3,null,dv.createElement(u3,{onClick:q},dv.createElement(UG,null))))):null,(ee||C)&&dv.createElement(VJ,null,dv.createElement("img",{src:_,alt:"",className:"spin"}))))}w3.propTypes={apiCheck:Lv.bool,frontalMinSize:Lv.number,mode:Lv.string,onLivenessDetectionDone:Lv.func,onClose:Lv.func,onError:Lv.func,captureFrameSettings:Lv.shape({}),onFramesCaptured:Lv.func,frontCamera:Lv.bool,customDirectionIcon:Lv.shape({}),customStepTimeConstraints:Lv.shape({}),onProcessing:Lv.func,customErrors:Lv.shape({}),livenessSettings:Lv.shape({}),apiCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string}),outputEncryptionSettings:Lv.shape({}),cameraScale:Lv.number,defaultCameraId:Lv.string,passiveModeAuto:Lv.bool,offsetFaceY:Lv.number,styledComponent:Lv.shape({CloseCameraButton:Lv.node}),sdkAdapter:Lv.shape({}),isLoading:Lv.bool},w3.defaultProps={apiCheck:!1,frontalMinSize:null,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(RJ={},tg(RJ,aI.FaceDirection.LEFT,dv.createElement(G$,{type:aI.FaceDirection.LEFT})),tg(RJ,aI.FaceDirection.RIGHT,dv.createElement(G$,{type:aI.FaceDirection.RIGHT})),tg(RJ,aI.FaceDirection.UP,dv.createElement(G$,{type:aI.FaceDirection.UP})),tg(RJ,aI.FaceDirection.FRONTAL,dv.createElement(G$,{type:aI.FaceDirection.FRONTAL})),RJ),customStepTimeConstraints:(NJ={},tg(NJ,aI.FaceDirection.UP,{delayTime:0}),tg(NJ,aI.FaceDirection.LEFT,{delayTime:0}),tg(NJ,aI.FaceDirection.RIGHT,{delayTime:0}),tg(NJ,aI.FaceDirection.FRONTAL,{delayTime:2e3}),NJ),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null},sdkAdapter:null,isLoading:!1};var k3,C3=Object.freeze({__proto__:null,Text:r3,FaceDetectionError:n3,CountdownTime:o3,FaceVerificationInstructions:a3,FaceVerificationStepsWrapper:i3,StepItem:s3,BottomButtonsOverlay:c3,Button:u3,CountDownOverlay:l3,InstructionsOverlay:d3,LivenessStyledComponent:$J,default:w3,useLivenessDetection:F$}),E3=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.frontCamera,r=void 0===t||t,n=document.createElement("div");document.body.appendChild(n);var o=function(){rI.unmountComponentAtNode(n)};return new Promise((function(e){rI.render(dv.createElement(hN.SDKSettingsProvider,{value:{lang:"en"}},dv.createElement(RG,{checkCameraMode:!0,frontCamera:r,onVideoPlayed:function(){o(),e(null)},onClose:o,onError:function(t){o(),e(t)}})),n)}))},S3=aw.input(k3||(k3=pg(["\n display: none;\n"]))),B3=dv.forwardRef((function(e,t){var r=e.useFileBrowse,n=e.accept,o=e.frontCamera,a=e.onCaptureDone,i=e.outputEncryptionSettings,s=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.target.files,!a){e.next=8;break}if(n=r[0],!i||!i.key){e.next=7;break}return e.next=6,TL.encrypt({blob:n,key:i.key});case 6:o=e.sent;case 7:a({file:n,encrypted:o});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[a,i]);return dv.createElement(S3,rg({ref:t,type:"file",accept:n,onChange:s},r?{}:{capture:o?"user":"environment"}))}));B3.propTypes={useFileBrowse:Lv.bool,accept:Lv.string,frontCamera:Lv.bool,onCaptureDone:Lv.func,outputEncryptionSettings:Lv.shape({key:Lv.string})},B3.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var _3,x3="landscape",T3="portrait",A3="desktop",I3=aI.Errors,P3=aw.div(_3||(_3=pg(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function R3(e){var t=e.children,r=hN.useSDKSettings().lang,n=I3.wrong_orientation.msg[r],o=function(){var e=dv.useRef(window.matchMedia("(orientation: portrait)")),t=dv.useRef(e.current.matches?T3:x3),r=hg(dv.useState(t.current),2),n=r[0],o=r[1];return dv.useEffect((function(){function t(e){e.matches?o(T3):o(x3)}return e.current.addEventListener("change",t),function(){e.current.removeEventListener("change",t)}}),[]),WW.isMobile?{curOrientation:n,initOrientation:t.current}:{curOrientation:A3}}().curOrientation;return dv.createElement(dv.Fragment,null,o===x3&&dv.createElement(pZ,{open:!0},dv.createElement(P3,null,n)),(o===T3||o===A3)&&dv.createElement(dv.Fragment,null,t))}var N3={LOADING:0,FAR_FACE:1,CLOSE_FACE:2,START_FLASHING:3,STOP_DECTECTING:4},O3="far_face",D3="close_face",L3="flashing",M3=WW.isMobile?200:400;function F3(){return(F3=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]?u[0]:{},r=t.tfScriptUrls,n=t.closeEyesModelUrl,o=new GM(n),e.next=4,SL.loadTensorFlow(r);case 4:return e.next=6,SL.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return a=[SL.loadFaceDetectionModel({detectorConfig:{runtime:"mediapipe",solutionPath:r.mediaPipeUrl}}),o.load()],e.next=9,Promise.all(a);case 9:return i=e.sent,s=hg(i,1),c=s[0].faceDetector,e.abrupt("return",{faceDetector:c,closeEyesModel:o});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var U3=e$((function(){return F3.apply(this,arguments)})),j3=function(e){var t=e.width,r=e.height,n=e.cameraScale,o=e.debug,a=hg(dv.useState(null),2),i=a[0],s=a[1];return dv.useEffect((function(){var e=document.createElement("canvas");e.width=t,e.height=r;var a=e.getContext("2d");return a.translate(t,0),a.scale(-1*n,1*n),o&&(document.body.appendChild(e),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.zIndex="9999"),s(e),function(){o&&document.body.removeChild(e)}}),[n,o,r,t]),i},V3=function(e){switch(e){case"partial_face":return"please_move_face_into_center_frame";case"no_face":case"face_out_of_box":return"face_not_found";case"face_too_small":return"please_move_face_closer";case"face_too_large":return"please_move_face_farther";case"eye_close":return"please_open_your_eyes";case"face_not_frontal":return"please_look_straight_at_the_camera";case"multiple_faces":return"please_only_one_face";case"face_too_high":return"please_move_face_down";default:return""}},z3=function(e,t){var r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.beginPath(),r.lineWidth="1",r.strokeStyle="red",r.rect(0,0,e.width,e.height),r.stroke(),r.closePath(),Object.entries(t).forEach((function(e,t){var n=hg(e,2),o=n[0],a=n[1];r.beginPath(),r.fillStyle="red",r.font="16px",r.fillText("".concat(o,": ").concat(a),10,20+20*t),r.closePath()}))},q3=dv.createContext(!1),H3=function(e){var t=e.children,r=e.debug;return dv.createElement(q3.Provider,{value:r},t)};H3.defaultProps={debug:!1,children:null},H3.propTypes={debug:Lv.bool,children:Lv.node};var K3=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.getContext("2d"),o=e.width;n.strokeStyle="blue",n.fillStyle="blue",n.lineWidth=1,t.forEach((function(e){e.landmarks.forEach((function(e){n.beginPath(),n.arc(r?o-e[0]:e[0],e[1],2,0,2*Math.PI),n.fill(),n.closePath()})),n.beginPath();var t={x:r?o-e.bottomRight[0]:e.bottomRight[0],y:e.topLeft[1],width:e.bottomRight[0]-e.topLeft[0],height:e.bottomRight[1]-e.topLeft[1]};n.rect(t.x,t.y,t.width,t.height),n.stroke(),n.closePath()}))},W3=function(e,t){return{topLeft:[e.topLeft[0]*t,e.topLeft[1]*t],bottomRight:[e.bottomRight[0]*t,e.bottomRight[1]*t],probability:e.probability,landmarks:e.landmarks.map((function(e){return[e[0]*t,e[1]*t]}))}};function G3(e){var t=e.cameraScale,r=void 0===t?1:t,n=e.isVideoPlaying,o=e.step,a=e.cropArea,i=e.videoRef,s=e.onCloseFaceDetected,c=e.onMovingCloseFace,u=e.onFarFaceDetected,l=e.onFarFullFaceDetected,d=e.onFlashingFramesCaptured,f=e.frameInterval,p=void 0===f?180:f,h=e.useFaceDetectorWhenFlashing,m=e.onFaceError,g=e.onError,v=e.faceSettings,y=e.ovalBoundingRect,b=e.isOvalTransitioning,w=e.closeEyesSettings,k=e.maskSettings,C=e.imageSettings,E=k.ovalPadding,S=k.chinToMaskBottomPadding,B=C.imageScale,_=w.enable,x=w.timeout,T=dv.useContext(q3),A=function(e){var t=e.cropArea,r=e.scale,n=void 0===r?1:r,o=e.video;return dv.useMemo((function(){var e=t.width,r=t.height,a=null!=o?o:{},i=a.videoWidth,s=void 0===i?Number.MAX_SAFE_INTEGER:i,c=a.videoHeight,u=void 0===c?Number.MAX_SAFE_INTEGER:c,l=Math.min(e,r)/200,d=e/l*n,f=r/l*n;return d>s||f>u?{width:WW.isMobile?s:u,height:u}:{width:d,height:f}}),[t,n,o])}({cropArea:a,scale:B,video:i.current}),I=function(e){var t=e.cropArea,r=e.ovalBoundingRect,n=e.ovalPadding,o=e.baseCanvasSize;return dv.useMemo((function(){var e,a,i,s,c=t.width,u=t.height,l=t.x,d=t.y,f=Math.min(c,u)/o,p=c/f,h=u/f,m=null!==(e=null==r?void 0:r.left)&&void 0!==e?e:0,g=null!==(a=null==r?void 0:r.top)&&void 0!==a?a:0,v=null!==(i=null==r?void 0:r.right)&&void 0!==i?i:c,y=null!==(s=null==r?void 0:r.bottom)&&void 0!==s?s:u;return{left:Math.max((m-l-n.left)/f,0),right:Math.min((v-l+n.right)/f,p-0),top:Math.max((g-d-n.top)/f,0),bottom:Math.min((y-d+n.bottom)/f,h-0)}}),[t,null==r?void 0:r.bottom,null==r?void 0:r.left,null==r?void 0:r.right,null==r?void 0:r.top,n.bottom,n.left,n.right,n.top,o])}({cropArea:a,ovalBoundingRect:y,ovalPadding:E,baseCanvasSize:Math.min(A.width,A.height)}),P=v.minFarFaceRatio,R=v.maxFarFaceRatio,N=v.closeFaceRatio,O=j3({width:A.width,height:A.height,cameraScale:r,debug:!1}),D=A.height/A.width,L=j3({width:M3,height:M3*D,cameraScale:r,debug:T}),M=function(e){var t=e.width,r=e.height,n=e.debug,o=dv.useRef(null),a=dv.useMemo((function(){var e=document.createElement("canvas");return e.width=t,e.height=r,e.style.position="fixed",e.style.bottom="0",e.style.left="0",e.style.zIndex="99999",o.current=e,n&&document.body.appendChild(e),e}),[r,t,n]);return dv.useEffect((function(){return function(){n&&document.body.removeChild(o.current)}}),[n]),a}({width:160,height:150,debug:T}),F=function(e){var t=e.videoRef,r=e.cropArea;return dv.useMemo((function(){return t.current?0===Object.keys(r).length?{}:CO.analyzeVideoAndWindowSizes(t.current,r):{}}),[t,r])}({videoRef:i,cropArea:a}),U=function(e,t){var r=hg(dv.useState({}),2),n=r[0],o=r[1],a=Object.keys(n).length>0;return dv.useEffect((function(){var r=!1;return function(){var n=$m(regeneratorRuntime.mark((function n(){var a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,U3(e);case 3:if(a=n.sent,!r){n.next=6;break}return n.abrupt("return");case 6:o(a),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(0),t({error:n.t0}),console.error(n.t0);case 13:case"end":return n.stop()}}),n,null,[[0,9]])})));return function(){return n.apply(this,arguments)}}()(),function(){r=!0}}),[a,e,t]),[n,a]}(hN.useSDKSettings().customUrls,g),j=hg(U,2),V=j[0],z=j[1],q=dv.useRef(null),H=function(e){var t=e.timeout,r=dv.useRef(null),n=dv.useCallback((function(){r.current=performance.now()}),[]),o=dv.useCallback((function(){return null===r.current?(n(),!1):performance.now()-r.current>t}),[n,t]);return{markTime:n,checkIfEllapsed:o}}({timeout:1e3*x}),K=H.markTime,W=H.checkIfEllapsed,G=z&&n,Q=hg(dv.useState(""),2),X=Q[0],Y=Q[1],$=V.closeEyesModel,Z=V.faceDetector,J=dv.useMemo((function(){return mQ(Y,1e3)}),[]),ee=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t,r){var n,a,f,p,v,y,w,k,C,E,B,x,A,O,D,F,U,j,V,z,q,H,G,Q,X,Y,ee,te,re,ne,oe,ae;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(null==r?void 0:r.width)&&0!==(null==r?void 0:r.height)){e.next=3;break}return e.abrupt("return");case 3:if(null!==i.current){e.next=5;break}return e.abrupt("return");case 5:if(!b){e.next=7;break}return e.abrupt("return");case 7:if(o!==N3.STOP_DECTECTING){e.next=9;break}return e.abrupt("return");case 9:if(n=t.cropX,a=t.cropY,f=t.cropWidth,p=t.cropHeight,v=r.width,y=r.height,r.getContext("2d").drawImage(i.current,n,a,f,p,0,0,v,y),w=M3/v,T&&L.getContext("2d").drawImage(i.current,n,a,f,p,0,0,v*w,y*w),h||o!==N3.START_FLASHING){e.next=21;break}if("function"!=typeof d){e.next=20;break}return e.next=20,d(null,r,null);case 20:return e.abrupt("return");case 21:return e.next=23,Z.estimateFaces(r);case 23:return k=e.sent,C=FO.faceDetectorToBlazefacePredictions(k),e.next=27,FO.validatePredictions({predictions:C,width:v,height:y});case 27:return E=e.sent,B=E.fullFace,x=E.ratio,A=[[I.left,I.top],[I.right,I.bottom]],e.next=33,FO.validatePredictions({predictions:C,cropAreaCoordinates:A});case 33:if(O=e.sent,D=O.error,F=O.fullFace,U=O.faceRatio,T&&(j={left:I.left*w,top:I.top*w,right:I.right*w,bottom:I.bottom*w},ie={x:j.left,y:j.top,width:j.right-j.left,height:j.bottom-j.top},se="red",ce=void 0,(ce=L.getContext("2d")).strokeStyle=se,ce.lineWidth=1,ce.beginPath(),ce.rect(ie.x,ie.y,ie.width,ie.height),ce.stroke(),ce.closePath(),V=C.map((function(e){return W3(e,w)})),K3(L,V,!0)),z=aI.FaceDirection.FRONTAL,!F){e.next=44;break}return e.next=42,FO.calculateFaceDirection({landmarks:F.landmarks,upDownBound:{lower:.35,upper:.7}});case 42:H=e.sent,z=null!==(q=null==H?void 0:H.gesture)&&void 0!==q?q:"";case 44:if(!B||o!==N3.FAR_FACE){e.next=48;break}if("function"!=typeof u){e.next=48;break}return e.next=48,u(C[0],r,B.landmarks);case 48:if(!B||o!==N3.CLOSE_FACE){e.next=52;break}if("function"!=typeof c){e.next=52;break}return e.next=52,c(C[0],r,B.landmarks);case 52:if(G=null==D?void 0:D.code,e.prev=53,G!==aI.Errors.no_face.code){e.next=56;break}throw new Error("no_face");case 56:if(!(G===aI.Errors.multiple_faces.code||C.length>1)){e.next=61;break}if(Q=FO.calculateFaceArea(C[0]),X=FO.calculateFaceArea(C[1]),!(Q<=2*X)){e.next=61;break}throw new Error("multiple_faces");case 61:if(z===aI.FaceDirection.FRONTAL){e.next=63;break}throw new Error("face_not_frontal");case 63:if(G!==aI.Errors.partial_face.code){e.next=68;break}if(Y=FO.cropFaceInsideBox([C[0].topLeft,C[0].bottomRight],A),!(IO.rectEdgeRatio(Y,A)>.95)){e.next=68;break}throw new Error("face_too_large");case 68:if(o!==N3.FAR_FACE){e.next=73;break}if(!(U>R)){e.next=71;break}throw new Error("face_too_large");case 71:if(!(U<P)){e.next=73;break}throw new Error("face_too_small");case 73:if(o!==N3.CLOSE_FACE){e.next=76;break}if(!(U<N)){e.next=76;break}throw new Error("face_too_small");case 76:if(!(Array.isArray(C)&&C.length>0&&I.bottom-C[0].bottomRight[1]>S)){e.next=78;break}throw new Error("face_too_high");case 78:if(G!==aI.Errors.face_out_of_box.code){e.next=85;break}if(o!==N3.FAR_FACE){e.next=82;break}if(!(U>=P&&U<=R)){e.next=82;break}throw new Error("");case 82:if(o!==N3.CLOSE_FACE){e.next=85;break}if(!(U>=N)){e.next=85;break}throw new Error("");case 85:e.next=90;break;case 87:e.prev=87,e.t0=e.catch(53),G=e.t0.message;case 90:if(!_){e.next=100;break}if(G){e.next=99;break}return e.next=94,$.predict(r,B.landmarks);case 94:ee=e.sent,te=W(),ee.isEyeClose&&!te&&(G="eye_close"),e.next=100;break;case 99:K();case 100:if(T&&z3(M,{ratio:null!==(re=null==x?void 0:x.toFixed(3))&&void 0!==re?re:"undefined",error:G,ovalFaceRatio:null!==(ne=null==U?void 0:U.toFixed(3))&&void 0!==ne?ne:"undefined",ovalError:null!==(oe=null==D?void 0:D.code)&&void 0!==oe?oe:"undefined",step:o===N3.FAR_FACE?"far":"close"}),ae=V3(G),J(ae),!ae){e.next=108;break}if("function"!=typeof m){e.next=107;break}return e.next=107,m({error:G,currentStep:o});case 107:return e.abrupt("return");case 108:if(!(B&&o===N3.FAR_FACE&&P<=U&&U<=R)){e.next=113;break}if("function"!=typeof u){e.next=113;break}return e.next=112,l(C[0],r,B.landmarks);case 112:return e.abrupt("return");case 113:if(!(B&&o===N3.CLOSE_FACE&&U>=N)){e.next=118;break}if("function"!=typeof s){e.next=118;break}return e.next=117,s(C[0],r,B.landmarks);case 117:return e.abrupt("return");case 118:if(!(B&&o===N3.START_FLASHING&&U>=N)){e.next=123;break}if("function"!=typeof d){e.next=123;break}return e.next=122,d(C[0],r,B.landmarks);case 122:return e.abrupt("return");case 123:e.next=129;break;case 125:e.prev=125,e.t1=e.catch(0),console.error(e.t1),g({error:e.t1});case 129:case"end":return e.stop()}var ie,se,ce}),e,null,[[0,125],[53,87]])})));return function(t,r){return e.apply(this,arguments)}}(),[L,M,T,i,b,o,Z,I.left,I.top,I.right,I.bottom,J,P,R,N,d,u,m,l,c,s,g,S,h,_,$,W,K]);return dv.useEffect((function(){var e=null,t=!1;return G&&function r(){e=requestAnimationFrame(function(){var e=$m(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=2;break}return e.abrupt("return");case 2:if(null!==i.current){e.next=4;break}return e.abrupt("return");case 4:if(null===q.current&&(q.current=n),!(n-q.current<p)){e.next=9;break}return r(),e.abrupt("return");case 9:return q.current=n,e.next=12,ee(F,O);case 12:r();case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}(),function(){t=!0,cancelAnimationFrame(e)}}),[O,F,ee,G,i,p]),{warmupDone:z,faceError:X}}var Q3,X3,Y3="rgba(0,0,0,0.6)",$3=function(e){var t=e.onVideoPlayed,r=hg(dv.useState(!1),2),n=r[0],o=r[1],a=hg(dv.useState({}),2),i=a[0],s=a[1];return{onVideoPlayed:dv.useCallback((function(e){var r,n,a,i,c,u,l,d=(i=(r=e).videoAreaWidth,c=r.videoAreaHeight,u=r.lostX,l=r.lostY,WW.isMobile?(n=i,a=c):(n=window.innerHeight,a=window.innerHeight),{width:n,height:a,x:Math.max(Math.round((i-n)/2+u),0),y:Math.max(Math.round((c-a)/2+l),0)});s(d),o(!0),"function"==typeof t&&t(e)}),[t]),cropArea:i,isPlaying:n}},Z3=function(e,t,r,n){var o=t.toDataURL("image/jpeg",.8);return e?{label:"portrait",base64:o.split(",")[1],landmarks:r,index:n}:{label:"portrait",base64:o.split(",")[1],index:n}},J3=function(){var e=$m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",30);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e0=function(e){var t=e.className;return dv.createElement("svg",{className:t,width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dv.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",fill:"#0276F1"}),dv.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 36.1124C30.6895 36.1124 36.1124 30.6895 36.1124 24C36.1124 17.3105 30.6895 11.8876 24 11.8876C17.3105 11.8876 11.8876 17.3105 11.8876 24C11.8876 30.6895 17.3105 36.1124 24 36.1124ZM24 38C31.732 38 38 31.732 38 24C38 16.268 31.732 10 24 10C16.268 10 10 16.268 10 24C10 31.732 16.268 38 24 38Z",fill:"white"}),dv.createElement("path",{d:"M18.1465 20.169C18.1465 19.6236 18.5886 19.1815 19.134 19.1815C19.6793 19.1815 20.1214 19.6236 20.1214 20.169V22.1439C20.1214 22.6893 19.6793 23.1314 19.134 23.1314C18.5886 23.1314 18.1465 22.6893 18.1465 22.1439V20.169Z",fill:"white"}),dv.createElement("path",{d:"M28.0213 20.169C28.0213 19.6236 28.4634 19.1815 29.0087 19.1815C29.5541 19.1815 29.9962 19.6236 29.9962 20.169V22.1439C29.9962 22.6893 29.5541 23.1314 29.0087 23.1314C28.4634 23.1314 28.0213 22.6893 28.0213 22.1439V20.169Z",fill:"white"}),dv.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0714 19.1135C24.654 19.1135 25.1262 19.5858 25.1262 20.1683V24.6119C25.1262 25.7398 24.2119 26.6542 23.084 26.6542H22.5902C22.0077 26.6542 21.5354 26.1819 21.5354 25.5994C21.5354 25.0168 22.0077 24.5446 22.5902 24.5446H23.0166V20.1683C23.0166 19.5858 23.4889 19.1135 24.0714 19.1135Z",fill:"white"}),dv.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.8537 27.4214C29.2114 27.8813 29.1285 28.544 28.6687 28.9016C26.6697 30.4564 24.6954 30.8255 23.0184 30.5817C21.3833 30.344 20.0946 29.5339 19.3755 28.8149C18.9636 28.403 18.9636 27.7351 19.3755 27.3232C19.7875 26.9113 20.4553 26.9113 20.8672 27.3232C21.3002 27.7562 22.184 28.3286 23.322 28.4941C24.4181 28.6534 25.8176 28.4466 27.3735 27.2364C27.8334 26.8788 28.4961 26.9616 28.8537 27.4214Z",fill:"white"}),dv.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",stroke:"#DAEAFB"}))};e0.defaultProps={className:""},e0.propTypes={className:Lv.string};var t0,r0=aw.div(Q3||(Q3=pg(["\n --color: #0276f1;\n\n & .indicator {\n color: var(--color);\n }\n\n & .gauge {\n background-color: var(--color);\n }\n"]))),n0=aw.div(X3||(X3=pg(["\n height: 10px;\n position: relative;\n background: #daeafb;\n border-radius: 100px;\n margin-block-end: 8px;\n\n & > span {\n display: block;\n height: 100%;\n border-radius: 100px;\n width: 0;\n overflow: hidden;\n }\n"]))),o0=function(e){var t=e.value,r=e.className;return dv.createElement(r0,{className:r},dv.createElement(n0,null,dv.createElement("span",{className:"gauge",style:{width:"".concat(t,"%")}})),dv.createElement("div",null,dv.createElement("span",{className:"indicator"},"• ",t,"%")))};o0.defaultProps={value:0,className:""},o0.propTypes={value:Lv.number,className:Lv.string};var a0,i0=aw.b(t0||(t0=pg(["\n color: #1d1d1d;\n padding: 8px 12px;\n background: #fafafa;\n border: 1px solid rgba(29, 29, 29, 0.04);\n border-radius: 100px;\n display: flex;\n align-items: center;\n flex-direction: row;\n font-size: 16px;\n"]))),s0=function(e){var t=e.children,r=e.className;return dv.createElement(i0,{className:r},t)};s0.defaultProps={children:null,className:""},s0.propTypes={children:Lv.node,className:Lv.string};var c0,u0=aw.span(a0||(a0=pg(["\n color: #1d1d1d;\n font-weight: bold;\n background: rgba(255, 255, 255, 0.8);\n border-radius: 12px;\n padding: 12px 16px;\n max-width: 200px;\n text-align: center;\n display: inline-block;\n"]))),l0=function(e){var t=e.children,r=e.className;return dv.createElement(u0,{className:r},t)};l0.defaultProps={children:null,className:""},l0.propTypes={children:Lv.node,className:Lv.string};var d0,f0,p0=aw.div(c0||(c0=pg(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1001;\n\n background-color: ",";\n"])),(function(e){return e.$overlay?"white":"transparent"})),h0=function(e){var t=e.children,r=e.overlay;return dv.createElement(p0,{$overlay:r},r&&dv.createElement(gZ,null),dv.createElement("div",{style:{visibility:r?"hidden":"visible"}},t))};h0.defaultProps={children:null,overlay:!1},h0.propTypes={children:Lv.node,overlay:Lv.bool};var m0={width:210,height:300},g0={width:WW.isMobile?window.innerWidth:window.innerHeight,height:window.innerHeight},v0=aw.ellipse(d0||(d0=pg(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),y0=aw.rect(f0||(f0=pg(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),b0=dv.forwardRef((function(e,t){var r=e.className,n=e.scale,o=e.debug,a=e.width,i=e.height,s=e.padding,c=e.verticalOffset,u={left:a/2-m0.width/2-s.left,top:i/2-m0.height/2-s.top+c,right:a/2+m0.width/2+s.right,bottom:i/2+m0.height/2+s.bottom+c};return dv.createElement("svg",{className:r,viewBox:"0 0 ".concat(a," ").concat(i),width:a,height:i},dv.createElement("mask",{id:"OVAL_MASK"},dv.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),dv.createElement(v0,{ref:t,cx:a/2,cy:i/2+c,rx:m0.width/2,ry:m0.height/2,$scale:n})),dv.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),o&&dv.createElement("rect",{x:"0",y:"0",width:a,height:i,stroke:"red",fill:"none"}),o&&dv.createElement(y0,{x:u.left,y:u.top,width:u.right-u.left,height:u.bottom-u.top,$scale:n,fill:"none",stroke:"red",strokeWidth:.5}))}));b0.propTypes={className:Lv.string,scale:Lv.oneOfType([Lv.number,Lv.string]),debug:Lv.bool,width:Lv.number,height:Lv.number,padding:Lv.oneOfType([Lv.number,Lv.shape({top:Lv.number,right:Lv.number,bottom:Lv.number,left:Lv.number})]),verticalOffset:Lv.number},b0.defaultProps={className:"",scale:1,debug:!1,width:g0.width,height:g0.height,padding:0,verticalOffset:0};var w0={en:{face_authentication:"Face authentication",hold_still:"Hold still",uploading:"Uploading",start:"Start",continue:"Continue",retry:"Retry","face_authentication.successful":"Successful face authentication","face_authentication.unsuccessful":"Unsuccessful face authentication",move_face_into_frame:"Fit your face into the oval",face_not_found:"No face detected",processing_result:"Processing result",please_move_face_into_center_frame:"Please fit your face in the oval",please_move_face_closer:"Please move your face a bit closer",please_move_face_farther:"Please move your face a bit further",please_open_your_eyes:"Please open your eyes",please_look_straight_at_the_camera:"Please hold your device at eye level",please_only_one_face:"Multiple faces detected",please_move_face_down:"Please move your face down a little","timeout.remaining":"Remaining time: <%= remain %> seconds","timeout.expired":"You need to complete within <%= timeout %> seconds. Please try again.",move_face_closer:"Move your face closer"},vi:{face_authentication:"Xác thực khuôn mặt",hold_still:"Giữ yên",uploading:"Đang tải lên",start:"Bắt đầu",continue:"Tiếp tục",retry:"Thử lại","face_authentication.successful":"Xác thực khuôn mặt thành công","face_authentication.unsuccessful":"Xác thực khuôn mặt không thành công",move_face_into_frame:"Đưa mặt vào khung",face_not_found:"Không tìm thấy khuôn mặt",processing_result:"Đang xử lý kết quả",please_move_face_into_center_frame:"Đưa khuôn mặt vào giữa hình oval",please_move_face_closer:"Đưa khuôn mặt lại gần một chút",please_move_face_farther:"Đưa khuôn mặt ra xa một chút",please_open_your_eyes:"Vui lòng mở to mắt",please_look_straight_at_the_camera:"Vui lòng đưa thiết bị ngang tầm mắt",please_only_one_face:"Có nhiều mặt trong khung hình",please_move_face_down:"Đưa khuôn mặt xuống một chút","timeout.remaining":"Thời gian còn lại: <%= remain %> giây","timeout.expired":"Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại.",move_face_closer:"Đưa mặt lại gần"}},k0=dv.createContext({}),C0=function(e){var t,r=e.children,n=hN.useSDKSettings().lang;return dv.createElement(k0.Provider,{value:null!==(t=w0[n])&&void 0!==t?t:w0.vi},r)};C0.propTypes={children:Lv.node.isRequired};var E0,S0=function(){var e=dv.useContext(k0);return dv.useCallback((function(t,r){var n,o;return r?iY(null!==(n=e[t])&&void 0!==n?n:t)(r):null!==(o=e[t])&&void 0!==o?o:t}),[e])},B0=function(e,t){var r=dv.useRef(e);dv.useEffect((function(){r.current=e}),[e]),dv.useEffect((function(){t&&"function"==typeof r.current&&r.current()}),[t])},_0=Object.freeze({READY:"READY",RUNNING:"RUNNING",STOPPED:"STOPPED"}),x0=aw.span(E0||(E0=pg(["\n display: inline-block;\n margin-block-start: 10px;\n color: red;\n text-align: center;\n max-width: 350px;\n"]))),T0=function(e){var t=e.onTimeout,r=e.timeout,n=e.shouldStart,o=e.shouldStop,a=S0(),i=function(e){var t=e.startTime,r=void 0===t?3:t,n=e.onCountDownDone,o=e.autoRestartAfter,a=void 0===o?-1:o,i=hg(dv.useState(r),2),s=i[0],c=i[1],u=hg(dv.useState(_0.READY),2),l=u[0],d=u[1],f=dv.useRef(),p=dv.useCallback((function(){d(_0.RUNNING),f.current=setInterval((function(){c((function(e){return e-1}))}),1e3)}),[]),h=dv.useCallback((function(){d(_0.READY),c(r),clearInterval(f.current)}),[r]);return dv.useEffect((function(){var e=null;return 0===s&&(d(_0.STOPPED),clearInterval(f.current),"function"==typeof n&&n(),-1!==a&&(e=setTimeout((function(){h(),p()}),1e3*a))),function(){clearTimeout(e)}}),[s,n,a,h,p]),{state:l,countdown:s,startCountDown:p,stopCountDown:h}}({startTime:r,onCountDownDone:t,autoRestartAfter:3}),s=i.countdown,c=i.startCountDown,u=i.stopCountDown;return B0(c,n),B0(u,o),dv.createElement(dv.Fragment,null,s>0&&s<10&&dv.createElement(x0,null,a("timeout.remaining",{remain:s})),0===s&&dv.createElement(x0,null,a("timeout.expired",{timeout:r})))};T0.propTypes={onTimeout:Lv.func.isRequired,timeout:Lv.number.isRequired,shouldStart:Lv.bool.isRequired,shouldStop:Lv.bool.isRequired};var A0={8:[" r rrr"," r rr"," r r rr "," r rrr "," r r r "," rr r rr"," rr r "," rr rrr"," rr r"," rrr r"," r rrr "," r r r "," r r rr"," r r r "," r rrr r"," r r "," rrr r "," r rr r"," rrr rrr"," r r "," rr r "," r rrr "," r rr "," r r rr"," r r r"," r r r"," r rr r"," r r r "," r rr r"," r rr rr"," rr rr "," rr rr"," r rrr"," r r"," r rrr"," r rr "," r rr r "," rr r "," rr r r "," r r "," rr r "," rr r "," r r r"," rr rr"," rr "," r rr "," rrr r r"," r r r"," rrr rr"," r rr"," rrr "," rr rrr"," r r "," rrr "," r r "," r r r"," r rr "," rr rr "," rrr r"," rr r r"," r r r r"," rr rrr "," rrr rr "," rrr r"," rrr rr"," r rr "," rrr r "," rr rr"," rr rr r"," r rr "," rr r"," r r rr"," r r r"," r r rrr"," rr r r"," rrr r "," rr r r"," r r "," rr r "," rr rr "," r r "],9:[" r r r "," r r r"," rrr r r "," r rrr "," r r rr"," rr r "," r r r "," r rrr "," rr rr "," rr r r "," r r rrr"," r r r r"," r rr r"," rr r r"," r rr "," rrr r "," r rr r"," rr rr "," rr r r"," rr r rr"," rr rrr "," r r r"," r r r "," rr rr r"," r rr r"," rrr rrr "," rr r r"," r r r "," rrr "," r r rr"," r r rrr"," r r r rr"," r r r "," rrr rr"," r rrr r "," rrr r "," rrr r "," rrr r "," r rr r r"," rr r r "," rr r r"," r r r"," rr rr r"," rr r r r"," r r r "," r r rr "," rr r r "," r rr r "," rr rr "," rr r "," rr r"," r r r"," rrr r"," r rr "," r r "," r r "," rrr r "," r rr "," r rr r "," r rr rr"," rr r "," r r rr "," rrr rr"," r rrr "," rrr rrr"," r rr "," r r rrr"," r rrr r"," r r rr r"," rr rr r "," r rrr "," r r rr"," rr r "," r r r "," r r r r "," r r "," r rr rr "," r rrr "," r rr "," rr rrr "," r r "," r r r r"," rr rr r"," r rr rr"," r r r "," rr rr"," r r rrr "," r r r "," rr rr rr"," r rr rrr"," rr rr "," rr r rr"," rrr rr "," rrr rr "," rr rrr "," r rrr"," rr r r"," rrr rr "," rrr rr"," rrr r r"," rr rr"," r rrr r"," r rr "," rr rrr"," rr r r"," r rr r"," r r rr "," r rr rr"," r rrr rr"," rrr r r"," r rr"," r r rr "," r r r"," rrr rrr"," rr r "," rr rr "," r r rr"," rr rrr r"," rrr r rr"," r rr r "," r r r"," r rr r"," rrr r r"," rr r rr"," rr r rrr"," r r "," r rrr"," rrr r "," r r r r"," rr rrr"," r r "," rr r "," rr r rr "," r rrr r"," rr r "," rrr r"," r rr r "," r rr r"," r rr "," r r rr"," r r r "," rr rrr"," rr rr "," r rrr "," rrr rr r"," r r rr"," rr r r "," r r r r"," r r r"],10:[" r rr r"," rrr rrr "," rr r rr "," r r rrr"," r rr r"," r r rr "," r rrr rr"," r r rr "," rr r r"," r r rr "," rr rrr "," r rr r r"," rr r rr "," r r r r "," r rrr "," r rr rr "," rr rr r"," rr r r "," r rrr r"," r r r "," r r r"," rrr r "," r r r"," rr r rrr"," r r r rr"," r rr rr"," r rr r "," rrr r r "," rr rr r"," r r rr"," r r r r"," rrr r rrr"," r r r r "," r r rrr "," r rrr rr "," rrr r"," r rrr "," r r r "," r rrr r "," r rr rrr"," r rrr rrr"," rr r r "," rr r r "," rrr r rr"," rr rrr "," rrr r "," rrr rr r"," rrr r "," r rrr r "," r r rrr r"," r r r r "," rrr r r "," rrr rrr "," rr r rr "," r r r rr"," rr r r r"," rr rr "," r rr rr "," rr rrr r"," rr rr "," r rr r "," r rrr r"," r r r r"," rr rrr "," r r "," rr r r "," rrr rr r"," rr r rr"," r rr r"," r r r"," rr r rr r"," r r rr r"," rrr rrr "," r r r r "," r r rrr "," rr r "," rrr r r "," r r rr "," r r r r "," r rrr r"," rr rrr "," r rrr rr"," rr r rr"," r r r "," r r rr r"," r r r r"," rr rr "," rrr rr "," r r r"," rr rr "," rr rrr"," r rr r"," r r rrr"," rr rr "," r rrr rr"," rr r "," r rr r "," rr r "," rr rr r "," rr rr r r"," r rrr r "," r rrr "," r rrr "," r rr rr"," rr rr rr"," rr rrr "," r r rr "," rr r r"," rr r "," rr r rr"," r rr rrr "," rr rrr r"," rr r r "," rr r rr "," r rrr "," r rr r r"," r r r "," rr rr r "," r r rr "," r rr r "," r rr r "," r rr r r"," rrr rrr"," rr r r rr"," rrr rr "," r rr rr r"," rr r r r"," r rr r"," r rr rr "," r r r "," r r rr r "," rrr r rr"," r r "," r rrr r "," r r rr r"," r r r r"," r rrr r r"," rr r rrr "," rrr rr "," r r rrr"," r r r "," rr r rr"," r rr r"," r r "," rrr r r "," rr rrr r"," rrr rr "," rr r r "," r r r r"," rrr r "," r rr rrr"," r rr r "," rrr r r"," rr r r"," r r r "," r r rrr"," rr r "," rr rr r"," r r r r"," r rr "," r rr rr "," rr r r "," rr r rrr"," rr rr r"," rrr rrr"," r r rrr"," r r r"," r r r "," rrr r r"," r rr r "," r rr rr"," rr rrr r "," r r r r"," rr r r r "," r rr r "," rr r r "," r rr "," r rr rr"," r rr rrr"," rrr r rr "," r r rrr "," r r r rr"," r r r "," r rrr r"," rr r "," rr rr"," r rr r "," rr r rr"," rr r rrr"," r rr r rr"," r r r "," r r r rr "," rr r r r"," r r r rr"," rr rr rr "," rrr r r"," r rr r r"," rr rr r "," rr r r"," r rr "," rrr rr r"," r r r "," r r rr "," rr rr r"," rrr rr rr"," r rrr "," rr rr rr"," rrr r r"," rrr r rr"," r r r "," rr rrr"," rrr rr "," rr rrr rr"," r r r"," r rrr "," r r rr"," r rr "," rr rr "," rrr r r r"," r rrr"," r r r rrr"," rrr rr"," r r rr "," r rrr r"," rr r r"," rrr r r"," rr rr rrr"," r r r r"," rrr r "," r r r r"," r r rr"," r rr rr"," rrr rr r "," r r r r r"," r r r "," r r r "," r rr r "," r r rr rr"," rrr r "," rr rr r "," r rr r r "," rr r r r"," rr rr r"," rr rrr "," rrr rrr r"," r r rrr "," r r rr"," rr r r"," rr r rr"," r r rr"," r r rr "," rrr r "," r rrr r"," r rr "," r r r "," r r r r"," rr r r "," rr rr "," rrr r r"," r rr "," rr r r"," rrr rr "," r r rr"," r r rr"," r r rr r"," r r r "," rrr rrr"," rrr rr"," r rr rr"," r r rr "," rr r r "," r rr r"," r r rrr"," rr rr rr"],11:[" rrr rrr "," r r r r r"," r r rrr"," r rr rr "," r rr rrr"," r r r r r"," rr r rrr"," rrr rrr r"," rr r r "," rr rrr rrr"," r rrr rrr"," r r r "," rr rrr r"," r rrr "," rr r rrr "," r rr rr"," rrr rr r"," rr r r "," r rrr rr"," r r rrr r"," rr r r r"," rrr r r"," r r rrr "," r rr rr r"," rr rrr r"," rrr r rrr"," rr rr r"," r rrr r "," r rr rrr "," r r rr"," rr r r "," r r r r "," r rr rr"," r rr r"," rrr rr "," rrr rr r "," rr r r r"," rr rrr rr"," rrr rr "," r rrr "," r rr r "," rrr rrr"," r rr rr rr"," r r r rr "," rr r rr rr"," r rr r "," r r r "," r rrr r "," rrr r r r"," rrr r rr "," r r r "," rr r rrr "," rrr r r"," rr rr r "," rr r r "," r rr r rrr"," r r r r"," rr r rrr "," r rr r"," r r rr"," rr r r "," rr r r"," r r r rr"," rrr r rr "," r r r r"," r rr r rr "," r r rr "," r r rr r"," r rrr rr "," r r r "," r rr r "," rr r r r"," rr r r r"," r rrr rr "," rr rrr "," rrr r r "," rrr r rr "," rr r rr"," rr rrr r"," r r rrr "," r r rr r "," r rr rr r "," rr r r r "," r r r "," rr r r "," r r r rrr "," rrr rr r"," r rr r "," rr rr r "," rr rr rr "," rrr r r "," rrr rr r r"," r r rrr "," r rr r rr"," rr rrr rr"," rr rr rr r"," r r r"," r rrr r"," rr r r r"," r r rrr "," r rr r rr"," rrr r r "," r rr r "," r rr rr "," r rr rr "," rr rrr rr "," rr rr rr "," rr r rr "," r r r r r"," rr rr rrr"," r r rr r "," r r r "," r r r r"," rr r rrr"," r rr r "," r r rr"," rrr r r"," rr rr r "," rrr r rr"," r r rr r"," rr rr r r"," r r r r "," r r rrr rr"," r rr "," r r r r "," rrr r rrr"," rrr r r r"," rr r rrr r"," rr rr r r"," rrr r r "," r rr r r "," rrr rr "," rr r rr"," r r rrr"," r r r r r "," r rrr r r"," r r rr r"," r r rrr "," r r rrr r "," r r r rr"," r rr rr "," rr rr rr "," r rrr r "," r rr rrr"," r r r r"," rrr r "," rr rr "," rr rrr "," rrr r r"," r rr r r "," r r rr "," r r rr "," r rr rr "," r r rr "," rr rr rr"," r rr "," rr r rr "," r rr r r "," r r r r"," r r r "," r rr rr "," rrr r r "," rr r r "," r r rr "," rr r rr r "," rr rrr"," rr rr rrr "," rr rr r"," r r r r "," rr r rrr"," rr rrr "," rr r r "," r rr r "," rr r r "," rr rrr r r"," rr r "," r r r rr "," rr rr rr "," rrr r "," r r rr r"," rr r r r "," rr r r r "," rrr r r"," rrr r rr"," r r r r "," rr rr r "," rrr rr "," r rr rrr"," r rr rr"," r rrr r r"," r rrr "," r rrr r"," rrr rrr r"," r r r "," r r rr "," r r rrr"," rr rr r"," r r rrr"," rrr rrr r "," rr r r r"," rrr rrr"," r r rrr r"," rr r r rr"," r r r "," rr rrr r "," rr rr r "," r r r "," r rrr "," r r r r "," r rrr r"," r r rr r "," r rr rrr "," rr r rrr"," rrr rr"," rrr r r r"," rrr rr r"," r rr r "," rr rr r r"," r r rrr "," r r r rr"," r r rrr "," rrr rr r "," rr rrr r"," rrr r rr"," r r rr rr"," rr rr "," r rr r"," r rr "," rrr r r "," r r rr "," r rrr r"," r rr r"," r r rr r"," r rr r r"," rr r rr"," rrr r rr"," r r rr"," r rrr rrr"," r rrr rr "," r r r r "," rrr r rr"," r r r r "," rrr rr rr"," r r rr rrr"," r r r r"," r rrr "," rr r r r"," rr rrr "," rr r r r"," rr r rrr "," rr r r"," r r r r"," rr rrr r"," rrr r r "," r r r "," r rr r r r"," r rr rrr r"," r r r r"," r r r rr r"," rrr r r r"," r r rrr"," rr rrr "," r r r r"," r r r"," r r rr rr"," rrr rr r"," r r rr "," r r r rr"," r rr r r "," r r r rr"," r rrr rr"," r r r"," r r rr"," r rrr r "," rr rr r "," rrr r "," rr rr r "," r r r r "," r r rr "," rrr r rr"," r rr r "," rr r r r r"," r r r r "," rr r r "," rrr rr "," rr rr rrr"," rr r rr"," r rrr rrr"," r rr r "," rr rr rr"," rr r r "," r rr rr "," r r r r "," r r r "," rr r rr "," r r rr "," r r r rr"," rr r r r "," r r rr "," r r r rr"," r r rrr"," rr rr r r"," r rrr rr r"," r rr rr"," r r rr "," r rr r r"," rr rr r "," r r rrr r"," r rrr rr "," rr rrr "," rrr r r "," rrr r r"," rrr rr "," rr r "," r rrr r rr"," r rrr r"," r rr r r "," rr r rr "," r r rr r r"," r rr r r"," rr r r "," r r r rr"," rrr rrr r"," rrr r r"," r rr r rr"," rr r r r "," rr r r "," rrr rrr "," r r rr"," r r rrr"," r r r r"," rr rr "," r r r r"," rrr rr rr"," rrr r "," r r r r r"," rrr r rrr"," rr rr "," rrr rrr "," r rrr r r "," rr r rr "," rr rr r"," rr r r"," rr r rr r"," r r r r "," r r rr r"," rrr rrr "," rr rrr r "," r rr rrr "," r rrr r"," rr r r"," r rrr "," r rr r "," rrr rrr "," rr r rr r"," rr rrr r "," rr rr rr"," rr r r"," r rr rr r"," r rrr rr"," rr r r "," r r r r "," rr r rr"," r r r r"," r rrr rr"," rr r rrr"," r r r rr "," rrr r rr r"," rrr r "," r rr r r"," r rr rrr"," rr rr rr"," r r rr rr"," r rr rr "," rr r rr"," r rr rr r"," r rrr r "," r rrr r "," rr r rrr"," r r rr "," r r r rr"," r r rrr "," r r r "," rr r r rr"," rr rr rr"," r rrr r "," rr rr "," r rr r r"," rr r r rrr"," rrr r "," r rr rr "," r rr r "," r r r rrr"," r r r rr"," rrr rr rr"," r rr rrr "," r rr rr r"," rrr r r rr"," r r r r"," r rr rrr"," r r rrr r"," r rr r r"," r rrr r r"," r r rr r"," rr rrr "," r rr r "," rr rrr r "," r r r r"," rr rr "," r rr rr"," r rr r "," r r rr r"," rr r rr"," rrr rr r "," rr rr rr"," r rr r "," r r r r rr"," rrr r r "," r r rrr "," rrr r rrr "," r r "," r r r "," r r r r"," r rr r"," r rrr r "," r r rr rr"," rrr rr r"," r rr r rr"," r rrr rr"," rr rrr r"," rr r r r"," rr rr r r "," r r rr r"," r rrr r "," r r r rr "," rrr rr r "," r rr r "," r r r r "," rrr rrr rr"," rrr r r "," r r r "," rr rr rrr"," r r r "," rr r rr "," rr r rr r"," rr rr r"," r rrr rrr "," r rr r r"," r rrr r r"," rrr r rr "," rr r r r"," r r r "," rrr rr rrr"," rr r rr "," rrr rr "," rr r rr "," rr r r rr"," rr r r "," r rr r r"," r rr r r"," r r rr r "," r r rr "," r r rr rr "," rr r r"," rrr rr r"," rr r r rr"," r rrr r"," rr r rr r"," r r r r r"," rr r r "," rr rr r"," r r r "," rr r "," r rr r"," r r r rrr"," rr r rr "," rr rr r "," r r rr "," r rr rrr"," r rrr rr"," r rr r r"," r r rrr "," r rr rr "," r rr rr"," rr rrr rr"," r r r "," rr rr r "," r r r r "," rrr r r r "," rr r rr "," rrr rr rr "," r r rr "," r r r rrr"," r r r rr "," rrr rrr "," rr rr r"," r r rr r"," r r r rrr"," r r rr r "," r r r r"," rr rr r rr"," rr r r rr "," r rrr r "," r rr rr"],12:[" rr rr rr r"," r r r rr"," r rr r r "," rr r r rr "," r rr r r"," rrr r r "," r r rr "," rrr rr r "," rr r rr "," rr rr r "," r r r r "," rr r rr r "," r r r rr"," rr rr r rr "," rr r rr "," rrr rr "," r rr r rr"," rrr rr rrr"," r rrr rr "," rr rr r "," r rr r r"," rrr rr rr "," rr r r r "," rrr r r "," r r rr "," r rr rr rr"," r rrr r "," rr rr r"," rr r r r "," rr rr r rr"," rr r r r"," r rr rr"," r r r r"," r rrr rr "," rr r rr "," rrr r r "," r rr rrr"," r rrr rrr "," r rrr rrr "," rr r r rrr"," r rr r r r"," r r r r rr"," r rrr "," r r rr rrr"," rrr r rr r"," r rrr r "," r rr r"," r rrr r "," rr rr r"," r rr r "," rrr r rr"," rr rr "," rrr r rr "," r rr rr r"," r rrr r r "," r r rr rr"," r rr rr r"," rr r r r "," rr r rrr r"," rr r r r"," r r rr rrr"," r rrr rr r"," rr rr r "," r rr r r "," r r r r"," rr rr r r"," rr r rrr"," rr r rr r"," r r r rr "," r rr r "," r rrr r r"," rrr r rr r"," r rrr rr rr"," r rr r r r"," r rr r rr"," rrr r r "," rr rrr rr "," rrr rr "," rrr rrr r"," rrr rr rr"," rrr rr rr"," r r rr rr"," rr r rr "," rr r r "," r rrr r r"," rr rr r "," rr rr rr "," rr r r "," rr r r "," rr rrr r "," rr rr rrr"," rrr r rr "," r r rr rr "," rr r r r "," rrr rr "," r rr r rr"," r r r r r"," r rr r r"," r r rr rr"," r rrr r r "," r rrr r r r"," r r rrr r"," rr r rr r"," r rr r rr "," rrr r r"," rrr r r "," rrr rrr r "," r r r rr "," rr r rr "," r rr rrr"," r rr r "," r r rr "," r r r r"," r r r r r "," r r rrr r"," rr r rr r"," r rr r rr "," r rr rr "," r r r r"," r r r r"," r r r r "," rr r r "," r r r r "," r rr rr "," rr rr r "," rr r rr rr "," rrr rr r "," r r rr r "," rr r rrr "," r rrr rrr"," rr rrr r "," r rr rrr rr"," rr r r"," rr r rr rr"," rr r r"," rrr r r "," r r rrr r "," r rr r rr r"," rrr rr r "," rr rrr r r"," r rrr r r"," rrr rrr rr "," rr rrr rr "," rr r r r"," r rrr r r"," rr r rr"," rr r r r rr"," rr rr r r"," rr rrr rr"," rr r r r"," rrr r rrr "," r r rrr r "," rrr rr r "," rr r r rrr"," r rr rr rrr"," rr r r "," r r rr r "," r rr rrr"," r r r rr rr"," r r rrr "," r r rrr "," rr rrr rrr"," r r rrr "," rr r rr r r"," rr rr rrr"," rrr r rr "," rr rr rr"," r r r r rr"," rr r rrr"," r rr r r r"," rr r r rr "," rrr rrr r"," rrr rr rr "," r r r r "," rr r rrr "," r rrr r r"," r rr r "," rr r r "," r r r rr"," r rrr rr "," r r r r r r"," r r rrr "," rr r rr"," rr r r r "," rr rrr r "," rr rrr r"," r r r "," rrr r rr"," rr rr r"," r rr r "," r rr r "," rr rr rr"," r rr rrr "," r rrr r r"," rr rr r r"," rrr rrr "," r rrr rrr"," rr r rrr r"," rr rr r r"," r rr r r"," r r rrr r"," r r r r"," rr rrr rrr "," r rr r r "," rr rr "," rr r rr "," r rr rrr r"," rr r r r "," rr r r r "," r rr r rr"," r rrr rr r"," rr r r r"," r rr r rrr"," rr r r r r"," rrr rrr r"," r rr rrr "," r r rrr r"," r r rr rr "," r r r r"," rr rr rr "," r rr r r "," r rr rr r"," rrr rrr rr"," rr rrr r r"," r rr r r"," r rr r rrr"," r r rr r"," r r r r r "," r r r r r "," r r r rr"," r r rr r "," r r rr rr"," r r r rrr r"," rr r rr rr"," r r rr r"," r r rr rr"," r r r r"," r r rrr r"," r rrr r rrr"," r r rr rr"," r r r rr"," r rr r "," r rr rrr "," r r r "," rrr r r rr"," r rrr r "," r r r r "," r rr r r"," r r rr r"," r r r rr "," rrr r r"," rr r r "," rrr r r r "," rr r r "," rr rr r "," r rr r r "," r r r rrr"," r rr rr r"," r r r r "," r r r "," r r rrr r r"," r rr r rr"," r rr r "," rrr r r "," r rr rr rr"," r rr r rr"," rr rrr "," rr rrr rr "," rrr r rr "," rrr r rr r"," r r rr rrr "," r r r r r"," rrr r rrr r"," rr r r rr "," rrr r r"," r rr r r"," rr rr r "," rr rr rrr "," r r r rrr"," rr rr rr "," rrr r rrr"," r rr rr r "," r rrr r "," r r rr "," rr r r r "," r r rr "," r r r r "," r rrr r"," rr rrr r "," rr rrr rr "," rr r r r"," rrr rr r"," r r r r rr"," r r rr r"," rrr rr r "," rr rrr rrr"," r rr rr "," rr rr "," r r rrr "," r r rr r"," r r rr r "," r r rr r r "," r r rr rrr"," r rrr rrr"," rrr r r "," r r r r r"," rr rr r rr"," rr r rrr "," rr r r r "," r r r rr"," rrr rr rrr"," r r r rrr"," r r rr r"," r r rr r "," r rrr rr"," r r rrr rr"," r r rr r r"," rr rr r r "," r rrr r"," rrr rr r r"," r rrr rr"," r rrr rr "," r rr r "," rrr r r r"," r r r r r"," r r r r"," r r r r r"," rr r r r"," r r r rr "," rrr rr r "," r rr rr r"," r rrr rr "," r rrr r rr "," rrr r r rr "," rrr rr "," rr r rr r"," r r r "," r rr r "," r rrr r"," rrr r rr r"," rr r rr"," r r rr r r"," r rrr r "," rr r r r"," rr r r "," r r rrr r"," rr rr r r r"," rrr rrr "," rr r r rrr"," rrr rr r"," r rr rrr "," rr r r "," rrr r r "," rr rrr r "," rr r r "," r rrr rrr"," r r rr "," rr rr rrr "," rrr rrr "," rrr r r r "," rrr r r r "," r r r rr"," r r rr r "," r rrr r "," r rr r r"," r r rr "," rr r rrr "," rr rr rr r "," r r r rrr"," r rr rr rr"," r rrr r rr"," rr r r rr"," r r r r"," rr rr rrr "," r rrr r r"," r rr r r r "," r r rr "," r rr r r "," rr rr r "," r rr r "," r rrr rr r"," r r rrr rr"," r r r "," r r r rr"," r r r rrr"," rr r r "," r r rrr "," r r r "," r r r r "," rr rr rr"," r rrr rr"," rr r rrr"," r rr rr r"," r r rr r"," rrr rr r"," r r r r rrr"," r rr rr "," r rr rrr "," rrr rrr r "," rr r r rr"," r r r r "," r r r "," rr rrr r"," r r r r "," rr r r "," r r rr r"," rrr r r r "," rr rr r r "," rrr r r r"," r r r r "," r rr r r"," rrr r "," rr r rr"," r rr rr "," rr rrr "," r r rr r"," rr rr rr"," rrr r rr"," rr r rr "," rrr rr rr"," rrr rr rrr "," r r rr r "," r r r rr "," r rrr r "," r r rrr "," rrr r rr "," rr r rr rr"," r r rr r"," r rr r r r"," r r rr r "," rr rr rrr"," rrr rr rr r"," r rr r "," r r r rr"," rrr rr r"," rr r rrr "," r rr rr r"," r r r rr r"," r rr r "," r r r r r "," rr r rr r "," r r rr r"," rr r r rr"," r r rrr"," r r r rr "," r r r rrr"," rr r rrr"," rrr r r "," r rrr r "," rr rrr rr"," r rr rr "," rr r rrr"," rr r rr "," r r r r r"," rr rr rr "," rr rrr rr"," rr r r "," r r r r "," rr r rr "," rrr r rr "," r rrr r r "," rr r r r r"," r rr r rr"," r rrr rr "," rr rr rr r"," r r r r"," rr rr r "," r r r r "," rr r rr r"," rr r rr r "," r r rr r "," rr rr rr "," rrr r r "," rr r r rr"," r r r "," rr r rrr"," rr r rrr "," r rrr r"," rrr r rrr"," rrr r r r"," rrr r r r"," r r r r"," r rr r rr "," rr r r r "," rr r r r"," r rrr rrr"," rr rr r rrr"," rr r r r "," rr rrr rr r"," rr r r r "," r r rrr r "," rr rrr rrr"," r r r r r "," r rrr rr"," rrr rr r "," r rr r r rr"," rrr r r r "," r rrr "," r rrr r "," r r rrr r"," r rrr r r"," rrr rr r"," rr r r rr r"," rr rr rrr"," r r r r r"," r r rrr "," rr r r r r"," r rr r r "," rr rr rrr r"," r rr rr "," rr rr r "," r r r r "," r rr r r "," rr rr r rr"," r r r "," rrr rrr r "," rr r rrr "," r rr r rr"," rrr rr rr "," rr rr rrr "," rr rr r r"," rr r r r "," r r r r"," rrr r "," r r r"," r rrr r"," r r r r"," r r rr r "," r r rr "," r r r "," rr r r "," r rr rrr"," r r r r "," r r rrr rr"," r r r r r"," r rrr rr"," rr r r r"," r rr rr "," r r rrr rr "," rrr r r r"," r rr r r "," r r rrr "," r rr r"," rr r r rr"," r r r rrr "," r r r r "," rrr r r r"," rr rrr r r"," rrr r rrr"," r rr rrr"," r rr r rrr"," rr rr r "," r rrr r r "," r rr rr"," r rr "," rrr r r rr"," rr rr r "," rr r rr "," r r r rr"," rrr r r "," rrr r r "," r r r r "," r r rrr r"," r r rr r"," r rr r r"," rr rrr r"," r r rr rrr"," r rr r r "," r rrr rrr "," rr rr r rr"," rrr rr r r "," r r r rr r"," rr rrr "," r rrr rrr"," rr rrr r "," rr r r r r"," rrr r rr rr"," r rrr rr"," r rrr r"," rr rr rrr"," r rr rrr "," r r rrr "," r rr rr "," rr rrr r"," r r r rr "," r r r rr "," rr rr rr "," rr r rr rr"," rrr rrr r r"," r rr rr"," r rr r rr "," rrr rr rr"," r r r rrr "," rr rr r r"," r r r rrr "," rrr rr rrr"," r r r r "," rr rr rr "," rr rrr r"," rr r r r "," rrr r rrr"," r rrr r "," rrr r r r"," rrr rr r r"," rrr rr r"," rr rrr r "," rr r r rr"," r r r "," rrr rrr r"," rr r r r"," r r rr "," r r r r rr"," r rrr rr r "," rr rr rr r"," r r rr "," r r r rr r"," r r rr r r"," r rr rr "," r rrr rr "," r r rr rr r"," r r rrr rrr"," rr rrr r "," r r r r r "," r r rr "," r rr r r"," r r rr r"," r r r r"," r rr r "," r r rrr rr"," rrr r rr r "," rrr r rrr"," r rrr rr "," r r rr r "," r rr rrr r"," r rr r r "," rr rr r r "," rr rr r "," r r r r r"," rr r rrr r "," r r rrr "," rr rrr rr"," r r r r"," rrr r r r"," r r r "," r rr rrr"," rr rrr rr"," rr rrr "," r r rr r rr"," r r r r r"," r r r rr "," r r rrr "," r rr rrr r"," rr rr r "," r r r "," r rr rr "," r r r "," r rr rr "," r r r r r"," r r r r "," r r rrr"," r r rr "," r r rr rr "," r rr rr rr "," r r r r"," r r r r"," r rr r "," rr r rr r "," rr rr r"," rr rrr r rr"," rrr rr rr"," r rrr r "," rrr rr r "," r r rrr"," r rr r "," rr rr r"," rrr r rr "," rr r rr r"," r r rrr r "," rr rr r r "," r rr r r"," r rr rr r"," r rr r rr "," rrr r rr"," r r r rrr"," rr r rr r"," rrr rr r"," rr r rrr r"," r rr r r"," rr r rr "," rr rr rr"," r r r r rr "," rr rr rr rr"," rr rrr r"," r rrr rr "," r r rr r"," r r r rrr"," r r rr r "," r r r rr "," r r r rr r "," r rrr r rr"," rrr rr rr "," rrr rrr rr"," r r rr rr"," r r rr "," r rr r r"," rr r r rr "," rr r r rr"," rr rr rr r"," rr r rr"," rr r r r "," r rrr rr "," rr r rr "," rr r rrr"," r rr r r"," rr r rr "," r rrr rrr "," rr r rr r"," rrr rrr "," r r rrr r"," rrr rr r r"," rr r r"," rr rrr rr"," rr r r r"," rr rrr "," rr r rrr rr"," rr r rr "," r rr rrr "," r r rr r r"," rr r r "," r r r "," r r rrr"," r r rr "," r r rrr"," rr r rr r "," rr rr r"," rr rrr r "," r r r "," r r r r"," rr rr r r"," r r r r "," r rr rr r "," rr rr rr "," rrr r rr"," r r rrr "," rrr rrr"," r r r r "," r r r r "," r rr rrr "," r rr rrr r"," rr r r rrr"," r r rrr "," rr r r r"," r r rr"," r rr rr r "," rrr r rr "," rrr r rrr "," rr r rrr "," rr r rrr "," r r r r r"," rrr rrr r"," r r rrr "," r rr r r "," rrr r r r r"," rr r r rrr "," rrr r "," rrr rr "," rrr rrr r "," rr r r r r"," r rr rr rr"," rr rrr r "," r r rr "," r r r r r"," rr rr r "," r r r r "," rr r r r"," rrr rrr "," r r rr r"," r rrr rr"," r r r r "," r r r r "," r r r r "," r rrr r "," r r r rrr"," r rrr r r"," r r rrr r "," r rrr "," r r r rr "," r rr rr "," r r r rr r"," r rr r rrr "," r rrr r r"," r rr rr "," r r r r "," r r rrr r"," rrr r r"," r r r rr"," r r r rrr "," r r r rr"," rr r r rr "," rr r r rr"," r rr rr"," rrr r r rr"," rrr r r "," rrr r rr "," rr rr rrr"," rr rrr r"," r r r rr"," rr r rr "," r r r rr"," r rr rr r r"," r rr r r "," r rr r rr"," r r rr rr"," r r rr rr "," rrr r rrr "," r r rrr "," rr r r r"," rr rrr r r "," rrr rr r rr"," r rr rrr "," r rr r rr"," r r r rrr "," rr r r "," rrr r rrr "," rrr r r r"," rrr r r r"," r r r rr "," r r r r rr"," r rr r r"," rrr r r rr"," rr rr r "," rrr rrr r"," rrr r rr"," r rr rr r"," r rr rr r "," r rr rrr r "," r rr rr"," rr rrr r r"," rr r rr rrr"," rr r r "," r rr r"," r rr r r "," rrr rr r "," r r rr rr "," r rr r "," rr r r rr"," rr r rrr "," rrr r r "," r rrr rrr r"," r r rr r"," r rr rrr "," rrr r rr"," r r r rr "," r rr rr"," rr r rr "," rrr rr r r"," rr r r "," r rrr r "," r r rr rr"," rrr r r"," rr r rr r"," rr r r rr"," r r r rr "," r r rr"," rrr rrr rr"," r r r r r"," rrr rrr "," r r r rr"," rrr r r "," rrr rrr "," rr rr rr"," rrr rr r "," r r r r "," r rrr r "," rrr r r rrr"," r rrr r "," rrr r rr "," r r r r "," rr r "," rr rr rr "," r rr r r "," r r r rr "," r r r r r"," rrr rrr rrr"," r r rr r r"," r r rr rr"," r r r r "," rr rr r r"," r rr rr r"," rrr rr "," rrr r r"," r rr rrr"," r r rr "," rr rr rr "," r r rr r "," r r rr r "," r rr r "," r r rrr"," r r r rr r"," r rrr r rr"," rr rr r r"," rr r rrr r"," rr r rr r"," r rr rr "," rrr r rrr"," r r r rr"," r r rr"," rr r r r"," rr rr r r "," rr rr r r"," rrr rr rr"," r rr rr "," r rrr rr r"," r r rr "," r rrr r r "," r rr r r r"," r r r rrr"," rr r r r r "," rr rr rr"," rr rrr "," r rrr r rr"," r r rr r "," r rr r rrr"," r r rr "," r rr r "," r rr rr r "," rr r rr"]},I0=function(e){return dv.createElement("svg",rg({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),dv.createElement("path",{d:"M17.2434 6.06389L17.2438 6.06352C17.4385 5.86879 17.7519 5.86879 17.9467 6.06352C18.1314 6.24826 18.1314 6.57168 17.9467 6.75642L13.0567 11.6464L12.7031 12L13.0567 12.3535L17.9467 17.2435C18.1414 17.4383 18.1414 17.7517 17.9467 17.9464C17.7519 18.1412 17.4385 18.1412 17.2438 17.9464L12.3538 13.0564L12.0002 12.7029L11.6467 13.0564L6.75666 17.9464C6.56192 18.1412 6.24851 18.1412 6.05377 17.9464C5.85903 17.7517 5.85903 17.4383 6.05377 17.2435L10.9438 12.3535L11.2973 12L10.9438 11.6464L6.05377 6.75642C5.85903 6.56168 5.85903 6.24826 6.05377 6.05352C6.24851 5.85879 6.56192 5.85879 6.75666 6.05352L11.6467 10.9435L11.9999 11.2967L12.3534 10.9439L17.2434 6.06389Z",fill:"#5E5E5E",stroke:"#1D1D1D"}))},P0=function(e){var t,r=(tg(t={},O3,0),tg(t,D3,0),tg(t,L3,0),t);return e.forEach((function(e){r[e.type]+=1})),r},R0=dv.createContext({}),N0=function(e){var t=e.apiCredentials,r=e.children,n=$D.useApiClient({apiCredentials:t}).apiClient;return dv.createElement(R0.Provider,{value:n},r)};N0.propTypes={apiCredentials:Lv.shape({accessKey:Lv.string.isRequired,secretKey:Lv.string.isRequired,apiUrl:Lv.string.isRequired}),children:Lv.node.isRequired},N0.defaultProps={apiCredentials:{}};var O0,D0,L0=function(){return dv.useContext(R0)},M0=(O0=[],D0=null,{uploadFrameBatch:function(e,t){D0!==e[e.length-1]&&(D0=e[e.length-1],O0.push(t.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})})))},getAllUploadedBatches:function(){var e=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(O0);case 2:if(!(t=e.sent).some((function(e){var t;return void 0===(null==e||null===(t=e.data)||void 0===t?void 0:t.file_id)}))){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",t.map((function(e){return{id:e.data.file_id}})));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),resetUploadBatches:function(){O0.length=0}}),F0=dv.createContext({}),U0={},j0=function(e){var t=e.children,r=e.clientSettings,n=e.apiCheck,o=hg(dv.useState({}),2),a=o[0],i=o[1],s=L0();dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof s.clientSettings){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,s.clientSettings();case 4:t=e.sent,i(t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[s]);var c=U0;return Object.keys(r).length>0?c=r:n&&(c=a),dv.createElement(F0.Provider,{value:c},t)};j0.propTypes={children:Lv.node.isRequired,clientSettings:Lv.shape({}),apiCheck:Lv.bool},j0.defaultProps={clientSettings:{},apiCheck:!1};var V0,z0,q0,H0,K0,W0,G0,Q0,X0,Y0,$0,Z0=function(){return dv.useContext(F0)},J0={captureFrameSettings:{enable:!1,framesIntervalTime:0,framesBatchLength:10},livenessSettings:{timeout:30,enableFarStep:!0},flashSettings:{flashColor:"rgb(255, 0, 0)",colorsLength:10,delayBetweenColors:120,framesPerColor:4,flashIntensity:1,useFaceDetectorWhenFlashing:!1},maskSettings:{smallScale:WW.isMobile?.65:.6,largeScale:WW.isMobile?.9:.85,ovalPadding:{left:WW.isMobile?20:30,right:WW.isMobile?20:30,top:(WW.isMobile,0),bottom:(WW.isMobile,20)},ovalVerticalOffset:WW.isMobile?60:0,chinToMaskBottomPadding:(WW.isMobile,20)},faceSettings:{minFarFaceRatio:WW.isMobile?.85:.8,maxFarFaceRatio:(WW.isMobile,.9),closeFaceRatio:WW.isMobile?.95:.82},closeEyesSettings:{enable:!1,timeout:5},exifSettings:{enable:!0},imageSettings:{imageScale:1,imageQuality:1}},e2=function(){var e=Z0();return dv.useMemo((function(){return{captureFrameSettings:{enable:GY(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.enable",J0.captureFrameSettings.enable),framesIntervalTime:GY(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_interval_time",J0.captureFrameSettings.framesIntervalTime),framesBatchLength:GY(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_batch_length",J0.captureFrameSettings.framesBatchLength)},livenessSettings:{timeout:GY(e,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.timeout",J0.livenessSettings.timeout),enableFarStep:GY(e,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.enable_far_step",J0.livenessSettings.enableFarStep)},flashSettings:{flashColor:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_color",J0.flashSettings.flashColor),colorsLength:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.colors_length",J0.flashSettings.colorsLength),delayBetweenColors:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.delay_between_colors",J0.flashSettings.delayBetweenColors),framesPerColor:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.frames_per_color",J0.flashSettings.framesPerColor),flashIntensity:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_intensity",J0.flashSettings.flashIntensity),useFaceDetectorWhenFlashing:GY(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.use_face_detector_when_flashing",J0.flashSettings.useFaceDetectorWhenFlashing)},maskSettings:{smallScale:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.small_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.small_scale",J0.maskSettings.smallScale),largeScale:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.large_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.large_scale",J0.maskSettings.largeScale),ovalPadding:{left:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.left":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.left",J0.maskSettings.ovalPadding.left),right:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.right":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.right",J0.maskSettings.ovalPadding.right),top:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.top":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.top",J0.maskSettings.ovalPadding.top),bottom:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.bottom":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.bottom",J0.maskSettings.ovalPadding.bottom)},ovalVerticalOffset:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_vertical_offset":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_vertical_offset",J0.maskSettings.ovalVerticalOffset),chinToMaskBottomPadding:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.chin_to_mask_bottom_padding":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.chin_to_mask_bottom_padding",J0.maskSettings.chinToMaskBottomPadding)},faceSettings:{minFarFaceRatio:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.min_far_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.min_far_face_ratio",J0.faceSettings.minFarFaceRatio),maxFarFaceRatio:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.max_far_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.max_far_face_ratio",J0.faceSettings.maxFarFaceRatio),closeFaceRatio:GY(e,WW.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.close_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.close_face_ratio",J0.faceSettings.closeFaceRatio)},closeEyesSettings:{enable:GY(e,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.enable",J0.closeEyesSettings.enable),timeout:GY(e,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.timeout",J0.closeEyesSettings.timeout)},exifSettings:{enable:GY(e,"data.settings.sdk_settings.flash_liveness_settings.exif_data_settings.enable",J0.exifSettings.enable)},imageSettings:{imageScale:GY(e,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_scale",J0.imageSettings.imageScale),imageQuality:GY(e,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_quality",J0.imageSettings.imageQuality)}}}),[e])},t2=function(e){return Array.isArray(e)?e.map((function(e){var t=e.base64,r=e.label,n=e.index,o=e.metadata;return{base64:t,label:r,index:n,metadata:JSON.stringify(o)}})):e},r2=(aw.div(V0||(V0=pg(["\n color: #ffffff;\n"]))),aw(b0)(z0||(z0=pg(["\n z-index: 2010;\n width: 100%;\n height: 100%;\n opacity: 1;\n margin: 0;\n"])))),n2=aw(s0)(q0||(q0=pg(["\n margin-block-start: 12px;\n z-index: ",";\n\n & svg {\n margin-inline-end: 8px;\n width: 24px;\n height: 24px;\n }\n\n color: ",";\n background: ",";\n\n ","\n"])),1002,(function(e){var t=e.theme;return e.$flashing?t.instruction.flashing.color:"#1d1d1d"}),(function(e){var t=e.theme;return e.$flashing?t.instruction.flashing.backgroundColor:"#fafafa"}),(function(e){return e.$flashing?Hb(["transform:translateY(45vh);padding:12px 16px;font-size:24px;"]):""})),o2=aw.div(H0||(H0=pg(["\n width: 100vw;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n background-color: ",";\n opacity: ",";\n z-index: ",";\n"])),(function(e){return e.$backgroundColor}),(function(e){return e.$intensity}),1001),a2=aw.div(K0||(K0=pg(["\n background: red;\n opacity: 0.2;\n width: 100vw;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n"]))),i2=aw(o0)(W0||(W0=pg(["\n margin-block-start: 10px;\n width: 300px;\n\n z-index: 1002;\n"]))),s2=aw.div(G0||(G0=pg(["\n position: fixed;\n z-index: ",";\n top: 0;\n left: 50%;\n transform: translate(-50%);\n min-width: 250px;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n"])),1002),c2=aw.div(Q0||(Q0=pg(["\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n"]))),u2=WW.isMobile?{width:{ideal:640},whiteBalanceMode:"none"}:null;function l2(e){var t=e.onFlashDone,r=e.apiCheck,n=e.onClose,o=e.onError,a=e.frontCamera,i=e.styledComponent,s=e.onFramesCaptured,c=e2(),u=c.maskSettings,l=c.flashSettings,d=c.faceSettings,f=c.closeEyesSettings,p=c.livenessSettings,h=c.captureFrameSettings,m=c.exifSettings,g=c.imageSettings;if(u.smallScale>u.largeScale)throw new Error("smallScale must be smaller than largeScale");var v,y,b,w,k=L0(),C=h.framesIntervalTime,E=dv.useRef(),S=(v=dv.useRef(),y=KN.useSDKTracking().sendEvent,dv.useCallback((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=performance.now();if("object"===Xm(r)){var o=og({},r);v.current&&(o.interval_vs_previous_in_ms=n-v.current),v.current=n,y({tag:e,event:t,log:o})}if("function"==typeof r){var a=r({lastTimeLog:v.current});v.current=n,y({tag:e,event:t,log:a})}}),[y])),B=S0(),_=dv.useContext(q3),x=l.colorsLength,T=l.framesPerColor,A=l.delayBetweenColors,I=l.useFaceDetectorWhenFlashing,P=l.flashIntensity,R=l.flashColor,N=(b=x,dv.useMemo((function(){var e=A0[b];return e[Math.floor(Math.random()*e.length)]}),[b])),O=function(e){var t=hg(dv.useState(e),2),r=t[0],n=t[1];return dv.useEffect((function(){!function(){var t=$m(regeneratorRuntime.mark((function t(){var r,o,a,i,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Promise.all([60,J3()]);case 3:r=t.sent,o=hg(r,2),a=o[0],i=o[1],s=Math.max(1e3/a,1e3/i,e),n(s),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(0),console.error(t.t0),n(20);case 15:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(){return t.apply(this,arguments)}}()()}),[e]),r}(C),D=dv.useRef(null),L=function(){var e,t=hg(dv.useState(null),2),r=t[0],n=t[1],o=hg(dv.useState(!1),2),a=o[0],i=o[1],s=dv.useRef(null);return dv.useEffect((function(){if(!s.current)return function(){};var e=s.current,t=function(){n(e.getBoundingClientRect()),i(!1)},r=function(){i(!0)};return e.addEventListener("transitionstart",r),e.addEventListener("transitionend",t),function(){e.removeEventListener("transitionstart",r),e.removeEventListener("transitionend",t)}}),[]),[s,null!=r?r:null===(e=s.current)||void 0===e?void 0:e.getBoundingClientRect(),a,i]}(),M=hg(L,4),F=M[0],U=M[1],j=M[2],V=M[3],z=hg(dv.useState(0),2),q=z[0],H=z[1],K=hg(dv.useState(N3.LOADING),2),W=K[0],G=K[1],Q=hg(dv.useState(""),2),X=Q[0],Y=Q[1],$=dv.useRef({frames:[],images:[],total:tg({},O3,0)}),Z=function(e){var t=e.mode,r=e.enableWriteExif,n=dv.useRef(Date.now()),o=dv.useCallback((function(){if(r){var e=Date.now();KM.preWriteExif({mode:t,startTime:n.current,endTime:e})}}),[t,r]),a=dv.useCallback((function(e,t){r&&KM.addExifData(e,t)}),[r]),i=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(n){var o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.imageData){e.next=3;break}return e.abrupt("return",null);case 3:if(r){e.next=5;break}return e.abrupt("return",o.blob);case 5:return e.next=7,KM.writeExif({mode:t,imageData:o,enableExifData:!0});case 7:return a=e.sent,e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[t,r]);return dv.useEffect((function(){r&&KM.initExifData()}),[r]),{prepareExifData:o,writeExifData:i,addExifData:a}}({mode:KM.MODE.SELFIE,enableWriteExif:m.enable}),J=Z.prepareExifData,ee=Z.writeExifData,te=Z.addExifData,re=dv.useCallback((function(){Y(B("move_face_into_frame"))}),[B]),ne=$3({onVideoPlayed:re}),oe=ne.onVideoPlayed,ae=ne.cropArea,ie=ne.isPlaying,se=function(e,t,r){var n=e.smallScale,o=e.largeScale,a=e.ovalPadding,i=t.width/t.height,s=n/o,c=n*r.height,u=o*r.height,l=a.top+a.bottom,d=a.left+a.right,f=c-l,p=u-l;if(parseFloat((p*i).toFixed(2))+d>r.width){var h=((r.width-d)/t.width).toFixed(2);return{smallScale:(h*s).toFixed(2),largeScale:h}}return{smallScale:(f/t.height).toFixed(2),largeScale:(p/t.height).toFixed(2)}}(u,m0,{width:ae.width,height:ae.height}),ce=se.smallScale,ue=se.largeScale,le=dv.useMemo((function(){return hQ((function(){$.current.frames=[],$.current.images=[],$.current.total[O3]=0,M0.resetUploadBatches(),p.enableFarStep&&(H(ce),G(N3.FAR_FACE)),Y(B("move_face_into_frame"))}),200,{leading:!0})}),[H,ce,B,p.enableFarStep]),de=function(e){var t=e.offset,r=e.ovalPadding,n=e.largeScale,o=e.ovalHeight,a=e.maskHeight,i=o/2+r.bottom;return(i+t)*n>a/2?a/2/n-i:t}({offset:u.ovalVerticalOffset,ovalPadding:u.ovalPadding,largeScale:ue,maskHeight:ae.height,ovalHeight:m0.height}),fe=dv.useCallback($m(regeneratorRuntime.mark((function e(){var n,a,i,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(G(N3.STOP_DECTECTING),Y(""),S("selfie_flash","user_activity.finish_flash"),S("selfie_flash","user_activity",(function(e){return{flash_liveness_in_ms:e.lastTimeLog-E.current}})),n=$.current.frames,h.enable&&h.framesBatchLength>0&&0!==(a=n.length%h.framesBatchLength)&&(i=n.slice(-1*a),"function"==typeof s&&s(i),r&&M0.uploadFrameBatch(t2(i),k)),c=P0(n),!p.enableFarStep){e.next=12;break}return $.current.images[0].frames=$.current.total[O3],e.next=11,$.current.images[0].blob;case 11:$.current.images[0].blob=e.sent;case 12:return $.current.images[1].frames=c[D3],e.next=15,$.current.images[1].blob;case 15:return $.current.images[1].blob=e.sent,J(),te("selfie_type",aI.Mode.FLASH),e.next=20,Promise.all([ee({imageData:$.current.images[0]}),ee({imageData:$.current.images[1]})]);case 20:if(u=e.sent,l=hg(u,2),d=l[0],f=l[1],p.enableFarStep&&($.current.images[0].blob=d),$.current.images[1].blob=f,$.current.images=$.current.images.filter((function(e){return!!e})),e.prev=27,"function"!=typeof t){e.next=31;break}return e.next=31,t({images:$.current.images,frames:$.current.frames},{colors:N,flashColor:R});case 31:e.next=36;break;case 33:e.prev=33,e.t0=e.catch(27),o({error:e.t0});case 36:case"end":return e.stop()}}),e,null,[[27,33]])}))),[S,h.enable,h.framesBatchLength,p.enableFarStep,J,te,ee,s,r,k,t,N,R,o]),pe=function(e){var t=e.colors,r=e.onFlashDone,n=e.framesPerColor,o=e.flashColor,a=hg(dv.useState(null),2),i=a[0],s=a[1],c=dv.useMemo((function(){return t.split("").reduce((function(e,t){return e+t.repeat(n)}),"")}),[t,n]),u=" "===c[i]?Y3:o,l=dv.useCallback((function(){s((function(e){return e+1}))}),[]),d=dv.useCallback((function(){s(0)}),[]);return dv.useEffect((function(){i>c.length-1&&(s(null),"function"==typeof r&&r())}),[i,c.length,r]),{colorIndex:i,currentColor:u,goToNextColor:l,startFlashing:d}}({colors:N,onFlashDone:fe,framesPerColor:T,flashColor:R}),he=pe.currentColor,me=pe.colorIndex,ge=pe.startFlashing,ve=pe.goToNextColor,ye=dv.useCallback((function(){$.current.total[O3]+=1}),[]),be=dv.useCallback((function(e,t){$.current.images[0]||($.current.images[0]={blob:CO.takePicture({canvas:t,quality:g.imageQuality}),gesture:"frontal",capture_time:Date.now(),step:O3}),H(ue),V(!0),G(N3.CLOSE_FACE),Y(B("move_face_closer"))}),[ue,V,B,g.imageQuality]),we=dv.useCallback((function(e,t){$.current.images[1]||($.current.images[1]={blob:CO.takePicture({canvas:t,quality:g.imageQuality}),gesture:"frontal",capture_time:Date.now(),step:D3}),rI.unstable_batchedUpdates((function(){G(N3.START_FLASHING),ge()}))}),[g.imageQuality,ge]),ke=null!==me&&W===N3.START_FLASHING,Ce=dv.useCallback((function(e,t,n){var o=$.current.frames,a=Z3(e,t,n,o.length);if(a.metadata={color:he,type:L3},o.push(a),h.enable&&h.framesBatchLength>0&&o.length%h.framesBatchLength==0){var i=o.slice(-1*h.framesBatchLength);"function"==typeof s&&s(i),r&&M0.uploadFrameBatch(t2(i),k)}ke&&ve()}),[r,k,h.enable,h.framesBatchLength,he,ve,ke,s]),Ee=dv.useCallback((function(e){var t=e.error;"no_face"!==t&&"multiple_faces"!==t||le()}),[le]),Se=dv.useCallback((function(e,t,n){var o=$.current.frames,a=Z3(e,t,n,o.length);if(a.metadata={color:"",type:D3},o.push(a),h.enable&&h.framesBatchLength>0&&o.length%h.framesBatchLength==0){var i=o.slice(-1*h.framesBatchLength);"function"==typeof s&&s(i),r&&M0.uploadFrameBatch(t2(i),k)}}),[r,k,h.enable,h.framesBatchLength,s]),Be=dv.useMemo((function(){return null===me?O:me%T==0?Math.max(A,O):O}),[me,A,O,T]),_e=G3({onError:o,isVideoPlaying:ie,step:W,cropArea:ae,videoRef:D,onCloseFaceDetected:we,onFarFullFaceDetected:be,onFlashingFramesCaptured:Ce,frameInterval:Be,useFaceDetectorWhenFlashing:I,onFaceError:Ee,onMovingCloseFace:Se,onFarFaceDetected:ye,faceSettings:d,ovalBoundingRect:U,isOvalTransitioning:j,maskSettings:u,closeEyesSettings:f,imageSettings:g}),xe=_e.faceError,Te=_e.warmupDone;w=D.current,dv.useEffect((function(){return function(){var e;w&&(null===(e=w.srcObject)||void 0===e||e.getTracks().forEach((function(e){e.stop()})))}}),[w]);B0((function(){p.enableFarStep?(G(N3.FAR_FACE),H(ce)):(G(N3.CLOSE_FACE),H(ue)),E.current||(E.current=performance.now())}),Te&&ie),B0((function(){return S("selfie_flash","user_activity.start")}),!0),B0((function(){return S("selfie_flash","user_activity.start_far")}),W===N3.FAR_FACE),B0((function(){return S("selfie_flash","user_activity.start_close")}),W===N3.CLOSE_FACE),B0((function(){return S("selfie_flash","user_activity.start_flash")}),W===N3.START_FLASHING);var Ae=null===me?0:Math.min(Math.round((me+1)/(N.length*T)*100),100),Ie=i.CloseCameraButton;return dv.createElement(dv.Fragment,null,dv.createElement(PG,{frontCamera:a,onVideoPlayed:oe,onClose:n,flipHorizontal:a,ref:D,onError:o,videoSettings:u2,closeButton:null!=Ie?Ie:dv.createElement(I0,{style:{position:"fixed",top:10,right:10,zIndex:1001,cursor:"pointer"}})},dv.createElement(h0,{overlay:!Te||!ie},""!==xe&&dv.createElement(a2,null),W!==N3.STOP_DECTECTING&&dv.createElement(FG,{x:"".concat(Math.round(ae.x),"px"),y:"".concat(Math.round(ae.y),"px"),width:"".concat(ae.width,"px"),height:"".concat(ae.height,"px"),surroundStyle:{background:"white"}},dv.createElement(r2,{ref:F,scale:q,debug:_,width:ae.width,height:ae.height,padding:u.ovalPadding,verticalOffset:de}),dv.createElement(c2,null,""!==xe&&W!==N3.FLASHING&&dv.createElement(l0,null,B(xe)))))),dv.createElement(s2,null,W!==N3.LOADING&&X&&dv.createElement(n2,{$flashing:W===N3.START_FLASHING},W===N3.START_FLASHING?B("hold_still"):dv.createElement(dv.Fragment,null,dv.createElement(e0,null)," ",X)),dv.createElement(T0,{onTimeout:le,timeout:p.timeout,shouldStart:Te&&ie,shouldStop:W===N3.START_FLASHING}),W===N3.START_FLASHING&&dv.createElement(i2,{value:Ae,max:100})),W===N3.START_FLASHING&&dv.createElement(o2,{$backgroundColor:he,$intensity:P}))}var d2=aw.div(X0||(X0=pg(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n\n z-index: 1001;\n"]))),f2=aw.div(Y0||(Y0=pg(["\n & > img {\n width: 100%;\n }\n\n ","\n"])),$Z),p2=aw.p($0||($0=pg(["\n color: #1d1d1d;\n font-size: 20px;\n"]))),h2=function(){var e=QN.useAsset("loader.jpg"),t=S0();return dv.createElement(d2,null,dv.createElement(f2,null,dv.createElement("img",{src:e,className:"spin",alt:"loading-icon"})),dv.createElement(p2,null,t("processing_result")))};var m2=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Array.isArray(e)?e.map((function(e,r){var n,o,a;return{name:e.step,image:{blob:e.blob,id:null!==(n=null===(o=t[r])||void 0===o||null===(a=o.data)||void 0===a?void 0:a.image_id)&&void 0!==n?n:null}}})):[]},g2=function(e){var t=QN.useAsset(e);dv.useEffect((function(){!function(e){new Promise((function(t,r){var n=new Image;n.onload=t,n.onerror=r,n.src=e}))}(t)}),[t])},v2=["apiCheck","onLivenessDetectionDone"],y2=function(e){var t,r=e.apiCheck,n=e.onLivenessDetectionDone,o=lg(e,v2),a=hg(dv.useState(!1),2),i=a[0],s=a[1],c=(t=L0(),{verifyFlashLiveness:dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(r){var n,o,a,i,s,c,u,l,d,f,p,h,m,g,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.colors,o=r.videos,a=r.images,i=r.flashSettings,s=r.frameInterval,c=r.enableFarStep,u=r.flashColor,e.prev=1,e.next=4,Promise.all(a.map((function(e){return t.uploadImage({label:"portrait",file:e})})));case 4:return l=e.sent,d=[t.verifyFaceLiveness({images:l.map((function(e){var t;return{id:null==e||null===(t=e.data)||void 0===t?void 0:t.image_id,label:"portrait"}})),videos:o,metadata:{flash_color:u,colors:n,frames_per_color:i.framesPerColor,frame_interval:s,delay_between_colors:i.delayBetweenColors,use_face_detector_when_flashing:i.useFaceDetectorWhenFlashing},selfie_type:aI.Mode.FLASH})],c&&d.push(t.requestVerifyPortrait({image:{id:null===(f=l[0])||void 0===f||null===(p=f.data)||void 0===p?void 0:p.image_id},selfie_type:aI.Mode.FLASH})),e.next=9,Promise.all(d);case 9:return h=e.sent,m=hg(h,2),g=m[0],v=m[1],e.abrupt("return",{uploadedImages:l,faceLivenessResult:g,portraitResult:v});case 16:return e.prev=16,e.t0=e.catch(1),console.error(e.t0),e.abrupt("return",{});case 20:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),[t])}).verifyFlashLiveness,u=e2(),l=u.captureFrameSettings,d=u.flashSettings,f=u.livenessSettings,p=l.framesIntervalTime,h=f.enableFarStep,m=e.onError;g2("loader.jpg");var g=function(){var e=$m(regeneratorRuntime.mark((function e(t,o){var a,i,u,f,g,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=4;break}return e.next=3,n({capturedFrames:t.frames,steps:m2(t.images)});case 3:return e.abrupt("return");case 4:if(e.prev=4,s(!0),i=null,!l.enable){e.next=13;break}return e.next=10,M0.getAllUploadedBatches();case 10:i=e.sent,e.next=14;break;case 13:i=[{frames:t2(t.frames)}];case 14:return e.next=16,c({videos:i,images:t.images.map((function(e){return e.blob})),flashSettings:d,frameInterval:p,colors:o.colors,flashColor:o.flashColor,enableFarStep:h});case 16:if(u=e.sent,f=u.uploadedImages,g=u.faceLivenessResult,v=u.portraitResult,M0.resetUploadBatches(),s(!1),!g.errors){e.next=24;break}throw g.errors;case 24:if(null==v||!v.errors){e.next=26;break}throw v.errors;case 26:return e.next=28,n({capturedFrames:t.frames,steps:m2(t.images,f),apiCheckPassed:g.data.is_live,verifyFaceLivenessResult:g.data,verifyPortraitResult:null!==(a=null==v?void 0:v.data)&&void 0!==a?a:null});case 28:e.next=35;break;case 30:e.prev=30,e.t0=e.catch(4),console.error(e.t0),s(!1),m({error:e.t0});case 35:case"end":return e.stop()}}),e,null,[[4,30]])})));return function(t,r){return e.apply(this,arguments)}}();return dv.createElement(dv.Fragment,null,dv.createElement(l2,rg({},o,{apiCheck:r,onFlashDone:g})),i&&dv.createElement(h2,null))},b2=function(e){var t=e.value,r=e.children,n=Z0(),o=GY(n,"data.settings.sdk_settings.server_log_settings.enable"),a=null!=o?o:null==t?void 0:t.enable;return dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og(og({},t),{},{enable:a})}},r)};b2.propTypes={value:Lv.shape({enable:Lv.bool,accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string}).isRequired,children:Lv.node.isRequired};var w2={instruction:{flashing:{color:"white",backgroundColor:"#E54D2E"}}},k2=function(e){var t=e.apiCheck,r=e.debug,n=e.clientSettings,o=e.apiCredentials,a=e.logCredentials;return dv.createElement(H3,{debug:r},dv.createElement(N0,{apiCredentials:o},dv.createElement(j0,{apiCheck:t,clientSettings:n},dv.createElement(R3,null,dv.createElement(rw,{theme:w2},dv.createElement(C0,null,dv.createElement(b2,{value:og({enable:!0},a)},dv.createElement(y2,e))))))))};k2.propTypes={apiCheck:Lv.bool,apiCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string}),onLivenessDetectionDone:Lv.func,onClose:Lv.func,onError:Lv.func,onFramesCaptured:Lv.func,frontCamera:Lv.bool,styledComponent:Lv.shape({CloseCameraButton:Lv.node}),clientSettings:Lv.shape({}),logCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string,userId:Lv.string,logSignature:Lv.shape({logUrl:Lv.string,timestamp:Lv.string,signature:Lv.string})})},k2.defaultProps={apiCheck:!1,apiCredentials:{},onLivenessDetectionDone:function(){},onClose:function(){},onError:function(){},onFramesCaptured:function(){},frontCamera:!0,styledComponent:{CloseCameraButton:null},clientSettings:{},logCredentials:{}};var C2=["logCredentials","clientSettings","livenessSettings","livenessComponent"];function E2(e){var t=e.logCredentials,r=void 0===t?{enable:!0}:t,n=e.clientSettings,o=e.livenessSettings,a=e.livenessComponent,i=void 0===a?w3:a,s=lg(e,C2);if(s.mode===aI.Mode.FLASH){var c=s.styledComponent,u=s.frontCamera,l=s.onFramesCaptured,d=s.onError,f=s.onClose,p=s.apiCheck,h=s.apiCredentials,m=s.onLivenessDetectionDone,g=s.debug;return dv.createElement(k2,{styledComponent:c,frontCamera:u,onFramesCaptured:l,onError:d,onClose:f,apiCheck:p,apiCredentials:h,onLivenessDetectionDone:m,logCredentials:r,clientSettings:n,debug:g})}var v=GY(n,"data.settings.sdk_settings",{});return dv.createElement(R3,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og({},r)}},dv.createElement(i,rg({},s,{livenessSettings:og(og(og({},o),null==v?void 0:v.active_liveness_settings),null==v?void 0:v.liveness_settings)}))))}var S2,B2,_2,x2={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},T2=aI.IDCardMessage,A2=aw.div(S2||(S2=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),I2=aw.div(B2||(B2=pg(["\n text-align: center;\n font-size: 1rem;\n"]))),P2=aw.button(_2||(_2=pg(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),R2=function(e){var t=e.onOk,r=e.maxSessionTime,n=hN.useSDKSettings().lang;return dv.createElement(A2,null,dv.createElement(I2,{className:"popup-message"},iY(T2.TIMEOUT_INSTRUCTION[n])({x:r})),dv.createElement(P2,{className:"popup-button",onClick:t},x2.BTN_OK[n]))};R2.propTypes={onOk:Lv.func,maxSessionTime:Lv.number},R2.defaultProps={onOk:function(){},maxSessionTime:30};var N2=function(){var e=hg(dv.useState(!1),2),t=e[0],r=e[1],n=hg(dv.useState(null),2),o=n[0],a=n[1],i=hg(dv.useState({}),2),s=i[0],c=i[1];return{showPopup:dv.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),a(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},O2="SESSION_TIMEOUT",D2="CONFIRM",L2="QR_INVALID",M2="QR_INSTRUCTIONS",F2=aI.Errors;function U2(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function j2(e,t){return Math.sqrt(U2(e,t))}function V2(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=window,o=n.cv,a=t.width,i=t.height,s=r;s<1&&(s=parseInt(.5*(i+a)*s,10));var c=o.imread(t),u=new o.Mat;return o.copyMakeBorder(c,u,s,s,s,s,o.BORDER_CONSTANT,new o.Scalar(0,0,0,255)),c.delete(),{mat:u,margin:s}}function z2(e,t){var r=window.cv,n=hg(t.map((function(e){return e.location})),4),o=n[0],a=n[1],i=n[2],s=n[3],c=j2(i,s),u=j2(a,o),l=Math.max(c,u),d=j2(a,i),f=j2(o,s),p=Math.max(d,f),h=[o.x,o.y,a.x,a.y,i.x,i.y,s.x,s.y],m=[0,0,l-1,0,l-1,p-1,0,p-1],g=r.imread(e),v=new r.Mat,y=new r.Size(l,p),b=r.matFromArray(4,1,r.CV_32FC2,h),w=r.matFromArray(4,1,r.CV_32FC2,m),k=r.getPerspectiveTransform(b,w);r.warpPerspective(g,v,k,y,r.INTER_LINEAR,r.BORDER_CONSTANT,new r.Scalar);var C=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),w.delete(),C}function q2(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},o={x:r.x-e.x,y:r.y-e.y},a=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),i=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(a*i))/Math.PI}function H2(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;t.forEach((function(e){var t=e.location,r=t.x,n=t.y;o=Math.min(o,r),a=Math.min(a,n),i=Math.max(i,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&a/n>=c&&(n-s)/n>=c&&(r-i)/r>=c}function K2(){return W2.apply(this,arguments)}function W2(){return(W2=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=t.canvas,n=t.paddingPercent,o=void 0===n?.04:n,a=r.width,i=r.height,s=Math.floor(a*o),c=Math.floor(i*o),u=a-2*s,l=i-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(r,s,c,u,l,0,0,u,l),e.abrupt("return",zD.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G2(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,a=q2(e[r].location,e[n].location,e[o].location);if(a<70||a>110)return!1}return!0}function Q2(e){return X2.apply(this,arguments)}function X2(){return(X2=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.blazefaceModel,n=t.predictedIdCardCanvas,o=t.frontSide,a=n.width,i=n.height,s=Math.floor(a/3),c=Math.floor(4*i/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(i/5),s,c,0,0,s,c),e.next=12,jO.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=hg(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4)&&!(IO.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[jO.SIZE,jO.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",F2.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",F2.id_detector_error_front_side_multiple_faces);case 20:e.next=24;break;case 22:if(!(p>0)){e.next=24;break}return e.abrupt("return",F2.id_detector_error_back_side_has_faces);case 24:return e.abrupt("return",null);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Y2=function(e){var t=GY(e,"card.corners");if(t&&Array.isArray(t)&&t.length>0){var r=GY(t,"[0].location"),n=r.x,o=r.y;return"".concat(n,":").concat(o)}return"-1:-1"},$2=function(e,t,r){e.current=[].concat(mg(e.current),[t]),e.current.length>r&&e.current.shift()},Z2=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=t.currentWorkingCanvas,u=t.refVirtualWorkingCanvas,l=t.refCountVirtualFrames,d=t.refVirtualFrames,f=t.refWorkingCanvas,(p=t.refCardResult).current.corners&&Array.isArray(p.current.corners)){e.next=3;break}return e.abrupt("return");case 3:return h=hg(p.current.corners,3),m=h[0],g=h[1],v=h[2],y=(null==g||null===(r=g.location)||void 0===r?void 0:r.x)-(null==m||null===(n=m.location)||void 0===n?void 0:n.x)-100,b=(null==v||null===(o=v.location)||void 0===o?void 0:o.y)-(null==g||null===(a=g.location)||void 0===a?void 0:a.y)-100,w=performance.now(),(k=u.current).width=y,k.height=b,(C=k.getContext("2d")).drawImage(c,(null==m||null===(i=m.location)||void 0===i?void 0:i.x)+50,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+50,y,b,0,0,y,b),e.next=14,new Promise((function(e){k.toBlob(function(){var t=$m(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,MN.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(mg(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 14:return w=Math.floor(performance.now()-w),E=180-w>0?180-w:0,e.next=18,new Promise((function(e){return setTimeout(e,E)}));case 18:if(!(l.current<3)){e.next=29;break}return _=performance.now(),x=f.current,C.drawImage(x,(null==m||null===(S=m.location)||void 0===S?void 0:S.x)+50,(null==m||null===(B=m.location)||void 0===B?void 0:B.y)+50,y,b,0,0,y,b),e.next=24,new Promise((function(e){k.toBlob(function(){var t=$m(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,MN.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(mg(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 24:if(!(l.current<2)){e.next=26;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _=Math.floor(performance.now()-_),t=180-_>0?180-_:0,e.next=4,new Promise((function(e){return setTimeout(e,t)}));case 4:case"end":return e.stop()}}),e)}))(),"t0",26);case 26:l.current+=1,e.next=18;break;case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J2=function(e,t){return!(0!==t.length&&!t.includes("vn.national_id"))||t.map((function(e){return e.replace("vn.","")})).some((function(t){var r;return(null===(r=e.split("."))||void 0===r?void 0:r.filter((function(e){return"front"!==e&&"back"!==e&&"vn"!==e}))).some((function(e){return e===t}))}))};var e1=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e};var t1=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=dQ(r))==r?r:0),void 0!==t&&(t=(t=dQ(t))==t?t:0),e1(dQ(e),t,r)},r1="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function n1(){return(n1=$m(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.url,n=void 0===r?r1:r,e.abrupt("return",new Promise((function(e,t){var r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("type","text/javascript"),r.setAttribute("id","opencvjs"),r.addEventListener("load",$m(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!window.cv||!window.cv.getBuildInformation){t.next=4;break}e(),t.next=12;break;case 4:if(!(window.cv instanceof Promise)){t.next=11;break}return t.next=7,window.cv;case 7:window.cv=t.sent,e(),t.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return t.stop()}}),t)})))),r.addEventListener("error",(function(){t()})),r.src=n;var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(r,o)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var o1=e$((function(){return n1.apply(this,arguments)})),a1={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},i1={vn:.4,ph:.5},s1={0:"top-left",1:"top-right",2:"bottom-right",3:"bottom-left",4:"cccd.front",5:"passport",6:"cmnd_old.front",7:"cmnd_old.back",8:"cmnd_new.front",9:"cmnd_new.back",10:"cccd_new.front",11:"cccd_new.back",12:"aadhaar_front",13:"aadhaar_back",14:"voter_front",15:"voter_back",16:"pan",17:"dl",18:"india_spassport",19:"aadhaar_letter",20:"pan_back",21:"passport_back",22:"unseen",23:"other",24:"BUREAU OF INTERNAL REVENUE",25:"COMMISSION ON ELECTIONS",26:"COVID VACCINATION CARD",27:"DRIVERS LICENSE",28:"HEALTH INSURANCE PHILHEALTH",29:"PAG-IBIG LOYALTY CARD",30:"PASSPORT",31:"PHILIPPINE IDENTIFICATION CARD",32:"POSTAL IDENTITY CARD",33:"PROFESSIONAL IDENTIFICATION CARD",34:"RESIDENT IDENTIFICATION CARD",35:"SOCIAL SECURITY SYSTEM",36:"UNIFIED MULTI PURPOSE ID",37:"VN_biz_license",38:"new_voter_front"};function c1(e){var t,r,n,o,a,i=e.card,s=e.corners,c=i.box,u={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},l=c[2]-c[0],d=c[1]-c[3],f=kg(s);try{for(f.s();!(a=f.n()).done;){var p=a.value;switch(p.label){case"top-left":t||(t=p.location);break;case"top-right":r||(r=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":o||(o=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![t,r,n,o].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(t.x+n.x)/2,y:(t.y+n.y)/2},m={x:(r.x+o.x)/2,y:(r.y+o.y)/2},g=U2(u,h),v=U2(u,m);return Math.sqrt(g)>(l+d)/8||Math.sqrt(v)>(l+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var u1=function(){function e(t){Zm(this,e),this.country=t||"vn",this.defaultModelUrl=a1[this.country]||a1.vn}var t,r,n,o,a,i,s;return eg(e,[{key:"load",value:(s=$m(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.opencvUrl,n=t.modelUrl,e.next=3,Promise.all([o1({url:r}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"predictDummyInput",value:(i=$m(regeneratorRuntime.mark((function e(){var t,r,n,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,n=r.tidy((function(){var e=r.zeros(o.inputShape,"float32");return o.model.predict(e)})),e.abrupt("return",Promise.all([n[this.out_score_name].data()]));case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadModel",value:(a=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,SL.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,SL.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,a=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),i=hg(a,3),this.out_score_name=i[0],this.out_class_name=i[1],this.out_box_name=i[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"loadResource",value:(o=$m(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,SL.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"dispose",value:(n=$m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.model&&this.model.dispose();case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"predict",value:(r=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x,T,A,I,P,R=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=R.length>1&&void 0!==R[1]?R[1]:{},n=r.imgMargin,o=r.detectThreshold,a=void 0===o?.3:o,i=r.maxNumReturns,s=void 0===i?100:i,c=window,u=c.cv,l={},d=t.width,f=t.height,l.originalWidth=d,l.originalHeight=f,p=V2({canvas:t,imgMargin:"number"==typeof n?n:i1[this.country]}),h=p.margin,m=p.mat,g=this.inputShape.slice(1,3),v=hg(g,2),y=v[0],b=v[1],w=new u.Mat,u.resize(m,w,new u.Size(y,b),0,0,u.INTER_AREA),k=m.cols/y,C=m.rows/b,(E=document.createElement("canvas")).width=y,E.height=b,E.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(w.data),w.cols,w.rows),0,0),m.delete(),w.delete(),l.canvas=E,l.margin=h,S=performance.now(),e.next=25,this.detect(E,{detectThreshold:a,maxNumReturns:s});case 25:if(B=e.sent,_=Math.floor(performance.now()-S),x={inputImage:l,card:null,exeTime:_},T=[[],[],[],[]],A=[],I=[],B.forEach((function(e){var t=hg(e.box,4),r=t[0],n=t[1],o=t[2],a=t[3];e.clazz<=3?T[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:t1(Math.floor((a+n)/2*k-h),0,d),y:t1(Math.floor((r+o)/2*C-h),0,f)},scaledLocation:{x:t1(Math.floor((a+n)/2),0,E.width),y:t1(Math.floor((r+o)/2),0,E.height)}}):I.push({label:e.label,score:e.score,box:[t1(Math.floor(r*C-h),0,f),t1(Math.floor(n*k-h),0,d),t1(Math.floor(o*C-h),0,f),t1(Math.floor(a*k-h),0,d)]})})),T.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),A.push(e[0]))})),!(I.length>0&&4===A.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),A.sort((function(e,t){return e.clazz-t.clazz})),P=I[0],e.prev=37,c1({card:P,corners:A})){e.next=41;break}return console.debug("Not qualified.",P,A),e.abrupt("return",x);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",x);case 46:return P.corners=A,x.card=P,e.abrupt("return",x);case 49:return e.abrupt("return",x);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return r.apply(this,arguments)})},{key:"detect",value:(t=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B=this,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.length>1&&void 0!==_[1]?_[1]:{},n=r.detectThreshold,o=r.maxNumReturns,a=window,i=a.tf,s=t.width,c=t.height,u=i.tidy((function(){var e=i.expandDims(i.cast(i.image.resizeBilinear(i.browser.fromPixels(t),B.inputShape.slice(1,3)),"float32"));return B.model.predict(e)})),e.next=7,Promise.all([u[this.out_score_name].data(),u[this.out_class_name].data(),u[this.out_box_name].array()]);case 7:l=e.sent,d=hg(l,3),f=d[0],p=d[1],h=hg(d[2],1),m=h[0],g=Math.min(f.length,o),v=[];try{for(y=0;y<g;y++)b=f[y],w=p[y],b>n&&(C=null!==(k=s1[Math.round(w)])&&void 0!==k?k:"NA",E=m[y],S=[E[0]*c,E[3]*s,E[2]*c,E[1]*s],v.push({score:b,clazz:w,box:S,label:C}))}catch(e){console.log(e)}return e.abrupt("return",v.length>=5?v:[]);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();class l1{static hasCamera(){return l1.listCameras(!1).then((e=>!!e.length)).catch((()=>!1))}static listCameras(e=!1){if(!navigator.mediaDevices)return Promise.resolve([]);let t=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((e=>t=e)).catch((()=>{})):Promise.resolve()).then((()=>navigator.mediaDevices.enumerateDevices())).then((e=>e.filter((e=>"videoinput"===e.kind)).map(((e,t)=>({id:e.deviceId,label:e.label||(0===t?"Default Camera":`Camera ${t+1}`)}))))).finally((()=>{if(t)for(const e of t.getTracks())e.stop(),t.removeTrack(e)}))}constructor(e,t,r=this._onDecodeError,n=this._calculateScanRegion,o="environment"){this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=t,this._legacyCanvasSize=l1.DEFAULT_CANVAS_SIZE,this._preferredCamera=o,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof r?(this._legacyCanvasSize=r,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=r,"number"==typeof n?(this._legacyCanvasSize=n,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=n,this._scanRegion=this._calculateScanRegion(e),this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let a=!1;e.hidden&&(e.hidden=!1,a=!0),document.body.contains(e)||(document.body.appendChild(e),a=!0),requestAnimationFrame((()=>{const t=window.getComputedStyle(e);"none"===t.display&&(e.style.setProperty("display","block","important"),a=!0),"visible"!==t.visibility&&(e.style.setProperty("visibility","visible","important"),a=!0),a&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity=0,e.style.width=0,e.style.height=0)})),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),this._qrEnginePromise=l1.createQrEngine()}hasFlash(){let e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((({stream:t})=>(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=t,t.getVideoTracks()[0])))).then((e=>"torch"in e.getSettings())).catch((()=>!1)).finally((()=>{if(e)for(const t of e.getTracks())t.stop(),e.removeTrack(t)}))}isFlashOn(){return this._flashOn}toggleFlash(){return this._flashOn?this.turnFlashOff():this.turnFlashOn()}turnFlashOn(){return this._flashOn?Promise.resolve():(this._flashOn=!0,!this._active||this._paused?Promise.resolve():this.hasFlash().then((e=>e?this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]}):Promise.reject("No flash available"))).catch((()=>{throw this._flashOn=!1,e})))}turnFlashOff(){if(this._flashOn)return this._flashOn=!1,this._restartVideoStream()}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.stop(),l1._postWorkerMessage(this._qrEnginePromise,"close")}start(){return this._active&&!this._paused?Promise.resolve():("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,document.hidden?Promise.resolve():(this._paused=!1,this.$video.srcObject?(this.$video.play(),Promise.resolve()):this._getCameraStream().then((({stream:e,facingMode:t})=>{this.$video.srcObject=e,this.$video.play(),this._setVideoMirror(t),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch((()=>{})))})).catch((e=>{throw this._active=!1,e}))))}stop(){this.pause(),this._active=!1}pause(e=!1){if(this._paused=!0,!this._active)return Promise.resolve(!0);this.$video.pause();const t=()=>{const e=this.$video.srcObject?this.$video.srcObject.getTracks():[];for(const t of e)t.stop(),this.$video.srcObject.removeTrack(t);this.$video.srcObject=null};return e?(t(),Promise.resolve(!0)):new Promise((e=>setTimeout(e,300))).then((()=>!!this._paused&&(t(),!0)))}setCamera(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}static scanImage(e,t=null,r=null,n=null,o=!1,a=!1){const i=r instanceof Worker;let s=Promise.all([r||l1.createQrEngine(),l1._loadImage(e)]).then((([e,a])=>{let s;return r=e,[n,s]=this._drawToCanvas(a,t,n,o),r instanceof Worker?(i||r.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,t)=>{let o,a,i;a=n=>{"qrResult"===n.data.type&&(r.removeEventListener("message",a),r.removeEventListener("error",i),clearTimeout(o),null!==n.data.data?e(n.data.data):t(l1.NO_QR_CODE_FOUND))},i=e=>{r.removeEventListener("message",a),r.removeEventListener("error",i),clearTimeout(o);const n=e?e.message||e:"Unknown Error";t("Scanner error: "+n)},r.addEventListener("message",a),r.addEventListener("error",i),o=setTimeout((()=>i("timeout")),1e4);const c=s.getImageData(0,0,n.width,n.height);r.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise(((e,t)=>{const o=setTimeout((()=>t("Scanner error: timeout")),1e4);r.detect(n).then((r=>{r.length?e(r[0].rawValue):t(l1.NO_QR_CODE_FOUND)})).catch((e=>t("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(o)))}))}));return t&&a&&(s=s.catch((()=>l1.scanImage(e,null,r,n,o)))),s=s.finally((()=>{i||l1._postWorkerMessage(r,"close")})),s}setGrayscaleWeights(e,t,r,n=!0){l1._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:t,blue:r,useIntegerApproximation:n})}setInversionMode(e){l1._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=l1.WORKER_PATH){return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((t=>-1!==t.indexOf("qr_code")?new BarcodeDetector({formats:["qr_code"]}):new Worker(e)))}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video)}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){const t=Math.min(e.videoWidth,e.videoHeight),r=Math.round(2/3*t);return{x:Math.round((e.videoWidth-r)/2),y:Math.round((e.videoHeight-r)/2),width:r,height:r,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_scanFrame(){if(!this._active||this.$video.paused||this.$video.ended)return!1;requestAnimationFrame((()=>{this.$video.readyState<=1?this._scanFrame():this._qrEnginePromise.then((e=>l1.scanImage(this.$video,this._scanRegion,e,this.$canvas))).then(this._onDecode,(e=>{if(!this._active)return;-1!==(e.message||e).indexOf("service unavailable")&&(this._qrEnginePromise=l1.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==l1.NO_QR_CODE_FOUND&&console.log(e)}_getCameraStream(){if(!navigator.mediaDevices)return Promise.reject("Camera not found.");const e="environment"===this._preferredCamera||"user"===this._preferredCamera?"facingMode":"deviceId",t=[{width:{min:1024}},{width:{min:768}},{}];return[...t.map((t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}}))),...t].reduceRight(((e,t)=>()=>navigator.mediaDevices.getUserMedia({video:t,audio:!1}).then((e=>({stream:e,facingMode:this._getFacingMode(e)||(t.facingMode?this._preferredCamera:"environment"===this._preferredCamera?"user":"environment")}))).catch(e)),(()=>Promise.reject("Camera not found.")))()}_restartVideoStream(){const e=this._paused;return this.pause(!0).then((t=>{if(t&&!e&&this._active)return this.start()}))}_setVideoMirror(e){const t="user"===e?-1:1;this.$video.style.transform="scaleX("+t+")"}_getFacingMode(e){const t=e.getVideoTracks()[0];return t?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}static _drawToCanvas(e,t=null,r=null,n=!1){r=r||document.createElement("canvas");const o=t&&t.x?t.x:0,a=t&&t.y?t.y:0,i=t&&t.width?t.width:e.width||e.videoWidth,s=t&&t.height?t.height:e.height||e.videoHeight;if(!n){const e=t&&t.downScaledWidth?t.downScaledWidth:i,n=t&&t.downScaledHeight?t.downScaledHeight:s;r.width!==e&&(r.width=e),r.height!==n&&(r.height=n)}const c=r.getContext("2d",{alpha:!1});return c.imageSmoothingEnabled=!1,c.drawImage(e,o,a,i,s,0,0,r.width,r.height),[r,c]}static _loadImage(e){if(e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||window.ImageBitmap&&e instanceof window.ImageBitmap||window.OffscreenCanvas&&e instanceof window.OffscreenCanvas)return Promise.resolve(e);if(e instanceof Image)return l1._awaitImageLoad(e).then((()=>e));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){const t=new Image;return e instanceof File||e instanceof Blob?t.src=URL.createObjectURL(e):t.src=e,l1._awaitImageLoad(t).then((()=>((e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(t.src),t)))}return Promise.reject("Unsupported image type.")}static _awaitImageLoad(e){return new Promise(((t,r)=>{if(e.complete&&0!==e.naturalWidth)t();else{let n,o;n=()=>{e.removeEventListener("load",n),e.removeEventListener("error",o),t()},o=()=>{e.removeEventListener("load",n),e.removeEventListener("error",o),r("Image load error")},e.addEventListener("load",n),e.addEventListener("error",o)}}))}static _postWorkerMessage(e,t,r){return Promise.resolve(e).then((e=>{e instanceof Worker&&e.postMessage({type:t,data:r})}))}}function d1(){return f1.apply(this,arguments)}function f1(){return(f1=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l1.WORKER_PATH=YM(),e.next=3,l1.createQrEngine(l1.WORKER_PATH);case 3:return t=e.sent,e.abrupt("return",{qrEngine:t});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p1(){return h1.apply(this,arguments)}function h1(){return(h1=$m(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([d1()]);case 2:return t=e.sent,r=hg(t,1),n=r[0].qrEngine,e.abrupt("return",{qrScannerResources:{engine:n,canvas:document.createElement("canvas")},noModel:!0});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}l1.DEFAULT_CANVAS_SIZE=400,l1.NO_QR_CODE_FOUND="No QR code found",l1.WORKER_PATH="qr-scanner-worker.min.js";var m1="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function g1(){return(g1=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=$m(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="detect.prototxt",r="detect.caffemodel",n="sr.prototxt",i="sr.caffemodel",o){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return u=[a(t),a(r),a(n),a(i)],e.next=11,Promise.all(u);case 11:l=e.sent,d=hg(l,4),f=d[0],p=d[1],h=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",p,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",h,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),o=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?m1:r,a=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(t));case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:return o=e.sent,e.abrupt("return",new Uint8Array(o));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,i();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",p1());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var v1=e$((function(){return g1.apply(this,arguments)}));function y1(e){return b1.apply(this,arguments)}function b1(){return(b1=$m(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,e.abrupt("return",new Promise((function(e,t){setTimeout(t,900),r.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w1(e){return k1.apply(this,arguments)}function k1(){return(k1=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,n=!0,e.prev=2,o=performance.now(),e.next=6,y1({idCardModel:r});case 6:(a=performance.now())-o+.6*(a-o)>900&&(n=!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n=!1;case 13:return e.abrupt("return",{fastEnough:n});case 14:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function C1(){return(C1=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,a=t.tfScriptUrls,i=t.wechatQRModelsUrl,s=h.length>1?h[1]:void 0,e.next=4,o$({blazefaceModelUrl:o,tfScriptUrls:a});case 4:return c=e.sent,u=c.blazefaceModel,l=!0,d=new u1(s),e.prev=8,e.next=11,d.load({opencvUrl:r,modelUrl:n});case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(8),e.abrupt("return",{ableToUseModel:!1});case 16:return e.next=18,v1({modelUrl:i});case 18:return e.prev=18,e.next=21,w1({idCardModel:d});case 21:f=e.sent,p=f.fastEnough,l=p,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),l=!1;case 29:return e.abrupt("return",{ableToUseModel:l,idCardModel:d,blazefaceModel:u});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var E1=e$((function(){return C1.apply(this,arguments)})),S1=aI.Errors;function B1(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=dv.useRef(null);null===a.current&&(a.current=document.createElement("canvas"));var i=dv.useRef(!1),s=dv.useRef(FD.createResizer({width:960,height:640})),c=dv.useRef(null),u=dv.useRef([{id:null,frames:[]}]),l=dv.useCallback((function(){!0===i.current&&(i.current=!1)}),[]),d=dv.useCallback((function(){u.current=[{id:null,frames:[]}]}),[]),f=dv.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),p=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,a,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,a=u.current,i=n.resize({srcCanvas:r}),c=i.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=dv.useCallback($m(regeneratorRuntime.mark((function e(){var r,n,s,u,l,d,f,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:if(r=o.frameCaptureIntervalMs,n=void 0===r?180:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:s=c.current,u=t.current,i.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=a.current).width=f,m.height=h,g=m.getContext("2d");case 13:return v=performance.now(),g.drawImage(u,l,d,f,h,0,0,f,h),e.next=18,p({workingCanvas:m});case 18:if(v=Math.floor(performance.now()-v),i.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,YN.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return dv.useEffect((function(){var e=t.current;function o(){return(o=$m(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=CO.analyzeVideoAndWindowSizes(e,n),t.next=3,h();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return r&&n&&function(){o.apply(this,arguments)}(),function(){l()}}),[r,n,t,l,f,h]),{refWorkingCanvas:a,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var _1=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,a=e.settings,i=e.shouldStartTimers,s=e.sessionTime,c=dv.useRef(),u=hg(dv.useState(0),2),l=u[0],d=u[1],f=dv.useCallback((function(){clearInterval(c.current)}),[]),p=dv.useCallback((function(){d((function(e){return e+1}))}),[]);return dv.useEffect((function(){if(i){var e=a.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var a=s-(t+=1);a<=u&&r&&r({curTimeLeft:a}),t>0&&t%e==0&&o&&o(),0===a&&(f(),n&&n())}),1e3)}return function(){f()}}),[i,t,r,f,n,o,l,a,s]),{stopTimers:f,startTimers:p}};KM.initExifData();var x1,T1,A1,I1=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onModelErrorChange,i=e.frontSide,s=e.cardList,c=e.onDebugInfoChange,u=e.onAboutToTimeout,l=e.onSessionTimeout,d=e.onCaptureDone,f=e.outputEncryptionSettings,p=e.quality,h=dv.useRef(!1),m=hg(dv.useState(!1),2),g=m[0],v=m[1],y=dv.useRef((function(){})),b=KN.useSDKTracking().sendEvent,w=dv.useRef(),k=dv.useRef(),C=dv.useRef(),E=hN.useSDKSettings(),S=E.debug,B=E.lang,_=E.enableAntiDebug,x=XM(),T=x.startMotion,A=x.stopMotion,I=x.motionData,P=x.orientationData;dv.useEffect((function(){_&&BL.enableAntiDebug()}),[_]);var R=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b({tag:i?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,y.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[b,i]),N=dv.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(void 0,t);var n=GY(t,"0.code");n&&n!==w.current&&(b({tag:i?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),w.current=n)}),[a,i,b]),O=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.cardList,i=e.onError,s=e.frontSide,c=e.onAutoCaptureSuccess,u=e.quality,l=dv.useRef(null);null===l.current&&(l.current=document.createElement("canvas"));var d=dv.useRef(0),f=dv.useRef([]),p=dv.useRef(null);null===p.current&&(p.current=document.createElement("canvas"));var h=dv.useRef({}),m=dv.useRef([]),g=dv.useRef(""),v=dv.useRef(!1),y=dv.useRef(!1),b=dv.useRef(!1),w=dv.useRef(null),k=hg(dv.useState(!1),2),C=k[0],E=k[1],S=dv.useRef({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),B=dv.useRef({imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}),_=dv.useRef(!1),x=dv.useRef(!1),T=dv.useRef(null),A=dv.useRef(!1),I=dv.useRef({}),P=hN.useSDKSettings(),R=P.customUrls,N=P.country;dv.useEffect((function(){var e=!1;function t(){return(t=$m(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||C){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,E1(R,N);case 4:return I.current=t.sent,t.next=7,SL.initTensorFlow();case 7:T.current=o.enableBlurCheck&&I.current.ableToUseModel,t.next=11;break;case 10:T.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:E(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[C,o,R,N]);var O=dv.useCallback((function(e){return Z2({currentWorkingCanvas:e,refVirtualWorkingCanvas:p,refCountVirtualFrames:d,refVirtualFrames:f,refWorkingCanvas:l,refCardResult:h})}),[]),D=dv.useCallback((function(){!0===b.current&&(b.current=!1)}),[]),L=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,a=o.blurThreshold,i=S.current,s=B.current,v.current=!1,!(r<a&&wO.hasBetterCardBlurScore(r,i.blurScore))){e.next=18;break}if(!A.current){e.next=10;break}i.imageBlob=s.imageBlob,e.next=14;break;case 10:return e.next=12,CO.takePicture({canvas:l.current,quality:u});case 12:i.imageBlob=e.sent,i.captureTime=Date.now();case 14:i.takenAt=(new Date).getTime(),i.blurScore=r,i.detectedCard=n,i.captureType="auto";case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,u]),M=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,x.current=!0,o=B.current,!wO.hasBetterCardBlurScore(r,o.blurScore)){e.next=14;break}return e.next=6,CO.takePicture({canvas:l.current,quality:u});case 6:o.imageBlob=e.sent,o.captureDuration+=Date.now()-o.captureTime,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,o.captureCount++,o.captureType="manual",A.current=!0;case 14:x.current=!1;case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u]),F=dv.useCallback((function(){var e=o.waitForBestImageTimeMs,t=S.current;null!==t.imageBlob&&(new Date).getTime()-t.takenAt>e&&(v.current=!0)}),[o]),U=dv.useCallback((function(){_.current=!0}),[]),j=dv.useCallback((function(){return new Promise((function(e){_.current=!1;var t=setInterval((function(){x.current||(clearInterval(t),e())}),150)}))}),[]),V=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t=o.blurThreshold,r=o.enableVirtualCamHashes,n=B.current;n.captureTime=Date.now(),T.current?(U(),setTimeout((function(){j().then($m(regeneratorRuntime.mark((function o(){var a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(wO.hasBetterCardBlurScore(n.blurScore,t)||(n.error=S1.id_detector_error_blur),a=l.current,null!==n.imageBlob){o.next=6;break}CO.takePicture({canvas:a,quality:u}).then(function(){var t=$m(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),!r){t.next=5;break}return t.next=5,O(a);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.next=10;break;case 6:if(!r){o.next=9;break}return o.next=9,O(a);case 9:e(n);case 10:case"end":return o.stop()}}),o)}))))}),2e3)):CO.takePicture({canvas:l.current,quality:u}).then(function(){var t=$m(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),!r){t.next=5;break}return t.next=5,O(l.current);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),[o,U,j,u,O]),z=dv.useCallback($m(regeneratorRuntime.mark((function e(){var r,n,u,p,k,E,x,T,P,R,U,j,V,z,q,H,K,W,G,Q,X,Y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&C&&!b.current){e.next=2;break}return e.abrupt("return");case 2:S.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},B.current={imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0},r=o.enableAutoCapture,n=o.enableBlurCheck,u=o.enableIdDetection,p=o.country,k=o.enableVirtualCamHashes,E=I.current,x=E.idCardModel,T=E.blazefaceModel,P=E.ableToUseModel,R=w.current,U=t.current,b.current=!0,j=R.cropX,V=R.cropY,z=R.cropWidth,q=R.cropHeight,H=R.cropWidthWithoutPadding,K=R.cropHeightWithoutPadding,(W=l.current).width=z,W.height=q,G=W.getContext("2d"),Q=document.createElement("canvas"),X=Q.getContext("2d"),Y=function(){var e=$m(regeneratorRuntime.mark((function e(){var t,w,C,E,I,R,$,Z;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(G.drawImage(U,j,V,z,q,0,0,z,q),t=performance.now(),A.current=!1,!u||!P){e.next=68;break}return w=null,e.next=7,x.predict(W,{detectThreshold:.3});case 7:if(C=e.sent,null==o||!o.trackCardCoordinates||B.current.imageBlob||S.current.imageBlob||$2(m,Y2(C),null==o?void 0:o.trackCardCoordinatesMaxLength),!C.card){e.next=65;break}if(!v.current&&r||(h.current=C.card),!v.current&&!B.current.imageBlob&&f.current.length>0&&(f.current=[],d.current=0,v.current=!1,y.current=!1),v.current&&!y.current&&(k&&setTimeout($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(y.current=!0,!k){e.next=4;break}return e.next=4,O(l.current);case 4:return e.next=6,c(S.current);case 6:D();case 7:case"end":return e.stop()}}),e)}))),0),v.current=!1,y.current=!1),!H2({corners:C.card.corners,width:z,height:q})){e.next=62;break}if(!G2(C.card.corners)){e.next=59;break}if(E=z2(W,C.card.corners),I=IO.rectAreaRatio({small:{area:E.width*E.height},big:{area:H*K}}),!GY(o,"enableCardTypeCheck")||"vn"!==p){e.next=26;break}R=GY(C,"card.label",""),g.current=R,J2(R,a)||(w=S1.not_allowed_card_types),e.next=57;break;case 26:if(!(I<.5)){e.next=30;break}w=S1.id_detector_card_too_small,e.next=57;break;case 30:if(!(I>.95)){e.next=34;break}w=S1.id_detector_error_incomplete,e.next=57;break;case 34:return Q.width=E.width,Q.height=E.height,X.putImageData(E,0,0),e.next=39,K2({canvas:Q});case 39:if(!e.sent){e.next=44;break}w=S1.glare_detected,e.next=57;break;case 44:if("ph"===N){e.next=48;break}return e.next=47,Q2({blazefaceModel:T,predictedIdCardCanvas:Q,frontSide:s});case 47:w=e.sent;case 48:if(w){e.next=57;break}if(!n){e.next=57;break}if($=wO.calculateIdCardBlurScore({canvas:Q}),!_.current){e.next=54;break}return e.next=54,M({blurScore:$,detectedCard:C.card});case 54:if(!r){e.next=57;break}return e.next=57,L({blurScore:$,detectedCard:C.card});case 57:e.next=60;break;case 59:w=S1.id_detector_validate_angle_error;case 60:e.next=63;break;case 62:w=S1.id_detector_error_incomplete;case 63:e.next=66;break;case 65:w=S1.id_detector_no_cards;case 66:i(w),F();case 68:return t=Math.floor(performance.now()-t),Z=180-t>0?180-t:0,e.next=72,new Promise((function(e){return setTimeout(e,Z)}));case 72:b.current&&window.requestAnimationFrame(Y);case 73:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(Y);case 19:case"end":return e.stop()}}),e)}))),[o,C,t,i,F,c,D,N,O,s,a,M,L]);dv.useEffect((function(){var e=t.current;function o(){return(o=$m(regeneratorRuntime.mark((function t(){var r,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(w.current=CO.analyzeVideoAndWindowSizes(e,n,.05),r=w.current,o=r.cropWidth,a=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(a)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,z();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&C&&function(){o.apply(this,arguments)}()}),[r,n,t,D,z,C]);var q=dv.useCallback((function(){D()}),[D]);return dv.useEffect((function(){return q}),[q]),{refWorkingCanvas:l,refCardLabel:g,stopCheckFrame:D,checkFrame:z,warmupDone:C,takePictureManually:V,refAbleToRunBurstMode:T,refVirtualFrames:f,refCardCoordinates:m}}({refVideo:r,shouldStart:t,cropArea:n,cardList:s,settings:o,onError:N,frontSide:i,onAutoCaptureSuccess:R,quality:p}),D=O.refWorkingCanvas,L=O.refCardLabel,M=O.stopCheckFrame,F=O.checkFrame,U=O.warmupDone,j=O.takePictureManually,V=O.refAbleToRunBurstMode,z=O.refVirtualFrames,q=O.refCardCoordinates,H=B1({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),K=H.stopCheckFrame,W=H.splitVideos,G=H.resetRecordedVideos,Q=H.checkFrame;!function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,a=e.onChange;dv.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,i=n.current,s=t[t.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==i?void 0:i.width,"canvas.height":null==i?void 0:i.height};a&&a(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[a,t,r,n,o])}({debug:S,refRecordedVideos:H.refRecordedVideos,refWorkingCanvas:D,refVideo:r,onChange:c});var X=dv.useCallback((function(){K(),M(),G(),l()}),[G,K,M,l]),Y=dv.useCallback((function(){W()}),[W]),$=_1({lang:B,onAboutToTimeout:u,onSessionTimeout:X,onVideoTimeLimitReached:Y,settings:o,shouldStartTimers:U&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),Z=$.stopTimers,J=$.startTimers,ee=dv.useCallback((function(){h.current=!1}),[]),te=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee(),J(),e.next=4,Promise.all([Q(),F()]);case 4:case"end":return e.stop()}}),e)}))),[ee,J,Q,F]),re=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t,r,n,a,s,c,u,l,p,m,g,y,w,E,S,B,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_.length>0&&void 0!==_[0]?_[0]:{},r=t.imageBlob,n=t.error,a=t.detectedCard,s=t.captureTime,c=t.captureCount,u=t.captureDuration,l=t.captureType,!h.current){e.next=3;break}return e.abrupt("return");case 3:return h.current=!0,v(!0),K(),M(),Z(),N(null),p=null==o?void 0:o.enableVirtualCamHashes,m={},p&&(g=z).current.length>0&&(m=g.current.reduce((function(e,t,r){return og(og({},e),{},tg({},"hash".concat(r+1),t))}),m)),y=null==o?void 0:o.trackCardCoordinates,w="[".concat(q.current.toString(),"]"),A(),KM.preWriteExif({mode:KM.MODE.ID_CARD,motionData:I,orientationData:P,startTime:k.current,endTime:Date.now()}),e.next=18,KM.writeExif({mode:KM.MODE.ID_CARD,imageData:og(og({detectedCard:a,captureTime:s,blob:r},p?{vCam:m}:{}),{},{captureCount:c,captureDuration:u,captureType:l},y?{cardTracking:w}:{}),enableExifData:null==o?void 0:o.enableExifData});case 18:if(E=e.sent,!f||!f.key){e.next=24;break}return B=f.key,e.next=23,TL.encrypt({blob:E,key:B});case 23:S=e.sent;case 24:d({image:{blob:E,encrypted:S,detectedCard:a},error:n,recordedVideos:[]}),v(!1),b({tag:i?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-C.current)/1e3}});case 27:case"end":return e.stop()}}),e)}))),[K,M,Z,N,d,i,b,f,I,P,A,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,null==o?void 0:o.trackCardCoordinates,z,q]);y.current=re;var ne=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),Z(),K(),V.current||M(),e.next=6,j();case 6:return t=e.sent,e.next=9,re(t);case 9:v(!1),b({tag:i?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[j,re,Z,V,K,M,b,i]);return dv.useEffect((function(){t&&(b({tag:i?"id_front":"id_back",event:"user_activity.start",log:{}}),k.current=Date.now(),T())}),[b,i,t,T]),dv.useEffect((function(){U&&(b({tag:i?"id_front":"id_back",event:"user_activity.show",log:{}}),b({tag:i?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-k.current}}),C.current=performance.now())}),[b,i,U]),{refCardLabel:L,warmupDone:U,isProcessing:g,takePictureManually:ne,restartSession:te,resetIsProcessingImageBlobTaken:ee}},P1=aI.IDCardMessage,R1=dv.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,a=e.refVideo,i=e.frontSide,s=e.cardList,c=e.settings,u=e.onCaptureDone,l=e.onUISpacingChange,d=e.outputEncryptionSettings,f=hg(dv.useState({}),2),p=f[0],h=f[1],m=p.yDescription,g=p.yMessage,v=p.yCaptureButton,y=QN.useAsset("ic_camera.svg"),b=QN.useAsset("ic_loading.png"),w=hg(dv.useState(""),2),k=w[0],C=w[1],E=hN.useSDKSettings(),S=E.debug,B=E.lang,_=hg(dv.useState(null),2),x=_[0],T=_[1],A=hg(dv.useState(""),2),I=A[0],P=A[1],R=hg(dv.useState(null),2),N=R[0],O=R[1],D=N2(),L=D.showPopup,M=D.popupShown,F=D.popupType,U=dv.useCallback((function(e){P(null===e?"":iY(e.msg[B])({side:i?x2.FRONT[B]:x2.BACK[B]}))}),[B,i]),j=dv.useCallback((function(){T(""),L({popupType:O2})}),[L]),V=dv.useCallback((function(){T(""),u.apply(void 0,arguments)}),[u]),z=dv.useCallback((function(e){var t=e.curTimeLeft;T(iY(P1.REMAINING_TIME[B])({x:t}))}),[B]),q=I1({shouldStart:!0,refVideo:a,cropArea:N,settings:c,onModelErrorChange:U,frontSide:i,cardList:s,onDebugInfoChange:C,onSessionTimeout:j,onCaptureDone:V,onAboutToTimeout:z,outputEncryptionSettings:d}),H=q.refCardLabel,K=q.warmupDone,W=q.isProcessing,G=q.takePictureManually,Q=q.restartSession,X=q.resetIsProcessingImageBlobTaken,Y=dv.useCallback((function(){L({popupType:null}),X()}),[L,X]),$=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Y(),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q,Y]);dv.useEffect((function(){if(o){var e,t,r,a,i,s,c,u=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,p=o.lostY,m=o.clientHeight;n?(i=.7*(s=d-165),r=(c=(e=p+10)+45)+20,a=(t=c+s+10)+60):(i=WW.isMobile?u-6:Math.floor(.7*u),r=(c=(e=p+10)+50)+20,a=(t=c+(s=Math.floor(Math.min(i/1.5,m-2*p-80-100)))+10)+60);var g=Math.floor((u-i)/2)+f;O({x:g,y:c,width:i,height:s,surroundStyle:{opacity:.6,background:"#000"}});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:a};h(v),l(v)}}),[o,n,l]);var Z=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(""),e.next=3,G();case 3:case"end":return e.stop()}}),e)}))),[G]);return dv.useImperativeHandle(t,(function(){return{restartSession:$}}),[$]),dv.createElement(dv.Fragment,null,!K&&dv.createElement(gZ,null),S&&dv.createElement(WJ,null,k),W&&dv.createElement(VJ,null,dv.createElement("img",{src:b,alt:"",className:"spin"})),N&&dv.createElement(FG,{x:"".concat(N.x,"px"),y:"".concat(N.y,"px"),width:"".concat(N.width,"px"),height:"".concat(N.height,"px"),surroundStyle:N.surroundStyle},dv.createElement(YJ,{width:N.width,height:N.height,type:I?eJ:JZ})),!I&&dv.createElement(GJ,{y:"".concat(m,"px"),className:"description"},r),dv.createElement("div",{style:{position:"fixed",bottom:0,left:0,color:"#fff",padding:30}},H.current),I&&dv.createElement(QJ,{y:"".concat(m,"px")},I),!W&&(!(null!=c&&c.disableCaptureButtonIfAlert)||!I)&&dv.createElement(jJ,{onClick:Z,y:"".concat(v,"px")},dv.createElement("img",{src:y,alt:""})),x&&dv.createElement(XJ,{key:x,className:"message",y:"".concat(g,"px")},x),dv.createElement(pZ,{open:M},F===O2&&dv.createElement(R2,{onOk:$,maxSessionTime:null==c?void 0:c.idCardSessionTime})))}));R1.propTypes={usePortraitMask:Lv.bool,description:Lv.string,windowAndVideoInfo:Lv.shape({}),refVideo:Lv.shape({}),frontSide:Lv.bool,cardList:Lv.bool,settings:Lv.shape({}),onCaptureDone:Lv.func,onUISpacingChange:Lv.func,outputEncryptionSettings:Lv.shape({})},R1.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,cardList:[],settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var N1,O1,D1=aw.div(x1||(x1=pg(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: 8px;\n top: ",";\n position: absolute;\n z-index: ",";\n color: #fff;\n padding: 10px;\n margin: 0 10px;\n max-width: 275px;\n text-align: center;\n"])),(function(e){return e.background}),(function(e){return e.y}),1020),L1=aw.div(T1||(T1=pg(["\n width: 0;\n height: 0;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n border-bottom: ",";\n position: absolute;\n left: 50%;\n top: ",";\n transform: translateX(-50%);\n"])),(function(e){return"".concat(e.arrowSize,"px solid ").concat(e.color)}),(function(e){return"".concat(e.top,"px")})),M1=function(e){var t=e.children,r=e.y;return dv.createElement(D1,{y:r,background:"#00ce78"},dv.createElement(L1,{arrowSize:10,top:-10,color:"#00ce78"}),t)},F1=aw.div(A1||(A1=pg(["\n text-align: center;\n position: absolute;\n font-size: 18px;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),U1={QR_INSTRUCTIONS_TEXT:{en:dv.createElement("span",null,"Please follow the instructions below to scan QR code:",dv.createElement("br",null),dv.createElement("br",null)," Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),vi:dv.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên CCCD. Canh vừa mã QR vào 4 góc khung hình để quét mã")},QR_INSTRUCTIONS_START_BUTTON:{en:"Scan QR code",vi:"Tiến hành quét mã QR"},QR_INSTRUCTIONS_COUNTDOWN:{en:"Start in <%= x %> s",vi:"Bắt đầu trong <%= x %> giây"},QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR"},REMAINING_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"},SESSION_TIMEOUT_POPUP_DESCRIPTION:{en:dv.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",dv.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn."),vi:dv.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",dv.createElement("br",null),dv.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",dv.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn.")},SESSION_TIMEOUT_POPUP_RETRY_BUTTON:{en:"Retry",vi:"Thực hiện lại"},SESSION_TIMEOUT_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"}},j1=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,a=e.mr,i=e.mx,s=e.my,c=e.pt,u=e.pb,l=e.pl,d=e.pr,f=e.px,p=e.py,h=t.props.style||{},m={};return null!==i&&(m.marginLeft=i,m.marginRight=i),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==a&&(m.marginRight=a),null!==f&&(m.paddingLeft=f,m.paddingRight=f),null!==p&&(m.paddingTop=p,m.paddingBottom=p),null!==c&&(m.paddingTop=c),null!==u&&(m.paddingBottom=u),null!==l&&(m.paddingLeft=l),null!==d&&(m.paddingRight=d),dv.cloneElement(t,{style:og(og({},h),m)})};j1.propTypes={mt:Lv.string,ml:Lv.string,mr:Lv.string,mb:Lv.string,mx:Lv.string,my:Lv.string,pt:Lv.string,pl:Lv.string,pr:Lv.string,pb:Lv.string,px:Lv.string,py:Lv.string},j1.defaultProps={mt:null,ml:null,mr:null,mb:null,mx:null,my:null,pt:null,pl:null,pr:null,pb:null,px:null,py:null};var V1,z1,q1,H1=aw.button(N1||(N1=pg(["\n width: 100%;\n max-width: 294px;\n height: 66px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 3px;\n color: #fff;\n font-weight: normal;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),K1=aw.a(O1||(O1=pg(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),W1=aw.div(V1||(V1=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),G1=aw.div(z1||(z1=pg(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),Q1=aw.div(q1||(q1=pg(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),X1=function(e){var t=e.onRetry,r=e.onSkip,n=hN.useSDKSettings().lang;return dv.createElement(W1,null,dv.createElement(j1,{mt:"25px"},dv.createElement(G1,null,U1.QR_INVALID_POPUP_TITLE[n])),dv.createElement(j1,{mt:"30px"},dv.createElement(Q1,null,U1.QR_INVALID_POPUP_DESCRIPTION[n])),dv.createElement(j1,{mt:"30px"},dv.createElement(H1,{onClick:t},U1.QR_INVALID_POPUP_RETRY_BUTTON[n])),dv.createElement(j1,{my:"20px"},dv.createElement(K1,{onClick:r},U1.QR_INVALID_POPUP_SKIP_BUTTON[n])))};X1.propTypes={onRetry:Lv.func,onSkip:Lv.func},X1.defaultProps={onRetry:function(){},onSkip:function(){}};var Y1,$1,Z1,J1,e5,t5,r5,n5=["children","ratio","padding"],o5=aw.div(Y1||(Y1=pg(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),a5=aw.div($1||($1=pg(["\n position: absolute;\n top: ",";\n left: ",";\n right: ",";\n bottom: ",";\n"])),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding})),i5=function(e){var t=e.children,r=e.ratio,n=e.padding,o=lg(e,n5);return dv.createElement(o5,rg({ratio:r},o),dv.createElement(a5,{padding:n},t))};i5.propTypes={children:Lv.node,ratio:Lv.number,padding:Lv.string},i5.defaultProps={children:null,ratio:4/3,padding:"0"};var s5=aw.div(Z1||(Z1=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),c5=aw.div(J1||(J1=pg(["\n background: #e7e6e6;\n width: 100%;\n"]))),u5=aw.img(e5||(e5=pg(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),l5=aw.div(t5||(t5=pg(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n line-height: 20px;\n"])),(function(e){return e.theme.tsSecondary})),d5=aw(l5)(r5||(r5=pg(["\n white-space: nowrap;\n"]))),f5=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=hN.useSDKSettings().lang,a=QN.useAsset("qr_code_banner.png"),i=dv.useRef(n),s=hg(dv.useState((function(){return iY(U1.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),c=s[0],u=s[1],l=KN.useSDKTracking().sendEvent,d=dv.useRef(!1);dv.useEffect((function(){l({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[l]),dv.useEffect((function(){var e=iY(U1.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){i.current--,u(e({x:i.current})),i.current<=0&&(clearInterval(t),d.current||l({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),r&&r())}),1e3);return function(){clearInterval(t)}}),[o,r]);return dv.createElement(s5,null,dv.createElement(c5,null,dv.createElement(i5,{ratio:1.6},dv.createElement(u5,{src:a}))),dv.createElement(j1,{mt:"30px"},dv.createElement(l5,null,U1.QR_INSTRUCTIONS_TEXT[o])),dv.createElement(j1,{mt:"30px"},dv.createElement(H1,{onClick:function(){l({tag:"id_qr",event:"user_activity.click_start",log:{}}),d.current=!0,t()}},U1.QR_INSTRUCTIONS_START_BUTTON[o])),dv.createElement(j1,{my:"20px"},dv.createElement(d5,null,c)))};f5.propTypes={onClickStart:Lv.func,onTimeout:Lv.func,timeout:Lv.number},f5.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var p5=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function h5(e){var t=e.canvas,r=e.qrModel,n=window.cv,o=n.imread(t,n.IMREAD_GRAYSCALE);return r.detectAndDecode(o).get(0)}var m5=function(){var e=$m(regeneratorRuntime.mark((function e(t,r){var n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v1();case 2:if(n=e.sent,o=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return a=document.createElement("canvas"),i=a.getContext("2d"),e.next=11,new Promise((function(e){var r=URL.createObjectURL(t),n=new Image;n.onload=function(){var t=n.width,o=n.height;a.width=t/2,a.height=o/2,i.drawImage(n,t/2,0,a.width,a.height,0,0,a.width,a.height),URL.revokeObjectURL(r),e()},n.src=r}));case 11:return e.next=13,h5({canvas:a,qrModel:o});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,KM.writeExif({mode:"",imageData:{blob:t,result:s,type:"qr_from_front_image"},enableExifData:!0});case 18:if(c=e.sent,!r||!r.key){e.next=24;break}return l=r.key,e.next=23,TL.encrypt({imageBlobWithExif:c,key:l});case 23:u=e.sent;case 24:return e.abrupt("return",{result:s,validateResult:{valid:!0},image:{blob:c,encrypted:u},recordedVideos:[]});case 25:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),g5=r(n((function(e,t){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height||!this.data[t*this.width+e])},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,o){for(var a=t;a<t+n;a++)for(var i=e;i<e+r;i++)this.set(i,a,!!o)},e}();t.BitMatrix=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.addOrSubtractGF=function(e,t){return e^t};var o=function(){function e(e,t,r){this.primitive=e,this.size=t,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var o=1,a=0;a<this.size;a++)this.expTable[a]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,t){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===t)return this.zero;var r=new Uint8ClampedArray(e+1);return r[0]=t,new n.default(this,r)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=function(){function e(e,t){if(0===t.length)throw new Error("No coefficients.");this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;if(n===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-n);for(var o=0;o<this.coefficients.length;o++)this.coefficients[o]=t[n+o]}}else this.coefficients=t}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(t){var r;if(this.isZero())return t;if(t.isZero())return this;var o=this.coefficients,a=t.coefficients;o.length>a.length&&(o=(r=[a,o])[0],a=r[1]);for(var i=new Uint8ClampedArray(a.length),s=a.length-o.length,c=0;c<s;c++)i[c]=a[c];for(c=s;c<a.length;c++)i[c]=n.addOrSubtractGF(o[c-s],a[c]);return new e(this.field,i)},e.prototype.multiply=function(t){if(0===t)return this.field.zero;if(1===t)return this;for(var r=this.coefficients.length,n=new Uint8ClampedArray(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,n)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var r=this.coefficients,o=r.length,a=t.coefficients,i=a.length,s=new Uint8ClampedArray(o+i-1),c=0;c<o;c++)for(var u=r[c],l=0;l<i;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,a[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new Error("Invalid degree less than 0");if(0===r)return this.field.zero;for(var n=this.coefficients.length,o=new Uint8ClampedArray(n+t),a=0;a<n;a++)o[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,o)},e.prototype.evaluateAt=function(e){var t=0;if(0===e)return this.getCoefficient(0);var r=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){t=n.addOrSubtractGF(t,e)})),t;t=this.coefficients[0];for(var o=1;o<r;o++)t=n.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[o]);return t},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(5),a=r(11),i=r(12);function s(e){var t=i.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=a.extract(e,s),u=o.decode(c.matrix);if(u)return{binaryData:u.bytes,data:u.text,chunks:u.chunks,version:u.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:"attemptBoth"};function u(e,t,r,o){void 0===o&&(o={});var a=c;Object.keys(a||{}).forEach((function(e){a[e]=o[e]||a[e]}));var i="attemptBoth"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,u="onlyInvert"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,l=n.binarize(e,t,r,i),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==a.inversionAttempts&&"invertFirst"!==a.inversionAttempts||(p=s(u?d:f)),p}u.default=u,t.default=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r){return e<t?t:e>r?r:e}var a=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,i){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new a(t,r),c=0;c<t;c++)for(var u=0;u<r;u++){var l=e[4*(u*t+c)+0],d=e[4*(u*t+c)+1],f=e[4*(u*t+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(t/8),h=Math.ceil(r/8),m=new a(p,h),g=0;g<h;g++)for(var v=0;v<p;v++){var y=0,b=1/0,w=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var k=s.get(8*v+c,8*g+u);y+=k,b=Math.min(b,k),w=Math.max(w,k)}var C=y/Math.pow(8,2);if(w-b<=24&&(C=b/2,g>0&&v>0)){var E=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<E&&(C=E)}m.set(v,g,C)}var S=n.BitMatrix.createEmpty(t,r),B=null;for(i&&(B=n.BitMatrix.createEmpty(t,r)),g=0;g<h;g++)for(v=0;v<p;v++){for(var _=o(v,2,p-3),x=o(g,2,h-3),T=(y=0,-2);T<=2;T++)for(var A=-2;A<=2;A++)y+=m.get(_+T,x+A);var I=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var P=s.get(c,u);S.set(c,u,P<=I),i&&B.set(c,u,!(P<=I))}}return i?{binarized:S,inverted:B}:{binarized:S}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),a=r(9),i=r(10);function s(e,t){for(var r=e^t,n=0;r;)n++,r&=r-1;return n}function c(e,t){return t<<1|e}var u=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],l=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e,t,r){for(var o=l[r.dataMask],a=e.height,i=function(e){var t=17+4*e.versionNumber,r=n.BitMatrix.createEmpty(t,t);r.setRegion(0,0,9,9,!0),r.setRegion(t-8,0,8,9,!0),r.setRegion(0,t-8,9,8,!0);for(var o=0,a=e.alignmentPatternCenters;o<a.length;o++)for(var i=a[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===i&&6===u||6===i&&u===t-7||i===t-7&&6===u||r.setRegion(i-2,u-2,5,5,!0)}return r.setRegion(6,9,1,t-17,!0),r.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),s=[],u=0,d=0,f=!0,p=a-1;p>0;p-=2){6===p&&p--;for(var h=0;h<a;h++)for(var m=f?a-1-h:h,g=0;g<2;g++){var v=p-g;if(!i.get(v,m)){d++;var y=e.get(v,m);o({y:m,x:v})&&(y=!y),u=c(y,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var t=function(e){var t=e.height,r=Math.floor((t-17)/4);if(r<=6)return i.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var a=t-9;a>=t-11;a--)n=c(e.get(a,o),n);var u=0;for(a=5;a>=0;a--)for(o=t-9;o>=t-11;o--)u=c(e.get(a,o),u);for(var l,d=1/0,f=0,p=i.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var m=s(n,h.infoBits);m<d&&(l=h,d=m),(m=s(u,h.infoBits))<d&&(l=h,d=m)}return d<=3?l:void 0}(e);if(!t)return null;var r=function(e){for(var t=0,r=0;r<=8;r++)6!==r&&(t=c(e.get(r,8),t));for(var n=7;n>=0;n--)6!==n&&(t=c(e.get(8,n),t));var o=e.height,a=0;for(n=o-1;n>=o-7;n--)a=c(e.get(8,n),a);for(r=o-8;r<o;r++)a=c(e.get(r,8),a);for(var i=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,m=p.formatInfo;if(h===t||h===a)return m;var g=s(t,h);g<i&&(l=m,i=g),t!==a&&(g=s(a,h))<i&&(l=m,i=g)}return i<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],a=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),a+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<a)return null;e=e.slice(0,a);for(var i=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<i;s++)for(var c=0,u=o;c<u.length;c++)u[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var l=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)o[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=o;f<p.length;f++)p[f].codewords.push(e.shift());return o}(d(e,t,r),t,r.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,t){return e+t.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,m=n;h<m.length;h++){var g=m[h],v=a.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[p++]=v[y]}try{return o.decode(f,t.versionNumber)}catch(e){return null}}t.decode=function(e){if(null==e)return null;var t=f(e);if(t)return t;for(var r=0;r<e.width;r++)for(var n=r+1;n<e.height;n++)e.get(r,n)!==e.get(n,r)&&(e.set(r,n,!e.get(r,n)),e.set(n,r,!e.get(n,r)));return f(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o,a=r(7),i=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],a=e.readBits(o);a>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var i=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+i,48+s,48+c),n+=i.toString()+s.toString()+c.toString(),a-=3}if(2===a){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");i=Math.floor(u/10),s=u%10,r.push(48+i,48+s),n+=i.toString()+s.toString()}else if(1===a){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+u),n+=u.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(o||(o={}));var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(e,t){for(var r=[],n="",o=[9,11,13][t],a=e.readBits(o);a>=2;){var i=e.readBits(11),s=Math.floor(i/45),u=i%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],a-=2}return 1===a&&(s=e.readBits(6),r.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:r,text:n}}function l(e,t){for(var r=[],n="",o=[8,16,16][t],a=e.readBits(o),i=0;i<a;i++){var s=e.readBits(8);r.push(s)}try{n+=decodeURIComponent(r.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:r,text:n}}function d(e,t){for(var r=[],n="",o=[8,10,12][t],a=e.readBits(o),s=0;s<a;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,r.push(u>>8,255&u),n+=String.fromCharCode(i.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,i,c,f,p=new a.BitStream(e),h=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};p.available()>=4;){var g=p.readBits(4);if(g===o.Terminator)return m;if(g===o.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===o.Numeric){var v=s(p,h);m.text+=v.text,(r=m.bytes).push.apply(r,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===o.Alphanumeric){var y=u(p,h);m.text+=y.text,(i=m.bytes).push.apply(i,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===o.Byte){var b=l(p,h);m.text+=b.text,(c=m.bytes).push.apply(c,b.bytes),m.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(g===o.Kanji){var w=d(p,h);m.text+=w.text,(f=m.bytes).push.apply(f,w.bytes),m.chunks.push({type:n.Kanji,bytes:w.bytes,text:w.text})}}if(0===p.available()||0===p.readBits(p.available()))return m}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e<r?e:r,o=255>>8-n<<(a=r-n);t=(this.bytes[this.byteOffset]&o)>>a,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var a;if(e>0)o=255>>(a=8-e)<<a,t=t<<e|(this.bytes[this.byteOffset]&o)>>a,this.bitOffset+=e}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var a=new n.default(285,256,0),i=new o.default(a,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=i.evaluateAt(a.exp(u+a.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(a,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var a=t,i=r,s=e.zero,c=e.one;i.degree()>=n/2;){var u=a,l=s;if(s=c,(a=i).isZero())return null;i=u;for(var d=e.zero,f=a.getCoefficient(a.degree()),p=e.inverse(f);i.degree()>=a.degree()&&!i.isZero();){var h=i.degree()-a.degree(),m=e.multiply(i.getCoefficient(i.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),i=i.addOrSubtract(a.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),i.degree()>=a.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),i.multiply(v)]}(a,a.buildMonomial(t,1),d,t);if(null===f)return null;var p=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),o=0,a=1;a<e.size&&o<r;a++)0===t.evaluateAt(a)&&(n[o]=e.inverse(a),o++);return o!==r?null:n}(a,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,a=new Array(o),i=0;i<o;i++){for(var s=e.inverse(r[i]),c=1,u=0;u<o;u++)i!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));a[i]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(a[i]=e.multiply(a[i],s))}return a}(a,f[1],p),m=0;m<p.length;m++){var g=r.length-1-a.log(p[m]);if(g<0)return null;r[g]=n.addOrSubtractGF(r[g],h[m])}return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r,n){var o=e.x-t.x+r.x-n.x,a=e.y-t.y+r.y-n.y;if(0===o&&0===a)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:r.x-t.x,a22:r.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var i=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=i*u-s*c,d=(o*u-s*a)/l,f=(i*a-o*c)/l;return{a11:t.x-e.x+d*t.x,a12:t.y-e.y+d*t.y,a13:d,a21:n.x-e.x+f*n.x,a22:n.y-e.y+f*n.y,a23:f,a31:e.x,a32:e.y,a33:1}}t.extract=function(e,t){for(var r=function(e,t,r,n){var a=o(e,t,r,n);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}({x:3.5,y:3.5},{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),a=function(e,t){return{a11:e.a11*t.a11+e.a21*t.a12+e.a31*t.a13,a12:e.a12*t.a11+e.a22*t.a12+e.a32*t.a13,a13:e.a13*t.a11+e.a23*t.a12+e.a33*t.a13,a21:e.a11*t.a21+e.a21*t.a22+e.a31*t.a23,a22:e.a12*t.a21+e.a22*t.a22+e.a32*t.a23,a23:e.a13*t.a21+e.a23*t.a22+e.a33*t.a23,a31:e.a11*t.a31+e.a21*t.a32+e.a31*t.a33,a32:e.a12*t.a31+e.a22*t.a32+e.a32*t.a33,a33:e.a13*t.a31+e.a23*t.a32+e.a33*t.a33}}(o(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft),r),i=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=a.a13*e+a.a23*t+a.a33;return{x:(a.a11*e+a.a21*t+a.a31)/r,y:(a.a12*e+a.a22*t+a.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);i.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:i,mappingFunction:s}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function o(e){return e.reduce((function(e,t){return e+t}))}function a(e,t,r,o){var a,i,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(t.y-e.y)>Math.abs(t.x-e.x);l?(a=Math.floor(e.y),i=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(a=Math.floor(e.x),i=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-a),f=Math.abs(c-i),p=Math.floor(-d/2),h=a<s?1:-1,m=i<c?1:-1,g=!0,v=a,y=i;v!==s+h;v+=h){var b=l?y:v,w=l?v:y;if(r.get(b,w)!==g&&(g=!g,u.push({x:b,y:w}),u.length===o+1))break;if((p+=f)>0){if(y===c)break;y+=m,p-=d}}for(var k=[],C=0;C<o;C++)u[C]&&u[C+1]?k.push(n(u[C],u[C+1])):k.push(0);return k}function i(e,t,r,n){var o,i=t.y-e.y,s=t.x-e.x,c=a(e,t,r,Math.ceil(n/2)),u=a(e,{x:e.x-s,y:e.y-i},r,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(o=u.concat(l)).concat.apply(o,c)}function s(e,t){var r=o(e)/o(t),n=0;return t.forEach((function(t,o){n+=Math.pow(e[o]-t*r,2)})),{averageSize:r,error:n}}function c(e,t,r){try{var n=i(e,{x:-1,y:e.y},r,t.length),o=i(e,{x:e.x,y:-1},r,t.length),a=i(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=i(e,{x:Math.min(r.width,e.x+e.y)+1,y:Math.min(r.height,e.y+e.x)+1},r,t.length),u=s(n,t),l=s(o,t),d=s(a,t),f=s(c,t),p=Math.sqrt(u.error*u.error+l.error*l.error+d.error*d.error+f.error*f.error),h=(u.averageSize+l.averageSize+d.averageSize+f.averageSize)/4;return p+(Math.pow(u.averageSize-h,2)+Math.pow(l.averageSize-h,2)+Math.pow(d.averageSize-h,2)+Math.pow(f.averageSize-h,2))/h}catch(e){return 1/0}}function u(e,t){for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r--;for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n++;for(var o=(r+n)/2,a=Math.round(t.y);e.get(Math.round(o),a);)a--;for(var i=Math.round(t.y);e.get(Math.round(o),i);)i++;return{x:o,y:(a+i)/2}}function l(e,t,r,a,s){var u,l,d;try{u=function(e,t,r,a){var s=(o(i(e,r,a,5))/7+o(i(e,t,a,5))/7+o(i(r,e,a,5))/7+o(i(t,e,a,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,t)/s),u=Math.round(n(e,r)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(a,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-a.x+s.x,p=r.y-a.y+s.y,h=(n(a,s)+n(a,r))/2/d,m=1-3/h,g={x:a.x+m*(f-a.x),y:a.y+m*(p-a.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,a=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(a))){var i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1];return o(i),{x:r,y:a,score:c({x:Math.floor(r),y:Math.floor(a)},[1,1,1],e)+n({x:r,y:a},g)}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));return{alignmentPattern:h>=15&&v.length?v[0]:g,dimension:l}}t.locate=function(e){for(var t=[],r=[],a=[],i=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var a=e.get(t,n);if(a===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=a;var l=o(u)/7,d=Math.abs(u[0]-l)<l&&Math.abs(u[1]-l)<l&&Math.abs(u[2]-3*l)<3*l&&Math.abs(u[3]-l)<l&&Math.abs(u[4]-l)<l&&!a,f=o(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&a;if(d){var h=t-u[3]-u[4],m=h-u[2],g={startX:m,endX:h,y:n};(v=r.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||h>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&h>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:r.push({top:g,bottom:g})}if(p){var v,y=t-u[4],b=y-u[3];g={startX:b,y:n,endX:y},(v=i.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||y>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&y>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:i.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)l(d);t.push.apply(t,r.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),r=r.filter((function(e){return e.bottom.y===n})),a.push.apply(a,i.filter((function(e){return e.bottom.y!==n}))),i=i.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);t.push.apply(t,r.filter((function(e){return e.bottom.y-e.top.y>=2}))),a.push.apply(a,i);var f=t.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],i=o(a)/a.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:i}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score})).map((function(e,t,r){if(t>4)return null;var n=r.filter((function(e,r){return t!==r})).map((function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}})).sort((function(e,t){return e.score-t.score}));if(n.length<2)return null;var o=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:o}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));if(0===f.length)return null;var p=function(e,t,r){var o,a,i,s,c,u,l,d=n(e,t),f=n(t,r),p=n(e,r);return f>=d&&f>=p?(c=(o=[t,e,r])[0],u=o[1],l=o[2]):p>=f&&p>=d?(c=(a=[e,t,r])[0],u=a[1],l=a[2]):(c=(i=[e,r,t])[0],u=i[1],l=i[2]),(l.x-u.x)*(c.y-u.y)-(l.y-u.y)*(c.x-u.x)<0&&(c=(s=[l,c])[0],l=s[1]),{bottomLeft:c,topLeft:u,topRight:l}}(f[0].points[0],f[0].points[1],f[0].points[2]),h=p.topRight,m=p.topLeft,g=p.bottomLeft,v=l(e,a,h,m,g),y=[];v&&y.push({alignmentPattern:{x:v.alignmentPattern.x,y:v.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:v.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),w=u(e,m),k=u(e,g),C=l(e,a,b,w,k);return C&&y.push({alignmentPattern:{x:C.alignmentPattern.x,y:C.alignmentPattern.y},bottomLeft:{x:k.x,y:k.y},topLeft:{x:w.x,y:w.y},topRight:{x:b.x,y:b.y},dimension:C.dimension}),0===y.length?null:y}}]).default},e.exports=r()})));function v5(e){return y5.apply(this,arguments)}function y5(){return(y5=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(a=n.getContext("2d"),o=a.getImageData(0,0,n.width,n.height)),!(i=g5(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",i.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b5(e){return w5.apply(this,arguments)}function w5(){return(w5=$m(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.canvas,n=t.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),l1.scanImage(r,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var k5=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,a=r,!n){e.next=6;break}return e.next=5,FD.blobToCanvas({blob:n});case 5:a=e.sent;case 6:return i=a.getContext("2d"),e.next=9,v5({imageData:i.getImageData(0,0,a.width,a.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,b5({canvas:a,qrScannerResources:o});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var C5,E5,S5,B5,_5,x5,T5=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onSessionTimeout,i=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=hg(dv.useState(!1),2),l=u[0],d=u[1],f=dv.useRef((function(){})),p=dv.useRef((function(){})),h=hN.useSDKSettings().lang,m=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.onResult,i=e.outputEncryptionSettings,s=dv.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=dv.useRef(!1),u=dv.useRef(null),l=hg(dv.useState(!1),2),d=l[0],f=l[1],p=dv.useRef({}),h=hN.useSDKSettings(),m=h.customUrls,g=h.qrSettings;dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d){e.next=5;break}return e.next=3,v1({modelUrl:null==m?void 0:m.wechatQRModelsUrl});case 3:p.current=e.sent,f(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[d,m]);var v=dv.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),y=dv.useCallback($m(regeneratorRuntime.mark((function e(){var r,n,l,f,h,m,y,b,w,k,C,E,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d&&o&&!c.current){e.next=2;break}return e.abrupt("return");case 2:r=p.current,n=r.qrModel,l=r.qrScannerResources,f=r.noModel,h=u.current,m=t.current,c.current=!0,y=h.cropX,b=h.cropY,w=h.cropWidth,k=h.cropHeight,(C=s.current).width=w,C.height=k,E=C.getContext("2d"),S=function(){var e=$m(regeneratorRuntime.mark((function e(){var t,r,o,u,d,p,h,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E.drawImage(m,y,b,w,k,0,0,w,k),t=performance.now(),f){e.next=8;break}return e.next=5,h5({canvas:C,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,k5({canvas:C,qrScannerResources:l});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=27;break}return v(),_=void 0,_=r.match(p5),o={valid:Boolean(_)},e.next=17,CO.takePicture({canvas:s.current});case 17:return u=e.sent,e.next=20,KM.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:"boolean"!=typeof(null==g?void 0:g.enableExif)||(null==g?void 0:g.enableExif)});case 20:if(d=e.sent,!i||!i.key){e.next=26;break}return h=i.key,e.next=25,TL.encrypt({blob:d,key:h});case 25:p=e.sent;case 26:a({result:r,validateResult:o,image:{blob:d,encrypted:p}});case 27:return B=180-t>0?180-t:0,e.next=30,new Promise((function(e){return setTimeout(e,B)}));case 30:c.current&&window.requestAnimationFrame(S);case 31:case"end":return e.stop()}var _}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(S);case 13:case"end":return e.stop()}}),e)}))),[d,o,t,v,null==g?void 0:g.enableExif,i,a]),b=dv.useCallback((function(){v()}),[v]);return dv.useEffect((function(){var e=t.current;r||b(),d&&r&&n&&e&&e.videoWidth>0&&(u.current=CO.analyzeVideoAndWindowSizes(e,n,0),y())}),[r,n,t,v,y,d,b]),dv.useEffect((function(){return b}),[b]),{refWorkingCanvas:s,stopCheckFrame:v,checkFrame:y,warmupDone:d}}({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:dv.useCallback((function(){f.current.apply(f,arguments)}),[]),outputEncryptionSettings:c}),g=m.stopCheckFrame,v=m.checkFrame,y=m.warmupDone,b=B1({refVideo:r,shouldStart:t&&y,cropArea:n,settings:o}),w=b.stopCheckFrame,k=b.refRecordedVideos,C=b.splitVideos,E=b.resetRecordedVideos,S=b.checkFrame;f.current=dv.useCallback((function(e){d(!0),w(),g(),p.current(),i(og(og({},e),{},{recordedVideos:k.current})),d(!1)}),[w,i,k,g]);var B=dv.useCallback((function(){w(),g();var e=mg(k.current);a({recordedVideos:e}),E()}),[E,w,g,a,k]),_=dv.useCallback((function(){C()}),[C]),x=_1({lang:h,onAboutToTimeout:s,onSessionTimeout:B,onVideoTimeLimitReached:_,settings:o,shouldStartTimers:t&&y,sessionTime:null==o?void 0:o.scanQrLimitTimeSecond}),T=x.stopTimers,A=x.startTimers;return p.current=T,{isProcessing:l,restartSession:dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(),e.next=3,Promise.all([S(),v()]);case 3:case"end":return e.stop()}}),e)}))),[S,v,A]),refRecordedVideos:k,warmupDone:y}};function A5(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,a=e.onCaptureDone,i=e.outputEncryptionSettings,s=hg(dv.useState(null),2),c=s[0],u=s[1],l=QN.useAsset("qr_capture_cursor.png"),d=hg(dv.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=hN.useSDKSettings().lang,v=KN.useSDKTracking().sendEvent,y=N2(),b=y.showPopup,w=y.popupShown,k=y.popupType,C=hg(dv.useState(!1),2),E=C[0],S=C[1],B=hg(dv.useState(null),2),_=B[0],x=B[1],T=QN.useAsset("ic_loading.png"),A=dv.useRef();dv.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),dv.useEffect((function(){b({popupType:M2})}),[b]),dv.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,a=WW.isMobile?Math.min(e-6,145):145,i=a,s=o+10,c=s+90,l=c+40,d=l+i+20,f=Math.floor((e-a)/2)+n;u({x:f,y:l,width:a,height:i,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var I=dv.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),a(e)}),[a,v]),P=dv.useCallback((function(e){var t=e.validateResult.valid;x("");var r=performance.now();t?(v({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-A.current)/1e3}}),a(e)):(b({popupType:L2}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,a,v]),R=dv.useCallback((function(e){var t=e.curTimeLeft;x(iY(U1.REMAINING_TIME[g])({x:t}))}),[g]),N=T5({shouldStart:E,refVideo:n,cropArea:c,settings:o,onSessionTimeout:I,onCaptureDone:P,onAboutToTimeout:R,outputEncryptionSettings:i}),O=N.isProcessing,D=N.restartSession,L=N.warmupDone,M=dv.useCallback((function(){b({popupType:null})}),[b]),F=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(),A.current=performance.now(),v({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,D();case 5:case"end":return e.stop()}}),e)}))),[D,M,v]),U=dv.useCallback((function(){M(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),a()}),[M,a,v]),j=dv.useCallback((function(){M(),setTimeout((function(){S(!0)}),200)}),[M]);return dv.createElement(dv.Fragment,null,!L&&dv.createElement(gZ,{contentStyle:{maxWidth:"300px"}}),c&&dv.createElement(FG,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},dv.createElement("div",null,dv.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),dv.createElement(M1,{y:"".concat(h,"px")},U1.QR_TOOLTIP[g]),_&&dv.createElement(F1,{key:_,className:"message",y:"".concat(m,"px")},_),O&&dv.createElement(VJ,null,dv.createElement("img",{src:T,alt:"",className:"spin"})),dv.createElement(pZ,{contentStyle:{maxWidth:"332px"},open:w},k===L2&&dv.createElement(X1,{onRetry:F,onSkip:U}),k===M2&&dv.createElement(f5,{onClickStart:j,onTimeout:j})))}A5.propTypes={windowAndVideoInfo:Lv.shape({}),onUISpacingChange:Lv.func,refVideo:Lv.shape({}),settings:Lv.shape({}),onCaptureDone:Lv.func,outputEncryptionSettings:Lv.shape({})},A5.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var I5,P5,R5,N5,O5,D5="SUCCESS",L5="WARNING",M5=(tg(C5={},D5,"52,206,95"),tg(C5,L5,"255,148,50"),C5),F5=(tg(E5={},D5,"✓"),tg(E5,L5,"!"),E5),U5=aw.div(S5||(S5=pg(["\n font-weight: normal;\n"]))),j5=aw.div(B5||(B5=pg(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return Hb(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],M5[e.type],M5[e.type],M5[e.type])})),V5=aw.div(_5||(_5=pg(["\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n margin-right: 8px;\n font-weight: bold;\n"])),(function(e){return Hb(["rgb(",")"],M5[e.type])})),z5=aw.div(x5||(x5=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),q5=function(e){var t=e.children,r=e.type,n=e.className;return dv.createElement(U5,{className:n},dv.createElement(j5,{type:r}),dv.createElement(z5,null,dv.createElement(V5,{type:r},F5[r]),t),dv.createElement(j5,{type:r}))};q5.propTypes={children:Lv.node,type:Lv.string,className:Lv.string},q5.defaultProps={children:null,type:D5,className:""};var H5=aw.div(I5||(I5=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),K5=aw.div(P5||(P5=pg(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),W5=aw.button(R5||(R5=pg(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),G5=aw.img(N5||(N5=pg(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),Q5=aw.div(O5||(O5=pg(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),X5=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,a=e.hasValidQR,i=e.frontSide,s=hg(dv.useState(null),2),c=s[0],u=s[1],l=hN.useSDKSettings().lang,d=KN.useSDKTracking().sendEvent;return dv.useEffect((function(){d({tag:i?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[i,d]),dv.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),dv.createElement(H5,null,null!==a&&dv.createElement(j1,{mb:"20px"},dv.createElement("div",null,dv.createElement(q5,{type:a?D5:L5},a?x2.CONFIRM_POPUP_VALID_QR[l]:x2.CONFIRM_POPUP_INVALID_QR[l]))),dv.createElement(i5,{ratio:1.5},dv.createElement(G5,{src:c})),o&&dv.createElement(K5,{className:"confirm-popup-error-message"},o.msg[l]),dv.createElement(Q5,null,dv.createElement(W5,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},x2.BTN_TRY_AGAIN[l]),dv.createElement(W5,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},x2.BTN_USE_THIS_PICTURE[l])))};X5.propTypes={imageTaken:Lv.shape({}),error:Lv.shape({msg:Lv.shape({})}),onConfirm:Lv.func,onTryAgain:Lv.func,hasValidQR:Lv.bool,frontSide:Lv.bool},X5.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var Y5,$5={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},Z5=sw(Y5||(Y5=pg(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),J5=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons","isLoading","cardList"];function e4(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,a=e.defaultCameraId,i=e.globalStyle,s=e.styledComponent,c=e.frontCamera,u=e.scannerTypeCons,l=e.isLoading,d=e.cardList,f=lg(e,J5),p=f.numberOfCaptures,h=f.stepNumber,m=f.frontSide,g=f.titleIcon,v=f.title,y=f.description,b=f.scannerType,w=f.usePortraitMask,k=f.shouldShowSpinner,C=f.handleQRCaptureDone,E=f.handleIDCardCaptureDone,S=f.handleRestartSession,B=f.refIDCardReader,_=f.handleClickConfirm,x=f.popupType,T=f.popupShown,A=f.popupProps,I=dv.useRef(null),P=hg(dv.useState(null),2),R=P[0],N=P[1],O=hg(dv.useState(!1),2),D=O[0],L=O[1],M=QN.useAsset("ic_loading.png"),F=hg(dv.useState({}),2),U=F[0],j=F[1],V=U.yTitle,z=dv.useCallback((function(e){N(e),L(!0)}),[]);dv.useEffect((function(){L(!1)}),[c]);var q=QN.useAsset(g),H=s.CloseCameraButton;return dv.createElement(rw,{theme:$5},dv.createElement(FJ,null,dv.createElement(RG,{key:c,frontCamera:c,onVideoPlayed:z,onClose:t,flipHorizontal:c,ref:I,onError:r,defaultCameraId:a,closeButton:H||null},D&&dv.createElement(dv.Fragment,null,b===u.ID_CARD&&dv.createElement(R1,{key:h,ref:B,windowAndVideoInfo:R,refVideo:I,settings:n,onCaptureDone:E,onUISpacingChange:j,frontSide:m,cardList:d,description:y,usePortraitMask:w,outputEncryptionSettings:o}),b===u.QR_CODE&&dv.createElement(A5,{key:h,refVideo:I,windowAndVideoInfo:R,settings:n,onCaptureDone:C,onUISpacingChange:j,outputEncryptionSettings:o})),dv.createElement(MJ,{keyForTransition:p}),dv.createElement(qJ,{y:"".concat(V,"px")},dv.createElement(KZ,null,dv.createElement(MZ,{key:v,timeout:{enter:500,exit:500},classNames:"flipY",unmountOnExit:!0},dv.createElement(HJ,null,g&&dv.createElement(UJ,{src:q,alt:""}),dv.createElement(KJ,{className:"title"},v))))),(k||l)&&dv.createElement(VJ,null,dv.createElement("img",{src:M,alt:"",className:"spin"}))),dv.createElement(pZ,{open:T},x===D2&&dv.createElement(X5,rg({},A,{onConfirm:_,onTryAgain:S,frontSide:m})))),dv.createElement(i,null))}var t4={cardList:Lv.arrayOf(Lv.string),settings:Lv.shape({}),onClose:Lv.func,onError:Lv.func,outputEncryptionSettings:Lv.shape({}),defaultCameraId:Lv.string,globalStyle:Lv.shape({}),styledComponent:Lv.shape({CloseCameraButton:Lv.node}),frontCamera:Lv.bool,scannerTypeCons:Lv.shape({}).isRequired,isLoading:Lv.bool},r4={cardList:[],settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:Z5,styledComponent:{CloseCameraButton:null},frontCamera:!1,isLoading:!1};e4.propTypes=t4,e4.defaultProps=r4;var n4=aI.IDCardSide,o4=aI.IDCardType,a4=aI.Errors,i4={ID_CARD:"id_card",QR_CODE:"qr_code"},s4=(aI.IDCardSide.FRONT,o4.VN,aI.IDCardSide.BACK,o4.VN,{scannerType:i4.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""}),c4=function(){return Promise.resolve({card_label:""})},u4=function(e){var t=e.settings,r=e.onError,n=e.detectIdCard,o=void 0===n?c4:n,a=e.outputEncryptionSettings,i=e.steps,s=e.onStepDone,c=hN.useSDKSettings().lang,u=null!=i?i:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",r="ph"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||"en"===t,n={scannerType:i4.ID_CARD,title:r?"Capture Front Side of ID Card":"Mặt trước CMND/CCCD",description:r?"":"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:aI.IDCardSide.FRONT,cardType:o4.VN,enableConfirmPopup:!0},o={scannerType:i4.ID_CARD,title:r?"Capture Back Side of ID Card":"Mặt sau CMND/CCCD",description:r?"":"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:aI.IDCardSide.BACK,cardType:o4.VN,enableConfirmPopup:!0};return e?[n,o]:[n]}(GY(t,"hasBackCard",!0),c,GY(t,"country")),l=hg(dv.useState(0),2),d=l[0],f=l[1],p=hg(dv.useState(u[d]),2),h=p[0],m=p[1],g=hg(dv.useState(0),2),v=g[0],y=g[1],b=hg(dv.useState(!1),2),w=b[0],k=b[1],C=dv.useRef({}),E=dv.useRef([]),S=dv.useRef(null),B=dv.useRef(),_=dv.useRef(null),x=N2(),T=x.showPopup,A=x.popupShown,I=x.popupType,P=x.props,R=h.scannerType,N=h.title,O=h.titleIcon,D=h.cardSide,L=h.description,M=h.usePortraitMask,F=h.cardType,U=h.enableConfirmPopup,j=dv.useCallback((function(e){e>=u.length||setTimeout((function(){f(e),m(u[e])}),200)}),[u]),V=dv.useCallback((function(){j(d+1)}),[j,d]),z=dv.useCallback((function(){setTimeout((function(){m((function(e){return og(og({},e),s4)}))}),200)}),[]),q=dv.useCallback((function(){T({popupType:null})}),[T]),H=dv.useCallback((function(){if(q(),S.current=null,R===i4.QR_CODE)j(d);else if(R===i4.ID_CARD){var e=null;_.current===n4.FRONT?e=0:_.current===n4.BACK&&(e=1),null!==e&&j(e),B.current.restartSession()}}),[j,d,q,R]),K=dv.useCallback($m(regeneratorRuntime.mark((function e(){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={stepNumber:d,cardSide:D,cardType:F,image:C.current,recordedVideos:null!=t&&t.enableRecording?E.current:[]},(R===i4.QR_CODE||null!==(r=S.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=S.current),k(!0),e.next=5,s(n);case 5:(o=e.sent)?(_.current=o,k(!1)):(k(!1),S.current=null,V());case 7:case"end":return e.stop()}}),e)}))),[t,d,s,V,R,k,D,F]),W=dv.useCallback((function(e){var t;if(S.current=e,e&&e.recordedVideos){var r,n=e.recordedVideos;(r=E.current).push.apply(r,mg(n))}y((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);U?T({popupType:D2,props:{hasValidQR:o,imageTaken:C.current}}):K()}),[T,U,K]),G=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(n){var i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.image,s=n.error,c=n.recordedVideos,C.current=i,E.current=c,y((function(e){return e+1})),D!==aI.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!WW.isMobile){e.next=28;break}if(l=null==i||null===(u=i.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return k(!0),e.prev=9,e.next=12,o({image:i,cardType:F,cardSide:D});case 12:d=e.sent,l=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(a4.detect_id_card_error);case 19:k(!1);case 20:if(!l||!"vn.cccd_new.front".includes(l)){e.next=28;break}return k(!0),e.next=24,m5(C.current.blob,a);case 24:return(f=e.sent)?W(f):z(),k(!1),e.abrupt("return");case 28:U?T({popupType:D2,props:{imageTaken:C.current,error:s}}):K();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[U,T,D,t,F,o,K,z,r,W,a,k]),Q=dv.useCallback((function(){q(),K()}),[K,q]);return{numberOfCaptures:v,stepNumber:d,titleIcon:O,title:N,description:L,frontSide:D===n4.FRONT,scannerType:R,usePortraitMask:M,shouldShowSpinner:w,handleQRCaptureDone:W,handleIDCardCaptureDone:G,handleRestartSession:H,refIDCardReader:B,handleClickConfirm:Q,showPopup:T,popupType:I,popupShown:A,popupProps:P}};var l4=function(){this.__data__=new TY,this.size=0};var d4=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var f4=function(e){return this.__data__.get(e)};var p4=function(e){return this.__data__.has(e)};var h4=function(e,t){var r=this.__data__;if(r instanceof TY){var n=r.__data__;if(!AY||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new FY(n)}return r.set(e,t),this.size=r.size,this};function m4(e){var t=this.__data__=new TY(e);this.size=t.size}m4.prototype.clear=l4,m4.prototype.delete=d4,m4.prototype.get=f4,m4.prototype.has=p4,m4.prototype.set=h4;var g4=m4;var v4=function(e,t,r){(void 0!==r&&!NQ(e[t],r)||void 0===r&&!(t in e))&&RQ(e,t,r)};var y4=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),s=i.length;s--;){var c=i[e?s:++o];if(!1===r(a[c],c,a))break}return t}}(),b4=n((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?qG.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}})),w4=qG.Uint8Array;var k4=function(e){var t=new e.constructor(e.byteLength);return new w4(t).set(new w4(e)),t};var C4=function(e,t){var r=t?k4(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)};var E4=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t},S4=Object.create,B4=function(){function e(){}return function(t){if(!jG(t))return{};if(S4)return S4(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();var _4=function(e){return"function"!=typeof e.constructor||gX(e)?{}:B4(EX(e))};var x4=function(e){return aQ(e)&&GQ(e)};var T4=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var A4=function(e){return LQ(e,wX(e))};var I4=function(e,t,r,n,o,a,i){var s=T4(e,r),c=T4(t,r),u=i.get(c);if(u)v4(e,r,u);else{var l=a?a(s,c,r+"",e,t,i):void 0,d=void 0===l;if(d){var f=oX(c),p=!f&&iX(c),h=!f&&!p&&fX(c);l=c,f||p||h?oX(s)?l=s:x4(s)?l=E4(s):p?(d=!1,l=b4(c,!0)):h?(d=!1,l=C4(c,!0)):l=[]:AX(c)||nX(c)?(l=s,nX(s)?l=A4(s):jG(s)&&!gQ(s)||(l=_4(c))):d=!1}d&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),v4(e,r,l)}};var P4=function e(t,r,n,o,a){t!==r&&y4(r,(function(i,s){if(a||(a=new g4),jG(i))I4(t,r,s,n,e,o,a);else{var c=o?o(T4(t,s),i,s+"",t,r,a):void 0;void 0===c&&(c=i),v4(t,s,c)}}),wX)},R4=$Q((function(e,t,r){P4(e,t,r)})),N4={data:{country:"vn",settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},track_card_coordinates:{enable:!1,max_length:150},card_type_check:{enable:!1},blur_check:{enable:!0,threshold_web:.82},disable_capture_button_if_alert:!1,exif_data_settings:{enable:!0},id_detection:{enable:!0},limit_time_settings:{enable:!0,limit_time_second:30,video_partial_length_seconds:15},save_frame_settings:{enable:!1,frames_interval_ms:190,quality_web:80},scan_qr_settings:{enable:!0,limit_time_second:20},virtual_cam_hashes:{web:!1,mobile:!1}}}}}};function O4(e){var t=e.clientSettings,r=hg(dv.useState(null),2),n=r[0],o=r[1];return dv.useEffect((function(){var e=R4(N4,t),r=GY(e,"data.settings.sdk_settings.id_detection_settings.card_type_check.enable"),n=GY(e,"data.country"),a=GY(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),i=GY(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.enable"),s=GY(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.max_length"),c=GY(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),u=GY(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),l=GY(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),d=GY(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),f=GY(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),p=GY(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),h=GY(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),m=GY(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),g=GY(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),v=GY(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),y=GY(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),b=GY(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),w=GY(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),k=GY(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),C=GY(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(WW.isMobile?"mobile":"web")),E=GY(e,"data.card_types[0].has_back_side",!0);o({country:n,enableRecording:a,trackCardCoordinates:i,trackCardCoordinatesMaxLength:s,enableCardTypeCheck:r,frameCaptureIntervalMs:c,idCardSessionTime:d,maxRecordingTimePerVideo:f,saveFrameQuality:u,enableTimers:l,enableAutoCapture:p,waitForBestImageTimeMs:h,enableBlurCheck:m,blurThreshold:g,disableCaptureButtonIfAlert:v,enableIdDetection:y,enableScanQr:b,scanQrLimitTimeSecond:w,enableExifData:k,enableVirtualCamHashes:C,hasBackCard:E})}),[t]),{settings:n}}function D4(e){var t=e.logCredentials,r=e.clientSettings,n=e.uiOnlyComponent,o=e.onError,a=e.detectIdCard,i=e.outputEncryptionSettings,s=e.steps,c=e.onStepDone,u=O4({clientSettings:r}).settings,l=rg({},u4({settings:u,onError:o,detectIdCard:a,outputEncryptionSettings:i,steps:s,onStepDone:c}));return dv.createElement(R3,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og({},t)}},dv.createElement(n,rg({},e,{settings:u,scannerTypeCons:i4},l))))}var L4={logCredentials:Lv.shape({}),clientSettings:Lv.shape({}),uiOnlyComponent:Lv.func,onError:Lv.func,onStepDone:Lv.func,steps:Lv.arrayOf(Lv.shape({})),detectIdCard:Lv.func,outputEncryptionSettings:Lv.shape({})};D4.propTypes=L4,D4.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:e4,onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var M4=function(e){var t=rg({},e),r=t.clientSettings,n=t.onError,o=t.onStepDone,a=t.logCredentials,i=t.uiOnlyComponent,s=t.detectIdCard,c=t.outputEncryptionSettings,u=t.steps,l=O4({clientSettings:r}).settings,d=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o(og(og({},t),{},{restartSession:null==f?void 0:f.handleRestartSession}));case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,null==f?void 0:f.handleRestartSession]),f=rg({},u4({settings:l,onError:n,detectIdCard:s,outputEncryptionSettings:c,steps:u,onStepDone:d}));return dv.createElement(R3,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og({},a)}},dv.createElement(i,rg({},t,{onStepDone:d,settings:l,scannerTypeCons:i4},f))))};function F4(e){var t=e.sdkAdapter;return t instanceof eF?dv.createElement(M4,og({sdkAdapter:t},e)):dv.createElement(D4,e)}M4.propTypes={clientSettings:Lv.shape({}),onError:Lv.func,onStepDone:Lv.func,logCredentials:Lv.shape({}),readIDCardUIOnlyComponent:Lv.func,uiOnlyComponent:Lv.func,sdkAdapter:Lv.shape({}),steps:Lv.arrayOf(Lv.shape({})),detectIdCard:Lv.func,outputEncryptionSettings:Lv.shape({})},M4.defaultProps={clientSettings:void 0,onError:function(){},onStepDone:function(){},logCredentials:{enable:!0},readIDCardUIOnlyComponent:D4,uiOnlyComponent:e4,sdkAdapter:null,steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var U4={sdkAdapter:Lv.shape({})};F4.propTypes=U4,F4.defaultProps={sdkAdapter:null};var j4=aI.IDCardSide,V4=aI.Errors;function z4(e){return q4.apply(this,arguments)}function q4(){return(q4=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.cardType,o=t.cardSide,a=t.apiClient,i=t.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(o)},!i||!i.key){e.next=4;break}return e.abrupt("return",a.httpClient.post("/v1/images",og({base64:r.encrypted.hex},s),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",a.uploadImage(og({file:r.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H4(e){return K4.apply(this,arguments)}function K4(){return(K4=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.apiClient,o=t.rawString,a=t.outputEncryptionSettings,i={label:"qr_code",metadata:JSON.stringify({raw:o})},!a||!a.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",og({base64:r.encrypted.hex},i),{"X-TV-Key":a.key}));case 4:return e.abrupt("return",n.uploadImage(og({file:r.blob},i)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W4(e){return G4.apply(this,arguments)}function G4(){return(G4=$m(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.imageId,n=t.cardType,o=t.apiClient,e.abrupt("return",o.requestVerifyIDCard({card_type:n,image1:{id:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q4(e){return X4.apply(this,arguments)}function X4(){return(X4=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.cardType,o=t.frontCardId,a=t.isCapturingFrontSide,i=t.backCardId,s=t.recordedVideos,c=t.qrImageId,u=s.filter((function(e){return null!==e.id})),l=s.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=5,Promise.all(l.map((function(e){return r.fileService.request({frames:e.frames})})));case 5:return d=e.sent,f={card_type:n,image:{id:o},image2:a?void 0:{id:i},videos:[].concat(mg(u.map((function(e){return{id:e.id}}))),mg(d.map((function(e){return{id:e.data.file_id}}))))},c&&(f.qr1_images=[{id:c}]),e.abrupt("return",r.detectIDTampering(f));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y4(e){return $4.apply(this,arguments)}function $4(){return($4=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,n=t.apiClient,o=t.frontCardId,a=t.backCardId,i=t.isCapturingFrontSide,s=t.qrImageId,c={card_type:r,image1:i?{id:o}:{id:a}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Z4(e){return J4.apply(this,arguments)}function J4(){return(J4=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,o=t.frontCardId,a=t.qrImageId,i=t.onError,s=t.recordedVideos,c=t.apiClient,u=t.cardType,l=t.cardSide,d=t.qrScannedResult,f=t.outputEncryptionSettings,l!==j4.BACK||o){e.next=4;break}return i(V4.missing_front_id_card),e.abrupt("return");case 4:return p=[z4({image:n,cardType:u,cardSide:l,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&p.push(H4({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(p);case 8:if(h=e.sent,m=hg(h,2),g=m[0],v=m[1],!g.errors){e.next=15;break}return i(og(og({},V4.upload_error),{},{details:g.errors})),e.abrupt("return");case 15:return y=g.data.image_id,b=(null==v||null===(r=v.data)||void 0===r?void 0:r.image_id)||a,(C=l===j4.FRONT)?w=y:(w=o,k=y),e.next=21,W4({imageId:y,cardType:u,apiClient:c});case 21:if(!(E=e.sent).errors){e.next=25;break}return i(og(og({},V4.sanity_check_error),{},{details:E.errors})),e.abrupt("return");case 25:return e.next=27,Y4({cardType:u,apiClient:c,frontCardId:w,backCardId:k,isCapturingFrontSide:C,qrImageId:b});case 27:if(!(S=e.sent).errors){e.next=31;break}return i(og(og({},V4.read_id_card_error),{},{details:S.errors})),e.abrupt("return");case 31:return e.next=33,Q4({apiClient:c,cardType:u,frontCardId:w,isCapturingFrontSide:C,backCardId:k,recordedVideos:s,qrImageId:b});case 33:if(!(B=e.sent).errors){e.next=37;break}return i(og(og({},V4.detect_id_tampering_error),{},{details:B.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:E.data,tamperingInfo:B.data,cardInfo:S.data,qrImageId:b});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var e8=["readIDCardUIOnlyComponent"],t8=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],r8=aI.Errors,n8=function(e){var t=e.readIDCardUIOnlyComponent,r=lg(e,e8),n=r.onError,o=r.onStepDone,a=r.apiCredentials,i=r.logCredentials,s=r.outputEncryptionSettings,c=lg(r,t8),u=hg(dv.useState(null),2),l=u[0],d=u[1],f=$D.useApiClient({apiCredentials:a,logCredentials:i}).apiClient,p=dv.useRef(""),h=dv.useRef("");dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.clientSettings();case 2:t=e.sent,d(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[f]);var m=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,a,i,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,a=t.cardSide,i=t.recordedVideos,c=t.qrScannedResult,u=t.image,l=null,e.prev=2,e.next=5,Z4({image:u,cardSide:a,frontCardId:p.current,qrImageId:h.current,onError:n,apiClient:f,cardType:r,recordedVideos:i,qrScannedResult:c,outputEncryptionSettings:s});case 5:l=e.sent,a===aI.IDCardSide.FRONT&&(p.current=l.cardInfo.image1.id),h.current=l.qrImageId,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n(og(og({},r8.api_call_error),{},{details:e.t0}));case 13:l&&o(og(og({},t),{},{apiResult:l}));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),[f,n,o,s]);return l&&dv.createElement(t,rg({logCredentials:i,onError:n,onStepDone:m,outputEncryptionSettings:s},c,{clientSettings:l}))};function o8(){return(o8=$m(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.tfScriptUrls,a=t.blazefaceModelUrl,i=t.closeEyesModelUrl,s=new u1,e.prev=2,SL.loadTensorFlow(o).then((function(){SL.loadBlazefaceModel({modelUrl:a})})),e.next=6,Promise.all([t$({closeEyesModelUrl:i}),s.loadResource({modelUrl:n}),o1({url:r})]);case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}n8.propTypes={onError:Lv.func,onStepDone:Lv.func,apiCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string}),logCredentials:Lv.shape({}),outputEncryptionSettings:Lv.shape({}),readIDCardUIOnlyComponent:Lv.func},n8.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:F4};var a8=e$((function(){return o8.apply(this,arguments)})),i8={id_card_sanity:3,portrait_sanity:3,face_liveness_with_card_tampering_ocr:3,compare_faces:3},s8={card_sanity:!0,card_tampering:!0,card_ocr:!0,face_sanity:!0,face_liveness:!0,compare_faces:!0,search_face:!0,index_face:!0},c8="ID_CARD",u8="FACE_LIVENESS",l8="IDLE",d8={},f8={REACH_RETRY_LIMIT:{en:"You have reached the retry limit. Please try again later.",vi:"Bạn đã vượt quá số lần thử. Vui lòng thử lại sau."},FAIL_STEP:{en:"Please try again at step: <%= step %>.",vi:"Vui lòng thử lại ở bước: <%= step %>."},FAIL_FRONT_CARD_SANITY:{en:"The front side of your ID card failed sanity check.",vi:"Hình ảnh Mặt trước của GTTT không đạt chất lượng yêu cầu."},FAIL_FRONT_CARD_TAMPERING:{en:"The front side of your ID card failed tampering check.",vi:"Hình ảnh Mặt trước của GTTT không hợp lệ."},FAIL_FRONT_CARD_OCR:{en:"Cannot read information on the front side of your ID card.",vi:"Không đọc được thông tin từ hình ảnh Mặt trước của GTTT."},FAIL_BACK_CARD_SANITY:{en:"The back side of your ID card failed sanity check.",vi:"Hình ảnh Mặt sau của GTTT không đạt chất lượng yêu cầu."},FAIL_BACK_CARD_TAMPERING:{en:"The back side of your ID card failed tampering check.",vi:"Hình ảnh Mặt sau của GTTT không hợp lệ."},FAIL_BACK_CARD_OCR:{en:"Cannot read information on the back side of your ID card.",vi:"Không đọc được thông tin từ hình ảnh Mặt sau của GTTT."},FAIL_FACE_SANITY:{en:"Selfie step failed sanity check.",vi:"Hình ảnh khuôn mặt không đạt chất lượng yêu cầu."},FAIL_FACE_LIVENESS:{en:"Selfie step failed liveness check.",vi:"Hình ảnh khuôn mặt không hợp lệ."},FAIL_COMPARE_FACE:{en:"Failed compare faces between ID photo and selfie.",vi:"Hình ảnh khuôn mặt trên GTTT không giống hình chụp chân dung"},RETRY_BUTTON:{en:"Retry",vi:"Thử lại"},STOP_BUTTON:{en:"Stop",vi:"Dừng"},FRONT_CARD:{en:"Front Card",vi:"Mặt trước"},BACK_CARD:{en:"Back Card",vi:"Mặt sau"},ID_CARD:{en:"ID Card",vi:"Thẻ ID"},FACE_LIVENESS:{en:"Face Liveness",vi:"Nhận diện khuôn mặt"}},p8=$Q((function(e,t,r,n){P4(e,t,r,n)})),h8=["restartSession"],m8=["detectIDTamperingBackground","readIDCardBackground"],g8=["restartSession"],v8=["detectIDTamperingBackground","readIDCardBackground"];function y8(e){if(!function(e){return"object"===Xm(e)&&"function"==typeof e.then}(e))return"pending";var t={};return Promise.race([e,t]).then((function(e){return e===t?"pending":"fulfilled"}),(function(){return"rejected"}))}var b8,w8,k8,C8=function(e,t){return null===t?e:t},E8=function(e,t){if(!GY(t,"face_sanity"))return!1;var r=GY(e,"verifyFacePortraitResult.status",""),n=GY(e,"verifyFacePortraitResult.portrait_sanity.verdict","");return"success"!==r||"good"!==n},S8=function(){var e=$m(regeneratorRuntime.mark((function e(t,r,n){var o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x,T,A,I,P,R,N,O,D,L,M,F,U,j,V,z,q,H;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=!1,!GY(r,"card_tampering")){e.next=29;break}return a=GY(t.current,"frontCard.apiResult.detectIDTamperingBackground"),e.next=5,y8(a);case 5:if("fulfilled"!==e.sent){e.next=15;break}return e.next=9,GY(t.current,"frontCard.apiResult.detectIDTamperingBackground");case 9:d=e.sent,f=d.result,p=d.message,h=x8(f,r),t.current=og(og({},t.current),{},{frontCard:og(og({},null!==(i=null===(s=t.current)||void 0===s?void 0:s.frontCard)&&void 0!==i?i:{}),{},{apiResult:og(og({},null!==(c=null===(u=t.current)||void 0===u||null===(l=u.frontCard)||void 0===l?void 0:l.apiResult)&&void 0!==c?c:{}),{},{tamperingInfo:og(og({},null==f?void 0:f.data),{},{message:GY(p,h?"error":"success")})})})}),o=o||h;case 15:if(!n){e.next=29;break}return m=GY(t.current,"backCard.apiResult.detectIDTamperingBackground"),e.next=19,y8(m);case 19:if("fulfilled"!==e.sent){e.next=29;break}return e.next=23,GY(t.current,"backCard.apiResult.detectIDTamperingBackground");case 23:k=e.sent,C=k.result,E=k.message,S=x8(C,r),t.current=og(og({},t.current),{},{backCard:og(og({},null!==(g=null===(v=t.current)||void 0===v?void 0:v.backCard)&&void 0!==g?g:{}),{},{apiResult:og(og({},null!==(y=null===(b=t.current)||void 0===b||null===(w=b.backCard)||void 0===w?void 0:w.apiResult)&&void 0!==y?y:{}),{},{tamperingInfo:og(og({},null==C?void 0:C.data),{},{message:GY(E,S?"error":"success")})})})}),o=o||S;case 29:if(!GY(r,"card_ocr")){e.next=57;break}return B=GY(t.current,"frontCard.apiResult.readIDCardBackground"),e.next=33,y8(B);case 33:if("fulfilled"!==e.sent){e.next=43;break}return e.next=37,GY(t.current,"frontCard.apiResult.readIDCardBackground");case 37:P=e.sent,R=P.result,N=P.message,O="success"===GY(R,"data.status",""),t.current=og(og({},t.current),{},{frontCard:og(og({},null!==(_=null===(x=t.current)||void 0===x?void 0:x.frontCard)&&void 0!==_?_:{}),{},{apiResult:og(og({},null!==(T=null===(A=t.current)||void 0===A||null===(I=A.frontCard)||void 0===I?void 0:I.apiResult)&&void 0!==T?T:{}),{},{cardInfo:og(og({},null==R?void 0:R.data),{},{message:GY(N,O?"success":"error")})})})}),o=o||x8(R,r);case 43:if(!n){e.next=57;break}return D=GY(t.current,"backCard.apiResult.readIDCardBackground"),e.next=47,y8(D);case 47:if("fulfilled"!==e.sent){e.next=57;break}return e.next=51,GY(t.current,"backCard.apiResult.readIDCardBackground");case 51:V=e.sent,z=V.result,q=V.message,H="success"===GY(z,"data.status",""),t.current=og(og({},t.current),{},{backCard:og(og({},null!==(L=null===(M=t.current)||void 0===M?void 0:M.backCard)&&void 0!==L?L:{}),{},{apiResult:og(og({},null!==(F=null===(U=t.current)||void 0===U||null===(j=U.backCard)||void 0===j?void 0:j.apiResult)&&void 0!==F?F:{}),{},{cardInfo:og(og({},null==z?void 0:z.data),{},{message:GY(q,H?"success":"error")})})})}),o=o||x8(z,r);case 57:return e.abrupt("return",o);case 58:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),B8=function(e){var t=GY(e,"verifyFaceLivenessResult.is_live",!1),r=GY(e,"verifyFaceLivenessResult.status","");return!t||"success"!==r},_8=function(e,t){if(!GY(t,"card_sanity"))return!1;var r=GY(e,"apiResult.sanityResult.status",""),n=GY(e,"apiResult.sanityResult.card_sanity.verdict","");return"success"!==r||"good"!==n},x8=function(e,t){return!!GY(e,"errors")||(GY(t,"card_tampering")&&Object.prototype.hasOwnProperty.call(null==e?void 0:e.data,"card_tampering")?"success"!==GY(e,"data.status","")||"good"!==GY(e,"data.card_tampering.verdict",""):!(!GY(t,"card_ocr")||!Object.prototype.hasOwnProperty.call(null==e?void 0:e.data,"card_information"))&&"success"!==GY(e,"data.status",""))},T8=function(e){var t,r=GY(e,"compare_faces",[]);return"matched"!==(null===(t=r[0])||void 0===t?void 0:t.result)||1!==r.filter((function(e){return"matched"===(null==e?void 0:e.result)})).length||e.errors},A8=function(){var e=$m(regeneratorRuntime.mark((function e(t,r,n){var o,a,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=!1,!GY(r,"card_tampering")){e.next=18;break}return e.next=4,GY(t.current,"frontCard.apiResult.detectIDTamperingBackground");case 4:if(a=e.sent,i=a.result,s=a.message,c=x8(i,r),o=o||c,t.current=og(og({},t.current),{},{frontCard:og(og({},t.current.frontCard),{},{apiResult:og(og({},t.current.frontCard.apiResult),{},{tamperingInfo:og(og({},null==i?void 0:i.data),{},{message:GY(s,c?"error":"success")})})})}),!n){e.next=18;break}return e.next=13,GY(t.current,"backCard.apiResult.detectIDTamperingBackground");case 13:u=e.sent,l=u.result,d=x8(l,r),o=o||d,t.current=og(og({},t.current),{},{backCard:og(og({},t.current.backCard),{},{apiResult:og(og({},t.current.backCard.apiResult),{},{tamperingInfo:og(og({},null==l?void 0:l.data),{},{message:GY(s,d?"error":"success")})})})});case 18:if(!GY(r,"card_ocr")){e.next=35;break}return e.next=21,GY(t.current,"frontCard.apiResult.readIDCardBackground");case 21:if(f=e.sent,p=f.result,h=f.message,m="success"===GY(p,"data.status",""),o=o||!m,t.current=og(og({},t.current),{},{frontCard:og(og({},t.current.frontCard),{},{apiResult:og(og({},t.current.frontCard.apiResult),{},{cardInfo:og(og({},null==p?void 0:p.data),{},{message:GY(h,m?"success":"error")})})})}),!n){e.next=35;break}return e.next=30,GY(t.current,"backCard.apiResult.readIDCardBackground");case 30:g=e.sent,v=g.result,y="success"===GY(v,"data.status",""),o=o||!y,t.current=og(og({},t.current),{},{backCard:og(og({},t.current.backCard),{},{apiResult:og(og({},t.current.backCard.apiResult),{},{cardInfo:og(og({},null==v?void 0:v.data),{},{message:GY(h,y?"success":"error")})})})});case 35:return e.abrupt("return",o);case 36:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),I8=function e(t){for(var r in t)"message"===r||"step"===r?delete t[r]:"object"===Xm(t[r])&&e(t[r]);return t},P8=function(){var e=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=I8(t.current),n=GY(r,"frontCard",{}),n.restartSession,o=lg(n,h8),a=GY(r,"frontCard.apiResult",{}),a.detectIDTamperingBackground,a.readIDCardBackground,i=lg(a,m8),s=GY(r,"backCard",{}),s.restartSession,c=lg(s,g8),u=GY(r,"backCard.apiResult",{}),u.detectIDTamperingBackground,u.readIDCardBackground,l=lg(u,v8),e.abrupt("return",og(og(og({},r),GY(r,"frontCard",null)?{frontCard:og(og({},o),{},{apiResult:i})}:{}),GY(r,"backCard",null)?{backCard:og(og({},c),{},{apiResult:l})}:{}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),R8=function(e,t,r){var n=[];if(GY(e,"frontCard.apiResult.sanityResult")&&"good"!==GY(e,"frontCard.apiResult.sanityResult.card_sanity.verdict","")){var o=GY(e,"frontCard.apiResult.sanityResult.message",null);null!=o&&o[r]?n.push(o[r]):n.push(f8.FAIL_FRONT_CARD_SANITY[r])}if(GY(e,"frontCard.apiResult.tamperingInfo")&&"good"!==GY(e,"frontCard.apiResult.tamperingInfo.card_tampering.verdict","")){var a=GY(e,"frontCard.apiResult.tamperingInfo.message",null);null!=a&&a[r]?n.push(a[r]):n.push(f8.FAIL_FRONT_CARD_TAMPERING[r])}if(GY(e,"frontCard.apiResult.cardInfo")&&"success"!==GY(e,"frontCard.apiResult.cardInfo.status","")){var i=GY(e,"frontCard.apiResult.cardInfo.message",null);null!=i&&i[r]?n.push(i[r]):n.push(f8.FAIL_FRONT_CARD_OCR[r])}if(GY(e,"backCard.apiResult.sanityResult")&&"good"!==GY(e,"backCard.apiResult.sanityResult.card_sanity.verdict","")){var s=GY(e,"backCard.apiResult.sanityResult.message",null);null!=s&&s[r]?n.push(s[r]):n.push(f8.FAIL_BACK_CARD_SANITY[r])}if(GY(e,"backCard.apiResult.tamperingInfo")&&"good"!==GY(e,"backCard.apiResult.tamperingInfo.card_tampering.verdict","")){var c=GY(e,"backCard.apiResult.tamperingInfo.message",null);null!=c&&c[r]?n.push(c[r]):n.push(f8.FAIL_BACK_CARD_TAMPERING[r])}if(GY(e,"backCard.apiResult.cardInfo")&&"success"!==GY(e,"backCard.apiResult.cardInfo.status","")){var u=GY(e,"backCard.apiResult.cardInfo.message",null);null!=u&&u[r]?n.push(u[r]):n.push(f8.FAIL_BACK_CARD_OCR[r])}if(GY(e,"faceLiveness.verifyFacePortraitResult")&&"good"!==GY(e,"faceLiveness.verifyFacePortraitResult.portrait_sanity.verdict","")){var l=GY(e,"faceLiveness.verifyFacePortraitResult.message",null);null!=l&&l[r]?n.push(l[r]):n.push(f8.FAIL_FACE_SANITY[r])}if(GY(e,"faceLiveness.verifyFaceLivenessResult")&&!GY(e,"faceLiveness.verifyFaceLivenessResult.is_live",!1)){var d=GY(e,"faceLiveness.verifyFaceLivenessResult.message",null);null!=d&&d[r]?n.push(d[r]):n.push(f8.FAIL_FACE_LIVENESS[r])}if(GY(e,"compareFaces",null)&&T8(GY(e,"compareFaces"))){var f=GY(e,"compareFaces.message",null);null!=f&&f[r]?n.push(f[r]):n.push(f8.FAIL_COMPARE_FACE[r])}return{retryAt:t,results:n}},N8=function(e){var t=GY(e,"frontCard.apiResult.cardInfo.card_information",[]).find((function(e){return"id"===e.field}));return GY(t,"value","")},O8=["livenessMode","sdkAdapter","onError","services","hasBackCard"],D8=aI.Errors,L8=aI.IDCardSide,M8=aI.FaceDirection,F8=aI.Mode;function U8(e){return j8.apply(this,arguments)}function j8(){return(j8=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E,S,B,_,x,T,A,I,P,R,N,O,D,L,M,F,U,j,V,z,q;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.hasBackCard,a=t.stepResult,i=t.frontCardId,s=t.qrImageId,c=t.sdkAdapter,u=t.onError,l=t.checkFinishAndFailCardTamperingOrOCR,d=t.refEkycResult,f=t.handleFailCardTamperingOCRBackground,p=t.services,c instanceof eF){e.next=3;break}return e.abrupt("return",a);case 3:if(h=a.cardSide,m=a.cardType,g=a.recordedVideos,v=a.qrScannedResult,y=a.image,h!==L8.BACK||i){e.next=7;break}return u(D8.missing_front_id_card),e.abrupt("return",!1);case 7:return b=c.uploadImage,w=c.uploadFiles,k=c.requestVerifyIDCard,C=c.detectIDTampering,E=c.readIDCard,S=[b({file:null==y?void 0:y.blob,label:"id_card.".concat(m,".").concat(h)})],v&&v.image&&v.result&&S.push(b({file:v.image.blob,label:"qr_code",rawString:v.result})),e.next=12,Promise.all(S);case 12:if(B=e.sent,_=hg(B,2),x=_[0],T=_[1],!x.errors){e.next=19;break}return u(og(og({},D8.upload_error),{},{details:x.reason})),e.abrupt("return",!1);case 19:if(A=null==x||null===(r=x.data)||void 0===r?void 0:r.image_id,I=(null==T||null===(n=T.data)||void 0===n?void 0:n.image_data)||s,h===L8.FRONT?P=A:(P=i,R=A),N={qrImageId:I,frontCardId:P,backCardId:R},!GY(p,"card_sanity")){e.next=32;break}return e.next=26,k({card_type:m,image1:{id:h===L8.FRONT?P:R}});case 26:if(O=e.sent,D=O.result,L=O.message,"good"===GY(D,"data.card_sanity.verdict","")&&!D.errors){e.next=31;break}return e.abrupt("return",og(og({},a),{},{apiResult:og(og({},N),{},{sanityResult:og(og({},null==D?void 0:D.data),{},{message:GY(L,"error")}),failSanity:!0})}));case 31:N=og(og({},N),{},{sanityResult:og(og({},null==D?void 0:D.data),{},{message:GY(L,"success")})});case 32:if(h!==L8.BACK){e.next=40;break}if("function"!=typeof l||"function"!=typeof f){e.next=40;break}return e.next=36,l(d,p,o);case 36:if(!e.sent){e.next=40;break}return f(),e.abrupt("return",og(og({},a),{},{apiResult:og(og({},N),{},{failSanity:!0})}));case 40:if(!GY(p,"card_tampering")){e.next=51;break}if(F=og({card_type:m,image:{id:P}},h===L8.FRONT?{image2:void 0,level:"1"}:{image2:{id:R},level:"concurrent"}),I&&(F.qr1_images=[{id:I}]),!(g.length>0)){e.next=50;break}return U=g.filter((function(e){return null!==e.id})),j=g.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=48,Promise.all(j.map((function(e){return w({frames:e.frames})})));case 48:V=e.sent,F.videos=[].concat(mg(U.map((function(e){return{id:e.id}}))),mg(V.map((function(e){return{id:e.data.file_id}}))));case 50:M=C(F);case 51:return GY(p,"card_ocr")&&(q={card_type:m,image1:h===L8.FRONT?{id:P}:{id:R}},I&&(q.qr1_images={id:I}),z=E(q)),e.abrupt("return",og(og({},a),{},{apiResult:og(og({},N),{},{detectIDTamperingBackground:M,readIDCardBackground:z})}));case 53:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V8(e){return z8.apply(this,arguments)}function z8(){return(z8=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepResult,n=t.sdkAdapter,o=t.services,a=r.faceVerificationFlowData,i=r.captureFrameSettings,s=r.capturedFrames,c=n.uploadImage,u=n.verifyFaceLiveness,l=n.requestVerifyPortrait,d=a.current.steps,f=[],d.forEach((function(e){var t=e.name,r=e.image,n=e.frontalFaceImage;t!==M8.FRONTAL?f.push(c({file:r.blob,label:"portrait",metadata:JSON.stringify({gesture_score:r.leftRightScore,gesture:t})})):f.push(Promise.resolve({data:{image_id:null}})),n.blob?f.push(c({file:n.blob,label:"portrait",metadata:JSON.stringify({gesture_score:n.leftRightScore,gesture:M8.FRONTAL})})):f.push(Promise.resolve({data:{image_id:null}}))})),e.next=8,Promise.all(f);case 8:if(p=e.sent,d.forEach((function(e,t){e.image.imageId=p[2*t].data.image_id,e.frontalFaceImage.imageId=p[2*t+1].data.image_id})),0!==(h=d.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=13;break}return e.abrupt("return",{error:"wrong_face_movement"});case 13:return e.next=15,u$();case 15:if(m=l$(i)){e.next=18;break}return e.abrupt("return",{error:"network_error"});case 18:if(g={frontalFaces:h.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:d.filter((function(e){return e.image.imageId&&e.name!==M8.FRONTAL})).map((function(e){var t=e.name,r=e.image;return{name:t,blob:r.blob,id:r.imageId}})),capturedFrames:s},!GY(o,"face_sanity")){e.next=28;break}return e.next=22,l({image:{id:h[h.length-1].frontalFaceImage.imageId}});case 22:if(v=e.sent,y=v.result,b=v.message,"good"===GY(y,"data.portrait_sanity.verdict","")&&!GY(y,"errors")){e.next=27;break}return e.abrupt("return",og(og({},g),{},{verifyFacePortraitResult:og(og({},y.data),{},{message:GY(b,"error")})}));case 27:g=og(og({},g),{},{verifyFacePortraitResult:og(og({},y.data),{},{message:GY(b,"success")})});case 28:if(!GY(o,"face_liveness")){e.next=36;break}return e.next=31,u({images:h.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:d.filter((function(e){return e.image.imageId&&e.name!==M8.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:m});case 31:w=e.sent,k=w.result,C=w.message,E=GY(k,"data.is_live"),g=og(og({},g),{},{verifyFaceLivenessResult:og(og({},k.data),{},{message:GY(C,E?"success":"error")})});case 36:return e.abrupt("return",g);case 37:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q8(e){return H8.apply(this,arguments)}function H8(){return(H8=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepResult,n=t.sdkAdapter,o=t.services,a=r.imageAddedExif,i=r.frontalFaceImages,s=r.capturedFrames,c=n.uploadImage,u=n.verifyFaceLiveness,l=n.requestVerifyPortrait,d=i.map((function(e,t){return c({file:a[t],label:"portrait",metadata:{gesture_score:e.leftRightScore,gesture:M8.FRONTAL}})})),e.next=6,Promise.all(d);case 6:if(f=e.sent,p=f.map((function(e){var t;return{id:null==e||null===(t=e.data)||void 0===t?void 0:t.image_id}})),h={images:p,capturedFrames:s,frontalFaces:a.map((function(e,t){var r;return{blob:e,id:null===(r=p[t])||void 0===r?void 0:r.id}}))},!GY(o,"face_sanity")){e.next=17;break}return e.next=12,l({image:{id:p[p.length-1].id}});case 12:if(m=e.sent,g=m.result,"good"===GY(g,"data.portrait_sanity.verdict","")&&!GY(g,"errors")){e.next=16;break}return e.abrupt("return",og(og({},r),{},{verifyFacePortraitResult:g.data}));case 16:h=og(og({},h),{},{verifyFacePortraitResult:g.data});case 17:return e.next=19,u({images:p.map((function(e){return{id:e.id}}))});case 19:return v=e.sent,y=v.result,e.abrupt("return",og(og({},h),{},{verifyFaceLivenessResult:y.data}));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K8(e){return W8.apply(this,arguments)}function W8(){return(W8=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.stepResult,n=t.sdkAdapter,o=t.services,(a=r.mode)!==F8.ACTIVE){e.next=4;break}return e.abrupt("return",V8({stepResult:r,sdkAdapter:n,services:o}));case 4:if(a!==F8.PASSIVE){e.next=6;break}return e.abrupt("return",q8({stepResult:r,sdkAdapter:n,services:o}));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G8(e){return Q8.apply(this,arguments)}function Q8(){return(Q8=$m(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.livenessMode,n=t.sdkAdapter,t.onError,o=t.services,a=t.hasBackCard,i=lg(t,O8),n instanceof eF){e.next=3;break}return e.abrupt("return",i);case 3:if(s=n.compareFaces,c=n.searchFaces,u=n.indexFaces,l=GY(t,"frontCard.apiResult.frontCardId",null),d=GY(t,"backCard.apiResult.backCardId",null),f=null,p=GY(t,"faceLiveness.frontalFaces",[]),f=null===(r=p[p.length-1])||void 0===r?void 0:r.id,l&&(!a||d)&&f){e.next=11;break}return e.abrupt("return");case 11:if(h=og({},i),!GY(o,"compare_faces")){e.next=21;break}return e.next=15,s({image1:{id:l},image2:{id:f}});case 15:if(m=e.sent,g=m.result,v=m.message,!T8(GY(g,"data"))){e.next=20;break}return e.abrupt("return",og(og({},h),{},{step:c8,compareFaces:og(og({},null==g?void 0:g.data),{},{message:v})}));case 20:h=og(og({},h),{},{compareFaces:og(og({},null==g?void 0:g.data),{},{message:v})});case 21:if(!GY(o,"search_face")){e.next=30;break}return e.next=24,c({image:{id:f}});case 24:if(y=e.sent,b=y.result,!((w=GY(b,"data.faces",null))||Array.isArray(w)&&w.length)){e.next=29;break}return e.abrupt("return",og(og({},h),{},{searchFaces:null==b?void 0:b.data}));case 29:h=og(og({},h),{},{searchFaces:null==b?void 0:b.data});case 30:if(!GY(o,"index_face")){e.next=37;break}return k=N8(t),e.next=34,u({image:og({id:f},k?{metadata:JSON.stringify({id:N8(t)})}:{})});case 34:C=e.sent,E=C.result,h=og(og({},h),{},{indexFaces:null==E?void 0:E.data});case 37:return e.abrupt("return",h);case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var X8,Y8,$8=aw.div(b8||(b8=pg(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Z8=aw.button(w8||(w8=pg(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: #0276f1;\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"]))),J8=aw.div(k8||(k8=pg(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),e6=function(e){var t=e.onRetry,r=e.onStop,n=e.children,o=hN.useSDKSettings().lang;return dv.createElement($8,null,n,dv.createElement(J8,null,dv.createElement(Z8,{onClick:r},f8.STOP_BUTTON[o]),dv.createElement(Z8,{onClick:t},f8.RETRY_BUTTON[o])))};e6.propTypes={children:Lv.node,onRetry:Lv.func,onStop:Lv.func},e6.defaultProps={children:null,onRetry:function(){},onStop:function(){}};var t6=aw.div(X8||(X8=pg(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),r6=aw.button(Y8||(Y8=pg(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: #0276f1;\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"]))),n6=function(e){var t=e.onStop,r=e.children,n=hN.useSDKSettings().lang;return dv.createElement(t6,null,r,dv.createElement(r6,{onClick:t},f8.STOP_BUTTON[n]))};n6.propTypes={children:Lv.node,onStop:Lv.func},n6.defaultProps={children:null,onStop:function(){}};var o6="FAIL_CARD_SANITY",a6="FAIL_FACE_SANITY",i6="FAIL_LIVENESS_TAMPERING_OCR_RETRY_ID",s6="FAIL_LIVENESS_TAMPERING_OCR_RETRY_FACE",c6="FAIL_COMPARE_FACES",u6="RESET_ACTIONS",l6="SET_STEP",d6={currentStep:null,readIdCardKey:0,faceLivenessKey:0,cardSanityTrials:-1,compareFacesTrials:-1,portraitSanityTrials:-1,faceLivenessCardTamperingOCRTrials:-1};function f6(e,t){switch(t.type){case o6:return og(og({},e),{},{cardSanityTrials:e.cardSanityTrials+1});case a6:return og(og({},e),{},{portraitSanityTrials:e.portraitSanityTrials+1,faceLivenessKey:e.faceLivenessKey+1});case i6:return og(og({},e),{},{readIdCardKey:e.readIdCardKey+1,faceLivenessCardTamperingOCRTrials:e.faceLivenessCardTamperingOCRTrials+1,currentStep:c8});case s6:return og(og({},e),{},{faceLivenessKey:e.faceLivenessKey+1,faceLivenessCardTamperingOCRTrials:e.faceLivenessCardTamperingOCRTrials+1,currentStep:u8});case c6:return og(og({},e),{},{compareFacesTrials:e.compareFacesTrials+1,readIdCardKey:e.readIdCardKey+1,faceLivenessKey:e.faceLivenessKey+1,currentStep:c8});case l6:return og(og({},e),{},{currentStep:t.payload});case u6:return d6;default:return e}}var p6=aI.IDCardSide,h6=aI.Errors,m6={padding:50,paddingBottom:20},g6=function(e){var t=e.content,r=e.lang,n=e.isStopPopup,o=void 0!==n&&n;return dv.createElement(dv.Fragment,null,dv.createElement("div",{style:m6},t.results.map((function(e,t){return dv.createElement("div",{key:t},e)}))),o?null:dv.createElement("div",{style:{padding:50,paddingBottom:0,color:"red"}},function(e,t){var r=Array.isArray(t)?t.map((function(t){return f8[t][e]})).join(", "):f8[t][e];return iY(f8.FAIL_STEP[e])({step:r})}(r,t.retryAt)))};function v6(e){var t=hN.useSDKSettings().lang,r=e.onDoneEkyc,n=e.readIDCardProps,o=e.livenessDetectionProps,a=e.onError,i=e.onClose,s=e.sdkAdapter,c=e.flow,u=void 0===c?aI.EkycFlow.FULL_FLOW:c,l=s.clientSettings,d=hg(dv.useState(!1),2),f=d[0],p=d[1],h=hg(dv.useState(!1),2),m=h[0],g=h[1],v=hg(dv.useState(null),2),y=v[0],b=v[1],w=hg(dv.useState(!1),2),k=w[0],C=w[1],E=hg(dv.useReducer(f6,d6),2),S=E[0],B=E[1],_=S.currentStep,x=S.readIdCardKey,T=S.faceLivenessKey,A=S.cardSanityTrials,I=S.compareFacesTrials,P=S.portraitSanityTrials,R=S.faceLivenessCardTamperingOCRTrials,N=dv.useRef(d8),O=dv.useRef(),D=dv.useRef(),L=dv.useRef(),M=dv.useRef(""),F=dv.useRef(""),U=dv.useMemo((function(){return function(e){var t=GY(e,"data.settings.sdk_settings.sdk_adapter.services",null),r=GY(e,"data.settings.sdk_settings.sdk_adapter.retries",null),n=p8(s8,t,C8),o=p8(i8,r,C8);return{cardSanityRetries:o.id_card_sanity,portraitSanityRetries:o.portrait_sanity,faceLivenessCardTamperingOCRRetries:o.face_liveness_with_card_tampering_ocr,compareFacesRetries:o.compare_faces,services:n}}(y)}),[y]),j=U.cardSanityRetries,V=U.portraitSanityRetries,z=U.faceLivenessCardTamperingOCRRetries,q=U.compareFacesRetries,H=U.services,K=dv.useMemo((function(){return u===aI.EkycFlow.FULL_FLOW||u===aI.EkycFlow.ID_CARD}),[u]),W=dv.useMemo((function(){return u===aI.EkycFlow.FULL_FLOW||u===aI.EkycFlow.FACE}),[u]),G=GY(y,"data.card_types[0].has_back_side",!0),Q=2===GY(n,"steps",[]).length||G;dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l();case 2:t=e.sent,b(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[l,s]),dv.useEffect((function(){B(K?{type:l6,payload:c8}:{type:l6,payload:u8})}),[K]),dv.useEffect((function(){(A>=j||P>=V||I>=q||R>=z)&&g(!0)}),[j,A,I,q,V,P,z,R,r]);var X=dv.useCallback((function(){B({type:"RESET_ACTIONS"}),p(!1),g(!1),N.current=d8,O.current=null,D.current=null}),[]);dv.useEffect((function(){return function(){return X()}}),[X]);var Y=dv.useCallback((function(){A+1<j?(D.current=R8(N.current,c8,t),O.current=function(){B({type:o6}),C(!1),"function"==typeof L.current&&L.current()},p(!0)):g(!0)}),[j,A,t]),$=dv.useCallback((function(){R+1<z?(D.current=R8(N.current,c8,t),O.current=function(){B({type:i6}),C(!1)},p(!0)):g(!0)}),[z,R,t]),Z=dv.useCallback((function(){P+1<V?(D.current=R8(N.current,u8,t),O.current=function(){B({type:a6}),C(!1)},p(!0)):g(!0)}),[V,P,t]),J=dv.useCallback((function(e,r){R+1<z?(D.current=R8(N.current,e,t),O.current=e===c8?function(){B({type:i6}),r||(N.current=d8)}:function(){B({type:s6})},p(!0)):g(!0)}),[z,R,t]),ee=dv.useCallback((function(){I+1<q?(D.current=R8(N.current,[c8,u8],t),O.current=function(){B({type:c6}),N.current=d8,C(!1)},p(!0)):g(!0)}),[q,I,t]),te=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!K){e.next=6;break}return e.next=3,A8(N,H,Q);case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",c8);case 6:if(!t){e.next=8;break}return e.abrupt("return",u8);case 8:return e.abrupt("return",!1);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[K,H,Q]),re=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,G8(og(og({},N.current),{},{livenessMode:o.mode,sdkAdapter:s,onError:a,services:H,hasBackCard:Q}));case 3:if(!(t=e.sent)){e.next=12;break}if(N.current=og(og({},N.current),t),!GY(t,"step",null)){e.next=10;break}ee(),e.next=12;break;case 10:return P8(N).then((function(e){r(e)})),e.abrupt("return");case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),a(og(og({},h6.api_call_error),{},{details:e.t0}));case 17:case"end":return e.stop()}}),e,null,[[0,14]])}))),[Q,o.mode,s,a,H,ee,r]),ne=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var n,o,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof GY(t,"restartSession")&&(L.current=t.restartSession),C(!0),_!==c8){e.next=62;break}if(GY(t,"cardSide")!==p6.FRONT){e.next=33;break}return e.next=6,U8({stepResult:t,frontCardId:M.current,qrImageId:F.current,onError:a,sdkAdapter:s,services:H});case 6:if(!(n=e.sent)){e.next=12;break}M.current=n.apiResult.frontCardId,F.current=n.apiResult.qrImageId,e.next=14;break;case 12:return C(!1),e.abrupt("return",!0);case 14:if(N.current=og(og({},N.current),{},{frontCard:n}),!_8(n,H)){e.next=18;break}return Y(),e.abrupt("return",p6.FRONT);case 18:if(Q){e.next=31;break}if(!W){e.next=23;break}B({type:l6,payload:u8}),e.next=31;break;case 23:return e.next=25,A8(N,H,Q);case 25:if(!e.sent){e.next=29;break}return $(),e.abrupt("return");case 29:return P8(N).then((function(e){r(e)})),e.abrupt("return");case 31:e.next=60;break;case 33:if(GY(t,"cardSide")!==p6.BACK){e.next=60;break}return e.next=36,S8(N,H,Q);case 36:if(!e.sent){e.next=41;break}$(),e.next=60;break;case 41:return e.next=43,U8({hasBackCard:Q,stepResult:t,frontCardId:M.current,qrImageId:F.current,sdkAdapter:s,onError:a,refEkycResult:N,services:H,checkFinishAndFailCardTamperingOrOCR:S8,handleFailCardTamperingOCRBackground:$});case 43:if(o=e.sent,N.current=og(og({},N.current),{},{backCard:o}),!_8(o,H)){e.next=48;break}return Y(),e.abrupt("return",p6.BACK);case 48:if(!W){e.next=52;break}B({type:l6,payload:u8}),e.next=60;break;case 52:return e.next=54,A8(N,H,Q);case 54:if(!e.sent){e.next=58;break}return $(),e.abrupt("return");case 58:return P8(N).then((function(e){r(e)})),e.abrupt("return");case 60:e.next=89;break;case 62:if(_!==u8){e.next=89;break}if(!K){e.next=77;break}return e.next=66,S8(N,H,Q);case 66:if(!e.sent){e.next=70;break}return $(),C(!1),e.abrupt("return");case 70:return e.next=72,A8(N,H,Q);case 72:if(!e.sent){e.next=77;break}return B({type:i6}),C(!1),e.abrupt("return");case 77:return e.next=79,K8({stepResult:t,sdkAdapter:s,services:H});case 79:if(i=e.sent,N.current=og(og({},N.current),{},{faceLiveness:i}),!E8(i,H)){e.next=85;break}Z(),e.next=89;break;case 85:return e.next=87,te(B8(i));case 87:(c=e.sent)?J(c,!B8(i)):K?re():P8(N).then((function(e){r(e)}));case 89:C(!1);case 90:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[Q,H,_,s,K,W,r,a,Y,$,Z,te,re,J]),oe=dv.useCallback((function(){p(!1),O.current()}),[]),ae=dv.useCallback((function(){p(!1),g(!1),P8(N).then((function(e){r(e),B({type:l6,payload:l8})}))}),[r]);return dv.createElement(dv.Fragment,null,_===c8?dv.createElement(F4,rg({},n,e,{onStepDone:ne,sdkAdapter:s,onError:a,onClose:i,clientSettings:y,key:x,isLoading:k})):null,_===u8?dv.createElement(E2,rg({},o,e,{onLivenessDetectionDone:ne,sdkAdapter:s,onError:a,onClose:i,clientSettings:y,key:T,isLoading:k})):null,dv.createElement(pZ,{open:f||m},f&&dv.createElement(e6,{onRetry:oe,onStop:ae},dv.createElement(g6,{content:D.current,lang:t})),m&&dv.createElement(n6,{onStop:ae},dv.createElement(g6,{content:D.current,lang:t,isStopPopup:!0}))))}function y6(e){var t=e.logCredentials,r=e.ekycFlowComponent;return dv.createElement(R3,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og({},t)}},dv.createElement(r,e)))}v6.propTypes={sdkAdapter:Lv.shape({}),onDoneEkyc:Lv.func,onError:Lv.func,onClose:Lv.func,readIDCardProps:Lv.shape({}),livenessDetectionProps:Lv.shape({})},v6.defaultProps={sdkAdapter:null,onDoneEkyc:function(){},onError:function(){},onClose:function(){},readIDCardProps:{},livenessDetectionProps:{}},y6.propTypes={logCredentials:Lv.shape({}),clientSettings:Lv.shape({}),ekycFlowComponent:Lv.func},y6.defaultProps={logCredentials:void 0,clientSettings:void 0,ekycFlowComponent:v6};var b6,w6,k6,C6,E6,S6,B6,_6,x6=F$,T6=lg(C3,["useLivenessDetection"]);function A6(e){var t=e.className;return dv.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dv.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}A6.propTypes={className:Lv.string},A6.defaultProps={className:""};var I6,P6,R6,N6,O6,D6,L6,M6,F6,U6,j6=UG,V6=CZ,z6=wZ,q6=YZ.default,H6=T6.FaceDetectionError,K6=T6.FaceVerificationInstructions,W6=T6.FaceVerificationStepsWrapper,G6=T6.StepItem,Q6=T6.BottomButtonsOverlay,X6=T6.Button,Y6=T6.CountDownOverlay,$6=T6.InstructionsOverlay,Z6=T6.CountdownTime,J6=aw(J$)(b6||(b6=pg(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),e9=aw(A6)(w6||(w6=pg(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.color;return null!=t?t:"rgba(0, 0, 0, 0.6)"})),t9=aw.div(k6||(k6=pg(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),r9=aw(K6)(C6||(C6=pg(["\n font-size: 20px;\n"]))),n9=aw($6)(E6||(E6=pg(["\n ",";\n ",";\n"])),z6.default,V6.default),o9=aw(Z6)(S6||(S6=pg(["\n background-color: unset;\n color: #ffffff;\n font-size: 20px;\n"]))),a9=WW.isMobile?{width:640}:null,i9={background:"#000000",opacity:.6};function s9(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,a=e.onError,i=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customStepTimeConstraints,l=e.onProcessing,d=e.customErrors,f=e.customMessages,p=e.livenessSettings,h=e.customInstructions,m=e.apiCredentials,g=QN.useAsset("bg_camera_mask.png"),v=QN.useAsset("bg_camera_mask_red.png"),y=hg(dv.useState({}),2),b=y[0],w=y[1],k=b.yFaceVerificationStepsWrapper,C=hg(dv.useState(""),2),E=C[0],S=C[1],B=hg(dv.useState(!1),2),_=B[0],x=B[1],T=dv.useCallback((function(e){var t=e.lostY,r=e.height,n=t+25,o=n+30;return w({yFaceDetectionError:n,yFaceVerificationStepsWrapper:o+r+20}),{y:Math.floor(o)}}),[]),A=x6({apiCheck:t,mode:r,bgCameraMask:g,bgCameraMaskRed:v,surroundStyle:i9,onLivenessDetectionDone:n,onError:a,cropAreaDimension:T,captureFrameSettings:i,onFramesCaptured:s,livenessSettings:p,setRemainingTime:S,customStepTimeConstraints:u,onProcessing:l,customErrors:d,customMessages:f,customInstructions:h,apiCredentials:m}),I=A.countdownToTakePicture,P=A.cropArea,R=A.curStepIndex,N=A.directionIcon,O=A.faceDetectionError,D=A.handleTriggerPassiveMode,L=A.handleVideoPlayed,M=A.instructions,F=A.isActiveMode,U=A.refVideo,j=A.showCountdown,V=A.steps,z=A.videoPlayed,q=A.directionIconAnimation,H=A.isFirstValidFrameFound,K=A.warmupDone;dv.useEffect((function(){Promise.all(V.map((function(e){return t=e.directionIcon,new Promise((function(e){var r=new Image;r.onload=e,r.onerror=e,r.src=t}));var t}))).then((function(){return x(!0)}))}),[V]);var W=dv.useRef(!1);return dv.useEffect((function(){H||(W.current=!1)}),[H]),O&&"liveness_terminated_time_out"===O.code&&(W.current=!0),dv.createElement(RG,{frontCamera:c,onVideoPlayed:L,onClose:o,flipHorizontal:c,ref:U,videoSettings:a9,onError:a},!K&&dv.createElement(gZ,null),z&&_?dv.createElement(dv.Fragment,null,dv.createElement(q6,{keyForTransition:R}),dv.createElement(H6,{top:k,className:"face-detection-error",error:O}),E&&dv.createElement(o9,{top:P.current.y-20},E),P.current?dv.createElement(FG,{x:"".concat(P.current.x,"px"),y:"".concat(P.current.y,"px"),width:"".concat(P.current.width,"px"),height:"".concat(P.current.height,"px"),surroundStyle:P.current.surroundStyle},dv.createElement(e9,null),dv.createElement(J6,{progress:R/V.length*100,hasError:!!O,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:2,insideRingStrokeDash:"none"}),j?dv.createElement(Y6,null,I):null,F?dv.createElement(n9,null,N?dv.createElement("img",{className:q,src:N,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):null):null,O&&dv.createElement(t9,null)):null,F?dv.createElement(dv.Fragment,null,M?dv.createElement(r9,{top:k-30,className:"instructions"},M):null,H&&!W.current&&dv.createElement(W6,{top:k+35},V.map((function(e,t){var r=e.name,n=e.image.objUrl;return dv.createElement(G6,{key:r,active:R>=t,className:"step-item"},n?dv.createElement("img",{src:n,alt:""}):dv.createElement("span",null,t+1))})))):dv.createElement(dv.Fragment,null,O?null:dv.createElement(Q6,null,dv.createElement(X6,{onClick:D},dv.createElement(j6,null))))):null)}function c9(e){return dv.createElement(E2,rg({},e,{livenessComponent:s9}))}s9.propTypes={apiCheck:Lv.bool,mode:Lv.string,onLivenessDetectionDone:Lv.func,onClose:Lv.func,onError:Lv.func,captureFrameSettings:Lv.shape({}),onFramesCaptured:Lv.func,frontCamera:Lv.bool,customStepTimeConstraints:Lv.shape({}),onProcessing:Lv.func,customErrors:Lv.shape({}),customMessages:Lv.shape({}),livenessSettings:Lv.shape({}),customInstructions:Lv.shape({}),apiCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string})},s9.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customStepTimeConstraints:(B6={},tg(B6,aI.FaceDirection.UP,{delayTime:0}),tg(B6,aI.FaceDirection.LEFT,{delayTime:0}),tg(B6,aI.FaceDirection.RIGHT,{delayTime:0}),tg(B6,aI.FaceDirection.FRONTAL,{delayTime:2e3}),B6),onProcessing:function(){},customErrors:{no_face:{code:"no_face",msg:{en:"Face is not detected.",vi:"Không nhận diện được khuôn mặt."}},multiple_faces:{code:"multiple_faces",msg:{en:"There are more than one face in the frame",vi:"Nhiều khuôn mặt xuất hiện trong khung hình"}},face_too_small:{code:"face_too_small",msg:{en:"The face is too small",vi:"Khuôn mặt quá nhỏ"}},face_too_large:{code:"face_too_large",msg:{en:"The face is too big",vi:"Khuôn mặt quá lớn"}},face_out_of_box:{code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt nằm ngoài khung ảnh"}},liveness_terminated_time_out:{code:"liveness_terminated_time_out",msg:{en:"The face verification need to be completed in <%= x %> seconds.\nPlease try again.",vi:"Xác thực khuôn mặt cần thực hiện trong <%= x %> giây.\nVui lòng thử lại."}}},customMessages:{REMAIN_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Kết thúc sau <%= x %>"}},customInstructions:(_6={},tg(_6,aI.FaceDirection.LEFT,{en:"Please turn to the left",vi:"Vui lòng quay trái"}),tg(_6,aI.FaceDirection.RIGHT,{en:"Please turn to the right",vi:"Vui lòng quay phải"}),tg(_6,aI.FaceDirection.UP,{en:"Please look up",vi:"Vui lòng nhìn lên"}),tg(_6,aI.FaceDirection.FRONTAL,{en:"Please look straight to camera",vi:"Vui lòng nhìn thẳng vào camera"}),_6),livenessSettings:{face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,limit_time_liveness_check:{enable:!0,limit_time_second:45,remain_time_show:15,format:"mm:ss"},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3}},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""}};var u9,l9=yZ,d9=ZZ,f9=YZ,p9=l9.animationDuration,h9=f9.default,m9=aw.div(I6||(I6=pg(["\n ","\n ","\n"])),l9.default,d9.default),g9=aw.img(P6||(P6=pg(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),v9=aw.div(R6||(R6=pg(["\n cursor: pointer;\n text-align: center;\n width: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),60,1020,WW.isMobile?Hb(["top:",";"],(function(e){return e.y})):Hb(["bottom:","px;"],10)),y9=function(){return dv.createElement("div",{className:"box_loader",id:"vib-v2018-loading"},dv.createElement("div",{className:"loader"},dv.createElement("div",{className:"inner one"}),dv.createElement("div",{className:"inner two"}),dv.createElement("div",{className:"inner three"})))},b9=aw.div(N6||(N6=pg(["\n color: #fff;\n text-align: center;\n"]))),w9=aw.div(O6||(O6=pg(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),k9=aw.div(D6||(D6=pg(["\n display: flex;\n align-items: center;\n"]))),C9=aw(b9)(L6||(L6=pg(["\n font-size: 16px;\n margin-left: 10px;\n color: #fff;\n"]))),E9=aw.div(M6||(M6=pg(["\n margin: 0 auto;\n padding: 0 5px;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),S9=aw(b9)(F6||(F6=pg(["\n text-align: center;\n background: ",";\n padding: 5px 10px;\n font-size: 18px;\n"])),(function(e){return e.theme.dangerColor})),B9=function(e){var t=e.children,r=e.y;return dv.createElement(E9,{y:r},dv.createElement(S9,null,t))},_9=aw(tJ)(U6||(U6=pg(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),x9=aI.Errors,T9={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},A9=og(og({},x9),{},{id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Take a photo of your ID card's <%= side %> side. Make sure the image of the card fits in the frame, (minimum 50% of frame).",vi:"Mặt <%= side %> CMND/CCCD cần nằm gọn trong khung hình, chiếm tối thiểu 50%."}},id_detector_validate_angle_error:{code:"id_detector_validate_angle_error",msg:{en:"Please put your ID card straight, not be oblique",vi:"Vui lòng đặt giấy tờ thẳng góc, không bị xô lệch khi chụp"}},id_detector_card_too_small:{code:"id_detector_card_too_small",msg:{en:"Please hold your ID card closer",vi:"Vui lòng đưa CMND/CCCD lại gần hơn"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please hold your ID card further",vi:"Vui lòng đưa CMND/CCCD ra xa hơn"}},id_detector_error_front_side_no_faces:{code:"id_detector_error_front_side_no_faces",msg:{en:"Take a photo of your ID card's front side",vi:"Vui lòng chụp ảnh mặt trước của CMND/CCCD"}},id_detector_error_front_side_multiple_faces:{code:"id_detector_error_front_side_multiple_faces",msg:{en:"Please remove other items out of the frame",vi:"Vui lòng không để lẫn vật thể khác trong khung chụp hình"}},glare_detected:{code:"glare_detected",msg:{en:"Your photo ID is glare. Please adjust the shooting angle.",vi:"Ảnh chụp bị lóa sáng. Vui lòng chụp lại"}}}),I9=dv.forwardRef((function(e,t){var r,n=e.usePortraitMask,o=e.windowAndVideoInfo,a=e.refVideo,i=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=hg(dv.useState({}),2),f=d[0],p=d[1],h=f.yErrorMessage,m=f.yCaptureButton,g=QN.useAsset("ic_camera.svg"),v=hN.useSDKSettings().lang,y=hg(dv.useState(""),2),b=y[0],w=y[1],k=hg(dv.useState(null),2),C=k[0],E=k[1],S=_L.useThemeContext().dangerColor,B=dv.useRef((function(){})),_=dv.useCallback((function(e){w(null===e?"":iY(A9[e.code].msg[v])({side:i?T9.FRONT[v]:T9.BACK[v]}))}),[v,i]),x=dv.useCallback((function(){B.current()}),[]),T=I1({shouldStart:!0,refVideo:a,cropArea:C,settings:s,onModelErrorChange:_,frontSide:i,onSessionTimeout:x,onCaptureDone:c,outputEncryptionSettings:l}),A=T.warmupDone,I=T.isProcessing,P=T.takePictureManually,R=T.restartSession,N=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R();case 2:case"end":return e.stop()}}),e)}))),[R]);B.current=N,dv.useEffect((function(){if(o){var e,t,r,a,i,s,c=o.videoAreaWidth,l=o.videoAreaHeight,d=o.lostX,f=o.lostY,h=o.clientHeight;n?(a=.7*(i=l-165),r=(s=(e=f+10)+45)+i+70):(a=WW.isMobile?c-6:Math.floor(.7*c),i=Math.floor(Math.min(a/1.5,h-2*f-80-135)),r=(t=(s=(e=f+10)+(WW.isMobile?90:50))+i+10)+88);var m=Math.floor((c-a)/2)+d;E({x:m,y:s,width:a,height:i,surroundStyle:{opacity:.6,background:"#000"}});var g={yTitle:e,yErrorMessage:t,yCaptureButton:r};p(g),u(g)}}),[o,n,u]);var O=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,P();case 2:case"end":return e.stop()}}),e)}))),[P]);return dv.useImperativeHandle(t,(function(){return{restartSession:N}}),[N]),dv.createElement(dv.Fragment,null,!A&&dv.createElement(gZ,null),I&&dv.createElement(y9,null),C&&dv.createElement(FG,{x:"".concat(C.x,"px"),y:"".concat(C.y,"px"),width:"".concat(C.width,"px"),height:"".concat(C.height,"px"),surroundStyle:C.surroundStyle},dv.createElement(_9,{strokeStyles:(r={},tg(r,JZ,{fill:"none",strokeWidth:1,stroke:"#fff"}),tg(r,eJ,{fill:"rgba(255, 0, 0, 0.1)",strokeWidth:3,stroke:S}),r),strokeWidth:3,errorColor:S,width:C.width,height:C.height,type:b?eJ:JZ})),b&&dv.createElement(B9,{y:"".concat(h,"px")},b),!I&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!b)&&dv.createElement(v9,{onClick:O,y:"".concat(m,"px")},dv.createElement("img",{src:g,alt:""})))}));I9.propTypes={usePortraitMask:Lv.bool,windowAndVideoInfo:Lv.shape({}),refVideo:Lv.shape({}),frontSide:Lv.bool,settings:Lv.shape({}),onCaptureDone:Lv.func,onUISpacingChange:Lv.func,outputEncryptionSettings:Lv.shape({})},I9.defaultProps={usePortraitMask:!1,windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var P9,R9,N9,O9,D9,L9,M9=aw.div(u9||(u9=pg(["\n z-index: ",";\n padding: 10px;\n margin: 0 10px;\n color: #fff;\n position: absolute;\n top: ",";\n font-size: 16px;\n text-align: center;\n max-width: 400px;\n"])),1020,(function(e){return e.y})),F9={QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR."}},U9=aw.button(P9||(P9=pg(["\n background: ",";\n height: 45px;\n border-radius: 5px;\n border: 0;\n padding: 0 20px;\n color: #000;\n cursor: pointer;\n font-size: 16px;\n font-weight: 600;\n"])),(function(e){return e.theme.primaryColor})),j9=aw.a(R9||(R9=pg(["\n text-decoration: underline;\n font-size: 16px;\n color: #000;\n cursor: pointer;\n"]))),V9=aw.div(N9||(N9=pg(["\n padding: 20px;\n"]))),z9=aw.div(O9||(O9=pg(["\n color: #000;\n font-size: 20px;\n"]))),q9=aw.div(D9||(D9=pg(["\n color: #000;\n font-size: 16px;\n"]))),H9=aw.div(L9||(L9=pg(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n"]))),K9=function(e){var t=e.onRetry,r=e.onSkip,n=hN.useSDKSettings().lang;return dv.createElement(V9,null,dv.createElement(j1,{mt:"15px"},dv.createElement(z9,null,F9.QR_INVALID_POPUP_TITLE[n])),dv.createElement(j1,{mt:"20px"},dv.createElement(q9,null,F9.QR_INVALID_POPUP_DESCRIPTION[n])),dv.createElement(j1,{mt:"30px"},dv.createElement(H9,null,dv.createElement(j1,{mr:"30px"},dv.createElement(j9,{onClick:r},F9.QR_INVALID_POPUP_SKIP_BUTTON[n])),dv.createElement(U9,{onClick:t},F9.QR_INVALID_POPUP_RETRY_BUTTON[n]))))};K9.propTypes={onRetry:Lv.func,onSkip:Lv.func},K9.defaultProps={onRetry:function(){},onSkip:function(){}};var W9,G9="CONFIRM",Q9="QR_INVALID",X9=["children","onClose"],Y9=aw.button(W9||(W9=pg(["\n position: absolute;\n top: 20px;\n right: 20px;\n border: 0;\n padding: 0;\n background: none;\n cursor: pointer;\n\n img {\n width: 16px;\n height: 16px;\n }\n"]))),$9=WW.isMobile?{contentStyle:{maxWidth:"100%",height:"100%",borderRadius:0},overlayStyle:{padding:0}}:{},Z9=function(e){var t=e.children,r=e.onClose,n=lg(e,X9),o=QN.useAsset("ic_close_black.png");return dv.createElement(pZ,rg({},$9,n),t,dv.createElement(Y9,{onClick:r},dv.createElement("img",{src:o,alt:""})))};Z9.propTypes={children:Lv.node,onClose:Lv.func},Z9.defaultProps={children:null,onClose:function(){}};var J9,e7,t7,r7;function n7(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,a=e.onCaptureDone,i=hg(dv.useState(null),2),s=i[0],c=i[1],u=QN.useAsset("qr_capture_cursor.png"),l=hg(dv.useState({}),2),d=l[0],f=l[1],p=d.yTooltip,h=hN.useSDKSettings().lang,m=KN.useSDKTracking().sendEvent,g=N2(),v=g.showPopup,y=g.popupShown,b=g.popupType,w=dv.useRef();dv.useEffect((function(){m({tag:"id_qr",event:"user_activity.start",log:{}}),w.current=performance.now()}),[m]),dv.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,a=WW.isMobile?Math.min(e-6,145):145,i=a,s=o+140,u=s+i+20,l=Math.floor((e-a)/2)+n;c({x:l,y:s,width:a,height:i,surroundStyle:{opacity:.6,background:"#000"}});var d={yTooltip:u};f(d),r(d)}}),[t,r]);var k=dv.useCallback((function(){m({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),a()}),[a,m]),C=dv.useCallback((function(e){var t=e.validateResult.valid,r=performance.now();t?(m({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-w.current)/1e3}}),a(e)):(v({popupType:Q9}),m({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[v,a,m]),E=T5({shouldStart:!0,refVideo:n,cropArea:s,settings:o,onSessionTimeout:k,onCaptureDone:C}),S=E.isProcessing,B=E.restartSession,_=E.warmupDone,x=dv.useCallback((function(){v({popupType:null})}),[v]),T=dv.useCallback($m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(),w.current=performance.now(),m({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,B();case 5:case"end":return e.stop()}}),e)}))),[B,x,m]),A=dv.useCallback((function(){x(),m({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),a()}),[x,a,m]);return dv.createElement(dv.Fragment,null,!_&&dv.createElement(gZ,null),s&&dv.createElement(FG,{x:"".concat(s.x,"px"),y:"".concat(s.y,"px"),width:"".concat(s.width,"px"),height:"".concat(s.height,"px"),surroundStyle:s.surroundStyle},dv.createElement("div",null,dv.createElement("img",{src:u,width:s.width,height:s.height,alt:""}))),dv.createElement(M9,{y:"".concat(p,"px")},F9.QR_TOOLTIP[h]),S&&dv.createElement(y9,null),dv.createElement(Z9,{open:y,onClose:A},b===Q9&&dv.createElement(K9,{onRetry:T,onSkip:A})))}n7.propTypes={windowAndVideoInfo:Lv.shape({}),onUISpacingChange:Lv.func,refVideo:Lv.shape({}),settings:Lv.shape({}),onCaptureDone:Lv.func},n7.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){}};var o7=aw.div(J9||(J9=pg(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),a7=aw.div(e7||(e7=pg(["\n text-align: center;\n font-size: 1rem;\n color: ",";\n margin-top: 10px;\n"])),(function(e){return e.theme.dangerColor})),i7=aw.img(t7||(t7=pg(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),s7=aw.div(r7||(r7=pg(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n gap: 10px;\n"]))),c7=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,a=e.hasValidQR,i=hg(dv.useState(null),2),s=i[0],c=i[1],u=hN.useSDKSettings().lang;return dv.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),c(e)),function(){URL.revokeObjectURL(e)}}),[t]),dv.createElement(o7,null,null!==a&&dv.createElement(j1,{mb:"20px"},dv.createElement("div",null,dv.createElement(q5,{type:a?D5:L5},a?T9.CONFIRM_POPUP_VALID_QR[u]:T9.CONFIRM_POPUP_INVALID_QR[u]))),dv.createElement(i5,{ratio:1.5},dv.createElement(i7,{src:s})),o&&dv.createElement(a7,{className:"confirm-popup-error-message"},o.msg[u]),dv.createElement(s7,null,dv.createElement(j9,{onClick:n},T9.BTN_TRY_AGAIN[u]),dv.createElement(U9,{onClick:r},T9.BTN_USE_THIS_PICTURE[u])))};c7.propTypes={imageTaken:Lv.shape({}),error:Lv.shape({msg:Lv.shape({})}),onConfirm:Lv.func,onTryAgain:Lv.func,hasValidQR:Lv.bool},c7.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null};var u7,l7={primaryColor:"#FDB913",dangerColor:"#FF0000"},d7=sw(u7||(u7=pg(['\n ///////////////// Loading Icon (provided by VIB) //////////////////////\n .loader {\n position: fixed;\n top: calc(50% - 32px);\n left: calc(50% - 32px);\n width: 64px;\n height: 64px;\n border-radius: 50%;\n perspective: 800px;\n z-index: 999999\n }\n\n .box_loader::before {\n /* background-color:rgba(0,0,0,.8); */\n width: 100%;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n content: "";\n display: block;\n z-index: 999995;\n }\n\n .inner {\n position: absolute;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border-radius: 50%\n }\n\n .inner.one {\n left: 0;\n top: 0;\n animation: rotate-one 1s linear infinite;\n border-bottom: 3px solid #fdb913\n }\n\n .inner.two {\n right: 0;\n top: 0;\n animation: rotate-two 1s linear infinite;\n border-right: 3px solid #f47920\n }\n\n .inner.three {\n right: 0;\n bottom: 0;\n animation: rotate-three 1s linear infinite;\n border-top: 3px solid #f7941d\n }\n\n @keyframes rotate-one {\n 0% {\n transform: rotateX(35deg) rotateY(-45deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg)\n }\n }\n\n @keyframes rotate-two {\n 0% {\n transform: rotateX(50deg) rotateY(10deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg)\n }\n }\n\n @keyframes rotate-three {\n 0% {\n transform: rotateX(35deg) rotateY(55deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg)\n }\n }\n ///////////////////////////////////////////////////////////\n']))),f7=aI.IDCardSide,p7=aI.IDCardType,h7=aI.Errors,m7="id_card",g7="qr_code",v7=[{scannerType:m7,title:"Chụp mặt trước CMND/CCCD",titleIcon:"id_card_front.svg",cardSide:aI.IDCardSide.FRONT,cardType:p7.VN,frontCamera:!1,enableConfirmPopup:!1},{scannerType:m7,title:"Chụp mặt sau CMND/CCCD",titleIcon:"id_card_back.svg",cardSide:aI.IDCardSide.BACK,cardType:p7.VN,frontCamera:!1,enableConfirmPopup:!1}],y7={scannerType:g7,frontCamera:!1,cardSide:aI.IDCardSide.FRONT,cardType:p7.VN};function b7(e){var t=e.onClose,r=e.onError,n=e.clientSettings,o=e.detectIdCard,a=e.onStepDone,i=e.steps,s=e.outputEncryptionSettings,c=hg(dv.useState(0),2),u=c[0],l=c[1],d=hg(dv.useState(i[u]),2),f=d[0],p=d[1],h=dv.useRef(null),m=hg(dv.useState(null),2),g=m[0],v=m[1],y=hg(dv.useState(!1),2),b=y[0],w=y[1],k=hg(dv.useState(0),2),C=k[0],E=k[1],S=dv.useRef(),B=f.scannerType,_=f.frontCamera,x=f.title,T=f.titleIcon,A=f.cardSide,I=f.usePortraitMask,P=f.cardType,R=f.enableConfirmPopup,N=A===f7.FRONT,O=QN.useAsset(T),D=N2(),L=D.showPopup,M=D.popupShown,F=D.popupType,U=D.props,j=hg(dv.useState(!1),2),V=j[0],z=j[1],q=dv.useRef(null),H=dv.useRef(null),K=dv.useRef([]),W=O4({clientSettings:n}).settings,G=hg(dv.useState({}),2),Q=G[0],X=G[1],Y=Q.yTitle,$=KN.useSDKTracking().sendEvent,Z=dv.useCallback((function(e){v(e),w(!0)}),[]);dv.useEffect((function(){w(!1)}),[_]);var J=dv.useCallback((function(){L({popupType:null})}),[L]),ee=dv.useCallback((function(e){e>=i.length||setTimeout((function(){l(e),p(i[e])}),200)}),[i]),te=dv.useCallback((function(){ee(u+1)}),[ee,u]),re=dv.useCallback((function(){setTimeout((function(){p((function(e){return og(og({},y7),{},{enableConfirmPopup:e.enableConfirmPopup})}))}),200)}),[]),ne=dv.useCallback($m(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={stepNumber:u,cardSide:A,cardType:P,image:q.current,recordedVideos:null!=W&&W.enableRecording?K.current:[]},(B===g7||null!==(t=H.current)&&void 0!==t&&t.result)&&(r.qrScannedResult=H.current),z(!0),e.next=5,a(r);case 5:$({tag:"result",event:"sdk_mode.read_id_card_one_side",log:{result_object:r}}),z(!1),H.current=null,te();case 9:case"end":return e.stop()}}),e)}))),[W,u,a,te,B,$,A,P]),oe=dv.useCallback((function(){J(),H.current=null,B===g7?ee(u):B===m7&&($({tag:N?"id_front":"id_back",event:"user_activity.retry",log:{}}),S.current.restartSession())}),[ee,u,J,B,N,$]),ae=dv.useCallback((function(){J(),$({tag:N?"id_front":"id_back",event:"user_activity.submit",log:{}}),ne()}),[ne,J,$,N]),ie=dv.useCallback((function(e){var t;if(H.current=e,e){var r,n=e.recordedVideos;(r=K.current).push.apply(r,mg(n))}E((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);R?L({popupType:G9,props:{hasValidQR:o,imageTaken:q.current}}):ne()}),[L,R,ne]),se=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var n,a,i,c,u,l,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,a=t.error,i=t.recordedVideos,q.current=n,K.current=i,E((function(e){return e+1})),A!==aI.IDCardSide.FRONT){e.next=28;break}if(!W.enableScanQr||!WW.isMobile){e.next=28;break}if(u=null==n||null===(c=n.detectedCard)||void 0===c?void 0:c.label){e.next=20;break}return z(!0),e.prev=9,e.next=12,o({image:n,cardType:P,cardSide:A});case 12:l=e.sent,u=l.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(h7.detect_id_card_error);case 19:z(!1);case 20:if(!u||!"vn.cccd_new.front".includes(u)){e.next=28;break}return z(!0),e.next=24,m5(q.current.blob,s);case 24:return(d=e.sent)?ie(d):re(),z(!1),e.abrupt("return");case 28:R?L({popupType:G9,props:{imageTaken:q.current,error:a}}):ne();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[R,L,A,W,P,o,ne,re,r,ie,s]);return dv.createElement(rw,{theme:l7},dv.createElement(m9,null,dv.createElement(RG,{key:_,frontCamera:_,onVideoPlayed:Z,onClose:t,flipHorizontal:_,ref:h,onError:r},b&&dv.createElement(dv.Fragment,null,B===m7&&dv.createElement(I9,{key:u,ref:S,windowAndVideoInfo:g,refVideo:h,settings:W,onCaptureDone:se,onUISpacingChange:X,frontSide:N,usePortraitMask:I,outputEncryptionSettings:s}),B===g7&&dv.createElement(n7,{key:u,refVideo:h,windowAndVideoInfo:g,settings:W,onCaptureDone:ie,onUISpacingChange:X})),dv.createElement(h9,{keyForTransition:C}),dv.createElement(w9,{y:"".concat(Y,"px")},dv.createElement(KZ,null,dv.createElement(MZ,{key:x,timeout:{enter:p9,exit:p9},classNames:"flipY",unmountOnExit:!0},dv.createElement(k9,null,T&&dv.createElement(g9,{src:O,alt:""}),dv.createElement(C9,{className:"title"},x))))),V&&dv.createElement(y9,null)),dv.createElement(pZ,{open:M},F===G9&&dv.createElement(c7,rg({},U,{onConfirm:ae,onTryAgain:oe})))),dv.createElement(d7,null))}b7.propTypes={onClose:Lv.func,onError:Lv.func,clientSettings:Lv.shape({}),detectIdCard:Lv.func,onStepDone:Lv.func,steps:Lv.arrayOf(Lv.shape({})),outputEncryptionSettings:Lv.shape({})},b7.defaultProps={onClose:function(){},onError:function(){},clientSettings:{},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:v7,outputEncryptionSettings:null};var w7=["tracking","clientSettings"];function k7(e){var t=e.tracking,r=e.clientSettings,n=lg(e,w7),o=dv.useMemo((function(){return GY(r,"data.settings.sdk_settings.server_log_settings.enable",null==t?void 0:t.enable)}),[r,t]);return dv.createElement(R3,null,dv.createElement(KN.SDKTrackingProvider,{value:{tracking:og(og({},t),{},{enable:o})}},dv.createElement(b7,rg({},n,{clientSettings:r}))))}k7.propTypes={tracking:Lv.shape({}),clientSettings:Lv.shape({})},k7.defaultProps={tracking:void 0,clientSettings:void 0};var C7=aI.Errors,E7=function(e){var t=e.onClose,r=e.onError,n=e.detectIdCard,o=e.steps,a=e.onStepDone,i=e.apiCredentials,s=e.tracking,c=hg(dv.useState(null),2),u=c[0],l=c[1],d=$D.useApiClient({apiCredentials:i,tracking:s}).apiClient,f=dv.useRef(""),p=dv.useRef("");dv.useEffect((function(){function e(){return(e=$m(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.clientSettings();case 2:t=e.sent,l(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[d]);var h=dv.useCallback(function(){var e=$m(regeneratorRuntime.mark((function e(t){var n,i,s,c,u,l,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.stepNumber,i=t.recordedVideos,s=t.qrScannedResult,c=t.image,u=o[n],l=u.cardType,h=u.cardSide,m=null,e.prev=3,e.next=6,Z4({image:c,cardSide:h,frontCardId:f.current,qrImageId:p.current,onError:r,apiClient:d,cardType:l,recordedVideos:i,qrScannedResult:s});case 6:m=e.sent,h===aI.IDCardSide.FRONT&&(f.current=m.cardInfo.image1.id),p.current=m.qrImageId,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),r(og(og({},C7.api_call_error),{},{details:e.t0}));case 14:m&&a(og(og({},t),{},{apiResult:m}));case 15:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t){return e.apply(this,arguments)}}(),[d,r,o,a]);return u&&dv.createElement(k7,{tracking:s,onClose:t,onError:r,clientSettings:u,detectIdCard:n,onStepDone:h,steps:o})};E7.propTypes={onClose:Lv.func,onError:Lv.func,detectIdCard:Lv.func,onStepDone:Lv.func,steps:Lv.arrayOf(Lv.shape({})),apiCredentials:Lv.shape({accessKey:Lv.string,secretKey:Lv.string,apiUrl:Lv.string}),tracking:Lv.shape({})},E7.defaultProps={onClose:function(){},onError:function(){},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:v7,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},tracking:void 0};var S7=function(e){ag(r,ZM);var t=fg(r);function r(e){return Zm(this,r),t.call(this,og(og({},e),{},{baseComponent:{checkCamera:E3,LivenessDetection:E2,NativeCamera:B3,ReadIDCardUIOnly:F4,ReadIDCardWithApiCall:n8,EkycFlow:y6,warmUpReadIdCard:E1,preloadEKYCResources:a8,getListCamera:cG,FlashLiveness:k2},component:{LivenessDetection:c9,ReadIDCardUIOnly:k7,ReadIDCardWithApiCall:E7}}))}return r}();exports.APIUtils=$D,exports.AntiDebugUtils=BL,exports.AssetUtils=QN,exports.AsyncUtils=YN,exports.BaseTVWebSDK=ZM,exports.BlurUtils=wO,exports.CameraUtils=CO,exports.CloseEyesDetector=GM,exports.CommonUtils=SO,exports.Constants=aI,exports.CoordinateUtils=IO,exports.CryptoUtils=TL,exports.DEFAULT_CLOSE_EYE_MODEL=WM,exports.ExifUtils=KM,exports.FaceUtils=FO,exports.GlareUtils=zD,exports.HashUtils=MN,exports.ImageUtils=FD,exports.LoadResourceUtils=iL,exports.LocalStorageUtils=NN,exports.ModelUtils=SL,exports.PredictionUtils=jO,exports.SDK=S7,exports.SDKAdapter=eF,exports.SDKTimer=AL,exports.ScannerType=gW,exports.SettingsContext=hN,exports.ThemeUtils=_L,exports.TimeUtils=IN,exports.TrackingContext=KN,exports.UserAgentUtils=xN,exports.defaultClientSettings=OW,exports.defaultReadIDCardSteps=vW,exports.getCustomUrlsBySettings=uN,exports.getQrScannerWorkerPath=YM,exports.getSDKVersion=function(){return"5.14.0-alpha.19"},exports.requestMotionPermission=QM,exports.useDeviceMotion=XM;