@tsocial/tvweb-sdk.tcb 5.13.5 → 5.13.7

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.
@@ -25,7 +25,7 @@
25
25
  *
26
26
  * Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
27
27
  * Dual licensed under GPLv2 or MIT
28
- */!function(o,i){var a="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]:i},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],Ey(s=p[o])===c&&s.length>0?2==s.length?Ey(s[1])==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?Ey(s[1])!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):i:this[s[0]]=l?s[1].call(this,l,s[2]):i:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):i):this[s]=l||i;d+=2}},str:function(e,t){for(var r in t)if(Ey(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?i:r}else if(w.has(t[r],e))return"?"===r?i: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"}}}},B={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,r){if("object"==Ey(t)&&(r=t,t=i),!(this instanceof e))return new e(t,r).getResult();var n=t||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),a=r?w.extend(B,r):B;return this.getBrowser=function(){var e={name:i,version:i};return k.rgx.call(e,n,a.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:i};return k.rgx.call(e,n,a.cpu),e},this.getDevice=function(){var e={vendor:i,model:i,type:i};return k.rgx.call(e,n,a.device),e},this.getEngine=function(){var e={name:i,version:i};return k.rgx.call(e,n,a.engine),e},this.getOS=function(){var e={name:i,version:i};return k.rgx.call(e,n,a.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 n},this.setUA=function(e){return n=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},Ey(t)!==s?(Ey(e)!==s&&e.exports&&(t=e.exports=S),t.UAParser=S):r(3)?(n=function(){return S}.call(t,r,t,e))===i||(e.exports=n):o&&(o.UAParser=S);var E=o&&(o.jQuery||o.Zepto);if(Ey(E)!==s){var _=new S;E.ua=_.getResult(),E.ua.get=function(){return _.getUA()},E.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)E.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":Ey(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),i=o.DEVICE_TYPES,a=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 i.MOBILE:return{isMobile:!0};case i.TABLET:return{isTablet:!0};case i.SMART_TV:return{isSmartTV:!0};case i.CONSOLE:return{isConsole:!0};case i.WEARABLE:return{isWearable:!0};case i.BROWSER:return{isBrowser:!0};default:return a}},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}}])}));function xF(){return"5.13.5"}function TF(){return{"X-TV-Device-Model":"".concat(_F.browserName," ").concat(_F.browserVersion),"X-TV-OS-Version":"".concat(_F.osName," ").concat(_F.osVersion),"X-TV-OS-Platform":_F.isMobile?"".concat(_F.osName.toLowerCase(),"_web"):"web","X-TV-SDK-Version":"5.13.5"}}var AF=Object.freeze({__proto__:null,getUAMetadata:TF});function PF(e){return e<10?"0".concat(e):e}function IF(e){return"".concat(e.getFullYear(),"-").concat(PF(e.getMonth()+1),"-").concat(PF(e.getDate()),"T").concat(PF(e.getHours()),":").concat(PF(e.getMinutes()),":").concat(PF(e.getSeconds())).concat(function(e){if(0===e)return"Z";var t=e>0?"-":"+";return e=Math.abs(e),"".concat(t+PF(Math.floor(e/60)),":").concat(PF(e%60))}(e.getTimezoneOffset()))}var RF=Object.freeze({__proto__:null,rfc3339:IF});function OF(e,t){window.localStorage&&window.JSON&&t&&localStorage.setItem(t,JSON.stringify(e))}function NF(e){if(window.localStorage&&window.JSON&&e){var t=localStorage.getItem(e);if(t)return JSON.parse(t)}}var DF=Object.freeze({__proto__:null,storeData:OF,getData:NF,removeData:function(e){window.localStorage&&window.JSON&&e&&localStorage.removeItem(e)}}),MF=FM((function(e,t){var r;e.exports=r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==UM&&UM.crypto&&(r=UM.crypto),!r)try{r=gF}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var a=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=a<<24-(n+i)%4*8}else for(var s=0;s<o;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new c.init(t,e)}}),u=i.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},d=u.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},f=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*u,i);if(u){for(var d=0;d<u;d+=a)this._doProcessBlock(o,d);r=o.splice(0,u),n.sigBytes-=l}return new c.init(r,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),h=(a.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}}),i.algo={});return i}(Math)})),LF=(FM((function(e,t){var r,n,o,i,a,s;e.exports=(n=(r=s=MF).lib,o=n.Base,i=n.WordArray,(a=r.x64={}).Word=o.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var o=e[n];r.push(o.high),r.push(o.low)}return i.create(r,this.sigBytes)},clone:function(){for(var e=o.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),s)})),FM((function(e,t){var r;e.exports=(r=MF,function(){if("function"==typeof ArrayBuffer){var e=r.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],o=0;o<r;o++)n[o>>>2]|=e[o]<<24-o%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var i=t[o>>>2]>>>16-o%4*8&65535;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o<r;o++)n[o>>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var a=o(t[i>>>2]>>>16-i%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var o=[],i=0,a=0;a<r;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return t.create(o,i)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],i=0;i<r;i+=3)for(var a=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s<r;s++)o.push(n.charAt(a>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return n(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var o=[],i=0,a=0;a<r;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return t.create(o,i)}e.enc.Base64url={stringify:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.words,n=e.sigBytes,o=t?this._safe_map:this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var s=(r[a>>>2]>>>24-a%4*8&255)<<16|(r[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|r[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c<n;c++)i.push(o.charAt(s>>>6*(3-c)&63));var u=o.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.length,o=t?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<o.length;a++)i[o.charCodeAt(a)]=a}var s=o.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(r=c)}return n(e,r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),r.enc.Base64url)})),FM((function(e,t){var r;e.exports=(r=MF,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=a.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,o=e[n];e[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=e[t+0],c=e[t+1],p=e[t+2],h=e[t+3],m=e[t+4],g=e[t+5],v=e[t+6],y=e[t+7],b=e[t+8],w=e[t+9],k=e[t+10],C=e[t+11],B=e[t+12],S=e[t+13],E=e[t+14],_=e[t+15],x=i[0],T=i[1],A=i[2],P=i[3];x=u(x,T,A,P,a,7,s[0]),P=u(P,x,T,A,c,12,s[1]),A=u(A,P,x,T,p,17,s[2]),T=u(T,A,P,x,h,22,s[3]),x=u(x,T,A,P,m,7,s[4]),P=u(P,x,T,A,g,12,s[5]),A=u(A,P,x,T,v,17,s[6]),T=u(T,A,P,x,y,22,s[7]),x=u(x,T,A,P,b,7,s[8]),P=u(P,x,T,A,w,12,s[9]),A=u(A,P,x,T,k,17,s[10]),T=u(T,A,P,x,C,22,s[11]),x=u(x,T,A,P,B,7,s[12]),P=u(P,x,T,A,S,12,s[13]),A=u(A,P,x,T,E,17,s[14]),x=l(x,T=u(T,A,P,x,_,22,s[15]),A,P,c,5,s[16]),P=l(P,x,T,A,v,9,s[17]),A=l(A,P,x,T,C,14,s[18]),T=l(T,A,P,x,a,20,s[19]),x=l(x,T,A,P,g,5,s[20]),P=l(P,x,T,A,k,9,s[21]),A=l(A,P,x,T,_,14,s[22]),T=l(T,A,P,x,m,20,s[23]),x=l(x,T,A,P,w,5,s[24]),P=l(P,x,T,A,E,9,s[25]),A=l(A,P,x,T,h,14,s[26]),T=l(T,A,P,x,b,20,s[27]),x=l(x,T,A,P,S,5,s[28]),P=l(P,x,T,A,p,9,s[29]),A=l(A,P,x,T,y,14,s[30]),x=d(x,T=l(T,A,P,x,B,20,s[31]),A,P,g,4,s[32]),P=d(P,x,T,A,b,11,s[33]),A=d(A,P,x,T,C,16,s[34]),T=d(T,A,P,x,E,23,s[35]),x=d(x,T,A,P,c,4,s[36]),P=d(P,x,T,A,m,11,s[37]),A=d(A,P,x,T,y,16,s[38]),T=d(T,A,P,x,k,23,s[39]),x=d(x,T,A,P,S,4,s[40]),P=d(P,x,T,A,a,11,s[41]),A=d(A,P,x,T,h,16,s[42]),T=d(T,A,P,x,v,23,s[43]),x=d(x,T,A,P,w,4,s[44]),P=d(P,x,T,A,B,11,s[45]),A=d(A,P,x,T,_,16,s[46]),x=f(x,T=d(T,A,P,x,p,23,s[47]),A,P,a,6,s[48]),P=f(P,x,T,A,y,10,s[49]),A=f(A,P,x,T,E,15,s[50]),T=f(T,A,P,x,g,21,s[51]),x=f(x,T,A,P,B,6,s[52]),P=f(P,x,T,A,h,10,s[53]),A=f(A,P,x,T,k,15,s[54]),T=f(T,A,P,x,c,21,s[55]),x=f(x,T,A,P,b,6,s[56]),P=f(P,x,T,A,_,10,s[57]),A=f(A,P,x,T,v,15,s[58]),T=f(T,A,P,x,S,21,s[59]),x=f(x,T,A,P,m,6,s[60]),P=f(P,x,T,A,C,10,s[61]),A=f(A,P,x,T,p,15,s[62]),T=f(T,A,P,x,w,21,s[63]),i[0]=i[0]+x|0,i[1]=i[1]+T|0,i[2]=i[2]+A|0,i[3]=i[3]+P|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;r[o>>>5]|=128<<24-o%32;var i=e.floor(n/4294967296),a=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,o,i,a){var s=e+(t&r|~t&n)+o+a;return(s<<i|s>>>32-i)+t}function l(e,t,r,n,o,i,a){var s=e+(t&n|r&~n)+o+a;return(s<<i|s>>>32-i)+t}function d(e,t,r,n,o,i,a){var s=e+(t^r^n)+o+a;return(s<<i|s>>>32-i)+t}function f(e,t,r,n,o,i,a){var s=e+(r^(t|~n))+o+a;return(s<<i|s>>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),r.MD5)})),FM((function(e,t){var r,n,o,i,a,s,c,u;e.exports=(n=(r=u=MF).lib,o=n.WordArray,i=n.Hasher,a=r.algo,s=[],c=a.SHA1=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],c=r[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}var d=(n<<5|n>>>27)+c+s[u];d+=u<20?1518500249+(o&i|~o&a):u<40?1859775393+(o^i^a):u<60?(o&i|o&a|i&a)-1894007588:(o^i^a)-899497514,c=a,a=i,i=o<<30|o>>>2,o=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=i._createHelper(c),r.HmacSHA1=i._createHmacHelper(c),u.SHA1)})),FM((function(e,t){var r;e.exports=(r=MF,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,o=0;o<64;)t(n)&&(o<8&&(s[o]=r(e.pow(n,.5))),c[o]=r(e.pow(n,1/3)),o++),n++}();var u=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,g=u[p-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[p]=m+u[p-7]+v+u[p-16]}var y=n&o^n&i^o&i,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+c[p]+u[p];f=d,d=l,l=s,s=a+w|0,a=i,i=o,o=n,n=w+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+d|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=e.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),r.SHA256)})),FM((function(e,t){var r,n,o,i,a,s;e.exports=(n=(r=s=MF).lib.WordArray,o=r.algo,i=o.SHA256,a=o.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=i._createHelper(a),r.HmacSHA224=i._createHmacHelper(a),s.SHA224)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,a=e.algo;function s(){return o.create.apply(o,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var l=a.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=n.high,h=n.low,m=o.high,g=o.low,v=i.high,y=i.low,b=a.high,w=a.low,k=s.high,C=s.low,B=l.high,S=l.low,E=d.high,_=d.low,x=f.high,T=f.low,A=p,P=h,I=m,R=g,O=v,N=y,D=b,M=w,L=k,U=C,j=B,F=S,V=E,z=_,q=x,H=T,K=0;K<80;K++){var W,G,Q=u[K];if(K<16)G=Q.high=0|e[t+2*K],W=Q.low=0|e[t+2*K+1];else{var X=u[K-15],Y=X.high,$=X.low,Z=(Y>>>1|$<<31)^(Y>>>8|$<<24)^Y>>>7,J=($>>>1|Y<<31)^($>>>8|Y<<24)^($>>>7|Y<<25),ee=u[K-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,oe=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ie=u[K-7],ae=ie.high,se=ie.low,ce=u[K-16],ue=ce.high,le=ce.low;G=(G=(G=Z+ae+((W=J+se)>>>0<J>>>0?1:0))+ne+((W+=oe)>>>0<oe>>>0?1:0))+ue+((W+=le)>>>0<le>>>0?1:0),Q.high=G,Q.low=W}var de,fe=L&j^~L&V,pe=U&F^~U&z,he=A&I^A&O^I&O,me=P&R^P&N^R&N,ge=(A>>>28|P<<4)^(A<<30|P>>>2)^(A<<25|P>>>7),ve=(P>>>28|A<<4)^(P<<30|A>>>2)^(P<<25|A>>>7),ye=(L>>>14|U<<18)^(L>>>18|U<<14)^(L<<23|U>>>9),be=(U>>>14|L<<18)^(U>>>18|L<<14)^(U<<23|L>>>9),we=c[K],ke=we.high,Ce=we.low,Be=q+ye+((de=H+be)>>>0<H>>>0?1:0),Se=ve+me;q=V,H=z,V=j,z=F,j=L,F=U,L=D+(Be=(Be=(Be=Be+fe+((de+=pe)>>>0<pe>>>0?1:0))+ke+((de+=Ce)>>>0<Ce>>>0?1:0))+G+((de+=W)>>>0<W>>>0?1:0))+((U=M+de|0)>>>0<M>>>0?1:0)|0,D=O,M=N,O=I,N=R,I=A,R=P,A=Be+(ge+he+(Se>>>0<ve>>>0?1:0))+((P=de+Se|0)>>>0<de>>>0?1:0)|0}h=n.low=h+P,n.high=p+A+(h>>>0<P>>>0?1:0),g=o.low=g+R,o.high=m+I+(g>>>0<R>>>0?1:0),y=i.low=y+N,i.high=v+O+(y>>>0<N>>>0?1:0),w=a.low=w+M,a.high=b+D+(w>>>0<M>>>0?1:0),C=s.low=C+U,s.high=k+L+(C>>>0<U>>>0?1:0),S=l.low=S+F,l.high=B+j+(S>>>0<F>>>0?1:0),_=d.low=_+z,d.high=E+V+(_>>>0<z>>>0?1:0),T=f.low=T+H,f.high=x+q+(T>>>0<H>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),r.SHA512)})),FM((function(e,t){var r,n,o,i,a,s,c,u;e.exports=(n=(r=u=MF).x64,o=n.Word,i=n.WordArray,a=r.algo,s=a.SHA512,c=a.SHA384=s.extend({_doReset:function(){this._hash=new i.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=s._createHelper(c),r.HmacSHA384=s._createHmacHelper(c),u.SHA384)})),FM((function(e,t){var r;e.exports=(r=MF,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.x64.Word,s=t.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,i=0;i<24;i++){for(var s=0,d=0,f=0;f<7;f++){if(1&o){var p=(1<<f)-1;p<32?d^=1<<p:s^=1<<p-32}128&o?o=o<<1^113:o<<=1}l[i]=a.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=a.create()}();var f=s.SHA3=i.extend({cfg:i.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,o=0;o<n;o++){var i=e[t+2*o],a=e[t+2*o+1];i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(T=r[o]).high^=a,T.low^=i}for(var s=0;s<24;s++){for(var f=0;f<5;f++){for(var p=0,h=0,m=0;m<5;m++)p^=(T=r[f+5*m]).high,h^=T.low;var g=d[f];g.high=p,g.low=h}for(f=0;f<5;f++){var v=d[(f+4)%5],y=d[(f+1)%5],b=y.high,w=y.low;for(p=v.high^(b<<1|w>>>31),h=v.low^(w<<1|b>>>31),m=0;m<5;m++)(T=r[f+5*m]).high^=p,T.low^=h}for(var k=1;k<25;k++){var C=(T=r[k]).high,B=T.low,S=c[k];S<32?(p=C<<S|B>>>32-S,h=B<<S|C>>>32-S):(p=B<<S-32|C>>>64-S,h=C<<S-32|B>>>64-S);var E=d[u[k]];E.high=p,E.low=h}var _=d[0],x=r[0];for(_.high=x.high,_.low=x.low,f=0;f<5;f++)for(m=0;m<5;m++){var T=r[k=f+5*m],A=d[k],P=d[(f+1)%5+5*m],I=d[(f+2)%5+5*m];T.high=A.high^~P.high&I.high,T.low=A.low^~P.low&I.low}T=r[0];var R=l[s];T.high^=R.high,T.low^=R.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l<c;l++){var d=a[l],f=d.high,p=d.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(f)}return new o.init(u,s)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=i._createHelper(f),t.HmacSHA3=i._createHmacHelper(f)}(Math),r.SHA3)})),FM((function(e,t){var r;e.exports=(r=MF,
28
+ */!function(o,i){var a="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]:i},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],Ey(s=p[o])===c&&s.length>0?2==s.length?Ey(s[1])==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?Ey(s[1])!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):i:this[s[0]]=l?s[1].call(this,l,s[2]):i:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):i):this[s]=l||i;d+=2}},str:function(e,t){for(var r in t)if(Ey(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?i:r}else if(w.has(t[r],e))return"?"===r?i: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"}}}},B={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,r){if("object"==Ey(t)&&(r=t,t=i),!(this instanceof e))return new e(t,r).getResult();var n=t||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),a=r?w.extend(B,r):B;return this.getBrowser=function(){var e={name:i,version:i};return k.rgx.call(e,n,a.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:i};return k.rgx.call(e,n,a.cpu),e},this.getDevice=function(){var e={vendor:i,model:i,type:i};return k.rgx.call(e,n,a.device),e},this.getEngine=function(){var e={name:i,version:i};return k.rgx.call(e,n,a.engine),e},this.getOS=function(){var e={name:i,version:i};return k.rgx.call(e,n,a.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 n},this.setUA=function(e){return n=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},Ey(t)!==s?(Ey(e)!==s&&e.exports&&(t=e.exports=S),t.UAParser=S):r(3)?(n=function(){return S}.call(t,r,t,e))===i||(e.exports=n):o&&(o.UAParser=S);var E=o&&(o.jQuery||o.Zepto);if(Ey(E)!==s){var _=new S;E.ua=_.getResult(),E.ua.get=function(){return _.getUA()},E.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)E.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":Ey(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),i=o.DEVICE_TYPES,a=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 i.MOBILE:return{isMobile:!0};case i.TABLET:return{isTablet:!0};case i.SMART_TV:return{isSmartTV:!0};case i.CONSOLE:return{isConsole:!0};case i.WEARABLE:return{isWearable:!0};case i.BROWSER:return{isBrowser:!0};default:return a}},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}}])}));function xF(){return"5.13.7"}function TF(){return{"X-TV-Device-Model":"".concat(_F.browserName," ").concat(_F.browserVersion),"X-TV-OS-Version":"".concat(_F.osName," ").concat(_F.osVersion),"X-TV-OS-Platform":_F.isMobile?"".concat(_F.osName.toLowerCase(),"_web"):"web","X-TV-SDK-Version":"5.13.7"}}var AF=Object.freeze({__proto__:null,getUAMetadata:TF});function PF(e){return e<10?"0".concat(e):e}function IF(e){return"".concat(e.getFullYear(),"-").concat(PF(e.getMonth()+1),"-").concat(PF(e.getDate()),"T").concat(PF(e.getHours()),":").concat(PF(e.getMinutes()),":").concat(PF(e.getSeconds())).concat(function(e){if(0===e)return"Z";var t=e>0?"-":"+";return e=Math.abs(e),"".concat(t+PF(Math.floor(e/60)),":").concat(PF(e%60))}(e.getTimezoneOffset()))}var RF=Object.freeze({__proto__:null,rfc3339:IF});function OF(e,t){window.localStorage&&window.JSON&&t&&localStorage.setItem(t,JSON.stringify(e))}function NF(e){if(window.localStorage&&window.JSON&&e){var t=localStorage.getItem(e);if(t)return JSON.parse(t)}}var DF=Object.freeze({__proto__:null,storeData:OF,getData:NF,removeData:function(e){window.localStorage&&window.JSON&&e&&localStorage.removeItem(e)}}),MF=FM((function(e,t){var r;e.exports=r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==UM&&UM.crypto&&(r=UM.crypto),!r)try{r=gF}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var a=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=a<<24-(n+i)%4*8}else for(var s=0;s<o;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new c.init(t,e)}}),u=i.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},d=u.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},f=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*u,i);if(u){for(var d=0;d<u;d+=a)this._doProcessBlock(o,d);r=o.splice(0,u),n.sigBytes-=l}return new c.init(r,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),h=(a.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}}),i.algo={});return i}(Math)})),LF=(FM((function(e,t){var r,n,o,i,a,s;e.exports=(n=(r=s=MF).lib,o=n.Base,i=n.WordArray,(a=r.x64={}).Word=o.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var o=e[n];r.push(o.high),r.push(o.low)}return i.create(r,this.sigBytes)},clone:function(){for(var e=o.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),s)})),FM((function(e,t){var r;e.exports=(r=MF,function(){if("function"==typeof ArrayBuffer){var e=r.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],o=0;o<r;o++)n[o>>>2]|=e[o]<<24-o%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var i=t[o>>>2]>>>16-o%4*8&65535;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o<r;o++)n[o>>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var a=o(t[i>>>2]>>>16-i%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var o=[],i=0,a=0;a<r;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return t.create(o,i)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],i=0;i<r;i+=3)for(var a=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s<r;s++)o.push(n.charAt(a>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return n(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var o=[],i=0,a=0;a<r;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return t.create(o,i)}e.enc.Base64url={stringify:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.words,n=e.sigBytes,o=t?this._safe_map:this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var s=(r[a>>>2]>>>24-a%4*8&255)<<16|(r[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|r[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c<n;c++)i.push(o.charAt(s>>>6*(3-c)&63));var u=o.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.length,o=t?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<o.length;a++)i[o.charCodeAt(a)]=a}var s=o.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(r=c)}return n(e,r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),r.enc.Base64url)})),FM((function(e,t){var r;e.exports=(r=MF,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=a.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,o=e[n];e[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=e[t+0],c=e[t+1],p=e[t+2],h=e[t+3],m=e[t+4],g=e[t+5],v=e[t+6],y=e[t+7],b=e[t+8],w=e[t+9],k=e[t+10],C=e[t+11],B=e[t+12],S=e[t+13],E=e[t+14],_=e[t+15],x=i[0],T=i[1],A=i[2],P=i[3];x=u(x,T,A,P,a,7,s[0]),P=u(P,x,T,A,c,12,s[1]),A=u(A,P,x,T,p,17,s[2]),T=u(T,A,P,x,h,22,s[3]),x=u(x,T,A,P,m,7,s[4]),P=u(P,x,T,A,g,12,s[5]),A=u(A,P,x,T,v,17,s[6]),T=u(T,A,P,x,y,22,s[7]),x=u(x,T,A,P,b,7,s[8]),P=u(P,x,T,A,w,12,s[9]),A=u(A,P,x,T,k,17,s[10]),T=u(T,A,P,x,C,22,s[11]),x=u(x,T,A,P,B,7,s[12]),P=u(P,x,T,A,S,12,s[13]),A=u(A,P,x,T,E,17,s[14]),x=l(x,T=u(T,A,P,x,_,22,s[15]),A,P,c,5,s[16]),P=l(P,x,T,A,v,9,s[17]),A=l(A,P,x,T,C,14,s[18]),T=l(T,A,P,x,a,20,s[19]),x=l(x,T,A,P,g,5,s[20]),P=l(P,x,T,A,k,9,s[21]),A=l(A,P,x,T,_,14,s[22]),T=l(T,A,P,x,m,20,s[23]),x=l(x,T,A,P,w,5,s[24]),P=l(P,x,T,A,E,9,s[25]),A=l(A,P,x,T,h,14,s[26]),T=l(T,A,P,x,b,20,s[27]),x=l(x,T,A,P,S,5,s[28]),P=l(P,x,T,A,p,9,s[29]),A=l(A,P,x,T,y,14,s[30]),x=d(x,T=l(T,A,P,x,B,20,s[31]),A,P,g,4,s[32]),P=d(P,x,T,A,b,11,s[33]),A=d(A,P,x,T,C,16,s[34]),T=d(T,A,P,x,E,23,s[35]),x=d(x,T,A,P,c,4,s[36]),P=d(P,x,T,A,m,11,s[37]),A=d(A,P,x,T,y,16,s[38]),T=d(T,A,P,x,k,23,s[39]),x=d(x,T,A,P,S,4,s[40]),P=d(P,x,T,A,a,11,s[41]),A=d(A,P,x,T,h,16,s[42]),T=d(T,A,P,x,v,23,s[43]),x=d(x,T,A,P,w,4,s[44]),P=d(P,x,T,A,B,11,s[45]),A=d(A,P,x,T,_,16,s[46]),x=f(x,T=d(T,A,P,x,p,23,s[47]),A,P,a,6,s[48]),P=f(P,x,T,A,y,10,s[49]),A=f(A,P,x,T,E,15,s[50]),T=f(T,A,P,x,g,21,s[51]),x=f(x,T,A,P,B,6,s[52]),P=f(P,x,T,A,h,10,s[53]),A=f(A,P,x,T,k,15,s[54]),T=f(T,A,P,x,c,21,s[55]),x=f(x,T,A,P,b,6,s[56]),P=f(P,x,T,A,_,10,s[57]),A=f(A,P,x,T,v,15,s[58]),T=f(T,A,P,x,S,21,s[59]),x=f(x,T,A,P,m,6,s[60]),P=f(P,x,T,A,C,10,s[61]),A=f(A,P,x,T,p,15,s[62]),T=f(T,A,P,x,w,21,s[63]),i[0]=i[0]+x|0,i[1]=i[1]+T|0,i[2]=i[2]+A|0,i[3]=i[3]+P|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;r[o>>>5]|=128<<24-o%32;var i=e.floor(n/4294967296),a=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,o,i,a){var s=e+(t&r|~t&n)+o+a;return(s<<i|s>>>32-i)+t}function l(e,t,r,n,o,i,a){var s=e+(t&n|r&~n)+o+a;return(s<<i|s>>>32-i)+t}function d(e,t,r,n,o,i,a){var s=e+(t^r^n)+o+a;return(s<<i|s>>>32-i)+t}function f(e,t,r,n,o,i,a){var s=e+(r^(t|~n))+o+a;return(s<<i|s>>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),r.MD5)})),FM((function(e,t){var r,n,o,i,a,s,c,u;e.exports=(n=(r=u=MF).lib,o=n.WordArray,i=n.Hasher,a=r.algo,s=[],c=a.SHA1=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],c=r[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}var d=(n<<5|n>>>27)+c+s[u];d+=u<20?1518500249+(o&i|~o&a):u<40?1859775393+(o^i^a):u<60?(o&i|o&a|i&a)-1894007588:(o^i^a)-899497514,c=a,a=i,i=o<<30|o>>>2,o=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=i._createHelper(c),r.HmacSHA1=i._createHmacHelper(c),u.SHA1)})),FM((function(e,t){var r;e.exports=(r=MF,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,o=0;o<64;)t(n)&&(o<8&&(s[o]=r(e.pow(n,.5))),c[o]=r(e.pow(n,1/3)),o++),n++}();var u=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,g=u[p-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[p]=m+u[p-7]+v+u[p-16]}var y=n&o^n&i^o&i,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+c[p]+u[p];f=d,d=l,l=s,s=a+w|0,a=i,i=o,o=n,n=w+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+d|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=e.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),r.SHA256)})),FM((function(e,t){var r,n,o,i,a,s;e.exports=(n=(r=s=MF).lib.WordArray,o=r.algo,i=o.SHA256,a=o.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=i._createHelper(a),r.HmacSHA224=i._createHmacHelper(a),s.SHA224)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,a=e.algo;function s(){return o.create.apply(o,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var l=a.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=n.high,h=n.low,m=o.high,g=o.low,v=i.high,y=i.low,b=a.high,w=a.low,k=s.high,C=s.low,B=l.high,S=l.low,E=d.high,_=d.low,x=f.high,T=f.low,A=p,P=h,I=m,R=g,O=v,N=y,D=b,M=w,L=k,U=C,j=B,F=S,V=E,z=_,q=x,H=T,K=0;K<80;K++){var W,G,Q=u[K];if(K<16)G=Q.high=0|e[t+2*K],W=Q.low=0|e[t+2*K+1];else{var X=u[K-15],Y=X.high,$=X.low,Z=(Y>>>1|$<<31)^(Y>>>8|$<<24)^Y>>>7,J=($>>>1|Y<<31)^($>>>8|Y<<24)^($>>>7|Y<<25),ee=u[K-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,oe=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ie=u[K-7],ae=ie.high,se=ie.low,ce=u[K-16],ue=ce.high,le=ce.low;G=(G=(G=Z+ae+((W=J+se)>>>0<J>>>0?1:0))+ne+((W+=oe)>>>0<oe>>>0?1:0))+ue+((W+=le)>>>0<le>>>0?1:0),Q.high=G,Q.low=W}var de,fe=L&j^~L&V,pe=U&F^~U&z,he=A&I^A&O^I&O,me=P&R^P&N^R&N,ge=(A>>>28|P<<4)^(A<<30|P>>>2)^(A<<25|P>>>7),ve=(P>>>28|A<<4)^(P<<30|A>>>2)^(P<<25|A>>>7),ye=(L>>>14|U<<18)^(L>>>18|U<<14)^(L<<23|U>>>9),be=(U>>>14|L<<18)^(U>>>18|L<<14)^(U<<23|L>>>9),we=c[K],ke=we.high,Ce=we.low,Be=q+ye+((de=H+be)>>>0<H>>>0?1:0),Se=ve+me;q=V,H=z,V=j,z=F,j=L,F=U,L=D+(Be=(Be=(Be=Be+fe+((de+=pe)>>>0<pe>>>0?1:0))+ke+((de+=Ce)>>>0<Ce>>>0?1:0))+G+((de+=W)>>>0<W>>>0?1:0))+((U=M+de|0)>>>0<M>>>0?1:0)|0,D=O,M=N,O=I,N=R,I=A,R=P,A=Be+(ge+he+(Se>>>0<ve>>>0?1:0))+((P=de+Se|0)>>>0<de>>>0?1:0)|0}h=n.low=h+P,n.high=p+A+(h>>>0<P>>>0?1:0),g=o.low=g+R,o.high=m+I+(g>>>0<R>>>0?1:0),y=i.low=y+N,i.high=v+O+(y>>>0<N>>>0?1:0),w=a.low=w+M,a.high=b+D+(w>>>0<M>>>0?1:0),C=s.low=C+U,s.high=k+L+(C>>>0<U>>>0?1:0),S=l.low=S+F,l.high=B+j+(S>>>0<F>>>0?1:0),_=d.low=_+z,d.high=E+V+(_>>>0<z>>>0?1:0),T=f.low=T+H,f.high=x+q+(T>>>0<H>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),r.SHA512)})),FM((function(e,t){var r,n,o,i,a,s,c,u;e.exports=(n=(r=u=MF).x64,o=n.Word,i=n.WordArray,a=r.algo,s=a.SHA512,c=a.SHA384=s.extend({_doReset:function(){this._hash=new i.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=s._createHelper(c),r.HmacSHA384=s._createHmacHelper(c),u.SHA384)})),FM((function(e,t){var r;e.exports=(r=MF,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.x64.Word,s=t.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,i=0;i<24;i++){for(var s=0,d=0,f=0;f<7;f++){if(1&o){var p=(1<<f)-1;p<32?d^=1<<p:s^=1<<p-32}128&o?o=o<<1^113:o<<=1}l[i]=a.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=a.create()}();var f=s.SHA3=i.extend({cfg:i.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,o=0;o<n;o++){var i=e[t+2*o],a=e[t+2*o+1];i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(T=r[o]).high^=a,T.low^=i}for(var s=0;s<24;s++){for(var f=0;f<5;f++){for(var p=0,h=0,m=0;m<5;m++)p^=(T=r[f+5*m]).high,h^=T.low;var g=d[f];g.high=p,g.low=h}for(f=0;f<5;f++){var v=d[(f+4)%5],y=d[(f+1)%5],b=y.high,w=y.low;for(p=v.high^(b<<1|w>>>31),h=v.low^(w<<1|b>>>31),m=0;m<5;m++)(T=r[f+5*m]).high^=p,T.low^=h}for(var k=1;k<25;k++){var C=(T=r[k]).high,B=T.low,S=c[k];S<32?(p=C<<S|B>>>32-S,h=B<<S|C>>>32-S):(p=B<<S-32|C>>>64-S,h=C<<S-32|B>>>64-S);var E=d[u[k]];E.high=p,E.low=h}var _=d[0],x=r[0];for(_.high=x.high,_.low=x.low,f=0;f<5;f++)for(m=0;m<5;m++){var T=r[k=f+5*m],A=d[k],P=d[(f+1)%5+5*m],I=d[(f+2)%5+5*m];T.high=A.high^~P.high&I.high,T.low=A.low^~P.low&I.low}T=r[0];var R=l[s];T.high^=R.high,T.low^=R.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l<c;l++){var d=a[l],f=d.high,p=d.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(f)}return new o.init(u,s)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=i._createHelper(f),t.HmacSHA3=i._createHmacHelper(f)}(Math),r.SHA3)})),FM((function(e,t){var r;e.exports=(r=MF,
29
29
  /** @preserve
30
30
  (c) 2012 by Cédric Mesnil. All rights reserved.
31
31
 
@@ -42,7 +42,7 @@ function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=o.create([0,1,2,
42
42
  * derived from CryptoJS.mode.CTR
43
43
  * Jan Hruby jhruby.web@gmail.com
44
44
  */
45
- (r=MF).mode.CTRGladman=function(){var e=r.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function n(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var o=e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,o=r.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0),n(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c<o;c++)e[t+c]^=s[c]}});return e.Decryptor=o,e}(),r.mode.CTRGladman)})),FM((function(e,t){var r,n,o;e.exports=((o=MF).mode.OFB=(n=(r=o.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,o=this._iv,i=this._keystream;o&&(i=this._keystream=o.slice(0),this._iv=void 0),r.encryptBlock(i,0);for(var a=0;a<n;a++)e[t+a]^=i[a]}}),r.Decryptor=n,r),o.mode.OFB)})),FM((function(e,t){var r,n;e.exports=((n=MF).mode.ECB=((r=n.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),r.Decryptor=r.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),r),n.mode.ECB)})),FM((function(e,t){var r;e.exports=((r=MF).pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,o=n-r%n,i=r+o-1;e.clamp(),e.words[i>>>2]|=o<<24-i%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)})),FM((function(e,t){var r;e.exports=((r=MF).pad.Iso10126={pad:function(e,t){var n=4*t,o=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(o-1)).concat(r.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)})),FM((function(e,t){var r;e.exports=((r=MF).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)})),FM((function(e,t){var r;e.exports=((r=MF).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},r.pad.ZeroPadding)})),FM((function(e,t){var r;e.exports=((r=MF).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)})),FM((function(e,t){var r;e.exports=(r=MF,function(e){var t=r,n=t.lib.CipherParams,o=t.enc.Hex;t.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return n.create({ciphertext:t})}}}(),r.format.Hex)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,o=[],i=[],a=[],s=[],c=[],u=[],l=[],d=[],f=[],p=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var h=n^n<<1^n<<2^n<<3^n<<4;h=h>>>8^255&h^99,o[r]=h,i[h]=r;var m=e[r],g=e[m],v=e[g],y=257*e[h]^16843008*h;a[r]=y<<24|y>>>8,s[r]=y<<16|y>>>16,c[r]=y<<8|y>>>24,u[r]=y,y=16843009*v^65537*g^257*m^16843008*r,l[h]=y<<24|y>>>8,d[h]=y<<16|y>>>16,f[h]=y<<8|y>>>24,p[h]=y,r?(r=m^e[e[e[v^m]]],n^=e[e[n]]):r=n=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),i=this._keySchedule=[],a=0;a<n;a++)a<r?i[a]=t[a]:(u=i[a-1],a%r?r>6&&a%r==4&&(u=o[u>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u]):(u=o[(u=u<<8|u>>>24)>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u],u^=h[a/r|0]<<24),i[a]=i[a-r]^u);for(var s=this._invKeySchedule=[],c=0;c<n;c++){if(a=n-c,c%4)var u=i[a];else u=i[a-4];s[c]=c<4||a<=4?u:l[o[u>>>24]]^d[o[u>>>16&255]]^f[o[u>>>8&255]]^p[o[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,o)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,d,f,p,i),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,o,i,a,s){for(var c=this._nRounds,u=e[t]^r[0],l=e[t+1]^r[1],d=e[t+2]^r[2],f=e[t+3]^r[3],p=4,h=1;h<c;h++){var m=n[u>>>24]^o[l>>>16&255]^i[d>>>8&255]^a[255&f]^r[p++],g=n[l>>>24]^o[d>>>16&255]^i[f>>>8&255]^a[255&u]^r[p++],v=n[d>>>24]^o[f>>>16&255]^i[u>>>8&255]^a[255&l]^r[p++],y=n[f>>>24]^o[u>>>16&255]^i[l>>>8&255]^a[255&d]^r[p++];u=m,l=g,d=v,f=y}m=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[d>>>8&255]<<8|s[255&f])^r[p++],g=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[255&u])^r[p++],v=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[p++],y=(s[f>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&d])^r[p++],e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var o=this._subKeys=[],i=0;i<16;i++){var u=o[i]=[],l=c[i];for(r=0;r<24;r++)u[r/6|0]|=t[(s[r]-1+l)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(s[r+24]-1+l)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var d=this._invSubKeys=[];for(r=0;r<16;r++)d[r]=o[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var o=r[n],i=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^o[c])&l[c])>>>0];this._lBlock=a,this._rBlock=i^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function p(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=o._createHelper(d);var h=i.TripleDES=o.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),o=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(o))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(h)}(),r.TripleDES)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var a=o%r,s=t[a>>>2]>>>24-a%4*8&255;i=(i+n[o]+s)%256;var c=n[o];n[o]=n[i],n[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,r=this._j,n=0,o=0;o<4;o++){r=(r+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[r],e[r]=i,n|=e[(e[t]+e[r])%256]<<24-8*o}return this._i=t,this._j=r,n}e.RC4=t._createHelper(o);var a=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)o[r]^=n[r+4&7];if(t){var i=t.words,a=i[0],s=i[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;for(o[0]^=u,o[1]^=d,o[2]^=l,o[3]^=f,o[4]^=u,o[5]^=d,o[6]^=l,o[7]^=f,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),e[t+n]^=o[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,s=n>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],a=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)c.call(this);for(o=0;o<8;o++)n[o]^=r[o+4&7];if(t){var i=t.words,a=i[0],s=i[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;for(n[0]^=u,n[1]^=d,n[2]^=l,n[3]^=f,n[4]^=u,n[5]^=d,n[6]^=l,n[7]^=f,o=0;o<4;o++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),e[t+n]^=o[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,s=n>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)})),FM((function(e,t){e.exports=MF}))),UF=function(e){var t=e.blob;return new Promise((function(e){var r=new FileReader;r.onload=function(t){var r=t.target.result,n=LF.MD5(LF.lib.WordArray.create(r)).toString();e(n)},r.readAsArrayBuffer(t)}))},jF=Object.freeze({__proto__:null,MD5:UF}),FF=["tracking"],VF=TF(),zF=_w.createContext(),qF={enable:!1,accessKey:"",secretKey:"",apiUrl:"",userId:""},HF=function(){var e=uM(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.tag,n=t.event,o=t.log,i=IF(new Date),a=o,e.t0=n,e.next="sdk_mode.read_id_card_one_side"===e.t0?6:"sdk_mode.liveness"===e.t0?19:36;break;case 6:return a=EF(o),s=o.result_object,e.next=10,UF({blob:s.image.blob});case 10:if(e.t1=e.sent,a.result_object.image={blob:e.t1},delete a.result_object.recordedVideos,!s.qrScannedResult){e.next=18;break}return e.next=16,UF({blob:s.qrScannedResult.image.blob});case 16:a.result_object.qrScannedResult.image.blob=e.sent,delete a.result_object.qrScannedResult.recordedVideos;case 18:return e.abrupt("break",36);case 19:return a=EF(o),c=o.result_object,u=c.steps,l=c.frontalFaces,d=c.frontalScaledImage,f=u.map((function(e){return UF({blob:e.image.blob})})),e.next=24,Promise.all(f);case 24:return p=e.sent,u.forEach((function(e,t){a.result_object.steps[t].image.blob=p[t]})),h=l.map((function(e){return UF({blob:e})})),e.next=29,Promise.all(h);case 29:if(m=e.sent,l.forEach((function(e,t){a.result_object.frontalFaces[t]=m[t]})),!d){e.next=35;break}return e.next=34,UF({blob:d});case 34:a.result_object.frontalScaledImage=e.sent;case 35:return e.abrupt("break",36);case 36:return e.abrupt("return",{tag:r,event:n,log:gM({device_time:i},a)});case 37:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function KF(e){var t,r=e.userId;if(r)t=r;else{var n=NF("user-id");if(n)t=n;else{var o=SF();t=o,OF(o,"user-id")}}return t}function WF(e){var t=e.value,r=e.children,n=t.tracking,o=void 0===n?qF:n,i=vM(t,FF),a=o.enable,s=void 0===a||a,c=o.accessKey,u=o.secretKey,l=o.apiUrl,d=o.userId,f=o.logSignature,p=_w.useCallback((function(e,t){if(f&&3===Object.keys(f).length){var r=f.timestamp,n=f.signature,o=f.logUrl;return fetch(o,{method:"POST",headers:gM({"X-TV-Timestamp":r,Authorization:n,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}if(s){if(!l||!c||!u)return console.error("apiUrl, accessKey and secretKey are required when tracking is enabled"),null;var i=new vF(c,u,l).httpClient.authorizer.getHeaders({requestPath:"/v1/log_events",method:"POST"});return fetch("".concat(l,"/v1/log_events"),{method:"POST",headers:gM({"X-TV-Timestamp":i["X-TV-Timestamp"],Authorization:i.Authorization,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}return null}),[f,s,l,c,u]),h=_w.useMemo((function(){return{"x-request-id":KF({userId:d})}}),[d]),m=_w.useCallback(uM(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.tag,n=t.event,o=t.log,i=void 0===o?{}:o,!s){e.next=11;break}return e.prev=2,e.next=5,HF({tag:r,event:n,log:i});case 5:a=e.sent,p(a,gM(gM({},h),VF)),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:case"end":return e.stop()}}),e,null,[[2,9]])}))),[p,h,s]);return _w.createElement(zF.Provider,{value:gM(gM({},i),{},{sendEvent:m})},r)}WF.propTypes={value:_k.shape({tracking:_k.shape({enable:_k.bool,accessKey:_k.string,secretKey:_k.string,apiUrl:_k.string,userId:_k.string})}).isRequired,children:_k.node.isRequired};var GF=Object.freeze({__proto__:null,defaultTrackingConfig:qF,getXRequestId:KF,SDKTrackingProvider:WF,useSDKTracking:function(){var e=_w.useContext(zF);return _w.useMemo((function(){return void 0===e?(console.warn("useSDKTracking must be used within a SDKTrackingProvider"),{sendEvent:function(){}}):e}),[e])}});function QF(e,t){return e&&!e.endsWith("/")?[e,"/",t].join(""):[e,t].join("")}function XF(){var e=pF();return null==e?void 0:e.assetRoot}var YF=Object.freeze({__proto__:null,getAsset:QF,useAssetRoot:XF,useAsset:function(e){return QF(XF(),e)}});function $F(e){return new Promise((function(t){return setTimeout(t,e)}))}var ZF=Object.freeze({__proto__:null,sleep:$F}),JF=Symbol("Comlink.proxy"),eV=Symbol("Comlink.endpoint"),tV=Symbol("Comlink.releaseProxy"),rV=Symbol("Comlink.thrown"),nV=function(e){return"object"==Ey(e)&&null!==e||"function"==typeof e},oV=new Map([["proxy",{canHandle:function(e){return nV(e)&&e[JF]},serialize:function(e){var t=new MessageChannel,r=t.port1,n=t.port2;return iV(e,r),[n,[n]]},deserialize:function(e){return e.start(),sV(e)}}],["throw",{canHandle:function(e){return nV(e)&&rV in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function iV(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;t.addEventListener("message",(function r(n){if(n&&n.data){var o,i=Object.assign({path:[]},n.data),a=i.id,s=i.type,c=i.path,u=(n.data.argumentList||[]).map(pV);try{var l=c.slice(0,-1).reduce((function(e,t){return e[t]}),e),d=c.reduce((function(e,t){return e[t]}),e);switch(s){case"GET":o=d;break;case"SET":l[c.slice(-1)[0]]=pV(n.data.value),o=!0;break;case"APPLY":o=d.apply(l,u);break;case"CONSTRUCT":o=function(e){return Object.assign(e,Iy({},JF,!0))}(jy(d,Gy(u)));break;case"ENDPOINT":var f=new MessageChannel,p=f.port1,h=f.port2;iV(e,h),o=function(e,t){return dV.set(e,t),e}(p,[p]);break;case"RELEASE":o=void 0;break;default:return}}catch(e){o=Iy({value:e},rV,0)}Promise.resolve(o).catch((function(e){return Iy({value:e},rV,0)})).then((function(e){var n=Wy(fV(e),2),o=n[0],i=n[1];t.postMessage(Object.assign(Object.assign({},o),{id:a}),i),"RELEASE"===s&&(t.removeEventListener("message",r),aV(t))}))}})),t.start&&t.start()}function aV(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function sV(e,t){return uV(e,[],t)}function cV(e){if(e)throw new Error("Proxy has been released and is not useable")}function uV(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=!1,o=new Proxy(r,{get:function(r,i){if(cV(n),i===tV)return function(){return hV(e,{type:"RELEASE",path:t.map((function(e){return e.toString()}))}).then((function(){aV(e),n=!0}))};if("then"===i){if(0===t.length)return{then:function(){return o}};var a=hV(e,{type:"GET",path:t.map((function(e){return e.toString()}))}).then(pV);return a.then.bind(a)}return uV(e,[].concat(Gy(t),[i]))},set:function(r,o,i){cV(n);var a=Wy(fV(i),2),s=a[0],c=a[1];return hV(e,{type:"SET",path:[].concat(Gy(t),[o]).map((function(e){return e.toString()})),value:s},c).then(pV)},apply:function(r,o,i){cV(n);var a=t[t.length-1];if(a===eV)return hV(e,{type:"ENDPOINT"}).then(pV);if("bind"===a)return uV(e,t.slice(0,-1));var s=Wy(lV(i),2),c=s[0],u=s[1];return hV(e,{type:"APPLY",path:t.map((function(e){return e.toString()})),argumentList:c},u).then(pV)},construct:function(r,o){cV(n);var i=Wy(lV(o),2),a=i[0],s=i[1];return hV(e,{type:"CONSTRUCT",path:t.map((function(e){return e.toString()})),argumentList:a},s).then(pV)}});return o}function lV(e){var t,r=e.map(fV);return[r.map((function(e){return e[0]})),(t=r.map((function(e){return e[1]})),Array.prototype.concat.apply([],t))]}var dV=new WeakMap;function fV(e){var t,r=rb(oV);try{for(r.s();!(t=r.n()).done;){var n=Wy(t.value,2),o=n[0],i=n[1];if(i.canHandle(e)){var a=Wy(i.serialize(e),2);return[{type:"HANDLER",name:o,value:a[0]},a[1]]}}}catch(e){r.e(e)}finally{r.f()}return[{type:"RAW",value:e},dV.get(e)||[]]}function pV(e){switch(e.type){case"HANDLER":return oV.get(e.name).deserialize(e.value);case"RAW":return e.value}}function hV(e,t,r){return new Promise((function(n){var o=new Array(4).fill(0).map((function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)})).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===o&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)}))}var mV=function(){if(!window.Worker)return null;var e=new Blob(['const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),n=Symbol("Comlink.thrown"),a=t=>"object"==typeof t&&null!==t||"function"==typeof t,o=new Map([["proxy",{canHandle:e=>a(e)&&e[t],serialize(t){const{port1:e,port2:r}=new MessageChannel;return i(t,e),[r,[r]]},deserialize(t){return t.start(),s(t,[],e);var e}}],["throw",{canHandle:t=>a(t)&&n in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function i(e,r=self){r.addEventListener("message",(function a(o){if(!o||!o.data)return;const{id:c,type:s,path:l}=Object.assign({path:[]},o.data),g=(o.data.argumentList||[]).map(m);let p;try{const r=l.slice(0,-1).reduce(((t,e)=>t[e]),e),n=l.reduce(((t,e)=>t[e]),e);switch(s){case"GET":p=n;break;case"SET":r[l.slice(-1)[0]]=m(o.data.value),p=!0;break;case"APPLY":p=n.apply(r,g);break;case"CONSTRUCT":p=function(e){return Object.assign(e,{[t]:!0})}(new n(...g));break;case"ENDPOINT":{const{port1:t,port2:r}=new MessageChannel;i(e,r),p=function(t,e){return f.set(t,e),t}(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(t){p={value:t,[n]:0}}Promise.resolve(p).catch((t=>({value:t,[n]:0}))).then((t=>{const[e,n]=h(t);r.postMessage(Object.assign(Object.assign({},e),{id:c}),n),"RELEASE"===s&&(r.removeEventListener("message",a),u(r))}))})),r.start&&r.start()}function u(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function c(t){if(t)throw new Error("Proxy has been released and is not useable")}function s(t,n=[],a=function(){}){let o=!1;const i=new Proxy(a,{get(e,a){if(c(o),a===r)return()=>g(t,{type:"RELEASE",path:n.map((t=>t.toString()))}).then((()=>{u(t),o=!0}));if("then"===a){if(0===n.length)return{then:()=>i};const e=g(t,{type:"GET",path:n.map((t=>t.toString()))}).then(m);return e.then.bind(e)}return s(t,[...n,a])},set(e,r,a){c(o);const[i,u]=h(a);return g(t,{type:"SET",path:[...n,r].map((t=>t.toString())),value:i},u).then(m)},apply(r,a,i){c(o);const u=n[n.length-1];if(u===e)return g(t,{type:"ENDPOINT"}).then(m);if("bind"===u)return s(t,n.slice(0,-1));const[f,h]=l(i);return g(t,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:f},h).then(m)},construct(e,r){c(o);const[a,i]=l(r);return g(t,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:a},i).then(m)}});return i}function l(t){const e=t.map(h);return[e.map((t=>t[0])),(r=e.map((t=>t[1])),Array.prototype.concat.apply([],r))];var r}const f=new WeakMap;function h(t){for(const[e,r]of o)if(r.canHandle(t)){const[n,a]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},a]}return[{type:"RAW",value:t},f.get(t)||[]]}function m(t){switch(t.type){case"HANDLER":return o.get(t.name).deserialize(t.value);case"RAW":return t.value}}function g(t,e,r){return new Promise((n=>{const a=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.addEventListener("message",(function e(r){r.data&&r.data.id&&r.data.id===a&&(t.removeEventListener("message",e),n(r.data))})),t.start&&t.start(),t.postMessage(Object.assign({id:a},e),r)}))}var p=[[0,1,0],[1,-4,1],[0,1,0]];function d(t,e,r,n){return t[4*(r*e+n)]}function v(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var E="frontal",S="left",w="right",M="up",k="down",_=0,A=1,R=2;function L(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=y(t,2),a=n[0],o=n[1],i=y(e,2),u=i[0],c=i[1],s=[a[0],o[0]],l=[a[1],o[1]];return s[0]+r<=u[0]&&c[0]<=s[1]-r&&l[0]+r<=u[1]&&c[1]<=l[1]-.8*r?R:s[0]<=u[0]||c[0]<=s[1]||l[0]<=u[1]||c[1]<=l[1]?A:_}var P={code:"no_face",msg:{en:"Face not found",vi:"Không tìm thấy khuôn mặt"}},O={code:"partial_face",msg:{en:"Face out of the box",vi:"Không tìm thấy toàn bộ khuôn mặt"}},T={code:"multiple_faces",msg:{en:"Too many faces",vi:"Quá nhiều khuôn mặt"}},j={code:"face_too_small",msg:{en:"Face too small",vi:"Khuôn mặt quá nhỏ"}},F={code:"face_too_large",msg:{en:"Face too large",vi:"Khuôn mặt quá to"}},x={code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt không nằm trọn vẹn trong khung ảnh"}};function C(t){return Math.pow(Math.pow(t[0],2)+Math.pow(t[1],2),.5)}function N(t,e){return[t[0]-e[0],t[1]-e[1]]}function z(t,e,r,n){var a=r*(4*e)+4*n;return{r:t[a],g:t[a+1],b:t[a+2]}}i({calculateBlurScoreFunc:function(t){for(var e=t.data,r=t.reducedWidth,n=t.reducedHeight,a=0;a<e.length;a+=4){var o=(e[a]+e[a+1]+e[a+2])/3;e[a]=o}for(var i=0,u=0,c=n-1,s=r-1,l=1;l<c;l++)for(var f=1;f<s;f++){var h=p[0][0]*d(e,r,f-1,l-1)+p[0][1]*d(e,r,f,l-1)+p[0][2]*d(e,r,f+1,l-1)+p[1][0]*d(e,r,f-1,l)+p[1][1]*d(e,r,f,l)+p[1][2]*d(e,r,f+1,l)+p[2][0]*d(e,r,f-1,l+1)+p[2][1]*d(e,r,f,l+1)+p[2][2]*d(e,r,f+1,l+1);(h=Math.abs(h))>25&&i++,h>15&&h<25&&u++}var m=0;return i+u!==0&&(m=i/(i+u)),m},calculateFaceDirectionFunc:function(t){var e=t.landmarks,r=t.getPerfectFrontal,n=function(t){var e,r,n,a,o,i,u,c=y(t,4),s=c[0],l=c[1],f=c[2],h=c[3],m=N(l,s),g=C(m),p=(a=l,e=[(n=s)[0]+a[0],n[1]+a[1]],r=2,[e[0]/r,e[1]/r]),d=N(f,p),v=C(N(h,f)),b=N(h,p),E=C(b),S=(d[0]*b[0]+d[1]*b[1])/E,w=v/E;if(g>.5*E)o=(d[0]*m[0]+d[1]*m[1])/g/g;else{var M=C(N(d,function(t,e){return[t[0]*e,t[1]*e]}(b,S/E)));u=b,o=((i=d)[0]*u[1]-u[0]*i[1]>=0?1:-1)*M/g}return{left_right_score:o,up_down_score:w}}(e),a=n.left_right_score,o=n.up_down_score,i=y(e,3),u=i[0],c=i[1],s=i[2],l=c[0]-s[0],f=u[0]-s[0],h=r?.1:.3,m=o>.7,g=o<.42,p=a>=.35&&a<=.6,d=a<=-.35&&a>=-.6;return o>=.42&&o<=.7&&a>-h&&a<h&&l*f<0?{gesture:E,leftRightScore:a}:m&&!d&&!p?{gesture:M,leftRightScore:a}:g&&!d&&!p?{gesture:k,leftRightScore:a}:p&&!m&&!g?{gesture:w,leftRightScore:a}:d&&!m&&!g?{gesture:S,leftRightScore:a}:null},validatePredictionsFunc:function(t){var e,r,n,a,o,i,u,c,s,l,f,h,m,g,p,d,b,E,S,w,M,k,C,N,z,H,I,D,K,G,W,U,q,Y=t.predictions,B=t.width,Q=[[0,0],[B,t.height]],X=Y.reduce((function(t,e){var r=e.topLeft,n=e.bottomRight,a=e.probability,o=e.landmarks;a<.9||o.length<6||function(t){var e=t.small,r=e.coords,n=e.area,a=t.big,o=a.coords,i=a.area,u=n;if(!u){var c=y(r,2),s=c[0],l=c[1];u=(l[0]-s[0])*(l[1]-s[1])}var f=i;if(!f){var h=y(o,2),m=h[0],g=h[1];f=(g[0]-m[0])*(g[1]-m[1])}return u/f}({small:{coords:[r,n]},big:{coords:Q}})<=.025?t[_].push(e):t[L(Q,[r,n])].push(e);return t}),(v(e={},A,[]),v(e,R,[]),v(e,_,[]),e)),$=X[R].length,J=X[A].length;if(0===$)r=J>0?O:P;else if($+J>1)r=T;else{var V=n=X[R][0],Z=V.topLeft,tt=V.bottomRight;N=Q,z=y([Z,tt],2),H=z[0],I=z[1],D=y(N,2),K=D[0],G=D[1],W=I[0]-H[0],U=I[1]-H[1],q=G[0]-K[0],(a=W/q<U/q?W/q:U/q)<.4&&(r=j),a>.61&&(r=F),L(Q,(o=n.landmarks,c=o[0],s=o[1],l=o[2],f=o[3],h=o[4],m=o[5],g=.5*(c[1]+s[1]),p=g+1.5*(g-f[1]),d=f[1]-1.2*(l[1]-f[1]),b=[c[0],s[0],l[0],f[0],h[0],m[0]],E=Math.min.apply(Math,b),S=Math.min(p,d),w=Math.max.apply(Math,b),M=Math.max(p,d),k=Math.abs(f[0]-h[0])/Math.abs(f[0]-m[0]),C=f[0]-h[0]<0&&m[0]-f[0]>.05*(w-E),f[0]-h[0]>0&&m[0]-f[0]<-.05*(w-E)?(i=.2,u=.1):C?(i=.1,u=.2):k>2||k<.5?(i=.15,u=.15):(i=.05,u=.05),[[E-i*(w-E),S],[w+u*(w-E),M]]),.05*B)!==R&&(r=x)}return{error:r,fullFace:n,faceRatio:a,faceNotFrontalMinThreshold:.38}},detectGlare:function(t,e,r){return function(t,e,r){for(var n=0,a=r[1],o=r[3],i=r[0],u=r[2],c=a;c<o;c++)for(var s=i;s<u;s++){var l=z(t,e,c,s),f=l.r,h=l.g,m=l.b;f>=245&&m>=245&&h>245&&(n+=1)}return n}(t,e,function(t,e){var r=Math.floor(.025*t),n=t-r,a=Math.floor(.025*e);return[r,a,n,e-a]}(e,r))/(e*r)>=.001}});']),t=URL.createObjectURL(e);return sV(new Worker(t))}(),gV=[[0,1,0],[1,-4,1],[0,1,0]];function vV(e,t,r,n){return e[4*(r*t+n)]}function yV(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,o=0;o<t.length;o+=4){var i=(t[o]+t[o+1]+t[o+2])/3;t[o]=i}for(var a=0,s=0,c=n-1,u=r-1,l=1;l<c;l++)for(var d=1;d<u;d++){var f=gV[0][0]*vV(t,r,d-1,l-1)+gV[0][1]*vV(t,r,d,l-1)+gV[0][2]*vV(t,r,d+1,l-1)+gV[1][0]*vV(t,r,d-1,l)+gV[1][1]*vV(t,r,d,l)+gV[1][2]*vV(t,r,d+1,l)+gV[2][0]*vV(t,r,d-1,l+1)+gV[2][1]*vV(t,r,d,l+1)+gV[2][2]*vV(t,r,d+1,l+1);(f=Math.abs(f))>25&&a++,f>15&&f<25&&s++}var p=0;return a+s!==0&&(p=a/(a+s)),p}function bV(e){var t=e.width,r=e.height,n=e.getContext("2d"),o=Math.floor(t/2.8),i=Math.floor(r/2.8),a=t-o,s=r-i;return{data:n.getImageData(Math.floor(o/2),Math.floor(i/2),a,s).data,reducedWidth:a,reducedHeight:s}}function wV(){return(wV=uM(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=bV(t),mV){e.next=3;break}return e.abrupt("return",yV(r));case 3:return e.abrupt("return",mV.calculateBlurScoreFunc(r));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kV(e,t,r,n){return e[4*(n*t+r)]}var CV=Object.freeze({__proto__:null,calculateBlurScore:function(e){return wV.apply(this,arguments)},hasBetterBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||e-t>r},hasBetterCardBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||t-e>r},calculateIdCardBlurScore:function(e){var t=e.canvas,r=document.createElement("canvas"),n=r.getContext("2d");r.width=430,r.height=270,n.drawImage(t,0,0,r.width,r.height);var o=Math.floor(129),i=Math.floor(13.5),a=Math.floor(408.5),s=Math.floor(256.5),c=document.createElement("canvas"),u=c.getContext("2d"),l=a-o,d=s-i;c.width=l,c.height=d,u.drawImage(r,o,i,l,d,0,0,l,d);for(var f=u.getImageData(0,0,l,d).data,p=0;p<f.length;p+=4){var h=Math.round(.299*f[p]+.587*f[p+1]+.114*f[p+2]);f[p]=h}for(var m=d-1,g=l-1,v=0,y=[],b=1;b<m;b++)for(var w=1;w<g;w++){var k=4*-kV(f,l,w,b)+kV(f,l,w,b-1)+kV(f,l,w,b+1)+kV(f,l,w-1,b)+kV(f,l,w+1,b);v+=k,y.push(k)}v/=(l-2)*(d-2);for(var C=0,B=0;B<y.length;B++){var S=y[B]-v;C+=Math.pow(S,2)}var E=Math.sqrt(C/y.length);return 1/(1+Math.pow(2,E/2-10))}});function BV(e){var t,r,n,o,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=s.x,l=s.y,d=s.width,f=s.height,p=e.videoWidth,h=e.videoHeight,m=window.innerWidth,g=window.innerHeight,v=m/g,y=p/h;v<y?(i=u*(n=p/m),a=(l-(t=(g-m/y)/2))*(o=h/(g-2*t))):(i=(u-(r=(m-g*y)/2))*(n=p/(m-2*r)),a=l*(o=h/g));var b=d*n,w=f*o,k=b,C=w,B=Math.max(b,w)*c;return{lostX:r,lostY:t,cropWidth:b=Math.floor(Math.min(p,b+2*B)),cropHeight:w=Math.floor(Math.min(h,w+2*B)),cropX:i=Math.floor(Math.max(0,i-B)),cropY:a=Math.floor(Math.max(0,a-B)),cropWidthWithoutPadding:k,cropHeightWithoutPadding:C}}var SV=Object.freeze({__proto__:null,analyzeVideoAndWindowSizes:BV,takePicture:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.canvas,n=t.video,o=t.cropArea,i=t.quality,a=void 0===i?1:i;if(r)e=r;else{var s=BV(n,o),c=s.cropWidth,u=s.cropHeight,l=s.cropX,d=s.cropY,f=(e=document.createElement("canvas")).getContext("2d");e.width=c,e.height=u,f.drawImage(n,l,d,c,u,0,0,c,u)}return new Promise((function(t){e.toBlob(t,"image/jpeg",a)}))}}),EV=function(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=[e[r],e[t]];e[t]=n[0],e[r]=n[1]}return e},_V=Object.freeze({__proto__:null,shuffleArray:EV}),xV={NONE:0,PARTIAL:1,FULL:2};function TV(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=yM(e,2),o=n[0],i=n[1],a=yM(t,2),s=a[0],c=a[1],u=[o[0],i[0]],l=[o[1],i[1]];return u[0]+r<=s[0]&&c[0]<=u[1]-r&&l[0]+r<=s[1]&&c[1]<=l[1]-.8*r?xV.FULL:u[0]<=s[0]||c[0]<=u[1]||l[0]<=s[1]||c[1]<=l[1]?xV.PARTIAL:xV.NONE}function AV(e){var t=e.small,r=t.coords,n=t.area,o=e.big,i=o.coords,a=o.area,s=n;if(!s){var c=yM(r,2),u=c[0],l=c[1];s=(l[0]-u[0])*(l[1]-u[1])}var d=a;if(!d){var f=yM(i,2),p=f[0],h=f[1];d=(h[0]-p[0])*(h[1]-p[1])}return s/d}function PV(e,t){var r=yM(e,2),n=r[0],o=r[1],i=yM(t,2),a=i[0],s=i[1],c=o[0]-n[0],u=o[1]-n[1],l=s[0]-a[0];return c/l<u/l?c/l:u/l}var IV=Object.freeze({__proto__:null,ContainMode:xV,rectContains:TV,rectAreaRatio:AV,rectEdgeRatio:PV,isFaceCenter:function(e,t){var r=yM(e,2),n=r[0],o=r[1],i=yM(t,2),a=i[0],s=i[1],c=o[0]-n[0],u=o[1]-n[1],l=s[0]-a[0],d=Math.abs(n[0]-(l-c)/2)/l<.2,f=Math.abs(n[1]-(l-u)/2)/l<.2;return!(!d||!f)}});function RV(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function OV(e,t){return[e[0]-t[0],e[1]-t[1]]}function NV(e){var t=e.landmarks,r=e.getPerfectFrontal,n=function(e){var t,r,n,o,i,a,s=yM(e,4),c=s[0],u=s[1],l=s[2],d=s[3],f=OV(u,c),p=RV(f),h=(n=u,2,[(t=[(r=c)[0]+n[0],r[1]+n[1]])[0]/2,t[1]/2]),m=OV(l,h),g=RV(OV(d,l)),v=OV(d,h),y=RV(v),b=(m[0]*v[0]+m[1]*v[1])/y,w=g/y;if(p>.5*y)o=(m[0]*f[0]+m[1]*f[1])/p/p;else{var k=RV(OV(m,function(e,t){return[e[0]*t,e[1]*t]}(v,b/y)));a=v,o=((i=m)[0]*a[1]-a[0]*i[1]>=0?1:-1)*k/p}return{left_right_score:o,up_down_score:w}}(t),o=n.left_right_score,i=n.up_down_score,a=yM(t,3),s=a[0],c=a[1],u=a[2],l=c[0]-u[0],d=s[0]-u[0],f=r?.1:.3,p=i>.7,h=i<.42,m=o>=.35&&o<=.6,g=o<=-.35&&o>=-.6;return i>=.42&&i<=.7&&o>-f&&o<f&&l*d<0?{gesture:aM.FRONTAL,leftRightScore:o}:!p||g||m?!h||g||m?!m||p||h?!g||p||h?null:{gesture:aM.LEFT,leftRightScore:o}:{gesture:aM.RIGHT,leftRightScore:o}:{gesture:aM.DOWN,leftRightScore:o}:{gesture:aM.UP,leftRightScore:o}}function DV(e){var t,r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S=e.predictions,E=e.width,_=[[0,0],[E,e.height]],x=S.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,o=t.probability,i=t.landmarks;return o<.9||i.length<6||AV({small:{coords:[r,n]},big:{coords:_}})<=.025?e[xV.NONE].push(t):e[TV(_,[r,n])].push(t),e}),(pM(t={},xV.PARTIAL,[]),pM(t,xV.FULL,[]),pM(t,xV.NONE,[]),t)),T=x[xV.FULL].length,A=x[xV.PARTIAL].length;if(0===T)r=A>0?iM.partial_face:iM.no_face;else if(T+A>1)r=iM.multiple_faces;else{var P=n=x[xV.FULL][0];(o=PV([P.topLeft,P.bottomRight],_))<.4&&(r=iM.face_too_small),o>.61&&(r=iM.face_too_large),TV(_,(c=(i=n.landmarks)[0],u=i[1],l=i[2],d=i[3],f=i[4],p=i[5],m=(h=.5*(c[1]+u[1]))+1.5*(h-d[1]),g=d[1]-1.2*(l[1]-d[1]),v=[c[0],u[0],l[0],d[0],f[0],p[0]],y=Math.min.apply(Math,v),b=Math.min(m,g),w=Math.max.apply(Math,v),k=Math.max(m,g),C=Math.abs(d[0]-f[0])/Math.abs(d[0]-p[0]),B=d[0]-f[0]<0&&p[0]-d[0]>.05*(w-y),d[0]-f[0]>0&&p[0]-d[0]<-.05*(w-y)?(a=.2,s=.1):B?(a=.1,s=.2):C>2||C<.5?(a=.15,s=.15):(a=.05,s=.05),[[y-a*(w-y),b],[w+s*(w-y),k]]),.05*E)!==xV.FULL&&(r=iM.face_out_of_box)}return{error:r,fullFace:n,faceRatio:o,faceNotFrontalMinThreshold:.38}}function MV(e,t){var r=t.customInstructions,n=t.customIcon,o=t.customDirectionIcon,i=t.customStepTimeConstraints,a={};return null!=r&&r[e]&&(a.instructions=r[e]),null!=n&&n[e]&&(a.icon=n[e]),null!=o&&o[e]&&(a.directionIcon=o[e]),null!=i&&i[e]&&(a.stepTimeConstraints=i[e]),a}function LV(){return(LV=uM(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(mV){e.next=2;break}return e.abrupt("return",DV(t));case 2:return e.abrupt("return",mV.validatePredictionsFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function UV(){return(UV=uM(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(mV){e.next=2;break}return e.abrupt("return",NV(t));case 2:return e.abrupt("return",mV.calculateFaceDirectionFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jV=Object.freeze({__proto__:null,initFaceVerificationData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.assetRoot,r=void 0===t?"/":t,n=e.customInstructions,o=e.customIcon,i=e.customDirectionIcon,a=e.customStepTimeConstraints;return{curStepIndex:0,steps:[].concat(bM(EV([gM({name:aM.LEFT,instructions:{en:"Turn your face to the left",vi:"Quay mặt chậm qua trái"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:QF(r,"ic_face_left.svg"),directionIcon:QF(r,"arrow_left.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},MV(aM.LEFT,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a})),gM({name:aM.RIGHT,instructions:{en:"Turn your face to the right",vi:"Quay mặt chậm qua phải"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:QF(r,"ic_face_right.svg"),directionIcon:QF(r,"arrow_right.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},MV(aM.RIGHT,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a})),gM({name:aM.UP,instructions:{en:"Turn your face up",vi:"Ngước mặt chậm lên trên"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:QF(r,"ic_face_up.svg"),directionIcon:QF(r,"arrow_up.svg"),directionIconAnimation:"slide-vertical",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},MV(aM.UP,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a}))])),[gM({name:aM.FRONTAL,instructions:{en:"Look straight into the camera",vi:"Nhìn thẳng camera"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:QF(r,"ic_face_frontal.svg"),directionIcon:QF(r,"frontal.svg"),directionIconAnimation:"blink",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},MV(aM.FRONTAL,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a}))])}},validatePredictions:function(e){return LV.apply(this,arguments)},calculateFaceDirection:function(e){return UV.apply(this,arguments)},faceTracker:function(){var e=[],t=[],r=[],n=[],o=[],i=0,a=0;function s(){a=i,r=bM(e),n=bM(t)}return function(c,u){var l=c.topLeft,d=c.bottomRight,f=c.landmarks,p=[],h=yM(l,2);p[0]=h[0],p[1]=h[1];var m=yM(d,2);p[2]=m[0],p[3]=m[1];var g=[],v=[];f.forEach((function(e,t){var r=yM(e,2);g[t]=r[0],v[t]=r[1]})),i=Date.now();var y=p[2]-p[0];if(e=[].concat(g),t=[].concat(v),!r.length&&!n.length||u)return s(),{score:0,time:i};for(var b=0;b<6;b++)o[b]=Math.sqrt((e[b]-r[b])*(e[b]-r[b])+(t[b]-n[b])*(t[b]-n[b]));for(var w=0;w<6;w++)o[w]/=(i-a)*y;for(var k=0,C=0;C<6;C++)k+=o[C];return k/=6,s(),{score:k,time:i}}}}),FV=function(){var e=uM(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.model,n=t.sCanvas,e.abrupt("return",r.estimateFaces(n,!1,!1,!0));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),VV=Object.freeze({__proto__:null,SIZE:400,getModelPredictions:FV}),zV=Object.getOwnPropertySymbols,qV=Object.prototype.hasOwnProperty,HV=Object.prototype.propertyIsEnumerable;function KV(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var WV,GV=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,o=KV(e),i=1;i<arguments.length;i++){for(var a in r=Object(arguments[i]))qV.call(r,a)&&(o[a]=r[a]);if(zV){n=zV(r);for(var s=0;s<n.length;s++)HV.call(r,n[s])&&(o[n[s]]=r[n[s]])}}return o},QV=arguments[3],XV=arguments[4],YV=arguments[5],$V=JSON.stringify,ZV=function(e,t){for(var r,n=Object.keys(YV),o=0,i=n.length;o<i;o++){var a=n[o],s=YV[a].exports;if(s===e||s&&s.default===e){r=a;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(o=0,i=n.length;o<i;o++)c[a=n[o]]=a;XV[r]=["function(require,module,exports){"+e+"(self); }",c]}var u=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[r]=r,XV[u]=["function(require,module,exports){var f = require("+$V(r)+");(f.default ? f.default : f)(self);}",l];var d={};!function e(t){for(var r in d[t]=!0,XV[t][1]){var n=XV[t][1][r];d[n]||e(n)}}(u);var f="("+QV+")({"+Object.keys(d).map((function(e){return $V(e)+":["+XV[e][0]+","+$V(XV[e][1])+"]"})).join(",")+"},{},["+$V(u)+"])",p=window.URL||window.webkitURL||window.mozURL||window.msURL,h=new Blob([f],{type:"text/javascript"});if(t&&t.bare)return h;var m=p.createObjectURL(h),g=new Worker(m);return g.objectURL=m,g},JV=FM((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),ez={js:!0,wasm:!0};function tz(e){if(!(this instanceof tz))return new tz(e);var t=GV({},ez,e||{});if(this.options=t,this.__cache={},this.__init_promise=null,this.__modules=t.modules||{},this.__memory=null,this.__wasm={},this.__isLE=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0],!this.options.js&&!this.options.wasm)throw new Error('mathlib: at least "js" or "wasm" should be enabled')}tz.prototype.has_wasm=function(){if(void 0!==WV)return WV;if(WV=!1,"undefined"==typeof WebAssembly)return WV;try{var e=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),t=new WebAssembly.Module(e);return 0!==new WebAssembly.Instance(t,{}).exports.test(4)&&(WV=!0),WV}catch(e){}return WV},tz.prototype.use=function(e){return this.__modules[e.name]=e,this.options.wasm&&this.has_wasm()&&e.wasm_fn?this[e.name]=e.wasm_fn:this[e.name]=e.fn,this},tz.prototype.init=function(){if(this.__init_promise)return this.__init_promise;if(!this.options.js&&this.options.wasm&&!this.has_wasm())return Promise.reject(new Error('mathlib: only "wasm" was enabled, but it\'s not supported'));var e=this;return this.__init_promise=Promise.all(Object.keys(e.__modules).map((function(t){var r=e.__modules[t];return e.options.wasm&&e.has_wasm()&&r.wasm_fn?e.__wasm[t]?null:WebAssembly.compile(e.__base64decode(r.wasm_src)).then((function(r){e.__wasm[t]=r})):null}))).then((function(){return e})),this.__init_promise},tz.prototype.__base64decode=function(e){for(var t=e.replace(/[\r\n=]/g,""),r=t.length,n=new Uint8Array(3*r>>2),o=0,i=0,a=0;a<r;a++)a%4==0&&a&&(n[i++]=o>>16&255,n[i++]=o>>8&255,n[i++]=255&o),o=o<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t.charAt(a));var s=r%4*6;return 0===s?(n[i++]=o>>16&255,n[i++]=o>>8&255,n[i++]=255&o):18===s?(n[i++]=o>>10&255,n[i++]=o>>2&255):12===s&&(n[i++]=o>>4&255),n},tz.prototype.__reallocate=function(e){if(!this.__memory)return this.__memory=new WebAssembly.Memory({initial:Math.ceil(e/65536)}),this.__memory;var t=this.__memory.buffer.byteLength;return t<e&&this.__memory.grow(Math.ceil((e-t)/65536)),this.__memory},tz.prototype.__instance=function(e,t,r){if(t&&this.__reallocate(t),!this.__wasm[e]){var n=this.__modules[e];this.__wasm[e]=new WebAssembly.Module(this.__base64decode(n.wasm_src))}if(!this.__cache[e]){var o={memoryBase:0,memory:this.__memory,tableBase:0,table:new WebAssembly.Table({initial:0,element:"anyfunc"})};this.__cache[e]=new WebAssembly.Instance(this.__wasm[e],{env:GV(o,r||{})})}return this.__cache[e]},tz.prototype.__align=function(e,t){var r=e%(t=t||8);return e+(r?t-r:0)};var rz,nz,oz,iz,az,sz,cz=tz;function uz(e,t,r,n,o,i){var a,s,c,u,l,d,f,p,h,m,g,v,y,b;for(h=0;h<i;h++){for(f=h,p=0,u=l=(a=e[d=h*o])*n[6],g=n[0],v=n[1],y=n[4],b=n[5],m=0;m<o;m++)c=(s=e[d])*g+a*v+u*y+l*b,l=u,u=c,a=s,r[p]=u,p++,d++;for(p--,f+=i*(o-1),u=l=(a=e[--d])*n[7],s=a,g=n[2],v=n[3],m=o-1;m>=0;m--)c=s*g+a*v+u*y+l*b,l=u,u=c,a=s,s=e[d],t[f]=r[p]+u,d--,p--,f-=i}}var lz=function(e,t,r,n){if(n){var o=new Uint16Array(e.length),i=new Float32Array(Math.max(t,r)),a=function(e){e<.5&&(e=.5);var t=Math.exp(.527076)/e,r=Math.exp(-t),n=Math.exp(-2*t),o=(1-r)*(1-r)/(1+2*t*r-n);return rz=o,nz=o*(t-1)*r,oz=o*(t+1)*r,iz=-o*n,az=2*r,sz=-n,new Float32Array([rz,nz,oz,iz,az,sz,(rz+nz)/(1-az-sz),(oz+iz)/(1-az-sz)])}(n);uz(e,o,i,a,t,r),uz(o,e,i,a,r,t)}},dz={name:"unsharp_mask",fn:function(e,t,r,n,o,i){var a,s,c,u,l,d,f,p,h,m,g,v,y;if(!(0===n||o<.5)){o>2&&(o=2);var b=function(e,t,r){for(var n,o,i,a,s,c=t*r,u=new Uint16Array(c),l=0;l<c;l++)n=e[4*l],o=e[4*l+1],i=e[4*l+2],s=n>=o&&n>=i?n:o>=i&&o>=n?o:i,a=n<=o&&n<=i?n:o<=i&&o<=n?o:i,u[l]=257*(s+a)>>1;return u}(e,t,r),w=new Uint16Array(b);lz(w,t,r,o);for(var k=n/100*4096+.5|0,C=257*i|0,B=t*r,S=0;S<B;S++)v=2*(b[S]-w[S]),Math.abs(v)>=C&&(a=e[y=4*S],s=e[y+1],c=e[y+2],d=257*((p=a>=s&&a>=c?a:s>=a&&s>=c?s:c)+(f=a<=s&&a<=c?a:s<=a&&s<=c?s:c))>>1,f===p?u=l=0:(l=d<=32767?4095*(p-f)/(p+f)|0:4095*(p-f)/(510-p-f)|0,u=a===p?65535*(s-c)/(6*(p-f))|0:s===p?21845+(65535*(c-a)/(6*(p-f))|0):43690+(65535*(a-s)/(6*(p-f))|0)),(d+=k*v+2048>>12)>65535?d=65535:d<0&&(d=0),0===l?a=s=c=d>>8:(h=2*d-(m=d<=32767?d*(4096+l)+2048>>12:d+((65535-d)*l+2048>>12))>>8,m>>=8,a=(g=u+21845&65535)>=43690?h:g>=32767?h+(6*(m-h)*(43690-g)+32768>>16):g>=10922?m:h+(6*(m-h)*g+32768>>16),s=(g=65535&u)>=43690?h:g>=32767?h+(6*(m-h)*(43690-g)+32768>>16):g>=10922?m:h+(6*(m-h)*g+32768>>16),c=(g=u-21845&65535)>=43690?h:g>=32767?h+(6*(m-h)*(43690-g)+32768>>16):g>=10922?m:h+(6*(m-h)*g+32768>>16)),e[y]=a,e[y+1]=s,e[y+2]=c)}},wasm_fn:function(e,t,r,n,o,i){if(!(0===n||o<.5)){o>2&&(o=2);var a=t*r,s=4*a,c=2*a,u=2*a,l=4*Math.max(t,r),d=s,f=d+c,p=f+u,h=p+u,m=h+l,g=this.__instance("unsharp_mask",s+c+2*u+l+32,{exp:Math.exp}),v=new Uint32Array(e.buffer);new Uint32Array(this.__memory.buffer).set(v);var y=g.exports.hsl_l16||g.exports._hsl_l16;y(0,d,t,r),(y=g.exports.blurMono16||g.exports._blurMono16)(d,f,p,h,m,t,r,o),(y=g.exports.unsharp||g.exports._unsharp)(0,0,d,f,t,r,n,i),v.set(new Uint32Array(this.__memory.buffer,0,a))}},wasm_src:"AGFzbQEAAAABMQZgAXwBfGACfX8AYAZ/f39/f38AYAh/f39/f39/fQBgBH9/f38AYAh/f39/f39/fwACGQIDZW52A2V4cAAAA2VudgZtZW1vcnkCAAEDBgUBAgMEBQQEAXAAAAdMBRZfX2J1aWxkX2dhdXNzaWFuX2NvZWZzAAEOX19nYXVzczE2X2xpbmUAAgpibHVyTW9ubzE2AAMHaHNsX2wxNgAEB3Vuc2hhcnAABQkBAAqJEAXZAQEGfAJAIAFE24a6Q4Ia+z8gALujIgOaEAAiBCAEoCIGtjgCECABIANEAAAAAAAAAMCiEAAiBbaMOAIUIAFEAAAAAAAA8D8gBKEiAiACoiAEIAMgA6CiRAAAAAAAAPA/oCAFoaMiArY4AgAgASAEIANEAAAAAAAA8L+gIAKioiIHtjgCBCABIAQgA0QAAAAAAADwP6AgAqKiIgO2OAIIIAEgBSACoiIEtow4AgwgASACIAegIAVEAAAAAAAA8D8gBqGgIgKjtjgCGCABIAMgBKEgAqO2OAIcCwu3AwMDfwR9CHwCQCADKgIUIQkgAyoCECEKIAMqAgwhCyADKgIIIQwCQCAEQX9qIgdBAEgiCA0AIAIgAC8BALgiDSADKgIYu6IiDiAJuyIQoiAOIAq7IhGiIA0gAyoCBLsiEqIgAyoCALsiEyANoqCgoCIPtjgCACACQQRqIQIgAEECaiEAIAdFDQAgBCEGA0AgAiAOIBCiIA8iDiARoiANIBKiIBMgAC8BALgiDaKgoKAiD7Y4AgAgAkEEaiECIABBAmohACAGQX9qIgZBAUoNAAsLAkAgCA0AIAEgByAFbEEBdGogAEF+ai8BACIIuCINIAu7IhGiIA0gDLsiEqKgIA0gAyoCHLuiIg4gCrsiE6KgIA4gCbsiFKKgIg8gAkF8aioCALugqzsBACAHRQ0AIAJBeGohAiAAQXxqIQBBACAFQQF0ayEHIAEgBSAEQQF0QXxqbGohBgNAIAghAyAALwEAIQggBiANIBGiIAO4Ig0gEqKgIA8iECAToqAgDiAUoqAiDyACKgIAu6CrOwEAIAYgB2ohBiAAQX5qIQAgAkF8aiECIBAhDiAEQX9qIgRBAUoNAAsLCwvfAgIDfwZ8AkAgB0MAAAAAWw0AIARE24a6Q4Ia+z8gB0MAAAA/l7ujIgyaEAAiDSANoCIPtjgCECAEIAxEAAAAAAAAAMCiEAAiDraMOAIUIAREAAAAAAAA8D8gDaEiCyALoiANIAwgDKCiRAAAAAAAAPA/oCAOoaMiC7Y4AgAgBCANIAxEAAAAAAAA8L+gIAuioiIQtjgCBCAEIA0gDEQAAAAAAADwP6AgC6KiIgy2OAIIIAQgDiALoiINtow4AgwgBCALIBCgIA5EAAAAAAAA8D8gD6GgIgujtjgCGCAEIAwgDaEgC6O2OAIcIAYEQCAFQQF0IQogBiEJIAIhCANAIAAgCCADIAQgBSAGEAIgACAKaiEAIAhBAmohCCAJQX9qIgkNAAsLIAVFDQAgBkEBdCEIIAUhAANAIAIgASADIAQgBiAFEAIgAiAIaiECIAFBAmohASAAQX9qIgANAAsLC7wBAQV/IAMgAmwiAwRAQQAgA2shBgNAIAAoAgAiBEEIdiIHQf8BcSECAn8gBEH/AXEiAyAEQRB2IgRB/wFxIgVPBEAgAyIIIAMgAk8NARoLIAQgBCAHIAIgA0kbIAIgBUkbQf8BcQshCAJAIAMgAk0EQCADIAVNDQELIAQgByAEIAMgAk8bIAIgBUsbQf8BcSEDCyAAQQRqIQAgASADIAhqQYECbEEBdjsBACABQQJqIQEgBkEBaiIGDQALCwvTBgEKfwJAIAazQwAAgEWUQwAAyEKVu0QAAAAAAADgP6CqIQ0gBSAEbCILBEAgB0GBAmwhDgNAQQAgAi8BACADLwEAayIGQQF0IgdrIAcgBkEASBsgDk8EQCAAQQJqLQAAIQUCfyAALQAAIgYgAEEBai0AACIESSIJRQRAIAYiCCAGIAVPDQEaCyAFIAUgBCAEIAVJGyAGIARLGwshCAJ/IAYgBE0EQCAGIgogBiAFTQ0BGgsgBSAFIAQgBCAFSxsgCRsLIgogCGoiD0GBAmwiEEEBdiERQQAhDAJ/QQAiCSAIIApGDQAaIAggCmsiCUH/H2wgD0H+AyAIayAKayAQQYCABEkbbSEMIAYgCEYEQCAEIAVrQf//A2wgCUEGbG0MAQsgBSAGayAGIARrIAQgCEYiBhtB//8DbCAJQQZsbUHVqgFBqtUCIAYbagshCSARIAcgDWxBgBBqQQx1aiIGQQAgBkEAShsiBkH//wMgBkH//wNIGyEGAkACfwJAIAxB//8DcSIFBEAgBkH//wFKDQEgBUGAIGogBmxBgBBqQQx2DAILIAZBCHYiBiEFIAYhBAwCCyAFIAZB//8Dc2xBgBBqQQx2IAZqCyIFQQh2IQcgBkEBdCAFa0EIdiIGIQQCQCAJQdWqAWpB//8DcSIFQanVAksNACAFQf//AU8EQEGq1QIgBWsgByAGa2xBBmxBgIACakEQdiAGaiEEDAELIAchBCAFQanVAEsNACAFIAcgBmtsQQZsQYCAAmpBEHYgBmohBAsCfyAGIgUgCUH//wNxIghBqdUCSw0AGkGq1QIgCGsgByAGa2xBBmxBgIACakEQdiAGaiAIQf//AU8NABogByIFIAhBqdUASw0AGiAIIAcgBmtsQQZsQYCAAmpBEHYgBmoLIQUgCUGr1QJqQf//A3EiCEGp1QJLDQAgCEH//wFPBEBBqtUCIAhrIAcgBmtsQQZsQYCAAmpBEHYgBmohBgwBCyAIQanVAEsEQCAHIQYMAQsgCCAHIAZrbEEGbEGAgAJqQRB2IAZqIQYLIAEgBDoAACABQQFqIAU6AAAgAUECaiAGOgAACyADQQJqIQMgAkECaiECIABBBGohACABQQRqIQEgC0F/aiILDQALCwsL"},fz=[{win:.5,filter:function(e){return e>=-.5&&e<.5?1:0}},{win:1,filter:function(e){if(e<=-1||e>=1)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*(.54+.46*Math.cos(t/1))}},{win:2,filter:function(e){if(e<=-2||e>=2)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*Math.sin(t/2)/(t/2)}},{win:3,filter:function(e){if(e<=-3||e>=3)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*Math.sin(t/3)/(t/3)}}];function pz(e){return Math.round(16383*e)}var hz=function(e,t,r,n,o){var i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C=fz[e].filter,B=1/n,S=Math.min(1,n),E=fz[e].win/S,_=Math.floor(2*(E+1)),x=new Int16Array((_+2)*r),T=0,A=!x.subarray||!x.set;for(i=0;i<r;i++){for(a=(i+.5)*B+o,s=Math.max(0,Math.floor(a-E)),u=(c=Math.min(t-1,Math.ceil(a+E)))-s+1,l=new Float32Array(u),d=new Int16Array(u),f=0,p=s,h=0;p<=c;p++,h++)f+=m=C((p+.5-a)*S),l[h]=m;for(g=0,h=0;h<l.length;h++)g+=v=l[h]/f,d[h]=pz(v);for(d[r>>1]+=pz(1-g),y=0;y<d.length&&0===d[y];)y++;if(y<d.length){for(b=d.length-1;b>0&&0===d[b];)b--;if(w=s+y,k=b-y+1,x[T++]=w,x[T++]=k,A)for(h=y;h<=b;h++)x[T++]=d[h];else x.set(d.subarray(y,b+1),T),T+=k}else x[T++]=0,x[T++]=0}return x};function mz(e){return e<0?0:e>255?255:e}var gz=function(e,t,r,n,o,i){var a,s,c,u,l,d,f,p,h,m,g,v=0,y=0;for(h=0;h<n;h++){for(l=0,m=0;m<o;m++){for(d=i[l++],f=i[l++],p=v+4*d|0,a=s=c=u=0;f>0;f--)u=u+(g=i[l++])*e[p+3]|0,c=c+g*e[p+2]|0,s=s+g*e[p+1]|0,a=a+g*e[p]|0,p=p+4|0;t[y+3]=mz(u+8192>>14),t[y+2]=mz(c+8192>>14),t[y+1]=mz(s+8192>>14),t[y]=mz(a+8192>>14),y=y+4*n|0}y=4*(h+1)|0,v=(h+1)*r*4|0}},vz=function(e,t,r,n,o,i){var a,s,c,u,l,d,f,p,h,m,g,v=0,y=0;for(h=0;h<n;h++){for(l=0,m=0;m<o;m++){for(d=i[l++],f=i[l++],p=v+4*d|0,a=s=c=u=0;f>0;f--)u=u+(g=i[l++])*e[p+3]|0,c=c+g*e[p+2]|0,s=s+g*e[p+1]|0,a=a+g*e[p]|0,p=p+4|0;t[y+3]=mz(u+8192>>14),t[y+2]=mz(c+8192>>14),t[y+1]=mz(s+8192>>14),t[y]=mz(a+8192>>14),y=y+4*n|0}y=4*(h+1)|0,v=(h+1)*r*4|0}},yz=!0;try{yz=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(e){}function bz(e,t,r){if(yz)t.set(function(e){return new Uint8Array(e.buffer,0,e.byteLength)}(e),r);else for(var n=r,o=0;o<e.length;o++){var i=e[o];t[n++]=255&i,t[n++]=i>>8&255}}var wz={name:"resize",fn:function(e){var t=e.src,r=e.width,n=e.height,o=e.toWidth,i=e.toHeight,a=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,c=e.offsetX||0,u=e.offsetY||0,l=e.dest||new Uint8Array(o*i*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,p=hz(d,r,o,a,c),h=hz(d,n,i,s,u),m=new Uint8Array(o*n*4);return gz(t,m,r,n,o,p),vz(m,l,n,o,i,h),f||function(e,t,r){for(var n=3,o=t*r*4|0;n<o;)e[n]=255,n=n+4|0}(l,o,i),l},wasm_fn:function(e){var t=e.src,r=e.width,n=e.height,o=e.toWidth,i=e.toHeight,a=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,c=e.offsetX||0,u=e.offsetY||0,l=e.dest||new Uint8Array(o*i*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,p=hz(d,r,o,a,c),h=hz(d,n,i,s,u),m=this.__align(0+Math.max(t.byteLength,l.byteLength)),g=this.__align(m+n*o*4),v=this.__align(g+p.byteLength),y=v+h.byteLength,b=this.__instance("resize",y),w=new Uint8Array(this.__memory.buffer),k=new Uint32Array(this.__memory.buffer),C=new Uint32Array(t.buffer);return k.set(C),bz(p,w,g),bz(h,w,v),(b.exports.convolveHV||b.exports._convolveHV)(g,v,m,r,n,o,i),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,i*o)),f||function(e,t,r){for(var n=3,o=t*r*4|0;n<o;)e[n]=255,n=n+4|0}(l,o,i),l},wasm_src:"AGFzbQEAAAABFAJgBn9/f39/fwBgB39/f39/f38AAg8BA2VudgZtZW1vcnkCAAEDAwIAAQQEAXAAAAcZAghjb252b2x2ZQAACmNvbnZvbHZlSFYAAQkBAArmAwLBAwEQfwJAIANFDQAgBEUNACAFQQRqIRVBACEMQQAhDQNAIA0hDkEAIRFBACEHA0AgB0ECaiESAn8gBSAHQQF0IgdqIgZBAmouAQAiEwRAQQAhCEEAIBNrIRQgFSAHaiEPIAAgDCAGLgEAakECdGohEEEAIQlBACEKQQAhCwNAIBAoAgAiB0EYdiAPLgEAIgZsIAtqIQsgB0H/AXEgBmwgCGohCCAHQRB2Qf8BcSAGbCAKaiEKIAdBCHZB/wFxIAZsIAlqIQkgD0ECaiEPIBBBBGohECAUQQFqIhQNAAsgEiATagwBC0EAIQtBACEKQQAhCUEAIQggEgshByABIA5BAnRqIApBgMAAakEOdSIGQf8BIAZB/wFIG0EQdEGAgPwHcUEAIAZBAEobIAtBgMAAakEOdSIGQf8BIAZB/wFIG0EYdEEAIAZBAEobciAJQYDAAGpBDnUiBkH/ASAGQf8BSBtBCHRBgP4DcUEAIAZBAEobciAIQYDAAGpBDnUiBkH/ASAGQf8BSBtB/wFxQQAgBkEAShtyNgIAIA4gA2ohDiARQQFqIhEgBEcNAAsgDCACaiEMIA1BAWoiDSADRw0ACwsLIQACQEEAIAIgAyAEIAUgABAAIAJBACAEIAUgBiABEAALCw=="};function kz(e){var t=e||[],r={js:t.indexOf("js")>=0,wasm:t.indexOf("wasm")>=0};cz.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(dz),this.use(wz)}JV(kz,cz),kz.prototype.resizeAndUnsharp=function(e,t){var r=this.resize(e,t);return e.unsharpAmount&&this.unsharp_mask(r,e.toWidth,e.toHeight,e.unsharpAmount,e.unsharpRadius,e.unsharpThreshold),r};var Cz=kz;function Bz(e,t){this.create=e,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=t||2e3}Bz.prototype.acquire=function(){var e,t=this;return 0!==this.available.length?e=this.available.pop():((e=this.create()).id=this.lastId++,e.release=function(){return t.release(e)}),this.acquired[e.id]=e,e},Bz.prototype.release=function(e){var t=this;delete this.acquired[e.id],e.lastUsed=Date.now(),this.available.push(e),0===this.timeoutId&&(this.timeoutId=setTimeout((function(){return t.gc()}),100))},Bz.prototype.gc=function(){var e=this,t=Date.now();this.available=this.available.filter((function(r){return!(t-r.lastUsed>e.idle&&(r.destroy(),1))})),0!==this.available.length?this.timeoutId=setTimeout((function(){return e.gc()}),100):this.timeoutId=0};var Sz=Bz;function Ez(e){return Object.prototype.toString.call(e)}var _z=function(e){var t=Ez(e);return"[object HTMLCanvasElement]"===t||"[object OffscreenCanvas]"===t||"[object Canvas]"===t},xz=function(e){return"[object HTMLImageElement]"===Ez(e)},Tz=function(e){return"[object ImageBitmap]"===Ez(e)},Az=function(e){var t=0,r=[];function n(){t<e&&r.length&&(t++,r.shift()())}return function(e){return new Promise((function(o,i){r.push((function(){e().then((function(e){o(e),t--,n()}),(function(e){i(e),t--,n()}))})),n()}))}},Pz=function(e){switch(e){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},Iz=function(e){return Promise.resolve().then((function(){if("undefined"==typeof createImageBitmap)return!1;var t=e(100,100);return createImageBitmap(t,0,0,100,100,{resizeWidth:10,resizeHeight:10,resizeQuality:"high"}).then((function(e){var r=10===e.width;return e.close(),t=null,r}))})).catch((function(){return!1}))},Rz=function(){var e,t=Cz;onmessage=function(r){var n=r.data.opts;e||(e=new t(r.data.features));var o=e.resizeAndUnsharp(n);postMessage({result:o},[o.buffer])}};function Oz(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.floor(e)}function Nz(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.ceil(e)}var Dz={},Mz=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(Mz=navigator.userAgent.indexOf("Safari")>=0)}catch(e){}var Lz=1;"undefined"!=typeof navigator&&(Lz=Math.min(navigator.hardwareConcurrency||1,4));var Uz,jz,Fz={tile:1024,concurrency:Lz,features:["js","wasm","ww"],idle:2e3,createCanvas:function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r}},Vz={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0};function zz(){return{value:ZV(Rz),destroy:function(){if(this.value.terminate(),"undefined"!=typeof window){var e=window.URL||window.webkitURL||window.mozURL||window.msURL;e&&e.revokeObjectURL&&this.value.objectURL&&e.revokeObjectURL(this.value.objectURL)}}}}function qz(e){if(!(this instanceof qz))return new qz(e);this.options=GV({},Fz,e||{});var t="lk_".concat(this.options.concurrency);this.__limit=Dz[t]||Az(this.options.concurrency),Dz[t]||(Dz[t]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}qz.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if(!1!==Uz&&!0!==Uz&&(Uz=!1,"undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray))try{new ImageData(new Uint8ClampedArray(400),10,10),Uz=!0}catch(t){}!1!==jz&&!0!==jz&&(jz=!1,"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?jz=!0:this.debug("ImageBitmap does not support .close(), disabled")));var t=this.options.features.slice();if(t.indexOf("all")>=0&&(t=["cib","wasm","js","ww"]),this.__requested_features=t,this.__mathlib=new Cz(t),t.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{ZV((function(){})).terminate(),this.features.ww=!0;var r="wp_".concat(JSON.stringify(this.options));Dz[r]?this.__workersPool=Dz[r]:(this.__workersPool=new Sz(zz,this.options.idle),Dz[r]=this.__workersPool)}catch(t){}var n,o=this.__mathlib.init().then((function(t){GV(e.features,t.features)}));return n=jz?Iz(this.options.createCanvas).then((function(r){e.features.cib&&t.indexOf("cib")<0?e.debug("createImageBitmap() resize supported, but disabled by config"):t.indexOf("cib")>=0&&(e.features.cib=r)})):Promise.resolve(!1),this.__initPromise=Promise.all([o,n]).then((function(){return e})),this.__initPromise},qz.prototype.resize=function(e,t,r){var n=this;this.debug("Start resize...");var o=GV({},Vz);if(isNaN(r)?r&&(o=GV(o,r)):o=GV(o,{quality:r}),o.toWidth=t.width,o.toHeight=t.height,o.width=e.naturalWidth||e.width,o.height=e.naturalHeight||e.height,0===t.width||0===t.height)return Promise.reject(new Error("Invalid output size: ".concat(t.width,"x").concat(t.height)));o.unsharpRadius>2&&(o.unsharpRadius=2);var i=!1,a=null;o.cancelToken&&(a=o.cancelToken.then((function(e){throw i=!0,e}),(function(e){throw i=!0,e})));var s=Math.ceil(Math.max(3,2.5*o.unsharpRadius|0));return this.init().then((function(){if(i)return a;if(n.features.cib){var r=t.getContext("2d",{alpha:Boolean(o.alpha)});return n.debug("Resize via createImageBitmap()"),createImageBitmap(e,{resizeWidth:o.toWidth,resizeHeight:o.toHeight,resizeQuality:Pz(o.quality)}).then((function(e){if(i)return a;if(!o.unsharpAmount)return r.drawImage(e,0,0),e.close(),r=null,n.debug("Finished!"),t;n.debug("Unsharp result");var s=n.options.createCanvas(o.toWidth,o.toHeight),c=s.getContext("2d",{alpha:Boolean(o.alpha)});c.drawImage(e,0,0),e.close();var u=c.getImageData(0,0,o.toWidth,o.toHeight);return n.__mathlib.unsharp_mask(u.data,o.toWidth,o.toHeight,o.unsharpAmount,o.unsharpRadius,o.unsharpThreshold),r.putImageData(u,0,0),s.width=s.height=0,u=c=s=r=null,n.debug("Finished!"),t}))}var c={},u=function(e){return Promise.resolve().then((function(){return n.features.ww?new Promise((function(t,r){var o=n.__workersPool.acquire();a&&a.catch((function(e){return r(e)})),o.value.onmessage=function(e){o.release(),e.data.err?r(e.data.err):t(e.data.result)},o.value.postMessage({opts:e,features:n.__requested_features,preload:{wasm_nodule:n.__mathlib.__}},[e.src.buffer])})):n.__mathlib.resizeAndUnsharp(e,c)}))},l=function(e,t,r){var o,c,l,d=!1,f=function(t){return n.__limit((function(){if(i)return a;var s;if(_z(e))n.debug("Get tile pixel data"),s=o.getImageData(t.x,t.y,t.width,t.height);else{n.debug("Draw tile imageBitmap/image to temporary canvas");var d=n.options.createCanvas(t.width,t.height),f=d.getContext("2d",{alpha:Boolean(r.alpha)});f.globalCompositeOperation="copy",f.drawImage(c||e,t.x,t.y,t.width,t.height,0,0,t.width,t.height),n.debug("Get tile pixel data"),s=f.getImageData(0,0,t.width,t.height),d.width=d.height=0,f=d=null}var p={src:s.data,width:t.width,height:t.height,toWidth:t.toWidth,toHeight:t.toHeight,scaleX:t.scaleX,scaleY:t.scaleY,offsetX:t.offsetX,offsetY:t.offsetY,quality:r.quality,alpha:r.alpha,unsharpAmount:r.unsharpAmount,unsharpRadius:r.unsharpRadius,unsharpThreshold:r.unsharpThreshold};return n.debug("Invoke resize math"),Promise.resolve().then((function(){return u(p)})).then((function(e){if(i)return a;var r;if(s=null,n.debug("Convert raw rgba tile result to ImageData"),Uz)r=new ImageData(new Uint8ClampedArray(e),t.toWidth,t.toHeight);else if((r=l.createImageData(t.toWidth,t.toHeight)).data.set)r.data.set(e);else for(var o=r.data.length-1;o>=0;o--)r.data[o]=e[o];return n.debug("Draw tile"),Mz?l.putImageData(r,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth+1e-5,t.toInnerHeight+1e-5):l.putImageData(r,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth,t.toInnerHeight),null}))}))};return Promise.resolve().then((function(){if(l=t.getContext("2d",{alpha:Boolean(r.alpha)}),_z(e))return o=e.getContext("2d",{alpha:Boolean(r.alpha)}),null;if(Tz(e))return c=e,d=!0,null;if(xz(e))return jz?(n.debug("Decode image via createImageBitmap"),createImageBitmap(e).then((function(e){c=e})).catch((function(e){return null}))):null;throw new Error('Pica: ".from" should be Image, Canvas or ImageBitmap')})).then((function(){if(i)return a;n.debug("Calculate tiles");var e=function(e){var t,r,n,o,i,a,s=e.toWidth/e.width,c=e.toHeight/e.height,u=Oz(e.srcTileSize*s)-2*e.destTileBorder,l=Oz(e.srcTileSize*c)-2*e.destTileBorder;if(u<1||l<1)throw new Error("Internal error in pica: target tile width/height is too small.");var d,f=[];for(o=0;o<e.toHeight;o+=l)for(n=0;n<e.toWidth;n+=u)(t=n-e.destTileBorder)<0&&(t=0),t+(i=n+u+e.destTileBorder-t)>=e.toWidth&&(i=e.toWidth-t),(r=o-e.destTileBorder)<0&&(r=0),r+(a=o+l+e.destTileBorder-r)>=e.toHeight&&(a=e.toHeight-r),d={toX:t,toY:r,toWidth:i,toHeight:a,toInnerX:n,toInnerY:o,toInnerWidth:u,toInnerHeight:l,offsetX:t/s-Oz(t/s),offsetY:r/c-Oz(r/c),scaleX:s,scaleY:c,x:Oz(t/s),y:Oz(r/c),width:Nz(i/s),height:Nz(a/c)},f.push(d);return f}({width:r.width,height:r.height,srcTileSize:n.options.tile,toWidth:r.toWidth,toHeight:r.toHeight,destTileBorder:s}).map((function(e){return f(e)}));function o(){c&&(d||c.close(),c=null)}return n.debug("Process tiles"),Promise.all(e).then((function(){return n.debug("Finished!"),o(),t}),(function(e){throw o(),e}))}))};return function e(t,r,o,s){if(i)return a;var c,u=Wy(t.shift(),2),d=u[0],f=u[1],p=0===t.length;return s=GV({},s,{toWidth:d,toHeight:f,quality:p?s.quality:Math.min(1,s.quality)}),p||(c=n.options.createCanvas(d,f)),l(r,p?o:c,s).then((function(){return p?o:(s.width=d,s.height=f,e(t,c,o,s))})).then((function(e){return c&&(c.width=c.height=0),e}))}(function(e,t,r,n,o,i){var a=r/e,s=n/t,c=(2*i+2+1)/o;if(c>.5)return[[r,n]];var u=Math.ceil(Math.log(Math.min(a,s))/Math.log(c));if(u<=1)return[[r,n]];for(var l=[],d=0;d<u;d++){var f=Math.round(Math.pow(Math.pow(e,u-d-1)*Math.pow(r,d+1),1/u)),p=Math.round(Math.pow(Math.pow(t,u-d-1)*Math.pow(n,d+1),1/u));l.push([f,p])}return l}(o.width,o.height,o.toWidth,o.toHeight,n.options.tile,s),e,t,o)}))},qz.prototype.resizeBuffer=function(e){var t=this,r=GV({},Vz,e);return this.init().then((function(){return t.__mathlib.resizeAndUnsharp(r)}))},qz.prototype.toBlob=function(e,t,r){return t=t||"image/png",new Promise((function(n){if(e.toBlob)e.toBlob((function(e){return n(e)}),t,r);else if(e.convertToBlob)n(e.convertToBlob({type:t,quality:r}));else{for(var o=atob(e.toDataURL(t,r).split(",")[1]),i=o.length,a=new Uint8Array(i),s=0;s<i;s++)a[s]=o.charCodeAt(s);n(new Blob([a],{type:t}))}}))},qz.prototype.debug=function(){};var Hz=new qz,Kz=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.minSize,o=void 0===n?720:n,i=e/t;return e>t?{desW:Math.floor(o*i),desH:o}:{desW:o,desH:Math.floor(o/i)}},Wz=Object.freeze({__proto__:null,scaleImage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.minSize,n=void 0===r?720:r;return new Promise((function(t){var r=URL.createObjectURL(e),o=new Image;o.src=r;var i=document.createElement("canvas");o.onload=function(){if(o.width&&o.height&&(o.width<n||o.height<n)){var e=Kz(o.width,o.height,{minSize:n}),r=e.desW,a=e.desH;i.width=r,i.height=a,Hz.resize(o,i).then((function(e){return Hz.toBlob(e,"image/jpeg",1)})).then((function(e){return t(e)}))}else t(null)}}))},createResizer:function(e){var t=e.width,r=e.height,n=document.createElement("canvas"),o=n.getContext("2d");return n.width=t,n.height=r,{resize:function(e){var t=e.srcCanvas;return o.drawImage(t,0,0,n.width,n.height),n}}},resizeBlobImg:function(e,t,r){var n=document.createElement("canvas"),o=n.getContext("2d");return n.width=t,n.height=r,new Promise((function(t){var r=URL.createObjectURL(e),i=new Image;i.onload=function(){URL.revokeObjectURL(r),o.drawImage(i,0,0,n.width,n.height),n.toBlob(t,"image/jpeg",1)},i.src=r}))},blobToCanvas:function(e){var t=e.blob;return new Promise((function(e){var r=document.createElement("canvas"),n=r.getContext("2d"),o=new Image;o.onload=function(t){var i=o.width,a=o.height;r.width=i,r.height=a,URL.revokeObjectURL(t.target.src),n.drawImage(t.target,0,0),e(r)},o.src=URL.createObjectURL(t)}))}});function Gz(e,t,r,n){var o=r*(4*t)+4*n;return{r:e[o],g:e[o+1],b:e[o+2]}}function Qz(e,t,r){return function(e,t,r){for(var n=0,o=r[1],i=r[3],a=r[0],s=r[2],c=o;c<i;c++)for(var u=a;u<s;u++){var l=Gz(e,t,c,u),d=l.r,f=l.g,p=l.b;d>=245&&p>=245&&f>245&&(n+=1)}return n}(e,t,function(e,t){var r=Math.floor(.025*e),n=e-r,o=Math.floor(.025*t);return[r,o,n,t-o]}(t,r))/(t*r)>=.001}function Xz(){return(Xz=uM(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.getContext("2d"),n=r.getImageData(0,0,t.width,t.height),o=n.data,mV){e.next=5;break}return e.abrupt("return",Qz(o,n.width,n.height));case 5:return e.abrupt("return",mV.detectGlare(o,n.width,n.height));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Yz=Object.freeze({__proto__:null,isCardGlare:function(e){return Xz.apply(this,arguments)}}),$z="internal_server_error",Zz="network_error",Jz=TF();function eq(e){return 500*Math.pow(1.5,e)}function tq(e){return Array.isArray(null==e?void 0:e.errors)&&e.errors.find((function(e){return e.code===$z}))}function rq(e){return"Failed to fetch"===e.message||!e.response}function nq(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,o=t.maxInternalServerErrorRetryTimes,i=void 0===o?1:o,a=t.propertyKey,s=t.onDone;return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var c=this;function u(e,t){return l.apply(this,arguments)}function l(){return(l=uM(regeneratorRuntime.mark((function t(o,l){var d,f,p,h,m,g,v,y,b=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return g=function(){return(g=uM(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=h(t),n=p(t)-r,e.next=4,$F(eq(n));case 4:return e.abrupt("return",u(r,t,n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},m=function(e){return g.apply(this,arguments)},h=function(e){return e===l?Math.max(o-1,0):p(e)-1},p=function(e){return e===Zz?n:e===$z?i:0},f=function(e){return o>0||(e===Zz?void 0===o&&n>0:e===$z&&void 0===o&&i>0)},d=b.length>2&&void 0!==b[2]?b[2]:0,v=performance.now(),t.prev=7,t.next=10,e.apply(c,r);case 10:if(y=t.sent,s({response:y,retryCount:d,propertyKey:a,timeInMs:performance.now()-v,args:r}),!tq(y)||!f($z)){t.next=16;break}return t.next=15,m($z);case 15:return t.abrupt("return",t.sent);case 16:return t.abrupt("return",y);case 19:if(t.prev=19,t.t0=t.catch(7),s({error:t.t0,retryCount:d,propertyKey:a,timeInMs:performance.now()-v,args:r}),!rq(t.t0)||!f(Zz)){t.next=24;break}return t.abrupt("return",m(Zz));case 24:throw t.t0;case 25:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}return u()}}function oq(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,o=t.maxInternalServerErrorRetryTimes,i=void 0===o?1:o,a=t.onDone,s=void 0===a?function(){}:a,c={get:function(e,t){var r=e[t];return"function"==typeof r&&"constructor"!==t?nq(r,{maxNetworkErrorRetryTimes:n,maxInternalServerErrorRetryTimes:i,propertyKey:t,onDone:s}):r}};return new Proxy(e,c)}var iq=Object.freeze({__proto__:null,createRetryAPIClient:oq,useApiClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCredentials,r=void 0===t?{}:t,n=e.tracking,o=void 0===n?{}:n,i=_w.useRef(null),a=function(){};if(null===i.current){var s=r.accessKey,c=r.secretKey,u=r.apiUrl,l=o.userId,d=KF({userId:l});i.current=oq(new vF(s,c,u,{httpHeaders:gM(gM({},Jz),{},{"x-request-id":d})}),{onDone:a})}return{apiClient:i.current}}}),aq="BFnYsWrH",sq="KbKcY2nb",cq=function(e){return e.split("").reverse().join("")},uq=function(e){var t=e.url;return new Promise((function(e){var r=document.createElement("script");r.onload=e,r.src=t,document.head.appendChild(r)}))},lq=window.fetch.bind(window);function dq(e){var t,r,n=e.hasOwnProperty("words")?e.words:[],o=e.hasOwnProperty("sigBytes")?e.sigBytes:4*n.length,i=new Uint8Array(o),a=0;for(r=0;r<o;r++)t=n[r],i[a++]=t>>24,i[a++]=t>>16&255,i[a++]=t>>8&255,i[a++]=255&t;return i}var fq=function(){var e=uM(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(cq(aq)).concat(cq(sq)),e.next=3,lq.apply(void 0,a);case 3:return r=e.sent,e.next=6,r.text();case 6:return n=e.sent,o=LF.AES.decrypt(n,t),i=dq(o),e.abrupt("return",{u8arr:i});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pq=function(){var e=uM(regeneratorRuntime.mark((function e(){var t,r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,lq.apply(void 0,n);case 2:return t=e.sent,e.next=5,t.text();case 5:return r=e.sent,e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),hq=Object.freeze({__proto__:null,reverseString:cq,loadExternalScript:uq,fetchWithDecryption:fq,fetchRawResource:pq}),mq=/\s/,gq=function(e){for(var t=e.length;t--&&mq.test(e.charAt(t)););return t},vq=/^\s+/,yq=function(e){return e?e.slice(0,gq(e)+1).replace(vq,""):e},bq=/^[-+]0x[0-9a-f]+$/i,wq=/^0b[01]+$/i,kq=/^0o[0-7]+$/i,Cq=parseInt,Bq=function(e){if("number"==typeof e)return e;if(Sj(e))return NaN;if(nL(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=nL(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=yq(e);var r=wq.test(e);return r||kq.test(e)?Cq(e.slice(2),r?2:8):bq.test(e)?NaN:+e},Sq=function(e){return e?1/0===(e=Bq(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},Eq=function(e){var t=Sq(e),r=t%1;return t==t?r?t-r:t:0},_q=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=Eq(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},xq=function(e){return _q(2,e)},Tq=xq(function(){var e=uM(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l,d,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=f.length>0&&void 0!==f[0]?f[0]:{},r=t.tfUrl,n=void 0===r?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.20.0/dist/tf.min.js":r,o=t.tfBackendWasmUrl,i=void 0===o?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.20.0/dist/tf-backend-wasm.js":o,a=t.tfBackendCpuUrl,s=void 0===a?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@3.20.0":a,c=t.tfLiteUrl,u=void 0===c?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite@0.0.1-alpha.8/dist/tf-tflite.min.js":c,l=t.blazefaceScriptUrl,d=void 0===l?"https://cdn.jsdelivr.net/npm/@tensorflow-models/blazeface@0.0.7":l,e.next=3,uq({url:n});case 3:return e.next=5,Promise.all([uq({url:i}),uq({url:s}),uq({url:d}),uq({url:u})]);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());function Aq(){return(Aq=uM(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},r=t.preferredBackends,n=void 0===r?["wasm","cpu"]:r,!window.tv_model_backend_init||window.tv_model_backend_init[0]!==n[0]){e.next=3;break}return e.abrupt("return");case 3:return o=window,i=o.tf,e.next=6,i.enableProdMode();case 6:a=CM(n),e.prev=7,a.s();case 9:if((s=a.n()).done){e.next=23;break}return c=s.value,e.prev=11,e.next=14,i.setBackend(c);case 14:return e.abrupt("break",23);case 17:if(e.prev=17,e.t0=e.catch(11),c!==n[n.length-1]){e.next=21;break}throw e.t0;case 21:e.next=9;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(7),a.e(e.t1);case 28:return e.prev=28,a.f(),e.finish(28);case 31:return e.next=33,i.ready();case 33:window.tv_model_backend_init=n;case 34:case"end":return e.stop()}}),e,null,[[7,25,28,31],[11,17]])})))).apply(this,arguments)}function Pq(){return(Pq=uM(regeneratorRuntime.mark((function e(t){var r,n,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.modelUrl,n=window,o=n.blazeface,!r){e.next=8;break}return e.next=5,o.load({modelUrl:r});case 5:i=e.sent,e.next=11;break;case 8:return e.next=10,o.load();case 10:i=e.sent;case 11:return e.abrupt("return",{blazefaceModel:i});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Iq(){return(Iq=uM(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.modelUrl,e.next=3,pq(r);case 3:return n=e.sent,o=n.rawData,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rq(e){return Oq.apply(this,arguments)}function Oq(){return(Oq=uM(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,n=t.options,o=void 0===n?{}:n,i=window,a=i.tflite,e.next=4,fq(r);case 4:return s=e.sent,c=s.u8arr,e.abrupt("return",a.loadTFLiteModel(c,gM({numThreads:1},o)));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nq=Object.freeze({__proto__:null,loadTensorFlow:Tq,initTensorFlow:function(){return Aq.apply(this,arguments)},loadBlazefaceModel:function(e){return Pq.apply(this,arguments)},preloadResource:function(e){return Iq.apply(this,arguments)},loadTFLiteModel:Rq}),Dq=Object.freeze({__proto__:null,enableAntiDebug:function(){var e,t,r=["action","gger","stateObject","apply","chain","test","input","Hello World!","constructor","counter","length","debu","call"];e=r,t=185,function(t){for(;--t;)e.push(e.shift())}(++t);var n,o,i=function(e,t){return r[e-=0]};function a(e){function t(e){if("string"==typeof e)return function(e){}[i("0x5")]("while (true) {}")[i("0x0")](i("0x6"));1!=="".concat(e/e)[i("0x7")]||e%20==0?function(){return!0}[i("0x5")]("".concat(i("0x8"),"gger"))[i("0x9")](i("0xa")):function(){return!1}.constructor("debu".concat(i("0xb")))[i("0x0")](i("0xc")),t(++e)}try{if(e)return t;t(0)}catch(e){}}setInterval((function(){a()}),4e3),n=!0,o=function(e,t){var r=n?function(){if(t){var r=t[i("0x0")](e,arguments);return t=null,r}}:function(){};return n=!1,r},function(){o(this,(function(){var e=new RegExp("function *\\( *\\)"),t=new RegExp("\\+\\+ *(?:_0x(?:[a-f0-9]){4,6}|(?:\\b|\\d)[a-z0-9]{1,4}(?:\\b|\\d))","i"),r=a("init");e.test(r+i("0x1"))&&t[i("0x2")](r+i("0x3"))?a():r("0")}))()}(),console.log(i("0x4"))}}),Mq=Object.freeze({__proto__:null,useThemeContext:function(){return _w.useContext(aE)}});function Lq(){return(Lq=uM(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.key,n=new TextEncoder,(o=n.encode(r)).reverse(),e.abrupt("return",crypto.subtle.digest("SHA-256",o));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Uq=Object.freeze({__proto__:null,encrypt:function(e){var t=e.blob,r=e.key;return new Promise((function(e){var n=new FileReader;n.onload=function(t){var n=t.target.result;(function(e){return Lq.apply(this,arguments)})({key:r}).then((function(t){window.crypto.subtle.importKey("raw",t,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(t){var r;e({hex:(r=t,bM(new Uint8Array(r)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""))})}))}))}))},n.readAsArrayBuffer(t)}))}}),jq=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;lM(this,e),this.interval=t,this.second=0,this.timeStone={origin:0},this.callbacks={}}return fM(e,[{key:"duration",value:function(e){return Object.prototype.hasOwnProperty.call(this.timeStone,e)?this.second-this.timeStone[e]:-1}},{key:"start",value:function(e,t){var r=this;e||this.timerID||(this.callbacks.origin=t,this.timerID=setInterval((function(){r.second++,Object.keys(r.timeStone).map((function(e){return"function"==typeof r.callbacks[e]&&r.callbacks[e](r.duration(e)),0}))}),this.interval)),Object.prototype.hasOwnProperty.call(this.timeStone,e)||e&&(this.timeStone[e]=this.second,this.callbacks[e]=t)}},{key:"stop",value:function(){clearInterval(this.timerID),this.timerID=void 0,this.second=0,this.timeStone={origin:0},this.callbacks={}}}]),e}(),Fq=FM((function(e,t){!function(){var r={};function n(e){return d(">"+p("B",e.length),e)}function o(e){return d(">"+p("H",e.length),e)}function i(e){return d(">"+p("L",e.length),e)}function a(e,t,r){var a,s,c,u,l="",f="";if("Byte"==t)(a=e.length)<=4?f=n(e)+p("\0",4-a):(f=d(">L",[r]),l=n(e));else if("Short"==t)(a=e.length)<=2?f=o(e)+p("\0\0",2-a):(f=d(">L",[r]),l=o(e));else if("Long"==t)(a=e.length)<=1?f=i(e):(f=d(">L",[r]),l=i(e));else if("Ascii"==t)(a=(s=e+"\0").length)>4?(f=d(">L",[r]),l=s):f=s+p("\0",4-a);else if("Rational"==t){if("number"==typeof e[0])a=1,c=e[0],u=e[1],s=d(">L",[c])+d(">L",[u]);else{a=e.length,s="";for(var h=0;h<a;h++)c=e[h][0],u=e[h][1],s+=d(">L",[c])+d(">L",[u])}f=d(">L",[r]),l=s}else if("SRational"==t){if("number"==typeof e[0])a=1,c=e[0],u=e[1],s=d(">l",[c])+d(">l",[u]);else for(a=e.length,s="",h=0;h<a;h++)c=e[h][0],u=e[h][1],s+=d(">l",[c])+d(">l",[u]);f=d(">L",[r]),l=s}else"Undefined"==t&&((a=e.length)>4?(f=d(">L",[r]),l=e):f=e+p("\0",4-a));return[d(">L",[a]),f,l]}function s(e,t,r){var n,o=Object.keys(e).length,i=d(">H",[o]);n=["0th","1st"].indexOf(t)>-1?2+12*o+4:2+12*o;var s="",c="";for(var u in e)if("string"==typeof u&&(u=parseInt(u)),!("0th"==t&&[34665,34853].indexOf(u)>-1||"Exif"==t&&40965==u||"1st"==t&&[513,514].indexOf(u)>-1)){var l=e[u],f=d(">H",[u]),p=g[t][u].type,h=d(">H",[m[p]]);"number"==typeof l&&(l=[l]);var v=a(l,p,8+n+r+c.length);s+=f+h+v[0]+v[1],c+=v[2]}return[i+s,c]}function c(e){var t;if("ÿØ"==e.slice(0,2))t=function(e){for(var t,r=0;r<e.length;r++)if("ÿá"==(t=e[r]).slice(0,2)&&"Exif\0\0"==t.slice(4,10))return t;return null}(h(e)),this.tiftag=t?t.slice(10):null;else if(["II","MM"].indexOf(e.slice(0,2))>-1)this.tiftag=e;else{if("Exif"!=e.slice(0,4))throw new Error("Given file is neither JPEG nor TIFF.");this.tiftag=e.slice(6)}}if(r.version="1.0.4",r.remove=function(e){var t=!1;if("ÿØ"==e.slice(0,2));else{if("data:image/jpeg;base64,"!=e.slice(0,23)&&"data:image/jpg;base64,"!=e.slice(0,22))throw new Error("Given data is not jpeg.");e=l(e.split(",")[1]),t=!0}var r=h(e).filter((function(e){return!("ÿá"==e.slice(0,2)&&"Exif\0\0"==e.slice(4,10))})).join("");return t&&(r="data:image/jpeg;base64,"+u(r)),r},r.insert=function(e,t){var r=!1;if("Exif\0\0"!=e.slice(0,6))throw new Error("Given data is not exif.");if("ÿØ"==t.slice(0,2));else{if("data:image/jpeg;base64,"!=t.slice(0,23)&&"data:image/jpg;base64,"!=t.slice(0,22))throw new Error("Given data is not jpeg.");t=l(t.split(",")[1]),r=!0}var n="ÿá"+d(">H",[e.length+2])+e,o=function(e,t){var r=!1,n=[];return e.forEach((function(o,i){"ÿá"==o.slice(0,2)&&"Exif\0\0"==o.slice(4,10)&&(r?n.unshift(i):(e[i]=t,r=!0))})),n.forEach((function(t){e.splice(t,1)})),!r&&t&&(e=[e[0],t].concat(e.slice(1))),e.join("")}(h(t),n);return r&&(o="data:image/jpeg;base64,"+u(o)),o},r.load=function(e){var t;if("string"!=typeof e)throw new Error("'load' gots invalid type argument.");if("ÿØ"==e.slice(0,2))t=e;else if("data:image/jpeg;base64,"==e.slice(0,23)||"data:image/jpg;base64,"==e.slice(0,22))t=l(e.split(",")[1]);else{if("Exif"!=e.slice(0,4))throw new Error("'load' gots invalid file data.");t=e.slice(6)}var r={"0th":{},Exif:{},GPS:{},Interop:{},"1st":{},thumbnail:null},n=new c(t);if(null===n.tiftag)return r;"II"==n.tiftag.slice(0,2)?n.endian_mark="<":n.endian_mark=">";var o=f(n.endian_mark+"L",n.tiftag.slice(4,8))[0];r["0th"]=n.get_ifd(o,"0th");var i=r["0th"].first_ifd_pointer;if(delete r["0th"].first_ifd_pointer,34665 in r["0th"]&&(o=r["0th"][34665],r.Exif=n.get_ifd(o,"Exif")),34853 in r["0th"]&&(o=r["0th"][34853],r.GPS=n.get_ifd(o,"GPS")),40965 in r.Exif&&(o=r.Exif[40965],r.Interop=n.get_ifd(o,"Interop")),"\0\0\0\0"!=i&&(o=f(n.endian_mark+"L",i)[0],r["1st"]=n.get_ifd(o,"1st"),513 in r["1st"]&&514 in r["1st"])){var a=r["1st"][513]+r["1st"][514],s=n.tiftag.slice(r["1st"][513],a);r.thumbnail=s}return r},r.dump=function(e){var t,n,o,i,a,c,u=(t=e,JSON.parse(JSON.stringify(t))),l=!1,f=!1,p=!1,g=!1;n="0th"in u?u["0th"]:{},"Exif"in u&&Object.keys(u.Exif).length||"Interop"in u&&Object.keys(u.Interop).length?(n[34665]=1,l=!0,o=u.Exif,"Interop"in u&&Object.keys(u.Interop).length?(o[40965]=1,p=!0,i=u.Interop):Object.keys(o).indexOf(r.ExifIFD.InteroperabilityTag.toString())>-1&&delete o[40965]):Object.keys(n).indexOf(r.ImageIFD.ExifTag.toString())>-1&&delete n[34665],"GPS"in u&&Object.keys(u.GPS).length?(n[r.ImageIFD.GPSTag]=1,f=!0,a=u.GPS):Object.keys(n).indexOf(r.ImageIFD.GPSTag.toString())>-1&&delete n[r.ImageIFD.GPSTag],"1st"in u&&"thumbnail"in u&&null!=u.thumbnail&&(g=!0,u["1st"][513]=1,u["1st"][514]=1,c=u["1st"]);var v,y,b,w=s(n,"0th",0),k=w[0].length+12*l+12*f+4+w[1].length,C="",B=0,S="",E=0,_="",x=0,T="";if(l&&(B=(v=s(o,"Exif",k))[0].length+12*p+v[1].length),f&&(E=(S=s(a,"GPS",k+B).join("")).length),p&&(x=(_=s(i,"Interop",k+B+E).join("")).length),g&&(y=s(c,"1st",k+B+E+x),(b=function(e){for(var t=h(e);"ÿà"<=t[1].slice(0,2)&&t[1].slice(0,2)<="ÿï";)t=[t[0]].concat(t.slice(2));return t.join("")}(u.thumbnail)).length>64e3))throw new Error("Given thumbnail is too large. max 64kB");var A="",P="",I="",R="\0\0\0\0";if(l){var O=d(">L",[N=8+k]);A=d(">H",[34665])+d(">H",[m.Long])+d(">L",[1])+O}if(f&&(O=d(">L",[N=8+k+B]),P=d(">H",[34853])+d(">H",[m.Long])+d(">L",[1])+O),p&&(O=d(">L",[N=8+k+B+E]),I=d(">H",[40965])+d(">H",[m.Long])+d(">L",[1])+O),g){var N;R=d(">L",[N=8+k+B+E+x]);var D="\0\0\0\0"+d(">L",[N+y[0].length+24+4+y[1].length]),M="\0\0\0\0"+d(">L",[b.length]);T=y[0]+D+M+"\0\0\0\0"+y[1]+b}var L=w[0]+A+P+R+w[1];return l&&(C=v[0]+I+v[1]),"Exif\0\0MM\0*\0\0\0\b"+L+C+S+_+T},c.prototype={get_ifd:function(e,t){var r,n={},o=f(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],i=e+2;r=["0th","1st"].indexOf(t)>-1?"Image":t;for(var a=0;a<o;a++){e=i+12*a;var s=f(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],c=[f(this.endian_mark+"H",this.tiftag.slice(e+2,e+4))[0],f(this.endian_mark+"L",this.tiftag.slice(e+4,e+8))[0],this.tiftag.slice(e+8,e+12)];s in g[r]&&(n[s]=this.convert_value(c))}return"0th"==t&&(e=i+12*o,n.first_ifd_pointer=this.tiftag.slice(e,e+4)),n},convert_value:function(e){var t,r=null,n=e[0],o=e[1],i=e[2];if(1==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+p("B",o),this.tiftag.slice(t,t+o))):r=f(this.endian_mark+p("B",o),i.slice(0,o));else if(2==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=this.tiftag.slice(t,t+o-1)):r=i.slice(0,o-1);else if(3==n)o>2?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+p("H",o),this.tiftag.slice(t,t+2*o))):r=f(this.endian_mark+p("H",o),i.slice(0,2*o));else if(4==n)o>1?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+p("L",o),this.tiftag.slice(t,t+4*o))):r=f(this.endian_mark+p("L",o),i);else if(5==n)if(t=f(this.endian_mark+"L",i)[0],o>1){r=[];for(var a=0;a<o;a++)r.push([f(this.endian_mark+"L",this.tiftag.slice(t+8*a,t+4+8*a))[0],f(this.endian_mark+"L",this.tiftag.slice(t+4+8*a,t+8+8*a))[0]])}else r=[f(this.endian_mark+"L",this.tiftag.slice(t,t+4))[0],f(this.endian_mark+"L",this.tiftag.slice(t+4,t+8))[0]];else if(7==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=this.tiftag.slice(t,t+o)):r=i.slice(0,o);else if(9==n)o>1?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+p("l",o),this.tiftag.slice(t,t+4*o))):r=f(this.endian_mark+p("l",o),i);else{if(10!=n)throw new Error("Exif might be wrong. Got incorrect value type to decode. type:"+n);if(t=f(this.endian_mark+"L",i)[0],o>1)for(r=[],a=0;a<o;a++)r.push([f(this.endian_mark+"l",this.tiftag.slice(t+8*a,t+4+8*a))[0],f(this.endian_mark+"l",this.tiftag.slice(t+4+8*a,t+8+8*a))[0]]);else r=[f(this.endian_mark+"l",this.tiftag.slice(t,t+4))[0],f(this.endian_mark+"l",this.tiftag.slice(t+4,t+8))[0]]}return r instanceof Array&&1==r.length?r[0]:r}},"undefined"!=typeof window&&"function"==typeof window.btoa)var u=window.btoa;if(void 0===u&&(u=function(e){for(var t,r,n,o,i,a,s,c="",u=0,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";u<e.length;)o=(t=e.charCodeAt(u++))>>2,i=(3&t)<<4|(r=e.charCodeAt(u++))>>4,a=(15&r)<<2|(n=e.charCodeAt(u++))>>6,s=63&n,isNaN(r)?a=s=64:isNaN(n)&&(s=64),c=c+l.charAt(o)+l.charAt(i)+l.charAt(a)+l.charAt(s);return c}),"undefined"!=typeof window&&"function"==typeof window.atob)var l=window.atob;function d(e,t){if(!(t instanceof Array))throw new Error("'pack' error. Got invalid type argument.");if(e.length-1!=t.length)throw new Error("'pack' error. "+(e.length-1)+" marks, "+t.length+" elements.");var r;if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("");r=!1}for(var n="",o=1,i=null,a=null,s=null;a=e[o];){if("b"==a.toLowerCase()){if(i=t[o-1],"b"==a&&i<0&&(i+=256),i>255||i<0)throw new Error("'pack' error.");s=String.fromCharCode(i)}else if("H"==a){if((i=t[o-1])>65535||i<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(i%65536/256))+String.fromCharCode(i%256),r&&(s=s.split("").reverse().join(""))}else{if("l"!=a.toLowerCase())throw new Error("'pack' error.");if(i=t[o-1],"l"==a&&i<0&&(i+=4294967296),i>4294967295||i<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(i/16777216))+String.fromCharCode(Math.floor(i%16777216/65536))+String.fromCharCode(Math.floor(i%65536/256))+String.fromCharCode(i%256),r&&(s=s.split("").reverse().join(""))}n+=s,o+=1}return n}function f(e,t){if("string"!=typeof t)throw new Error("'unpack' error. Got invalid type argument.");for(var r,n=0,o=1;o<e.length;o++)if("b"==e[o].toLowerCase())n+=1;else if("h"==e[o].toLowerCase())n+=2;else{if("l"!=e[o].toLowerCase())throw new Error("'unpack' error. Got invalid mark.");n+=4}if(n!=t.length)throw new Error("'unpack' error. Mismatch between symbol and string length. "+n+":"+t.length);if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("'unpack' error.");r=!1}for(var i=[],a=0,s=1,c=null,u=null,l=null,d="";u=e[s];){if("b"==u.toLowerCase())l=1,c=(d=t.slice(a,a+l)).charCodeAt(0),"b"==u&&c>=128&&(c-=256);else if("H"==u)l=2,d=t.slice(a,a+l),r&&(d=d.split("").reverse().join("")),c=256*d.charCodeAt(0)+d.charCodeAt(1);else{if("l"!=u.toLowerCase())throw new Error("'unpack' error. "+u);l=4,d=t.slice(a,a+l),r&&(d=d.split("").reverse().join("")),c=16777216*d.charCodeAt(0)+65536*d.charCodeAt(1)+256*d.charCodeAt(2)+d.charCodeAt(3),"l"==u&&c>=2147483648&&(c-=4294967296)}i.push(c),a+=l,s+=1}return i}function p(e,t){for(var r="",n=0;n<t;n++)r+=e;return r}function h(e){if("ÿØ"!=e.slice(0,2))throw new Error("Given data isn't JPEG.");for(var t=2,r=["ÿØ"];;){if("ÿÚ"==e.slice(t,t+2)){r.push(e.slice(t));break}var n=t+f(">H",e.slice(t+2,t+4))[0]+2;if(r.push(e.slice(t,n)),(t=n)>=e.length)throw new Error("Wrong JPEG data.")}return r}void 0===l&&(l=function(e){var t,r,n,o,i,a,s="",c=0,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<e.length;)t=u.indexOf(e.charAt(c++))<<2|(o=u.indexOf(e.charAt(c++)))>>4,r=(15&o)<<4|(i=u.indexOf(e.charAt(c++)))>>2,n=(3&i)<<6|(a=u.indexOf(e.charAt(c++))),s+=String.fromCharCode(t),64!=i&&(s+=String.fromCharCode(r)),64!=a&&(s+=String.fromCharCode(n));return s});var m={Byte:1,Ascii:2,Short:3,Long:4,Rational:5,Undefined:7,SLong:9,SRational:10},g={Image:{11:{name:"ProcessingSoftware",type:"Ascii"},254:{name:"NewSubfileType",type:"Long"},255:{name:"SubfileType",type:"Short"},256:{name:"ImageWidth",type:"Long"},257:{name:"ImageLength",type:"Long"},258:{name:"BitsPerSample",type:"Short"},259:{name:"Compression",type:"Short"},262:{name:"PhotometricInterpretation",type:"Short"},263:{name:"Threshholding",type:"Short"},264:{name:"CellWidth",type:"Short"},265:{name:"CellLength",type:"Short"},266:{name:"FillOrder",type:"Short"},269:{name:"DocumentName",type:"Ascii"},270:{name:"ImageDescription",type:"Ascii"},271:{name:"Make",type:"Ascii"},272:{name:"Model",type:"Ascii"},273:{name:"StripOffsets",type:"Long"},274:{name:"Orientation",type:"Short"},277:{name:"SamplesPerPixel",type:"Short"},278:{name:"RowsPerStrip",type:"Long"},279:{name:"StripByteCounts",type:"Long"},282:{name:"XResolution",type:"Rational"},283:{name:"YResolution",type:"Rational"},284:{name:"PlanarConfiguration",type:"Short"},290:{name:"GrayResponseUnit",type:"Short"},291:{name:"GrayResponseCurve",type:"Short"},292:{name:"T4Options",type:"Long"},293:{name:"T6Options",type:"Long"},296:{name:"ResolutionUnit",type:"Short"},301:{name:"TransferFunction",type:"Short"},305:{name:"Software",type:"Ascii"},306:{name:"DateTime",type:"Ascii"},315:{name:"Artist",type:"Ascii"},316:{name:"HostComputer",type:"Ascii"},317:{name:"Predictor",type:"Short"},318:{name:"WhitePoint",type:"Rational"},319:{name:"PrimaryChromaticities",type:"Rational"},320:{name:"ColorMap",type:"Short"},321:{name:"HalftoneHints",type:"Short"},322:{name:"TileWidth",type:"Short"},323:{name:"TileLength",type:"Short"},324:{name:"TileOffsets",type:"Short"},325:{name:"TileByteCounts",type:"Short"},330:{name:"SubIFDs",type:"Long"},332:{name:"InkSet",type:"Short"},333:{name:"InkNames",type:"Ascii"},334:{name:"NumberOfInks",type:"Short"},336:{name:"DotRange",type:"Byte"},337:{name:"TargetPrinter",type:"Ascii"},338:{name:"ExtraSamples",type:"Short"},339:{name:"SampleFormat",type:"Short"},340:{name:"SMinSampleValue",type:"Short"},341:{name:"SMaxSampleValue",type:"Short"},342:{name:"TransferRange",type:"Short"},343:{name:"ClipPath",type:"Byte"},344:{name:"XClipPathUnits",type:"Long"},345:{name:"YClipPathUnits",type:"Long"},346:{name:"Indexed",type:"Short"},347:{name:"JPEGTables",type:"Undefined"},351:{name:"OPIProxy",type:"Short"},512:{name:"JPEGProc",type:"Long"},513:{name:"JPEGInterchangeFormat",type:"Long"},514:{name:"JPEGInterchangeFormatLength",type:"Long"},515:{name:"JPEGRestartInterval",type:"Short"},517:{name:"JPEGLosslessPredictors",type:"Short"},518:{name:"JPEGPointTransforms",type:"Short"},519:{name:"JPEGQTables",type:"Long"},520:{name:"JPEGDCTables",type:"Long"},521:{name:"JPEGACTables",type:"Long"},529:{name:"YCbCrCoefficients",type:"Rational"},530:{name:"YCbCrSubSampling",type:"Short"},531:{name:"YCbCrPositioning",type:"Short"},532:{name:"ReferenceBlackWhite",type:"Rational"},700:{name:"XMLPacket",type:"Byte"},18246:{name:"Rating",type:"Short"},18249:{name:"RatingPercent",type:"Short"},32781:{name:"ImageID",type:"Ascii"},33421:{name:"CFARepeatPatternDim",type:"Short"},33422:{name:"CFAPattern",type:"Byte"},33423:{name:"BatteryLevel",type:"Rational"},33432:{name:"Copyright",type:"Ascii"},33434:{name:"ExposureTime",type:"Rational"},34377:{name:"ImageResources",type:"Byte"},34665:{name:"ExifTag",type:"Long"},34675:{name:"InterColorProfile",type:"Undefined"},34853:{name:"GPSTag",type:"Long"},34857:{name:"Interlace",type:"Short"},34858:{name:"TimeZoneOffset",type:"Long"},34859:{name:"SelfTimerMode",type:"Short"},37387:{name:"FlashEnergy",type:"Rational"},37388:{name:"SpatialFrequencyResponse",type:"Undefined"},37389:{name:"Noise",type:"Undefined"},37390:{name:"FocalPlaneXResolution",type:"Rational"},37391:{name:"FocalPlaneYResolution",type:"Rational"},37392:{name:"FocalPlaneResolutionUnit",type:"Short"},37393:{name:"ImageNumber",type:"Long"},37394:{name:"SecurityClassification",type:"Ascii"},37395:{name:"ImageHistory",type:"Ascii"},37397:{name:"ExposureIndex",type:"Rational"},37398:{name:"TIFFEPStandardID",type:"Byte"},37399:{name:"SensingMethod",type:"Short"},40091:{name:"XPTitle",type:"Byte"},40092:{name:"XPComment",type:"Byte"},40093:{name:"XPAuthor",type:"Byte"},40094:{name:"XPKeywords",type:"Byte"},40095:{name:"XPSubject",type:"Byte"},50341:{name:"PrintImageMatching",type:"Undefined"},50706:{name:"DNGVersion",type:"Byte"},50707:{name:"DNGBackwardVersion",type:"Byte"},50708:{name:"UniqueCameraModel",type:"Ascii"},50709:{name:"LocalizedCameraModel",type:"Byte"},50710:{name:"CFAPlaneColor",type:"Byte"},50711:{name:"CFALayout",type:"Short"},50712:{name:"LinearizationTable",type:"Short"},50713:{name:"BlackLevelRepeatDim",type:"Short"},50714:{name:"BlackLevel",type:"Rational"},50715:{name:"BlackLevelDeltaH",type:"SRational"},50716:{name:"BlackLevelDeltaV",type:"SRational"},50717:{name:"WhiteLevel",type:"Short"},50718:{name:"DefaultScale",type:"Rational"},50719:{name:"DefaultCropOrigin",type:"Short"},50720:{name:"DefaultCropSize",type:"Short"},50721:{name:"ColorMatrix1",type:"SRational"},50722:{name:"ColorMatrix2",type:"SRational"},50723:{name:"CameraCalibration1",type:"SRational"},50724:{name:"CameraCalibration2",type:"SRational"},50725:{name:"ReductionMatrix1",type:"SRational"},50726:{name:"ReductionMatrix2",type:"SRational"},50727:{name:"AnalogBalance",type:"Rational"},50728:{name:"AsShotNeutral",type:"Short"},50729:{name:"AsShotWhiteXY",type:"Rational"},50730:{name:"BaselineExposure",type:"SRational"},50731:{name:"BaselineNoise",type:"Rational"},50732:{name:"BaselineSharpness",type:"Rational"},50733:{name:"BayerGreenSplit",type:"Long"},50734:{name:"LinearResponseLimit",type:"Rational"},50735:{name:"CameraSerialNumber",type:"Ascii"},50736:{name:"LensInfo",type:"Rational"},50737:{name:"ChromaBlurRadius",type:"Rational"},50738:{name:"AntiAliasStrength",type:"Rational"},50739:{name:"ShadowScale",type:"SRational"},50740:{name:"DNGPrivateData",type:"Byte"},50741:{name:"MakerNoteSafety",type:"Short"},50778:{name:"CalibrationIlluminant1",type:"Short"},50779:{name:"CalibrationIlluminant2",type:"Short"},50780:{name:"BestQualityScale",type:"Rational"},50781:{name:"RawDataUniqueID",type:"Byte"},50827:{name:"OriginalRawFileName",type:"Byte"},50828:{name:"OriginalRawFileData",type:"Undefined"},50829:{name:"ActiveArea",type:"Short"},50830:{name:"MaskedAreas",type:"Short"},50831:{name:"AsShotICCProfile",type:"Undefined"},50832:{name:"AsShotPreProfileMatrix",type:"SRational"},50833:{name:"CurrentICCProfile",type:"Undefined"},50834:{name:"CurrentPreProfileMatrix",type:"SRational"},50879:{name:"ColorimetricReference",type:"Short"},50931:{name:"CameraCalibrationSignature",type:"Byte"},50932:{name:"ProfileCalibrationSignature",type:"Byte"},50934:{name:"AsShotProfileName",type:"Byte"},50935:{name:"NoiseReductionApplied",type:"Rational"},50936:{name:"ProfileName",type:"Byte"},50937:{name:"ProfileHueSatMapDims",type:"Long"},50938:{name:"ProfileHueSatMapData1",type:"Float"},50939:{name:"ProfileHueSatMapData2",type:"Float"},50940:{name:"ProfileToneCurve",type:"Float"},50941:{name:"ProfileEmbedPolicy",type:"Long"},50942:{name:"ProfileCopyright",type:"Byte"},50964:{name:"ForwardMatrix1",type:"SRational"},50965:{name:"ForwardMatrix2",type:"SRational"},50966:{name:"PreviewApplicationName",type:"Byte"},50967:{name:"PreviewApplicationVersion",type:"Byte"},50968:{name:"PreviewSettingsName",type:"Byte"},50969:{name:"PreviewSettingsDigest",type:"Byte"},50970:{name:"PreviewColorSpace",type:"Long"},50971:{name:"PreviewDateTime",type:"Ascii"},50972:{name:"RawImageDigest",type:"Undefined"},50973:{name:"OriginalRawFileDigest",type:"Undefined"},50974:{name:"SubTileBlockSize",type:"Long"},50975:{name:"RowInterleaveFactor",type:"Long"},50981:{name:"ProfileLookTableDims",type:"Long"},50982:{name:"ProfileLookTableData",type:"Float"},51008:{name:"OpcodeList1",type:"Undefined"},51009:{name:"OpcodeList2",type:"Undefined"},51022:{name:"OpcodeList3",type:"Undefined"}},Exif:{33434:{name:"ExposureTime",type:"Rational"},33437:{name:"FNumber",type:"Rational"},34850:{name:"ExposureProgram",type:"Short"},34852:{name:"SpectralSensitivity",type:"Ascii"},34855:{name:"ISOSpeedRatings",type:"Short"},34856:{name:"OECF",type:"Undefined"},34864:{name:"SensitivityType",type:"Short"},34865:{name:"StandardOutputSensitivity",type:"Long"},34866:{name:"RecommendedExposureIndex",type:"Long"},34867:{name:"ISOSpeed",type:"Long"},34868:{name:"ISOSpeedLatitudeyyy",type:"Long"},34869:{name:"ISOSpeedLatitudezzz",type:"Long"},36864:{name:"ExifVersion",type:"Undefined"},36867:{name:"DateTimeOriginal",type:"Ascii"},36868:{name:"DateTimeDigitized",type:"Ascii"},37121:{name:"ComponentsConfiguration",type:"Undefined"},37122:{name:"CompressedBitsPerPixel",type:"Rational"},37377:{name:"ShutterSpeedValue",type:"SRational"},37378:{name:"ApertureValue",type:"Rational"},37379:{name:"BrightnessValue",type:"SRational"},37380:{name:"ExposureBiasValue",type:"SRational"},37381:{name:"MaxApertureValue",type:"Rational"},37382:{name:"SubjectDistance",type:"Rational"},37383:{name:"MeteringMode",type:"Short"},37384:{name:"LightSource",type:"Short"},37385:{name:"Flash",type:"Short"},37386:{name:"FocalLength",type:"Rational"},37396:{name:"SubjectArea",type:"Short"},37500:{name:"MakerNote",type:"Undefined"},37510:{name:"UserComment",type:"Ascii"},37520:{name:"SubSecTime",type:"Ascii"},37521:{name:"SubSecTimeOriginal",type:"Ascii"},37522:{name:"SubSecTimeDigitized",type:"Ascii"},40960:{name:"FlashpixVersion",type:"Undefined"},40961:{name:"ColorSpace",type:"Short"},40962:{name:"PixelXDimension",type:"Long"},40963:{name:"PixelYDimension",type:"Long"},40964:{name:"RelatedSoundFile",type:"Ascii"},40965:{name:"InteroperabilityTag",type:"Long"},41483:{name:"FlashEnergy",type:"Rational"},41484:{name:"SpatialFrequencyResponse",type:"Undefined"},41486:{name:"FocalPlaneXResolution",type:"Rational"},41487:{name:"FocalPlaneYResolution",type:"Rational"},41488:{name:"FocalPlaneResolutionUnit",type:"Short"},41492:{name:"SubjectLocation",type:"Short"},41493:{name:"ExposureIndex",type:"Rational"},41495:{name:"SensingMethod",type:"Short"},41728:{name:"FileSource",type:"Undefined"},41729:{name:"SceneType",type:"Undefined"},41730:{name:"CFAPattern",type:"Undefined"},41985:{name:"CustomRendered",type:"Short"},41986:{name:"ExposureMode",type:"Short"},41987:{name:"WhiteBalance",type:"Short"},41988:{name:"DigitalZoomRatio",type:"Rational"},41989:{name:"FocalLengthIn35mmFilm",type:"Short"},41990:{name:"SceneCaptureType",type:"Short"},41991:{name:"GainControl",type:"Short"},41992:{name:"Contrast",type:"Short"},41993:{name:"Saturation",type:"Short"},41994:{name:"Sharpness",type:"Short"},41995:{name:"DeviceSettingDescription",type:"Undefined"},41996:{name:"SubjectDistanceRange",type:"Short"},42016:{name:"ImageUniqueID",type:"Ascii"},42032:{name:"CameraOwnerName",type:"Ascii"},42033:{name:"BodySerialNumber",type:"Ascii"},42034:{name:"LensSpecification",type:"Rational"},42035:{name:"LensMake",type:"Ascii"},42036:{name:"LensModel",type:"Ascii"},42037:{name:"LensSerialNumber",type:"Ascii"},42240:{name:"Gamma",type:"Rational"}},GPS:{0:{name:"GPSVersionID",type:"Byte"},1:{name:"GPSLatitudeRef",type:"Ascii"},2:{name:"GPSLatitude",type:"Rational"},3:{name:"GPSLongitudeRef",type:"Ascii"},4:{name:"GPSLongitude",type:"Rational"},5:{name:"GPSAltitudeRef",type:"Byte"},6:{name:"GPSAltitude",type:"Rational"},7:{name:"GPSTimeStamp",type:"Rational"},8:{name:"GPSSatellites",type:"Ascii"},9:{name:"GPSStatus",type:"Ascii"},10:{name:"GPSMeasureMode",type:"Ascii"},11:{name:"GPSDOP",type:"Rational"},12:{name:"GPSSpeedRef",type:"Ascii"},13:{name:"GPSSpeed",type:"Rational"},14:{name:"GPSTrackRef",type:"Ascii"},15:{name:"GPSTrack",type:"Rational"},16:{name:"GPSImgDirectionRef",type:"Ascii"},17:{name:"GPSImgDirection",type:"Rational"},18:{name:"GPSMapDatum",type:"Ascii"},19:{name:"GPSDestLatitudeRef",type:"Ascii"},20:{name:"GPSDestLatitude",type:"Rational"},21:{name:"GPSDestLongitudeRef",type:"Ascii"},22:{name:"GPSDestLongitude",type:"Rational"},23:{name:"GPSDestBearingRef",type:"Ascii"},24:{name:"GPSDestBearing",type:"Rational"},25:{name:"GPSDestDistanceRef",type:"Ascii"},26:{name:"GPSDestDistance",type:"Rational"},27:{name:"GPSProcessingMethod",type:"Undefined"},28:{name:"GPSAreaInformation",type:"Undefined"},29:{name:"GPSDateStamp",type:"Ascii"},30:{name:"GPSDifferential",type:"Short"},31:{name:"GPSHPositioningError",type:"Rational"}},Interop:{1:{name:"InteroperabilityIndex",type:"Ascii"}}};g["0th"]=g.Image,g["1st"]=g.Image,r.TAGS=g,r.ImageIFD={ProcessingSoftware:11,NewSubfileType:254,SubfileType:255,ImageWidth:256,ImageLength:257,BitsPerSample:258,Compression:259,PhotometricInterpretation:262,Threshholding:263,CellWidth:264,CellLength:265,FillOrder:266,DocumentName:269,ImageDescription:270,Make:271,Model:272,StripOffsets:273,Orientation:274,SamplesPerPixel:277,RowsPerStrip:278,StripByteCounts:279,XResolution:282,YResolution:283,PlanarConfiguration:284,GrayResponseUnit:290,GrayResponseCurve:291,T4Options:292,T6Options:293,ResolutionUnit:296,TransferFunction:301,Software:305,DateTime:306,Artist:315,HostComputer:316,Predictor:317,WhitePoint:318,PrimaryChromaticities:319,ColorMap:320,HalftoneHints:321,TileWidth:322,TileLength:323,TileOffsets:324,TileByteCounts:325,SubIFDs:330,InkSet:332,InkNames:333,NumberOfInks:334,DotRange:336,TargetPrinter:337,ExtraSamples:338,SampleFormat:339,SMinSampleValue:340,SMaxSampleValue:341,TransferRange:342,ClipPath:343,XClipPathUnits:344,YClipPathUnits:345,Indexed:346,JPEGTables:347,OPIProxy:351,JPEGProc:512,JPEGInterchangeFormat:513,JPEGInterchangeFormatLength:514,JPEGRestartInterval:515,JPEGLosslessPredictors:517,JPEGPointTransforms:518,JPEGQTables:519,JPEGDCTables:520,JPEGACTables:521,YCbCrCoefficients:529,YCbCrSubSampling:530,YCbCrPositioning:531,ReferenceBlackWhite:532,XMLPacket:700,Rating:18246,RatingPercent:18249,ImageID:32781,CFARepeatPatternDim:33421,CFAPattern:33422,BatteryLevel:33423,Copyright:33432,ExposureTime:33434,ImageResources:34377,ExifTag:34665,InterColorProfile:34675,GPSTag:34853,Interlace:34857,TimeZoneOffset:34858,SelfTimerMode:34859,FlashEnergy:37387,SpatialFrequencyResponse:37388,Noise:37389,FocalPlaneXResolution:37390,FocalPlaneYResolution:37391,FocalPlaneResolutionUnit:37392,ImageNumber:37393,SecurityClassification:37394,ImageHistory:37395,ExposureIndex:37397,TIFFEPStandardID:37398,SensingMethod:37399,XPTitle:40091,XPComment:40092,XPAuthor:40093,XPKeywords:40094,XPSubject:40095,PrintImageMatching:50341,DNGVersion:50706,DNGBackwardVersion:50707,UniqueCameraModel:50708,LocalizedCameraModel:50709,CFAPlaneColor:50710,CFALayout:50711,LinearizationTable:50712,BlackLevelRepeatDim:50713,BlackLevel:50714,BlackLevelDeltaH:50715,BlackLevelDeltaV:50716,WhiteLevel:50717,DefaultScale:50718,DefaultCropOrigin:50719,DefaultCropSize:50720,ColorMatrix1:50721,ColorMatrix2:50722,CameraCalibration1:50723,CameraCalibration2:50724,ReductionMatrix1:50725,ReductionMatrix2:50726,AnalogBalance:50727,AsShotNeutral:50728,AsShotWhiteXY:50729,BaselineExposure:50730,BaselineNoise:50731,BaselineSharpness:50732,BayerGreenSplit:50733,LinearResponseLimit:50734,CameraSerialNumber:50735,LensInfo:50736,ChromaBlurRadius:50737,AntiAliasStrength:50738,ShadowScale:50739,DNGPrivateData:50740,MakerNoteSafety:50741,CalibrationIlluminant1:50778,CalibrationIlluminant2:50779,BestQualityScale:50780,RawDataUniqueID:50781,OriginalRawFileName:50827,OriginalRawFileData:50828,ActiveArea:50829,MaskedAreas:50830,AsShotICCProfile:50831,AsShotPreProfileMatrix:50832,CurrentICCProfile:50833,CurrentPreProfileMatrix:50834,ColorimetricReference:50879,CameraCalibrationSignature:50931,ProfileCalibrationSignature:50932,AsShotProfileName:50934,NoiseReductionApplied:50935,ProfileName:50936,ProfileHueSatMapDims:50937,ProfileHueSatMapData1:50938,ProfileHueSatMapData2:50939,ProfileToneCurve:50940,ProfileEmbedPolicy:50941,ProfileCopyright:50942,ForwardMatrix1:50964,ForwardMatrix2:50965,PreviewApplicationName:50966,PreviewApplicationVersion:50967,PreviewSettingsName:50968,PreviewSettingsDigest:50969,PreviewColorSpace:50970,PreviewDateTime:50971,RawImageDigest:50972,OriginalRawFileDigest:50973,SubTileBlockSize:50974,RowInterleaveFactor:50975,ProfileLookTableDims:50981,ProfileLookTableData:50982,OpcodeList1:51008,OpcodeList2:51009,OpcodeList3:51022,NoiseProfile:51041},r.ExifIFD={ExposureTime:33434,FNumber:33437,ExposureProgram:34850,SpectralSensitivity:34852,ISOSpeedRatings:34855,OECF:34856,SensitivityType:34864,StandardOutputSensitivity:34865,RecommendedExposureIndex:34866,ISOSpeed:34867,ISOSpeedLatitudeyyy:34868,ISOSpeedLatitudezzz:34869,ExifVersion:36864,DateTimeOriginal:36867,DateTimeDigitized:36868,ComponentsConfiguration:37121,CompressedBitsPerPixel:37122,ShutterSpeedValue:37377,ApertureValue:37378,BrightnessValue:37379,ExposureBiasValue:37380,MaxApertureValue:37381,SubjectDistance:37382,MeteringMode:37383,LightSource:37384,Flash:37385,FocalLength:37386,SubjectArea:37396,MakerNote:37500,UserComment:37510,SubSecTime:37520,SubSecTimeOriginal:37521,SubSecTimeDigitized:37522,FlashpixVersion:40960,ColorSpace:40961,PixelXDimension:40962,PixelYDimension:40963,RelatedSoundFile:40964,InteroperabilityTag:40965,FlashEnergy:41483,SpatialFrequencyResponse:41484,FocalPlaneXResolution:41486,FocalPlaneYResolution:41487,FocalPlaneResolutionUnit:41488,SubjectLocation:41492,ExposureIndex:41493,SensingMethod:41495,FileSource:41728,SceneType:41729,CFAPattern:41730,CustomRendered:41985,ExposureMode:41986,WhiteBalance:41987,DigitalZoomRatio:41988,FocalLengthIn35mmFilm:41989,SceneCaptureType:41990,GainControl:41991,Contrast:41992,Saturation:41993,Sharpness:41994,DeviceSettingDescription:41995,SubjectDistanceRange:41996,ImageUniqueID:42016,CameraOwnerName:42032,BodySerialNumber:42033,LensSpecification:42034,LensMake:42035,LensModel:42036,LensSerialNumber:42037,Gamma:42240},r.GPSIFD={GPSVersionID:0,GPSLatitudeRef:1,GPSLatitude:2,GPSLongitudeRef:3,GPSLongitude:4,GPSAltitudeRef:5,GPSAltitude:6,GPSTimeStamp:7,GPSSatellites:8,GPSStatus:9,GPSMeasureMode:10,GPSDOP:11,GPSSpeedRef:12,GPSSpeed:13,GPSTrackRef:14,GPSTrack:15,GPSImgDirectionRef:16,GPSImgDirection:17,GPSMapDatum:18,GPSDestLatitudeRef:19,GPSDestLatitude:20,GPSDestLongitudeRef:21,GPSDestLongitude:22,GPSDestBearingRef:23,GPSDestBearing:24,GPSDestDistanceRef:25,GPSDestDistance:26,GPSProcessingMethod:27,GPSAreaInformation:28,GPSDateStamp:29,GPSDifferential:30,GPSHPositioningError:31},r.InteropIFD={InteroperabilityIndex:1},r.GPSHelper={degToDmsRational:function(e){var t=Math.abs(e),r=t%1*60,n=r%1*60;return[[Math.floor(t),1],[Math.floor(r),1],[Math.round(100*n),100]]},dmsRationalToDeg:function(e,t){var r="S"===t||"W"===t?-1:1;return(e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600)*r}},e.exports&&(t=e.exports=r),t.piexif=r}()}));function Vq(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function zq(e,t){return e&t}function qq(e,t){return e|t}function Hq(e,t){return e^t}function Kq(e,t){return e&~t}function Wq(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function Gq(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var Qq,Xq="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Yq(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=Xq.charAt(r>>6)+Xq.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=Xq.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=Xq.charAt(r>>2)+Xq.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function $q(e){var t,r="",n=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var i=Xq.indexOf(e.charAt(t));i<0||(0==n?(r+=Vq(i>>2),o=3&i,n=1):1==n?(r+=Vq(o<<2|i>>4),o=15&i,n=2):2==n?(r+=Vq(o),r+=Vq(i>>2),o=3&i,n=3):(r+=Vq(o<<2|i>>4),r+=Vq(15&i),n=0))}return 1==n&&(r+=Vq(o<<2)),r}var Zq,Jq=function(e){var t;if(void 0===Qq){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(Qq={},t=0;t<16;++t)Qq[r.charAt(t)]=t;for(r=r.toLowerCase(),t=10;t<16;++t)Qq[r.charAt(t)]=t;for(t=0;t<n.length;++t)Qq[n.charAt(t)]=-1}var o=[],i=0,a=0;for(t=0;t<e.length;++t){var s=e.charAt(t);if("="==s)break;if(-1!=(s=Qq[s])){if(void 0===s)throw new Error("Illegal character at offset "+t);i|=s,++a>=2?(o[o.length]=i,i=0,a=0):i<<=4}}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return o},eH={decode:function(e){var t;if(void 0===Zq){var r="= \f\n\r\t \u2028\u2029";for(Zq=Object.create(null),t=0;t<64;++t)Zq["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(Zq["-"]=62,Zq._=63,t=0;t<r.length;++t)Zq[r.charAt(t)]=-1}var n=[],o=0,i=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=Zq[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);o|=a,++i>=4?(n[n.length]=o>>16,n[n.length]=o>>8&255,n[n.length]=255&o,o=0,i=0):o<<=6}}switch(i){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=o>>10;break;case 3:n[n.length]=o>>16,n[n.length]=o>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=eH.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return eH.decode(e)}},tH=1e13,rH=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var r,n,o=this.buf,i=o.length;for(r=0;r<i;++r)(n=o[r]*e+t)<tH?t=0:n-=(t=0|n/tH)*tH,o[r]=n;t>0&&(o[r]=t)},e.prototype.sub=function(e){var t,r,n=this.buf,o=n.length;for(t=0;t<o;++t)(r=n[t]-e)<0?(r+=tH,e=1):e=0,n[t]=r;for(;0===n[n.length-1];)n.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,r=t[t.length-1].toString(),n=t.length-2;n>=0;--n)r+=(tH+t[n]).toString().substring(1);return r},e.prototype.valueOf=function(){for(var e=this.buf,t=0,r=e.length-1;r>=0;--r)t=t*tH+e[r];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),nH=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,oH=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function iH(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var aH,sH=function(){function e(t,r){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=r)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,r){for(var n="",o=e;o<t;++o)if(n+=this.hexByte(this.get(o)),!0!==r)switch(15&o){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},e.prototype.isASCII=function(e,t){for(var r=e;r<t;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var r="",n=e;n<t;++n)r+=String.fromCharCode(this.get(n));return r},e.prototype.parseStringUTF=function(e,t){for(var r="",n=e;n<t;){var o=this.get(n++);r+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(n++)):String.fromCharCode((15&o)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},e.prototype.parseStringBMP=function(e,t){for(var r,n,o="",i=e;i<t;)r=this.get(i++),n=this.get(i++),o+=String.fromCharCode(r<<8|n);return o},e.prototype.parseTime=function(e,t,r){var n=this.parseStringISO(e,t),o=(r?nH:oH).exec(n);return o?(r&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),n=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(n+=":"+o[5],o[6]&&(n+=":"+o[6],o[7]&&(n+="."+o[7]))),o[8]&&(n+=" UTC","Z"!=o[8]&&(n+=o[8],o[9]&&(n+=":"+o[9]))),n):"Unrecognized time: "+n},e.prototype.parseInteger=function(e,t){for(var r,n=this.get(e),o=n>127,i=o?255:0,a="";n==i&&++e<t;)n=this.get(e);if(0==(r=t-e))return o?-1:0;if(r>4){for(a=n,r<<=3;0==(128&(+a^i));)a=+a<<1,--r;a="("+r+" bit)\n"}o&&(n-=256);for(var s=new rH(n),c=e+1;c<t;++c)s.mulAdd(256,this.get(c));return a+s.toString()},e.prototype.parseBitString=function(e,t,r){for(var n=this.get(e),o="("+((t-e-1<<3)-n)+" bit)\n",i="",a=e+1;a<t;++a){for(var s=this.get(a),c=a==t-1?n:0,u=7;u>=c;--u)i+=s>>u&1?"1":"0";if(i.length>r)return o+iH(i,r)}return o+i},e.prototype.parseOctetString=function(e,t,r){if(this.isASCII(e,t))return iH(this.parseStringISO(e,t),r);var n=t-e,o="("+n+" byte)\n";n>(r/=2)&&(t=e+r);for(var i=e;i<t;++i)o+=this.hexByte(this.get(i));return n>r&&(o+="…"),o},e.prototype.parseOID=function(e,t,r){for(var n="",o=new rH,i=0,a=e;a<t;++a){var s=this.get(a);if(o.mulAdd(128,127&s),i+=7,!(128&s)){if(""===n)if((o=o.simplify())instanceof rH)o.sub(80),n="2."+o.toString();else{var c=o<80?o<40?0:1:2;n=c+"."+(o-40*c)}else n+="."+o.toString();if(n.length>r)return iH(n,r);o=new rH,i=0}}return i>0&&(n+=".incomplete"),n},e}(),cH=function(){function e(e,t,r,n,o){if(!(n instanceof uH))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=r,this.tag=n,this.sub=o}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+r,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);case 6:return this.stream.parseOID(t,t+r,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return iH(this.stream.parseStringUTF(t,t+r),e);case 18:case 19:case 20:case 21:case 22:case 26:return iH(this.stream.parseStringISO(t,t+r),e);case 30:return iH(this.stream.parseStringBMP(t,t+r),e);case 23:case 24:return this.stream.parseTime(t,t+r,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var r=0,n=this.sub.length;r<n;++r)t+=this.sub[r].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),r=127&t;if(r==t)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===r)return null;t=0;for(var n=0;n<r;++n)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,r=2*this.length;return e.substr(t,r)},e.decode=function(t){var r;r=t instanceof sH?t:new sH(t,0);var n=new sH(r),o=new uH(r),i=e.decodeLength(r),a=r.pos,s=a-n.pos,c=null,u=function(){var t=[];if(null!==i){for(var n=a+i;r.pos<n;)t[t.length]=e.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var o=e.decode(r);if(o.tag.isEOC())break;t[t.length]=o}i=a-r.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(o.tagConstructed)c=u();else if(o.isUniversal()&&(3==o.tagNumber||4==o.tagNumber))try{if(3==o.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");c=u();for(var l=0;l<c.length;++l)if(c[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){c=null}if(null===c){if(null===i)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);r.pos=a+Math.abs(i)}return new e(n,s,i,o,c)},e}(),uH=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=0!=(32&t),this.tagNumber=31&t,31==this.tagNumber){var r=new rH;do{t=e.get(),r.mulAdd(128,127&t)}while(128&t);this.tagNumber=r.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),lH=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],dH=(1<<26)/lH[lH.length-1],fH=function(){function e(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,o=!1,i="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(r=this[a]>>s)>0&&(o=!0,i=Vq(r));a>=0;)s<t?(r=(this[a]&(1<<s)-1)<<t-s,r|=this[--a]>>(s+=this.DB-t)):(r=this[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(o=!0),o&&(i+=Vq(r));return o?i:"0"},e.prototype.negate=function(){var t=vH();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+EH(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var r=vH();return this.abs().divRemTo(t,null,r),this.s<0&&r.compareTo(e.ZERO)>0&&t.subTo(r,r),r},e.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new hH(t):new mH(t),this.exp(e,r)},e.prototype.clone=function(){var e=vH();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var r,n=this.DB-e*this.DB%8,o=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[o++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==o&&(128&this.s)!=(128&r)&&++o,(o>0||r!=this.s)&&(t[o++]=r);return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=vH();return this.bitwiseTo(e,zq,t),t},e.prototype.or=function(e){var t=vH();return this.bitwiseTo(e,qq,t),t},e.prototype.xor=function(e){var t=vH();return this.bitwiseTo(e,Hq,t),t},e.prototype.andNot=function(e){var t=vH();return this.bitwiseTo(e,Kq,t),t},e.prototype.not=function(){for(var e=vH(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=vH();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=vH();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+Wq(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Gq(this[r]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,qq)},e.prototype.clearBit=function(e){return this.changeBit(e,Kq)},e.prototype.flipBit=function(e){return this.changeBit(e,Hq)},e.prototype.add=function(e){var t=vH();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=vH();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=vH();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=vH();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=vH();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=vH(),r=vH();return this.divRemTo(e,t,r),[t,r]},e.prototype.modPow=function(e,t){var r,n,o=e.bitLength(),i=SH(1);if(o<=0)return i;r=o<18?1:o<48?3:o<144?4:o<768?5:6,n=o<8?new hH(t):t.isEven()?new gH(t):new mH(t);var a=[],s=3,c=r-1,u=(1<<r)-1;if(a[1]=n.convert(this),r>1){var l=vH();for(n.sqrTo(a[1],l);s<=u;)a[s]=vH(),n.mulTo(l,a[s-2],a[s]),s+=2}var d,f,p=e.t-1,h=!0,m=vH();for(o=EH(e[p])-1;p>=0;){for(o>=c?d=e[p]>>o-c&u:(d=(e[p]&(1<<o+1)-1)<<c-o,p>0&&(d|=e[p-1]>>this.DB+o-c)),s=r;0==(1&d);)d>>=1,--s;if((o-=s)<0&&(o+=this.DB,--p),h)a[d].copyTo(i),h=!1;else{for(;s>1;)n.sqrTo(i,m),n.sqrTo(m,i),s-=2;s>0?n.sqrTo(i,m):(f=i,i=m,m=f),n.mulTo(m,a[d],i)}for(;p>=0&&0==(e[p]&1<<o);)n.sqrTo(i,m),f=i,i=m,m=f,--o<0&&(o=this.DB-1,--p)}return n.revert(i)},e.prototype.modInverse=function(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return e.ZERO;for(var n=t.clone(),o=this.clone(),i=SH(1),a=SH(0),s=SH(0),c=SH(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;o.isEven();)o.rShiftTo(1,o),r?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(t,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(t,c),c.rShiftTo(1,c);n.compareTo(o)>=0?(n.subTo(o,n),r&&i.subTo(s,i),a.subTo(c,a)):(o.subTo(n,o),r&&s.subTo(i,s),c.subTo(a,c))}return 0!=o.compareTo(e.ONE)?e.ZERO:c.compareTo(t)>=0?c.subtract(t):c.signum()<0?(c.addTo(t,c),c.signum()<0?c.add(t):c):c},e.prototype.pow=function(e){return this.exp(e,new pH)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},e.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=lH[lH.length-1]){for(t=0;t<lH.length;++t)if(r[0]==lH[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<lH.length;){for(var n=lH[t],o=t+1;o<lH.length&&n<dH;)n*=lH[o++];for(n=r.modInt(n);t<o;)if(n%lH[t++]==0)return!1}return r.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var o=t.length,i=!1,a=0;--o>=0;){var s=8==n?255&+t[o]:BH(t,o);s<0?"-"==t.charAt(o)&&(i=!0):(i=!1,0==a?this[this.t++]=s:a+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,(a+=n)>=this.DB&&(a-=this.DB))}8==n&&0!=(128&+t[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var r=e%this.DB,n=this.DB-r,o=(1<<n)-1,i=Math.floor(e/this.DB),a=this.s<<r&this.DM,s=this.t-1;s>=0;--s)t[s+i+1]=this[s]>>n|a,a=(this[s]&o)<<r;for(s=i-1;s>=0;--s)t[s]=0;t[i]=a,t.t=this.t+i+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,o=this.DB-n,i=(1<<n)-1;t[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)t[a-r-1]|=(this[a]&i)<<o,t[a-r]=this[a]>>n;n>0&&(t[this.t-r-1]|=(this.s&i)<<o),t.t=this.t-r,t.clamp()}},e.prototype.subTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},e.prototype.multiplyTo=function(t,r){var n=this.abs(),o=t.abs(),i=n.t;for(r.t=i+o.t;--i>=0;)r[i]=0;for(i=0;i<o.t;++i)r[i+n.t]=n.am(0,o[i],r,i,0,n.t);r.s=0,r.clamp(),this.s!=t.s&&e.ZERO.subTo(r,r)},e.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,r,n){var o=t.abs();if(!(o.t<=0)){var i=this.abs();if(i.t<o.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=vH());var a=vH(),s=this.s,c=t.s,u=this.DB-EH(o[o.t-1]);u>0?(o.lShiftTo(u,a),i.lShiftTo(u,n)):(o.copyTo(a),i.copyTo(n));var l=a.t,d=a[l-1];if(0!=d){var f=d*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0),p=this.FV/f,h=(1<<this.F1)/f,m=1<<this.F2,g=n.t,v=g-l,y=null==r?vH():r;for(a.dlShiftTo(v,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),e.ONE.dlShiftTo(l,y),y.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--v>=0;){var b=n[--g]==d?this.DM:Math.floor(n[g]*p+(n[g-1]+m)*h);if((n[g]+=a.am(0,b,n,v,0,l))<b)for(a.dlShiftTo(v,y),n.subTo(y,n);n[g]<--b;)n.subTo(y,n)}null!=r&&(n.drShiftTo(l,r),s!=c&&e.ZERO.subTo(r,r)),n.t=l,n.clamp(),u>0&&n.rShiftTo(u,n),s<0&&e.ZERO.subTo(n,n)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,r){if(t>4294967295||t<1)return e.ONE;var n=vH(),o=vH(),i=r.convert(this),a=EH(t)-1;for(i.copyTo(n);--a>=0;)if(r.sqrTo(n,o),(t&1<<a)>0)r.mulTo(o,i,n);else{var s=n;n=o,o=s}return r.revert(n)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=SH(r),o=vH(),i=vH(),a="";for(this.divRemTo(n,o,i);o.signum()>0;)a=(r+i.intValue()).toString(e).substr(1)+a,o.divRemTo(n,o,i);return i.intValue().toString(e)+a},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),o=Math.pow(r,n),i=!1,a=0,s=0,c=0;c<t.length;++c){var u=BH(t,c);u<0?"-"==t.charAt(c)&&0==this.signum()&&(i=!0):(s=r*s+u,++a>=n&&(this.dMultiply(o),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(r,a)),this.dAddOffset(s,0)),i&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,n){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),qq,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var o=[],i=7&t;o.length=1+(t>>3),r.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},e.prototype.bitwiseTo=function(e,t,r){var n,o,i=Math.min(e.t,this.t);for(n=0;n<i;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=i;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},e.prototype.changeBit=function(t,r){var n=e.ONE.shiftLeft(t);return this.bitwiseTo(n,r,n),n},e.prototype.addTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var o=r.t-this.t;n<o;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(o=Math.min(e.t,t);n<o;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()},e.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},e.prototype.millerRabin=function(t){var r=this.subtract(e.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var o=r.shiftRight(n);(t=t+1>>1)>lH.length&&(t=lH.length);for(var i=vH(),a=0;a<t;++a){i.fromInt(lH[Math.floor(Math.random()*lH.length)]);var s=i.modPow(o,this);if(0!=s.compareTo(e.ONE)&&0!=s.compareTo(r)){for(var c=1;c++<n&&0!=s.compareTo(r);)if(0==(s=s.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=s.compareTo(r))return!1}}return!0},e.prototype.square=function(){var e=vH();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var r=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(r.compareTo(n)<0){var o=r;r=n,n=o}var i=r.getLowestSetBit(),a=n.getLowestSetBit();if(a<0)t(r);else{i<a&&(a=i),a>0&&(r.rShiftTo(a,r),n.rShiftTo(a,n));setTimeout((function e(){(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(e,0):(a>0&&n.lShiftTo(a,n),setTimeout((function(){t(n)}),0))}),10)}},e.prototype.fromNumberAsync=function(t,r,n,o){if("number"==typeof r)if(t<2)this.fromInt(1);else{this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),qq,this),this.isEven()&&this.dAddOffset(1,0);var i=this;setTimeout((function n(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(e.ONE.shiftLeft(t-1),i),i.isProbablePrime(r)?setTimeout((function(){o()}),0):setTimeout(n,0)}),0)}else{var a=[],s=7&t;a.length=1+(t>>3),r.nextBytes(a),s>0?a[0]&=(1<<s)-1:a[0]=0,this.fromString(a,256)}},e}(),pH=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),hH=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),mH=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=vH();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(fH.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=vH();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),gH=function(){function e(e){this.m=e,this.r2=vH(),this.q3=vH(),fH.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=vH();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function vH(){return new fH(null)}function yH(e,t){return new fH(e,t)}var bH="undefined"!=typeof navigator;bH&&"Microsoft Internet Explorer"==navigator.appName?(fH.prototype.am=function(e,t,r,n,o,i){for(var a=32767&t,s=t>>15;--i>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;o=((c=a*c+((32767&l)<<15)+r[n]+(1073741823&o))>>>30)+(l>>>15)+s*u+(o>>>30),r[n++]=1073741823&c}return o},aH=30):bH&&"Netscape"!=navigator.appName?(fH.prototype.am=function(e,t,r,n,o,i){for(;--i>=0;){var a=t*this[e++]+r[n]+o;o=Math.floor(a/67108864),r[n++]=67108863&a}return o},aH=26):(fH.prototype.am=function(e,t,r,n,o,i){for(var a=16383&t,s=t>>14;--i>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;o=((c=a*c+((16383&l)<<14)+r[n]+o)>>28)+(l>>14)+s*u,r[n++]=268435455&c}return o},aH=28),fH.prototype.DB=aH,fH.prototype.DM=(1<<aH)-1,fH.prototype.DV=1<<aH,fH.prototype.FV=Math.pow(2,52),fH.prototype.F1=52-aH,fH.prototype.F2=2*aH-52;var wH,kH,CH=[];for(wH="0".charCodeAt(0),kH=0;kH<=9;++kH)CH[wH++]=kH;for(wH="a".charCodeAt(0),kH=10;kH<36;++kH)CH[wH++]=kH;for(wH="A".charCodeAt(0),kH=10;kH<36;++kH)CH[wH++]=kH;function BH(e,t){var r=CH[e.charCodeAt(t)];return null==r?-1:r}function SH(e){var t=vH();return t.fromInt(e),t}function EH(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}fH.ZERO=SH(0),fH.ONE=SH(1);var _H,xH,TH=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}(),AH=null;if(null==AH){AH=[],xH=0;var PH=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var IH=new Uint32Array(256);for(window.crypto.getRandomValues(IH),PH=0;PH<IH.length;++PH)AH[xH++]=255&IH[PH]}var RH=0,OH=function e(t){if((RH=RH||0)>=256||xH>=256)window.removeEventListener?window.removeEventListener("mousemove",e,!1):window.detachEvent&&window.detachEvent("onmousemove",e);else try{var r=t.x+t.y;AH[xH++]=255&r,RH+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",OH,!1):window.attachEvent&&window.attachEvent("onmousemove",OH))}function NH(){if(null==_H){for(_H=new TH;xH<256;){var e=Math.floor(65536*Math.random());AH[xH++]=255&e}for(_H.init(AH),xH=0;xH<AH.length;++xH)AH[xH]=0;xH=0}return _H.next()}var DH=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=NH()},e}(),MH=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=yH(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=this.n.bitLength()+7>>3,r=function(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=e.length-1;n>=0&&t>0;){var o=e.charCodeAt(n--);o<128?r[--t]=o:o>127&&o<2048?(r[--t]=63&o|128,r[--t]=o>>6|192):(r[--t]=63&o|128,r[--t]=o>>6&63|128,r[--t]=o>>12|224)}r[--t]=0;for(var i=new DH,a=[];t>2;){for(a[0]=0;0==a[0];)i.nextBytes(a);r[--t]=a[0]}return r[--t]=2,r[--t]=0,new fH(r)}(e,t);if(null==r)return null;var n=this.doPublic(r);if(null==n)return null;for(var o=n.toString(16),i=o.length,a=0;a<2*t-i;a++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,r){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=yH(e,16),this.e=parseInt(t,16),this.d=yH(r,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,r,n,o,i,a,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=yH(e,16),this.e=parseInt(t,16),this.d=yH(r,16),this.p=yH(n,16),this.q=yH(o,16),this.dmp1=yH(i,16),this.dmq1=yH(a,16),this.coeff=yH(s,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var r=new DH,n=e>>1;this.e=parseInt(t,16);for(var o=new fH(t,16);;){for(;this.p=new fH(e-n,1,r),0!=this.p.subtract(fH.ONE).gcd(o).compareTo(fH.ONE)||!this.p.isProbablePrime(10););for(;this.q=new fH(n,1,r),0!=this.q.subtract(fH.ONE).gcd(o).compareTo(fH.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var i=this.p;this.p=this.q,this.q=i}var a=this.p.subtract(fH.ONE),s=this.q.subtract(fH.ONE),c=a.multiply(s);if(0==c.gcd(o).compareTo(fH.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(c),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=yH(e,16),r=this.doPrivate(t);return null==r?null:function(e,t){for(var r=e.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=t-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var o="";++n<r.length;){var i=255&r[n];i<128?o+=String.fromCharCode(i):i>191&&i<224?(o+=String.fromCharCode((31&i)<<6|63&r[n+1]),++n):(o+=String.fromCharCode((15&i)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return o}(r,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,r){var n=new DH,o=e>>1;this.e=parseInt(t,16);var i=new fH(t,16),a=this;setTimeout((function t(){var s=function(){if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var n=a.p.subtract(fH.ONE),o=a.q.subtract(fH.ONE),s=n.multiply(o);0==s.gcd(i).compareTo(fH.ONE)?(a.n=a.p.multiply(a.q),a.d=i.modInverse(s),a.dmp1=a.d.mod(n),a.dmq1=a.d.mod(o),a.coeff=a.q.modInverse(a.p),setTimeout((function(){r()}),0)):setTimeout(t,0)},c=function e(){a.q=vH(),a.q.fromNumberAsync(o,1,n,(function(){a.q.subtract(fH.ONE).gcda(i,(function(t){0==t.compareTo(fH.ONE)&&a.q.isProbablePrime(10)?setTimeout(s,0):setTimeout(e,0)}))}))};setTimeout((function t(){a.p=vH(),a.p.fromNumberAsync(e-o,1,n,(function(){a.p.subtract(fH.ONE).gcda(i,(function(e){0==e.compareTo(fH.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(t,0)}))}))}),0)}),0)},e.prototype.sign=function(e,t,r){var n=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var r=t-e.length-6,n="",o=0;o<r;o+=2)n+="ff";return yH("0001"+n+"00"+e,16)}((LH[r]||"")+t(e).toString(),this.n.bitLength()/4);if(null==n)return null;var o=this.doPrivate(n);if(null==o)return null;var i=o.toString(16);return 0==(1&i.length)?i:"0"+i},e.prototype.verify=function(e,t,r){var n=yH(t,16),o=this.doPublic(n);return null==o?null:function(e){for(var t in LH)if(LH.hasOwnProperty(t)){var r=LH[t],n=r.length;if(e.substr(0,n)==r)return e.substr(n)}return e}
45
+ (r=MF).mode.CTRGladman=function(){var e=r.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function n(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var o=e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,o=r.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0),n(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c<o;c++)e[t+c]^=s[c]}});return e.Decryptor=o,e}(),r.mode.CTRGladman)})),FM((function(e,t){var r,n,o;e.exports=((o=MF).mode.OFB=(n=(r=o.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,o=this._iv,i=this._keystream;o&&(i=this._keystream=o.slice(0),this._iv=void 0),r.encryptBlock(i,0);for(var a=0;a<n;a++)e[t+a]^=i[a]}}),r.Decryptor=n,r),o.mode.OFB)})),FM((function(e,t){var r,n;e.exports=((n=MF).mode.ECB=((r=n.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),r.Decryptor=r.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),r),n.mode.ECB)})),FM((function(e,t){var r;e.exports=((r=MF).pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,o=n-r%n,i=r+o-1;e.clamp(),e.words[i>>>2]|=o<<24-i%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)})),FM((function(e,t){var r;e.exports=((r=MF).pad.Iso10126={pad:function(e,t){var n=4*t,o=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(o-1)).concat(r.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)})),FM((function(e,t){var r;e.exports=((r=MF).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)})),FM((function(e,t){var r;e.exports=((r=MF).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},r.pad.ZeroPadding)})),FM((function(e,t){var r;e.exports=((r=MF).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)})),FM((function(e,t){var r;e.exports=(r=MF,function(e){var t=r,n=t.lib.CipherParams,o=t.enc.Hex;t.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return n.create({ciphertext:t})}}}(),r.format.Hex)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,o=[],i=[],a=[],s=[],c=[],u=[],l=[],d=[],f=[],p=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var h=n^n<<1^n<<2^n<<3^n<<4;h=h>>>8^255&h^99,o[r]=h,i[h]=r;var m=e[r],g=e[m],v=e[g],y=257*e[h]^16843008*h;a[r]=y<<24|y>>>8,s[r]=y<<16|y>>>16,c[r]=y<<8|y>>>24,u[r]=y,y=16843009*v^65537*g^257*m^16843008*r,l[h]=y<<24|y>>>8,d[h]=y<<16|y>>>16,f[h]=y<<8|y>>>24,p[h]=y,r?(r=m^e[e[e[v^m]]],n^=e[e[n]]):r=n=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),i=this._keySchedule=[],a=0;a<n;a++)a<r?i[a]=t[a]:(u=i[a-1],a%r?r>6&&a%r==4&&(u=o[u>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u]):(u=o[(u=u<<8|u>>>24)>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u],u^=h[a/r|0]<<24),i[a]=i[a-r]^u);for(var s=this._invKeySchedule=[],c=0;c<n;c++){if(a=n-c,c%4)var u=i[a];else u=i[a-4];s[c]=c<4||a<=4?u:l[o[u>>>24]]^d[o[u>>>16&255]]^f[o[u>>>8&255]]^p[o[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,o)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,d,f,p,i),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,o,i,a,s){for(var c=this._nRounds,u=e[t]^r[0],l=e[t+1]^r[1],d=e[t+2]^r[2],f=e[t+3]^r[3],p=4,h=1;h<c;h++){var m=n[u>>>24]^o[l>>>16&255]^i[d>>>8&255]^a[255&f]^r[p++],g=n[l>>>24]^o[d>>>16&255]^i[f>>>8&255]^a[255&u]^r[p++],v=n[d>>>24]^o[f>>>16&255]^i[u>>>8&255]^a[255&l]^r[p++],y=n[f>>>24]^o[u>>>16&255]^i[l>>>8&255]^a[255&d]^r[p++];u=m,l=g,d=v,f=y}m=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[d>>>8&255]<<8|s[255&f])^r[p++],g=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[255&u])^r[p++],v=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[p++],y=(s[f>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&d])^r[p++],e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var o=this._subKeys=[],i=0;i<16;i++){var u=o[i]=[],l=c[i];for(r=0;r<24;r++)u[r/6|0]|=t[(s[r]-1+l)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(s[r+24]-1+l)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var d=this._invSubKeys=[];for(r=0;r<16;r++)d[r]=o[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var o=r[n],i=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^o[c])&l[c])>>>0];this._lBlock=a,this._rBlock=i^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function p(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=o._createHelper(d);var h=i.TripleDES=o.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),o=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(o))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(h)}(),r.TripleDES)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var a=o%r,s=t[a>>>2]>>>24-a%4*8&255;i=(i+n[o]+s)%256;var c=n[o];n[o]=n[i],n[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,r=this._j,n=0,o=0;o<4;o++){r=(r+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[r],e[r]=i,n|=e[(e[t]+e[r])%256]<<24-8*o}return this._i=t,this._j=r,n}e.RC4=t._createHelper(o);var a=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)o[r]^=n[r+4&7];if(t){var i=t.words,a=i[0],s=i[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;for(o[0]^=u,o[1]^=d,o[2]^=l,o[3]^=f,o[4]^=u,o[5]^=d,o[6]^=l,o[7]^=f,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),e[t+n]^=o[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,s=n>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)})),FM((function(e,t){var r;e.exports=(r=MF,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],a=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)c.call(this);for(o=0;o<8;o++)n[o]^=r[o+4&7];if(t){var i=t.words,a=i[0],s=i[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;for(n[0]^=u,n[1]^=d,n[2]^=l,n[3]^=f,n[4]^=u,n[5]^=d,n[6]^=l,n[7]^=f,o=0;o<4;o++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),e[t+n]^=o[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,s=n>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)})),FM((function(e,t){e.exports=MF}))),UF=function(e){var t=e.blob;return new Promise((function(e){var r=new FileReader;r.onload=function(t){var r=t.target.result,n=LF.MD5(LF.lib.WordArray.create(r)).toString();e(n)},r.readAsArrayBuffer(t)}))},jF=Object.freeze({__proto__:null,MD5:UF}),FF=["tracking"],VF=TF(),zF=_w.createContext(),qF={enable:!1,accessKey:"",secretKey:"",apiUrl:"",userId:""},HF=function(){var e=uM(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.tag,n=t.event,o=t.log,i=IF(new Date),a=o,e.t0=n,e.next="sdk_mode.read_id_card_one_side"===e.t0?6:"sdk_mode.liveness"===e.t0?19:36;break;case 6:return a=EF(o),s=o.result_object,e.next=10,UF({blob:s.image.blob});case 10:if(e.t1=e.sent,a.result_object.image={blob:e.t1},delete a.result_object.recordedVideos,!s.qrScannedResult){e.next=18;break}return e.next=16,UF({blob:s.qrScannedResult.image.blob});case 16:a.result_object.qrScannedResult.image.blob=e.sent,delete a.result_object.qrScannedResult.recordedVideos;case 18:return e.abrupt("break",36);case 19:return a=EF(o),c=o.result_object,u=c.steps,l=c.frontalFaces,d=c.frontalScaledImage,f=u.map((function(e){return UF({blob:e.image.blob})})),e.next=24,Promise.all(f);case 24:return p=e.sent,u.forEach((function(e,t){a.result_object.steps[t].image.blob=p[t]})),h=l.map((function(e){return UF({blob:e})})),e.next=29,Promise.all(h);case 29:if(m=e.sent,l.forEach((function(e,t){a.result_object.frontalFaces[t]=m[t]})),!d){e.next=35;break}return e.next=34,UF({blob:d});case 34:a.result_object.frontalScaledImage=e.sent;case 35:return e.abrupt("break",36);case 36:return e.abrupt("return",{tag:r,event:n,log:gM({device_time:i},a)});case 37:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function KF(e){var t,r=e.userId;if(r)t=r;else{var n=NF("tv:user-id");if(n)t=n;else{var o=SF();t=o,OF(o,"tv:user-id")}}return t}function WF(e){var t=e.value,r=e.children,n=t.tracking,o=void 0===n?qF:n,i=vM(t,FF),a=o.enable,s=void 0===a||a,c=o.accessKey,u=o.secretKey,l=o.apiUrl,d=o.userId,f=o.logSignature,p=_w.useCallback((function(e,t){if(f&&3===Object.keys(f).length){var r=f.timestamp,n=f.signature,o=f.logUrl;return fetch(o,{method:"POST",headers:gM({"X-TV-Timestamp":r,Authorization:n,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}if(s){if(!l||!c||!u)return console.error("apiUrl, accessKey and secretKey are required when tracking is enabled"),null;var i=new vF(c,u,l).httpClient.authorizer.getHeaders({requestPath:"/v1/log_events",method:"POST"});return fetch("".concat(l,"/v1/log_events"),{method:"POST",headers:gM({"X-TV-Timestamp":i["X-TV-Timestamp"],Authorization:i.Authorization,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}return null}),[f,s,l,c,u]),h=_w.useMemo((function(){return{"x-request-id":KF({userId:d})}}),[d]),m=_w.useCallback(uM(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.tag,n=t.event,o=t.log,i=void 0===o?{}:o,!s){e.next=11;break}return e.prev=2,e.next=5,HF({tag:r,event:n,log:i});case 5:a=e.sent,p(a,gM(gM({},h),VF)),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:case"end":return e.stop()}}),e,null,[[2,9]])}))),[p,h,s]);return _w.createElement(zF.Provider,{value:gM(gM({},i),{},{sendEvent:m})},r)}WF.propTypes={value:_k.shape({tracking:_k.shape({enable:_k.bool,accessKey:_k.string,secretKey:_k.string,apiUrl:_k.string,userId:_k.string})}).isRequired,children:_k.node.isRequired};var GF=Object.freeze({__proto__:null,defaultTrackingConfig:qF,getXRequestId:KF,SDKTrackingProvider:WF,useSDKTracking:function(){var e=_w.useContext(zF);return _w.useMemo((function(){return void 0===e?(console.warn("useSDKTracking must be used within a SDKTrackingProvider"),{sendEvent:function(){}}):e}),[e])}});function QF(e,t){return e&&!e.endsWith("/")?[e,"/",t].join(""):[e,t].join("")}function XF(){var e=pF();return null==e?void 0:e.assetRoot}var YF=Object.freeze({__proto__:null,getAsset:QF,useAssetRoot:XF,useAsset:function(e){return QF(XF(),e)}});function $F(e){return new Promise((function(t){return setTimeout(t,e)}))}var ZF=Object.freeze({__proto__:null,sleep:$F}),JF=Symbol("Comlink.proxy"),eV=Symbol("Comlink.endpoint"),tV=Symbol("Comlink.releaseProxy"),rV=Symbol("Comlink.thrown"),nV=function(e){return"object"==Ey(e)&&null!==e||"function"==typeof e},oV=new Map([["proxy",{canHandle:function(e){return nV(e)&&e[JF]},serialize:function(e){var t=new MessageChannel,r=t.port1,n=t.port2;return iV(e,r),[n,[n]]},deserialize:function(e){return e.start(),sV(e)}}],["throw",{canHandle:function(e){return nV(e)&&rV in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function iV(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;t.addEventListener("message",(function r(n){if(n&&n.data){var o,i=Object.assign({path:[]},n.data),a=i.id,s=i.type,c=i.path,u=(n.data.argumentList||[]).map(pV);try{var l=c.slice(0,-1).reduce((function(e,t){return e[t]}),e),d=c.reduce((function(e,t){return e[t]}),e);switch(s){case"GET":o=d;break;case"SET":l[c.slice(-1)[0]]=pV(n.data.value),o=!0;break;case"APPLY":o=d.apply(l,u);break;case"CONSTRUCT":o=function(e){return Object.assign(e,Iy({},JF,!0))}(jy(d,Gy(u)));break;case"ENDPOINT":var f=new MessageChannel,p=f.port1,h=f.port2;iV(e,h),o=function(e,t){return dV.set(e,t),e}(p,[p]);break;case"RELEASE":o=void 0;break;default:return}}catch(e){o=Iy({value:e},rV,0)}Promise.resolve(o).catch((function(e){return Iy({value:e},rV,0)})).then((function(e){var n=Wy(fV(e),2),o=n[0],i=n[1];t.postMessage(Object.assign(Object.assign({},o),{id:a}),i),"RELEASE"===s&&(t.removeEventListener("message",r),aV(t))}))}})),t.start&&t.start()}function aV(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function sV(e,t){return uV(e,[],t)}function cV(e){if(e)throw new Error("Proxy has been released and is not useable")}function uV(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=!1,o=new Proxy(r,{get:function(r,i){if(cV(n),i===tV)return function(){return hV(e,{type:"RELEASE",path:t.map((function(e){return e.toString()}))}).then((function(){aV(e),n=!0}))};if("then"===i){if(0===t.length)return{then:function(){return o}};var a=hV(e,{type:"GET",path:t.map((function(e){return e.toString()}))}).then(pV);return a.then.bind(a)}return uV(e,[].concat(Gy(t),[i]))},set:function(r,o,i){cV(n);var a=Wy(fV(i),2),s=a[0],c=a[1];return hV(e,{type:"SET",path:[].concat(Gy(t),[o]).map((function(e){return e.toString()})),value:s},c).then(pV)},apply:function(r,o,i){cV(n);var a=t[t.length-1];if(a===eV)return hV(e,{type:"ENDPOINT"}).then(pV);if("bind"===a)return uV(e,t.slice(0,-1));var s=Wy(lV(i),2),c=s[0],u=s[1];return hV(e,{type:"APPLY",path:t.map((function(e){return e.toString()})),argumentList:c},u).then(pV)},construct:function(r,o){cV(n);var i=Wy(lV(o),2),a=i[0],s=i[1];return hV(e,{type:"CONSTRUCT",path:t.map((function(e){return e.toString()})),argumentList:a},s).then(pV)}});return o}function lV(e){var t,r=e.map(fV);return[r.map((function(e){return e[0]})),(t=r.map((function(e){return e[1]})),Array.prototype.concat.apply([],t))]}var dV=new WeakMap;function fV(e){var t,r=rb(oV);try{for(r.s();!(t=r.n()).done;){var n=Wy(t.value,2),o=n[0],i=n[1];if(i.canHandle(e)){var a=Wy(i.serialize(e),2);return[{type:"HANDLER",name:o,value:a[0]},a[1]]}}}catch(e){r.e(e)}finally{r.f()}return[{type:"RAW",value:e},dV.get(e)||[]]}function pV(e){switch(e.type){case"HANDLER":return oV.get(e.name).deserialize(e.value);case"RAW":return e.value}}function hV(e,t,r){return new Promise((function(n){var o=new Array(4).fill(0).map((function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)})).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===o&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)}))}var mV=function(){if(!window.Worker)return null;var e=new Blob(['const t=Symbol("Comlink.proxy"),e=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),n=Symbol("Comlink.thrown"),a=t=>"object"==typeof t&&null!==t||"function"==typeof t,o=new Map([["proxy",{canHandle:e=>a(e)&&e[t],serialize(t){const{port1:e,port2:r}=new MessageChannel;return i(t,e),[r,[r]]},deserialize(t){return t.start(),s(t,[],e);var e}}],["throw",{canHandle:t=>a(t)&&n in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function i(e,r=self){r.addEventListener("message",(function a(o){if(!o||!o.data)return;const{id:c,type:s,path:l}=Object.assign({path:[]},o.data),g=(o.data.argumentList||[]).map(m);let p;try{const r=l.slice(0,-1).reduce(((t,e)=>t[e]),e),n=l.reduce(((t,e)=>t[e]),e);switch(s){case"GET":p=n;break;case"SET":r[l.slice(-1)[0]]=m(o.data.value),p=!0;break;case"APPLY":p=n.apply(r,g);break;case"CONSTRUCT":p=function(e){return Object.assign(e,{[t]:!0})}(new n(...g));break;case"ENDPOINT":{const{port1:t,port2:r}=new MessageChannel;i(e,r),p=function(t,e){return f.set(t,e),t}(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(t){p={value:t,[n]:0}}Promise.resolve(p).catch((t=>({value:t,[n]:0}))).then((t=>{const[e,n]=h(t);r.postMessage(Object.assign(Object.assign({},e),{id:c}),n),"RELEASE"===s&&(r.removeEventListener("message",a),u(r))}))})),r.start&&r.start()}function u(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function c(t){if(t)throw new Error("Proxy has been released and is not useable")}function s(t,n=[],a=function(){}){let o=!1;const i=new Proxy(a,{get(e,a){if(c(o),a===r)return()=>g(t,{type:"RELEASE",path:n.map((t=>t.toString()))}).then((()=>{u(t),o=!0}));if("then"===a){if(0===n.length)return{then:()=>i};const e=g(t,{type:"GET",path:n.map((t=>t.toString()))}).then(m);return e.then.bind(e)}return s(t,[...n,a])},set(e,r,a){c(o);const[i,u]=h(a);return g(t,{type:"SET",path:[...n,r].map((t=>t.toString())),value:i},u).then(m)},apply(r,a,i){c(o);const u=n[n.length-1];if(u===e)return g(t,{type:"ENDPOINT"}).then(m);if("bind"===u)return s(t,n.slice(0,-1));const[f,h]=l(i);return g(t,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:f},h).then(m)},construct(e,r){c(o);const[a,i]=l(r);return g(t,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:a},i).then(m)}});return i}function l(t){const e=t.map(h);return[e.map((t=>t[0])),(r=e.map((t=>t[1])),Array.prototype.concat.apply([],r))];var r}const f=new WeakMap;function h(t){for(const[e,r]of o)if(r.canHandle(t)){const[n,a]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},a]}return[{type:"RAW",value:t},f.get(t)||[]]}function m(t){switch(t.type){case"HANDLER":return o.get(t.name).deserialize(t.value);case"RAW":return t.value}}function g(t,e,r){return new Promise((n=>{const a=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");t.addEventListener("message",(function e(r){r.data&&r.data.id&&r.data.id===a&&(t.removeEventListener("message",e),n(r.data))})),t.start&&t.start(),t.postMessage(Object.assign({id:a},e),r)}))}var p=[[0,1,0],[1,-4,1],[0,1,0]];function d(t,e,r,n){return t[4*(r*e+n)]}function v(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var E="frontal",S="left",w="right",M="up",k="down",_=0,A=1,R=2;function L(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=y(t,2),a=n[0],o=n[1],i=y(e,2),u=i[0],c=i[1],s=[a[0],o[0]],l=[a[1],o[1]];return s[0]+r<=u[0]&&c[0]<=s[1]-r&&l[0]+r<=u[1]&&c[1]<=l[1]-.8*r?R:s[0]<=u[0]||c[0]<=s[1]||l[0]<=u[1]||c[1]<=l[1]?A:_}var P={code:"no_face",msg:{en:"Face not found",vi:"Không tìm thấy khuôn mặt"}},O={code:"partial_face",msg:{en:"Face out of the box",vi:"Không tìm thấy toàn bộ khuôn mặt"}},T={code:"multiple_faces",msg:{en:"Too many faces",vi:"Quá nhiều khuôn mặt"}},j={code:"face_too_small",msg:{en:"Face too small",vi:"Khuôn mặt quá nhỏ"}},F={code:"face_too_large",msg:{en:"Face too large",vi:"Khuôn mặt quá to"}},x={code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt không nằm trọn vẹn trong khung ảnh"}};function C(t){return Math.pow(Math.pow(t[0],2)+Math.pow(t[1],2),.5)}function N(t,e){return[t[0]-e[0],t[1]-e[1]]}function z(t,e,r,n){var a=r*(4*e)+4*n;return{r:t[a],g:t[a+1],b:t[a+2]}}i({calculateBlurScoreFunc:function(t){for(var e=t.data,r=t.reducedWidth,n=t.reducedHeight,a=0;a<e.length;a+=4){var o=(e[a]+e[a+1]+e[a+2])/3;e[a]=o}for(var i=0,u=0,c=n-1,s=r-1,l=1;l<c;l++)for(var f=1;f<s;f++){var h=p[0][0]*d(e,r,f-1,l-1)+p[0][1]*d(e,r,f,l-1)+p[0][2]*d(e,r,f+1,l-1)+p[1][0]*d(e,r,f-1,l)+p[1][1]*d(e,r,f,l)+p[1][2]*d(e,r,f+1,l)+p[2][0]*d(e,r,f-1,l+1)+p[2][1]*d(e,r,f,l+1)+p[2][2]*d(e,r,f+1,l+1);(h=Math.abs(h))>25&&i++,h>15&&h<25&&u++}var m=0;return i+u!==0&&(m=i/(i+u)),m},calculateFaceDirectionFunc:function(t){var e=t.landmarks,r=t.getPerfectFrontal,n=function(t){var e,r,n,a,o,i,u,c=y(t,4),s=c[0],l=c[1],f=c[2],h=c[3],m=N(l,s),g=C(m),p=(a=l,e=[(n=s)[0]+a[0],n[1]+a[1]],r=2,[e[0]/r,e[1]/r]),d=N(f,p),v=C(N(h,f)),b=N(h,p),E=C(b),S=(d[0]*b[0]+d[1]*b[1])/E,w=v/E;if(g>.5*E)o=(d[0]*m[0]+d[1]*m[1])/g/g;else{var M=C(N(d,function(t,e){return[t[0]*e,t[1]*e]}(b,S/E)));u=b,o=((i=d)[0]*u[1]-u[0]*i[1]>=0?1:-1)*M/g}return{left_right_score:o,up_down_score:w}}(e),a=n.left_right_score,o=n.up_down_score,i=y(e,3),u=i[0],c=i[1],s=i[2],l=c[0]-s[0],f=u[0]-s[0],h=r?.1:.3,m=o>.7,g=o<.42,p=a>=.35&&a<=.6,d=a<=-.35&&a>=-.6;return o>=.42&&o<=.7&&a>-h&&a<h&&l*f<0?{gesture:E,leftRightScore:a}:m&&!d&&!p?{gesture:M,leftRightScore:a}:g&&!d&&!p?{gesture:k,leftRightScore:a}:p&&!m&&!g?{gesture:w,leftRightScore:a}:d&&!m&&!g?{gesture:S,leftRightScore:a}:null},validatePredictionsFunc:function(t){var e,r,n,a,o,i,u,c,s,l,f,h,m,g,p,d,b,E,S,w,M,k,C,N,z,H,I,D,K,G,W,U,q,Y=t.predictions,B=t.width,Q=[[0,0],[B,t.height]],X=Y.reduce((function(t,e){var r=e.topLeft,n=e.bottomRight,a=e.probability,o=e.landmarks;a<.9||o.length<6||function(t){var e=t.small,r=e.coords,n=e.area,a=t.big,o=a.coords,i=a.area,u=n;if(!u){var c=y(r,2),s=c[0],l=c[1];u=(l[0]-s[0])*(l[1]-s[1])}var f=i;if(!f){var h=y(o,2),m=h[0],g=h[1];f=(g[0]-m[0])*(g[1]-m[1])}return u/f}({small:{coords:[r,n]},big:{coords:Q}})<=.025?t[_].push(e):t[L(Q,[r,n])].push(e);return t}),(v(e={},A,[]),v(e,R,[]),v(e,_,[]),e)),$=X[R].length,J=X[A].length;if(0===$)r=J>0?O:P;else if($+J>1)r=T;else{var V=n=X[R][0],Z=V.topLeft,tt=V.bottomRight;N=Q,z=y([Z,tt],2),H=z[0],I=z[1],D=y(N,2),K=D[0],G=D[1],W=I[0]-H[0],U=I[1]-H[1],q=G[0]-K[0],(a=W/q<U/q?W/q:U/q)<.4&&(r=j),a>.61&&(r=F),L(Q,(o=n.landmarks,c=o[0],s=o[1],l=o[2],f=o[3],h=o[4],m=o[5],g=.5*(c[1]+s[1]),p=g+1.5*(g-f[1]),d=f[1]-1.2*(l[1]-f[1]),b=[c[0],s[0],l[0],f[0],h[0],m[0]],E=Math.min.apply(Math,b),S=Math.min(p,d),w=Math.max.apply(Math,b),M=Math.max(p,d),k=Math.abs(f[0]-h[0])/Math.abs(f[0]-m[0]),C=f[0]-h[0]<0&&m[0]-f[0]>.05*(w-E),f[0]-h[0]>0&&m[0]-f[0]<-.05*(w-E)?(i=.2,u=.1):C?(i=.1,u=.2):k>2||k<.5?(i=.15,u=.15):(i=.05,u=.05),[[E-i*(w-E),S],[w+u*(w-E),M]]),.05*B)!==R&&(r=x)}return{error:r,fullFace:n,faceRatio:a,faceNotFrontalMinThreshold:.38}},detectGlare:function(t,e,r){return function(t,e,r){for(var n=0,a=r[1],o=r[3],i=r[0],u=r[2],c=a;c<o;c++)for(var s=i;s<u;s++){var l=z(t,e,c,s),f=l.r,h=l.g,m=l.b;f>=245&&m>=245&&h>245&&(n+=1)}return n}(t,e,function(t,e){var r=Math.floor(.025*t),n=t-r,a=Math.floor(.025*e);return[r,a,n,e-a]}(e,r))/(e*r)>=.001}});']),t=URL.createObjectURL(e);return sV(new Worker(t))}(),gV=[[0,1,0],[1,-4,1],[0,1,0]];function vV(e,t,r,n){return e[4*(r*t+n)]}function yV(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,o=0;o<t.length;o+=4){var i=(t[o]+t[o+1]+t[o+2])/3;t[o]=i}for(var a=0,s=0,c=n-1,u=r-1,l=1;l<c;l++)for(var d=1;d<u;d++){var f=gV[0][0]*vV(t,r,d-1,l-1)+gV[0][1]*vV(t,r,d,l-1)+gV[0][2]*vV(t,r,d+1,l-1)+gV[1][0]*vV(t,r,d-1,l)+gV[1][1]*vV(t,r,d,l)+gV[1][2]*vV(t,r,d+1,l)+gV[2][0]*vV(t,r,d-1,l+1)+gV[2][1]*vV(t,r,d,l+1)+gV[2][2]*vV(t,r,d+1,l+1);(f=Math.abs(f))>25&&a++,f>15&&f<25&&s++}var p=0;return a+s!==0&&(p=a/(a+s)),p}function bV(e){var t=e.width,r=e.height,n=e.getContext("2d"),o=Math.floor(t/2.8),i=Math.floor(r/2.8),a=t-o,s=r-i;return{data:n.getImageData(Math.floor(o/2),Math.floor(i/2),a,s).data,reducedWidth:a,reducedHeight:s}}function wV(){return(wV=uM(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=bV(t),mV){e.next=3;break}return e.abrupt("return",yV(r));case 3:return e.abrupt("return",mV.calculateBlurScoreFunc(r));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kV(e,t,r,n){return e[4*(n*t+r)]}var CV=Object.freeze({__proto__:null,calculateBlurScore:function(e){return wV.apply(this,arguments)},hasBetterBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||e-t>r},hasBetterCardBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||t-e>r},calculateIdCardBlurScore:function(e){var t=e.canvas,r=document.createElement("canvas"),n=r.getContext("2d");r.width=430,r.height=270,n.drawImage(t,0,0,r.width,r.height);var o=Math.floor(129),i=Math.floor(13.5),a=Math.floor(408.5),s=Math.floor(256.5),c=document.createElement("canvas"),u=c.getContext("2d"),l=a-o,d=s-i;c.width=l,c.height=d,u.drawImage(r,o,i,l,d,0,0,l,d);for(var f=u.getImageData(0,0,l,d).data,p=0;p<f.length;p+=4){var h=Math.round(.299*f[p]+.587*f[p+1]+.114*f[p+2]);f[p]=h}for(var m=d-1,g=l-1,v=0,y=[],b=1;b<m;b++)for(var w=1;w<g;w++){var k=4*-kV(f,l,w,b)+kV(f,l,w,b-1)+kV(f,l,w,b+1)+kV(f,l,w-1,b)+kV(f,l,w+1,b);v+=k,y.push(k)}v/=(l-2)*(d-2);for(var C=0,B=0;B<y.length;B++){var S=y[B]-v;C+=Math.pow(S,2)}var E=Math.sqrt(C/y.length);return 1/(1+Math.pow(2,E/2-10))}});function BV(e){var t,r,n,o,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=s.x,l=s.y,d=s.width,f=s.height,p=e.videoWidth,h=e.videoHeight,m=window.innerWidth,g=window.innerHeight,v=m/g,y=p/h;v<y?(i=u*(n=p/m),a=(l-(t=(g-m/y)/2))*(o=h/(g-2*t))):(i=(u-(r=(m-g*y)/2))*(n=p/(m-2*r)),a=l*(o=h/g));var b=d*n,w=f*o,k=b,C=w,B=Math.max(b,w)*c;return{lostX:r,lostY:t,cropWidth:b=Math.floor(Math.min(p,b+2*B)),cropHeight:w=Math.floor(Math.min(h,w+2*B)),cropX:i=Math.floor(Math.max(0,i-B)),cropY:a=Math.floor(Math.max(0,a-B)),cropWidthWithoutPadding:k,cropHeightWithoutPadding:C}}var SV=Object.freeze({__proto__:null,analyzeVideoAndWindowSizes:BV,takePicture:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.canvas,n=t.video,o=t.cropArea,i=t.quality,a=void 0===i?1:i;if(r)e=r;else{var s=BV(n,o),c=s.cropWidth,u=s.cropHeight,l=s.cropX,d=s.cropY,f=(e=document.createElement("canvas")).getContext("2d");e.width=c,e.height=u,f.drawImage(n,l,d,c,u,0,0,c,u)}return new Promise((function(t){e.toBlob(t,"image/jpeg",a)}))}}),EV=function(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=[e[r],e[t]];e[t]=n[0],e[r]=n[1]}return e},_V=Object.freeze({__proto__:null,shuffleArray:EV}),xV={NONE:0,PARTIAL:1,FULL:2};function TV(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=yM(e,2),o=n[0],i=n[1],a=yM(t,2),s=a[0],c=a[1],u=[o[0],i[0]],l=[o[1],i[1]];return u[0]+r<=s[0]&&c[0]<=u[1]-r&&l[0]+r<=s[1]&&c[1]<=l[1]-.8*r?xV.FULL:u[0]<=s[0]||c[0]<=u[1]||l[0]<=s[1]||c[1]<=l[1]?xV.PARTIAL:xV.NONE}function AV(e){var t=e.small,r=t.coords,n=t.area,o=e.big,i=o.coords,a=o.area,s=n;if(!s){var c=yM(r,2),u=c[0],l=c[1];s=(l[0]-u[0])*(l[1]-u[1])}var d=a;if(!d){var f=yM(i,2),p=f[0],h=f[1];d=(h[0]-p[0])*(h[1]-p[1])}return s/d}function PV(e,t){var r=yM(e,2),n=r[0],o=r[1],i=yM(t,2),a=i[0],s=i[1],c=o[0]-n[0],u=o[1]-n[1],l=s[0]-a[0];return c/l<u/l?c/l:u/l}var IV=Object.freeze({__proto__:null,ContainMode:xV,rectContains:TV,rectAreaRatio:AV,rectEdgeRatio:PV,isFaceCenter:function(e,t){var r=yM(e,2),n=r[0],o=r[1],i=yM(t,2),a=i[0],s=i[1],c=o[0]-n[0],u=o[1]-n[1],l=s[0]-a[0],d=Math.abs(n[0]-(l-c)/2)/l<.2,f=Math.abs(n[1]-(l-u)/2)/l<.2;return!(!d||!f)}});function RV(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function OV(e,t){return[e[0]-t[0],e[1]-t[1]]}function NV(e){var t=e.landmarks,r=e.getPerfectFrontal,n=function(e){var t,r,n,o,i,a,s=yM(e,4),c=s[0],u=s[1],l=s[2],d=s[3],f=OV(u,c),p=RV(f),h=(n=u,2,[(t=[(r=c)[0]+n[0],r[1]+n[1]])[0]/2,t[1]/2]),m=OV(l,h),g=RV(OV(d,l)),v=OV(d,h),y=RV(v),b=(m[0]*v[0]+m[1]*v[1])/y,w=g/y;if(p>.5*y)o=(m[0]*f[0]+m[1]*f[1])/p/p;else{var k=RV(OV(m,function(e,t){return[e[0]*t,e[1]*t]}(v,b/y)));a=v,o=((i=m)[0]*a[1]-a[0]*i[1]>=0?1:-1)*k/p}return{left_right_score:o,up_down_score:w}}(t),o=n.left_right_score,i=n.up_down_score,a=yM(t,3),s=a[0],c=a[1],u=a[2],l=c[0]-u[0],d=s[0]-u[0],f=r?.1:.3,p=i>.7,h=i<.42,m=o>=.35&&o<=.6,g=o<=-.35&&o>=-.6;return i>=.42&&i<=.7&&o>-f&&o<f&&l*d<0?{gesture:aM.FRONTAL,leftRightScore:o}:!p||g||m?!h||g||m?!m||p||h?!g||p||h?null:{gesture:aM.LEFT,leftRightScore:o}:{gesture:aM.RIGHT,leftRightScore:o}:{gesture:aM.DOWN,leftRightScore:o}:{gesture:aM.UP,leftRightScore:o}}function DV(e){var t,r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S=e.predictions,E=e.width,_=[[0,0],[E,e.height]],x=S.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,o=t.probability,i=t.landmarks;return o<.9||i.length<6||AV({small:{coords:[r,n]},big:{coords:_}})<=.025?e[xV.NONE].push(t):e[TV(_,[r,n])].push(t),e}),(pM(t={},xV.PARTIAL,[]),pM(t,xV.FULL,[]),pM(t,xV.NONE,[]),t)),T=x[xV.FULL].length,A=x[xV.PARTIAL].length;if(0===T)r=A>0?iM.partial_face:iM.no_face;else if(T+A>1)r=iM.multiple_faces;else{var P=n=x[xV.FULL][0];(o=PV([P.topLeft,P.bottomRight],_))<.4&&(r=iM.face_too_small),o>.61&&(r=iM.face_too_large),TV(_,(c=(i=n.landmarks)[0],u=i[1],l=i[2],d=i[3],f=i[4],p=i[5],m=(h=.5*(c[1]+u[1]))+1.5*(h-d[1]),g=d[1]-1.2*(l[1]-d[1]),v=[c[0],u[0],l[0],d[0],f[0],p[0]],y=Math.min.apply(Math,v),b=Math.min(m,g),w=Math.max.apply(Math,v),k=Math.max(m,g),C=Math.abs(d[0]-f[0])/Math.abs(d[0]-p[0]),B=d[0]-f[0]<0&&p[0]-d[0]>.05*(w-y),d[0]-f[0]>0&&p[0]-d[0]<-.05*(w-y)?(a=.2,s=.1):B?(a=.1,s=.2):C>2||C<.5?(a=.15,s=.15):(a=.05,s=.05),[[y-a*(w-y),b],[w+s*(w-y),k]]),.05*E)!==xV.FULL&&(r=iM.face_out_of_box)}return{error:r,fullFace:n,faceRatio:o,faceNotFrontalMinThreshold:.38}}function MV(e,t){var r=t.customInstructions,n=t.customIcon,o=t.customDirectionIcon,i=t.customStepTimeConstraints,a={};return null!=r&&r[e]&&(a.instructions=r[e]),null!=n&&n[e]&&(a.icon=n[e]),null!=o&&o[e]&&(a.directionIcon=o[e]),null!=i&&i[e]&&(a.stepTimeConstraints=i[e]),a}function LV(){return(LV=uM(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(mV){e.next=2;break}return e.abrupt("return",DV(t));case 2:return e.abrupt("return",mV.validatePredictionsFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function UV(){return(UV=uM(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(mV){e.next=2;break}return e.abrupt("return",NV(t));case 2:return e.abrupt("return",mV.calculateFaceDirectionFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jV=Object.freeze({__proto__:null,initFaceVerificationData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.assetRoot,r=void 0===t?"/":t,n=e.customInstructions,o=e.customIcon,i=e.customDirectionIcon,a=e.customStepTimeConstraints;return{curStepIndex:0,steps:[].concat(bM(EV([gM({name:aM.LEFT,instructions:{en:"Turn your face to the left",vi:"Quay mặt chậm qua trái"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:QF(r,"ic_face_left.svg"),directionIcon:QF(r,"arrow_left.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},MV(aM.LEFT,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a})),gM({name:aM.RIGHT,instructions:{en:"Turn your face to the right",vi:"Quay mặt chậm qua phải"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:QF(r,"ic_face_right.svg"),directionIcon:QF(r,"arrow_right.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},MV(aM.RIGHT,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a})),gM({name:aM.UP,instructions:{en:"Turn your face up",vi:"Ngước mặt chậm lên trên"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:QF(r,"ic_face_up.svg"),directionIcon:QF(r,"arrow_up.svg"),directionIconAnimation:"slide-vertical",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},MV(aM.UP,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a}))])),[gM({name:aM.FRONTAL,instructions:{en:"Look straight into the camera",vi:"Nhìn thẳng camera"},image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:QF(r,"ic_face_frontal.svg"),directionIcon:QF(r,"frontal.svg"),directionIconAnimation:"blink",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},MV(aM.FRONTAL,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a}))])}},validatePredictions:function(e){return LV.apply(this,arguments)},calculateFaceDirection:function(e){return UV.apply(this,arguments)},faceTracker:function(){var e=[],t=[],r=[],n=[],o=[],i=0,a=0;function s(){a=i,r=bM(e),n=bM(t)}return function(c,u){var l=c.topLeft,d=c.bottomRight,f=c.landmarks,p=[],h=yM(l,2);p[0]=h[0],p[1]=h[1];var m=yM(d,2);p[2]=m[0],p[3]=m[1];var g=[],v=[];f.forEach((function(e,t){var r=yM(e,2);g[t]=r[0],v[t]=r[1]})),i=Date.now();var y=p[2]-p[0];if(e=[].concat(g),t=[].concat(v),!r.length&&!n.length||u)return s(),{score:0,time:i};for(var b=0;b<6;b++)o[b]=Math.sqrt((e[b]-r[b])*(e[b]-r[b])+(t[b]-n[b])*(t[b]-n[b]));for(var w=0;w<6;w++)o[w]/=(i-a)*y;for(var k=0,C=0;C<6;C++)k+=o[C];return k/=6,s(),{score:k,time:i}}}}),FV=function(){var e=uM(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.model,n=t.sCanvas,e.abrupt("return",r.estimateFaces(n,!1,!1,!0));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),VV=Object.freeze({__proto__:null,SIZE:400,getModelPredictions:FV}),zV=Object.getOwnPropertySymbols,qV=Object.prototype.hasOwnProperty,HV=Object.prototype.propertyIsEnumerable;function KV(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var WV,GV=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,o=KV(e),i=1;i<arguments.length;i++){for(var a in r=Object(arguments[i]))qV.call(r,a)&&(o[a]=r[a]);if(zV){n=zV(r);for(var s=0;s<n.length;s++)HV.call(r,n[s])&&(o[n[s]]=r[n[s]])}}return o},QV=arguments[3],XV=arguments[4],YV=arguments[5],$V=JSON.stringify,ZV=function(e,t){for(var r,n=Object.keys(YV),o=0,i=n.length;o<i;o++){var a=n[o],s=YV[a].exports;if(s===e||s&&s.default===e){r=a;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(o=0,i=n.length;o<i;o++)c[a=n[o]]=a;XV[r]=["function(require,module,exports){"+e+"(self); }",c]}var u=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[r]=r,XV[u]=["function(require,module,exports){var f = require("+$V(r)+");(f.default ? f.default : f)(self);}",l];var d={};!function e(t){for(var r in d[t]=!0,XV[t][1]){var n=XV[t][1][r];d[n]||e(n)}}(u);var f="("+QV+")({"+Object.keys(d).map((function(e){return $V(e)+":["+XV[e][0]+","+$V(XV[e][1])+"]"})).join(",")+"},{},["+$V(u)+"])",p=window.URL||window.webkitURL||window.mozURL||window.msURL,h=new Blob([f],{type:"text/javascript"});if(t&&t.bare)return h;var m=p.createObjectURL(h),g=new Worker(m);return g.objectURL=m,g},JV=FM((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),ez={js:!0,wasm:!0};function tz(e){if(!(this instanceof tz))return new tz(e);var t=GV({},ez,e||{});if(this.options=t,this.__cache={},this.__init_promise=null,this.__modules=t.modules||{},this.__memory=null,this.__wasm={},this.__isLE=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0],!this.options.js&&!this.options.wasm)throw new Error('mathlib: at least "js" or "wasm" should be enabled')}tz.prototype.has_wasm=function(){if(void 0!==WV)return WV;if(WV=!1,"undefined"==typeof WebAssembly)return WV;try{var e=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),t=new WebAssembly.Module(e);return 0!==new WebAssembly.Instance(t,{}).exports.test(4)&&(WV=!0),WV}catch(e){}return WV},tz.prototype.use=function(e){return this.__modules[e.name]=e,this.options.wasm&&this.has_wasm()&&e.wasm_fn?this[e.name]=e.wasm_fn:this[e.name]=e.fn,this},tz.prototype.init=function(){if(this.__init_promise)return this.__init_promise;if(!this.options.js&&this.options.wasm&&!this.has_wasm())return Promise.reject(new Error('mathlib: only "wasm" was enabled, but it\'s not supported'));var e=this;return this.__init_promise=Promise.all(Object.keys(e.__modules).map((function(t){var r=e.__modules[t];return e.options.wasm&&e.has_wasm()&&r.wasm_fn?e.__wasm[t]?null:WebAssembly.compile(e.__base64decode(r.wasm_src)).then((function(r){e.__wasm[t]=r})):null}))).then((function(){return e})),this.__init_promise},tz.prototype.__base64decode=function(e){for(var t=e.replace(/[\r\n=]/g,""),r=t.length,n=new Uint8Array(3*r>>2),o=0,i=0,a=0;a<r;a++)a%4==0&&a&&(n[i++]=o>>16&255,n[i++]=o>>8&255,n[i++]=255&o),o=o<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t.charAt(a));var s=r%4*6;return 0===s?(n[i++]=o>>16&255,n[i++]=o>>8&255,n[i++]=255&o):18===s?(n[i++]=o>>10&255,n[i++]=o>>2&255):12===s&&(n[i++]=o>>4&255),n},tz.prototype.__reallocate=function(e){if(!this.__memory)return this.__memory=new WebAssembly.Memory({initial:Math.ceil(e/65536)}),this.__memory;var t=this.__memory.buffer.byteLength;return t<e&&this.__memory.grow(Math.ceil((e-t)/65536)),this.__memory},tz.prototype.__instance=function(e,t,r){if(t&&this.__reallocate(t),!this.__wasm[e]){var n=this.__modules[e];this.__wasm[e]=new WebAssembly.Module(this.__base64decode(n.wasm_src))}if(!this.__cache[e]){var o={memoryBase:0,memory:this.__memory,tableBase:0,table:new WebAssembly.Table({initial:0,element:"anyfunc"})};this.__cache[e]=new WebAssembly.Instance(this.__wasm[e],{env:GV(o,r||{})})}return this.__cache[e]},tz.prototype.__align=function(e,t){var r=e%(t=t||8);return e+(r?t-r:0)};var rz,nz,oz,iz,az,sz,cz=tz;function uz(e,t,r,n,o,i){var a,s,c,u,l,d,f,p,h,m,g,v,y,b;for(h=0;h<i;h++){for(f=h,p=0,u=l=(a=e[d=h*o])*n[6],g=n[0],v=n[1],y=n[4],b=n[5],m=0;m<o;m++)c=(s=e[d])*g+a*v+u*y+l*b,l=u,u=c,a=s,r[p]=u,p++,d++;for(p--,f+=i*(o-1),u=l=(a=e[--d])*n[7],s=a,g=n[2],v=n[3],m=o-1;m>=0;m--)c=s*g+a*v+u*y+l*b,l=u,u=c,a=s,s=e[d],t[f]=r[p]+u,d--,p--,f-=i}}var lz=function(e,t,r,n){if(n){var o=new Uint16Array(e.length),i=new Float32Array(Math.max(t,r)),a=function(e){e<.5&&(e=.5);var t=Math.exp(.527076)/e,r=Math.exp(-t),n=Math.exp(-2*t),o=(1-r)*(1-r)/(1+2*t*r-n);return rz=o,nz=o*(t-1)*r,oz=o*(t+1)*r,iz=-o*n,az=2*r,sz=-n,new Float32Array([rz,nz,oz,iz,az,sz,(rz+nz)/(1-az-sz),(oz+iz)/(1-az-sz)])}(n);uz(e,o,i,a,t,r),uz(o,e,i,a,r,t)}},dz={name:"unsharp_mask",fn:function(e,t,r,n,o,i){var a,s,c,u,l,d,f,p,h,m,g,v,y;if(!(0===n||o<.5)){o>2&&(o=2);var b=function(e,t,r){for(var n,o,i,a,s,c=t*r,u=new Uint16Array(c),l=0;l<c;l++)n=e[4*l],o=e[4*l+1],i=e[4*l+2],s=n>=o&&n>=i?n:o>=i&&o>=n?o:i,a=n<=o&&n<=i?n:o<=i&&o<=n?o:i,u[l]=257*(s+a)>>1;return u}(e,t,r),w=new Uint16Array(b);lz(w,t,r,o);for(var k=n/100*4096+.5|0,C=257*i|0,B=t*r,S=0;S<B;S++)v=2*(b[S]-w[S]),Math.abs(v)>=C&&(a=e[y=4*S],s=e[y+1],c=e[y+2],d=257*((p=a>=s&&a>=c?a:s>=a&&s>=c?s:c)+(f=a<=s&&a<=c?a:s<=a&&s<=c?s:c))>>1,f===p?u=l=0:(l=d<=32767?4095*(p-f)/(p+f)|0:4095*(p-f)/(510-p-f)|0,u=a===p?65535*(s-c)/(6*(p-f))|0:s===p?21845+(65535*(c-a)/(6*(p-f))|0):43690+(65535*(a-s)/(6*(p-f))|0)),(d+=k*v+2048>>12)>65535?d=65535:d<0&&(d=0),0===l?a=s=c=d>>8:(h=2*d-(m=d<=32767?d*(4096+l)+2048>>12:d+((65535-d)*l+2048>>12))>>8,m>>=8,a=(g=u+21845&65535)>=43690?h:g>=32767?h+(6*(m-h)*(43690-g)+32768>>16):g>=10922?m:h+(6*(m-h)*g+32768>>16),s=(g=65535&u)>=43690?h:g>=32767?h+(6*(m-h)*(43690-g)+32768>>16):g>=10922?m:h+(6*(m-h)*g+32768>>16),c=(g=u-21845&65535)>=43690?h:g>=32767?h+(6*(m-h)*(43690-g)+32768>>16):g>=10922?m:h+(6*(m-h)*g+32768>>16)),e[y]=a,e[y+1]=s,e[y+2]=c)}},wasm_fn:function(e,t,r,n,o,i){if(!(0===n||o<.5)){o>2&&(o=2);var a=t*r,s=4*a,c=2*a,u=2*a,l=4*Math.max(t,r),d=s,f=d+c,p=f+u,h=p+u,m=h+l,g=this.__instance("unsharp_mask",s+c+2*u+l+32,{exp:Math.exp}),v=new Uint32Array(e.buffer);new Uint32Array(this.__memory.buffer).set(v);var y=g.exports.hsl_l16||g.exports._hsl_l16;y(0,d,t,r),(y=g.exports.blurMono16||g.exports._blurMono16)(d,f,p,h,m,t,r,o),(y=g.exports.unsharp||g.exports._unsharp)(0,0,d,f,t,r,n,i),v.set(new Uint32Array(this.__memory.buffer,0,a))}},wasm_src:"AGFzbQEAAAABMQZgAXwBfGACfX8AYAZ/f39/f38AYAh/f39/f39/fQBgBH9/f38AYAh/f39/f39/fwACGQIDZW52A2V4cAAAA2VudgZtZW1vcnkCAAEDBgUBAgMEBQQEAXAAAAdMBRZfX2J1aWxkX2dhdXNzaWFuX2NvZWZzAAEOX19nYXVzczE2X2xpbmUAAgpibHVyTW9ubzE2AAMHaHNsX2wxNgAEB3Vuc2hhcnAABQkBAAqJEAXZAQEGfAJAIAFE24a6Q4Ia+z8gALujIgOaEAAiBCAEoCIGtjgCECABIANEAAAAAAAAAMCiEAAiBbaMOAIUIAFEAAAAAAAA8D8gBKEiAiACoiAEIAMgA6CiRAAAAAAAAPA/oCAFoaMiArY4AgAgASAEIANEAAAAAAAA8L+gIAKioiIHtjgCBCABIAQgA0QAAAAAAADwP6AgAqKiIgO2OAIIIAEgBSACoiIEtow4AgwgASACIAegIAVEAAAAAAAA8D8gBqGgIgKjtjgCGCABIAMgBKEgAqO2OAIcCwu3AwMDfwR9CHwCQCADKgIUIQkgAyoCECEKIAMqAgwhCyADKgIIIQwCQCAEQX9qIgdBAEgiCA0AIAIgAC8BALgiDSADKgIYu6IiDiAJuyIQoiAOIAq7IhGiIA0gAyoCBLsiEqIgAyoCALsiEyANoqCgoCIPtjgCACACQQRqIQIgAEECaiEAIAdFDQAgBCEGA0AgAiAOIBCiIA8iDiARoiANIBKiIBMgAC8BALgiDaKgoKAiD7Y4AgAgAkEEaiECIABBAmohACAGQX9qIgZBAUoNAAsLAkAgCA0AIAEgByAFbEEBdGogAEF+ai8BACIIuCINIAu7IhGiIA0gDLsiEqKgIA0gAyoCHLuiIg4gCrsiE6KgIA4gCbsiFKKgIg8gAkF8aioCALugqzsBACAHRQ0AIAJBeGohAiAAQXxqIQBBACAFQQF0ayEHIAEgBSAEQQF0QXxqbGohBgNAIAghAyAALwEAIQggBiANIBGiIAO4Ig0gEqKgIA8iECAToqAgDiAUoqAiDyACKgIAu6CrOwEAIAYgB2ohBiAAQX5qIQAgAkF8aiECIBAhDiAEQX9qIgRBAUoNAAsLCwvfAgIDfwZ8AkAgB0MAAAAAWw0AIARE24a6Q4Ia+z8gB0MAAAA/l7ujIgyaEAAiDSANoCIPtjgCECAEIAxEAAAAAAAAAMCiEAAiDraMOAIUIAREAAAAAAAA8D8gDaEiCyALoiANIAwgDKCiRAAAAAAAAPA/oCAOoaMiC7Y4AgAgBCANIAxEAAAAAAAA8L+gIAuioiIQtjgCBCAEIA0gDEQAAAAAAADwP6AgC6KiIgy2OAIIIAQgDiALoiINtow4AgwgBCALIBCgIA5EAAAAAAAA8D8gD6GgIgujtjgCGCAEIAwgDaEgC6O2OAIcIAYEQCAFQQF0IQogBiEJIAIhCANAIAAgCCADIAQgBSAGEAIgACAKaiEAIAhBAmohCCAJQX9qIgkNAAsLIAVFDQAgBkEBdCEIIAUhAANAIAIgASADIAQgBiAFEAIgAiAIaiECIAFBAmohASAAQX9qIgANAAsLC7wBAQV/IAMgAmwiAwRAQQAgA2shBgNAIAAoAgAiBEEIdiIHQf8BcSECAn8gBEH/AXEiAyAEQRB2IgRB/wFxIgVPBEAgAyIIIAMgAk8NARoLIAQgBCAHIAIgA0kbIAIgBUkbQf8BcQshCAJAIAMgAk0EQCADIAVNDQELIAQgByAEIAMgAk8bIAIgBUsbQf8BcSEDCyAAQQRqIQAgASADIAhqQYECbEEBdjsBACABQQJqIQEgBkEBaiIGDQALCwvTBgEKfwJAIAazQwAAgEWUQwAAyEKVu0QAAAAAAADgP6CqIQ0gBSAEbCILBEAgB0GBAmwhDgNAQQAgAi8BACADLwEAayIGQQF0IgdrIAcgBkEASBsgDk8EQCAAQQJqLQAAIQUCfyAALQAAIgYgAEEBai0AACIESSIJRQRAIAYiCCAGIAVPDQEaCyAFIAUgBCAEIAVJGyAGIARLGwshCAJ/IAYgBE0EQCAGIgogBiAFTQ0BGgsgBSAFIAQgBCAFSxsgCRsLIgogCGoiD0GBAmwiEEEBdiERQQAhDAJ/QQAiCSAIIApGDQAaIAggCmsiCUH/H2wgD0H+AyAIayAKayAQQYCABEkbbSEMIAYgCEYEQCAEIAVrQf//A2wgCUEGbG0MAQsgBSAGayAGIARrIAQgCEYiBhtB//8DbCAJQQZsbUHVqgFBqtUCIAYbagshCSARIAcgDWxBgBBqQQx1aiIGQQAgBkEAShsiBkH//wMgBkH//wNIGyEGAkACfwJAIAxB//8DcSIFBEAgBkH//wFKDQEgBUGAIGogBmxBgBBqQQx2DAILIAZBCHYiBiEFIAYhBAwCCyAFIAZB//8Dc2xBgBBqQQx2IAZqCyIFQQh2IQcgBkEBdCAFa0EIdiIGIQQCQCAJQdWqAWpB//8DcSIFQanVAksNACAFQf//AU8EQEGq1QIgBWsgByAGa2xBBmxBgIACakEQdiAGaiEEDAELIAchBCAFQanVAEsNACAFIAcgBmtsQQZsQYCAAmpBEHYgBmohBAsCfyAGIgUgCUH//wNxIghBqdUCSw0AGkGq1QIgCGsgByAGa2xBBmxBgIACakEQdiAGaiAIQf//AU8NABogByIFIAhBqdUASw0AGiAIIAcgBmtsQQZsQYCAAmpBEHYgBmoLIQUgCUGr1QJqQf//A3EiCEGp1QJLDQAgCEH//wFPBEBBqtUCIAhrIAcgBmtsQQZsQYCAAmpBEHYgBmohBgwBCyAIQanVAEsEQCAHIQYMAQsgCCAHIAZrbEEGbEGAgAJqQRB2IAZqIQYLIAEgBDoAACABQQFqIAU6AAAgAUECaiAGOgAACyADQQJqIQMgAkECaiECIABBBGohACABQQRqIQEgC0F/aiILDQALCwsL"},fz=[{win:.5,filter:function(e){return e>=-.5&&e<.5?1:0}},{win:1,filter:function(e){if(e<=-1||e>=1)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*(.54+.46*Math.cos(t/1))}},{win:2,filter:function(e){if(e<=-2||e>=2)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*Math.sin(t/2)/(t/2)}},{win:3,filter:function(e){if(e<=-3||e>=3)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*Math.sin(t/3)/(t/3)}}];function pz(e){return Math.round(16383*e)}var hz=function(e,t,r,n,o){var i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C=fz[e].filter,B=1/n,S=Math.min(1,n),E=fz[e].win/S,_=Math.floor(2*(E+1)),x=new Int16Array((_+2)*r),T=0,A=!x.subarray||!x.set;for(i=0;i<r;i++){for(a=(i+.5)*B+o,s=Math.max(0,Math.floor(a-E)),u=(c=Math.min(t-1,Math.ceil(a+E)))-s+1,l=new Float32Array(u),d=new Int16Array(u),f=0,p=s,h=0;p<=c;p++,h++)f+=m=C((p+.5-a)*S),l[h]=m;for(g=0,h=0;h<l.length;h++)g+=v=l[h]/f,d[h]=pz(v);for(d[r>>1]+=pz(1-g),y=0;y<d.length&&0===d[y];)y++;if(y<d.length){for(b=d.length-1;b>0&&0===d[b];)b--;if(w=s+y,k=b-y+1,x[T++]=w,x[T++]=k,A)for(h=y;h<=b;h++)x[T++]=d[h];else x.set(d.subarray(y,b+1),T),T+=k}else x[T++]=0,x[T++]=0}return x};function mz(e){return e<0?0:e>255?255:e}var gz=function(e,t,r,n,o,i){var a,s,c,u,l,d,f,p,h,m,g,v=0,y=0;for(h=0;h<n;h++){for(l=0,m=0;m<o;m++){for(d=i[l++],f=i[l++],p=v+4*d|0,a=s=c=u=0;f>0;f--)u=u+(g=i[l++])*e[p+3]|0,c=c+g*e[p+2]|0,s=s+g*e[p+1]|0,a=a+g*e[p]|0,p=p+4|0;t[y+3]=mz(u+8192>>14),t[y+2]=mz(c+8192>>14),t[y+1]=mz(s+8192>>14),t[y]=mz(a+8192>>14),y=y+4*n|0}y=4*(h+1)|0,v=(h+1)*r*4|0}},vz=function(e,t,r,n,o,i){var a,s,c,u,l,d,f,p,h,m,g,v=0,y=0;for(h=0;h<n;h++){for(l=0,m=0;m<o;m++){for(d=i[l++],f=i[l++],p=v+4*d|0,a=s=c=u=0;f>0;f--)u=u+(g=i[l++])*e[p+3]|0,c=c+g*e[p+2]|0,s=s+g*e[p+1]|0,a=a+g*e[p]|0,p=p+4|0;t[y+3]=mz(u+8192>>14),t[y+2]=mz(c+8192>>14),t[y+1]=mz(s+8192>>14),t[y]=mz(a+8192>>14),y=y+4*n|0}y=4*(h+1)|0,v=(h+1)*r*4|0}},yz=!0;try{yz=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(e){}function bz(e,t,r){if(yz)t.set(function(e){return new Uint8Array(e.buffer,0,e.byteLength)}(e),r);else for(var n=r,o=0;o<e.length;o++){var i=e[o];t[n++]=255&i,t[n++]=i>>8&255}}var wz={name:"resize",fn:function(e){var t=e.src,r=e.width,n=e.height,o=e.toWidth,i=e.toHeight,a=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,c=e.offsetX||0,u=e.offsetY||0,l=e.dest||new Uint8Array(o*i*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,p=hz(d,r,o,a,c),h=hz(d,n,i,s,u),m=new Uint8Array(o*n*4);return gz(t,m,r,n,o,p),vz(m,l,n,o,i,h),f||function(e,t,r){for(var n=3,o=t*r*4|0;n<o;)e[n]=255,n=n+4|0}(l,o,i),l},wasm_fn:function(e){var t=e.src,r=e.width,n=e.height,o=e.toWidth,i=e.toHeight,a=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,c=e.offsetX||0,u=e.offsetY||0,l=e.dest||new Uint8Array(o*i*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,p=hz(d,r,o,a,c),h=hz(d,n,i,s,u),m=this.__align(0+Math.max(t.byteLength,l.byteLength)),g=this.__align(m+n*o*4),v=this.__align(g+p.byteLength),y=v+h.byteLength,b=this.__instance("resize",y),w=new Uint8Array(this.__memory.buffer),k=new Uint32Array(this.__memory.buffer),C=new Uint32Array(t.buffer);return k.set(C),bz(p,w,g),bz(h,w,v),(b.exports.convolveHV||b.exports._convolveHV)(g,v,m,r,n,o,i),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,i*o)),f||function(e,t,r){for(var n=3,o=t*r*4|0;n<o;)e[n]=255,n=n+4|0}(l,o,i),l},wasm_src:"AGFzbQEAAAABFAJgBn9/f39/fwBgB39/f39/f38AAg8BA2VudgZtZW1vcnkCAAEDAwIAAQQEAXAAAAcZAghjb252b2x2ZQAACmNvbnZvbHZlSFYAAQkBAArmAwLBAwEQfwJAIANFDQAgBEUNACAFQQRqIRVBACEMQQAhDQNAIA0hDkEAIRFBACEHA0AgB0ECaiESAn8gBSAHQQF0IgdqIgZBAmouAQAiEwRAQQAhCEEAIBNrIRQgFSAHaiEPIAAgDCAGLgEAakECdGohEEEAIQlBACEKQQAhCwNAIBAoAgAiB0EYdiAPLgEAIgZsIAtqIQsgB0H/AXEgBmwgCGohCCAHQRB2Qf8BcSAGbCAKaiEKIAdBCHZB/wFxIAZsIAlqIQkgD0ECaiEPIBBBBGohECAUQQFqIhQNAAsgEiATagwBC0EAIQtBACEKQQAhCUEAIQggEgshByABIA5BAnRqIApBgMAAakEOdSIGQf8BIAZB/wFIG0EQdEGAgPwHcUEAIAZBAEobIAtBgMAAakEOdSIGQf8BIAZB/wFIG0EYdEEAIAZBAEobciAJQYDAAGpBDnUiBkH/ASAGQf8BSBtBCHRBgP4DcUEAIAZBAEobciAIQYDAAGpBDnUiBkH/ASAGQf8BSBtB/wFxQQAgBkEAShtyNgIAIA4gA2ohDiARQQFqIhEgBEcNAAsgDCACaiEMIA1BAWoiDSADRw0ACwsLIQACQEEAIAIgAyAEIAUgABAAIAJBACAEIAUgBiABEAALCw=="};function kz(e){var t=e||[],r={js:t.indexOf("js")>=0,wasm:t.indexOf("wasm")>=0};cz.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(dz),this.use(wz)}JV(kz,cz),kz.prototype.resizeAndUnsharp=function(e,t){var r=this.resize(e,t);return e.unsharpAmount&&this.unsharp_mask(r,e.toWidth,e.toHeight,e.unsharpAmount,e.unsharpRadius,e.unsharpThreshold),r};var Cz=kz;function Bz(e,t){this.create=e,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=t||2e3}Bz.prototype.acquire=function(){var e,t=this;return 0!==this.available.length?e=this.available.pop():((e=this.create()).id=this.lastId++,e.release=function(){return t.release(e)}),this.acquired[e.id]=e,e},Bz.prototype.release=function(e){var t=this;delete this.acquired[e.id],e.lastUsed=Date.now(),this.available.push(e),0===this.timeoutId&&(this.timeoutId=setTimeout((function(){return t.gc()}),100))},Bz.prototype.gc=function(){var e=this,t=Date.now();this.available=this.available.filter((function(r){return!(t-r.lastUsed>e.idle&&(r.destroy(),1))})),0!==this.available.length?this.timeoutId=setTimeout((function(){return e.gc()}),100):this.timeoutId=0};var Sz=Bz;function Ez(e){return Object.prototype.toString.call(e)}var _z=function(e){var t=Ez(e);return"[object HTMLCanvasElement]"===t||"[object OffscreenCanvas]"===t||"[object Canvas]"===t},xz=function(e){return"[object HTMLImageElement]"===Ez(e)},Tz=function(e){return"[object ImageBitmap]"===Ez(e)},Az=function(e){var t=0,r=[];function n(){t<e&&r.length&&(t++,r.shift()())}return function(e){return new Promise((function(o,i){r.push((function(){e().then((function(e){o(e),t--,n()}),(function(e){i(e),t--,n()}))})),n()}))}},Pz=function(e){switch(e){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},Iz=function(e){return Promise.resolve().then((function(){if("undefined"==typeof createImageBitmap)return!1;var t=e(100,100);return createImageBitmap(t,0,0,100,100,{resizeWidth:10,resizeHeight:10,resizeQuality:"high"}).then((function(e){var r=10===e.width;return e.close(),t=null,r}))})).catch((function(){return!1}))},Rz=function(){var e,t=Cz;onmessage=function(r){var n=r.data.opts;e||(e=new t(r.data.features));var o=e.resizeAndUnsharp(n);postMessage({result:o},[o.buffer])}};function Oz(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.floor(e)}function Nz(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.ceil(e)}var Dz={},Mz=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(Mz=navigator.userAgent.indexOf("Safari")>=0)}catch(e){}var Lz=1;"undefined"!=typeof navigator&&(Lz=Math.min(navigator.hardwareConcurrency||1,4));var Uz,jz,Fz={tile:1024,concurrency:Lz,features:["js","wasm","ww"],idle:2e3,createCanvas:function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r}},Vz={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0};function zz(){return{value:ZV(Rz),destroy:function(){if(this.value.terminate(),"undefined"!=typeof window){var e=window.URL||window.webkitURL||window.mozURL||window.msURL;e&&e.revokeObjectURL&&this.value.objectURL&&e.revokeObjectURL(this.value.objectURL)}}}}function qz(e){if(!(this instanceof qz))return new qz(e);this.options=GV({},Fz,e||{});var t="lk_".concat(this.options.concurrency);this.__limit=Dz[t]||Az(this.options.concurrency),Dz[t]||(Dz[t]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}qz.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if(!1!==Uz&&!0!==Uz&&(Uz=!1,"undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray))try{new ImageData(new Uint8ClampedArray(400),10,10),Uz=!0}catch(t){}!1!==jz&&!0!==jz&&(jz=!1,"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?jz=!0:this.debug("ImageBitmap does not support .close(), disabled")));var t=this.options.features.slice();if(t.indexOf("all")>=0&&(t=["cib","wasm","js","ww"]),this.__requested_features=t,this.__mathlib=new Cz(t),t.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{ZV((function(){})).terminate(),this.features.ww=!0;var r="wp_".concat(JSON.stringify(this.options));Dz[r]?this.__workersPool=Dz[r]:(this.__workersPool=new Sz(zz,this.options.idle),Dz[r]=this.__workersPool)}catch(t){}var n,o=this.__mathlib.init().then((function(t){GV(e.features,t.features)}));return n=jz?Iz(this.options.createCanvas).then((function(r){e.features.cib&&t.indexOf("cib")<0?e.debug("createImageBitmap() resize supported, but disabled by config"):t.indexOf("cib")>=0&&(e.features.cib=r)})):Promise.resolve(!1),this.__initPromise=Promise.all([o,n]).then((function(){return e})),this.__initPromise},qz.prototype.resize=function(e,t,r){var n=this;this.debug("Start resize...");var o=GV({},Vz);if(isNaN(r)?r&&(o=GV(o,r)):o=GV(o,{quality:r}),o.toWidth=t.width,o.toHeight=t.height,o.width=e.naturalWidth||e.width,o.height=e.naturalHeight||e.height,0===t.width||0===t.height)return Promise.reject(new Error("Invalid output size: ".concat(t.width,"x").concat(t.height)));o.unsharpRadius>2&&(o.unsharpRadius=2);var i=!1,a=null;o.cancelToken&&(a=o.cancelToken.then((function(e){throw i=!0,e}),(function(e){throw i=!0,e})));var s=Math.ceil(Math.max(3,2.5*o.unsharpRadius|0));return this.init().then((function(){if(i)return a;if(n.features.cib){var r=t.getContext("2d",{alpha:Boolean(o.alpha)});return n.debug("Resize via createImageBitmap()"),createImageBitmap(e,{resizeWidth:o.toWidth,resizeHeight:o.toHeight,resizeQuality:Pz(o.quality)}).then((function(e){if(i)return a;if(!o.unsharpAmount)return r.drawImage(e,0,0),e.close(),r=null,n.debug("Finished!"),t;n.debug("Unsharp result");var s=n.options.createCanvas(o.toWidth,o.toHeight),c=s.getContext("2d",{alpha:Boolean(o.alpha)});c.drawImage(e,0,0),e.close();var u=c.getImageData(0,0,o.toWidth,o.toHeight);return n.__mathlib.unsharp_mask(u.data,o.toWidth,o.toHeight,o.unsharpAmount,o.unsharpRadius,o.unsharpThreshold),r.putImageData(u,0,0),s.width=s.height=0,u=c=s=r=null,n.debug("Finished!"),t}))}var c={},u=function(e){return Promise.resolve().then((function(){return n.features.ww?new Promise((function(t,r){var o=n.__workersPool.acquire();a&&a.catch((function(e){return r(e)})),o.value.onmessage=function(e){o.release(),e.data.err?r(e.data.err):t(e.data.result)},o.value.postMessage({opts:e,features:n.__requested_features,preload:{wasm_nodule:n.__mathlib.__}},[e.src.buffer])})):n.__mathlib.resizeAndUnsharp(e,c)}))},l=function(e,t,r){var o,c,l,d=!1,f=function(t){return n.__limit((function(){if(i)return a;var s;if(_z(e))n.debug("Get tile pixel data"),s=o.getImageData(t.x,t.y,t.width,t.height);else{n.debug("Draw tile imageBitmap/image to temporary canvas");var d=n.options.createCanvas(t.width,t.height),f=d.getContext("2d",{alpha:Boolean(r.alpha)});f.globalCompositeOperation="copy",f.drawImage(c||e,t.x,t.y,t.width,t.height,0,0,t.width,t.height),n.debug("Get tile pixel data"),s=f.getImageData(0,0,t.width,t.height),d.width=d.height=0,f=d=null}var p={src:s.data,width:t.width,height:t.height,toWidth:t.toWidth,toHeight:t.toHeight,scaleX:t.scaleX,scaleY:t.scaleY,offsetX:t.offsetX,offsetY:t.offsetY,quality:r.quality,alpha:r.alpha,unsharpAmount:r.unsharpAmount,unsharpRadius:r.unsharpRadius,unsharpThreshold:r.unsharpThreshold};return n.debug("Invoke resize math"),Promise.resolve().then((function(){return u(p)})).then((function(e){if(i)return a;var r;if(s=null,n.debug("Convert raw rgba tile result to ImageData"),Uz)r=new ImageData(new Uint8ClampedArray(e),t.toWidth,t.toHeight);else if((r=l.createImageData(t.toWidth,t.toHeight)).data.set)r.data.set(e);else for(var o=r.data.length-1;o>=0;o--)r.data[o]=e[o];return n.debug("Draw tile"),Mz?l.putImageData(r,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth+1e-5,t.toInnerHeight+1e-5):l.putImageData(r,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth,t.toInnerHeight),null}))}))};return Promise.resolve().then((function(){if(l=t.getContext("2d",{alpha:Boolean(r.alpha)}),_z(e))return o=e.getContext("2d",{alpha:Boolean(r.alpha)}),null;if(Tz(e))return c=e,d=!0,null;if(xz(e))return jz?(n.debug("Decode image via createImageBitmap"),createImageBitmap(e).then((function(e){c=e})).catch((function(e){return null}))):null;throw new Error('Pica: ".from" should be Image, Canvas or ImageBitmap')})).then((function(){if(i)return a;n.debug("Calculate tiles");var e=function(e){var t,r,n,o,i,a,s=e.toWidth/e.width,c=e.toHeight/e.height,u=Oz(e.srcTileSize*s)-2*e.destTileBorder,l=Oz(e.srcTileSize*c)-2*e.destTileBorder;if(u<1||l<1)throw new Error("Internal error in pica: target tile width/height is too small.");var d,f=[];for(o=0;o<e.toHeight;o+=l)for(n=0;n<e.toWidth;n+=u)(t=n-e.destTileBorder)<0&&(t=0),t+(i=n+u+e.destTileBorder-t)>=e.toWidth&&(i=e.toWidth-t),(r=o-e.destTileBorder)<0&&(r=0),r+(a=o+l+e.destTileBorder-r)>=e.toHeight&&(a=e.toHeight-r),d={toX:t,toY:r,toWidth:i,toHeight:a,toInnerX:n,toInnerY:o,toInnerWidth:u,toInnerHeight:l,offsetX:t/s-Oz(t/s),offsetY:r/c-Oz(r/c),scaleX:s,scaleY:c,x:Oz(t/s),y:Oz(r/c),width:Nz(i/s),height:Nz(a/c)},f.push(d);return f}({width:r.width,height:r.height,srcTileSize:n.options.tile,toWidth:r.toWidth,toHeight:r.toHeight,destTileBorder:s}).map((function(e){return f(e)}));function o(){c&&(d||c.close(),c=null)}return n.debug("Process tiles"),Promise.all(e).then((function(){return n.debug("Finished!"),o(),t}),(function(e){throw o(),e}))}))};return function e(t,r,o,s){if(i)return a;var c,u=Wy(t.shift(),2),d=u[0],f=u[1],p=0===t.length;return s=GV({},s,{toWidth:d,toHeight:f,quality:p?s.quality:Math.min(1,s.quality)}),p||(c=n.options.createCanvas(d,f)),l(r,p?o:c,s).then((function(){return p?o:(s.width=d,s.height=f,e(t,c,o,s))})).then((function(e){return c&&(c.width=c.height=0),e}))}(function(e,t,r,n,o,i){var a=r/e,s=n/t,c=(2*i+2+1)/o;if(c>.5)return[[r,n]];var u=Math.ceil(Math.log(Math.min(a,s))/Math.log(c));if(u<=1)return[[r,n]];for(var l=[],d=0;d<u;d++){var f=Math.round(Math.pow(Math.pow(e,u-d-1)*Math.pow(r,d+1),1/u)),p=Math.round(Math.pow(Math.pow(t,u-d-1)*Math.pow(n,d+1),1/u));l.push([f,p])}return l}(o.width,o.height,o.toWidth,o.toHeight,n.options.tile,s),e,t,o)}))},qz.prototype.resizeBuffer=function(e){var t=this,r=GV({},Vz,e);return this.init().then((function(){return t.__mathlib.resizeAndUnsharp(r)}))},qz.prototype.toBlob=function(e,t,r){return t=t||"image/png",new Promise((function(n){if(e.toBlob)e.toBlob((function(e){return n(e)}),t,r);else if(e.convertToBlob)n(e.convertToBlob({type:t,quality:r}));else{for(var o=atob(e.toDataURL(t,r).split(",")[1]),i=o.length,a=new Uint8Array(i),s=0;s<i;s++)a[s]=o.charCodeAt(s);n(new Blob([a],{type:t}))}}))},qz.prototype.debug=function(){};var Hz=new qz,Kz=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.minSize,o=void 0===n?720:n,i=e/t;return e>t?{desW:Math.floor(o*i),desH:o}:{desW:o,desH:Math.floor(o/i)}},Wz=Object.freeze({__proto__:null,scaleImage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.minSize,n=void 0===r?720:r;return new Promise((function(t){var r=URL.createObjectURL(e),o=new Image;o.src=r;var i=document.createElement("canvas");o.onload=function(){if(o.width&&o.height&&(o.width<n||o.height<n)){var e=Kz(o.width,o.height,{minSize:n}),r=e.desW,a=e.desH;i.width=r,i.height=a,Hz.resize(o,i).then((function(e){return Hz.toBlob(e,"image/jpeg",1)})).then((function(e){return t(e)}))}else t(null)}}))},createResizer:function(e){var t=e.width,r=e.height,n=document.createElement("canvas"),o=n.getContext("2d");return n.width=t,n.height=r,{resize:function(e){var t=e.srcCanvas;return o.drawImage(t,0,0,n.width,n.height),n}}},resizeBlobImg:function(e,t,r){var n=document.createElement("canvas"),o=n.getContext("2d");return n.width=t,n.height=r,new Promise((function(t){var r=URL.createObjectURL(e),i=new Image;i.onload=function(){URL.revokeObjectURL(r),o.drawImage(i,0,0,n.width,n.height),n.toBlob(t,"image/jpeg",1)},i.src=r}))},blobToCanvas:function(e){var t=e.blob;return new Promise((function(e){var r=document.createElement("canvas"),n=r.getContext("2d"),o=new Image;o.onload=function(t){var i=o.width,a=o.height;r.width=i,r.height=a,URL.revokeObjectURL(t.target.src),n.drawImage(t.target,0,0),e(r)},o.src=URL.createObjectURL(t)}))}});function Gz(e,t,r,n){var o=r*(4*t)+4*n;return{r:e[o],g:e[o+1],b:e[o+2]}}function Qz(e,t,r){return function(e,t,r){for(var n=0,o=r[1],i=r[3],a=r[0],s=r[2],c=o;c<i;c++)for(var u=a;u<s;u++){var l=Gz(e,t,c,u),d=l.r,f=l.g,p=l.b;d>=245&&p>=245&&f>245&&(n+=1)}return n}(e,t,function(e,t){var r=Math.floor(.025*e),n=e-r,o=Math.floor(.025*t);return[r,o,n,t-o]}(t,r))/(t*r)>=.001}function Xz(){return(Xz=uM(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.getContext("2d"),n=r.getImageData(0,0,t.width,t.height),o=n.data,mV){e.next=5;break}return e.abrupt("return",Qz(o,n.width,n.height));case 5:return e.abrupt("return",mV.detectGlare(o,n.width,n.height));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Yz=Object.freeze({__proto__:null,isCardGlare:function(e){return Xz.apply(this,arguments)}}),$z="internal_server_error",Zz="network_error",Jz=TF();function eq(e){return 500*Math.pow(1.5,e)}function tq(e){return Array.isArray(null==e?void 0:e.errors)&&e.errors.find((function(e){return e.code===$z}))}function rq(e){return"Failed to fetch"===e.message||!e.response}function nq(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,o=t.maxInternalServerErrorRetryTimes,i=void 0===o?1:o,a=t.propertyKey,s=t.onDone;return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var c=this;function u(e,t){return l.apply(this,arguments)}function l(){return(l=uM(regeneratorRuntime.mark((function t(o,l){var d,f,p,h,m,g,v,y,b=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return g=function(){return(g=uM(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=h(t),n=p(t)-r,e.next=4,$F(eq(n));case 4:return e.abrupt("return",u(r,t,n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},m=function(e){return g.apply(this,arguments)},h=function(e){return e===l?Math.max(o-1,0):p(e)-1},p=function(e){return e===Zz?n:e===$z?i:0},f=function(e){return o>0||(e===Zz?void 0===o&&n>0:e===$z&&void 0===o&&i>0)},d=b.length>2&&void 0!==b[2]?b[2]:0,v=performance.now(),t.prev=7,t.next=10,e.apply(c,r);case 10:if(y=t.sent,s({response:y,retryCount:d,propertyKey:a,timeInMs:performance.now()-v,args:r}),!tq(y)||!f($z)){t.next=16;break}return t.next=15,m($z);case 15:return t.abrupt("return",t.sent);case 16:return t.abrupt("return",y);case 19:if(t.prev=19,t.t0=t.catch(7),s({error:t.t0,retryCount:d,propertyKey:a,timeInMs:performance.now()-v,args:r}),!rq(t.t0)||!f(Zz)){t.next=24;break}return t.abrupt("return",m(Zz));case 24:throw t.t0;case 25:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}return u()}}function oq(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,o=t.maxInternalServerErrorRetryTimes,i=void 0===o?1:o,a=t.onDone,s=void 0===a?function(){}:a,c={get:function(e,t){var r=e[t];return"function"==typeof r&&"constructor"!==t?nq(r,{maxNetworkErrorRetryTimes:n,maxInternalServerErrorRetryTimes:i,propertyKey:t,onDone:s}):r}};return new Proxy(e,c)}var iq=Object.freeze({__proto__:null,createRetryAPIClient:oq,useApiClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCredentials,r=void 0===t?{}:t,n=e.tracking,o=void 0===n?{}:n,i=_w.useRef(null),a=function(){};if(null===i.current){var s=r.accessKey,c=r.secretKey,u=r.apiUrl,l=o.userId,d=KF({userId:l});i.current=oq(new vF(s,c,u,{httpHeaders:gM(gM({},Jz),{},{"x-request-id":d})}),{onDone:a})}return{apiClient:i.current}}}),aq="BFnYsWrH",sq="KbKcY2nb",cq=function(e){return e.split("").reverse().join("")},uq=function(e){var t=e.url;return new Promise((function(e){var r=document.createElement("script");r.onload=e,r.src=t,document.head.appendChild(r)}))},lq=window.fetch.bind(window);function dq(e){var t,r,n=e.hasOwnProperty("words")?e.words:[],o=e.hasOwnProperty("sigBytes")?e.sigBytes:4*n.length,i=new Uint8Array(o),a=0;for(r=0;r<o;r++)t=n[r],i[a++]=t>>24,i[a++]=t>>16&255,i[a++]=t>>8&255,i[a++]=255&t;return i}var fq=function(){var e=uM(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(cq(aq)).concat(cq(sq)),e.next=3,lq.apply(void 0,a);case 3:return r=e.sent,e.next=6,r.text();case 6:return n=e.sent,o=LF.AES.decrypt(n,t),i=dq(o),e.abrupt("return",{u8arr:i});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pq=function(){var e=uM(regeneratorRuntime.mark((function e(){var t,r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,lq.apply(void 0,n);case 2:return t=e.sent,e.next=5,t.text();case 5:return r=e.sent,e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),hq=Object.freeze({__proto__:null,reverseString:cq,loadExternalScript:uq,fetchWithDecryption:fq,fetchRawResource:pq}),mq=/\s/,gq=function(e){for(var t=e.length;t--&&mq.test(e.charAt(t)););return t},vq=/^\s+/,yq=function(e){return e?e.slice(0,gq(e)+1).replace(vq,""):e},bq=/^[-+]0x[0-9a-f]+$/i,wq=/^0b[01]+$/i,kq=/^0o[0-7]+$/i,Cq=parseInt,Bq=function(e){if("number"==typeof e)return e;if(Sj(e))return NaN;if(nL(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=nL(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=yq(e);var r=wq.test(e);return r||kq.test(e)?Cq(e.slice(2),r?2:8):bq.test(e)?NaN:+e},Sq=function(e){return e?1/0===(e=Bq(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},Eq=function(e){var t=Sq(e),r=t%1;return t==t?r?t-r:t:0},_q=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=Eq(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},xq=function(e){return _q(2,e)},Tq=xq(function(){var e=uM(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l,d,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=f.length>0&&void 0!==f[0]?f[0]:{},r=t.tfUrl,n=void 0===r?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.20.0/dist/tf.min.js":r,o=t.tfBackendWasmUrl,i=void 0===o?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.20.0/dist/tf-backend-wasm.js":o,a=t.tfBackendCpuUrl,s=void 0===a?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@3.20.0":a,c=t.tfLiteUrl,u=void 0===c?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite@0.0.1-alpha.8/dist/tf-tflite.min.js":c,l=t.blazefaceScriptUrl,d=void 0===l?"https://cdn.jsdelivr.net/npm/@tensorflow-models/blazeface@0.0.7":l,e.next=3,uq({url:n});case 3:return e.next=5,Promise.all([uq({url:i}),uq({url:s}),uq({url:d}),uq({url:u})]);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());function Aq(){return(Aq=uM(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},r=t.preferredBackends,n=void 0===r?["wasm","cpu"]:r,!window.tv_model_backend_init||window.tv_model_backend_init[0]!==n[0]){e.next=3;break}return e.abrupt("return");case 3:return o=window,i=o.tf,e.next=6,i.enableProdMode();case 6:a=CM(n),e.prev=7,a.s();case 9:if((s=a.n()).done){e.next=23;break}return c=s.value,e.prev=11,e.next=14,i.setBackend(c);case 14:return e.abrupt("break",23);case 17:if(e.prev=17,e.t0=e.catch(11),c!==n[n.length-1]){e.next=21;break}throw e.t0;case 21:e.next=9;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(7),a.e(e.t1);case 28:return e.prev=28,a.f(),e.finish(28);case 31:return e.next=33,i.ready();case 33:window.tv_model_backend_init=n;case 34:case"end":return e.stop()}}),e,null,[[7,25,28,31],[11,17]])})))).apply(this,arguments)}function Pq(){return(Pq=uM(regeneratorRuntime.mark((function e(t){var r,n,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.modelUrl,n=window,o=n.blazeface,!r){e.next=8;break}return e.next=5,o.load({modelUrl:r});case 5:i=e.sent,e.next=11;break;case 8:return e.next=10,o.load();case 10:i=e.sent;case 11:return e.abrupt("return",{blazefaceModel:i});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Iq(){return(Iq=uM(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.modelUrl,e.next=3,pq(r);case 3:return n=e.sent,o=n.rawData,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rq(e){return Oq.apply(this,arguments)}function Oq(){return(Oq=uM(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,n=t.options,o=void 0===n?{}:n,i=window,a=i.tflite,e.next=4,fq(r);case 4:return s=e.sent,c=s.u8arr,e.abrupt("return",a.loadTFLiteModel(c,gM({numThreads:1},o)));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nq=Object.freeze({__proto__:null,loadTensorFlow:Tq,initTensorFlow:function(){return Aq.apply(this,arguments)},loadBlazefaceModel:function(e){return Pq.apply(this,arguments)},preloadResource:function(e){return Iq.apply(this,arguments)},loadTFLiteModel:Rq}),Dq=Object.freeze({__proto__:null,enableAntiDebug:function(){var e,t,r=["action","gger","stateObject","apply","chain","test","input","Hello World!","constructor","counter","length","debu","call"];e=r,t=185,function(t){for(;--t;)e.push(e.shift())}(++t);var n,o,i=function(e,t){return r[e-=0]};function a(e){function t(e){if("string"==typeof e)return function(e){}[i("0x5")]("while (true) {}")[i("0x0")](i("0x6"));1!=="".concat(e/e)[i("0x7")]||e%20==0?function(){return!0}[i("0x5")]("".concat(i("0x8"),"gger"))[i("0x9")](i("0xa")):function(){return!1}.constructor("debu".concat(i("0xb")))[i("0x0")](i("0xc")),t(++e)}try{if(e)return t;t(0)}catch(e){}}setInterval((function(){a()}),4e3),n=!0,o=function(e,t){var r=n?function(){if(t){var r=t[i("0x0")](e,arguments);return t=null,r}}:function(){};return n=!1,r},function(){o(this,(function(){var e=new RegExp("function *\\( *\\)"),t=new RegExp("\\+\\+ *(?:_0x(?:[a-f0-9]){4,6}|(?:\\b|\\d)[a-z0-9]{1,4}(?:\\b|\\d))","i"),r=a("init");e.test(r+i("0x1"))&&t[i("0x2")](r+i("0x3"))?a():r("0")}))()}(),console.log(i("0x4"))}}),Mq=Object.freeze({__proto__:null,useThemeContext:function(){return _w.useContext(aE)}});function Lq(){return(Lq=uM(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.key,n=new TextEncoder,(o=n.encode(r)).reverse(),e.abrupt("return",crypto.subtle.digest("SHA-256",o));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Uq=Object.freeze({__proto__:null,encrypt:function(e){var t=e.blob,r=e.key;return new Promise((function(e){var n=new FileReader;n.onload=function(t){var n=t.target.result;(function(e){return Lq.apply(this,arguments)})({key:r}).then((function(t){window.crypto.subtle.importKey("raw",t,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(t){var r;e({hex:(r=t,bM(new Uint8Array(r)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""))})}))}))}))},n.readAsArrayBuffer(t)}))}}),jq=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;lM(this,e),this.interval=t,this.second=0,this.timeStone={origin:0},this.callbacks={}}return fM(e,[{key:"duration",value:function(e){return Object.prototype.hasOwnProperty.call(this.timeStone,e)?this.second-this.timeStone[e]:-1}},{key:"start",value:function(e,t){var r=this;e||this.timerID||(this.callbacks.origin=t,this.timerID=setInterval((function(){r.second++,Object.keys(r.timeStone).map((function(e){return"function"==typeof r.callbacks[e]&&r.callbacks[e](r.duration(e)),0}))}),this.interval)),Object.prototype.hasOwnProperty.call(this.timeStone,e)||e&&(this.timeStone[e]=this.second,this.callbacks[e]=t)}},{key:"stop",value:function(){clearInterval(this.timerID),this.timerID=void 0,this.second=0,this.timeStone={origin:0},this.callbacks={}}}]),e}(),Fq=FM((function(e,t){!function(){var r={};function n(e){return d(">"+p("B",e.length),e)}function o(e){return d(">"+p("H",e.length),e)}function i(e){return d(">"+p("L",e.length),e)}function a(e,t,r){var a,s,c,u,l="",f="";if("Byte"==t)(a=e.length)<=4?f=n(e)+p("\0",4-a):(f=d(">L",[r]),l=n(e));else if("Short"==t)(a=e.length)<=2?f=o(e)+p("\0\0",2-a):(f=d(">L",[r]),l=o(e));else if("Long"==t)(a=e.length)<=1?f=i(e):(f=d(">L",[r]),l=i(e));else if("Ascii"==t)(a=(s=e+"\0").length)>4?(f=d(">L",[r]),l=s):f=s+p("\0",4-a);else if("Rational"==t){if("number"==typeof e[0])a=1,c=e[0],u=e[1],s=d(">L",[c])+d(">L",[u]);else{a=e.length,s="";for(var h=0;h<a;h++)c=e[h][0],u=e[h][1],s+=d(">L",[c])+d(">L",[u])}f=d(">L",[r]),l=s}else if("SRational"==t){if("number"==typeof e[0])a=1,c=e[0],u=e[1],s=d(">l",[c])+d(">l",[u]);else for(a=e.length,s="",h=0;h<a;h++)c=e[h][0],u=e[h][1],s+=d(">l",[c])+d(">l",[u]);f=d(">L",[r]),l=s}else"Undefined"==t&&((a=e.length)>4?(f=d(">L",[r]),l=e):f=e+p("\0",4-a));return[d(">L",[a]),f,l]}function s(e,t,r){var n,o=Object.keys(e).length,i=d(">H",[o]);n=["0th","1st"].indexOf(t)>-1?2+12*o+4:2+12*o;var s="",c="";for(var u in e)if("string"==typeof u&&(u=parseInt(u)),!("0th"==t&&[34665,34853].indexOf(u)>-1||"Exif"==t&&40965==u||"1st"==t&&[513,514].indexOf(u)>-1)){var l=e[u],f=d(">H",[u]),p=g[t][u].type,h=d(">H",[m[p]]);"number"==typeof l&&(l=[l]);var v=a(l,p,8+n+r+c.length);s+=f+h+v[0]+v[1],c+=v[2]}return[i+s,c]}function c(e){var t;if("ÿØ"==e.slice(0,2))t=function(e){for(var t,r=0;r<e.length;r++)if("ÿá"==(t=e[r]).slice(0,2)&&"Exif\0\0"==t.slice(4,10))return t;return null}(h(e)),this.tiftag=t?t.slice(10):null;else if(["II","MM"].indexOf(e.slice(0,2))>-1)this.tiftag=e;else{if("Exif"!=e.slice(0,4))throw new Error("Given file is neither JPEG nor TIFF.");this.tiftag=e.slice(6)}}if(r.version="1.0.4",r.remove=function(e){var t=!1;if("ÿØ"==e.slice(0,2));else{if("data:image/jpeg;base64,"!=e.slice(0,23)&&"data:image/jpg;base64,"!=e.slice(0,22))throw new Error("Given data is not jpeg.");e=l(e.split(",")[1]),t=!0}var r=h(e).filter((function(e){return!("ÿá"==e.slice(0,2)&&"Exif\0\0"==e.slice(4,10))})).join("");return t&&(r="data:image/jpeg;base64,"+u(r)),r},r.insert=function(e,t){var r=!1;if("Exif\0\0"!=e.slice(0,6))throw new Error("Given data is not exif.");if("ÿØ"==t.slice(0,2));else{if("data:image/jpeg;base64,"!=t.slice(0,23)&&"data:image/jpg;base64,"!=t.slice(0,22))throw new Error("Given data is not jpeg.");t=l(t.split(",")[1]),r=!0}var n="ÿá"+d(">H",[e.length+2])+e,o=function(e,t){var r=!1,n=[];return e.forEach((function(o,i){"ÿá"==o.slice(0,2)&&"Exif\0\0"==o.slice(4,10)&&(r?n.unshift(i):(e[i]=t,r=!0))})),n.forEach((function(t){e.splice(t,1)})),!r&&t&&(e=[e[0],t].concat(e.slice(1))),e.join("")}(h(t),n);return r&&(o="data:image/jpeg;base64,"+u(o)),o},r.load=function(e){var t;if("string"!=typeof e)throw new Error("'load' gots invalid type argument.");if("ÿØ"==e.slice(0,2))t=e;else if("data:image/jpeg;base64,"==e.slice(0,23)||"data:image/jpg;base64,"==e.slice(0,22))t=l(e.split(",")[1]);else{if("Exif"!=e.slice(0,4))throw new Error("'load' gots invalid file data.");t=e.slice(6)}var r={"0th":{},Exif:{},GPS:{},Interop:{},"1st":{},thumbnail:null},n=new c(t);if(null===n.tiftag)return r;"II"==n.tiftag.slice(0,2)?n.endian_mark="<":n.endian_mark=">";var o=f(n.endian_mark+"L",n.tiftag.slice(4,8))[0];r["0th"]=n.get_ifd(o,"0th");var i=r["0th"].first_ifd_pointer;if(delete r["0th"].first_ifd_pointer,34665 in r["0th"]&&(o=r["0th"][34665],r.Exif=n.get_ifd(o,"Exif")),34853 in r["0th"]&&(o=r["0th"][34853],r.GPS=n.get_ifd(o,"GPS")),40965 in r.Exif&&(o=r.Exif[40965],r.Interop=n.get_ifd(o,"Interop")),"\0\0\0\0"!=i&&(o=f(n.endian_mark+"L",i)[0],r["1st"]=n.get_ifd(o,"1st"),513 in r["1st"]&&514 in r["1st"])){var a=r["1st"][513]+r["1st"][514],s=n.tiftag.slice(r["1st"][513],a);r.thumbnail=s}return r},r.dump=function(e){var t,n,o,i,a,c,u=(t=e,JSON.parse(JSON.stringify(t))),l=!1,f=!1,p=!1,g=!1;n="0th"in u?u["0th"]:{},"Exif"in u&&Object.keys(u.Exif).length||"Interop"in u&&Object.keys(u.Interop).length?(n[34665]=1,l=!0,o=u.Exif,"Interop"in u&&Object.keys(u.Interop).length?(o[40965]=1,p=!0,i=u.Interop):Object.keys(o).indexOf(r.ExifIFD.InteroperabilityTag.toString())>-1&&delete o[40965]):Object.keys(n).indexOf(r.ImageIFD.ExifTag.toString())>-1&&delete n[34665],"GPS"in u&&Object.keys(u.GPS).length?(n[r.ImageIFD.GPSTag]=1,f=!0,a=u.GPS):Object.keys(n).indexOf(r.ImageIFD.GPSTag.toString())>-1&&delete n[r.ImageIFD.GPSTag],"1st"in u&&"thumbnail"in u&&null!=u.thumbnail&&(g=!0,u["1st"][513]=1,u["1st"][514]=1,c=u["1st"]);var v,y,b,w=s(n,"0th",0),k=w[0].length+12*l+12*f+4+w[1].length,C="",B=0,S="",E=0,_="",x=0,T="";if(l&&(B=(v=s(o,"Exif",k))[0].length+12*p+v[1].length),f&&(E=(S=s(a,"GPS",k+B).join("")).length),p&&(x=(_=s(i,"Interop",k+B+E).join("")).length),g&&(y=s(c,"1st",k+B+E+x),(b=function(e){for(var t=h(e);"ÿà"<=t[1].slice(0,2)&&t[1].slice(0,2)<="ÿï";)t=[t[0]].concat(t.slice(2));return t.join("")}(u.thumbnail)).length>64e3))throw new Error("Given thumbnail is too large. max 64kB");var A="",P="",I="",R="\0\0\0\0";if(l){var O=d(">L",[N=8+k]);A=d(">H",[34665])+d(">H",[m.Long])+d(">L",[1])+O}if(f&&(O=d(">L",[N=8+k+B]),P=d(">H",[34853])+d(">H",[m.Long])+d(">L",[1])+O),p&&(O=d(">L",[N=8+k+B+E]),I=d(">H",[40965])+d(">H",[m.Long])+d(">L",[1])+O),g){var N;R=d(">L",[N=8+k+B+E+x]);var D="\0\0\0\0"+d(">L",[N+y[0].length+24+4+y[1].length]),M="\0\0\0\0"+d(">L",[b.length]);T=y[0]+D+M+"\0\0\0\0"+y[1]+b}var L=w[0]+A+P+R+w[1];return l&&(C=v[0]+I+v[1]),"Exif\0\0MM\0*\0\0\0\b"+L+C+S+_+T},c.prototype={get_ifd:function(e,t){var r,n={},o=f(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],i=e+2;r=["0th","1st"].indexOf(t)>-1?"Image":t;for(var a=0;a<o;a++){e=i+12*a;var s=f(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],c=[f(this.endian_mark+"H",this.tiftag.slice(e+2,e+4))[0],f(this.endian_mark+"L",this.tiftag.slice(e+4,e+8))[0],this.tiftag.slice(e+8,e+12)];s in g[r]&&(n[s]=this.convert_value(c))}return"0th"==t&&(e=i+12*o,n.first_ifd_pointer=this.tiftag.slice(e,e+4)),n},convert_value:function(e){var t,r=null,n=e[0],o=e[1],i=e[2];if(1==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+p("B",o),this.tiftag.slice(t,t+o))):r=f(this.endian_mark+p("B",o),i.slice(0,o));else if(2==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=this.tiftag.slice(t,t+o-1)):r=i.slice(0,o-1);else if(3==n)o>2?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+p("H",o),this.tiftag.slice(t,t+2*o))):r=f(this.endian_mark+p("H",o),i.slice(0,2*o));else if(4==n)o>1?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+p("L",o),this.tiftag.slice(t,t+4*o))):r=f(this.endian_mark+p("L",o),i);else if(5==n)if(t=f(this.endian_mark+"L",i)[0],o>1){r=[];for(var a=0;a<o;a++)r.push([f(this.endian_mark+"L",this.tiftag.slice(t+8*a,t+4+8*a))[0],f(this.endian_mark+"L",this.tiftag.slice(t+4+8*a,t+8+8*a))[0]])}else r=[f(this.endian_mark+"L",this.tiftag.slice(t,t+4))[0],f(this.endian_mark+"L",this.tiftag.slice(t+4,t+8))[0]];else if(7==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=this.tiftag.slice(t,t+o)):r=i.slice(0,o);else if(9==n)o>1?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+p("l",o),this.tiftag.slice(t,t+4*o))):r=f(this.endian_mark+p("l",o),i);else{if(10!=n)throw new Error("Exif might be wrong. Got incorrect value type to decode. type:"+n);if(t=f(this.endian_mark+"L",i)[0],o>1)for(r=[],a=0;a<o;a++)r.push([f(this.endian_mark+"l",this.tiftag.slice(t+8*a,t+4+8*a))[0],f(this.endian_mark+"l",this.tiftag.slice(t+4+8*a,t+8+8*a))[0]]);else r=[f(this.endian_mark+"l",this.tiftag.slice(t,t+4))[0],f(this.endian_mark+"l",this.tiftag.slice(t+4,t+8))[0]]}return r instanceof Array&&1==r.length?r[0]:r}},"undefined"!=typeof window&&"function"==typeof window.btoa)var u=window.btoa;if(void 0===u&&(u=function(e){for(var t,r,n,o,i,a,s,c="",u=0,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";u<e.length;)o=(t=e.charCodeAt(u++))>>2,i=(3&t)<<4|(r=e.charCodeAt(u++))>>4,a=(15&r)<<2|(n=e.charCodeAt(u++))>>6,s=63&n,isNaN(r)?a=s=64:isNaN(n)&&(s=64),c=c+l.charAt(o)+l.charAt(i)+l.charAt(a)+l.charAt(s);return c}),"undefined"!=typeof window&&"function"==typeof window.atob)var l=window.atob;function d(e,t){if(!(t instanceof Array))throw new Error("'pack' error. Got invalid type argument.");if(e.length-1!=t.length)throw new Error("'pack' error. "+(e.length-1)+" marks, "+t.length+" elements.");var r;if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("");r=!1}for(var n="",o=1,i=null,a=null,s=null;a=e[o];){if("b"==a.toLowerCase()){if(i=t[o-1],"b"==a&&i<0&&(i+=256),i>255||i<0)throw new Error("'pack' error.");s=String.fromCharCode(i)}else if("H"==a){if((i=t[o-1])>65535||i<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(i%65536/256))+String.fromCharCode(i%256),r&&(s=s.split("").reverse().join(""))}else{if("l"!=a.toLowerCase())throw new Error("'pack' error.");if(i=t[o-1],"l"==a&&i<0&&(i+=4294967296),i>4294967295||i<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(i/16777216))+String.fromCharCode(Math.floor(i%16777216/65536))+String.fromCharCode(Math.floor(i%65536/256))+String.fromCharCode(i%256),r&&(s=s.split("").reverse().join(""))}n+=s,o+=1}return n}function f(e,t){if("string"!=typeof t)throw new Error("'unpack' error. Got invalid type argument.");for(var r,n=0,o=1;o<e.length;o++)if("b"==e[o].toLowerCase())n+=1;else if("h"==e[o].toLowerCase())n+=2;else{if("l"!=e[o].toLowerCase())throw new Error("'unpack' error. Got invalid mark.");n+=4}if(n!=t.length)throw new Error("'unpack' error. Mismatch between symbol and string length. "+n+":"+t.length);if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("'unpack' error.");r=!1}for(var i=[],a=0,s=1,c=null,u=null,l=null,d="";u=e[s];){if("b"==u.toLowerCase())l=1,c=(d=t.slice(a,a+l)).charCodeAt(0),"b"==u&&c>=128&&(c-=256);else if("H"==u)l=2,d=t.slice(a,a+l),r&&(d=d.split("").reverse().join("")),c=256*d.charCodeAt(0)+d.charCodeAt(1);else{if("l"!=u.toLowerCase())throw new Error("'unpack' error. "+u);l=4,d=t.slice(a,a+l),r&&(d=d.split("").reverse().join("")),c=16777216*d.charCodeAt(0)+65536*d.charCodeAt(1)+256*d.charCodeAt(2)+d.charCodeAt(3),"l"==u&&c>=2147483648&&(c-=4294967296)}i.push(c),a+=l,s+=1}return i}function p(e,t){for(var r="",n=0;n<t;n++)r+=e;return r}function h(e){if("ÿØ"!=e.slice(0,2))throw new Error("Given data isn't JPEG.");for(var t=2,r=["ÿØ"];;){if("ÿÚ"==e.slice(t,t+2)){r.push(e.slice(t));break}var n=t+f(">H",e.slice(t+2,t+4))[0]+2;if(r.push(e.slice(t,n)),(t=n)>=e.length)throw new Error("Wrong JPEG data.")}return r}void 0===l&&(l=function(e){var t,r,n,o,i,a,s="",c=0,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<e.length;)t=u.indexOf(e.charAt(c++))<<2|(o=u.indexOf(e.charAt(c++)))>>4,r=(15&o)<<4|(i=u.indexOf(e.charAt(c++)))>>2,n=(3&i)<<6|(a=u.indexOf(e.charAt(c++))),s+=String.fromCharCode(t),64!=i&&(s+=String.fromCharCode(r)),64!=a&&(s+=String.fromCharCode(n));return s});var m={Byte:1,Ascii:2,Short:3,Long:4,Rational:5,Undefined:7,SLong:9,SRational:10},g={Image:{11:{name:"ProcessingSoftware",type:"Ascii"},254:{name:"NewSubfileType",type:"Long"},255:{name:"SubfileType",type:"Short"},256:{name:"ImageWidth",type:"Long"},257:{name:"ImageLength",type:"Long"},258:{name:"BitsPerSample",type:"Short"},259:{name:"Compression",type:"Short"},262:{name:"PhotometricInterpretation",type:"Short"},263:{name:"Threshholding",type:"Short"},264:{name:"CellWidth",type:"Short"},265:{name:"CellLength",type:"Short"},266:{name:"FillOrder",type:"Short"},269:{name:"DocumentName",type:"Ascii"},270:{name:"ImageDescription",type:"Ascii"},271:{name:"Make",type:"Ascii"},272:{name:"Model",type:"Ascii"},273:{name:"StripOffsets",type:"Long"},274:{name:"Orientation",type:"Short"},277:{name:"SamplesPerPixel",type:"Short"},278:{name:"RowsPerStrip",type:"Long"},279:{name:"StripByteCounts",type:"Long"},282:{name:"XResolution",type:"Rational"},283:{name:"YResolution",type:"Rational"},284:{name:"PlanarConfiguration",type:"Short"},290:{name:"GrayResponseUnit",type:"Short"},291:{name:"GrayResponseCurve",type:"Short"},292:{name:"T4Options",type:"Long"},293:{name:"T6Options",type:"Long"},296:{name:"ResolutionUnit",type:"Short"},301:{name:"TransferFunction",type:"Short"},305:{name:"Software",type:"Ascii"},306:{name:"DateTime",type:"Ascii"},315:{name:"Artist",type:"Ascii"},316:{name:"HostComputer",type:"Ascii"},317:{name:"Predictor",type:"Short"},318:{name:"WhitePoint",type:"Rational"},319:{name:"PrimaryChromaticities",type:"Rational"},320:{name:"ColorMap",type:"Short"},321:{name:"HalftoneHints",type:"Short"},322:{name:"TileWidth",type:"Short"},323:{name:"TileLength",type:"Short"},324:{name:"TileOffsets",type:"Short"},325:{name:"TileByteCounts",type:"Short"},330:{name:"SubIFDs",type:"Long"},332:{name:"InkSet",type:"Short"},333:{name:"InkNames",type:"Ascii"},334:{name:"NumberOfInks",type:"Short"},336:{name:"DotRange",type:"Byte"},337:{name:"TargetPrinter",type:"Ascii"},338:{name:"ExtraSamples",type:"Short"},339:{name:"SampleFormat",type:"Short"},340:{name:"SMinSampleValue",type:"Short"},341:{name:"SMaxSampleValue",type:"Short"},342:{name:"TransferRange",type:"Short"},343:{name:"ClipPath",type:"Byte"},344:{name:"XClipPathUnits",type:"Long"},345:{name:"YClipPathUnits",type:"Long"},346:{name:"Indexed",type:"Short"},347:{name:"JPEGTables",type:"Undefined"},351:{name:"OPIProxy",type:"Short"},512:{name:"JPEGProc",type:"Long"},513:{name:"JPEGInterchangeFormat",type:"Long"},514:{name:"JPEGInterchangeFormatLength",type:"Long"},515:{name:"JPEGRestartInterval",type:"Short"},517:{name:"JPEGLosslessPredictors",type:"Short"},518:{name:"JPEGPointTransforms",type:"Short"},519:{name:"JPEGQTables",type:"Long"},520:{name:"JPEGDCTables",type:"Long"},521:{name:"JPEGACTables",type:"Long"},529:{name:"YCbCrCoefficients",type:"Rational"},530:{name:"YCbCrSubSampling",type:"Short"},531:{name:"YCbCrPositioning",type:"Short"},532:{name:"ReferenceBlackWhite",type:"Rational"},700:{name:"XMLPacket",type:"Byte"},18246:{name:"Rating",type:"Short"},18249:{name:"RatingPercent",type:"Short"},32781:{name:"ImageID",type:"Ascii"},33421:{name:"CFARepeatPatternDim",type:"Short"},33422:{name:"CFAPattern",type:"Byte"},33423:{name:"BatteryLevel",type:"Rational"},33432:{name:"Copyright",type:"Ascii"},33434:{name:"ExposureTime",type:"Rational"},34377:{name:"ImageResources",type:"Byte"},34665:{name:"ExifTag",type:"Long"},34675:{name:"InterColorProfile",type:"Undefined"},34853:{name:"GPSTag",type:"Long"},34857:{name:"Interlace",type:"Short"},34858:{name:"TimeZoneOffset",type:"Long"},34859:{name:"SelfTimerMode",type:"Short"},37387:{name:"FlashEnergy",type:"Rational"},37388:{name:"SpatialFrequencyResponse",type:"Undefined"},37389:{name:"Noise",type:"Undefined"},37390:{name:"FocalPlaneXResolution",type:"Rational"},37391:{name:"FocalPlaneYResolution",type:"Rational"},37392:{name:"FocalPlaneResolutionUnit",type:"Short"},37393:{name:"ImageNumber",type:"Long"},37394:{name:"SecurityClassification",type:"Ascii"},37395:{name:"ImageHistory",type:"Ascii"},37397:{name:"ExposureIndex",type:"Rational"},37398:{name:"TIFFEPStandardID",type:"Byte"},37399:{name:"SensingMethod",type:"Short"},40091:{name:"XPTitle",type:"Byte"},40092:{name:"XPComment",type:"Byte"},40093:{name:"XPAuthor",type:"Byte"},40094:{name:"XPKeywords",type:"Byte"},40095:{name:"XPSubject",type:"Byte"},50341:{name:"PrintImageMatching",type:"Undefined"},50706:{name:"DNGVersion",type:"Byte"},50707:{name:"DNGBackwardVersion",type:"Byte"},50708:{name:"UniqueCameraModel",type:"Ascii"},50709:{name:"LocalizedCameraModel",type:"Byte"},50710:{name:"CFAPlaneColor",type:"Byte"},50711:{name:"CFALayout",type:"Short"},50712:{name:"LinearizationTable",type:"Short"},50713:{name:"BlackLevelRepeatDim",type:"Short"},50714:{name:"BlackLevel",type:"Rational"},50715:{name:"BlackLevelDeltaH",type:"SRational"},50716:{name:"BlackLevelDeltaV",type:"SRational"},50717:{name:"WhiteLevel",type:"Short"},50718:{name:"DefaultScale",type:"Rational"},50719:{name:"DefaultCropOrigin",type:"Short"},50720:{name:"DefaultCropSize",type:"Short"},50721:{name:"ColorMatrix1",type:"SRational"},50722:{name:"ColorMatrix2",type:"SRational"},50723:{name:"CameraCalibration1",type:"SRational"},50724:{name:"CameraCalibration2",type:"SRational"},50725:{name:"ReductionMatrix1",type:"SRational"},50726:{name:"ReductionMatrix2",type:"SRational"},50727:{name:"AnalogBalance",type:"Rational"},50728:{name:"AsShotNeutral",type:"Short"},50729:{name:"AsShotWhiteXY",type:"Rational"},50730:{name:"BaselineExposure",type:"SRational"},50731:{name:"BaselineNoise",type:"Rational"},50732:{name:"BaselineSharpness",type:"Rational"},50733:{name:"BayerGreenSplit",type:"Long"},50734:{name:"LinearResponseLimit",type:"Rational"},50735:{name:"CameraSerialNumber",type:"Ascii"},50736:{name:"LensInfo",type:"Rational"},50737:{name:"ChromaBlurRadius",type:"Rational"},50738:{name:"AntiAliasStrength",type:"Rational"},50739:{name:"ShadowScale",type:"SRational"},50740:{name:"DNGPrivateData",type:"Byte"},50741:{name:"MakerNoteSafety",type:"Short"},50778:{name:"CalibrationIlluminant1",type:"Short"},50779:{name:"CalibrationIlluminant2",type:"Short"},50780:{name:"BestQualityScale",type:"Rational"},50781:{name:"RawDataUniqueID",type:"Byte"},50827:{name:"OriginalRawFileName",type:"Byte"},50828:{name:"OriginalRawFileData",type:"Undefined"},50829:{name:"ActiveArea",type:"Short"},50830:{name:"MaskedAreas",type:"Short"},50831:{name:"AsShotICCProfile",type:"Undefined"},50832:{name:"AsShotPreProfileMatrix",type:"SRational"},50833:{name:"CurrentICCProfile",type:"Undefined"},50834:{name:"CurrentPreProfileMatrix",type:"SRational"},50879:{name:"ColorimetricReference",type:"Short"},50931:{name:"CameraCalibrationSignature",type:"Byte"},50932:{name:"ProfileCalibrationSignature",type:"Byte"},50934:{name:"AsShotProfileName",type:"Byte"},50935:{name:"NoiseReductionApplied",type:"Rational"},50936:{name:"ProfileName",type:"Byte"},50937:{name:"ProfileHueSatMapDims",type:"Long"},50938:{name:"ProfileHueSatMapData1",type:"Float"},50939:{name:"ProfileHueSatMapData2",type:"Float"},50940:{name:"ProfileToneCurve",type:"Float"},50941:{name:"ProfileEmbedPolicy",type:"Long"},50942:{name:"ProfileCopyright",type:"Byte"},50964:{name:"ForwardMatrix1",type:"SRational"},50965:{name:"ForwardMatrix2",type:"SRational"},50966:{name:"PreviewApplicationName",type:"Byte"},50967:{name:"PreviewApplicationVersion",type:"Byte"},50968:{name:"PreviewSettingsName",type:"Byte"},50969:{name:"PreviewSettingsDigest",type:"Byte"},50970:{name:"PreviewColorSpace",type:"Long"},50971:{name:"PreviewDateTime",type:"Ascii"},50972:{name:"RawImageDigest",type:"Undefined"},50973:{name:"OriginalRawFileDigest",type:"Undefined"},50974:{name:"SubTileBlockSize",type:"Long"},50975:{name:"RowInterleaveFactor",type:"Long"},50981:{name:"ProfileLookTableDims",type:"Long"},50982:{name:"ProfileLookTableData",type:"Float"},51008:{name:"OpcodeList1",type:"Undefined"},51009:{name:"OpcodeList2",type:"Undefined"},51022:{name:"OpcodeList3",type:"Undefined"}},Exif:{33434:{name:"ExposureTime",type:"Rational"},33437:{name:"FNumber",type:"Rational"},34850:{name:"ExposureProgram",type:"Short"},34852:{name:"SpectralSensitivity",type:"Ascii"},34855:{name:"ISOSpeedRatings",type:"Short"},34856:{name:"OECF",type:"Undefined"},34864:{name:"SensitivityType",type:"Short"},34865:{name:"StandardOutputSensitivity",type:"Long"},34866:{name:"RecommendedExposureIndex",type:"Long"},34867:{name:"ISOSpeed",type:"Long"},34868:{name:"ISOSpeedLatitudeyyy",type:"Long"},34869:{name:"ISOSpeedLatitudezzz",type:"Long"},36864:{name:"ExifVersion",type:"Undefined"},36867:{name:"DateTimeOriginal",type:"Ascii"},36868:{name:"DateTimeDigitized",type:"Ascii"},37121:{name:"ComponentsConfiguration",type:"Undefined"},37122:{name:"CompressedBitsPerPixel",type:"Rational"},37377:{name:"ShutterSpeedValue",type:"SRational"},37378:{name:"ApertureValue",type:"Rational"},37379:{name:"BrightnessValue",type:"SRational"},37380:{name:"ExposureBiasValue",type:"SRational"},37381:{name:"MaxApertureValue",type:"Rational"},37382:{name:"SubjectDistance",type:"Rational"},37383:{name:"MeteringMode",type:"Short"},37384:{name:"LightSource",type:"Short"},37385:{name:"Flash",type:"Short"},37386:{name:"FocalLength",type:"Rational"},37396:{name:"SubjectArea",type:"Short"},37500:{name:"MakerNote",type:"Undefined"},37510:{name:"UserComment",type:"Ascii"},37520:{name:"SubSecTime",type:"Ascii"},37521:{name:"SubSecTimeOriginal",type:"Ascii"},37522:{name:"SubSecTimeDigitized",type:"Ascii"},40960:{name:"FlashpixVersion",type:"Undefined"},40961:{name:"ColorSpace",type:"Short"},40962:{name:"PixelXDimension",type:"Long"},40963:{name:"PixelYDimension",type:"Long"},40964:{name:"RelatedSoundFile",type:"Ascii"},40965:{name:"InteroperabilityTag",type:"Long"},41483:{name:"FlashEnergy",type:"Rational"},41484:{name:"SpatialFrequencyResponse",type:"Undefined"},41486:{name:"FocalPlaneXResolution",type:"Rational"},41487:{name:"FocalPlaneYResolution",type:"Rational"},41488:{name:"FocalPlaneResolutionUnit",type:"Short"},41492:{name:"SubjectLocation",type:"Short"},41493:{name:"ExposureIndex",type:"Rational"},41495:{name:"SensingMethod",type:"Short"},41728:{name:"FileSource",type:"Undefined"},41729:{name:"SceneType",type:"Undefined"},41730:{name:"CFAPattern",type:"Undefined"},41985:{name:"CustomRendered",type:"Short"},41986:{name:"ExposureMode",type:"Short"},41987:{name:"WhiteBalance",type:"Short"},41988:{name:"DigitalZoomRatio",type:"Rational"},41989:{name:"FocalLengthIn35mmFilm",type:"Short"},41990:{name:"SceneCaptureType",type:"Short"},41991:{name:"GainControl",type:"Short"},41992:{name:"Contrast",type:"Short"},41993:{name:"Saturation",type:"Short"},41994:{name:"Sharpness",type:"Short"},41995:{name:"DeviceSettingDescription",type:"Undefined"},41996:{name:"SubjectDistanceRange",type:"Short"},42016:{name:"ImageUniqueID",type:"Ascii"},42032:{name:"CameraOwnerName",type:"Ascii"},42033:{name:"BodySerialNumber",type:"Ascii"},42034:{name:"LensSpecification",type:"Rational"},42035:{name:"LensMake",type:"Ascii"},42036:{name:"LensModel",type:"Ascii"},42037:{name:"LensSerialNumber",type:"Ascii"},42240:{name:"Gamma",type:"Rational"}},GPS:{0:{name:"GPSVersionID",type:"Byte"},1:{name:"GPSLatitudeRef",type:"Ascii"},2:{name:"GPSLatitude",type:"Rational"},3:{name:"GPSLongitudeRef",type:"Ascii"},4:{name:"GPSLongitude",type:"Rational"},5:{name:"GPSAltitudeRef",type:"Byte"},6:{name:"GPSAltitude",type:"Rational"},7:{name:"GPSTimeStamp",type:"Rational"},8:{name:"GPSSatellites",type:"Ascii"},9:{name:"GPSStatus",type:"Ascii"},10:{name:"GPSMeasureMode",type:"Ascii"},11:{name:"GPSDOP",type:"Rational"},12:{name:"GPSSpeedRef",type:"Ascii"},13:{name:"GPSSpeed",type:"Rational"},14:{name:"GPSTrackRef",type:"Ascii"},15:{name:"GPSTrack",type:"Rational"},16:{name:"GPSImgDirectionRef",type:"Ascii"},17:{name:"GPSImgDirection",type:"Rational"},18:{name:"GPSMapDatum",type:"Ascii"},19:{name:"GPSDestLatitudeRef",type:"Ascii"},20:{name:"GPSDestLatitude",type:"Rational"},21:{name:"GPSDestLongitudeRef",type:"Ascii"},22:{name:"GPSDestLongitude",type:"Rational"},23:{name:"GPSDestBearingRef",type:"Ascii"},24:{name:"GPSDestBearing",type:"Rational"},25:{name:"GPSDestDistanceRef",type:"Ascii"},26:{name:"GPSDestDistance",type:"Rational"},27:{name:"GPSProcessingMethod",type:"Undefined"},28:{name:"GPSAreaInformation",type:"Undefined"},29:{name:"GPSDateStamp",type:"Ascii"},30:{name:"GPSDifferential",type:"Short"},31:{name:"GPSHPositioningError",type:"Rational"}},Interop:{1:{name:"InteroperabilityIndex",type:"Ascii"}}};g["0th"]=g.Image,g["1st"]=g.Image,r.TAGS=g,r.ImageIFD={ProcessingSoftware:11,NewSubfileType:254,SubfileType:255,ImageWidth:256,ImageLength:257,BitsPerSample:258,Compression:259,PhotometricInterpretation:262,Threshholding:263,CellWidth:264,CellLength:265,FillOrder:266,DocumentName:269,ImageDescription:270,Make:271,Model:272,StripOffsets:273,Orientation:274,SamplesPerPixel:277,RowsPerStrip:278,StripByteCounts:279,XResolution:282,YResolution:283,PlanarConfiguration:284,GrayResponseUnit:290,GrayResponseCurve:291,T4Options:292,T6Options:293,ResolutionUnit:296,TransferFunction:301,Software:305,DateTime:306,Artist:315,HostComputer:316,Predictor:317,WhitePoint:318,PrimaryChromaticities:319,ColorMap:320,HalftoneHints:321,TileWidth:322,TileLength:323,TileOffsets:324,TileByteCounts:325,SubIFDs:330,InkSet:332,InkNames:333,NumberOfInks:334,DotRange:336,TargetPrinter:337,ExtraSamples:338,SampleFormat:339,SMinSampleValue:340,SMaxSampleValue:341,TransferRange:342,ClipPath:343,XClipPathUnits:344,YClipPathUnits:345,Indexed:346,JPEGTables:347,OPIProxy:351,JPEGProc:512,JPEGInterchangeFormat:513,JPEGInterchangeFormatLength:514,JPEGRestartInterval:515,JPEGLosslessPredictors:517,JPEGPointTransforms:518,JPEGQTables:519,JPEGDCTables:520,JPEGACTables:521,YCbCrCoefficients:529,YCbCrSubSampling:530,YCbCrPositioning:531,ReferenceBlackWhite:532,XMLPacket:700,Rating:18246,RatingPercent:18249,ImageID:32781,CFARepeatPatternDim:33421,CFAPattern:33422,BatteryLevel:33423,Copyright:33432,ExposureTime:33434,ImageResources:34377,ExifTag:34665,InterColorProfile:34675,GPSTag:34853,Interlace:34857,TimeZoneOffset:34858,SelfTimerMode:34859,FlashEnergy:37387,SpatialFrequencyResponse:37388,Noise:37389,FocalPlaneXResolution:37390,FocalPlaneYResolution:37391,FocalPlaneResolutionUnit:37392,ImageNumber:37393,SecurityClassification:37394,ImageHistory:37395,ExposureIndex:37397,TIFFEPStandardID:37398,SensingMethod:37399,XPTitle:40091,XPComment:40092,XPAuthor:40093,XPKeywords:40094,XPSubject:40095,PrintImageMatching:50341,DNGVersion:50706,DNGBackwardVersion:50707,UniqueCameraModel:50708,LocalizedCameraModel:50709,CFAPlaneColor:50710,CFALayout:50711,LinearizationTable:50712,BlackLevelRepeatDim:50713,BlackLevel:50714,BlackLevelDeltaH:50715,BlackLevelDeltaV:50716,WhiteLevel:50717,DefaultScale:50718,DefaultCropOrigin:50719,DefaultCropSize:50720,ColorMatrix1:50721,ColorMatrix2:50722,CameraCalibration1:50723,CameraCalibration2:50724,ReductionMatrix1:50725,ReductionMatrix2:50726,AnalogBalance:50727,AsShotNeutral:50728,AsShotWhiteXY:50729,BaselineExposure:50730,BaselineNoise:50731,BaselineSharpness:50732,BayerGreenSplit:50733,LinearResponseLimit:50734,CameraSerialNumber:50735,LensInfo:50736,ChromaBlurRadius:50737,AntiAliasStrength:50738,ShadowScale:50739,DNGPrivateData:50740,MakerNoteSafety:50741,CalibrationIlluminant1:50778,CalibrationIlluminant2:50779,BestQualityScale:50780,RawDataUniqueID:50781,OriginalRawFileName:50827,OriginalRawFileData:50828,ActiveArea:50829,MaskedAreas:50830,AsShotICCProfile:50831,AsShotPreProfileMatrix:50832,CurrentICCProfile:50833,CurrentPreProfileMatrix:50834,ColorimetricReference:50879,CameraCalibrationSignature:50931,ProfileCalibrationSignature:50932,AsShotProfileName:50934,NoiseReductionApplied:50935,ProfileName:50936,ProfileHueSatMapDims:50937,ProfileHueSatMapData1:50938,ProfileHueSatMapData2:50939,ProfileToneCurve:50940,ProfileEmbedPolicy:50941,ProfileCopyright:50942,ForwardMatrix1:50964,ForwardMatrix2:50965,PreviewApplicationName:50966,PreviewApplicationVersion:50967,PreviewSettingsName:50968,PreviewSettingsDigest:50969,PreviewColorSpace:50970,PreviewDateTime:50971,RawImageDigest:50972,OriginalRawFileDigest:50973,SubTileBlockSize:50974,RowInterleaveFactor:50975,ProfileLookTableDims:50981,ProfileLookTableData:50982,OpcodeList1:51008,OpcodeList2:51009,OpcodeList3:51022,NoiseProfile:51041},r.ExifIFD={ExposureTime:33434,FNumber:33437,ExposureProgram:34850,SpectralSensitivity:34852,ISOSpeedRatings:34855,OECF:34856,SensitivityType:34864,StandardOutputSensitivity:34865,RecommendedExposureIndex:34866,ISOSpeed:34867,ISOSpeedLatitudeyyy:34868,ISOSpeedLatitudezzz:34869,ExifVersion:36864,DateTimeOriginal:36867,DateTimeDigitized:36868,ComponentsConfiguration:37121,CompressedBitsPerPixel:37122,ShutterSpeedValue:37377,ApertureValue:37378,BrightnessValue:37379,ExposureBiasValue:37380,MaxApertureValue:37381,SubjectDistance:37382,MeteringMode:37383,LightSource:37384,Flash:37385,FocalLength:37386,SubjectArea:37396,MakerNote:37500,UserComment:37510,SubSecTime:37520,SubSecTimeOriginal:37521,SubSecTimeDigitized:37522,FlashpixVersion:40960,ColorSpace:40961,PixelXDimension:40962,PixelYDimension:40963,RelatedSoundFile:40964,InteroperabilityTag:40965,FlashEnergy:41483,SpatialFrequencyResponse:41484,FocalPlaneXResolution:41486,FocalPlaneYResolution:41487,FocalPlaneResolutionUnit:41488,SubjectLocation:41492,ExposureIndex:41493,SensingMethod:41495,FileSource:41728,SceneType:41729,CFAPattern:41730,CustomRendered:41985,ExposureMode:41986,WhiteBalance:41987,DigitalZoomRatio:41988,FocalLengthIn35mmFilm:41989,SceneCaptureType:41990,GainControl:41991,Contrast:41992,Saturation:41993,Sharpness:41994,DeviceSettingDescription:41995,SubjectDistanceRange:41996,ImageUniqueID:42016,CameraOwnerName:42032,BodySerialNumber:42033,LensSpecification:42034,LensMake:42035,LensModel:42036,LensSerialNumber:42037,Gamma:42240},r.GPSIFD={GPSVersionID:0,GPSLatitudeRef:1,GPSLatitude:2,GPSLongitudeRef:3,GPSLongitude:4,GPSAltitudeRef:5,GPSAltitude:6,GPSTimeStamp:7,GPSSatellites:8,GPSStatus:9,GPSMeasureMode:10,GPSDOP:11,GPSSpeedRef:12,GPSSpeed:13,GPSTrackRef:14,GPSTrack:15,GPSImgDirectionRef:16,GPSImgDirection:17,GPSMapDatum:18,GPSDestLatitudeRef:19,GPSDestLatitude:20,GPSDestLongitudeRef:21,GPSDestLongitude:22,GPSDestBearingRef:23,GPSDestBearing:24,GPSDestDistanceRef:25,GPSDestDistance:26,GPSProcessingMethod:27,GPSAreaInformation:28,GPSDateStamp:29,GPSDifferential:30,GPSHPositioningError:31},r.InteropIFD={InteroperabilityIndex:1},r.GPSHelper={degToDmsRational:function(e){var t=Math.abs(e),r=t%1*60,n=r%1*60;return[[Math.floor(t),1],[Math.floor(r),1],[Math.round(100*n),100]]},dmsRationalToDeg:function(e,t){var r="S"===t||"W"===t?-1:1;return(e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600)*r}},e.exports&&(t=e.exports=r),t.piexif=r}()}));function Vq(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function zq(e,t){return e&t}function qq(e,t){return e|t}function Hq(e,t){return e^t}function Kq(e,t){return e&~t}function Wq(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function Gq(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var Qq,Xq="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Yq(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=Xq.charAt(r>>6)+Xq.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=Xq.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=Xq.charAt(r>>2)+Xq.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function $q(e){var t,r="",n=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var i=Xq.indexOf(e.charAt(t));i<0||(0==n?(r+=Vq(i>>2),o=3&i,n=1):1==n?(r+=Vq(o<<2|i>>4),o=15&i,n=2):2==n?(r+=Vq(o),r+=Vq(i>>2),o=3&i,n=3):(r+=Vq(o<<2|i>>4),r+=Vq(15&i),n=0))}return 1==n&&(r+=Vq(o<<2)),r}var Zq,Jq=function(e){var t;if(void 0===Qq){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(Qq={},t=0;t<16;++t)Qq[r.charAt(t)]=t;for(r=r.toLowerCase(),t=10;t<16;++t)Qq[r.charAt(t)]=t;for(t=0;t<n.length;++t)Qq[n.charAt(t)]=-1}var o=[],i=0,a=0;for(t=0;t<e.length;++t){var s=e.charAt(t);if("="==s)break;if(-1!=(s=Qq[s])){if(void 0===s)throw new Error("Illegal character at offset "+t);i|=s,++a>=2?(o[o.length]=i,i=0,a=0):i<<=4}}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return o},eH={decode:function(e){var t;if(void 0===Zq){var r="= \f\n\r\t \u2028\u2029";for(Zq=Object.create(null),t=0;t<64;++t)Zq["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(Zq["-"]=62,Zq._=63,t=0;t<r.length;++t)Zq[r.charAt(t)]=-1}var n=[],o=0,i=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=Zq[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);o|=a,++i>=4?(n[n.length]=o>>16,n[n.length]=o>>8&255,n[n.length]=255&o,o=0,i=0):o<<=6}}switch(i){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=o>>10;break;case 3:n[n.length]=o>>16,n[n.length]=o>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=eH.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return eH.decode(e)}},tH=1e13,rH=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var r,n,o=this.buf,i=o.length;for(r=0;r<i;++r)(n=o[r]*e+t)<tH?t=0:n-=(t=0|n/tH)*tH,o[r]=n;t>0&&(o[r]=t)},e.prototype.sub=function(e){var t,r,n=this.buf,o=n.length;for(t=0;t<o;++t)(r=n[t]-e)<0?(r+=tH,e=1):e=0,n[t]=r;for(;0===n[n.length-1];)n.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,r=t[t.length-1].toString(),n=t.length-2;n>=0;--n)r+=(tH+t[n]).toString().substring(1);return r},e.prototype.valueOf=function(){for(var e=this.buf,t=0,r=e.length-1;r>=0;--r)t=t*tH+e[r];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),nH=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,oH=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function iH(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var aH,sH=function(){function e(t,r){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=r)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,r){for(var n="",o=e;o<t;++o)if(n+=this.hexByte(this.get(o)),!0!==r)switch(15&o){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},e.prototype.isASCII=function(e,t){for(var r=e;r<t;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var r="",n=e;n<t;++n)r+=String.fromCharCode(this.get(n));return r},e.prototype.parseStringUTF=function(e,t){for(var r="",n=e;n<t;){var o=this.get(n++);r+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(n++)):String.fromCharCode((15&o)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},e.prototype.parseStringBMP=function(e,t){for(var r,n,o="",i=e;i<t;)r=this.get(i++),n=this.get(i++),o+=String.fromCharCode(r<<8|n);return o},e.prototype.parseTime=function(e,t,r){var n=this.parseStringISO(e,t),o=(r?nH:oH).exec(n);return o?(r&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),n=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(n+=":"+o[5],o[6]&&(n+=":"+o[6],o[7]&&(n+="."+o[7]))),o[8]&&(n+=" UTC","Z"!=o[8]&&(n+=o[8],o[9]&&(n+=":"+o[9]))),n):"Unrecognized time: "+n},e.prototype.parseInteger=function(e,t){for(var r,n=this.get(e),o=n>127,i=o?255:0,a="";n==i&&++e<t;)n=this.get(e);if(0==(r=t-e))return o?-1:0;if(r>4){for(a=n,r<<=3;0==(128&(+a^i));)a=+a<<1,--r;a="("+r+" bit)\n"}o&&(n-=256);for(var s=new rH(n),c=e+1;c<t;++c)s.mulAdd(256,this.get(c));return a+s.toString()},e.prototype.parseBitString=function(e,t,r){for(var n=this.get(e),o="("+((t-e-1<<3)-n)+" bit)\n",i="",a=e+1;a<t;++a){for(var s=this.get(a),c=a==t-1?n:0,u=7;u>=c;--u)i+=s>>u&1?"1":"0";if(i.length>r)return o+iH(i,r)}return o+i},e.prototype.parseOctetString=function(e,t,r){if(this.isASCII(e,t))return iH(this.parseStringISO(e,t),r);var n=t-e,o="("+n+" byte)\n";n>(r/=2)&&(t=e+r);for(var i=e;i<t;++i)o+=this.hexByte(this.get(i));return n>r&&(o+="…"),o},e.prototype.parseOID=function(e,t,r){for(var n="",o=new rH,i=0,a=e;a<t;++a){var s=this.get(a);if(o.mulAdd(128,127&s),i+=7,!(128&s)){if(""===n)if((o=o.simplify())instanceof rH)o.sub(80),n="2."+o.toString();else{var c=o<80?o<40?0:1:2;n=c+"."+(o-40*c)}else n+="."+o.toString();if(n.length>r)return iH(n,r);o=new rH,i=0}}return i>0&&(n+=".incomplete"),n},e}(),cH=function(){function e(e,t,r,n,o){if(!(n instanceof uH))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=r,this.tag=n,this.sub=o}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+r,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);case 6:return this.stream.parseOID(t,t+r,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return iH(this.stream.parseStringUTF(t,t+r),e);case 18:case 19:case 20:case 21:case 22:case 26:return iH(this.stream.parseStringISO(t,t+r),e);case 30:return iH(this.stream.parseStringBMP(t,t+r),e);case 23:case 24:return this.stream.parseTime(t,t+r,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var r=0,n=this.sub.length;r<n;++r)t+=this.sub[r].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),r=127&t;if(r==t)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===r)return null;t=0;for(var n=0;n<r;++n)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,r=2*this.length;return e.substr(t,r)},e.decode=function(t){var r;r=t instanceof sH?t:new sH(t,0);var n=new sH(r),o=new uH(r),i=e.decodeLength(r),a=r.pos,s=a-n.pos,c=null,u=function(){var t=[];if(null!==i){for(var n=a+i;r.pos<n;)t[t.length]=e.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var o=e.decode(r);if(o.tag.isEOC())break;t[t.length]=o}i=a-r.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(o.tagConstructed)c=u();else if(o.isUniversal()&&(3==o.tagNumber||4==o.tagNumber))try{if(3==o.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");c=u();for(var l=0;l<c.length;++l)if(c[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){c=null}if(null===c){if(null===i)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);r.pos=a+Math.abs(i)}return new e(n,s,i,o,c)},e}(),uH=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=0!=(32&t),this.tagNumber=31&t,31==this.tagNumber){var r=new rH;do{t=e.get(),r.mulAdd(128,127&t)}while(128&t);this.tagNumber=r.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),lH=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],dH=(1<<26)/lH[lH.length-1],fH=function(){function e(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,o=!1,i="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(r=this[a]>>s)>0&&(o=!0,i=Vq(r));a>=0;)s<t?(r=(this[a]&(1<<s)-1)<<t-s,r|=this[--a]>>(s+=this.DB-t)):(r=this[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(o=!0),o&&(i+=Vq(r));return o?i:"0"},e.prototype.negate=function(){var t=vH();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+EH(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var r=vH();return this.abs().divRemTo(t,null,r),this.s<0&&r.compareTo(e.ZERO)>0&&t.subTo(r,r),r},e.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new hH(t):new mH(t),this.exp(e,r)},e.prototype.clone=function(){var e=vH();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var r,n=this.DB-e*this.DB%8,o=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[o++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==o&&(128&this.s)!=(128&r)&&++o,(o>0||r!=this.s)&&(t[o++]=r);return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=vH();return this.bitwiseTo(e,zq,t),t},e.prototype.or=function(e){var t=vH();return this.bitwiseTo(e,qq,t),t},e.prototype.xor=function(e){var t=vH();return this.bitwiseTo(e,Hq,t),t},e.prototype.andNot=function(e){var t=vH();return this.bitwiseTo(e,Kq,t),t},e.prototype.not=function(){for(var e=vH(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=vH();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=vH();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+Wq(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Gq(this[r]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,qq)},e.prototype.clearBit=function(e){return this.changeBit(e,Kq)},e.prototype.flipBit=function(e){return this.changeBit(e,Hq)},e.prototype.add=function(e){var t=vH();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=vH();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=vH();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=vH();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=vH();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=vH(),r=vH();return this.divRemTo(e,t,r),[t,r]},e.prototype.modPow=function(e,t){var r,n,o=e.bitLength(),i=SH(1);if(o<=0)return i;r=o<18?1:o<48?3:o<144?4:o<768?5:6,n=o<8?new hH(t):t.isEven()?new gH(t):new mH(t);var a=[],s=3,c=r-1,u=(1<<r)-1;if(a[1]=n.convert(this),r>1){var l=vH();for(n.sqrTo(a[1],l);s<=u;)a[s]=vH(),n.mulTo(l,a[s-2],a[s]),s+=2}var d,f,p=e.t-1,h=!0,m=vH();for(o=EH(e[p])-1;p>=0;){for(o>=c?d=e[p]>>o-c&u:(d=(e[p]&(1<<o+1)-1)<<c-o,p>0&&(d|=e[p-1]>>this.DB+o-c)),s=r;0==(1&d);)d>>=1,--s;if((o-=s)<0&&(o+=this.DB,--p),h)a[d].copyTo(i),h=!1;else{for(;s>1;)n.sqrTo(i,m),n.sqrTo(m,i),s-=2;s>0?n.sqrTo(i,m):(f=i,i=m,m=f),n.mulTo(m,a[d],i)}for(;p>=0&&0==(e[p]&1<<o);)n.sqrTo(i,m),f=i,i=m,m=f,--o<0&&(o=this.DB-1,--p)}return n.revert(i)},e.prototype.modInverse=function(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return e.ZERO;for(var n=t.clone(),o=this.clone(),i=SH(1),a=SH(0),s=SH(0),c=SH(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;o.isEven();)o.rShiftTo(1,o),r?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(t,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(t,c),c.rShiftTo(1,c);n.compareTo(o)>=0?(n.subTo(o,n),r&&i.subTo(s,i),a.subTo(c,a)):(o.subTo(n,o),r&&s.subTo(i,s),c.subTo(a,c))}return 0!=o.compareTo(e.ONE)?e.ZERO:c.compareTo(t)>=0?c.subtract(t):c.signum()<0?(c.addTo(t,c),c.signum()<0?c.add(t):c):c},e.prototype.pow=function(e){return this.exp(e,new pH)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},e.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=lH[lH.length-1]){for(t=0;t<lH.length;++t)if(r[0]==lH[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<lH.length;){for(var n=lH[t],o=t+1;o<lH.length&&n<dH;)n*=lH[o++];for(n=r.modInt(n);t<o;)if(n%lH[t++]==0)return!1}return r.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var o=t.length,i=!1,a=0;--o>=0;){var s=8==n?255&+t[o]:BH(t,o);s<0?"-"==t.charAt(o)&&(i=!0):(i=!1,0==a?this[this.t++]=s:a+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,(a+=n)>=this.DB&&(a-=this.DB))}8==n&&0!=(128&+t[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var r=e%this.DB,n=this.DB-r,o=(1<<n)-1,i=Math.floor(e/this.DB),a=this.s<<r&this.DM,s=this.t-1;s>=0;--s)t[s+i+1]=this[s]>>n|a,a=(this[s]&o)<<r;for(s=i-1;s>=0;--s)t[s]=0;t[i]=a,t.t=this.t+i+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,o=this.DB-n,i=(1<<n)-1;t[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)t[a-r-1]|=(this[a]&i)<<o,t[a-r]=this[a]>>n;n>0&&(t[this.t-r-1]|=(this.s&i)<<o),t.t=this.t-r,t.clamp()}},e.prototype.subTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},e.prototype.multiplyTo=function(t,r){var n=this.abs(),o=t.abs(),i=n.t;for(r.t=i+o.t;--i>=0;)r[i]=0;for(i=0;i<o.t;++i)r[i+n.t]=n.am(0,o[i],r,i,0,n.t);r.s=0,r.clamp(),this.s!=t.s&&e.ZERO.subTo(r,r)},e.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,r,n){var o=t.abs();if(!(o.t<=0)){var i=this.abs();if(i.t<o.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=vH());var a=vH(),s=this.s,c=t.s,u=this.DB-EH(o[o.t-1]);u>0?(o.lShiftTo(u,a),i.lShiftTo(u,n)):(o.copyTo(a),i.copyTo(n));var l=a.t,d=a[l-1];if(0!=d){var f=d*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0),p=this.FV/f,h=(1<<this.F1)/f,m=1<<this.F2,g=n.t,v=g-l,y=null==r?vH():r;for(a.dlShiftTo(v,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),e.ONE.dlShiftTo(l,y),y.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--v>=0;){var b=n[--g]==d?this.DM:Math.floor(n[g]*p+(n[g-1]+m)*h);if((n[g]+=a.am(0,b,n,v,0,l))<b)for(a.dlShiftTo(v,y),n.subTo(y,n);n[g]<--b;)n.subTo(y,n)}null!=r&&(n.drShiftTo(l,r),s!=c&&e.ZERO.subTo(r,r)),n.t=l,n.clamp(),u>0&&n.rShiftTo(u,n),s<0&&e.ZERO.subTo(n,n)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,r){if(t>4294967295||t<1)return e.ONE;var n=vH(),o=vH(),i=r.convert(this),a=EH(t)-1;for(i.copyTo(n);--a>=0;)if(r.sqrTo(n,o),(t&1<<a)>0)r.mulTo(o,i,n);else{var s=n;n=o,o=s}return r.revert(n)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=SH(r),o=vH(),i=vH(),a="";for(this.divRemTo(n,o,i);o.signum()>0;)a=(r+i.intValue()).toString(e).substr(1)+a,o.divRemTo(n,o,i);return i.intValue().toString(e)+a},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),o=Math.pow(r,n),i=!1,a=0,s=0,c=0;c<t.length;++c){var u=BH(t,c);u<0?"-"==t.charAt(c)&&0==this.signum()&&(i=!0):(s=r*s+u,++a>=n&&(this.dMultiply(o),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(r,a)),this.dAddOffset(s,0)),i&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,n){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),qq,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var o=[],i=7&t;o.length=1+(t>>3),r.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},e.prototype.bitwiseTo=function(e,t,r){var n,o,i=Math.min(e.t,this.t);for(n=0;n<i;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=i;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},e.prototype.changeBit=function(t,r){var n=e.ONE.shiftLeft(t);return this.bitwiseTo(n,r,n),n},e.prototype.addTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var o=r.t-this.t;n<o;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(o=Math.min(e.t,t);n<o;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()},e.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},e.prototype.millerRabin=function(t){var r=this.subtract(e.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var o=r.shiftRight(n);(t=t+1>>1)>lH.length&&(t=lH.length);for(var i=vH(),a=0;a<t;++a){i.fromInt(lH[Math.floor(Math.random()*lH.length)]);var s=i.modPow(o,this);if(0!=s.compareTo(e.ONE)&&0!=s.compareTo(r)){for(var c=1;c++<n&&0!=s.compareTo(r);)if(0==(s=s.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=s.compareTo(r))return!1}}return!0},e.prototype.square=function(){var e=vH();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var r=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(r.compareTo(n)<0){var o=r;r=n,n=o}var i=r.getLowestSetBit(),a=n.getLowestSetBit();if(a<0)t(r);else{i<a&&(a=i),a>0&&(r.rShiftTo(a,r),n.rShiftTo(a,n));setTimeout((function e(){(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(e,0):(a>0&&n.lShiftTo(a,n),setTimeout((function(){t(n)}),0))}),10)}},e.prototype.fromNumberAsync=function(t,r,n,o){if("number"==typeof r)if(t<2)this.fromInt(1);else{this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),qq,this),this.isEven()&&this.dAddOffset(1,0);var i=this;setTimeout((function n(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(e.ONE.shiftLeft(t-1),i),i.isProbablePrime(r)?setTimeout((function(){o()}),0):setTimeout(n,0)}),0)}else{var a=[],s=7&t;a.length=1+(t>>3),r.nextBytes(a),s>0?a[0]&=(1<<s)-1:a[0]=0,this.fromString(a,256)}},e}(),pH=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),hH=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),mH=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=vH();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(fH.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=vH();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),gH=function(){function e(e){this.m=e,this.r2=vH(),this.q3=vH(),fH.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=vH();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function vH(){return new fH(null)}function yH(e,t){return new fH(e,t)}var bH="undefined"!=typeof navigator;bH&&"Microsoft Internet Explorer"==navigator.appName?(fH.prototype.am=function(e,t,r,n,o,i){for(var a=32767&t,s=t>>15;--i>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;o=((c=a*c+((32767&l)<<15)+r[n]+(1073741823&o))>>>30)+(l>>>15)+s*u+(o>>>30),r[n++]=1073741823&c}return o},aH=30):bH&&"Netscape"!=navigator.appName?(fH.prototype.am=function(e,t,r,n,o,i){for(;--i>=0;){var a=t*this[e++]+r[n]+o;o=Math.floor(a/67108864),r[n++]=67108863&a}return o},aH=26):(fH.prototype.am=function(e,t,r,n,o,i){for(var a=16383&t,s=t>>14;--i>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;o=((c=a*c+((16383&l)<<14)+r[n]+o)>>28)+(l>>14)+s*u,r[n++]=268435455&c}return o},aH=28),fH.prototype.DB=aH,fH.prototype.DM=(1<<aH)-1,fH.prototype.DV=1<<aH,fH.prototype.FV=Math.pow(2,52),fH.prototype.F1=52-aH,fH.prototype.F2=2*aH-52;var wH,kH,CH=[];for(wH="0".charCodeAt(0),kH=0;kH<=9;++kH)CH[wH++]=kH;for(wH="a".charCodeAt(0),kH=10;kH<36;++kH)CH[wH++]=kH;for(wH="A".charCodeAt(0),kH=10;kH<36;++kH)CH[wH++]=kH;function BH(e,t){var r=CH[e.charCodeAt(t)];return null==r?-1:r}function SH(e){var t=vH();return t.fromInt(e),t}function EH(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}fH.ZERO=SH(0),fH.ONE=SH(1);var _H,xH,TH=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}(),AH=null;if(null==AH){AH=[],xH=0;var PH=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var IH=new Uint32Array(256);for(window.crypto.getRandomValues(IH),PH=0;PH<IH.length;++PH)AH[xH++]=255&IH[PH]}var RH=0,OH=function e(t){if((RH=RH||0)>=256||xH>=256)window.removeEventListener?window.removeEventListener("mousemove",e,!1):window.detachEvent&&window.detachEvent("onmousemove",e);else try{var r=t.x+t.y;AH[xH++]=255&r,RH+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",OH,!1):window.attachEvent&&window.attachEvent("onmousemove",OH))}function NH(){if(null==_H){for(_H=new TH;xH<256;){var e=Math.floor(65536*Math.random());AH[xH++]=255&e}for(_H.init(AH),xH=0;xH<AH.length;++xH)AH[xH]=0;xH=0}return _H.next()}var DH=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=NH()},e}(),MH=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=yH(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=this.n.bitLength()+7>>3,r=function(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=e.length-1;n>=0&&t>0;){var o=e.charCodeAt(n--);o<128?r[--t]=o:o>127&&o<2048?(r[--t]=63&o|128,r[--t]=o>>6|192):(r[--t]=63&o|128,r[--t]=o>>6&63|128,r[--t]=o>>12|224)}r[--t]=0;for(var i=new DH,a=[];t>2;){for(a[0]=0;0==a[0];)i.nextBytes(a);r[--t]=a[0]}return r[--t]=2,r[--t]=0,new fH(r)}(e,t);if(null==r)return null;var n=this.doPublic(r);if(null==n)return null;for(var o=n.toString(16),i=o.length,a=0;a<2*t-i;a++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,r){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=yH(e,16),this.e=parseInt(t,16),this.d=yH(r,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,r,n,o,i,a,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=yH(e,16),this.e=parseInt(t,16),this.d=yH(r,16),this.p=yH(n,16),this.q=yH(o,16),this.dmp1=yH(i,16),this.dmq1=yH(a,16),this.coeff=yH(s,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var r=new DH,n=e>>1;this.e=parseInt(t,16);for(var o=new fH(t,16);;){for(;this.p=new fH(e-n,1,r),0!=this.p.subtract(fH.ONE).gcd(o).compareTo(fH.ONE)||!this.p.isProbablePrime(10););for(;this.q=new fH(n,1,r),0!=this.q.subtract(fH.ONE).gcd(o).compareTo(fH.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var i=this.p;this.p=this.q,this.q=i}var a=this.p.subtract(fH.ONE),s=this.q.subtract(fH.ONE),c=a.multiply(s);if(0==c.gcd(o).compareTo(fH.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(c),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=yH(e,16),r=this.doPrivate(t);return null==r?null:function(e,t){for(var r=e.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=t-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var o="";++n<r.length;){var i=255&r[n];i<128?o+=String.fromCharCode(i):i>191&&i<224?(o+=String.fromCharCode((31&i)<<6|63&r[n+1]),++n):(o+=String.fromCharCode((15&i)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return o}(r,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,r){var n=new DH,o=e>>1;this.e=parseInt(t,16);var i=new fH(t,16),a=this;setTimeout((function t(){var s=function(){if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var n=a.p.subtract(fH.ONE),o=a.q.subtract(fH.ONE),s=n.multiply(o);0==s.gcd(i).compareTo(fH.ONE)?(a.n=a.p.multiply(a.q),a.d=i.modInverse(s),a.dmp1=a.d.mod(n),a.dmq1=a.d.mod(o),a.coeff=a.q.modInverse(a.p),setTimeout((function(){r()}),0)):setTimeout(t,0)},c=function e(){a.q=vH(),a.q.fromNumberAsync(o,1,n,(function(){a.q.subtract(fH.ONE).gcda(i,(function(t){0==t.compareTo(fH.ONE)&&a.q.isProbablePrime(10)?setTimeout(s,0):setTimeout(e,0)}))}))};setTimeout((function t(){a.p=vH(),a.p.fromNumberAsync(e-o,1,n,(function(){a.p.subtract(fH.ONE).gcda(i,(function(e){0==e.compareTo(fH.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(t,0)}))}))}),0)}),0)},e.prototype.sign=function(e,t,r){var n=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var r=t-e.length-6,n="",o=0;o<r;o+=2)n+="ff";return yH("0001"+n+"00"+e,16)}((LH[r]||"")+t(e).toString(),this.n.bitLength()/4);if(null==n)return null;var o=this.doPrivate(n);if(null==o)return null;var i=o.toString(16);return 0==(1&i.length)?i:"0"+i},e.prototype.verify=function(e,t,r){var n=yH(t,16),o=this.doPublic(n);return null==o?null:function(e){for(var t in LH)if(LH.hasOwnProperty(t)){var r=LH[t],n=r.length;if(e.substr(0,n)==r)return e.substr(n)}return e}
46
46
  /*!
47
47
  Copyright (c) 2011, Yahoo! Inc. All rights reserved.
48
48
  Code licensed under the BSD License:
@@ -57,7 +57,7 @@ function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=o.create([0,1,2,
57
57
  * @since jsrsasign 2.1
58
58
  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
59
59
  */
60
- var jH={};void 0!==jH.asn1&&jH.asn1||(jH.asn1={}),jH.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",o=0;o<r;o++)n+="f";t=new fH(n,16).xor(e).add(fH.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=jH.asn1,r=t.DERBoolean,n=t.DERInteger,o=t.DERBitString,i=t.DEROctetString,a=t.DERNull,s=t.DERObjectIdentifier,c=t.DEREnumerated,u=t.DERUTF8String,l=t.DERNumericString,d=t.DERPrintableString,f=t.DERTeletexString,p=t.DERIA5String,h=t.DERUTCTime,m=t.DERGeneralizedTime,g=t.DERSequence,v=t.DERSet,y=t.DERTaggedObject,b=t.ASN1Util.newObject,w=Object.keys(e);if(1!=w.length)throw"key of param shall be only one.";var k=w[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+k+":"))throw"undefined key: "+k;if("bool"==k)return new r(e[k]);if("int"==k)return new n(e[k]);if("bitstr"==k)return new o(e[k]);if("octstr"==k)return new i(e[k]);if("null"==k)return new a(e[k]);if("oid"==k)return new s(e[k]);if("enum"==k)return new c(e[k]);if("utf8str"==k)return new u(e[k]);if("numstr"==k)return new l(e[k]);if("prnstr"==k)return new d(e[k]);if("telstr"==k)return new f(e[k]);if("ia5str"==k)return new p(e[k]);if("utctime"==k)return new h(e[k]);if("gentime"==k)return new m(e[k]);if("seq"==k){for(var C=e[k],B=[],S=0;S<C.length;S++){var E=b(C[S]);B.push(E)}return new g({array:B})}if("set"==k){for(C=e[k],B=[],S=0;S<C.length;S++)E=b(C[S]),B.push(E);return new v({array:B})}if("tag"==k){var _=e[k];if("[object Array]"===Object.prototype.toString.call(_)&&3==_.length){var x=b(_[2]);return new y({tag:_[0],explicit:_[1],obj:x})}var T={};if(void 0!==_.explicit&&(T.explicit=_.explicit),void 0!==_.tag&&(T.tag=_.tag),void 0===_.obj)throw"obj shall be specified for 'tag'.";return T.obj=b(_.obj),new y(T)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},jH.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),o=2;o<e.length;o+=2){var i=("00000000"+parseInt(e.substr(o,2),16).toString(2)).slice(-8);n+=i.substr(1,7),"0"==i.substr(0,1)&&(t=t+"."+new fH(n,2).toString(10),n="")}return t},jH.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new fH(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);return n},jH.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},jH.asn1.DERAbstractString=function(e){jH.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},UH.lang.extend(jH.asn1.DERAbstractString,jH.asn1.ASN1Object),jH.asn1.DERAbstractTime=function(e){jH.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,r){var n=this.zeroPadding,o=this.localDateToUTC(e),i=String(o.getFullYear());"utc"==t&&(i=i.substr(2,2));var a=i+n(String(o.getMonth()+1),2)+n(String(o.getDate()),2)+n(String(o.getHours()),2)+n(String(o.getMinutes()),2)+n(String(o.getSeconds()),2);if(!0===r){var s=o.getMilliseconds();if(0!=s){var c=n(String(s),3);a=a+"."+(c=c.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,r,n,o,i){var a=new Date(Date.UTC(e,t-1,r,n,o,i,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},UH.lang.extend(jH.asn1.DERAbstractTime,jH.asn1.ASN1Object),jH.asn1.DERAbstractStructured=function(e){jH.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},UH.lang.extend(jH.asn1.DERAbstractStructured,jH.asn1.ASN1Object),jH.asn1.DERBoolean=function(){jH.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},UH.lang.extend(jH.asn1.DERBoolean,jH.asn1.ASN1Object),jH.asn1.DERInteger=function(e){jH.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=jH.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new fH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},UH.lang.extend(jH.asn1.DERInteger,jH.asn1.ASN1Object),jH.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=jH.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}jH.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var o=e.substr(r,8),i=parseInt(o,2).toString(16);1==i.length&&(i="0"+i),n+=i}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},UH.lang.extend(jH.asn1.DERBitString,jH.asn1.ASN1Object),jH.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=jH.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}jH.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},UH.lang.extend(jH.asn1.DEROctetString,jH.asn1.DERAbstractString),jH.asn1.DERNull=function(){jH.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},UH.lang.extend(jH.asn1.DERNull,jH.asn1.ASN1Object),jH.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new fH(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};jH.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var t=jH.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},UH.lang.extend(jH.asn1.DERObjectIdentifier,jH.asn1.ASN1Object),jH.asn1.DEREnumerated=function(e){jH.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=jH.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new fH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},UH.lang.extend(jH.asn1.DEREnumerated,jH.asn1.ASN1Object),jH.asn1.DERUTF8String=function(e){jH.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},UH.lang.extend(jH.asn1.DERUTF8String,jH.asn1.DERAbstractString),jH.asn1.DERNumericString=function(e){jH.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},UH.lang.extend(jH.asn1.DERNumericString,jH.asn1.DERAbstractString),jH.asn1.DERPrintableString=function(e){jH.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},UH.lang.extend(jH.asn1.DERPrintableString,jH.asn1.DERAbstractString),jH.asn1.DERTeletexString=function(e){jH.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},UH.lang.extend(jH.asn1.DERTeletexString,jH.asn1.DERAbstractString),jH.asn1.DERIA5String=function(e){jH.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},UH.lang.extend(jH.asn1.DERIA5String,jH.asn1.DERAbstractString),jH.asn1.DERUTCTime=function(e){jH.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},UH.lang.extend(jH.asn1.DERUTCTime,jH.asn1.DERAbstractTime),jH.asn1.DERGeneralizedTime=function(e){jH.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},UH.lang.extend(jH.asn1.DERGeneralizedTime,jH.asn1.DERAbstractTime),jH.asn1.DERSequence=function(e){jH.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},UH.lang.extend(jH.asn1.DERSequence,jH.asn1.DERAbstractStructured),jH.asn1.DERSet=function(e){jH.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},UH.lang.extend(jH.asn1.DERSet,jH.asn1.DERAbstractStructured),jH.asn1.DERTaggedObject=function(e){jH.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},UH.lang.extend(jH.asn1.DERTaggedObject,jH.asn1.ASN1Object);var FH,VH,zH,qH,HH=(FH=function(e,t){return(FH=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}FH(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),KH=function(e){function t(r){var n=e.call(this)||this;return r&&("string"==typeof r?n.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&n.parsePropertiesFrom(r)),n}return HH(t,e),t.prototype.parseKey=function(e){try{var t=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?Jq(e):eH.unarmor(e),o=cH.decode(n);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=yH(t,16),r=o.sub[2].getHexStringValue(),this.e=parseInt(r,16);var i=o.sub[3].getHexStringValue();this.d=yH(i,16);var a=o.sub[4].getHexStringValue();this.p=yH(a,16);var s=o.sub[5].getHexStringValue();this.q=yH(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=yH(c,16);var u=o.sub[7].getHexStringValue();this.dmq1=yH(u,16);var l=o.sub[8].getHexStringValue();this.coeff=yH(l,16)}else{if(2!==o.sub.length)return!1;if(o.sub[0].sub){var d=o.sub[1].sub[0];t=d.sub[0].getHexStringValue(),this.n=yH(t,16),r=d.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=o.sub[0].getHexStringValue(),this.n=yH(t,16),r=o.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new jH.asn1.DERInteger({int:0}),new jH.asn1.DERInteger({bigint:this.n}),new jH.asn1.DERInteger({int:this.e}),new jH.asn1.DERInteger({bigint:this.d}),new jH.asn1.DERInteger({bigint:this.p}),new jH.asn1.DERInteger({bigint:this.q}),new jH.asn1.DERInteger({bigint:this.dmp1}),new jH.asn1.DERInteger({bigint:this.dmq1}),new jH.asn1.DERInteger({bigint:this.coeff})]};return new jH.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return Yq(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new jH.asn1.DERSequence({array:[new jH.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new jH.asn1.DERNull]}),t=new jH.asn1.DERSequence({array:[new jH.asn1.DERInteger({bigint:this.n}),new jH.asn1.DERInteger({int:this.e})]}),r=new jH.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new jH.asn1.DERSequence({array:[e,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return Yq(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return(e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return(e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(MH),WH=function(){function e(e){void 0===e&&(e={}),e=e||{},this.default_key_size=e.default_key_size?parseInt(e.default_key_size,10):1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}return e.prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new KH(e)},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt($q(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return Yq(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,t,r){try{return Yq(this.getKey().sign(e,t,r))}catch(e){return!1}},e.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,$q(t),r)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new KH,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version="3.3.0",e}(),GH=function(e,t,r,n){if(!nL(e))return e;for(var o=-1,i=(t=Lj(t,e)).length,a=i-1,s=e;null!=s&&++o<i;){var c=jj(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var l=s[c];void 0===(u=n?n(l,c,s):void 0)&&(u=nL(l)?l:iU(t[o+1])?[]:{})}WL(s,c,u),s=s[c]}return e},QH=function(e,t,r){return null==e?e:GH(e,t,r)},XH=["-","-","-","-","-","B","E","G","I","N"," ","P","U","B","L","I","C"," ","K","E","Y","-","-","-","-","-","\n"," "," ","M","I","I","B","I","j","A","N","B","g","k","q","h","k","i","G","9","w","0","B","A","Q","E","F","A","A","O","C","A","Q","8","A","M","I","I","B","C","g","K","C","A","Q","E","A","z","7","v","7","a","s","x","M","n","j","L","3","/","j","G","E","d","M","3","T","\n"," "," ","j","0","h","X","b","h","r","/","m","N","2","B","m","j","/","Y","e","6","I","y","1","T","t","g","E","S","W","j","r","V","Y","Z","J","k","a","+","T","L","+","L","0","U","n","h","i","8","l","W","x","2","w","R","s","+","N","i","u","Y","f","g","+","B","U","b","\n"," "," ","s","e","y","L","j","G","B","q","N","t","z","x","H","Z","K","v","d","h","d","i","r","o","y","R","y","C","S","f","p","m","f","h","Q","C","P","s","K","q","/","y","k","1","m","A","e","/","9","1","W","Y","J","b","l","K","h","W","Y","q","W","0","2","I","G","/","\n"," "," ","g","h","r","z","0","b","i","Y","X","C","b","5","m","6","s","R","o","7","e","J","p","4","F","e","2","1","U","N","Q","W","O","o","y","V","2","M","9","o","+","n","G","l","0","P","+","V","A","I","z","q","Z","m","l","P","w","w","v","w","B","i","l","f","X","e","\n"," "," ","W","V","P","x","9","6","f","2","c","A","I","h","S","2","b","W","f","f","d","X","3","w","p","c","1","C","E","m","c","v","9","V","E","f","o","j","j","i","X","O","7","I","n","k","u","P","t","H","4","W","2","E","P","Z","0","8","C","z","3","+","e","Q","2","k","\n"," "," ","D","z","c","j","P","9","8","Q","T","p","u","w","2","E","X","C","S","1","w","s","k","Z","C","2","1","j","L","8","j","z","X","H","a","W","3","B","q","O","h","s","V","G","9","T","F","S","y","c","l","F","g","e","n","r","G","s","Z","i","t","h","l","l","K","/","\n"," "," ","t","Q","I","D","A","Q","A","B","\n"," "," ","-","-","-","-","-","E","N","D"," ","P","U","B","L","I","C"," ","K","E","Y","-","-","-","-","-"],YH={},$H={SELFIE:"selfie",ID_CARD:"id_card"},ZH=xq((function(){var e=new WH;return e.setPublicKey(XH.join("")),e}));VH=ZH();var JH=function(e){var t=e.gesture;return{capture_time:e.captureTime,type:t}},eK=function(e){var t=e.detectedCard,r=e.captureTime,n=e.vCam;return{capture_time:r,type:null==t?void 0:t.label,v_cam:n}},tK=function(){var e=uM(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return bM(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},e.abrupt("return",new Promise((function(e){var o=new TextEncoder,i=o.encode(t),a=o.encode(r);window.crypto.subtle.importKey("raw",a,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,i).then((function(t){e("".concat(qH,".").concat(n(t)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),rK=function(){var e=uM(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.mode,o=t.imageData,t.enableExifData){e.next=3;break}return e.abrupt("return",new Promise((function(e){return e(o.blob)})));case 3:return i=gM(gM({},YH),n===$H.SELFIE?JH(o):eK(o)),a=gM(gM({},i),{},{sensor_data:"sensor data exceed 64KB"}),null!=o&&null!==(r=o.type)&&void 0!==r&&r.includes("qr")&&(i={capture_time:null==o?void 0:o.captureTime,type:null==o?void 0:o.type,qr_string:null==o?void 0:o.result}),e.next=8,tK(JSON.stringify(a),zH);case 8:return s=e.sent,e.next=11,tK(JSON.stringify(i),zH);case 11:return c=e.sent,u=Fq.dump({Exif:pM({},Fq.ExifIFD.MakerNote,c)}),l=Fq.dump({Exif:pM({},Fq.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var t=new FileReader;t.onload=function(){var t=uM(regeneratorRuntime.mark((function t(r){var n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{n=Fq.insert(u,r.target.result)}catch(t){try{n=Fq.insert(l,r.target.result)}catch(t){e(o.blob)}}return t.next=3,fetch(n).then((function(e){return e.blob()}));case 3:i=t.sent,URL.revokeObjectURL(n),e(i);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),t.readAsDataURL(o.blob)})));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),nK=Object.freeze({__proto__:null,MODE:$H,initExifData:function(){YH={device_info:{device_brand_name:"".concat("none"===_F.mobileVendor?"null":_F.mobileVendor),device_model:"".concat("none"===_F.mobileModel?"null":_F.mobileModel),browser_version:"".concat(_F.browserName," ").concat(_F.browserVersion),browser_userAgent:"".concat(_F.getUA),os:_F.osName,os_version:_F.osVersion},sdk_version:"5.13.5",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,t){QH(YH,e,t)},preWriteExif:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mode,r=(e.motionData,e.orientationData,e.startTime),n=e.endTime;YH.user_action=gM({},t===$H.SELFIE?{start_selfie:r,end_selfie:n}:{start_id_card:r,end_id_card:n}),zH=SF().replace(/-/g,""),VH||(VH=ZH()),qH=$q(VH.encrypt(zH))},writeExif:rK}),oK="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",iK=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oK,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.342,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:368,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;lM(this,e),this.model_path=t,this.threshold=r,this.size=Math.round(n/2),this.enable_profiling=o,this.num_threads=i}var t,r;return fM(e,[{key:"load",value:(r=uM(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,e.next=3,Rq({modelUrl:this.model_path,options:{numThreads:this.num_threads,enableProfiling:this.enable_profiling}});case 3:this.model=e.sent,n=this.model.inputs[0],this.input_width=n.shape[1],this.input_height=n.shape[2],r.tidy((function(){var e=r.randomNormal([1,o.input_width,o.input_height,3]);o.model.predict(e)}));case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"crop_eyes",value:function(e,t){var r=this,n=window.tf,o=t[0].map((function(e){return Math.round(e)})),i=t[1].map((function(e){return Math.round(e)}));o[0]>i[0]&&(o=t[1].map((function(e){return Math.round(e)})),i=t[0].map((function(e){return Math.round(e)})));var a=Math.round((o[0]+i[0])/2),s=a-o[0],c=i[0]-a;s>=this.size&&(s=this.size),c>=this.size&&(c=this.size);var u=Math.max(o[0]-s,0),l=Math.max(o[1]-s,0),d=Math.max(i[0]-c,0),f=Math.max(i[1]-c,0);return n.tidy((function(){var t=e.slice([l,u,0],[2*s,2*s,3]),o=e.slice([f,d,0],[2*c,2*c,3]);return{l_img:t=n.expandDims(n.image.resizeBilinear(t,[r.input_width,r.input_height])),r_img:o=n.expandDims(n.image.resizeBilinear(o,[r.input_width,r.input_height]))}}))}},{key:"predict",value:(t=uM(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,s,c,u,l,d,f=this,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>2&&void 0!==p[2]?p[2]:this.threshold,o=window,i=o.tf,a=t.getContext("2d"),s=a.getImageData(0,0,t.height,t.width),c=i.tidy((function(){var e=i.browser.fromPixels(s),t=f.crop_eyes(e,r),o=t.l_img,a=t.r_img,c=f.model.predict(o).arraySync()[0],u=f.model.predict(a).arraySync()[0];return[c>n,u>n]})),u=yM(c,2),l=u[0],d=u[1],e.abrupt("return",{isEyeClose:l||d});case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}(),aK=function(){var e=uM(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!DeviceMotionEvent||"function"!=typeof DeviceMotionEvent.requestPermission){e.next=2;break}return e.abrupt("return",DeviceMotionEvent.requestPermission());case 2:return e.abrupt("return",new Promise((function(e){return e("granted")})));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function sK(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,r=void 0===t?100:t,n=_w.useRef([]),o=_w.useRef([]),i=(_w.useRef(!1),_w.useRef({})),a=_w.useCallback((function(e){var t=Date.now(),n=e.type;return!!(i.current[n]&&t-i.current[n]<r)||(i.current[n]=t,!1)}),[r]),s=_w.useCallback((function(e){a(e)||o.current.push({time:Date.now(),alpha:null==e?void 0:e.alpha,beta:null==e?void 0:e.beta,gamma:null==e?void 0:e.gamma})}),[a]),c=_w.useCallback((function(e){var t,r,o,i,s,c;a(e)||n.current.push({time:Date.now(),Accelerometer:{x:null==e||null===(t=e.acceleration)||void 0===t?void 0:t.x,y:null==e||null===(r=e.acceleration)||void 0===r?void 0:r.y,z:null==e||null===(o=e.acceleration)||void 0===o?void 0:o.z},Gyroscope:{z:null==e||null===(i=e.rotationRate)||void 0===i?void 0:i.alpha,x:null==e||null===(s=e.rotationRate)||void 0===s?void 0:s.beta,y:null==e||null===(c=e.rotationRate)||void 0===c?void 0:c.gamma}})}),[a]),u=_w.useCallback((function(){}),[c,s]),l=_w.useCallback((function(){}),[c,s]);return _w.useEffect((function(){return function(){l()}}),[l]),{motionData:n.current,orientationData:o.current,startMotion:u,stopMotion:l}}var cK=function(){return URL.createObjectURL(new Blob(['\'use strict\';(function(){function T(a,b){let c=[],d="";b=a.readBits([8,16,16][b]);for(let d=0;d<b;d++){let b=a.readBits(8);c.push(b)}try{d+=decodeURIComponent(c.map(a=>`%${("0"+a.toString(16)).substr(-2)}`).join(""))}catch(e){}return{bytes:c,text:d}}function U(a,b){a=new V(a);let c=9>=b?0:26>=b?1:2;for(b={text:"",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===t.Terminator)return b;if(d===t.ECI)0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(7)}):\n0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:r.ECI,assignmentNumber:-1});else if(d===t.Numeric){var e=a;d=[];for(var f="",g=e.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error("Invalid numeric value above 999");var k=Math.floor(h/100),n=Math.floor(h/10)%10;h%=10;d.push(48+k,48+n,48+h);f+=k.toString()+n.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);\nif(100<=g)throw Error("Invalid numeric value above 99");e=Math.floor(g/10);g%=10;d.push(48+e,48+g);f+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error("Invalid numeric value above 9");d.push(48+e);f+=e.toString()}d={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Numeric,text:d.text})}else if(d===t.Alphanumeric){e=a;d=[];f="";for(g=e.readBits([9,11,13][c]);2<=g;)n=e.readBits(11),k=Math.floor(n/45),n%=45,d.push(B[k].charCodeAt(0),B[n].charCodeAt(0)),\nf+=B[k]+B[n],g-=2;1===g&&(e=e.readBits(6),d.push(B[e].charCodeAt(0)),f+=B[e]);d={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Alphanumeric,text:d.text})}else if(d===t.Byte)d=T(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:r.Byte,bytes:d.bytes,text:d.text});else if(d===t.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder("shift-jis")).decode(Uint8Array.from(d));\nd={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Kanji,bytes:d.bytes,text:d.text})}else d===t.StructuredAppend&&b.chunks.push({type:r.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}function J(a,b){return a^b}function W(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let d=e;b=c;e=f;if(b.isZero())return null;\nc=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let d=c.degree()-b.degree(),e=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(d,e));c=c.addOrSubtract(b.multiplyByMonomial(d,e))}f=f.multiplyPoly(e).addOrSubtract(d);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);if(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}function X(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new Y(285,\n256,0);var d=new w(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new w(a,e);d=W(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;d=d[1];e=b.length;f=Array(e);for(g=0;g<e;g++){h=a.inverse(b[g]);let c=1;for(let d=\n0;d<e;d++)g!==d&&(c=a.multiply(c,J(1,a.multiply(b[d],h))));f[g]=a.multiply(d.evaluateAt(h),a.inverse(c));0!==a.generatorBase&&(f[g]=a.multiply(f[g],h))}d=f;for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}function E(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function C(a,b){return b<<1|a}function Z(a,b,c){c=aa[c.dataMask];let d=a.height;var e=17+4*b.versionNumber,f=A.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===\ng&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=f;g=[];e=h=0;f=!0;for(let k=d-1;0<k;k-=2){6===k&&k--;for(let n=0;n<d;n++){let m=f?d-1-n:n;for(let d=0;2>d;d++){let f=k-d;if(!b.get(f,m)){e++;let b=a.get(f,m);c({y:m,x:f})&&(b=!b);h=h<<1|b;8===e&&(g.push(h),h=e=0)}}}f=!f}return g}function ba(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return K[c-\n1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=C(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let c=b-9;c>=b-11;c--)d=C(a.get(e,c),d);a=Infinity;let f;for(let e of K){if(e.infoBits===c||e.infoBits===d)return e;b=E(c,e.infoBits);b<a&&(f=e,a=b);b=E(d,e.infoBits);b<a&&(f=e,a=b)}if(3>=a)return f}function ca(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=C(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=C(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=C(a.get(8,e),c);for(e=d-8;e<d;e++)c=C(a.get(e,\n8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of da){if(f===b||f===c)return g;e=E(b,f);e<a&&(d=g,a=e);b!==c&&(e=E(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}function ea(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(a=>{for(let b=0;b<a.numBlocks;b++)e.push({numDataCodewords:a.dataCodewordsPerBlock,codewords:[]}),f+=a.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());\nif(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let b of e)b.codewords.push(a.shift());return e}function L(a){let b=ba(a);if(!b)return null;var c=ca(a);if(!c)return null;a=Z(a,b,c);var d=ea(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((a,b)=>a+b.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let b of d){d=X(b.codewords,b.codewords.length-b.numDataCodewords);if(!d)return null;for(let e=\n0;e<b.numDataCodewords;e++)c[a++]=d[e]}try{return U(c,b.versionNumber)}catch(e){return null}}function M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};{let h=b.x-c.x;var g=d.x-c.x;let k=b.y-c.y,n=d.y-c.y;c=h*n-g*k;g=(e*n-g*f)/c;e=(h*f-e*k)/c;return{a11:b.x-a.x+g*b.x,a12:b.y-a.y+g*b.y,a13:g,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}}function fa(a,b,c,d){a=M(a,b,c,d);\nreturn{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}}function ha(a,b){var c=fa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+\nd.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,n=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,m=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,l=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,p=d.a13*c.a31+d.a23*c.a32+d.a33*c.a33;c=A.createEmpty(b.dimension,b.dimension);d=(a,b)=>{const c=g*a+n*b+p;return{x:(e*a+h*b+m)/c,y:(f*a+k*b+l)/c}};for(let e=0;e<b.dimension;e++)for(let f=0;f<b.dimension;f++){let b=d(f+.5,e+.5);c.set(f,e,a.get(Math.floor(b.x),\nMath.floor(b.y)))}return{matrix:c,mappingFunction:d}}function x(a){return a.reduce((a,c)=>a+c)}function ia(a,b,c){let d=y(a,b),e=y(b,c),f=y(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}function ja(a,b,c,d){d=(x(z(a,c,d,5))/7+x(z(a,b,d,5))/7+x(z(c,a,d,5))/7+x(z(b,a,d,5))/7)/4;if(1>d)throw Error("Invalid module size");b=Math.round(y(a,b)/d);a=Math.round(y(a,c)/d);a=\nMath.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}function N(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),n=Math.abs(b-h),m=Math.floor(-k/2),l=g<a?1:-1,p=h<b?1:-1,q=!0;for(let v=g,u=h;v!==a+l;v+=l){g=f?u:v;h=f?v:u;if(c.get(g,\nh)!==q&&(q=!q,e.push({x:g,y:h}),e.length===d+1))break;m+=n;if(0<m){if(u===b)break;u+=p;m-=k}}c=[];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(y(e[f],e[f+1])):c.push(0);return c}function z(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=N(a,b,c,Math.ceil(d/2));a=N(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function F(a,b){let c=x(a)/x(b),d=0;b.forEach((b,f)=>{d+=Math.pow(a[f]-b*c,2)});return{averageSize:c,error:d}}function O(a,b,c){try{let d=z(a,{x:-1,y:a.y},c,b.length),\ne=z(a,{x:a.x,y:-1},c,b.length),f=z(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=z(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=F(d,b),k=F(e,b),n=F(f,b),m=F(g,b),l=(h.averageSize+k.averageSize+n.averageSize+m.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+n.error*n.error+m.error*m.error)+(Math.pow(h.averageSize-l,2)+Math.pow(k.averageSize-l,2)+Math.pow(n.averageSize-l,2)+Math.pow(m.averageSize-l,2))/l}catch(d){return Infinity}}\nfunction H(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}function ka(a){var b=[],c=[];let d=[];var e=[];for(let m=0;m<=a.height;m++){var f=0,g=!1;let l=[0,0,0,0,0];for(let b=-1;b<=a.width;b++){var h=a.get(b,m);if(h===g)f++;else{l=[l[1],l[2],l[3],l[4],f];f=1;g=h;var k=x(l)/7;k=Math.abs(l[0]-k)<k&&Math.abs(l[1]-\nk)<k&&Math.abs(l[2]-3*k)<3*k&&Math.abs(l[3]-k)<k&&Math.abs(l[4]-k)<k&&!h;var n=x(l.slice(-3))/3;h=Math.abs(l[2]-n)<n&&Math.abs(l[3]-n)<n&&Math.abs(l[4]-n)<n&&h;if(k){let a=b-l[3]-l[4],d=a-l[2];k={startX:d,endX:a,y:m};n=c.filter(b=>d>=b.bottom.startX&&d<=b.bottom.endX||a>=b.bottom.startX&&d<=b.bottom.endX||d<=b.bottom.startX&&a>=b.bottom.endX&&1.5>l[2]/(b.bottom.endX-b.bottom.startX)&&.5<l[2]/(b.bottom.endX-b.bottom.startX));0<n.length?n[0].bottom=k:c.push({top:k,bottom:k})}if(h){let a=b-l[4],c=a-\nl[3];h={startX:c,y:m,endX:a};k=e.filter(b=>c>=b.bottom.startX&&c<=b.bottom.endX||a>=b.bottom.startX&&c<=b.bottom.endX||c<=b.bottom.startX&&a>=b.bottom.endX&&1.5>l[2]/(b.bottom.endX-b.bottom.startX)&&.5<l[2]/(b.bottom.endX-b.bottom.startX));0<k.length?k[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(a=>a.bottom.y!==m&&2<=a.bottom.y-a.top.y));c=c.filter(a=>a.bottom.y===m);d.push(...e.filter(a=>a.bottom.y!==m));e=e.filter(a=>a.bottom.y===m)}b.push(...c.filter(a=>2<=a.bottom.y-a.top.y));d.push(...e);\nc=[];for(var m of b)2>m.bottom.y-m.top.y||(b=(m.top.startX+m.top.endX+m.bottom.startX+m.bottom.endX)/4,e=(m.top.y+m.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[m.top.endX-m.top.startX,m.bottom.endX-m.bottom.startX,m.bottom.y-m.top.y+1],f=x(f)/f.length,g=O({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((a,b)=>a.score-b.score);m=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var l of c)l!==e&&f.push(Object.assign(Object.assign({},\nl),{score:l.score+Math.pow(l.size-e.size,2)/e.size}));f.sort((a,b)=>a.score-b.score);m.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}m.sort((a,b)=>a.score-b.score);let {topRight:p,topLeft:q,bottomLeft:v}=ia(...m[0].points);m=P(a,d,p,q,v);l=[];m&&l.push({alignmentPattern:{x:m.alignmentPattern.x,y:m.alignmentPattern.y},bottomLeft:{x:v.x,y:v.y},dimension:m.dimension,topLeft:{x:q.x,y:q.y},topRight:{x:p.x,y:p.y}});m=H(a,p);b=H(a,q);c=H(a,v);(a=P(a,d,m,b,c))&&l.push({alignmentPattern:{x:a.alignmentPattern.x,\ny:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:m.x,y:m.y},dimension:a.dimension});return 0===l.length?null:l}function P(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ja(d,c,e,a))}catch(m){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(y(d,e)+y(d,c))/2/g;e=1-3/c;let n={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(b=>{const c=(b.top.startX+b.top.endX+b.bottom.startX+b.bottom.endX)/4;b=(b.top.y+b.bottom.y+1)/2;if(a.get(Math.floor(c),Math.floor(b))){var d=O({x:Math.floor(c),\ny:Math.floor(b)},[1,1,1],a)+y({x:c,y:b},n);return{x:c,y:b,score:d}}}).filter(a=>!!a).sort((a,b)=>a.score-b.score);return{alignmentPattern:15<=c&&b.length?b[0]:n,dimension:f}}function Q(a){var b=ka(a);if(!b)return null;for(let e of b){b=ha(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let a=d+1;a<c.height;a++)c.get(d,a)!==c.get(a,d)&&(c.set(d,a,!c.get(d,a)),c.set(a,d,!c.get(a,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,\nlocation:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,e.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}function R(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}function I(a,b,c,d={}){let e=Object.create(null);R(e,la);R(e,d);\nd="onlyInvert"===e.inversionAttempts||"invertFirst"===e.inversionAttempts;var f="attemptBoth"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error("Malformed data passed to binarizer.");var n=0;if(h){var m=new Uint8ClampedArray(a.buffer,n,k);n+=k}m=new S(b,c,m);if(g.useIntegerApproximation)for(var l=0;l<c;l++)for(var p=0;p<b;p++){var q=4*(l*b+p);m.set(p,l,g.red*a[q]+g.green*a[q+1]+g.blue*a[q+2]+128>>8)}else for(l=0;l<c;l++)for(p=0;p<b;p++)q=4*\n(l*b+p),m.set(p,l,g.red*a[q]+g.green*a[q+1]+g.blue*a[q+2]);g=Math.ceil(b/8);l=Math.ceil(c/8);p=g*l;if(h){var v=new Uint8ClampedArray(a.buffer,n,p);n+=p}v=new S(g,l,v);for(p=0;p<l;p++)for(q=0;q<g;q++){var u=Infinity,r=0;for(var t=0;8>t;t++)for(let a=0;8>a;a++){let b=m.get(8*q+a,8*p+t);u=Math.min(u,b);r=Math.max(r,b)}t=(u+r)/2;t=Math.min(255,1.11*t);24>=r-u&&(t=u/2,0<p&&0<q&&(r=(v.get(q,p-1)+2*v.get(q-1,p)+v.get(q-1,p-1))/4,u<r&&(t=r)));v.set(q,p,t)}h?(p=new Uint8ClampedArray(a.buffer,n,k),n+=k,p=new A(p,\nb)):p=A.createEmpty(b,c);q=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,n,k),q=new A(a,b)):q=A.createEmpty(b,c));for(b=0;b<l;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=l-3;h=2>b?2:b>h?h:b;k=0;for(n=-2;2>=n;n++)for(u=-2;2>=u;u++)k+=v.get(c+n,h+u);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)n=8*a+h,u=8*b+k,r=m.get(n,u),p.set(n,u,r<=c),f&&q.set(n,u,!(r<=c))}f=f?{binarized:p,inverted:q}:{binarized:p};let {binarized:w,inverted:x}=f;(f=Q(d?x:w))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||\n(f=Q(d?w:x));return f}class A{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new A(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let b=a;b<a+c;b++)this.set(b,f,!!e)}}class S{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,\nb){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}class V{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,\na-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var r;(function(a){a.Numeric="numeric";a.Alphanumeric="alphanumeric";a.Byte="byte";a.Kanji="kanji";a.ECI="eci";a.StructuredAppend="structuredappend"})(r||(r={}));var t;(function(a){a[a.Terminator=0]="Terminator";a[a.Numeric=1]="Numeric";a[a.Alphanumeric=2]="Alphanumeric";a[a.Byte=4]="Byte";a[a.Kanji=8]="Kanji";a[a.ECI=7]="ECI";a[a.StructuredAppend=\n3]="StructuredAppend"})(t||(t={}));let B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");class w{constructor(a,b){if(0===b.length)throw Error("No coefficients.");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===\nthis.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;if(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new w(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);\nfor(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new w(this.field,c)}multiplyPoly(a){if(this.isZero()||a.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let h=0;h<c;h++){let c=b[h];for(let b=0;b<d;b++){var f=h+b,g=this.field.multiply(c,a[b]);e[f]=e[h+b]^g}}return new w(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error("Invalid degree less than 0");if(0===b)return this.field.zero;\nlet c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new w(this.field,a)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(a=>{b^=a}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=J(this.field.multiply(a,b),this.coefficients[d]);return b}}class Y{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);\nthis.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new w(this,Uint8ClampedArray.from([0]));this.one=new w(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===a)throw Error("Can\'t invert 0");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,\nb){if(0>a)throw Error("Invalid monomial degree less than 0");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new w(this,a)}log(a){if(0===a)throw Error("Can\'t take log(0)");return this.logTable[a]}exp(a){return this.expTable[a]}}let K=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,\necBlocks:[{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}]}]},\n{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,\ndataCodewordsPerBlock: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,\necBlocks:[{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}]},\n{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},\n{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},\n{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},\n{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,\ndataCodewordsPerBlock: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,\ndataCodewordsPerBlock: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}]},\n{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}]},\n{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},\n{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,\necBlocks:[{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}]},\n{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},\n{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,\necBlocks:[{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,\ndataCodewordsPerBlock: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,\ndataCodewordsPerBlock: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,\necBlocks:[{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,\necBlocks:[{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,\ndataCodewordsPerBlock: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,\necBlocks:[{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,\n32,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}]}]},\n{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},\n{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,\necBlocks:[{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,\ndataCodewordsPerBlock: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,\necBlocks:[{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},\n{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,\necBlocks:[{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}]},\n{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},\n{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,\necBlocks:[{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,\n30,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}]}]},\n{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,\ndataCodewordsPerBlock: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}]},\n{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,\ndataCodewordsPerBlock: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}]},\n{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,\ndataCodewordsPerBlock: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}]}]}],da=[{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,\ndataMask: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,\nformatInfo:{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,\ndataMask: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,\ndataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],aa=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2],y=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2)),la={inversionAttempts:"attemptBoth",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},\ncanOverwriteImage:!0};I.default=I;let G="dontInvert",D={red:77,green:150,blue:29,useIntegerApproximation:!0};self.onmessage=a=>{let b=a.data.data;switch(a.data.type){case "decode":a=I(b.data,b.width,b.height,{inversionAttempts:G,greyScaleWeights:D});self.postMessage({type:"qrResult",data:a?a.data:null});break;case "grayscaleWeights":D.red=b.red;D.green=b.green;D.blue=b.blue;D.useIntegerApproximation=b.useIntegerApproximation;break;case "inversionMode":switch(b){case "original":G="dontInvert";break;\ncase "invert":G="onlyInvert";break;case "both":G="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}})()\n\n']))},uK=function(e,t,r,n,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,i,a,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},lK=TF(),dK=function(){function e(t){var r=this,n=t.container,o=t.lang,i=void 0===o?"en":o,a=t.assetRoot,s=void 0===a?"https://unpkg.com/@tsocial/tvweb-sdk@latest/assets":a,c=t.resourceRoot,u=t.customUrls,l=void 0===u?{}:u,d=t.enableAntiDebug,f=void 0===d||d,p=t.warmupMessage,h=t.baseComponent,m=t.component,g=void 0===m?{}:m;lM(this,e),pM(this,"initNativeCamera",(function(e){var t=document.createElement("div");document.body.appendChild(t);var n=_w.createRef(),o=r.component.NativeCamera;return oM.render(_w.createElement(o,hM({},e,{ref:n})),t),{openCamera:function(){n.current.click()}}})),pM(this,"runWarmUpReadIDCard",uM(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.commonSettings.customUrls,e.abrupt("return",r.component.warmUpReadIdCard(t));case 2:case"end":return e.stop()}}),e)})))),pM(this,"runPreloadEKYCResources",uM(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=r.commonSettings.customUrls,r.component.preloadEKYCResources(t);case 2:case"end":return e.stop()}}),e)})))),pM(this,"destroyView",(function(){oM.unmountComponentAtNode(r.container)})),uK(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var v=lF({resourceRoot:c,initCustomUrls:l});this.commonSettings={lang:i,assetRoot:s,customUrls:v,enableAntiDebug:f,debug:!1,warmupMessage:p},this.component=gM(gM({},h),g)}return fM(e,[{key:"checkCamera",value:function(){return(0,this.component.checkCamera)()}},{key:"getListCamera",value:function(){return(0,this.component.getListCamera)()}},{key:"readIDCardWithApiCall",value:function(e){var t=this.component.ReadIDCardWithApiCall;oM.render(_w.createElement(fF,{value:gM({},this.commonSettings)},_w.createElement(t,hM({onClose:this.destroyView},e))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var t=this.component.ReadIDCardUIOnly;oM.render(_w.createElement(fF,{value:this.commonSettings},_w.createElement(t,hM({onClose:this.destroyView},e))),this.container)}},{key:"livenessDetection",value:function(e){var t=this.component.LivenessDetection;oM.render(_w.createElement(fF,{value:gM({},this.commonSettings)},_w.createElement(t,hM({onClose:this.destroyView},e))),this.container)}},{key:"compareFaces",value:function(e){var t=e.accessKey,r=e.secretKey,n=e.apiUrl,o=e.image1,i=e.image2,a=e.onSuccess,s=e.onError;oq(new vF(t,r,n,{httpHeaders:lK})).compareFaces({image1:{id:o},image2:{id:i}}).then((function(e){a(e)})).catch((function(e){s(e)}))}}]),e}();function fK(e){return(fK="function"==typeof Symbol&&"symbol"==Ey(Symbol.iterator)?function(e){return Ey(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Ey(e)})(e)}function pK(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function hK(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){pK(i,n,o,a,s,"next",e)}function s(e){pK(i,n,o,a,s,"throw",e)}a(void 0)}))}}function mK(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)}}function gK(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vK(){return(vK=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 yK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bK(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yK(Object(r),!0).forEach((function(t){gK(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yK(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wK(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function kK(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function CK(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}(e,t)||SK(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function BK(e){return function(e){if(Array.isArray(e))return EK(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||SK(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SK(e,t){if(e){if("string"==typeof e)return EK(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?EK(e,t):void 0}}function EK(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var _K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xK(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function TK(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var AK,PK=TK((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){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:{MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0},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),i=r(0),a=i.BROWSER_TYPES,s=i.OS_TYPES,c=i.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(),B=y.getUA(),S=a.CHROME,E=a.CHROMIUM,_=a.IE,x=a.INTERNET_EXPLORER,T=a.OPERA,A=a.FIREFOX,P=a.SAFARI,I=a.EDGE,R=a.YANDEX,O=a.MOBILE_SAFARI,N=c.MOBILE,D=c.TABLET,M=c.SMART_TV,L=c.BROWSER,U=c.WEARABLE,j=c.CONSOLE,F=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 B&&-1!==B.indexOf("Edg/")},W=function(){return b.name===I},G=function(){return v("iPad")},Q=w.type===M,X=w.type===j,Y=w.type===U,$=b.name===O||G(),Z=b.name===E,J=function(){switch(w.type){case N:case D:return!0;default:return!1}}()||G(),ee=w.type===N,te=w.type===D||G(),re=w.type===L,ne=C.name===F,oe=C.name===V,ie=C.name===z||G(),ae=b.name===S,se=b.name===A,ce=b.name===P||b.name===O,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=B,ke=W()||K(),Ce=b.name===R,Be=w.type,Se=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Ee=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(),Pe=W(),Ie=C.name===q,Re=C.name===H,Oe=l(w.type);e.exports={deviceDetect:function(){var e=Oe.isBrowser,t=Oe.isMobile,r=Oe.isTablet,n=Oe.isSmartTV,o=Oe.isConsole,i=Oe.isWearable;return e?d(e,b,k,C,B):n?m(n,k,C,B):o?h(o,k,C,B):t||r?f(Oe,w,C,B):i?p(i,k,C,B):void 0},isSmartTV:Q,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ie,isChrome:ae,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:Be,isIOS13:Se,isIPad13:Ee,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Pe,isWindows:Ie,isMacOs:Re}},function(e,t,r){var n;
60
+ var jH={};void 0!==jH.asn1&&jH.asn1||(jH.asn1={}),jH.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",o=0;o<r;o++)n+="f";t=new fH(n,16).xor(e).add(fH.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=jH.asn1,r=t.DERBoolean,n=t.DERInteger,o=t.DERBitString,i=t.DEROctetString,a=t.DERNull,s=t.DERObjectIdentifier,c=t.DEREnumerated,u=t.DERUTF8String,l=t.DERNumericString,d=t.DERPrintableString,f=t.DERTeletexString,p=t.DERIA5String,h=t.DERUTCTime,m=t.DERGeneralizedTime,g=t.DERSequence,v=t.DERSet,y=t.DERTaggedObject,b=t.ASN1Util.newObject,w=Object.keys(e);if(1!=w.length)throw"key of param shall be only one.";var k=w[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+k+":"))throw"undefined key: "+k;if("bool"==k)return new r(e[k]);if("int"==k)return new n(e[k]);if("bitstr"==k)return new o(e[k]);if("octstr"==k)return new i(e[k]);if("null"==k)return new a(e[k]);if("oid"==k)return new s(e[k]);if("enum"==k)return new c(e[k]);if("utf8str"==k)return new u(e[k]);if("numstr"==k)return new l(e[k]);if("prnstr"==k)return new d(e[k]);if("telstr"==k)return new f(e[k]);if("ia5str"==k)return new p(e[k]);if("utctime"==k)return new h(e[k]);if("gentime"==k)return new m(e[k]);if("seq"==k){for(var C=e[k],B=[],S=0;S<C.length;S++){var E=b(C[S]);B.push(E)}return new g({array:B})}if("set"==k){for(C=e[k],B=[],S=0;S<C.length;S++)E=b(C[S]),B.push(E);return new v({array:B})}if("tag"==k){var _=e[k];if("[object Array]"===Object.prototype.toString.call(_)&&3==_.length){var x=b(_[2]);return new y({tag:_[0],explicit:_[1],obj:x})}var T={};if(void 0!==_.explicit&&(T.explicit=_.explicit),void 0!==_.tag&&(T.tag=_.tag),void 0===_.obj)throw"obj shall be specified for 'tag'.";return T.obj=b(_.obj),new y(T)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},jH.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),o=2;o<e.length;o+=2){var i=("00000000"+parseInt(e.substr(o,2),16).toString(2)).slice(-8);n+=i.substr(1,7),"0"==i.substr(0,1)&&(t=t+"."+new fH(n,2).toString(10),n="")}return t},jH.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new fH(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);return n},jH.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},jH.asn1.DERAbstractString=function(e){jH.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},UH.lang.extend(jH.asn1.DERAbstractString,jH.asn1.ASN1Object),jH.asn1.DERAbstractTime=function(e){jH.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,r){var n=this.zeroPadding,o=this.localDateToUTC(e),i=String(o.getFullYear());"utc"==t&&(i=i.substr(2,2));var a=i+n(String(o.getMonth()+1),2)+n(String(o.getDate()),2)+n(String(o.getHours()),2)+n(String(o.getMinutes()),2)+n(String(o.getSeconds()),2);if(!0===r){var s=o.getMilliseconds();if(0!=s){var c=n(String(s),3);a=a+"."+(c=c.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,r,n,o,i){var a=new Date(Date.UTC(e,t-1,r,n,o,i,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},UH.lang.extend(jH.asn1.DERAbstractTime,jH.asn1.ASN1Object),jH.asn1.DERAbstractStructured=function(e){jH.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},UH.lang.extend(jH.asn1.DERAbstractStructured,jH.asn1.ASN1Object),jH.asn1.DERBoolean=function(){jH.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},UH.lang.extend(jH.asn1.DERBoolean,jH.asn1.ASN1Object),jH.asn1.DERInteger=function(e){jH.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=jH.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new fH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},UH.lang.extend(jH.asn1.DERInteger,jH.asn1.ASN1Object),jH.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=jH.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}jH.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var o=e.substr(r,8),i=parseInt(o,2).toString(16);1==i.length&&(i="0"+i),n+=i}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},UH.lang.extend(jH.asn1.DERBitString,jH.asn1.ASN1Object),jH.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=jH.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}jH.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},UH.lang.extend(jH.asn1.DEROctetString,jH.asn1.DERAbstractString),jH.asn1.DERNull=function(){jH.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},UH.lang.extend(jH.asn1.DERNull,jH.asn1.ASN1Object),jH.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new fH(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};jH.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var t=jH.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},UH.lang.extend(jH.asn1.DERObjectIdentifier,jH.asn1.ASN1Object),jH.asn1.DEREnumerated=function(e){jH.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=jH.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new fH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},UH.lang.extend(jH.asn1.DEREnumerated,jH.asn1.ASN1Object),jH.asn1.DERUTF8String=function(e){jH.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},UH.lang.extend(jH.asn1.DERUTF8String,jH.asn1.DERAbstractString),jH.asn1.DERNumericString=function(e){jH.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},UH.lang.extend(jH.asn1.DERNumericString,jH.asn1.DERAbstractString),jH.asn1.DERPrintableString=function(e){jH.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},UH.lang.extend(jH.asn1.DERPrintableString,jH.asn1.DERAbstractString),jH.asn1.DERTeletexString=function(e){jH.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},UH.lang.extend(jH.asn1.DERTeletexString,jH.asn1.DERAbstractString),jH.asn1.DERIA5String=function(e){jH.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},UH.lang.extend(jH.asn1.DERIA5String,jH.asn1.DERAbstractString),jH.asn1.DERUTCTime=function(e){jH.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},UH.lang.extend(jH.asn1.DERUTCTime,jH.asn1.DERAbstractTime),jH.asn1.DERGeneralizedTime=function(e){jH.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},UH.lang.extend(jH.asn1.DERGeneralizedTime,jH.asn1.DERAbstractTime),jH.asn1.DERSequence=function(e){jH.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},UH.lang.extend(jH.asn1.DERSequence,jH.asn1.DERAbstractStructured),jH.asn1.DERSet=function(e){jH.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},UH.lang.extend(jH.asn1.DERSet,jH.asn1.DERAbstractStructured),jH.asn1.DERTaggedObject=function(e){jH.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},UH.lang.extend(jH.asn1.DERTaggedObject,jH.asn1.ASN1Object);var FH,VH,zH,qH,HH=(FH=function(e,t){return(FH=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}FH(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),KH=function(e){function t(r){var n=e.call(this)||this;return r&&("string"==typeof r?n.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&n.parsePropertiesFrom(r)),n}return HH(t,e),t.prototype.parseKey=function(e){try{var t=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?Jq(e):eH.unarmor(e),o=cH.decode(n);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=yH(t,16),r=o.sub[2].getHexStringValue(),this.e=parseInt(r,16);var i=o.sub[3].getHexStringValue();this.d=yH(i,16);var a=o.sub[4].getHexStringValue();this.p=yH(a,16);var s=o.sub[5].getHexStringValue();this.q=yH(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=yH(c,16);var u=o.sub[7].getHexStringValue();this.dmq1=yH(u,16);var l=o.sub[8].getHexStringValue();this.coeff=yH(l,16)}else{if(2!==o.sub.length)return!1;if(o.sub[0].sub){var d=o.sub[1].sub[0];t=d.sub[0].getHexStringValue(),this.n=yH(t,16),r=d.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=o.sub[0].getHexStringValue(),this.n=yH(t,16),r=o.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new jH.asn1.DERInteger({int:0}),new jH.asn1.DERInteger({bigint:this.n}),new jH.asn1.DERInteger({int:this.e}),new jH.asn1.DERInteger({bigint:this.d}),new jH.asn1.DERInteger({bigint:this.p}),new jH.asn1.DERInteger({bigint:this.q}),new jH.asn1.DERInteger({bigint:this.dmp1}),new jH.asn1.DERInteger({bigint:this.dmq1}),new jH.asn1.DERInteger({bigint:this.coeff})]};return new jH.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return Yq(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new jH.asn1.DERSequence({array:[new jH.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new jH.asn1.DERNull]}),t=new jH.asn1.DERSequence({array:[new jH.asn1.DERInteger({bigint:this.n}),new jH.asn1.DERInteger({int:this.e})]}),r=new jH.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new jH.asn1.DERSequence({array:[e,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return Yq(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return(e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return(e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(MH),WH=function(){function e(e){void 0===e&&(e={}),e=e||{},this.default_key_size=e.default_key_size?parseInt(e.default_key_size,10):1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}return e.prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new KH(e)},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt($q(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return Yq(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,t,r){try{return Yq(this.getKey().sign(e,t,r))}catch(e){return!1}},e.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,$q(t),r)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new KH,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version="3.3.0",e}(),GH=function(e,t,r,n){if(!nL(e))return e;for(var o=-1,i=(t=Lj(t,e)).length,a=i-1,s=e;null!=s&&++o<i;){var c=jj(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var l=s[c];void 0===(u=n?n(l,c,s):void 0)&&(u=nL(l)?l:iU(t[o+1])?[]:{})}WL(s,c,u),s=s[c]}return e},QH=function(e,t,r){return null==e?e:GH(e,t,r)},XH=["-","-","-","-","-","B","E","G","I","N"," ","P","U","B","L","I","C"," ","K","E","Y","-","-","-","-","-","\n"," "," ","M","I","I","B","I","j","A","N","B","g","k","q","h","k","i","G","9","w","0","B","A","Q","E","F","A","A","O","C","A","Q","8","A","M","I","I","B","C","g","K","C","A","Q","E","A","z","7","v","7","a","s","x","M","n","j","L","3","/","j","G","E","d","M","3","T","\n"," "," ","j","0","h","X","b","h","r","/","m","N","2","B","m","j","/","Y","e","6","I","y","1","T","t","g","E","S","W","j","r","V","Y","Z","J","k","a","+","T","L","+","L","0","U","n","h","i","8","l","W","x","2","w","R","s","+","N","i","u","Y","f","g","+","B","U","b","\n"," "," ","s","e","y","L","j","G","B","q","N","t","z","x","H","Z","K","v","d","h","d","i","r","o","y","R","y","C","S","f","p","m","f","h","Q","C","P","s","K","q","/","y","k","1","m","A","e","/","9","1","W","Y","J","b","l","K","h","W","Y","q","W","0","2","I","G","/","\n"," "," ","g","h","r","z","0","b","i","Y","X","C","b","5","m","6","s","R","o","7","e","J","p","4","F","e","2","1","U","N","Q","W","O","o","y","V","2","M","9","o","+","n","G","l","0","P","+","V","A","I","z","q","Z","m","l","P","w","w","v","w","B","i","l","f","X","e","\n"," "," ","W","V","P","x","9","6","f","2","c","A","I","h","S","2","b","W","f","f","d","X","3","w","p","c","1","C","E","m","c","v","9","V","E","f","o","j","j","i","X","O","7","I","n","k","u","P","t","H","4","W","2","E","P","Z","0","8","C","z","3","+","e","Q","2","k","\n"," "," ","D","z","c","j","P","9","8","Q","T","p","u","w","2","E","X","C","S","1","w","s","k","Z","C","2","1","j","L","8","j","z","X","H","a","W","3","B","q","O","h","s","V","G","9","T","F","S","y","c","l","F","g","e","n","r","G","s","Z","i","t","h","l","l","K","/","\n"," "," ","t","Q","I","D","A","Q","A","B","\n"," "," ","-","-","-","-","-","E","N","D"," ","P","U","B","L","I","C"," ","K","E","Y","-","-","-","-","-"],YH={},$H={SELFIE:"selfie",ID_CARD:"id_card"},ZH=xq((function(){var e=new WH;return e.setPublicKey(XH.join("")),e}));VH=ZH();var JH=function(e){var t=e.gesture;return{capture_time:e.captureTime,type:t}},eK=function(e){var t=e.detectedCard,r=e.captureTime,n=e.vCam;return{capture_time:r,type:null==t?void 0:t.label,v_cam:n}},tK=function(){var e=uM(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return bM(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},e.abrupt("return",new Promise((function(e){var o=new TextEncoder,i=o.encode(t),a=o.encode(r);window.crypto.subtle.importKey("raw",a,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,i).then((function(t){e("".concat(qH,".").concat(n(t)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),rK=function(){var e=uM(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.mode,o=t.imageData,t.enableExifData){e.next=3;break}return e.abrupt("return",new Promise((function(e){return e(o.blob)})));case 3:return i=gM(gM({},YH),n===$H.SELFIE?JH(o):eK(o)),a=gM(gM({},i),{},{sensor_data:"sensor data exceed 64KB"}),null!=o&&null!==(r=o.type)&&void 0!==r&&r.includes("qr")&&(i={capture_time:null==o?void 0:o.captureTime,type:null==o?void 0:o.type,qr_string:null==o?void 0:o.result}),e.next=8,tK(JSON.stringify(a),zH);case 8:return s=e.sent,e.next=11,tK(JSON.stringify(i),zH);case 11:return c=e.sent,u=Fq.dump({Exif:pM({},Fq.ExifIFD.MakerNote,c)}),l=Fq.dump({Exif:pM({},Fq.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var t=new FileReader;t.onload=function(){var t=uM(regeneratorRuntime.mark((function t(r){var n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{n=Fq.insert(u,r.target.result)}catch(t){try{n=Fq.insert(l,r.target.result)}catch(t){e(o.blob)}}return t.next=3,fetch(n).then((function(e){return e.blob()}));case 3:i=t.sent,URL.revokeObjectURL(n),e(i);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),t.readAsDataURL(o.blob)})));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),nK=Object.freeze({__proto__:null,MODE:$H,initExifData:function(){YH={device_info:{device_brand_name:"".concat("none"===_F.mobileVendor?"null":_F.mobileVendor),device_model:"".concat("none"===_F.mobileModel?"null":_F.mobileModel),browser_version:"".concat(_F.browserName," ").concat(_F.browserVersion),browser_userAgent:"".concat(_F.getUA),os:_F.osName,os_version:_F.osVersion},sdk_version:"5.13.7",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,t){QH(YH,e,t)},preWriteExif:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mode,r=(e.motionData,e.orientationData,e.startTime),n=e.endTime;YH.user_action=gM({},t===$H.SELFIE?{start_selfie:r,end_selfie:n}:{start_id_card:r,end_id_card:n}),zH=SF().replace(/-/g,""),VH||(VH=ZH()),qH=$q(VH.encrypt(zH))},writeExif:rK}),oK="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",iK=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oK,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.342,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:368,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;lM(this,e),this.model_path=t,this.threshold=r,this.size=Math.round(n/2),this.enable_profiling=o,this.num_threads=i}var t,r;return fM(e,[{key:"load",value:(r=uM(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,e.next=3,Rq({modelUrl:this.model_path,options:{numThreads:this.num_threads,enableProfiling:this.enable_profiling}});case 3:this.model=e.sent,n=this.model.inputs[0],this.input_width=n.shape[1],this.input_height=n.shape[2],r.tidy((function(){var e=r.randomNormal([1,o.input_width,o.input_height,3]);o.model.predict(e)}));case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"crop_eyes",value:function(e,t){var r=this,n=window.tf,o=t[0].map((function(e){return Math.round(e)})),i=t[1].map((function(e){return Math.round(e)}));o[0]>i[0]&&(o=t[1].map((function(e){return Math.round(e)})),i=t[0].map((function(e){return Math.round(e)})));var a=Math.round((o[0]+i[0])/2),s=a-o[0],c=i[0]-a;s>=this.size&&(s=this.size),c>=this.size&&(c=this.size);var u=Math.max(o[0]-s,0),l=Math.max(o[1]-s,0),d=Math.max(i[0]-c,0),f=Math.max(i[1]-c,0);return n.tidy((function(){var t=e.slice([l,u,0],[2*s,2*s,3]),o=e.slice([f,d,0],[2*c,2*c,3]);return{l_img:t=n.expandDims(n.image.resizeBilinear(t,[r.input_width,r.input_height])),r_img:o=n.expandDims(n.image.resizeBilinear(o,[r.input_width,r.input_height]))}}))}},{key:"predict",value:(t=uM(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,s,c,u,l,d,f=this,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>2&&void 0!==p[2]?p[2]:this.threshold,o=window,i=o.tf,a=t.getContext("2d"),s=a.getImageData(0,0,t.height,t.width),c=i.tidy((function(){var e=i.browser.fromPixels(s),t=f.crop_eyes(e,r),o=t.l_img,a=t.r_img,c=f.model.predict(o).arraySync()[0],u=f.model.predict(a).arraySync()[0];return[c>n,u>n]})),u=yM(c,2),l=u[0],d=u[1],e.abrupt("return",{isEyeClose:l||d});case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}(),aK=function(){var e=uM(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!DeviceMotionEvent||"function"!=typeof DeviceMotionEvent.requestPermission){e.next=2;break}return e.abrupt("return",DeviceMotionEvent.requestPermission());case 2:return e.abrupt("return",new Promise((function(e){return e("granted")})));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function sK(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,r=void 0===t?100:t,n=_w.useRef([]),o=_w.useRef([]),i=(_w.useRef(!1),_w.useRef({})),a=_w.useCallback((function(e){var t=Date.now(),n=e.type;return!!(i.current[n]&&t-i.current[n]<r)||(i.current[n]=t,!1)}),[r]),s=_w.useCallback((function(e){a(e)||o.current.push({time:Date.now(),alpha:null==e?void 0:e.alpha,beta:null==e?void 0:e.beta,gamma:null==e?void 0:e.gamma})}),[a]),c=_w.useCallback((function(e){var t,r,o,i,s,c;a(e)||n.current.push({time:Date.now(),Accelerometer:{x:null==e||null===(t=e.acceleration)||void 0===t?void 0:t.x,y:null==e||null===(r=e.acceleration)||void 0===r?void 0:r.y,z:null==e||null===(o=e.acceleration)||void 0===o?void 0:o.z},Gyroscope:{z:null==e||null===(i=e.rotationRate)||void 0===i?void 0:i.alpha,x:null==e||null===(s=e.rotationRate)||void 0===s?void 0:s.beta,y:null==e||null===(c=e.rotationRate)||void 0===c?void 0:c.gamma}})}),[a]),u=_w.useCallback((function(){}),[c,s]),l=_w.useCallback((function(){}),[c,s]);return _w.useEffect((function(){return function(){l()}}),[l]),{motionData:n.current,orientationData:o.current,startMotion:u,stopMotion:l}}var cK=function(){return URL.createObjectURL(new Blob(['\'use strict\';(function(){function T(a,b){let c=[],d="";b=a.readBits([8,16,16][b]);for(let d=0;d<b;d++){let b=a.readBits(8);c.push(b)}try{d+=decodeURIComponent(c.map(a=>`%${("0"+a.toString(16)).substr(-2)}`).join(""))}catch(e){}return{bytes:c,text:d}}function U(a,b){a=new V(a);let c=9>=b?0:26>=b?1:2;for(b={text:"",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===t.Terminator)return b;if(d===t.ECI)0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(7)}):\n0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:r.ECI,assignmentNumber:-1});else if(d===t.Numeric){var e=a;d=[];for(var f="",g=e.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error("Invalid numeric value above 999");var k=Math.floor(h/100),n=Math.floor(h/10)%10;h%=10;d.push(48+k,48+n,48+h);f+=k.toString()+n.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);\nif(100<=g)throw Error("Invalid numeric value above 99");e=Math.floor(g/10);g%=10;d.push(48+e,48+g);f+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error("Invalid numeric value above 9");d.push(48+e);f+=e.toString()}d={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Numeric,text:d.text})}else if(d===t.Alphanumeric){e=a;d=[];f="";for(g=e.readBits([9,11,13][c]);2<=g;)n=e.readBits(11),k=Math.floor(n/45),n%=45,d.push(B[k].charCodeAt(0),B[n].charCodeAt(0)),\nf+=B[k]+B[n],g-=2;1===g&&(e=e.readBits(6),d.push(B[e].charCodeAt(0)),f+=B[e]);d={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Alphanumeric,text:d.text})}else if(d===t.Byte)d=T(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:r.Byte,bytes:d.bytes,text:d.text});else if(d===t.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder("shift-jis")).decode(Uint8Array.from(d));\nd={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Kanji,bytes:d.bytes,text:d.text})}else d===t.StructuredAppend&&b.chunks.push({type:r.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}function J(a,b){return a^b}function W(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let d=e;b=c;e=f;if(b.isZero())return null;\nc=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let d=c.degree()-b.degree(),e=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(d,e));c=c.addOrSubtract(b.multiplyByMonomial(d,e))}f=f.multiplyPoly(e).addOrSubtract(d);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);if(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}function X(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new Y(285,\n256,0);var d=new w(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new w(a,e);d=W(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;d=d[1];e=b.length;f=Array(e);for(g=0;g<e;g++){h=a.inverse(b[g]);let c=1;for(let d=\n0;d<e;d++)g!==d&&(c=a.multiply(c,J(1,a.multiply(b[d],h))));f[g]=a.multiply(d.evaluateAt(h),a.inverse(c));0!==a.generatorBase&&(f[g]=a.multiply(f[g],h))}d=f;for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}function E(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function C(a,b){return b<<1|a}function Z(a,b,c){c=aa[c.dataMask];let d=a.height;var e=17+4*b.versionNumber,f=A.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===\ng&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=f;g=[];e=h=0;f=!0;for(let k=d-1;0<k;k-=2){6===k&&k--;for(let n=0;n<d;n++){let m=f?d-1-n:n;for(let d=0;2>d;d++){let f=k-d;if(!b.get(f,m)){e++;let b=a.get(f,m);c({y:m,x:f})&&(b=!b);h=h<<1|b;8===e&&(g.push(h),h=e=0)}}}f=!f}return g}function ba(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return K[c-\n1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=C(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let c=b-9;c>=b-11;c--)d=C(a.get(e,c),d);a=Infinity;let f;for(let e of K){if(e.infoBits===c||e.infoBits===d)return e;b=E(c,e.infoBits);b<a&&(f=e,a=b);b=E(d,e.infoBits);b<a&&(f=e,a=b)}if(3>=a)return f}function ca(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=C(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=C(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=C(a.get(8,e),c);for(e=d-8;e<d;e++)c=C(a.get(e,\n8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of da){if(f===b||f===c)return g;e=E(b,f);e<a&&(d=g,a=e);b!==c&&(e=E(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}function ea(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(a=>{for(let b=0;b<a.numBlocks;b++)e.push({numDataCodewords:a.dataCodewordsPerBlock,codewords:[]}),f+=a.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());\nif(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let b of e)b.codewords.push(a.shift());return e}function L(a){let b=ba(a);if(!b)return null;var c=ca(a);if(!c)return null;a=Z(a,b,c);var d=ea(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((a,b)=>a+b.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let b of d){d=X(b.codewords,b.codewords.length-b.numDataCodewords);if(!d)return null;for(let e=\n0;e<b.numDataCodewords;e++)c[a++]=d[e]}try{return U(c,b.versionNumber)}catch(e){return null}}function M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};{let h=b.x-c.x;var g=d.x-c.x;let k=b.y-c.y,n=d.y-c.y;c=h*n-g*k;g=(e*n-g*f)/c;e=(h*f-e*k)/c;return{a11:b.x-a.x+g*b.x,a12:b.y-a.y+g*b.y,a13:g,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}}function fa(a,b,c,d){a=M(a,b,c,d);\nreturn{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}}function ha(a,b){var c=fa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+\nd.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,n=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,m=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,l=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,p=d.a13*c.a31+d.a23*c.a32+d.a33*c.a33;c=A.createEmpty(b.dimension,b.dimension);d=(a,b)=>{const c=g*a+n*b+p;return{x:(e*a+h*b+m)/c,y:(f*a+k*b+l)/c}};for(let e=0;e<b.dimension;e++)for(let f=0;f<b.dimension;f++){let b=d(f+.5,e+.5);c.set(f,e,a.get(Math.floor(b.x),\nMath.floor(b.y)))}return{matrix:c,mappingFunction:d}}function x(a){return a.reduce((a,c)=>a+c)}function ia(a,b,c){let d=y(a,b),e=y(b,c),f=y(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}function ja(a,b,c,d){d=(x(z(a,c,d,5))/7+x(z(a,b,d,5))/7+x(z(c,a,d,5))/7+x(z(b,a,d,5))/7)/4;if(1>d)throw Error("Invalid module size");b=Math.round(y(a,b)/d);a=Math.round(y(a,c)/d);a=\nMath.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}function N(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),n=Math.abs(b-h),m=Math.floor(-k/2),l=g<a?1:-1,p=h<b?1:-1,q=!0;for(let v=g,u=h;v!==a+l;v+=l){g=f?u:v;h=f?v:u;if(c.get(g,\nh)!==q&&(q=!q,e.push({x:g,y:h}),e.length===d+1))break;m+=n;if(0<m){if(u===b)break;u+=p;m-=k}}c=[];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(y(e[f],e[f+1])):c.push(0);return c}function z(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=N(a,b,c,Math.ceil(d/2));a=N(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function F(a,b){let c=x(a)/x(b),d=0;b.forEach((b,f)=>{d+=Math.pow(a[f]-b*c,2)});return{averageSize:c,error:d}}function O(a,b,c){try{let d=z(a,{x:-1,y:a.y},c,b.length),\ne=z(a,{x:a.x,y:-1},c,b.length),f=z(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=z(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=F(d,b),k=F(e,b),n=F(f,b),m=F(g,b),l=(h.averageSize+k.averageSize+n.averageSize+m.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+n.error*n.error+m.error*m.error)+(Math.pow(h.averageSize-l,2)+Math.pow(k.averageSize-l,2)+Math.pow(n.averageSize-l,2)+Math.pow(m.averageSize-l,2))/l}catch(d){return Infinity}}\nfunction H(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}function ka(a){var b=[],c=[];let d=[];var e=[];for(let m=0;m<=a.height;m++){var f=0,g=!1;let l=[0,0,0,0,0];for(let b=-1;b<=a.width;b++){var h=a.get(b,m);if(h===g)f++;else{l=[l[1],l[2],l[3],l[4],f];f=1;g=h;var k=x(l)/7;k=Math.abs(l[0]-k)<k&&Math.abs(l[1]-\nk)<k&&Math.abs(l[2]-3*k)<3*k&&Math.abs(l[3]-k)<k&&Math.abs(l[4]-k)<k&&!h;var n=x(l.slice(-3))/3;h=Math.abs(l[2]-n)<n&&Math.abs(l[3]-n)<n&&Math.abs(l[4]-n)<n&&h;if(k){let a=b-l[3]-l[4],d=a-l[2];k={startX:d,endX:a,y:m};n=c.filter(b=>d>=b.bottom.startX&&d<=b.bottom.endX||a>=b.bottom.startX&&d<=b.bottom.endX||d<=b.bottom.startX&&a>=b.bottom.endX&&1.5>l[2]/(b.bottom.endX-b.bottom.startX)&&.5<l[2]/(b.bottom.endX-b.bottom.startX));0<n.length?n[0].bottom=k:c.push({top:k,bottom:k})}if(h){let a=b-l[4],c=a-\nl[3];h={startX:c,y:m,endX:a};k=e.filter(b=>c>=b.bottom.startX&&c<=b.bottom.endX||a>=b.bottom.startX&&c<=b.bottom.endX||c<=b.bottom.startX&&a>=b.bottom.endX&&1.5>l[2]/(b.bottom.endX-b.bottom.startX)&&.5<l[2]/(b.bottom.endX-b.bottom.startX));0<k.length?k[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(a=>a.bottom.y!==m&&2<=a.bottom.y-a.top.y));c=c.filter(a=>a.bottom.y===m);d.push(...e.filter(a=>a.bottom.y!==m));e=e.filter(a=>a.bottom.y===m)}b.push(...c.filter(a=>2<=a.bottom.y-a.top.y));d.push(...e);\nc=[];for(var m of b)2>m.bottom.y-m.top.y||(b=(m.top.startX+m.top.endX+m.bottom.startX+m.bottom.endX)/4,e=(m.top.y+m.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[m.top.endX-m.top.startX,m.bottom.endX-m.bottom.startX,m.bottom.y-m.top.y+1],f=x(f)/f.length,g=O({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((a,b)=>a.score-b.score);m=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var l of c)l!==e&&f.push(Object.assign(Object.assign({},\nl),{score:l.score+Math.pow(l.size-e.size,2)/e.size}));f.sort((a,b)=>a.score-b.score);m.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}m.sort((a,b)=>a.score-b.score);let {topRight:p,topLeft:q,bottomLeft:v}=ia(...m[0].points);m=P(a,d,p,q,v);l=[];m&&l.push({alignmentPattern:{x:m.alignmentPattern.x,y:m.alignmentPattern.y},bottomLeft:{x:v.x,y:v.y},dimension:m.dimension,topLeft:{x:q.x,y:q.y},topRight:{x:p.x,y:p.y}});m=H(a,p);b=H(a,q);c=H(a,v);(a=P(a,d,m,b,c))&&l.push({alignmentPattern:{x:a.alignmentPattern.x,\ny:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:m.x,y:m.y},dimension:a.dimension});return 0===l.length?null:l}function P(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ja(d,c,e,a))}catch(m){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(y(d,e)+y(d,c))/2/g;e=1-3/c;let n={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(b=>{const c=(b.top.startX+b.top.endX+b.bottom.startX+b.bottom.endX)/4;b=(b.top.y+b.bottom.y+1)/2;if(a.get(Math.floor(c),Math.floor(b))){var d=O({x:Math.floor(c),\ny:Math.floor(b)},[1,1,1],a)+y({x:c,y:b},n);return{x:c,y:b,score:d}}}).filter(a=>!!a).sort((a,b)=>a.score-b.score);return{alignmentPattern:15<=c&&b.length?b[0]:n,dimension:f}}function Q(a){var b=ka(a);if(!b)return null;for(let e of b){b=ha(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let a=d+1;a<c.height;a++)c.get(d,a)!==c.get(a,d)&&(c.set(d,a,!c.get(d,a)),c.set(a,d,!c.get(a,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,\nlocation:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,e.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}function R(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}function I(a,b,c,d={}){let e=Object.create(null);R(e,la);R(e,d);\nd="onlyInvert"===e.inversionAttempts||"invertFirst"===e.inversionAttempts;var f="attemptBoth"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error("Malformed data passed to binarizer.");var n=0;if(h){var m=new Uint8ClampedArray(a.buffer,n,k);n+=k}m=new S(b,c,m);if(g.useIntegerApproximation)for(var l=0;l<c;l++)for(var p=0;p<b;p++){var q=4*(l*b+p);m.set(p,l,g.red*a[q]+g.green*a[q+1]+g.blue*a[q+2]+128>>8)}else for(l=0;l<c;l++)for(p=0;p<b;p++)q=4*\n(l*b+p),m.set(p,l,g.red*a[q]+g.green*a[q+1]+g.blue*a[q+2]);g=Math.ceil(b/8);l=Math.ceil(c/8);p=g*l;if(h){var v=new Uint8ClampedArray(a.buffer,n,p);n+=p}v=new S(g,l,v);for(p=0;p<l;p++)for(q=0;q<g;q++){var u=Infinity,r=0;for(var t=0;8>t;t++)for(let a=0;8>a;a++){let b=m.get(8*q+a,8*p+t);u=Math.min(u,b);r=Math.max(r,b)}t=(u+r)/2;t=Math.min(255,1.11*t);24>=r-u&&(t=u/2,0<p&&0<q&&(r=(v.get(q,p-1)+2*v.get(q-1,p)+v.get(q-1,p-1))/4,u<r&&(t=r)));v.set(q,p,t)}h?(p=new Uint8ClampedArray(a.buffer,n,k),n+=k,p=new A(p,\nb)):p=A.createEmpty(b,c);q=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,n,k),q=new A(a,b)):q=A.createEmpty(b,c));for(b=0;b<l;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=l-3;h=2>b?2:b>h?h:b;k=0;for(n=-2;2>=n;n++)for(u=-2;2>=u;u++)k+=v.get(c+n,h+u);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)n=8*a+h,u=8*b+k,r=m.get(n,u),p.set(n,u,r<=c),f&&q.set(n,u,!(r<=c))}f=f?{binarized:p,inverted:q}:{binarized:p};let {binarized:w,inverted:x}=f;(f=Q(d?x:w))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||\n(f=Q(d?w:x));return f}class A{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new A(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let b=a;b<a+c;b++)this.set(b,f,!!e)}}class S{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,\nb){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}class V{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,\na-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var r;(function(a){a.Numeric="numeric";a.Alphanumeric="alphanumeric";a.Byte="byte";a.Kanji="kanji";a.ECI="eci";a.StructuredAppend="structuredappend"})(r||(r={}));var t;(function(a){a[a.Terminator=0]="Terminator";a[a.Numeric=1]="Numeric";a[a.Alphanumeric=2]="Alphanumeric";a[a.Byte=4]="Byte";a[a.Kanji=8]="Kanji";a[a.ECI=7]="ECI";a[a.StructuredAppend=\n3]="StructuredAppend"})(t||(t={}));let B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");class w{constructor(a,b){if(0===b.length)throw Error("No coefficients.");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===\nthis.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;if(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new w(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);\nfor(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new w(this.field,c)}multiplyPoly(a){if(this.isZero()||a.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let h=0;h<c;h++){let c=b[h];for(let b=0;b<d;b++){var f=h+b,g=this.field.multiply(c,a[b]);e[f]=e[h+b]^g}}return new w(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error("Invalid degree less than 0");if(0===b)return this.field.zero;\nlet c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new w(this.field,a)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(a=>{b^=a}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=J(this.field.multiply(a,b),this.coefficients[d]);return b}}class Y{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);\nthis.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new w(this,Uint8ClampedArray.from([0]));this.one=new w(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===a)throw Error("Can\'t invert 0");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,\nb){if(0>a)throw Error("Invalid monomial degree less than 0");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new w(this,a)}log(a){if(0===a)throw Error("Can\'t take log(0)");return this.logTable[a]}exp(a){return this.expTable[a]}}let K=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,\necBlocks:[{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}]}]},\n{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,\ndataCodewordsPerBlock: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,\necBlocks:[{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}]},\n{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},\n{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},\n{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},\n{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,\ndataCodewordsPerBlock: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,\ndataCodewordsPerBlock: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}]},\n{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}]},\n{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},\n{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,\necBlocks:[{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}]},\n{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},\n{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,\necBlocks:[{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,\ndataCodewordsPerBlock: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,\ndataCodewordsPerBlock: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,\necBlocks:[{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,\necBlocks:[{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,\ndataCodewordsPerBlock: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,\necBlocks:[{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,\n32,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}]}]},\n{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},\n{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,\necBlocks:[{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,\ndataCodewordsPerBlock: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,\necBlocks:[{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},\n{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,\necBlocks:[{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}]},\n{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},\n{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,\necBlocks:[{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,\n30,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}]}]},\n{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,\ndataCodewordsPerBlock: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}]},\n{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,\ndataCodewordsPerBlock: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}]},\n{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,\ndataCodewordsPerBlock: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}]}]}],da=[{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,\ndataMask: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,\nformatInfo:{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,\ndataMask: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,\ndataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],aa=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2],y=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2)),la={inversionAttempts:"attemptBoth",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},\ncanOverwriteImage:!0};I.default=I;let G="dontInvert",D={red:77,green:150,blue:29,useIntegerApproximation:!0};self.onmessage=a=>{let b=a.data.data;switch(a.data.type){case "decode":a=I(b.data,b.width,b.height,{inversionAttempts:G,greyScaleWeights:D});self.postMessage({type:"qrResult",data:a?a.data:null});break;case "grayscaleWeights":D.red=b.red;D.green=b.green;D.blue=b.blue;D.useIntegerApproximation=b.useIntegerApproximation;break;case "inversionMode":switch(b){case "original":G="dontInvert";break;\ncase "invert":G="onlyInvert";break;case "both":G="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}})()\n\n']))},uK=function(e,t,r,n,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,i,a,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},lK=TF(),dK=function(){function e(t){var r=this,n=t.container,o=t.lang,i=void 0===o?"en":o,a=t.assetRoot,s=void 0===a?"https://unpkg.com/@tsocial/tvweb-sdk@latest/assets":a,c=t.resourceRoot,u=t.customUrls,l=void 0===u?{}:u,d=t.enableAntiDebug,f=void 0===d||d,p=t.warmupMessage,h=t.baseComponent,m=t.component,g=void 0===m?{}:m;lM(this,e),pM(this,"initNativeCamera",(function(e){var t=document.createElement("div");document.body.appendChild(t);var n=_w.createRef(),o=r.component.NativeCamera;return oM.render(_w.createElement(o,hM({},e,{ref:n})),t),{openCamera:function(){n.current.click()}}})),pM(this,"runWarmUpReadIDCard",uM(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.commonSettings.customUrls,e.abrupt("return",r.component.warmUpReadIdCard(t));case 2:case"end":return e.stop()}}),e)})))),pM(this,"runPreloadEKYCResources",uM(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=r.commonSettings.customUrls,r.component.preloadEKYCResources(t);case 2:case"end":return e.stop()}}),e)})))),pM(this,"destroyView",(function(){oM.unmountComponentAtNode(r.container)})),uK(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var v=lF({resourceRoot:c,initCustomUrls:l});this.commonSettings={lang:i,assetRoot:s,customUrls:v,enableAntiDebug:f,debug:!1,warmupMessage:p},this.component=gM(gM({},h),g)}return fM(e,[{key:"checkCamera",value:function(){return(0,this.component.checkCamera)()}},{key:"getListCamera",value:function(){return(0,this.component.getListCamera)()}},{key:"readIDCardWithApiCall",value:function(e){var t=this.component.ReadIDCardWithApiCall;oM.render(_w.createElement(fF,{value:gM({},this.commonSettings)},_w.createElement(t,hM({onClose:this.destroyView},e))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var t=this.component.ReadIDCardUIOnly;oM.render(_w.createElement(fF,{value:this.commonSettings},_w.createElement(t,hM({onClose:this.destroyView},e))),this.container)}},{key:"livenessDetection",value:function(e){var t=this.component.LivenessDetection;oM.render(_w.createElement(fF,{value:gM({},this.commonSettings)},_w.createElement(t,hM({onClose:this.destroyView},e))),this.container)}},{key:"compareFaces",value:function(e){var t=e.accessKey,r=e.secretKey,n=e.apiUrl,o=e.image1,i=e.image2,a=e.onSuccess,s=e.onError;oq(new vF(t,r,n,{httpHeaders:lK})).compareFaces({image1:{id:o},image2:{id:i}}).then((function(e){a(e)})).catch((function(e){s(e)}))}}]),e}();function fK(e){return(fK="function"==typeof Symbol&&"symbol"==Ey(Symbol.iterator)?function(e){return Ey(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Ey(e)})(e)}function pK(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function hK(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){pK(i,n,o,a,s,"next",e)}function s(e){pK(i,n,o,a,s,"throw",e)}a(void 0)}))}}function mK(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)}}function gK(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vK(){return(vK=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 yK(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bK(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yK(Object(r),!0).forEach((function(t){gK(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yK(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wK(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function kK(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function CK(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}(e,t)||SK(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function BK(e){return function(e){if(Array.isArray(e))return EK(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||SK(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SK(e,t){if(e){if("string"==typeof e)return EK(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?EK(e,t):void 0}}function EK(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var _K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xK(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function TK(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var AK,PK=TK((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){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:{MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0},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),i=r(0),a=i.BROWSER_TYPES,s=i.OS_TYPES,c=i.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(),B=y.getUA(),S=a.CHROME,E=a.CHROMIUM,_=a.IE,x=a.INTERNET_EXPLORER,T=a.OPERA,A=a.FIREFOX,P=a.SAFARI,I=a.EDGE,R=a.YANDEX,O=a.MOBILE_SAFARI,N=c.MOBILE,D=c.TABLET,M=c.SMART_TV,L=c.BROWSER,U=c.WEARABLE,j=c.CONSOLE,F=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 B&&-1!==B.indexOf("Edg/")},W=function(){return b.name===I},G=function(){return v("iPad")},Q=w.type===M,X=w.type===j,Y=w.type===U,$=b.name===O||G(),Z=b.name===E,J=function(){switch(w.type){case N:case D:return!0;default:return!1}}()||G(),ee=w.type===N,te=w.type===D||G(),re=w.type===L,ne=C.name===F,oe=C.name===V,ie=C.name===z||G(),ae=b.name===S,se=b.name===A,ce=b.name===P||b.name===O,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=B,ke=W()||K(),Ce=b.name===R,Be=w.type,Se=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Ee=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(),Pe=W(),Ie=C.name===q,Re=C.name===H,Oe=l(w.type);e.exports={deviceDetect:function(){var e=Oe.isBrowser,t=Oe.isMobile,r=Oe.isTablet,n=Oe.isSmartTV,o=Oe.isConsole,i=Oe.isWearable;return e?d(e,b,k,C,B):n?m(n,k,C,B):o?h(o,k,C,B):t||r?f(Oe,w,C,B):i?p(i,k,C,B):void 0},isSmartTV:Q,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ie,isChrome:ae,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:Be,isIOS13:Se,isIPad13:Ee,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Pe,isWindows:Ie,isMacOs:Re}},function(e,t,r){var n;
61
61
  /*!
62
62
  * UAParser.js v0.7.18
63
63
  * Lightweight JavaScript-based User-Agent string parser
@@ -73,7 +73,7 @@ var jH={};void 0!==jH.asn1&&jH.asn1||(jH.asn1={}),jH.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 EQ(e){if("object"==Ey(e)&&null!==e){var t=e.$$typeof;switch(t){case sQ:switch(e=e.type){case hQ:case mQ:case uQ:case dQ:case lQ:case vQ:return e;default:switch(e=e&&e.$$typeof){case pQ:case gQ:case wQ:case bQ:case fQ:return e;default:return t}}case cQ:return t}}}function _Q(e){return EQ(e)===mQ}var xQ={AsyncMode:hQ,ConcurrentMode:mQ,ContextConsumer:pQ,ContextProvider:fQ,Element:sQ,ForwardRef:gQ,Fragment:uQ,Lazy:wQ,Memo:bQ,Portal:cQ,Profiler:dQ,StrictMode:lQ,Suspense:vQ,isAsyncMode:function(e){return _Q(e)||EQ(e)===hQ},isConcurrentMode:_Q,isContextConsumer:function(e){return EQ(e)===pQ},isContextProvider:function(e){return EQ(e)===fQ},isElement:function(e){return"object"==Ey(e)&&null!==e&&e.$$typeof===sQ},isForwardRef:function(e){return EQ(e)===gQ},isFragment:function(e){return EQ(e)===uQ},isLazy:function(e){return EQ(e)===wQ},isMemo:function(e){return EQ(e)===bQ},isPortal:function(e){return EQ(e)===cQ},isProfiler:function(e){return EQ(e)===dQ},isStrictMode:function(e){return EQ(e)===lQ},isSuspense:function(e){return EQ(e)===vQ},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===uQ||e===mQ||e===dQ||e===lQ||e===vQ||e===yQ||"object"==Ey(e)&&null!==e&&(e.$$typeof===wQ||e.$$typeof===bQ||e.$$typeof===fQ||e.$$typeof===pQ||e.$$typeof===gQ||e.$$typeof===CQ||e.$$typeof===BQ||e.$$typeof===SQ||e.$$typeof===kQ)},typeOf:EQ},TQ=(TK((function(e,t){})),TK((function(e){e.exports=xQ}))),AQ={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},PQ={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},IQ={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},RQ={};function OQ(e){return TQ.isMemo(e)?IQ:RQ[e.$$typeof]||AQ}RQ[TQ.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},RQ[TQ.Memo]=IQ;var NQ=Object.defineProperty,DQ=Object.getOwnPropertyNames,MQ=Object.getOwnPropertySymbols,LQ=Object.getOwnPropertyDescriptor,UQ=Object.getPrototypeOf,jQ=Object.prototype,FQ=function e(t,r,n){if("string"!=typeof r){if(jQ){var o=UQ(r);o&&o!==jQ&&e(t,o,n)}var i=DQ(r);MQ&&(i=i.concat(MQ(r)));for(var a=OQ(t),s=OQ(r),c=0;c<i.length;++c){var u=i[c];if(!(PQ[u]||n&&n[u]||s&&s[u]||a&&a[u])){var l=LQ(r,u);try{NQ(t,u,l)}catch(e){}}}}return t};function VQ(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===fK(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 zQ,qQ,HQ,KQ,WQ,GQ=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],QQ=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&&GQ.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},XQ=function(e){return!e||1===navigator.maxTouchPoints||navigator.plugins.length>0},YQ=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}}},$Q=sM.Errors,ZQ=lE.div(zQ||(zQ=kK(["\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;"})),JQ=lE.video(qQ||(qQ=kK(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),eX=lE.div(HQ||(HQ=kK(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),tX=lE(eX)(KQ||(KQ=kK(["\n z-index: ",";\n position: absolute;\n top: 20px;\n right: 20px;\n width: 20px;\n"])),1100),rX=lE.div(WQ||(WQ=kK(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),nX=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 oX(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,i=e.onVideoPlayed,a=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=_w.useRef(),g=mF.useSDKSettings().lang,v=GF.useSDKTracking().sendEvent,y=YF.useAsset("ic_close.png"),b=CK(_w.useState(""),2),w=b[0],k=b[1],C=_w.useRef(!1),B=_w.useRef(!1),S=_w.useRef(!1),E=_w.useRef(),_=_w.useRef([]),x=_w.useRef(""),T=_w.useCallback((function(e){u&&u(e)}),[u]),A=_w.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(E)}),[c]);function P(){return I.apply(this,arguments)}function I(){return(I=hK(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,VQ();case 3:t=e.sent,_.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),nK.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)),_w.useEffect((function(){return function(){S.current=!0}}),[]);var R=_w.useCallback((function(){E.current||(E.current=setTimeout((function(){C.current||(k($Q.camera_timeout.msg[g]),T($Q.camera_timeout))}),2e4))}),[g,T]),O=_w.useCallback(function(){var e=hK(regeneratorRuntime.mark((function e(t){var n,o,i,a,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=p.length>1&&void 0!==p[1]&&p[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=PK.isMobile?PK.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:1650},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:9999}},i=YQ(),a=i.updateTime,c=i.getStart,u=i.getEnd,e.prev=8,l=s||o,a(performance.now(),"start"),XQ(PK.isMobile)&&r&&(l={}),n&&(l={}),nK.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),e.next=16,nX.getUserMedia({audio:!1,video:bK(bK({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)});case 16:return d=e.sent,e.next=19,P();case 19:if(R(),d){e.next=24;break}return k($Q.not_supported.msg[g]),T($Q.not_supported),e.abrupt("return",null);case 24:a(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{f=d.getVideoTracks()[0].getSettings(),nK.addExifData("device_info.camera_label_dimension.got","".concat(f.width,"x").concat(f.height))}catch(e){}return e.abrupt("return",d);case 31:e.prev=31,e.t0=e.catch(8),a(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k($Q.no_permission.msg[g]),T($Q.no_permission),B.current=!0,v({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):B.current&&("NotReadableError"===e.t0.name?(T($Q.not_readable),k($Q.not_readable.msg[g])):(k(e.t0.message),T({code:e.t0.name||e.t0.code,message:e.t0.message})));case 35:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 37:case"end":return e.stop()}}),e,null,[[8,31]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,T,h,R,v]),N=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var t,r,n,o,a,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!=(a=c.current)&&null!==(t=a.srcObject)&&void 0!==t&&t.id&&null!=a&&null!==(r=a.srcObject)&&void 0!==r&&r.active&&C.current)){e.next=5;break}return e.abrupt("return");case 5:return a.oncanplaythrough=function(){var e,t,r;a.play(),nK.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=SV.analyzeVideoAndWindowSizes(a),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));i&&i({clientWidth:n,clientHeight:o,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,O(n,o);case 8:s=e.sent,u=QQ(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&&N(f[0].deviceId)),s||B.current||(nK.addExifData("device_info.camera_label_retry","yes"),B.current=!0,N(n,!0)),s&&S.current&&(c.current.srcObject=s,A()),!s||S.current||d||(a.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,O,i,p,A]);_w.useEffect((function(){function e(){return(e=hK(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,N();case 2:return e.next=4,VQ();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(),N(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return!nX||PK.browserName&&["facebook"].includes(PK.browserName.toLowerCase())||PK.getUA.includes("Zalo iOS")?(k($Q.not_supported.msg[g]),T($Q.not_supported)):t&&(PK.isAndroid&&!1===r?function(){e.apply(this,arguments)}():N()),function(){S.current&&A()}}),[c,g,r,N,A,T]);var D=_w.useCallback((function(){A(),n&&n(),v({tag:"result",event:"user_activity.cancel",log:{}})}),[n,A,v]);return _w.createElement(ZQ,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!w)return null;var e=$Q.no_permission.msg[g];return w===e&&PK.isIOS?_w.createElement(rX,null,w," ",_w.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):_w.createElement(rX,null,w)}(),_w.createElement(JQ,{ref:c,playsInline:!0,muted:!0,flipHorizontal:a,className:d,scale:f}),o,l?_w.cloneElement(l,{onClick:D,"data-testid":"close-camera"}):_w.createElement(tX,{onClick:D,"data-testid":"close-camera"},_w.createElement("img",{src:y,alt:""})))}oX.propTypes={checkCameraMode:_k.bool,frontCamera:_k.bool,onClose:_k.func,onError:_k.func,onVideoPlayed:_k.func,children:_k.node,flipHorizontal:_k.bool,videoSettings:_k.object,refVideo:_k.object,closeButton:_k.node,videoClassName:_k.string,scale:_k.number,defaultCameraId:_k.string,onWarning:_k.func},oX.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},function(e,t,r){var n=function(t){Dy(o,t);var n=Hy(o);function o(){var e;return Ty(this,o),(e=n.apply(this,arguments)).updateDebounced=iQ(e.forceUpdate,250,r),e}return Py(o,[{key:"shouldComponentUpdate",value:function(){return this.updateDebounced(),!1}},{key:"componentWillUnmount",value:function(){this.updateDebounced.cancel()}},{key:"render",value:function(){return _w.createElement(e,Object.assign({},this.props))}}]),o}(_w.Component);n.displayName="debounceRender(".concat(e.displayName||e.name||"Component",")"),FQ(n,e)}(oX);var iX,aX=lE(HG)(iX||(iX=kK(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: ",";\n"])),1010);function sX(){return(sX=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)}var cX,uX="undefined"!=typeof window?_w.useLayoutEffect:_w.useEffect,lX={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}}},dX=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],fX=function(e,t,r,n,o){var i=o.offsetX,a=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-a:p+a,left:h="left"===c[0]?h-i:h+i,transform:m,arrowLeft:v,arrowTop:g}},pX=function(e,t,r,n,o,i){var a=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}(i),d=Array.isArray(r)?r:[r];for((i||Array.isArray(r))&&(d=[].concat(d,dX));u<d.length;){var f={top:(c=fX(e,t,d[u],n,{offsetX:a,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},hX=0,mX=_w.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,o=e.onOpen,i=void 0===o?function(){}:o,a=e.onClose,s=void 0===a?function(){}:a,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,B=void 0===C?["click"]:C,S=e.contentStyle,E=void 0===S?{}:S,_=e.arrowStyle,x=void 0===_?{}:_,T=e.overlayStyle,A=void 0===T?{}:T,P=e.className,I=void 0===P?"":P,R=e.position,O=void 0===R?"bottom center":R,N=e.modal,D=void 0!==N&&N,M=e.lockScroll,L=void 0!==M&&M,U=e.arrow,j=void 0===U||U,F=e.offsetX,V=void 0===F?0:F,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,$=_w.useState(d||u),Z=$[0],J=$[1],ee=_w.useRef(null),te=_w.useRef(null),re=_w.useRef(null),ne=_w.useRef(null),oe=_w.useRef("popup-"+ ++hX),ie=!!D||!n,ae=_w.useRef(0);uX((function(){return Z?(ne.current=document.activeElement,ye(),me(),pe()):he(),function(){clearTimeout(ae.current)}}),[Z]),_w.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return i(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ie&&(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(ae.current),ae.current=setTimeout((function(){return se(e)}),K)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(ae.current),ae.current=setTimeout((function(){return ce(e)}),G)},pe=function(){ie&&L&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ie&&L&&(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()};_w.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var ge,ve,ye=function(){if(!ie&&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=pX(r,n,O,j,{offsetX:V,offsetY:q},X);te.current.style.top=o.top+window.scrollY+"px",te.current.style.left=o.left+window.scrollX+"px",j&&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)}};void 0===(ve=k)&&(ve=!0),_w.useEffect((function(){if(ve){var e=function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){"Escape"===e.key&&ge(e)}));return document.addEventListener("keyup",e),function(){ve&&document.removeEventListener("keyup",e)}}}),[ge=ce,ve]),function(e,t){void 0===t&&(t=!0),_w.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 i=o[0],a=o[o.length-1];t.shiftKey&&document.activeElement===i?(t.preventDefault(),a.focus()):document.activeElement===a&&(t.preventDefault(),i.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])}(te,Z&&ie),function(e,t){void 0===t&&(t=!0),_w.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),_w.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 _w.createElement("div",Object.assign({},(e=ie?lX.popupContent.modal:lX.popupContent.tooltip,t={className:"popup-content "+(""!==I?I.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:sX({},e,E,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!D&&B.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ie?"dialog":"tooltip",id:oe.current}),j&&!ie&&_w.createElement("div",{ref:re,style:lX.popupArrow},_w.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==I?I.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:sX({position:"absolute"},x)},_w.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},ke=!(B.indexOf("hover")>=0),Ce=ie?lX.overlay.modal:lX.overlay.tooltip,Be=[ke&&_w.createElement("div",{key:"O","data-testid":"overlay","data-popup":ie?"modal":"tooltip",className:"popup-overlay "+(""!==I?I.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:sX({},Ce,A,{pointerEvents:v&&m||ie?"auto":"none"}),onClick:v&&m?ce:void 0,tabIndex:-1},ie&&we()),!ie&&we()];return _w.createElement(_w.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":oe.current},t=Array.isArray(B)?B:[B],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 i=n(Z);return!!n&&_w.cloneElement(i,e)}return!!n&&_w.cloneElement(n,e)}(),Z&&oM.createPortal(Be,(null===(be=document.getElementById("popup-root"))&&((be=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(be)),be)))})),gX=fE(cX||(cX=kK(["\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"]))),vX=["open","children","overlayStyle"],yX=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=wK(e,vX);return _w.createElement(_w.Fragment,null,t&&_w.createElement(_w.Fragment,null,_w.createElement(mX,vK({overlayStyle:bK(bK({},n),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),_w.createElement(gX,null)))};yX.propTypes={open:_k.bool,children:_k.node,overlayStyle:_k.shape({})},yX.defaultProps={open:!1,children:null,overlayStyle:{}};var bX="default",wX="error";function kX(e){var t=e.className,r=e.width,n=e.height,o=e.type,i=e.strokeStyles,a=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=_w.useMemo((function(){var e;return bK((gK(e={},bX,{fill:"none",strokeWidth:a,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),gK(e,wX,{fill:"rgba(234,50,35, 0.1)",strokeWidth:a,stroke:"#ea3223"}),e),i)}),[a,i]),l=s+.8*a,d=u[o];return _w.createElement("svg",{width:r,height:n,className:t},_w.createElement("rect",{x:a/2,y:a/2,rx:s,ry:s,width:r-a,height:n-a,style:d}),_w.createElement("path",{d:"M0,".concat(l," Q0,0 ").concat(l,",0 L0,0 Z"),style:c}),_w.createElement("path",{d:"M0,".concat(n-l," Q0,").concat(n," ").concat(l,",").concat(n," L0,").concat(n," Z"),style:c}),_w.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}),_w.createElement("path",{d:"M".concat(r-l,",0 Q").concat(r,",0 ").concat(r,",").concat(l," L").concat(r,",0 Z"),style:c}))}kX.propTypes={className:_k.string,width:_k.number,height:_k.number,strokeWidth:_k.number,strokeStyles:_k.shape({}),type:_k.oneOf([bX,wX]),radius:_k.number,paddingStyle:_k.shape({})},kX.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:bX,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var CX,BX,SX,EX,_X,xX,TX,AX,PX,IX,RX,OX,NX,DX,MX,LX,UX,jX,FX=pE(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),VX=pE(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),zX=XS([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],FX,500,VX,500),qX=pE(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),HX=pE(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20),KX=(XS([".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;}"],qX,HX),pE(["from,to{opacity:1;}50%{opacity:0;}"])),WX=(XS([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],KX),lE.div(CX||(CX=kK(["\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),pE(["from{background:#000;}to{}"])),GX=XS([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],WX,300),QX=(lE.div(BX||(BX=kK(["\n ","\n"])),GX),pE(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"])),XX=XS([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],QX),YX=["width","height","type"],$X=lE(kX)(SX||(SX=kK([""]))),ZX=lE.img(EX||(EX=kK(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),JX=lE.div(_X||(_X=kK(["\n ","\n ","\n"])),zX,XX),eY=(lE.img(xX||(xX=kK(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),lE.div(TX||(TX=kK(["\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,PK.isMobile?XS(["top:",";"],(function(e){return e.y})):XS(["bottom:","px;"],10))),tY=lE.div(AX||(AX=kK(["\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),rY=lE.div(PX||(PX=kK(["\n color: #fff;\n text-align: center;\n"]))),nY=(lE.div(IX||(IX=kK(["\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),lE.div(RX||(RX=kK(["\n display: flex;\n align-items: center;\n"]))),lE(rY)(OX||(OX=kK(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),lE(rY)(NX||(NX=kK(["\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)),oY=lE(rY)(DX||(DX=kK(["\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),iY=lE(oY)(MX||(MX=kK(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),aY=lE(rY)(LX||(LX=kK(["\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),sY=(lE.div(UX||(UX=kK(["\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=wK(e,YX),i=YF.useAsset("id_card_frame.png"),a=YF.useAsset("id_card_frame_error.png");return _w.createElement(JX,{width:t,height:r},_w.createElement(ZX,{src:n===wX?a:i,width:t,height:r}),_w.createElement($X,vK({width:t,height:r,type:n},o)))}),cY={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},uY=lE.div(jX||(jX=kK(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),lY=function(e){var t=e.contentStyle,r=mF.useSDKSettings(),n=r.lang,o=r.warmupMessage,i=o?o[n]:cY.WARMUP_INTRO[n];return _w.createElement(yX,{open:!0,contentStyle:t},_w.createElement(uY,{className:"warmup-message"},i))};lY.propTypes={contentStyle:_k.shape({})},lY.defaultProps={contentStyle:{}};var dY,fY,pY,hY={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"}},mY=sM.IDCardMessage,gY=lE.div(dY||(dY=kK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),vY=lE.div(fY||(fY=kK(["\n text-align: center;\n font-size: 1rem;\n"]))),yY=lE.button(pY||(pY=kK(["\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})),bY=function(e){var t=e.onOk,r=e.maxSessionTime,n=mF.useSDKSettings().lang;return _w.createElement(gY,null,_w.createElement(vY,{className:"popup-message"},jG(mY.TIMEOUT_INSTRUCTION[n])({x:r})),_w.createElement(yY,{className:"popup-button",onClick:t},hY.BTN_OK[n]))};bY.propTypes={onOk:_k.func,maxSessionTime:_k.number},bY.defaultProps={onOk:function(){},maxSessionTime:30};var wY=function(){var e=CK(_w.useState(!1),2),t=e[0],r=e[1],n=CK(_w.useState(null),2),o=n[0],i=n[1],a=CK(_w.useState({}),2),s=a[0],c=a[1];return{showPopup:_w.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),i(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},kY="SESSION_TIMEOUT",CY="QR_INVALID",BY="QR_INSTRUCTIONS",SY=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,EY=/^\w*$/,_Y=function(e,t){if(NW(e))return!1;var r=Ey(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!BG(e))||EY.test(e)||!SY.test(e)||null!=t&&e in Object(t)},xY=iW(Object,"create"),TY=function(){this.__data__=xY?xY(null):{},this.size=0},AY=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},PY=Object.prototype.hasOwnProperty,IY=function(e){var t=this.__data__;if(xY){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return PY.call(t,e)?t[e]:void 0},RY=Object.prototype.hasOwnProperty,OY=function(e){var t=this.__data__;return xY?void 0!==t[e]:RY.call(t,e)},NY=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=xY&&void 0===t?"__lodash_hash_undefined__":t,this};function DY(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])}}DY.prototype.clear=TY,DY.prototype.delete=AY,DY.prototype.get=IY,DY.prototype.has=OY,DY.prototype.set=NY;var MY=DY,LY=function(){this.__data__=[],this.size=0},UY=function(e,t){for(var r=e.length;r--;)if(cW(e[r][0],t))return r;return-1},jY=Array.prototype.splice,FY=function(e){var t=this.__data__,r=UY(t,e);return!(r<0||(r==t.length-1?t.pop():jY.call(t,r,1),--this.size,0))},VY=function(e){var t=this.__data__,r=UY(t,e);return r<0?void 0:t[r][1]},zY=function(e){return UY(this.__data__,e)>-1},qY=function(e,t){var r=this.__data__,n=UY(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function HY(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])}}HY.prototype.clear=LY,HY.prototype.delete=FY,HY.prototype.get=VY,HY.prototype.has=zY,HY.prototype.set=qY;var KY=HY,WY=iW(OK,"Map"),GY=function(){this.size=0,this.__data__={hash:new MY,map:new(WY||KY),string:new MY}},QY=function(e){var t=Ey(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},XY=function(e,t){var r=e.__data__;return QY(t)?r["string"==typeof t?"string":"hash"]:r.map},YY=function(e){var t=XY(this,e).delete(e);return this.size-=t?1:0,t},$Y=function(e){return XY(this,e).get(e)},ZY=function(e){return XY(this,e).has(e)},JY=function(e,t){var r=XY(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function e$(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])}}e$.prototype.clear=GY,e$.prototype.delete=YY,e$.prototype.get=$Y,e$.prototype.has=ZY,e$.prototype.set=JY;var t$=e$;function r$(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],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(r$.Cache||t$),r}r$.Cache=t$;var n$=r$,o$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i$=/\\(\\)?/g,a$=function(e){var t=n$((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o$,(function(e,r,n,o){t.push(n?o.replace(i$,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),s$=function(e,t){return NW(e)?e:_Y(e,t)?[e]:a$(xG(e))},c$=function(e){if("string"==typeof e||BG(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},u$=function(e,t){for(var r=0,n=(t=s$(t,e)).length;null!=e&&r<n;)e=e[c$(t[r++])];return r&&r==n?e:void 0},l$=function(e,t,r){var n=null==e?void 0:u$(e,t);return void 0===n?r:n},d$=sM.Errors;function f$(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function p$(e,t){return Math.sqrt(f$(e,t))}function h$(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=void 0===r?.4:r,o=window,i=o.cv,a=t.width,s=t.height,c=n;c<1&&(c=parseInt(.5*(s+a)*c,10));var u=i.imread(t),l=new i.Mat;return i.copyMakeBorder(u,l,c,c,c,c,i.BORDER_CONSTANT,new i.Scalar(0,0,0,255)),u.delete(),{mat:l,margin:c}}function m$(e,t){var r=window.cv,n=CK(t.map((function(e){return e.location})),4),o=n[0],i=n[1],a=n[2],s=n[3],c=p$(a,s),u=p$(i,o),l=Math.max(c,u),d=p$(i,a),f=p$(o,s),p=Math.max(d,f),h=[o.x,o.y,i.x,i.y,a.x,a.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 g$(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},i=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),a=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(i*a))/Math.PI}function v$(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,a=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),i=Math.min(i,n),a=Math.max(a,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&i/n>=c&&(n-s)/n>=c&&(r-a)/r>=c}function y$(){return b$.apply(this,arguments)}function b$(){return(b$=hK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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,i=r.width,a=r.height,s=Math.floor(i*o),c=Math.floor(a*o),u=i-2*s,l=a-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",Yz.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w$(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,i=g$(e[r].location,e[n].location,e[o].location);if(i<70||i>110)return!1}return!0}function k$(e){return C$.apply(this,arguments)}function C$(){return(C$=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,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,i=n.width,a=n.height,s=Math.floor(i/3),c=Math.floor(4*a/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(a/5),s,c,0,0,s,c),e.next=12,VV.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=CK(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4||IV.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[VV.SIZE,VV.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",d$.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",d$.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",d$.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 B$=function(){var e=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=t.currentWorkingCanvas,u=t.refVirtualWorkingCanvas,l=t.refCountVirtualFrames,d=t.refVirtualFrames,f=t.refWorkingCanvas,p=t.refCardResult,h=CK(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===(i=g.location)||void 0===i?void 0:i.y)-100,w=performance.now(),(k=u.current).width=y,k.height=b,(C=k.getContext("2d")).drawImage(c,(null==m||null===(a=m.location)||void 0===a?void 0:a.x)+50,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+50,y,b,0,0,y,b),e.next=12,new Promise((function(e){k.toBlob(function(){var t=hK(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jF.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(BK(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 12:return w=Math.floor(performance.now()-w),B=180-w>0?180-w:0,e.next=16,new Promise((function(e){return setTimeout(e,B)}));case 16:if(!(l.current<3)){e.next=27;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===(E=m.location)||void 0===E?void 0:E.y)+50,y,b,0,0,y,b),e.next=22,new Promise((function(e){k.toBlob(function(){var t=hK(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jF.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(BK(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 22:if(!(l.current<2)){e.next=24;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",24);case 24:l.current+=1,e.next=16;break;case 27:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),S$=/\s/,E$=function(e){for(var t=e.length;t--&&S$.test(e.charAt(t)););return t},_$=/^\s+/,x$=function(e){return e?e.slice(0,E$(e)+1).replace(_$,""):e},T$=/^[-+]0x[0-9a-f]+$/i,A$=/^0b[01]+$/i,P$=/^0o[0-7]+$/i,I$=parseInt,R$=function(e){if("number"==typeof e)return e;if(BG(e))return NaN;if(HK(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=HK(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=x$(e);var r=A$.test(e);return r||P$.test(e)?I$(e.slice(2),r?2:8):T$.test(e)?NaN:+e},O$=function(e){return e?1/0===(e=R$(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},N$=function(e){var t=O$(e),r=t%1;return t==t?r?t-r:t:0},D$=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=N$(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},M$=function(e){return D$(2,e)},L$=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e},U$=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=R$(r))==r?r:0),void 0!==t&&(t=(t=R$(t))==t?t:0),L$(R$(e),t,r)},j$="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function F$(){return(F$=hK(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?j$: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",hK(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 V$=M$((function(){return F$.apply(this,arguments)})),z$="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",q$={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"};function H$(e){var t,r,n,o,i,a=e.card,s=e.corners,c=a.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=SK(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 i,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=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,i=e})),f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(s);try{for(f.s();!(i=f.n()).done;){var p=i.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=f$(u,h),v=f$(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 K$=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n,o,i,a,s,c,u;return t=e,(r=[{key:"load",value:(u=hK(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([V$({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=hK(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=hK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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?z$:r,e.next=3,Nq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,Nq.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,i=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),a=CK(i,3),this.out_score_name=a[0],this.out_class_name=a[1],this.out_box_name=a[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"loadResource",value:(a=hK(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?z$:r,e.next=3,Nq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"dispose",value:(i=hK(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 i.apply(this,arguments)})},{key:"predict",value:(o=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E,_,x,T,A,P,I,R,O=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.length>1&&void 0!==O[1]?O[1]:{},n=r.imgMargin,o=void 0===n?.4:n,i=r.detectThreshold,a=void 0===i?.3:i,s=r.maxNumReturns,c=void 0===s?100:s,u=window,l=u.cv,d={},f=t.width,p=t.height,d.originalWidth=f,d.originalHeight=p,h=h$({canvas:t,imgMargin:o}),m=h.margin,g=h.mat,v=this.inputShape.slice(1,3),y=CK(v,2),b=y[0],w=y[1],k=new l.Mat,l.resize(g,k,new l.Size(b,w),0,0,l.INTER_AREA),C=g.cols/b,B=g.rows/w,(S=document.createElement("canvas")).width=b,S.height=w,S.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(k.data),k.cols,k.rows),0,0),g.delete(),k.delete(),d.canvas=S,d.margin=m,E=performance.now(),e.next=25,this.detect(S,{detectThreshold:a,maxNumReturns:c});case 25:if(_=e.sent,x=Math.floor(performance.now()-E),T={inputImage:d,card:null,exeTime:x},A=[[],[],[],[]],P=[],I=[],_.forEach((function(e){var t=CK(e.box,4),r=t[0],n=t[1],o=t[2],i=t[3];e.clazz<=3?A[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:U$(Math.floor((i+n)/2*C-m),0,f),y:U$(Math.floor((r+o)/2*B-m),0,p)},scaledLocation:{x:U$(Math.floor((i+n)/2),0,S.width),y:U$(Math.floor((r+o)/2),0,S.height)}}):I.push({label:e.label,score:e.score,box:[U$(Math.floor(r*B-m),0,p),U$(Math.floor(n*C-m),0,f),U$(Math.floor(o*B-m),0,p),U$(Math.floor(i*C-m),0,f)]})})),A.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),P.push(e[0]))})),!(I.length>0&&4===P.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),P.sort((function(e,t){return e.clazz-t.clazz})),R=I[0],e.prev=37,H$({card:R,corners:P})){e.next=41;break}return console.debug("Not qualified.",R,P),e.abrupt("return",T);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",T);case 46:return R.corners=P,T.card=R,e.abrupt("return",T);case 49:return e.abrupt("return",T);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return o.apply(this,arguments)})},{key:"detect",value:(n=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E=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,i=window,a=i.tf,s=t.width,c=t.height,u=a.tidy((function(){var e=a.expandDims(a.cast(a.image.resizeBilinear(a.browser.fromPixels(t),E.inputShape.slice(1,3)),"float32"));return E.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=CK(l,3),f=d[0],p=d[1],h=CK(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=q$[Math.round(w)])&&void 0!==k?k:"NA",B=m[y],S=[B[0]*c,B[3]*s,B[2]*c,B[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)})}])&&mK(t.prototype,r),e}();function W$(){return(W$=hK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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,i=new iK(o),e.next=4,Nq.loadTensorFlow(n);case 4:return e.next=6,Nq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return a=[Nq.loadBlazefaceModel({modelUrl:r}),i.load()],e.next=9,Promise.all(a);case 9:return s=e.sent,c=CK(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:i});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var G$=M$((function(){return W$.apply(this,arguments)})),Q$=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,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"environment";Ty(this,t),this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=r,this._legacyCanvasSize=t.DEFAULT_CANVAS_SIZE,this._preferredCamera=i,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 a=!1;e.hidden&&(e.hidden=!1,a=!0),document.body.contains(e)||(document.body.appendChild(e),a=!0),requestAnimationFrame((function(){var 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=t.createQrEngine()}return Py(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=rb(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=rb(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(Gy(r.map((function(r){return Object.assign({},r,Iy({},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=rb(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,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=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=Wy(e,2),d=l[0],f=l[1];return o=d,s=Wy(r._drawToCanvas(f,n,i,a),2),i=s[0],u=s[1],o instanceof Worker?(c||o.postMessage({type:"inversionMode",data:"both"}),new Promise((function(e,r){var n,a,s;a=function(i){"qrResult"===i.data.type&&(o.removeEventListener("message",a),o.removeEventListener("error",s),clearTimeout(n),null!==i.data.data?e(i.data.data):r(t.NO_QR_CODE_FOUND))},s=function(e){o.removeEventListener("message",a),o.removeEventListener("error",s),clearTimeout(n);var t=e?e.message||e:"Unknown Error";r("Scanner error: "+t)},o.addEventListener("message",a),o.addEventListener("error",s),n=setTimeout((function(){return s("timeout")}),1e4);var c=u.getImageData(0,0,i.width,i.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(i).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,i,a)}))),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,i=t&&t.y?t.y:0,a=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:a,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,i,a,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 X$(){return Y$.apply(this,arguments)}function Y$(){return(Y$=hK(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q$.WORKER_PATH=cK(),e.next=3,Q$.createQrEngine(Q$.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 $$(){return Z$.apply(this,arguments)}function Z$(){return(Z$=hK(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([X$()]);case 2:return t=e.sent,r=CK(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)}Q$.DEFAULT_CANVAS_SIZE=400,Q$.NO_QR_CODE_FOUND="No QR code found",Q$.WORKER_PATH="qr-scanner-worker.min.js";var J$="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function eZ(){return(eZ=hK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=hK(regeneratorRuntime.mark((function e(){var t,r,n,a,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",a="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=[i(t),i(r),i(n),i(a)],e.next=11,Promise.all(u);case 11:l=e.sent,d=CK(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)},a=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?J$:r,i=function(){var e=hK(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,a();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",$$());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var tZ=M$((function(){return eZ.apply(this,arguments)}));function rZ(e){return nZ.apply(this,arguments)}function nZ(){return(nZ=hK(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 oZ(e){return iZ.apply(this,arguments)}function iZ(){return(iZ=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i;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,rZ({idCardModel:r});case 6:(i=performance.now())-o+.6*(i-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 aZ(){return(aZ=hK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,i=t.tfScriptUrls,a=t.wechatQRModelsUrl,e.next=3,G$({blazefaceModelUrl:o,tfScriptUrls:i});case 3:return s=e.sent,c=s.blazefaceModel,u=!0,l=new K$,e.prev=7,e.next=10,l.load({opencvUrl:r,modelUrl:n});case 10:e.next=15;break;case 12:return e.prev=12,e.t0=e.catch(7),e.abrupt("return",{ableToUseModel:!1});case 15:return e.next=17,tZ({modelUrl:a});case 17:return e.prev=17,e.next=20,oZ({idCardModel:l});case 20:d=e.sent,f=d.fastEnough,u=f,e.next=28;break;case 25:e.prev=25,e.t1=e.catch(17),u=!1;case 28:return e.abrupt("return",{ableToUseModel:u,idCardModel:l,blazefaceModel:c});case 29:case"end":return e.stop()}}),e,null,[[7,12],[17,25]])})))).apply(this,arguments)}var sZ=M$((function(){return aZ.apply(this,arguments)})),cZ=sM.Errors;function uZ(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=_w.useRef(null);null===i.current&&(i.current=document.createElement("canvas"));var a=_w.useRef(!1),s=_w.useRef(Wz.createResizer({width:960,height:640})),c=_w.useRef(null),u=_w.useRef([{id:null,frames:[]}]),l=_w.useCallback((function(){!0===a.current&&(a.current=!1)}),[]),d=_w.useCallback((function(){u.current=[{id:null,frames:[]}]}),[]),f=_w.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),p=_w.useCallback(function(){var e=hK(regeneratorRuntime.mark((function e(t){var r,n,i,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,i=u.current,a=n.resize({srcCanvas:r}),c=a.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],i[i.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=_w.useCallback(hK(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,a.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=i.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),a.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,ZF.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return _w.useEffect((function(){var e=t.current;function o(){return(o=hK(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=SV.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:i,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var lZ=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,i=e.settings,a=e.shouldStartTimers,s=e.sessionTime,c=_w.useRef(),u=CK(_w.useState(0),2),l=u[0],d=u[1],f=_w.useCallback((function(){clearInterval(c.current)}),[]),p=_w.useCallback((function(){d((function(e){return e+1}))}),[]);return _w.useEffect((function(){if(a){var e=i.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var i=s-(t+=1);i<=u&&r&&r({curTimeLeft:i}),t>0&&t%e==0&&o&&o(),0===i&&(f(),n&&n())}),1e3)}return function(){f()}}),[a,t,r,f,n,o,l,i,s]),{stopTimers:f,startTimers:p}};nK.initExifData();var dZ,fZ,pZ,hZ=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onModelErrorChange,a=e.frontSide,s=e.onDebugInfoChange,c=e.onAboutToTimeout,u=e.onSessionTimeout,l=e.onCaptureDone,d=e.outputEncryptionSettings,f=e.quality,p=_w.useRef(!1),h=CK(_w.useState(!1),2),m=h[0],g=h[1],v=_w.useRef((function(){})),y=GF.useSDKTracking().sendEvent,b=_w.useRef(),w=_w.useRef(),k=_w.useRef(),C=mF.useSDKSettings(),B=C.debug,S=C.lang,E=C.enableAntiDebug,_=sK(),x=_.startMotion,T=_.stopMotion,A=_.motionData,P=_.orientationData;_w.useEffect((function(){E&&Dq.enableAntiDebug()}),[E]);var I=_w.useCallback(function(){var e=hK(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y({tag:a?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,v.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[y,a]),R=_w.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.apply(void 0,t);var n=l$(t,"0.code");n&&n!==b.current&&(y({tag:a?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),b.current=n)}),[i,a,y]),O=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.onError,a=e.frontSide,s=e.onAutoCaptureSuccess,c=e.quality,u=_w.useRef(null);null===u.current&&(u.current=document.createElement("canvas"));var l=_w.useRef(0),d=_w.useRef([]),f=_w.useRef(null);null===f.current&&(f.current=document.createElement("canvas"));var p=_w.useRef({}),h=_w.useRef(!1),m=_w.useRef(null),g=CK(_w.useState(!1),2),v=g[0],y=g[1],b=_w.useRef({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),w=_w.useRef({imageBlob:null,blurScore:null,error:null,detectedCard:null}),k=_w.useRef(!1),C=_w.useRef(!1),B=_w.useRef(null),S=_w.useRef(!1),E=_w.useRef({}),_=mF.useSDKSettings().customUrls;_w.useEffect((function(){var e=!1;function t(){return(t=hK(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||v){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,sZ(_);case 4:return E.current=t.sent,t.next=7,Nq.initTensorFlow();case 7:B.current=o.enableBlurCheck&&E.current.ableToUseModel,t.next=11;break;case 10:B.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:y(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[v,o,_]);var x=_w.useCallback((function(e){return B$({currentWorkingCanvas:e,refVirtualWorkingCanvas:f,refCountVirtualFrames:l,refVirtualFrames:d,refWorkingCanvas:u,refCardResult:p})}),[]),T=_w.useCallback((function(){!0===h.current&&(h.current=!1)}),[]),A=_w.useCallback(function(){var e=hK(regeneratorRuntime.mark((function e(t){var r,n,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,i=o.blurThreshold,a=b.current,s=w.current,!(r<i&&CV.hasBetterCardBlurScore(r,a.blurScore))){e.next=16;break}if(!S.current){e.next=9;break}a.imageBlob=s.imageBlob,e.next=13;break;case 9:return e.next=11,SV.takePicture({canvas:u.current,quality:c});case 11:a.imageBlob=e.sent,a.captureTime=Date.now();case 13:a.takenAt=(new Date).getTime(),a.blurScore=r,a.detectedCard=n;case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,c]),P=_w.useCallback(function(){var e=hK(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,C.current=!0,o=w.current,!CV.hasBetterCardBlurScore(r,o.blurScore)){e.next=11;break}return e.next=6,SV.takePicture({canvas:u.current,quality:c});case 6:o.imageBlob=e.sent,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,S.current=!0;case 11:C.current=!1;case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c]),I=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.waitForBestImageTimeMs,null===(r=b.current).imageBlob){e.next=8;break}if(!((new Date).getTime()-r.takenAt>t)){e.next=8;break}return e.next=7,s(r);case 7:T();case 8:case"end":return e.stop()}}),e)}))),[s,o,T]),R=_w.useCallback((function(){k.current=!0}),[]),O=_w.useCallback((function(){return new Promise((function(e){k.current=!1;var t=setInterval((function(){C.current||(clearInterval(t),e())}),150)}))}),[]),N=_w.useCallback(hK(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=w.current;B.current?(R(),setTimeout((function(){O().then(hK(regeneratorRuntime.mark((function o(){var i;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(CV.hasBetterCardBlurScore(n.blurScore,t)||(n.error=cZ.id_detector_error_blur),i=u.current,null!==n.imageBlob){o.next=6;break}SV.takePicture({canvas:i,quality:c}).then(function(){var t=hK(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,x(i);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,x(i);case 9:e(n);case 10:case"end":return o.stop()}}),o)}))))}),2e3)):SV.takePicture({canvas:u.current,quality:c}).then(function(){var t=hK(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,x(u.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,R,O,c,x]),D=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var r,n,s,c,f,g,y,C,B,_,x,T,R,O,N,D,M,L,U,j;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&v&&!h.current){e.next=2;break}return e.abrupt("return");case 2:b.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},w.current={imageBlob:null,blurScore:null,error:null,detectedCard:null},r=o.enableAutoCapture,n=o.enableBlurCheck,s=o.enableIdDetection,c=E.current,f=c.idCardModel,g=c.blazefaceModel,y=c.ableToUseModel,C=m.current,B=t.current,h.current=!0,_=C.cropX,x=C.cropY,T=C.cropWidth,R=C.cropHeight,O=C.cropWidthWithoutPadding,N=C.cropHeightWithoutPadding,(D=u.current).width=T,D.height=R,M=D.getContext("2d"),L=document.createElement("canvas"),U=L.getContext("2d"),j=function(){var e=hK(regeneratorRuntime.mark((function e(){var t,o,c,u,m,v,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(M.drawImage(B,_,x,T,R,0,0,T,R),t=performance.now(),S.current=!1,!s||!y){e.next=59;break}return o=null,e.next=7,f.predict(D,{detectThreshold:.3});case 7:if(!(c=e.sent).card){e.next=55;break}if(p.current=c.card,!w.current.imageBlob&&d.current.length>0&&(d.current=[],l.current=0),!v$({corners:c.card.corners,width:T,height:R})){e.next=52;break}if(!w$(c.card.corners)){e.next=49;break}if(u=m$(D,c.card.corners),!((m=IV.rectAreaRatio({small:{area:u.width*u.height},big:{area:O*N}}))<.5)){e.next=21;break}o=cZ.id_detector_card_too_small,e.next=47;break;case 21:if(!(m>.95)){e.next=25;break}o=cZ.id_detector_error_incomplete,e.next=47;break;case 25:return L.width=u.width,L.height=u.height,U.putImageData(u,0,0),e.next=30,y$({canvas:L});case 30:if(!e.sent){e.next=35;break}o=cZ.glare_detected,e.next=47;break;case 35:return e.next=37,k$({blazefaceModel:g,predictedIdCardCanvas:L,frontSide:a});case 37:if(o=e.sent){e.next=47;break}if(!n){e.next=47;break}if(v=CV.calculateIdCardBlurScore({canvas:L}),!k.current){e.next=44;break}return e.next=44,P({blurScore:v,detectedCard:c.card});case 44:if(!r){e.next=47;break}return e.next=47,A({blurScore:v,detectedCard:c.card});case 47:e.next=50;break;case 49:o=cZ.id_detector_validate_angle_error;case 50:e.next=53;break;case 52:o=cZ.id_detector_error_incomplete;case 53:e.next=56;break;case 55:o=cZ.id_detector_no_cards;case 56:return i(o),e.next=59,I();case 59:return t=Math.floor(performance.now()-t),b=180-t>0?180-t:0,e.next=63,new Promise((function(e){return setTimeout(e,b)}));case 63:h.current&&window.requestAnimationFrame(j);case 64:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(j);case 19:case"end":return e.stop()}}),e)}))),[t,o,v,a,i,A,P,I]);_w.useEffect((function(){var e=t.current;function o(){return(o=hK(regeneratorRuntime.mark((function t(){var r,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m.current=SV.analyzeVideoAndWindowSizes(e,n,.05),r=m.current,o=r.cropWidth,i=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(i)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,D();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&v&&function(){o.apply(this,arguments)}()}),[r,n,t,T,D,v]);var M=_w.useCallback((function(){T()}),[T]);return _w.useEffect((function(){return M}),[M]),{refWorkingCanvas:u,stopCheckFrame:T,checkFrame:D,warmupDone:v,takePictureManually:N,refAbleToRunBurstMode:B,refVirtualFrames:d}}({refVideo:r,shouldStart:t,cropArea:n,settings:o,onError:R,frontSide:a,onAutoCaptureSuccess:I,quality:f}),N=O.refWorkingCanvas,D=O.stopCheckFrame,M=O.checkFrame,L=O.warmupDone,U=O.takePictureManually,j=O.refAbleToRunBurstMode,F=O.refVirtualFrames,V=uZ({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),z=V.stopCheckFrame,q=V.splitVideos,H=V.resetRecordedVideos,K=V.checkFrame;!function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,i=e.onChange;_w.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,a=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==a?void 0:a.width,"canvas.height":null==a?void 0:a.height};i&&i(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[i,t,r,n,o])}({debug:B,refRecordedVideos:V.refRecordedVideos,refWorkingCanvas:N,refVideo:r,onChange:s});var W=_w.useCallback((function(){z(),D(),H(),u()}),[H,z,D,u]),G=_w.useCallback((function(){q()}),[q]),Q=lZ({lang:S,onAboutToTimeout:c,onSessionTimeout:W,onVideoTimeLimitReached:G,settings:o,shouldStartTimers:L&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),X=Q.stopTimers,Y=Q.startTimers,$=_w.useCallback((function(){p.current=!1}),[]),Z=_w.useCallback(hK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $(),Y(),e.next=4,Promise.all([K(),M()]);case 4:case"end":return e.stop()}}),e)}))),[$,Y,K,M]),J=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,f,h,m,v,b=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=b.length>0&&void 0!==b[0]?b[0]:{},r=t.imageBlob,n=t.error,i=t.detectedCard,s=t.captureTime,!p.current){e.next=3;break}return e.abrupt("return");case 3:return p.current=!0,g(!0),z(),D(),X(),R(null),c=null==o?void 0:o.enableVirtualCamHashes,u={},c&&(f=F).current.length>0&&(u=f.current.reduce((function(e,t,r){return bK(bK({},e),{},gK({},"hash".concat(r+1),t))}),u)),T(),nK.preWriteExif({mode:nK.MODE.ID_CARD,motionData:A,orientationData:P,startTime:w.current,endTime:Date.now()}),e.next=16,nK.writeExif({mode:nK.MODE.ID_CARD,imageData:bK({detectedCard:i,captureTime:s,blob:r},c?{vCam:u}:{}),enableExifData:null==o?void 0:o.enableExifData});case 16:if(h=e.sent,!d||!d.key){e.next=22;break}return v=d.key,e.next=21,Uq.encrypt({blob:h,key:v});case 21:m=e.sent;case 22:l({image:{blob:h,encrypted:m,detectedCard:i},error:n,recordedVideos:[]}),g(!1),y({tag:a?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-k.current)/1e3}});case 25:case"end":return e.stop()}}),e)}))),[z,D,X,R,l,a,y,d,A,P,T,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,F]);v.current=J;var ee=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),X(),z(),j.current||D(),e.next=6,U();case 6:return t=e.sent,e.next=9,J(t);case 9:g(!1),y({tag:a?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[U,J,X,j,z,D,y,a]);return _w.useEffect((function(){t&&(y({tag:a?"id_front":"id_back",event:"user_activity.start",log:{}}),w.current=Date.now(),x())}),[y,a,t,x]),_w.useEffect((function(){L&&(y({tag:a?"id_front":"id_back",event:"user_activity.show",log:{}}),y({tag:a?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-w.current}}),k.current=performance.now())}),[y,a,L]),{warmupDone:L,isProcessing:m,takePictureManually:ee,restartSession:Z,resetIsProcessingImageBlobTaken:$}},mZ=sM.IDCardMessage,gZ=_w.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,i=e.refVideo,a=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=CK(_w.useState({}),2),f=d[0],p=d[1],h=f.yDescription,m=f.yMessage,g=f.yCaptureButton,v=YF.useAsset("ic_camera.svg"),y=YF.useAsset("ic_loading.png"),b=CK(_w.useState(""),2),w=b[0],k=b[1],C=mF.useSDKSettings(),B=C.debug,S=C.lang,E=CK(_w.useState(null),2),_=E[0],x=E[1],T=CK(_w.useState(""),2),A=T[0],P=T[1],I=CK(_w.useState(null),2),R=I[0],O=I[1],N=wY(),D=N.showPopup,M=N.popupShown,L=N.popupType,U=_w.useCallback((function(e){P(null===e?"":jG(e.msg[S])({side:a?hY.FRONT[S]:hY.BACK[S]}))}),[S,a]),j=_w.useCallback((function(){x(""),D({popupType:kY})}),[D]),F=_w.useCallback((function(){x(""),c.apply(void 0,arguments)}),[c]),V=_w.useCallback((function(e){var t=e.curTimeLeft;x(jG(mZ.REMAINING_TIME[S])({x:t}))}),[S]),z=hZ({shouldStart:!0,refVideo:i,cropArea:R,settings:s,onModelErrorChange:U,frontSide:a,onDebugInfoChange:k,onSessionTimeout:j,onCaptureDone:F,onAboutToTimeout:V,outputEncryptionSettings:l}),q=z.warmupDone,H=z.isProcessing,K=z.takePictureManually,W=z.restartSession,G=z.resetIsProcessingImageBlobTaken,Q=_w.useCallback((function(){D({popupType:null}),G()}),[D,G]),X=_w.useCallback(hK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(),e.next=3,W();case 3:case"end":return e.stop()}}),e)}))),[W,Q]);_w.useEffect((function(){if(o){var e,t,r,i,a,s,c,l=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,h=o.lostY,m=o.clientHeight;n?(a=.7*(s=d-165),r=(c=(e=h+10)+45)+20,i=(t=c+s+10)+60):(a=PK.isMobile?l-6:Math.floor(.7*l),r=(c=(e=h+10)+50)+20,i=(t=c+(s=Math.floor(Math.min(a/1.5,m-2*h-80-100)))+10)+60);var g=Math.floor((l-a)/2)+f;O({x:g,y:c,width:a,height:s,surroundStyle:{opacity:.6,background:"#000"}});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:i};p(v),u(v)}}),[o,n,u]);var Y=_w.useCallback(hK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(""),e.next=3,K();case 3:case"end":return e.stop()}}),e)}))),[K]);return _w.useImperativeHandle(t,(function(){return{restartSession:X}}),[X]),_w.createElement(_w.Fragment,null,!q&&_w.createElement(lY,null),B&&_w.createElement(nY,null,w),H&&_w.createElement(tY,null,_w.createElement("img",{src:y,alt:"",className:"spin"})),R&&_w.createElement(aX,{x:"".concat(R.x,"px"),y:"".concat(R.y,"px"),width:"".concat(R.width,"px"),height:"".concat(R.height,"px"),surroundStyle:R.surroundStyle},_w.createElement(sY,{width:R.width,height:R.height,type:A?wX:bX})),!A&&_w.createElement(oY,{y:"".concat(h,"px"),className:"description"},r),A&&_w.createElement(iY,{y:"".concat(h,"px")},A),!H&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!A)&&_w.createElement(eY,{onClick:Y,y:"".concat(g,"px")},_w.createElement("img",{src:v,alt:""})),_&&_w.createElement(aY,{key:_,className:"message",y:"".concat(m,"px")},_),_w.createElement(yX,{open:M},L===kY&&_w.createElement(bY,{onOk:X,maxSessionTime:null==s?void 0:s.idCardSessionTime})))}));gZ.propTypes={usePortraitMask:_k.bool,description:_k.string,windowAndVideoInfo:_k.shape({}),refVideo:_k.shape({}),frontSide:_k.bool,settings:_k.shape({}),onCaptureDone:_k.func,onUISpacingChange:_k.func,outputEncryptionSettings:_k.shape({})},gZ.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var vZ,yZ,bZ=lE.div(dZ||(dZ=kK(["\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),wZ=lE.div(fZ||(fZ=kK(["\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")})),kZ=function(e){var t=e.children,r=e.y;return _w.createElement(bZ,{y:r,background:"#00ce78"},_w.createElement(wZ,{arrowSize:10,top:-10,color:"#00ce78"}),t)},CZ=lE.div(pZ||(pZ=kK(["\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),BZ={QR_INSTRUCTIONS_TEXT:{en:_w.createElement("span",null,"Please follow the instructions below to scan QR code:",_w.createElement("br",null),_w.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:_w.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",_w.createElement("br",null),_w.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:_w.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",_w.createElement("br",null),_w.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",_w.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:_w.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",_w.createElement("br",null),_w.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",_w.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"}},SZ=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,i=e.mr,a=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!==a&&(m.marginLeft=a,m.marginRight=a),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==i&&(m.marginRight=i),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),_w.cloneElement(t,{style:bK(bK({},h),m)})};SZ.propTypes={mt:_k.string,ml:_k.string,mr:_k.string,mb:_k.string,mx:_k.string,my:_k.string,pt:_k.string,pl:_k.string,pr:_k.string,pb:_k.string,px:_k.string,py:_k.string},SZ.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 EZ,_Z,xZ,TZ=lE.button(vZ||(vZ=kK(["\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})),AZ=lE.a(yZ||(yZ=kK(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),PZ=lE.div(EZ||(EZ=kK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),IZ=lE.div(_Z||(_Z=kK(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),RZ=lE.div(xZ||(xZ=kK(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),OZ=function(e){var t=e.onRetry,r=e.onSkip,n=mF.useSDKSettings().lang;return _w.createElement(PZ,null,_w.createElement(SZ,{mt:"25px"},_w.createElement(IZ,null,BZ.QR_INVALID_POPUP_TITLE[n])),_w.createElement(SZ,{mt:"30px"},_w.createElement(RZ,null,BZ.QR_INVALID_POPUP_DESCRIPTION[n])),_w.createElement(SZ,{mt:"30px"},_w.createElement(TZ,{onClick:t},BZ.QR_INVALID_POPUP_RETRY_BUTTON[n])),_w.createElement(SZ,{my:"20px"},_w.createElement(AZ,{onClick:r},BZ.QR_INVALID_POPUP_SKIP_BUTTON[n])))};OZ.propTypes={onRetry:_k.func,onSkip:_k.func},OZ.defaultProps={onRetry:function(){},onSkip:function(){}};var NZ,DZ,MZ,LZ,UZ,jZ,FZ,VZ=["children","ratio","padding"],zZ=lE.div(NZ||(NZ=kK(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),qZ=lE.div(DZ||(DZ=kK(["\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})),HZ=function(e){var t=e.children,r=e.ratio,n=e.padding,o=wK(e,VZ);return _w.createElement(zZ,vK({ratio:r},o),_w.createElement(qZ,{padding:n},t))};HZ.propTypes={children:_k.node,ratio:_k.number,padding:_k.string},HZ.defaultProps={children:null,ratio:4/3,padding:"0"};var KZ=lE.div(MZ||(MZ=kK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),WZ=lE.div(LZ||(LZ=kK(["\n background: #e7e6e6;\n width: 100%;\n"]))),GZ=lE.img(UZ||(UZ=kK(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),QZ=lE.div(jZ||(jZ=kK(["\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})),XZ=lE(QZ)(FZ||(FZ=kK(["\n white-space: nowrap;\n"]))),YZ=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=mF.useSDKSettings().lang,i=YF.useAsset("qr_code_banner.png"),a=_w.useRef(n),s=CK(_w.useState((function(){return jG(BZ.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),c=s[0],u=s[1],l=GF.useSDKTracking().sendEvent,d=_w.useRef(!1);return _w.useEffect((function(){l({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[l]),_w.useEffect((function(){var e=jG(BZ.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){a.current--,u(e({x:a.current})),a.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]),_w.createElement(KZ,null,_w.createElement(WZ,null,_w.createElement(HZ,{ratio:1.6},_w.createElement(GZ,{src:i}))),_w.createElement(SZ,{mt:"30px"},_w.createElement(QZ,null,BZ.QR_INSTRUCTIONS_TEXT[o])),_w.createElement(SZ,{mt:"30px"},_w.createElement(TZ,{onClick:function(){l({tag:"id_qr",event:"user_activity.click_start",log:{}}),d.current=!0,t()}},BZ.QR_INSTRUCTIONS_START_BUTTON[o])),_w.createElement(SZ,{my:"20px"},_w.createElement(XZ,null,c)))};YZ.propTypes={onClickStart:_k.func,onTimeout:_k.func,timeout:_k.number},YZ.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var $Z=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function ZZ(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 JZ=xK(TK((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 i=t;i<t+n;i++)for(var a=e;a<e+r;a++)this.set(a,i,!!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,i=0;i<this.size;i++)this.expTable[i]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(i=0;i<this.size-1;i++)this.logTable[this.expTable[i]]=i;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,i=t.coefficients;o.length>i.length&&(o=(r=[i,o])[0],i=r[1]);for(var a=new Uint8ClampedArray(i.length),s=i.length-o.length,c=0;c<s;c++)a[c]=i[c];for(c=s;c<i.length;c++)a[c]=n.addOrSubtractGF(o[c-s],i[c]);return new e(this.field,a)},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,i=t.coefficients,a=i.length,s=new Uint8ClampedArray(o+a-1),c=0;c<o;c++)for(var u=r[c],l=0;l<a;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,i[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),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],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),i=r(11),a=r(12);function s(e){var t=a.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=i.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 i=c;Object.keys(i||{}).forEach((function(e){i[e]=o[e]||i[e]}));var a="attemptBoth"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,u="onlyInvert"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,l=n.binarize(e,t,r,a),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==i.inversionAttempts&&"invertFirst"!==i.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 i=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,a){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new i(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 i(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 B=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<B&&(C=B)}m.set(v,g,C)}var S=n.BitMatrix.createEmpty(t,r),E=null;for(a&&(E=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 P=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var I=s.get(c,u);S.set(c,u,I<=P),a&&E.set(c,u,!(I<=P))}}return a?{binarized:S,inverted:E}:{binarized:S}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),i=r(9),a=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],i=e.height,a=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,i=e.alignmentPatternCenters;o<i.length;o++)for(var a=i[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===a&&6===u||6===a&&u===t-7||a===t-7&&6===u||r.setRegion(a-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=i-1;p>0;p-=2){6===p&&p--;for(var h=0;h<i;h++)for(var m=f?i-1-h:h,g=0;g<2;g++){var v=p-g;if(!a.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 a.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var i=t-9;i>=t-11;i--)n=c(e.get(i,o),n);var u=0;for(i=5;i>=0;i--)for(o=t-9;o>=t-11;o--)u=c(e.get(i,o),u);for(var l,d=1/0,f=0,p=a.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,i=0;for(n=o-1;n>=o-7;n--)i=c(e.get(8,n),i);for(r=o-8;r<o;r++)i=c(e.get(r,8),i);for(var a=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===i)return m;var g=s(t,h);g<a&&(l=m,a=g),t!==i&&(g=s(i,h))<a&&(l=m,a=g)}return a<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],i=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),i+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<i)return null;e=e.slice(0,i);for(var a=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<a;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=i.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,i=r(7),a=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],i=e.readBits(o);i>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var a=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+a,48+s,48+c),n+=a.toString()+s.toString()+c.toString(),i-=3}if(2===i){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");a=Math.floor(u/10),s=u%10,r.push(48+a,48+s),n+=a.toString()+s.toString()}else if(1===i){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],i=e.readBits(o);i>=2;){var a=e.readBits(11),s=Math.floor(a/45),u=a%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],i-=2}return 1===i&&(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],i=e.readBits(o),a=0;a<i;a++){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],i=e.readBits(o),s=0;s<i;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(a.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,a,c,f,p=new i.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,(a=m.bytes).push.apply(a,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<<(i=r-n);t=(this.bytes[this.byteOffset]&o)>>i,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 i;e>0&&(o=255>>(i=8-e)<<i,t=t<<e|(this.bytes[this.byteOffset]&o)>>i,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 i=new n.default(285,256,0),a=new o.default(i,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=a.evaluateAt(i.exp(u+i.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(i,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var i=t,a=r,s=e.zero,c=e.one;a.degree()>=n/2;){var u=i,l=s;if(s=c,(i=a).isZero())return null;a=u;for(var d=e.zero,f=i.getCoefficient(i.degree()),p=e.inverse(f);a.degree()>=i.degree()&&!a.isZero();){var h=a.degree()-i.degree(),m=e.multiply(a.getCoefficient(a.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),a=a.addOrSubtract(i.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),a.degree()>=i.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),a.multiply(v)]}(i,i.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,i=1;i<e.size&&o<r;i++)0===t.evaluateAt(i)&&(n[o]=e.inverse(i),o++);return o!==r?null:n}(i,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,i=new Array(o),a=0;a<o;a++){for(var s=e.inverse(r[a]),c=1,u=0;u<o;u++)a!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));i[a]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(i[a]=e.multiply(i[a],s))}return i}(i,f[1],p),m=0;m<p.length;m++){var g=r.length-1-i.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,i=e.y-t.y+r.y-n.y;if(0===o&&0===i)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 a=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=a*u-s*c,d=(o*u-s*i)/l,f=(a*i-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 i=o({x:3.5,y:3.5},t,r,n);return{a11:i.a22*i.a33-i.a23*i.a32,a12:i.a13*i.a32-i.a12*i.a33,a13:i.a12*i.a23-i.a13*i.a22,a21:i.a23*i.a31-i.a21*i.a33,a22:i.a11*i.a33-i.a13*i.a31,a23:i.a13*i.a21-i.a11*i.a23,a31:i.a21*i.a32-i.a22*i.a31,a32:i.a12*i.a31-i.a11*i.a32,a33:i.a11*i.a22-i.a12*i.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}),i=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),a=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=i.a13*e+i.a23*t+i.a33;return{x:(i.a11*e+i.a21*t+i.a31)/r,y:(i.a12*e+i.a22*t+i.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);a.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:a,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 i(e,t,r,o){var i,a,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?(i=Math.floor(e.y),a=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(i=Math.floor(e.x),a=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-i),f=Math.abs(c-a),p=Math.floor(-d/2),h=i<s?1:-1,m=a<c?1:-1,g=!0,v=i,y=a;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 a(e,t,r,n){var o,a=t.y-e.y,s=t.x-e.x,c=i(e,t,r,Math.ceil(n/2)),u=i(e,{x:e.x-s,y:e.y-a},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=a(e,{x:-1,y:e.y},r,t.length),o=a(e,{x:e.x,y:-1},r,t.length),i=a(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=a(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(i,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,i=Math.round(t.y);e.get(Math.round(o),i);)i--;for(var a=Math.round(t.y);e.get(Math.round(o),a);)a++;return{x:o,y:(i+a)/2}}function l(e,t,r,i,s){var u,l,d;try{u=function(e,t,r,i){var s=(o(a(e,r,i,5))/7+o(a(e,t,i,5))/7+o(a(r,e,i,5))/7+o(a(t,e,i,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}}(i,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-i.x+s.x,p=r.y-i.y+s.y,h=(n(i,s)+n(i,r))/2/d,m=1-3/h,g={x:i.x+m*(f-i.x),y:i.y+m*(p-i.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,i=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(i)))return o([t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1]),{x:r,y:i,score:c({x:Math.floor(r),y:Math.floor(i)},[1,1,1],e)+n({x:r,y:i},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=[],i=[],a=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var i=e.get(t,n);if(i===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=i;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&&!i,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&&i;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=a.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:a.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})),i.push.apply(i,a.filter((function(e){return e.bottom.y!==n}))),a=a.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}))),i.push.apply(i,a);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 i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],a=o(i)/i.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:a}}})).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,i,a,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=(i=[e,t,r])[0],u=i[1],l=i[2]):(c=(a=[e,r,t])[0],u=a[1],l=a[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,i,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,i,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 eJ(e){return tJ.apply(this,arguments)}function tJ(){return(tJ=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(i=n.getContext("2d"),o=i.getImageData(0,0,n.width,n.height)),!(a=JZ(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",a.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rJ(e){return nJ.apply(this,arguments)}function nJ(){return(nJ=hK(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),Q$.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 oJ,iJ,aJ,sJ,cJ,uJ,lJ=function(){var e=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,i=r,!n){e.next=6;break}return e.next=5,Wz.blobToCanvas({blob:n});case 5:i=e.sent;case 6:return a=i.getContext("2d"),e.next=9,eJ({imageData:a.getImageData(0,0,i.width,i.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,rJ({canvas:i,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)}}(),dJ=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onSessionTimeout,a=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=CK(_w.useState(!1),2),l=u[0],d=u[1],f=_w.useRef((function(){})),p=_w.useRef((function(){})),h=mF.useSDKSettings().lang,m=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.onResult,a=e.outputEncryptionSettings,s=_w.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=_w.useRef(!1),u=_w.useRef(null),l=CK(_w.useState(!1),2),d=l[0],f=l[1],p=_w.useRef({}),h=mF.useSDKSettings().customUrls;_w.useEffect((function(){function e(){return(e=hK(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,tZ({modelUrl:null==h?void 0:h.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,h]);var m=_w.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),g=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var r,n,l,f,h,g,v,y,b,w,k,C,B;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,g=t.current,c.current=!0,v=h.cropX,y=h.cropY,b=h.cropWidth,w=h.cropHeight,(k=s.current).width=b,k.height=w,C=k.getContext("2d"),B=function(){var e=hK(regeneratorRuntime.mark((function e(){var t,r,o,u,d,p,h,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C.drawImage(g,v,y,b,w,0,0,b,w),t=performance.now(),f){e.next=8;break}return e.next=5,ZZ({canvas:k,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,lJ({canvas:k,qrScannerResources:l});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=27;break}return m(),void 0,E=r.match($Z),o={valid:Boolean(E)},e.next=17,SV.takePicture({canvas:s.current});case 17:return u=e.sent,e.next=20,nK.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:!0});case 20:if(d=e.sent,!a||!a.key){e.next=26;break}return h=a.key,e.next=25,Uq.encrypt({blob:d,key:h});case 25:p=e.sent;case 26:i({result:r,validateResult:o,image:{blob:d,encrypted:p}});case 27:return S=180-t>0?180-t:0,e.next=30,new Promise((function(e){return setTimeout(e,S)}));case 30:c.current&&window.requestAnimationFrame(B);case 31:case"end":return e.stop()}var E}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(B);case 13:case"end":return e.stop()}}),e)}))),[t,o,d,i,m,a]),v=_w.useCallback((function(){m()}),[m]);return _w.useEffect((function(){var e=t.current;r||v(),d&&r&&n&&e&&e.videoWidth>0&&(u.current=SV.analyzeVideoAndWindowSizes(e,n,0),g())}),[r,n,t,m,g,d,v]),_w.useEffect((function(){return v}),[v]),{refWorkingCanvas:s,stopCheckFrame:m,checkFrame:g,warmupDone:d}}({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:_w.useCallback((function(){f.current.apply(f,arguments)}),[]),outputEncryptionSettings:c}),g=m.stopCheckFrame,v=m.checkFrame,y=m.warmupDone,b=uZ({refVideo:r,shouldStart:t&&y,cropArea:n,settings:o}),w=b.stopCheckFrame,k=b.refRecordedVideos,C=b.splitVideos,B=b.resetRecordedVideos,S=b.checkFrame;f.current=_w.useCallback((function(e){d(!0),w(),g(),p.current(),a(bK(bK({},e),{},{recordedVideos:k.current})),d(!1)}),[w,a,k,g]);var E=_w.useCallback((function(){w(),g();var e=BK(k.current);i({recordedVideos:e}),B()}),[B,w,g,i,k]),_=_w.useCallback((function(){C()}),[C]),x=lZ({lang:h,onAboutToTimeout:s,onSessionTimeout:E,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:_w.useCallback(hK(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 fJ(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,i=e.onCaptureDone,a=e.outputEncryptionSettings,s=CK(_w.useState(null),2),c=s[0],u=s[1],l=YF.useAsset("qr_capture_cursor.png"),d=CK(_w.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=mF.useSDKSettings().lang,v=GF.useSDKTracking().sendEvent,y=wY(),b=y.showPopup,w=y.popupShown,k=y.popupType,C=CK(_w.useState(!1),2),B=C[0],S=C[1],E=CK(_w.useState(null),2),_=E[0],x=E[1],T=YF.useAsset("ic_loading.png"),A=_w.useRef();_w.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),_w.useEffect((function(){b({popupType:BY})}),[b]),_w.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,i=PK.isMobile?Math.min(e-6,145):145,a=i,s=o+10,c=s+90,l=c+40,d=l+a+20,f=Math.floor((e-i)/2)+n;u({x:f,y:l,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var P=_w.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),i(e)}),[i,v]),I=_w.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}}),i(e)):(b({popupType:CY}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,i,v]),R=_w.useCallback((function(e){var t=e.curTimeLeft;x(jG(BZ.REMAINING_TIME[g])({x:t}))}),[g]),O=dJ({shouldStart:B,refVideo:n,cropArea:c,settings:o,onSessionTimeout:P,onCaptureDone:I,onAboutToTimeout:R,outputEncryptionSettings:a}),N=O.isProcessing,D=O.restartSession,M=O.warmupDone,L=_w.useCallback((function(){b({popupType:null})}),[b]),U=_w.useCallback(hK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(),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,L,v]),j=_w.useCallback((function(){L(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),i()}),[L,i,v]),F=_w.useCallback((function(){L(),setTimeout((function(){S(!0)}),200)}),[L]);return _w.createElement(_w.Fragment,null,!M&&_w.createElement(lY,{contentStyle:{maxWidth:"300px"}}),c&&_w.createElement(aX,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},_w.createElement("div",null,_w.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),_w.createElement(kZ,{y:"".concat(h,"px")},BZ.QR_TOOLTIP[g]),_&&_w.createElement(CZ,{key:_,className:"message",y:"".concat(m,"px")},_),N&&_w.createElement(tY,null,_w.createElement("img",{src:T,alt:"",className:"spin"})),_w.createElement(yX,{contentStyle:{maxWidth:"332px"},open:w},k===CY&&_w.createElement(OZ,{onRetry:U,onSkip:j}),k===BY&&_w.createElement(YZ,{onClickStart:F,onTimeout:F})))}fJ.propTypes={windowAndVideoInfo:_k.shape({}),onUISpacingChange:_k.func,refVideo:_k.shape({}),settings:_k.shape({}),onCaptureDone:_k.func,outputEncryptionSettings:_k.shape({})},fJ.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var pJ,hJ,mJ,gJ,vJ,yJ="SUCCESS",bJ="WARNING",wJ=(gK(oJ={},yJ,"52,206,95"),gK(oJ,bJ,"255,148,50"),oJ),kJ=(gK(iJ={},yJ,"✓"),gK(iJ,bJ,"!"),iJ),CJ=lE.div(aJ||(aJ=kK(["\n font-weight: normal;\n"]))),BJ=lE.div(sJ||(sJ=kK(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return XS(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],wJ[e.type],wJ[e.type],wJ[e.type])})),SJ=lE.div(cJ||(cJ=kK(["\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 XS(["rgb(",")"],wJ[e.type])})),EJ=lE.div(uJ||(uJ=kK(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),_J=function(e){var t=e.children,r=e.type,n=e.className;return _w.createElement(CJ,{className:n},_w.createElement(BJ,{type:r}),_w.createElement(EJ,null,_w.createElement(SJ,{type:r},kJ[r]),t),_w.createElement(BJ,{type:r}))};_J.propTypes={children:_k.node,type:_k.string,className:_k.string},_J.defaultProps={children:null,type:yJ,className:""};var xJ,TJ=lE.div(pJ||(pJ=kK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),AJ=lE.div(hJ||(hJ=kK(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),PJ=lE.button(mJ||(mJ=kK(["\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})),IJ=lE.img(gJ||(gJ=kK(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),RJ=lE.div(vJ||(vJ=kK(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),OJ=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,i=e.hasValidQR,a=e.frontSide,s=CK(_w.useState(null),2),c=s[0],u=s[1],l=mF.useSDKSettings().lang,d=GF.useSDKTracking().sendEvent;return _w.useEffect((function(){d({tag:a?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[a,d]),_w.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),_w.createElement(TJ,null,null!==i&&_w.createElement(SZ,{mb:"20px"},_w.createElement("div",null,_w.createElement(_J,{type:i?yJ:bJ},i?hY.CONFIRM_POPUP_VALID_QR[l]:hY.CONFIRM_POPUP_INVALID_QR[l]))),_w.createElement(HZ,{ratio:1.5},_w.createElement(IJ,{src:c})),o&&_w.createElement(AJ,{className:"confirm-popup-error-message"},o.msg[l]),_w.createElement(RJ,null,_w.createElement(PJ,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},hY.BTN_TRY_AGAIN[l]),_w.createElement(PJ,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},hY.BTN_USE_THIS_PICTURE[l])))};OJ.propTypes={imageTaken:_k.shape({}),error:_k.shape({msg:_k.shape({})}),onConfirm:_k.func,onTryAgain:_k.func,hasValidQR:_k.bool,frontSide:_k.bool},OJ.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0},fE(xJ||(xJ=kK(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),_k.shape({}),_k.func,_k.func,_k.shape({}),_k.string,_k.shape({}),_k.shape({CloseCameraButton:_k.node}),_k.bool,_k.shape({}).isRequired,sM.IDCardSide;var NJ=sM.IDCardType,DJ=(sM.Errors,{ID_CARD:"id_card",QR_CODE:"qr_code"}),MJ=[{scannerType:DJ.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:sM.IDCardSide.FRONT,cardType:NJ.VN,enableConfirmPopup:!0},{scannerType:DJ.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:sM.IDCardSide.BACK,cardType:NJ.VN,enableConfirmPopup:!0}],LJ=function(){this.__data__=new KY,this.size=0},UJ=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},jJ=function(e){return this.__data__.get(e)},FJ=function(e){return this.__data__.has(e)},VJ=function(e,t){var r=this.__data__;if(r instanceof KY){var n=r.__data__;if(!WY||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new t$(n)}return r.set(e,t),this.size=r.size,this};function zJ(e){var t=this.__data__=new KY(e);this.size=t.size}zJ.prototype.clear=LJ,zJ.prototype.delete=UJ,zJ.prototype.get=jJ,zJ.prototype.has=FJ,zJ.prototype.set=VJ;var qJ,HJ=zJ,KJ=function(e,t,r){(void 0!==r&&!cW(e[t],r)||void 0===r&&!(t in e))&&sW(e,t,r)},WJ=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),a=i.length;a--;){var s=i[++n];if(!1===t(o[s],s,o))break}return e},GJ=TK((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?OK.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}})),QJ=OK.Uint8Array,XJ=function(e){var t=new e.constructor(e.byteLength);return new QJ(t).set(new QJ(e)),t},YJ=function(e,t){var r=t?XJ(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},$J=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t},ZJ=Object.create,JJ=function(){function e(){}return function(t){if(!HK(t))return{};if(ZJ)return ZJ(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),e3=function(e){return"function"!=typeof e.constructor||QW(e)?{}:JJ(tG(e))},t3=function(e){return TW(e)&&CW(e)},r3=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},n3=function(e){return dW(e,ZW(e))},o3=function(e,t,r,n,o,i,a){var s=r3(e,r),c=r3(t,r),u=a.get(c);if(u)KJ(e,r,u);else{var l=i?i(s,c,r+"",e,t,a):void 0,d=void 0===l;if(d){var f=NW(c),p=!f&&MW(c),h=!f&&!p&&HW(c);l=c,f||p||h?NW(s)?l=s:t3(s)?l=$J(s):p?(d=!1,l=GJ(c,!0)):h?(d=!1,l=YJ(c,!0)):l=[]:sG(c)||OW(c)?(l=s,OW(s)?l=n3(s):HK(s)&&!KK(s)||(l=e3(c))):d=!1}d&&(a.set(c,l),o(l,c,n,i,a),a.delete(c)),KJ(e,r,l)}},i3=function e(t,r,n,o,i){t!==r&&WJ(r,(function(a,s){if(i||(i=new HJ),HK(a))o3(t,r,s,n,e,o,i);else{var c=o?o(r3(t,s),a,s+"",t,r,i):void 0;void 0===c&&(c=a),KJ(t,s,c)}}),ZW)},a3=(_W((function(e,t,r){i3(e,t,r)})),{data:{settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},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:!0,mobile:!1}}}}}});sM.Errors,lE.div(qJ||(qJ=kK(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"]))),_k.shape({}),_k.shape({}),_k.func,_k.func,_k.func,_k.arrayOf(_k.shape({})),_k.func,_k.shape({});var s3=o((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),i=r(0),a=i.BROWSER_TYPES,s=i.OS_TYPES,c=i.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(),B=y.getUA(),S=a.CHROME,E=a.CHROMIUM,_=a.IE,x=a.INTERNET_EXPLORER,T=a.OPERA,A=a.FIREFOX,P=a.SAFARI,I=a.EDGE,R=a.YANDEX,O=a.MOBILE_SAFARI,N=c.MOBILE,D=c.TABLET,M=c.SMART_TV,L=c.BROWSER,U=c.WEARABLE,j=c.CONSOLE,F=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 B&&-1!==B.indexOf("Edg/"))},W=function(){return b.name===I},G=function(){return v("iPad")},Q=w.type===M,X=w.type===j,Y=w.type===U,$=b.name===O||G(),Z=b.name===E,J=function(){switch(w.type){case N:case D:return!0;default:return!1}}()||G(),ee=w.type===N,te=w.type===D||G(),re=w.type===L,ne=C.name===F,oe=C.name===V,ie=C.name===z||G(),ae=b.name===S,se=b.name===A,ce=b.name===P||b.name===O,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=B,ke=W()||K(),Ce=b.name===R,Be=w.type,Se=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Ee=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(),Pe=W(),Ie=C.name===q,Re=C.name===H,Oe=l(w.type);e.exports={deviceDetect:function(){var e=Oe.isBrowser,t=Oe.isMobile,r=Oe.isTablet,n=Oe.isSmartTV,o=Oe.isConsole,i=Oe.isWearable;return e?d(e,b,k,C,B):n?m(n,k,C,B):o?h(o,k,C,B):t||r?f(Oe,w,C,B):i?p(i,k,C,B):void 0},isSmartTV:Q,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ie,isChrome:ae,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:Be,isIOS13:Se,isIPad13:Ee,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Pe,isWindows:Ie,isMacOs:Re}},function(e,t,r){var n;
76
+ */function EQ(e){if("object"==Ey(e)&&null!==e){var t=e.$$typeof;switch(t){case sQ:switch(e=e.type){case hQ:case mQ:case uQ:case dQ:case lQ:case vQ:return e;default:switch(e=e&&e.$$typeof){case pQ:case gQ:case wQ:case bQ:case fQ:return e;default:return t}}case cQ:return t}}}function _Q(e){return EQ(e)===mQ}var xQ={AsyncMode:hQ,ConcurrentMode:mQ,ContextConsumer:pQ,ContextProvider:fQ,Element:sQ,ForwardRef:gQ,Fragment:uQ,Lazy:wQ,Memo:bQ,Portal:cQ,Profiler:dQ,StrictMode:lQ,Suspense:vQ,isAsyncMode:function(e){return _Q(e)||EQ(e)===hQ},isConcurrentMode:_Q,isContextConsumer:function(e){return EQ(e)===pQ},isContextProvider:function(e){return EQ(e)===fQ},isElement:function(e){return"object"==Ey(e)&&null!==e&&e.$$typeof===sQ},isForwardRef:function(e){return EQ(e)===gQ},isFragment:function(e){return EQ(e)===uQ},isLazy:function(e){return EQ(e)===wQ},isMemo:function(e){return EQ(e)===bQ},isPortal:function(e){return EQ(e)===cQ},isProfiler:function(e){return EQ(e)===dQ},isStrictMode:function(e){return EQ(e)===lQ},isSuspense:function(e){return EQ(e)===vQ},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===uQ||e===mQ||e===dQ||e===lQ||e===vQ||e===yQ||"object"==Ey(e)&&null!==e&&(e.$$typeof===wQ||e.$$typeof===bQ||e.$$typeof===fQ||e.$$typeof===pQ||e.$$typeof===gQ||e.$$typeof===CQ||e.$$typeof===BQ||e.$$typeof===SQ||e.$$typeof===kQ)},typeOf:EQ},TQ=(TK((function(e,t){})),TK((function(e){e.exports=xQ}))),AQ={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},PQ={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},IQ={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},RQ={};function OQ(e){return TQ.isMemo(e)?IQ:RQ[e.$$typeof]||AQ}RQ[TQ.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},RQ[TQ.Memo]=IQ;var NQ=Object.defineProperty,DQ=Object.getOwnPropertyNames,MQ=Object.getOwnPropertySymbols,LQ=Object.getOwnPropertyDescriptor,UQ=Object.getPrototypeOf,jQ=Object.prototype,FQ=function e(t,r,n){if("string"!=typeof r){if(jQ){var o=UQ(r);o&&o!==jQ&&e(t,o,n)}var i=DQ(r);MQ&&(i=i.concat(MQ(r)));for(var a=OQ(t),s=OQ(r),c=0;c<i.length;++c){var u=i[c];if(!(PQ[u]||n&&n[u]||s&&s[u]||a&&a[u])){var l=LQ(r,u);try{NQ(t,u,l)}catch(e){}}}}return t};function VQ(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===fK(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 zQ,qQ,HQ,KQ,WQ,GQ=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],QQ=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&&GQ.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},XQ=function(e){return!e||1===navigator.maxTouchPoints||navigator.plugins.length>0},YQ=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}}},$Q=sM.Errors,ZQ=lE.div(zQ||(zQ=kK(["\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;"})),JQ=lE.video(qQ||(qQ=kK(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),eX=lE.div(HQ||(HQ=kK(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),tX=lE(eX)(KQ||(KQ=kK(["\n z-index: ",";\n position: absolute;\n top: 20px;\n right: 20px;\n width: 20px;\n"])),1100),rX=lE.div(WQ||(WQ=kK(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),nX=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 oX(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,i=e.onVideoPlayed,a=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=_w.useRef(),g=mF.useSDKSettings().lang,v=GF.useSDKTracking().sendEvent,y=YF.useAsset("ic_close.png"),b=CK(_w.useState(""),2),w=b[0],k=b[1],C=_w.useRef(!1),B=_w.useRef(!1),S=_w.useRef(!1),E=_w.useRef(),_=_w.useRef([]),x=_w.useRef(""),T=_w.useCallback((function(e){u&&u(e)}),[u]),A=_w.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(E)}),[c]);function P(){return I.apply(this,arguments)}function I(){return(I=hK(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,VQ();case 3:t=e.sent,_.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),nK.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)),_w.useEffect((function(){return function(){S.current=!0}}),[]);var R=_w.useCallback((function(){E.current||(E.current=setTimeout((function(){C.current||(k($Q.camera_timeout.msg[g]),T($Q.camera_timeout))}),2e4))}),[g,T]),O=_w.useCallback(function(){var e=hK(regeneratorRuntime.mark((function e(t){var n,o,i,a,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=p.length>1&&void 0!==p[1]&&p[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=PK.isMobile?PK.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:1650},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:9999}},i=YQ(),a=i.updateTime,c=i.getStart,u=i.getEnd,e.prev=8,l=s||o,a(performance.now(),"start"),XQ(PK.isMobile)&&r&&(l={}),n&&(l={}),nK.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),e.next=16,nX.getUserMedia({audio:!1,video:bK(bK({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)});case 16:return d=e.sent,e.next=19,P();case 19:if(R(),d){e.next=24;break}return k($Q.not_supported.msg[g]),T($Q.not_supported),e.abrupt("return",null);case 24:a(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{f=d.getVideoTracks()[0].getSettings(),nK.addExifData("device_info.camera_label_dimension.got","".concat(f.width,"x").concat(f.height))}catch(e){}return e.abrupt("return",d);case 31:e.prev=31,e.t0=e.catch(8),a(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k($Q.no_permission.msg[g]),T($Q.no_permission),B.current=!0,v({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):B.current&&("NotReadableError"===e.t0.name?(T($Q.not_readable),k($Q.not_readable.msg[g])):(k(e.t0.message),T({code:e.t0.name||e.t0.code,message:e.t0.message})));case 35:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 37:case"end":return e.stop()}}),e,null,[[8,31]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,T,h,R,v]),N=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var t,r,n,o,a,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!=(a=c.current)&&null!==(t=a.srcObject)&&void 0!==t&&t.id&&null!=a&&null!==(r=a.srcObject)&&void 0!==r&&r.active&&C.current)){e.next=5;break}return e.abrupt("return");case 5:return a.oncanplaythrough=function(){var e,t,r;a.play(),nK.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=SV.analyzeVideoAndWindowSizes(a),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));i&&i({clientWidth:n,clientHeight:o,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,O(n,o);case 8:s=e.sent,u=QQ(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&&N(f[0].deviceId)),s||B.current||(nK.addExifData("device_info.camera_label_retry","yes"),B.current=!0,N(n,!0)),s&&S.current&&(c.current.srcObject=s,A()),!s||S.current||d||(a.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,O,i,p,A]);_w.useEffect((function(){function e(){return(e=hK(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,N();case 2:return e.next=4,VQ();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(),N(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return!nX||PK.browserName&&["facebook"].includes(PK.browserName.toLowerCase())||PK.getUA.includes("Zalo iOS")?(k($Q.not_supported.msg[g]),T($Q.not_supported)):t&&(PK.isAndroid&&!1===r?function(){e.apply(this,arguments)}():N()),function(){S.current&&A()}}),[c,g,r,N,A,T]);var D=_w.useCallback((function(){A(),n&&n(),v({tag:"result",event:"user_activity.cancel",log:{}})}),[n,A,v]);return _w.createElement(ZQ,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!w)return null;var e=$Q.no_permission.msg[g];return w===e&&PK.isIOS?_w.createElement(rX,null,w," ",_w.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):_w.createElement(rX,null,w)}(),_w.createElement(JQ,{ref:c,playsInline:!0,muted:!0,flipHorizontal:a,className:d,scale:f}),o,l?_w.cloneElement(l,{onClick:D,"data-testid":"close-camera"}):_w.createElement(tX,{onClick:D,"data-testid":"close-camera"},_w.createElement("img",{src:y,alt:""})))}oX.propTypes={checkCameraMode:_k.bool,frontCamera:_k.bool,onClose:_k.func,onError:_k.func,onVideoPlayed:_k.func,children:_k.node,flipHorizontal:_k.bool,videoSettings:_k.object,refVideo:_k.object,closeButton:_k.node,videoClassName:_k.string,scale:_k.number,defaultCameraId:_k.string,onWarning:_k.func},oX.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},function(e,t,r){var n=function(t){Dy(o,t);var n=Hy(o);function o(){var e;return Ty(this,o),(e=n.apply(this,arguments)).updateDebounced=iQ(e.forceUpdate,250,r),e}return Py(o,[{key:"shouldComponentUpdate",value:function(){return this.updateDebounced(),!1}},{key:"componentWillUnmount",value:function(){this.updateDebounced.cancel()}},{key:"render",value:function(){return _w.createElement(e,Object.assign({},this.props))}}]),o}(_w.Component);n.displayName="debounceRender(".concat(e.displayName||e.name||"Component",")"),FQ(n,e)}(oX);var iX,aX=lE(HG)(iX||(iX=kK(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: ",";\n"])),1010);function sX(){return(sX=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)}var cX,uX="undefined"!=typeof window?_w.useLayoutEffect:_w.useEffect,lX={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}}},dX=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],fX=function(e,t,r,n,o){var i=o.offsetX,a=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-a:p+a,left:h="left"===c[0]?h-i:h+i,transform:m,arrowLeft:v,arrowTop:g}},pX=function(e,t,r,n,o,i){var a=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}(i),d=Array.isArray(r)?r:[r];for((i||Array.isArray(r))&&(d=[].concat(d,dX));u<d.length;){var f={top:(c=fX(e,t,d[u],n,{offsetX:a,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},hX=0,mX=_w.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,o=e.onOpen,i=void 0===o?function(){}:o,a=e.onClose,s=void 0===a?function(){}:a,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,B=void 0===C?["click"]:C,S=e.contentStyle,E=void 0===S?{}:S,_=e.arrowStyle,x=void 0===_?{}:_,T=e.overlayStyle,A=void 0===T?{}:T,P=e.className,I=void 0===P?"":P,R=e.position,O=void 0===R?"bottom center":R,N=e.modal,D=void 0!==N&&N,M=e.lockScroll,L=void 0!==M&&M,U=e.arrow,j=void 0===U||U,F=e.offsetX,V=void 0===F?0:F,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,$=_w.useState(d||u),Z=$[0],J=$[1],ee=_w.useRef(null),te=_w.useRef(null),re=_w.useRef(null),ne=_w.useRef(null),oe=_w.useRef("popup-"+ ++hX),ie=!!D||!n,ae=_w.useRef(0);uX((function(){return Z?(ne.current=document.activeElement,ye(),me(),pe()):he(),function(){clearTimeout(ae.current)}}),[Z]),_w.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return i(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ie&&(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(ae.current),ae.current=setTimeout((function(){return se(e)}),K)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(ae.current),ae.current=setTimeout((function(){return ce(e)}),G)},pe=function(){ie&&L&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ie&&L&&(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()};_w.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var ge,ve,ye=function(){if(!ie&&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=pX(r,n,O,j,{offsetX:V,offsetY:q},X);te.current.style.top=o.top+window.scrollY+"px",te.current.style.left=o.left+window.scrollX+"px",j&&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)}};void 0===(ve=k)&&(ve=!0),_w.useEffect((function(){if(ve){var e=function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){"Escape"===e.key&&ge(e)}));return document.addEventListener("keyup",e),function(){ve&&document.removeEventListener("keyup",e)}}}),[ge=ce,ve]),function(e,t){void 0===t&&(t=!0),_w.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 i=o[0],a=o[o.length-1];t.shiftKey&&document.activeElement===i?(t.preventDefault(),a.focus()):document.activeElement===a&&(t.preventDefault(),i.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])}(te,Z&&ie),function(e,t){void 0===t&&(t=!0),_w.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),_w.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 _w.createElement("div",Object.assign({},(e=ie?lX.popupContent.modal:lX.popupContent.tooltip,t={className:"popup-content "+(""!==I?I.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:sX({},e,E,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!D&&B.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ie?"dialog":"tooltip",id:oe.current}),j&&!ie&&_w.createElement("div",{ref:re,style:lX.popupArrow},_w.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==I?I.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:sX({position:"absolute"},x)},_w.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},ke=!(B.indexOf("hover")>=0),Ce=ie?lX.overlay.modal:lX.overlay.tooltip,Be=[ke&&_w.createElement("div",{key:"O","data-testid":"overlay","data-popup":ie?"modal":"tooltip",className:"popup-overlay "+(""!==I?I.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:sX({},Ce,A,{pointerEvents:v&&m||ie?"auto":"none"}),onClick:v&&m?ce:void 0,tabIndex:-1},ie&&we()),!ie&&we()];return _w.createElement(_w.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":oe.current},t=Array.isArray(B)?B:[B],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 i=n(Z);return!!n&&_w.cloneElement(i,e)}return!!n&&_w.cloneElement(n,e)}(),Z&&oM.createPortal(Be,(null===(be=document.getElementById("popup-root"))&&((be=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(be)),be)))})),gX=fE(cX||(cX=kK(["\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"]))),vX=["open","children","overlayStyle"],yX=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=wK(e,vX);return _w.createElement(_w.Fragment,null,t&&_w.createElement(_w.Fragment,null,_w.createElement(mX,vK({overlayStyle:bK(bK({},n),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),_w.createElement(gX,null)))};yX.propTypes={open:_k.bool,children:_k.node,overlayStyle:_k.shape({})},yX.defaultProps={open:!1,children:null,overlayStyle:{}};var bX="default",wX="error";function kX(e){var t=e.className,r=e.width,n=e.height,o=e.type,i=e.strokeStyles,a=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=_w.useMemo((function(){var e;return bK((gK(e={},bX,{fill:"none",strokeWidth:a,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),gK(e,wX,{fill:"rgba(234,50,35, 0.1)",strokeWidth:a,stroke:"#ea3223"}),e),i)}),[a,i]),l=s+.8*a,d=u[o];return _w.createElement("svg",{width:r,height:n,className:t},_w.createElement("rect",{x:a/2,y:a/2,rx:s,ry:s,width:r-a,height:n-a,style:d}),_w.createElement("path",{d:"M0,".concat(l," Q0,0 ").concat(l,",0 L0,0 Z"),style:c}),_w.createElement("path",{d:"M0,".concat(n-l," Q0,").concat(n," ").concat(l,",").concat(n," L0,").concat(n," Z"),style:c}),_w.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}),_w.createElement("path",{d:"M".concat(r-l,",0 Q").concat(r,",0 ").concat(r,",").concat(l," L").concat(r,",0 Z"),style:c}))}kX.propTypes={className:_k.string,width:_k.number,height:_k.number,strokeWidth:_k.number,strokeStyles:_k.shape({}),type:_k.oneOf([bX,wX]),radius:_k.number,paddingStyle:_k.shape({})},kX.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:bX,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var CX,BX,SX,EX,_X,xX,TX,AX,PX,IX,RX,OX,NX,DX,MX,LX,UX,jX,FX=pE(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),VX=pE(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),zX=XS([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],FX,500,VX,500),qX=pE(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),HX=pE(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20),KX=(XS([".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;}"],qX,HX),pE(["from,to{opacity:1;}50%{opacity:0;}"])),WX=(XS([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],KX),lE.div(CX||(CX=kK(["\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),pE(["from{background:#000;}to{}"])),GX=XS([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],WX,300),QX=(lE.div(BX||(BX=kK(["\n ","\n"])),GX),pE(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"])),XX=XS([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],QX),YX=["width","height","type"],$X=lE(kX)(SX||(SX=kK([""]))),ZX=lE.img(EX||(EX=kK(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),JX=lE.div(_X||(_X=kK(["\n ","\n ","\n"])),zX,XX),eY=(lE.img(xX||(xX=kK(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),lE.div(TX||(TX=kK(["\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,PK.isMobile?XS(["top:",";"],(function(e){return e.y})):XS(["bottom:","px;"],10))),tY=lE.div(AX||(AX=kK(["\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),rY=lE.div(PX||(PX=kK(["\n color: #fff;\n text-align: center;\n"]))),nY=(lE.div(IX||(IX=kK(["\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),lE.div(RX||(RX=kK(["\n display: flex;\n align-items: center;\n"]))),lE(rY)(OX||(OX=kK(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),lE(rY)(NX||(NX=kK(["\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)),oY=lE(rY)(DX||(DX=kK(["\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),iY=lE(oY)(MX||(MX=kK(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),aY=lE(rY)(LX||(LX=kK(["\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),sY=(lE.div(UX||(UX=kK(["\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=wK(e,YX),i=YF.useAsset("id_card_frame.png"),a=YF.useAsset("id_card_frame_error.png");return _w.createElement(JX,{width:t,height:r},_w.createElement(ZX,{src:n===wX?a:i,width:t,height:r}),_w.createElement($X,vK({width:t,height:r,type:n},o)))}),cY={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},uY=lE.div(jX||(jX=kK(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),lY=function(e){var t=e.contentStyle,r=mF.useSDKSettings(),n=r.lang,o=r.warmupMessage,i=o?o[n]:cY.WARMUP_INTRO[n];return _w.createElement(yX,{open:!0,contentStyle:t},_w.createElement(uY,{className:"warmup-message"},i))};lY.propTypes={contentStyle:_k.shape({})},lY.defaultProps={contentStyle:{}};var dY,fY,pY,hY={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"}},mY=sM.IDCardMessage,gY=lE.div(dY||(dY=kK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),vY=lE.div(fY||(fY=kK(["\n text-align: center;\n font-size: 1rem;\n"]))),yY=lE.button(pY||(pY=kK(["\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})),bY=function(e){var t=e.onOk,r=e.maxSessionTime,n=mF.useSDKSettings().lang;return _w.createElement(gY,null,_w.createElement(vY,{className:"popup-message"},jG(mY.TIMEOUT_INSTRUCTION[n])({x:r})),_w.createElement(yY,{className:"popup-button",onClick:t},hY.BTN_OK[n]))};bY.propTypes={onOk:_k.func,maxSessionTime:_k.number},bY.defaultProps={onOk:function(){},maxSessionTime:30};var wY=function(){var e=CK(_w.useState(!1),2),t=e[0],r=e[1],n=CK(_w.useState(null),2),o=n[0],i=n[1],a=CK(_w.useState({}),2),s=a[0],c=a[1];return{showPopup:_w.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),i(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},kY="SESSION_TIMEOUT",CY="QR_INVALID",BY="QR_INSTRUCTIONS",SY=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,EY=/^\w*$/,_Y=function(e,t){if(NW(e))return!1;var r=Ey(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!BG(e))||EY.test(e)||!SY.test(e)||null!=t&&e in Object(t)},xY=iW(Object,"create"),TY=function(){this.__data__=xY?xY(null):{},this.size=0},AY=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},PY=Object.prototype.hasOwnProperty,IY=function(e){var t=this.__data__;if(xY){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return PY.call(t,e)?t[e]:void 0},RY=Object.prototype.hasOwnProperty,OY=function(e){var t=this.__data__;return xY?void 0!==t[e]:RY.call(t,e)},NY=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=xY&&void 0===t?"__lodash_hash_undefined__":t,this};function DY(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])}}DY.prototype.clear=TY,DY.prototype.delete=AY,DY.prototype.get=IY,DY.prototype.has=OY,DY.prototype.set=NY;var MY=DY,LY=function(){this.__data__=[],this.size=0},UY=function(e,t){for(var r=e.length;r--;)if(cW(e[r][0],t))return r;return-1},jY=Array.prototype.splice,FY=function(e){var t=this.__data__,r=UY(t,e);return!(r<0||(r==t.length-1?t.pop():jY.call(t,r,1),--this.size,0))},VY=function(e){var t=this.__data__,r=UY(t,e);return r<0?void 0:t[r][1]},zY=function(e){return UY(this.__data__,e)>-1},qY=function(e,t){var r=this.__data__,n=UY(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function HY(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])}}HY.prototype.clear=LY,HY.prototype.delete=FY,HY.prototype.get=VY,HY.prototype.has=zY,HY.prototype.set=qY;var KY=HY,WY=iW(OK,"Map"),GY=function(){this.size=0,this.__data__={hash:new MY,map:new(WY||KY),string:new MY}},QY=function(e){var t=Ey(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},XY=function(e,t){var r=e.__data__;return QY(t)?r["string"==typeof t?"string":"hash"]:r.map},YY=function(e){var t=XY(this,e).delete(e);return this.size-=t?1:0,t},$Y=function(e){return XY(this,e).get(e)},ZY=function(e){return XY(this,e).has(e)},JY=function(e,t){var r=XY(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function e$(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])}}e$.prototype.clear=GY,e$.prototype.delete=YY,e$.prototype.get=$Y,e$.prototype.has=ZY,e$.prototype.set=JY;var t$=e$;function r$(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],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(r$.Cache||t$),r}r$.Cache=t$;var n$=r$,o$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i$=/\\(\\)?/g,a$=function(e){var t=n$((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o$,(function(e,r,n,o){t.push(n?o.replace(i$,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),s$=function(e,t){return NW(e)?e:_Y(e,t)?[e]:a$(xG(e))},c$=function(e){if("string"==typeof e||BG(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},u$=function(e,t){for(var r=0,n=(t=s$(t,e)).length;null!=e&&r<n;)e=e[c$(t[r++])];return r&&r==n?e:void 0},l$=function(e,t,r){var n=null==e?void 0:u$(e,t);return void 0===n?r:n},d$=sM.Errors;function f$(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function p$(e,t){return Math.sqrt(f$(e,t))}function h$(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=void 0===r?.4:r,o=window,i=o.cv,a=t.width,s=t.height,c=n;c<1&&(c=parseInt(.5*(s+a)*c,10));var u=i.imread(t),l=new i.Mat;return i.copyMakeBorder(u,l,c,c,c,c,i.BORDER_CONSTANT,new i.Scalar(0,0,0,255)),u.delete(),{mat:l,margin:c}}function m$(e,t){var r=window.cv,n=CK(t.map((function(e){return e.location})),4),o=n[0],i=n[1],a=n[2],s=n[3],c=p$(a,s),u=p$(i,o),l=Math.max(c,u),d=p$(i,a),f=p$(o,s),p=Math.max(d,f),h=[o.x,o.y,i.x,i.y,a.x,a.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 g$(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},i=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),a=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(i*a))/Math.PI}function v$(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,a=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),i=Math.min(i,n),a=Math.max(a,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&i/n>=c&&(n-s)/n>=c&&(r-a)/r>=c}function y$(){return b$.apply(this,arguments)}function b$(){return(b$=hK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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,i=r.width,a=r.height,s=Math.floor(i*o),c=Math.floor(a*o),u=i-2*s,l=a-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",Yz.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function w$(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,i=g$(e[r].location,e[n].location,e[o].location);if(i<70||i>110)return!1}return!0}function k$(e){return C$.apply(this,arguments)}function C$(){return(C$=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,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,i=n.width,a=n.height,s=Math.floor(i/3),c=Math.floor(4*a/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(a/5),s,c,0,0,s,c),e.next=12,VV.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=CK(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4||IV.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[VV.SIZE,VV.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",d$.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",d$.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",d$.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 B$=function(){var e=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E,_,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=CK(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===(i=g.location)||void 0===i?void 0:i.y)-100,w=performance.now(),(k=u.current).width=y,k.height=b,(C=k.getContext("2d")).drawImage(c,(null==m||null===(a=m.location)||void 0===a?void 0:a.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=hK(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jF.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(BK(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),B=180-w>0?180-w:0,e.next=18,new Promise((function(e){return setTimeout(e,B)}));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===(E=m.location)||void 0===E?void 0:E.y)+50,y,b,0,0,y,b),e.next=24,new Promise((function(e){k.toBlob(function(){var t=hK(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jF.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(BK(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)}}(),S$=/\s/,E$=function(e){for(var t=e.length;t--&&S$.test(e.charAt(t)););return t},_$=/^\s+/,x$=function(e){return e?e.slice(0,E$(e)+1).replace(_$,""):e},T$=/^[-+]0x[0-9a-f]+$/i,A$=/^0b[01]+$/i,P$=/^0o[0-7]+$/i,I$=parseInt,R$=function(e){if("number"==typeof e)return e;if(BG(e))return NaN;if(HK(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=HK(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=x$(e);var r=A$.test(e);return r||P$.test(e)?I$(e.slice(2),r?2:8):T$.test(e)?NaN:+e},O$=function(e){return e?1/0===(e=R$(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},N$=function(e){var t=O$(e),r=t%1;return t==t?r?t-r:t:0},D$=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=N$(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},M$=function(e){return D$(2,e)},L$=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e},U$=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=R$(r))==r?r:0),void 0!==t&&(t=(t=R$(t))==t?t:0),L$(R$(e),t,r)},j$="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function F$(){return(F$=hK(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?j$: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",hK(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 V$=M$((function(){return F$.apply(this,arguments)})),z$="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",q$={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"};function H$(e){var t,r,n,o,i,a=e.card,s=e.corners,c=a.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=SK(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 i,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=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,i=e})),f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(s);try{for(f.s();!(i=f.n()).done;){var p=i.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=f$(u,h),v=f$(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 K$=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n,o,i,a,s,c,u;return t=e,(r=[{key:"load",value:(u=hK(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([V$({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=hK(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=hK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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?z$:r,e.next=3,Nq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,Nq.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,i=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),a=CK(i,3),this.out_score_name=a[0],this.out_class_name=a[1],this.out_box_name=a[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"loadResource",value:(a=hK(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?z$:r,e.next=3,Nq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"dispose",value:(i=hK(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 i.apply(this,arguments)})},{key:"predict",value:(o=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E,_,x,T,A,P,I,R,O=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.length>1&&void 0!==O[1]?O[1]:{},n=r.imgMargin,o=void 0===n?.4:n,i=r.detectThreshold,a=void 0===i?.3:i,s=r.maxNumReturns,c=void 0===s?100:s,u=window,l=u.cv,d={},f=t.width,p=t.height,d.originalWidth=f,d.originalHeight=p,h=h$({canvas:t,imgMargin:o}),m=h.margin,g=h.mat,v=this.inputShape.slice(1,3),y=CK(v,2),b=y[0],w=y[1],k=new l.Mat,l.resize(g,k,new l.Size(b,w),0,0,l.INTER_AREA),C=g.cols/b,B=g.rows/w,(S=document.createElement("canvas")).width=b,S.height=w,S.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(k.data),k.cols,k.rows),0,0),g.delete(),k.delete(),d.canvas=S,d.margin=m,E=performance.now(),e.next=25,this.detect(S,{detectThreshold:a,maxNumReturns:c});case 25:if(_=e.sent,x=Math.floor(performance.now()-E),T={inputImage:d,card:null,exeTime:x},A=[[],[],[],[]],P=[],I=[],_.forEach((function(e){var t=CK(e.box,4),r=t[0],n=t[1],o=t[2],i=t[3];e.clazz<=3?A[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:U$(Math.floor((i+n)/2*C-m),0,f),y:U$(Math.floor((r+o)/2*B-m),0,p)},scaledLocation:{x:U$(Math.floor((i+n)/2),0,S.width),y:U$(Math.floor((r+o)/2),0,S.height)}}):I.push({label:e.label,score:e.score,box:[U$(Math.floor(r*B-m),0,p),U$(Math.floor(n*C-m),0,f),U$(Math.floor(o*B-m),0,p),U$(Math.floor(i*C-m),0,f)]})})),A.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),P.push(e[0]))})),!(I.length>0&&4===P.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),P.sort((function(e,t){return e.clazz-t.clazz})),R=I[0],e.prev=37,H$({card:R,corners:P})){e.next=41;break}return console.debug("Not qualified.",R,P),e.abrupt("return",T);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",T);case 46:return R.corners=P,T.card=R,e.abrupt("return",T);case 49:return e.abrupt("return",T);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return o.apply(this,arguments)})},{key:"detect",value:(n=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E=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,i=window,a=i.tf,s=t.width,c=t.height,u=a.tidy((function(){var e=a.expandDims(a.cast(a.image.resizeBilinear(a.browser.fromPixels(t),E.inputShape.slice(1,3)),"float32"));return E.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=CK(l,3),f=d[0],p=d[1],h=CK(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=q$[Math.round(w)])&&void 0!==k?k:"NA",B=m[y],S=[B[0]*c,B[3]*s,B[2]*c,B[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)})}])&&mK(t.prototype,r),e}();function W$(){return(W$=hK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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,i=new iK(o),e.next=4,Nq.loadTensorFlow(n);case 4:return e.next=6,Nq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return a=[Nq.loadBlazefaceModel({modelUrl:r}),i.load()],e.next=9,Promise.all(a);case 9:return s=e.sent,c=CK(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:i});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var G$=M$((function(){return W$.apply(this,arguments)})),Q$=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,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"environment";Ty(this,t),this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=r,this._legacyCanvasSize=t.DEFAULT_CANVAS_SIZE,this._preferredCamera=i,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 a=!1;e.hidden&&(e.hidden=!1,a=!0),document.body.contains(e)||(document.body.appendChild(e),a=!0),requestAnimationFrame((function(){var 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=t.createQrEngine()}return Py(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=rb(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=rb(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(Gy(r.map((function(r){return Object.assign({},r,Iy({},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=rb(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,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=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=Wy(e,2),d=l[0],f=l[1];return o=d,s=Wy(r._drawToCanvas(f,n,i,a),2),i=s[0],u=s[1],o instanceof Worker?(c||o.postMessage({type:"inversionMode",data:"both"}),new Promise((function(e,r){var n,a,s;a=function(i){"qrResult"===i.data.type&&(o.removeEventListener("message",a),o.removeEventListener("error",s),clearTimeout(n),null!==i.data.data?e(i.data.data):r(t.NO_QR_CODE_FOUND))},s=function(e){o.removeEventListener("message",a),o.removeEventListener("error",s),clearTimeout(n);var t=e?e.message||e:"Unknown Error";r("Scanner error: "+t)},o.addEventListener("message",a),o.addEventListener("error",s),n=setTimeout((function(){return s("timeout")}),1e4);var c=u.getImageData(0,0,i.width,i.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(i).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,i,a)}))),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,i=t&&t.y?t.y:0,a=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:a,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,i,a,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 X$(){return Y$.apply(this,arguments)}function Y$(){return(Y$=hK(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q$.WORKER_PATH=cK(),e.next=3,Q$.createQrEngine(Q$.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 $$(){return Z$.apply(this,arguments)}function Z$(){return(Z$=hK(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([X$()]);case 2:return t=e.sent,r=CK(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)}Q$.DEFAULT_CANVAS_SIZE=400,Q$.NO_QR_CODE_FOUND="No QR code found",Q$.WORKER_PATH="qr-scanner-worker.min.js";var J$="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function eZ(){return(eZ=hK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=hK(regeneratorRuntime.mark((function e(){var t,r,n,a,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",a="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=[i(t),i(r),i(n),i(a)],e.next=11,Promise.all(u);case 11:l=e.sent,d=CK(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)},a=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?J$:r,i=function(){var e=hK(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,a();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",$$());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var tZ=M$((function(){return eZ.apply(this,arguments)}));function rZ(e){return nZ.apply(this,arguments)}function nZ(){return(nZ=hK(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 oZ(e){return iZ.apply(this,arguments)}function iZ(){return(iZ=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i;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,rZ({idCardModel:r});case 6:(i=performance.now())-o+.6*(i-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 aZ(){return(aZ=hK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,i=t.tfScriptUrls,a=t.wechatQRModelsUrl,e.next=3,G$({blazefaceModelUrl:o,tfScriptUrls:i});case 3:return s=e.sent,c=s.blazefaceModel,u=!0,l=new K$,e.prev=7,e.next=10,l.load({opencvUrl:r,modelUrl:n});case 10:e.next=15;break;case 12:return e.prev=12,e.t0=e.catch(7),e.abrupt("return",{ableToUseModel:!1});case 15:return e.next=17,tZ({modelUrl:a});case 17:return e.prev=17,e.next=20,oZ({idCardModel:l});case 20:d=e.sent,f=d.fastEnough,u=f,e.next=28;break;case 25:e.prev=25,e.t1=e.catch(17),u=!1;case 28:return e.abrupt("return",{ableToUseModel:u,idCardModel:l,blazefaceModel:c});case 29:case"end":return e.stop()}}),e,null,[[7,12],[17,25]])})))).apply(this,arguments)}var sZ=M$((function(){return aZ.apply(this,arguments)})),cZ=sM.Errors;function uZ(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=_w.useRef(null);null===i.current&&(i.current=document.createElement("canvas"));var a=_w.useRef(!1),s=_w.useRef(Wz.createResizer({width:960,height:640})),c=_w.useRef(null),u=_w.useRef([{id:null,frames:[]}]),l=_w.useCallback((function(){!0===a.current&&(a.current=!1)}),[]),d=_w.useCallback((function(){u.current=[{id:null,frames:[]}]}),[]),f=_w.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),p=_w.useCallback(function(){var e=hK(regeneratorRuntime.mark((function e(t){var r,n,i,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,i=u.current,a=n.resize({srcCanvas:r}),c=a.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],i[i.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=_w.useCallback(hK(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,a.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=i.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),a.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,ZF.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return _w.useEffect((function(){var e=t.current;function o(){return(o=hK(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=SV.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:i,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var lZ=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,i=e.settings,a=e.shouldStartTimers,s=e.sessionTime,c=_w.useRef(),u=CK(_w.useState(0),2),l=u[0],d=u[1],f=_w.useCallback((function(){clearInterval(c.current)}),[]),p=_w.useCallback((function(){d((function(e){return e+1}))}),[]);return _w.useEffect((function(){if(a){var e=i.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var i=s-(t+=1);i<=u&&r&&r({curTimeLeft:i}),t>0&&t%e==0&&o&&o(),0===i&&(f(),n&&n())}),1e3)}return function(){f()}}),[a,t,r,f,n,o,l,i,s]),{stopTimers:f,startTimers:p}};nK.initExifData();var dZ,fZ,pZ,hZ=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onModelErrorChange,a=e.frontSide,s=e.onDebugInfoChange,c=e.onAboutToTimeout,u=e.onSessionTimeout,l=e.onCaptureDone,d=e.outputEncryptionSettings,f=e.quality,p=_w.useRef(!1),h=CK(_w.useState(!1),2),m=h[0],g=h[1],v=_w.useRef((function(){})),y=GF.useSDKTracking().sendEvent,b=_w.useRef(),w=_w.useRef(),k=_w.useRef(),C=mF.useSDKSettings(),B=C.debug,S=C.lang,E=C.enableAntiDebug,_=sK(),x=_.startMotion,T=_.stopMotion,A=_.motionData,P=_.orientationData;_w.useEffect((function(){E&&Dq.enableAntiDebug()}),[E]);var I=_w.useCallback(function(){var e=hK(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y({tag:a?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,v.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[y,a]),R=_w.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.apply(void 0,t);var n=l$(t,"0.code");n&&n!==b.current&&(y({tag:a?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),b.current=n)}),[i,a,y]),O=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.onError,a=e.frontSide,s=e.onAutoCaptureSuccess,c=e.quality,u=_w.useRef(null);null===u.current&&(u.current=document.createElement("canvas"));var l=_w.useRef(0),d=_w.useRef([]),f=_w.useRef(null);null===f.current&&(f.current=document.createElement("canvas"));var p=_w.useRef({}),h=_w.useRef(!1),m=_w.useRef(null),g=CK(_w.useState(!1),2),v=g[0],y=g[1],b=_w.useRef({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),w=_w.useRef({imageBlob:null,blurScore:null,error:null,detectedCard:null}),k=_w.useRef(!1),C=_w.useRef(!1),B=_w.useRef(null),S=_w.useRef(!1),E=_w.useRef({}),_=mF.useSDKSettings().customUrls;_w.useEffect((function(){var e=!1;function t(){return(t=hK(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||v){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,sZ(_);case 4:return E.current=t.sent,t.next=7,Nq.initTensorFlow();case 7:B.current=o.enableBlurCheck&&E.current.ableToUseModel,t.next=11;break;case 10:B.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:y(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[v,o,_]);var x=_w.useCallback((function(e){return B$({currentWorkingCanvas:e,refVirtualWorkingCanvas:f,refCountVirtualFrames:l,refVirtualFrames:d,refWorkingCanvas:u,refCardResult:p})}),[]),T=_w.useCallback((function(){!0===h.current&&(h.current=!1)}),[]),A=_w.useCallback(function(){var e=hK(regeneratorRuntime.mark((function e(t){var r,n,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,i=o.blurThreshold,a=b.current,s=w.current,!(r<i&&CV.hasBetterCardBlurScore(r,a.blurScore))){e.next=16;break}if(!S.current){e.next=9;break}a.imageBlob=s.imageBlob,e.next=13;break;case 9:return e.next=11,SV.takePicture({canvas:u.current,quality:c});case 11:a.imageBlob=e.sent,a.captureTime=Date.now();case 13:a.takenAt=(new Date).getTime(),a.blurScore=r,a.detectedCard=n;case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,c]),P=_w.useCallback(function(){var e=hK(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,C.current=!0,o=w.current,!CV.hasBetterCardBlurScore(r,o.blurScore)){e.next=11;break}return e.next=6,SV.takePicture({canvas:u.current,quality:c});case 6:o.imageBlob=e.sent,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,S.current=!0;case 11:C.current=!1;case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c]),I=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.waitForBestImageTimeMs,null===(r=b.current).imageBlob){e.next=8;break}if(!((new Date).getTime()-r.takenAt>t)){e.next=8;break}return e.next=7,s(r);case 7:T();case 8:case"end":return e.stop()}}),e)}))),[s,o,T]),R=_w.useCallback((function(){k.current=!0}),[]),O=_w.useCallback((function(){return new Promise((function(e){k.current=!1;var t=setInterval((function(){C.current||(clearInterval(t),e())}),150)}))}),[]),N=_w.useCallback(hK(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=w.current;B.current?(R(),setTimeout((function(){O().then(hK(regeneratorRuntime.mark((function o(){var i;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(CV.hasBetterCardBlurScore(n.blurScore,t)||(n.error=cZ.id_detector_error_blur),i=u.current,null!==n.imageBlob){o.next=6;break}SV.takePicture({canvas:i,quality:c}).then(function(){var t=hK(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,x(i);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,x(i);case 9:e(n);case 10:case"end":return o.stop()}}),o)}))))}),2e3)):SV.takePicture({canvas:u.current,quality:c}).then(function(){var t=hK(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,x(u.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,R,O,c,x]),D=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var r,n,s,c,f,g,y,C,B,_,x,T,R,O,N,D,M,L,U,j;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&v&&!h.current){e.next=2;break}return e.abrupt("return");case 2:b.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},w.current={imageBlob:null,blurScore:null,error:null,detectedCard:null},r=o.enableAutoCapture,n=o.enableBlurCheck,s=o.enableIdDetection,c=E.current,f=c.idCardModel,g=c.blazefaceModel,y=c.ableToUseModel,C=m.current,B=t.current,h.current=!0,_=C.cropX,x=C.cropY,T=C.cropWidth,R=C.cropHeight,O=C.cropWidthWithoutPadding,N=C.cropHeightWithoutPadding,(D=u.current).width=T,D.height=R,M=D.getContext("2d"),L=document.createElement("canvas"),U=L.getContext("2d"),j=function(){var e=hK(regeneratorRuntime.mark((function e(){var t,o,c,u,m,v,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(M.drawImage(B,_,x,T,R,0,0,T,R),t=performance.now(),S.current=!1,!s||!y){e.next=59;break}return o=null,e.next=7,f.predict(D,{detectThreshold:.3});case 7:if(!(c=e.sent).card){e.next=55;break}if(p.current=c.card,!w.current.imageBlob&&d.current.length>0&&(d.current=[],l.current=0),!v$({corners:c.card.corners,width:T,height:R})){e.next=52;break}if(!w$(c.card.corners)){e.next=49;break}if(u=m$(D,c.card.corners),!((m=IV.rectAreaRatio({small:{area:u.width*u.height},big:{area:O*N}}))<.5)){e.next=21;break}o=cZ.id_detector_card_too_small,e.next=47;break;case 21:if(!(m>.95)){e.next=25;break}o=cZ.id_detector_error_incomplete,e.next=47;break;case 25:return L.width=u.width,L.height=u.height,U.putImageData(u,0,0),e.next=30,y$({canvas:L});case 30:if(!e.sent){e.next=35;break}o=cZ.glare_detected,e.next=47;break;case 35:return e.next=37,k$({blazefaceModel:g,predictedIdCardCanvas:L,frontSide:a});case 37:if(o=e.sent){e.next=47;break}if(!n){e.next=47;break}if(v=CV.calculateIdCardBlurScore({canvas:L}),!k.current){e.next=44;break}return e.next=44,P({blurScore:v,detectedCard:c.card});case 44:if(!r){e.next=47;break}return e.next=47,A({blurScore:v,detectedCard:c.card});case 47:e.next=50;break;case 49:o=cZ.id_detector_validate_angle_error;case 50:e.next=53;break;case 52:o=cZ.id_detector_error_incomplete;case 53:e.next=56;break;case 55:o=cZ.id_detector_no_cards;case 56:return i(o),e.next=59,I();case 59:return t=Math.floor(performance.now()-t),b=180-t>0?180-t:0,e.next=63,new Promise((function(e){return setTimeout(e,b)}));case 63:h.current&&window.requestAnimationFrame(j);case 64:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(j);case 19:case"end":return e.stop()}}),e)}))),[t,o,v,a,i,A,P,I]);_w.useEffect((function(){var e=t.current;function o(){return(o=hK(regeneratorRuntime.mark((function t(){var r,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m.current=SV.analyzeVideoAndWindowSizes(e,n,.05),r=m.current,o=r.cropWidth,i=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(i)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,D();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&v&&function(){o.apply(this,arguments)}()}),[r,n,t,T,D,v]);var M=_w.useCallback((function(){T()}),[T]);return _w.useEffect((function(){return M}),[M]),{refWorkingCanvas:u,stopCheckFrame:T,checkFrame:D,warmupDone:v,takePictureManually:N,refAbleToRunBurstMode:B,refVirtualFrames:d}}({refVideo:r,shouldStart:t,cropArea:n,settings:o,onError:R,frontSide:a,onAutoCaptureSuccess:I,quality:f}),N=O.refWorkingCanvas,D=O.stopCheckFrame,M=O.checkFrame,L=O.warmupDone,U=O.takePictureManually,j=O.refAbleToRunBurstMode,F=O.refVirtualFrames,V=uZ({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),z=V.stopCheckFrame,q=V.splitVideos,H=V.resetRecordedVideos,K=V.checkFrame;!function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,i=e.onChange;_w.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,a=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==a?void 0:a.width,"canvas.height":null==a?void 0:a.height};i&&i(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[i,t,r,n,o])}({debug:B,refRecordedVideos:V.refRecordedVideos,refWorkingCanvas:N,refVideo:r,onChange:s});var W=_w.useCallback((function(){z(),D(),H(),u()}),[H,z,D,u]),G=_w.useCallback((function(){q()}),[q]),Q=lZ({lang:S,onAboutToTimeout:c,onSessionTimeout:W,onVideoTimeLimitReached:G,settings:o,shouldStartTimers:L&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),X=Q.stopTimers,Y=Q.startTimers,$=_w.useCallback((function(){p.current=!1}),[]),Z=_w.useCallback(hK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $(),Y(),e.next=4,Promise.all([K(),M()]);case 4:case"end":return e.stop()}}),e)}))),[$,Y,K,M]),J=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,f,h,m,v,b=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=b.length>0&&void 0!==b[0]?b[0]:{},r=t.imageBlob,n=t.error,i=t.detectedCard,s=t.captureTime,!p.current){e.next=3;break}return e.abrupt("return");case 3:return p.current=!0,g(!0),z(),D(),X(),R(null),c=null==o?void 0:o.enableVirtualCamHashes,u={},c&&(f=F).current.length>0&&(u=f.current.reduce((function(e,t,r){return bK(bK({},e),{},gK({},"hash".concat(r+1),t))}),u)),T(),nK.preWriteExif({mode:nK.MODE.ID_CARD,motionData:A,orientationData:P,startTime:w.current,endTime:Date.now()}),e.next=16,nK.writeExif({mode:nK.MODE.ID_CARD,imageData:bK({detectedCard:i,captureTime:s,blob:r},c?{vCam:u}:{}),enableExifData:null==o?void 0:o.enableExifData});case 16:if(h=e.sent,!d||!d.key){e.next=22;break}return v=d.key,e.next=21,Uq.encrypt({blob:h,key:v});case 21:m=e.sent;case 22:l({image:{blob:h,encrypted:m,detectedCard:i},error:n,recordedVideos:[]}),g(!1),y({tag:a?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-k.current)/1e3}});case 25:case"end":return e.stop()}}),e)}))),[z,D,X,R,l,a,y,d,A,P,T,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,F]);v.current=J;var ee=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),X(),z(),j.current||D(),e.next=6,U();case 6:return t=e.sent,e.next=9,J(t);case 9:g(!1),y({tag:a?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[U,J,X,j,z,D,y,a]);return _w.useEffect((function(){t&&(y({tag:a?"id_front":"id_back",event:"user_activity.start",log:{}}),w.current=Date.now(),x())}),[y,a,t,x]),_w.useEffect((function(){L&&(y({tag:a?"id_front":"id_back",event:"user_activity.show",log:{}}),y({tag:a?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-w.current}}),k.current=performance.now())}),[y,a,L]),{warmupDone:L,isProcessing:m,takePictureManually:ee,restartSession:Z,resetIsProcessingImageBlobTaken:$}},mZ=sM.IDCardMessage,gZ=_w.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,i=e.refVideo,a=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=CK(_w.useState({}),2),f=d[0],p=d[1],h=f.yDescription,m=f.yMessage,g=f.yCaptureButton,v=YF.useAsset("ic_camera.svg"),y=YF.useAsset("ic_loading.png"),b=CK(_w.useState(""),2),w=b[0],k=b[1],C=mF.useSDKSettings(),B=C.debug,S=C.lang,E=CK(_w.useState(null),2),_=E[0],x=E[1],T=CK(_w.useState(""),2),A=T[0],P=T[1],I=CK(_w.useState(null),2),R=I[0],O=I[1],N=wY(),D=N.showPopup,M=N.popupShown,L=N.popupType,U=_w.useCallback((function(e){P(null===e?"":jG(e.msg[S])({side:a?hY.FRONT[S]:hY.BACK[S]}))}),[S,a]),j=_w.useCallback((function(){x(""),D({popupType:kY})}),[D]),F=_w.useCallback((function(){x(""),c.apply(void 0,arguments)}),[c]),V=_w.useCallback((function(e){var t=e.curTimeLeft;x(jG(mZ.REMAINING_TIME[S])({x:t}))}),[S]),z=hZ({shouldStart:!0,refVideo:i,cropArea:R,settings:s,onModelErrorChange:U,frontSide:a,onDebugInfoChange:k,onSessionTimeout:j,onCaptureDone:F,onAboutToTimeout:V,outputEncryptionSettings:l}),q=z.warmupDone,H=z.isProcessing,K=z.takePictureManually,W=z.restartSession,G=z.resetIsProcessingImageBlobTaken,Q=_w.useCallback((function(){D({popupType:null}),G()}),[D,G]),X=_w.useCallback(hK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(),e.next=3,W();case 3:case"end":return e.stop()}}),e)}))),[W,Q]);_w.useEffect((function(){if(o){var e,t,r,i,a,s,c,l=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,h=o.lostY,m=o.clientHeight;n?(a=.7*(s=d-165),r=(c=(e=h+10)+45)+20,i=(t=c+s+10)+60):(a=PK.isMobile?l-6:Math.floor(.7*l),r=(c=(e=h+10)+50)+20,i=(t=c+(s=Math.floor(Math.min(a/1.5,m-2*h-80-100)))+10)+60);var g=Math.floor((l-a)/2)+f;O({x:g,y:c,width:a,height:s,surroundStyle:{opacity:.6,background:"#000"}});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:i};p(v),u(v)}}),[o,n,u]);var Y=_w.useCallback(hK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(""),e.next=3,K();case 3:case"end":return e.stop()}}),e)}))),[K]);return _w.useImperativeHandle(t,(function(){return{restartSession:X}}),[X]),_w.createElement(_w.Fragment,null,!q&&_w.createElement(lY,null),B&&_w.createElement(nY,null,w),H&&_w.createElement(tY,null,_w.createElement("img",{src:y,alt:"",className:"spin"})),R&&_w.createElement(aX,{x:"".concat(R.x,"px"),y:"".concat(R.y,"px"),width:"".concat(R.width,"px"),height:"".concat(R.height,"px"),surroundStyle:R.surroundStyle},_w.createElement(sY,{width:R.width,height:R.height,type:A?wX:bX})),!A&&_w.createElement(oY,{y:"".concat(h,"px"),className:"description"},r),A&&_w.createElement(iY,{y:"".concat(h,"px")},A),!H&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!A)&&_w.createElement(eY,{onClick:Y,y:"".concat(g,"px")},_w.createElement("img",{src:v,alt:""})),_&&_w.createElement(aY,{key:_,className:"message",y:"".concat(m,"px")},_),_w.createElement(yX,{open:M},L===kY&&_w.createElement(bY,{onOk:X,maxSessionTime:null==s?void 0:s.idCardSessionTime})))}));gZ.propTypes={usePortraitMask:_k.bool,description:_k.string,windowAndVideoInfo:_k.shape({}),refVideo:_k.shape({}),frontSide:_k.bool,settings:_k.shape({}),onCaptureDone:_k.func,onUISpacingChange:_k.func,outputEncryptionSettings:_k.shape({})},gZ.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var vZ,yZ,bZ=lE.div(dZ||(dZ=kK(["\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),wZ=lE.div(fZ||(fZ=kK(["\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")})),kZ=function(e){var t=e.children,r=e.y;return _w.createElement(bZ,{y:r,background:"#00ce78"},_w.createElement(wZ,{arrowSize:10,top:-10,color:"#00ce78"}),t)},CZ=lE.div(pZ||(pZ=kK(["\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),BZ={QR_INSTRUCTIONS_TEXT:{en:_w.createElement("span",null,"Please follow the instructions below to scan QR code:",_w.createElement("br",null),_w.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:_w.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",_w.createElement("br",null),_w.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:_w.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",_w.createElement("br",null),_w.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",_w.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:_w.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",_w.createElement("br",null),_w.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",_w.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"}},SZ=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,i=e.mr,a=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!==a&&(m.marginLeft=a,m.marginRight=a),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==i&&(m.marginRight=i),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),_w.cloneElement(t,{style:bK(bK({},h),m)})};SZ.propTypes={mt:_k.string,ml:_k.string,mr:_k.string,mb:_k.string,mx:_k.string,my:_k.string,pt:_k.string,pl:_k.string,pr:_k.string,pb:_k.string,px:_k.string,py:_k.string},SZ.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 EZ,_Z,xZ,TZ=lE.button(vZ||(vZ=kK(["\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})),AZ=lE.a(yZ||(yZ=kK(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),PZ=lE.div(EZ||(EZ=kK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),IZ=lE.div(_Z||(_Z=kK(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),RZ=lE.div(xZ||(xZ=kK(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),OZ=function(e){var t=e.onRetry,r=e.onSkip,n=mF.useSDKSettings().lang;return _w.createElement(PZ,null,_w.createElement(SZ,{mt:"25px"},_w.createElement(IZ,null,BZ.QR_INVALID_POPUP_TITLE[n])),_w.createElement(SZ,{mt:"30px"},_w.createElement(RZ,null,BZ.QR_INVALID_POPUP_DESCRIPTION[n])),_w.createElement(SZ,{mt:"30px"},_w.createElement(TZ,{onClick:t},BZ.QR_INVALID_POPUP_RETRY_BUTTON[n])),_w.createElement(SZ,{my:"20px"},_w.createElement(AZ,{onClick:r},BZ.QR_INVALID_POPUP_SKIP_BUTTON[n])))};OZ.propTypes={onRetry:_k.func,onSkip:_k.func},OZ.defaultProps={onRetry:function(){},onSkip:function(){}};var NZ,DZ,MZ,LZ,UZ,jZ,FZ,VZ=["children","ratio","padding"],zZ=lE.div(NZ||(NZ=kK(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),qZ=lE.div(DZ||(DZ=kK(["\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})),HZ=function(e){var t=e.children,r=e.ratio,n=e.padding,o=wK(e,VZ);return _w.createElement(zZ,vK({ratio:r},o),_w.createElement(qZ,{padding:n},t))};HZ.propTypes={children:_k.node,ratio:_k.number,padding:_k.string},HZ.defaultProps={children:null,ratio:4/3,padding:"0"};var KZ=lE.div(MZ||(MZ=kK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),WZ=lE.div(LZ||(LZ=kK(["\n background: #e7e6e6;\n width: 100%;\n"]))),GZ=lE.img(UZ||(UZ=kK(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),QZ=lE.div(jZ||(jZ=kK(["\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})),XZ=lE(QZ)(FZ||(FZ=kK(["\n white-space: nowrap;\n"]))),YZ=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=mF.useSDKSettings().lang,i=YF.useAsset("qr_code_banner.png"),a=_w.useRef(n),s=CK(_w.useState((function(){return jG(BZ.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),c=s[0],u=s[1],l=GF.useSDKTracking().sendEvent,d=_w.useRef(!1);return _w.useEffect((function(){l({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[l]),_w.useEffect((function(){var e=jG(BZ.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){a.current--,u(e({x:a.current})),a.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]),_w.createElement(KZ,null,_w.createElement(WZ,null,_w.createElement(HZ,{ratio:1.6},_w.createElement(GZ,{src:i}))),_w.createElement(SZ,{mt:"30px"},_w.createElement(QZ,null,BZ.QR_INSTRUCTIONS_TEXT[o])),_w.createElement(SZ,{mt:"30px"},_w.createElement(TZ,{onClick:function(){l({tag:"id_qr",event:"user_activity.click_start",log:{}}),d.current=!0,t()}},BZ.QR_INSTRUCTIONS_START_BUTTON[o])),_w.createElement(SZ,{my:"20px"},_w.createElement(XZ,null,c)))};YZ.propTypes={onClickStart:_k.func,onTimeout:_k.func,timeout:_k.number},YZ.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var $Z=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function ZZ(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 JZ=xK(TK((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 i=t;i<t+n;i++)for(var a=e;a<e+r;a++)this.set(a,i,!!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,i=0;i<this.size;i++)this.expTable[i]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(i=0;i<this.size-1;i++)this.logTable[this.expTable[i]]=i;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,i=t.coefficients;o.length>i.length&&(o=(r=[i,o])[0],i=r[1]);for(var a=new Uint8ClampedArray(i.length),s=i.length-o.length,c=0;c<s;c++)a[c]=i[c];for(c=s;c<i.length;c++)a[c]=n.addOrSubtractGF(o[c-s],i[c]);return new e(this.field,a)},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,i=t.coefficients,a=i.length,s=new Uint8ClampedArray(o+a-1),c=0;c<o;c++)for(var u=r[c],l=0;l<a;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,i[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),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],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),i=r(11),a=r(12);function s(e){var t=a.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=i.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 i=c;Object.keys(i||{}).forEach((function(e){i[e]=o[e]||i[e]}));var a="attemptBoth"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,u="onlyInvert"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,l=n.binarize(e,t,r,a),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==i.inversionAttempts&&"invertFirst"!==i.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 i=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,a){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new i(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 i(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 B=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<B&&(C=B)}m.set(v,g,C)}var S=n.BitMatrix.createEmpty(t,r),E=null;for(a&&(E=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 P=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var I=s.get(c,u);S.set(c,u,I<=P),a&&E.set(c,u,!(I<=P))}}return a?{binarized:S,inverted:E}:{binarized:S}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),i=r(9),a=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],i=e.height,a=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,i=e.alignmentPatternCenters;o<i.length;o++)for(var a=i[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===a&&6===u||6===a&&u===t-7||a===t-7&&6===u||r.setRegion(a-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=i-1;p>0;p-=2){6===p&&p--;for(var h=0;h<i;h++)for(var m=f?i-1-h:h,g=0;g<2;g++){var v=p-g;if(!a.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 a.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var i=t-9;i>=t-11;i--)n=c(e.get(i,o),n);var u=0;for(i=5;i>=0;i--)for(o=t-9;o>=t-11;o--)u=c(e.get(i,o),u);for(var l,d=1/0,f=0,p=a.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,i=0;for(n=o-1;n>=o-7;n--)i=c(e.get(8,n),i);for(r=o-8;r<o;r++)i=c(e.get(r,8),i);for(var a=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===i)return m;var g=s(t,h);g<a&&(l=m,a=g),t!==i&&(g=s(i,h))<a&&(l=m,a=g)}return a<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],i=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),i+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<i)return null;e=e.slice(0,i);for(var a=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<a;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=i.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,i=r(7),a=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],i=e.readBits(o);i>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var a=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+a,48+s,48+c),n+=a.toString()+s.toString()+c.toString(),i-=3}if(2===i){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");a=Math.floor(u/10),s=u%10,r.push(48+a,48+s),n+=a.toString()+s.toString()}else if(1===i){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],i=e.readBits(o);i>=2;){var a=e.readBits(11),s=Math.floor(a/45),u=a%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],i-=2}return 1===i&&(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],i=e.readBits(o),a=0;a<i;a++){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],i=e.readBits(o),s=0;s<i;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(a.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,a,c,f,p=new i.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,(a=m.bytes).push.apply(a,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<<(i=r-n);t=(this.bytes[this.byteOffset]&o)>>i,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 i;e>0&&(o=255>>(i=8-e)<<i,t=t<<e|(this.bytes[this.byteOffset]&o)>>i,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 i=new n.default(285,256,0),a=new o.default(i,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=a.evaluateAt(i.exp(u+i.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(i,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var i=t,a=r,s=e.zero,c=e.one;a.degree()>=n/2;){var u=i,l=s;if(s=c,(i=a).isZero())return null;a=u;for(var d=e.zero,f=i.getCoefficient(i.degree()),p=e.inverse(f);a.degree()>=i.degree()&&!a.isZero();){var h=a.degree()-i.degree(),m=e.multiply(a.getCoefficient(a.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),a=a.addOrSubtract(i.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),a.degree()>=i.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),a.multiply(v)]}(i,i.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,i=1;i<e.size&&o<r;i++)0===t.evaluateAt(i)&&(n[o]=e.inverse(i),o++);return o!==r?null:n}(i,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,i=new Array(o),a=0;a<o;a++){for(var s=e.inverse(r[a]),c=1,u=0;u<o;u++)a!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));i[a]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(i[a]=e.multiply(i[a],s))}return i}(i,f[1],p),m=0;m<p.length;m++){var g=r.length-1-i.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,i=e.y-t.y+r.y-n.y;if(0===o&&0===i)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 a=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=a*u-s*c,d=(o*u-s*i)/l,f=(a*i-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 i=o({x:3.5,y:3.5},t,r,n);return{a11:i.a22*i.a33-i.a23*i.a32,a12:i.a13*i.a32-i.a12*i.a33,a13:i.a12*i.a23-i.a13*i.a22,a21:i.a23*i.a31-i.a21*i.a33,a22:i.a11*i.a33-i.a13*i.a31,a23:i.a13*i.a21-i.a11*i.a23,a31:i.a21*i.a32-i.a22*i.a31,a32:i.a12*i.a31-i.a11*i.a32,a33:i.a11*i.a22-i.a12*i.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}),i=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),a=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=i.a13*e+i.a23*t+i.a33;return{x:(i.a11*e+i.a21*t+i.a31)/r,y:(i.a12*e+i.a22*t+i.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);a.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:a,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 i(e,t,r,o){var i,a,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?(i=Math.floor(e.y),a=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(i=Math.floor(e.x),a=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-i),f=Math.abs(c-a),p=Math.floor(-d/2),h=i<s?1:-1,m=a<c?1:-1,g=!0,v=i,y=a;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 a(e,t,r,n){var o,a=t.y-e.y,s=t.x-e.x,c=i(e,t,r,Math.ceil(n/2)),u=i(e,{x:e.x-s,y:e.y-a},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=a(e,{x:-1,y:e.y},r,t.length),o=a(e,{x:e.x,y:-1},r,t.length),i=a(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=a(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(i,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,i=Math.round(t.y);e.get(Math.round(o),i);)i--;for(var a=Math.round(t.y);e.get(Math.round(o),a);)a++;return{x:o,y:(i+a)/2}}function l(e,t,r,i,s){var u,l,d;try{u=function(e,t,r,i){var s=(o(a(e,r,i,5))/7+o(a(e,t,i,5))/7+o(a(r,e,i,5))/7+o(a(t,e,i,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}}(i,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-i.x+s.x,p=r.y-i.y+s.y,h=(n(i,s)+n(i,r))/2/d,m=1-3/h,g={x:i.x+m*(f-i.x),y:i.y+m*(p-i.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,i=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(i)))return o([t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1]),{x:r,y:i,score:c({x:Math.floor(r),y:Math.floor(i)},[1,1,1],e)+n({x:r,y:i},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=[],i=[],a=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var i=e.get(t,n);if(i===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=i;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&&!i,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&&i;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=a.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:a.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})),i.push.apply(i,a.filter((function(e){return e.bottom.y!==n}))),a=a.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}))),i.push.apply(i,a);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 i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],a=o(i)/i.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:a}}})).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,i,a,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=(i=[e,t,r])[0],u=i[1],l=i[2]):(c=(a=[e,r,t])[0],u=a[1],l=a[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,i,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,i,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 eJ(e){return tJ.apply(this,arguments)}function tJ(){return(tJ=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(i=n.getContext("2d"),o=i.getImageData(0,0,n.width,n.height)),!(a=JZ(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",a.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rJ(e){return nJ.apply(this,arguments)}function nJ(){return(nJ=hK(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),Q$.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 oJ,iJ,aJ,sJ,cJ,uJ,lJ=function(){var e=hK(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,i=r,!n){e.next=6;break}return e.next=5,Wz.blobToCanvas({blob:n});case 5:i=e.sent;case 6:return a=i.getContext("2d"),e.next=9,eJ({imageData:a.getImageData(0,0,i.width,i.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,rJ({canvas:i,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)}}(),dJ=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onSessionTimeout,a=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=CK(_w.useState(!1),2),l=u[0],d=u[1],f=_w.useRef((function(){})),p=_w.useRef((function(){})),h=mF.useSDKSettings().lang,m=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.onResult,a=e.outputEncryptionSettings,s=_w.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=_w.useRef(!1),u=_w.useRef(null),l=CK(_w.useState(!1),2),d=l[0],f=l[1],p=_w.useRef({}),h=mF.useSDKSettings().customUrls;_w.useEffect((function(){function e(){return(e=hK(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,tZ({modelUrl:null==h?void 0:h.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,h]);var m=_w.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),g=_w.useCallback(hK(regeneratorRuntime.mark((function e(){var r,n,l,f,h,g,v,y,b,w,k,C,B;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,g=t.current,c.current=!0,v=h.cropX,y=h.cropY,b=h.cropWidth,w=h.cropHeight,(k=s.current).width=b,k.height=w,C=k.getContext("2d"),B=function(){var e=hK(regeneratorRuntime.mark((function e(){var t,r,o,u,d,p,h,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C.drawImage(g,v,y,b,w,0,0,b,w),t=performance.now(),f){e.next=8;break}return e.next=5,ZZ({canvas:k,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,lJ({canvas:k,qrScannerResources:l});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=27;break}return m(),void 0,E=r.match($Z),o={valid:Boolean(E)},e.next=17,SV.takePicture({canvas:s.current});case 17:return u=e.sent,e.next=20,nK.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:!0});case 20:if(d=e.sent,!a||!a.key){e.next=26;break}return h=a.key,e.next=25,Uq.encrypt({blob:d,key:h});case 25:p=e.sent;case 26:i({result:r,validateResult:o,image:{blob:d,encrypted:p}});case 27:return S=180-t>0?180-t:0,e.next=30,new Promise((function(e){return setTimeout(e,S)}));case 30:c.current&&window.requestAnimationFrame(B);case 31:case"end":return e.stop()}var E}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(B);case 13:case"end":return e.stop()}}),e)}))),[t,o,d,i,m,a]),v=_w.useCallback((function(){m()}),[m]);return _w.useEffect((function(){var e=t.current;r||v(),d&&r&&n&&e&&e.videoWidth>0&&(u.current=SV.analyzeVideoAndWindowSizes(e,n,0),g())}),[r,n,t,m,g,d,v]),_w.useEffect((function(){return v}),[v]),{refWorkingCanvas:s,stopCheckFrame:m,checkFrame:g,warmupDone:d}}({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:_w.useCallback((function(){f.current.apply(f,arguments)}),[]),outputEncryptionSettings:c}),g=m.stopCheckFrame,v=m.checkFrame,y=m.warmupDone,b=uZ({refVideo:r,shouldStart:t&&y,cropArea:n,settings:o}),w=b.stopCheckFrame,k=b.refRecordedVideos,C=b.splitVideos,B=b.resetRecordedVideos,S=b.checkFrame;f.current=_w.useCallback((function(e){d(!0),w(),g(),p.current(),a(bK(bK({},e),{},{recordedVideos:k.current})),d(!1)}),[w,a,k,g]);var E=_w.useCallback((function(){w(),g();var e=BK(k.current);i({recordedVideos:e}),B()}),[B,w,g,i,k]),_=_w.useCallback((function(){C()}),[C]),x=lZ({lang:h,onAboutToTimeout:s,onSessionTimeout:E,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:_w.useCallback(hK(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 fJ(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,i=e.onCaptureDone,a=e.outputEncryptionSettings,s=CK(_w.useState(null),2),c=s[0],u=s[1],l=YF.useAsset("qr_capture_cursor.png"),d=CK(_w.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=mF.useSDKSettings().lang,v=GF.useSDKTracking().sendEvent,y=wY(),b=y.showPopup,w=y.popupShown,k=y.popupType,C=CK(_w.useState(!1),2),B=C[0],S=C[1],E=CK(_w.useState(null),2),_=E[0],x=E[1],T=YF.useAsset("ic_loading.png"),A=_w.useRef();_w.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),_w.useEffect((function(){b({popupType:BY})}),[b]),_w.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,i=PK.isMobile?Math.min(e-6,145):145,a=i,s=o+10,c=s+90,l=c+40,d=l+a+20,f=Math.floor((e-i)/2)+n;u({x:f,y:l,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var P=_w.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),i(e)}),[i,v]),I=_w.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}}),i(e)):(b({popupType:CY}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,i,v]),R=_w.useCallback((function(e){var t=e.curTimeLeft;x(jG(BZ.REMAINING_TIME[g])({x:t}))}),[g]),O=dJ({shouldStart:B,refVideo:n,cropArea:c,settings:o,onSessionTimeout:P,onCaptureDone:I,onAboutToTimeout:R,outputEncryptionSettings:a}),N=O.isProcessing,D=O.restartSession,M=O.warmupDone,L=_w.useCallback((function(){b({popupType:null})}),[b]),U=_w.useCallback(hK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(),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,L,v]),j=_w.useCallback((function(){L(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),i()}),[L,i,v]),F=_w.useCallback((function(){L(),setTimeout((function(){S(!0)}),200)}),[L]);return _w.createElement(_w.Fragment,null,!M&&_w.createElement(lY,{contentStyle:{maxWidth:"300px"}}),c&&_w.createElement(aX,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},_w.createElement("div",null,_w.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),_w.createElement(kZ,{y:"".concat(h,"px")},BZ.QR_TOOLTIP[g]),_&&_w.createElement(CZ,{key:_,className:"message",y:"".concat(m,"px")},_),N&&_w.createElement(tY,null,_w.createElement("img",{src:T,alt:"",className:"spin"})),_w.createElement(yX,{contentStyle:{maxWidth:"332px"},open:w},k===CY&&_w.createElement(OZ,{onRetry:U,onSkip:j}),k===BY&&_w.createElement(YZ,{onClickStart:F,onTimeout:F})))}fJ.propTypes={windowAndVideoInfo:_k.shape({}),onUISpacingChange:_k.func,refVideo:_k.shape({}),settings:_k.shape({}),onCaptureDone:_k.func,outputEncryptionSettings:_k.shape({})},fJ.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var pJ,hJ,mJ,gJ,vJ,yJ="SUCCESS",bJ="WARNING",wJ=(gK(oJ={},yJ,"52,206,95"),gK(oJ,bJ,"255,148,50"),oJ),kJ=(gK(iJ={},yJ,"✓"),gK(iJ,bJ,"!"),iJ),CJ=lE.div(aJ||(aJ=kK(["\n font-weight: normal;\n"]))),BJ=lE.div(sJ||(sJ=kK(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return XS(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],wJ[e.type],wJ[e.type],wJ[e.type])})),SJ=lE.div(cJ||(cJ=kK(["\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 XS(["rgb(",")"],wJ[e.type])})),EJ=lE.div(uJ||(uJ=kK(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),_J=function(e){var t=e.children,r=e.type,n=e.className;return _w.createElement(CJ,{className:n},_w.createElement(BJ,{type:r}),_w.createElement(EJ,null,_w.createElement(SJ,{type:r},kJ[r]),t),_w.createElement(BJ,{type:r}))};_J.propTypes={children:_k.node,type:_k.string,className:_k.string},_J.defaultProps={children:null,type:yJ,className:""};var xJ,TJ=lE.div(pJ||(pJ=kK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),AJ=lE.div(hJ||(hJ=kK(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),PJ=lE.button(mJ||(mJ=kK(["\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})),IJ=lE.img(gJ||(gJ=kK(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),RJ=lE.div(vJ||(vJ=kK(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),OJ=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,i=e.hasValidQR,a=e.frontSide,s=CK(_w.useState(null),2),c=s[0],u=s[1],l=mF.useSDKSettings().lang,d=GF.useSDKTracking().sendEvent;return _w.useEffect((function(){d({tag:a?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[a,d]),_w.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),_w.createElement(TJ,null,null!==i&&_w.createElement(SZ,{mb:"20px"},_w.createElement("div",null,_w.createElement(_J,{type:i?yJ:bJ},i?hY.CONFIRM_POPUP_VALID_QR[l]:hY.CONFIRM_POPUP_INVALID_QR[l]))),_w.createElement(HZ,{ratio:1.5},_w.createElement(IJ,{src:c})),o&&_w.createElement(AJ,{className:"confirm-popup-error-message"},o.msg[l]),_w.createElement(RJ,null,_w.createElement(PJ,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},hY.BTN_TRY_AGAIN[l]),_w.createElement(PJ,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},hY.BTN_USE_THIS_PICTURE[l])))};OJ.propTypes={imageTaken:_k.shape({}),error:_k.shape({msg:_k.shape({})}),onConfirm:_k.func,onTryAgain:_k.func,hasValidQR:_k.bool,frontSide:_k.bool},OJ.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0},fE(xJ||(xJ=kK(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),_k.shape({}),_k.func,_k.func,_k.shape({}),_k.string,_k.shape({}),_k.shape({CloseCameraButton:_k.node}),_k.bool,_k.shape({}).isRequired,sM.IDCardSide;var NJ=sM.IDCardType,DJ=(sM.Errors,{ID_CARD:"id_card",QR_CODE:"qr_code"}),MJ=[{scannerType:DJ.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:sM.IDCardSide.FRONT,cardType:NJ.VN,enableConfirmPopup:!0},{scannerType:DJ.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:sM.IDCardSide.BACK,cardType:NJ.VN,enableConfirmPopup:!0}],LJ=function(){this.__data__=new KY,this.size=0},UJ=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},jJ=function(e){return this.__data__.get(e)},FJ=function(e){return this.__data__.has(e)},VJ=function(e,t){var r=this.__data__;if(r instanceof KY){var n=r.__data__;if(!WY||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new t$(n)}return r.set(e,t),this.size=r.size,this};function zJ(e){var t=this.__data__=new KY(e);this.size=t.size}zJ.prototype.clear=LJ,zJ.prototype.delete=UJ,zJ.prototype.get=jJ,zJ.prototype.has=FJ,zJ.prototype.set=VJ;var qJ,HJ=zJ,KJ=function(e,t,r){(void 0!==r&&!cW(e[t],r)||void 0===r&&!(t in e))&&sW(e,t,r)},WJ=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),a=i.length;a--;){var s=i[++n];if(!1===t(o[s],s,o))break}return e},GJ=TK((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?OK.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}})),QJ=OK.Uint8Array,XJ=function(e){var t=new e.constructor(e.byteLength);return new QJ(t).set(new QJ(e)),t},YJ=function(e,t){var r=t?XJ(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},$J=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t},ZJ=Object.create,JJ=function(){function e(){}return function(t){if(!HK(t))return{};if(ZJ)return ZJ(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),e3=function(e){return"function"!=typeof e.constructor||QW(e)?{}:JJ(tG(e))},t3=function(e){return TW(e)&&CW(e)},r3=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},n3=function(e){return dW(e,ZW(e))},o3=function(e,t,r,n,o,i,a){var s=r3(e,r),c=r3(t,r),u=a.get(c);if(u)KJ(e,r,u);else{var l=i?i(s,c,r+"",e,t,a):void 0,d=void 0===l;if(d){var f=NW(c),p=!f&&MW(c),h=!f&&!p&&HW(c);l=c,f||p||h?NW(s)?l=s:t3(s)?l=$J(s):p?(d=!1,l=GJ(c,!0)):h?(d=!1,l=YJ(c,!0)):l=[]:sG(c)||OW(c)?(l=s,OW(s)?l=n3(s):HK(s)&&!KK(s)||(l=e3(c))):d=!1}d&&(a.set(c,l),o(l,c,n,i,a),a.delete(c)),KJ(e,r,l)}},i3=function e(t,r,n,o,i){t!==r&&WJ(r,(function(a,s){if(i||(i=new HJ),HK(a))o3(t,r,s,n,e,o,i);else{var c=o?o(r3(t,s),a,s+"",t,r,i):void 0;void 0===c&&(c=a),KJ(t,s,c)}}),ZW)},a3=(_W((function(e,t,r){i3(e,t,r)})),{data:{settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},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:!0,mobile:!1}}}}}});sM.Errors,lE.div(qJ||(qJ=kK(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"]))),_k.shape({}),_k.shape({}),_k.func,_k.func,_k.func,_k.arrayOf(_k.shape({})),_k.func,_k.shape({});var s3=o((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),i=r(0),a=i.BROWSER_TYPES,s=i.OS_TYPES,c=i.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(),B=y.getUA(),S=a.CHROME,E=a.CHROMIUM,_=a.IE,x=a.INTERNET_EXPLORER,T=a.OPERA,A=a.FIREFOX,P=a.SAFARI,I=a.EDGE,R=a.YANDEX,O=a.MOBILE_SAFARI,N=c.MOBILE,D=c.TABLET,M=c.SMART_TV,L=c.BROWSER,U=c.WEARABLE,j=c.CONSOLE,F=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 B&&-1!==B.indexOf("Edg/"))},W=function(){return b.name===I},G=function(){return v("iPad")},Q=w.type===M,X=w.type===j,Y=w.type===U,$=b.name===O||G(),Z=b.name===E,J=function(){switch(w.type){case N:case D:return!0;default:return!1}}()||G(),ee=w.type===N,te=w.type===D||G(),re=w.type===L,ne=C.name===F,oe=C.name===V,ie=C.name===z||G(),ae=b.name===S,se=b.name===A,ce=b.name===P||b.name===O,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=B,ke=W()||K(),Ce=b.name===R,Be=w.type,Se=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Ee=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(),Pe=W(),Ie=C.name===q,Re=C.name===H,Oe=l(w.type);e.exports={deviceDetect:function(){var e=Oe.isBrowser,t=Oe.isMobile,r=Oe.isTablet,n=Oe.isSmartTV,o=Oe.isConsole,i=Oe.isWearable;return e?d(e,b,k,C,B):n?m(n,k,C,B):o?h(o,k,C,B):t||r?f(Oe,w,C,B):i?p(i,k,C,B):void 0},isSmartTV:Q,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ie,isChrome:ae,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:Be,isIOS13:Se,isIPad13:Ee,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Pe,isWindows:Ie,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 jH={};void 0!==jH.asn1&&jH.asn1||(jH.asn1={}),jH.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,i){var a="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]:i},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]==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):i:this[s[0]]=l?s[1].call(this,l,s[2]):i:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):i):this[s]=l||i;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?i:r}else if(w.has(t[r],e))return"?"===r?i: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"}}}},B={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=i),!(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(B,t):B;return this.getBrowser=function(){var e={name:i,version:i};return k.rgx.call(e,r,n.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:i};return k.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:i,model:i,type:i};return k.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:i,version:i};return k.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:i,version:i};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))===i||(e.exports=n):o&&(o.UAParser=S);var E=o&&(o.jQuery||o.Zepto);if(typeof E!==s){var _=new S;E.ua=_.getResult(),E.ua.get=function(){return _.getUA()},E.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)E.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),i=o.DEVICE_TYPES,a=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 i.MOBILE:return{isMobile:!0};case i.TABLET:return{isTablet:!0};case i.SMART_TV:return{isSmartTV:!0};case i.CONSOLE:return{isConsole:!0};case i.WEARABLE:return{isWearable:!0};case i.BROWSER:return{isBrowser:!0};default:return a}},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}}])})),c3="Expected a function",u3=NaN,l3="[object Symbol]",d3=/^\s+|\s+$/g,f3=/^[-+]0x[0-9a-f]+$/i,p3=/^0b[01]+$/i,h3=/^0o[0-7]+$/i,m3=parseInt,g3="object"==typeof r&&r&&r.Object===Object&&r,v3="object"==typeof self&&self&&self.Object===Object&&self,y3=g3||v3||Function("return this")(),b3=Object.prototype,w3=b3.toString,k3=Math.max,C3=Math.min,B3=function(){return y3.Date.now()};function S3(e,t,r){var n,o,i,a,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(c3);function p(t){var r=n,i=o;return n=o=void 0,u=t,a=e.apply(i,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):a}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=i}function g(){var e=B3();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?C3(r,i-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,a)}function y(){var e=B3(),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)),a}return t=T3(t)||0,E3(r)&&(l=!!r.leading,i=(d="maxWait"in r)?k3(T3(r.maxWait)||0,t):i,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?a:v(B3())},y}function E3(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _3(e){return!!e&&"object"==typeof e}function x3(e){return"symbol"==typeof e||_3(e)&&w3.call(e)==l3}function T3(e){if("number"==typeof e)return e;if(x3(e))return u3;if(E3(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=E3(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d3,"");var r=p3.test(e);return r||h3.test(e)?m3(e.slice(2),r?2:8):f3.test(e)?u3:+e}var A3=S3;function P3(e,t,r){class n extends _w.Component{constructor(){super(...arguments),this.updateDebounced=A3(this.forceUpdate,t,r)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return _w.createElement(e,Object.assign({},this.props))}}return n.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,KB(n,e)}function I3(){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 R3(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===Ey(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 O3,N3,D3,M3,L3,U3=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],j3=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&&U3.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},F3=function(e){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0)},V3=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}}},z3=sM.Errors,q3=1e3,H3=lE.div(O3||(O3=Ky(["\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"])),q3,(function(e){return e.checkCameraMode&&"opacity: 0;"})),K3=lE.video(N3||(N3=Ky(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),W3=lE.div(D3||(D3=Ky(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),G3=lE(W3)(M3||(M3=Ky(["\n z-index: ",";\n position: absolute;\n top: 20px;\n right: 20px;\n width: 20px;\n"])),q3+100),Q3=lE.div(L3||(L3=Ky(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),q3+20),X3=_w.createRef(),Y3=I3();function $3(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,i=e.onVideoPlayed,a=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=_w.useRef(),g=mF.useSDKSettings().lang,v=GF.useSDKTracking().sendEvent,y=YF.useAsset("ic_close.png"),b=Wy(_w.useState(""),2),w=b[0],k=b[1],C=_w.useRef(!1),B=_w.useRef(!1),S=_w.useRef(!1),E=_w.useRef(),_=_w.useRef([]),x=_w.useRef(""),T=_w.useCallback((function(e){u&&u(e)}),[u]),A=_w.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(E)}),[c]);function P(){return I.apply(this,arguments)}function I(){return(I=xy(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,R3();case 3:t=e.sent,_.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),nK.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)),_w.useEffect((function(){return function(){S.current=!0}}),[]);var R=_w.useCallback((function(){E.current||(E.current=setTimeout((function(){C.current||(k(z3.camera_timeout.msg[g]),T(z3.camera_timeout))}),2e4))}),[g,T]),O=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,o,i,a,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=p.length>1&&void 0!==p[1]&&p[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=s3.isMobile?s3.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:1650},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:9999}},i=V3(),a=i.updateTime,c=i.getStart,u=i.getEnd,e.prev=8,l=s||o,a(performance.now(),"start"),F3(s3.isMobile)&&r&&(l={}),n&&(l={}),nK.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),e.next=16,Y3.getUserMedia({audio:!1,video:Ny(Ny({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)});case 16:return d=e.sent,e.next=19,P();case 19:if(R(),d){e.next=24;break}return k(z3.not_supported.msg[g]),T(z3.not_supported),e.abrupt("return",null);case 24:a(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{f=d.getVideoTracks()[0].getSettings(),nK.addExifData("device_info.camera_label_dimension.got","".concat(f.width,"x").concat(f.height))}catch(e){}return e.abrupt("return",d);case 31:e.prev=31,e.t0=e.catch(8),a(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k(z3.no_permission.msg[g]),T(z3.no_permission),B.current=!0,v({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):B.current&&("NotReadableError"===e.t0.name?(T(z3.not_readable),k(z3.not_readable.msg[g])):(k(e.t0.message),T({code:e.t0.name||e.t0.code,message:e.t0.message})));case 35:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 37:case"end":return e.stop()}}),e,null,[[8,31]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,T,h,R,v]),N=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,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!=(a=c.current)&&null!==(t=a.srcObject)&&void 0!==t&&t.id&&null!=a&&null!==(r=a.srcObject)&&void 0!==r&&r.active&&C.current)){e.next=5;break}return e.abrupt("return");case 5:return a.oncanplaythrough=function(){var e,t,r;a.play(),nK.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=SV.analyzeVideoAndWindowSizes(a),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));i&&i({clientWidth:n,clientHeight:o,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,O(n,o);case 8:s=e.sent,u=j3(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&&N(f[0].deviceId)),s||B.current||(nK.addExifData("device_info.camera_label_retry","yes"),B.current=!0,N(n,!0)),s&&S.current&&(c.current.srcObject=s,A()),!s||S.current||d||(a.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,O,i,p,A]);_w.useEffect((function(){function e(){return(e=xy(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,N();case 2:return e.next=4,R3();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(),N(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return!Y3||s3.browserName&&["facebook"].includes(s3.browserName.toLowerCase())||s3.getUA.includes("Zalo iOS")?(k(z3.not_supported.msg[g]),T(z3.not_supported)):t&&(s3.isAndroid&&!1===r?function(){e.apply(this,arguments)}():N()),function(){S.current&&A()}}),[c,g,r,N,A,T]);var D=_w.useCallback((function(){A(),n&&n(),v({tag:"result",event:"user_activity.cancel",log:{}})}),[n,A,v]);return _w.createElement(H3,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!w)return null;var e=z3.no_permission.msg[g];return w===e&&s3.isIOS?_w.createElement(Q3,null,w," ",_w.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):_w.createElement(Q3,null,w)}(),_w.createElement(K3,{ref:c,playsInline:!0,muted:!0,flipHorizontal:a,className:d,scale:f}),o,l?_w.cloneElement(l,{onClick:D,"data-testid":"close-camera"}):_w.createElement(G3,{onClick:D,"data-testid":"close-camera"},_w.createElement("img",{src:y,alt:""})))}$3.propTypes={checkCameraMode:_k.bool,frontCamera:_k.bool,onClose:_k.func,onError:_k.func,onVideoPlayed:_k.func,children:_k.node,flipHorizontal:_k.bool,videoSettings:_k.object,refVideo:_k.object,closeButton:_k.node,videoClassName:_k.string,scale:_k.number,defaultCameraId:_k.string,onWarning:_k.func},$3.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 Z3,J3,e0,t0=P3($3,250),r0=_w.forwardRef((function(e,t){return _w.createElement(t0,Ry({},e,{refVideo:t||X3}))})),n0=lE.table(Z3||(Z3=Ky(["\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"]))),o0=lE.div(J3||(J3=Ky(["\n position: relative;\n"]))),i0=Array.from(Array(3).keys()),a0=Array.from(Array(3).keys());function s0(e){var t=e.children,r=e.x,n=e.y,o=e.width,i=e.height,a=e.className,s=e.surroundStyle;return _w.createElement(n0,{className:a},_w.createElement("tbody",null,i0.map((function(e,a){return _w.createElement("tr",{key:e,style:{height:0===a?n:"auto"},"data-testid":"row"},a0.map((function(e,n){var c=1===a&&1===n,u="auto";return c?u=o:0===n&&(u=r),_w.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:Ny({width:u,height:c?i:"auto"},c?{}:s)},c?_w.createElement(o0,{style:{width:u,height:i}},t):null)})))}))))}s0.propTypes={children:_k.node,x:_k.string,y:_k.string,width:_k.string,height:_k.string,className:_k.string,surroundStyle:_k.object},s0.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var c0=lE(s0)(e0||(e0=Ky(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: ",";\n"])),q3+10);function u0(e){var t=e.className;return _w.createElement("svg",{className:t,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},_w.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),_w.createElement("desc",null,"Created with sketchtool."),_w.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},_w.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},_w.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},_w.createElement("g",{id:"Group-2"},_w.createElement("g",{id:"camera"},_w.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"})))))))}function l0(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}u0.propTypes={className:_k.string},u0.defaultProps={className:""};var d0=l0,f0="object"==typeof r&&r&&r.Object===Object&&r,p0=f0,h0="object"==typeof self&&self&&self.Object===Object&&self,m0=p0||h0||Function("return this")(),g0=m0,v0=function(){return g0.Date.now()},y0=v0,b0=/\s/;function w0(e){for(var t=e.length;t--&&b0.test(e.charAt(t)););return t}var k0=w0,C0=/^\s+/;function B0(e){return e?e.slice(0,k0(e)+1).replace(C0,""):e}var S0=B0,E0=g0.Symbol,_0=E0,x0=Object.prototype,T0=x0.hasOwnProperty,A0=x0.toString,P0=_0?_0.toStringTag:void 0;function I0(e){var t=T0.call(e,P0),r=e[P0];try{e[P0]=void 0;var n=!0}catch(e){}var o=A0.call(e);return n&&(t?e[P0]=r:delete e[P0]),o}var R0=I0,O0=Object.prototype,N0=O0.toString;function D0(e){return N0.call(e)}var M0=D0,L0="[object Null]",U0="[object Undefined]",j0=_0?_0.toStringTag:void 0;function F0(e){return null==e?void 0===e?U0:L0:j0&&j0 in Object(e)?R0(e):M0(e)}var V0=F0;function z0(e){return null!=e&&"object"==typeof e}var q0=z0,H0="[object Symbol]";function K0(e){return"symbol"==typeof e||q0(e)&&V0(e)==H0}var W0=K0,G0=NaN,Q0=/^[-+]0x[0-9a-f]+$/i,X0=/^0b[01]+$/i,Y0=/^0o[0-7]+$/i,$0=parseInt;function Z0(e){if("number"==typeof e)return e;if(W0(e))return G0;if(d0(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=d0(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=S0(e);var r=X0.test(e);return r||Y0.test(e)?$0(e.slice(2),r?2:8):Q0.test(e)?G0:+e}var J0=Z0,e2="Expected a function",t2=Math.max,r2=Math.min;function n2(e,t,r){var n,o,i,a,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(e2);function p(t){var r=n,i=o;return n=o=void 0,u=t,a=e.apply(i,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):a}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=i}function g(){var e=y0();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?r2(r,i-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,a)}function y(){var e=y0(),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)),a}return t=J0(t)||0,d0(r)&&(l=!!r.leading,i=(d="maxWait"in r)?t2(J0(r.maxWait)||0,t):i,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?a:v(y0())},y}var o2=n2,i2="Expected a function";function a2(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError(i2);return d0(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),o2(e,t,{leading:n,maxWait:t,trailing:o})}var s2=a2,c2="[object AsyncFunction]",u2="[object Function]",l2="[object GeneratorFunction]",d2="[object Proxy]";function f2(e){if(!d0(e))return!1;var t=V0(e);return t==u2||t==l2||t==c2||t==d2}var p2=f2,h2=g0["__core-js_shared__"],m2=h2,g2=function(){var e=/[^.]+$/.exec(m2&&m2.keys&&m2.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function v2(e){return!!g2&&g2 in e}var y2=v2,b2=Function.prototype,w2=b2.toString;function k2(e){if(null!=e){try{return w2.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var C2=k2,B2=/[\\^$.*+?()[\]{}|]/g,S2=/^\[object .+?Constructor\]$/,E2=Function.prototype,_2=Object.prototype,x2=E2.toString,T2=_2.hasOwnProperty,A2=RegExp("^"+x2.call(T2).replace(B2,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function P2(e){return!(!d0(e)||y2(e))&&(p2(e)?A2:S2).test(C2(e))}var I2=P2;function R2(e,t){return null==e?void 0:e[t]}var O2=R2;function N2(e,t){var r=O2(e,t);return I2(r)?r:void 0}var D2=N2,M2=function(){try{var e=D2(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),L2=M2;function U2(e,t,r){"__proto__"==t&&L2?L2(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var j2=U2;function F2(e,t){return e===t||e!=e&&t!=t}var V2=F2,z2=Object.prototype,q2=z2.hasOwnProperty;function H2(e,t,r){var n=e[t];q2.call(e,t)&&V2(n,r)&&(void 0!==r||t in e)||j2(e,t,r)}var K2=H2;function W2(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var s=t[i],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?j2(r,s,c):K2(r,s,c)}return r}var G2=W2;function Q2(e){return e}var X2=Q2;function Y2(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)}var $2=Y2,Z2=Math.max;function J2(e,t,r){return t=Z2(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=Z2(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),$2(e,this,s)}}var e1=J2;function t1(e){return function(){return e}}var r1=t1,n1=L2?function(e,t){return L2(e,"toString",{configurable:!0,enumerable:!1,value:r1(t),writable:!0})}:X2,o1=n1,i1=800,a1=16,s1=Date.now;function c1(e){var t=0,r=0;return function(){var n=s1(),o=a1-(n-r);if(r=n,o>0){if(++t>=i1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var u1=c1,l1=u1(o1),d1=l1;function f1(e,t){return d1(e1(e,t,X2),e+"")}var p1=f1,h1=9007199254740991;function m1(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h1}var g1=m1;function v1(e){return null!=e&&g1(e.length)&&!p2(e)}var y1=v1,b1=9007199254740991,w1=/^(?:0|[1-9]\d*)$/;function k1(e,t){var r=typeof e;return!!(t=null==t?b1:t)&&("number"==r||"symbol"!=r&&w1.test(e))&&e>-1&&e%1==0&&e<t}var C1=k1;function B1(e,t,r){if(!d0(r))return!1;var n=typeof t;return!!("number"==n?y1(r)&&C1(t,r.length):"string"==n&&t in r)&&V2(r[t],e)}var S1=B1;function E1(e){return p1((function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&S1(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t}))}var _1=E1;function x1(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var T1=x1,A1="[object Arguments]";function P1(e){return q0(e)&&V0(e)==A1}var I1=P1,R1=Object.prototype,O1=R1.hasOwnProperty,N1=R1.propertyIsEnumerable,D1=I1(function(){return arguments}())?I1:function(e){return q0(e)&&O1.call(e,"callee")&&!N1.call(e,"callee")},M1=D1,L1=Array.isArray,U1=L1;function j1(){return!1}var F1=j1,V1=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?g0.Buffer:void 0,i=(o?o.isBuffer:void 0)||F1;e.exports=i})),z1="[object Arguments]",q1="[object Array]",H1="[object Boolean]",K1="[object Date]",W1="[object Error]",G1="[object Function]",Q1="[object Map]",X1="[object Number]",Y1="[object Object]",$1="[object RegExp]",Z1="[object Set]",J1="[object String]",e5="[object WeakMap]",t5="[object ArrayBuffer]",r5="[object DataView]",n5="[object Float32Array]",o5="[object Float64Array]",i5="[object Int8Array]",a5="[object Int16Array]",s5="[object Int32Array]",c5="[object Uint8Array]",u5="[object Uint8ClampedArray]",l5="[object Uint16Array]",d5="[object Uint32Array]",f5={};function p5(e){return q0(e)&&g1(e.length)&&!!f5[V0(e)]}f5[n5]=f5[o5]=f5[i5]=f5[a5]=f5[s5]=f5[c5]=f5[u5]=f5[l5]=f5[d5]=!0,f5[z1]=f5[q1]=f5[t5]=f5[H1]=f5[r5]=f5[K1]=f5[W1]=f5[G1]=f5[Q1]=f5[X1]=f5[Y1]=f5[$1]=f5[Z1]=f5[J1]=f5[e5]=!1;var h5=p5;function m5(e){return function(t){return e(t)}}var g5=m5,v5=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&p0.process,i=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i})),y5=v5&&v5.isTypedArray,b5=y5?g5(y5):h5,w5=b5,k5=Object.prototype,C5=k5.hasOwnProperty;function B5(e,t){var r=U1(e),n=!r&&M1(e),o=!r&&!n&&V1(e),i=!r&&!n&&!o&&w5(e),a=r||n||o||i,s=a?T1(e.length,String):[],c=s.length;for(var u in e)!t&&!C5.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||C1(u,c))||s.push(u);return s}var S5=B5,E5=Object.prototype;function _5(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||E5)}var x5=_5;function T5(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}var A5=T5,P5=Object.prototype,I5=P5.hasOwnProperty;function R5(e){if(!d0(e))return A5(e);var t=x5(e),r=[];for(var n in e)("constructor"!=n||!t&&I5.call(e,n))&&r.push(n);return r}var O5=R5;function N5(e){return y1(e)?S5(e,!0):O5(e)}var D5=N5,M5=_1((function(e,t,r,n){G2(t,D5(t),e,n)})),L5=M5;function U5(e,t){return function(r){return e(t(r))}}var j5=U5,F5=j5(Object.getPrototypeOf,Object),V5=F5,z5="[object Object]",q5=Function.prototype,H5=Object.prototype,K5=q5.toString,W5=H5.hasOwnProperty,G5=K5.call(Object);function Q5(e){if(!q0(e)||V0(e)!=z5)return!1;var t=V5(e);if(null===t)return!0;var r=W5.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&K5.call(r)==G5}var X5=Q5,Y5="[object DOMException]",$5="[object Error]";function Z5(e){if(!q0(e))return!1;var t=V0(e);return t==$5||t==Y5||"string"==typeof e.message&&"string"==typeof e.name&&!X5(e)}var J5=Z5,e4=p1((function(e,t){try{return $2(e,void 0,t)}catch(e){return J5(e)?e:new Error(e)}})),t4=e4;function r4(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 n4=r4;function o4(e,t){return n4(t,(function(t){return e[t]}))}var i4=o4,a4=Object.prototype,s4=a4.hasOwnProperty;function c4(e,t,r,n){return void 0===e||V2(e,a4[r])&&!s4.call(n,r)?t:e}var u4=c4,l4={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function d4(e){return"\\"+l4[e]}var f4=d4,p4=j5(Object.keys,Object),h4=p4,m4=Object.prototype,g4=m4.hasOwnProperty;function v4(e){if(!x5(e))return h4(e);var t=[];for(var r in Object(e))g4.call(e,r)&&"constructor"!=r&&t.push(r);return t}var y4=v4;function b4(e){return y1(e)?S5(e):y4(e)}var w4=b4,k4=/<%=([\s\S]+?)%>/g,C4=k4;function B4(e){return function(t){return null==e?void 0:e[t]}}var S4=B4,E4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_4=S4(E4),x4=_4,T4=1/0,A4=_0?_0.prototype:void 0,P4=A4?A4.toString:void 0;function I4(e){if("string"==typeof e)return e;if(U1(e))return n4(e,I4)+"";if(W0(e))return P4?P4.call(e):"";var t=e+"";return"0"==t&&1/e==-T4?"-0":t}var R4=I4;function O4(e){return null==e?"":R4(e)}var N4=O4,D4=/[&<>"']/g,M4=RegExp(D4.source);function L4(e){return(e=N4(e))&&M4.test(e)?e.replace(D4,x4):e}var U4=L4,j4=/<%-([\s\S]+?)%>/g,F4=j4,V4=/<%([\s\S]+?)%>/g,z4=V4,q4={escape:F4,evaluate:z4,interpolate:C4,variable:"",imports:{_:{escape:U4}}},H4=q4,K4="Invalid `variable` option passed into `_.template`",W4=/\b__p \+= '';/g,G4=/\b(__p \+=) '' \+/g,Q4=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X4=/[()=,{}\[\]\/\s]/,Y4=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$4=/($^)/,Z4=/['\n\r\u2028\u2029\\]/g,J4=Object.prototype,e8=J4.hasOwnProperty;function t8(e,t,r){var n=H4.imports._.templateSettings||H4;r&&S1(e,t,r)&&(t=void 0),e=N4(e),t=L5({},t,n,u4);var o,i,a=L5({},t.imports,n.imports,u4),s=w4(a),c=i4(a,s),u=0,l=t.interpolate||$4,d="__p += '",f=RegExp((t.escape||$4).source+"|"+l.source+"|"+(l===C4?Y4:$4).source+"|"+(t.evaluate||$4).source+"|$","g"),p=e8.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,a,s,c){return n||(n=a),d+=e.slice(u,c).replace(Z4,f4),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var h=e8.call(t,"variable")&&t.variable;if(h){if(X4.test(h))throw new Error(K4)}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(W4,""):d).replace(G4,"$1").replace(Q4,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=t4((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(m.source=d,J5(m))throw m;return m}var r8=t8,n8=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o8=/^\w*$/;function i8(e,t){if(U1(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!W0(e))||(o8.test(e)||!n8.test(e)||null!=t&&e in Object(t))}var a8=i8,s8=D2(Object,"create"),c8=s8;function u8(){this.__data__=c8?c8(null):{},this.size=0}var l8=u8;function d8(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var f8=d8,p8="__lodash_hash_undefined__",h8=Object.prototype,m8=h8.hasOwnProperty;function g8(e){var t=this.__data__;if(c8){var r=t[e];return r===p8?void 0:r}return m8.call(t,e)?t[e]:void 0}var v8=g8,y8=Object.prototype,b8=y8.hasOwnProperty;function w8(e){var t=this.__data__;return c8?void 0!==t[e]:b8.call(t,e)}var k8=w8,C8="__lodash_hash_undefined__";function B8(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=c8&&void 0===t?C8:t,this}var S8=B8;function E8(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])}}E8.prototype.clear=l8,E8.prototype.delete=f8,E8.prototype.get=v8,E8.prototype.has=k8,E8.prototype.set=S8;var _8=E8;function x8(){this.__data__=[],this.size=0}var T8=x8;function A8(e,t){for(var r=e.length;r--;)if(V2(e[r][0],t))return r;return-1}var P8=A8,I8=Array.prototype,R8=I8.splice;function O8(e){var t=this.__data__,r=P8(t,e);return!(r<0)&&(r==t.length-1?t.pop():R8.call(t,r,1),--this.size,!0)}var N8=O8;function D8(e){var t=this.__data__,r=P8(t,e);return r<0?void 0:t[r][1]}var M8=D8;function L8(e){return P8(this.__data__,e)>-1}var U8=L8;function j8(e,t){var r=this.__data__,n=P8(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var F8=j8;function V8(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])}}V8.prototype.clear=T8,V8.prototype.delete=N8,V8.prototype.get=M8,V8.prototype.has=U8,V8.prototype.set=F8;var z8=V8,q8=D2(g0,"Map"),H8=q8;function K8(){this.size=0,this.__data__={hash:new _8,map:new(H8||z8),string:new _8}}var W8=K8;function G8(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var Q8=G8;function X8(e,t){var r=e.__data__;return Q8(t)?r["string"==typeof t?"string":"hash"]:r.map}var Y8=X8;function $8(e){var t=Y8(this,e).delete(e);return this.size-=t?1:0,t}var Z8=$8;function J8(e){return Y8(this,e).get(e)}var e6=J8;function t6(e){return Y8(this,e).has(e)}var r6=t6;function n6(e,t){var r=Y8(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var o6=n6;function i6(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])}}i6.prototype.clear=W8,i6.prototype.delete=Z8,i6.prototype.get=e6,i6.prototype.has=r6,i6.prototype.set=o6;var a6=i6,s6="Expected a function";function c6(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s6);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(c6.Cache||a6),r}c6.Cache=a6;var u6=c6,l6=500;function d6(e){var t=u6(e,(function(e){return r.size===l6&&r.clear(),e})),r=t.cache;return t}var f6=d6,p6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h6=/\\(\\)?/g,m6=f6((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(p6,(function(e,r,n,o){t.push(n?o.replace(h6,"$1"):r||e)})),t})),g6=m6;function v6(e,t){return U1(e)?e:a8(e,t)?[e]:g6(N4(e))}var y6=v6,b6=1/0;function w6(e){if("string"==typeof e||W0(e))return e;var t=e+"";return"0"==t&&1/e==-b6?"-0":t}var k6=w6;function C6(e,t){for(var r=0,n=(t=y6(t,e)).length;null!=e&&r<n;)e=e[k6(t[r++])];return r&&r==n?e:void 0}var B6=C6;function S6(e,t,r){var n=null==e?void 0:B6(e,t);return void 0===n?r:n}var E6=S6,_6=sM.Errors;function x6(e){var t=e.livenessSettings,r=e.apiClient,n=e.apiCheck,o=e.onError,i=Wy(_w.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,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}}),2),a=i[0],s=i[1];return _w.useEffect((function(){t&&Object.keys(t).length>0?s((function(e){return Ny(Ny({},e),t)})):n&&r.clientSettings().then((function(e){if(e&&e.data){var t,r=E6(e,"data.settings.sdk_settings.active_liveness_settings"),n=E6(e,"data.settings.sdk_settings.liveness_settings"),i=E6(r,"save_encoded_frames",{});i.enable&&(t={enable:!0,framesIntervalTime:i.frames_interval_ms,framesBatchLength:i.frames_batch_len});var a=E6(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});s(Ny(Ny(Ny({},r),n),{},{captureFrameSettings:t,exif_data_settings:a}))}e&&e.errors&&o(_6.server_error)})).catch((function(e){o(e)}))}),[t,r,o,n]),a}var T6=function(e){var t=e.curStep,r=e.faceDirection,n=E6(t,"stepTimeConstraints.delayTime");return!!n&&(null===t.firstFrameSpottedAt?(t.name===r&&(t.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-t.firstFrameSpottedAt<n)},A6=1/0,P6=17976931348623157e292;function I6(e){return e?(e=J0(e))===A6||e===-A6?(e<0?-1:1)*P6:e==e?e:0:0===e?e:0}var R6=I6;function O6(e){var t=R6(e),r=t%1;return t==t?r?t-r:t:0}var N6=O6,D6="Expected a function";function M6(e,t){var r;if("function"!=typeof t)throw new TypeError(D6);return e=N6(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var L6=M6;function U6(e){return L6(2,e)}var j6=U6,F6=function(){var e=xy(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?oK:r,e.next=3,Nq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function V6(){return z6.apply(this,arguments)}function z6(){return(z6=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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,i=new iK(o),e.next=4,Nq.loadTensorFlow(n);case 4:return e.next=6,Nq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return a=[Nq.loadBlazefaceModel({modelUrl:r}),i.load()],e.next=9,Promise.all(a);case 9:return s=e.sent,c=Wy(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:i});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var q6,H6,K6,W6,G6,Q6,X6,Y6=j6(V6),$6=[],Z6=function(){$6=[]},J6=function(e,t,r){r&&Z6(),$6.push({id:null});var n=$6.length-1;t.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?$6[n].id=e.data.file_id:$6[n].id=-1}))},e9=function(){return new Promise((function(e){var t=setInterval((function(){$6.every((function(e){return e.id}))&&(e(),clearInterval(t))}),200)}))},t9=function(e){return e.enable?$6.some((function(e){return-1===e.id}))?null:$6:[]},r9=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.steps,n=t.apiClient,o=t.FaceDirection,i=t.outputEncryptionSettings,a=[],r.forEach((function(e){var t=e.name,r=e.image,s=e.frontalFaceImage;if(t!==o.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:r.leftRightScore,gesture:t})};i&&i.key?a.push(n.httpClient.post("/v1/images",Ny({base64:r.encrypted.hex},c),{"X-TV-Key":i.key})):a.push(n.uploadImage(Ny({file:r.blob},c)))}else a.push(Promise.resolve({data:{image_id:null}}));if(s.blob){var u={label:"portrait",metadata:JSON.stringify({gesture_score:s.leftRightScore,gesture:o.FRONTAL})};i&&i.key?a.push(n.httpClient.post("/v1/images",Ny({base64:s.encrypted.hex},u),{"X-TV-Key":i.key})):a.push(n.uploadImage(Ny({file:s.blob},u)))}else a.push(Promise.resolve({data:{image_id:null}}))})),e.next=5,Promise.all(a);case 5:s=e.sent,r.forEach((function(e,t){e.image.imageId=s[2*t].data.image_id,e.frontalFaceImage.imageId=s[2*t+1].data.image_id}));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n9=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,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.apiClient,n=t.faceVerificationFlowData,o=t.onLivenessDetectionDone,i=t.captureFrameSettings,a=t.FaceDirection,s=t.onError,c=t.outputEncryptionSettings,e.prev=1,u=n.current.steps,e.next=5,r9({steps:u,apiClient:r,FaceDirection:a,outputEncryptionSettings:c});case 5:if(0!==(l=u.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,e9();case 12:if(d=t9(i)){e.next=17;break}o({error:"network_error"}),e.next=27;break;case 17:return f=r.verifyFaceLiveness({images:l.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:u.filter((function(e){return e.image.imageId&&e.name!==a.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:d}),p=r.requestVerifyPortrait({image:{id:l[l.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([f,p]);case 21:h=e.sent,m=Wy(h,2),g=m[0],v=m[1],y=!0===g.data.is_live,o({apiCheckPassed:y,verifyFaceLivenessResult:g.data,verifyFacePortraitResult:v.data,frontalFaces:l.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:u.filter((function(e){return e.image.imageId&&e.name!==a.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)}}(),o9=jV.faceTracker(),i9=new jq,a9=sM.Mode,s9=sM.FaceDirection,c9=sM.Errors,u9=sM.Messages,l9=sM.TrackLivenessEvents,d9=-1,f9=3,p9=3;function h9(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.apiCheck,n=t.mode,o=t.bgCameraMask,i=t.bgCameraMaskRed,a=t.surroundStyle,s=t.cropAreaDimension,c=t.customInstructions,u=t.customIcon,l=t.customDirectionIcon,d=t.customStepTimeConstraints,f=void 0===d?(Iy(e={},sM.FaceDirection.UP,{delayTime:0}),Iy(e,sM.FaceDirection.LEFT,{delayTime:0}),Iy(e,sM.FaceDirection.RIGHT,{delayTime:0}),Iy(e,sM.FaceDirection.FRONTAL,{delayTime:2e3}),e):d,p=t.onLivenessDetectionDone,h=t.onError,m=t.frontalMinSize,g=t.waitingTimeToGetBetterFrames,v=void 0===g?500:g,y=t.captureFrameSettings,b=void 0===y?{enable:!1,framesIntervalTime:180,framesBatchLength:0}:y,w=t.livenessSettings,k=t.setRemainingTime,C=void 0===k?function(){}:k,B=t.onProcessing,S=void 0===B?function(){}:B,E=t.customErrors,_=t.customMessages,x=t.apiCredentials,T=void 0===x?{}:x,A=t.onFramesCaptured,P=void 0===A?function(){}:A,I=t.initFirstGestureTimeout,R=void 0===I?2e3:I,O=t.outputEncryptionSettings,N=t.cameraScale,D=void 0===N?1:N,M=t.passiveModeAuto,L=void 0!==M&&M,U=t.sendCustomEvent,j=_w.useState(!1),F=Wy(j,2),V=F[0],z=F[1],q=_w.useState(!1),H=Wy(q,2),K=H[0],W=H[1],G=_w.useState(!1),Q=Wy(G,2),X=Q[0],Y=Q[1],$=_w.useRef(null),Z=mF.useSDKSettings(),J=Z.lang,ee=Z.assetRoot,te=Z.customUrls,re=iq.useApiClient({apiCredentials:T}),ne=re.apiClient,oe=n===a9.ACTIVE,ie=_w.useReducer((function(e){return e+1}),0),ae=Wy(ie,2),se=(ae[0],ae[1]),ce=_w.useRef(null),ue=_w.useRef(!1),le=_w.useState(!1),de=Wy(le,2),fe=de[0],pe=de[1],he=_w.useRef({}),me=GF.useSDKTracking(),ge=me.sendEvent,ve=sK(),ye=ve.startMotion,be=ve.stopMotion,we=ve.motionData,ke=ve.orientationData,Ce=_w.useRef(null);null===Ce.current&&(Ce.current=jV.initFaceVerificationData({assetRoot:ee,customInstructions:c,customIcon:u,customDirectionIcon:l,customStepTimeConstraints:f}));var Be=_w.useState(),Se=Wy(Be,2),Ee=Se[0],_e=Se[1],xe=_w.useCallback((function(e){_e(e)}),[]),Te=_w.useMemo((function(){return s2(xe,500)}),[xe]),Ae=_w.useRef([]),Pe=_w.useRef(),Ie=x6({livenessSettings:w,apiClient:ne,apiCheck:r,onError:h}),Re=Ie.face_tracking_setting,Oe=Ie.flow_interval_time_ms,Ne=Ie.limit_time_liveness_check,De=Ie.terminate_if_no_face,Me=Ie.close_eye_detector,Le=void 0===Me?{}:Me,Ue=Ie.captureFrameSettings,je=void 0===Ue?b:Ue,Fe=Ie.exif_data_settings,Ve=_w.useRef(""),ze=_w.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==l9?void 0:l9.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===Ve.current)return;Ve.current=r}ge(e),U&&U(e)}}),[U,ge]),qe=_w.useMemo((function(){return s2((function(e){ze(e)}),2e3)}),[ze]),He=_w.useRef(0),Ke=_w.useRef(),We=_w.useRef(!1);_w.useEffect((function(){return nK.initExifData(),ze({tag:"selfie",event:null==l9?void 0:l9.start_camera,log:{}}),i9.start(),function(){We.current=!0,i9.stop()}}),[ze]),_w.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(fe){e.next=13;break}return Pe.current=performance.now(),e.next=4,Y6(te);case 4:return he.current=e.sent,e.next=7,Nq.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!We.current){e.next=9;break}return e.abrupt("return");case 9:pe(!0),ze({tag:"selfie",event:null==l9?void 0:l9.show_warmup,log:{}}),ze({tag:"selfie",event:null==l9?void 0:l9.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Pe.current}}),Pe.current=null;case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[fe,te,ze]);var Ge=_w.useCallback((function(){C(""),Ce.current.curStepIndex=Ce.current.steps.length,W(!1),i9.stop(),setTimeout((function(){Ce.current=jV.initFaceVerificationData({assetRoot:ee,customInstructions:c,customIcon:u,customDirectionIcon:l}),i9.start(),He.current=0,Ke.current=null,Ae.current=[],Y(!1),Z6(),se()}),Oe)}),[ee,c,u,l,Oe,C]),Qe=_w.useMemo((function(){return Ny(Ny({},c9),E)}),[E]),Xe=_w.useMemo((function(){return Ny(Ny({},u9),_)}),[_]),Ye=400;_w.useEffect((function(){if(V&&Ne.enable&&X){var e=Ne.limit_time_second+1,t=Ne.remain_time_show||10,r=Ne.format||"s";i9.start("limit",(function(n){var o=e-n;if(Ce.current.curStepIndex<Ce.current.steps.length){if(o<=t&&o>=1){var i=r8(Xe.REMAIN_TIME[J]),a=o;switch(r){case"mm:ss":a=o.toString().padStart(5,"00:00");break;case"ss":a=o.toString().padStart(2,"0")}C(i({x:a}))}if(0===o){var s,c={};Object.keys(null===(s=Qe.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=r8(null===(t=Qe.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:Ne.limit_time_second})})),_e(Ny(Ny({},Qe.liveness_terminated_time_out),{},{msg:c,duration:Oe})),ze({tag:"selfie",event:null==l9?void 0:l9.show_alert,log:{alert:"liveness_terminated_time_out,"}}),Ge()}}}))}}),[Ge,C,V,J,Oe,Ne.enable,Ne.limit_time_second,X,Qe.liveness_terminated_time_out,Xe.REMAIN_TIME,Ne.format,Ne.remain_time_show,ze]);var $e=_w.useCallback((function(e){var t,r,n=e.clientWidth,i=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;s3.isMobile?r=t=c:t=r=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=o;ce.current={x:f,y:p,width:t,height:r,image:h,surroundStyle:a},"object"===Ey(s)?ce.current=Ny(Ny({},ce.current),s):"function"==typeof s&&(ce.current=Ny(Ny({},ce.current),s({clientWidth:n,clientHeight:i,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:s3.isMobile,width:t,height:r}))),se(),z(!0)}),[o,a,s]),Ze=_w.useState(f9),Je=Wy(Ze,2),et=Je[0],tt=Je[1],rt=_w.useState(!1),nt=Wy(rt,2),ot=nt[0],it=nt[1],at=_w.useRef(!1),st=_w.useCallback((function(e){it(e),at.current=e}),[]),ct=_w.useRef(null),ut=_w.useRef([]),lt=_w.useCallback((function(){tt(f9),clearInterval(ct.current),st(!0);var e=function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,o,i,a,s,c,u,l,d,f,m,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t-1!=0){e.next=23;break}return clearInterval(ct.current),n=ut.current,S(),be(),nK.preWriteExif({mode:nK.MODE.SELFIE,motionData:we,orientationData:ke,startTime:Date.now()-1e3*i9.duration("from_1st_frame"),endTime:Date.now()}),o=n.map((function(e){return Wz.resizeBlobImg(e.blob,Ye,Ye)})),e.next=9,Promise.all(o);case 9:return i=e.sent,a=i.map((function(e,t){return nK.writeExif({mode:nK.MODE.SELFIE,imageData:Ny(Ny({},n[t]),{},{blob:e,gesture:"frontal"}),enableExifData:Fe.enable})})),e.next=13,Promise.all(a);case 13:if(s=e.sent,c={},!O||!O.key){e.next=22;break}return u=O.key,l=s.map((function(e){return Uq.encrypt({blob:e,key:u})})),e.next=20,Promise.all(l);case 20:d=e.sent,c={frontalFacesEncrypted:d};case 22:r?(f=Gy(Ae.current),m=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:s9.FRONTAL})}},g=n.map((function(e,t){return ne.uploadImage(Ny({file:s[t]},m(e.leftRightScore)))})),O&&O.key&&(g=n.map((function(e,t){return ne.httpClient.post("/v1/images",Ny({base64:c.frontalFacesEncrypted[t].hex},m(e.leftRightScore)),{"X-TV-Key":O.key})}))),Promise.all(g).then((function(e){return ne.verifyFaceLiveness({images:e.map((function(e){return{id:e.data.image_id}})),videos:[{frames:f}]})})).then((function(e){p({apiCheckPassed:e.data.is_live,verifyFaceLivenessResult:e.data})})).catch((function(e){h({error:e})}))):p(Ny(Ny({frontalFaces:s},c),{},{capturedFrames:Ae.current}));case 23:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();ct.current=setInterval((function(){tt((function(t){return e(t),t-1}))}),1e3)}),[st,r,p,ne,h,S,O,be,we,ke,Fe.enable]),dt=_w.useRef({});_w.useEffect((function(){dt.current.isFirstValidFrameFoundRef=X}),[X]),_w.useEffect((function(){var e,t=$.current,n=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Ce.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:s9.FRONTAL}),0})),n=r.map((function(e){return Wz.resizeBlobImg(e.blob,Ye,Ye)})),e.next=6,Promise.all(n);case 6:return o=e.sent,i=o.map((function(e,t){return nK.writeExif({mode:nK.MODE.SELFIE,imageData:Ny(Ny({},r[t]),{},{blob:e}),enableExifData:Fe.enable})})),e.next=10,Promise.all(i);case 10:return a=e.sent,s=r.map((function(e,t){return{name:e.name,blob:a[t]}})),e.next=14,Promise.all(t.map(function(){var e=xy(regeneratorRuntime.mark((function e(r,n){var o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=s.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),!O||!O.key){e.next=12;break}return i=O.key,e.next=7,Uq.encrypt({blob:o[0].blob,key:i});case 7:if(t[n].image.encrypted=e.sent,!r.frontalFaceImage.blob){e.next=12;break}return e.next=11,Uq.encrypt({blob:o[1].blob,key:i});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 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,o,i,a,s,c,u,l,d,f,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=Ce.current.steps,i=o[Ce.current.curStepIndex],Iy(t={},sM.FaceDirection.UP,null==l9?void 0:l9.capture_up_face),Iy(t,sM.FaceDirection.LEFT,null==l9?void 0:l9.capture_left_face),Iy(t,sM.FaceDirection.RIGHT,null==l9?void 0:l9.capture_right_face),Iy(t,sM.FaceDirection.FRONTAL,null==l9?void 0:l9.capture_frontal_face),ze({tag:"selfie",event:t[i.name],log:{time_capture_in_seconds:((performance.now()-Pe.current)/1e3).toFixed(1)}}),Ce.current.curStepIndex++,Pe.current=performance.now(),Re.enable&&"each_gesture"===Re.limit_for&&(He.current=0),Ce.current.curStepIndex!==o.length){e.next=39;break}if(Ne.enable&&C(""),!p){e.next=39;break}return je.enable&&je.framesBatchLength>0&&Ae.current.length%je.framesBatchLength>0&&(P(Ae.current.slice(Ae.current.length%je.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),r&&J6(Ae.current.slice(Ae.current.length%je.framesBatchLength*-1),ne)),ze({tag:"selfie",event:null==l9?void 0:l9.finish_capture,log:{time_capture_in_seconds:i9.duration("from_1st_frame")}}),S(),be(),nK.preWriteExif({mode:nK.MODE.SELFIE,motionData:we,orientationData:ke,startTime:Date.now()-1e3*i9.duration("from_1st_frame"),endTime:Date.now()}),e.next=17,n();case 17:if(r){e.next=37;break}if(l=o.filter((function(e){return e.name!==s9.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),d=o.filter((function(e){return e.name!==s9.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),f=o.filter((function(e){return e.name!==s9.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),g=null===(a=o.find((function(e){return e.name===s9.FRONTAL})))||void 0===a||null===(s=a.image)||void 0===s?void 0:s.blob,v=null===(c=o.find((function(e){return e.name===s9.FRONTAL})))||void 0===c||null===(u=c.image)||void 0===u?void 0:u.encrypted,!g||!m){e.next=29;break}return e.next=26,Wz.scaleImage(g,{minSize:m});case 26:e.t0=e.sent,e.next=30;break;case 29:e.t0=null;case 30:y=e.t0,g&&d.push(g),v&&f.push(v),ze({tag:"result",event:null==l9?void 0:l9.liveness_detection_done,log:{result_object:{steps:l,frontalFaces:d,frontalScaledImage:y}}}),p({steps:l,frontalFaces:d,frontalFacesEncrypted:f,frontalScaledImage:y,capturedFrames:Ae.current}),e.next=39;break;case 37:return e.next=39,n9({apiClient:ne,faceVerificationFlowData:Ce,onLivenessDetectionDone:p,captureFrameSettings:je,FaceDirection:s9,onError:h,outputEncryptionSettings:O});case 39:se();case 40:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=o2((function(){var e=Ce.current,t=e.curStepIndex,r=e.steps,n=r[t],o=null!==(null==n?void 0:n.image.blob),i=null!==(null==n?void 0:n.frontalFaceImage.blob),s=r.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(i||![1].includes(t)||s>=1)?(ue.current=!1,a(),c=!0):ue.current=!(!o||i),W(!1),c}),v);function c(e){return u.apply(this,arguments)}function u(){return(u=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,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,i=t.leftRightScore,c=t.isEyeClose,u=Ce.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!T6({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!==s9.FRONTAL||null!==f.frontalFaceImage.blurScore&&!CV.hasBetterBlurScore(o,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=o,e.next=12,SV.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=i,f.frontalFaceImage.captureTime=Date.now(),ue.current&&(ue.current=!1,a());case 17:if(f.name!==r||null!==f.image.blurScore&&!CV.hasBetterBlurScore(o,f.image.blurScore)){e.next=29;break}return W(!0),f.image.blurScore=o,e.next=22,SV.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=i,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 d.apply(this,arguments)}function d(){return(d=xy(regeneratorRuntime.mark((function e(t,r,n){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!0===at.current&&t===s9.FRONTAL&&ut.current.length<p9)){e.next=5;break}return e.next=3,SV.takePicture({canvas:r});case 3:o=e.sent,ut.current.push({blob:o,leftRightScore:n,captureTime:Date.now()});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e,t,n,o){if(Ae.current.length&&Date.now()-Ae.current[Ae.current.length-1].time<je.framesIntervalTime)return null;if(je.enable&&!o){var i=e.topLeft,a=e.bottomRight,s=[].concat(Gy(i),Gy(a)),c=o9(e,0===Ae.current.length),u=c.score,l=c.time,d=t.toDataURL("image/jpeg",.8);return Ae.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:Ae.current.length,bbox:s,original_bbox:s}),je.framesBatchLength>0&&Ae.current.length%je.framesBatchLength==0&&P&&(P(Ae.current.slice(-je.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),r&&J6(Ae.current.slice(-je.framesBatchLength),ne,Ae.current.length===je.framesBatchLength)),u}return null}function y(e){var t=e.trackingScore,r=e.isFirstValidFrameFoundRef;if(!Re.enable||null===t||!r)return!0;var n=Re.web_warning_threshold,o=Re.web_terminate_threshold,i=Re.max_warning_time;return t<n||(t<o&&He.current<i?(He.current++,He.current===i?(_e(Ny(Ny({},Qe.liveness_terminated_face_tracking),{},{duration:Oe})),ze({tag:"selfie",event:null==l9?void 0:l9.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):_e(Ny(Ny({},Qe.liveness_too_fast),{},{duration:1500})),!0):(_e(Ny(Ny({},Qe.liveness_terminated),{},{duration:Oe})),ze({tag:"selfie",event:null==l9?void 0:l9.show_alert,log:{alert:"liveness_terminated"}}),Ge(),!1))}function b(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(De.enable&&r){var n=De.max_time_ms;Ke.current&&t||(Ke.current={time:Date.now(),frame:0}),t&&Ke.current.frame++;var o=Ke.current.time;t&&Date.now()-o>=n&&(_e(Ny(Ny({},Qe.liveness_terminated_no_face),{},{duration:Oe})),ze({tag:"selfie",event:null==l9?void 0:l9.show_alert,log:{alert:"liveness_terminated_no_face"}}),Ge())}}function w(e,t){return k.apply(this,arguments)}function k(){return(k=xy(regeneratorRuntime.mark((function r(n,a){var s,u,d,p,h,m,v,k,C,B,S,E,_,x,T,A,P,I,R,O,N,M,U,j,F,V,z,q,H,K,W,G,Q,X,$;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==(null==a?void 0:a.width)&&0!==(null==a?void 0:a.height)){r.next=2;break}return r.abrupt("return");case 2:return p=dt.current.isFirstValidFrameFoundRef,h=n.cropX,m=n.cropY,v=n.cropWidth,k=n.cropHeight,a.getContext("2d").drawImage(t,h,m,v,k,-(Ye*D-Ye)/2/D,-(Ye*D-Ye)/2/D,Ye,Ye),C=he.current,B=C.blazefaceModel,S=C.closeEyesModel,r.next=9,CV.calculateBlurScore(a);case 9:return E=r.sent,r.next=12,VV.getModelPredictions({model:B,sCanvas:a});case 12:return _=r.sent,r.next=15,jV.validatePredictions({predictions:_,width:VV.SIZE,height:VV.SIZE});case 15:if(T=r.sent,A=T.error,P=T.fullFace,I=T.faceRatio,R=T.faceNotFrontalMinThreshold,x=A,ce.current.image=o,N=null,M=null,U=null,j=null,F=Ce.current,V=F.curStepIndex,z=F.steps,!P){r.next=44;break}return q=z[V],H=q&&q.name===s9.FRONTAL,U=P.landmarks,r.next=33,jV.calculateFaceDirection({landmarks:U,getPerfectFrontal:H});case 33:if((K=r.sent)&&(N=K.gesture,M=K.leftRightScore),W=(null==Le?void 0:Le.web_timeout)+f[sM.FaceDirection.FRONTAL].delayTime/1e3,!(H&&null!=Le&&Le.enable&&(-1===i9.duration("limit_close_eye")||i9.duration("limit_close_eye")<W))){r.next=44;break}return-1===i9.duration("limit_close_eye")&&i9.start("limit_close_eye"),r.next=40,S.predict(a,U,null==Le?void 0:Le.web_threshold);case 40:G=r.sent,Q=G.isEyeClose,(j=Q)&&!x&&(x=c9.close_eye);case 44:if(X="no_face"===(null===(s=x)||void 0===s?void 0:s.code)||"partial_face"===(null===(u=x)||void 0===u?void 0:u.code),$=V<z.length,b({noFace:X&&$,isFirstValidFrameFoundRef:p}),null!==(d=x)&&void 0!==d&&d.code&&qe({tag:"selfie",event:null==l9?void 0:l9.show_alert,log:{alert:x.code}}),x&&!("face_too_small"===x.code&&N!==s9.FRONTAL&&I>=R)){r.next=70;break}if(oe||g(_[0],a,U),!oe){r.next=58;break}if(p||(Y(!0),Pe.current=performance.now(),i9.start("from_1st_frame")),!y({trackingScore:g(_[0],a,U,V>=z.length),isFirstValidFrameFoundRef:p})){r.next=56;break}return r.next=56,c({faceDirection:N,canvas:a,blurScore:E,leftRightScore:M,isEyeClose:j});case 56:r.next=68;break;case 58:if(N===s9.FRONTAL){r.next=63;break}O=Qe.not_frontal_face,ce.current.image=i,r.next=68;break;case 63:if(x){r.next=68;break}return p||(Y(!0),i9.start("from_1st_frame")),L&&!at.current&&0===ut.current.length&&setTimeout((function(){lt()}),500),r.next=68,l(N,a,M);case 68:r.next=71;break;case 70:V<z.length&&(O=Qe[x.code],ce.current.image=i);case 71:Te(O),e!==d9&&(e=requestAnimationFrame((function(){return w(n,a)})));case 73:case"end":return r.stop()}}),r)})))).apply(this,arguments)}function B(){return(B=xy(regeneratorRuntime.mark((function e(){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=SV.analyzeVideoAndWindowSizes(t,ce.current),(n=document.createElement("canvas")).width=Ye,n.height=Ye,(o=n.getContext("2d")).translate(Ye,0),o.scale(-1*D,1*D),w(r,n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return V&&fe&&setTimeout((function(){!function(){B.apply(this,arguments)}()}),R),function(){We.current&&(cancelAnimationFrame(e),e=d9)}}),[R,V,J,oe,ne,r,o,i,p,h,m,v,je,S,Re,Ne.enable,C,Te,f,Oe,Ge,De,Qe,fe,ze,P,O,D,lt,L,Le.enable,Le.web_threshold,Le.web_timeout,we,ke,be,Fe.enable,qe]),_w.useEffect((function(){Ee&&(clearInterval(ct.current),st(!1),ut.current=[]),ye()}),[Ee,st,ye]);var ft=Ce.current,pt=ft.curStepIndex,ht=ft.steps,mt=_w.useMemo((function(){return ht.find((function(e){return e.name===sM.FaceDirection.FRONTAL}))}),[ht]),gt=ue.current?mt:ht[pt],vt=gt&&X?gt.instructions[J]:null,yt=gt&&X?gt.directionIcon:"",bt=gt?gt.directionIconAnimation:"";return{countdownToTakePicture:et,cropArea:ce,curStepIndex:pt,directionIcon:yt,directionIconAnimation:bt,faceDetectionError:Ee,handleTriggerPassiveMode:lt,handleVideoPlayed:$e,instructions:vt,isActiveMode:oe,refVideo:$,showCountdown:ot,steps:ht,videoPlayed:V,activeCapturing:K,isFirstValidFrameFound:X,warmupDone:fe,motionData:we,orientationData:ke}}var m9=(Iy(q6={},sM.FaceDirection.LEFT,90),Iy(q6,sM.FaceDirection.RIGHT,270),Iy(q6,sM.FaceDirection.UP,180),Iy(q6,sM.FaceDirection.DOWN,0),q6),g9=pE(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),v9=lE.div(H6||(H6=Ky(["\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"])),m9[sM.FaceDirection.DOWN],m9[sM.FaceDirection.LEFT],m9[sM.FaceDirection.UP],m9[sM.FaceDirection.RIGHT]),y9=lE.div(K6||(K6=Ky(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var t,r=e.direction;return null!==(t=m9[r])&&void 0!==t?t:0})),b9=lE.span(W6||(W6=Ky(["\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"])),g9),w9=lE(b9)(G6||(G6=Ky(["\n animation-delay: 0s;\n"]))),k9=lE(b9)(Q6||(Q6=Ky(["\n animation-delay: 0.5s;\n"]))),C9=lE(b9)(X6||(X6=Ky(["\n animation-delay: 1s;\n"])));function B9(e){var t=e.type;return t!==sM.FaceDirection.FRONTAL?_w.createElement(y9,{direction:t},_w.createElement(w9,null),_w.createElement(k9,null),_w.createElement(C9,null)):_w.createElement(v9,null,_w.createElement(y9,{className:"top"},_w.createElement(w9,null),_w.createElement(k9,null),_w.createElement(C9,null)),_w.createElement(y9,{className:"right"},_w.createElement(w9,null),_w.createElement(k9,null),_w.createElement(C9,null)),_w.createElement(y9,{className:"bottom"},_w.createElement(w9,null),_w.createElement(k9,null),_w.createElement(C9,null)),_w.createElement(y9,{className:"left"},_w.createElement(w9,null),_w.createElement(k9,null),_w.createElement(C9,null)))}B9.propTypes={type:_k.oneOf([sM.FaceDirection.LEFT,sM.FaceDirection.RIGHT,sM.FaceDirection.UP,sM.FaceDirection.FRONTAL])},B9.defaultProps={type:sM.FaceDirection.LEFT};var S9,E9=sM.ErrorDuration;function _9(e){var t=e.children,r=e.errorMsg,n=e.className;return _w.isValidElement(t)?r?_w.createElement("div",{className:n},_w.cloneElement(t,{errorMsg:r})):null:r?_w.createElement("div",{className:n},r):null}function x9(e){var t=e.children,r=e.className,n=e.error,o=_w.useRef(0),i=_w.useRef(""),a=mF.useSDKSettings().lang,s=_w.useRef(E9.SHORT),c=n||{},u=c.msg,l=c.duration,d=void 0===l?E9.SHORT:l,f=null==u?void 0:u[a];return Date.now()-o.current>=s.current?(o.current=Date.now(),s.current=d,i.current=f,_9({children:t,errorMsg:f,className:r})):_9({children:t,errorMsg:i.current,className:r})}x9.propTypes={children:_k.node,className:_k.string},x9.defaultProps={className:""};var T9=lE.circle(S9||(S9=Ky(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function A9(e){var t=e.className,r=e.style,n=e.radius,o=e.strokeWidth,i=e.progress,a=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,B=e.showOutsideRing,S=e.showInsideRing,E=e.showDashedRing,_=2*n,x=2*n,T=n-2*o,A=2*Math.PI*T,P=A-i/100*A,I=T-y/2-o/2-c,R=2*Math.PI*I,O=R-i/100*R,N=I-C/2-y/2,D=2*Math.PI*N,M=D-i/100*D,L=N-f/2-C/2,U=N-h/2-C/2;return _w.createElement("svg",{className:t,style:r,width:_,height:x,viewBox:"0 0 ".concat(_," ").concat(x),fill:"none",xmlns:"http://www.w3.org/2000/svg"},B?_w.createElement(_w.Fragment,null,_w.createElement("circle",{"data-testid":"outsideRing",opacity:l,cx:n,cy:n,r:T,stroke:u}),_w.createElement(T9,{"data-testid":"outsideAnimateRing",cx:n,cy:n,r:T,stroke:s,strokeWidth:o,strokeLinecap:"round",strokeDasharray:"".concat(A," ").concat(A),style:{strokeDashoffset:P}})):null,E?_w.createElement(_w.Fragment,null,_w.createElement("circle",{"data-testid":"dashedRing",opacity:v,cx:n,cy:n,r:I,stroke:g,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)}),_w.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},_w.createElement("circle",{cx:n,cy:n,r:I,stroke:s,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)})),_w.createElement("g",{mask:"url(#mask0)"},_w.createElement(T9,{"data-testid":"dashedAnimateRing",cx:n,cy:n,r:I,stroke:s,strokeWidth:y,strokeDasharray:"".concat(R," ").concat(R),style:{strokeDashoffset:O}})),_w.createElement("circle",{"data-testid":"dashedInsideRing",opacity:v,cx:n,cy:n,r:N,stroke:k,strokeWidth:C}),_w.createElement(T9,{"data-testid":"dashedInsideAnimateRing",cx:n,cy:n,r:N,stroke:s,strokeWidth:C,strokeLinecap:"round",strokeDasharray:"".concat(D," ").concat(D),style:{strokeDashoffset:M}})):null,S?_w.createElement("circle",{"data-testid":"insideRing",strokeDasharray:p,cx:n,cy:n,r:L,stroke:d,strokeWidth:f}):null,a?_w.createElement("circle",{"data-testid":"errorRing",strokeDasharray:p,cx:n,cy:n,r:U,stroke:m,strokeWidth:h}):null)}function P9(e){var t=e.className;return _w.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_w.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 I9(){return(I9=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)}A9.propTypes={className:_k.string,style:_k.shape({}),radius:_k.number,strokeWidth:_k.number,progress:_k.number,hasError:_k.bool,activeColor:_k.string,innerPadding:_k.number,outsideRingColor:_k.string,outsideRingOpacity:_k.number,insideRingColor:_k.string,insideRingWidth:_k.number,insideRingStrokeDash:_k.string,errorRingColor:_k.string,errorRingWidth:_k.number,dashedRingColor:_k.string,dashedRingOpacity:_k.number,dashedRingWidth:_k.number,dashedRingLineThick:_k.number,dashedRingLineSpacing:_k.number,dashedInsideRingColor:_k.string,dashedInsideRingWidth:_k.number,showOutsideRing:_k.bool,showDashedRing:_k.bool,showInsideRing:_k.bool},A9.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},P9.propTypes={className:_k.string},P9.defaultProps={className:""};var R9,O9,N9=function(e,t){void 0===t&&(t=!0),_w.useEffect((function(){if(t){var r=function(t){"Escape"===t.key&&e(t)};return document.addEventListener("keyup",r),function(){t&&document.removeEventListener("keyup",r)}}}),[e,t])},D9=function(e,t){void 0===t&&(t=!0),_w.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])},M9=function(e,t,r){void 0===r&&(r=!0),_w.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])},L9=function(e,t){void 0===t&&(t=!0),_w.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 i=o[0],a=o[o.length-1];t.shiftKey&&document.activeElement===i?(t.preventDefault(),a.focus()):document.activeElement===a&&(t.preventDefault(),i.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])},U9="undefined"!=typeof window?_w.useLayoutEffect:_w.useEffect,j9={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}}},F9=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],V9=function(e,t,r,n,o){var i=o.offsetX,a=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-a:p+a,left:h="left"===c[0]?h-i:h+i,transform:m,arrowLeft:v,arrowTop:g}},z9=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},q9=function(e,t,r,n,o,i){var a=o.offsetX,s=o.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=z9(i),d=Array.isArray(r)?r:[r];for((i||Array.isArray(r))&&(d=[].concat(d,F9));u<d.length;){var f={top:(c=V9(e,t,d[u],n,{offsetX:a,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},H9=0,K9=function(){var e=document.getElementById("popup-root");return null===e&&((e=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(e)),e},W9=_w.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,o=e.onOpen,i=void 0===o?function(){}:o,a=e.onClose,s=void 0===a?function(){}:a,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,B=void 0===C?["click"]:C,S=e.contentStyle,E=void 0===S?{}:S,_=e.arrowStyle,x=void 0===_?{}:_,T=e.overlayStyle,A=void 0===T?{}:T,P=e.className,I=void 0===P?"":P,R=e.position,O=void 0===R?"bottom center":R,N=e.modal,D=void 0!==N&&N,M=e.lockScroll,L=void 0!==M&&M,U=e.arrow,j=void 0===U||U,F=e.offsetX,V=void 0===F?0:F,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,$=_w.useState(d||u),Z=$[0],J=$[1],ee=_w.useRef(null),te=_w.useRef(null),re=_w.useRef(null),ne=_w.useRef(null),oe=_w.useRef("popup-"+ ++H9),ie=!!D||!n,ae=_w.useRef(0);U9((function(){return Z?(ne.current=document.activeElement,ge(),me(),pe()):he(),function(){clearTimeout(ae.current)}}),[Z]),_w.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return i(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ie&&(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(ae.current),ae.current=setTimeout((function(){return se(e)}),K)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(ae.current),ae.current=setTimeout((function(){return ce(e)}),G)},pe=function(){ie&&L&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ie&&L&&(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()};_w.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var ge=function(){if(!ie&&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=q9(r,n,O,j,{offsetX:V,offsetY:q},X);if(te.current.style.top=o.top+window.scrollY+"px",te.current.style.left=o.left+window.scrollX+"px",j&&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}};N9(ce,k),L9(te,Z&&ie),D9(ge,b),M9(n?[te,ee]:[te],ce,v&&!m);var ve=function(){return _w.createElement("div",Object.assign({},(e=ie?j9.popupContent.modal:j9.popupContent.tooltip,t={className:"popup-content "+(""!==I?I.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:I9({},e,E,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!D&&B.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ie?"dialog":"tooltip",id:oe.current}),j&&!ie&&_w.createElement("div",{ref:re,style:j9.popupArrow},_w.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==I?I.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:I9({position:"absolute"},x)},_w.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},ye=!(B.indexOf("hover")>=0),be=ie?j9.overlay.modal:j9.overlay.tooltip,we=[ye&&_w.createElement("div",{key:"O","data-testid":"overlay","data-popup":ie?"modal":"tooltip",className:"popup-overlay "+(""!==I?I.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:I9({},be,A,{pointerEvents:v&&m||ie?"auto":"none"}),onClick:v&&m?ce:void 0,tabIndex:-1},ie&&ve()),!ie&&ve()];return _w.createElement(_w.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":oe.current},t=Array.isArray(B)?B:[B],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 i=n(Z);return!!n&&_w.cloneElement(i,e)}return!!n&&_w.cloneElement(n,e)}(),Z&&oM.createPortal(we,K9()))})),G9=fE(R9||(R9=Ky(["\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"]))),Q9=["open","children","overlayStyle"],X9=q3+1e3,Y9=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=Vy(e,Q9);return _w.createElement(_w.Fragment,null,t&&_w.createElement(_w.Fragment,null,_w.createElement(W9,Ry({overlayStyle:Ny(Ny({},n),{},{zIndex:X9}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),_w.createElement(G9,null)))};Y9.propTypes={open:_k.bool,children:_k.node,overlayStyle:_k.shape({})},Y9.defaultProps={open:!1,children:null,overlayStyle:{}};var $9={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},Z9=lE.div(O9||(O9=Ky(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),J9=function(e){var t=e.contentStyle,r=mF.useSDKSettings(),n=r.lang,o=r.warmupMessage,i=o?o[n]:$9.WARMUP_INTRO[n];return _w.createElement(Y9,{open:!0,contentStyle:t},_w.createElement(Z9,{className:"warmup-message"},i))};J9.propTypes={contentStyle:_k.shape({})},J9.defaultProps={contentStyle:{}};var e7,t7,r7,n7,o7,i7,a7,s7,c7,u7,l7,d7,f7,p7,h7,m7,g7=function(e){var t=e.className,r=e.onClick,n=YF.useAsset("ic_close.png");return _w.createElement(G3,{className:t,onClick:r},_w.createElement("img",{src:n,alt:""}))},v7=Object.freeze({__proto__:null,CloseCameraButton:g7}),y7=XS(["z-index:",";color:#ffffff;"],q3+20),b7=lE.div(e7||(e7=Ky(["\n ","\n"])),y7),w7=lE(x9)(t7||(t7=Ky(["\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"])),y7,(function(e){var t=e.top;return t&&XS(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&XS(["bottom:","px;"],t)}),(function(e){return e.centerY&&XS(["top:50%;transform:translateY(-50%);"])})),k7=lE(b7)(r7||(r7=Ky(["\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&&XS(["top:","px;"],t)})),C7=lE(b7)(n7||(n7=Ky(["\n position: absolute;\n ","\n ","\n font-size: ",";\n text-shadow: 2px 2px 4px #000000;\n"])),(function(e){var t=e.top;return t&&XS(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&XS(["bottom:","px;"],t)}),(function(){return s3.isMobile?"20px":"22px"})),B7=lE.div(o7||(o7=Ky(["\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 s3.isMobile?"50px":"70px"}),(function(e){var t=e.top;return t&&XS(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&XS(["bottom:","px;"],t)}),q3+20),S7=lE.div(i7||(i7=Ky(["\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 s3.isMobile?"40px":"50px"}),(function(){return s3.isMobile?"40px":"50px"}),(function(e){return!e.active&&XS(["opacity:0.6;"])})),E7=lE.div(a7||(a7=Ky(["\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"])),q3+20),_7=lE.div(s7||(s7=Ky(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),x7=lE.div(c7||(c7=Ky(["\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"]))),T7=lE.div(u7||(u7=Ky(["\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"]))),A7=lE(A9)(l7||(l7=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),P7=lE(P9)(d7||(d7=Ky(["\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)"})),I7=lE.div(f7||(f7=Ky(["\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"]))),R7=pE(["from{opacity:1;}to{opacity:0;}"]),O7=lE.div(p7||(p7=Ky(["\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"])),R7),N7=s3.isMobile?{width:{ideal:640}}:null,D7={background:"#000000",opacity:.6};function M7(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,i=e.onError,a=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=YF.useAsset("bg_camera_mask.png"),C=YF.useAsset("bg_camera_mask_red.png"),B=Wy(_w.useState({}),2),S=B[0],E=B[1],_=S.yFaceDetectionError,x=S.yFaceVerificationStepsWrapper,T=Wy(_w.useState(""),2),A=T[0],P=T[1],I=_w.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,o=t+25,a=o+30;E({yFaceDetectionError:o,yFaceVerificationStepsWrapper:a+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(a);return 0!==b&&(u+b<s||u+b+r>c)?i({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=b,{y:u}}),[b,i]),R=h9({apiCheck:t,mode:r,bgCameraMask:k,bgCameraMaskRed:C,surroundStyle:D7,onLivenessDetectionDone:n,onError:i,cropAreaDimension:I,customDirectionIcon:u,captureFrameSettings:a,onFramesCaptured:s,livenessSettings:p,setRemainingTime:P,customStepTimeConstraints:l,onProcessing:d,customErrors:f,apiCredentials:h,outputEncryptionSettings:m,cameraScale:g,passiveModeAuto:y}),O=R.countdownToTakePicture,N=R.cropArea,D=R.curStepIndex,M=R.directionIcon,L=R.faceDetectionError,U=R.handleTriggerPassiveMode,j=R.handleVideoPlayed,F=R.instructions,V=R.isActiveMode,z=R.refVideo,q=R.showCountdown,H=R.steps,K=R.videoPlayed,W=R.activeCapturing,G=R.isFirstValidFrameFound,Q=R.warmupDone,X=w.CloseCameraButton;return _w.createElement(r0,{frontCamera:c,onVideoPlayed:j,onClose:o,flipHorizontal:c,ref:z,videoSettings:N7,onError:i,scale:g,defaultCameraId:v,closeButton:X||null},!Q&&_w.createElement(J9,null),K?_w.createElement(_w.Fragment,null,_w.createElement(w7,{top:_-15,className:"face-detection-error",error:L}),N.current?_w.createElement(c0,{x:"".concat(N.current.x,"px"),y:"".concat(N.current.y,"px"),width:"".concat(N.current.width,"px"),height:"".concat(N.current.height,"px"),surroundStyle:N.current.surroundStyle},_w.createElement(P7,null),_w.createElement(A7,{progress:D/H.length*100,hasError:!!L,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:1,insideRingStrokeDash:"2"}),q?_w.createElement(x7,null,O):null,V?_w.createElement(_w.Fragment,null,_w.createElement(T7,null,M),W&&_w.createElement(O7,null)):null,L&&_w.createElement(I7,null)):null,V?_w.createElement(_w.Fragment,null,A&&_w.createElement(k7,{top:x-30},A),F?_w.createElement(C7,{top:x+5,className:"instructions"},F):null,G&&_w.createElement(B7,{top:x+35},H.map((function(e,t){var r=e.name,n=e.image.objUrl;return _w.createElement(S7,{key:r,active:D>=t,className:"step-item"},n?_w.createElement("img",{src:n,alt:""}):_w.createElement("span",null,t+1))})))):_w.createElement(_w.Fragment,null,!G||L||y?null:_w.createElement(E7,null,_w.createElement(_7,{onClick:U},_w.createElement(u0,null))))):null)}M7.propTypes={apiCheck:_k.bool,mode:_k.string,onLivenessDetectionDone:_k.func,onClose:_k.func,onError:_k.func,captureFrameSettings:_k.shape({}),onFramesCaptured:_k.func,frontCamera:_k.bool,customDirectionIcon:_k.shape({}),customStepTimeConstraints:_k.shape({}),onProcessing:_k.func,customErrors:_k.shape({}),livenessSettings:_k.shape({}),apiCredentials:_k.shape({accessKey:_k.string,secretKey:_k.string,apiUrl:_k.string}),outputEncryptionSettings:_k.shape({}),cameraScale:_k.number,defaultCameraId:_k.string,passiveModeAuto:_k.bool,offsetFaceY:_k.number,styledComponent:_k.shape({CloseCameraButton:_k.node})},M7.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(h7={},Iy(h7,sM.FaceDirection.LEFT,_w.createElement(B9,{type:sM.FaceDirection.LEFT})),Iy(h7,sM.FaceDirection.RIGHT,_w.createElement(B9,{type:sM.FaceDirection.RIGHT})),Iy(h7,sM.FaceDirection.UP,_w.createElement(B9,{type:sM.FaceDirection.UP})),Iy(h7,sM.FaceDirection.FRONTAL,_w.createElement(B9,{type:sM.FaceDirection.FRONTAL})),h7),customStepTimeConstraints:(m7={},Iy(m7,sM.FaceDirection.UP,{delayTime:0}),Iy(m7,sM.FaceDirection.LEFT,{delayTime:0}),Iy(m7,sM.FaceDirection.RIGHT,{delayTime:0}),Iy(m7,sM.FaceDirection.FRONTAL,{delayTime:2e3}),m7),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null}};var L7,U7=Object.freeze({__proto__:null,Text:b7,FaceDetectionError:w7,CountdownTime:k7,FaceVerificationInstructions:C7,FaceVerificationStepsWrapper:B7,StepItem:S7,BottomButtonsOverlay:E7,Button:_7,CountDownOverlay:x7,InstructionsOverlay:T7,LivenessStyledComponent:v7,default:M7,useLivenessDetection:h9}),j7=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(){oM.unmountComponentAtNode(n)};return new Promise((function(e){oM.render(_w.createElement(mF.SDKSettingsProvider,{value:{lang:"en"}},_w.createElement(r0,{checkCameraMode:!0,frontCamera:r,onVideoPlayed:function(){o(),e(null)},onClose:o,onError:function(t){o(),e(t)}})),n)}))},F7=lE.input(L7||(L7=Ky(["\n display: none;\n"]))),V7=_w.forwardRef((function(e,t){var r=e.useFileBrowse,n=e.accept,o=e.frontCamera,i=e.onCaptureDone,a=e.outputEncryptionSettings,s=_w.useCallback(function(){var e=xy(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,!i){e.next=8;break}if(n=r[0],!a||!a.key){e.next=7;break}return e.next=6,Uq.encrypt({blob:n,key:a.key});case 6:o=e.sent;case 7:i({file:n,encrypted:o});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[i,a]);return _w.createElement(F7,Ry({ref:t,type:"file",accept:n,onChange:s},r?{}:{capture:o?"user":"environment"}))}));V7.propTypes={useFileBrowse:_k.bool,accept:_k.string,frontCamera:_k.bool,onCaptureDone:_k.func,outputEncryptionSettings:_k.shape({key:_k.string})},V7.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var z7,q7={LANDSCAPE:"landscape",PORTRAIT:"portrait",DESKTOP:"desktop"},H7=function(){var e=_w.useRef(window.matchMedia("(orientation: portrait)")),t=_w.useRef(e.current.matches?q7.PORTRAIT:q7.LANDSCAPE),r=Wy(_w.useState(t.current),2),n=r[0],o=r[1];return _w.useEffect((function(){function t(e){e.matches?o(q7.PORTRAIT):o(q7.LANDSCAPE)}return e.current.addEventListener("change",t),function(){e.current.removeEventListener("change",t)}}),[]),s3.isMobile?{curOrientation:n,initOrientation:t.current}:{curOrientation:q7.DESKTOP}},K7=sM.Errors,W7=lE.div(z7||(z7=Ky(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function G7(e){var t=e.children,r=mF.useSDKSettings().lang,n=K7.wrong_orientation.msg[r],o=H7().curOrientation;return _w.createElement(_w.Fragment,null,o===q7.LANDSCAPE&&_w.createElement(Y9,{open:!0},_w.createElement(W7,null,n)),(o===q7.PORTRAIT||o===q7.DESKTOP)&&_w.createElement(_w.Fragment,null,t))}var Q7=["logCredentials","clientSettings","livenessSettings","livenessComponent"];function X7(e){var t=e.logCredentials,r=void 0===t?{enable:!0}:t,n=e.clientSettings,o=e.livenessSettings,i=e.livenessComponent,a=void 0===i?M7:i,s=Vy(e,Q7),c=E6(n,"data.settings.sdk_settings",{});return _w.createElement(G7,null,_w.createElement(GF.SDKTrackingProvider,{value:{tracking:Ny({},r)}},_w.createElement(a,Ry({},s,{livenessSettings:Ny(Ny(Ny({},o),null==c?void 0:c.active_liveness_settings),null==c?void 0:c.liveness_settings)}))))}function Y7(){return(Y7=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 $7(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function Z7(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function J7(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function eee(e,t){e.classList?e.classList.add(t):J7(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function tee(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function ree(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=tee(e.className,t):e.setAttribute("class",tee(e.className&&e.className.baseVal||"",t))}var nee={disabled:!1},oee=_w.createContext(null),iee="unmounted",aee="exited",see="entering",cee="entered",uee="exiting",lee=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var o,i=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?i?(o=aee,n.appearStatus=see):o=cee:o=t.unmountOnExit||t.mountOnEnter?iee:aee,n.state={status:o},n.nextCallback=null,n}Z7(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===iee?{status:aee}: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!==see&&r!==cee&&(t=see):r!==see&&r!==cee||(t=uee)}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===see?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===aee&&this.setState({status:iee})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,o=this.props.nodeRef?[n]:[oM.findDOMNode(this),n],i=o[0],a=o[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!r||nee.disabled?this.safeSetState({status:cee},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:see},(function(){t.props.onEntering(i,a),t.onTransitionEnd(c,(function(){t.safeSetState({status:cee},(function(){t.props.onEntered(i,a)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:oM.findDOMNode(this);t&&!nee.disabled?(this.props.onExit(n),this.safeSetState({status:uee},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:aee},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:aee},(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:oM.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],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===iee)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,$7(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return _w.createElement(oee.Provider,{value:null},"function"==typeof r?r(e,n):_w.cloneElement(_w.Children.only(r),n))},t}(_w.Component);function dee(){}lee.contextType=oee,lee.propTypes={},lee.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:dee,onEntering:dee,onEntered:dee,onExit:dee,onExiting:dee,onExited:dee},lee.UNMOUNTED=iee,lee.EXITED=aee,lee.ENTERING=see,lee.ENTERED=cee,lee.EXITING=uee;var fee,pee,hee=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return eee(e,t)}))},mee=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return ree(e,t)}))},gee=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],i=n[1];t.removeClasses(o,"exit"),t.addClass(o,i?"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],i=n[1]?"appear":"enter";t.addClass(o,i,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),o=n[0],i=n[1]?"appear":"enter";t.removeClasses(o,i),t.addClass(o,i,"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}Z7(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,hee(e,n))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,o=r.active,i=r.done;this.appliedClasses[t]={},n&&mee(e,n),o&&mee(e,o),i&&mee(e,i)},r.render=function(){var e=this.props,t=(e.classNames,$7(e,["classNames"]));return _w.createElement(lee,Y7({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(_w.Component);function vee(e,t){return e!==t&&(!_w.isValidElement(e)||!_w.isValidElement(t)||null==e.key||e.key!==t.key)}gee.defaultProps={classNames:""},gee.propTypes={};var yee={out:"out-in",in:"in-out"},bee=function(e,t,r){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),r()}},wee=((fee={})[yee.out]=function(e){var t=e.current,r=e.changeState;return _w.cloneElement(t,{in:!1,onExited:bee(t,"onExited",(function(){r(see,null)}))})},fee[yee.in]=function(e){var t=e.current,r=e.changeState,n=e.children;return[t,_w.cloneElement(n,{in:!0,onEntered:bee(n,"onEntered",(function(){r(see)}))})]},fee),kee=((pee={})[yee.out]=function(e){var t=e.children,r=e.changeState;return _w.cloneElement(t,{in:!0,onEntered:bee(t,"onEntered",(function(){r(cee,_w.cloneElement(t,{in:!0}))}))})},pee[yee.in]=function(e){var t=e.current,r=e.children,n=e.changeState;return[_w.cloneElement(t,{in:!1,onExited:bee(t,"onExited",(function(){n(cee,_w.cloneElement(r,{in:!0}))}))}),_w.cloneElement(r,{in:!0})]},pee),Cee=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:cee,current:null},t.appeared=!1,t.changeState=function(e,r){void 0===r&&(r=t.state.current),t.setState({status:e,current:r})},t}Z7(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===see&&e.mode===yee.in?{status:see}:t.current&&vee(t.current,e.children)?{status:uee}:{current:_w.cloneElement(e.children,{in:!0})}},r.render=function(){var e,t=this.props,r=t.children,n=t.mode,o=this.state,i=o.status,a=o.current,s={children:r,current:a,changeState:this.changeState,status:i};switch(i){case see:e=kee[n](s);break;case uee:e=wee[n](s);break;case cee:e=a}return _w.createElement(oee.Provider,{value:{isMounting:!this.appeared}},e)},t}(_w.Component);Cee.propTypes={},Cee.defaultProps={mode:yee.out};var Bee={DEFAULT:"default",ERROR:"error"};function See(e){var t=e.className,r=e.width,n=e.height,o=e.type,i=e.strokeStyles,a=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=_w.useMemo((function(){var e;return Ny((Iy(e={},Bee.DEFAULT,{fill:"none",strokeWidth:a,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),Iy(e,Bee.ERROR,{fill:"rgba(234,50,35, 0.1)",strokeWidth:a,stroke:"#ea3223"}),e),i)}),[a,i]),l=s+.8*a,d=u[o];return _w.createElement("svg",{width:r,height:n,className:t},_w.createElement("rect",{x:a/2,y:a/2,rx:s,ry:s,width:r-a,height:n-a,style:d}),_w.createElement("path",{d:"M0,".concat(l," Q0,0 ").concat(l,",0 L0,0 Z"),style:c}),_w.createElement("path",{d:"M0,".concat(n-l," Q0,").concat(n," ").concat(l,",").concat(n," L0,").concat(n," Z"),style:c}),_w.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}),_w.createElement("path",{d:"M".concat(r-l,",0 Q").concat(r,",0 ").concat(r,",").concat(l," L").concat(r,",0 Z"),style:c}))}See.propTypes={className:_k.string,width:_k.number,height:_k.number,strokeWidth:_k.number,strokeStyles:_k.shape({}),type:_k.oneOf([Bee.DEFAULT,Bee.ERROR]),radius:_k.number,paddingStyle:_k.shape({})},See.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:Bee.DEFAULT,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var Eee,_ee,xee,Tee,Aee,Pee,Iee,Ree,Oee,Nee,Dee,Mee,Lee,Uee,jee,Fee,Vee,zee,qee,Hee,Kee=500,Wee=pE(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),Gee=pE(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),Qee=XS([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],Wee,Kee,Gee,Kee),Xee=Object.freeze({__proto__:null,animationDuration:Kee,default:Qee}),Yee=20,$ee=pE(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],Yee,Yee),Zee=pE(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],Yee,Yee),Jee=(XS([".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;}"],$ee,Zee),pE(["from,to{opacity:1;}50%{opacity:0;}"])),ete=(XS([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],Jee),300),tte=lE.div(Eee||(Eee=Ky(["\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"])),q3+1),rte=pE(["from{background:#000;}to{}"]),nte=XS([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],rte,ete),ote=lE.div(_ee||(_ee=Ky(["\n ","\n"])),nte),ite=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return _w.createElement(ote,null,_w.createElement(Cee,null,_w.createElement(gee,{key:r,timeout:{enter:ete,exit:0},classNames:"splash",unmountOnExit:!1},_w.createElement(tte,null))))},ate=Object.freeze({__proto__:null,default:ite}),ste=pE(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),cte=XS([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],ste),ute=Object.freeze({__proto__:null,default:cte}),lte=["width","height","type"],dte=lE(See)(xee||(xee=Ky([""]))),fte=lE.img(Tee||(Tee=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),pte=Kee,hte=ite,mte=lE.div(Aee||(Aee=Ky(["\n ","\n ","\n"])),Qee,cte),gte=lE.img(Pee||(Pee=Ky(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),vte=10,yte=60,bte=100,wte=lE.div(Iee||(Iee=Ky(["\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"])),yte,q3+20,s3.isMobile?XS(["top:",";"],(function(e){return e.y})):XS(["bottom:","px;"],vte)),kte=lE.div(Ree||(Ree=Ky(["\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"])),bte,bte,q3+20),Cte=lE.div(Oee||(Oee=Ky(["\n color: #fff;\n text-align: center;\n"]))),Bte=lE.div(Nee||(Nee=Ky(["\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}),q3+20),Ste=lE.div(Dee||(Dee=Ky(["\n display: flex;\n align-items: center;\n"]))),Ete=lE(Cte)(Mee||(Mee=Ky(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),_te=lE(Cte)(Lee||(Lee=Ky(["\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"])),q3+30),xte=lE(Cte)(Uee||(Uee=Ky(["\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}),q3+20),Tte=lE(xte)(jee||(jee=Ky(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),Ate=lE(Cte)(Fee||(Fee=Ky(["\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}),q3+20),Pte=(lE.div(Vee||(Vee=Ky(["\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=Vy(e,lte),i=YF.useAsset("id_card_frame.png"),a=YF.useAsset("id_card_frame_error.png");return _w.createElement(mte,{width:t,height:r},_w.createElement(fte,{src:n===Bee.ERROR?a:i,width:t,height:r}),_w.createElement(dte,Ry({width:t,height:r,type:n},o)))}),Ite={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"}},Rte=50,Ote=sM.IDCardMessage,Nte=lE.div(zee||(zee=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Dte=lE.div(qee||(qee=Ky(["\n text-align: center;\n font-size: 1rem;\n"]))),Mte=lE.button(Hee||(Hee=Ky(["\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})),Lte=function(e){var t=e.onOk,r=e.maxSessionTime,n=mF.useSDKSettings().lang;return _w.createElement(Nte,null,_w.createElement(Dte,{className:"popup-message"},r8(Ote.TIMEOUT_INSTRUCTION[n])({x:r})),_w.createElement(Mte,{className:"popup-button",onClick:t},Ite.BTN_OK[n]))};Lte.propTypes={onOk:_k.func,maxSessionTime:_k.number},Lte.defaultProps={onOk:function(){},maxSessionTime:30};var Ute=function(){var e=Wy(_w.useState(!1),2),t=e[0],r=e[1],n=Wy(_w.useState(null),2),o=n[0],i=n[1],a=Wy(_w.useState({}),2),s=a[0],c=a[1];return{showPopup:_w.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),i(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},jte={SESSION_TIMEOUT:"SESSION_TIMEOUT",CONFIRM:"CONFIRM",QR_INVALID:"QR_INVALID",QR_INSTRUCTIONS:"QR_INSTRUCTIONS"},Fte=sM.Errors;function Vte(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function zte(e,t){return Math.sqrt(Vte(e,t))}function qte(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=void 0===r?.4:r,o=window,i=o.cv,a=t.width,s=t.height,c=n;c<1&&(c=parseInt(.5*(s+a)*c,10));var u=i.imread(t),l=new i.Mat;return i.copyMakeBorder(u,l,c,c,c,c,i.BORDER_CONSTANT,new i.Scalar(0,0,0,255)),u.delete(),{mat:l,margin:c}}function Hte(e,t){var r=window.cv,n=Wy(t.map((function(e){return e.location})),4),o=n[0],i=n[1],a=n[2],s=n[3],c=zte(a,s),u=zte(i,o),l=Math.max(c,u),d=zte(i,a),f=zte(o,s),p=Math.max(d,f),h=[o.x,o.y,i.x,i.y,a.x,a.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 Kte(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},i=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),a=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(i*a))/Math.PI}function Wte(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,a=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),i=Math.min(i,n),a=Math.max(a,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&i/n>=c&&(n-s)/n>=c&&(r-a)/r>=c}function Gte(){return Qte.apply(this,arguments)}function Qte(){return(Qte=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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,i=r.width,a=r.height,s=Math.floor(i*o),c=Math.floor(a*o),u=i-2*s,l=a-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",Yz.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xte(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,i=Kte(e[r].location,e[n].location,e[o].location);if(i<70||i>110)return!1}return!0}function Yte(e){return $te.apply(this,arguments)}function $te(){return($te=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,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,i=n.width,a=n.height,s=Math.floor(i/3),c=Math.floor(4*a/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(a/5),s,c,0,0,s,c),e.next=12,VV.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=Wy(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4)&&!(IV.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[VV.SIZE,VV.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",Fte.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",Fte.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",Fte.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 Zte=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=t.currentWorkingCanvas,u=t.refVirtualWorkingCanvas,l=t.refCountVirtualFrames,d=t.refVirtualFrames,f=t.refWorkingCanvas,p=t.refCardResult,h=Wy(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)-2*Rte,b=(null==v||null===(o=v.location)||void 0===o?void 0:o.y)-(null==g||null===(i=g.location)||void 0===i?void 0:i.y)-2*Rte,w=performance.now(),(k=u.current).width=y,k.height=b,(C=k.getContext("2d")).drawImage(c,(null==m||null===(a=m.location)||void 0===a?void 0:a.x)+Rte,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+Rte,y,b,0,0,y,b),e.next=12,new Promise((function(e){k.toBlob(function(){var t=xy(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jF.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(Gy(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 12:return w=Math.floor(performance.now()-w),B=180-w>0?180-w:0,e.next=16,new Promise((function(e){return setTimeout(e,B)}));case 16:if(!(l.current<3)){e.next=27;break}return _=performance.now(),x=f.current,C.drawImage(x,(null==m||null===(S=m.location)||void 0===S?void 0:S.x)+Rte,(null==m||null===(E=m.location)||void 0===E?void 0:E.y)+Rte,y,b,0,0,y,b),e.next=22,new Promise((function(e){k.toBlob(function(){var t=xy(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jF.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(Gy(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 22:if(!(l.current<2)){e.next=24;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",24);case 24:l.current+=1,e.next=16;break;case 27:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Jte(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}var ere=Jte;function tre(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=J0(r))==r?r:0),void 0!==t&&(t=(t=J0(t))==t?t:0),ere(J0(e),t,r)}var rre=tre,nre="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function ore(){return ire.apply(this,arguments)}function ire(){return(ire=xy(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?nre: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",xy(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 are=j6(ore),sre="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",cre={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"};function ure(e){var t,r,n,o,i,a=e.card,s=e.corners,c=a.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=rb(s);try{for(f.s();!(i=f.n()).done;){var p=i.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=Vte(u,h),v=Vte(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 lre=function(){function e(){Ty(this,e)}var t,r,n,o,i,a,s;return Py(e,[{key:"load",value:(s=xy(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([are({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:(a=xy(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 a.apply(this,arguments)})},{key:"loadModel",value:(i=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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?sre:r,e.next=3,Nq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,Nq.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,i=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),a=Wy(i,3),this.out_score_name=a[0],this.out_class_name=a[1],this.out_box_name=a[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadResource",value:(o=xy(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?sre:r,e.next=3,Nq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})},{key:"dispose",value:(n=xy(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=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E,_,x,T,A,P,I,R,O=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.length>1&&void 0!==O[1]?O[1]:{},n=r.imgMargin,o=void 0===n?.4:n,i=r.detectThreshold,a=void 0===i?.3:i,s=r.maxNumReturns,c=void 0===s?100:s,u=window,l=u.cv,d={},f=t.width,p=t.height,d.originalWidth=f,d.originalHeight=p,h=qte({canvas:t,imgMargin:o}),m=h.margin,g=h.mat,v=this.inputShape.slice(1,3),y=Wy(v,2),b=y[0],w=y[1],k=new l.Mat,l.resize(g,k,new l.Size(b,w),0,0,l.INTER_AREA),C=g.cols/b,B=g.rows/w,(S=document.createElement("canvas")).width=b,S.height=w,S.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(k.data),k.cols,k.rows),0,0),g.delete(),k.delete(),d.canvas=S,d.margin=m,E=performance.now(),e.next=25,this.detect(S,{detectThreshold:a,maxNumReturns:c});case 25:if(_=e.sent,x=Math.floor(performance.now()-E),T={inputImage:d,card:null,exeTime:x},A=[[],[],[],[]],P=[],I=[],_.forEach((function(e){var t=Wy(e.box,4),r=t[0],n=t[1],o=t[2],i=t[3];e.clazz<=3?A[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:rre(Math.floor((i+n)/2*C-m),0,f),y:rre(Math.floor((r+o)/2*B-m),0,p)},scaledLocation:{x:rre(Math.floor((i+n)/2),0,S.width),y:rre(Math.floor((r+o)/2),0,S.height)}}):I.push({label:e.label,score:e.score,box:[rre(Math.floor(r*B-m),0,p),rre(Math.floor(n*C-m),0,f),rre(Math.floor(o*B-m),0,p),rre(Math.floor(i*C-m),0,f)]})})),A.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),P.push(e[0]))})),!(I.length>0&&4===P.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),P.sort((function(e,t){return e.clazz-t.clazz})),R=I[0],e.prev=37,ure({card:R,corners:P})){e.next=41;break}return console.debug("Not qualified.",R,P),e.abrupt("return",T);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",T);case 46:return R.corners=P,T.card=R,e.abrupt("return",T);case 49:return e.abrupt("return",T);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return r.apply(this,arguments)})},{key:"detect",value:(t=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E=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,i=window,a=i.tf,s=t.width,c=t.height,u=a.tidy((function(){var e=a.expandDims(a.cast(a.image.resizeBilinear(a.browser.fromPixels(t),E.inputShape.slice(1,3)),"float32"));return E.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=Wy(l,3),f=d[0],p=d[1],h=Wy(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=cre[Math.round(w)])&&void 0!==k?k:"NA",B=m[y],S=[B[0]*c,B[3]*s,B[2]*c,B[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 dre{static hasCamera(){return dre.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=dre.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 i=!1;e.hidden&&(e.hidden=!1,i=!0),document.body.contains(e)||(document.body.appendChild(e),i=!0),requestAnimationFrame((()=>{const 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=dre.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(),dre._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,i=!1){const a=r instanceof Worker;let s=Promise.all([r||dre.createQrEngine(),dre._loadImage(e)]).then((([e,i])=>{let s;return r=e,[n,s]=this._drawToCanvas(i,t,n,o),r instanceof Worker?(a||r.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,t)=>{let o,i,a;i=n=>{"qrResult"===n.data.type&&(r.removeEventListener("message",i),r.removeEventListener("error",a),clearTimeout(o),null!==n.data.data?e(n.data.data):t(dre.NO_QR_CODE_FOUND))},a=e=>{r.removeEventListener("message",i),r.removeEventListener("error",a),clearTimeout(o);const n=e?e.message||e:"Unknown Error";t("Scanner error: "+n)},r.addEventListener("message",i),r.addEventListener("error",a),o=setTimeout((()=>a("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(dre.NO_QR_CODE_FOUND)})).catch((e=>t("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(o)))}))}));return t&&i&&(s=s.catch((()=>dre.scanImage(e,null,r,n,o)))),s=s.finally((()=>{a||dre._postWorkerMessage(r,"close")})),s}setGrayscaleWeights(e,t,r,n=!0){dre._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:t,blue:r,useIntegerApproximation:n})}setInversionMode(e){dre._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=dre.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=>dre.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=dre.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==dre.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,i=t&&t.y?t.y:0,a=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:a,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,i,a,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 dre._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,dre._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 fre(){return pre.apply(this,arguments)}function pre(){return(pre=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return dre.WORKER_PATH=cK(),e.next=3,dre.createQrEngine(dre.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 hre(){return mre.apply(this,arguments)}function mre(){return(mre=xy(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([fre()]);case 2:return t=e.sent,r=Wy(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)}dre.DEFAULT_CANVAS_SIZE=400,dre.NO_QR_CODE_FOUND="No QR code found",dre.WORKER_PATH="qr-scanner-worker.min.js";var gre="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function vre(){return yre.apply(this,arguments)}function yre(){return(yre=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=xy(regeneratorRuntime.mark((function e(){var t,r,n,a,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",a="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=[i(t),i(r),i(n),i(a)],e.next=11,Promise.all(u);case 11:l=e.sent,d=Wy(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)},a=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?gre:r,i=function(){var e=xy(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,a();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",hre());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var bre=j6(vre),wre=900;function kre(e){return Cre.apply(this,arguments)}function Cre(){return(Cre=xy(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,wre),r.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Bre(e){return Sre.apply(this,arguments)}function Sre(){return(Sre=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i;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,kre({idCardModel:r});case 6:(i=performance.now())-o+.6*(i-o)>wre&&(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 Ere(){return _re.apply(this,arguments)}function _re(){return(_re=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,i=t.tfScriptUrls,a=t.wechatQRModelsUrl,e.next=3,Y6({blazefaceModelUrl:o,tfScriptUrls:i});case 3:return s=e.sent,c=s.blazefaceModel,u=!0,l=new lre,e.prev=7,e.next=10,l.load({opencvUrl:r,modelUrl:n});case 10:e.next=15;break;case 12:return e.prev=12,e.t0=e.catch(7),e.abrupt("return",{ableToUseModel:!1});case 15:return e.next=17,bre({modelUrl:a});case 17:return e.prev=17,e.next=20,Bre({idCardModel:l});case 20:d=e.sent,f=d.fastEnough,u=f,e.next=28;break;case 25:e.prev=25,e.t1=e.catch(17),u=!1;case 28:return e.abrupt("return",{ableToUseModel:u,idCardModel:l,blazefaceModel:c});case 29:case"end":return e.stop()}}),e,null,[[7,12],[17,25]])})))).apply(this,arguments)}var xre=j6(Ere),Tre=sM.Errors,Are=function(){return{imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}},Pre=function(){return{imageBlob:null,blurScore:null,error:null,detectedCard:null}};function Ire(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.onError,a=e.frontSide,s=e.onAutoCaptureSuccess,c=e.quality,u=_w.useRef(null);null===u.current&&(u.current=document.createElement("canvas"));var l=_w.useRef(0),d=_w.useRef([]),f=_w.useRef(null);null===f.current&&(f.current=document.createElement("canvas"));var p=_w.useRef({}),h=_w.useRef(!1),m=_w.useRef(null),g=Wy(_w.useState(!1),2),v=g[0],y=g[1],b=_w.useRef(Are()),w=_w.useRef(Pre()),k=_w.useRef(!1),C=_w.useRef(!1),B=_w.useRef(null),S=_w.useRef(!1),E=_w.useRef({}),_=mF.useSDKSettings().customUrls;_w.useEffect((function(){var e=!1;function t(){return(t=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||v){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,xre(_);case 4:return E.current=t.sent,t.next=7,Nq.initTensorFlow();case 7:B.current=o.enableBlurCheck&&E.current.ableToUseModel,t.next=11;break;case 10:B.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:y(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[v,o,_]);var x=_w.useCallback((function(e){return Zte({currentWorkingCanvas:e,refVirtualWorkingCanvas:f,refCountVirtualFrames:l,refVirtualFrames:d,refWorkingCanvas:u,refCardResult:p})}),[]),T=_w.useCallback((function(){!0===h.current&&(h.current=!1)}),[]),A=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,i=o.blurThreshold,a=b.current,s=w.current,!(r<i&&CV.hasBetterCardBlurScore(r,a.blurScore))){e.next=16;break}if(!S.current){e.next=9;break}a.imageBlob=s.imageBlob,e.next=13;break;case 9:return e.next=11,SV.takePicture({canvas:u.current,quality:c});case 11:a.imageBlob=e.sent,a.captureTime=Date.now();case 13:a.takenAt=(new Date).getTime(),a.blurScore=r,a.detectedCard=n;case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,c]),P=_w.useCallback(function(){var e=xy(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,C.current=!0,o=w.current,!CV.hasBetterCardBlurScore(r,o.blurScore)){e.next=11;break}return e.next=6,SV.takePicture({canvas:u.current,quality:c});case 6:o.imageBlob=e.sent,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,S.current=!0;case 11:C.current=!1;case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c]),I=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.waitForBestImageTimeMs,null===(r=b.current).imageBlob){e.next=8;break}if(!((new Date).getTime()-r.takenAt>t)){e.next=8;break}return e.next=7,s(r);case 7:T();case 8:case"end":return e.stop()}}),e)}))),[s,o,T]),R=_w.useCallback((function(){k.current=!0}),[]),O=_w.useCallback((function(){return new Promise((function(e){k.current=!1;var t=setInterval((function(){C.current||(clearInterval(t),e())}),150)}))}),[]),N=_w.useCallback(xy(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=w.current;B.current?(R(),setTimeout((function(){O().then(xy(regeneratorRuntime.mark((function o(){var i;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(CV.hasBetterCardBlurScore(n.blurScore,t)||(n.error=Tre.id_detector_error_blur),i=u.current,null!==n.imageBlob){o.next=6;break}SV.takePicture({canvas:i,quality:c}).then(function(){var t=xy(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,x(i);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,x(i);case 9:e(n);case 10:case"end":return o.stop()}}),o)}))))}),2e3)):SV.takePicture({canvas:u.current,quality:c}).then(function(){var t=xy(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,x(u.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,R,O,c,x]),D=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,s,c,f,g,y,C,B,_,x,T,R,O,N,D,M,L,U,j;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&v&&!h.current){e.next=2;break}return e.abrupt("return");case 2:b.current=Are(),w.current=Pre(),r=o.enableAutoCapture,n=o.enableBlurCheck,s=o.enableIdDetection,c=E.current,f=c.idCardModel,g=c.blazefaceModel,y=c.ableToUseModel,C=m.current,B=t.current,h.current=!0,_=C.cropX,x=C.cropY,T=C.cropWidth,R=C.cropHeight,O=C.cropWidthWithoutPadding,N=C.cropHeightWithoutPadding,(D=u.current).width=T,D.height=R,M=D.getContext("2d"),L=document.createElement("canvas"),U=L.getContext("2d"),j=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,o,c,u,m,v,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(M.drawImage(B,_,x,T,R,0,0,T,R),t=performance.now(),S.current=!1,!s||!y){e.next=59;break}return o=null,e.next=7,f.predict(D,{detectThreshold:.3});case 7:if(!(c=e.sent).card){e.next=55;break}if(p.current=c.card,!w.current.imageBlob&&d.current.length>0&&(d.current=[],l.current=0),!Wte({corners:c.card.corners,width:T,height:R})){e.next=52;break}if(!Xte(c.card.corners)){e.next=49;break}if(u=Hte(D,c.card.corners),!((m=IV.rectAreaRatio({small:{area:u.width*u.height},big:{area:O*N}}))<.5)){e.next=21;break}o=Tre.id_detector_card_too_small,e.next=47;break;case 21:if(!(m>.95)){e.next=25;break}o=Tre.id_detector_error_incomplete,e.next=47;break;case 25:return L.width=u.width,L.height=u.height,U.putImageData(u,0,0),e.next=30,Gte({canvas:L});case 30:if(!e.sent){e.next=35;break}o=Tre.glare_detected,e.next=47;break;case 35:return e.next=37,Yte({blazefaceModel:g,predictedIdCardCanvas:L,frontSide:a});case 37:if(o=e.sent){e.next=47;break}if(!n){e.next=47;break}if(v=CV.calculateIdCardBlurScore({canvas:L}),!k.current){e.next=44;break}return e.next=44,P({blurScore:v,detectedCard:c.card});case 44:if(!r){e.next=47;break}return e.next=47,A({blurScore:v,detectedCard:c.card});case 47:e.next=50;break;case 49:o=Tre.id_detector_validate_angle_error;case 50:e.next=53;break;case 52:o=Tre.id_detector_error_incomplete;case 53:e.next=56;break;case 55:o=Tre.id_detector_no_cards;case 56:return i(o),e.next=59,I();case 59:return t=Math.floor(performance.now()-t),b=180-t>0?180-t:0,e.next=63,new Promise((function(e){return setTimeout(e,b)}));case 63:h.current&&window.requestAnimationFrame(j);case 64:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(j);case 19:case"end":return e.stop()}}),e)}))),[t,o,v,a,i,A,P,I]);_w.useEffect((function(){var e=t.current;function o(){return(o=xy(regeneratorRuntime.mark((function t(){var r,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m.current=SV.analyzeVideoAndWindowSizes(e,n,.05),r=m.current,o=r.cropWidth,i=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(i)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,D();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&v&&function(){o.apply(this,arguments)}()}),[r,n,t,T,D,v]);var M=_w.useCallback((function(){T()}),[T]);return _w.useEffect((function(){return M}),[M]),{refWorkingCanvas:u,stopCheckFrame:T,checkFrame:D,warmupDone:v,takePictureManually:N,refAbleToRunBurstMode:B,refVirtualFrames:d}}var Rre=function(){return{id:null,frames:[]}},Ore=180;function Nre(){return[Rre()]}function Dre(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=_w.useRef(null);null===i.current&&(i.current=document.createElement("canvas"));var a=_w.useRef(!1),s=_w.useRef(Wz.createResizer({width:960,height:640})),c=_w.useRef(null),u=_w.useRef(Nre()),l=_w.useCallback((function(){!0===a.current&&(a.current=!1)}),[]),d=_w.useCallback((function(){u.current=Nre()}),[]),f=_w.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push(Rre())}),[]),p=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,i,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,i=u.current,a=n.resize({srcCanvas:r}),c=a.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],i[i.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=_w.useCallback(xy(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?Ore:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:s=c.current,u=t.current,a.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=i.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),a.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,ZF.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return _w.useEffect((function(){var e=t.current;function o(){return(o=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=SV.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:i,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var Mre=function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,i=e.onChange;_w.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,a=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==a?void 0:a.width,"canvas.height":null==a?void 0:a.height};i&&i(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[i,t,r,n,o])},Lre=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,i=e.settings,a=e.shouldStartTimers,s=e.sessionTime,c=_w.useRef(),u=Wy(_w.useState(0),2),l=u[0],d=u[1],f=_w.useCallback((function(){clearInterval(c.current)}),[]),p=_w.useCallback((function(){d((function(e){return e+1}))}),[]);return _w.useEffect((function(){if(a){var e=i.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var i=s-(t+=1);i<=u&&r&&r({curTimeLeft:i}),t>0&&t%e==0&&o&&o(),0===i&&(f(),n&&n())}),1e3)}return function(){f()}}),[a,t,r,f,n,o,l,i,s]),{stopTimers:f,startTimers:p}};nK.initExifData();var Ure,jre,Fre,Vre=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onModelErrorChange,a=e.frontSide,s=e.onDebugInfoChange,c=e.onAboutToTimeout,u=e.onSessionTimeout,l=e.onCaptureDone,d=e.outputEncryptionSettings,f=e.quality,p=_w.useRef(!1),h=Wy(_w.useState(!1),2),m=h[0],g=h[1],v=_w.useRef((function(){})),y=GF.useSDKTracking().sendEvent,b=_w.useRef(),w=_w.useRef(),k=_w.useRef(),C=mF.useSDKSettings(),B=C.debug,S=C.lang,E=C.enableAntiDebug,_=sK(),x=_.startMotion,T=_.stopMotion,A=_.motionData,P=_.orientationData;_w.useEffect((function(){E&&Dq.enableAntiDebug()}),[E]);var I=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y({tag:a?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,v.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[y,a]),R=_w.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.apply(void 0,t);var n=E6(t,"0.code");n&&n!==b.current&&(y({tag:a?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),b.current=n)}),[i,a,y]),O=Ire({refVideo:r,shouldStart:t,cropArea:n,settings:o,onError:R,frontSide:a,onAutoCaptureSuccess:I,quality:f}),N=O.refWorkingCanvas,D=O.stopCheckFrame,M=O.checkFrame,L=O.warmupDone,U=O.takePictureManually,j=O.refAbleToRunBurstMode,F=O.refVirtualFrames,V=Dre({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),z=V.stopCheckFrame,q=V.splitVideos,H=V.resetRecordedVideos,K=V.checkFrame,W=V.refRecordedVideos;Mre({debug:B,refRecordedVideos:W,refWorkingCanvas:N,refVideo:r,onChange:s});var G=_w.useCallback((function(){z(),D(),H(),u()}),[H,z,D,u]),Q=_w.useCallback((function(){q()}),[q]),X=Lre({lang:S,onAboutToTimeout:c,onSessionTimeout:G,onVideoTimeLimitReached:Q,settings:o,shouldStartTimers:L&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),Y=X.stopTimers,$=X.startTimers,Z=_w.useCallback((function(){p.current=!1}),[]),J=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Z(),$(),e.next=4,Promise.all([K(),M()]);case 4:case"end":return e.stop()}}),e)}))),[Z,$,K,M]),ee=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,f,h,m,v,b=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=b.length>0&&void 0!==b[0]?b[0]:{},r=t.imageBlob,n=t.error,i=t.detectedCard,s=t.captureTime,!p.current){e.next=3;break}return e.abrupt("return");case 3:return p.current=!0,g(!0),z(),D(),Y(),R(null),c=null==o?void 0:o.enableVirtualCamHashes,u={},c&&(f=F).current.length>0&&(u=f.current.reduce((function(e,t,r){return Ny(Ny({},e),{},Iy({},"hash".concat(r+1),t))}),u)),T(),nK.preWriteExif({mode:nK.MODE.ID_CARD,motionData:A,orientationData:P,startTime:w.current,endTime:Date.now()}),e.next=16,nK.writeExif({mode:nK.MODE.ID_CARD,imageData:Ny({detectedCard:i,captureTime:s,blob:r},c?{vCam:u}:{}),enableExifData:null==o?void 0:o.enableExifData});case 16:if(h=e.sent,!d||!d.key){e.next=22;break}return v=d.key,e.next=21,Uq.encrypt({blob:h,key:v});case 21:m=e.sent;case 22:l({image:{blob:h,encrypted:m,detectedCard:i},error:n,recordedVideos:[]}),g(!1),y({tag:a?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-k.current)/1e3}});case 25:case"end":return e.stop()}}),e)}))),[z,D,Y,R,l,a,y,d,A,P,T,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,F]);v.current=ee;var te=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),Y(),z(),j.current||D(),e.next=6,U();case 6:return t=e.sent,e.next=9,ee(t);case 9:g(!1),y({tag:a?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[U,ee,Y,j,z,D,y,a]);return _w.useEffect((function(){t&&(y({tag:a?"id_front":"id_back",event:"user_activity.start",log:{}}),w.current=Date.now(),x())}),[y,a,t,x]),_w.useEffect((function(){L&&(y({tag:a?"id_front":"id_back",event:"user_activity.show",log:{}}),y({tag:a?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-w.current}}),k.current=performance.now())}),[y,a,L]),{warmupDone:L,isProcessing:m,takePictureManually:te,restartSession:J,resetIsProcessingImageBlobTaken:Z}},zre=sM.IDCardMessage,qre=_w.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,i=e.refVideo,a=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=Wy(_w.useState({}),2),f=d[0],p=d[1],h=f.yDescription,m=f.yMessage,g=f.yCaptureButton,v=YF.useAsset("ic_camera.svg"),y=YF.useAsset("ic_loading.png"),b=Wy(_w.useState(""),2),w=b[0],k=b[1],C=mF.useSDKSettings(),B=C.debug,S=C.lang,E=Wy(_w.useState(null),2),_=E[0],x=E[1],T=Wy(_w.useState(""),2),A=T[0],P=T[1],I=Wy(_w.useState(null),2),R=I[0],O=I[1],N=Ute(),D=N.showPopup,M=N.popupShown,L=N.popupType,U=_w.useCallback((function(e){P(null===e?"":r8(e.msg[S])({side:a?Ite.FRONT[S]:Ite.BACK[S]}))}),[S,a]),j=_w.useCallback((function(){x(""),D({popupType:jte.SESSION_TIMEOUT})}),[D]),F=_w.useCallback((function(){x(""),c.apply(void 0,arguments)}),[c]),V=_w.useCallback((function(e){var t=e.curTimeLeft;x(r8(zre.REMAINING_TIME[S])({x:t}))}),[S]),z=Vre({shouldStart:!0,refVideo:i,cropArea:R,settings:s,onModelErrorChange:U,frontSide:a,onDebugInfoChange:k,onSessionTimeout:j,onCaptureDone:F,onAboutToTimeout:V,outputEncryptionSettings:l}),q=z.warmupDone,H=z.isProcessing,K=z.takePictureManually,W=z.restartSession,G=z.resetIsProcessingImageBlobTaken,Q=_w.useCallback((function(){D({popupType:null}),G()}),[D,G]),X=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(),e.next=3,W();case 3:case"end":return e.stop()}}),e)}))),[W,Q]);_w.useEffect((function(){if(o){var e,t,r,i,a,s,c,l=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,h=o.lostY,m=o.clientHeight;n?(a=.7*(s=d-165),r=(c=(e=h+10)+45)+20,i=(t=c+s+10)+60):(a=s3.isMobile?l-6:Math.floor(.7*l),r=(c=(e=h+10)+50)+20,i=(t=c+(s=Math.floor(Math.min(a/1.5,m-2*h-(yte+2*vte)-100)))+10)+60);var g=Math.floor((l-a)/2)+f;O({x:g,y:c,width:a,height:s,surroundStyle:{opacity:.6,background:"#000"}});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:i};p(v),u(v)}}),[o,n,u]);var Y=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(""),e.next=3,K();case 3:case"end":return e.stop()}}),e)}))),[K]);return _w.useImperativeHandle(t,(function(){return{restartSession:X}}),[X]),_w.createElement(_w.Fragment,null,!q&&_w.createElement(J9,null),B&&_w.createElement(_te,null,w),H&&_w.createElement(kte,null,_w.createElement("img",{src:y,alt:"",className:"spin"})),R&&_w.createElement(c0,{x:"".concat(R.x,"px"),y:"".concat(R.y,"px"),width:"".concat(R.width,"px"),height:"".concat(R.height,"px"),surroundStyle:R.surroundStyle},_w.createElement(Pte,{width:R.width,height:R.height,type:A?Bee.ERROR:Bee.DEFAULT})),!A&&_w.createElement(xte,{y:"".concat(h,"px"),className:"description"},r),A&&_w.createElement(Tte,{y:"".concat(h,"px")},A),!H&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!A)&&_w.createElement(wte,{onClick:Y,y:"".concat(g,"px")},_w.createElement("img",{src:v,alt:""})),_&&_w.createElement(Ate,{key:_,className:"message",y:"".concat(m,"px")},_),_w.createElement(Y9,{open:M},L===jte.SESSION_TIMEOUT&&_w.createElement(Lte,{onOk:X,maxSessionTime:null==s?void 0:s.idCardSessionTime})))}));qre.propTypes={usePortraitMask:_k.bool,description:_k.string,windowAndVideoInfo:_k.shape({}),refVideo:_k.shape({}),frontSide:_k.bool,settings:_k.shape({}),onCaptureDone:_k.func,onUISpacingChange:_k.func,outputEncryptionSettings:_k.shape({})},qre.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var Hre,Kre,Wre="#00ce78",Gre=10,Qre=lE.div(Ure||(Ure=Ky(["\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}),q3+20),Xre=lE.div(jre||(jre=Ky(["\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")})),Yre=function(e){var t=e.children,r=e.y;return _w.createElement(Qre,{y:r,background:Wre},_w.createElement(Xre,{arrowSize:Gre,top:-Gre,color:Wre}),t)},$re=lE.div(Fre||(Fre=Ky(["\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}),q3+20),Zre={QR_INSTRUCTIONS_TEXT:{en:_w.createElement("span",null,"Please follow the instructions below to scan QR code:",_w.createElement("br",null),_w.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:_w.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",_w.createElement("br",null),_w.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:_w.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",_w.createElement("br",null),_w.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",_w.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:_w.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",_w.createElement("br",null),_w.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",_w.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"}},Jre=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,i=e.mr,a=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!==a&&(m.marginLeft=a,m.marginRight=a),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==i&&(m.marginRight=i),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),_w.cloneElement(t,{style:Ny(Ny({},h),m)})};Jre.propTypes={mt:_k.string,ml:_k.string,mr:_k.string,mb:_k.string,mx:_k.string,my:_k.string,pt:_k.string,pl:_k.string,pr:_k.string,pb:_k.string,px:_k.string,py:_k.string},Jre.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 ene,tne,rne,nne=lE.button(Hre||(Hre=Ky(["\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})),one=lE.a(Kre||(Kre=Ky(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),ine=lE.div(ene||(ene=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),ane=lE.div(tne||(tne=Ky(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),sne=lE.div(rne||(rne=Ky(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),cne=function(e){var t=e.onRetry,r=e.onSkip,n=mF.useSDKSettings().lang;return _w.createElement(ine,null,_w.createElement(Jre,{mt:"25px"},_w.createElement(ane,null,Zre.QR_INVALID_POPUP_TITLE[n])),_w.createElement(Jre,{mt:"30px"},_w.createElement(sne,null,Zre.QR_INVALID_POPUP_DESCRIPTION[n])),_w.createElement(Jre,{mt:"30px"},_w.createElement(nne,{onClick:t},Zre.QR_INVALID_POPUP_RETRY_BUTTON[n])),_w.createElement(Jre,{my:"20px"},_w.createElement(one,{onClick:r},Zre.QR_INVALID_POPUP_SKIP_BUTTON[n])))};cne.propTypes={onRetry:_k.func,onSkip:_k.func},cne.defaultProps={onRetry:function(){},onSkip:function(){}};var une,lne,dne,fne,pne,hne,mne,gne=["children","ratio","padding"],vne=lE.div(une||(une=Ky(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),yne=lE.div(lne||(lne=Ky(["\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})),bne=function(e){var t=e.children,r=e.ratio,n=e.padding,o=Vy(e,gne);return _w.createElement(vne,Ry({ratio:r},o),_w.createElement(yne,{padding:n},t))};bne.propTypes={children:_k.node,ratio:_k.number,padding:_k.string},bne.defaultProps={children:null,ratio:4/3,padding:"0"};var wne=lE.div(dne||(dne=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),kne=lE.div(fne||(fne=Ky(["\n background: #e7e6e6;\n width: 100%;\n"]))),Cne=lE.img(pne||(pne=Ky(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),Bne=lE.div(hne||(hne=Ky(["\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})),Sne=lE(Bne)(mne||(mne=Ky(["\n white-space: nowrap;\n"]))),Ene=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=mF.useSDKSettings().lang,i=YF.useAsset("qr_code_banner.png"),a=_w.useRef(n),s=Wy(_w.useState((function(){return r8(Zre.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),c=s[0],u=s[1],l=GF.useSDKTracking().sendEvent,d=_w.useRef(!1);_w.useEffect((function(){l({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[l]),_w.useEffect((function(){var e=r8(Zre.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){a.current--,u(e({x:a.current})),a.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 _w.createElement(wne,null,_w.createElement(kne,null,_w.createElement(bne,{ratio:1.6},_w.createElement(Cne,{src:i}))),_w.createElement(Jre,{mt:"30px"},_w.createElement(Bne,null,Zre.QR_INSTRUCTIONS_TEXT[o])),_w.createElement(Jre,{mt:"30px"},_w.createElement(nne,{onClick:function(){l({tag:"id_qr",event:"user_activity.click_start",log:{}}),d.current=!0,t()}},Zre.QR_INSTRUCTIONS_START_BUTTON[o])),_w.createElement(Jre,{my:"20px"},_w.createElement(Sne,null,c)))};Ene.propTypes={onClickStart:_k.func,onTimeout:_k.func,timeout:_k.number},Ene.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var _ne=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g,xne=function(e){var t=e.match(_ne);return{valid:Boolean(t)}};function Tne(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 Ane=function(){var e=xy(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,bre();case 2:if(n=e.sent,o=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return i=document.createElement("canvas"),a=i.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;i.width=t/2,i.height=o/2,a.drawImage(n,t/2,0,i.width,i.height,0,0,i.width,i.height),URL.revokeObjectURL(r),e()},n.src=r}));case 11:return e.next=13,Tne({canvas:i,qrModel:o});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,nK.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,Uq.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)}}(),Pne=o((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 i=t;i<t+n;i++)for(var a=e;a<e+r;a++)this.set(a,i,!!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,i=0;i<this.size;i++)this.expTable[i]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(i=0;i<this.size-1;i++)this.logTable[this.expTable[i]]=i;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,i=t.coefficients;o.length>i.length&&(o=(r=[i,o])[0],i=r[1]);for(var a=new Uint8ClampedArray(i.length),s=i.length-o.length,c=0;c<s;c++)a[c]=i[c];for(c=s;c<i.length;c++)a[c]=n.addOrSubtractGF(o[c-s],i[c]);return new e(this.field,a)},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,i=t.coefficients,a=i.length,s=new Uint8ClampedArray(o+a-1),c=0;c<o;c++)for(var u=r[c],l=0;l<a;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,i[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),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],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),i=r(11),a=r(12);function s(e){var t=a.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=i.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 i=c;Object.keys(i||{}).forEach((function(e){i[e]=o[e]||i[e]}));var a="attemptBoth"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,u="onlyInvert"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,l=n.binarize(e,t,r,a),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==i.inversionAttempts&&"invertFirst"!==i.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 i=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,a){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new i(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 i(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 B=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<B&&(C=B)}m.set(v,g,C)}var S=n.BitMatrix.createEmpty(t,r),E=null;for(a&&(E=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 P=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var I=s.get(c,u);S.set(c,u,I<=P),a&&E.set(c,u,!(I<=P))}}return a?{binarized:S,inverted:E}:{binarized:S}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),i=r(9),a=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],i=e.height,a=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,i=e.alignmentPatternCenters;o<i.length;o++)for(var a=i[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===a&&6===u||6===a&&u===t-7||a===t-7&&6===u||r.setRegion(a-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=i-1;p>0;p-=2){6===p&&p--;for(var h=0;h<i;h++)for(var m=f?i-1-h:h,g=0;g<2;g++){var v=p-g;if(!a.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 a.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var i=t-9;i>=t-11;i--)n=c(e.get(i,o),n);var u=0;for(i=5;i>=0;i--)for(o=t-9;o>=t-11;o--)u=c(e.get(i,o),u);for(var l,d=1/0,f=0,p=a.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,i=0;for(n=o-1;n>=o-7;n--)i=c(e.get(8,n),i);for(r=o-8;r<o;r++)i=c(e.get(r,8),i);for(var a=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===i)return m;var g=s(t,h);g<a&&(l=m,a=g),t!==i&&(g=s(i,h))<a&&(l=m,a=g)}return a<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],i=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),i+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<i)return null;e=e.slice(0,i);for(var a=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<a;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=i.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,i=r(7),a=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],i=e.readBits(o);i>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var a=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+a,48+s,48+c),n+=a.toString()+s.toString()+c.toString(),i-=3}if(2===i){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");a=Math.floor(u/10),s=u%10,r.push(48+a,48+s),n+=a.toString()+s.toString()}else if(1===i){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],i=e.readBits(o);i>=2;){var a=e.readBits(11),s=Math.floor(a/45),u=a%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],i-=2}return 1===i&&(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],i=e.readBits(o),a=0;a<i;a++){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],i=e.readBits(o),s=0;s<i;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(a.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,a,c,f,p=new i.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,(a=m.bytes).push.apply(a,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<<(i=r-n);t=(this.bytes[this.byteOffset]&o)>>i,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 i;if(e>0)o=255>>(i=8-e)<<i,t=t<<e|(this.bytes[this.byteOffset]&o)>>i,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 i=new n.default(285,256,0),a=new o.default(i,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=a.evaluateAt(i.exp(u+i.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(i,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var i=t,a=r,s=e.zero,c=e.one;a.degree()>=n/2;){var u=i,l=s;if(s=c,(i=a).isZero())return null;a=u;for(var d=e.zero,f=i.getCoefficient(i.degree()),p=e.inverse(f);a.degree()>=i.degree()&&!a.isZero();){var h=a.degree()-i.degree(),m=e.multiply(a.getCoefficient(a.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),a=a.addOrSubtract(i.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),a.degree()>=i.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),a.multiply(v)]}(i,i.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,i=1;i<e.size&&o<r;i++)0===t.evaluateAt(i)&&(n[o]=e.inverse(i),o++);return o!==r?null:n}(i,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,i=new Array(o),a=0;a<o;a++){for(var s=e.inverse(r[a]),c=1,u=0;u<o;u++)a!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));i[a]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(i[a]=e.multiply(i[a],s))}return i}(i,f[1],p),m=0;m<p.length;m++){var g=r.length-1-i.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,i=e.y-t.y+r.y-n.y;if(0===o&&0===i)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 a=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=a*u-s*c,d=(o*u-s*i)/l,f=(a*i-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 i=o(e,t,r,n);return{a11:i.a22*i.a33-i.a23*i.a32,a12:i.a13*i.a32-i.a12*i.a33,a13:i.a12*i.a23-i.a13*i.a22,a21:i.a23*i.a31-i.a21*i.a33,a22:i.a11*i.a33-i.a13*i.a31,a23:i.a13*i.a21-i.a11*i.a23,a31:i.a21*i.a32-i.a22*i.a31,a32:i.a12*i.a31-i.a11*i.a32,a33:i.a11*i.a22-i.a12*i.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}),i=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),a=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=i.a13*e+i.a23*t+i.a33;return{x:(i.a11*e+i.a21*t+i.a31)/r,y:(i.a12*e+i.a22*t+i.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);a.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:a,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 i(e,t,r,o){var i,a,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?(i=Math.floor(e.y),a=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(i=Math.floor(e.x),a=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-i),f=Math.abs(c-a),p=Math.floor(-d/2),h=i<s?1:-1,m=a<c?1:-1,g=!0,v=i,y=a;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 a(e,t,r,n){var o,a=t.y-e.y,s=t.x-e.x,c=i(e,t,r,Math.ceil(n/2)),u=i(e,{x:e.x-s,y:e.y-a},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=a(e,{x:-1,y:e.y},r,t.length),o=a(e,{x:e.x,y:-1},r,t.length),i=a(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=a(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(i,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,i=Math.round(t.y);e.get(Math.round(o),i);)i--;for(var a=Math.round(t.y);e.get(Math.round(o),a);)a++;return{x:o,y:(i+a)/2}}function l(e,t,r,i,s){var u,l,d;try{u=function(e,t,r,i){var s=(o(a(e,r,i,5))/7+o(a(e,t,i,5))/7+o(a(r,e,i,5))/7+o(a(t,e,i,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}}(i,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-i.x+s.x,p=r.y-i.y+s.y,h=(n(i,s)+n(i,r))/2/d,m=1-3/h,g={x:i.x+m*(f-i.x),y:i.y+m*(p-i.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,i=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(i))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1];return o(a),{x:r,y:i,score:c({x:Math.floor(r),y:Math.floor(i)},[1,1,1],e)+n({x:r,y:i},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=[],i=[],a=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var i=e.get(t,n);if(i===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=i;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&&!i,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&&i;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=a.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:a.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})),i.push.apply(i,a.filter((function(e){return e.bottom.y!==n}))),a=a.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}))),i.push.apply(i,a);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 i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],a=o(i)/i.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:a}}})).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,i,a,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=(i=[e,t,r])[0],u=i[1],l=i[2]):(c=(a=[e,r,t])[0],u=a[1],l=a[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,i,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,i,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()})),Ine=n(Pne);function Rne(e){return One.apply(this,arguments)}function One(){return(One=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(i=n.getContext("2d"),o=i.getImageData(0,0,n.width,n.height)),!(a=Ine(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",a.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nne(e){return Dne.apply(this,arguments)}function Dne(){return(Dne=xy(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),dre.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 Mne=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,i=r,!n){e.next=6;break}return e.next=5,Wz.blobToCanvas({blob:n});case 5:i=e.sent;case 6:return a=i.getContext("2d"),e.next=9,Rne({imageData:a.getImageData(0,0,i.width,i.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,Nne({canvas:i,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 Lne(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.onResult,a=e.outputEncryptionSettings,s=_w.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=_w.useRef(!1),u=_w.useRef(null),l=Wy(_w.useState(!1),2),d=l[0],f=l[1],p=_w.useRef({}),h=mF.useSDKSettings().customUrls;_w.useEffect((function(){function e(){return(e=xy(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,bre({modelUrl:null==h?void 0:h.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,h]);var m=_w.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),g=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,l,f,h,g,v,y,b,w,k,C,B;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,g=t.current,c.current=!0,v=h.cropX,y=h.cropY,b=h.cropWidth,w=h.cropHeight,(k=s.current).width=b,k.height=w,C=k.getContext("2d"),B=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,o,u,d,p,h,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C.drawImage(g,v,y,b,w,0,0,b,w),t=performance.now(),f){e.next=8;break}return e.next=5,Tne({canvas:k,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,Mne({canvas:k,qrScannerResources:l});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=27;break}return m(),o=xne(r),e.next=17,SV.takePicture({canvas:s.current});case 17:return u=e.sent,e.next=20,nK.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:!0});case 20:if(d=e.sent,!a||!a.key){e.next=26;break}return h=a.key,e.next=25,Uq.encrypt({blob:d,key:h});case 25:p=e.sent;case 26:i({result:r,validateResult:o,image:{blob:d,encrypted:p}});case 27:return S=180-t>0?180-t:0,e.next=30,new Promise((function(e){return setTimeout(e,S)}));case 30:c.current&&window.requestAnimationFrame(B);case 31:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(B);case 13:case"end":return e.stop()}}),e)}))),[t,o,d,i,m,a]),v=_w.useCallback((function(){m()}),[m]);return _w.useEffect((function(){var e=t.current;r||v(),d&&r&&n&&e&&e.videoWidth>0&&(u.current=SV.analyzeVideoAndWindowSizes(e,n,0),g())}),[r,n,t,m,g,d,v]),_w.useEffect((function(){return v}),[v]),{refWorkingCanvas:s,stopCheckFrame:m,checkFrame:g,warmupDone:d}}var Une,jne,Fne,Vne,zne,qne,Hne=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onSessionTimeout,a=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=Wy(_w.useState(!1),2),l=u[0],d=u[1],f=_w.useRef((function(){})),p=_w.useRef((function(){})),h=mF.useSDKSettings().lang,m=Lne({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:_w.useCallback((function(){f.current.apply(f,arguments)}),[]),outputEncryptionSettings:c}),g=m.stopCheckFrame,v=m.checkFrame,y=m.warmupDone,b=Dre({refVideo:r,shouldStart:t&&y,cropArea:n,settings:o}),w=b.stopCheckFrame,k=b.refRecordedVideos,C=b.splitVideos,B=b.resetRecordedVideos,S=b.checkFrame;f.current=_w.useCallback((function(e){d(!0),w(),g(),p.current(),a(Ny(Ny({},e),{},{recordedVideos:k.current})),d(!1)}),[w,a,k,g]);var E=_w.useCallback((function(){w(),g();var e=Gy(k.current);i({recordedVideos:e}),B()}),[B,w,g,i,k]),_=_w.useCallback((function(){C()}),[C]),x=Lre({lang:h,onAboutToTimeout:s,onSessionTimeout:E,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:_w.useCallback(xy(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}},Kne=145;function Wne(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,i=e.onCaptureDone,a=e.outputEncryptionSettings,s=Wy(_w.useState(null),2),c=s[0],u=s[1],l=YF.useAsset("qr_capture_cursor.png"),d=Wy(_w.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=mF.useSDKSettings().lang,v=GF.useSDKTracking().sendEvent,y=Ute(),b=y.showPopup,w=y.popupShown,k=y.popupType,C=Wy(_w.useState(!1),2),B=C[0],S=C[1],E=Wy(_w.useState(null),2),_=E[0],x=E[1],T=YF.useAsset("ic_loading.png"),A=_w.useRef();_w.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),_w.useEffect((function(){b({popupType:jte.QR_INSTRUCTIONS})}),[b]),_w.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,i=s3.isMobile?Math.min(e-6,Kne):Kne,a=i,s=o+10,c=s+90,l=c+40,d=l+a+20,f=Math.floor((e-i)/2)+n;u({x:f,y:l,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var P=_w.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),i(e)}),[i,v]),I=_w.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}}),i(e)):(b({popupType:jte.QR_INVALID}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,i,v]),R=_w.useCallback((function(e){var t=e.curTimeLeft;x(r8(Zre.REMAINING_TIME[g])({x:t}))}),[g]),O=Hne({shouldStart:B,refVideo:n,cropArea:c,settings:o,onSessionTimeout:P,onCaptureDone:I,onAboutToTimeout:R,outputEncryptionSettings:a}),N=O.isProcessing,D=O.restartSession,M=O.warmupDone,L=_w.useCallback((function(){b({popupType:null})}),[b]),U=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(),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,L,v]),j=_w.useCallback((function(){L(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),i()}),[L,i,v]),F=_w.useCallback((function(){L(),setTimeout((function(){S(!0)}),200)}),[L]);return _w.createElement(_w.Fragment,null,!M&&_w.createElement(J9,{contentStyle:{maxWidth:"300px"}}),c&&_w.createElement(c0,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},_w.createElement("div",null,_w.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),_w.createElement(Yre,{y:"".concat(h,"px")},Zre.QR_TOOLTIP[g]),_&&_w.createElement($re,{key:_,className:"message",y:"".concat(m,"px")},_),N&&_w.createElement(kte,null,_w.createElement("img",{src:T,alt:"",className:"spin"})),_w.createElement(Y9,{contentStyle:{maxWidth:"332px"},open:w},k===jte.QR_INVALID&&_w.createElement(cne,{onRetry:U,onSkip:j}),k===jte.QR_INSTRUCTIONS&&_w.createElement(Ene,{onClickStart:F,onTimeout:F})))}Wne.propTypes={windowAndVideoInfo:_k.shape({}),onUISpacingChange:_k.func,refVideo:_k.shape({}),settings:_k.shape({}),onCaptureDone:_k.func,outputEncryptionSettings:_k.shape({})},Wne.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var Gne,Qne,Xne,Yne,$ne,Zne={SUCCESS:"SUCCESS",WARNING:"WARNING"},Jne=(Iy(Une={},Zne.SUCCESS,"52,206,95"),Iy(Une,Zne.WARNING,"255,148,50"),Une),eoe=(Iy(jne={},Zne.SUCCESS,"✓"),Iy(jne,Zne.WARNING,"!"),jne),toe=lE.div(Fne||(Fne=Ky(["\n font-weight: normal;\n"]))),roe=lE.div(Vne||(Vne=Ky(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return XS(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],Jne[e.type],Jne[e.type],Jne[e.type])})),noe=lE.div(zne||(zne=Ky(["\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 XS(["rgb(",")"],Jne[e.type])})),ooe=lE.div(qne||(qne=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),ioe=function(e){var t=e.children,r=e.type,n=e.className;return _w.createElement(toe,{className:n},_w.createElement(roe,{type:r}),_w.createElement(ooe,null,_w.createElement(noe,{type:r},eoe[r]),t),_w.createElement(roe,{type:r}))};ioe.propTypes={children:_k.node,type:_k.string,className:_k.string},ioe.defaultProps={children:null,type:Zne.SUCCESS,className:""};var aoe=lE.div(Gne||(Gne=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),soe=lE.div(Qne||(Qne=Ky(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),coe=lE.button(Xne||(Xne=Ky(["\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})),uoe=lE.img(Yne||(Yne=Ky(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),loe=lE.div($ne||($ne=Ky(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),doe=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,i=e.hasValidQR,a=e.frontSide,s=Wy(_w.useState(null),2),c=s[0],u=s[1],l=mF.useSDKSettings().lang,d=GF.useSDKTracking().sendEvent;return _w.useEffect((function(){d({tag:a?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[a,d]),_w.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),_w.createElement(aoe,null,null!==i&&_w.createElement(Jre,{mb:"20px"},_w.createElement("div",null,_w.createElement(ioe,{type:i?Zne.SUCCESS:Zne.WARNING},i?Ite.CONFIRM_POPUP_VALID_QR[l]:Ite.CONFIRM_POPUP_INVALID_QR[l]))),_w.createElement(bne,{ratio:1.5},_w.createElement(uoe,{src:c})),o&&_w.createElement(soe,{className:"confirm-popup-error-message"},o.msg[l]),_w.createElement(loe,null,_w.createElement(coe,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},Ite.BTN_TRY_AGAIN[l]),_w.createElement(coe,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},Ite.BTN_USE_THIS_PICTURE[l])))};doe.propTypes={imageTaken:_k.shape({}),error:_k.shape({msg:_k.shape({})}),onConfirm:_k.func,onTryAgain:_k.func,hasValidQR:_k.bool,frontSide:_k.bool},doe.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var foe,poe={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},hoe=fE(foe||(foe=Ky(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),moe=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons"];function goe(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,i=e.defaultCameraId,a=e.globalStyle,s=e.styledComponent,c=e.frontCamera,u=e.scannerTypeCons,l=Vy(e,moe),d=l.numberOfCaptures,f=l.stepNumber,p=l.frontSide,h=l.titleIcon,m=l.title,g=l.description,v=l.scannerType,y=l.usePortraitMask,b=l.shouldShowSpinner,w=l.handleQRCaptureDone,k=l.handleIDCardCaptureDone,C=l.handleRestartSession,B=l.refIDCardReader,S=l.handleClickConfirm,E=l.popupType,_=l.popupShown,x=l.popupProps,T=_w.useRef(null),A=Wy(_w.useState(null),2),P=A[0],I=A[1],R=Wy(_w.useState(!1),2),O=R[0],N=R[1],D=YF.useAsset("ic_loading.png"),M=Wy(_w.useState({}),2),L=M[0],U=M[1],j=L.yTitle,F=_w.useCallback((function(e){I(e),N(!0)}),[]);_w.useEffect((function(){N(!1)}),[c]);var V=YF.useAsset(h),z=s.CloseCameraButton;return _w.createElement(sE,{theme:poe},_w.createElement(mte,null,_w.createElement(r0,{key:c,frontCamera:c,onVideoPlayed:F,onClose:t,flipHorizontal:c,ref:T,onError:r,defaultCameraId:i,closeButton:z||null},O&&_w.createElement(_w.Fragment,null,v===u.ID_CARD&&_w.createElement(qre,{key:f,ref:B,windowAndVideoInfo:P,refVideo:T,settings:n,onCaptureDone:k,onUISpacingChange:U,frontSide:p,description:g,usePortraitMask:y,outputEncryptionSettings:o}),v===u.QR_CODE&&_w.createElement(Wne,{key:f,refVideo:T,windowAndVideoInfo:P,settings:n,onCaptureDone:w,onUISpacingChange:U,outputEncryptionSettings:o})),_w.createElement(hte,{keyForTransition:d}),_w.createElement(Bte,{y:"".concat(j,"px")},_w.createElement(Cee,null,_w.createElement(gee,{key:m,timeout:{enter:pte,exit:pte},classNames:"flipY",unmountOnExit:!0},_w.createElement(Ste,null,h&&_w.createElement(gte,{src:V,alt:""}),_w.createElement(Ete,{className:"title"},m))))),b&&_w.createElement(kte,null,_w.createElement("img",{src:D,alt:"",className:"spin"}))),_w.createElement(Y9,{open:_},E===jte.CONFIRM&&_w.createElement(doe,Ry({},x,{onConfirm:S,onTryAgain:C,frontSide:p})))),_w.createElement(a,null))}var voe={settings:_k.shape({}),onClose:_k.func,onError:_k.func,outputEncryptionSettings:_k.shape({}),defaultCameraId:_k.string,globalStyle:_k.shape({}),styledComponent:_k.shape({CloseCameraButton:_k.node}),frontCamera:_k.bool,scannerTypeCons:_k.shape({}).isRequired},yoe={settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:hoe,styledComponent:{CloseCameraButton:null},frontCamera:!1};goe.propTypes=voe,goe.defaultProps=yoe;var boe=sM.IDCardSide,woe=sM.IDCardType,koe=sM.Errors,Coe={ID_CARD:"id_card",QR_CODE:"qr_code"},Boe=[{scannerType:Coe.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:sM.IDCardSide.FRONT,cardType:woe.VN,enableConfirmPopup:!0},{scannerType:Coe.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:sM.IDCardSide.BACK,cardType:woe.VN,enableConfirmPopup:!0}],Soe={scannerType:Coe.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},Eoe=function(){return Promise.resolve({card_label:""})},_oe=function(e){var t=e.settings,r=e.onError,n=e.detectIdCard,o=void 0===n?Eoe:n,i=e.outputEncryptionSettings,a=e.steps,s=void 0===a?Boe:a,c=e.onStepDone,u=Wy(_w.useState(0),2),l=u[0],d=u[1],f=Wy(_w.useState(s[l]),2),p=f[0],h=f[1],m=Wy(_w.useState(0),2),g=m[0],v=m[1],y=Wy(_w.useState(!1),2),b=y[0],w=y[1],k=_w.useRef({}),C=_w.useRef([]),B=_w.useRef(null),S=_w.useRef(),E=Ute(),_=E.showPopup,x=E.popupShown,T=E.popupType,A=E.props,P=p.scannerType,I=p.title,R=p.titleIcon,O=p.cardSide,N=p.description,D=p.usePortraitMask,M=p.cardType,L=p.enableConfirmPopup,U=_w.useCallback((function(e){e>=s.length||setTimeout((function(){d(e),h(s[e])}),200)}),[s]),j=_w.useCallback((function(){U(l+1)}),[U,l]),F=_w.useCallback((function(){setTimeout((function(){h((function(e){return Ny(Ny({},e),Soe)}))}),200)}),[]),V=_w.useCallback((function(){_({popupType:null})}),[_]),z=_w.useCallback((function(){V(),B.current=null,P===Coe.QR_CODE?U(l):P===Coe.ID_CARD&&S.current.restartSession()}),[U,l,V,P]),q=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={stepNumber:l,cardSide:O,cardType:M,image:k.current,recordedVideos:null!=t&&t.enableRecording?C.current:[]},(P===Coe.QR_CODE||null!==(r=B.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=B.current),w(!0),e.next=5,c(n);case 5:w(!1),B.current=null,j();case 8:case"end":return e.stop()}}),e)}))),[t,l,c,j,P,w,O,M]),H=_w.useCallback((function(e){var t;if(B.current=e,e&&e.recordedVideos){var r,n=e.recordedVideos;(r=C.current).push.apply(r,Gy(n))}v((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);L?_({popupType:jte.CONFIRM,props:{hasValidQR:o,imageTaken:k.current}}):q()}),[_,L,q]),K=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var a,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.image,s=n.error,c=n.recordedVideos,k.current=a,C.current=c,v((function(e){return e+1})),O!==sM.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!s3.isMobile){e.next=28;break}if(l=null==a||null===(u=a.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return w(!0),e.prev=9,e.next=12,o({image:a,cardType:M,cardSide:O});case 12:d=e.sent,l=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(koe.detect_id_card_error);case 19:w(!1);case 20:if(!l||!"vn.cccd_new.front".includes(l)){e.next=28;break}return w(!0),e.next=24,Ane(k.current.blob,i);case 24:return(f=e.sent)?H(f):F(),w(!1),e.abrupt("return");case 28:L?_({popupType:jte.CONFIRM,props:{imageTaken:k.current,error:s}}):q();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[L,_,O,t,M,o,q,F,r,H,i,w]),W=_w.useCallback((function(){V(),q()}),[q,V]);return{numberOfCaptures:g,stepNumber:l,titleIcon:R,title:I,description:N,frontSide:O===boe.FRONT,scannerType:P,usePortraitMask:D,shouldShowSpinner:b,handleQRCaptureDone:H,handleIDCardCaptureDone:K,handleRestartSession:z,refIDCardReader:S,handleClickConfirm:W,showPopup:_,popupType:T,popupShown:x,popupProps:A}};function xoe(){this.__data__=new z8,this.size=0}var Toe=xoe;function Aoe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Poe=Aoe;function Ioe(e){return this.__data__.get(e)}var Roe=Ioe;function Ooe(e){return this.__data__.has(e)}var Noe=Ooe,Doe=200;function Moe(e,t){var r=this.__data__;if(r instanceof z8){var n=r.__data__;if(!H8||n.length<Doe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new a6(n)}return r.set(e,t),this.size=r.size,this}var Loe=Moe;function Uoe(e){var t=this.__data__=new z8(e);this.size=t.size}Uoe.prototype.clear=Toe,Uoe.prototype.delete=Poe,Uoe.prototype.get=Roe,Uoe.prototype.has=Noe,Uoe.prototype.set=Loe;var joe=Uoe;function Foe(e,t,r){(void 0!==r&&!V2(e[t],r)||void 0===r&&!(t in e))&&j2(e,t,r)}var Voe=Foe;function zoe(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===r(i[c],c,i))break}return t}}var qoe=zoe,Hoe=qoe(),Koe=Hoe,Woe=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?g0.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}})),Goe=g0.Uint8Array,Qoe=Goe;function Xoe(e){var t=new e.constructor(e.byteLength);return new Qoe(t).set(new Qoe(e)),t}var Yoe=Xoe;function $oe(e,t){var r=t?Yoe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Zoe=$oe;function Joe(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var eie=Joe,tie=Object.create,rie=function(){function e(){}return function(t){if(!d0(t))return{};if(tie)return tie(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),nie=rie;function oie(e){return"function"!=typeof e.constructor||x5(e)?{}:nie(V5(e))}var iie=oie;function aie(e){return q0(e)&&y1(e)}var sie=aie;function cie(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var uie=cie;function lie(e){return G2(e,D5(e))}var die=lie;function fie(e,t,r,n,o,i,a){var s=uie(e,r),c=uie(t,r),u=a.get(c);if(u)Voe(e,r,u);else{var l=i?i(s,c,r+"",e,t,a):void 0,d=void 0===l;if(d){var f=U1(c),p=!f&&V1(c),h=!f&&!p&&w5(c);l=c,f||p||h?U1(s)?l=s:sie(s)?l=eie(s):p?(d=!1,l=Woe(c,!0)):h?(d=!1,l=Zoe(c,!0)):l=[]:X5(c)||M1(c)?(l=s,M1(s)?l=die(s):d0(s)&&!p2(s)||(l=iie(c))):d=!1}d&&(a.set(c,l),o(l,c,n,i,a),a.delete(c)),Voe(e,r,l)}}var pie=fie;function hie(e,t,r,n,o){e!==t&&Koe(t,(function(i,a){if(o||(o=new joe),d0(i))pie(e,t,a,r,hie,n,o);else{var s=n?n(uie(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),Voe(e,a,s)}}),D5)}var mie=hie,gie=_1((function(e,t,r){mie(e,t,r)})),vie=gie,yie={data:{settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},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:!0,mobile:!1}}}}}};function bie(e){var t=e.clientSettings,r=Wy(_w.useState(null),2),n=r[0],o=r[1];return _w.useEffect((function(){var e=vie(yie,t),r=E6(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),n=E6(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),i=E6(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),a=E6(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),s=E6(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),c=E6(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),u=E6(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),l=E6(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),d=E6(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),f=E6(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),p=E6(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),h=E6(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),m=E6(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),g=E6(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),v=E6(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),y=E6(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(s3.isMobile?"mobile":"web"));o({enableRecording:r,frameCaptureIntervalMs:n,idCardSessionTime:s,maxRecordingTimePerVideo:c,saveFrameQuality:i,enableTimers:a,enableAutoCapture:u,waitForBestImageTimeMs:l,enableBlurCheck:d,blurThreshold:f,disableCaptureButtonIfAlert:p,enableIdDetection:h,enableScanQr:m,scanQrLimitTimeSecond:g,enableExifData:v,enableVirtualCamHashes:y})}),[t]),{settings:n}}function wie(e){var t=e.logCredentials,r=e.clientSettings,n=e.uiOnlyComponent,o=e.onError,i=e.detectIdCard,a=e.outputEncryptionSettings,s=e.steps,c=e.onStepDone,u=bie({clientSettings:r}).settings,l=Ry({},_oe({settings:u,onError:o,detectIdCard:i,outputEncryptionSettings:a,steps:s,onStepDone:c}));return _w.createElement(G7,null,_w.createElement(GF.SDKTrackingProvider,{value:{tracking:Ny({},t)}},_w.createElement(n,Ry({},e,{settings:u,scannerTypeCons:Coe},l))))}var kie={logCredentials:_k.shape({}),clientSettings:_k.shape({}),uiOnlyComponent:_k.func,onError:_k.func,onStepDone:_k.func,steps:_k.arrayOf(_k.shape({})),detectIdCard:_k.func,outputEncryptionSettings:_k.shape({})};wie.propTypes=kie,wie.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:goe,onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var Cie=sM.IDCardSide,Bie=sM.Errors;function Sie(e){return Eie.apply(this,arguments)}function Eie(){return(Eie=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.cardType,o=t.cardSide,i=t.apiClient,a=t.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(o)},!a||!a.key){e.next=4;break}return e.abrupt("return",i.httpClient.post("/v1/images",Ny({base64:r.encrypted.hex},s),{"X-TV-Key":a.key}));case 4:return e.abrupt("return",i.uploadImage(Ny({file:r.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _ie(e){return xie.apply(this,arguments)}function xie(){return(xie=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.apiClient,o=t.rawString,i=t.outputEncryptionSettings,a={label:"qr_code",metadata:JSON.stringify({raw:o})},!i||!i.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",Ny({base64:r.encrypted.hex},a),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",n.uploadImage(Ny({file:r.blob},a)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tie(e){return Aie.apply(this,arguments)}function Aie(){return(Aie=xy(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 Pie(e){return Iie.apply(this,arguments)}function Iie(){return(Iie=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,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,i=t.isCapturingFrontSide,a=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:i?void 0:{id:a},videos:[].concat(Gy(u.map((function(e){return{id:e.id}}))),Gy(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 Rie(e){return Oie.apply(this,arguments)}function Oie(){return(Oie=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,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,i=t.backCardId,a=t.isCapturingFrontSide,s=t.qrImageId,c={card_type:r,image1:a?{id:o}:{id:i}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nie(e){return Die.apply(this,arguments)}function Die(){return(Die=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,o=t.frontCardId,i=t.qrImageId,a=t.onError,s=t.recordedVideos,c=t.apiClient,u=t.cardType,l=t.cardSide,d=t.qrScannedResult,f=t.outputEncryptionSettings,l!==Cie.BACK||o){e.next=4;break}return a(Bie.missing_front_id_card),e.abrupt("return");case 4:return p=[Sie({image:n,cardType:u,cardSide:l,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&p.push(_ie({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(p);case 8:if(h=e.sent,m=Wy(h,2),g=m[0],v=m[1],!g.errors){e.next=15;break}return a(Ny(Ny({},Bie.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)||i,(C=l===Cie.FRONT)?w=y:(w=o,k=y),e.next=21,Tie({imageId:y,cardType:u,apiClient:c});case 21:if(!(B=e.sent).errors){e.next=25;break}return a(Ny(Ny({},Bie.sanity_check_error),{},{details:B.errors})),e.abrupt("return");case 25:return e.next=27,Rie({cardType:u,apiClient:c,frontCardId:w,backCardId:k,isCapturingFrontSide:C,qrImageId:b});case 27:if(!(S=e.sent).errors){e.next=31;break}return a(Ny(Ny({},Bie.read_id_card_error),{},{details:S.errors})),e.abrupt("return");case 31:return e.next=33,Pie({apiClient:c,cardType:u,frontCardId:w,isCapturingFrontSide:C,backCardId:k,recordedVideos:s,qrImageId:b});case 33:if(!(E=e.sent).errors){e.next=37;break}return a(Ny(Ny({},Bie.detect_id_tampering_error),{},{details:E.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:B.data,tamperingInfo:E.data,cardInfo:S.data,qrImageId:b});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Mie=["readIDCardUIOnlyComponent"],Lie=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],Uie=sM.Errors,jie=function(e){var t=e.readIDCardUIOnlyComponent,r=Vy(e,Mie),n=r.onError,o=r.onStepDone,i=r.apiCredentials,a=r.logCredentials,s=r.outputEncryptionSettings,c=Vy(r,Lie),u=Wy(_w.useState(null),2),l=u[0],d=u[1],f=iq.useApiClient({apiCredentials:i,logCredentials:a}).apiClient,p=_w.useRef(""),h=_w.useRef("");_w.useEffect((function(){function e(){return(e=xy(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=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,i,a,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,i=t.cardSide,a=t.recordedVideos,c=t.qrScannedResult,u=t.image,l=null,e.prev=2,e.next=5,Nie({image:u,cardSide:i,frontCardId:p.current,qrImageId:h.current,onError:n,apiClient:f,cardType:r,recordedVideos:a,qrScannedResult:c,outputEncryptionSettings:s});case 5:l=e.sent,i===sM.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(Ny(Ny({},Uie.api_call_error),{},{details:e.t0}));case 13:l&&o(Ny(Ny({},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&&_w.createElement(t,Ry({logCredentials:a,onError:n,onStepDone:m,outputEncryptionSettings:s},c,{clientSettings:l}))};function Fie(){return Vie.apply(this,arguments)}function Vie(){return(Vie=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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,i=t.blazefaceModelUrl,a=t.closeEyesModelUrl,s=new lre,e.prev=2,Nq.loadTensorFlow(o).then((function(){Nq.loadBlazefaceModel({modelUrl:i})})),e.next=6,Promise.all([F6({closeEyesModelUrl:a}),s.loadResource({modelUrl:n}),are({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)}jie.propTypes={onError:_k.func,onStepDone:_k.func,apiCredentials:_k.shape({accessKey:_k.string,secretKey:_k.string,apiUrl:_k.string}),logCredentials:_k.shape({}),outputEncryptionSettings:_k.shape({}),readIDCardUIOnlyComponent:_k.func},jie.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:wie};var zie=j6(Fie),qie=function(){return{checkCamera:j7,LivenessDetection:X7,NativeCamera:V7,ReadIDCardUIOnly:wie,ReadIDCardWithApiCall:jie,warmUpReadIdCard:xre,preloadEKYCResources:zie,getListCamera:R3}},Hie=Vy(U7,["useLivenessDetection"]);function Kie(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}var Wie=Kie;function Gie(e,t){return e&&G2(t,w4(t),e)}var Qie=Gie;function Xie(e,t){return e&&G2(t,D5(t),e)}var Yie=Xie;function $ie(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}var Zie=$ie;function Jie(){return[]}var eae=Jie,tae=Object.prototype,rae=tae.propertyIsEnumerable,nae=Object.getOwnPropertySymbols,oae=nae?function(e){return null==e?[]:(e=Object(e),Zie(nae(e),(function(t){return rae.call(e,t)})))}:eae,iae=oae;function aae(e,t){return G2(e,iae(e),t)}var sae=aae;function cae(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}var uae=cae,lae=Object.getOwnPropertySymbols,dae=lae?function(e){for(var t=[];e;)uae(t,iae(e)),e=V5(e);return t}:eae,fae=dae;function pae(e,t){return G2(e,fae(e),t)}var hae=pae;function mae(e,t,r){var n=t(e);return U1(e)?n:uae(n,r(e))}var gae=mae;function vae(e){return gae(e,w4,iae)}var yae=vae;function bae(e){return gae(e,D5,fae)}var wae=bae,kae=D2(g0,"DataView"),Cae=kae,Bae=D2(g0,"Promise"),Sae=Bae,Eae=D2(g0,"Set"),_ae=Eae,xae=D2(g0,"WeakMap"),Tae=xae,Aae="[object Map]",Pae="[object Object]",Iae="[object Promise]",Rae="[object Set]",Oae="[object WeakMap]",Nae="[object DataView]",Dae=C2(Cae),Mae=C2(H8),Lae=C2(Sae),Uae=C2(_ae),jae=C2(Tae),Fae=V0;(Cae&&Fae(new Cae(new ArrayBuffer(1)))!=Nae||H8&&Fae(new H8)!=Aae||Sae&&Fae(Sae.resolve())!=Iae||_ae&&Fae(new _ae)!=Rae||Tae&&Fae(new Tae)!=Oae)&&(Fae=function(e){var t=V0(e),r=t==Pae?e.constructor:void 0,n=r?C2(r):"";if(n)switch(n){case Dae:return Nae;case Mae:return Aae;case Lae:return Iae;case Uae:return Rae;case jae:return Oae}return t});var Vae=Fae,zae=Object.prototype,qae=zae.hasOwnProperty;function Hae(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&qae.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Kae=Hae;function Wae(e,t){var r=t?Yoe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Gae=Wae,Qae=/\w*$/;function Xae(e){var t=new e.constructor(e.source,Qae.exec(e));return t.lastIndex=e.lastIndex,t}var Yae=Xae,$ae=_0?_0.prototype:void 0,Zae=$ae?$ae.valueOf:void 0;function Jae(e){return Zae?Object(Zae.call(e)):{}}var ese=Jae,tse="[object Boolean]",rse="[object Date]",nse="[object Map]",ose="[object Number]",ise="[object RegExp]",ase="[object Set]",sse="[object String]",cse="[object Symbol]",use="[object ArrayBuffer]",lse="[object DataView]",dse="[object Float32Array]",fse="[object Float64Array]",pse="[object Int8Array]",hse="[object Int16Array]",mse="[object Int32Array]",gse="[object Uint8Array]",vse="[object Uint8ClampedArray]",yse="[object Uint16Array]",bse="[object Uint32Array]";function wse(e,t,r){var n=e.constructor;switch(t){case use:return Yoe(e);case tse:case rse:return new n(+e);case lse:return Gae(e,r);case dse:case fse:case pse:case hse:case mse:case gse:case vse:case yse:case bse:return Zoe(e,r);case nse:return new n;case ose:case sse:return new n(e);case ise:return Yae(e);case ase:return new n;case cse:return ese(e)}}var kse=wse,Cse="[object Map]";function Bse(e){return q0(e)&&Vae(e)==Cse}var Sse=Bse,Ese=v5&&v5.isMap,_se=Ese?g5(Ese):Sse,xse=_se,Tse="[object Set]";function Ase(e){return q0(e)&&Vae(e)==Tse}var Pse=Ase,Ise=v5&&v5.isSet,Rse=Ise?g5(Ise):Pse,Ose=Rse,Nse=1,Dse=2,Mse=4,Lse="[object Arguments]",Use="[object Array]",jse="[object Boolean]",Fse="[object Date]",Vse="[object Error]",zse="[object Function]",qse="[object GeneratorFunction]",Hse="[object Map]",Kse="[object Number]",Wse="[object Object]",Gse="[object RegExp]",Qse="[object Set]",Xse="[object String]",Yse="[object Symbol]",$se="[object WeakMap]",Zse="[object ArrayBuffer]",Jse="[object DataView]",ece="[object Float32Array]",tce="[object Float64Array]",rce="[object Int8Array]",nce="[object Int16Array]",oce="[object Int32Array]",ice="[object Uint8Array]",ace="[object Uint8ClampedArray]",sce="[object Uint16Array]",cce="[object Uint32Array]",uce={};function lce(e,t,r,n,o,i){var a,s=t&Nse,c=t&Dse,u=t&Mse;if(r&&(a=o?r(e,n,o,i):r(e)),void 0!==a)return a;if(!d0(e))return e;var l=U1(e);if(l){if(a=Kae(e),!s)return eie(e,a)}else{var d=Vae(e),f=d==zse||d==qse;if(V1(e))return Woe(e,s);if(d==Wse||d==Lse||f&&!o){if(a=c||f?{}:iie(e),!s)return c?hae(e,Yie(a,e)):sae(e,Qie(a,e))}else{if(!uce[d])return o?e:{};a=kse(e,d,s)}}i||(i=new joe);var p=i.get(e);if(p)return p;i.set(e,a),Ose(e)?e.forEach((function(n){a.add(lce(n,t,r,n,e,i))})):xse(e)&&e.forEach((function(n,o){a.set(o,lce(n,t,r,o,e,i))}));var h=l?void 0:(u?c?wae:yae:c?D5:w4)(e);return Wie(h||e,(function(n,o){h&&(n=e[o=n]),K2(a,o,lce(n,t,r,o,e,i))})),a}uce[Lse]=uce[Use]=uce[Zse]=uce[Jse]=uce[jse]=uce[Fse]=uce[ece]=uce[tce]=uce[rce]=uce[nce]=uce[oce]=uce[Hse]=uce[Kse]=uce[Wse]=uce[Gse]=uce[Qse]=uce[Xse]=uce[Yse]=uce[ice]=uce[ace]=uce[sce]=uce[cce]=!0,uce[Vse]=uce[zse]=uce[$se]=!1;var dce=lce;function fce(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var pce=fce;function hce(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}var mce=hce;function gce(e,t){return t.length<2?e:B6(e,mce(t,0,-1))}var vce=gce;function yce(e,t){return t=y6(t,e),null==(e=vce(e,t))||delete e[k6(pce(t))]}var bce=yce;function wce(e){return X5(e)?void 0:e}var kce=wce,Cce=_0?_0.isConcatSpreadable:void 0;function Bce(e){return U1(e)||M1(e)||!!(Cce&&e&&e[Cce])}var Sce=Bce;function Ece(e,t,r,n,o){var i=-1,a=e.length;for(r||(r=Sce),o||(o=[]);++i<a;){var s=e[i];t>0&&r(s)?t>1?Ece(s,t-1,r,n,o):uae(o,s):n||(o[o.length]=s)}return o}var _ce=Ece;function xce(e){return(null==e?0:e.length)?_ce(e,1):[]}var Tce=xce;function Ace(e){return d1(e1(e,void 0,Tce),e+"")}var Pce,Ice,Rce,Oce,Nce,Dce,Mce,Lce,Uce,jce,Fce,Vce,zce,qce,Hce,Kce,Wce=Ace,Gce=1,Qce=2,Xce=4,Yce=Wce((function(e,t){var r={};if(null==e)return r;var n=!1;t=n4(t,(function(t){return t=y6(t,e),n||(n=t.length>1),t})),G2(e,wae(e),r),n&&(r=dce(r,Gce|Qce|Xce,kce));for(var o=t.length;o--;)bce(r,t[o]);return r})),$ce=Yce,Zce=Xee,Jce=ute,eue=ate,tue=(Zce.animationDuration,eue.default),rue=100,nue=lE.div(Pce||(Pce=Ky(["\n ","\n ","\n"])),Zce.default,Jce.default),oue=(lE.img(Ice||(Ice=Ky(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),10),iue=78,aue=lE.div(Rce||(Rce=Ky(["\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"])),iue,q3+20,s3.isMobile?XS(["top:",";"],(function(e){return e.y})):XS(["bottom:","px;"],oue)),sue=lE.div(Oce||(Oce=Ky(["\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"])),rue,rue,q3+20),cue=lE.div(Nce||(Nce=Ky(["\n color: #fff;\n text-align: center;\n"]))),uue=(lE.div(Dce||(Dce=Ky(["\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}),q3+20),lE.div(Mce||(Mce=Ky(["\n display: flex;\n align-items: center;\n"]))),lE(cue)(Lce||(Lce=Ky(["\n font-size: 16px;\n margin-left: 10px;\n color: #fff;\n"]))),lE.div(Uce||(Uce=Ky(["\n margin: 0;\n padding: 0 5px;\n position: absolute;\n top: ",";\n z-index: ",";\n left: 50%;\n transform: translateX(-50%);\n width: fit-content;\n"])),(function(e){return e.y}),q3+20)),lue=lE(cue)(jce||(jce=Ky(["\n text-align: center;\n background: ",";\n padding: 5px 10px;\n font-size: 16px;\n"])),(function(e){return e.theme.dangerColor})),due=function(e){var t=e.children,r=e.y;return _w.createElement(uue,{y:r},_w.createElement(lue,null,t))},fue=lE.div(Fce||(Fce=Ky(["\n background: rgba(0, 0, 0, 0.3);\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 120px;\n z-index: ",";\n"])),q3+10),pue=lE.div(Vce||(Vce=Ky(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),hue=lE(pue)(zce||(zce=Ky(["\n z-index: ",";\n position: absolute;\n top: 16px;\n right: 16px;\n width: 60px;\n"])),q3+100),mue=["width","height","type"],gue=lE(See)(qce||(qce=Ky([""]))),vue=lE.div(Hce||(Hce=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),yue=lE.img(Kce||(Kce=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),bue=function(e){var t=e.width,r=e.height,n=e.type,o=Vy(e,mue),i=YF.useAsset("id_card_frame.png"),a=YF.useAsset("id_card_frame_error.png");return _w.createElement(vue,{width:t,height:r},_w.createElement(yue,{src:n===Bee.ERROR?a:i,width:t,height:r}),_w.createElement(gue,Ry({width:t,height:r,type:n},o)))},wue=sM.Errors,kue={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"}},Cue=Ny(Ny({},wue),{},{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"}}}),Bue=20,Sue={fill:"none",strokeWidth:Bue,stroke:"rgba(0, 0, 0, 0.6)"},Eue=_w.forwardRef((function(e,t){var r,n=e.usePortraitMask,o=e.windowAndVideoInfo,i=e.refVideo,a=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=e.quality,f=Wy(_w.useState({}),2),p=f[0],h=f[1],m=p.yErrorMessage,g=p.yCaptureButton,v=YF.useAsset("ic_camera.svg"),y=YF.useAsset("ic_loading.png"),b=mF.useSDKSettings().lang,w=Wy(_w.useState(""),2),k=w[0],C=w[1],B=Wy(_w.useState(null),2),S=B[0],E=B[1],_=Mq.useThemeContext().dangerColor,x=_w.useRef((function(){})),T=_w.useCallback((function(e){C(null===e?"":r8(Cue[e.code].msg[b])({side:a?kue.FRONT[b]:kue.BACK[b]}))}),[b,a]),A=_w.useCallback((function(){x.current()}),[]),P=Vre({shouldStart:!0,refVideo:i,cropArea:S,settings:s,onModelErrorChange:T,frontSide:a,onSessionTimeout:A,onCaptureDone:c,outputEncryptionSettings:l,quality:d}),I=P.warmupDone,R=P.isProcessing,O=P.takePictureManually,N=P.restartSession,D=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N();case 2:case"end":return e.stop()}}),e)}))),[N]);x.current=D,_w.useEffect((function(){if(o){var e,t,r,i,a,s,c=o.videoAreaWidth,l=o.videoAreaHeight,d=o.lostX,f=o.lostY,p=o.clientHeight;n?(i=.7*(a=l-165),r=(s=(e=f+10)+45)+a+70):(i=s3.isMobile?c-6:Math.floor(.7*c),a=Math.floor(Math.min(i/1.5,p-2*f-(iue+2*oue)-135)),r=(t=(s=(e=f+10)+(s3.isMobile?90:50))+a+10)+88);var m=Math.floor((c-i)/2)+d;E({x:m,y:s,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var g={yTitle:e,yErrorMessage:t,yCaptureButton:r};h(g),u(g)}}),[o,n,u]);var M=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:case"end":return e.stop()}}),e)}))),[O]);return _w.useImperativeHandle(t,(function(){return{restartSession:D}}),[D]),_w.createElement(_w.Fragment,null,!I&&_w.createElement(J9,null),R&&_w.createElement(sue,null,_w.createElement("img",{src:y,alt:"",className:"spin"})),S&&_w.createElement(c0,{x:"".concat(S.x,"px"),y:"".concat(S.y,"px"),width:"".concat(S.width,"px"),height:"".concat(S.height,"px"),surroundStyle:S.surroundStyle},_w.createElement(bue,{strokeStyles:(r={},Iy(r,Bee.DEFAULT,Sue),Iy(r,Bee.ERROR,Sue),r),radius:20,strokeWidth:Bue,errorColor:_,width:S.width,height:S.height,type:k?Bee.ERROR:Bee.DEFAULT})),k&&_w.createElement(due,{y:"".concat(m,"px")},k),!R&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!k)&&_w.createElement(aue,{onClick:M,y:"".concat(g,"px")},_w.createElement("img",{src:v,alt:""})),!s3.isMobile&&_w.createElement(fue,null))}));Eue.propTypes={usePortraitMask:_k.bool,windowAndVideoInfo:_k.shape({}),refVideo:_k.shape({}),frontSide:_k.bool,settings:_k.shape({}),onCaptureDone:_k.func,onUISpacingChange:_k.func,outputEncryptionSettings:_k.shape({}),quality:_k.number},Eue.defaultProps={usePortraitMask:!1,windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null,quality:void 0};var _ue,xue={primaryColor:"#FDB913",dangerColor:"#D32F2F"},Tue=fE(_ue||(_ue=Ky([""]))),Aue=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","frontCamera","scannerTypeCons","quality"];function Pue(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,i=(e.defaultCameraId,e.frontCamera),a=e.scannerTypeCons,s=e.quality,c=Vy(e,Aue),u=c.numberOfCaptures,l=c.stepNumber,d=c.frontSide,f=c.scannerType,p=c.usePortraitMask,h=c.shouldShowSpinner,m=c.handleIDCardCaptureDone,g=c.refIDCardReader,v=_w.useRef(null),y=Wy(_w.useState(null),2),b=y[0],w=y[1],k=Wy(_w.useState(!1),2),C=k[0],B=k[1],S=YF.useAsset("ic_loading.png"),E=YF.useAsset("ic_close.png"),_=_w.useCallback((function(e){w(e),B(!0)}),[]);return _w.useEffect((function(){B(!1)}),[i]),_w.createElement(sE,{theme:xue},_w.createElement(nue,null,_w.createElement(r0,{key:i,frontCamera:i,onVideoPlayed:_,onClose:t,flipHorizontal:i,ref:v,onError:r,closeButton:_w.createElement(hue,null,_w.createElement("img",{src:E,alt:""}))},C&&_w.createElement(_w.Fragment,null,f===a.ID_CARD&&_w.createElement(Eue,{key:l,ref:g,windowAndVideoInfo:b,refVideo:v,settings:n,onCaptureDone:m,frontSide:d,usePortraitMask:p,outputEncryptionSettings:o,quality:s})),_w.createElement(tue,{keyForTransition:u}),h&&_w.createElement(sue,null,_w.createElement("img",{src:S,alt:"",className:"spin"})))),_w.createElement(Tue,null))}var Iue=$ce(voe,["globalStyle","styledComponent"]),Rue=$ce(yoe,["globalStyle","styledComponent"]);function Oue(e){var t=Boe.map((function(e){return Ny(Ny({},e),{},{enableConfirmPopup:!1})}));return _w.createElement(wie,Ry({},e,{uiOnlyComponent:Pue,steps:t}))}Pue.propTypes=Ny(Ny({},Iue),{},{quality:_k.number}),Pue.defaultProps=Ny(Ny({},Rue),{},{quality:void 0});var Nue,Due=function(e){return _w.createElement(jie,Ry({},e,{readIDCardUIOnlyComponent:Oue}))},Mue=Hie.LivenessStyledComponent.CloseCameraButton,Lue=lE(Mue)(Nue||(Nue=Ky(["\n width: 60px;\n"])));function Uue(e){return _w.createElement(X7,Ry({},e,{styledComponent:{CloseCameraButton:_w.createElement(Lue,null)}}))}var jue=function(e){Dy(r,e);var t=Hy(r);function r(e){return Ty(this,r),t.call(this,Ny(Ny({},e),{},{baseComponent:qie(),component:{ReadIDCardUIOnly:Oue,ReadIDCardWithApiCall:Due,LivenessDetection:Uue}}))}return r}(dK);t.APIUtils=iq,t.AntiDebugUtils=Dq,t.AssetUtils=YF,t.AsyncUtils=ZF,t.BaseTVWebSDK=dK,t.BlurUtils=CV,t.CameraUtils=SV,t.CloseEyesDetector=iK,t.CommonUtils=_V,t.Constants=sM,t.CoordinateUtils=IV,t.CryptoUtils=Uq,t.DEFAULT_CLOSE_EYE_MODEL=oK,t.ExifUtils=nK,t.FaceUtils=jV,t.GlareUtils=Yz,t.HashUtils=jF,t.ImageUtils=Wz,t.LoadResourceUtils=hq,t.LocalStorageUtils=DF,t.ModelUtils=Nq,t.PredictionUtils=VV,t.SDK=jue,t.SDKTimer=jq,t.ScannerType=DJ,t.SettingsContext=mF,t.ThemeUtils=Mq,t.TimeUtils=RF,t.TrackingContext=GF,t.UserAgentUtils=AF,t.defaultClientSettings=a3,t.defaultReadIDCardSteps=MJ,t.getCustomUrlsBySettings=lF,t.getQrScannerWorkerPath=cK,t.getSDKVersion=xF,t.requestMotionPermission=aK,t.useDeviceMotion=sK,Object.defineProperty(t,"__esModule",{value:!0})}));
84
+ */!function(o,i){var a="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]:i},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]==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):i:this[s[0]]=l?s[1].call(this,l,s[2]):i:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):i):this[s]=l||i;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?i:r}else if(w.has(t[r],e))return"?"===r?i: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"}}}},B={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=i),!(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(B,t):B;return this.getBrowser=function(){var e={name:i,version:i};return k.rgx.call(e,r,n.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:i};return k.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:i,model:i,type:i};return k.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:i,version:i};return k.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:i,version:i};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))===i||(e.exports=n):o&&(o.UAParser=S);var E=o&&(o.jQuery||o.Zepto);if(typeof E!==s){var _=new S;E.ua=_.getResult(),E.ua.get=function(){return _.getUA()},E.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)E.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),i=o.DEVICE_TYPES,a=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 i.MOBILE:return{isMobile:!0};case i.TABLET:return{isTablet:!0};case i.SMART_TV:return{isSmartTV:!0};case i.CONSOLE:return{isConsole:!0};case i.WEARABLE:return{isWearable:!0};case i.BROWSER:return{isBrowser:!0};default:return a}},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}}])})),c3="Expected a function",u3=NaN,l3="[object Symbol]",d3=/^\s+|\s+$/g,f3=/^[-+]0x[0-9a-f]+$/i,p3=/^0b[01]+$/i,h3=/^0o[0-7]+$/i,m3=parseInt,g3="object"==typeof r&&r&&r.Object===Object&&r,v3="object"==typeof self&&self&&self.Object===Object&&self,y3=g3||v3||Function("return this")(),b3=Object.prototype,w3=b3.toString,k3=Math.max,C3=Math.min,B3=function(){return y3.Date.now()};function S3(e,t,r){var n,o,i,a,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(c3);function p(t){var r=n,i=o;return n=o=void 0,u=t,a=e.apply(i,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):a}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=i}function g(){var e=B3();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?C3(r,i-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,a)}function y(){var e=B3(),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)),a}return t=T3(t)||0,E3(r)&&(l=!!r.leading,i=(d="maxWait"in r)?k3(T3(r.maxWait)||0,t):i,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?a:v(B3())},y}function E3(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _3(e){return!!e&&"object"==typeof e}function x3(e){return"symbol"==typeof e||_3(e)&&w3.call(e)==l3}function T3(e){if("number"==typeof e)return e;if(x3(e))return u3;if(E3(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=E3(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d3,"");var r=p3.test(e);return r||h3.test(e)?m3(e.slice(2),r?2:8):f3.test(e)?u3:+e}var A3=S3;function P3(e,t,r){class n extends _w.Component{constructor(){super(...arguments),this.updateDebounced=A3(this.forceUpdate,t,r)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return _w.createElement(e,Object.assign({},this.props))}}return n.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,KB(n,e)}function I3(){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 R3(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===Ey(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 O3,N3,D3,M3,L3,U3=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],j3=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&&U3.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},F3=function(e){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0)},V3=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}}},z3=sM.Errors,q3=1e3,H3=lE.div(O3||(O3=Ky(["\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"])),q3,(function(e){return e.checkCameraMode&&"opacity: 0;"})),K3=lE.video(N3||(N3=Ky(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),W3=lE.div(D3||(D3=Ky(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),G3=lE(W3)(M3||(M3=Ky(["\n z-index: ",";\n position: absolute;\n top: 20px;\n right: 20px;\n width: 20px;\n"])),q3+100),Q3=lE.div(L3||(L3=Ky(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),q3+20),X3=_w.createRef(),Y3=I3();function $3(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,i=e.onVideoPlayed,a=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=_w.useRef(),g=mF.useSDKSettings().lang,v=GF.useSDKTracking().sendEvent,y=YF.useAsset("ic_close.png"),b=Wy(_w.useState(""),2),w=b[0],k=b[1],C=_w.useRef(!1),B=_w.useRef(!1),S=_w.useRef(!1),E=_w.useRef(),_=_w.useRef([]),x=_w.useRef(""),T=_w.useCallback((function(e){u&&u(e)}),[u]),A=_w.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(E)}),[c]);function P(){return I.apply(this,arguments)}function I(){return(I=xy(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,R3();case 3:t=e.sent,_.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),nK.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)),_w.useEffect((function(){return function(){S.current=!0}}),[]);var R=_w.useCallback((function(){E.current||(E.current=setTimeout((function(){C.current||(k(z3.camera_timeout.msg[g]),T(z3.camera_timeout))}),2e4))}),[g,T]),O=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,o,i,a,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=p.length>1&&void 0!==p[1]&&p[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=s3.isMobile?s3.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:1650},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:9999}},i=V3(),a=i.updateTime,c=i.getStart,u=i.getEnd,e.prev=8,l=s||o,a(performance.now(),"start"),F3(s3.isMobile)&&r&&(l={}),n&&(l={}),nK.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),e.next=16,Y3.getUserMedia({audio:!1,video:Ny(Ny({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)});case 16:return d=e.sent,e.next=19,P();case 19:if(R(),d){e.next=24;break}return k(z3.not_supported.msg[g]),T(z3.not_supported),e.abrupt("return",null);case 24:a(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{f=d.getVideoTracks()[0].getSettings(),nK.addExifData("device_info.camera_label_dimension.got","".concat(f.width,"x").concat(f.height))}catch(e){}return e.abrupt("return",d);case 31:e.prev=31,e.t0=e.catch(8),a(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k(z3.no_permission.msg[g]),T(z3.no_permission),B.current=!0,v({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):B.current&&("NotReadableError"===e.t0.name?(T(z3.not_readable),k(z3.not_readable.msg[g])):(k(e.t0.message),T({code:e.t0.name||e.t0.code,message:e.t0.message})));case 35:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 37:case"end":return e.stop()}}),e,null,[[8,31]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,T,h,R,v]),N=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,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!=(a=c.current)&&null!==(t=a.srcObject)&&void 0!==t&&t.id&&null!=a&&null!==(r=a.srcObject)&&void 0!==r&&r.active&&C.current)){e.next=5;break}return e.abrupt("return");case 5:return a.oncanplaythrough=function(){var e,t,r;a.play(),nK.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=SV.analyzeVideoAndWindowSizes(a),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));i&&i({clientWidth:n,clientHeight:o,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,O(n,o);case 8:s=e.sent,u=j3(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&&N(f[0].deviceId)),s||B.current||(nK.addExifData("device_info.camera_label_retry","yes"),B.current=!0,N(n,!0)),s&&S.current&&(c.current.srcObject=s,A()),!s||S.current||d||(a.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,O,i,p,A]);_w.useEffect((function(){function e(){return(e=xy(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,N();case 2:return e.next=4,R3();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(),N(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return!Y3||s3.browserName&&["facebook"].includes(s3.browserName.toLowerCase())||s3.getUA.includes("Zalo iOS")?(k(z3.not_supported.msg[g]),T(z3.not_supported)):t&&(s3.isAndroid&&!1===r?function(){e.apply(this,arguments)}():N()),function(){S.current&&A()}}),[c,g,r,N,A,T]);var D=_w.useCallback((function(){A(),n&&n(),v({tag:"result",event:"user_activity.cancel",log:{}})}),[n,A,v]);return _w.createElement(H3,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!w)return null;var e=z3.no_permission.msg[g];return w===e&&s3.isIOS?_w.createElement(Q3,null,w," ",_w.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):_w.createElement(Q3,null,w)}(),_w.createElement(K3,{ref:c,playsInline:!0,muted:!0,flipHorizontal:a,className:d,scale:f}),o,l?_w.cloneElement(l,{onClick:D,"data-testid":"close-camera"}):_w.createElement(G3,{onClick:D,"data-testid":"close-camera"},_w.createElement("img",{src:y,alt:""})))}$3.propTypes={checkCameraMode:_k.bool,frontCamera:_k.bool,onClose:_k.func,onError:_k.func,onVideoPlayed:_k.func,children:_k.node,flipHorizontal:_k.bool,videoSettings:_k.object,refVideo:_k.object,closeButton:_k.node,videoClassName:_k.string,scale:_k.number,defaultCameraId:_k.string,onWarning:_k.func},$3.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 Z3,J3,e0,t0=P3($3,250),r0=_w.forwardRef((function(e,t){return _w.createElement(t0,Ry({},e,{refVideo:t||X3}))})),n0=lE.table(Z3||(Z3=Ky(["\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"]))),o0=lE.div(J3||(J3=Ky(["\n position: relative;\n"]))),i0=Array.from(Array(3).keys()),a0=Array.from(Array(3).keys());function s0(e){var t=e.children,r=e.x,n=e.y,o=e.width,i=e.height,a=e.className,s=e.surroundStyle;return _w.createElement(n0,{className:a},_w.createElement("tbody",null,i0.map((function(e,a){return _w.createElement("tr",{key:e,style:{height:0===a?n:"auto"},"data-testid":"row"},a0.map((function(e,n){var c=1===a&&1===n,u="auto";return c?u=o:0===n&&(u=r),_w.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:Ny({width:u,height:c?i:"auto"},c?{}:s)},c?_w.createElement(o0,{style:{width:u,height:i}},t):null)})))}))))}s0.propTypes={children:_k.node,x:_k.string,y:_k.string,width:_k.string,height:_k.string,className:_k.string,surroundStyle:_k.object},s0.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var c0=lE(s0)(e0||(e0=Ky(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: ",";\n"])),q3+10);function u0(e){var t=e.className;return _w.createElement("svg",{className:t,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},_w.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),_w.createElement("desc",null,"Created with sketchtool."),_w.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},_w.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},_w.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},_w.createElement("g",{id:"Group-2"},_w.createElement("g",{id:"camera"},_w.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"})))))))}function l0(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}u0.propTypes={className:_k.string},u0.defaultProps={className:""};var d0=l0,f0="object"==typeof r&&r&&r.Object===Object&&r,p0=f0,h0="object"==typeof self&&self&&self.Object===Object&&self,m0=p0||h0||Function("return this")(),g0=m0,v0=function(){return g0.Date.now()},y0=v0,b0=/\s/;function w0(e){for(var t=e.length;t--&&b0.test(e.charAt(t)););return t}var k0=w0,C0=/^\s+/;function B0(e){return e?e.slice(0,k0(e)+1).replace(C0,""):e}var S0=B0,E0=g0.Symbol,_0=E0,x0=Object.prototype,T0=x0.hasOwnProperty,A0=x0.toString,P0=_0?_0.toStringTag:void 0;function I0(e){var t=T0.call(e,P0),r=e[P0];try{e[P0]=void 0;var n=!0}catch(e){}var o=A0.call(e);return n&&(t?e[P0]=r:delete e[P0]),o}var R0=I0,O0=Object.prototype,N0=O0.toString;function D0(e){return N0.call(e)}var M0=D0,L0="[object Null]",U0="[object Undefined]",j0=_0?_0.toStringTag:void 0;function F0(e){return null==e?void 0===e?U0:L0:j0&&j0 in Object(e)?R0(e):M0(e)}var V0=F0;function z0(e){return null!=e&&"object"==typeof e}var q0=z0,H0="[object Symbol]";function K0(e){return"symbol"==typeof e||q0(e)&&V0(e)==H0}var W0=K0,G0=NaN,Q0=/^[-+]0x[0-9a-f]+$/i,X0=/^0b[01]+$/i,Y0=/^0o[0-7]+$/i,$0=parseInt;function Z0(e){if("number"==typeof e)return e;if(W0(e))return G0;if(d0(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=d0(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=S0(e);var r=X0.test(e);return r||Y0.test(e)?$0(e.slice(2),r?2:8):Q0.test(e)?G0:+e}var J0=Z0,e2="Expected a function",t2=Math.max,r2=Math.min;function n2(e,t,r){var n,o,i,a,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(e2);function p(t){var r=n,i=o;return n=o=void 0,u=t,a=e.apply(i,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):a}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=i}function g(){var e=y0();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?r2(r,i-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,a)}function y(){var e=y0(),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)),a}return t=J0(t)||0,d0(r)&&(l=!!r.leading,i=(d="maxWait"in r)?t2(J0(r.maxWait)||0,t):i,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?a:v(y0())},y}var o2=n2,i2="Expected a function";function a2(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError(i2);return d0(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),o2(e,t,{leading:n,maxWait:t,trailing:o})}var s2=a2,c2="[object AsyncFunction]",u2="[object Function]",l2="[object GeneratorFunction]",d2="[object Proxy]";function f2(e){if(!d0(e))return!1;var t=V0(e);return t==u2||t==l2||t==c2||t==d2}var p2=f2,h2=g0["__core-js_shared__"],m2=h2,g2=function(){var e=/[^.]+$/.exec(m2&&m2.keys&&m2.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function v2(e){return!!g2&&g2 in e}var y2=v2,b2=Function.prototype,w2=b2.toString;function k2(e){if(null!=e){try{return w2.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var C2=k2,B2=/[\\^$.*+?()[\]{}|]/g,S2=/^\[object .+?Constructor\]$/,E2=Function.prototype,_2=Object.prototype,x2=E2.toString,T2=_2.hasOwnProperty,A2=RegExp("^"+x2.call(T2).replace(B2,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function P2(e){return!(!d0(e)||y2(e))&&(p2(e)?A2:S2).test(C2(e))}var I2=P2;function R2(e,t){return null==e?void 0:e[t]}var O2=R2;function N2(e,t){var r=O2(e,t);return I2(r)?r:void 0}var D2=N2,M2=function(){try{var e=D2(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),L2=M2;function U2(e,t,r){"__proto__"==t&&L2?L2(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var j2=U2;function F2(e,t){return e===t||e!=e&&t!=t}var V2=F2,z2=Object.prototype,q2=z2.hasOwnProperty;function H2(e,t,r){var n=e[t];q2.call(e,t)&&V2(n,r)&&(void 0!==r||t in e)||j2(e,t,r)}var K2=H2;function W2(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var s=t[i],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?j2(r,s,c):K2(r,s,c)}return r}var G2=W2;function Q2(e){return e}var X2=Q2;function Y2(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)}var $2=Y2,Z2=Math.max;function J2(e,t,r){return t=Z2(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=Z2(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),$2(e,this,s)}}var e1=J2;function t1(e){return function(){return e}}var r1=t1,n1=L2?function(e,t){return L2(e,"toString",{configurable:!0,enumerable:!1,value:r1(t),writable:!0})}:X2,o1=n1,i1=800,a1=16,s1=Date.now;function c1(e){var t=0,r=0;return function(){var n=s1(),o=a1-(n-r);if(r=n,o>0){if(++t>=i1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var u1=c1,l1=u1(o1),d1=l1;function f1(e,t){return d1(e1(e,t,X2),e+"")}var p1=f1,h1=9007199254740991;function m1(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h1}var g1=m1;function v1(e){return null!=e&&g1(e.length)&&!p2(e)}var y1=v1,b1=9007199254740991,w1=/^(?:0|[1-9]\d*)$/;function k1(e,t){var r=typeof e;return!!(t=null==t?b1:t)&&("number"==r||"symbol"!=r&&w1.test(e))&&e>-1&&e%1==0&&e<t}var C1=k1;function B1(e,t,r){if(!d0(r))return!1;var n=typeof t;return!!("number"==n?y1(r)&&C1(t,r.length):"string"==n&&t in r)&&V2(r[t],e)}var S1=B1;function E1(e){return p1((function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&S1(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t}))}var _1=E1;function x1(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var T1=x1,A1="[object Arguments]";function P1(e){return q0(e)&&V0(e)==A1}var I1=P1,R1=Object.prototype,O1=R1.hasOwnProperty,N1=R1.propertyIsEnumerable,D1=I1(function(){return arguments}())?I1:function(e){return q0(e)&&O1.call(e,"callee")&&!N1.call(e,"callee")},M1=D1,L1=Array.isArray,U1=L1;function j1(){return!1}var F1=j1,V1=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?g0.Buffer:void 0,i=(o?o.isBuffer:void 0)||F1;e.exports=i})),z1="[object Arguments]",q1="[object Array]",H1="[object Boolean]",K1="[object Date]",W1="[object Error]",G1="[object Function]",Q1="[object Map]",X1="[object Number]",Y1="[object Object]",$1="[object RegExp]",Z1="[object Set]",J1="[object String]",e5="[object WeakMap]",t5="[object ArrayBuffer]",r5="[object DataView]",n5="[object Float32Array]",o5="[object Float64Array]",i5="[object Int8Array]",a5="[object Int16Array]",s5="[object Int32Array]",c5="[object Uint8Array]",u5="[object Uint8ClampedArray]",l5="[object Uint16Array]",d5="[object Uint32Array]",f5={};function p5(e){return q0(e)&&g1(e.length)&&!!f5[V0(e)]}f5[n5]=f5[o5]=f5[i5]=f5[a5]=f5[s5]=f5[c5]=f5[u5]=f5[l5]=f5[d5]=!0,f5[z1]=f5[q1]=f5[t5]=f5[H1]=f5[r5]=f5[K1]=f5[W1]=f5[G1]=f5[Q1]=f5[X1]=f5[Y1]=f5[$1]=f5[Z1]=f5[J1]=f5[e5]=!1;var h5=p5;function m5(e){return function(t){return e(t)}}var g5=m5,v5=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&p0.process,i=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i})),y5=v5&&v5.isTypedArray,b5=y5?g5(y5):h5,w5=b5,k5=Object.prototype,C5=k5.hasOwnProperty;function B5(e,t){var r=U1(e),n=!r&&M1(e),o=!r&&!n&&V1(e),i=!r&&!n&&!o&&w5(e),a=r||n||o||i,s=a?T1(e.length,String):[],c=s.length;for(var u in e)!t&&!C5.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||C1(u,c))||s.push(u);return s}var S5=B5,E5=Object.prototype;function _5(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||E5)}var x5=_5;function T5(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}var A5=T5,P5=Object.prototype,I5=P5.hasOwnProperty;function R5(e){if(!d0(e))return A5(e);var t=x5(e),r=[];for(var n in e)("constructor"!=n||!t&&I5.call(e,n))&&r.push(n);return r}var O5=R5;function N5(e){return y1(e)?S5(e,!0):O5(e)}var D5=N5,M5=_1((function(e,t,r,n){G2(t,D5(t),e,n)})),L5=M5;function U5(e,t){return function(r){return e(t(r))}}var j5=U5,F5=j5(Object.getPrototypeOf,Object),V5=F5,z5="[object Object]",q5=Function.prototype,H5=Object.prototype,K5=q5.toString,W5=H5.hasOwnProperty,G5=K5.call(Object);function Q5(e){if(!q0(e)||V0(e)!=z5)return!1;var t=V5(e);if(null===t)return!0;var r=W5.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&K5.call(r)==G5}var X5=Q5,Y5="[object DOMException]",$5="[object Error]";function Z5(e){if(!q0(e))return!1;var t=V0(e);return t==$5||t==Y5||"string"==typeof e.message&&"string"==typeof e.name&&!X5(e)}var J5=Z5,e4=p1((function(e,t){try{return $2(e,void 0,t)}catch(e){return J5(e)?e:new Error(e)}})),t4=e4;function r4(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 n4=r4;function o4(e,t){return n4(t,(function(t){return e[t]}))}var i4=o4,a4=Object.prototype,s4=a4.hasOwnProperty;function c4(e,t,r,n){return void 0===e||V2(e,a4[r])&&!s4.call(n,r)?t:e}var u4=c4,l4={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function d4(e){return"\\"+l4[e]}var f4=d4,p4=j5(Object.keys,Object),h4=p4,m4=Object.prototype,g4=m4.hasOwnProperty;function v4(e){if(!x5(e))return h4(e);var t=[];for(var r in Object(e))g4.call(e,r)&&"constructor"!=r&&t.push(r);return t}var y4=v4;function b4(e){return y1(e)?S5(e):y4(e)}var w4=b4,k4=/<%=([\s\S]+?)%>/g,C4=k4;function B4(e){return function(t){return null==e?void 0:e[t]}}var S4=B4,E4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_4=S4(E4),x4=_4,T4=1/0,A4=_0?_0.prototype:void 0,P4=A4?A4.toString:void 0;function I4(e){if("string"==typeof e)return e;if(U1(e))return n4(e,I4)+"";if(W0(e))return P4?P4.call(e):"";var t=e+"";return"0"==t&&1/e==-T4?"-0":t}var R4=I4;function O4(e){return null==e?"":R4(e)}var N4=O4,D4=/[&<>"']/g,M4=RegExp(D4.source);function L4(e){return(e=N4(e))&&M4.test(e)?e.replace(D4,x4):e}var U4=L4,j4=/<%-([\s\S]+?)%>/g,F4=j4,V4=/<%([\s\S]+?)%>/g,z4=V4,q4={escape:F4,evaluate:z4,interpolate:C4,variable:"",imports:{_:{escape:U4}}},H4=q4,K4="Invalid `variable` option passed into `_.template`",W4=/\b__p \+= '';/g,G4=/\b(__p \+=) '' \+/g,Q4=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X4=/[()=,{}\[\]\/\s]/,Y4=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$4=/($^)/,Z4=/['\n\r\u2028\u2029\\]/g,J4=Object.prototype,e8=J4.hasOwnProperty;function t8(e,t,r){var n=H4.imports._.templateSettings||H4;r&&S1(e,t,r)&&(t=void 0),e=N4(e),t=L5({},t,n,u4);var o,i,a=L5({},t.imports,n.imports,u4),s=w4(a),c=i4(a,s),u=0,l=t.interpolate||$4,d="__p += '",f=RegExp((t.escape||$4).source+"|"+l.source+"|"+(l===C4?Y4:$4).source+"|"+(t.evaluate||$4).source+"|$","g"),p=e8.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,a,s,c){return n||(n=a),d+=e.slice(u,c).replace(Z4,f4),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var h=e8.call(t,"variable")&&t.variable;if(h){if(X4.test(h))throw new Error(K4)}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(W4,""):d).replace(G4,"$1").replace(Q4,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=t4((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(m.source=d,J5(m))throw m;return m}var r8=t8,n8=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o8=/^\w*$/;function i8(e,t){if(U1(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!W0(e))||(o8.test(e)||!n8.test(e)||null!=t&&e in Object(t))}var a8=i8,s8=D2(Object,"create"),c8=s8;function u8(){this.__data__=c8?c8(null):{},this.size=0}var l8=u8;function d8(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var f8=d8,p8="__lodash_hash_undefined__",h8=Object.prototype,m8=h8.hasOwnProperty;function g8(e){var t=this.__data__;if(c8){var r=t[e];return r===p8?void 0:r}return m8.call(t,e)?t[e]:void 0}var v8=g8,y8=Object.prototype,b8=y8.hasOwnProperty;function w8(e){var t=this.__data__;return c8?void 0!==t[e]:b8.call(t,e)}var k8=w8,C8="__lodash_hash_undefined__";function B8(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=c8&&void 0===t?C8:t,this}var S8=B8;function E8(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])}}E8.prototype.clear=l8,E8.prototype.delete=f8,E8.prototype.get=v8,E8.prototype.has=k8,E8.prototype.set=S8;var _8=E8;function x8(){this.__data__=[],this.size=0}var T8=x8;function A8(e,t){for(var r=e.length;r--;)if(V2(e[r][0],t))return r;return-1}var P8=A8,I8=Array.prototype,R8=I8.splice;function O8(e){var t=this.__data__,r=P8(t,e);return!(r<0)&&(r==t.length-1?t.pop():R8.call(t,r,1),--this.size,!0)}var N8=O8;function D8(e){var t=this.__data__,r=P8(t,e);return r<0?void 0:t[r][1]}var M8=D8;function L8(e){return P8(this.__data__,e)>-1}var U8=L8;function j8(e,t){var r=this.__data__,n=P8(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var F8=j8;function V8(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])}}V8.prototype.clear=T8,V8.prototype.delete=N8,V8.prototype.get=M8,V8.prototype.has=U8,V8.prototype.set=F8;var z8=V8,q8=D2(g0,"Map"),H8=q8;function K8(){this.size=0,this.__data__={hash:new _8,map:new(H8||z8),string:new _8}}var W8=K8;function G8(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var Q8=G8;function X8(e,t){var r=e.__data__;return Q8(t)?r["string"==typeof t?"string":"hash"]:r.map}var Y8=X8;function $8(e){var t=Y8(this,e).delete(e);return this.size-=t?1:0,t}var Z8=$8;function J8(e){return Y8(this,e).get(e)}var e6=J8;function t6(e){return Y8(this,e).has(e)}var r6=t6;function n6(e,t){var r=Y8(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var o6=n6;function i6(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])}}i6.prototype.clear=W8,i6.prototype.delete=Z8,i6.prototype.get=e6,i6.prototype.has=r6,i6.prototype.set=o6;var a6=i6,s6="Expected a function";function c6(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s6);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(c6.Cache||a6),r}c6.Cache=a6;var u6=c6,l6=500;function d6(e){var t=u6(e,(function(e){return r.size===l6&&r.clear(),e})),r=t.cache;return t}var f6=d6,p6=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h6=/\\(\\)?/g,m6=f6((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(p6,(function(e,r,n,o){t.push(n?o.replace(h6,"$1"):r||e)})),t})),g6=m6;function v6(e,t){return U1(e)?e:a8(e,t)?[e]:g6(N4(e))}var y6=v6,b6=1/0;function w6(e){if("string"==typeof e||W0(e))return e;var t=e+"";return"0"==t&&1/e==-b6?"-0":t}var k6=w6;function C6(e,t){for(var r=0,n=(t=y6(t,e)).length;null!=e&&r<n;)e=e[k6(t[r++])];return r&&r==n?e:void 0}var B6=C6;function S6(e,t,r){var n=null==e?void 0:B6(e,t);return void 0===n?r:n}var E6=S6,_6=sM.Errors;function x6(e){var t=e.livenessSettings,r=e.apiClient,n=e.apiCheck,o=e.onError,i=Wy(_w.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,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}}),2),a=i[0],s=i[1];return _w.useEffect((function(){t&&Object.keys(t).length>0?s((function(e){return Ny(Ny({},e),t)})):n&&r.clientSettings().then((function(e){if(e&&e.data){var t,r=E6(e,"data.settings.sdk_settings.active_liveness_settings"),n=E6(e,"data.settings.sdk_settings.liveness_settings"),i=E6(r,"save_encoded_frames",{});i.enable&&(t={enable:!0,framesIntervalTime:i.frames_interval_ms,framesBatchLength:i.frames_batch_len});var a=E6(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});s(Ny(Ny(Ny({},r),n),{},{captureFrameSettings:t,exif_data_settings:a}))}e&&e.errors&&o(_6.server_error)})).catch((function(e){o(e)}))}),[t,r,o,n]),a}var T6=function(e){var t=e.curStep,r=e.faceDirection,n=E6(t,"stepTimeConstraints.delayTime");return!!n&&(null===t.firstFrameSpottedAt?(t.name===r&&(t.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-t.firstFrameSpottedAt<n)},A6=1/0,P6=17976931348623157e292;function I6(e){return e?(e=J0(e))===A6||e===-A6?(e<0?-1:1)*P6:e==e?e:0:0===e?e:0}var R6=I6;function O6(e){var t=R6(e),r=t%1;return t==t?r?t-r:t:0}var N6=O6,D6="Expected a function";function M6(e,t){var r;if("function"!=typeof t)throw new TypeError(D6);return e=N6(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var L6=M6;function U6(e){return L6(2,e)}var j6=U6,F6=function(){var e=xy(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?oK:r,e.next=3,Nq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function V6(){return z6.apply(this,arguments)}function z6(){return(z6=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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,i=new iK(o),e.next=4,Nq.loadTensorFlow(n);case 4:return e.next=6,Nq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return a=[Nq.loadBlazefaceModel({modelUrl:r}),i.load()],e.next=9,Promise.all(a);case 9:return s=e.sent,c=Wy(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:i});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var q6,H6,K6,W6,G6,Q6,X6,Y6,$6=j6(V6),Z6=[],J6=function(){Z6=[]},e9=function(e,t,r){r&&J6(),Z6.push({id:null});var n=Z6.length-1;t.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?Z6[n].id=e.data.file_id:Z6[n].id=-1}))},t9=function(){return new Promise((function(e){var t=setInterval((function(){Z6.every((function(e){return e.id}))&&(e(),clearInterval(t))}),200)}))},r9=function(e){return e.enable?Z6.some((function(e){return-1===e.id}))?null:Z6:[]},n9=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.steps,n=t.apiClient,o=t.FaceDirection,i=t.outputEncryptionSettings,a=[],r.forEach((function(e){var t=e.name,r=e.image,s=e.frontalFaceImage;if(t!==o.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:r.leftRightScore,gesture:t})};i&&i.key?a.push(n.httpClient.post("/v1/images",Ny({base64:r.encrypted.hex},c),{"X-TV-Key":i.key})):a.push(n.uploadImage(Ny({file:r.blob},c)))}else a.push(Promise.resolve({data:{image_id:null}}));if(s.blob){var u={label:"portrait",metadata:JSON.stringify({gesture_score:s.leftRightScore,gesture:o.FRONTAL})};i&&i.key?a.push(n.httpClient.post("/v1/images",Ny({base64:s.encrypted.hex},u),{"X-TV-Key":i.key})):a.push(n.uploadImage(Ny({file:s.blob},u)))}else a.push(Promise.resolve({data:{image_id:null}}))})),e.next=5,Promise.all(a);case 5:s=e.sent,r.forEach((function(e,t){e.image.imageId=s[2*t].data.image_id,e.frontalFaceImage.imageId=s[2*t+1].data.image_id}));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o9=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,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.apiClient,n=t.faceVerificationFlowData,o=t.onLivenessDetectionDone,i=t.captureFrameSettings,a=t.FaceDirection,s=t.onError,c=t.outputEncryptionSettings,e.prev=1,u=n.current.steps,e.next=5,n9({steps:u,apiClient:r,FaceDirection:a,outputEncryptionSettings:c});case 5:if(0!==(l=u.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,t9();case 12:if(d=r9(i)){e.next=17;break}o({error:"network_error"}),e.next=27;break;case 17:return f=r.verifyFaceLiveness({images:l.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:u.filter((function(e){return e.image.imageId&&e.name!==a.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:d}),p=r.requestVerifyPortrait({image:{id:l[l.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([f,p]);case 21:h=e.sent,m=Wy(h,2),g=m[0],v=m[1],y=!0===g.data.is_live,o({apiCheckPassed:y,verifyFaceLivenessResult:g.data,verifyFacePortraitResult:v.data,frontalFaces:l.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:u.filter((function(e){return e.image.imageId&&e.name!==a.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)}}(),i9=jV.faceTracker(),a9=new jq,s9=sM.Mode,c9=sM.FaceDirection,u9=sM.Errors,l9=sM.Messages,d9=sM.TrackLivenessEvents,f9=-1,p9=3,h9=3,m9={customStepTimeConstraints:(q6={},Iy(q6,sM.FaceDirection.UP,{delayTime:0}),Iy(q6,sM.FaceDirection.LEFT,{delayTime:0}),Iy(q6,sM.FaceDirection.RIGHT,{delayTime:0}),Iy(q6,sM.FaceDirection.FRONTAL,{delayTime:2e3}),q6),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}};function g9(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,r=e.mode,n=e.bgCameraMask,o=e.bgCameraMaskRed,i=e.surroundStyle,a=e.cropAreaDimension,s=e.customInstructions,c=e.customIcon,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=void 0===l?m9.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?{enable:!1,framesIntervalTime:180,framesBatchLength:0}:v,b=e.livenessSettings,w=e.setRemainingTime,k=void 0===w?m9.setRemainingTime:w,C=e.onProcessing,B=void 0===C?m9.onProcessing:C,S=e.customErrors,E=e.customMessages,_=e.apiCredentials,x=void 0===_?{}:_,T=e.onFramesCaptured,A=void 0===T?m9.onFramesCaptured:T,P=e.initFirstGestureTimeout,I=void 0===P?2e3:P,R=e.outputEncryptionSettings,O=e.cameraScale,N=void 0===O?1:O,D=e.passiveModeAuto,M=void 0!==D&&D,L=e.sendCustomEvent,U=_w.useState(!1),j=Wy(U,2),F=j[0],V=j[1],z=_w.useState(!1),q=Wy(z,2),H=q[0],K=q[1],W=_w.useState(!1),G=Wy(W,2),Q=G[0],X=G[1],Y=_w.useRef(null),$=mF.useSDKSettings(),Z=$.lang,J=$.assetRoot,ee=$.customUrls,te=iq.useApiClient({apiCredentials:x}),re=te.apiClient,ne=r===s9.ACTIVE,oe=_w.useReducer((function(e){return e+1}),0),ie=Wy(oe,2),ae=(ie[0],ie[1]),se=_w.useRef(null),ce=_w.useRef(!1),ue=_w.useState(!1),le=Wy(ue,2),de=le[0],fe=le[1],pe=_w.useRef({}),he=GF.useSDKTracking(),me=he.sendEvent,ge=sK(),ve=ge.startMotion,ye=ge.stopMotion,be=ge.motionData,we=ge.orientationData,ke=_w.useRef(null);null===ke.current&&(ke.current=jV.initFaceVerificationData({assetRoot:J,customInstructions:s,customIcon:c,customDirectionIcon:u,customStepTimeConstraints:d}));var Ce=_w.useState(),Be=Wy(Ce,2),Se=Be[0],Ee=Be[1],_e=_w.useCallback((function(e){Ee(e)}),[]),xe=_w.useMemo((function(){return s2(_e,500)}),[_e]),Te=_w.useRef([]),Ae=_w.useRef(),Pe=x6({livenessSettings:b,apiClient:re,apiCheck:t,onError:p}),Ie=Pe.face_tracking_setting,Re=Pe.flow_interval_time_ms,Oe=Pe.limit_time_liveness_check,Ne=Pe.terminate_if_no_face,De=Pe.close_eye_detector,Me=void 0===De?{}:De,Le=Pe.captureFrameSettings,Ue=void 0===Le?y:Le,je=Pe.exif_data_settings,Fe=_w.useRef(""),Ve=_w.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==d9?void 0:d9.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===Fe.current)return;Fe.current=r}me(e),L&&L(e)}}),[L,me]),ze=_w.useMemo((function(){return s2((function(e){Ve(e)}),2e3)}),[Ve]),qe=_w.useRef(0),He=_w.useRef(),Ke=_w.useRef(!1);_w.useEffect((function(){return nK.initExifData(),Ve({tag:"selfie",event:null==d9?void 0:d9.start_camera,log:{}}),a9.start(),function(){Ke.current=!0,a9.stop()}}),[Ve]),_w.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(de){e.next=13;break}return Ae.current=performance.now(),e.next=4,$6(ee);case 4:return pe.current=e.sent,e.next=7,Nq.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!Ke.current){e.next=9;break}return e.abrupt("return");case 9:fe(!0),Ve({tag:"selfie",event:null==d9?void 0:d9.show_warmup,log:{}}),Ve({tag:"selfie",event:null==d9?void 0:d9.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Ae.current}}),Ae.current=null;case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[de,ee,Ve]);var We=_w.useCallback((function(){k(""),ke.current.curStepIndex=ke.current.steps.length,K(!1),a9.stop(),setTimeout((function(){ke.current=jV.initFaceVerificationData({assetRoot:J,customInstructions:s,customIcon:c,customDirectionIcon:u}),a9.start(),qe.current=0,He.current=null,Te.current=[],X(!1),J6(),ae()}),Re)}),[J,s,c,u,Re,k]),Ge=_w.useMemo((function(){return Ny(Ny({},u9),S)}),[S]),Qe=_w.useMemo((function(){return Ny(Ny({},l9),E)}),[E]),Xe=400;_w.useEffect((function(){if(F&&Oe.enable&&Q){var e=Oe.limit_time_second+1,t=Oe.remain_time_show||10,r=Oe.format||"s";a9.start("limit",(function(n){var o=e-n;if(ke.current.curStepIndex<ke.current.steps.length){if(o<=t&&o>=1){var i=r8(Qe.REMAIN_TIME[Z]),a=o;switch(r){case"mm:ss":a=o.toString().padStart(5,"00:00");break;case"ss":a=o.toString().padStart(2,"0")}k(i({x:a}))}if(0===o){var s,c={};Object.keys(null===(s=Ge.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=r8(null===(t=Ge.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:Oe.limit_time_second})})),Ee(Ny(Ny({},Ge.liveness_terminated_time_out),{},{msg:c,duration:Re})),Ve({tag:"selfie",event:null==d9?void 0:d9.show_alert,log:{alert:"liveness_terminated_time_out,"}}),We()}}}))}}),[We,k,F,Z,Re,Oe.enable,Oe.limit_time_second,Q,Ge.liveness_terminated_time_out,Qe.REMAIN_TIME,Oe.format,Oe.remain_time_show,Ve]);var Ye=_w.useCallback((function(e){var t,r,o=e.clientWidth,s=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;s3.isMobile?r=t=c:t=r=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=n;se.current={x:f,y:p,width:t,height:r,image:h,surroundStyle:i},"object"===Ey(a)?se.current=Ny(Ny({},se.current),a):"function"==typeof a&&(se.current=Ny(Ny({},se.current),a({clientWidth:o,clientHeight:s,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:s3.isMobile,width:t,height:r}))),ae(),V(!0)}),[n,i,a]),$e=_w.useState(p9),Ze=Wy($e,2),Je=Ze[0],et=Ze[1],tt=_w.useState(!1),rt=Wy(tt,2),nt=rt[0],ot=rt[1],it=_w.useRef(!1),at=_w.useCallback((function(e){ot(e),it.current=e}),[]),st=_w.useRef(null),ct=_w.useRef([]),ut=_w.useCallback((function(){et(p9),clearInterval(st.current),at(!0);var e=function(){var e=xy(regeneratorRuntime.mark((function e(r){var n,o,i,a,s,c,u,l,d,h,m,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r-1!=0){e.next=23;break}return clearInterval(st.current),n=ct.current,B(),ye(),nK.preWriteExif({mode:nK.MODE.SELFIE,motionData:be,orientationData:we,startTime:Date.now()-1e3*a9.duration("from_1st_frame"),endTime:Date.now()}),o=n.map((function(e){return Wz.resizeBlobImg(e.blob,Xe,Xe)})),e.next=9,Promise.all(o);case 9:return i=e.sent,a=i.map((function(e,t){return nK.writeExif({mode:nK.MODE.SELFIE,imageData:Ny(Ny({},n[t]),{},{blob:e,gesture:"frontal"}),enableExifData:je.enable})})),e.next=13,Promise.all(a);case 13:if(s=e.sent,c={},!R||!R.key){e.next=22;break}return u=R.key,l=s.map((function(e){return Uq.encrypt({blob:e,key:u})})),e.next=20,Promise.all(l);case 20:d=e.sent,c={frontalFacesEncrypted:d};case 22:t?(h=Gy(Te.current),m=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:c9.FRONTAL})}},g=n.map((function(e,t){return re.uploadImage(Ny({file:s[t]},m(e.leftRightScore)))})),R&&R.key&&(g=n.map((function(e,t){return re.httpClient.post("/v1/images",Ny({base64:c.frontalFacesEncrypted[t].hex},m(e.leftRightScore)),{"X-TV-Key":R.key})}))),Promise.all(g).then((function(e){return re.verifyFaceLiveness({images:e.map((function(e){return{id:e.data.image_id}})),videos:[{frames:h}]})})).then((function(e){f({apiCheckPassed:e.data.is_live,verifyFaceLivenessResult:e.data})})).catch((function(e){p({error:e})}))):f(Ny(Ny({frontalFaces:s},c),{},{capturedFrames:Te.current}));case 23:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();st.current=setInterval((function(){et((function(t){return e(t),t-1}))}),1e3)}),[at,t,f,re,p,B,R,ye,be,we,je.enable]),lt=_w.useRef({});_w.useEffect((function(){lt.current.isFirstValidFrameFoundRef=Q}),[Q]),_w.useEffect((function(){var e,r=Y.current,i=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ke.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:c9.FRONTAL}),0})),n=r.map((function(e){return Wz.resizeBlobImg(e.blob,Xe,Xe)})),e.next=6,Promise.all(n);case 6:return o=e.sent,i=o.map((function(e,t){return nK.writeExif({mode:nK.MODE.SELFIE,imageData:Ny(Ny({},r[t]),{},{blob:e}),enableExifData:je.enable})})),e.next=10,Promise.all(i);case 10:return a=e.sent,s=r.map((function(e,t){return{name:e.name,blob:a[t]}})),e.next=14,Promise.all(t.map(function(){var e=xy(regeneratorRuntime.mark((function e(r,n){var o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=s.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 i=R.key,e.next=7,Uq.encrypt({blob:o[0].blob,key:i});case 7:if(t[n].image.encrypted=e.sent,!r.frontalFaceImage.blob){e.next=12;break}return e.next=11,Uq.encrypt({blob:o[1].blob,key:i});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 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=xy(regeneratorRuntime.mark((function e(){var r,n,o,a,s,c,u,l,d,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ke.current.steps,o=n[ke.current.curStepIndex],Iy(r={},sM.FaceDirection.UP,null==d9?void 0:d9.capture_up_face),Iy(r,sM.FaceDirection.LEFT,null==d9?void 0:d9.capture_left_face),Iy(r,sM.FaceDirection.RIGHT,null==d9?void 0:d9.capture_right_face),Iy(r,sM.FaceDirection.FRONTAL,null==d9?void 0:d9.capture_frontal_face),Ve({tag:"selfie",event:r[o.name],log:{time_capture_in_seconds:((performance.now()-Ae.current)/1e3).toFixed(1)}}),ke.current.curStepIndex++,Ae.current=performance.now(),Ie.enable&&"each_gesture"===Ie.limit_for&&(qe.current=0),ke.current.curStepIndex!==n.length){e.next=39;break}if(Oe.enable&&k(""),!f){e.next=39;break}return Ue.enable&&Ue.framesBatchLength>0&&Te.current.length%Ue.framesBatchLength>0&&(A(Te.current.slice(Te.current.length%Ue.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&e9(Te.current.slice(Te.current.length%Ue.framesBatchLength*-1),re)),Ve({tag:"selfie",event:null==d9?void 0:d9.finish_capture,log:{time_capture_in_seconds:a9.duration("from_1st_frame")}}),B(),ye(),nK.preWriteExif({mode:nK.MODE.SELFIE,motionData:be,orientationData:we,startTime:Date.now()-1e3*a9.duration("from_1st_frame"),endTime:Date.now()}),e.next=17,i();case 17:if(t){e.next=37;break}if(l=n.filter((function(e){return e.name!==c9.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),d=n.filter((function(e){return e.name!==c9.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),m=n.filter((function(e){return e.name!==c9.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),g=null===(a=n.find((function(e){return e.name===c9.FRONTAL})))||void 0===a||null===(s=a.image)||void 0===s?void 0:s.blob,v=null===(c=n.find((function(e){return e.name===c9.FRONTAL})))||void 0===c||null===(u=c.image)||void 0===u?void 0:u.encrypted,!g||!h){e.next=29;break}return e.next=26,Wz.scaleImage(g,{minSize:h});case 26:e.t0=e.sent,e.next=30;break;case 29:e.t0=null;case 30:y=e.t0,g&&d.push(g),v&&m.push(v),Ve({tag:"result",event:null==d9?void 0:d9.liveness_detection_done,log:{result_object:{steps:l,frontalFaces:d,frontalScaledImage:y}}}),f({steps:l,frontalFaces:d,frontalFacesEncrypted:m,frontalScaledImage:y,capturedFrames:Te.current}),e.next=39;break;case 37:return e.next=39,o9({apiClient:re,faceVerificationFlowData:ke,onLivenessDetectionDone:f,captureFrameSettings:Ue,FaceDirection:c9,onError:p,outputEncryptionSettings:R});case 39:ae();case 40:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=o2((function(){var e=ke.current,t=e.curStepIndex,r=e.steps,n=r[t],o=null!==(null==n?void 0:n.image.blob),i=null!==(null==n?void 0:n.frontalFaceImage.blob),s=r.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(i||![1].includes(t)||s>=1)?(ce.current=!1,a(),c=!0):ce.current=!(!o||i),K(!1),c}),g);function c(e){return u.apply(this,arguments)}function u(){return(u=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,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,i=t.leftRightScore,c=t.isEyeClose,u=ke.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!T6({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!==c9.FRONTAL||null!==f.frontalFaceImage.blurScore&&!CV.hasBetterBlurScore(o,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=o,e.next=12,SV.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=i,f.frontalFaceImage.captureTime=Date.now(),ce.current&&(ce.current=!1,a());case 17:if(f.name!==r||null!==f.image.blurScore&&!CV.hasBetterBlurScore(o,f.image.blurScore)){e.next=29;break}return K(!0),f.image.blurScore=o,e.next=22,SV.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=i,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=xy(regeneratorRuntime.mark((function e(t,r,n){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!0===it.current&&t===c9.FRONTAL&&ct.current.length<h9)){e.next=5;break}return e.next=3,SV.takePicture({canvas:r});case 3:o=e.sent,ct.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(Te.current.length&&Date.now()-Te.current[Te.current.length-1].time<Ue.framesIntervalTime)return null;if(Ue.enable&&!o){var i=e.topLeft,a=e.bottomRight,s=[].concat(Gy(i),Gy(a)),c=i9(e,0===Te.current.length),u=c.score,l=c.time,d=r.toDataURL("image/jpeg",.8);return Te.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:Te.current.length,bbox:s,original_bbox:s}),Ue.framesBatchLength>0&&Te.current.length%Ue.framesBatchLength==0&&A&&(A(Te.current.slice(-Ue.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&e9(Te.current.slice(-Ue.framesBatchLength),re,Te.current.length===Ue.framesBatchLength)),u}return null}function y(e){var t=e.trackingScore,r=e.isFirstValidFrameFoundRef;if(!Ie.enable||null===t||!r)return!0;var n=Ie.web_warning_threshold,o=Ie.web_terminate_threshold,i=Ie.max_warning_time;return t<n||(t<o&&qe.current<i?(qe.current++,qe.current===i?(Ee(Ny(Ny({},Ge.liveness_terminated_face_tracking),{},{duration:Re})),Ve({tag:"selfie",event:null==d9?void 0:d9.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):Ee(Ny(Ny({},Ge.liveness_too_fast),{},{duration:1500})),!0):(Ee(Ny(Ny({},Ge.liveness_terminated),{},{duration:Re})),Ve({tag:"selfie",event:null==d9?void 0:d9.show_alert,log:{alert:"liveness_terminated"}}),We(),!1))}function b(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(Ne.enable&&r){var n=Ne.max_time_ms;He.current&&t||(He.current={time:Date.now(),frame:0}),t&&He.current.frame++;var o=He.current.time;t&&Date.now()-o>=n&&(Ee(Ny(Ny({},Ge.liveness_terminated_no_face),{},{duration:Re})),Ve({tag:"selfie",event:null==d9?void 0:d9.show_alert,log:{alert:"liveness_terminated_no_face"}}),We())}}function w(e,t){return C.apply(this,arguments)}function C(){return(C=xy(regeneratorRuntime.mark((function t(i,a){var s,u,f,p,h,m,g,k,C,B,S,E,_,x,T,A,P,I,R,O,D,L,U,j,F,V,z,q,H,K,W,G,Q,Y,$;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==a?void 0:a.width)&&0!==(null==a?void 0:a.height)){t.next=2;break}return t.abrupt("return");case 2:return p=lt.current.isFirstValidFrameFoundRef,h=i.cropX,m=i.cropY,g=i.cropWidth,k=i.cropHeight,a.getContext("2d").drawImage(r,h,m,g,k,-(Xe*N-Xe)/2/N,-(Xe*N-Xe)/2/N,Xe,Xe),C=pe.current,B=C.blazefaceModel,S=C.closeEyesModel,t.next=9,CV.calculateBlurScore(a);case 9:return E=t.sent,t.next=12,VV.getModelPredictions({model:B,sCanvas:a});case 12:return _=t.sent,t.next=15,jV.validatePredictions({predictions:_,width:VV.SIZE,height:VV.SIZE});case 15:if(T=t.sent,A=T.error,P=T.fullFace,I=T.faceRatio,R=T.faceNotFrontalMinThreshold,x=A,se.current.image=n,D=null,L=null,U=null,j=null,F=ke.current,V=F.curStepIndex,z=F.steps,!P){t.next=44;break}return q=z[V],H=q&&q.name===c9.FRONTAL,U=P.landmarks,t.next=33,jV.calculateFaceDirection({landmarks:U,getPerfectFrontal:H});case 33:if((K=t.sent)&&(D=K.gesture,L=K.leftRightScore),W=(null==Me?void 0:Me.web_timeout)+d[sM.FaceDirection.FRONTAL].delayTime/1e3,!(H&&null!=Me&&Me.enable&&(-1===a9.duration("limit_close_eye")||a9.duration("limit_close_eye")<W))){t.next=44;break}return-1===a9.duration("limit_close_eye")&&a9.start("limit_close_eye"),t.next=40,S.predict(a,U,null==Me?void 0:Me.web_threshold);case 40:G=t.sent,Q=G.isEyeClose,(j=Q)&&!x&&(x=u9.close_eye);case 44:if(Y="no_face"===(null===(s=x)||void 0===s?void 0:s.code)||"partial_face"===(null===(u=x)||void 0===u?void 0:u.code),$=V<z.length,b({noFace:Y&&$,isFirstValidFrameFoundRef:p}),null!==(f=x)&&void 0!==f&&f.code&&ze({tag:"selfie",event:null==d9?void 0:d9.show_alert,log:{alert:x.code}}),x&&!("face_too_small"===x.code&&D!==c9.FRONTAL&&I>=R)){t.next=70;break}if(ne||v(_[0],a,U),!ne){t.next=58;break}if(p||(X(!0),Ae.current=performance.now(),a9.start("from_1st_frame")),!y({trackingScore:v(_[0],a,U,V>=z.length),isFirstValidFrameFoundRef:p})){t.next=56;break}return t.next=56,c({faceDirection:D,canvas:a,blurScore:E,leftRightScore:L,isEyeClose:j});case 56:t.next=68;break;case 58:if(D===c9.FRONTAL){t.next=63;break}O=Ge.not_frontal_face,se.current.image=o,t.next=68;break;case 63:if(x){t.next=68;break}return p||(X(!0),a9.start("from_1st_frame")),M&&!it.current&&0===ct.current.length&&setTimeout((function(){ut()}),500),t.next=68,l(D,a,L);case 68:t.next=71;break;case 70:V<z.length&&(O=Ge[x.code],se.current.image=o);case 71:xe(O),e!==f9&&(e=requestAnimationFrame((function(){return w(i,a)})));case 73:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function S(){return(S=xy(regeneratorRuntime.mark((function e(){var t,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=SV.analyzeVideoAndWindowSizes(r,se.current),(n=document.createElement("canvas")).width=Xe,n.height=Xe,(o=n.getContext("2d")).translate(Xe,0),o.scale(-1*N,1*N),w(t,n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return F&&de&&setTimeout((function(){!function(){S.apply(this,arguments)}()}),I),function(){Ke.current&&(cancelAnimationFrame(e),e=f9)}}),[I,F,Z,ne,re,t,n,o,f,p,h,g,Ue,B,Ie,Oe.enable,k,xe,d,Re,We,Ne,Ge,de,Ve,A,R,N,ut,M,Me.enable,Me.web_threshold,Me.web_timeout,be,we,ye,je.enable,ze]),_w.useEffect((function(){Se&&(clearInterval(st.current),at(!1),ct.current=[]),ve()}),[Se,at,ve]);var dt=ke.current,ft=dt.curStepIndex,pt=dt.steps,ht=_w.useMemo((function(){return pt.find((function(e){return e.name===sM.FaceDirection.FRONTAL}))}),[pt]),mt=ce.current?ht:pt[ft],gt=mt&&Q?mt.instructions[Z]:null,vt=mt&&Q?mt.directionIcon:"",yt=mt?mt.directionIconAnimation:"";return{countdownToTakePicture:Je,cropArea:se,curStepIndex:ft,directionIcon:vt,directionIconAnimation:yt,faceDetectionError:Se,handleTriggerPassiveMode:ut,handleVideoPlayed:Ye,instructions:gt,isActiveMode:ne,refVideo:Y,showCountdown:nt,steps:pt,videoPlayed:F,activeCapturing:H,isFirstValidFrameFound:Q,warmupDone:de,motionData:be,orientationData:we}}var v9=(Iy(H6={},sM.FaceDirection.LEFT,90),Iy(H6,sM.FaceDirection.RIGHT,270),Iy(H6,sM.FaceDirection.UP,180),Iy(H6,sM.FaceDirection.DOWN,0),H6),y9=pE(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),b9=lE.div(K6||(K6=Ky(["\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"])),v9[sM.FaceDirection.DOWN],v9[sM.FaceDirection.LEFT],v9[sM.FaceDirection.UP],v9[sM.FaceDirection.RIGHT]),w9=lE.div(W6||(W6=Ky(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var t,r=e.direction;return null!==(t=v9[r])&&void 0!==t?t:0})),k9=lE.span(G6||(G6=Ky(["\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"])),y9),C9=lE(k9)(Q6||(Q6=Ky(["\n animation-delay: 0s;\n"]))),B9=lE(k9)(X6||(X6=Ky(["\n animation-delay: 0.5s;\n"]))),S9=lE(k9)(Y6||(Y6=Ky(["\n animation-delay: 1s;\n"])));function E9(e){var t=e.type;return t!==sM.FaceDirection.FRONTAL?_w.createElement(w9,{direction:t},_w.createElement(C9,null),_w.createElement(B9,null),_w.createElement(S9,null)):_w.createElement(b9,null,_w.createElement(w9,{className:"top"},_w.createElement(C9,null),_w.createElement(B9,null),_w.createElement(S9,null)),_w.createElement(w9,{className:"right"},_w.createElement(C9,null),_w.createElement(B9,null),_w.createElement(S9,null)),_w.createElement(w9,{className:"bottom"},_w.createElement(C9,null),_w.createElement(B9,null),_w.createElement(S9,null)),_w.createElement(w9,{className:"left"},_w.createElement(C9,null),_w.createElement(B9,null),_w.createElement(S9,null)))}E9.propTypes={type:_k.oneOf([sM.FaceDirection.LEFT,sM.FaceDirection.RIGHT,sM.FaceDirection.UP,sM.FaceDirection.FRONTAL])},E9.defaultProps={type:sM.FaceDirection.LEFT};var _9,x9=sM.ErrorDuration;function T9(e){var t=e.children,r=e.errorMsg,n=e.className;return _w.isValidElement(t)?r?_w.createElement("div",{className:n},_w.cloneElement(t,{errorMsg:r})):null:r?_w.createElement("div",{className:n},r):null}function A9(e){var t=e.children,r=e.className,n=e.error,o=_w.useRef(0),i=_w.useRef(""),a=mF.useSDKSettings().lang,s=_w.useRef(x9.SHORT),c=n||{},u=c.msg,l=c.duration,d=void 0===l?x9.SHORT:l,f=null==u?void 0:u[a];return Date.now()-o.current>=s.current?(o.current=Date.now(),s.current=d,i.current=f,T9({children:t,errorMsg:f,className:r})):T9({children:t,errorMsg:i.current,className:r})}A9.propTypes={children:_k.node,className:_k.string},A9.defaultProps={className:""};var P9=lE.circle(_9||(_9=Ky(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function I9(e){var t=e.className,r=e.style,n=e.radius,o=e.strokeWidth,i=e.progress,a=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,B=e.showOutsideRing,S=e.showInsideRing,E=e.showDashedRing,_=2*n,x=2*n,T=n-2*o,A=2*Math.PI*T,P=A-i/100*A,I=T-y/2-o/2-c,R=2*Math.PI*I,O=R-i/100*R,N=I-C/2-y/2,D=2*Math.PI*N,M=D-i/100*D,L=N-f/2-C/2,U=N-h/2-C/2;return _w.createElement("svg",{className:t,style:r,width:_,height:x,viewBox:"0 0 ".concat(_," ").concat(x),fill:"none",xmlns:"http://www.w3.org/2000/svg"},B?_w.createElement(_w.Fragment,null,_w.createElement("circle",{"data-testid":"outsideRing",opacity:l,cx:n,cy:n,r:T,stroke:u}),_w.createElement(P9,{"data-testid":"outsideAnimateRing",cx:n,cy:n,r:T,stroke:s,strokeWidth:o,strokeLinecap:"round",strokeDasharray:"".concat(A," ").concat(A),style:{strokeDashoffset:P}})):null,E?_w.createElement(_w.Fragment,null,_w.createElement("circle",{"data-testid":"dashedRing",opacity:v,cx:n,cy:n,r:I,stroke:g,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)}),_w.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},_w.createElement("circle",{cx:n,cy:n,r:I,stroke:s,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)})),_w.createElement("g",{mask:"url(#mask0)"},_w.createElement(P9,{"data-testid":"dashedAnimateRing",cx:n,cy:n,r:I,stroke:s,strokeWidth:y,strokeDasharray:"".concat(R," ").concat(R),style:{strokeDashoffset:O}})),_w.createElement("circle",{"data-testid":"dashedInsideRing",opacity:v,cx:n,cy:n,r:N,stroke:k,strokeWidth:C}),_w.createElement(P9,{"data-testid":"dashedInsideAnimateRing",cx:n,cy:n,r:N,stroke:s,strokeWidth:C,strokeLinecap:"round",strokeDasharray:"".concat(D," ").concat(D),style:{strokeDashoffset:M}})):null,S?_w.createElement("circle",{"data-testid":"insideRing",strokeDasharray:p,cx:n,cy:n,r:L,stroke:d,strokeWidth:f}):null,a?_w.createElement("circle",{"data-testid":"errorRing",strokeDasharray:p,cx:n,cy:n,r:U,stroke:m,strokeWidth:h}):null)}function R9(e){var t=e.className;return _w.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_w.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 O9(){return(O9=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)}I9.propTypes={className:_k.string,style:_k.shape({}),radius:_k.number,strokeWidth:_k.number,progress:_k.number,hasError:_k.bool,activeColor:_k.string,innerPadding:_k.number,outsideRingColor:_k.string,outsideRingOpacity:_k.number,insideRingColor:_k.string,insideRingWidth:_k.number,insideRingStrokeDash:_k.string,errorRingColor:_k.string,errorRingWidth:_k.number,dashedRingColor:_k.string,dashedRingOpacity:_k.number,dashedRingWidth:_k.number,dashedRingLineThick:_k.number,dashedRingLineSpacing:_k.number,dashedInsideRingColor:_k.string,dashedInsideRingWidth:_k.number,showOutsideRing:_k.bool,showDashedRing:_k.bool,showInsideRing:_k.bool},I9.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},R9.propTypes={className:_k.string},R9.defaultProps={className:""};var N9,D9,M9=function(e,t){void 0===t&&(t=!0),_w.useEffect((function(){if(t){var r=function(t){"Escape"===t.key&&e(t)};return document.addEventListener("keyup",r),function(){t&&document.removeEventListener("keyup",r)}}}),[e,t])},L9=function(e,t){void 0===t&&(t=!0),_w.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])},U9=function(e,t,r){void 0===r&&(r=!0),_w.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])},j9=function(e,t){void 0===t&&(t=!0),_w.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 i=o[0],a=o[o.length-1];t.shiftKey&&document.activeElement===i?(t.preventDefault(),a.focus()):document.activeElement===a&&(t.preventDefault(),i.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])},F9="undefined"!=typeof window?_w.useLayoutEffect:_w.useEffect,V9={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}}},z9=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],q9=function(e,t,r,n,o){var i=o.offsetX,a=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-a:p+a,left:h="left"===c[0]?h-i:h+i,transform:m,arrowLeft:v,arrowTop:g}},H9=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},K9=function(e,t,r,n,o,i){var a=o.offsetX,s=o.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=H9(i),d=Array.isArray(r)?r:[r];for((i||Array.isArray(r))&&(d=[].concat(d,z9));u<d.length;){var f={top:(c=q9(e,t,d[u],n,{offsetX:a,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},W9=0,G9=function(){var e=document.getElementById("popup-root");return null===e&&((e=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(e)),e},Q9=_w.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,o=e.onOpen,i=void 0===o?function(){}:o,a=e.onClose,s=void 0===a?function(){}:a,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,B=void 0===C?["click"]:C,S=e.contentStyle,E=void 0===S?{}:S,_=e.arrowStyle,x=void 0===_?{}:_,T=e.overlayStyle,A=void 0===T?{}:T,P=e.className,I=void 0===P?"":P,R=e.position,O=void 0===R?"bottom center":R,N=e.modal,D=void 0!==N&&N,M=e.lockScroll,L=void 0!==M&&M,U=e.arrow,j=void 0===U||U,F=e.offsetX,V=void 0===F?0:F,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,$=_w.useState(d||u),Z=$[0],J=$[1],ee=_w.useRef(null),te=_w.useRef(null),re=_w.useRef(null),ne=_w.useRef(null),oe=_w.useRef("popup-"+ ++W9),ie=!!D||!n,ae=_w.useRef(0);F9((function(){return Z?(ne.current=document.activeElement,ge(),me(),pe()):he(),function(){clearTimeout(ae.current)}}),[Z]),_w.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return i(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ie&&(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(ae.current),ae.current=setTimeout((function(){return se(e)}),K)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(ae.current),ae.current=setTimeout((function(){return ce(e)}),G)},pe=function(){ie&&L&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ie&&L&&(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()};_w.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var ge=function(){if(!ie&&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=K9(r,n,O,j,{offsetX:V,offsetY:q},X);if(te.current.style.top=o.top+window.scrollY+"px",te.current.style.left=o.left+window.scrollX+"px",j&&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}};M9(ce,k),j9(te,Z&&ie),L9(ge,b),U9(n?[te,ee]:[te],ce,v&&!m);var ve=function(){return _w.createElement("div",Object.assign({},(e=ie?V9.popupContent.modal:V9.popupContent.tooltip,t={className:"popup-content "+(""!==I?I.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:O9({},e,E,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!D&&B.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ie?"dialog":"tooltip",id:oe.current}),j&&!ie&&_w.createElement("div",{ref:re,style:V9.popupArrow},_w.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==I?I.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:O9({position:"absolute"},x)},_w.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},ye=!(B.indexOf("hover")>=0),be=ie?V9.overlay.modal:V9.overlay.tooltip,we=[ye&&_w.createElement("div",{key:"O","data-testid":"overlay","data-popup":ie?"modal":"tooltip",className:"popup-overlay "+(""!==I?I.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:O9({},be,A,{pointerEvents:v&&m||ie?"auto":"none"}),onClick:v&&m?ce:void 0,tabIndex:-1},ie&&ve()),!ie&&ve()];return _w.createElement(_w.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":oe.current},t=Array.isArray(B)?B:[B],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 i=n(Z);return!!n&&_w.cloneElement(i,e)}return!!n&&_w.cloneElement(n,e)}(),Z&&oM.createPortal(we,G9()))})),X9=fE(N9||(N9=Ky(["\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"]))),Y9=["open","children","overlayStyle"],$9=q3+1e3,Z9=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=Vy(e,Y9);return _w.createElement(_w.Fragment,null,t&&_w.createElement(_w.Fragment,null,_w.createElement(Q9,Ry({overlayStyle:Ny(Ny({},n),{},{zIndex:$9}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),_w.createElement(X9,null)))};Z9.propTypes={open:_k.bool,children:_k.node,overlayStyle:_k.shape({})},Z9.defaultProps={open:!1,children:null,overlayStyle:{}};var J9={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},e7=lE.div(D9||(D9=Ky(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),t7=function(e){var t=e.contentStyle,r=mF.useSDKSettings(),n=r.lang,o=r.warmupMessage,i=o?o[n]:J9.WARMUP_INTRO[n];return _w.createElement(Z9,{open:!0,contentStyle:t},_w.createElement(e7,{className:"warmup-message"},i))};t7.propTypes={contentStyle:_k.shape({})},t7.defaultProps={contentStyle:{}};var r7,n7,o7,i7,a7,s7,c7,u7,l7,d7,f7,p7,h7,m7,g7,v7,y7=function(e){var t=e.className,r=e.onClick,n=YF.useAsset("ic_close.png");return _w.createElement(G3,{className:t,onClick:r},_w.createElement("img",{src:n,alt:""}))},b7=Object.freeze({__proto__:null,CloseCameraButton:y7}),w7=XS(["z-index:",";color:#ffffff;"],q3+20),k7=lE.div(r7||(r7=Ky(["\n ","\n"])),w7),C7=lE(A9)(n7||(n7=Ky(["\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"])),w7,(function(e){var t=e.top;return t&&XS(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&XS(["bottom:","px;"],t)}),(function(e){return e.centerY&&XS(["top:50%;transform:translateY(-50%);"])})),B7=lE(k7)(o7||(o7=Ky(["\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&&XS(["top:","px;"],t)})),S7=lE(k7)(i7||(i7=Ky(["\n position: absolute;\n ","\n ","\n font-size: ",";\n text-shadow: 2px 2px 4px #000000;\n"])),(function(e){var t=e.top;return t&&XS(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&XS(["bottom:","px;"],t)}),(function(){return s3.isMobile?"20px":"22px"})),E7=lE.div(a7||(a7=Ky(["\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 s3.isMobile?"50px":"70px"}),(function(e){var t=e.top;return t&&XS(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&XS(["bottom:","px;"],t)}),q3+20),_7=lE.div(s7||(s7=Ky(["\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 s3.isMobile?"40px":"50px"}),(function(){return s3.isMobile?"40px":"50px"}),(function(e){return!e.active&&XS(["opacity:0.6;"])})),x7=lE.div(c7||(c7=Ky(["\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"])),q3+20),T7=lE.div(u7||(u7=Ky(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),A7=lE.div(l7||(l7=Ky(["\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"]))),P7=lE.div(d7||(d7=Ky(["\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"]))),I7=lE(I9)(f7||(f7=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),R7=lE(R9)(p7||(p7=Ky(["\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)"})),O7=lE.div(h7||(h7=Ky(["\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"]))),N7=pE(["from{opacity:1;}to{opacity:0;}"]),D7=lE.div(m7||(m7=Ky(["\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"])),N7),M7=s3.isMobile?{width:{ideal:640}}:null,L7={background:"#000000",opacity:.6};function U7(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,i=e.onError,a=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=YF.useAsset("bg_camera_mask.png"),C=YF.useAsset("bg_camera_mask_red.png"),B=Wy(_w.useState({}),2),S=B[0],E=B[1],_=S.yFaceDetectionError,x=S.yFaceVerificationStepsWrapper,T=Wy(_w.useState(""),2),A=T[0],P=T[1],I=_w.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,o=t+25,a=o+30;E({yFaceDetectionError:o,yFaceVerificationStepsWrapper:a+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(a);return 0!==b&&(u+b<s||u+b+r>c)?i({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=b,{y:u}}),[b,i]),R=g9({apiCheck:t,mode:r,bgCameraMask:k,bgCameraMaskRed:C,surroundStyle:L7,onLivenessDetectionDone:n,onError:i,cropAreaDimension:I,customDirectionIcon:u,captureFrameSettings:a,onFramesCaptured:s,livenessSettings:p,setRemainingTime:P,customStepTimeConstraints:l,onProcessing:d,customErrors:f,apiCredentials:h,outputEncryptionSettings:m,cameraScale:g,passiveModeAuto:y}),O=R.countdownToTakePicture,N=R.cropArea,D=R.curStepIndex,M=R.directionIcon,L=R.faceDetectionError,U=R.handleTriggerPassiveMode,j=R.handleVideoPlayed,F=R.instructions,V=R.isActiveMode,z=R.refVideo,q=R.showCountdown,H=R.steps,K=R.videoPlayed,W=R.activeCapturing,G=R.isFirstValidFrameFound,Q=R.warmupDone,X=w.CloseCameraButton;return _w.createElement(r0,{frontCamera:c,onVideoPlayed:j,onClose:o,flipHorizontal:c,ref:z,videoSettings:M7,onError:i,scale:g,defaultCameraId:v,closeButton:X||null},!Q&&_w.createElement(t7,null),K?_w.createElement(_w.Fragment,null,_w.createElement(C7,{top:_-15,className:"face-detection-error",error:L}),N.current?_w.createElement(c0,{x:"".concat(N.current.x,"px"),y:"".concat(N.current.y,"px"),width:"".concat(N.current.width,"px"),height:"".concat(N.current.height,"px"),surroundStyle:N.current.surroundStyle},_w.createElement(R7,null),_w.createElement(I7,{progress:D/H.length*100,hasError:!!L,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:1,insideRingStrokeDash:"2"}),q?_w.createElement(A7,null,O):null,V?_w.createElement(_w.Fragment,null,_w.createElement(P7,null,M),W&&_w.createElement(D7,null)):null,L&&_w.createElement(O7,null)):null,V?_w.createElement(_w.Fragment,null,A&&_w.createElement(B7,{top:x-30},A),F?_w.createElement(S7,{top:x+5,className:"instructions"},F):null,G&&_w.createElement(E7,{top:x+35},H.map((function(e,t){var r=e.name,n=e.image.objUrl;return _w.createElement(_7,{key:r,active:D>=t,className:"step-item"},n?_w.createElement("img",{src:n,alt:""}):_w.createElement("span",null,t+1))})))):_w.createElement(_w.Fragment,null,!G||L||y?null:_w.createElement(x7,null,_w.createElement(T7,{onClick:U},_w.createElement(u0,null))))):null)}U7.propTypes={apiCheck:_k.bool,mode:_k.string,onLivenessDetectionDone:_k.func,onClose:_k.func,onError:_k.func,captureFrameSettings:_k.shape({}),onFramesCaptured:_k.func,frontCamera:_k.bool,customDirectionIcon:_k.shape({}),customStepTimeConstraints:_k.shape({}),onProcessing:_k.func,customErrors:_k.shape({}),livenessSettings:_k.shape({}),apiCredentials:_k.shape({accessKey:_k.string,secretKey:_k.string,apiUrl:_k.string}),outputEncryptionSettings:_k.shape({}),cameraScale:_k.number,defaultCameraId:_k.string,passiveModeAuto:_k.bool,offsetFaceY:_k.number,styledComponent:_k.shape({CloseCameraButton:_k.node})},U7.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(g7={},Iy(g7,sM.FaceDirection.LEFT,_w.createElement(E9,{type:sM.FaceDirection.LEFT})),Iy(g7,sM.FaceDirection.RIGHT,_w.createElement(E9,{type:sM.FaceDirection.RIGHT})),Iy(g7,sM.FaceDirection.UP,_w.createElement(E9,{type:sM.FaceDirection.UP})),Iy(g7,sM.FaceDirection.FRONTAL,_w.createElement(E9,{type:sM.FaceDirection.FRONTAL})),g7),customStepTimeConstraints:(v7={},Iy(v7,sM.FaceDirection.UP,{delayTime:0}),Iy(v7,sM.FaceDirection.LEFT,{delayTime:0}),Iy(v7,sM.FaceDirection.RIGHT,{delayTime:0}),Iy(v7,sM.FaceDirection.FRONTAL,{delayTime:2e3}),v7),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null}};var j7,F7=Object.freeze({__proto__:null,Text:k7,FaceDetectionError:C7,CountdownTime:B7,FaceVerificationInstructions:S7,FaceVerificationStepsWrapper:E7,StepItem:_7,BottomButtonsOverlay:x7,Button:T7,CountDownOverlay:A7,InstructionsOverlay:P7,LivenessStyledComponent:b7,default:U7,useLivenessDetection:g9}),V7=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(){oM.unmountComponentAtNode(n)};return new Promise((function(e){oM.render(_w.createElement(mF.SDKSettingsProvider,{value:{lang:"en"}},_w.createElement(r0,{checkCameraMode:!0,frontCamera:r,onVideoPlayed:function(){o(),e(null)},onClose:o,onError:function(t){o(),e(t)}})),n)}))},z7=lE.input(j7||(j7=Ky(["\n display: none;\n"]))),q7=_w.forwardRef((function(e,t){var r=e.useFileBrowse,n=e.accept,o=e.frontCamera,i=e.onCaptureDone,a=e.outputEncryptionSettings,s=_w.useCallback(function(){var e=xy(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,!i){e.next=8;break}if(n=r[0],!a||!a.key){e.next=7;break}return e.next=6,Uq.encrypt({blob:n,key:a.key});case 6:o=e.sent;case 7:i({file:n,encrypted:o});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[i,a]);return _w.createElement(z7,Ry({ref:t,type:"file",accept:n,onChange:s},r?{}:{capture:o?"user":"environment"}))}));q7.propTypes={useFileBrowse:_k.bool,accept:_k.string,frontCamera:_k.bool,onCaptureDone:_k.func,outputEncryptionSettings:_k.shape({key:_k.string})},q7.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var H7,K7={LANDSCAPE:"landscape",PORTRAIT:"portrait",DESKTOP:"desktop"},W7=function(){var e=_w.useRef(window.matchMedia("(orientation: portrait)")),t=_w.useRef(e.current.matches?K7.PORTRAIT:K7.LANDSCAPE),r=Wy(_w.useState(t.current),2),n=r[0],o=r[1];return _w.useEffect((function(){function t(e){e.matches?o(K7.PORTRAIT):o(K7.LANDSCAPE)}return e.current.addEventListener("change",t),function(){e.current.removeEventListener("change",t)}}),[]),s3.isMobile?{curOrientation:n,initOrientation:t.current}:{curOrientation:K7.DESKTOP}},G7=sM.Errors,Q7=lE.div(H7||(H7=Ky(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function X7(e){var t=e.children,r=mF.useSDKSettings().lang,n=G7.wrong_orientation.msg[r],o=W7().curOrientation;return _w.createElement(_w.Fragment,null,o===K7.LANDSCAPE&&_w.createElement(Z9,{open:!0},_w.createElement(Q7,null,n)),(o===K7.PORTRAIT||o===K7.DESKTOP)&&_w.createElement(_w.Fragment,null,t))}var Y7=["logCredentials","clientSettings","livenessSettings","livenessComponent"];function $7(e){var t=e.logCredentials,r=void 0===t?{enable:!0}:t,n=e.clientSettings,o=e.livenessSettings,i=e.livenessComponent,a=void 0===i?U7:i,s=Vy(e,Y7),c=E6(n,"data.settings.sdk_settings",{});return _w.createElement(X7,null,_w.createElement(GF.SDKTrackingProvider,{value:{tracking:Ny({},r)}},_w.createElement(a,Ry({},s,{livenessSettings:Ny(Ny(Ny({},o),null==c?void 0:c.active_liveness_settings),null==c?void 0:c.liveness_settings)}))))}function Z7(){return(Z7=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 J7(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function eee(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function tee(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function ree(e,t){e.classList?e.classList.add(t):tee(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function nee(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function oee(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=nee(e.className,t):e.setAttribute("class",nee(e.className&&e.className.baseVal||"",t))}var iee={disabled:!1},aee=_w.createContext(null),see="unmounted",cee="exited",uee="entering",lee="entered",dee="exiting",fee=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var o,i=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?i?(o=cee,n.appearStatus=uee):o=lee:o=t.unmountOnExit||t.mountOnEnter?see:cee,n.state={status:o},n.nextCallback=null,n}eee(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===see?{status:cee}: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!==uee&&r!==lee&&(t=uee):r!==uee&&r!==lee||(t=dee)}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===uee?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===cee&&this.setState({status:see})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,o=this.props.nodeRef?[n]:[oM.findDOMNode(this),n],i=o[0],a=o[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!r||iee.disabled?this.safeSetState({status:lee},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:uee},(function(){t.props.onEntering(i,a),t.onTransitionEnd(c,(function(){t.safeSetState({status:lee},(function(){t.props.onEntered(i,a)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:oM.findDOMNode(this);t&&!iee.disabled?(this.props.onExit(n),this.safeSetState({status:dee},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:cee},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:cee},(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:oM.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],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===see)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,J7(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return _w.createElement(aee.Provider,{value:null},"function"==typeof r?r(e,n):_w.cloneElement(_w.Children.only(r),n))},t}(_w.Component);function pee(){}fee.contextType=aee,fee.propTypes={},fee.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:pee,onEntering:pee,onEntered:pee,onExit:pee,onExiting:pee,onExited:pee},fee.UNMOUNTED=see,fee.EXITED=cee,fee.ENTERING=uee,fee.ENTERED=lee,fee.EXITING=dee;var hee,mee,gee=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return ree(e,t)}))},vee=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return oee(e,t)}))},yee=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],i=n[1];t.removeClasses(o,"exit"),t.addClass(o,i?"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],i=n[1]?"appear":"enter";t.addClass(o,i,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),o=n[0],i=n[1]?"appear":"enter";t.removeClasses(o,i),t.addClass(o,i,"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}eee(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,gee(e,n))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,o=r.active,i=r.done;this.appliedClasses[t]={},n&&vee(e,n),o&&vee(e,o),i&&vee(e,i)},r.render=function(){var e=this.props,t=(e.classNames,J7(e,["classNames"]));return _w.createElement(fee,Z7({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(_w.Component);function bee(e,t){return e!==t&&(!_w.isValidElement(e)||!_w.isValidElement(t)||null==e.key||e.key!==t.key)}yee.defaultProps={classNames:""},yee.propTypes={};var wee={out:"out-in",in:"in-out"},kee=function(e,t,r){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),r()}},Cee=((hee={})[wee.out]=function(e){var t=e.current,r=e.changeState;return _w.cloneElement(t,{in:!1,onExited:kee(t,"onExited",(function(){r(uee,null)}))})},hee[wee.in]=function(e){var t=e.current,r=e.changeState,n=e.children;return[t,_w.cloneElement(n,{in:!0,onEntered:kee(n,"onEntered",(function(){r(uee)}))})]},hee),Bee=((mee={})[wee.out]=function(e){var t=e.children,r=e.changeState;return _w.cloneElement(t,{in:!0,onEntered:kee(t,"onEntered",(function(){r(lee,_w.cloneElement(t,{in:!0}))}))})},mee[wee.in]=function(e){var t=e.current,r=e.children,n=e.changeState;return[_w.cloneElement(t,{in:!1,onExited:kee(t,"onExited",(function(){n(lee,_w.cloneElement(r,{in:!0}))}))}),_w.cloneElement(r,{in:!0})]},mee),See=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:lee,current:null},t.appeared=!1,t.changeState=function(e,r){void 0===r&&(r=t.state.current),t.setState({status:e,current:r})},t}eee(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===uee&&e.mode===wee.in?{status:uee}:t.current&&bee(t.current,e.children)?{status:dee}:{current:_w.cloneElement(e.children,{in:!0})}},r.render=function(){var e,t=this.props,r=t.children,n=t.mode,o=this.state,i=o.status,a=o.current,s={children:r,current:a,changeState:this.changeState,status:i};switch(i){case uee:e=Bee[n](s);break;case dee:e=Cee[n](s);break;case lee:e=a}return _w.createElement(aee.Provider,{value:{isMounting:!this.appeared}},e)},t}(_w.Component);See.propTypes={},See.defaultProps={mode:wee.out};var Eee={DEFAULT:"default",ERROR:"error"};function _ee(e){var t=e.className,r=e.width,n=e.height,o=e.type,i=e.strokeStyles,a=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=_w.useMemo((function(){var e;return Ny((Iy(e={},Eee.DEFAULT,{fill:"none",strokeWidth:a,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),Iy(e,Eee.ERROR,{fill:"rgba(234,50,35, 0.1)",strokeWidth:a,stroke:"#ea3223"}),e),i)}),[a,i]),l=s+.8*a,d=u[o];return _w.createElement("svg",{width:r,height:n,className:t},_w.createElement("rect",{x:a/2,y:a/2,rx:s,ry:s,width:r-a,height:n-a,style:d}),_w.createElement("path",{d:"M0,".concat(l," Q0,0 ").concat(l,",0 L0,0 Z"),style:c}),_w.createElement("path",{d:"M0,".concat(n-l," Q0,").concat(n," ").concat(l,",").concat(n," L0,").concat(n," Z"),style:c}),_w.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}),_w.createElement("path",{d:"M".concat(r-l,",0 Q").concat(r,",0 ").concat(r,",").concat(l," L").concat(r,",0 Z"),style:c}))}_ee.propTypes={className:_k.string,width:_k.number,height:_k.number,strokeWidth:_k.number,strokeStyles:_k.shape({}),type:_k.oneOf([Eee.DEFAULT,Eee.ERROR]),radius:_k.number,paddingStyle:_k.shape({})},_ee.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:Eee.DEFAULT,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var xee,Tee,Aee,Pee,Iee,Ree,Oee,Nee,Dee,Mee,Lee,Uee,jee,Fee,Vee,zee,qee,Hee,Kee,Wee,Gee=500,Qee=pE(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),Xee=pE(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),Yee=XS([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],Qee,Gee,Xee,Gee),$ee=Object.freeze({__proto__:null,animationDuration:Gee,default:Yee}),Zee=20,Jee=pE(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],Zee,Zee),ete=pE(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],Zee,Zee),tte=(XS([".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;}"],Jee,ete),pE(["from,to{opacity:1;}50%{opacity:0;}"])),rte=(XS([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],tte),300),nte=lE.div(xee||(xee=Ky(["\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"])),q3+1),ote=pE(["from{background:#000;}to{}"]),ite=XS([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],ote,rte),ate=lE.div(Tee||(Tee=Ky(["\n ","\n"])),ite),ste=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return _w.createElement(ate,null,_w.createElement(See,null,_w.createElement(yee,{key:r,timeout:{enter:rte,exit:0},classNames:"splash",unmountOnExit:!1},_w.createElement(nte,null))))},cte=Object.freeze({__proto__:null,default:ste}),ute=pE(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),lte=XS([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],ute),dte=Object.freeze({__proto__:null,default:lte}),fte=["width","height","type"],pte=lE(_ee)(Aee||(Aee=Ky([""]))),hte=lE.img(Pee||(Pee=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),mte=Gee,gte=ste,vte=lE.div(Iee||(Iee=Ky(["\n ","\n ","\n"])),Yee,lte),yte=lE.img(Ree||(Ree=Ky(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),bte=10,wte=60,kte=100,Cte=lE.div(Oee||(Oee=Ky(["\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"])),wte,q3+20,s3.isMobile?XS(["top:",";"],(function(e){return e.y})):XS(["bottom:","px;"],bte)),Bte=lE.div(Nee||(Nee=Ky(["\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"])),kte,kte,q3+20),Ste=lE.div(Dee||(Dee=Ky(["\n color: #fff;\n text-align: center;\n"]))),Ete=lE.div(Mee||(Mee=Ky(["\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}),q3+20),_te=lE.div(Lee||(Lee=Ky(["\n display: flex;\n align-items: center;\n"]))),xte=lE(Ste)(Uee||(Uee=Ky(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),Tte=lE(Ste)(jee||(jee=Ky(["\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"])),q3+30),Ate=lE(Ste)(Fee||(Fee=Ky(["\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}),q3+20),Pte=lE(Ate)(Vee||(Vee=Ky(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),Ite=lE(Ste)(zee||(zee=Ky(["\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}),q3+20),Rte=(lE.div(qee||(qee=Ky(["\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=Vy(e,fte),i=YF.useAsset("id_card_frame.png"),a=YF.useAsset("id_card_frame_error.png");return _w.createElement(vte,{width:t,height:r},_w.createElement(hte,{src:n===Eee.ERROR?a:i,width:t,height:r}),_w.createElement(pte,Ry({width:t,height:r,type:n},o)))}),Ote={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"}},Nte=50,Dte=sM.IDCardMessage,Mte=lE.div(Hee||(Hee=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Lte=lE.div(Kee||(Kee=Ky(["\n text-align: center;\n font-size: 1rem;\n"]))),Ute=lE.button(Wee||(Wee=Ky(["\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})),jte=function(e){var t=e.onOk,r=e.maxSessionTime,n=mF.useSDKSettings().lang;return _w.createElement(Mte,null,_w.createElement(Lte,{className:"popup-message"},r8(Dte.TIMEOUT_INSTRUCTION[n])({x:r})),_w.createElement(Ute,{className:"popup-button",onClick:t},Ote.BTN_OK[n]))};jte.propTypes={onOk:_k.func,maxSessionTime:_k.number},jte.defaultProps={onOk:function(){},maxSessionTime:30};var Fte=function(){var e=Wy(_w.useState(!1),2),t=e[0],r=e[1],n=Wy(_w.useState(null),2),o=n[0],i=n[1],a=Wy(_w.useState({}),2),s=a[0],c=a[1];return{showPopup:_w.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),i(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},Vte={SESSION_TIMEOUT:"SESSION_TIMEOUT",CONFIRM:"CONFIRM",QR_INVALID:"QR_INVALID",QR_INSTRUCTIONS:"QR_INSTRUCTIONS"},zte=sM.Errors;function qte(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function Hte(e,t){return Math.sqrt(qte(e,t))}function Kte(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=void 0===r?.4:r,o=window,i=o.cv,a=t.width,s=t.height,c=n;c<1&&(c=parseInt(.5*(s+a)*c,10));var u=i.imread(t),l=new i.Mat;return i.copyMakeBorder(u,l,c,c,c,c,i.BORDER_CONSTANT,new i.Scalar(0,0,0,255)),u.delete(),{mat:l,margin:c}}function Wte(e,t){var r=window.cv,n=Wy(t.map((function(e){return e.location})),4),o=n[0],i=n[1],a=n[2],s=n[3],c=Hte(a,s),u=Hte(i,o),l=Math.max(c,u),d=Hte(i,a),f=Hte(o,s),p=Math.max(d,f),h=[o.x,o.y,i.x,i.y,a.x,a.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 Gte(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},i=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),a=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(i*a))/Math.PI}function Qte(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,a=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),i=Math.min(i,n),a=Math.max(a,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&i/n>=c&&(n-s)/n>=c&&(r-a)/r>=c}function Xte(){return Yte.apply(this,arguments)}function Yte(){return(Yte=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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,i=r.width,a=r.height,s=Math.floor(i*o),c=Math.floor(a*o),u=i-2*s,l=a-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",Yz.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $te(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,i=Gte(e[r].location,e[n].location,e[o].location);if(i<70||i>110)return!1}return!0}function Zte(e){return Jte.apply(this,arguments)}function Jte(){return(Jte=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,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,i=n.width,a=n.height,s=Math.floor(i/3),c=Math.floor(4*a/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(a/5),s,c,0,0,s,c),e.next=12,VV.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=Wy(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4)&&!(IV.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[VV.SIZE,VV.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",zte.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",zte.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",zte.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 ere=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E,_,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=Wy(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)-2*Nte,b=(null==v||null===(o=v.location)||void 0===o?void 0:o.y)-(null==g||null===(i=g.location)||void 0===i?void 0:i.y)-2*Nte,w=performance.now(),(k=u.current).width=y,k.height=b,(C=k.getContext("2d")).drawImage(c,(null==m||null===(a=m.location)||void 0===a?void 0:a.x)+Nte,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+Nte,y,b,0,0,y,b),e.next=14,new Promise((function(e){k.toBlob(function(){var t=xy(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jF.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(Gy(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),B=180-w>0?180-w:0,e.next=18,new Promise((function(e){return setTimeout(e,B)}));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)+Nte,(null==m||null===(E=m.location)||void 0===E?void 0:E.y)+Nte,y,b,0,0,y,b),e.next=24,new Promise((function(e){k.toBlob(function(){var t=xy(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jF.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(Gy(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)}}();function tre(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}var rre=tre;function nre(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=J0(r))==r?r:0),void 0!==t&&(t=(t=J0(t))==t?t:0),rre(J0(e),t,r)}var ore=nre,ire="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function are(){return sre.apply(this,arguments)}function sre(){return(sre=xy(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?ire: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",xy(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 cre=j6(are),ure="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",lre={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"};function dre(e){var t,r,n,o,i,a=e.card,s=e.corners,c=a.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=rb(s);try{for(f.s();!(i=f.n()).done;){var p=i.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=qte(u,h),v=qte(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 fre=function(){function e(){Ty(this,e)}var t,r,n,o,i,a,s;return Py(e,[{key:"load",value:(s=xy(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([cre({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:(a=xy(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 a.apply(this,arguments)})},{key:"loadModel",value:(i=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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?ure:r,e.next=3,Nq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,Nq.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,i=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),a=Wy(i,3),this.out_score_name=a[0],this.out_class_name=a[1],this.out_box_name=a[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadResource",value:(o=xy(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?ure:r,e.next=3,Nq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})},{key:"dispose",value:(n=xy(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=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E,_,x,T,A,P,I,R,O=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=O.length>1&&void 0!==O[1]?O[1]:{},n=r.imgMargin,o=void 0===n?.4:n,i=r.detectThreshold,a=void 0===i?.3:i,s=r.maxNumReturns,c=void 0===s?100:s,u=window,l=u.cv,d={},f=t.width,p=t.height,d.originalWidth=f,d.originalHeight=p,h=Kte({canvas:t,imgMargin:o}),m=h.margin,g=h.mat,v=this.inputShape.slice(1,3),y=Wy(v,2),b=y[0],w=y[1],k=new l.Mat,l.resize(g,k,new l.Size(b,w),0,0,l.INTER_AREA),C=g.cols/b,B=g.rows/w,(S=document.createElement("canvas")).width=b,S.height=w,S.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(k.data),k.cols,k.rows),0,0),g.delete(),k.delete(),d.canvas=S,d.margin=m,E=performance.now(),e.next=25,this.detect(S,{detectThreshold:a,maxNumReturns:c});case 25:if(_=e.sent,x=Math.floor(performance.now()-E),T={inputImage:d,card:null,exeTime:x},A=[[],[],[],[]],P=[],I=[],_.forEach((function(e){var t=Wy(e.box,4),r=t[0],n=t[1],o=t[2],i=t[3];e.clazz<=3?A[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:ore(Math.floor((i+n)/2*C-m),0,f),y:ore(Math.floor((r+o)/2*B-m),0,p)},scaledLocation:{x:ore(Math.floor((i+n)/2),0,S.width),y:ore(Math.floor((r+o)/2),0,S.height)}}):I.push({label:e.label,score:e.score,box:[ore(Math.floor(r*B-m),0,p),ore(Math.floor(n*C-m),0,f),ore(Math.floor(o*B-m),0,p),ore(Math.floor(i*C-m),0,f)]})})),A.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),P.push(e[0]))})),!(I.length>0&&4===P.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),P.sort((function(e,t){return e.clazz-t.clazz})),R=I[0],e.prev=37,dre({card:R,corners:P})){e.next=41;break}return console.debug("Not qualified.",R,P),e.abrupt("return",T);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",T);case 46:return R.corners=P,T.card=R,e.abrupt("return",T);case 49:return e.abrupt("return",T);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return r.apply(this,arguments)})},{key:"detect",value:(t=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E=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,i=window,a=i.tf,s=t.width,c=t.height,u=a.tidy((function(){var e=a.expandDims(a.cast(a.image.resizeBilinear(a.browser.fromPixels(t),E.inputShape.slice(1,3)),"float32"));return E.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=Wy(l,3),f=d[0],p=d[1],h=Wy(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=lre[Math.round(w)])&&void 0!==k?k:"NA",B=m[y],S=[B[0]*c,B[3]*s,B[2]*c,B[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 pre{static hasCamera(){return pre.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=pre.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 i=!1;e.hidden&&(e.hidden=!1,i=!0),document.body.contains(e)||(document.body.appendChild(e),i=!0),requestAnimationFrame((()=>{const 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=pre.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(),pre._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,i=!1){const a=r instanceof Worker;let s=Promise.all([r||pre.createQrEngine(),pre._loadImage(e)]).then((([e,i])=>{let s;return r=e,[n,s]=this._drawToCanvas(i,t,n,o),r instanceof Worker?(a||r.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,t)=>{let o,i,a;i=n=>{"qrResult"===n.data.type&&(r.removeEventListener("message",i),r.removeEventListener("error",a),clearTimeout(o),null!==n.data.data?e(n.data.data):t(pre.NO_QR_CODE_FOUND))},a=e=>{r.removeEventListener("message",i),r.removeEventListener("error",a),clearTimeout(o);const n=e?e.message||e:"Unknown Error";t("Scanner error: "+n)},r.addEventListener("message",i),r.addEventListener("error",a),o=setTimeout((()=>a("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(pre.NO_QR_CODE_FOUND)})).catch((e=>t("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(o)))}))}));return t&&i&&(s=s.catch((()=>pre.scanImage(e,null,r,n,o)))),s=s.finally((()=>{a||pre._postWorkerMessage(r,"close")})),s}setGrayscaleWeights(e,t,r,n=!0){pre._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:t,blue:r,useIntegerApproximation:n})}setInversionMode(e){pre._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=pre.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=>pre.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=pre.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==pre.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,i=t&&t.y?t.y:0,a=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:a,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,i,a,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 pre._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,pre._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 hre(){return mre.apply(this,arguments)}function mre(){return(mre=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return pre.WORKER_PATH=cK(),e.next=3,pre.createQrEngine(pre.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 gre(){return vre.apply(this,arguments)}function vre(){return(vre=xy(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([hre()]);case 2:return t=e.sent,r=Wy(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)}pre.DEFAULT_CANVAS_SIZE=400,pre.NO_QR_CODE_FOUND="No QR code found",pre.WORKER_PATH="qr-scanner-worker.min.js";var yre="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function bre(){return wre.apply(this,arguments)}function wre(){return(wre=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=xy(regeneratorRuntime.mark((function e(){var t,r,n,a,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",a="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=[i(t),i(r),i(n),i(a)],e.next=11,Promise.all(u);case 11:l=e.sent,d=Wy(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)},a=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?yre:r,i=function(){var e=xy(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,a();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",gre());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var kre=j6(bre),Cre=900;function Bre(e){return Sre.apply(this,arguments)}function Sre(){return(Sre=xy(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,Cre),r.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ere(e){return _re.apply(this,arguments)}function _re(){return(_re=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i;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,Bre({idCardModel:r});case 6:(i=performance.now())-o+.6*(i-o)>Cre&&(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 xre(){return Tre.apply(this,arguments)}function Tre(){return(Tre=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,i=t.tfScriptUrls,a=t.wechatQRModelsUrl,e.next=3,$6({blazefaceModelUrl:o,tfScriptUrls:i});case 3:return s=e.sent,c=s.blazefaceModel,u=!0,l=new fre,e.prev=7,e.next=10,l.load({opencvUrl:r,modelUrl:n});case 10:e.next=15;break;case 12:return e.prev=12,e.t0=e.catch(7),e.abrupt("return",{ableToUseModel:!1});case 15:return e.next=17,kre({modelUrl:a});case 17:return e.prev=17,e.next=20,Ere({idCardModel:l});case 20:d=e.sent,f=d.fastEnough,u=f,e.next=28;break;case 25:e.prev=25,e.t1=e.catch(17),u=!1;case 28:return e.abrupt("return",{ableToUseModel:u,idCardModel:l,blazefaceModel:c});case 29:case"end":return e.stop()}}),e,null,[[7,12],[17,25]])})))).apply(this,arguments)}var Are=j6(xre),Pre=sM.Errors,Ire=function(){return{imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}},Rre=function(){return{imageBlob:null,blurScore:null,error:null,detectedCard:null}};function Ore(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.onError,a=e.frontSide,s=e.onAutoCaptureSuccess,c=e.quality,u=_w.useRef(null);null===u.current&&(u.current=document.createElement("canvas"));var l=_w.useRef(0),d=_w.useRef([]),f=_w.useRef(null);null===f.current&&(f.current=document.createElement("canvas"));var p=_w.useRef({}),h=_w.useRef(!1),m=_w.useRef(null),g=Wy(_w.useState(!1),2),v=g[0],y=g[1],b=_w.useRef(Ire()),w=_w.useRef(Rre()),k=_w.useRef(!1),C=_w.useRef(!1),B=_w.useRef(null),S=_w.useRef(!1),E=_w.useRef({}),_=mF.useSDKSettings().customUrls;_w.useEffect((function(){var e=!1;function t(){return(t=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||v){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,Are(_);case 4:return E.current=t.sent,t.next=7,Nq.initTensorFlow();case 7:B.current=o.enableBlurCheck&&E.current.ableToUseModel,t.next=11;break;case 10:B.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:y(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[v,o,_]);var x=_w.useCallback((function(e){return ere({currentWorkingCanvas:e,refVirtualWorkingCanvas:f,refCountVirtualFrames:l,refVirtualFrames:d,refWorkingCanvas:u,refCardResult:p})}),[]),T=_w.useCallback((function(){!0===h.current&&(h.current=!1)}),[]),A=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,i=o.blurThreshold,a=b.current,s=w.current,!(r<i&&CV.hasBetterCardBlurScore(r,a.blurScore))){e.next=16;break}if(!S.current){e.next=9;break}a.imageBlob=s.imageBlob,e.next=13;break;case 9:return e.next=11,SV.takePicture({canvas:u.current,quality:c});case 11:a.imageBlob=e.sent,a.captureTime=Date.now();case 13:a.takenAt=(new Date).getTime(),a.blurScore=r,a.detectedCard=n;case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,c]),P=_w.useCallback(function(){var e=xy(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,C.current=!0,o=w.current,!CV.hasBetterCardBlurScore(r,o.blurScore)){e.next=11;break}return e.next=6,SV.takePicture({canvas:u.current,quality:c});case 6:o.imageBlob=e.sent,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,S.current=!0;case 11:C.current=!1;case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c]),I=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.waitForBestImageTimeMs,null===(r=b.current).imageBlob){e.next=8;break}if(!((new Date).getTime()-r.takenAt>t)){e.next=8;break}return e.next=7,s(r);case 7:T();case 8:case"end":return e.stop()}}),e)}))),[s,o,T]),R=_w.useCallback((function(){k.current=!0}),[]),O=_w.useCallback((function(){return new Promise((function(e){k.current=!1;var t=setInterval((function(){C.current||(clearInterval(t),e())}),150)}))}),[]),N=_w.useCallback(xy(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=w.current;B.current?(R(),setTimeout((function(){O().then(xy(regeneratorRuntime.mark((function o(){var i;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(CV.hasBetterCardBlurScore(n.blurScore,t)||(n.error=Pre.id_detector_error_blur),i=u.current,null!==n.imageBlob){o.next=6;break}SV.takePicture({canvas:i,quality:c}).then(function(){var t=xy(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,x(i);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,x(i);case 9:e(n);case 10:case"end":return o.stop()}}),o)}))))}),2e3)):SV.takePicture({canvas:u.current,quality:c}).then(function(){var t=xy(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,x(u.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,R,O,c,x]),D=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,s,c,f,g,y,C,B,_,x,T,R,O,N,D,M,L,U,j;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&v&&!h.current){e.next=2;break}return e.abrupt("return");case 2:b.current=Ire(),w.current=Rre(),r=o.enableAutoCapture,n=o.enableBlurCheck,s=o.enableIdDetection,c=E.current,f=c.idCardModel,g=c.blazefaceModel,y=c.ableToUseModel,C=m.current,B=t.current,h.current=!0,_=C.cropX,x=C.cropY,T=C.cropWidth,R=C.cropHeight,O=C.cropWidthWithoutPadding,N=C.cropHeightWithoutPadding,(D=u.current).width=T,D.height=R,M=D.getContext("2d"),L=document.createElement("canvas"),U=L.getContext("2d"),j=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,o,c,u,m,v,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(M.drawImage(B,_,x,T,R,0,0,T,R),t=performance.now(),S.current=!1,!s||!y){e.next=59;break}return o=null,e.next=7,f.predict(D,{detectThreshold:.3});case 7:if(!(c=e.sent).card){e.next=55;break}if(p.current=c.card,!w.current.imageBlob&&d.current.length>0&&(d.current=[],l.current=0),!Qte({corners:c.card.corners,width:T,height:R})){e.next=52;break}if(!$te(c.card.corners)){e.next=49;break}if(u=Wte(D,c.card.corners),!((m=IV.rectAreaRatio({small:{area:u.width*u.height},big:{area:O*N}}))<.5)){e.next=21;break}o=Pre.id_detector_card_too_small,e.next=47;break;case 21:if(!(m>.95)){e.next=25;break}o=Pre.id_detector_error_incomplete,e.next=47;break;case 25:return L.width=u.width,L.height=u.height,U.putImageData(u,0,0),e.next=30,Xte({canvas:L});case 30:if(!e.sent){e.next=35;break}o=Pre.glare_detected,e.next=47;break;case 35:return e.next=37,Zte({blazefaceModel:g,predictedIdCardCanvas:L,frontSide:a});case 37:if(o=e.sent){e.next=47;break}if(!n){e.next=47;break}if(v=CV.calculateIdCardBlurScore({canvas:L}),!k.current){e.next=44;break}return e.next=44,P({blurScore:v,detectedCard:c.card});case 44:if(!r){e.next=47;break}return e.next=47,A({blurScore:v,detectedCard:c.card});case 47:e.next=50;break;case 49:o=Pre.id_detector_validate_angle_error;case 50:e.next=53;break;case 52:o=Pre.id_detector_error_incomplete;case 53:e.next=56;break;case 55:o=Pre.id_detector_no_cards;case 56:return i(o),e.next=59,I();case 59:return t=Math.floor(performance.now()-t),b=180-t>0?180-t:0,e.next=63,new Promise((function(e){return setTimeout(e,b)}));case 63:h.current&&window.requestAnimationFrame(j);case 64:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(j);case 19:case"end":return e.stop()}}),e)}))),[t,o,v,a,i,A,P,I]);_w.useEffect((function(){var e=t.current;function o(){return(o=xy(regeneratorRuntime.mark((function t(){var r,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(m.current=SV.analyzeVideoAndWindowSizes(e,n,.05),r=m.current,o=r.cropWidth,i=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(i)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,D();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&v&&function(){o.apply(this,arguments)}()}),[r,n,t,T,D,v]);var M=_w.useCallback((function(){T()}),[T]);return _w.useEffect((function(){return M}),[M]),{refWorkingCanvas:u,stopCheckFrame:T,checkFrame:D,warmupDone:v,takePictureManually:N,refAbleToRunBurstMode:B,refVirtualFrames:d}}var Nre=function(){return{id:null,frames:[]}},Dre=180;function Mre(){return[Nre()]}function Lre(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=_w.useRef(null);null===i.current&&(i.current=document.createElement("canvas"));var a=_w.useRef(!1),s=_w.useRef(Wz.createResizer({width:960,height:640})),c=_w.useRef(null),u=_w.useRef(Mre()),l=_w.useCallback((function(){!0===a.current&&(a.current=!1)}),[]),d=_w.useCallback((function(){u.current=Mre()}),[]),f=_w.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push(Nre())}),[]),p=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,i,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,i=u.current,a=n.resize({srcCanvas:r}),c=a.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],i[i.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=_w.useCallback(xy(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?Dre:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:s=c.current,u=t.current,a.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=i.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),a.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,ZF.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return _w.useEffect((function(){var e=t.current;function o(){return(o=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=SV.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:i,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var Ure=function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,i=e.onChange;_w.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,a=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==a?void 0:a.width,"canvas.height":null==a?void 0:a.height};i&&i(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[i,t,r,n,o])},jre=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,i=e.settings,a=e.shouldStartTimers,s=e.sessionTime,c=_w.useRef(),u=Wy(_w.useState(0),2),l=u[0],d=u[1],f=_w.useCallback((function(){clearInterval(c.current)}),[]),p=_w.useCallback((function(){d((function(e){return e+1}))}),[]);return _w.useEffect((function(){if(a){var e=i.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var i=s-(t+=1);i<=u&&r&&r({curTimeLeft:i}),t>0&&t%e==0&&o&&o(),0===i&&(f(),n&&n())}),1e3)}return function(){f()}}),[a,t,r,f,n,o,l,i,s]),{stopTimers:f,startTimers:p}};nK.initExifData();var Fre,Vre,zre,qre=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onModelErrorChange,a=e.frontSide,s=e.onDebugInfoChange,c=e.onAboutToTimeout,u=e.onSessionTimeout,l=e.onCaptureDone,d=e.outputEncryptionSettings,f=e.quality,p=_w.useRef(!1),h=Wy(_w.useState(!1),2),m=h[0],g=h[1],v=_w.useRef((function(){})),y=GF.useSDKTracking().sendEvent,b=_w.useRef(),w=_w.useRef(),k=_w.useRef(),C=mF.useSDKSettings(),B=C.debug,S=C.lang,E=C.enableAntiDebug,_=sK(),x=_.startMotion,T=_.stopMotion,A=_.motionData,P=_.orientationData;_w.useEffect((function(){E&&Dq.enableAntiDebug()}),[E]);var I=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y({tag:a?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,v.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[y,a]),R=_w.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.apply(void 0,t);var n=E6(t,"0.code");n&&n!==b.current&&(y({tag:a?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),b.current=n)}),[i,a,y]),O=Ore({refVideo:r,shouldStart:t,cropArea:n,settings:o,onError:R,frontSide:a,onAutoCaptureSuccess:I,quality:f}),N=O.refWorkingCanvas,D=O.stopCheckFrame,M=O.checkFrame,L=O.warmupDone,U=O.takePictureManually,j=O.refAbleToRunBurstMode,F=O.refVirtualFrames,V=Lre({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),z=V.stopCheckFrame,q=V.splitVideos,H=V.resetRecordedVideos,K=V.checkFrame,W=V.refRecordedVideos;Ure({debug:B,refRecordedVideos:W,refWorkingCanvas:N,refVideo:r,onChange:s});var G=_w.useCallback((function(){z(),D(),H(),u()}),[H,z,D,u]),Q=_w.useCallback((function(){q()}),[q]),X=jre({lang:S,onAboutToTimeout:c,onSessionTimeout:G,onVideoTimeLimitReached:Q,settings:o,shouldStartTimers:L&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),Y=X.stopTimers,$=X.startTimers,Z=_w.useCallback((function(){p.current=!1}),[]),J=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Z(),$(),e.next=4,Promise.all([K(),M()]);case 4:case"end":return e.stop()}}),e)}))),[Z,$,K,M]),ee=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,f,h,m,v,b=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=b.length>0&&void 0!==b[0]?b[0]:{},r=t.imageBlob,n=t.error,i=t.detectedCard,s=t.captureTime,!p.current){e.next=3;break}return e.abrupt("return");case 3:return p.current=!0,g(!0),z(),D(),Y(),R(null),c=null==o?void 0:o.enableVirtualCamHashes,u={},c&&(f=F).current.length>0&&(u=f.current.reduce((function(e,t,r){return Ny(Ny({},e),{},Iy({},"hash".concat(r+1),t))}),u)),T(),nK.preWriteExif({mode:nK.MODE.ID_CARD,motionData:A,orientationData:P,startTime:w.current,endTime:Date.now()}),e.next=16,nK.writeExif({mode:nK.MODE.ID_CARD,imageData:Ny({detectedCard:i,captureTime:s,blob:r},c?{vCam:u}:{}),enableExifData:null==o?void 0:o.enableExifData});case 16:if(h=e.sent,!d||!d.key){e.next=22;break}return v=d.key,e.next=21,Uq.encrypt({blob:h,key:v});case 21:m=e.sent;case 22:l({image:{blob:h,encrypted:m,detectedCard:i},error:n,recordedVideos:[]}),g(!1),y({tag:a?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-k.current)/1e3}});case 25:case"end":return e.stop()}}),e)}))),[z,D,Y,R,l,a,y,d,A,P,T,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,F]);v.current=ee;var te=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),Y(),z(),j.current||D(),e.next=6,U();case 6:return t=e.sent,e.next=9,ee(t);case 9:g(!1),y({tag:a?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[U,ee,Y,j,z,D,y,a]);return _w.useEffect((function(){t&&(y({tag:a?"id_front":"id_back",event:"user_activity.start",log:{}}),w.current=Date.now(),x())}),[y,a,t,x]),_w.useEffect((function(){L&&(y({tag:a?"id_front":"id_back",event:"user_activity.show",log:{}}),y({tag:a?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-w.current}}),k.current=performance.now())}),[y,a,L]),{warmupDone:L,isProcessing:m,takePictureManually:te,restartSession:J,resetIsProcessingImageBlobTaken:Z}},Hre=sM.IDCardMessage,Kre=_w.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,i=e.refVideo,a=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=Wy(_w.useState({}),2),f=d[0],p=d[1],h=f.yDescription,m=f.yMessage,g=f.yCaptureButton,v=YF.useAsset("ic_camera.svg"),y=YF.useAsset("ic_loading.png"),b=Wy(_w.useState(""),2),w=b[0],k=b[1],C=mF.useSDKSettings(),B=C.debug,S=C.lang,E=Wy(_w.useState(null),2),_=E[0],x=E[1],T=Wy(_w.useState(""),2),A=T[0],P=T[1],I=Wy(_w.useState(null),2),R=I[0],O=I[1],N=Fte(),D=N.showPopup,M=N.popupShown,L=N.popupType,U=_w.useCallback((function(e){P(null===e?"":r8(e.msg[S])({side:a?Ote.FRONT[S]:Ote.BACK[S]}))}),[S,a]),j=_w.useCallback((function(){x(""),D({popupType:Vte.SESSION_TIMEOUT})}),[D]),F=_w.useCallback((function(){x(""),c.apply(void 0,arguments)}),[c]),V=_w.useCallback((function(e){var t=e.curTimeLeft;x(r8(Hre.REMAINING_TIME[S])({x:t}))}),[S]),z=qre({shouldStart:!0,refVideo:i,cropArea:R,settings:s,onModelErrorChange:U,frontSide:a,onDebugInfoChange:k,onSessionTimeout:j,onCaptureDone:F,onAboutToTimeout:V,outputEncryptionSettings:l}),q=z.warmupDone,H=z.isProcessing,K=z.takePictureManually,W=z.restartSession,G=z.resetIsProcessingImageBlobTaken,Q=_w.useCallback((function(){D({popupType:null}),G()}),[D,G]),X=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(),e.next=3,W();case 3:case"end":return e.stop()}}),e)}))),[W,Q]);_w.useEffect((function(){if(o){var e,t,r,i,a,s,c,l=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,h=o.lostY,m=o.clientHeight;n?(a=.7*(s=d-165),r=(c=(e=h+10)+45)+20,i=(t=c+s+10)+60):(a=s3.isMobile?l-6:Math.floor(.7*l),r=(c=(e=h+10)+50)+20,i=(t=c+(s=Math.floor(Math.min(a/1.5,m-2*h-(wte+2*bte)-100)))+10)+60);var g=Math.floor((l-a)/2)+f;O({x:g,y:c,width:a,height:s,surroundStyle:{opacity:.6,background:"#000"}});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:i};p(v),u(v)}}),[o,n,u]);var Y=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(""),e.next=3,K();case 3:case"end":return e.stop()}}),e)}))),[K]);return _w.useImperativeHandle(t,(function(){return{restartSession:X}}),[X]),_w.createElement(_w.Fragment,null,!q&&_w.createElement(t7,null),B&&_w.createElement(Tte,null,w),H&&_w.createElement(Bte,null,_w.createElement("img",{src:y,alt:"",className:"spin"})),R&&_w.createElement(c0,{x:"".concat(R.x,"px"),y:"".concat(R.y,"px"),width:"".concat(R.width,"px"),height:"".concat(R.height,"px"),surroundStyle:R.surroundStyle},_w.createElement(Rte,{width:R.width,height:R.height,type:A?Eee.ERROR:Eee.DEFAULT})),!A&&_w.createElement(Ate,{y:"".concat(h,"px"),className:"description"},r),A&&_w.createElement(Pte,{y:"".concat(h,"px")},A),!H&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!A)&&_w.createElement(Cte,{onClick:Y,y:"".concat(g,"px")},_w.createElement("img",{src:v,alt:""})),_&&_w.createElement(Ite,{key:_,className:"message",y:"".concat(m,"px")},_),_w.createElement(Z9,{open:M},L===Vte.SESSION_TIMEOUT&&_w.createElement(jte,{onOk:X,maxSessionTime:null==s?void 0:s.idCardSessionTime})))}));Kre.propTypes={usePortraitMask:_k.bool,description:_k.string,windowAndVideoInfo:_k.shape({}),refVideo:_k.shape({}),frontSide:_k.bool,settings:_k.shape({}),onCaptureDone:_k.func,onUISpacingChange:_k.func,outputEncryptionSettings:_k.shape({})},Kre.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var Wre,Gre,Qre="#00ce78",Xre=10,Yre=lE.div(Fre||(Fre=Ky(["\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}),q3+20),$re=lE.div(Vre||(Vre=Ky(["\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")})),Zre=function(e){var t=e.children,r=e.y;return _w.createElement(Yre,{y:r,background:Qre},_w.createElement($re,{arrowSize:Xre,top:-Xre,color:Qre}),t)},Jre=lE.div(zre||(zre=Ky(["\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}),q3+20),ene={QR_INSTRUCTIONS_TEXT:{en:_w.createElement("span",null,"Please follow the instructions below to scan QR code:",_w.createElement("br",null),_w.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:_w.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",_w.createElement("br",null),_w.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:_w.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",_w.createElement("br",null),_w.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",_w.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:_w.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",_w.createElement("br",null),_w.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",_w.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"}},tne=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,i=e.mr,a=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!==a&&(m.marginLeft=a,m.marginRight=a),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==i&&(m.marginRight=i),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),_w.cloneElement(t,{style:Ny(Ny({},h),m)})};tne.propTypes={mt:_k.string,ml:_k.string,mr:_k.string,mb:_k.string,mx:_k.string,my:_k.string,pt:_k.string,pl:_k.string,pr:_k.string,pb:_k.string,px:_k.string,py:_k.string},tne.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 rne,nne,one,ine=lE.button(Wre||(Wre=Ky(["\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})),ane=lE.a(Gre||(Gre=Ky(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),sne=lE.div(rne||(rne=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),cne=lE.div(nne||(nne=Ky(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),une=lE.div(one||(one=Ky(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),lne=function(e){var t=e.onRetry,r=e.onSkip,n=mF.useSDKSettings().lang;return _w.createElement(sne,null,_w.createElement(tne,{mt:"25px"},_w.createElement(cne,null,ene.QR_INVALID_POPUP_TITLE[n])),_w.createElement(tne,{mt:"30px"},_w.createElement(une,null,ene.QR_INVALID_POPUP_DESCRIPTION[n])),_w.createElement(tne,{mt:"30px"},_w.createElement(ine,{onClick:t},ene.QR_INVALID_POPUP_RETRY_BUTTON[n])),_w.createElement(tne,{my:"20px"},_w.createElement(ane,{onClick:r},ene.QR_INVALID_POPUP_SKIP_BUTTON[n])))};lne.propTypes={onRetry:_k.func,onSkip:_k.func},lne.defaultProps={onRetry:function(){},onSkip:function(){}};var dne,fne,pne,hne,mne,gne,vne,yne=["children","ratio","padding"],bne=lE.div(dne||(dne=Ky(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),wne=lE.div(fne||(fne=Ky(["\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})),kne=function(e){var t=e.children,r=e.ratio,n=e.padding,o=Vy(e,yne);return _w.createElement(bne,Ry({ratio:r},o),_w.createElement(wne,{padding:n},t))};kne.propTypes={children:_k.node,ratio:_k.number,padding:_k.string},kne.defaultProps={children:null,ratio:4/3,padding:"0"};var Cne=lE.div(pne||(pne=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Bne=lE.div(hne||(hne=Ky(["\n background: #e7e6e6;\n width: 100%;\n"]))),Sne=lE.img(mne||(mne=Ky(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),Ene=lE.div(gne||(gne=Ky(["\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})),_ne=lE(Ene)(vne||(vne=Ky(["\n white-space: nowrap;\n"]))),xne=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=mF.useSDKSettings().lang,i=YF.useAsset("qr_code_banner.png"),a=_w.useRef(n),s=Wy(_w.useState((function(){return r8(ene.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),c=s[0],u=s[1],l=GF.useSDKTracking().sendEvent,d=_w.useRef(!1);_w.useEffect((function(){l({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[l]),_w.useEffect((function(){var e=r8(ene.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){a.current--,u(e({x:a.current})),a.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 _w.createElement(Cne,null,_w.createElement(Bne,null,_w.createElement(kne,{ratio:1.6},_w.createElement(Sne,{src:i}))),_w.createElement(tne,{mt:"30px"},_w.createElement(Ene,null,ene.QR_INSTRUCTIONS_TEXT[o])),_w.createElement(tne,{mt:"30px"},_w.createElement(ine,{onClick:function(){l({tag:"id_qr",event:"user_activity.click_start",log:{}}),d.current=!0,t()}},ene.QR_INSTRUCTIONS_START_BUTTON[o])),_w.createElement(tne,{my:"20px"},_w.createElement(_ne,null,c)))};xne.propTypes={onClickStart:_k.func,onTimeout:_k.func,timeout:_k.number},xne.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var Tne=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g,Ane=function(e){var t=e.match(Tne);return{valid:Boolean(t)}};function Pne(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 Ine=function(){var e=xy(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,kre();case 2:if(n=e.sent,o=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return i=document.createElement("canvas"),a=i.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;i.width=t/2,i.height=o/2,a.drawImage(n,t/2,0,i.width,i.height,0,0,i.width,i.height),URL.revokeObjectURL(r),e()},n.src=r}));case 11:return e.next=13,Pne({canvas:i,qrModel:o});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,nK.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,Uq.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)}}(),Rne=o((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 i=t;i<t+n;i++)for(var a=e;a<e+r;a++)this.set(a,i,!!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,i=0;i<this.size;i++)this.expTable[i]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(i=0;i<this.size-1;i++)this.logTable[this.expTable[i]]=i;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,i=t.coefficients;o.length>i.length&&(o=(r=[i,o])[0],i=r[1]);for(var a=new Uint8ClampedArray(i.length),s=i.length-o.length,c=0;c<s;c++)a[c]=i[c];for(c=s;c<i.length;c++)a[c]=n.addOrSubtractGF(o[c-s],i[c]);return new e(this.field,a)},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,i=t.coefficients,a=i.length,s=new Uint8ClampedArray(o+a-1),c=0;c<o;c++)for(var u=r[c],l=0;l<a;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,i[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),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],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),i=r(11),a=r(12);function s(e){var t=a.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=i.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 i=c;Object.keys(i||{}).forEach((function(e){i[e]=o[e]||i[e]}));var a="attemptBoth"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,u="onlyInvert"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,l=n.binarize(e,t,r,a),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==i.inversionAttempts&&"invertFirst"!==i.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 i=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,a){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new i(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 i(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 B=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<B&&(C=B)}m.set(v,g,C)}var S=n.BitMatrix.createEmpty(t,r),E=null;for(a&&(E=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 P=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var I=s.get(c,u);S.set(c,u,I<=P),a&&E.set(c,u,!(I<=P))}}return a?{binarized:S,inverted:E}:{binarized:S}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),i=r(9),a=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],i=e.height,a=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,i=e.alignmentPatternCenters;o<i.length;o++)for(var a=i[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===a&&6===u||6===a&&u===t-7||a===t-7&&6===u||r.setRegion(a-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=i-1;p>0;p-=2){6===p&&p--;for(var h=0;h<i;h++)for(var m=f?i-1-h:h,g=0;g<2;g++){var v=p-g;if(!a.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 a.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var i=t-9;i>=t-11;i--)n=c(e.get(i,o),n);var u=0;for(i=5;i>=0;i--)for(o=t-9;o>=t-11;o--)u=c(e.get(i,o),u);for(var l,d=1/0,f=0,p=a.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,i=0;for(n=o-1;n>=o-7;n--)i=c(e.get(8,n),i);for(r=o-8;r<o;r++)i=c(e.get(r,8),i);for(var a=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===i)return m;var g=s(t,h);g<a&&(l=m,a=g),t!==i&&(g=s(i,h))<a&&(l=m,a=g)}return a<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],i=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),i+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<i)return null;e=e.slice(0,i);for(var a=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<a;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=i.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,i=r(7),a=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],i=e.readBits(o);i>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var a=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+a,48+s,48+c),n+=a.toString()+s.toString()+c.toString(),i-=3}if(2===i){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");a=Math.floor(u/10),s=u%10,r.push(48+a,48+s),n+=a.toString()+s.toString()}else if(1===i){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],i=e.readBits(o);i>=2;){var a=e.readBits(11),s=Math.floor(a/45),u=a%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],i-=2}return 1===i&&(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],i=e.readBits(o),a=0;a<i;a++){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],i=e.readBits(o),s=0;s<i;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(a.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,a,c,f,p=new i.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,(a=m.bytes).push.apply(a,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<<(i=r-n);t=(this.bytes[this.byteOffset]&o)>>i,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 i;if(e>0)o=255>>(i=8-e)<<i,t=t<<e|(this.bytes[this.byteOffset]&o)>>i,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 i=new n.default(285,256,0),a=new o.default(i,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=a.evaluateAt(i.exp(u+i.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(i,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var i=t,a=r,s=e.zero,c=e.one;a.degree()>=n/2;){var u=i,l=s;if(s=c,(i=a).isZero())return null;a=u;for(var d=e.zero,f=i.getCoefficient(i.degree()),p=e.inverse(f);a.degree()>=i.degree()&&!a.isZero();){var h=a.degree()-i.degree(),m=e.multiply(a.getCoefficient(a.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),a=a.addOrSubtract(i.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),a.degree()>=i.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),a.multiply(v)]}(i,i.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,i=1;i<e.size&&o<r;i++)0===t.evaluateAt(i)&&(n[o]=e.inverse(i),o++);return o!==r?null:n}(i,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,i=new Array(o),a=0;a<o;a++){for(var s=e.inverse(r[a]),c=1,u=0;u<o;u++)a!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));i[a]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(i[a]=e.multiply(i[a],s))}return i}(i,f[1],p),m=0;m<p.length;m++){var g=r.length-1-i.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,i=e.y-t.y+r.y-n.y;if(0===o&&0===i)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 a=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=a*u-s*c,d=(o*u-s*i)/l,f=(a*i-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 i=o(e,t,r,n);return{a11:i.a22*i.a33-i.a23*i.a32,a12:i.a13*i.a32-i.a12*i.a33,a13:i.a12*i.a23-i.a13*i.a22,a21:i.a23*i.a31-i.a21*i.a33,a22:i.a11*i.a33-i.a13*i.a31,a23:i.a13*i.a21-i.a11*i.a23,a31:i.a21*i.a32-i.a22*i.a31,a32:i.a12*i.a31-i.a11*i.a32,a33:i.a11*i.a22-i.a12*i.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}),i=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),a=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=i.a13*e+i.a23*t+i.a33;return{x:(i.a11*e+i.a21*t+i.a31)/r,y:(i.a12*e+i.a22*t+i.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);a.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:a,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 i(e,t,r,o){var i,a,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?(i=Math.floor(e.y),a=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(i=Math.floor(e.x),a=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-i),f=Math.abs(c-a),p=Math.floor(-d/2),h=i<s?1:-1,m=a<c?1:-1,g=!0,v=i,y=a;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 a(e,t,r,n){var o,a=t.y-e.y,s=t.x-e.x,c=i(e,t,r,Math.ceil(n/2)),u=i(e,{x:e.x-s,y:e.y-a},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=a(e,{x:-1,y:e.y},r,t.length),o=a(e,{x:e.x,y:-1},r,t.length),i=a(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=a(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(i,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,i=Math.round(t.y);e.get(Math.round(o),i);)i--;for(var a=Math.round(t.y);e.get(Math.round(o),a);)a++;return{x:o,y:(i+a)/2}}function l(e,t,r,i,s){var u,l,d;try{u=function(e,t,r,i){var s=(o(a(e,r,i,5))/7+o(a(e,t,i,5))/7+o(a(r,e,i,5))/7+o(a(t,e,i,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}}(i,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-i.x+s.x,p=r.y-i.y+s.y,h=(n(i,s)+n(i,r))/2/d,m=1-3/h,g={x:i.x+m*(f-i.x),y:i.y+m*(p-i.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,i=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(i))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1];return o(a),{x:r,y:i,score:c({x:Math.floor(r),y:Math.floor(i)},[1,1,1],e)+n({x:r,y:i},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=[],i=[],a=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var i=e.get(t,n);if(i===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=i;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&&!i,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&&i;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=a.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:a.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})),i.push.apply(i,a.filter((function(e){return e.bottom.y!==n}))),a=a.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}))),i.push.apply(i,a);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 i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],a=o(i)/i.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:a}}})).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,i,a,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=(i=[e,t,r])[0],u=i[1],l=i[2]):(c=(a=[e,r,t])[0],u=a[1],l=a[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,i,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,i,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()})),One=n(Rne);function Nne(e){return Dne.apply(this,arguments)}function Dne(){return(Dne=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(i=n.getContext("2d"),o=i.getImageData(0,0,n.width,n.height)),!(a=One(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",a.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mne(e){return Lne.apply(this,arguments)}function Lne(){return(Lne=xy(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),pre.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 Une=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,i=r,!n){e.next=6;break}return e.next=5,Wz.blobToCanvas({blob:n});case 5:i=e.sent;case 6:return a=i.getContext("2d"),e.next=9,Nne({imageData:a.getImageData(0,0,i.width,i.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,Mne({canvas:i,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 jne(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.onResult,a=e.outputEncryptionSettings,s=_w.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=_w.useRef(!1),u=_w.useRef(null),l=Wy(_w.useState(!1),2),d=l[0],f=l[1],p=_w.useRef({}),h=mF.useSDKSettings().customUrls;_w.useEffect((function(){function e(){return(e=xy(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,kre({modelUrl:null==h?void 0:h.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,h]);var m=_w.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),g=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,l,f,h,g,v,y,b,w,k,C,B;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,g=t.current,c.current=!0,v=h.cropX,y=h.cropY,b=h.cropWidth,w=h.cropHeight,(k=s.current).width=b,k.height=w,C=k.getContext("2d"),B=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,o,u,d,p,h,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C.drawImage(g,v,y,b,w,0,0,b,w),t=performance.now(),f){e.next=8;break}return e.next=5,Pne({canvas:k,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,Une({canvas:k,qrScannerResources:l});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=27;break}return m(),o=Ane(r),e.next=17,SV.takePicture({canvas:s.current});case 17:return u=e.sent,e.next=20,nK.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:!0});case 20:if(d=e.sent,!a||!a.key){e.next=26;break}return h=a.key,e.next=25,Uq.encrypt({blob:d,key:h});case 25:p=e.sent;case 26:i({result:r,validateResult:o,image:{blob:d,encrypted:p}});case 27:return S=180-t>0?180-t:0,e.next=30,new Promise((function(e){return setTimeout(e,S)}));case 30:c.current&&window.requestAnimationFrame(B);case 31:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(B);case 13:case"end":return e.stop()}}),e)}))),[t,o,d,i,m,a]),v=_w.useCallback((function(){m()}),[m]);return _w.useEffect((function(){var e=t.current;r||v(),d&&r&&n&&e&&e.videoWidth>0&&(u.current=SV.analyzeVideoAndWindowSizes(e,n,0),g())}),[r,n,t,m,g,d,v]),_w.useEffect((function(){return v}),[v]),{refWorkingCanvas:s,stopCheckFrame:m,checkFrame:g,warmupDone:d}}var Fne,Vne,zne,qne,Hne,Kne,Wne=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onSessionTimeout,a=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=Wy(_w.useState(!1),2),l=u[0],d=u[1],f=_w.useRef((function(){})),p=_w.useRef((function(){})),h=mF.useSDKSettings().lang,m=jne({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:_w.useCallback((function(){f.current.apply(f,arguments)}),[]),outputEncryptionSettings:c}),g=m.stopCheckFrame,v=m.checkFrame,y=m.warmupDone,b=Lre({refVideo:r,shouldStart:t&&y,cropArea:n,settings:o}),w=b.stopCheckFrame,k=b.refRecordedVideos,C=b.splitVideos,B=b.resetRecordedVideos,S=b.checkFrame;f.current=_w.useCallback((function(e){d(!0),w(),g(),p.current(),a(Ny(Ny({},e),{},{recordedVideos:k.current})),d(!1)}),[w,a,k,g]);var E=_w.useCallback((function(){w(),g();var e=Gy(k.current);i({recordedVideos:e}),B()}),[B,w,g,i,k]),_=_w.useCallback((function(){C()}),[C]),x=jre({lang:h,onAboutToTimeout:s,onSessionTimeout:E,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:_w.useCallback(xy(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}},Gne=145;function Qne(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,i=e.onCaptureDone,a=e.outputEncryptionSettings,s=Wy(_w.useState(null),2),c=s[0],u=s[1],l=YF.useAsset("qr_capture_cursor.png"),d=Wy(_w.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=mF.useSDKSettings().lang,v=GF.useSDKTracking().sendEvent,y=Fte(),b=y.showPopup,w=y.popupShown,k=y.popupType,C=Wy(_w.useState(!1),2),B=C[0],S=C[1],E=Wy(_w.useState(null),2),_=E[0],x=E[1],T=YF.useAsset("ic_loading.png"),A=_w.useRef();_w.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),_w.useEffect((function(){b({popupType:Vte.QR_INSTRUCTIONS})}),[b]),_w.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,i=s3.isMobile?Math.min(e-6,Gne):Gne,a=i,s=o+10,c=s+90,l=c+40,d=l+a+20,f=Math.floor((e-i)/2)+n;u({x:f,y:l,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var P=_w.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),i(e)}),[i,v]),I=_w.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}}),i(e)):(b({popupType:Vte.QR_INVALID}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,i,v]),R=_w.useCallback((function(e){var t=e.curTimeLeft;x(r8(ene.REMAINING_TIME[g])({x:t}))}),[g]),O=Wne({shouldStart:B,refVideo:n,cropArea:c,settings:o,onSessionTimeout:P,onCaptureDone:I,onAboutToTimeout:R,outputEncryptionSettings:a}),N=O.isProcessing,D=O.restartSession,M=O.warmupDone,L=_w.useCallback((function(){b({popupType:null})}),[b]),U=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(),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,L,v]),j=_w.useCallback((function(){L(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),i()}),[L,i,v]),F=_w.useCallback((function(){L(),setTimeout((function(){S(!0)}),200)}),[L]);return _w.createElement(_w.Fragment,null,!M&&_w.createElement(t7,{contentStyle:{maxWidth:"300px"}}),c&&_w.createElement(c0,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},_w.createElement("div",null,_w.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),_w.createElement(Zre,{y:"".concat(h,"px")},ene.QR_TOOLTIP[g]),_&&_w.createElement(Jre,{key:_,className:"message",y:"".concat(m,"px")},_),N&&_w.createElement(Bte,null,_w.createElement("img",{src:T,alt:"",className:"spin"})),_w.createElement(Z9,{contentStyle:{maxWidth:"332px"},open:w},k===Vte.QR_INVALID&&_w.createElement(lne,{onRetry:U,onSkip:j}),k===Vte.QR_INSTRUCTIONS&&_w.createElement(xne,{onClickStart:F,onTimeout:F})))}Qne.propTypes={windowAndVideoInfo:_k.shape({}),onUISpacingChange:_k.func,refVideo:_k.shape({}),settings:_k.shape({}),onCaptureDone:_k.func,outputEncryptionSettings:_k.shape({})},Qne.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var Xne,Yne,$ne,Zne,Jne,eoe={SUCCESS:"SUCCESS",WARNING:"WARNING"},toe=(Iy(Fne={},eoe.SUCCESS,"52,206,95"),Iy(Fne,eoe.WARNING,"255,148,50"),Fne),roe=(Iy(Vne={},eoe.SUCCESS,"✓"),Iy(Vne,eoe.WARNING,"!"),Vne),noe=lE.div(zne||(zne=Ky(["\n font-weight: normal;\n"]))),ooe=lE.div(qne||(qne=Ky(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return XS(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],toe[e.type],toe[e.type],toe[e.type])})),ioe=lE.div(Hne||(Hne=Ky(["\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 XS(["rgb(",")"],toe[e.type])})),aoe=lE.div(Kne||(Kne=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),soe=function(e){var t=e.children,r=e.type,n=e.className;return _w.createElement(noe,{className:n},_w.createElement(ooe,{type:r}),_w.createElement(aoe,null,_w.createElement(ioe,{type:r},roe[r]),t),_w.createElement(ooe,{type:r}))};soe.propTypes={children:_k.node,type:_k.string,className:_k.string},soe.defaultProps={children:null,type:eoe.SUCCESS,className:""};var coe=lE.div(Xne||(Xne=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),uoe=lE.div(Yne||(Yne=Ky(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),loe=lE.button($ne||($ne=Ky(["\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})),doe=lE.img(Zne||(Zne=Ky(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),foe=lE.div(Jne||(Jne=Ky(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),poe=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,i=e.hasValidQR,a=e.frontSide,s=Wy(_w.useState(null),2),c=s[0],u=s[1],l=mF.useSDKSettings().lang,d=GF.useSDKTracking().sendEvent;return _w.useEffect((function(){d({tag:a?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[a,d]),_w.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),_w.createElement(coe,null,null!==i&&_w.createElement(tne,{mb:"20px"},_w.createElement("div",null,_w.createElement(soe,{type:i?eoe.SUCCESS:eoe.WARNING},i?Ote.CONFIRM_POPUP_VALID_QR[l]:Ote.CONFIRM_POPUP_INVALID_QR[l]))),_w.createElement(kne,{ratio:1.5},_w.createElement(doe,{src:c})),o&&_w.createElement(uoe,{className:"confirm-popup-error-message"},o.msg[l]),_w.createElement(foe,null,_w.createElement(loe,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},Ote.BTN_TRY_AGAIN[l]),_w.createElement(loe,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},Ote.BTN_USE_THIS_PICTURE[l])))};poe.propTypes={imageTaken:_k.shape({}),error:_k.shape({msg:_k.shape({})}),onConfirm:_k.func,onTryAgain:_k.func,hasValidQR:_k.bool,frontSide:_k.bool},poe.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var hoe,moe={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},goe=fE(hoe||(hoe=Ky(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),voe=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons"];function yoe(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,i=e.defaultCameraId,a=e.globalStyle,s=e.styledComponent,c=e.frontCamera,u=e.scannerTypeCons,l=Vy(e,voe),d=l.numberOfCaptures,f=l.stepNumber,p=l.frontSide,h=l.titleIcon,m=l.title,g=l.description,v=l.scannerType,y=l.usePortraitMask,b=l.shouldShowSpinner,w=l.handleQRCaptureDone,k=l.handleIDCardCaptureDone,C=l.handleRestartSession,B=l.refIDCardReader,S=l.handleClickConfirm,E=l.popupType,_=l.popupShown,x=l.popupProps,T=_w.useRef(null),A=Wy(_w.useState(null),2),P=A[0],I=A[1],R=Wy(_w.useState(!1),2),O=R[0],N=R[1],D=YF.useAsset("ic_loading.png"),M=Wy(_w.useState({}),2),L=M[0],U=M[1],j=L.yTitle,F=_w.useCallback((function(e){I(e),N(!0)}),[]);_w.useEffect((function(){N(!1)}),[c]);var V=YF.useAsset(h),z=s.CloseCameraButton;return _w.createElement(sE,{theme:moe},_w.createElement(vte,null,_w.createElement(r0,{key:c,frontCamera:c,onVideoPlayed:F,onClose:t,flipHorizontal:c,ref:T,onError:r,defaultCameraId:i,closeButton:z||null},O&&_w.createElement(_w.Fragment,null,v===u.ID_CARD&&_w.createElement(Kre,{key:f,ref:B,windowAndVideoInfo:P,refVideo:T,settings:n,onCaptureDone:k,onUISpacingChange:U,frontSide:p,description:g,usePortraitMask:y,outputEncryptionSettings:o}),v===u.QR_CODE&&_w.createElement(Qne,{key:f,refVideo:T,windowAndVideoInfo:P,settings:n,onCaptureDone:w,onUISpacingChange:U,outputEncryptionSettings:o})),_w.createElement(gte,{keyForTransition:d}),_w.createElement(Ete,{y:"".concat(j,"px")},_w.createElement(See,null,_w.createElement(yee,{key:m,timeout:{enter:mte,exit:mte},classNames:"flipY",unmountOnExit:!0},_w.createElement(_te,null,h&&_w.createElement(yte,{src:V,alt:""}),_w.createElement(xte,{className:"title"},m))))),b&&_w.createElement(Bte,null,_w.createElement("img",{src:D,alt:"",className:"spin"}))),_w.createElement(Z9,{open:_},E===Vte.CONFIRM&&_w.createElement(poe,Ry({},x,{onConfirm:S,onTryAgain:C,frontSide:p})))),_w.createElement(a,null))}var boe={settings:_k.shape({}),onClose:_k.func,onError:_k.func,outputEncryptionSettings:_k.shape({}),defaultCameraId:_k.string,globalStyle:_k.shape({}),styledComponent:_k.shape({CloseCameraButton:_k.node}),frontCamera:_k.bool,scannerTypeCons:_k.shape({}).isRequired},woe={settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:goe,styledComponent:{CloseCameraButton:null},frontCamera:!1};yoe.propTypes=boe,yoe.defaultProps=woe;var koe=sM.IDCardSide,Coe=sM.IDCardType,Boe=sM.Errors,Soe={ID_CARD:"id_card",QR_CODE:"qr_code"},Eoe=[{scannerType:Soe.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:sM.IDCardSide.FRONT,cardType:Coe.VN,enableConfirmPopup:!0},{scannerType:Soe.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:sM.IDCardSide.BACK,cardType:Coe.VN,enableConfirmPopup:!0}],_oe={scannerType:Soe.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},xoe=function(){return Promise.resolve({card_label:""})},Toe=function(e){var t=e.settings,r=e.onError,n=e.detectIdCard,o=void 0===n?xoe:n,i=e.outputEncryptionSettings,a=e.steps,s=void 0===a?Eoe:a,c=e.onStepDone,u=Wy(_w.useState(0),2),l=u[0],d=u[1],f=Wy(_w.useState(s[l]),2),p=f[0],h=f[1],m=Wy(_w.useState(0),2),g=m[0],v=m[1],y=Wy(_w.useState(!1),2),b=y[0],w=y[1],k=_w.useRef({}),C=_w.useRef([]),B=_w.useRef(null),S=_w.useRef(),E=Fte(),_=E.showPopup,x=E.popupShown,T=E.popupType,A=E.props,P=p.scannerType,I=p.title,R=p.titleIcon,O=p.cardSide,N=p.description,D=p.usePortraitMask,M=p.cardType,L=p.enableConfirmPopup,U=_w.useCallback((function(e){e>=s.length||setTimeout((function(){d(e),h(s[e])}),200)}),[s]),j=_w.useCallback((function(){U(l+1)}),[U,l]),F=_w.useCallback((function(){setTimeout((function(){h((function(e){return Ny(Ny({},e),_oe)}))}),200)}),[]),V=_w.useCallback((function(){_({popupType:null})}),[_]),z=_w.useCallback((function(){V(),B.current=null,P===Soe.QR_CODE?U(l):P===Soe.ID_CARD&&S.current.restartSession()}),[U,l,V,P]),q=_w.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={stepNumber:l,cardSide:O,cardType:M,image:k.current,recordedVideos:null!=t&&t.enableRecording?C.current:[]},(P===Soe.QR_CODE||null!==(r=B.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=B.current),w(!0),e.next=5,c(n);case 5:w(!1),B.current=null,j();case 8:case"end":return e.stop()}}),e)}))),[t,l,c,j,P,w,O,M]),H=_w.useCallback((function(e){var t;if(B.current=e,e&&e.recordedVideos){var r,n=e.recordedVideos;(r=C.current).push.apply(r,Gy(n))}v((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);L?_({popupType:Vte.CONFIRM,props:{hasValidQR:o,imageTaken:k.current}}):q()}),[_,L,q]),K=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var a,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.image,s=n.error,c=n.recordedVideos,k.current=a,C.current=c,v((function(e){return e+1})),O!==sM.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!s3.isMobile){e.next=28;break}if(l=null==a||null===(u=a.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return w(!0),e.prev=9,e.next=12,o({image:a,cardType:M,cardSide:O});case 12:d=e.sent,l=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(Boe.detect_id_card_error);case 19:w(!1);case 20:if(!l||!"vn.cccd_new.front".includes(l)){e.next=28;break}return w(!0),e.next=24,Ine(k.current.blob,i);case 24:return(f=e.sent)?H(f):F(),w(!1),e.abrupt("return");case 28:L?_({popupType:Vte.CONFIRM,props:{imageTaken:k.current,error:s}}):q();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[L,_,O,t,M,o,q,F,r,H,i,w]),W=_w.useCallback((function(){V(),q()}),[q,V]);return{numberOfCaptures:g,stepNumber:l,titleIcon:R,title:I,description:N,frontSide:O===koe.FRONT,scannerType:P,usePortraitMask:D,shouldShowSpinner:b,handleQRCaptureDone:H,handleIDCardCaptureDone:K,handleRestartSession:z,refIDCardReader:S,handleClickConfirm:W,showPopup:_,popupType:T,popupShown:x,popupProps:A}};function Aoe(){this.__data__=new z8,this.size=0}var Poe=Aoe;function Ioe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Roe=Ioe;function Ooe(e){return this.__data__.get(e)}var Noe=Ooe;function Doe(e){return this.__data__.has(e)}var Moe=Doe,Loe=200;function Uoe(e,t){var r=this.__data__;if(r instanceof z8){var n=r.__data__;if(!H8||n.length<Loe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new a6(n)}return r.set(e,t),this.size=r.size,this}var joe=Uoe;function Foe(e){var t=this.__data__=new z8(e);this.size=t.size}Foe.prototype.clear=Poe,Foe.prototype.delete=Roe,Foe.prototype.get=Noe,Foe.prototype.has=Moe,Foe.prototype.set=joe;var Voe=Foe;function zoe(e,t,r){(void 0!==r&&!V2(e[t],r)||void 0===r&&!(t in e))&&j2(e,t,r)}var qoe=zoe;function Hoe(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===r(i[c],c,i))break}return t}}var Koe=Hoe,Woe=Koe(),Goe=Woe,Qoe=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?g0.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}})),Xoe=g0.Uint8Array,Yoe=Xoe;function $oe(e){var t=new e.constructor(e.byteLength);return new Yoe(t).set(new Yoe(e)),t}var Zoe=$oe;function Joe(e,t){var r=t?Zoe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var eie=Joe;function tie(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var rie=tie,nie=Object.create,oie=function(){function e(){}return function(t){if(!d0(t))return{};if(nie)return nie(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),iie=oie;function aie(e){return"function"!=typeof e.constructor||x5(e)?{}:iie(V5(e))}var sie=aie;function cie(e){return q0(e)&&y1(e)}var uie=cie;function lie(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var die=lie;function fie(e){return G2(e,D5(e))}var pie=fie;function hie(e,t,r,n,o,i,a){var s=die(e,r),c=die(t,r),u=a.get(c);if(u)qoe(e,r,u);else{var l=i?i(s,c,r+"",e,t,a):void 0,d=void 0===l;if(d){var f=U1(c),p=!f&&V1(c),h=!f&&!p&&w5(c);l=c,f||p||h?U1(s)?l=s:uie(s)?l=rie(s):p?(d=!1,l=Qoe(c,!0)):h?(d=!1,l=eie(c,!0)):l=[]:X5(c)||M1(c)?(l=s,M1(s)?l=pie(s):d0(s)&&!p2(s)||(l=sie(c))):d=!1}d&&(a.set(c,l),o(l,c,n,i,a),a.delete(c)),qoe(e,r,l)}}var mie=hie;function gie(e,t,r,n,o){e!==t&&Goe(t,(function(i,a){if(o||(o=new Voe),d0(i))mie(e,t,a,r,gie,n,o);else{var s=n?n(die(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),qoe(e,a,s)}}),D5)}var vie=gie,yie=_1((function(e,t,r){vie(e,t,r)})),bie=yie,wie={data:{settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},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:!0,mobile:!1}}}}}};function kie(e){var t=e.clientSettings,r=Wy(_w.useState(null),2),n=r[0],o=r[1];return _w.useEffect((function(){var e=bie(wie,t),r=E6(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),n=E6(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),i=E6(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),a=E6(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),s=E6(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),c=E6(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),u=E6(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),l=E6(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),d=E6(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),f=E6(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),p=E6(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),h=E6(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),m=E6(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),g=E6(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),v=E6(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),y=E6(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(s3.isMobile?"mobile":"web"));o({enableRecording:r,frameCaptureIntervalMs:n,idCardSessionTime:s,maxRecordingTimePerVideo:c,saveFrameQuality:i,enableTimers:a,enableAutoCapture:u,waitForBestImageTimeMs:l,enableBlurCheck:d,blurThreshold:f,disableCaptureButtonIfAlert:p,enableIdDetection:h,enableScanQr:m,scanQrLimitTimeSecond:g,enableExifData:v,enableVirtualCamHashes:y})}),[t]),{settings:n}}function Cie(e){var t=e.logCredentials,r=e.clientSettings,n=e.uiOnlyComponent,o=e.onError,i=e.detectIdCard,a=e.outputEncryptionSettings,s=e.steps,c=e.onStepDone,u=kie({clientSettings:r}).settings,l=Ry({},Toe({settings:u,onError:o,detectIdCard:i,outputEncryptionSettings:a,steps:s,onStepDone:c}));return _w.createElement(X7,null,_w.createElement(GF.SDKTrackingProvider,{value:{tracking:Ny({},t)}},_w.createElement(n,Ry({},e,{settings:u,scannerTypeCons:Soe},l))))}var Bie={logCredentials:_k.shape({}),clientSettings:_k.shape({}),uiOnlyComponent:_k.func,onError:_k.func,onStepDone:_k.func,steps:_k.arrayOf(_k.shape({})),detectIdCard:_k.func,outputEncryptionSettings:_k.shape({})};Cie.propTypes=Bie,Cie.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:yoe,onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var Sie=sM.IDCardSide,Eie=sM.Errors;function _ie(e){return xie.apply(this,arguments)}function xie(){return(xie=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.cardType,o=t.cardSide,i=t.apiClient,a=t.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(o)},!a||!a.key){e.next=4;break}return e.abrupt("return",i.httpClient.post("/v1/images",Ny({base64:r.encrypted.hex},s),{"X-TV-Key":a.key}));case 4:return e.abrupt("return",i.uploadImage(Ny({file:r.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tie(e){return Aie.apply(this,arguments)}function Aie(){return(Aie=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.apiClient,o=t.rawString,i=t.outputEncryptionSettings,a={label:"qr_code",metadata:JSON.stringify({raw:o})},!i||!i.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",Ny({base64:r.encrypted.hex},a),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",n.uploadImage(Ny({file:r.blob},a)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pie(e){return Iie.apply(this,arguments)}function Iie(){return(Iie=xy(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 Rie(e){return Oie.apply(this,arguments)}function Oie(){return(Oie=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,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,i=t.isCapturingFrontSide,a=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:i?void 0:{id:a},videos:[].concat(Gy(u.map((function(e){return{id:e.id}}))),Gy(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 Nie(e){return Die.apply(this,arguments)}function Die(){return(Die=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,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,i=t.backCardId,a=t.isCapturingFrontSide,s=t.qrImageId,c={card_type:r,image1:a?{id:o}:{id:i}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mie(e){return Lie.apply(this,arguments)}function Lie(){return(Lie=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,k,C,B,S,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,o=t.frontCardId,i=t.qrImageId,a=t.onError,s=t.recordedVideos,c=t.apiClient,u=t.cardType,l=t.cardSide,d=t.qrScannedResult,f=t.outputEncryptionSettings,l!==Sie.BACK||o){e.next=4;break}return a(Eie.missing_front_id_card),e.abrupt("return");case 4:return p=[_ie({image:n,cardType:u,cardSide:l,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&p.push(Tie({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(p);case 8:if(h=e.sent,m=Wy(h,2),g=m[0],v=m[1],!g.errors){e.next=15;break}return a(Ny(Ny({},Eie.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)||i,(C=l===Sie.FRONT)?w=y:(w=o,k=y),e.next=21,Pie({imageId:y,cardType:u,apiClient:c});case 21:if(!(B=e.sent).errors){e.next=25;break}return a(Ny(Ny({},Eie.sanity_check_error),{},{details:B.errors})),e.abrupt("return");case 25:return e.next=27,Nie({cardType:u,apiClient:c,frontCardId:w,backCardId:k,isCapturingFrontSide:C,qrImageId:b});case 27:if(!(S=e.sent).errors){e.next=31;break}return a(Ny(Ny({},Eie.read_id_card_error),{},{details:S.errors})),e.abrupt("return");case 31:return e.next=33,Rie({apiClient:c,cardType:u,frontCardId:w,isCapturingFrontSide:C,backCardId:k,recordedVideos:s,qrImageId:b});case 33:if(!(E=e.sent).errors){e.next=37;break}return a(Ny(Ny({},Eie.detect_id_tampering_error),{},{details:E.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:B.data,tamperingInfo:E.data,cardInfo:S.data,qrImageId:b});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Uie=["readIDCardUIOnlyComponent"],jie=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],Fie=sM.Errors,Vie=function(e){var t=e.readIDCardUIOnlyComponent,r=Vy(e,Uie),n=r.onError,o=r.onStepDone,i=r.apiCredentials,a=r.logCredentials,s=r.outputEncryptionSettings,c=Vy(r,jie),u=Wy(_w.useState(null),2),l=u[0],d=u[1],f=iq.useApiClient({apiCredentials:i,logCredentials:a}).apiClient,p=_w.useRef(""),h=_w.useRef("");_w.useEffect((function(){function e(){return(e=xy(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=_w.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,i,a,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,i=t.cardSide,a=t.recordedVideos,c=t.qrScannedResult,u=t.image,l=null,e.prev=2,e.next=5,Mie({image:u,cardSide:i,frontCardId:p.current,qrImageId:h.current,onError:n,apiClient:f,cardType:r,recordedVideos:a,qrScannedResult:c,outputEncryptionSettings:s});case 5:l=e.sent,i===sM.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(Ny(Ny({},Fie.api_call_error),{},{details:e.t0}));case 13:l&&o(Ny(Ny({},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&&_w.createElement(t,Ry({logCredentials:a,onError:n,onStepDone:m,outputEncryptionSettings:s},c,{clientSettings:l}))};function zie(){return qie.apply(this,arguments)}function qie(){return(qie=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,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,i=t.blazefaceModelUrl,a=t.closeEyesModelUrl,s=new fre,e.prev=2,Nq.loadTensorFlow(o).then((function(){Nq.loadBlazefaceModel({modelUrl:i})})),e.next=6,Promise.all([F6({closeEyesModelUrl:a}),s.loadResource({modelUrl:n}),cre({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)}Vie.propTypes={onError:_k.func,onStepDone:_k.func,apiCredentials:_k.shape({accessKey:_k.string,secretKey:_k.string,apiUrl:_k.string}),logCredentials:_k.shape({}),outputEncryptionSettings:_k.shape({}),readIDCardUIOnlyComponent:_k.func},Vie.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:Cie};var Hie=j6(zie),Kie=function(){return{checkCamera:V7,LivenessDetection:$7,NativeCamera:q7,ReadIDCardUIOnly:Cie,ReadIDCardWithApiCall:Vie,warmUpReadIdCard:Are,preloadEKYCResources:Hie,getListCamera:R3}},Wie=Vy(F7,["useLivenessDetection"]);function Gie(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}var Qie=Gie;function Xie(e,t){return e&&G2(t,w4(t),e)}var Yie=Xie;function $ie(e,t){return e&&G2(t,D5(t),e)}var Zie=$ie;function Jie(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}var eae=Jie;function tae(){return[]}var rae=tae,nae=Object.prototype,oae=nae.propertyIsEnumerable,iae=Object.getOwnPropertySymbols,aae=iae?function(e){return null==e?[]:(e=Object(e),eae(iae(e),(function(t){return oae.call(e,t)})))}:rae,sae=aae;function cae(e,t){return G2(e,sae(e),t)}var uae=cae;function lae(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}var dae=lae,fae=Object.getOwnPropertySymbols,pae=fae?function(e){for(var t=[];e;)dae(t,sae(e)),e=V5(e);return t}:rae,hae=pae;function mae(e,t){return G2(e,hae(e),t)}var gae=mae;function vae(e,t,r){var n=t(e);return U1(e)?n:dae(n,r(e))}var yae=vae;function bae(e){return yae(e,w4,sae)}var wae=bae;function kae(e){return yae(e,D5,hae)}var Cae=kae,Bae=D2(g0,"DataView"),Sae=Bae,Eae=D2(g0,"Promise"),_ae=Eae,xae=D2(g0,"Set"),Tae=xae,Aae=D2(g0,"WeakMap"),Pae=Aae,Iae="[object Map]",Rae="[object Object]",Oae="[object Promise]",Nae="[object Set]",Dae="[object WeakMap]",Mae="[object DataView]",Lae=C2(Sae),Uae=C2(H8),jae=C2(_ae),Fae=C2(Tae),Vae=C2(Pae),zae=V0;(Sae&&zae(new Sae(new ArrayBuffer(1)))!=Mae||H8&&zae(new H8)!=Iae||_ae&&zae(_ae.resolve())!=Oae||Tae&&zae(new Tae)!=Nae||Pae&&zae(new Pae)!=Dae)&&(zae=function(e){var t=V0(e),r=t==Rae?e.constructor:void 0,n=r?C2(r):"";if(n)switch(n){case Lae:return Mae;case Uae:return Iae;case jae:return Oae;case Fae:return Nae;case Vae:return Dae}return t});var qae=zae,Hae=Object.prototype,Kae=Hae.hasOwnProperty;function Wae(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Kae.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Gae=Wae;function Qae(e,t){var r=t?Zoe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Xae=Qae,Yae=/\w*$/;function $ae(e){var t=new e.constructor(e.source,Yae.exec(e));return t.lastIndex=e.lastIndex,t}var Zae=$ae,Jae=_0?_0.prototype:void 0,ese=Jae?Jae.valueOf:void 0;function tse(e){return ese?Object(ese.call(e)):{}}var rse=tse,nse="[object Boolean]",ose="[object Date]",ise="[object Map]",ase="[object Number]",sse="[object RegExp]",cse="[object Set]",use="[object String]",lse="[object Symbol]",dse="[object ArrayBuffer]",fse="[object DataView]",pse="[object Float32Array]",hse="[object Float64Array]",mse="[object Int8Array]",gse="[object Int16Array]",vse="[object Int32Array]",yse="[object Uint8Array]",bse="[object Uint8ClampedArray]",wse="[object Uint16Array]",kse="[object Uint32Array]";function Cse(e,t,r){var n=e.constructor;switch(t){case dse:return Zoe(e);case nse:case ose:return new n(+e);case fse:return Xae(e,r);case pse:case hse:case mse:case gse:case vse:case yse:case bse:case wse:case kse:return eie(e,r);case ise:return new n;case ase:case use:return new n(e);case sse:return Zae(e);case cse:return new n;case lse:return rse(e)}}var Bse=Cse,Sse="[object Map]";function Ese(e){return q0(e)&&qae(e)==Sse}var _se=Ese,xse=v5&&v5.isMap,Tse=xse?g5(xse):_se,Ase=Tse,Pse="[object Set]";function Ise(e){return q0(e)&&qae(e)==Pse}var Rse=Ise,Ose=v5&&v5.isSet,Nse=Ose?g5(Ose):Rse,Dse=Nse,Mse=1,Lse=2,Use=4,jse="[object Arguments]",Fse="[object Array]",Vse="[object Boolean]",zse="[object Date]",qse="[object Error]",Hse="[object Function]",Kse="[object GeneratorFunction]",Wse="[object Map]",Gse="[object Number]",Qse="[object Object]",Xse="[object RegExp]",Yse="[object Set]",$se="[object String]",Zse="[object Symbol]",Jse="[object WeakMap]",ece="[object ArrayBuffer]",tce="[object DataView]",rce="[object Float32Array]",nce="[object Float64Array]",oce="[object Int8Array]",ice="[object Int16Array]",ace="[object Int32Array]",sce="[object Uint8Array]",cce="[object Uint8ClampedArray]",uce="[object Uint16Array]",lce="[object Uint32Array]",dce={};function fce(e,t,r,n,o,i){var a,s=t&Mse,c=t&Lse,u=t&Use;if(r&&(a=o?r(e,n,o,i):r(e)),void 0!==a)return a;if(!d0(e))return e;var l=U1(e);if(l){if(a=Gae(e),!s)return rie(e,a)}else{var d=qae(e),f=d==Hse||d==Kse;if(V1(e))return Qoe(e,s);if(d==Qse||d==jse||f&&!o){if(a=c||f?{}:sie(e),!s)return c?gae(e,Zie(a,e)):uae(e,Yie(a,e))}else{if(!dce[d])return o?e:{};a=Bse(e,d,s)}}i||(i=new Voe);var p=i.get(e);if(p)return p;i.set(e,a),Dse(e)?e.forEach((function(n){a.add(fce(n,t,r,n,e,i))})):Ase(e)&&e.forEach((function(n,o){a.set(o,fce(n,t,r,o,e,i))}));var h=l?void 0:(u?c?Cae:wae:c?D5:w4)(e);return Qie(h||e,(function(n,o){h&&(n=e[o=n]),K2(a,o,fce(n,t,r,o,e,i))})),a}dce[jse]=dce[Fse]=dce[ece]=dce[tce]=dce[Vse]=dce[zse]=dce[rce]=dce[nce]=dce[oce]=dce[ice]=dce[ace]=dce[Wse]=dce[Gse]=dce[Qse]=dce[Xse]=dce[Yse]=dce[$se]=dce[Zse]=dce[sce]=dce[cce]=dce[uce]=dce[lce]=!0,dce[qse]=dce[Hse]=dce[Jse]=!1;var pce=fce;function hce(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var mce=hce;function gce(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}var vce=gce;function yce(e,t){return t.length<2?e:B6(e,vce(t,0,-1))}var bce=yce;function wce(e,t){return t=y6(t,e),null==(e=bce(e,t))||delete e[k6(mce(t))]}var kce=wce;function Cce(e){return X5(e)?void 0:e}var Bce=Cce,Sce=_0?_0.isConcatSpreadable:void 0;function Ece(e){return U1(e)||M1(e)||!!(Sce&&e&&e[Sce])}var _ce=Ece;function xce(e,t,r,n,o){var i=-1,a=e.length;for(r||(r=_ce),o||(o=[]);++i<a;){var s=e[i];t>0&&r(s)?t>1?xce(s,t-1,r,n,o):dae(o,s):n||(o[o.length]=s)}return o}var Tce=xce;function Ace(e){return(null==e?0:e.length)?Tce(e,1):[]}var Pce=Ace;function Ice(e){return d1(e1(e,void 0,Pce),e+"")}var Rce,Oce,Nce,Dce,Mce,Lce,Uce,jce,Fce,Vce,zce,qce,Hce,Kce,Wce,Gce,Qce=Ice,Xce=1,Yce=2,$ce=4,Zce=Qce((function(e,t){var r={};if(null==e)return r;var n=!1;t=n4(t,(function(t){return t=y6(t,e),n||(n=t.length>1),t})),G2(e,Cae(e),r),n&&(r=pce(r,Xce|Yce|$ce,Bce));for(var o=t.length;o--;)kce(r,t[o]);return r})),Jce=Zce,eue=$ee,tue=dte,rue=cte,nue=(eue.animationDuration,rue.default),oue=100,iue=lE.div(Rce||(Rce=Ky(["\n ","\n ","\n"])),eue.default,tue.default),aue=(lE.img(Oce||(Oce=Ky(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),10),sue=78,cue=lE.div(Nce||(Nce=Ky(["\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"])),sue,q3+20,s3.isMobile?XS(["top:",";"],(function(e){return e.y})):XS(["bottom:","px;"],aue)),uue=lE.div(Dce||(Dce=Ky(["\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"])),oue,oue,q3+20),lue=lE.div(Mce||(Mce=Ky(["\n color: #fff;\n text-align: center;\n"]))),due=(lE.div(Lce||(Lce=Ky(["\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}),q3+20),lE.div(Uce||(Uce=Ky(["\n display: flex;\n align-items: center;\n"]))),lE(lue)(jce||(jce=Ky(["\n font-size: 16px;\n margin-left: 10px;\n color: #fff;\n"]))),lE.div(Fce||(Fce=Ky(["\n margin: 0;\n padding: 0 5px;\n position: absolute;\n top: ",";\n z-index: ",";\n left: 50%;\n transform: translateX(-50%);\n width: fit-content;\n"])),(function(e){return e.y}),q3+20)),fue=lE(lue)(Vce||(Vce=Ky(["\n text-align: center;\n background: ",";\n padding: 5px 10px;\n font-size: 16px;\n"])),(function(e){return e.theme.dangerColor})),pue=function(e){var t=e.children,r=e.y;return _w.createElement(due,{y:r},_w.createElement(fue,null,t))},hue=lE.div(zce||(zce=Ky(["\n background: rgba(0, 0, 0, 0.3);\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 120px;\n z-index: ",";\n"])),q3+10),mue=lE.div(qce||(qce=Ky(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),gue=lE(mue)(Hce||(Hce=Ky(["\n z-index: ",";\n position: absolute;\n top: 16px;\n right: 16px;\n width: 60px;\n"])),q3+100),vue=["width","height","type"],yue=lE(_ee)(Kce||(Kce=Ky([""]))),bue=lE.div(Wce||(Wce=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),wue=lE.img(Gce||(Gce=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),kue=function(e){var t=e.width,r=e.height,n=e.type,o=Vy(e,vue),i=YF.useAsset("id_card_frame.png"),a=YF.useAsset("id_card_frame_error.png");return _w.createElement(bue,{width:t,height:r},_w.createElement(wue,{src:n===Eee.ERROR?a:i,width:t,height:r}),_w.createElement(yue,Ry({width:t,height:r,type:n},o)))},Cue=sM.Errors,Bue={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"}},Sue=Ny(Ny({},Cue),{},{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"}}}),Eue=20,_ue={fill:"none",strokeWidth:Eue,stroke:"rgba(0, 0, 0, 0.6)"},xue=_w.forwardRef((function(e,t){var r,n=e.usePortraitMask,o=e.windowAndVideoInfo,i=e.refVideo,a=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=e.quality,f=Wy(_w.useState({}),2),p=f[0],h=f[1],m=p.yErrorMessage,g=p.yCaptureButton,v=YF.useAsset("ic_camera.svg"),y=YF.useAsset("ic_loading.png"),b=mF.useSDKSettings().lang,w=Wy(_w.useState(""),2),k=w[0],C=w[1],B=Wy(_w.useState(null),2),S=B[0],E=B[1],_=Mq.useThemeContext().dangerColor,x=_w.useRef((function(){})),T=_w.useCallback((function(e){C(null===e?"":r8(Sue[e.code].msg[b])({side:a?Bue.FRONT[b]:Bue.BACK[b]}))}),[b,a]),A=_w.useCallback((function(){x.current()}),[]),P=qre({shouldStart:!0,refVideo:i,cropArea:S,settings:s,onModelErrorChange:T,frontSide:a,onSessionTimeout:A,onCaptureDone:c,outputEncryptionSettings:l,quality:d}),I=P.warmupDone,R=P.isProcessing,O=P.takePictureManually,N=P.restartSession,D=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N();case 2:case"end":return e.stop()}}),e)}))),[N]);x.current=D,_w.useEffect((function(){if(o){var e,t,r,i,a,s,c=o.videoAreaWidth,l=o.videoAreaHeight,d=o.lostX,f=o.lostY,p=o.clientHeight;n?(i=.7*(a=l-165),r=(s=(e=f+10)+45)+a+70):(i=s3.isMobile?c-6:Math.floor(.7*c),a=Math.floor(Math.min(i/1.5,p-2*f-(sue+2*aue)-135)),r=(t=(s=(e=f+10)+(s3.isMobile?90:50))+a+10)+88);var m=Math.floor((c-i)/2)+d;E({x:m,y:s,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var g={yTitle:e,yErrorMessage:t,yCaptureButton:r};h(g),u(g)}}),[o,n,u]);var M=_w.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:case"end":return e.stop()}}),e)}))),[O]);return _w.useImperativeHandle(t,(function(){return{restartSession:D}}),[D]),_w.createElement(_w.Fragment,null,!I&&_w.createElement(t7,null),R&&_w.createElement(uue,null,_w.createElement("img",{src:y,alt:"",className:"spin"})),S&&_w.createElement(c0,{x:"".concat(S.x,"px"),y:"".concat(S.y,"px"),width:"".concat(S.width,"px"),height:"".concat(S.height,"px"),surroundStyle:S.surroundStyle},_w.createElement(kue,{strokeStyles:(r={},Iy(r,Eee.DEFAULT,_ue),Iy(r,Eee.ERROR,_ue),r),radius:20,strokeWidth:Eue,errorColor:_,width:S.width,height:S.height,type:k?Eee.ERROR:Eee.DEFAULT})),k&&_w.createElement(pue,{y:"".concat(m,"px")},k),!R&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!k)&&_w.createElement(cue,{onClick:M,y:"".concat(g,"px")},_w.createElement("img",{src:v,alt:""})),!s3.isMobile&&_w.createElement(hue,null))}));xue.propTypes={usePortraitMask:_k.bool,windowAndVideoInfo:_k.shape({}),refVideo:_k.shape({}),frontSide:_k.bool,settings:_k.shape({}),onCaptureDone:_k.func,onUISpacingChange:_k.func,outputEncryptionSettings:_k.shape({}),quality:_k.number},xue.defaultProps={usePortraitMask:!1,windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null,quality:void 0};var Tue,Aue={primaryColor:"#FDB913",dangerColor:"#D32F2F"},Pue=fE(Tue||(Tue=Ky([""]))),Iue=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","frontCamera","scannerTypeCons","quality"];function Rue(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,i=(e.defaultCameraId,e.frontCamera),a=e.scannerTypeCons,s=e.quality,c=Vy(e,Iue),u=c.numberOfCaptures,l=c.stepNumber,d=c.frontSide,f=c.scannerType,p=c.usePortraitMask,h=c.shouldShowSpinner,m=c.handleIDCardCaptureDone,g=c.refIDCardReader,v=_w.useRef(null),y=Wy(_w.useState(null),2),b=y[0],w=y[1],k=Wy(_w.useState(!1),2),C=k[0],B=k[1],S=YF.useAsset("ic_loading.png"),E=YF.useAsset("ic_close.png"),_=_w.useCallback((function(e){w(e),B(!0)}),[]);return _w.useEffect((function(){B(!1)}),[i]),_w.createElement(sE,{theme:Aue},_w.createElement(iue,null,_w.createElement(r0,{key:i,frontCamera:i,onVideoPlayed:_,onClose:t,flipHorizontal:i,ref:v,onError:r,closeButton:_w.createElement(gue,null,_w.createElement("img",{src:E,alt:""}))},C&&_w.createElement(_w.Fragment,null,f===a.ID_CARD&&_w.createElement(xue,{key:l,ref:g,windowAndVideoInfo:b,refVideo:v,settings:n,onCaptureDone:m,frontSide:d,usePortraitMask:p,outputEncryptionSettings:o,quality:s})),_w.createElement(nue,{keyForTransition:u}),h&&_w.createElement(uue,null,_w.createElement("img",{src:S,alt:"",className:"spin"})))),_w.createElement(Pue,null))}var Oue=Jce(boe,["globalStyle","styledComponent"]),Nue=Jce(woe,["globalStyle","styledComponent"]);function Due(e){var t=Eoe.map((function(e){return Ny(Ny({},e),{},{enableConfirmPopup:!1})}));return _w.createElement(Cie,Ry({},e,{uiOnlyComponent:Rue,steps:t}))}Rue.propTypes=Ny(Ny({},Oue),{},{quality:_k.number}),Rue.defaultProps=Ny(Ny({},Nue),{},{quality:void 0});var Mue,Lue=function(e){return _w.createElement(Vie,Ry({},e,{readIDCardUIOnlyComponent:Due}))},Uue=Wie.LivenessStyledComponent.CloseCameraButton,jue=lE(Uue)(Mue||(Mue=Ky(["\n width: 60px;\n"])));function Fue(e){return _w.createElement($7,Ry({},e,{styledComponent:{CloseCameraButton:_w.createElement(jue,null)}}))}var Vue=function(e){Dy(r,e);var t=Hy(r);function r(e){return Ty(this,r),t.call(this,Ny(Ny({},e),{},{baseComponent:Kie(),component:{ReadIDCardUIOnly:Due,ReadIDCardWithApiCall:Lue,LivenessDetection:Fue}}))}return r}(dK);t.APIUtils=iq,t.AntiDebugUtils=Dq,t.AssetUtils=YF,t.AsyncUtils=ZF,t.BaseTVWebSDK=dK,t.BlurUtils=CV,t.CameraUtils=SV,t.CloseEyesDetector=iK,t.CommonUtils=_V,t.Constants=sM,t.CoordinateUtils=IV,t.CryptoUtils=Uq,t.DEFAULT_CLOSE_EYE_MODEL=oK,t.ExifUtils=nK,t.FaceUtils=jV,t.GlareUtils=Yz,t.HashUtils=jF,t.ImageUtils=Wz,t.LoadResourceUtils=hq,t.LocalStorageUtils=DF,t.ModelUtils=Nq,t.PredictionUtils=VV,t.SDK=Vue,t.SDKTimer=jq,t.ScannerType=DJ,t.SettingsContext=mF,t.ThemeUtils=Mq,t.TimeUtils=RF,t.TrackingContext=GF,t.UserAgentUtils=AF,t.defaultClientSettings=a3,t.defaultReadIDCardSteps=MJ,t.getCustomUrlsBySettings=lF,t.getQrScannerWorkerPath=cK,t.getSDKVersion=xF,t.requestMotionPermission=aK,t.useDeviceMotion=sK,Object.defineProperty(t,"__esModule",{value:!0})}));