@tsocial/tvweb-sdk.tiki 0.0.0-beta.11012024
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/assets/arrow_down.svg +17 -0
- package/assets/arrow_left.svg +17 -0
- package/assets/arrow_right.svg +17 -0
- package/assets/arrow_up.svg +17 -0
- package/assets/bg_camera_mask.png +0 -0
- package/assets/bg_camera_mask_red.png +0 -0
- package/assets/frontal.svg +17 -0
- package/assets/ic_camera.png +0 -0
- package/assets/ic_camera_disabled.png +0 -0
- package/assets/ic_close.png +0 -0
- package/assets/ic_close_black.png +0 -0
- package/assets/ic_close_desktop.png +0 -0
- package/assets/ic_face_frontal.svg +8 -0
- package/assets/ic_face_left.svg +4 -0
- package/assets/ic_face_right.svg +4 -0
- package/assets/ic_face_up.svg +4 -0
- package/assets/ic_id_back.png +0 -0
- package/assets/ic_id_front.png +0 -0
- package/assets/ic_loading.png +0 -0
- package/assets/id_card_back.svg +1 -0
- package/assets/id_card_blur_bottom.png +0 -0
- package/assets/id_card_front.svg +1 -0
- package/assets/qr_capture_cursor.png +0 -0
- package/build/tvweb-sdk.cjs.min.js +84 -0
- package/build/tvweb-sdk.tiki.standalone.min.js +84 -0
- package/examples/extract-id-info-and-liveness-detection/index.html +389 -0
- package/examples/extract-id-info-and-liveness-detection/keys-input.js +71 -0
- package/examples/extract-id-info-and-liveness-detection/qr-scanner-for-input-keys.js +81 -0
- package/examples/extract-id-info-and-liveness-detection/style.css +65 -0
- package/examples/index.html +21 -0
- package/examples/native-camera/index.html +44 -0
- package/package.json +38 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TVWebSDK={})}(this,(function(t){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return a(null==t&&r.path)}},r.exports),r.exports}function a(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var i=function(e){return e&&e.Math==Math&&e},s=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r&&r)||function(){return this}()||Function("return this")(),c=function(e){try{return!!e()}catch(e){return!0}},u=!c((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),l={}.propertyIsEnumerable,d=Object.getOwnPropertyDescriptor,f=d&&!l.call({1:2},1),p=f?function(e){var t=d(this,e);return!!t&&t.enumerable}:l,h={f:p},m=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},g={}.toString,v=function(e){return g.call(e).slice(8,-1)},y="".split,b=c((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==v(e)?y.call(e,""):Object(e)}:Object,C=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},w=function(e){return b(C(e))},k=function(e){return"object"==typeof e?null!==e:"function"==typeof e},S=function(e,t){if(!k(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!k(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!k(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!k(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},E={}.hasOwnProperty,B=function(e,t){return E.call(e,t)},_=s.document,x=k(_)&&k(_.createElement),T=function(e){return x?_.createElement(e):{}},A=!u&&!c((function(){return 7!=Object.defineProperty(T("div"),"a",{get:function(){return 7}}).a})),I=Object.getOwnPropertyDescriptor,P=u?I:function(e,t){if(e=w(e),t=S(t,!0),A)try{return I(e,t)}catch(e){}if(B(e,t))return m(!h.f.call(e,t),e[t])},R={f:P},D=function(e){if(!k(e))throw TypeError(String(e)+" is not an object");return e},N=Object.defineProperty,O=u?N:function(e,t,r){if(D(e),t=S(t,!0),D(r),A)try{return N(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e},L={f:O},M=u?function(e,t,r){return L.f(e,t,m(1,r))}:function(e,t,r){return e[t]=r,e},F=function(e,t){try{M(s,e,t)}catch(r){s[e]=t}return t},U="__core-js_shared__",j=s[U]||F(U,{}),V=j,z=Function.toString;"function"!=typeof V.inspectSource&&(V.inspectSource=function(e){return z.call(e)});var q,H,K,W=V.inspectSource,Q=s.WeakMap,G="function"==typeof Q&&/native code/.test(W(Q)),X=!1,Y=o((function(e){(e.exports=function(e,t){return V[e]||(V[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.8.1",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),$=0,Z=Math.random(),J=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++$+Z).toString(36)},ee=Y("keys"),te=function(e){return ee[e]||(ee[e]=J(e))},re={},ne=s.WeakMap,oe=function(e){return K(e)?H(e):q(e,{})},ae=function(e){return function(t){var r;if(!k(t)||(r=H(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}};if(G){var ie=V.state||(V.state=new ne),se=ie.get,ce=ie.has,ue=ie.set;q=function(e,t){return t.facade=e,ue.call(ie,e,t),t},H=function(e){return se.call(ie,e)||{}},K=function(e){return ce.call(ie,e)}}else{var le=te("state");re[le]=!0,q=function(e,t){return t.facade=e,M(e,le,t),t},H=function(e){return B(e,le)?e[le]:{}},K=function(e){return B(e,le)}}var de,fe={set:q,get:H,has:K,enforce:oe,getterFor:ae},pe=o((function(e){var t=fe.get,r=fe.enforce,n=String(String).split("String");(e.exports=function(e,t,o,a){var i,c=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,l=!!a&&!!a.noTargetGet;"function"==typeof o&&("string"!=typeof t||B(o,"name")||M(o,"name",t),(i=r(o)).source||(i.source=n.join("string"==typeof t?t:""))),e!==s?(c?!l&&e[t]&&(u=!0):delete e[t],u?e[t]=o:M(e,t,o)):u?e[t]=o:F(t,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||W(this)}))})),he=s,me=function(e){return"function"==typeof e?e:void 0},ge=function(e,t){return arguments.length<2?me(he[e])||me(s[e]):he[e]&&he[e][t]||s[e]&&s[e][t]},ve=Math.ceil,ye=Math.floor,be=function(e){return isNaN(e=+e)?0:(e>0?ye:ve)(e)},Ce=Math.min,we=function(e){return e>0?Ce(be(e),9007199254740991):0},ke=Math.max,Se=Math.min,Ee=function(e,t){var r=be(e);return r<0?ke(r+t,0):Se(r,t)},Be=function(e){return function(t,r,n){var o,a=w(t),i=we(a.length),s=Ee(n,i);if(e&&r!=r){for(;i>s;)if((o=a[s++])!=o)return!0}else for(;i>s;s++)if((e||s in a)&&a[s]===r)return e||s||0;return!e&&-1}},_e={includes:Be(!0),indexOf:Be(!1)},xe=_e.indexOf,Te=function(e,t){var r,n=w(e),o=0,a=[];for(r in n)!B(re,r)&&B(n,r)&&a.push(r);for(;t.length>o;)B(n,r=t[o++])&&(~xe(a,r)||a.push(r));return a},Ae=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ie=Ae.concat("length","prototype"),Pe=Object.getOwnPropertyNames||function(e){return Te(e,Ie)},Re={f:Pe},De=Object.getOwnPropertySymbols,Ne={f:De},Oe=ge("Reflect","ownKeys")||function(e){var t=Re.f(D(e)),r=Ne.f;return r?t.concat(r(e)):t},Le=function(e,t){for(var r=Oe(t),n=L.f,o=R.f,a=0;a<r.length;a++){var i=r[a];B(e,i)||n(e,i,o(t,i))}},Me=/#|\.prototype\./,Fe=function(e,t){var r=je[Ue(e)];return r==ze||r!=Ve&&("function"==typeof t?c(t):!!t)},Ue=Fe.normalize=function(e){return String(e).replace(Me,".").toLowerCase()},je=Fe.data={},Ve=Fe.NATIVE="N",ze=Fe.POLYFILL="P",qe=Fe,He=R.f,Ke=function(e,t){var r,n,o,a,i,c=e.target,u=e.global,l=e.stat;if(r=u?s:l?s[c]||F(c,{}):(s[c]||{}).prototype)for(n in t){if(a=t[n],o=e.noTargetGet?(i=He(r,n))&&i.value:r[n],!qe(u?n:c+(l?".":"#")+n,e.forced)&&void 0!==o){if(typeof a==typeof o)continue;Le(a,o)}(e.sham||o&&o.sham)&&M(a,"sham",!0),pe(r,n,a,e)}},We=!!Object.getOwnPropertySymbols&&!c((function(){return!String(Symbol())})),Qe=We&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ge=Array.isArray||function(e){return"Array"==v(e)},Xe=function(e){return Object(C(e))},Ye=Object.keys||function(e){return Te(e,Ae)},$e=u?Object.defineProperties:function(e,t){D(e);for(var r,n=Ye(t),o=n.length,a=0;o>a;)L.f(e,r=n[a++],t[r]);return e},Ze=ge("document","documentElement"),Je=">",et="<",tt="prototype",rt="script",nt=te("IE_PROTO"),ot=function(){},at=function(e){return et+rt+Je+e+et+"/"+rt+Je},it=function(e){e.write(at("")),e.close();var t=e.parentWindow.Object;return e=null,t},st=function(){var e,t=T("iframe"),r="java"+rt+":";return t.style.display="none",Ze.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(at("document.F=Object")),e.close(),e.F},ct=function(){try{de=document.domain&&new ActiveXObject("htmlfile")}catch(e){}ct=de?it(de):st();for(var e=Ae.length;e--;)delete ct[tt][Ae[e]];return ct()};re[nt]=!0;var ut=Object.create||function(e,t){var r;return null!==e?(ot[tt]=D(e),r=new ot,ot[tt]=null,r[nt]=e):r=ct(),void 0===t?r:$e(r,t)},lt=Re.f,dt={}.toString,ft="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],pt=function(e){try{return lt(e)}catch(e){return ft.slice()}},ht=function(e){return ft&&"[object Window]"==dt.call(e)?pt(e):lt(w(e))},mt={f:ht},gt=Y("wks"),vt=s.Symbol,yt=Qe?vt:vt&&vt.withoutSetter||J,bt=function(e){return B(gt,e)||(We&&B(vt,e)?gt[e]=vt[e]:gt[e]=yt("Symbol."+e)),gt[e]},Ct=bt,wt={f:Ct},kt=L.f,St=function(e){var t=he.Symbol||(he.Symbol={});B(t,e)||kt(t,e,{value:wt.f(e)})},Et=L.f,Bt=bt("toStringTag"),_t=function(e,t,r){e&&!B(e=r?e:e.prototype,Bt)&&Et(e,Bt,{configurable:!0,value:t})},xt=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Tt=function(e,t,r){if(xt(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}},At=bt("species"),It=function(e,t){var r;return Ge(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!Ge(r.prototype)?k(r)&&null===(r=r[At])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)},Pt=[].push,Rt=function(e){var t=1==e,r=2==e,n=3==e,o=4==e,a=6==e,i=7==e,s=5==e||a;return function(c,u,l,d){for(var f,p,h=Xe(c),m=b(h),g=Tt(u,l,3),v=we(m.length),y=0,C=d||It,w=t?C(c,v):r||i?C(c,0):void 0;v>y;y++)if((s||y in m)&&(p=g(f=m[y],y,h),e))if(t)w[y]=p;else if(p)switch(e){case 3:return!0;case 5:return f;case 6:return y;case 2:Pt.call(w,f)}else switch(e){case 4:return!1;case 7:Pt.call(w,f)}return a?-1:n||o?o:w}},Dt={forEach:Rt(0),map:Rt(1),filter:Rt(2),some:Rt(3),every:Rt(4),find:Rt(5),findIndex:Rt(6),filterOut:Rt(7)},Nt=Dt.forEach,Ot=te("hidden"),Lt="Symbol",Mt="prototype",Ft=bt("toPrimitive"),Ut=fe.set,jt=fe.getterFor(Lt),Vt=Object[Mt],zt=s.Symbol,qt=ge("JSON","stringify"),Ht=R.f,Kt=L.f,Wt=mt.f,Qt=h.f,Gt=Y("symbols"),Xt=Y("op-symbols"),Yt=Y("string-to-symbol-registry"),$t=Y("symbol-to-string-registry"),Zt=Y("wks"),Jt=s.QObject,er=!Jt||!Jt[Mt]||!Jt[Mt].findChild,tr=u&&c((function(){return 7!=ut(Kt({},"a",{get:function(){return Kt(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Ht(Vt,t);n&&delete Vt[t],Kt(e,t,r),n&&e!==Vt&&Kt(Vt,t,n)}:Kt,rr=function(e,t){var r=Gt[e]=ut(zt[Mt]);return Ut(r,{type:Lt,tag:e,description:t}),u||(r.description=t),r},nr=Qe?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof zt},or=function(e,t,r){e===Vt&&or(Xt,t,r),D(e);var n=S(t,!0);return D(r),B(Gt,n)?(r.enumerable?(B(e,Ot)&&e[Ot][n]&&(e[Ot][n]=!1),r=ut(r,{enumerable:m(0,!1)})):(B(e,Ot)||Kt(e,Ot,m(1,{})),e[Ot][n]=!0),tr(e,n,r)):Kt(e,n,r)},ar=function(e,t){D(e);var r=w(t),n=Ye(r).concat(lr(r));return Nt(n,(function(t){u&&!sr.call(r,t)||or(e,t,r[t])})),e},ir=function(e,t){return void 0===t?ut(e):ar(ut(e),t)},sr=function(e){var t=S(e,!0),r=Qt.call(this,t);return!(this===Vt&&B(Gt,t)&&!B(Xt,t))&&(!(r||!B(this,t)||!B(Gt,t)||B(this,Ot)&&this[Ot][t])||r)},cr=function(e,t){var r=w(e),n=S(t,!0);if(r!==Vt||!B(Gt,n)||B(Xt,n)){var o=Ht(r,n);return!o||!B(Gt,n)||B(r,Ot)&&r[Ot][n]||(o.enumerable=!0),o}},ur=function(e){var t=Wt(w(e)),r=[];return Nt(t,(function(e){B(Gt,e)||B(re,e)||r.push(e)})),r},lr=function(e){var t=e===Vt,r=Wt(t?Xt:w(e)),n=[];return Nt(r,(function(e){!B(Gt,e)||t&&!B(Vt,e)||n.push(Gt[e])})),n};if(We||(pe((zt=function(){if(this instanceof zt)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=J(e),r=function(e){this===Vt&&r.call(Xt,e),B(this,Ot)&&B(this[Ot],t)&&(this[Ot][t]=!1),tr(this,t,m(1,e))};return u&&er&&tr(Vt,t,{configurable:!0,set:r}),rr(t,e)})[Mt],"toString",(function(){return jt(this).tag})),pe(zt,"withoutSetter",(function(e){return rr(J(e),e)})),h.f=sr,L.f=or,R.f=cr,Re.f=mt.f=ur,Ne.f=lr,wt.f=function(e){return rr(bt(e),e)},u&&(Kt(zt[Mt],"description",{configurable:!0,get:function(){return jt(this).description}}),pe(Vt,"propertyIsEnumerable",sr,{unsafe:!0}))),Ke({global:!0,wrap:!0,forced:!We,sham:!We},{Symbol:zt}),Nt(Ye(Zt),(function(e){St(e)})),Ke({target:Lt,stat:!0,forced:!We},{for:function(e){var t=String(e);if(B(Yt,t))return Yt[t];var r=zt(t);return Yt[t]=r,$t[r]=t,r},keyFor:function(e){if(!nr(e))throw TypeError(e+" is not a symbol");if(B($t,e))return $t[e]},useSetter:function(){er=!0},useSimple:function(){er=!1}}),Ke({target:"Object",stat:!0,forced:!We,sham:!u},{create:ir,defineProperty:or,defineProperties:ar,getOwnPropertyDescriptor:cr}),Ke({target:"Object",stat:!0,forced:!We},{getOwnPropertyNames:ur,getOwnPropertySymbols:lr}),Ke({target:"Object",stat:!0,forced:c((function(){Ne.f(1)}))},{getOwnPropertySymbols:function(e){return Ne.f(Xe(e))}}),qt){var dr=!We||c((function(){var e=zt();return"[null]"!=qt([e])||"{}"!=qt({a:e})||"{}"!=qt(Object(e))}));Ke({target:"JSON",stat:!0,forced:dr},{stringify:function(e,t,r){for(var n,o=[e],a=1;arguments.length>a;)o.push(arguments[a++]);if(n=t,(k(t)||void 0!==e)&&!nr(e))return Ge(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!nr(t))return t}),o[1]=t,qt.apply(null,o)}})}zt[Mt][Ft]||M(zt[Mt],Ft,zt[Mt].valueOf),_t(zt,Lt),re[Ot]=!0,St("asyncIterator");var fr=L.f,pr=s.Symbol;if(u&&"function"==typeof pr&&(!("description"in pr.prototype)||void 0!==pr().description)){var hr={},mr=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof mr?new pr(e):void 0===e?pr():pr(e);return""===e&&(hr[t]=!0),t};Le(mr,pr);var gr=mr.prototype=pr.prototype;gr.constructor=mr;var vr=gr.toString,yr="Symbol(test)"==String(pr("test")),br=/^Symbol\((.*)\)[^)]+$/;fr(gr,"description",{configurable:!0,get:function(){var e=k(this)?this.valueOf():this,t=vr.call(e);if(B(hr,e))return"";var r=yr?t.slice(7,-1):t.replace(br,"$1");return""===r?void 0:r}}),Ke({global:!0,forced:!0},{Symbol:mr})}St("hasInstance"),St("isConcatSpreadable"),St("iterator"),St("match"),St("matchAll"),St("replace"),St("search"),St("species"),St("split"),St("toPrimitive"),St("toStringTag"),St("unscopables");var Cr=!c((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),wr=te("IE_PROTO"),kr=Object.prototype,Sr=Cr?Object.getPrototypeOf:function(e){return e=Xe(e),B(e,wr)?e[wr]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?kr:null},Er=function(e){if(!k(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},Br=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return D(r),Er(n),t?e.call(r,n):r.__proto__=n,r}}():void 0),_r={},xr=bt("iterator"),Tr=Array.prototype,Ar=function(e){return void 0!==e&&(_r.Array===e||Tr[xr]===e)},Ir=bt("toStringTag"),Pr={};Pr[Ir]="z";var Rr="[object z]"===String(Pr),Dr=bt("toStringTag"),Nr="Arguments"==v(function(){return arguments}()),Or=function(e,t){try{return e[t]}catch(e){}},Lr=Rr?v:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=Or(t=Object(e),Dr))?r:Nr?v(t):"Object"==(n=v(t))&&"function"==typeof t.callee?"Arguments":n},Mr=bt("iterator"),Fr=function(e){if(null!=e)return e[Mr]||e["@@iterator"]||_r[Lr(e)]},Ur=function(e){var t=e.return;if(void 0!==t)return D(t.call(e)).value},jr=function(e,t){this.stopped=e,this.result=t},Vr=function(e,t,r){var n,o,a,i,s,c,u,l=r&&r.that,d=!(!r||!r.AS_ENTRIES),f=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),h=Tt(t,l,1+d+p),m=function(e){return n&&Ur(n),new jr(!0,e)},g=function(e){return d?(D(e),p?h(e[0],e[1],m):h(e[0],e[1])):p?h(e,m):h(e)};if(f)n=e;else{if("function"!=typeof(o=Fr(e)))throw TypeError("Target is not iterable");if(Ar(o)){for(a=0,i=we(e.length);i>a;a++)if((s=g(e[a]))&&s instanceof jr)return s;return new jr(!1)}n=o.call(e)}for(c=n.next;!(u=c.call(n)).done;){try{s=g(u.value)}catch(e){throw Ur(n),e}if("object"==typeof s&&s&&s instanceof jr)return s}return new jr(!1)},zr=function(e,t){var r=this;if(!(r instanceof zr))return new zr(e,t);Br&&(r=Br(new Error(void 0),Sr(r))),void 0!==t&&M(r,"message",String(t));var n=[];return Vr(e,n.push,{that:n}),M(r,"errors",n),r};zr.prototype=ut(Error.prototype,{constructor:m(5,zr),message:m(5,""),name:m(5,"AggregateError")}),Ke({global:!0},{AggregateError:zr});var qr=function(e,t,r,n){try{return n?t(D(r)[0],r[1]):t(r)}catch(t){throw Ur(e),t}},Hr=function(e,t,r){var n=S(t);n in e?L.f(e,n,m(0,r)):e[n]=r},Kr=function(e){var t,r,n,o,a,i,s=Xe(e),c="function"==typeof this?this:Array,u=arguments.length,l=u>1?arguments[1]:void 0,d=void 0!==l,f=Fr(s),p=0;if(d&&(l=Tt(l,u>2?arguments[2]:void 0,2)),null==f||c==Array&&Ar(f))for(r=new c(t=we(s.length));t>p;p++)i=d?l(s[p],p):s[p],Hr(r,p,i);else for(a=(o=f.call(s)).next,r=new c;!(n=a.call(o)).done;p++)i=d?qr(o,l,[n.value,p],!0):n.value,Hr(r,p,i);return r.length=p,r},Wr=bt("iterator"),Qr=!1;try{var Gr=0,Xr={next:function(){return{done:!!Gr++}},return:function(){Qr=!0}};Xr[Wr]=function(){return this},Array.from(Xr,(function(){throw 2}))}catch(e){}var Yr=function(e,t){if(!t&&!Qr)return!1;var r=!1;try{var n={};n[Wr]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},$r=!Yr((function(e){Array.from(e)}));Ke({target:"Array",stat:!0,forced:$r},{from:Kr}),Ke({target:"Array",stat:!0},{isArray:Ge});var Zr=c((function(){function e(){}return!(Array.of.call(e)instanceof e)}));Ke({target:"Array",stat:!0,forced:Zr},{of:function(){for(var e=0,t=arguments.length,r=new("function"==typeof this?this:Array)(t);t>e;)Hr(r,e,arguments[e++]);return r.length=t,r}});var Jr,en,tn=ge("navigator","userAgent")||"",rn=s.process,nn=rn&&rn.versions,on=nn&&nn.v8;on?en=(Jr=on.split("."))[0]+Jr[1]:tn&&(!(Jr=tn.match(/Edge\/(\d+)/))||Jr[1]>=74)&&(Jr=tn.match(/Chrome\/(\d+)/))&&(en=Jr[1]);var an=en&&+en,sn=bt("species"),cn=function(e){return an>=51||!c((function(){var t=[];return(t.constructor={})[sn]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},un=bt("isConcatSpreadable"),ln=9007199254740991,dn="Maximum allowed index exceeded",fn=an>=51||!c((function(){var e=[];return e[un]=!1,e.concat()[0]!==e})),pn=cn("concat"),hn=function(e){if(!k(e))return!1;var t=e[un];return void 0!==t?!!t:Ge(e)},mn=!fn||!pn;Ke({target:"Array",proto:!0,forced:mn},{concat:function(e){var t,r,n,o,a,i=Xe(this),s=It(i,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(hn(a=-1===t?i:arguments[t])){if(c+(o=we(a.length))>ln)throw TypeError(dn);for(r=0;r<o;r++,c++)r in a&&Hr(s,c,a[r])}else{if(c>=ln)throw TypeError(dn);Hr(s,c++,a)}return s.length=c,s}});var gn=Math.min,vn=[].copyWithin||function(e,t){var r=Xe(this),n=we(r.length),o=Ee(e,n),a=Ee(t,n),i=arguments.length>2?arguments[2]:void 0,s=gn((void 0===i?n:Ee(i,n))-a,n-o),c=1;for(a<o&&o<a+s&&(c=-1,a+=s-1,o+=s-1);s-- >0;)a in r?r[o]=r[a]:delete r[o],o+=c,a+=c;return r},yn=bt("unscopables"),bn=Array.prototype;null==bn[yn]&&L.f(bn,yn,{configurable:!0,value:ut(null)});var Cn=function(e){bn[yn][e]=!0};Ke({target:"Array",proto:!0},{copyWithin:vn}),Cn("copyWithin");var wn=function(e,t){var r=[][e];return!!r&&c((function(){r.call(null,t||function(){throw 1},1)}))},kn=Object.defineProperty,Sn={},En=function(e){throw e},Bn=function(e,t){if(B(Sn,e))return Sn[e];t||(t={});var r=[][e],n=!!B(t,"ACCESSORS")&&t.ACCESSORS,o=B(t,0)?t[0]:En,a=B(t,1)?t[1]:void 0;return Sn[e]=!!r&&!c((function(){if(n&&!u)return!0;var e={length:-1};n?kn(e,1,{enumerable:!0,get:En}):e[1]=1,r.call(e,o,a)}))},_n=Dt.every,xn=wn("every"),Tn=Bn("every");Ke({target:"Array",proto:!0,forced:!xn||!Tn},{every:function(e){return _n(this,e,arguments.length>1?arguments[1]:void 0)}});var An=function(e){for(var t=Xe(this),r=we(t.length),n=arguments.length,o=Ee(n>1?arguments[1]:void 0,r),a=n>2?arguments[2]:void 0,i=void 0===a?r:Ee(a,r);i>o;)t[o++]=e;return t};Ke({target:"Array",proto:!0},{fill:An}),Cn("fill");var In=Dt.filter,Pn=cn("filter"),Rn=Bn("filter");Ke({target:"Array",proto:!0,forced:!Pn||!Rn},{filter:function(e){return In(this,e,arguments.length>1?arguments[1]:void 0)}});var Dn=Dt.find,Nn="find",On=!0,Ln=Bn(Nn);Nn in[]&&Array(1)[Nn]((function(){On=!1})),Ke({target:"Array",proto:!0,forced:On||!Ln},{find:function(e){return Dn(this,e,arguments.length>1?arguments[1]:void 0)}}),Cn(Nn);var Mn=Dt.findIndex,Fn="findIndex",Un=!0,jn=Bn(Fn);Fn in[]&&Array(1)[Fn]((function(){Un=!1})),Ke({target:"Array",proto:!0,forced:Un||!jn},{findIndex:function(e){return Mn(this,e,arguments.length>1?arguments[1]:void 0)}}),Cn(Fn);var Vn=function(e,t,r,n,o,a,i,s){for(var c,u=o,l=0,d=!!i&&Tt(i,s,3);l<n;){if(l in r){if(c=d?d(r[l],l,t):r[l],a>0&&Ge(c))u=Vn(e,t,c,we(c.length),u,a-1)-1;else{if(u>=9007199254740991)throw TypeError("Exceed the acceptable array length");e[u]=c}u++}l++}return u},zn=Vn;Ke({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=Xe(this),r=we(t.length),n=It(t,0);return n.length=zn(n,t,t,r,0,void 0===e?1:be(e)),n}}),Ke({target:"Array",proto:!0},{flatMap:function(e){var t,r=Xe(this),n=we(r.length);return xt(e),(t=It(r,0)).length=zn(t,r,r,n,0,1,e,arguments.length>1?arguments[1]:void 0),t}});var qn=Dt.forEach,Hn=wn("forEach"),Kn=Bn("forEach"),Wn=Hn&&Kn?[].forEach:function(e){return qn(this,e,arguments.length>1?arguments[1]:void 0)};Ke({target:"Array",proto:!0,forced:[].forEach!=Wn},{forEach:Wn});var Qn=_e.includes,Gn=Bn("indexOf",{ACCESSORS:!0,1:0});Ke({target:"Array",proto:!0,forced:!Gn},{includes:function(e){return Qn(this,e,arguments.length>1?arguments[1]:void 0)}}),Cn("includes");var Xn=_e.indexOf,Yn=[].indexOf,$n=!!Yn&&1/[1].indexOf(1,-0)<0,Zn=wn("indexOf"),Jn=Bn("indexOf",{ACCESSORS:!0,1:0});Ke({target:"Array",proto:!0,forced:$n||!Zn||!Jn},{indexOf:function(e){return $n?Yn.apply(this,arguments)||0:Xn(this,e,arguments.length>1?arguments[1]:void 0)}});var eo=[].join,to=b!=Object,ro=wn("join",",");Ke({target:"Array",proto:!0,forced:to||!ro},{join:function(e){return eo.call(w(this),void 0===e?",":e)}});var no=Math.min,oo=[].lastIndexOf,ao=!!oo&&1/[1].lastIndexOf(1,-0)<0,io=wn("lastIndexOf"),so=Bn("indexOf",{ACCESSORS:!0,1:0}),co=ao||!io||!so,uo=co?function(e){if(ao)return oo.apply(this,arguments)||0;var t=w(this),r=we(t.length),n=r-1;for(arguments.length>1&&(n=no(n,be(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:oo;Ke({target:"Array",proto:!0,forced:uo!==[].lastIndexOf},{lastIndexOf:uo});var lo=Dt.map,fo=cn("map"),po=Bn("map");Ke({target:"Array",proto:!0,forced:!fo||!po},{map:function(e){return lo(this,e,arguments.length>1?arguments[1]:void 0)}});var ho=function(e){return function(t,r,n,o){xt(r);var a=Xe(t),i=b(a),s=we(a.length),c=e?s-1:0,u=e?-1:1;if(n<2)for(;;){if(c in i){o=i[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw TypeError("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=u)c in i&&(o=r(o,i[c],c,a));return o}},mo={left:ho(!1),right:ho(!0)},go="process"==v(s.process),vo=mo.left,yo=wn("reduce"),bo=Bn("reduce",{1:0}),Co=!go&&an>79&&an<83;Ke({target:"Array",proto:!0,forced:!yo||!bo||Co},{reduce:function(e){return vo(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var wo=mo.right,ko=wn("reduceRight"),So=Bn("reduce",{1:0}),Eo=!go&&an>79&&an<83;Ke({target:"Array",proto:!0,forced:!ko||!So||Eo},{reduceRight:function(e){return wo(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Bo=[].reverse,_o=[1,2];Ke({target:"Array",proto:!0,forced:String(_o)===String(_o.reverse())},{reverse:function(){return Ge(this)&&(this.length=this.length),Bo.call(this)}});var xo=cn("slice"),To=Bn("slice",{ACCESSORS:!0,0:0,1:2}),Ao=bt("species"),Io=[].slice,Po=Math.max;Ke({target:"Array",proto:!0,forced:!xo||!To},{slice:function(e,t){var r,n,o,a=w(this),i=we(a.length),s=Ee(e,i),c=Ee(void 0===t?i:t,i);if(Ge(a)&&("function"!=typeof(r=a.constructor)||r!==Array&&!Ge(r.prototype)?k(r)&&null===(r=r[Ao])&&(r=void 0):r=void 0,r===Array||void 0===r))return Io.call(a,s,c);for(n=new(void 0===r?Array:r)(Po(c-s,0)),o=0;s<c;s++,o++)s in a&&Hr(n,o,a[s]);return n.length=o,n}});var Ro=Dt.some,Do=wn("some"),No=Bn("some");Ke({target:"Array",proto:!0,forced:!Do||!No},{some:function(e){return Ro(this,e,arguments.length>1?arguments[1]:void 0)}});var Oo=[],Lo=Oo.sort,Mo=c((function(){Oo.sort(void 0)})),Fo=c((function(){Oo.sort(null)})),Uo=wn("sort"),jo=Mo||!Fo||!Uo;Ke({target:"Array",proto:!0,forced:jo},{sort:function(e){return void 0===e?Lo.call(Xe(this)):Lo.call(Xe(this),xt(e))}});var Vo=cn("splice"),zo=Bn("splice",{ACCESSORS:!0,0:0,1:2}),qo=Math.max,Ho=Math.min,Ko=9007199254740991,Wo="Maximum allowed length exceeded";Ke({target:"Array",proto:!0,forced:!Vo||!zo},{splice:function(e,t){var r,n,o,a,i,s,c=Xe(this),u=we(c.length),l=Ee(e,u),d=arguments.length;if(0===d?r=n=0:1===d?(r=0,n=u-l):(r=d-2,n=Ho(qo(be(t),0),u-l)),u+r-n>Ko)throw TypeError(Wo);for(o=It(c,n),a=0;a<n;a++)(i=l+a)in c&&Hr(o,a,c[i]);if(o.length=n,r<n){for(a=l;a<u-n;a++)s=a+r,(i=a+n)in c?c[s]=c[i]:delete c[s];for(a=u;a>u-n+r;a--)delete c[a-1]}else if(r>n)for(a=u-n;a>l;a--)s=a+r-1,(i=a+n-1)in c?c[s]=c[i]:delete c[s];for(a=0;a<r;a++)c[a+l]=arguments[a+2];return c.length=u-n+r,o}});var Qo=bt("species"),Go=function(e){var t=ge(e),r=L.f;u&&t&&!t[Qo]&&r(t,Qo,{configurable:!0,get:function(){return this}})};Go("Array"),Cn("flat"),Cn("flatMap");var Xo,Yo,$o,Zo=bt("iterator"),Jo=!1,ea=function(){return this};[].keys&&("next"in($o=[].keys())?(Yo=Sr(Sr($o)))!==Object.prototype&&(Xo=Yo):Jo=!0),null==Xo&&(Xo={}),B(Xo,Zo)||M(Xo,Zo,ea);var ta={IteratorPrototype:Xo,BUGGY_SAFARI_ITERATORS:Jo},ra=ta.IteratorPrototype,na=function(){return this},oa=function(e,t,r){var n=t+" Iterator";return e.prototype=ut(ra,{next:m(1,r)}),_t(e,n,!1),_r[n]=na,e},aa=ta.IteratorPrototype,ia=ta.BUGGY_SAFARI_ITERATORS,sa=bt("iterator"),ca="keys",ua="values",la="entries",da=function(){return this},fa=function(e,t,r,n,o,a,i){oa(r,t,n);var s,c,u,l=function(e){if(e===o&&m)return m;if(!ia&&e in p)return p[e];switch(e){case ca:case ua:case la:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,p=e.prototype,h=p[sa]||p["@@iterator"]||o&&p[o],m=!ia&&h||l(o),g="Array"==t&&p.entries||h;if(g&&(s=Sr(g.call(new e)),aa!==Object.prototype&&s.next&&(Sr(s)!==aa&&(Br?Br(s,aa):"function"!=typeof s[sa]&&M(s,sa,da)),_t(s,d,!0))),o==ua&&h&&h.name!==ua&&(f=!0,m=function(){return h.call(this)}),p[sa]!==m&&M(p,sa,m),_r[t]=m,o)if(c={values:l(ua),keys:a?m:l(ca),entries:l(la)},i)for(u in c)(ia||f||!(u in p))&&pe(p,u,c[u]);else Ke({target:t,proto:!0,forced:ia||f},c);return c},pa="Array Iterator",ha=fe.set,ma=fe.getterFor(pa),ga=fa(Array,"Array",(function(e,t){ha(this,{type:pa,target:w(e),index:0,kind:t})}),(function(){var e=ma(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");_r.Arguments=_r.Array,Cn("keys"),Cn("values"),Cn("entries");var va=[].slice,ya={},ba=function(e,t,r){if(!(t in ya)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";ya[t]=Function("C,a","return new C("+n.join(",")+")")}return ya[t](e,r)},Ca=Function.bind||function(e){var t=xt(this),r=va.call(arguments,1),n=function(){var o=r.concat(va.call(arguments));return this instanceof n?ba(t,o.length,o):t.apply(e,o)};return k(t.prototype)&&(n.prototype=t.prototype),n};Ke({target:"Function",proto:!0},{bind:Ca});var wa=L.f,ka=Function.prototype,Sa=ka.toString,Ea=/^\s*function ([^ (]*)/,Ba="name";u&&!(Ba in ka)&&wa(ka,Ba,{configurable:!0,get:function(){try{return Sa.call(this).match(Ea)[1]}catch(e){return""}}});var _a=bt("hasInstance"),xa=Function.prototype;_a in xa||L.f(xa,_a,{value:function(e){if("function"!=typeof this||!k(e))return!1;if(!k(this.prototype))return e instanceof this;for(;e=Sr(e);)if(this.prototype===e)return!0;return!1}}),Ke({global:!0},{globalThis:s});var Ta=Object.assign,Aa=Object.defineProperty,Ia=!Ta||c((function(){if(u&&1!==Ta({b:1},Ta(Aa({},"a",{enumerable:!0,get:function(){Aa(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=Ta({},e)[r]||Ye(Ta({},t)).join("")!=n}))?function(e,t){for(var r=Xe(e),n=arguments.length,o=1,a=Ne.f,i=h.f;n>o;)for(var s,c=b(arguments[o++]),l=a?Ye(c).concat(a(c)):Ye(c),d=l.length,f=0;d>f;)s=l[f++],u&&!i.call(c,s)||(r[s]=c[s]);return r}:Ta;Ke({target:"Object",stat:!0,forced:Object.assign!==Ia},{assign:Ia}),Ke({target:"Object",stat:!0,sham:!u},{create:ut}),Ke({target:"Object",stat:!0,forced:!u,sham:!u},{defineProperty:L.f}),Ke({target:"Object",stat:!0,forced:!u,sham:!u},{defineProperties:$e});var Pa=h.f,Ra=function(e){return function(t){for(var r,n=w(t),o=Ye(n),a=o.length,i=0,s=[];a>i;)r=o[i++],u&&!Pa.call(n,r)||s.push(e?[r,n[r]]:n[r]);return s}},Da={entries:Ra(!0),values:Ra(!1)},Na=Da.entries;Ke({target:"Object",stat:!0},{entries:function(e){return Na(e)}});var Oa=!c((function(){return Object.isExtensible(Object.preventExtensions({}))})),La=o((function(e){var t=L.f,r=J("meta"),n=0,o=Object.isExtensible||function(){return!0},a=function(e){t(e,r,{value:{objectID:"O"+ ++n,weakData:{}}})},i=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!k(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!B(e,r)){if(!o(e))return"F";if(!t)return"E";a(e)}return e[r].objectID},getWeakData:function(e,t){if(!B(e,r)){if(!o(e))return!0;if(!t)return!1;a(e)}return e[r].weakData},onFreeze:function(e){return Oa&&i.REQUIRED&&o(e)&&!B(e,r)&&a(e),e}};re[r]=!0})),Ma=La.onFreeze,Fa=Object.freeze,Ua=c((function(){Fa(1)}));Ke({target:"Object",stat:!0,forced:Ua,sham:!Oa},{freeze:function(e){return Fa&&k(e)?Fa(Ma(e)):e}}),Ke({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Vr(e,(function(e,r){Hr(t,e,r)}),{AS_ENTRIES:!0}),t}});var ja=R.f,Va=c((function(){ja(1)})),za=!u||Va;Ke({target:"Object",stat:!0,forced:za,sham:!u},{getOwnPropertyDescriptor:function(e,t){return ja(w(e),t)}}),Ke({target:"Object",stat:!0,sham:!u},{getOwnPropertyDescriptors:function(e){for(var t,r,n=w(e),o=R.f,a=Oe(n),i={},s=0;a.length>s;)void 0!==(r=o(n,t=a[s++]))&&Hr(i,t,r);return i}});var qa=mt.f,Ha=c((function(){return!Object.getOwnPropertyNames(1)}));Ke({target:"Object",stat:!0,forced:Ha},{getOwnPropertyNames:qa});var Ka=c((function(){Sr(1)}));Ke({target:"Object",stat:!0,forced:Ka,sham:!Cr},{getPrototypeOf:function(e){return Sr(Xe(e))}});var Wa=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};Ke({target:"Object",stat:!0},{is:Wa});var Qa=Object.isExtensible,Ga=c((function(){Qa(1)}));Ke({target:"Object",stat:!0,forced:Ga},{isExtensible:function(e){return!!k(e)&&(!Qa||Qa(e))}});var Xa=Object.isFrozen,Ya=c((function(){Xa(1)}));Ke({target:"Object",stat:!0,forced:Ya},{isFrozen:function(e){return!k(e)||!!Xa&&Xa(e)}});var $a=Object.isSealed,Za=c((function(){$a(1)}));Ke({target:"Object",stat:!0,forced:Za},{isSealed:function(e){return!k(e)||!!$a&&$a(e)}});var Ja=c((function(){Ye(1)}));Ke({target:"Object",stat:!0,forced:Ja},{keys:function(e){return Ye(Xe(e))}});var ei=La.onFreeze,ti=Object.preventExtensions,ri=c((function(){ti(1)}));Ke({target:"Object",stat:!0,forced:ri,sham:!Oa},{preventExtensions:function(e){return ti&&k(e)?ti(ei(e)):e}});var ni=La.onFreeze,oi=Object.seal,ai=c((function(){oi(1)}));Ke({target:"Object",stat:!0,forced:ai,sham:!Oa},{seal:function(e){return oi&&k(e)?oi(ni(e)):e}}),Ke({target:"Object",stat:!0},{setPrototypeOf:Br});var ii=Da.values;Ke({target:"Object",stat:!0},{values:function(e){return ii(e)}});var si=Rr?{}.toString:function(){return"[object "+Lr(this)+"]"};Rr||pe(Object.prototype,"toString",si,{unsafe:!0});var ci=!c((function(){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete s[e]}));u&&Ke({target:"Object",proto:!0,forced:ci},{__defineGetter__:function(e,t){L.f(Xe(this),e,{get:xt(t),enumerable:!0,configurable:!0})}}),u&&Ke({target:"Object",proto:!0,forced:ci},{__defineSetter__:function(e,t){L.f(Xe(this),e,{set:xt(t),enumerable:!0,configurable:!0})}});var ui=R.f;u&&Ke({target:"Object",proto:!0,forced:ci},{__lookupGetter__:function(e){var t,r=Xe(this),n=S(e,!0);do{if(t=ui(r,n))return t.get}while(r=Sr(r))}});var li=R.f;u&&Ke({target:"Object",proto:!0,forced:ci},{__lookupSetter__:function(e){var t,r=Xe(this),n=S(e,!0);do{if(t=li(r,n))return t.set}while(r=Sr(r))}});var di=String.fromCharCode,fi=String.fromCodePoint,pi=!!fi&&1!=fi.length;Ke({target:"String",stat:!0,forced:pi},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,o=0;n>o;){if(t=+arguments[o++],Ee(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(t<65536?di(t):di(55296+((t-=65536)>>10),t%1024+56320))}return r.join("")}}),Ke({target:"String",stat:!0},{raw:function(e){for(var t=w(e.raw),r=we(t.length),n=arguments.length,o=[],a=0;r>a;)o.push(String(t[a++])),a<n&&o.push(String(arguments[a]));return o.join("")}});var hi=function(e){return function(t,r){var n,o,a=String(C(t)),i=be(r),s=a.length;return i<0||i>=s?e?"":void 0:(n=a.charCodeAt(i))<55296||n>56319||i+1===s||(o=a.charCodeAt(i+1))<56320||o>57343?e?a.charAt(i):n:e?a.slice(i,i+2):o-56320+(n-55296<<10)+65536}},mi={codeAt:hi(!1),charAt:hi(!0)},gi=mi.codeAt;Ke({target:"String",proto:!0},{codePointAt:function(e){return gi(this,e)}});var vi,yi=bt("match"),bi=function(e){var t;return k(e)&&(void 0!==(t=e[yi])?!!t:"RegExp"==v(e))},Ci=function(e){if(bi(e))throw TypeError("The method doesn't accept regular expressions");return e},wi=bt("match"),ki=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[wi]=!1,"/./"[e](t)}catch(e){}}return!1},Si=R.f,Ei="".endsWith,Bi=Math.min,_i=ki("endsWith"),xi=!(_i||(vi=Si(String.prototype,"endsWith"),!vi||vi.writable));Ke({target:"String",proto:!0,forced:!xi&&!_i},{endsWith:function(e){var t=String(C(this));Ci(e);var r=arguments.length>1?arguments[1]:void 0,n=we(t.length),o=void 0===r?n:Bi(we(r),n),a=String(e);return Ei?Ei.call(t,a,o):t.slice(o-a.length,o)===a}}),Ke({target:"String",proto:!0,forced:!ki("includes")},{includes:function(e){return!!~String(C(this)).indexOf(Ci(e),arguments.length>1?arguments[1]:void 0)}});var Ti=function(){var e=D(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function Ai(e,t){return RegExp(e,t)}var Ii=c((function(){var e=Ai("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Pi=c((function(){var e=Ai("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),Ri={UNSUPPORTED_Y:Ii,BROKEN_CARET:Pi},Di=RegExp.prototype.exec,Ni=String.prototype.replace,Oi=Di,Li=function(){var e=/a/,t=/b*/g;return Di.call(e,"a"),Di.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Mi=Ri.UNSUPPORTED_Y||Ri.BROKEN_CARET,Fi=void 0!==/()??/.exec("")[1],Ui=Li||Fi||Mi;Ui&&(Oi=function(e){var t,r,n,o,a=this,i=Mi&&a.sticky,s=Ti.call(a),c=a.source,u=0,l=e;return i&&(-1===(s=s.replace("y","")).indexOf("g")&&(s+="g"),l=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(c="(?: "+c+")",l=" "+l,u++),r=new RegExp("^(?:"+c+")",s)),Fi&&(r=new RegExp("^"+c+"$(?!\\s)",s)),Li&&(t=a.lastIndex),n=Di.call(i?r:a,l),i?n?(n.input=n.input.slice(u),n[0]=n[0].slice(u),n.index=a.lastIndex,a.lastIndex+=n[0].length):a.lastIndex=0:Li&&n&&(a.lastIndex=a.global?n.index+n[0].length:t),Fi&&n&&n.length>1&&Ni.call(n[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n});var ji=Oi;Ke({target:"RegExp",proto:!0,forced:/./.exec!==ji},{exec:ji});var Vi=bt("species"),zi=!c((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),qi="$0"==="a".replace(/./,"$0"),Hi=bt("replace"),Ki=!!/./[Hi]&&""===/./[Hi]("a","$0"),Wi=!c((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),Qi=function(e,t,r,n){var o=bt(e),a=!c((function(){var t={};return t[o]=function(){return 7},7!=""[e](t)})),i=a&&!c((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[Vi]=function(){return r},r.flags="",r[o]=/./[o]),r.exec=function(){return t=!0,null},r[o](""),!t}));if(!a||!i||"replace"===e&&(!zi||!qi||Ki)||"split"===e&&!Wi){var s=/./[o],u=r(o,""[e],(function(e,t,r,n,o){return t.exec===ji?a&&!o?{done:!0,value:s.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}}),{REPLACE_KEEPS_$0:qi,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Ki}),l=u[0],d=u[1];pe(String.prototype,e,l),pe(RegExp.prototype,o,2==t?function(e,t){return d.call(e,this,t)}:function(e){return d.call(e,this)})}n&&M(RegExp.prototype[o],"sham",!0)},Gi=mi.charAt,Xi=function(e,t,r){return t+(r?Gi(e,t).length:1)},Yi=function(e,t){var r=e.exec;if("function"==typeof r){var n=r.call(e,t);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==v(e))throw TypeError("RegExp#exec called on incompatible receiver");return ji.call(e,t)};Qi("match",1,(function(e,t,r){return[function(t){var r=C(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n=r(t,e,this);if(n.done)return n.value;var o=D(e),a=String(this);if(!o.global)return Yi(o,a);var i=o.unicode;o.lastIndex=0;for(var s,c=[],u=0;null!==(s=Yi(o,a));){var l=String(s[0]);c[u]=l,""===l&&(o.lastIndex=Xi(a,we(o.lastIndex),i)),u++}return 0===u?null:c}]}));var $i=bt("species"),Zi=function(e,t){var r,n=D(e).constructor;return void 0===n||null==(r=D(n)[$i])?t:xt(r)},Ji=bt("matchAll"),es="RegExp String",ts=es+" Iterator",rs=fe.set,ns=fe.getterFor(ts),os=RegExp.prototype,as=os.exec,is="".matchAll,ss=!!is&&!c((function(){"a".matchAll(/./)})),cs=function(e,t){var r,n=e.exec;if("function"==typeof n){if("object"!=typeof(r=n.call(e,t)))throw TypeError("Incorrect exec result");return r}return as.call(e,t)},us=oa((function(e,t,r,n){rs(this,{type:ts,regexp:e,string:t,global:r,unicode:n,done:!1})}),es,(function(){var e=ns(this);if(e.done)return{value:void 0,done:!0};var t=e.regexp,r=e.string,n=cs(t,r);return null===n?{value:void 0,done:e.done=!0}:e.global?(""==String(n[0])&&(t.lastIndex=Xi(r,we(t.lastIndex),e.unicode)),{value:n,done:!1}):(e.done=!0,{value:n,done:!1})})),ls=function(e){var t,r,n,o,a,i,s=D(this),c=String(e);return t=Zi(s,RegExp),void 0===(r=s.flags)&&s instanceof RegExp&&!("flags"in os)&&(r=Ti.call(s)),n=void 0===r?"":String(r),o=new t(t===RegExp?s.source:s,n),a=!!~n.indexOf("g"),i=!!~n.indexOf("u"),o.lastIndex=we(s.lastIndex),new us(o,c,a,i)};Ke({target:"String",proto:!0,forced:ss},{matchAll:function(e){var t,r,n=C(this);if(null!=e){if(bi(e)&&!~String(C("flags"in os?e.flags:Ti.call(e))).indexOf("g"))throw TypeError("`.matchAll` does not allow non-global regexes");if(ss)return is.apply(n,arguments);if(void 0===(r=e[Ji])&&X&&"RegExp"==v(e)&&(r=ls),null!=r)return xt(r).call(e,n)}else if(ss)return is.apply(n,arguments);return t=String(n),new RegExp(e,"g")[Ji](t)}}),Ji in os||M(os,Ji,ls);var ds="".repeat||function(e){var t=String(C(this)),r="",n=be(e);if(n<0||n==1/0)throw RangeError("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},fs=Math.ceil,ps=function(e){return function(t,r,n){var o,a,i=String(C(t)),s=i.length,c=void 0===n?" ":String(n),u=we(r);return u<=s||""==c?i:(o=u-s,(a=ds.call(c,fs(o/c.length))).length>o&&(a=a.slice(0,o)),e?i+a:a+i)}},hs={start:ps(!1),end:ps(!0)},ms=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(tn),gs=hs.end;Ke({target:"String",proto:!0,forced:ms},{padEnd:function(e){return gs(this,e,arguments.length>1?arguments[1]:void 0)}});var vs=hs.start;Ke({target:"String",proto:!0,forced:ms},{padStart:function(e){return vs(this,e,arguments.length>1?arguments[1]:void 0)}}),Ke({target:"String",proto:!0},{repeat:ds});var ys=Math.max,bs=Math.min,Cs=Math.floor,ws=/\$([$&'`]|\d\d?|<[^>]*>)/g,ks=/\$([$&'`]|\d\d?)/g,Ss=function(e){return void 0===e?e:String(e)};Qi("replace",2,(function(e,t,r,n){var o=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,a=n.REPLACE_KEEPS_$0,i=o?"$":"$0";return[function(r,n){var o=C(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,o,n):t.call(String(o),r,n)},function(e,n){if(!o&&a||"string"==typeof n&&-1===n.indexOf(i)){var c=r(t,e,this,n);if(c.done)return c.value}var u=D(e),l=String(this),d="function"==typeof n;d||(n=String(n));var f=u.global;if(f){var p=u.unicode;u.lastIndex=0}for(var h=[];;){var m=Yi(u,l);if(null===m)break;if(h.push(m),!f)break;""===String(m[0])&&(u.lastIndex=Xi(l,we(u.lastIndex),p))}for(var g="",v=0,y=0;y<h.length;y++){m=h[y];for(var b=String(m[0]),C=ys(bs(be(m.index),l.length),0),w=[],k=1;k<m.length;k++)w.push(Ss(m[k]));var S=m.groups;if(d){var E=[b].concat(w,C,l);void 0!==S&&E.push(S);var B=String(n.apply(void 0,E))}else B=s(b,l,C,w,S,n);C>=v&&(g+=l.slice(v,C)+B,v=C+b.length)}return g+l.slice(v)}];function s(e,r,n,o,a,i){var s=n+e.length,c=o.length,u=ks;return void 0!==a&&(a=Xe(a),u=ws),t.call(i,u,(function(t,i){var u;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return r.slice(0,n);case"'":return r.slice(s);case"<":u=a[i.slice(1,-1)];break;default:var l=+i;if(0===l)return t;if(l>c){var d=Cs(l/10);return 0===d?t:d<=c?void 0===o[d-1]?i.charAt(1):o[d-1]+i.charAt(1):t}u=o[l-1]}return void 0===u?"":u}))}})),Qi("search",1,(function(e,t,r){return[function(t){var r=C(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n=r(t,e,this);if(n.done)return n.value;var o=D(e),a=String(this),i=o.lastIndex;Wa(i,0)||(o.lastIndex=0);var s=Yi(o,a);return Wa(o.lastIndex,i)||(o.lastIndex=i),null===s?-1:s.index}]}));var Es=[].push,Bs=Math.min,_s=4294967295,xs=!c((function(){return!RegExp(_s,"y")}));Qi("split",2,(function(e,t,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var n=String(C(this)),o=void 0===r?_s:r>>>0;if(0===o)return[];if(void 0===e)return[n];if(!bi(e))return t.call(n,e,o);for(var a,i,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,d=new RegExp(e.source,u+"g");(a=ji.call(d,n))&&!((i=d.lastIndex)>l&&(c.push(n.slice(l,a.index)),a.length>1&&a.index<n.length&&Es.apply(c,a.slice(1)),s=a[0].length,l=i,c.length>=o));)d.lastIndex===a.index&&d.lastIndex++;return l===n.length?!s&&d.test("")||c.push(""):c.push(n.slice(l)),c.length>o?c.slice(0,o):c}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t.call(this,e,r)}:t,[function(t,r){var o=C(this),a=null==t?void 0:t[e];return void 0!==a?a.call(t,o,r):n.call(String(o),t,r)},function(e,o){var a=r(n,e,this,o,n!==t);if(a.done)return a.value;var i=D(e),s=String(this),c=Zi(i,RegExp),u=i.unicode,l=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(xs?"y":"g"),d=new c(xs?i:"^(?:"+i.source+")",l),f=void 0===o?_s:o>>>0;if(0===f)return[];if(0===s.length)return null===Yi(d,s)?[s]:[];for(var p=0,h=0,m=[];h<s.length;){d.lastIndex=xs?h:0;var g,v=Yi(d,xs?s:s.slice(h));if(null===v||(g=Bs(we(d.lastIndex+(xs?0:h)),s.length))===p)h=Xi(s,h,u);else{if(m.push(s.slice(p,h)),m.length===f)return m;for(var y=1;y<=v.length-1;y++)if(m.push(v[y]),m.length===f)return m;h=p=g}}return m.push(s.slice(p)),m}]}),!xs);var Ts=R.f,As="".startsWith,Is=Math.min,Ps=ki("startsWith"),Rs=!Ps&&!!function(){var e=Ts(String.prototype,"startsWith");return e&&!e.writable}();Ke({target:"String",proto:!0,forced:!Rs&&!Ps},{startsWith:function(e){var t=String(C(this));Ci(e);var r=we(Is(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return As?As.call(t,n,r):t.slice(r,r+n.length)===n}});var Ds="\t\n\v\f\r \u2028\u2029\ufeff",Ns="["+Ds+"]",Os=RegExp("^"+Ns+Ns+"*"),Ls=RegExp(Ns+Ns+"*$"),Ms=function(e){return function(t){var r=String(C(t));return 1&e&&(r=r.replace(Os,"")),2&e&&(r=r.replace(Ls,"")),r}},Fs={start:Ms(1),end:Ms(2),trim:Ms(3)},Us="
",js=function(e){return c((function(){return!!Ds[e]()||Us[e]()!=Us||Ds[e].name!==e}))},Vs=Fs.trim;Ke({target:"String",proto:!0,forced:js("trim")},{trim:function(){return Vs(this)}});var zs=Fs.start,qs=js("trimStart"),Hs=qs?function(){return zs(this)}:"".trimStart;Ke({target:"String",proto:!0,forced:qs},{trimStart:Hs,trimLeft:Hs});var Ks=Fs.end,Ws=js("trimEnd"),Qs=Ws?function(){return Ks(this)}:"".trimEnd;Ke({target:"String",proto:!0,forced:Ws},{trimEnd:Qs,trimRight:Qs});var Gs=mi.charAt,Xs="String Iterator",Ys=fe.set,$s=fe.getterFor(Xs);fa(String,"String",(function(e){Ys(this,{type:Xs,string:String(e),index:0})}),(function(){var e,t=$s(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Gs(r,n),t.index+=e.length,{value:e,done:!1})}));var Zs=/"/g,Js=function(e,t,r,n){var o=String(C(e)),a="<"+t;return""!==r&&(a+=" "+r+'="'+String(n).replace(Zs,""")+'"'),a+">"+o+"</"+t+">"},ec=function(e){return c((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))};Ke({target:"String",proto:!0,forced:ec("anchor")},{anchor:function(e){return Js(this,"a","name",e)}}),Ke({target:"String",proto:!0,forced:ec("big")},{big:function(){return Js(this,"big","","")}}),Ke({target:"String",proto:!0,forced:ec("blink")},{blink:function(){return Js(this,"blink","","")}}),Ke({target:"String",proto:!0,forced:ec("bold")},{bold:function(){return Js(this,"b","","")}}),Ke({target:"String",proto:!0,forced:ec("fixed")},{fixed:function(){return Js(this,"tt","","")}}),Ke({target:"String",proto:!0,forced:ec("fontcolor")},{fontcolor:function(e){return Js(this,"font","color",e)}}),Ke({target:"String",proto:!0,forced:ec("fontsize")},{fontsize:function(e){return Js(this,"font","size",e)}}),Ke({target:"String",proto:!0,forced:ec("italics")},{italics:function(){return Js(this,"i","","")}}),Ke({target:"String",proto:!0,forced:ec("link")},{link:function(e){return Js(this,"a","href",e)}}),Ke({target:"String",proto:!0,forced:ec("small")},{small:function(){return Js(this,"small","","")}}),Ke({target:"String",proto:!0,forced:ec("strike")},{strike:function(){return Js(this,"strike","","")}}),Ke({target:"String",proto:!0,forced:ec("sub")},{sub:function(){return Js(this,"sub","","")}}),Ke({target:"String",proto:!0,forced:ec("sup")},{sup:function(){return Js(this,"sup","","")}});var tc=bt("replace"),rc=RegExp.prototype;Ke({target:"String",proto:!0},{replaceAll:function e(t,r){var n,o,a,i,s,c,u,l=C(this);if(null!=t){if(bi(t)&&!~String(C("flags"in rc?t.flags:Ti.call(t))).indexOf("g"))throw TypeError("`.replaceAll` does not allow non-global regexes");if(void 0!==(n=t[tc]))return n.call(t,l,r)}if(o=String(l),""===(a=String(t)))return e.call(o,/(?:)/g,r);if(i=o.split(a),"function"!=typeof r)return i.join(String(r));for(c=(s=i[0]).length,u=1;u<i.length;u++)s+=String(r(a,c,o)),c+=a.length+i[u].length,s+=i[u];return s}});var nc=function(e,t,r){var n,o;return Br&&"function"==typeof(n=t.constructor)&&n!==r&&k(o=n.prototype)&&o!==r.prototype&&Br(e,o),e},oc=L.f,ac=Re.f,ic=fe.set,sc=bt("match"),cc=s.RegExp,uc=cc.prototype,lc=/a/g,dc=/a/g,fc=new cc(lc)!==lc,pc=Ri.UNSUPPORTED_Y,hc=u&&qe("RegExp",!fc||pc||c((function(){return dc[sc]=!1,cc(lc)!=lc||cc(dc)==dc||"/a/i"!=cc(lc,"i")})));if(hc){for(var mc=function(e,t){var r,n=this instanceof mc,o=bi(e),a=void 0===t;if(!n&&o&&e.constructor===mc&&a)return e;fc?o&&!a&&(e=e.source):e instanceof mc&&(a&&(t=Ti.call(e)),e=e.source),pc&&(r=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var i=nc(fc?new cc(e,t):cc(e,t),n?this:uc,mc);return pc&&r&&ic(i,{sticky:r}),i},gc=function(e){e in mc||oc(mc,e,{configurable:!0,get:function(){return cc[e]},set:function(t){cc[e]=t}})},vc=ac(cc),yc=0;vc.length>yc;)gc(vc[yc++]);uc.constructor=mc,mc.prototype=uc,pe(s,"RegExp",mc)}Go("RegExp");var bc=Ri.UNSUPPORTED_Y;u&&("g"!=/./g.flags||bc)&&L.f(RegExp.prototype,"flags",{configurable:!0,get:Ti});var Cc=Ri.UNSUPPORTED_Y,wc=L.f,kc=fe.get,Sc=RegExp.prototype;u&&Cc&&wc(RegExp.prototype,"sticky",{configurable:!0,get:function(){if(this!==Sc){if(this instanceof RegExp)return!!kc(this).sticky;throw TypeError("Incompatible receiver, RegExp required")}}});var Ec=function(){var e=!1,t=/[ac]/;return t.exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e}(),Bc=/./.test;Ke({target:"RegExp",proto:!0,forced:!Ec},{test:function(e){if("function"!=typeof this.exec)return Bc.call(this,e);var t=this.exec(e);if(null!==t&&!k(t))throw new Error("RegExp exec method returned something other than an Object or null");return!!t}});var _c="toString",xc=RegExp.prototype,Tc=xc[_c],Ac=c((function(){return"/a/b"!=Tc.call({source:"a",flags:"b"})})),Ic=Tc.name!=_c;(Ac||Ic)&&pe(RegExp.prototype,_c,(function(){var e=D(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in xc)?Ti.call(e):r)}),{unsafe:!0});var Pc=Fs.trim,Rc=s.parseInt,Dc=/^[+-]?0[Xx]/,Nc=8!==Rc(Ds+"08")||22!==Rc(Ds+"0x16"),Oc=Nc?function(e,t){var r=Pc(String(e));return Rc(r,t>>>0||(Dc.test(r)?16:10))}:Rc;Ke({global:!0,forced:parseInt!=Oc},{parseInt:Oc});var Lc=Fs.trim,Mc=s.parseFloat,Fc=1/Mc(Ds+"-0")!=-1/0,Uc=Fc?function(e){var t=Lc(String(e)),r=Mc(t);return 0===r&&"-"==t.charAt(0)?-0:r}:Mc;Ke({global:!0,forced:parseFloat!=Uc},{parseFloat:Uc});var jc=Re.f,Vc=R.f,zc=L.f,qc=Fs.trim,Hc="Number",Kc=s[Hc],Wc=Kc.prototype,Qc=v(ut(Wc))==Hc,Gc=function(e){var t,r,n,o,a,i,s,c,u=S(e,!1);if("string"==typeof u&&u.length>2)if(43===(t=(u=qc(u)).charCodeAt(0))||45===t){if(88===(r=u.charCodeAt(2))||120===r)return NaN}else if(48===t){switch(u.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+u}for(i=(a=u.slice(2)).length,s=0;s<i;s++)if((c=a.charCodeAt(s))<48||c>o)return NaN;return parseInt(a,n)}return+u};if(qe(Hc,!Kc(" 0o1")||!Kc("0b1")||Kc("+0x1"))){for(var Xc,Yc=function(e){var t=arguments.length<1?0:e,r=this;return r instanceof Yc&&(Qc?c((function(){Wc.valueOf.call(r)})):v(r)!=Hc)?nc(new Kc(Gc(t)),r,Yc):Gc(t)},$c=u?jc(Kc):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),Zc=0;$c.length>Zc;Zc++)B(Kc,Xc=$c[Zc])&&!B(Yc,Xc)&&zc(Yc,Xc,Vc(Kc,Xc));Yc.prototype=Wc,Wc.constructor=Yc,pe(s,Hc,Yc)}Ke({target:"Number",stat:!0},{EPSILON:Math.pow(2,-52)});var Jc=s.isFinite,eu=Number.isFinite||function(e){return"number"==typeof e&&Jc(e)};Ke({target:"Number",stat:!0},{isFinite:eu});var tu=Math.floor,ru=function(e){return!k(e)&&isFinite(e)&&tu(e)===e};Ke({target:"Number",stat:!0},{isInteger:ru}),Ke({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var nu=Math.abs;Ke({target:"Number",stat:!0},{isSafeInteger:function(e){return ru(e)&&nu(e)<=9007199254740991}}),Ke({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991}),Ke({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991}),Ke({target:"Number",stat:!0,forced:Number.parseFloat!=Uc},{parseFloat:Uc}),Ke({target:"Number",stat:!0,forced:Number.parseInt!=Oc},{parseInt:Oc});var ou=function(e){if("number"!=typeof e&&"Number"!=v(e))throw TypeError("Incorrect invocation");return+e},au=1..toFixed,iu=Math.floor,su=function(e,t,r){return 0===t?r:t%2==1?su(e,t-1,r*e):su(e*e,t/2,r)},cu=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t},uu=au&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!c((function(){au.call({})}));Ke({target:"Number",proto:!0,forced:uu},{toFixed:function(e){var t,r,n,o,a=ou(this),i=be(e),s=[0,0,0,0,0,0],c="",u="0",l=function(e,t){for(var r=-1,n=t;++r<6;)n+=e*s[r],s[r]=n%1e7,n=iu(n/1e7)},d=function(e){for(var t=6,r=0;--t>=0;)r+=s[t],s[t]=iu(r/e),r=r%e*1e7},f=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==s[e]){var r=String(s[e]);t=""===t?r:t+ds.call("0",7-r.length)+r}return t};if(i<0||i>20)throw RangeError("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return String(a);if(a<0&&(c="-",a=-a),a>1e-21)if(r=(t=cu(a*su(2,69,1))-69)<0?a*su(2,-t,1):a/su(2,t,1),r*=4503599627370496,(t=52-t)>0){for(l(0,r),n=i;n>=7;)l(1e7,0),n-=7;for(l(su(10,n,1),0),n=t-1;n>=23;)d(1<<23),n-=23;d(1<<n),l(1,1),d(2),u=f()}else l(0,r),l(1<<-t,0),u=f()+ds.call("0",i);return u=i>0?c+((o=u.length)<=i?"0."+ds.call("0",i-o)+u:u.slice(0,o-i)+"."+u.slice(o-i)):c+u}});var lu=1..toPrecision,du=c((function(){return"1"!==lu.call(1,void 0)}))||!c((function(){lu.call({})}));Ke({target:"Number",proto:!0,forced:du},{toPrecision:function(e){return void 0===e?lu.call(ou(this)):lu.call(ou(this),e)}});var fu=Math.log,pu=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:fu(1+e)},hu=Math.acosh,mu=Math.log,gu=Math.sqrt,vu=Math.LN2,yu=!hu||710!=Math.floor(hu(Number.MAX_VALUE))||hu(1/0)!=1/0;Ke({target:"Math",stat:!0,forced:yu},{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?mu(e)+vu:pu(e-1+gu(e-1)*gu(e+1))}});var bu=Math.asinh,Cu=Math.log,wu=Math.sqrt;function ku(e){return isFinite(e=+e)&&0!=e?e<0?-ku(-e):Cu(e+wu(e*e+1)):e}Ke({target:"Math",stat:!0,forced:!(bu&&1/bu(0)>0)},{asinh:ku});var Su=Math.atanh,Eu=Math.log;Ke({target:"Math",stat:!0,forced:!(Su&&1/Su(-0)<0)},{atanh:function(e){return 0==(e=+e)?e:Eu((1+e)/(1-e))/2}});var Bu=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1},_u=Math.abs,xu=Math.pow;Ke({target:"Math",stat:!0},{cbrt:function(e){return Bu(e=+e)*xu(_u(e),1/3)}});var Tu=Math.floor,Au=Math.log,Iu=Math.LOG2E;Ke({target:"Math",stat:!0},{clz32:function(e){return(e>>>=0)?31-Tu(Au(e+.5)*Iu):32}});var Pu=Math.expm1,Ru=Math.exp,Du=!Pu||Pu(10)>22025.465794806718||Pu(10)<22025.465794806718||-2e-17!=Pu(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Ru(e)-1}:Pu,Nu=Math.cosh,Ou=Math.abs,Lu=Math.E;Ke({target:"Math",stat:!0,forced:!Nu||Nu(710)===1/0},{cosh:function(e){var t=Du(Ou(e)-1)+1;return(t+1/(t*Lu*Lu))*(Lu/2)}}),Ke({target:"Math",stat:!0,forced:Du!=Math.expm1},{expm1:Du});var Mu=Math.abs,Fu=Math.pow,Uu=Fu(2,-52),ju=Fu(2,-23),Vu=Fu(2,127)*(2-ju),zu=Fu(2,-126),qu=function(e){return e+1/Uu-1/Uu},Hu=Math.fround||function(e){var t,r,n=Mu(e),o=Bu(e);return n<zu?o*qu(n/zu/ju)*zu*ju:(r=(t=(1+ju/Uu)*n)-(t-n))>Vu||r!=r?o*(1/0):o*r};Ke({target:"Math",stat:!0},{fround:Hu});var Ku=Math.hypot,Wu=Math.abs,Qu=Math.sqrt,Gu=!!Ku&&Ku(1/0,NaN)!==1/0;Ke({target:"Math",stat:!0,forced:Gu},{hypot:function(e,t){for(var r,n,o=0,a=0,i=arguments.length,s=0;a<i;)s<(r=Wu(arguments[a++]))?(o=o*(n=s/r)*n+1,s=r):o+=r>0?(n=r/s)*n:r;return s===1/0?1/0:s*Qu(o)}});var Xu=Math.imul,Yu=c((function(){return-5!=Xu(4294967295,5)||2!=Xu.length}));Ke({target:"Math",stat:!0,forced:Yu},{imul:function(e,t){var r=65535,n=+e,o=+t,a=r&n,i=r&o;return 0|a*i+((r&n>>>16)*i+a*(r&o>>>16)<<16>>>0)}});var $u=Math.log,Zu=Math.LOG10E;Ke({target:"Math",stat:!0},{log10:function(e){return $u(e)*Zu}}),Ke({target:"Math",stat:!0},{log1p:pu});var Ju=Math.log,el=Math.LN2;Ke({target:"Math",stat:!0},{log2:function(e){return Ju(e)/el}}),Ke({target:"Math",stat:!0},{sign:Bu});var tl=Math.abs,rl=Math.exp,nl=Math.E,ol=c((function(){return-2e-17!=Math.sinh(-2e-17)}));Ke({target:"Math",stat:!0,forced:ol},{sinh:function(e){return tl(e=+e)<1?(Du(e)-Du(-e))/2:(rl(e-1)-rl(-e-1))*(nl/2)}});var al=Math.exp;Ke({target:"Math",stat:!0},{tanh:function(e){var t=Du(e=+e),r=Du(-e);return t==1/0?1:r==1/0?-1:(t-r)/(al(e)+al(-e))}}),_t(Math,"Math",!0);var il=Math.ceil,sl=Math.floor;Ke({target:"Math",stat:!0},{trunc:function(e){return(e>0?sl:il)(e)}}),Ke({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}});var cl=c((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}));Ke({target:"Date",proto:!0,forced:cl},{toJSON:function(e){var t=Xe(this),r=S(t);return"number"!=typeof r||isFinite(r)?t.toISOString():null}});var ul=hs.start,ll=Math.abs,dl=Date.prototype,fl=dl.getTime,pl=dl.toISOString,hl=c((function(){return"0385-07-25T07:06:39.999Z"!=pl.call(new Date(-50000000000001))}))||!c((function(){pl.call(new Date(NaN))}))?function(){if(!isFinite(fl.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),r=e.getUTCMilliseconds(),n=t<0?"-":t>9999?"+":"";return n+ul(ll(t),n?6:4,0)+"-"+ul(e.getUTCMonth()+1,2,0)+"-"+ul(e.getUTCDate(),2,0)+"T"+ul(e.getUTCHours(),2,0)+":"+ul(e.getUTCMinutes(),2,0)+":"+ul(e.getUTCSeconds(),2,0)+"."+ul(r,3,0)+"Z"}:pl;Ke({target:"Date",proto:!0,forced:Date.prototype.toISOString!==hl},{toISOString:hl});var ml=Date.prototype,gl="Invalid Date",vl="toString",yl=ml[vl],bl=ml.getTime;new Date(NaN)+""!=gl&&pe(ml,vl,(function(){var e=bl.call(this);return e==e?yl.call(this):gl}));var Cl=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint");return S(D(this),"number"!==e)},wl=bt("toPrimitive"),kl=Date.prototype;wl in kl||M(kl,wl,Cl);var Sl=ge("JSON","stringify"),El=/[\uD800-\uDFFF]/g,Bl=/^[\uD800-\uDBFF]$/,_l=/^[\uDC00-\uDFFF]$/,xl=function(e,t,r){var n=r.charAt(t-1),o=r.charAt(t+1);return Bl.test(e)&&!_l.test(o)||_l.test(e)&&!Bl.test(n)?"\\u"+e.charCodeAt(0).toString(16):e},Tl=c((function(){return'"\\udf06\\ud834"'!==Sl("\udf06\ud834")||'"\\udead"'!==Sl("\udead")}));Sl&&Ke({target:"JSON",stat:!0,forced:Tl},{stringify:function(e,t,r){var n=Sl.apply(null,arguments);return"string"==typeof n?n.replace(El,xl):n}}),_t(s.JSON,"JSON",!0);var Al,Il,Pl,Rl=s.Promise,Dl=function(e,t,r){for(var n in t)pe(e,n,t[n],r);return e},Nl=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e},Ol=/(iphone|ipod|ipad).*applewebkit/i.test(tn),Ll=s.location,Ml=s.setImmediate,Fl=s.clearImmediate,Ul=s.process,jl=s.MessageChannel,Vl=s.Dispatch,zl=0,ql={},Hl="onreadystatechange",Kl=function(e){if(ql.hasOwnProperty(e)){var t=ql[e];delete ql[e],t()}},Wl=function(e){return function(){Kl(e)}},Ql=function(e){Kl(e.data)},Gl=function(e){s.postMessage(e+"",Ll.protocol+"//"+Ll.host)};Ml&&Fl||(Ml=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return ql[++zl]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Al(zl),zl},Fl=function(e){delete ql[e]},go?Al=function(e){Ul.nextTick(Wl(e))}:Vl&&Vl.now?Al=function(e){Vl.now(Wl(e))}:jl&&!Ol?(Pl=(Il=new jl).port2,Il.port1.onmessage=Ql,Al=Tt(Pl.postMessage,Pl,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts&&Ll&&"file:"!==Ll.protocol&&!c(Gl)?(Al=Gl,s.addEventListener("message",Ql,!1)):Al=Hl in T("script")?function(e){Ze.appendChild(T("script"))[Hl]=function(){Ze.removeChild(this),Kl(e)}}:function(e){setTimeout(Wl(e),0)});var Xl,Yl,$l,Zl,Jl,ed,td,rd,nd={set:Ml,clear:Fl},od=R.f,ad=nd.set,id=s.MutationObserver||s.WebKitMutationObserver,sd=s.document,cd=s.process,ud=s.Promise,ld=od(s,"queueMicrotask"),dd=ld&&ld.value;dd||(Xl=function(){var e,t;for(go&&(e=cd.domain)&&e.exit();Yl;){t=Yl.fn,Yl=Yl.next;try{t()}catch(e){throw Yl?Zl():$l=void 0,e}}$l=void 0,e&&e.enter()},!Ol&&!go&&id&&sd?(Jl=!0,ed=sd.createTextNode(""),new id(Xl).observe(ed,{characterData:!0}),Zl=function(){ed.data=Jl=!Jl}):ud&&ud.resolve?(td=ud.resolve(void 0),rd=td.then,Zl=function(){rd.call(td,Xl)}):Zl=go?function(){cd.nextTick(Xl)}:function(){ad.call(s,Xl)});var fd,pd,hd,md,gd=dd||function(e){var t={fn:e,next:void 0};$l&&($l.next=t),Yl||(Yl=t,Zl()),$l=t},vd=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=xt(t),this.reject=xt(r)},yd=function(e){return new vd(e)},bd={f:yd},Cd=function(e,t){if(D(e),k(t)&&t.constructor===e)return t;var r=bd.f(e);return(0,r.resolve)(t),r.promise},wd=function(e,t){var r=s.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))},kd=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Sd=nd.set,Ed=bt("species"),Bd="Promise",_d=fe.get,xd=fe.set,Td=fe.getterFor(Bd),Ad=Rl,Id=s.TypeError,Pd=s.document,Rd=s.process,Dd=ge("fetch"),Nd=bd.f,Od=Nd,Ld=!!(Pd&&Pd.createEvent&&s.dispatchEvent),Md="function"==typeof PromiseRejectionEvent,Fd="unhandledrejection",Ud="rejectionhandled",jd=0,Vd=1,zd=2,qd=1,Hd=2,Kd=qe(Bd,(function(){if(!(W(Ad)!==String(Ad))){if(66===an)return!0;if(!go&&!Md)return!0}if(an>=51&&/native code/.test(Ad))return!1;var e=Ad.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[Ed]=t,!(e.then((function(){}))instanceof t)})),Wd=Kd||!Yr((function(e){Ad.all(e).catch((function(){}))})),Qd=function(e){var t;return!(!k(e)||"function"!=typeof(t=e.then))&&t},Gd=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;gd((function(){for(var n=e.value,o=e.state==Vd,a=0;r.length>a;){var i,s,c,u=r[a++],l=o?u.ok:u.fail,d=u.resolve,f=u.reject,p=u.domain;try{l?(o||(e.rejection===Hd&&Zd(e),e.rejection=qd),!0===l?i=n:(p&&p.enter(),i=l(n),p&&(p.exit(),c=!0)),i===u.promise?f(Id("Promise-chain cycle")):(s=Qd(i))?s.call(i,d,f):d(i)):f(n)}catch(e){p&&!c&&p.exit(),f(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Yd(e)}))}},Xd=function(e,t,r){var n,o;Ld?((n=Pd.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),s.dispatchEvent(n)):n={promise:t,reason:r},!Md&&(o=s["on"+e])?o(n):e===Fd&&wd("Unhandled promise rejection",r)},Yd=function(e){Sd.call(s,(function(){var t,r=e.facade,n=e.value;if($d(e)&&(t=kd((function(){go?Rd.emit("unhandledRejection",n,r):Xd(Fd,r,n)})),e.rejection=go||$d(e)?Hd:qd,t.error))throw t.value}))},$d=function(e){return e.rejection!==qd&&!e.parent},Zd=function(e){Sd.call(s,(function(){var t=e.facade;go?Rd.emit("rejectionHandled",t):Xd(Ud,t,e.value)}))},Jd=function(e,t,r){return function(n){e(t,n,r)}},ef=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=zd,Gd(e,!0))},tf=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw Id("Promise can't be resolved itself");var n=Qd(t);n?gd((function(){var r={done:!1};try{n.call(t,Jd(tf,r,e),Jd(ef,r,e))}catch(t){ef(r,t,e)}})):(e.value=t,e.state=Vd,Gd(e,!1))}catch(t){ef({done:!1},t,e)}}};Kd&&(Ad=function(e){Nl(this,Ad,Bd),xt(e),fd.call(this);var t=_d(this);try{e(Jd(tf,t),Jd(ef,t))}catch(e){ef(t,e)}},(fd=function(e){xd(this,{type:Bd,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:jd,value:void 0})}).prototype=Dl(Ad.prototype,{then:function(e,t){var r=Td(this),n=Nd(Zi(this,Ad));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=go?Rd.domain:void 0,r.parent=!0,r.reactions.push(n),r.state!=jd&&Gd(r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),pd=function(){var e=new fd,t=_d(e);this.promise=e,this.resolve=Jd(tf,t),this.reject=Jd(ef,t)},bd.f=Nd=function(e){return e===Ad||e===hd?new pd(e):Od(e)},"function"==typeof Rl&&(md=Rl.prototype.then,pe(Rl.prototype,"then",(function(e,t){var r=this;return new Ad((function(e,t){md.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Dd&&Ke({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return Cd(Ad,Dd.apply(s,arguments))}}))),Ke({global:!0,wrap:!0,forced:Kd},{Promise:Ad}),_t(Ad,Bd,!1),Go(Bd),hd=ge(Bd),Ke({target:Bd,stat:!0,forced:Kd},{reject:function(e){var t=Nd(this);return t.reject.call(void 0,e),t.promise}}),Ke({target:Bd,stat:!0,forced:Kd},{resolve:function(e){return Cd(this,e)}}),Ke({target:Bd,stat:!0,forced:Wd},{all:function(e){var t=this,r=Nd(t),n=r.resolve,o=r.reject,a=kd((function(){var r=xt(t.resolve),a=[],i=0,s=1;Vr(e,(function(e){var c=i++,u=!1;a.push(void 0),s++,r.call(t,e).then((function(e){u||(u=!0,a[c]=e,--s||n(a))}),o)})),--s||n(a)}));return a.error&&o(a.value),r.promise},race:function(e){var t=this,r=Nd(t),n=r.reject,o=kd((function(){var o=xt(t.resolve);Vr(e,(function(e){o.call(t,e).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}}),Ke({target:"Promise",stat:!0},{allSettled:function(e){var t=this,r=bd.f(t),n=r.resolve,o=r.reject,a=kd((function(){var r=xt(t.resolve),o=[],a=0,i=1;Vr(e,(function(e){var s=a++,c=!1;o.push(void 0),i++,r.call(t,e).then((function(e){c||(c=!0,o[s]={status:"fulfilled",value:e},--i||n(o))}),(function(e){c||(c=!0,o[s]={status:"rejected",reason:e},--i||n(o))}))})),--i||n(o)}));return a.error&&o(a.value),r.promise}});var rf="No one promise resolved";Ke({target:"Promise",stat:!0},{any:function(e){var t=this,r=bd.f(t),n=r.resolve,o=r.reject,a=kd((function(){var r=xt(t.resolve),a=[],i=0,s=1,c=!1;Vr(e,(function(e){var u=i++,l=!1;a.push(void 0),s++,r.call(t,e).then((function(e){l||c||(c=!0,n(e))}),(function(e){l||c||(l=!0,a[u]=e,--s||o(new(ge("AggregateError"))(a,rf)))}))})),--s||o(new(ge("AggregateError"))(a,rf))}));return a.error&&o(a.value),r.promise}});var nf=!!Rl&&c((function(){Rl.prototype.finally.call({then:function(){}},(function(){}))}));Ke({target:"Promise",proto:!0,real:!0,forced:nf},{finally:function(e){var t=Zi(this,ge("Promise")),r="function"==typeof e;return this.then(r?function(r){return Cd(t,e()).then((function(){return r}))}:e,r?function(r){return Cd(t,e()).then((function(){throw r}))}:e)}}),"function"!=typeof Rl||Rl.prototype.finally||pe(Rl.prototype,"finally",ge("Promise").prototype.finally);var of=function(e,t,r){var n=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),a=n?"set":"add",i=s[e],u=i&&i.prototype,l=i,d={},f=function(e){var t=u[e];pe(u,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(o&&!k(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return o&&!k(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(o&&!k(e))&&t.call(this,0===e?0:e)}:function(e,r){return t.call(this,0===e?0:e,r),this})};if(qe(e,"function"!=typeof i||!(o||u.forEach&&!c((function(){(new i).entries().next()})))))l=r.getConstructor(t,e,n,a),La.REQUIRED=!0;else if(qe(e,!0)){var p=new l,h=p[a](o?{}:-0,1)!=p,m=c((function(){p.has(1)})),g=Yr((function(e){new i(e)})),v=!o&&c((function(){for(var e=new i,t=5;t--;)e[a](t,t);return!e.has(-0)}));g||((l=t((function(t,r){Nl(t,l,e);var o=nc(new i,t,l);return null!=r&&Vr(r,o[a],{that:o,AS_ENTRIES:n}),o}))).prototype=u,u.constructor=l),(m||v)&&(f("delete"),f("has"),n&&f("get")),(v||h)&&f(a),o&&u.clear&&delete u.clear}return d[e]=l,Ke({global:!0,forced:l!=i},d),_t(l,e),o||r.setStrong(l,e,n),l},af=L.f,sf=La.fastKey,cf=fe.set,uf=fe.getterFor,lf={getConstructor:function(e,t,r,n){var o=e((function(e,a){Nl(e,o,t),cf(e,{type:t,index:ut(null),first:void 0,last:void 0,size:0}),u||(e.size=0),null!=a&&Vr(a,e[n],{that:e,AS_ENTRIES:r})})),a=uf(t),i=function(e,t,r){var n,o,i=a(e),c=s(e,t);return c?c.value=r:(i.last=c={index:o=sf(t,!0),key:t,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=c),n&&(n.next=c),u?i.size++:e.size++,"F"!==o&&(i.index[o]=c)),e},s=function(e,t){var r,n=a(e),o=sf(t);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==t)return r};return Dl(o.prototype,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,u?e.size=0:this.size=0},delete:function(e){var t=this,r=a(t),n=s(t,e);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first==n&&(r.first=o),r.last==n&&(r.last=i),u?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=a(this),n=Tt(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),Dl(o.prototype,r?{get:function(e){var t=s(this,e);return t&&t.value},set:function(e,t){return i(this,0===e?0:e,t)}}:{add:function(e){return i(this,e=0===e?0:e,e)}}),u&&af(o.prototype,"size",{get:function(){return a(this).size}}),o},setStrong:function(e,t,r){var n=t+" Iterator",o=uf(t),a=uf(n);fa(e,t,(function(e,t){cf(this,{type:n,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),Go(t)}},df=(of("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),lf),of("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),lf),La.getWeakData),ff=fe.set,pf=fe.getterFor,hf=Dt.find,mf=Dt.findIndex,gf=0,vf=function(e){return e.frozen||(e.frozen=new yf)},yf=function(){this.entries=[]},bf=function(e,t){return hf(e.entries,(function(e){return e[0]===t}))};yf.prototype={get:function(e){var t=bf(this,e);if(t)return t[1]},has:function(e){return!!bf(this,e)},set:function(e,t){var r=bf(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=mf(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}};var Cf={getConstructor:function(e,t,r,n){var o=e((function(e,a){Nl(e,o,t),ff(e,{type:t,id:gf++,frozen:void 0}),null!=a&&Vr(a,e[n],{that:e,AS_ENTRIES:r})})),a=pf(t),i=function(e,t,r){var n=a(e),o=df(D(t),!0);return!0===o?vf(n).set(t,r):o[n.id]=r,e};return Dl(o.prototype,{delete:function(e){var t=a(this);if(!k(e))return!1;var r=df(e);return!0===r?vf(t).delete(e):r&&B(r,t.id)&&delete r[t.id]},has:function(e){var t=a(this);if(!k(e))return!1;var r=df(e);return!0===r?vf(t).has(e):r&&B(r,t.id)}}),Dl(o.prototype,r?{get:function(e){var t=a(this);if(k(e)){var r=df(e);return!0===r?vf(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return i(this,e,t)}}:{add:function(e){return i(this,e,!0)}}),o}};o((function(e){var t,r=fe.enforce,n=!s.ActiveXObject&&"ActiveXObject"in s,o=Object.isExtensible,a=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},i=e.exports=of("WeakMap",a,Cf);if(G&&n){t=Cf.getConstructor(a,"WeakMap",!0),La.REQUIRED=!0;var c=i.prototype,u=c.delete,l=c.has,d=c.get,f=c.set;Dl(c,{delete:function(e){if(k(e)&&!o(e)){var n=r(this);return n.frozen||(n.frozen=new t),u.call(this,e)||n.frozen.delete(e)}return u.call(this,e)},has:function(e){if(k(e)&&!o(e)){var n=r(this);return n.frozen||(n.frozen=new t),l.call(this,e)||n.frozen.has(e)}return l.call(this,e)},get:function(e){if(k(e)&&!o(e)){var n=r(this);return n.frozen||(n.frozen=new t),l.call(this,e)?d.call(this,e):n.frozen.get(e)}return d.call(this,e)},set:function(e,n){if(k(e)&&!o(e)){var a=r(this);a.frozen||(a.frozen=new t),l.call(this,e)?f.call(this,e,n):a.frozen.set(e,n)}else f.call(this,e,n);return this}})}}));of("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Cf);var wf="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,kf=function(e){if(void 0===e)return 0;var t=be(e),r=we(t);if(t!==r)throw RangeError("Wrong length or index");return r},Sf=1/0,Ef=Math.abs,Bf=Math.pow,_f=Math.floor,xf=Math.log,Tf=Math.LN2,Af=function(e,t,r){var n,o,a,i=new Array(r),s=8*r-t-1,c=(1<<s)-1,u=c>>1,l=23===t?Bf(2,-24)-Bf(2,-77):0,d=e<0||0===e&&1/e<0?1:0,f=0;for((e=Ef(e))!=e||e===Sf?(o=e!=e?1:0,n=c):(n=_f(xf(e)/Tf),e*(a=Bf(2,-n))<1&&(n--,a*=2),(e+=n+u>=1?l/a:l*Bf(2,1-u))*a>=2&&(n++,a/=2),n+u>=c?(o=0,n=c):n+u>=1?(o=(e*a-1)*Bf(2,t),n+=u):(o=e*Bf(2,u-1)*Bf(2,t),n=0));t>=8;i[f++]=255&o,o/=256,t-=8);for(n=n<<t|o,s+=t;s>0;i[f++]=255&n,n/=256,s-=8);return i[--f]|=128*d,i},If=function(e,t){var r,n=e.length,o=8*n-t-1,a=(1<<o)-1,i=a>>1,s=o-7,c=n-1,u=e[c--],l=127&u;for(u>>=7;s>0;l=256*l+e[c],c--,s-=8);for(r=l&(1<<-s)-1,l>>=-s,s+=t;s>0;r=256*r+e[c],c--,s-=8);if(0===l)l=1-i;else{if(l===a)return r?NaN:u?-Sf:Sf;r+=Bf(2,t),l-=i}return(u?-1:1)*r*Bf(2,l-t)},Pf={pack:Af,unpack:If},Rf=Re.f,Df=L.f,Nf=fe.get,Of=fe.set,Lf="ArrayBuffer",Mf="DataView",Ff="prototype",Uf="Wrong length",jf="Wrong index",Vf=s[Lf],zf=Vf,qf=s[Mf],Hf=qf&&qf[Ff],Kf=Object.prototype,Wf=s.RangeError,Qf=Pf.pack,Gf=Pf.unpack,Xf=function(e){return[255&e]},Yf=function(e){return[255&e,e>>8&255]},$f=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Zf=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Jf=function(e){return Qf(e,23,4)},ep=function(e){return Qf(e,52,8)},tp=function(e,t){Df(e[Ff],t,{get:function(){return Nf(this)[t]}})},rp=function(e,t,r,n){var o=kf(r),a=Nf(e);if(o+t>a.byteLength)throw Wf(jf);var i=Nf(a.buffer).bytes,s=o+a.byteOffset,c=i.slice(s,s+t);return n?c:c.reverse()},np=function(e,t,r,n,o,a){var i=kf(r),s=Nf(e);if(i+t>s.byteLength)throw Wf(jf);for(var c=Nf(s.buffer).bytes,u=i+s.byteOffset,l=n(+o),d=0;d<t;d++)c[u+d]=l[a?d:t-d-1]};if(wf){if(!c((function(){Vf(1)}))||!c((function(){new Vf(-1)}))||c((function(){return new Vf,new Vf(1.5),new Vf(NaN),Vf.name!=Lf}))){for(var op,ap=(zf=function(e){return Nl(this,zf),new Vf(kf(e))})[Ff]=Vf[Ff],ip=Rf(Vf),sp=0;ip.length>sp;)(op=ip[sp++])in zf||M(zf,op,Vf[op]);ap.constructor=zf}Br&&Sr(Hf)!==Kf&&Br(Hf,Kf);var cp=new qf(new zf(2)),up=Hf.setInt8;cp.setInt8(0,2147483648),cp.setInt8(1,2147483649),!cp.getInt8(0)&&cp.getInt8(1)||Dl(Hf,{setInt8:function(e,t){up.call(this,e,t<<24>>24)},setUint8:function(e,t){up.call(this,e,t<<24>>24)}},{unsafe:!0})}else zf=function(e){Nl(this,zf,Lf);var t=kf(e);Of(this,{bytes:An.call(new Array(t),0),byteLength:t}),u||(this.byteLength=t)},qf=function(e,t,r){Nl(this,qf,Mf),Nl(e,zf,Mf);var n=Nf(e).byteLength,o=be(t);if(o<0||o>n)throw Wf("Wrong offset");if(o+(r=void 0===r?n-o:we(r))>n)throw Wf(Uf);Of(this,{buffer:e,byteLength:r,byteOffset:o}),u||(this.buffer=e,this.byteLength=r,this.byteOffset=o)},u&&(tp(zf,"byteLength"),tp(qf,"buffer"),tp(qf,"byteLength"),tp(qf,"byteOffset")),Dl(qf[Ff],{getInt8:function(e){return rp(this,1,e)[0]<<24>>24},getUint8:function(e){return rp(this,1,e)[0]},getInt16:function(e){var t=rp(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=rp(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Zf(rp(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Zf(rp(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Gf(rp(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Gf(rp(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){np(this,1,e,Xf,t)},setUint8:function(e,t){np(this,1,e,Xf,t)},setInt16:function(e,t){np(this,2,e,Yf,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){np(this,2,e,Yf,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){np(this,4,e,$f,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){np(this,4,e,$f,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){np(this,4,e,Jf,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){np(this,8,e,ep,t,arguments.length>2?arguments[2]:void 0)}});_t(zf,Lf),_t(qf,Mf);var lp={ArrayBuffer:zf,DataView:qf},dp="ArrayBuffer",fp=lp[dp],pp=s[dp];Ke({global:!0,forced:pp!==fp},{ArrayBuffer:fp}),Go(dp);var hp,mp=L.f,gp=s.Int8Array,vp=gp&&gp.prototype,yp=s.Uint8ClampedArray,bp=yp&&yp.prototype,Cp=gp&&Sr(gp),wp=vp&&Sr(vp),kp=Object.prototype,Sp=kp.isPrototypeOf,Ep=bt("toStringTag"),Bp=J("TYPED_ARRAY_TAG"),_p=wf&&!!Br&&"Opera"!==Lr(s.opera),xp=!1,Tp={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Ap={BigInt64Array:8,BigUint64Array:8},Ip=function(e){if(!k(e))return!1;var t=Lr(e);return"DataView"===t||B(Tp,t)||B(Ap,t)},Pp=function(e){if(!k(e))return!1;var t=Lr(e);return B(Tp,t)||B(Ap,t)},Rp=function(e){if(Pp(e))return e;throw TypeError("Target is not a typed array")},Dp=function(e){if(Br){if(Sp.call(Cp,e))return e}else for(var t in Tp)if(B(Tp,hp)){var r=s[t];if(r&&(e===r||Sp.call(r,e)))return e}throw TypeError("Target is not a typed array constructor")},Np=function(e,t,r){if(u){if(r)for(var n in Tp){var o=s[n];o&&B(o.prototype,e)&&delete o.prototype[e]}wp[e]&&!r||pe(wp,e,r?t:_p&&vp[e]||t)}},Op=function(e,t,r){var n,o;if(u){if(Br){if(r)for(n in Tp)(o=s[n])&&B(o,e)&&delete o[e];if(Cp[e]&&!r)return;try{return pe(Cp,e,r?t:_p&&gp[e]||t)}catch(e){}}for(n in Tp)!(o=s[n])||o[e]&&!r||pe(o,e,t)}};for(hp in Tp)s[hp]||(_p=!1);if((!_p||"function"!=typeof Cp||Cp===Function.prototype)&&(Cp=function(){throw TypeError("Incorrect invocation")},_p))for(hp in Tp)s[hp]&&Br(s[hp],Cp);if((!_p||!wp||wp===kp)&&(wp=Cp.prototype,_p))for(hp in Tp)s[hp]&&Br(s[hp].prototype,wp);if(_p&&Sr(bp)!==wp&&Br(bp,wp),u&&!B(wp,Ep))for(hp in xp=!0,mp(wp,Ep,{get:function(){return k(this)?this[Bp]:void 0}}),Tp)s[hp]&&M(s[hp],Bp,hp);var Lp={NATIVE_ARRAY_BUFFER_VIEWS:_p,TYPED_ARRAY_TAG:xp&&Bp,aTypedArray:Rp,aTypedArrayConstructor:Dp,exportTypedArrayMethod:Np,exportTypedArrayStaticMethod:Op,isView:Ip,isTypedArray:Pp,TypedArray:Cp,TypedArrayPrototype:wp},Mp=Lp.NATIVE_ARRAY_BUFFER_VIEWS;Ke({target:"ArrayBuffer",stat:!0,forced:!Mp},{isView:Lp.isView});var Fp=lp.ArrayBuffer,Up=lp.DataView,jp=Fp.prototype.slice,Vp=c((function(){return!new Fp(2).slice(1,void 0).byteLength}));Ke({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Vp},{slice:function(e,t){if(void 0!==jp&&void 0===t)return jp.call(D(this),e);for(var r=D(this).byteLength,n=Ee(e,r),o=Ee(void 0===t?r:t,r),a=new(Zi(this,Fp))(we(o-n)),i=new Up(this),s=new Up(a),c=0;n<o;)s.setUint8(c++,i.getUint8(n++));return a}}),Ke({global:!0,forced:!wf},{DataView:lp.DataView});var zp=Lp.NATIVE_ARRAY_BUFFER_VIEWS,qp=s.ArrayBuffer,Hp=s.Int8Array,Kp=!zp||!c((function(){Hp(1)}))||!c((function(){new Hp(-1)}))||!Yr((function(e){new Hp,new Hp(null),new Hp(1.5),new Hp(e)}),!0)||c((function(){return 1!==new Hp(new qp(2),1,void 0).length})),Wp=function(e){var t=be(e);if(t<0)throw RangeError("The argument can't be less than 0");return t},Qp=function(e,t){var r=Wp(e);if(r%t)throw RangeError("Wrong offset");return r},Gp=Lp.aTypedArrayConstructor,Xp=function(e){var t,r,n,o,a,i,s=Xe(e),c=arguments.length,u=c>1?arguments[1]:void 0,l=void 0!==u,d=Fr(s);if(null!=d&&!Ar(d))for(i=(a=d.call(s)).next,s=[];!(o=i.call(a)).done;)s.push(o.value);for(l&&c>2&&(u=Tt(u,arguments[2],2)),r=we(s.length),n=new(Gp(this))(r),t=0;r>t;t++)n[t]=l?u(s[t],t):s[t];return n},Yp=o((function(e){var t=Re.f,r=Dt.forEach,n=fe.get,o=fe.set,a=L.f,i=R.f,c=Math.round,l=s.RangeError,d=lp.ArrayBuffer,f=lp.DataView,p=Lp.NATIVE_ARRAY_BUFFER_VIEWS,h=Lp.TYPED_ARRAY_TAG,g=Lp.TypedArray,v=Lp.TypedArrayPrototype,y=Lp.aTypedArrayConstructor,b=Lp.isTypedArray,C="BYTES_PER_ELEMENT",w="Wrong length",E=function(e,t){for(var r=0,n=t.length,o=new(y(e))(n);n>r;)o[r]=t[r++];return o},_=function(e,t){a(e,t,{get:function(){return n(this)[t]}})},x=function(e){var t;return e instanceof d||"ArrayBuffer"==(t=Lr(e))||"SharedArrayBuffer"==t},T=function(e,t){return b(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},A=function(e,t){return T(e,t=S(t,!0))?m(2,e[t]):i(e,t)},I=function(e,t,r){return!(T(e,t=S(t,!0))&&k(r)&&B(r,"value"))||B(r,"get")||B(r,"set")||r.configurable||B(r,"writable")&&!r.writable||B(r,"enumerable")&&!r.enumerable?a(e,t,r):(e[t]=r.value,e)};u?(p||(R.f=A,L.f=I,_(v,"buffer"),_(v,"byteOffset"),_(v,"byteLength"),_(v,"length")),Ke({target:"Object",stat:!0,forced:!p},{getOwnPropertyDescriptor:A,defineProperty:I}),e.exports=function(e,i,u){var m=e.match(/\d+$/)[0]/8,y=e+(u?"Clamped":"")+"Array",S="get"+e,B="set"+e,_=s[y],T=_,A=T&&T.prototype,I={},P=function(e,t){a(e,t,{get:function(){return function(e,t){var r=n(e);return r.view[S](t*m+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var o=n(e);u&&(r=(r=c(r))<0?0:r>255?255:255&r),o.view[B](t*m+o.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};p?Kp&&(T=i((function(e,t,r,n){return Nl(e,T,y),nc(k(t)?x(t)?void 0!==n?new _(t,Qp(r,m),n):void 0!==r?new _(t,Qp(r,m)):new _(t):b(t)?E(T,t):Xp.call(T,t):new _(kf(t)),e,T)})),Br&&Br(T,g),r(t(_),(function(e){e in T||M(T,e,_[e])})),T.prototype=A):(T=i((function(e,t,r,n){Nl(e,T,y);var a,i,s,c=0,u=0;if(k(t)){if(!x(t))return b(t)?E(T,t):Xp.call(T,t);a=t,u=Qp(r,m);var p=t.byteLength;if(void 0===n){if(p%m)throw l(w);if((i=p-u)<0)throw l(w)}else if((i=we(n)*m)+u>p)throw l(w);s=i/m}else s=kf(t),a=new d(i=s*m);for(o(e,{buffer:a,byteOffset:u,byteLength:i,length:s,view:new f(a)});c<s;)P(e,c++)})),Br&&Br(T,g),A=T.prototype=ut(v)),A.constructor!==T&&M(A,"constructor",T),h&&M(A,h,y),I[y]=T,Ke({global:!0,forced:T!=_,sham:!p},I),C in T||M(T,C,m),C in A||M(A,C,m),Go(y)}):e.exports=function(){}}));Yp("Int8",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Yp("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Yp("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}),!0),Yp("Int16",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Yp("Uint16",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Yp("Int32",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Yp("Uint32",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Yp("Float32",(function(e){return function(t,r,n){return e(this,t,r,n)}})),Yp("Float64",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var $p=Lp.exportTypedArrayStaticMethod;$p("from",Xp,Kp);var Zp=Lp.aTypedArrayConstructor,Jp=Lp.exportTypedArrayStaticMethod;Jp("of",(function(){for(var e=0,t=arguments.length,r=new(Zp(this))(t);t>e;)r[e]=arguments[e++];return r}),Kp);var eh=Lp.aTypedArray,th=Lp.exportTypedArrayMethod;th("copyWithin",(function(e,t){return vn.call(eh(this),e,t,arguments.length>2?arguments[2]:void 0)}));var rh=Dt.every,nh=Lp.aTypedArray,oh=Lp.exportTypedArrayMethod;oh("every",(function(e){return rh(nh(this),e,arguments.length>1?arguments[1]:void 0)}));var ah=Lp.aTypedArray,ih=Lp.exportTypedArrayMethod;ih("fill",(function(e){return An.apply(ah(this),arguments)}));var sh=Dt.filter,ch=Lp.aTypedArray,uh=Lp.aTypedArrayConstructor,lh=Lp.exportTypedArrayMethod;lh("filter",(function(e){for(var t=sh(ch(this),e,arguments.length>1?arguments[1]:void 0),r=Zi(this,this.constructor),n=0,o=t.length,a=new(uh(r))(o);o>n;)a[n]=t[n++];return a}));var dh=Dt.find,fh=Lp.aTypedArray,ph=Lp.exportTypedArrayMethod;ph("find",(function(e){return dh(fh(this),e,arguments.length>1?arguments[1]:void 0)}));var hh=Dt.findIndex,mh=Lp.aTypedArray,gh=Lp.exportTypedArrayMethod;gh("findIndex",(function(e){return hh(mh(this),e,arguments.length>1?arguments[1]:void 0)}));var vh=Dt.forEach,yh=Lp.aTypedArray,bh=Lp.exportTypedArrayMethod;bh("forEach",(function(e){vh(yh(this),e,arguments.length>1?arguments[1]:void 0)}));var Ch=_e.includes,wh=Lp.aTypedArray,kh=Lp.exportTypedArrayMethod;kh("includes",(function(e){return Ch(wh(this),e,arguments.length>1?arguments[1]:void 0)}));var Sh=_e.indexOf,Eh=Lp.aTypedArray,Bh=Lp.exportTypedArrayMethod;Bh("indexOf",(function(e){return Sh(Eh(this),e,arguments.length>1?arguments[1]:void 0)}));var _h=bt("iterator"),xh=s.Uint8Array,Th=ga.values,Ah=ga.keys,Ih=ga.entries,Ph=Lp.aTypedArray,Rh=Lp.exportTypedArrayMethod,Dh=xh&&xh.prototype[_h],Nh=!!Dh&&("values"==Dh.name||null==Dh.name),Oh=function(){return Th.call(Ph(this))};Rh("entries",(function(){return Ih.call(Ph(this))})),Rh("keys",(function(){return Ah.call(Ph(this))})),Rh("values",Oh,!Nh),Rh(_h,Oh,!Nh);var Lh=Lp.aTypedArray,Mh=Lp.exportTypedArrayMethod,Fh=[].join;Mh("join",(function(e){return Fh.apply(Lh(this),arguments)}));var Uh=Lp.aTypedArray,jh=Lp.exportTypedArrayMethod;jh("lastIndexOf",(function(e){return uo.apply(Uh(this),arguments)}));var Vh=Dt.map,zh=Lp.aTypedArray,qh=Lp.aTypedArrayConstructor,Hh=Lp.exportTypedArrayMethod;Hh("map",(function(e){return Vh(zh(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(qh(Zi(e,e.constructor)))(t)}))}));var Kh=mo.left,Wh=Lp.aTypedArray,Qh=Lp.exportTypedArrayMethod;Qh("reduce",(function(e){return Kh(Wh(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var Gh=mo.right,Xh=Lp.aTypedArray,Yh=Lp.exportTypedArrayMethod;Yh("reduceRight",(function(e){return Gh(Xh(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var $h=Lp.aTypedArray,Zh=Lp.exportTypedArrayMethod,Jh=Math.floor;Zh("reverse",(function(){for(var e,t=this,r=$h(t).length,n=Jh(r/2),o=0;o<n;)e=t[o],t[o++]=t[--r],t[r]=e;return t}));var em=Lp.aTypedArray,tm=Lp.exportTypedArrayMethod,rm=c((function(){new Int8Array(1).set({})}));tm("set",(function(e){em(this);var t=Qp(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=Xe(e),o=we(n.length),a=0;if(o+t>r)throw RangeError("Wrong length");for(;a<o;)this[t+a]=n[a++]}),rm);var nm=Lp.aTypedArray,om=Lp.aTypedArrayConstructor,am=Lp.exportTypedArrayMethod,im=[].slice,sm=c((function(){new Int8Array(1).slice()}));am("slice",(function(e,t){for(var r=im.call(nm(this),e,t),n=Zi(this,this.constructor),o=0,a=r.length,i=new(om(n))(a);a>o;)i[o]=r[o++];return i}),sm);var cm=Dt.some,um=Lp.aTypedArray,lm=Lp.exportTypedArrayMethod;lm("some",(function(e){return cm(um(this),e,arguments.length>1?arguments[1]:void 0)}));var dm=Lp.aTypedArray,fm=Lp.exportTypedArrayMethod,pm=[].sort;fm("sort",(function(e){return pm.call(dm(this),e)}));var hm=Lp.aTypedArray,mm=Lp.exportTypedArrayMethod;mm("subarray",(function(e,t){var r=hm(this),n=r.length,o=Ee(e,n);return new(Zi(r,r.constructor))(r.buffer,r.byteOffset+o*r.BYTES_PER_ELEMENT,we((void 0===t?n:Ee(t,n))-o))}));var gm=s.Int8Array,vm=Lp.aTypedArray,ym=Lp.exportTypedArrayMethod,bm=[].toLocaleString,Cm=[].slice,wm=!!gm&&c((function(){bm.call(new gm(1))})),km=c((function(){return[1,2].toLocaleString()!=new gm([1,2]).toLocaleString()}))||!c((function(){gm.prototype.toLocaleString.call([1,2])}));ym("toLocaleString",(function(){return bm.apply(wm?Cm.call(vm(this)):vm(this),arguments)}),km);var Sm=Lp.exportTypedArrayMethod,Em=s.Uint8Array,Bm=Em&&Em.prototype||{},_m=[].toString,xm=[].join;c((function(){_m.call({})}))&&(_m=function(){return xm.call(this)});var Tm=Bm.toString!=_m;Sm("toString",_m,Tm);var Am=ge("Reflect","apply"),Im=Function.apply,Pm=!c((function(){Am((function(){}))}));Ke({target:"Reflect",stat:!0,forced:Pm},{apply:function(e,t,r){return xt(e),D(r),Am?Am(e,t,r):Im.call(e,t,r)}});var Rm=ge("Reflect","construct"),Dm=c((function(){function e(){}return!(Rm((function(){}),[],e)instanceof e)})),Nm=!c((function(){Rm((function(){}))})),Om=Dm||Nm;Ke({target:"Reflect",stat:!0,forced:Om,sham:Om},{construct:function(e,t){xt(e),D(t);var r=arguments.length<3?e:xt(arguments[2]);if(Nm&&!Dm)return Rm(e,t,r);if(e==r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return n.push.apply(n,t),new(Ca.apply(e,n))}var o=r.prototype,a=ut(k(o)?o:Object.prototype),i=Function.apply.call(e,a,t);return k(i)?i:a}});var Lm=c((function(){Reflect.defineProperty(L.f({},1,{value:1}),1,{value:2})}));Ke({target:"Reflect",stat:!0,forced:Lm,sham:!u},{defineProperty:function(e,t,r){D(e);var n=S(t,!0);D(r);try{return L.f(e,n,r),!0}catch(e){return!1}}});var Mm=R.f;function Fm(e,t){var r,n,o=arguments.length<3?e:arguments[2];return D(e)===o?e[t]:(r=R.f(e,t))?B(r,"value")?r.value:void 0===r.get?void 0:r.get.call(o):k(n=Sr(e))?Fm(n,t,o):void 0}Ke({target:"Reflect",stat:!0},{deleteProperty:function(e,t){var r=Mm(D(e),t);return!(r&&!r.configurable)&&delete e[t]}}),Ke({target:"Reflect",stat:!0},{get:Fm}),Ke({target:"Reflect",stat:!0,sham:!u},{getOwnPropertyDescriptor:function(e,t){return R.f(D(e),t)}}),Ke({target:"Reflect",stat:!0,sham:!Cr},{getPrototypeOf:function(e){return Sr(D(e))}}),Ke({target:"Reflect",stat:!0},{has:function(e,t){return t in e}});var Um=Object.isExtensible;function jm(e,t,r){var n,o,a=arguments.length<4?e:arguments[3],i=R.f(D(e),t);if(!i){if(k(o=Sr(e)))return jm(o,t,r,a);i=m(0)}if(B(i,"value")){if(!1===i.writable||!k(a))return!1;if(n=R.f(a,t)){if(n.get||n.set||!1===n.writable)return!1;n.value=r,L.f(a,t,n)}else L.f(a,t,m(0,r));return!0}return void 0!==i.set&&(i.set.call(a,r),!0)}Ke({target:"Reflect",stat:!0},{isExtensible:function(e){return D(e),!Um||Um(e)}}),Ke({target:"Reflect",stat:!0},{ownKeys:Oe}),Ke({target:"Reflect",stat:!0,sham:!Oa},{preventExtensions:function(e){D(e);try{var t=ge("Object","preventExtensions");return t&&t(e),!0}catch(e){return!1}}});var Vm=c((function(){var e=function(){},t=L.f(new e,"a",{configurable:!0});return!1!==Reflect.set(e.prototype,"a",1,t)}));Ke({target:"Reflect",stat:!0,forced:Vm},{set:jm}),Br&&Ke({target:"Reflect",stat:!0},{setPrototypeOf:function(e,t){D(e),Er(t);try{return Br(e,t),!0}catch(e){return!1}}}),Ke({global:!0},{Reflect:{}}),_t(s.Reflect,"Reflect",!0);var zm={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var qm in zm){var Hm=s[qm],Km=Hm&&Hm.prototype;if(Km&&Km.forEach!==Wn)try{M(Km,"forEach",Wn)}catch(e){Km.forEach=Wn}}var Wm=bt("iterator"),Qm=bt("toStringTag"),Gm=ga.values;for(var Xm in zm){var Ym=s[Xm],$m=Ym&&Ym.prototype;if($m){if($m[Wm]!==Gm)try{M($m,Wm,Gm)}catch(e){$m[Wm]=Gm}if($m[Qm]||M($m,Qm,Xm),zm[Xm])for(var Zm in ga)if($m[Zm]!==ga[Zm])try{M($m,Zm,ga[Zm])}catch(e){$m[Zm]=ga[Zm]}}}var Jm=!s.setImmediate||!s.clearImmediate;Ke({global:!0,bind:!0,enumerable:!0,forced:Jm},{setImmediate:nd.set,clearImmediate:nd.clear});var eg=s.process;Ke({global:!0,enumerable:!0,noTargetGet:!0},{queueMicrotask:function(e){var t=go&&eg.domain;gd(t?t.bind(e):e)}});var tg=[].slice,rg=/MSIE .\./.test(tn),ng=function(e){return function(t,r){var n=arguments.length>2,o=n?tg.call(arguments,2):void 0;return e(n?function(){("function"==typeof t?t:Function(t)).apply(this,o)}:t,r)}};Ke({global:!0,bind:!0,forced:rg},{setTimeout:ng(s.setTimeout),setInterval:ng(s.setInterval)});var og=bt("iterator"),ag=!c((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),X&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[og]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),ig=2147483647,sg=36,cg=1,ug=26,lg=38,dg=700,fg=72,pg=128,hg="-",mg=/[^\0-\u007E]/,gg=/[.\u3002\uFF0E\uFF61]/g,vg="Overflow: input needs wider integers to process",yg=sg-cg,bg=Math.floor,Cg=String.fromCharCode,wg=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=e.charCodeAt(r++);if(o>=55296&&o<=56319&&r<n){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&o)<<10)+(1023&a)+65536):(t.push(o),r--)}else t.push(o)}return t},kg=function(e){return e+22+75*(e<26)},Sg=function(e,t,r){var n=0;for(e=r?bg(e/dg):e>>1,e+=bg(e/t);e>yg*ug>>1;n+=sg)e=bg(e/yg);return bg(n+(yg+1)*e/(e+lg))},Eg=function(e){var t,r,n=[],o=(e=wg(e)).length,a=pg,i=0,s=fg;for(t=0;t<e.length;t++)(r=e[t])<128&&n.push(Cg(r));var c=n.length,u=c;for(c&&n.push(hg);u<o;){var l=ig;for(t=0;t<e.length;t++)(r=e[t])>=a&&r<l&&(l=r);var d=u+1;if(l-a>bg((ig-i)/d))throw RangeError(vg);for(i+=(l-a)*d,a=l,t=0;t<e.length;t++){if((r=e[t])<a&&++i>ig)throw RangeError(vg);if(r==a){for(var f=i,p=sg;;p+=sg){var h=p<=s?cg:p>=s+ug?ug:p-s;if(f<h)break;var m=f-h,g=sg-h;n.push(Cg(kg(h+m%g))),f=bg(m/g)}n.push(Cg(kg(f))),s=Sg(i,d,u==c),i=0,++u}}++i,++a}return n.join("")},Bg=function(e){var t,r,n=[],o=e.toLowerCase().replace(gg,".").split(".");for(t=0;t<o.length;t++)r=o[t],n.push(mg.test(r)?"xn--"+Eg(r):r);return n.join(".")},_g=function(e){var t=Fr(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return D(t.call(e))},xg=ge("fetch"),Tg=ge("Headers"),Ag=bt("iterator"),Ig="URLSearchParams",Pg=Ig+"Iterator",Rg=fe.set,Dg=fe.getterFor(Ig),Ng=fe.getterFor(Pg),Og=/\+/g,Lg=Array(4),Mg=function(e){return Lg[e-1]||(Lg[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Fg=function(e){try{return decodeURIComponent(e)}catch(t){return e}},Ug=function(e){var t=e.replace(Og," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=t.replace(Mg(r--),Fg);return t}},jg=/[!'()~]|%20/g,Vg={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},zg=function(e){return Vg[e]},qg=function(e){return encodeURIComponent(e).replace(jg,zg)},Hg=function(e,t){if(t)for(var r,n,o=t.split("&"),a=0;a<o.length;)(r=o[a++]).length&&(n=r.split("="),e.push({key:Ug(n.shift()),value:Ug(n.join("="))}))},Kg=function(e){this.entries.length=0,Hg(this.entries,e)},Wg=function(e,t){if(e<t)throw TypeError("Not enough arguments")},Qg=oa((function(e,t){Rg(this,{type:Pg,iterator:_g(Dg(e).entries),kind:t})}),"Iterator",(function(){var e=Ng(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r})),Gg=function(){Nl(this,Gg,Ig);var e,t,r,n,o,a,i,s,c,u=arguments.length>0?arguments[0]:void 0,l=this,d=[];if(Rg(l,{type:Ig,entries:d,updateURL:function(){},updateSearchParams:Kg}),void 0!==u)if(k(u))if("function"==typeof(e=Fr(u)))for(r=(t=e.call(u)).next;!(n=r.call(t)).done;){if((i=(a=(o=_g(D(n.value))).next).call(o)).done||(s=a.call(o)).done||!a.call(o).done)throw TypeError("Expected sequence with length 2");d.push({key:i.value+"",value:s.value+""})}else for(c in u)B(u,c)&&d.push({key:c,value:u[c]+""});else Hg(d,"string"==typeof u?"?"===u.charAt(0)?u.slice(1):u:u+"")},Xg=Gg.prototype;Dl(Xg,{append:function(e,t){Wg(arguments.length,2);var r=Dg(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},delete:function(e){Wg(arguments.length,1);for(var t=Dg(this),r=t.entries,n=e+"",o=0;o<r.length;)r[o].key===n?r.splice(o,1):o++;t.updateURL()},get:function(e){Wg(arguments.length,1);for(var t=Dg(this).entries,r=e+"",n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){Wg(arguments.length,1);for(var t=Dg(this).entries,r=e+"",n=[],o=0;o<t.length;o++)t[o].key===r&&n.push(t[o].value);return n},has:function(e){Wg(arguments.length,1);for(var t=Dg(this).entries,r=e+"",n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){Wg(arguments.length,1);for(var r,n=Dg(this),o=n.entries,a=!1,i=e+"",s=t+"",c=0;c<o.length;c++)(r=o[c]).key===i&&(a?o.splice(c--,1):(a=!0,r.value=s));a||o.push({key:i,value:s}),n.updateURL()},sort:function(){var e,t,r,n=Dg(this),o=n.entries,a=o.slice();for(o.length=0,r=0;r<a.length;r++){for(e=a[r],t=0;t<r;t++)if(o[t].key>e.key){o.splice(t,0,e);break}t===r&&o.push(e)}n.updateURL()},forEach:function(e){for(var t,r=Dg(this).entries,n=Tt(e,arguments.length>1?arguments[1]:void 0,3),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new Qg(this,"keys")},values:function(){return new Qg(this,"values")},entries:function(){return new Qg(this,"entries")}},{enumerable:!0}),pe(Xg,Ag,Xg.entries),pe(Xg,"toString",(function(){for(var e,t=Dg(this).entries,r=[],n=0;n<t.length;)e=t[n++],r.push(qg(e.key)+"="+qg(e.value));return r.join("&")}),{enumerable:!0}),_t(Gg,Ig),Ke({global:!0,forced:!ag},{URLSearchParams:Gg}),ag||"function"!=typeof xg||"function"!=typeof Tg||Ke({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,r,n,o=[e];return arguments.length>1&&(k(t=arguments[1])&&(r=t.body,Lr(r)===Ig&&((n=t.headers?new Tg(t.headers):new Tg).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=ut(t,{body:m(0,String(r)),headers:m(0,n)}))),o.push(t)),xg.apply(this,o)}});var Yg,$g={URLSearchParams:Gg,getState:Dg},Zg=mi.codeAt,Jg=s.URL,ev=$g.URLSearchParams,tv=$g.getState,rv=fe.set,nv=fe.getterFor("URL"),ov=Math.floor,av=Math.pow,iv="Invalid authority",sv="Invalid scheme",cv="Invalid host",uv="Invalid port",lv=/[A-Za-z]/,dv=/[\d+-.A-Za-z]/,fv=/\d/,pv=/^(0x|0X)/,hv=/^[0-7]+$/,mv=/^\d+$/,gv=/^[\dA-Fa-f]+$/,vv=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,yv=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,bv=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,Cv=/[\u0009\u000A\u000D]/g,wv=function(e,t){var r,n,o;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return cv;if(!(r=Sv(t.slice(1,-1))))return cv;e.host=r}else if(Rv(e)){if(t=Bg(t),vv.test(t))return cv;if(null===(r=kv(t)))return cv;e.host=r}else{if(yv.test(t))return cv;for(r="",n=Kr(t),o=0;o<n.length;o++)r+=Iv(n[o],_v);e.host=r}},kv=function(e){var t,r,n,o,a,i,s,c=e.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(o=c[n]))return e;if(a=10,o.length>1&&"0"==o.charAt(0)&&(a=pv.test(o)?16:8,o=o.slice(8==a?1:2)),""===o)i=0;else{if(!(10==a?mv:8==a?hv:gv).test(o))return e;i=parseInt(o,a)}r.push(i)}for(n=0;n<t;n++)if(i=r[n],n==t-1){if(i>=av(256,5-t))return null}else if(i>255)return null;for(s=r.pop(),n=0;n<r.length;n++)s+=r[n]*av(256,3-n);return s},Sv=function(e){var t,r,n,o,a,i,s,c=[0,0,0,0,0,0,0,0],u=0,l=null,d=0,f=function(){return e.charAt(d)};if(":"==f()){if(":"!=e.charAt(1))return;d+=2,l=++u}for(;f();){if(8==u)return;if(":"!=f()){for(t=r=0;r<4&&gv.test(f());)t=16*t+parseInt(f(),16),d++,r++;if("."==f()){if(0==r)return;if(d-=r,u>6)return;for(n=0;f();){if(o=null,n>0){if(!("."==f()&&n<4))return;d++}if(!fv.test(f()))return;for(;fv.test(f());){if(a=parseInt(f(),10),null===o)o=a;else{if(0==o)return;o=10*o+a}if(o>255)return;d++}c[u]=256*c[u]+o,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==f()){if(d++,!f())return}else if(f())return;c[u++]=t}else{if(null!==l)return;d++,l=++u}}if(null!==l)for(i=u-l,u=7;0!=u&&i>0;)s=c[u],c[u--]=c[l+i-1],c[l+--i]=s;else if(8!=u)return;return c},Ev=function(e){for(var t=null,r=1,n=null,o=0,a=0;a<8;a++)0!==e[a]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=a),++o);return o>r&&(t=n,r=o),t},Bv=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=ov(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=Ev(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}return e},_v={},xv=Ia({},_v,{" ":1,'"':1,"<":1,">":1,"`":1}),Tv=Ia({},xv,{"#":1,"?":1,"{":1,"}":1}),Av=Ia({},Tv,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Iv=function(e,t){var r=Zg(e,0);return r>32&&r<127&&!B(t,e)?e:encodeURIComponent(e)},Pv={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Rv=function(e){return B(Pv,e.scheme)},Dv=function(e){return""!=e.username||""!=e.password},Nv=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},Ov=function(e,t){var r;return 2==e.length&&lv.test(e.charAt(0))&&(":"==(r=e.charAt(1))||!t&&"|"==r)},Lv=function(e){var t;return e.length>1&&Ov(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},Mv=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&Ov(t[0],!0)||t.pop()},Fv=function(e){return"."===e||"%2e"===e.toLowerCase()},Uv=function(e){return".."===(e=e.toLowerCase())||"%2e."===e||".%2e"===e||"%2e%2e"===e},jv={},Vv={},zv={},qv={},Hv={},Kv={},Wv={},Qv={},Gv={},Xv={},Yv={},$v={},Zv={},Jv={},ey={},ty={},ry={},ny={},oy={},ay={},iy={},sy=function(e,t,r,n){var o,a,i,s,c=r||jv,u=0,l="",d=!1,f=!1,p=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(bv,"")),t=t.replace(Cv,""),o=Kr(t);u<=o.length;){switch(a=o[u],c){case jv:if(!a||!lv.test(a)){if(r)return sv;c=zv;continue}l+=a.toLowerCase(),c=Vv;break;case Vv:if(a&&(dv.test(a)||"+"==a||"-"==a||"."==a))l+=a.toLowerCase();else{if(":"!=a){if(r)return sv;l="",c=zv,u=0;continue}if(r&&(Rv(e)!=B(Pv,l)||"file"==l&&(Dv(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=l,r)return void(Rv(e)&&Pv[e.scheme]==e.port&&(e.port=null));l="","file"==e.scheme?c=Jv:Rv(e)&&n&&n.scheme==e.scheme?c=qv:Rv(e)?c=Qv:"/"==o[u+1]?(c=Hv,u++):(e.cannotBeABaseURL=!0,e.path.push(""),c=oy)}break;case zv:if(!n||n.cannotBeABaseURL&&"#"!=a)return sv;if(n.cannotBeABaseURL&&"#"==a){e.scheme=n.scheme,e.path=n.path.slice(),e.query=n.query,e.fragment="",e.cannotBeABaseURL=!0,c=iy;break}c="file"==n.scheme?Jv:Kv;continue;case qv:if("/"!=a||"/"!=o[u+1]){c=Kv;continue}c=Gv,u++;break;case Hv:if("/"==a){c=Xv;break}c=ny;continue;case Kv:if(e.scheme=n.scheme,a==Yg)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query;else if("/"==a||"\\"==a&&Rv(e))c=Wv;else if("?"==a)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query="",c=ay;else{if("#"!=a){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.path.pop(),c=ny;continue}e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query,e.fragment="",c=iy}break;case Wv:if(!Rv(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,c=ny;continue}c=Xv}else c=Gv;break;case Qv:if(c=Gv,"/"!=a||"/"!=l.charAt(u+1))continue;u++;break;case Gv:if("/"!=a&&"\\"!=a){c=Xv;continue}break;case Xv:if("@"==a){d&&(l="%40"+l),d=!0,i=Kr(l);for(var h=0;h<i.length;h++){var m=i[h];if(":"!=m||p){var g=Iv(m,Av);p?e.password+=g:e.username+=g}else p=!0}l=""}else if(a==Yg||"/"==a||"?"==a||"#"==a||"\\"==a&&Rv(e)){if(d&&""==l)return iv;u-=Kr(l).length+1,l="",c=Yv}else l+=a;break;case Yv:case $v:if(r&&"file"==e.scheme){c=ty;continue}if(":"!=a||f){if(a==Yg||"/"==a||"?"==a||"#"==a||"\\"==a&&Rv(e)){if(Rv(e)&&""==l)return cv;if(r&&""==l&&(Dv(e)||null!==e.port))return;if(s=wv(e,l))return s;if(l="",c=ry,r)return;continue}"["==a?f=!0:"]"==a&&(f=!1),l+=a}else{if(""==l)return cv;if(s=wv(e,l))return s;if(l="",c=Zv,r==$v)return}break;case Zv:if(!fv.test(a)){if(a==Yg||"/"==a||"?"==a||"#"==a||"\\"==a&&Rv(e)||r){if(""!=l){var v=parseInt(l,10);if(v>65535)return uv;e.port=Rv(e)&&v===Pv[e.scheme]?null:v,l=""}if(r)return;c=ry;continue}return uv}l+=a;break;case Jv:if(e.scheme="file","/"==a||"\\"==a)c=ey;else{if(!n||"file"!=n.scheme){c=ny;continue}if(a==Yg)e.host=n.host,e.path=n.path.slice(),e.query=n.query;else if("?"==a)e.host=n.host,e.path=n.path.slice(),e.query="",c=ay;else{if("#"!=a){Lv(o.slice(u).join(""))||(e.host=n.host,e.path=n.path.slice(),Mv(e)),c=ny;continue}e.host=n.host,e.path=n.path.slice(),e.query=n.query,e.fragment="",c=iy}}break;case ey:if("/"==a||"\\"==a){c=ty;break}n&&"file"==n.scheme&&!Lv(o.slice(u).join(""))&&(Ov(n.path[0],!0)?e.path.push(n.path[0]):e.host=n.host),c=ny;continue;case ty:if(a==Yg||"/"==a||"\\"==a||"?"==a||"#"==a){if(!r&&Ov(l))c=ny;else if(""==l){if(e.host="",r)return;c=ry}else{if(s=wv(e,l))return s;if("localhost"==e.host&&(e.host=""),r)return;l="",c=ry}continue}l+=a;break;case ry:if(Rv(e)){if(c=ny,"/"!=a&&"\\"!=a)continue}else if(r||"?"!=a)if(r||"#"!=a){if(a!=Yg&&(c=ny,"/"!=a))continue}else e.fragment="",c=iy;else e.query="",c=ay;break;case ny:if(a==Yg||"/"==a||"\\"==a&&Rv(e)||!r&&("?"==a||"#"==a)){if(Uv(l)?(Mv(e),"/"==a||"\\"==a&&Rv(e)||e.path.push("")):Fv(l)?"/"==a||"\\"==a&&Rv(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&Ov(l)&&(e.host&&(e.host=""),l=l.charAt(0)+":"),e.path.push(l)),l="","file"==e.scheme&&(a==Yg||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",c=ay):"#"==a&&(e.fragment="",c=iy)}else l+=Iv(a,Tv);break;case oy:"?"==a?(e.query="",c=ay):"#"==a?(e.fragment="",c=iy):a!=Yg&&(e.path[0]+=Iv(a,_v));break;case ay:r||"#"!=a?a!=Yg&&("'"==a&&Rv(e)?e.query+="%27":e.query+="#"==a?"%23":Iv(a,_v)):(e.fragment="",c=iy);break;case iy:a!=Yg&&(e.fragment+=Iv(a,xv))}u++}},cy=function(e){var t,r,n=Nl(this,cy,"URL"),o=arguments.length>1?arguments[1]:void 0,a=String(e),i=rv(n,{type:"URL"});if(void 0!==o)if(o instanceof cy)t=nv(o);else if(r=sy(t={},String(o)))throw TypeError(r);if(r=sy(i,a,null,t))throw TypeError(r);var s=i.searchParams=new ev,c=tv(s);c.updateSearchParams(i.query),c.updateURL=function(){i.query=String(s)||null},u||(n.href=ly.call(n),n.origin=dy.call(n),n.protocol=fy.call(n),n.username=py.call(n),n.password=hy.call(n),n.host=my.call(n),n.hostname=gy.call(n),n.port=vy.call(n),n.pathname=yy.call(n),n.search=by.call(n),n.searchParams=Cy.call(n),n.hash=wy.call(n))},uy=cy.prototype,ly=function(){var e=nv(this),t=e.scheme,r=e.username,n=e.password,o=e.host,a=e.port,i=e.path,s=e.query,c=e.fragment,u=t+":";return null!==o?(u+="//",Dv(e)&&(u+=r+(n?":"+n:"")+"@"),u+=Bv(o),null!==a&&(u+=":"+a)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?i[0]:i.length?"/"+i.join("/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},dy=function(){var e=nv(this),t=e.scheme,r=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Rv(e)?t+"://"+Bv(e.host)+(null!==r?":"+r:""):"null"},fy=function(){return nv(this).scheme+":"},py=function(){return nv(this).username},hy=function(){return nv(this).password},my=function(){var e=nv(this),t=e.host,r=e.port;return null===t?"":null===r?Bv(t):Bv(t)+":"+r},gy=function(){var e=nv(this).host;return null===e?"":Bv(e)},vy=function(){var e=nv(this).port;return null===e?"":String(e)},yy=function(){var e=nv(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},by=function(){var e=nv(this).query;return e?"?"+e:""},Cy=function(){return nv(this).searchParams},wy=function(){var e=nv(this).fragment;return e?"#"+e:""},ky=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(u&&$e(uy,{href:ky(ly,(function(e){var t=nv(this),r=String(e),n=sy(t,r);if(n)throw TypeError(n);tv(t.searchParams).updateSearchParams(t.query)})),origin:ky(dy),protocol:ky(fy,(function(e){var t=nv(this);sy(t,String(e)+":",jv)})),username:ky(py,(function(e){var t=nv(this),r=Kr(String(e));if(!Nv(t)){t.username="";for(var n=0;n<r.length;n++)t.username+=Iv(r[n],Av)}})),password:ky(hy,(function(e){var t=nv(this),r=Kr(String(e));if(!Nv(t)){t.password="";for(var n=0;n<r.length;n++)t.password+=Iv(r[n],Av)}})),host:ky(my,(function(e){var t=nv(this);t.cannotBeABaseURL||sy(t,String(e),Yv)})),hostname:ky(gy,(function(e){var t=nv(this);t.cannotBeABaseURL||sy(t,String(e),$v)})),port:ky(vy,(function(e){var t=nv(this);Nv(t)||(""==(e=String(e))?t.port=null:sy(t,e,Zv))})),pathname:ky(yy,(function(e){var t=nv(this);t.cannotBeABaseURL||(t.path=[],sy(t,e+"",ry))})),search:ky(by,(function(e){var t=nv(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",sy(t,e,ay)),tv(t.searchParams).updateSearchParams(t.query)})),searchParams:ky(Cy),hash:ky(wy,(function(e){var t=nv(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",sy(t,e,iy)):t.fragment=null}))}),pe(uy,"toJSON",(function(){return ly.call(this)}),{enumerable:!0}),pe(uy,"toString",(function(){return ly.call(this)}),{enumerable:!0}),Jg){var Sy=Jg.createObjectURL,Ey=Jg.revokeObjectURL;Sy&&pe(cy,"createObjectURL",(function(e){return Sy.apply(Jg,arguments)})),Ey&&pe(cy,"revokeObjectURL",(function(e){return Ey.apply(Jg,arguments)}))}_t(cy,"URL"),Ke({global:!0,forced:!ag,sham:!u},{URL:cy}),Ke({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});o((function(e){var t=function(e){var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),i=new T(n||[]);return a._invoke=function(e,t,r){var n=d;return function(o,a){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw a;return I()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=B(i,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=l(e,t,r);if("normal"===c.type){if(n=r.done?h:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=h,r.method="throw",r.arg=c.arg)}}}(e,r,i),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",h="completed",m={};function g(){}function v(){}function y(){}var b={};b[a]=function(){return this};var C=Object.getPrototypeOf,w=C&&C(C(A([])));w&&w!==r&&n.call(w,a)&&(b=w);var k=y.prototype=g.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,a,i,s){var c=l(e[o],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(d).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,s)}))}s(c.arg)}var o;this._invoke=function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}}function B(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,B(e,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=l(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function A(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}return{next:I}}function I(){return{value:t,done:!0}}return v.prototype=k.constructor=y,y.constructor=v,v.displayName=c(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,s,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},S(E.prototype),E.prototype[i]=function(){return this},e.AsyncIterator=E,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new E(u(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},S(k),c(k,s,"Generator"),k[a]=function(){return this},k.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));function By(e){return(By="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _y(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function xy(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){_y(a,n,o,i,s,"next",e)}function s(e){_y(a,n,o,i,s,"throw",e)}i(void 0)}))}}function Ty(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ay(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 Iy(e,t,r){return t&&Ay(e.prototype,t),r&&Ay(e,r),e}function Py(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ry(){return(Ry=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 Dy(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 Ny(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dy(Object(r),!0).forEach((function(t){Py(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dy(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Oy(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&My(e,t)}function Ly(e){return(Ly=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function My(e,t){return(My=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fy(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function Uy(e,t,r){return(Uy=Fy()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&My(o,r.prototype),o}).apply(null,arguments)}function jy(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function Vy(e,t){if(null==e)return{};var r,n,o=jy(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function zy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qy(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?zy(e):t}function Hy(e){var t=Fy();return function(){var r,n=Ly(e);if(t){var o=Ly(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qy(this,r)}}function Ky(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Wy(e,t){return Yy(e)||Zy(e,t)||Jy(e,t)||rb()}function Qy(e){return Yy(e)||$y(e)||Jy(e)||rb()}function Gy(e){return Xy(e)||$y(e)||Jy(e)||tb()}function Xy(e){if(Array.isArray(e))return eb(e)}function Yy(e){if(Array.isArray(e))return e}function $y(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function Zy(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw a}}return r}}function Jy(e,t){if(e){if("string"==typeof e)return eb(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)?eb(e,t):void 0}}function eb(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}function tb(){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 rb(){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 nb(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=Jy(e))||t&&e&&"number"==typeof e.length){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){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}
|
2
|
+
/*
|
3
|
+
object-assign
|
4
|
+
(c) Sindre Sorhus
|
5
|
+
@license MIT
|
6
|
+
*/var ob=Object.getOwnPropertySymbols,ab=Object.prototype.hasOwnProperty,ib=Object.prototype.propertyIsEnumerable;function sb(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function cb(){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}}var ub=cb()?Object.assign:function(e,t){for(var r,n,o=sb(e),a=1;a<arguments.length;a++){for(var i in r=Object(arguments[a]))ab.call(r,i)&&(o[i]=r[i]);if(ob){n=ob(r);for(var s=0;s<n.length;s++)ib.call(r,n[s])&&(o[n[s]]=r[n[s]])}}return o},lb="function"==typeof Symbol&&Symbol.for,db=lb?Symbol.for("react.element"):60103,fb=lb?Symbol.for("react.portal"):60106,pb=lb?Symbol.for("react.fragment"):60107,hb=lb?Symbol.for("react.strict_mode"):60108,mb=lb?Symbol.for("react.profiler"):60114,gb=lb?Symbol.for("react.provider"):60109,vb=lb?Symbol.for("react.context"):60110,yb=lb?Symbol.for("react.forward_ref"):60112,bb=lb?Symbol.for("react.suspense"):60113,Cb=lb?Symbol.for("react.memo"):60115,wb=lb?Symbol.for("react.lazy"):60116,kb="function"==typeof Symbol&&Symbol.iterator;function Sb(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Eb={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Bb={};function _b(e,t,r){this.props=e,this.context=t,this.refs=Bb,this.updater=r||Eb}function xb(){}function Tb(e,t,r){this.props=e,this.context=t,this.refs=Bb,this.updater=r||Eb}_b.prototype.isReactComponent={},_b.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(Sb(85));this.updater.enqueueSetState(this,e,t,"setState")},_b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},xb.prototype=_b.prototype;var Ab=Tb.prototype=new xb;Ab.constructor=Tb,ub(Ab,_b.prototype),Ab.isPureReactComponent=!0;var Ib={current:null},Pb=Object.prototype.hasOwnProperty,Rb={key:!0,ref:!0,__self:!0,__source:!0};function Db(e,t,r){var n,o={},a=null,i=null;if(null!=t)for(n in void 0!==t.ref&&(i=t.ref),void 0!==t.key&&(a=""+t.key),t)Pb.call(t,n)&&!Rb.hasOwnProperty(n)&&(o[n]=t[n]);var s=arguments.length-2;if(1===s)o.children=r;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(n in s=e.defaultProps)void 0===o[n]&&(o[n]=s[n]);return{$$typeof:db,type:e,key:a,ref:i,props:o,_owner:Ib.current}}function Nb(e,t){return{$$typeof:db,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ob(e){return"object"==typeof e&&null!==e&&e.$$typeof===db}function Lb(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}var Mb=/\/+/g,Fb=[];function Ub(e,t,r,n){if(Fb.length){var o=Fb.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function jb(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>Fb.length&&Fb.push(e)}function Vb(e,t,r,n){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case db:case fb:a=!0}}if(a)return r(n,e,""===t?"."+qb(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var i=0;i<e.length;i++){var s=t+qb(o=e[i],i);a+=Vb(o,s,r,n)}else if(null===e||"object"!=typeof e?s=null:s="function"==typeof(s=kb&&e[kb]||e["@@iterator"])?s:null,"function"==typeof s)for(e=s.call(e),i=0;!(o=e.next()).done;)a+=Vb(o=o.value,s=t+qb(o,i++),r,n);else if("object"===o)throw r=""+e,Error(Sb(31,"[object Object]"===r?"object with keys {"+Object.keys(e).join(", ")+"}":r,""));return a}function zb(e,t,r){return null==e?0:Vb(e,"",t,r)}function qb(e,t){return"object"==typeof e&&null!==e&&null!=e.key?Lb(e.key):t.toString(36)}function Hb(e,t){e.func.call(e.context,t,e.count++)}function Kb(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?Wb(e,n,r,(function(e){return e})):null!=e&&(Ob(e)&&(e=Nb(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(Mb,"$&/")+"/")+r)),n.push(e))}function Wb(e,t,r,n,o){var a="";null!=r&&(a=(""+r).replace(Mb,"$&/")+"/"),zb(e,Kb,t=Ub(t,a,n,o)),jb(t)}var Qb={current:null};function Gb(){var e=Qb.current;if(null===e)throw Error(Sb(321));return e}var Xb={ReactCurrentDispatcher:Qb,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:Ib,IsSomeRendererActing:{current:!1},assign:ub},Yb={map:function(e,t,r){if(null==e)return e;var n=[];return Wb(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;zb(e,Hb,t=Ub(null,null,t,r)),jb(t)},count:function(e){return zb(e,(function(){return null}),null)},toArray:function(e){var t=[];return Wb(e,t,null,(function(e){return e})),t},only:function(e){if(!Ob(e))throw Error(Sb(143));return e}},$b=_b,Zb=pb,Jb=mb,eC=Tb,tC=hb,rC=bb,nC=Xb,oC=function(e,t,r){if(null==e)throw Error(Sb(267,e));var n=ub({},e.props),o=e.key,a=e.ref,i=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,i=Ib.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(c in t)Pb.call(t,c)&&!Rb.hasOwnProperty(c)&&(n[c]=void 0===t[c]&&void 0!==s?s[c]:t[c])}var c=arguments.length-2;if(1===c)n.children=r;else if(1<c){s=Array(c);for(var u=0;u<c;u++)s[u]=arguments[u+2];n.children=s}return{$$typeof:db,type:e.type,key:o,ref:a,props:n,_owner:i}},aC=function(e,t){return void 0===t&&(t=null),(e={$$typeof:vb,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:gb,_context:e},e.Consumer=e},iC=Db,sC=function(e){var t=Db.bind(null,e);return t.type=e,t},cC=function(){return{current:null}},uC=function(e){return{$$typeof:yb,render:e}},lC=Ob,dC=function(e){return{$$typeof:wb,_ctor:e,_status:-1,_result:null}},fC=function(e,t){return{$$typeof:Cb,type:e,compare:void 0===t?null:t}},pC=function(e,t){return Gb().useCallback(e,t)},hC=function(e,t){return Gb().useContext(e,t)},mC=function(){},gC=function(e,t){return Gb().useEffect(e,t)},vC=function(e,t,r){return Gb().useImperativeHandle(e,t,r)},yC=function(e,t){return Gb().useLayoutEffect(e,t)},bC=function(e,t){return Gb().useMemo(e,t)},CC=function(e,t,r){return Gb().useReducer(e,t,r)},wC=function(e){return Gb().useRef(e)},kC=function(e){return Gb().useState(e)},SC="16.14.0",EC={Children:Yb,Component:$b,Fragment:Zb,Profiler:Jb,PureComponent:eC,StrictMode:tC,Suspense:rC,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:nC,cloneElement:oC,createContext:aC,createElement:iC,createFactory:sC,createRef:cC,forwardRef:uC,isValidElement:lC,lazy:dC,memo:fC,useCallback:pC,useContext:hC,useDebugValue:mC,useEffect:gC,useImperativeHandle:vC,useLayoutEffect:yC,useMemo:bC,useReducer:CC,useRef:wC,useState:kC,version:SC},BC="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",_C=BC,xC=(o((function(e,t){})),o((function(e){e.exports=EC}))),TC="function"==typeof Symbol&&Symbol.for,AC=TC?Symbol.for("react.element"):60103,IC=TC?Symbol.for("react.portal"):60106,PC=TC?Symbol.for("react.fragment"):60107,RC=TC?Symbol.for("react.strict_mode"):60108,DC=TC?Symbol.for("react.profiler"):60114,NC=TC?Symbol.for("react.provider"):60109,OC=TC?Symbol.for("react.context"):60110,LC=TC?Symbol.for("react.async_mode"):60111,MC=TC?Symbol.for("react.concurrent_mode"):60111,FC=TC?Symbol.for("react.forward_ref"):60112,UC=TC?Symbol.for("react.suspense"):60113,jC=TC?Symbol.for("react.suspense_list"):60120,VC=TC?Symbol.for("react.memo"):60115,zC=TC?Symbol.for("react.lazy"):60116,qC=TC?Symbol.for("react.block"):60121,HC=TC?Symbol.for("react.fundamental"):60117,KC=TC?Symbol.for("react.responder"):60118,WC=TC?Symbol.for("react.scope"):60119;function QC(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case AC:switch(e=e.type){case LC:case MC:case PC:case DC:case RC:case UC:return e;default:switch(e=e&&e.$$typeof){case OC:case FC:case zC:case VC:case NC:return e;default:return t}}case IC:return t}}}function GC(e){return QC(e)===MC}var XC=LC,YC=MC,$C=OC,ZC=NC,JC=AC,ew=FC,tw=PC,rw=zC,nw=VC,ow=IC,aw=DC,iw=RC,sw=UC,cw=function(e){return GC(e)||QC(e)===LC},uw=GC,lw=function(e){return QC(e)===OC},dw=function(e){return QC(e)===NC},fw=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===AC},pw=function(e){return QC(e)===FC},hw=function(e){return QC(e)===PC},mw=function(e){return QC(e)===zC},gw=function(e){return QC(e)===VC},vw=function(e){return QC(e)===IC},yw=function(e){return QC(e)===DC},bw=function(e){return QC(e)===RC},Cw=function(e){return QC(e)===UC},ww=function(e){return"string"==typeof e||"function"==typeof e||e===PC||e===MC||e===DC||e===RC||e===UC||e===jC||"object"==typeof e&&null!==e&&(e.$$typeof===zC||e.$$typeof===VC||e.$$typeof===NC||e.$$typeof===OC||e.$$typeof===FC||e.$$typeof===HC||e.$$typeof===KC||e.$$typeof===WC||e.$$typeof===qC)},kw=QC,Sw={AsyncMode:XC,ConcurrentMode:YC,ContextConsumer:$C,ContextProvider:ZC,Element:JC,ForwardRef:ew,Fragment:tw,Lazy:rw,Memo:nw,Portal:ow,Profiler:aw,StrictMode:iw,Suspense:sw,isAsyncMode:cw,isConcurrentMode:uw,isContextConsumer:lw,isContextProvider:dw,isElement:fw,isForwardRef:pw,isFragment:hw,isLazy:mw,isMemo:gw,isPortal:vw,isProfiler:yw,isStrictMode:bw,isSuspense:Cw,isValidElementType:ww,typeOf:kw};o((function(e,t){})),o((function(e){e.exports=Sw})),Function.call.bind(Object.prototype.hasOwnProperty);function Ew(){}function Bw(){}Bw.resetWarningCache=Ew;var _w=function(){function e(e,t,r,n,o,a){if(a!==_C){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Bw,resetWarningCache:Ew};return r.PropTypes=r,r},xw=o((function(e){e.exports=_w()})),Tw=60103,Aw=60106,Iw=60107,Pw=60108,Rw=60114,Dw=60109,Nw=60110,Ow=60112,Lw=60113,Mw=60120,Fw=60115,Uw=60116,jw=60121,Vw=60122,zw=60117,qw=60129,Hw=60131;if("function"==typeof Symbol&&Symbol.for){var Kw=Symbol.for;Tw=Kw("react.element"),Aw=Kw("react.portal"),Iw=Kw("react.fragment"),Pw=Kw("react.strict_mode"),Rw=Kw("react.profiler"),Dw=Kw("react.provider"),Nw=Kw("react.context"),Ow=Kw("react.forward_ref"),Lw=Kw("react.suspense"),Mw=Kw("react.suspense_list"),Fw=Kw("react.memo"),Uw=Kw("react.lazy"),jw=Kw("react.block"),Vw=Kw("react.server.block"),zw=Kw("react.fundamental"),qw=Kw("react.debug_trace_mode"),Hw=Kw("react.legacy_hidden")}function Ww(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Tw:switch(e=e.type){case Iw:case Rw:case Pw:case Lw:case Mw:return e;default:switch(e=e&&e.$$typeof){case Nw:case Ow:case Uw:case Fw:case Dw:return e;default:return t}}case Aw:return t}}}var Qw=Dw,Gw=Tw,Xw=Ow,Yw=Iw,$w=Uw,Zw=Fw,Jw=Aw,ek=Rw,tk=Pw,rk=Lw,nk=Nw,ok=Qw,ak=Gw,ik=Xw,sk=Yw,ck=$w,uk=Zw,lk=Jw,dk=ek,fk=tk,pk=rk,hk=function(){return!1},mk=function(){return!1},gk=function(e){return Ww(e)===Nw},vk=function(e){return Ww(e)===Dw},yk=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Tw},bk=function(e){return Ww(e)===Ow},Ck=function(e){return Ww(e)===Iw},wk=function(e){return Ww(e)===Uw},kk=function(e){return Ww(e)===Fw},Sk=function(e){return Ww(e)===Aw},Ek=function(e){return Ww(e)===Rw},Bk=function(e){return Ww(e)===Pw},_k=function(e){return Ww(e)===Lw},xk=function(e){return"string"==typeof e||"function"==typeof e||e===Iw||e===Rw||e===qw||e===Pw||e===Lw||e===Mw||e===Hw||"object"==typeof e&&null!==e&&(e.$$typeof===Uw||e.$$typeof===Fw||e.$$typeof===Dw||e.$$typeof===Nw||e.$$typeof===Ow||e.$$typeof===zw||e.$$typeof===jw||e[0]===Vw)},Tk=Ww,Ak={ContextConsumer:nk,ContextProvider:ok,Element:ak,ForwardRef:ik,Fragment:sk,Lazy:ck,Memo:uk,Portal:lk,Profiler:dk,StrictMode:fk,Suspense:pk,isAsyncMode:hk,isConcurrentMode:mk,isContextConsumer:gk,isContextProvider:vk,isElement:yk,isForwardRef:bk,isFragment:Ck,isLazy:wk,isMemo:kk,isPortal:Sk,isProfiler:Ek,isStrictMode:Bk,isSuspense:_k,isValidElementType:xk,typeOf:Tk},Ik=(o((function(e,t){})),o((function(e){e.exports=Ak})));function Pk(e){function t(e,n,c,u,f){for(var p,h,m,g,C,k=0,S=0,E=0,B=0,_=0,R=0,N=m=p=0,L=0,M=0,F=0,U=0,j=c.length,V=j-1,z="",q="",H="",K="";L<j;){if(h=c.charCodeAt(L),L===V&&0!==S+B+E+k&&(0!==S&&(h=47===S?10:47),B=E=k=0,j++,V++),0===S+B+E+k){if(L===V&&(0<M&&(z=z.replace(d,"")),0<z.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:z+=c.charAt(L)}h=59}switch(h){case 123:for(p=(z=z.trim()).charCodeAt(0),m=1,U=++L;L<j;){switch(h=c.charCodeAt(L)){case 123:m++;break;case 125:m--;break;case 47:switch(h=c.charCodeAt(L+1)){case 42:case 47:e:{for(N=L+1;N<V;++N)switch(c.charCodeAt(N)){case 47:if(42===h&&42===c.charCodeAt(N-1)&&L+2!==N){L=N+1;break e}break;case 10:if(47===h){L=N+1;break e}}L=N}}break;case 91:h++;case 40:h++;case 34:case 39:for(;L++<V&&c.charCodeAt(L)!==h;);}if(0===m)break;L++}switch(m=c.substring(U,L),0===p&&(p=(z=z.replace(l,"").trim()).charCodeAt(0)),p){case 64:switch(0<M&&(z=z.replace(d,"")),h=z.charCodeAt(1)){case 100:case 109:case 115:case 45:M=n;break;default:M=P}if(U=(m=t(n,M,m,h,f+1)).length,0<D&&(C=s(3,m,M=r(P,z,F),n,T,x,U,h,f,u),z=M.join(""),void 0!==C&&0===(U=(m=C.trim()).length)&&(h=0,m="")),0<U)switch(h){case 115:z=z.replace(w,i);case 100:case 109:case 45:m=z+"{"+m+"}";break;case 107:m=(z=z.replace(v,"$1 $2"))+"{"+m+"}",m=1===I||2===I&&a("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=z+m,112===u&&(q+=m,m="")}else m="";break;default:m=t(n,r(n,z,F),m,u,f+1)}H+=m,m=F=M=N=p=0,z="",h=c.charCodeAt(++L);break;case 125:case 59:if(1<(U=(z=(0<M?z.replace(d,""):z).trim()).length))switch(0===N&&(p=z.charCodeAt(0),45===p||96<p&&123>p)&&(U=(z=z.replace(" ",":")).length),0<D&&void 0!==(C=s(1,z,n,e,T,x,q.length,u,f,u))&&0===(U=(z=C.trim()).length)&&(z="\0\0"),p=z.charCodeAt(0),h=z.charCodeAt(1),p){case 0:break;case 64:if(105===h||99===h){K+=z+c.charAt(L);break}default:58!==z.charCodeAt(U-1)&&(q+=o(z,p,h,z.charCodeAt(2)))}F=M=N=p=0,z="",h=c.charCodeAt(++L)}}switch(h){case 13:case 10:47===S?S=0:0===1+p&&107!==u&&0<z.length&&(M=1,z+="\0"),0<D*O&&s(0,z,n,e,T,x,q.length,u,f,u),x=1,T++;break;case 59:case 125:if(0===S+B+E+k){x++;break}default:switch(x++,g=c.charAt(L),h){case 9:case 32:if(0===B+k+S)switch(_){case 44:case 58:case 9:case 32:g="";break;default:32!==h&&(g=" ")}break;case 0:g="\\0";break;case 12:g="\\f";break;case 11:g="\\v";break;case 38:0===B+S+k&&(M=F=1,g="\f"+g);break;case 108:if(0===B+S+k+A&&0<N)switch(L-N){case 2:112===_&&58===c.charCodeAt(L-3)&&(A=_);case 8:111===R&&(A=R)}break;case 58:0===B+S+k&&(N=L);break;case 44:0===S+E+B+k&&(M=1,g+="\r");break;case 34:case 39:0===S&&(B=B===h?0:0===B?h:B);break;case 91:0===B+S+E&&k++;break;case 93:0===B+S+E&&k--;break;case 41:0===B+S+k&&E--;break;case 40:if(0===B+S+k){if(0===p)switch(2*_+3*R){case 533:break;default:p=1}E++}break;case 64:0===S+E+B+k+N+m&&(m=1);break;case 42:case 47:if(!(0<B+k+E))switch(S){case 0:switch(2*h+3*c.charCodeAt(L+1)){case 235:S=47;break;case 220:U=L,S=42}break;case 42:47===h&&42===_&&U+2!==L&&(33===c.charCodeAt(U+2)&&(q+=c.substring(U,L+1)),g="",S=0)}}0===S&&(z+=g)}R=_,_=h,L++}if(0<(U=q.length)){if(M=n,0<D&&(void 0!==(C=s(2,q,M,e,T,x,U,u,f,u))&&0===(q=C).length))return K+q+H;if(q=M.join(",")+"{"+q+"}",0!=I*A){switch(2!==I||a(q,2)||(A=0),A){case 111:q=q.replace(b,":-moz-$1")+q;break;case 112:q=q.replace(y,"::-webkit-input-$1")+q.replace(y,"::-moz-$1")+q.replace(y,":-ms-input-$1")+q}A=0}}return K+q+H}function r(e,t,r){var o=t.trim().split(m);t=o;var a=o.length,i=e.length;switch(i){case 0:case 1:var s=0;for(e=0===i?"":e[0]+" ";s<a;++s)t[s]=n(e,t[s],r).trim();break;default:var c=s=0;for(t=[];s<a;++s)for(var u=0;u<i;++u)t[c++]=n(e[u]+" ",o[s],r).trim()}return t}function n(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(g,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function o(e,t,r,n){var i=e+";",s=2*t+3*r+4*n;if(944===s){e=i.indexOf(":",9)+1;var c=i.substring(e,i.length-1).trim();return c=i.substring(0,e).trim()+c+";",1===I||2===I&&a(c,1)?"-webkit-"+c+c:c}if(0===I||2===I&&!a(i,1))return i;switch(s){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(_,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(c=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+c+i;case 1005:return p.test(i)?i.replace(f,":-webkit-")+i.replace(f,":-moz-")+i:i;case 1e3:switch(t=(c=i.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(t)){case 226:c=i.replace(C,"tb");break;case 232:c=i.replace(C,"tb-rl");break;case 220:c=i.replace(C,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+c+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,s=(c=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:i=i.replace(c,"-webkit-"+c)+";"+i;break;case 207:case 102:i=i.replace(c,"-webkit-"+(102<s?"inline-":"")+"box")+";"+i.replace(c,"-webkit-"+c)+";"+i.replace(c,"-ms-"+c+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return c=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+c+"-ms-flex-"+c+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(S,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(S,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===B.test(e))return 115===(c=e.substring(e.indexOf(":")+1)).charCodeAt(0)?o(e.replace("stretch","fill-available"),t,r,n).replace(":fill-available",":stretch"):i.replace(c,"-webkit-"+c)+i.replace(c,"-moz-"+c.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===r+n&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(h,"$1-webkit-$2")+i}return i}function a(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),N(2!==t?n:n.replace(E,"$1"),r,t)}function i(e,t){var r=o(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(k," or ($1)").substring(4):"("+t+")"}function s(e,t,r,n,o,a,i,s,c,l){for(var d,f=0,p=t;f<D;++f)switch(d=R[f].call(u,e,p,r,n,o,a,i,s,c,l)){case void 0:case!1:case!0:case null:break;default:p=d}if(p!==t)return p}function c(e){return void 0!==(e=e.prefix)&&(N=null,e?"function"!=typeof e?I=1:(I=2,N=e):I=0),c}function u(e,r){var n=e;if(33>n.charCodeAt(0)&&(n=n.trim()),n=[n],0<D){var o=s(-1,r,n,n,T,x,0,0,0,0);void 0!==o&&"string"==typeof o&&(r=o)}var a=t(P,n,r,0,0);return 0<D&&(void 0!==(o=s(-2,a,n,n,T,x,a.length,0,0,0))&&(a=o)),"",A=0,x=T=1,a}var l=/^\0+/g,d=/[\0\r\f]/g,f=/: */g,p=/zoo|gra/,h=/([,: ])(transform)/g,m=/,\r+?/g,g=/([\t\r\n ])*\f?&/g,v=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,b=/:(read-only)/g,C=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,k=/([\s\S]*?);/g,S=/-self|flex-/g,E=/[^]*?(:[rp][el]a[\w-]+)[^]*/,B=/stretch|:\s*\w+\-(?:conte|avail)/,_=/([^-])(image-set\()/,x=1,T=1,A=0,I=1,P=[],R=[],D=0,N=null,O=0;return u.use=function e(t){switch(t){case void 0:case null:D=R.length=0;break;default:if("function"==typeof t)R[D++]=t;else if("object"==typeof t)for(var r=0,n=t.length;r<n;++r)e(t[r]);else O=0|!!t}return e},u.set=c,void 0!==e&&c(e),u}var Rk={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Dk(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var Nk=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Ok=Dk((function(e){return Nk.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),Lk="function"==typeof Symbol&&Symbol.for,Mk=Lk?Symbol.for("react.element"):60103,Fk=Lk?Symbol.for("react.portal"):60106,Uk=Lk?Symbol.for("react.fragment"):60107,jk=Lk?Symbol.for("react.strict_mode"):60108,Vk=Lk?Symbol.for("react.profiler"):60114,zk=Lk?Symbol.for("react.provider"):60109,qk=Lk?Symbol.for("react.context"):60110,Hk=Lk?Symbol.for("react.async_mode"):60111,Kk=Lk?Symbol.for("react.concurrent_mode"):60111,Wk=Lk?Symbol.for("react.forward_ref"):60112,Qk=Lk?Symbol.for("react.suspense"):60113,Gk=Lk?Symbol.for("react.suspense_list"):60120,Xk=Lk?Symbol.for("react.memo"):60115,Yk=Lk?Symbol.for("react.lazy"):60116,$k=Lk?Symbol.for("react.block"):60121,Zk=Lk?Symbol.for("react.fundamental"):60117,Jk=Lk?Symbol.for("react.responder"):60118,eS=Lk?Symbol.for("react.scope"):60119;function tS(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Mk:switch(e=e.type){case Hk:case Kk:case Uk:case Vk:case jk:case Qk:return e;default:switch(e=e&&e.$$typeof){case qk:case Wk:case Yk:case Xk:case zk:return e;default:return t}}case Fk:return t}}}function rS(e){return tS(e)===Kk}var nS=Hk,oS=Kk,aS=qk,iS=zk,sS=Mk,cS=Wk,uS=Uk,lS=Yk,dS=Xk,fS=Fk,pS=Vk,hS=jk,mS=Qk,gS=function(e){return rS(e)||tS(e)===Hk},vS=rS,yS=function(e){return tS(e)===qk},bS=function(e){return tS(e)===zk},CS=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Mk},wS=function(e){return tS(e)===Wk},kS=function(e){return tS(e)===Uk},SS=function(e){return tS(e)===Yk},ES=function(e){return tS(e)===Xk},BS=function(e){return tS(e)===Fk},_S=function(e){return tS(e)===Vk},xS=function(e){return tS(e)===jk},TS=function(e){return tS(e)===Qk},AS=function(e){return"string"==typeof e||"function"==typeof e||e===Uk||e===Kk||e===Vk||e===jk||e===Qk||e===Gk||"object"==typeof e&&null!==e&&(e.$$typeof===Yk||e.$$typeof===Xk||e.$$typeof===zk||e.$$typeof===qk||e.$$typeof===Wk||e.$$typeof===Zk||e.$$typeof===Jk||e.$$typeof===eS||e.$$typeof===$k)},IS=tS,PS={AsyncMode:nS,ConcurrentMode:oS,ContextConsumer:aS,ContextProvider:iS,Element:sS,ForwardRef:cS,Fragment:uS,Lazy:lS,Memo:dS,Portal:fS,Profiler:pS,StrictMode:hS,Suspense:mS,isAsyncMode:gS,isConcurrentMode:vS,isContextConsumer:yS,isContextProvider:bS,isElement:CS,isForwardRef:wS,isFragment:kS,isLazy:SS,isMemo:ES,isPortal:BS,isProfiler:_S,isStrictMode:xS,isSuspense:TS,isValidElementType:AS,typeOf:IS},RS=(o((function(e,t){})),o((function(e){e.exports=PS}))),DS={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},NS={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},OS={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},LS={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},MS={};function FS(e){return RS.isMemo(e)?LS:MS[e.$$typeof]||DS}MS[RS.ForwardRef]=OS,MS[RS.Memo]=LS;var US=Object.defineProperty,jS=Object.getOwnPropertyNames,VS=Object.getOwnPropertySymbols,zS=Object.getOwnPropertyDescriptor,qS=Object.getPrototypeOf,HS=Object.prototype;function KS(e,t,r){if("string"!=typeof t){if(HS){var n=qS(t);n&&n!==HS&&KS(e,n,r)}var o=jS(t);VS&&(o=o.concat(VS(t)));for(var a=FS(e),i=FS(t),s=0;s<o.length;++s){var c=o[s];if(!(NS[c]||r&&r[c]||i&&i[c]||a&&a[c])){var u=zS(t,c);try{US(e,c,u)}catch(e){}}}}return e}var WS=KS;function QS(){return(QS=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 GS=function(e,t){for(var r=[e[0]],n=0,o=t.length;n<o;n+=1)r.push(t[n],e[n+1]);return r},XS=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!Ik.typeOf(e)},YS=Object.freeze([]),$S=Object.freeze({});function ZS(e){return"function"==typeof e}function JS(e){return e.displayName||e.name||"Component"}function eE(e){return e&&"string"==typeof e.styledComponentId}var tE="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",rE="undefined"!=typeof window&&"HTMLElement"in window,nE=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&("false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY)),oE={};function aE(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(r.length>0?" Args: "+r.join(", "):""))}var iE=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,r=0;r<e;r++)t+=this.groupSizes[r];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,o=n;e>=o;)(o<<=1)<0&&aE(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=n;a<o;a++)this.groupSizes[a]=0}for(var i=this.indexOfGroup(e+1),s=0,c=t.length;s<c;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],r=this.indexOfGroup(e),n=r+t;this.groupSizes[e]=0;for(var o=r;o<n;o++)this.tag.deleteRule(r)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),o=n+r,a=n;a<o;a++)t+=this.tag.getRule(a)+"/*!sc*/\n";return t},e}(),sE=new Map,cE=new Map,uE=1,lE=function(e){if(sE.has(e))return sE.get(e);for(;cE.has(uE);)uE++;var t=uE++;return sE.set(e,t),cE.set(t,e),t},dE=function(e){return cE.get(e)},fE=function(e,t){sE.set(e,t),cE.set(t,e)},pE="style["+tE+'][data-styled-version="5.2.1"]',hE=new RegExp("^"+tE+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),mE=function(e,t,r){for(var n,o=r.split(","),a=0,i=o.length;a<i;a++)(n=o[a])&&e.registerName(t,n)},gE=function(e,t){for(var r=t.innerHTML.split("/*!sc*/\n"),n=[],o=0,a=r.length;o<a;o++){var i=r[o].trim();if(i){var s=i.match(hE);if(s){var c=0|parseInt(s[1],10),u=s[2];0!==c&&(fE(u,c),mE(e,u,s[3]),e.getTag().insertRules(c,n)),n.length=0}else n.push(i)}}},vE=function(){return"undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null},yE=function(e){var t=document.head,r=e||t,n=document.createElement("style"),o=function(e){for(var t=e.childNodes,r=t.length;r>=0;r--){var n=t[r];if(n&&1===n.nodeType&&n.hasAttribute(tE))return n}}(r),a=void 0!==o?o.nextSibling:null;n.setAttribute(tE,"active"),n.setAttribute("data-styled-version","5.2.1");var i=vE();return i&&n.setAttribute("nonce",i),r.insertBefore(n,a),n},bE=function(){function e(e){var t=this.element=yE(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,r=0,n=t.length;r<n;r++){var o=t[r];if(o.ownerNode===e)return o}aE(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),CE=function(){function e(e){var t=this.element=yE(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var r=document.createTextNode(t),n=this.nodes[e];return this.element.insertBefore(r,n||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),wE=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),kE=rE,SE={isServer:!rE,useCSSOMInjection:!nE},EE=function(){function e(e,t,r){void 0===e&&(e=$S),void 0===t&&(t={}),this.options=QS({},SE,{},e),this.gs=t,this.names=new Map(r),!this.options.isServer&&rE&&kE&&(kE=!1,function(e){for(var t=document.querySelectorAll(pE),r=0,n=t.length;r<n;r++){var o=t[r];o&&"active"!==o.getAttribute(tE)&&(gE(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return lE(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,r){return void 0===r&&(r=!0),new e(QS({},this.options,{},t),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(r=(t=this.options).isServer,n=t.useCSSOMInjection,o=t.target,e=r?new wE(o):n?new bE(o):new CE(o),new iE(e)));var e,t,r,n,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(lE(e),this.names.has(e))this.names.get(e).add(t);else{var r=new Set;r.add(t),this.names.set(e,r)}},t.insertRules=function(e,t,r){this.registerName(e,t),this.getTag().insertRules(lE(e),r)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(lE(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),r=t.length,n="",o=0;o<r;o++){var a=dE(o);if(void 0!==a){var i=e.names.get(a),s=t.getGroup(o);if(void 0!==i&&0!==s.length){var c=tE+".g"+o+'[id="'+a+'"]',u="";void 0!==i&&i.forEach((function(e){e.length>0&&(u+=e+",")})),n+=""+s+c+'{content:"'+u+'"}/*!sc*/\n'}}}return n}(this)},e}(),BE=/(a)(d)/gi,_E=function(e){return String.fromCharCode(e+(e>25?39:97))};function xE(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=_E(t%52)+r;return(_E(t%52)+r).replace(BE,"$1-$2")}var TE=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},AE=function(e){return TE(5381,e)};function IE(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(ZS(r)&&!eE(r))return!1}return!0}var PE=AE("5.2.1"),RE=function(){function e(e,t,r){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===r||r.isStatic)&&IE(e),this.componentId=t,this.baseHash=TE(PE,t),this.baseStyle=r,EE.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,r){var n=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&t.hasNameForId(n,this.staticRulesId))o.push(this.staticRulesId);else{var a=XE(this.rules,e,t,r).join(""),i=xE(TE(this.baseHash,a.length)>>>0);if(!t.hasNameForId(n,i)){var s=r(a,"."+i,void 0,n);t.insertRules(n,i,s)}o.push(i),this.staticRulesId=i}else{for(var c=this.rules.length,u=TE(this.baseHash,r.hash),l="",d=0;d<c;d++){var f=this.rules[d];if("string"==typeof f)l+=f;else if(f){var p=XE(f,e,t,r),h=Array.isArray(p)?p.join(""):p;u=TE(u,h+d),l+=h}}if(l){var m=xE(u>>>0);if(!t.hasNameForId(n,m)){var g=r(l,"."+m,void 0,n);t.insertRules(n,m,g)}o.push(m)}}return o.join(" ")},e}(),DE=/^\s*\/\/.*$/gm,NE=[":","[",".","#"];function OE(e){var t,r,n,o,a=void 0===e?$S:e,i=a.options,s=void 0===i?$S:i,c=a.plugins,u=void 0===c?YS:c,l=new Pk(s),d=[],f=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,n,o,a,i,s,c,u,l,d){switch(r){case 1:if(0===l&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===u)return n+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+n),"";default:return n+(0===d?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}((function(e){d.push(e)})),p=function(e,n,a){return 0===n&&NE.includes(a[r.length])||a.match(o)?e:"."+t};function h(e,a,i,s){void 0===s&&(s="&");var c=e.replace(DE,""),u=a&&i?i+" "+a+" { "+c+" }":c;return t=s,r=a,n=new RegExp("\\"+r+"\\b","g"),o=new RegExp("(\\"+r+"\\b){2,}"),l(i||!a?"":a,u)}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(r)>0&&(o[0]=o[0].replace(n,p))},f,function(e){if(-2===e){var t=d;return d=[],t}}])),h.hash=u.length?u.reduce((function(e,t){return t.name||aE(15),TE(e,t.name)}),5381).toString():"",h}var LE=xC.createContext(),ME=(LE.Consumer,xC.createContext()),FE=(ME.Consumer,new EE),UE=OE();function jE(){return xC.useContext(LE)||FE}function VE(){return xC.useContext(ME)||UE}var zE=function(){function e(e,t){var r=this;this.inject=function(e,t){void 0===t&&(t=UE);var n=r.name+t.hash;e.hasNameForId(r.id,n)||e.insertRules(r.id,n,t(r.rules,n,"@keyframes"))},this.toString=function(){return aE(12,String(r.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=UE),this.name+e.hash},e}(),qE=/([A-Z])/,HE=/([A-Z])/g,KE=/^ms-/,WE=function(e){return"-"+e.toLowerCase()};function QE(e){return qE.test(e)?e.replace(HE,WE).replace(KE,"-ms-"):e}var GE=function(e){return null==e||!1===e||""===e};function XE(e,t,r,n){if(Array.isArray(e)){for(var o,a=[],i=0,s=e.length;i<s;i+=1)""!==(o=XE(e[i],t,r,n))&&(Array.isArray(o)?a.push.apply(a,o):a.push(o));return a}return GE(e)?"":eE(e)?"."+e.styledComponentId:ZS(e)?"function"!=typeof(c=e)||c.prototype&&c.prototype.isReactComponent||!t?e:XE(e(t),t,r,n):e instanceof zE?r?(e.inject(r,n),e.getName(n)):e:XS(e)?function e(t,r){var n,o,a=[];for(var i in t)t.hasOwnProperty(i)&&!GE(t[i])&&(XS(t[i])?a.push.apply(a,e(t[i],i)):ZS(t[i])?a.push(QE(i)+":",t[i],";"):a.push(QE(i)+": "+(n=i,(null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||n in Rk?String(o).trim():o+"px")+";")));return r?[r+" {"].concat(a,["}"]):a}(e):e.toString();var c}function YE(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return ZS(e)||XS(e)?XE(GS(YS,[e].concat(r))):0===r.length&&1===e.length&&"string"==typeof e[0]?e:XE(GS(e,r))}var $E=function(e,t,r){return void 0===r&&(r=$S),e.theme!==r.theme&&e.theme||t||r.theme},ZE=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,JE=/(^-|-$)/g;function eB(e){return e.replace(ZE,"-").replace(JE,"")}var tB=function(e){return xE(AE(e)>>>0)};function rB(e){return"string"==typeof e&&!0}var nB=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},oB=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function aB(e,t,r){var n=e[r];nB(t)&&nB(n)?iB(n,t):e[r]=t}function iB(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var o=0,a=r;o<a.length;o++){var i=a[o];if(nB(i))for(var s in i)oB(s)&&aB(e,i[s],s)}return e}var sB=xC.createContext();sB.Consumer;function cB(e){var t=xC.useContext(sB),r=xC.useMemo((function(){return function(e,t){return e?ZS(e)?e(t):Array.isArray(e)||"object"!=typeof e?aE(8):t?QS({},t,{},e):e:aE(14)}(e.theme,t)}),[e.theme,t]);return e.children?xC.createElement(sB.Provider,{value:r},e.children):null}var uB={};function lB(e,t,r){var n=eE(e),o=!rB(e),a=t.attrs,i=void 0===a?YS:a,s=t.componentId,c=void 0===s?function(e,t){var r="string"!=typeof e?"sc":eB(e);uB[r]=(uB[r]||0)+1;var n=r+"-"+tB("5.2.1"+r+uB[r]);return t?t+"-"+n:n}(t.displayName,t.parentComponentId):s,u=t.displayName,l=void 0===u?function(e){return rB(e)?"styled."+e:"Styled("+JS(e)+")"}(e):u,d=t.displayName&&t.componentId?eB(t.displayName)+"-"+t.componentId:t.componentId||c,f=n&&e.attrs?Array.prototype.concat(e.attrs,i).filter(Boolean):i,p=t.shouldForwardProp;n&&e.shouldForwardProp&&(p=t.shouldForwardProp?function(r,n){return e.shouldForwardProp(r,n)&&t.shouldForwardProp(r,n)}:e.shouldForwardProp);var h,m=new RE(r,d,n?e.componentStyle:void 0),g=m.isStatic&&0===i.length,v=function(e,t){return function(e,t,r,n){var o=e.attrs,a=e.componentStyle,i=e.defaultProps,s=e.foldedComponentIds,c=e.shouldForwardProp,u=e.styledComponentId,l=e.target,d=function(e,t,r){void 0===e&&(e=$S);var n=QS({},t,{theme:e}),o={};return r.forEach((function(e){var t,r,a,i=e;for(t in ZS(i)&&(i=i(n)),i)n[t]=o[t]="className"===t?(r=o[t],a=i[t],r&&a?r+" "+a:r||a):i[t]})),[n,o]}($E(t,xC.useContext(sB),i)||$S,t,o),f=d[0],p=d[1],h=function(e,t,r,n){var o=jE(),a=VE();return t?e.generateAndInjectStyles($S,o,a):e.generateAndInjectStyles(r,o,a)}(a,n,f),m=r,g=p.$as||t.$as||p.as||t.as||l,v=rB(g),y=p!==t?QS({},t,{},p):t,b={};for(var C in y)"$"!==C[0]&&"as"!==C&&("forwardedAs"===C?b.as=y[C]:(c?c(C,Ok):!v||Ok(C))&&(b[C]=y[C]));return t.style&&p.style!==t.style&&(b.style=QS({},t.style,{},p.style)),b.className=Array.prototype.concat(s,u,h!==u?h:null,t.className,p.className).filter(Boolean).join(" "),b.ref=m,xC.createElement(g,b)}(h,e,t,g)};return v.displayName=l,(h=xC.forwardRef(v)).attrs=f,h.componentStyle=m,h.displayName=l,h.shouldForwardProp=p,h.foldedComponentIds=n?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):YS,h.styledComponentId=d,h.target=n?e.target:e,h.withComponent=function(e){var n=t.componentId,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(t,["componentId"]),a=n&&n+"-"+(rB(e)?e:eB(JS(e)));return lB(e,QS({},o,{attrs:f,componentId:a}),r)},Object.defineProperty(h,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=n?iB({},e.defaultProps,t):t}}),h.toString=function(){return"."+h.styledComponentId},o&&WS(h,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),h}var dB=function(e){return function e(t,r,n){if(void 0===n&&(n=$S),!Ik.isValidElementType(r))return aE(1,String(r));var o=function(){return t(r,n,YE.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,r,QS({},n,{},o))},o.attrs=function(o){return e(t,r,QS({},n,{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},o}(lB,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){dB[e]=dB(e)}));var fB=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=IE(e),EE.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,r,n){var o=n(XE(this.rules,t,r,n).join(""),""),a=this.componentId+e;r.insertRules(a,a,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,r,n){e>2&&EE.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)},e}();function pB(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=YE.apply(void 0,[e].concat(r)),a="sc-global-"+tB(JSON.stringify(o)),i=new fB(o,a);function s(e){var t=jE(),r=VE(),n=xC.useContext(sB),o=xC.useRef(t.allocateGSInstance(a)).current;return xC.useLayoutEffect((function(){return c(o,e,t,n,r),function(){return i.removeStyles(o,t)}}),[o,e,t,n,r]),null}function c(e,t,r,n,o){if(i.isStatic)i.renderStyles(e,oE,r,o);else{var a=QS({},t,{theme:$E(t,n,s.defaultProps)});i.renderStyles(e,a,r,o)}}return xC.memo(s)}function hB(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=YE.apply(void 0,[e].concat(r)).join(""),a=tB(o);return new zE(a,o)}var mB=function(){return xC.useContext(sB)},gB=o((function(e,t){var r,n,o,a,i;if("undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,c=null,u=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(u,0),e}},l=Date.now();t.unstable_now=function(){return Date.now()-l},r=function(e){null!==s?setTimeout(r,0,e):(s=e,setTimeout(u,0))},n=function(e,t){c=setTimeout(e,t)},o=function(){clearTimeout(c)},a=function(){return!1},i=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,f=window.Date,p=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var m=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var g=f.now();t.unstable_now=function(){return f.now()-g}}var v=!1,y=null,b=-1,C=5,w=0;a=function(){return t.unstable_now()>=w},i=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):C=0<e?Math.floor(1e3/e):5};var k=new MessageChannel,S=k.port2;k.port1.onmessage=function(){if(null!==y){var e=t.unstable_now();w=e+C;try{y(!0,e)?S.postMessage(null):(v=!1,y=null)}catch(e){throw S.postMessage(null),e}}else v=!1},r=function(e){y=e,v||(v=!0,S.postMessage(null))},n=function(e,r){b=p((function(){e(t.unstable_now())}),r)},o=function(){h(b),b=-1}}function E(e,t){var r=e.length;e.push(t);e:for(;;){var n=r-1>>>1,o=e[n];if(!(void 0!==o&&0<x(o,t)))break e;e[n]=t,e[r]=o,r=n}}function B(e){return void 0===(e=e[0])?null:e}function _(e){var t=e[0];if(void 0!==t){var r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,o=e.length;n<o;){var a=2*(n+1)-1,i=e[a],s=a+1,c=e[s];if(void 0!==i&&0>x(i,r))void 0!==c&&0>x(c,i)?(e[n]=c,e[s]=r,n=s):(e[n]=i,e[a]=r,n=a);else{if(!(void 0!==c&&0>x(c,r)))break e;e[n]=c,e[s]=r,n=s}}}return t}return null}function x(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var T=[],A=[],I=1,P=null,R=3,D=!1,N=!1,O=!1;function L(e){for(var t=B(A);null!==t;){if(null===t.callback)_(A);else{if(!(t.startTime<=e))break;_(A),t.sortIndex=t.expirationTime,E(T,t)}t=B(A)}}function M(e){if(O=!1,L(e),!N)if(null!==B(T))N=!0,r(F);else{var t=B(A);null!==t&&n(M,t.startTime-e)}}function F(e,r){N=!1,O&&(O=!1,o()),D=!0;var i=R;try{for(L(r),P=B(T);null!==P&&(!(P.expirationTime>r)||e&&!a());){var s=P.callback;if(null!==s){P.callback=null,R=P.priorityLevel;var c=s(P.expirationTime<=r);r=t.unstable_now(),"function"==typeof c?P.callback=c:P===B(T)&&_(T),L(r)}else _(T);P=B(T)}if(null!==P)var u=!0;else{var l=B(A);null!==l&&n(M,l.startTime-r),u=!1}return u}finally{P=null,R=i,D=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var j=i;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||D||(N=!0,r(F))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return B(T)},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var r=R;R=t;try{return e()}finally{R=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=j,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=R;R=e;try{return t()}finally{R=r}},t.unstable_scheduleCallback=function(e,a,i){var s=t.unstable_now();if("object"==typeof i&&null!==i){var c=i.delay;c="number"==typeof c&&0<c?s+c:s,i="number"==typeof i.timeout?i.timeout:U(e)}else i=U(e),c=s;return e={id:I++,callback:a,priorityLevel:e,startTime:c,expirationTime:i=c+i,sortIndex:-1},c>s?(e.sortIndex=c,E(A,e),null===B(T)&&e===B(A)&&(O?o():O=!0,n(M,c-s))):(e.sortIndex=i,E(T,e),N||D||(N=!0,r(F))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();L(e);var r=B(T);return r!==P&&null!==P&&null!==r&&null!==r.callback&&r.startTime<=e&&r.expirationTime<P.expirationTime||a()},t.unstable_wrapCallback=function(e){var t=R;return function(){var r=R;R=t;try{return e.apply(this,arguments)}finally{R=r}}}})),vB=(o((function(e,t){})),o((function(e){e.exports=gB})));function yB(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!xC)throw Error(yB(227));function bB(e,t,r,n,o,a,i,s,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(e){this.onError(e)}}var CB=!1,wB=null,kB=!1,SB=null,EB={onError:function(e){CB=!0,wB=e}};function BB(e,t,r,n,o,a,i,s,c){CB=!1,wB=null,bB.apply(EB,arguments)}function _B(e,t,r,n,o,a,i,s,c){if(BB.apply(this,arguments),CB){if(!CB)throw Error(yB(198));var u=wB;CB=!1,wB=null,kB||(kB=!0,SB=u)}}var xB=null,TB=null,AB=null;function IB(e,t,r){var n=e.type||"unknown-event";e.currentTarget=AB(r),_B(n,t,void 0,e),e.currentTarget=null}var PB=null,RB={};function DB(){if(PB)for(var e in RB){var t=RB[e],r=PB.indexOf(e);if(!(-1<r))throw Error(yB(96,e));if(!OB[r]){if(!t.extractEvents)throw Error(yB(97,e));for(var n in OB[r]=t,r=t.eventTypes){var o=void 0,a=r[n],i=t,s=n;if(LB.hasOwnProperty(s))throw Error(yB(99,s));LB[s]=a;var c=a.phasedRegistrationNames;if(c){for(o in c)c.hasOwnProperty(o)&&NB(c[o],i,s);o=!0}else a.registrationName?(NB(a.registrationName,i,s),o=!0):o=!1;if(!o)throw Error(yB(98,n,e))}}}}function NB(e,t,r){if(MB[e])throw Error(yB(100,e));MB[e]=t,FB[e]=t.eventTypes[r].dependencies}var OB=[],LB={},MB={},FB={};function UB(e){var t,r=!1;for(t in e)if(e.hasOwnProperty(t)){var n=e[t];if(!RB.hasOwnProperty(t)||RB[t]!==n){if(RB[t])throw Error(yB(102,t));RB[t]=n,r=!0}}r&&DB()}var jB=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),VB=null,zB=null,qB=null;function HB(e){if(e=TB(e)){if("function"!=typeof VB)throw Error(yB(280));var t=e.stateNode;t&&(t=xB(t),VB(e.stateNode,e.type,t))}}function KB(e){zB?qB?qB.push(e):qB=[e]:zB=e}function WB(){if(zB){var e=zB,t=qB;if(qB=zB=null,HB(e),t)for(e=0;e<t.length;e++)HB(t[e])}}function QB(e,t){return e(t)}function GB(e,t,r,n,o){return e(t,r,n,o)}function XB(){}var YB=QB,$B=!1,ZB=!1;function JB(){null===zB&&null===qB||(XB(),WB())}function e_(e,t,r){if(ZB)return e(t,r);ZB=!0;try{return YB(e,t,r)}finally{ZB=!1,JB()}}var t_=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,r_=Object.prototype.hasOwnProperty,n_={},o_={};function a_(e){return!!r_.call(o_,e)||!r_.call(n_,e)&&(t_.test(e)?o_[e]=!0:(n_[e]=!0,!1))}function i_(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}function s_(e,t,r,n){if(null==t||i_(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function c_(e,t,r,n,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a}var u_={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){u_[e]=new c_(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];u_[t]=new c_(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){u_[e]=new c_(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){u_[e]=new c_(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){u_[e]=new c_(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){u_[e]=new c_(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){u_[e]=new c_(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){u_[e]=new c_(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){u_[e]=new c_(e,5,!1,e.toLowerCase(),null,!1)}));var l_=/[\-:]([a-z])/g;function d_(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(l_,d_);u_[t]=new c_(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(l_,d_);u_[t]=new c_(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(l_,d_);u_[t]=new c_(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){u_[e]=new c_(e,1,!1,e.toLowerCase(),null,!1)})),u_.xlinkHref=new c_("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){u_[e]=new c_(e,1,!1,e.toLowerCase(),null,!0)}));var f_=xC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p_(e,t,r,n){var o=u_.hasOwnProperty(t)?u_[t]:null;(null!==o?0===o.type:!n&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(s_(t,r,o,n)&&(r=null),n||null===o?a_(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=null===r?3!==o.type&&"":r:(t=o.attributeName,n=o.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(o=o.type)||4===o&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}f_.hasOwnProperty("ReactCurrentDispatcher")||(f_.ReactCurrentDispatcher={current:null}),f_.hasOwnProperty("ReactCurrentBatchConfig")||(f_.ReactCurrentBatchConfig={suspense:null});var h_=/^(.*)[\\\/]/,m_="function"==typeof Symbol&&Symbol.for,g_=m_?Symbol.for("react.element"):60103,v_=m_?Symbol.for("react.portal"):60106,y_=m_?Symbol.for("react.fragment"):60107,b_=m_?Symbol.for("react.strict_mode"):60108,C_=m_?Symbol.for("react.profiler"):60114,w_=m_?Symbol.for("react.provider"):60109,k_=m_?Symbol.for("react.context"):60110,S_=m_?Symbol.for("react.concurrent_mode"):60111,E_=m_?Symbol.for("react.forward_ref"):60112,B_=m_?Symbol.for("react.suspense"):60113,__=m_?Symbol.for("react.suspense_list"):60120,x_=m_?Symbol.for("react.memo"):60115,T_=m_?Symbol.for("react.lazy"):60116,A_=m_?Symbol.for("react.block"):60121,I_="function"==typeof Symbol&&Symbol.iterator;function P_(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=I_&&e[I_]||e["@@iterator"])?e:null}function R_(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}function D_(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case y_:return"Fragment";case v_:return"Portal";case C_:return"Profiler";case b_:return"StrictMode";case B_:return"Suspense";case __:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case k_:return"Context.Consumer";case w_:return"Context.Provider";case E_:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case x_:return D_(e.type);case A_:return D_(e.render);case T_:if(e=1===e._status?e._result:null)return D_(e)}return null}function N_(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var r="";break e;default:var n=e._debugOwner,o=e._debugSource,a=D_(e.type);r=null,n&&(r=D_(n.type)),n=a,a="",o?a=" (at "+o.fileName.replace(h_,"")+":"+o.lineNumber+")":r&&(a=" (created by "+r+")"),r="\n in "+(n||"Unknown")+a}t+=r,e=e.return}while(e);return t}function O_(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function L_(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function M_(e){var t=L_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var o=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function F_(e){e._valueTracker||(e._valueTracker=M_(e))}function U_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=L_(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function j_(e,t){var r=t.checked;return ub({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function V_(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=O_(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function z_(e,t){null!=(t=t.checked)&&p_(e,"checked",t,!1)}function q_(e,t){z_(e,t);var r=O_(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?K_(e,t.type,r):t.hasOwnProperty("defaultValue")&&K_(e,t.type,O_(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function H_(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function K_(e,t,r){"number"===t&&e.ownerDocument.activeElement===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}function W_(e){var t="";return xC.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}function Q_(e,t){return e=ub({children:void 0},t),(t=W_(t.children))&&(e.children=t),e}function G_(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o<r.length;o++)t["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=t.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&n&&(e[r].defaultSelected=!0)}else{for(r=""+O_(r),t=null,o=0;o<e.length;o++){if(e[o].value===r)return e[o].selected=!0,void(n&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function X_(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(yB(91));return ub({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Y_(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(yB(92));if(Array.isArray(r)){if(!(1>=r.length))throw Error(yB(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:O_(r)}}function $_(e,t){var r=O_(t.value),n=O_(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function Z_(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var J_={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function ex(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function tx(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ex(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var rx,nx,ox=(nx=function(e,t){if(e.namespaceURI!==J_.svg||"innerHTML"in e)e.innerHTML=t;else{for((rx=rx||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=rx.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return nx(e,t)}))}:nx);function ax(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}function ix(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var sx={animationend:ix("Animation","AnimationEnd"),animationiteration:ix("Animation","AnimationIteration"),animationstart:ix("Animation","AnimationStart"),transitionend:ix("Transition","TransitionEnd")},cx={},ux={};function lx(e){if(cx[e])return cx[e];if(!sx[e])return e;var t,r=sx[e];for(t in r)if(r.hasOwnProperty(t)&&t in ux)return cx[e]=r[t];return e}jB&&(ux=document.createElement("div").style,"AnimationEvent"in window||(delete sx.animationend.animation,delete sx.animationiteration.animation,delete sx.animationstart.animation),"TransitionEvent"in window||delete sx.transitionend.transition);var dx=lx("animationend"),fx=lx("animationiteration"),px=lx("animationstart"),hx=lx("transitionend"),mx="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),gx=new("function"==typeof WeakMap?WeakMap:Map);function vx(e){var t=gx.get(e);return void 0===t&&(t=new Map,gx.set(e,t)),t}function yx(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function bx(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Cx(e){if(yx(e)!==e)throw Error(yB(188))}function wx(e){var t=e.alternate;if(!t){if(null===(t=yx(e)))throw Error(yB(188));return t!==e?null:e}for(var r=e,n=t;;){var o=r.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(n=o.return)){r=n;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===r)return Cx(o),e;if(a===n)return Cx(o),t;a=a.sibling}throw Error(yB(188))}if(r.return!==n.return)r=o,n=a;else{for(var i=!1,s=o.child;s;){if(s===r){i=!0,r=o,n=a;break}if(s===n){i=!0,n=o,r=a;break}s=s.sibling}if(!i){for(s=a.child;s;){if(s===r){i=!0,r=a,n=o;break}if(s===n){i=!0,n=a,r=o;break}s=s.sibling}if(!i)throw Error(yB(189))}}if(r.alternate!==n)throw Error(yB(190))}if(3!==r.tag)throw Error(yB(188));return r.stateNode.current===r?e:t}function kx(e){if(!(e=wx(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Sx(e,t){if(null==t)throw Error(yB(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function Ex(e,t,r){Array.isArray(e)?e.forEach(t,r):e&&t.call(r,e)}var Bx=null;function _x(e){if(e){var t=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(t))for(var n=0;n<t.length&&!e.isPropagationStopped();n++)IB(e,t[n],r[n]);else t&&IB(e,t,r);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function xx(e){if(null!==e&&(Bx=Sx(Bx,e)),e=Bx,Bx=null,e){if(Ex(e,_x),Bx)throw Error(yB(95));if(kB)throw e=SB,kB=!1,SB=null,e}}function Tx(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function Ax(e){if(!jB)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t}var Ix=[];function Px(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>Ix.length&&Ix.push(e)}function Rx(e,t,r,n){if(Ix.length){var o=Ix.pop();return o.topLevelType=e,o.eventSystemFlags=n,o.nativeEvent=t,o.targetInst=r,o}return{topLevelType:e,eventSystemFlags:n,nativeEvent:t,targetInst:r,ancestors:[]}}function Dx(e){var t=e.targetInst,r=t;do{if(!r){e.ancestors.push(r);break}var n=r;if(3===n.tag)n=n.stateNode.containerInfo;else{for(;n.return;)n=n.return;n=3!==n.tag?null:n.stateNode.containerInfo}if(!n)break;5!==(t=r.tag)&&6!==t||e.ancestors.push(r),r=JT(n)}while(r);for(r=0;r<e.ancestors.length;r++){t=e.ancestors[r];var o=Tx(e.nativeEvent);n=e.topLevelType;var a=e.nativeEvent,i=e.eventSystemFlags;0===r&&(i|=64);for(var s=null,c=0;c<OB.length;c++){var u=OB[c];u&&(u=u.extractEvents(n,t,a,o,i))&&(s=Sx(s,u))}xx(s)}}function Nx(e,t,r){if(!r.has(e)){switch(e){case"scroll":gT(t,"scroll",!0);break;case"focus":case"blur":gT(t,"focus",!0),gT(t,"blur",!0),r.set("blur",null),r.set("focus",null);break;case"cancel":case"close":Ax(e)&&gT(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===mx.indexOf(e)&&mT(e,t)}r.set(e,null)}}var Ox,Lx,Mx,Fx=!1,Ux=[],jx=null,Vx=null,zx=null,qx=new Map,Hx=new Map,Kx=[],Wx="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),Qx="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function Gx(e,t){var r=vx(t);Wx.forEach((function(e){Nx(e,t,r)})),Qx.forEach((function(e){Nx(e,t,r)}))}function Xx(e,t,r,n,o){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|r,nativeEvent:o,container:n}}function Yx(e,t){switch(e){case"focus":case"blur":jx=null;break;case"dragenter":case"dragleave":Vx=null;break;case"mouseover":case"mouseout":zx=null;break;case"pointerover":case"pointerout":qx.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hx.delete(t.pointerId)}}function $x(e,t,r,n,o,a){return null===e||e.nativeEvent!==a?(e=Xx(t,r,n,o,a),null!==t&&(null!==(t=eA(t))&&Lx(t)),e):(e.eventSystemFlags|=n,e)}function Zx(e,t,r,n,o){switch(t){case"focus":return jx=$x(jx,e,t,r,n,o),!0;case"dragenter":return Vx=$x(Vx,e,t,r,n,o),!0;case"mouseover":return zx=$x(zx,e,t,r,n,o),!0;case"pointerover":var a=o.pointerId;return qx.set(a,$x(qx.get(a)||null,e,t,r,n,o)),!0;case"gotpointercapture":return a=o.pointerId,Hx.set(a,$x(Hx.get(a)||null,e,t,r,n,o)),!0}return!1}function Jx(e){var t=JT(e.target);if(null!==t){var r=yx(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=bx(r)))return e.blockedOn=t,void vB.unstable_runWithPriority(e.priority,(function(){Mx(r)}))}else if(3===t&&r.stateNode.hydrate)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function eT(e){if(null!==e.blockedOn)return!1;var t=CT(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var r=eA(t);return null!==r&&Lx(r),e.blockedOn=t,!1}return!0}function tT(e,t,r){eT(e)&&r.delete(t)}function rT(){for(Fx=!1;0<Ux.length;){var e=Ux[0];if(null!==e.blockedOn){null!==(e=eA(e.blockedOn))&&Ox(e);break}var t=CT(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:Ux.shift()}null!==jx&&eT(jx)&&(jx=null),null!==Vx&&eT(Vx)&&(Vx=null),null!==zx&&eT(zx)&&(zx=null),qx.forEach(tT),Hx.forEach(tT)}function nT(e,t){e.blockedOn===t&&(e.blockedOn=null,Fx||(Fx=!0,vB.unstable_scheduleCallback(vB.unstable_NormalPriority,rT)))}function oT(e){function t(t){return nT(t,e)}if(0<Ux.length){nT(Ux[0],e);for(var r=1;r<Ux.length;r++){var n=Ux[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==jx&&nT(jx,e),null!==Vx&&nT(Vx,e),null!==zx&&nT(zx,e),qx.forEach(t),Hx.forEach(t),r=0;r<Kx.length;r++)(n=Kx[r]).blockedOn===e&&(n.blockedOn=null);for(;0<Kx.length&&null===(r=Kx[0]).blockedOn;)Jx(r),null===r.blockedOn&&Kx.shift()}var aT={},iT=new Map,sT=new Map,cT=["abort","abort",dx,"animationEnd",fx,"animationIteration",px,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",hx,"transitionEnd","waiting","waiting"];function uT(e,t){for(var r=0;r<e.length;r+=2){var n=e[r],o=e[r+1],a="on"+(o[0].toUpperCase()+o.slice(1));a={phasedRegistrationNames:{bubbled:a,captured:a+"Capture"},dependencies:[n],eventPriority:t},sT.set(n,t),iT.set(n,a),aT[o]=a}}uT("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),uT("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),uT(cT,2);for(var lT="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),dT=0;dT<lT.length;dT++)sT.set(lT[dT],0);var fT=vB.unstable_UserBlockingPriority,pT=vB.unstable_runWithPriority,hT=!0;function mT(e,t){gT(t,e,!1)}function gT(e,t,r){var n=sT.get(t);switch(void 0===n?2:n){case 0:n=vT.bind(null,t,1,e);break;case 1:n=yT.bind(null,t,1,e);break;default:n=bT.bind(null,t,1,e)}r?e.addEventListener(t,n,!0):e.addEventListener(t,n,!1)}function vT(e,t,r,n){$B||XB();var o=bT,a=$B;$B=!0;try{GB(o,e,t,r,n)}finally{($B=a)||JB()}}function yT(e,t,r,n){pT(fT,bT.bind(null,e,t,r,n))}function bT(e,t,r,n){if(hT)if(0<Ux.length&&-1<Wx.indexOf(e))e=Xx(null,e,t,r,n),Ux.push(e);else{var o=CT(e,t,r,n);if(null===o)Yx(e,n);else if(-1<Wx.indexOf(e))e=Xx(o,e,t,r,n),Ux.push(e);else if(!Zx(o,e,t,r,n)){Yx(e,n),e=Rx(e,n,null,t);try{e_(Dx,e)}finally{Px(e)}}}}function CT(e,t,r,n){if(null!==(r=JT(r=Tx(n)))){var o=yx(r);if(null===o)r=null;else{var a=o.tag;if(13===a){if(null!==(r=bx(o)))return r;r=null}else if(3===a){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}e=Rx(e,n,r,t);try{e_(Dx,e)}finally{Px(e)}return null}var wT={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},kT=["Webkit","ms","Moz","O"];function ST(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||wT.hasOwnProperty(e)&&wT[e]?(""+t).trim():t+"px"}function ET(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),o=ST(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}Object.keys(wT).forEach((function(e){kT.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wT[t]=wT[e]}))}));var BT=ub({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _T(e,t){if(t){if(BT[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(yB(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(yB(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(yB(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(yB(62,""))}}function xT(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var TT=J_.html;function AT(e,t){var r=vx(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=FB[t];for(var n=0;n<t.length;n++)Nx(t[n],e,r)}function IT(){}function PT(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function RT(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function DT(e,t){var r,n=RT(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=RT(n)}}function NT(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?NT(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function OT(){for(var e=window,t=PT();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=PT((e=t.contentWindow).document)}return t}function LT(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var MT="$",FT="/$",UT="$?",jT="$!",VT=null,zT=null;function qT(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function HT(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var KT="function"==typeof setTimeout?setTimeout:void 0,WT="function"==typeof clearTimeout?clearTimeout:void 0;function QT(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function GT(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if(r===MT||r===jT||r===UT){if(0===t)return e;t--}else r===FT&&t++}e=e.previousSibling}return null}var XT=Math.random().toString(36).slice(2),YT="__reactInternalInstance$"+XT,$T="__reactEventHandlers$"+XT,ZT="__reactContainere$"+XT;function JT(e){var t=e[YT];if(t)return t;for(var r=e.parentNode;r;){if(t=r[ZT]||r[YT]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=GT(e);null!==e;){if(r=e[YT])return r;e=GT(e)}return t}r=(e=r).parentNode}return null}function eA(e){return!(e=e[YT]||e[ZT])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function tA(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(yB(33))}function rA(e){return e[$T]||null}function nA(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function oA(e,t){var r=e.stateNode;if(!r)return null;var n=xB(r);if(!n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(yB(231,t,typeof r));return r}function aA(e,t,r){(t=oA(e,r.dispatchConfig.phasedRegistrationNames[t]))&&(r._dispatchListeners=Sx(r._dispatchListeners,t),r._dispatchInstances=Sx(r._dispatchInstances,e))}function iA(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,r=[];t;)r.push(t),t=nA(t);for(t=r.length;0<t--;)aA(r[t],"captured",e);for(t=0;t<r.length;t++)aA(r[t],"bubbled",e)}}function sA(e,t,r){e&&r&&r.dispatchConfig.registrationName&&(t=oA(e,r.dispatchConfig.registrationName))&&(r._dispatchListeners=Sx(r._dispatchListeners,t),r._dispatchInstances=Sx(r._dispatchInstances,e))}function cA(e){e&&e.dispatchConfig.registrationName&&sA(e._targetInst,null,e)}function uA(e){Ex(e,iA)}var lA=null,dA=null,fA=null;function pA(){if(fA)return fA;var e,t,r=dA,n=r.length,o="value"in lA?lA.value:lA.textContent,a=o.length;for(e=0;e<n&&r[e]===o[e];e++);var i=n-e;for(t=1;t<=i&&r[n-t]===o[a-t];t++);return fA=o.slice(e,1<t?1-t:void 0)}function hA(){return!0}function mA(){return!1}function gA(e,t,r,n){for(var o in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=r,e=this.constructor.Interface)e.hasOwnProperty(o)&&((t=e[o])?this[o]=t(r):"target"===o?this.target=n:this[o]=r[o]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?hA:mA,this.isPropagationStopped=mA,this}function vA(e,t,r,n){if(this.eventPool.length){var o=this.eventPool.pop();return this.call(o,e,t,r,n),o}return new this(e,t,r,n)}function yA(e){if(!(e instanceof this))throw Error(yB(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function bA(e){e.eventPool=[],e.getPooled=vA,e.release=yA}ub(gA.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=hA)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=hA)},persist:function(){this.isPersistent=hA},isPersistent:mA,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=mA,this._dispatchInstances=this._dispatchListeners=null}}),gA.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},gA.extend=function(e){function t(){}function r(){return n.apply(this,arguments)}var n=this;t.prototype=n.prototype;var o=new t;return ub(o,r.prototype),r.prototype=o,r.prototype.constructor=r,r.Interface=ub({},n.Interface,e),r.extend=n.extend,bA(r),r},bA(gA);var CA=gA.extend({data:null}),wA=gA.extend({data:null}),kA=[9,13,27,32],SA=jB&&"CompositionEvent"in window,EA=null;jB&&"documentMode"in document&&(EA=document.documentMode);var BA=jB&&"TextEvent"in window&&!EA,_A=jB&&(!SA||EA&&8<EA&&11>=EA),xA=String.fromCharCode(32),TA={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},AA=!1;function IA(e,t){switch(e){case"keyup":return-1!==kA.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function PA(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var RA=!1;function DA(e,t){switch(e){case"compositionend":return PA(t);case"keypress":return 32!==t.which?null:(AA=!0,xA);case"textInput":return(e=t.data)===xA&&AA?null:e;default:return null}}function NA(e,t){if(RA)return"compositionend"===e||!SA&&IA(e,t)?(e=pA(),fA=dA=lA=null,RA=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _A&&"ko"!==t.locale?null:t.data;default:return null}}var OA={eventTypes:TA,extractEvents:function(e,t,r,n){var o;if(SA)e:{switch(e){case"compositionstart":var a=TA.compositionStart;break e;case"compositionend":a=TA.compositionEnd;break e;case"compositionupdate":a=TA.compositionUpdate;break e}a=void 0}else RA?IA(e,r)&&(a=TA.compositionEnd):"keydown"===e&&229===r.keyCode&&(a=TA.compositionStart);return a?(_A&&"ko"!==r.locale&&(RA||a!==TA.compositionStart?a===TA.compositionEnd&&RA&&(o=pA()):(dA="value"in(lA=n)?lA.value:lA.textContent,RA=!0)),a=CA.getPooled(a,t,r,n),o?a.data=o:null!==(o=PA(r))&&(a.data=o),uA(a),o=a):o=null,(e=BA?DA(e,r):NA(e,r))?((t=wA.getPooled(TA.beforeInput,t,r,n)).data=e,uA(t)):t=null,null===o?t:null===t?o:[o,t]}},LA={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function MA(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!LA[e.type]:"textarea"===t}var FA={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function UA(e,t,r){return(e=gA.getPooled(FA.change,e,t,r)).type="change",KB(r),uA(e),e}var jA=null,VA=null;function zA(e){xx(e)}function qA(e){if(U_(tA(e)))return e}function HA(e,t){if("change"===e)return t}var KA=!1;function WA(){jA&&(jA.detachEvent("onpropertychange",QA),VA=jA=null)}function QA(e){if("value"===e.propertyName&&qA(VA))if(e=UA(VA,e,Tx(e)),$B)xx(e);else{$B=!0;try{QB(zA,e)}finally{$B=!1,JB()}}}function GA(e,t,r){"focus"===e?(WA(),VA=r,(jA=t).attachEvent("onpropertychange",QA)):"blur"===e&&WA()}function XA(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return qA(VA)}function YA(e,t){if("click"===e)return qA(t)}function $A(e,t){if("input"===e||"change"===e)return qA(t)}jB&&(KA=Ax("input")&&(!document.documentMode||9<document.documentMode));var ZA={eventTypes:FA,_isInputEventSupported:KA,extractEvents:function(e,t,r,n){var o=t?tA(t):window,a=o.nodeName&&o.nodeName.toLowerCase();if("select"===a||"input"===a&&"file"===o.type)var i=HA;else if(MA(o))if(KA)i=$A;else{i=XA;var s=GA}else(a=o.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(i=YA);if(i&&(i=i(e,t)))return UA(i,r,n);s&&s(e,o,t),"blur"===e&&(e=o._wrapperState)&&e.controlled&&"number"===o.type&&K_(o,"number",o.value)}},JA=gA.extend({view:null,detail:null}),eI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=eI[e])&&!!t[e]}function rI(){return tI}var nI=0,oI=0,aI=!1,iI=!1,sI=JA.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:rI,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=nI;return nI=e.screenX,aI?"mousemove"===e.type?e.screenX-t:0:(aI=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=oI;return oI=e.screenY,iI?"mousemove"===e.type?e.screenY-t:0:(iI=!0,0)}}),cI=sI.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),uI={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},lI={eventTypes:uI,extractEvents:function(e,t,r,n,o){var a="mouseover"===e||"pointerover"===e,i="mouseout"===e||"pointerout"===e;if(a&&0==(32&o)&&(r.relatedTarget||r.fromElement)||!i&&!a)return null;(a=n.window===n?n:(a=n.ownerDocument)?a.defaultView||a.parentWindow:window,i)?(i=t,null!==(t=(t=r.relatedTarget||r.toElement)?JT(t):null)&&(t!==yx(t)||5!==t.tag&&6!==t.tag)&&(t=null)):i=null;if(i===t)return null;if("mouseout"===e||"mouseover"===e)var s=sI,c=uI.mouseLeave,u=uI.mouseEnter,l="mouse";else"pointerout"!==e&&"pointerover"!==e||(s=cI,c=uI.pointerLeave,u=uI.pointerEnter,l="pointer");if(e=null==i?a:tA(i),a=null==t?a:tA(t),(c=s.getPooled(c,i,r,n)).type=l+"leave",c.target=e,c.relatedTarget=a,(r=s.getPooled(u,t,r,n)).type=l+"enter",r.target=a,r.relatedTarget=e,l=t,(n=i)&&l)e:{for(u=l,i=0,e=s=n;e;e=nA(e))i++;for(e=0,t=u;t;t=nA(t))e++;for(;0<i-e;)s=nA(s),i--;for(;0<e-i;)u=nA(u),e--;for(;i--;){if(s===u||s===u.alternate)break e;s=nA(s),u=nA(u)}s=null}else s=null;for(u=s,s=[];n&&n!==u&&(null===(i=n.alternate)||i!==u);)s.push(n),n=nA(n);for(n=[];l&&l!==u&&(null===(i=l.alternate)||i!==u);)n.push(l),l=nA(l);for(l=0;l<s.length;l++)sA(s[l],"bubbled",c);for(l=n.length;0<l--;)sA(n[l],"captured",r);return 0==(64&o)?[c]:[c,r]}};function dI(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t}var fI="function"==typeof Object.is?Object.is:dI,pI=Object.prototype.hasOwnProperty;function hI(e,t){if(fI(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++)if(!pI.call(t,r[n])||!fI(e[r[n]],t[r[n]]))return!1;return!0}var mI=jB&&"documentMode"in document&&11>=document.documentMode,gI={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},vI=null,yI=null,bI=null,CI=!1;function wI(e,t){var r=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return CI||null==vI||vI!==PT(r)?null:("selectionStart"in(r=vI)&<(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},bI&&hI(bI,r)?null:(bI=r,(e=gA.getPooled(gI.select,yI,e,t)).type="select",e.target=vI,uA(e),e))}var kI={eventTypes:gI,extractEvents:function(e,t,r,n,o,a){if(!(a=!(o=a||(n.window===n?n.document:9===n.nodeType?n:n.ownerDocument)))){e:{o=vx(o),a=FB.onSelect;for(var i=0;i<a.length;i++)if(!o.has(a[i])){o=!1;break e}o=!0}a=!o}if(a)return null;switch(o=t?tA(t):window,e){case"focus":(MA(o)||"true"===o.contentEditable)&&(vI=o,yI=t,bI=null);break;case"blur":bI=yI=vI=null;break;case"mousedown":CI=!0;break;case"contextmenu":case"mouseup":case"dragend":return CI=!1,wI(r,n);case"selectionchange":if(mI)break;case"keydown":case"keyup":return wI(r,n)}return null}},SI=gA.extend({animationName:null,elapsedTime:null,pseudoElement:null}),EI=gA.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),BI=JA.extend({relatedTarget:null});function _I(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var xI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TI={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},AI=JA.extend({key:function(e){if(e.key){var t=xI[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=_I(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?TI[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:rI,charCode:function(e){return"keypress"===e.type?_I(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?_I(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),II=sI.extend({dataTransfer:null}),PI=JA.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:rI}),RI=gA.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),DI=sI.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),NI={eventTypes:aT,extractEvents:function(e,t,r,n){var o=iT.get(e);if(!o)return null;switch(e){case"keypress":if(0===_I(r))return null;case"keydown":case"keyup":e=AI;break;case"blur":case"focus":e=BI;break;case"click":if(2===r.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=sI;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=II;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=PI;break;case dx:case fx:case px:e=SI;break;case hx:e=RI;break;case"scroll":e=JA;break;case"wheel":e=DI;break;case"copy":case"cut":case"paste":e=EI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=cI;break;default:e=gA}return uA(t=e.getPooled(o,t,r,n)),t}};if(PB)throw Error(yB(101));PB=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),DB();var OI=eA;xB=rA,TB=OI,AB=tA,UB({SimpleEventPlugin:NI,EnterLeaveEventPlugin:lI,ChangeEventPlugin:ZA,SelectEventPlugin:kI,BeforeInputEventPlugin:OA});var LI=[],MI=-1;function FI(e){0>MI||(e.current=LI[MI],LI[MI]=null,MI--)}function UI(e,t){MI++,LI[MI]=e.current,e.current=t}var jI={},VI={current:jI},zI={current:!1},qI=jI;function HI(e,t){var r=e.type.contextTypes;if(!r)return jI;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o,a={};for(o in r)a[o]=t[o];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function KI(e){return null!=(e=e.childContextTypes)}function WI(){FI(zI),FI(VI)}function QI(e,t,r){if(VI.current!==jI)throw Error(yB(168));UI(VI,t),UI(zI,r)}function GI(e,t,r){var n=e.stateNode;if(e=t.childContextTypes,"function"!=typeof n.getChildContext)return r;for(var o in n=n.getChildContext())if(!(o in e))throw Error(yB(108,D_(t)||"Unknown",o));return ub({},r,{},n)}function XI(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||jI,qI=VI.current,UI(VI,e),UI(zI,zI.current),!0}function YI(e,t,r){var n=e.stateNode;if(!n)throw Error(yB(169));r?(e=GI(e,t,qI),n.__reactInternalMemoizedMergedChildContext=e,FI(zI),FI(VI),UI(VI,e)):FI(zI),UI(zI,r)}var $I=vB.unstable_runWithPriority,ZI=vB.unstable_scheduleCallback,JI=vB.unstable_cancelCallback,eP=vB.unstable_requestPaint,tP=vB.unstable_now,rP=vB.unstable_getCurrentPriorityLevel,nP=vB.unstable_ImmediatePriority,oP=vB.unstable_UserBlockingPriority,aP=vB.unstable_NormalPriority,iP=vB.unstable_LowPriority,sP=vB.unstable_IdlePriority,cP={},uP=vB.unstable_shouldYield,lP=void 0!==eP?eP:function(){},dP=null,fP=null,pP=!1,hP=tP(),mP=1e4>hP?tP:function(){return tP()-hP};function gP(){switch(rP()){case nP:return 99;case oP:return 98;case aP:return 97;case iP:return 96;case sP:return 95;default:throw Error(yB(332))}}function vP(e){switch(e){case 99:return nP;case 98:return oP;case 97:return aP;case 96:return iP;case 95:return sP;default:throw Error(yB(332))}}function yP(e,t){return e=vP(e),$I(e,t)}function bP(e,t,r){return e=vP(e),ZI(e,t,r)}function CP(e){return null===dP?(dP=[e],fP=ZI(nP,kP)):dP.push(e),cP}function wP(){if(null!==fP){var e=fP;fP=null,JI(e)}kP()}function kP(){if(!pP&&null!==dP){pP=!0;var e=0;try{var t=dP;yP(99,(function(){for(;e<t.length;e++){var r=t[e];do{r=r(!0)}while(null!==r)}})),dP=null}catch(t){throw null!==dP&&(dP=dP.slice(e+1)),ZI(nP,wP),t}finally{pP=!1}}}function SP(e,t,r){return 1073741821-(1+((1073741821-e+t/10)/(r/=10)|0))*r}function EP(e,t){if(e&&e.defaultProps)for(var r in t=ub({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}var BP={current:null},_P=null,xP=null,TP=null;function AP(){TP=xP=_P=null}function IP(e){var t=BP.current;FI(BP),e.type._context._currentValue=t}function PP(e,t){for(;null!==e;){var r=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==r&&r.childExpirationTime<t&&(r.childExpirationTime=t);else{if(!(null!==r&&r.childExpirationTime<t))break;r.childExpirationTime=t}e=e.return}}function RP(e,t){_P=e,TP=xP=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(aD=!0),e.firstContext=null)}function DP(e,t){if(TP!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(TP=e,t=1073741823),t={context:e,observedBits:t,next:null},null===xP){if(null===_P)throw Error(yB(308));xP=t,_P.dependencies={expirationTime:0,firstContext:t,responders:null}}else xP=xP.next=t;return e._currentValue}var NP=!1;function OP(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function LP(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function MP(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function FP(e,t){if(null!==(e=e.updateQueue)){var r=(e=e.shared).pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}}function UP(e,t){var r=e.alternate;null!==r&&LP(r,e),null===(r=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=r.next,r.next=t)}function jP(e,t,r,n){var o=e.updateQueue;NP=!1;var a=o.baseQueue,i=o.shared.pending;if(null!==i){if(null!==a){var s=a.next;a.next=i.next,i.next=s}a=i,o.shared.pending=null,null!==(s=e.alternate)&&(null!==(s=s.updateQueue)&&(s.baseQueue=i))}if(null!==a){s=a.next;var c=o.baseState,u=0,l=null,d=null,f=null;if(null!==s)for(var p=s;;){if((i=p.expirationTime)<n){var h={expirationTime:p.expirationTime,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null};null===f?(d=f=h,l=c):f=f.next=h,i>u&&(u=i)}else{null!==f&&(f=f.next={expirationTime:1073741823,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null}),QN(i,p.suspenseConfig);e:{var m=e,g=p;switch(i=t,h=r,g.tag){case 1:if("function"==typeof(m=g.payload)){c=m.call(h,c,i);break e}c=m;break e;case 3:m.effectTag=-4097&m.effectTag|64;case 0:if(null==(i="function"==typeof(m=g.payload)?m.call(h,c,i):m))break e;c=ub({},c,i);break e;case 2:NP=!0}}null!==p.callback&&(e.effectTag|=32,null===(i=o.effects)?o.effects=[p]:i.push(p))}if(null===(p=p.next)||p===s){if(null===(i=o.shared.pending))break;p=a.next=i.next,i.next=s,o.baseQueue=a=i,o.shared.pending=null}}null===f?l=c:f.next=d,o.baseState=l,o.baseQueue=f,GN(u),e.expirationTime=u,e.memoizedState=c}}function VP(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],o=n.callback;if(null!==o){if(n.callback=null,n=o,o=r,"function"!=typeof n)throw Error(yB(191,n));n.call(o)}}}var zP=f_.ReactCurrentBatchConfig,qP=(new xC.Component).refs;function HP(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:ub({},t,r),e.memoizedState=r,0===e.expirationTime&&(e.updateQueue.baseState=r)}var KP={isMounted:function(e){return!!(e=e._reactInternalFiber)&&yx(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternalFiber;var n=DN(),o=zP.suspense;(o=MP(n=NN(n,e,o),o)).payload=t,null!=r&&(o.callback=r),FP(e,o),ON(e,n)},enqueueReplaceState:function(e,t,r){e=e._reactInternalFiber;var n=DN(),o=zP.suspense;(o=MP(n=NN(n,e,o),o)).tag=1,o.payload=t,null!=r&&(o.callback=r),FP(e,o),ON(e,n)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var r=DN(),n=zP.suspense;(n=MP(r=NN(r,e,n),n)).tag=2,null!=t&&(n.callback=t),FP(e,n),ON(e,r)}};function WP(e,t,r,n,o,a,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,a,i):!t.prototype||!t.prototype.isPureReactComponent||(!hI(r,n)||!hI(o,a))}function QP(e,t,r){var n=!1,o=jI,a=t.contextType;return"object"==typeof a&&null!==a?a=DP(a):(o=KI(t)?qI:VI.current,a=(n=null!=(n=t.contextTypes))?HI(e,o):jI),t=new t(r,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=KP,e.stateNode=t,t._reactInternalFiber=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function GP(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&KP.enqueueReplaceState(t,t.state,null)}function XP(e,t,r,n){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs=qP,OP(e);var a=t.contextType;"object"==typeof a&&null!==a?o.context=DP(a):(a=KI(t)?qI:VI.current,o.context=HI(e,a)),jP(e,r,o,n),o.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(HP(e,t,a,r),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&KP.enqueueReplaceState(o,o.state,null),jP(e,r,o,n),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.effectTag|=4)}var YP=Array.isArray;function $P(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(yB(309));var n=r.stateNode}if(!n)throw Error(yB(147,e));var o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:((t=function(e){var t=n.refs;t===qP&&(t=n.refs={}),null===e?delete t[o]:t[o]=e})._stringRef=o,t)}if("string"!=typeof e)throw Error(yB(284));if(!r._owner)throw Error(yB(290,e))}return e}function ZP(e,t){if("textarea"!==e.type)throw Error(yB(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function JP(e){function t(t,r){if(e){var n=t.lastEffect;null!==n?(n.nextEffect=r,t.lastEffect=r):t.firstEffect=t.lastEffect=r,r.nextEffect=null,r.effectTag=8}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=gO(e,t)).index=0,e.sibling=null,e}function a(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.effectTag=2,r):n:(t.effectTag=2,r):r}function i(t){return e&&null===t.alternate&&(t.effectTag=2),t}function s(e,t,r,n){return null===t||6!==t.tag?((t=bO(r,e.mode,n)).return=e,t):((t=o(t,r)).return=e,t)}function c(e,t,r,n){return null!==t&&t.elementType===r.type?((n=o(t,r.props)).ref=$P(e,t,r),n.return=e,n):((n=vO(r.type,r.key,r.props,null,e.mode,n)).ref=$P(e,t,r),n.return=e,n)}function u(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=CO(r,e.mode,n)).return=e,t):((t=o(t,r.children||[])).return=e,t)}function l(e,t,r,n,a){return null===t||7!==t.tag?((t=yO(r,e.mode,n,a)).return=e,t):((t=o(t,r)).return=e,t)}function d(e,t,r){if("string"==typeof t||"number"==typeof t)return(t=bO(""+t,e.mode,r)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case g_:return(r=vO(t.type,t.key,t.props,null,e.mode,r)).ref=$P(e,null,t),r.return=e,r;case v_:return(t=CO(t,e.mode,r)).return=e,t}if(YP(t)||P_(t))return(t=yO(t,e.mode,r,null)).return=e,t;ZP(e,t)}return null}function f(e,t,r,n){var o=null!==t?t.key:null;if("string"==typeof r||"number"==typeof r)return null!==o?null:s(e,t,""+r,n);if("object"==typeof r&&null!==r){switch(r.$$typeof){case g_:return r.key===o?r.type===y_?l(e,t,r.props.children,n,o):c(e,t,r,n):null;case v_:return r.key===o?u(e,t,r,n):null}if(YP(r)||P_(r))return null!==o?null:l(e,t,r,n,null);ZP(e,r)}return null}function p(e,t,r,n,o){if("string"==typeof n||"number"==typeof n)return s(t,e=e.get(r)||null,""+n,o);if("object"==typeof n&&null!==n){switch(n.$$typeof){case g_:return e=e.get(null===n.key?r:n.key)||null,n.type===y_?l(t,e,n.props.children,o,n.key):c(t,e,n,o);case v_:return u(t,e=e.get(null===n.key?r:n.key)||null,n,o)}if(YP(n)||P_(n))return l(t,e=e.get(r)||null,n,o,null);ZP(t,n)}return null}function h(o,i,s,c){for(var u=null,l=null,h=i,m=i=0,g=null;null!==h&&m<s.length;m++){h.index>m?(g=h,h=null):g=h.sibling;var v=f(o,h,s[m],c);if(null===v){null===h&&(h=g);break}e&&h&&null===v.alternate&&t(o,h),i=a(v,i,m),null===l?u=v:l.sibling=v,l=v,h=g}if(m===s.length)return r(o,h),u;if(null===h){for(;m<s.length;m++)null!==(h=d(o,s[m],c))&&(i=a(h,i,m),null===l?u=h:l.sibling=h,l=h);return u}for(h=n(o,h);m<s.length;m++)null!==(g=p(h,o,m,s[m],c))&&(e&&null!==g.alternate&&h.delete(null===g.key?m:g.key),i=a(g,i,m),null===l?u=g:l.sibling=g,l=g);return e&&h.forEach((function(e){return t(o,e)})),u}function m(o,i,s,c){var u=P_(s);if("function"!=typeof u)throw Error(yB(150));if(null==(s=u.call(s)))throw Error(yB(151));for(var l=u=null,h=i,m=i=0,g=null,v=s.next();null!==h&&!v.done;m++,v=s.next()){h.index>m?(g=h,h=null):g=h.sibling;var y=f(o,h,v.value,c);if(null===y){null===h&&(h=g);break}e&&h&&null===y.alternate&&t(o,h),i=a(y,i,m),null===l?u=y:l.sibling=y,l=y,h=g}if(v.done)return r(o,h),u;if(null===h){for(;!v.done;m++,v=s.next())null!==(v=d(o,v.value,c))&&(i=a(v,i,m),null===l?u=v:l.sibling=v,l=v);return u}for(h=n(o,h);!v.done;m++,v=s.next())null!==(v=p(h,o,m,v.value,c))&&(e&&null!==v.alternate&&h.delete(null===v.key?m:v.key),i=a(v,i,m),null===l?u=v:l.sibling=v,l=v);return e&&h.forEach((function(e){return t(o,e)})),u}return function(e,n,a,s){var c="object"==typeof a&&null!==a&&a.type===y_&&null===a.key;c&&(a=a.props.children);var u="object"==typeof a&&null!==a;if(u)switch(a.$$typeof){case g_:e:{for(u=a.key,c=n;null!==c;){if(c.key===u){switch(c.tag){case 7:if(a.type===y_){r(e,c.sibling),(n=o(c,a.props.children)).return=e,e=n;break e}break;default:if(c.elementType===a.type){r(e,c.sibling),(n=o(c,a.props)).ref=$P(e,c,a),n.return=e,e=n;break e}}r(e,c);break}t(e,c),c=c.sibling}a.type===y_?((n=yO(a.props.children,e.mode,s,a.key)).return=e,e=n):((s=vO(a.type,a.key,a.props,null,e.mode,s)).ref=$P(e,n,a),s.return=e,e=s)}return i(e);case v_:e:{for(c=a.key;null!==n;){if(n.key===c){if(4===n.tag&&n.stateNode.containerInfo===a.containerInfo&&n.stateNode.implementation===a.implementation){r(e,n.sibling),(n=o(n,a.children||[])).return=e,e=n;break e}r(e,n);break}t(e,n),n=n.sibling}(n=CO(a,e.mode,s)).return=e,e=n}return i(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==n&&6===n.tag?(r(e,n.sibling),(n=o(n,a)).return=e,e=n):(r(e,n),(n=bO(a,e.mode,s)).return=e,e=n),i(e);if(YP(a))return h(e,n,a,s);if(P_(a))return m(e,n,a,s);if(u&&ZP(e,a),void 0===a&&!c)switch(e.tag){case 1:case 0:throw e=e.type,Error(yB(152,e.displayName||e.name||"Component"))}return r(e,n)}}var eR=JP(!0),tR=JP(!1),rR={},nR={current:rR},oR={current:rR},aR={current:rR};function iR(e){if(e===rR)throw Error(yB(174));return e}function sR(e,t){switch(UI(aR,t),UI(oR,e),UI(nR,rR),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:tx(null,"");break;default:t=tx(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}FI(nR),UI(nR,t)}function cR(){FI(nR),FI(oR),FI(aR)}function uR(e){iR(aR.current);var t=iR(nR.current),r=tx(t,e.type);t!==r&&(UI(oR,e),UI(nR,r))}function lR(e){oR.current===e&&(FI(nR),FI(oR))}var dR={current:0};function fR(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||r.data===UT||r.data===jT))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function pR(e,t){return{responder:e,props:t}}var hR=f_.ReactCurrentDispatcher,mR=f_.ReactCurrentBatchConfig,gR=0,vR=null,yR=null,bR=null,CR=!1;function wR(){throw Error(yB(321))}function kR(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!fI(e[r],t[r]))return!1;return!0}function SR(e,t,r,n,o,a){if(gR=a,vR=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,hR.current=null===e||null===e.memoizedState?WR:QR,e=r(n,o),t.expirationTime===gR){a=0;do{if(t.expirationTime=0,!(25>a))throw Error(yB(301));a+=1,bR=yR=null,t.updateQueue=null,hR.current=GR,e=r(n,o)}while(t.expirationTime===gR)}if(hR.current=KR,t=null!==yR&&null!==yR.next,gR=0,bR=yR=vR=null,CR=!1,t)throw Error(yB(300));return e}function ER(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===bR?vR.memoizedState=bR=e:bR=bR.next=e,bR}function BR(){if(null===yR){var e=vR.alternate;e=null!==e?e.memoizedState:null}else e=yR.next;var t=null===bR?vR.memoizedState:bR.next;if(null!==t)bR=t,yR=e;else{if(null===e)throw Error(yB(310));e={memoizedState:(yR=e).memoizedState,baseState:yR.baseState,baseQueue:yR.baseQueue,queue:yR.queue,next:null},null===bR?vR.memoizedState=bR=e:bR=bR.next=e}return bR}function _R(e,t){return"function"==typeof t?t(e):t}function xR(e){var t=BR(),r=t.queue;if(null===r)throw Error(yB(311));r.lastRenderedReducer=e;var n=yR,o=n.baseQueue,a=r.pending;if(null!==a){if(null!==o){var i=o.next;o.next=a.next,a.next=i}n.baseQueue=o=a,r.pending=null}if(null!==o){o=o.next,n=n.baseState;var s=i=a=null,c=o;do{var u=c.expirationTime;if(u<gR){var l={expirationTime:c.expirationTime,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===s?(i=s=l,a=n):s=s.next=l,u>vR.expirationTime&&(vR.expirationTime=u,GN(u))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:c.suspenseConfig,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),QN(u,c.suspenseConfig),n=c.eagerReducer===e?c.eagerState:e(n,c.action);c=c.next}while(null!==c&&c!==o);null===s?a=n:s.next=i,fI(n,t.memoizedState)||(aD=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=s,r.lastRenderedState=n}return[t.memoizedState,r.dispatch]}function TR(e){var t=BR(),r=t.queue;if(null===r)throw Error(yB(311));r.lastRenderedReducer=e;var n=r.dispatch,o=r.pending,a=t.memoizedState;if(null!==o){r.pending=null;var i=o=o.next;do{a=e(a,i.action),i=i.next}while(i!==o);fI(a,t.memoizedState)||(aD=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function AR(e){var t=ER();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:_R,lastRenderedState:e}).dispatch=HR.bind(null,vR,e),[t.memoizedState,e]}function IR(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=vR.updateQueue)?(t={lastEffect:null},vR.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function PR(){return BR().memoizedState}function RR(e,t,r,n){var o=ER();vR.effectTag|=e,o.memoizedState=IR(1|t,r,void 0,void 0===n?null:n)}function DR(e,t,r,n){var o=BR();n=void 0===n?null:n;var a=void 0;if(null!==yR){var i=yR.memoizedState;if(a=i.destroy,null!==n&&kR(n,i.deps))return void IR(t,r,a,n)}vR.effectTag|=e,o.memoizedState=IR(1|t,r,a,n)}function NR(e,t){return RR(516,4,e,t)}function OR(e,t){return DR(516,4,e,t)}function LR(e,t){return DR(4,2,e,t)}function MR(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function FR(e,t,r){return r=null!=r?r.concat([e]):null,DR(4,2,MR.bind(null,t,e),r)}function UR(){}function jR(e,t){return ER().memoizedState=[e,void 0===t?null:t],e}function VR(e,t){var r=BR();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&kR(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function zR(e,t){var r=BR();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&kR(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function qR(e,t,r){var n=gP();yP(98>n?98:n,(function(){e(!0)})),yP(97<n?97:n,(function(){var n=mR.suspense;mR.suspense=void 0===t?null:t;try{e(!1),r()}finally{mR.suspense=n}}))}function HR(e,t,r){var n=DN(),o=zP.suspense;o={expirationTime:n=NN(n,e,o),suspenseConfig:o,action:r,eagerReducer:null,eagerState:null,next:null};var a=t.pending;if(null===a?o.next=o:(o.next=a.next,a.next=o),t.pending=o,a=e.alternate,e===vR||null!==a&&a===vR)CR=!0,o.expirationTime=gR,vR.expirationTime=gR;else{if(0===e.expirationTime&&(null===a||0===a.expirationTime)&&null!==(a=t.lastRenderedReducer))try{var i=t.lastRenderedState,s=a(i,r);if(o.eagerReducer=a,o.eagerState=s,fI(s,i))return}catch(e){}ON(e,n)}}var KR={readContext:DP,useCallback:wR,useContext:wR,useEffect:wR,useImperativeHandle:wR,useLayoutEffect:wR,useMemo:wR,useReducer:wR,useRef:wR,useState:wR,useDebugValue:wR,useResponder:wR,useDeferredValue:wR,useTransition:wR},WR={readContext:DP,useCallback:jR,useContext:DP,useEffect:NR,useImperativeHandle:function(e,t,r){return r=null!=r?r.concat([e]):null,RR(4,2,MR.bind(null,t,e),r)},useLayoutEffect:function(e,t){return RR(4,2,e,t)},useMemo:function(e,t){var r=ER();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ER();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e=(e=n.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=HR.bind(null,vR,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},ER().memoizedState=e},useState:AR,useDebugValue:UR,useResponder:pR,useDeferredValue:function(e,t){var r=AR(e),n=r[0],o=r[1];return NR((function(){var r=mR.suspense;mR.suspense=void 0===t?null:t;try{o(e)}finally{mR.suspense=r}}),[e,t]),n},useTransition:function(e){var t=AR(!1),r=t[0];return t=t[1],[jR(qR.bind(null,t,e),[t,e]),r]}},QR={readContext:DP,useCallback:VR,useContext:DP,useEffect:OR,useImperativeHandle:FR,useLayoutEffect:LR,useMemo:zR,useReducer:xR,useRef:PR,useState:function(){return xR(_R)},useDebugValue:UR,useResponder:pR,useDeferredValue:function(e,t){var r=xR(_R),n=r[0],o=r[1];return OR((function(){var r=mR.suspense;mR.suspense=void 0===t?null:t;try{o(e)}finally{mR.suspense=r}}),[e,t]),n},useTransition:function(e){var t=xR(_R),r=t[0];return t=t[1],[VR(qR.bind(null,t,e),[t,e]),r]}},GR={readContext:DP,useCallback:VR,useContext:DP,useEffect:OR,useImperativeHandle:FR,useLayoutEffect:LR,useMemo:zR,useReducer:TR,useRef:PR,useState:function(){return TR(_R)},useDebugValue:UR,useResponder:pR,useDeferredValue:function(e,t){var r=TR(_R),n=r[0],o=r[1];return OR((function(){var r=mR.suspense;mR.suspense=void 0===t?null:t;try{o(e)}finally{mR.suspense=r}}),[e,t]),n},useTransition:function(e){var t=TR(_R),r=t[0];return t=t[1],[VR(qR.bind(null,t,e),[t,e]),r]}},XR=null,YR=null,$R=!1;function ZR(e,t){var r=pO(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=t,r.return=e,r.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function JR(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function eD(e){if($R){var t=YR;if(t){var r=t;if(!JR(e,t)){if(!(t=QT(r.nextSibling))||!JR(e,t))return e.effectTag=-1025&e.effectTag|2,$R=!1,void(XR=e);ZR(XR,r)}XR=e,YR=QT(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,$R=!1,XR=e}}function tD(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;XR=e}function rD(e){if(e!==XR)return!1;if(!$R)return tD(e),$R=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!HT(t,e.memoizedProps))for(t=YR;t;)ZR(e,t),t=QT(t.nextSibling);if(tD(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(yB(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if(r===FT){if(0===t){YR=QT(e.nextSibling);break e}t--}else r!==MT&&r!==jT&&r!==UT||t++}e=e.nextSibling}YR=null}}else YR=XR?QT(e.stateNode.nextSibling):null;return!0}function nD(){YR=XR=null,$R=!1}var oD=f_.ReactCurrentOwner,aD=!1;function iD(e,t,r,n){t.child=null===e?tR(t,null,r,n):eR(t,e.child,r,n)}function sD(e,t,r,n,o){r=r.render;var a=t.ref;return RP(t,o),n=SR(e,t,r,n,a,o),null===e||aD?(t.effectTag|=1,iD(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=o&&(e.expirationTime=0),ED(e,t,o))}function cD(e,t,r,n,o,a){if(null===e){var i=r.type;return"function"!=typeof i||hO(i)||void 0!==i.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=vO(r.type,null,n,null,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,uD(e,t,i,n,o,a))}return i=e.child,o<a&&(o=i.memoizedProps,(r=null!==(r=r.compare)?r:hI)(o,n)&&e.ref===t.ref)?ED(e,t,a):(t.effectTag|=1,(e=gO(i,n)).ref=t.ref,e.return=t,t.child=e)}function uD(e,t,r,n,o,a){return null!==e&&hI(e.memoizedProps,n)&&e.ref===t.ref&&(aD=!1,o<a)?(t.expirationTime=e.expirationTime,ED(e,t,a)):dD(e,t,r,n,a)}function lD(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.effectTag|=128)}function dD(e,t,r,n,o){var a=KI(r)?qI:VI.current;return a=HI(t,a),RP(t,o),r=SR(e,t,r,n,a,o),null===e||aD?(t.effectTag|=1,iD(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=o&&(e.expirationTime=0),ED(e,t,o))}function fD(e,t,r,n,o){if(KI(r)){var a=!0;XI(t)}else a=!1;if(RP(t,o),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),QP(t,r,n),XP(t,r,n,o),n=!0;else if(null===e){var i=t.stateNode,s=t.memoizedProps;i.props=s;var c=i.context,u=r.contextType;"object"==typeof u&&null!==u?u=DP(u):u=HI(t,u=KI(r)?qI:VI.current);var l=r.getDerivedStateFromProps,d="function"==typeof l||"function"==typeof i.getSnapshotBeforeUpdate;d||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==n||c!==u)&&GP(t,i,n,u),NP=!1;var f=t.memoizedState;i.state=f,jP(t,n,i,o),c=t.memoizedState,s!==n||f!==c||zI.current||NP?("function"==typeof l&&(HP(t,r,l,n),c=t.memoizedState),(s=NP||WP(t,r,s,n,f,c,u))?(d||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.effectTag|=4)):("function"==typeof i.componentDidMount&&(t.effectTag|=4),t.memoizedProps=n,t.memoizedState=c),i.props=n,i.state=c,i.context=u,n=s):("function"==typeof i.componentDidMount&&(t.effectTag|=4),n=!1)}else i=t.stateNode,LP(e,t),s=t.memoizedProps,i.props=t.type===t.elementType?s:EP(t.type,s),c=i.context,"object"==typeof(u=r.contextType)&&null!==u?u=DP(u):u=HI(t,u=KI(r)?qI:VI.current),(d="function"==typeof(l=r.getDerivedStateFromProps)||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==n||c!==u)&&GP(t,i,n,u),NP=!1,c=t.memoizedState,i.state=c,jP(t,n,i,o),f=t.memoizedState,s!==n||c!==f||zI.current||NP?("function"==typeof l&&(HP(t,r,l,n),f=t.memoizedState),(l=NP||WP(t,r,s,n,c,f,u))?(d||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(n,f,u),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(n,f,u)),"function"==typeof i.componentDidUpdate&&(t.effectTag|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=256),t.memoizedProps=n,t.memoizedState=f),i.props=n,i.state=f,i.context=u,n=l):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&c===e.memoizedState||(t.effectTag|=256),n=!1);return pD(e,t,r,n,a,o)}function pD(e,t,r,n,o,a){lD(e,t);var i=0!=(64&t.effectTag);if(!n&&!i)return o&&YI(t,r,!1),ED(e,t,a);n=t.stateNode,oD.current=t;var s=i&&"function"!=typeof r.getDerivedStateFromError?null:n.render();return t.effectTag|=1,null!==e&&i?(t.child=eR(t,e.child,null,a),t.child=eR(t,null,s,a)):iD(e,t,s,a),t.memoizedState=n.state,o&&YI(t,r,!0),t.child}function hD(e){var t=e.stateNode;t.pendingContext?QI(0,t.pendingContext,t.pendingContext!==t.context):t.context&&QI(0,t.context,!1),sR(e,t.containerInfo)}var mD,gD,vD,yD,bD={dehydrated:null,retryTime:0};function CD(e,t,r){var n,o=t.mode,a=t.pendingProps,i=dR.current,s=!1;if((n=0!=(64&t.effectTag))||(n=0!=(2&i)&&(null===e||null!==e.memoizedState)),n?(s=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===a.fallback||!0===a.unstable_avoidThisFallback||(i|=1),UI(dR,1&i),null===e){if(void 0!==a.fallback&&eD(t),s){if(s=a.fallback,(a=yO(null,o,0,null)).return=t,0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,a.child=e;null!==e;)e.return=a,e=e.sibling;return(r=yO(s,o,r,null)).return=t,a.sibling=r,t.memoizedState=bD,t.child=a,r}return o=a.children,t.memoizedState=null,t.child=tR(t,null,o,r)}if(null!==e.memoizedState){if(o=(e=e.child).sibling,s){if(a=a.fallback,(r=gO(e,e.pendingProps)).return=t,0==(2&t.mode)&&(s=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(r.child=s;null!==s;)s.return=r,s=s.sibling;return(o=gO(o,a)).return=t,r.sibling=o,r.childExpirationTime=0,t.memoizedState=bD,t.child=r,o}return r=eR(t,e.child,a.children,r),t.memoizedState=null,t.child=r}if(e=e.child,s){if(s=a.fallback,(a=yO(null,o,0,null)).return=t,a.child=e,null!==e&&(e.return=a),0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,a.child=e;null!==e;)e.return=a,e=e.sibling;return(r=yO(s,o,r,null)).return=t,a.sibling=r,r.effectTag|=2,a.childExpirationTime=0,t.memoizedState=bD,t.child=a,r}return t.memoizedState=null,t.child=eR(t,e,a.children,r)}function wD(e,t){e.expirationTime<t&&(e.expirationTime=t);var r=e.alternate;null!==r&&r.expirationTime<t&&(r.expirationTime=t),PP(e.return,t)}function kD(e,t,r,n,o,a){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailExpiration:0,tailMode:o,lastEffect:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailExpiration=0,i.tailMode=o,i.lastEffect=a)}function SD(e,t,r){var n=t.pendingProps,o=n.revealOrder,a=n.tail;if(iD(e,t,n.children,r),0!=(2&(n=dR.current)))n=1&n|2,t.effectTag|=64;else{if(null!==e&&0!=(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&wD(e,r);else if(19===e.tag)wD(e,r);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(UI(dR,n),0==(2&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(r=t.child,o=null;null!==r;)null!==(e=r.alternate)&&null===fR(e)&&(o=r),r=r.sibling;null===(r=o)?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),kD(t,!1,o,r,a,t.lastEffect);break;case"backwards":for(r=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===fR(e)){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}kD(t,!0,r,null,a,t.lastEffect);break;case"together":kD(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function ED(e,t,r){null!==e&&(t.dependencies=e.dependencies);var n=t.expirationTime;if(0!==n&&GN(n),t.childExpirationTime<r)return null;if(null!==e&&t.child!==e.child)throw Error(yB(153));if(null!==t.child){for(r=gO(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=gO(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function BD(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function _D(e,t,r){var n=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return KI(t.type)&&WI(),null;case 3:return cR(),FI(zI),FI(VI),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||!rD(t)||(t.effectTag|=4),gD(t),null;case 5:lR(t),r=iR(aR.current);var o=t.type;if(null!==e&&null!=t.stateNode)vD(e,t,o,n,r),e.ref!==t.ref&&(t.effectTag|=128);else{if(!n){if(null===t.stateNode)throw Error(yB(166));return null}if(e=iR(nR.current),rD(t)){n=t.stateNode,o=t.type;var a=t.memoizedProps;switch(n[YT]=t,n[$T]=a,o){case"iframe":case"object":case"embed":mT("load",n);break;case"video":case"audio":for(e=0;e<mx.length;e++)mT(mx[e],n);break;case"source":mT("error",n);break;case"img":case"image":case"link":mT("error",n),mT("load",n);break;case"form":mT("reset",n),mT("submit",n);break;case"details":mT("toggle",n);break;case"input":V_(n,a),mT("invalid",n),AT(r,"onChange");break;case"select":n._wrapperState={wasMultiple:!!a.multiple},mT("invalid",n),AT(r,"onChange");break;case"textarea":Y_(n,a),mT("invalid",n),AT(r,"onChange")}for(var i in _T(o,a),e=null,a)if(a.hasOwnProperty(i)){var s=a[i];"children"===i?"string"==typeof s?n.textContent!==s&&(e=["children",s]):"number"==typeof s&&n.textContent!==""+s&&(e=["children",""+s]):MB.hasOwnProperty(i)&&null!=s&&AT(r,i)}switch(o){case"input":F_(n),H_(n,a,!0);break;case"textarea":F_(n),Z_(n);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(n.onclick=IT)}r=e,t.updateQueue=r,null!==r&&(t.effectTag|=4)}else{switch(i=9===r.nodeType?r:r.ownerDocument,e===TT&&(e=ex(o)),e===TT?"script"===o?((e=i.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof n.is?e=i.createElement(o,{is:n.is}):(e=i.createElement(o),"select"===o&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,o),e[YT]=t,e[$T]=n,mD(e,t,!1,!1),t.stateNode=e,i=xT(o,n),o){case"iframe":case"object":case"embed":mT("load",e),s=n;break;case"video":case"audio":for(s=0;s<mx.length;s++)mT(mx[s],e);s=n;break;case"source":mT("error",e),s=n;break;case"img":case"image":case"link":mT("error",e),mT("load",e),s=n;break;case"form":mT("reset",e),mT("submit",e),s=n;break;case"details":mT("toggle",e),s=n;break;case"input":V_(e,n),s=j_(e,n),mT("invalid",e),AT(r,"onChange");break;case"option":s=Q_(e,n);break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=ub({},n,{value:void 0}),mT("invalid",e),AT(r,"onChange");break;case"textarea":Y_(e,n),s=X_(e,n),mT("invalid",e),AT(r,"onChange");break;default:s=n}_T(o,s);var c=s;for(a in c)if(c.hasOwnProperty(a)){var u=c[a];"style"===a?ET(e,u):"dangerouslySetInnerHTML"===a?null!=(u=u?u.__html:void 0)&&ox(e,u):"children"===a?"string"==typeof u?("textarea"!==o||""!==u)&&ax(e,u):"number"==typeof u&&ax(e,""+u):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(MB.hasOwnProperty(a)?null!=u&&AT(r,a):null!=u&&p_(e,a,u,i))}switch(o){case"input":F_(e),H_(e,n,!1);break;case"textarea":F_(e),Z_(e);break;case"option":null!=n.value&&e.setAttribute("value",""+O_(n.value));break;case"select":e.multiple=!!n.multiple,null!=(r=n.value)?G_(e,!!n.multiple,r,!1):null!=n.defaultValue&&G_(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=IT)}qT(o,n)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)yD(e,t,e.memoizedProps,n);else{if("string"!=typeof n&&null===t.stateNode)throw Error(yB(166));r=iR(aR.current),iR(nR.current),rD(t)?(r=t.stateNode,n=t.memoizedProps,r[YT]=t,r.nodeValue!==n&&(t.effectTag|=4)):((r=(9===r.nodeType?r:r.ownerDocument).createTextNode(n))[YT]=t,t.stateNode=r)}return null;case 13:return FI(dR),n=t.memoizedState,0!=(64&t.effectTag)?(t.expirationTime=r,t):(r=null!==n,n=!1,null===e?void 0!==t.memoizedProps.fallback&&rD(t):(n=null!==(o=e.memoizedState),r||null===o||null!==(o=e.child.sibling)&&(null!==(a=t.firstEffect)?(t.firstEffect=o,o.nextEffect=a):(t.firstEffect=t.lastEffect=o,o.nextEffect=null),o.effectTag=8)),r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&dR.current)?pN===nN&&(pN=iN):(pN!==nN&&pN!==iN||(pN=sN),0!==yN&&null!==lN&&(SO(lN,fN),EO(lN,yN)))),(r||n)&&(t.effectTag|=4),null);case 4:return cR(),gD(t),null;case 10:return IP(t),null;case 17:return KI(t.type)&&WI(),null;case 19:if(FI(dR),null===(n=t.memoizedState))return null;if(o=0!=(64&t.effectTag),null===(a=n.rendering)){if(o)BD(n,!1);else if(pN!==nN||null!==e&&0!=(64&e.effectTag))for(a=t.child;null!==a;){if(null!==(e=fR(a))){for(t.effectTag|=64,BD(n,!1),null!==(o=e.updateQueue)&&(t.updateQueue=o,t.effectTag|=4),null===n.lastEffect&&(t.firstEffect=null),t.lastEffect=n.lastEffect,n=t.child;null!==n;)a=r,(o=n).effectTag&=2,o.nextEffect=null,o.firstEffect=null,o.lastEffect=null,null===(e=o.alternate)?(o.childExpirationTime=0,o.expirationTime=a,o.child=null,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null):(o.childExpirationTime=e.childExpirationTime,o.expirationTime=e.expirationTime,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,a=e.dependencies,o.dependencies=null===a?null:{expirationTime:a.expirationTime,firstContext:a.firstContext,responders:a.responders}),n=n.sibling;return UI(dR,1&dR.current|2),t.child}a=a.sibling}}else{if(!o)if(null!==(e=fR(a))){if(t.effectTag|=64,o=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.effectTag|=4),BD(n,!0),null===n.tail&&"hidden"===n.tailMode&&!a.alternate)return null!==(t=t.lastEffect=n.lastEffect)&&(t.nextEffect=null),null}else 2*mP()-n.renderingStartTime>n.tailExpiration&&1<r&&(t.effectTag|=64,o=!0,BD(n,!1),t.expirationTime=t.childExpirationTime=r-1);n.isBackwards?(a.sibling=t.child,t.child=a):(null!==(r=n.last)?r.sibling=a:t.child=a,n.last=a)}return null!==n.tail?(0===n.tailExpiration&&(n.tailExpiration=mP()+500),r=n.tail,n.rendering=r,n.tail=r.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=mP(),r.sibling=null,t=dR.current,UI(dR,o?1&t|2:1&t),r):null}throw Error(yB(156,t.tag))}function xD(e){switch(e.tag){case 1:KI(e.type)&&WI();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(cR(),FI(zI),FI(VI),0!=(64&(t=e.effectTag)))throw Error(yB(285));return e.effectTag=-4097&t|64,e;case 5:return lR(e),null;case 13:return FI(dR),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return FI(dR),null;case 4:return cR(),null;case 10:return IP(e),null;default:return null}}function TD(e,t){return{value:e,source:t,stack:N_(t)}}mD=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},gD=function(){},vD=function(e,t,r,n,o){var a=e.memoizedProps;if(a!==n){var i,s,c=t.stateNode;switch(iR(nR.current),e=null,r){case"input":a=j_(c,a),n=j_(c,n),e=[];break;case"option":a=Q_(c,a),n=Q_(c,n),e=[];break;case"select":a=ub({},a,{value:void 0}),n=ub({},n,{value:void 0}),e=[];break;case"textarea":a=X_(c,a),n=X_(c,n),e=[];break;default:"function"!=typeof a.onClick&&"function"==typeof n.onClick&&(c.onclick=IT)}for(i in _T(r,n),r=null,a)if(!n.hasOwnProperty(i)&&a.hasOwnProperty(i)&&null!=a[i])if("style"===i)for(s in c=a[i])c.hasOwnProperty(s)&&(r||(r={}),r[s]="");else"dangerouslySetInnerHTML"!==i&&"children"!==i&&"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&"autoFocus"!==i&&(MB.hasOwnProperty(i)?e||(e=[]):(e=e||[]).push(i,null));for(i in n){var u=n[i];if(c=null!=a?a[i]:void 0,n.hasOwnProperty(i)&&u!==c&&(null!=u||null!=c))if("style"===i)if(c){for(s in c)!c.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in u)u.hasOwnProperty(s)&&c[s]!==u[s]&&(r||(r={}),r[s]=u[s])}else r||(e||(e=[]),e.push(i,r)),r=u;else"dangerouslySetInnerHTML"===i?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(e=e||[]).push(i,u)):"children"===i?c===u||"string"!=typeof u&&"number"!=typeof u||(e=e||[]).push(i,""+u):"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&(MB.hasOwnProperty(i)?(null!=u&&AT(o,i),e||c===u||(e=[])):(e=e||[]).push(i,u))}r&&(e=e||[]).push("style",r),o=e,(t.updateQueue=o)&&(t.effectTag|=4)}},yD=function(e,t,r,n){r!==n&&(t.effectTag|=4)};var AD="function"==typeof WeakSet?WeakSet:Set;function ID(e,t){var r=t.source,n=t.stack;null===n&&null!==r&&(n=N_(r)),null!==r&&D_(r.type),t=t.value,null!==e&&1===e.tag&&D_(e.type);try{console.error(t)}catch(e){setTimeout((function(){throw e}))}}function PD(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(t){iO(e,t)}}function RD(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){iO(e,t)}else t.current=null}function DD(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var r=e.memoizedProps,n=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?r:EP(t.type,r),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(yB(163))}function ND(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.destroy;r.destroy=void 0,void 0!==n&&n()}r=r.next}while(r!==t)}}function OD(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function LD(e,t,r){switch(r.tag){case 0:case 11:case 15:case 22:return void OD(3,r);case 1:if(e=r.stateNode,4&r.effectTag)if(null===t)e.componentDidMount();else{var n=r.elementType===r.type?t.memoizedProps:EP(r.type,t.memoizedProps);e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=r.updateQueue)&&VP(r,t,e));case 3:if(null!==(t=r.updateQueue)){if(e=null,null!==r.child)switch(r.child.tag){case 5:e=r.child.stateNode;break;case 1:e=r.child.stateNode}VP(r,t,e)}return;case 5:return e=r.stateNode,void(null===t&&4&r.effectTag&&qT(r.type,r.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===r.memoizedState&&(r=r.alternate,null!==r&&(r=r.memoizedState,null!==r&&(r=r.dehydrated,null!==r&&oT(r)))));case 19:case 17:case 20:case 21:return}throw Error(yB(163))}function MD(e,t,r){switch("function"==typeof lO&&lO(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e.next;yP(97<r?97:r,(function(){var e=n;do{var r=e.destroy;if(void 0!==r){var o=t;try{r()}catch(e){iO(o,e)}}e=e.next}while(e!==n)}))}break;case 1:RD(t),"function"==typeof(r=t.stateNode).componentWillUnmount&&PD(t,r);break;case 5:RD(t);break;case 4:qD(e,t,r)}}function FD(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&FD(t)}function UD(e){return 5===e.tag||3===e.tag||4===e.tag}function jD(e){e:{for(var t=e.return;null!==t;){if(UD(t)){var r=t;break e}t=t.return}throw Error(yB(160))}switch(t=r.stateNode,r.tag){case 5:var n=!1;break;case 3:case 4:t=t.containerInfo,n=!0;break;default:throw Error(yB(161))}16&r.effectTag&&(ax(t,""),r.effectTag&=-17);e:t:for(r=e;;){for(;null===r.sibling;){if(null===r.return||UD(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;5!==r.tag&&6!==r.tag&&18!==r.tag;){if(2&r.effectTag)continue t;if(null===r.child||4===r.tag)continue t;r.child.return=r,r=r.child}if(!(2&r.effectTag)){r=r.stateNode;break e}}n?VD(e,r,t):zD(e,r,t)}function VD(e,t,r){var n=e.tag,o=5===n||6===n;if(o)e=o?e.stateNode:e.stateNode.instance,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!=(r=r._reactRootContainer)||null!==t.onclick||(t.onclick=IT));else if(4!==n&&null!==(e=e.child))for(VD(e,t,r),e=e.sibling;null!==e;)VD(e,t,r),e=e.sibling}function zD(e,t,r){var n=e.tag,o=5===n||6===n;if(o)e=o?e.stateNode:e.stateNode.instance,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(zD(e,t,r),e=e.sibling;null!==e;)zD(e,t,r),e=e.sibling}function qD(e,t,r){for(var n,o,a=t,i=!1;;){if(!i){i=a.return;e:for(;;){if(null===i)throw Error(yB(160));switch(n=i.stateNode,i.tag){case 5:o=!1;break e;case 3:case 4:n=n.containerInfo,o=!0;break e}i=i.return}i=!0}if(5===a.tag||6===a.tag){e:for(var s=e,c=a,u=r,l=c;;)if(MD(s,l,u),null!==l.child&&4!==l.tag)l.child.return=l,l=l.child;else{if(l===c)break e;for(;null===l.sibling;){if(null===l.return||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}o?(s=n,c=a.stateNode,8===s.nodeType?s.parentNode.removeChild(c):s.removeChild(c)):n.removeChild(a.stateNode)}else if(4===a.tag){if(null!==a.child){n=a.stateNode.containerInfo,o=!0,a.child.return=a,a=a.child;continue}}else if(MD(e,a,r),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(i=!1)}a.sibling.return=a.return,a=a.sibling}}function HD(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void ND(3,t);case 1:return;case 5:var r=t.stateNode;if(null!=r){var n=t.memoizedProps,o=null!==e?e.memoizedProps:n;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(r[$T]=n,"input"===e&&"radio"===n.type&&null!=n.name&&z_(r,n),xT(e,o),t=xT(e,n),o=0;o<a.length;o+=2){var i=a[o],s=a[o+1];"style"===i?ET(r,s):"dangerouslySetInnerHTML"===i?ox(r,s):"children"===i?ax(r,s):p_(r,i,s,t)}switch(e){case"input":q_(r,n);break;case"textarea":$_(r,n);break;case"select":t=r._wrapperState.wasMultiple,r._wrapperState.wasMultiple=!!n.multiple,null!=(e=n.value)?G_(r,!!n.multiple,e,!1):t!==!!n.multiple&&(null!=n.defaultValue?G_(r,!!n.multiple,n.defaultValue,!0):G_(r,!!n.multiple,n.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(yB(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,oT(t.containerInfo)));case 12:return;case 13:if(r=t,null===t.memoizedState?n=!1:(n=!0,r=t.child,CN=mP()),null!==r)e:for(e=r;;){if(5===e.tag)a=e.stateNode,n?"function"==typeof(a=a.style).setProperty?a.setProperty("display","none","important"):a.display="none":(a=e.stateNode,o=null!=(o=e.memoizedProps.style)&&o.hasOwnProperty("display")?o.display:null,a.style.display=ST("display",o));else if(6===e.tag)e.stateNode.nodeValue=n?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(a=e.child.sibling).return=e,e=a;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===r)break;for(;null===e.sibling;){if(null===e.return||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void KD(t);case 19:return void KD(t);case 17:return}throw Error(yB(163))}function KD(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new AD),t.forEach((function(t){var n=cO.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}var WD="function"==typeof WeakMap?WeakMap:Map;function QD(e,t,r){(r=MP(r,null)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){SN||(SN=!0,EN=n),ID(e,t)},r}function GD(e,t,r){(r=MP(r,null)).tag=3;var n=e.type.getDerivedStateFromError;if("function"==typeof n){var o=t.value;r.payload=function(){return ID(e,t),n(o)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(r.callback=function(){"function"!=typeof n&&(null===BN?BN=new Set([this]):BN.add(this),ID(e,t));var r=t.stack;this.componentDidCatch(t.value,{componentStack:null!==r?r:""})}),r}var XD,YD=Math.ceil,$D=f_.ReactCurrentDispatcher,ZD=f_.ReactCurrentOwner,JD=0,eN=8,tN=16,rN=32,nN=0,oN=1,aN=2,iN=3,sN=4,cN=5,uN=JD,lN=null,dN=null,fN=0,pN=nN,hN=null,mN=1073741823,gN=1073741823,vN=null,yN=0,bN=!1,CN=0,wN=500,kN=null,SN=!1,EN=null,BN=null,_N=!1,xN=null,TN=90,AN=null,IN=0,PN=null,RN=0;function DN(){return(uN&(tN|rN))!==JD?1073741821-(mP()/10|0):0!==RN?RN:RN=1073741821-(mP()/10|0)}function NN(e,t,r){if(0==(2&(t=t.mode)))return 1073741823;var n=gP();if(0==(4&t))return 99===n?1073741823:1073741822;if((uN&tN)!==JD)return fN;if(null!==r)e=SP(e,0|r.timeoutMs||5e3,250);else switch(n){case 99:e=1073741823;break;case 98:e=SP(e,150,100);break;case 97:case 96:e=SP(e,5e3,250);break;case 95:e=2;break;default:throw Error(yB(326))}return null!==lN&&e===fN&&--e,e}function ON(e,t){if(50<IN)throw IN=0,PN=null,Error(yB(185));if(null!==(e=LN(e,t))){var r=gP();1073741823===t?(uN&eN)!==JD&&(uN&(tN|rN))===JD?jN(e):(FN(e),uN===JD&&wP()):FN(e),(4&uN)===JD||98!==r&&99!==r||(null===AN?AN=new Map([[e,t]]):(void 0===(r=AN.get(e))||r>t)&&AN.set(e,t))}}function LN(e,t){e.expirationTime<t&&(e.expirationTime=t);var r=e.alternate;null!==r&&r.expirationTime<t&&(r.expirationTime=t);var n=e.return,o=null;if(null===n&&3===e.tag)o=e.stateNode;else for(;null!==n;){if(r=n.alternate,n.childExpirationTime<t&&(n.childExpirationTime=t),null!==r&&r.childExpirationTime<t&&(r.childExpirationTime=t),null===n.return&&3===n.tag){o=n.stateNode;break}n=n.return}return null!==o&&(lN===o&&(GN(t),pN===sN&&SO(o,fN)),EO(o,t)),o}function MN(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!kO(e,t=e.firstPendingTime))return t;var r=e.lastPingedTime;return 2>=(e=r>(e=e.nextKnownPendingLevel)?r:e)&&t!==e?0:e}function FN(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=CP(jN.bind(null,e));else{var t=MN(e),r=e.callbackNode;if(0===t)null!==r&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var n=DN();if(1073741823===t?n=99:1===t||2===t?n=95:n=0>=(n=10*(1073741821-t)-10*(1073741821-n))?99:250>=n?98:5250>=n?97:95,null!==r){var o=e.callbackPriority;if(e.callbackExpirationTime===t&&o>=n)return;r!==cP&&JI(r)}e.callbackExpirationTime=t,e.callbackPriority=n,t=1073741823===t?CP(jN.bind(null,e)):bP(n,UN.bind(null,e),{timeout:10*(1073741821-t)-mP()}),e.callbackNode=t}}}function UN(e,t){if(RN=0,t)return BO(e,t=DN()),FN(e),null;var r=MN(e);if(0!==r){if(t=e.callbackNode,(uN&(tN|rN))!==JD)throw Error(yB(327));if(nO(),e===lN&&r===fN||HN(e,r),null!==dN){var n=uN;uN|=tN;for(var o=WN();;)try{YN();break}catch(t){KN(e,t)}if(AP(),uN=n,$D.current=o,pN===oN)throw t=hN,HN(e,r),SO(e,r),FN(e),t;if(null===dN)switch(o=e.finishedWork=e.current.alternate,e.finishedExpirationTime=r,n=pN,lN=null,n){case nN:case oN:throw Error(yB(345));case aN:BO(e,2<r?2:r);break;case iN:if(SO(e,r),r===(n=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=JN(o)),1073741823===mN&&10<(o=CN+wN-mP())){if(bN){var a=e.lastPingedTime;if(0===a||a>=r){e.lastPingedTime=r,HN(e,r);break}}if(0!==(a=MN(e))&&a!==r)break;if(0!==n&&n!==r){e.lastPingedTime=n;break}e.timeoutHandle=KT(eO.bind(null,e),o);break}eO(e);break;case sN:if(SO(e,r),r===(n=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=JN(o)),bN&&(0===(o=e.lastPingedTime)||o>=r)){e.lastPingedTime=r,HN(e,r);break}if(0!==(o=MN(e))&&o!==r)break;if(0!==n&&n!==r){e.lastPingedTime=n;break}if(1073741823!==gN?n=10*(1073741821-gN)-mP():1073741823===mN?n=0:(n=10*(1073741821-mN)-5e3,0>(n=(o=mP())-n)&&(n=0),(r=10*(1073741821-r)-o)<(n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*YD(n/1960))-n)&&(n=r)),10<n){e.timeoutHandle=KT(eO.bind(null,e),n);break}eO(e);break;case cN:if(1073741823!==mN&&null!==vN){a=mN;var i=vN;if(0>=(n=0|i.busyMinDurationMs)?n=0:(o=0|i.busyDelayMs,n=(a=mP()-(10*(1073741821-a)-(0|i.timeoutMs||5e3)))<=o?0:o+n-a),10<n){SO(e,r),e.timeoutHandle=KT(eO.bind(null,e),n);break}}eO(e);break;default:throw Error(yB(329))}if(FN(e),e.callbackNode===t)return UN.bind(null,e)}}return null}function jN(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,(uN&(tN|rN))!==JD)throw Error(yB(327));if(nO(),e===lN&&t===fN||HN(e,t),null!==dN){var r=uN;uN|=tN;for(var n=WN();;)try{XN();break}catch(t){KN(e,t)}if(AP(),uN=r,$D.current=n,pN===oN)throw r=hN,HN(e,t),SO(e,t),FN(e),r;if(null!==dN)throw Error(yB(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,lN=null,eO(e),FN(e)}return null}function VN(){if(null!==AN){var e=AN;AN=null,e.forEach((function(e,t){BO(t,e),FN(t)})),wP()}}function zN(e,t){var r=uN;uN|=1;try{return e(t)}finally{(uN=r)===JD&&wP()}}function qN(e,t){var r=uN;uN&=-2,uN|=eN;try{return e(t)}finally{(uN=r)===JD&&wP()}}function HN(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,WT(r)),null!==dN)for(r=dN.return;null!==r;){var n=r;switch(n.tag){case 1:null!=(n=n.type.childContextTypes)&&WI();break;case 3:cR(),FI(zI),FI(VI);break;case 5:lR(n);break;case 4:cR();break;case 13:case 19:FI(dR);break;case 10:IP(n)}r=r.return}lN=e,dN=gO(e.current,null),fN=t,pN=nN,hN=null,gN=mN=1073741823,vN=null,yN=0,bN=!1}function KN(e,t){for(;;){try{if(AP(),hR.current=KR,CR)for(var r=vR.memoizedState;null!==r;){var n=r.queue;null!==n&&(n.pending=null),r=r.next}if(gR=0,bR=yR=vR=null,CR=!1,null===dN||null===dN.return)return pN=oN,hN=t,dN=null;e:{var o=e,a=dN.return,i=dN,s=t;if(t=fN,i.effectTag|=2048,i.firstEffect=i.lastEffect=null,null!==s&&"object"==typeof s&&"function"==typeof s.then){var c=s;if(0==(2&i.mode)){var u=i.alternate;u?(i.updateQueue=u.updateQueue,i.memoizedState=u.memoizedState,i.expirationTime=u.expirationTime):(i.updateQueue=null,i.memoizedState=null)}var l=0!=(1&dR.current),d=a;do{var f;if(f=13===d.tag){var p=d.memoizedState;if(null!==p)f=null!==p.dehydrated;else{var h=d.memoizedProps;f=void 0!==h.fallback&&(!0!==h.unstable_avoidThisFallback||!l)}}if(f){var m=d.updateQueue;if(null===m){var g=new Set;g.add(c),d.updateQueue=g}else m.add(c);if(0==(2&d.mode)){if(d.effectTag|=64,i.effectTag&=-2981,1===i.tag)if(null===i.alternate)i.tag=17;else{var v=MP(1073741823,null);v.tag=2,FP(i,v)}i.expirationTime=1073741823;break e}s=void 0,i=t;var y=o.pingCache;if(null===y?(y=o.pingCache=new WD,s=new Set,y.set(c,s)):void 0===(s=y.get(c))&&(s=new Set,y.set(c,s)),!s.has(i)){s.add(i);var b=sO.bind(null,o,c,i);c.then(b,b)}d.effectTag|=4096,d.expirationTime=t;break e}d=d.return}while(null!==d);s=Error((D_(i.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+N_(i))}pN!==cN&&(pN=aN),s=TD(s,i),d=a;do{switch(d.tag){case 3:c=s,d.effectTag|=4096,d.expirationTime=t,UP(d,QD(d,c,t));break e;case 1:c=s;var C=d.type,w=d.stateNode;if(0==(64&d.effectTag)&&("function"==typeof C.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===BN||!BN.has(w)))){d.effectTag|=4096,d.expirationTime=t,UP(d,GD(d,c,t));break e}}d=d.return}while(null!==d)}dN=ZN(dN)}catch(e){t=e;continue}break}}function WN(){var e=$D.current;return $D.current=KR,null===e?KR:e}function QN(e,t){e<mN&&2<e&&(mN=e),null!==t&&e<gN&&2<e&&(gN=e,vN=t)}function GN(e){e>yN&&(yN=e)}function XN(){for(;null!==dN;)dN=$N(dN)}function YN(){for(;null!==dN&&!uP();)dN=$N(dN)}function $N(e){var t=XD(e.alternate,e,fN);return e.memoizedProps=e.pendingProps,null===t&&(t=ZN(e)),ZD.current=null,t}function ZN(e){dN=e;do{var t=dN.alternate;if(e=dN.return,0==(2048&dN.effectTag)){if(t=_D(t,dN,fN),1===fN||1!==dN.childExpirationTime){for(var r=0,n=dN.child;null!==n;){var o=n.expirationTime,a=n.childExpirationTime;o>r&&(r=o),a>r&&(r=a),n=n.sibling}dN.childExpirationTime=r}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=dN.firstEffect),null!==dN.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=dN.firstEffect),e.lastEffect=dN.lastEffect),1<dN.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=dN:e.firstEffect=dN,e.lastEffect=dN))}else{if(null!==(t=xD(dN)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=dN.sibling))return t;dN=e}while(null!==dN);return pN===nN&&(pN=cN),null}function JN(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function eO(e){var t=gP();return yP(99,tO.bind(null,e,t)),null}function tO(e,t){do{nO()}while(null!==xN);if((uN&(tN|rN))!==JD)throw Error(yB(327));var r=e.finishedWork,n=e.finishedExpirationTime;if(null===r)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,r===e.current)throw Error(yB(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var o=JN(r);if(e.firstPendingTime=o,n<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:n<=e.firstSuspendedTime&&(e.firstSuspendedTime=n-1),n<=e.lastPingedTime&&(e.lastPingedTime=0),n<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===lN&&(dN=lN=null,fN=0),1<r.effectTag?null!==r.lastEffect?(r.lastEffect.nextEffect=r,o=r.firstEffect):o=r:o=r.firstEffect,null!==o){var a=uN;uN|=rN,ZD.current=null,VT=hT;var i=OT();if(LT(i)){if("selectionStart"in i)var s={start:i.selectionStart,end:i.selectionEnd};else e:{var c=(s=(s=i.ownerDocument)&&s.defaultView||window).getSelection&&s.getSelection();if(c&&0!==c.rangeCount){s=c.anchorNode;var u=c.anchorOffset,l=c.focusNode;c=c.focusOffset;try{s.nodeType,l.nodeType}catch(e){s=null;break e}var d=0,f=-1,p=-1,h=0,m=0,g=i,v=null;t:for(;;){for(var y;g!==s||0!==u&&3!==g.nodeType||(f=d+u),g!==l||0!==c&&3!==g.nodeType||(p=d+c),3===g.nodeType&&(d+=g.nodeValue.length),null!==(y=g.firstChild);)v=g,g=y;for(;;){if(g===i)break t;if(v===s&&++h===u&&(f=d),v===l&&++m===c&&(p=d),null!==(y=g.nextSibling))break;v=(g=v).parentNode}g=y}s=-1===f||-1===p?null:{start:f,end:p}}else s=null}s=s||{start:0,end:0}}else s=null;zT={activeElementDetached:null,focusedElem:i,selectionRange:s},hT=!1,kN=o;do{try{rO()}catch(e){if(null===kN)throw Error(yB(330));iO(kN,e),kN=kN.nextEffect}}while(null!==kN);kN=o;do{try{for(i=e,s=t;null!==kN;){var b=kN.effectTag;if(16&b&&ax(kN.stateNode,""),128&b){var C=kN.alternate;if(null!==C){var w=C.ref;null!==w&&("function"==typeof w?w(null):w.current=null)}}switch(1038&b){case 2:jD(kN),kN.effectTag&=-3;break;case 6:jD(kN),kN.effectTag&=-3,HD(kN.alternate,kN);break;case 1024:kN.effectTag&=-1025;break;case 1028:kN.effectTag&=-1025,HD(kN.alternate,kN);break;case 4:HD(kN.alternate,kN);break;case 8:qD(i,u=kN,s),FD(u)}kN=kN.nextEffect}}catch(e){if(null===kN)throw Error(yB(330));iO(kN,e),kN=kN.nextEffect}}while(null!==kN);if(w=zT,C=OT(),b=w.focusedElem,s=w.selectionRange,C!==b&&b&&b.ownerDocument&&NT(b.ownerDocument.documentElement,b)){null!==s&<(b)&&(C=s.start,void 0===(w=s.end)&&(w=C),"selectionStart"in b?(b.selectionStart=C,b.selectionEnd=Math.min(w,b.value.length)):(w=(C=b.ownerDocument||document)&&C.defaultView||window).getSelection&&(w=w.getSelection(),u=b.textContent.length,i=Math.min(s.start,u),s=void 0===s.end?i:Math.min(s.end,u),!w.extend&&i>s&&(u=s,s=i,i=u),u=DT(b,i),l=DT(b,s),u&&l&&(1!==w.rangeCount||w.anchorNode!==u.node||w.anchorOffset!==u.offset||w.focusNode!==l.node||w.focusOffset!==l.offset)&&((C=C.createRange()).setStart(u.node,u.offset),w.removeAllRanges(),i>s?(w.addRange(C),w.extend(l.node,l.offset)):(C.setEnd(l.node,l.offset),w.addRange(C))))),C=[];for(w=b;w=w.parentNode;)1===w.nodeType&&C.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<C.length;b++)(w=C[b]).element.scrollLeft=w.left,w.element.scrollTop=w.top}hT=!!VT,zT=VT=null,e.current=r,kN=o;do{try{for(b=e;null!==kN;){var k=kN.effectTag;if(36&k&&LD(b,kN.alternate,kN),128&k){C=void 0;var S=kN.ref;if(null!==S){var E=kN.stateNode;switch(kN.tag){case 5:C=E;break;default:C=E}"function"==typeof S?S(C):S.current=C}}kN=kN.nextEffect}}catch(e){if(null===kN)throw Error(yB(330));iO(kN,e),kN=kN.nextEffect}}while(null!==kN);kN=null,lP(),uN=a}else e.current=r;if(_N)_N=!1,xN=e,TN=t;else for(kN=o;null!==kN;)t=kN.nextEffect,kN.nextEffect=null,kN=t;if(0===(t=e.firstPendingTime)&&(BN=null),1073741823===t?e===PN?IN++:(IN=0,PN=e):IN=0,"function"==typeof uO&&uO(r.stateNode,n),FN(e),SN)throw SN=!1,e=EN,EN=null,e;return(uN&eN)!==JD||wP(),null}function rO(){for(;null!==kN;){var e=kN.effectTag;0!=(256&e)&&DD(kN.alternate,kN),0==(512&e)||_N||(_N=!0,bP(97,(function(){return nO(),null}))),kN=kN.nextEffect}}function nO(){if(90!==TN){var e=97<TN?97:TN;return TN=90,yP(e,oO)}}function oO(){if(null===xN)return!1;var e=xN;if(xN=null,(uN&(tN|rN))!==JD)throw Error(yB(331));var t=uN;for(uN|=rN,e=e.current.firstEffect;null!==e;){try{var r=e;if(0!=(512&r.effectTag))switch(r.tag){case 0:case 11:case 15:case 22:ND(5,r),OD(5,r)}}catch(t){if(null===e)throw Error(yB(330));iO(e,t)}r=e.nextEffect,e.nextEffect=null,e=r}return uN=t,wP(),!0}function aO(e,t,r){FP(e,t=QD(e,t=TD(r,t),1073741823)),null!==(e=LN(e,1073741823))&&FN(e)}function iO(e,t){if(3===e.tag)aO(e,e,t);else for(var r=e.return;null!==r;){if(3===r.tag){aO(r,e,t);break}if(1===r.tag){var n=r.stateNode;if("function"==typeof r.type.getDerivedStateFromError||"function"==typeof n.componentDidCatch&&(null===BN||!BN.has(n))){FP(r,e=GD(r,e=TD(t,e),1073741823)),null!==(r=LN(r,1073741823))&&FN(r);break}}r=r.return}}function sO(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),lN===e&&fN===r?pN===sN||pN===iN&&1073741823===mN&&mP()-CN<wN?HN(e,fN):bN=!0:kO(e,r)&&(0!==(t=e.lastPingedTime)&&t<r||(e.lastPingedTime=r,FN(e)))}function cO(e,t){var r=e.stateNode;null!==r&&r.delete(t),0===(t=0)&&(t=NN(t=DN(),e,null)),null!==(e=LN(e,t))&&FN(e)}XD=function(e,t,r){var n=t.expirationTime;if(null!==e){var o=t.pendingProps;if(e.memoizedProps!==o||zI.current)aD=!0;else{if(n<r){switch(aD=!1,t.tag){case 3:hD(t),nD();break;case 5:if(uR(t),4&t.mode&&1!==r&&o.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:KI(t.type)&&XI(t);break;case 4:sR(t,t.stateNode.containerInfo);break;case 10:n=t.memoizedProps.value,o=t.type._context,UI(BP,o._currentValue),o._currentValue=n;break;case 13:if(null!==t.memoizedState)return 0!==(n=t.child.childExpirationTime)&&n>=r?CD(e,t,r):(UI(dR,1&dR.current),null!==(t=ED(e,t,r))?t.sibling:null);UI(dR,1&dR.current);break;case 19:if(n=t.childExpirationTime>=r,0!=(64&e.effectTag)){if(n)return SD(e,t,r);t.effectTag|=64}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null),UI(dR,dR.current),!n)return null}return ED(e,t,r)}aD=!1}}else aD=!1;switch(t.expirationTime=0,t.tag){case 2:if(n=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,o=HI(t,VI.current),RP(t,r),o=SR(null,t,n,e,o,r),t.effectTag|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,KI(n)){var a=!0;XI(t)}else a=!1;t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,OP(t);var i=n.getDerivedStateFromProps;"function"==typeof i&&HP(t,n,i,e),o.updater=KP,t.stateNode=o,o._reactInternalFiber=t,XP(t,n,e,r),t=pD(null,t,n,!0,a,r)}else t.tag=0,iD(null,t,o,r),t=t.child;return t;case 16:e:{if(o=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,R_(o),1!==o._status)throw o._result;switch(o=o._result,t.type=o,a=t.tag=mO(o),e=EP(o,e),a){case 0:t=dD(null,t,o,e,r);break e;case 1:t=fD(null,t,o,e,r);break e;case 11:t=sD(null,t,o,e,r);break e;case 14:t=cD(null,t,o,EP(o.type,e),n,r);break e}throw Error(yB(306,o,""))}return t;case 0:return n=t.type,o=t.pendingProps,dD(e,t,n,o=t.elementType===n?o:EP(n,o),r);case 1:return n=t.type,o=t.pendingProps,fD(e,t,n,o=t.elementType===n?o:EP(n,o),r);case 3:if(hD(t),n=t.updateQueue,null===e||null===n)throw Error(yB(282));if(n=t.pendingProps,o=null!==(o=t.memoizedState)?o.element:null,LP(e,t),jP(t,n,null,r),(n=t.memoizedState.element)===o)nD(),t=ED(e,t,r);else{if((o=t.stateNode.hydrate)&&(YR=QT(t.stateNode.containerInfo.firstChild),XR=t,o=$R=!0),o)for(r=tR(t,null,n,r),t.child=r;r;)r.effectTag=-3&r.effectTag|1024,r=r.sibling;else iD(e,t,n,r),nD();t=t.child}return t;case 5:return uR(t),null===e&&eD(t),n=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,i=o.children,HT(n,o)?i=null:null!==a&&HT(n,a)&&(t.effectTag|=16),lD(e,t),4&t.mode&&1!==r&&o.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(iD(e,t,i,r),t=t.child),t;case 6:return null===e&&eD(t),null;case 13:return CD(e,t,r);case 4:return sR(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=eR(t,null,n,r):iD(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,sD(e,t,n,o=t.elementType===n?o:EP(n,o),r);case 7:return iD(e,t,t.pendingProps,r),t.child;case 8:case 12:return iD(e,t,t.pendingProps.children,r),t.child;case 10:e:{n=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value;var s=t.type._context;if(UI(BP,s._currentValue),s._currentValue=a,null!==i)if(s=i.value,0===(a=fI(s,a)?0:0|("function"==typeof n._calculateChangedBits?n._calculateChangedBits(s,a):1073741823))){if(i.children===o.children&&!zI.current){t=ED(e,t,r);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var c=s.dependencies;if(null!==c){i=s.child;for(var u=c.firstContext;null!==u;){if(u.context===n&&0!=(u.observedBits&a)){1===s.tag&&((u=MP(r,null)).tag=2,FP(s,u)),s.expirationTime<r&&(s.expirationTime=r),null!==(u=s.alternate)&&u.expirationTime<r&&(u.expirationTime=r),PP(s.return,r),c.expirationTime<r&&(c.expirationTime=r);break}u=u.next}}else i=10===s.tag&&s.type===t.type?null:s.child;if(null!==i)i.return=s;else for(i=s;null!==i;){if(i===t){i=null;break}if(null!==(s=i.sibling)){s.return=i.return,i=s;break}i=i.return}s=i}iD(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=(a=t.pendingProps).children,RP(t,r),n=n(o=DP(o,a.unstable_observedBits)),t.effectTag|=1,iD(e,t,n,r),t.child;case 14:return a=EP(o=t.type,t.pendingProps),cD(e,t,o,a=EP(o.type,a),n,r);case 15:return uD(e,t,t.type,t.pendingProps,n,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:EP(n,o),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,KI(n)?(e=!0,XI(t)):e=!1,RP(t,r),QP(t,n,o),XP(t,n,o,r),pD(null,t,n,!0,e,r);case 19:return SD(e,t,r)}throw Error(yB(156,t.tag))};var uO=null,lO=null;function dO(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var r=t.inject(e);uO=function(e){try{t.onCommitFiberRoot(r,e,void 0,64==(64&e.current.effectTag))}catch(e){}},lO=function(e){try{t.onCommitFiberUnmount(r,e)}catch(e){}}}catch(e){}return!0}function fO(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function pO(e,t,r,n){return new fO(e,t,r,n)}function hO(e){return!(!(e=e.prototype)||!e.isReactComponent)}function mO(e){if("function"==typeof e)return hO(e)?1:0;if(null!=e){if((e=e.$$typeof)===E_)return 11;if(e===x_)return 14}return 2}function gO(e,t){var r=e.alternate;return null===r?((r=pO(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.childExpirationTime=e.childExpirationTime,r.expirationTime=e.expirationTime,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function vO(e,t,r,n,o,a){var i=2;if(n=e,"function"==typeof e)hO(e)&&(i=1);else if("string"==typeof e)i=5;else e:switch(e){case y_:return yO(r.children,o,a,t);case S_:i=8,o|=7;break;case b_:i=8,o|=1;break;case C_:return(e=pO(12,r,t,8|o)).elementType=C_,e.type=C_,e.expirationTime=a,e;case B_:return(e=pO(13,r,t,o)).type=B_,e.elementType=B_,e.expirationTime=a,e;case __:return(e=pO(19,r,t,o)).elementType=__,e.expirationTime=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case w_:i=10;break e;case k_:i=9;break e;case E_:i=11;break e;case x_:i=14;break e;case T_:i=16,n=null;break e;case A_:i=22;break e}throw Error(yB(130,null==e?e:typeof e,""))}return(t=pO(i,r,t,o)).elementType=e,t.type=n,t.expirationTime=a,t}function yO(e,t,r,n){return(e=pO(7,e,n,t)).expirationTime=r,e}function bO(e,t,r){return(e=pO(6,e,null,t)).expirationTime=r,e}function CO(e,t,r){return(t=pO(4,null!==e.children?e.children:[],e.key,t)).expirationTime=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function wO(e,t,r){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=r,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function kO(e,t){var r=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==r&&r>=t&&e<=t}function SO(e,t){var r=e.firstSuspendedTime,n=e.lastSuspendedTime;r<t&&(e.firstSuspendedTime=t),(n>t||0===r)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function EO(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var r=e.firstSuspendedTime;0!==r&&(t>=r?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function BO(e,t){var r=e.lastExpiredTime;(0===r||r>t)&&(e.lastExpiredTime=t)}function _O(e,t,r,n){var o=t.current,a=DN(),i=zP.suspense;a=NN(a,o,i);e:if(r){t:{if(yx(r=r._reactInternalFiber)!==r||1!==r.tag)throw Error(yB(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(KI(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(yB(171))}if(1===r.tag){var c=r.type;if(KI(c)){r=GI(r,c,s);break e}}r=s}else r=jI;return null===t.context?t.context=r:t.pendingContext=r,(t=MP(a,i)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),FP(o,t),ON(o,a),a}function xO(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function TO(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function AO(e,t){TO(e,t),(e=e.alternate)&&TO(e,t)}function IO(e,t,r){var n=new wO(e,t,r=null!=r&&!0===r.hydrate),o=pO(3,null,null,2===t?7:1===t?3:0);n.current=o,o.stateNode=n,OP(o),e[ZT]=n.current,r&&0!==t&&Gx(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=n}function PO(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function RO(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var r;r=e.lastChild;)e.removeChild(r);return new IO(e,0,t?{hydrate:!0}:void 0)}function DO(e,t,r,n,o){var a=r._reactRootContainer;if(a){var i=a._internalRoot;if("function"==typeof o){var s=o;o=function(){var e=xO(i);s.call(e)}}_O(t,i,e,o)}else{if(a=r._reactRootContainer=RO(r,n),i=a._internalRoot,"function"==typeof o){var c=o;o=function(){var e=xO(i);c.call(e)}}qN((function(){_O(t,i,e,o)}))}return xO(i)}function NO(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:v_,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}function OO(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!PO(t))throw Error(yB(200));return NO(e,t,null,r)}IO.prototype.render=function(e){_O(e,this._internalRoot,null,null)},IO.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;_O(null,e,null,(function(){t[ZT]=null}))},Ox=function(e){if(13===e.tag){var t=SP(DN(),150,100);ON(e,t),AO(e,t)}},Lx=function(e){13===e.tag&&(ON(e,3),AO(e,3))},Mx=function(e){if(13===e.tag){var t=DN();ON(e,t=NN(t,e,null)),AO(e,t)}},VB=function(e,t,r){switch(t){case"input":if(q_(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var o=rA(n);if(!o)throw Error(yB(90));U_(n),q_(n,o)}}}break;case"textarea":$_(e,r);break;case"select":null!=(t=r.value)&&G_(e,!!r.multiple,t,!1)}},QB=zN,GB=function(e,t,r,n,o){var a=uN;uN|=4;try{return yP(98,e.bind(null,t,r,n,o))}finally{(uN=a)===JD&&wP()}},XB=function(){(uN&(1|tN|rN))===JD&&(VN(),nO())},YB=function(e,t){var r=uN;uN|=2;try{return e(t)}finally{(uN=r)===JD&&wP()}};var LO={Events:[eA,tA,rA,UB,LB,uA,function(e){Ex(e,cA)},KB,WB,bT,xx,nO,{current:!1}]};!function(e){var t=e.findFiberByHostInstance;dO(ub({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f_.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=kx(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:JT,bundleType:0,version:"16.14.0",rendererPackageName:"react-dom"});var MO=LO,FO=OO,UO=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw Error(yB(188));throw Error(yB(268,Object.keys(e)))}return e=null===(e=kx(t))?null:e.stateNode},jO=function(e,t){if((uN&(tN|rN))!==JD)throw Error(yB(187));var r=uN;uN|=1;try{return yP(99,e.bind(null,t))}finally{uN=r,wP()}},VO=function(e,t,r){if(!PO(t))throw Error(yB(200));return DO(null,e,t,!0,r)},zO=function(e,t,r){if(!PO(t))throw Error(yB(200));return DO(null,e,t,!1,r)},qO=function(e){if(!PO(e))throw Error(yB(40));return!!e._reactRootContainer&&(qN((function(){DO(null,null,e,!1,(function(){e._reactRootContainer=null,e[ZT]=null}))})),!0)},HO=zN,KO=function(e,t){return OO(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},WO=function(e,t,r,n){if(!PO(r))throw Error(yB(200));if(null==e||void 0===e._reactInternalFiber)throw Error(yB(38));return DO(e,t,r,!1,n)},QO="16.14.0",GO={__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:MO,createPortal:FO,findDOMNode:UO,flushSync:jO,hydrate:VO,render:zO,unmountComponentAtNode:qO,unstable_batchedUpdates:HO,unstable_createPortal:KO,unstable_renderSubtreeIntoContainer:WO,version:QO},XO=0,YO=null,$O=null,ZO=function(e){return e()},JO=function(){return null},eL=function(){return++XO},tL=function(){},rL=function(e,t,r){return r()},nL=function(){},oL=function(e){return e},aL={__interactionsRef:YO,__subscriberRef:$O,unstable_clear:ZO,unstable_getCurrent:JO,unstable_getThreadID:eL,unstable_subscribe:tL,unstable_trace:rL,unstable_unsubscribe:nL,unstable_wrap:oL},iL=(o((function(e,t){})),o((function(e){e.exports=aL})),o((function(e,t){})),o((function(e){!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=GO}))),sL={not_supported:{code:"not_supported",msg:{en:"Camera is not well-supported on this device/browser. Please try another one.",vi:"Camera không được hỗ trợ. Vui lòng thử trình duyệt hoặc thiết bị khác."}},camera_timeout:{code:"camera_timeout",msg:{en:"Can't access camera. Please check camera permission, try again or try another browser/device",vi:"Không thể truy cập camera. Vui lòng kiểm tra quyền truy cập camera, đóng các tab/app khác đang sử dụng camera hoặc thử lại trên trình duyệt/thiết bị khác."}},wrong_orientation:{code:"wrong_orientation",msg:{en:"You are using landscape mode. Please rotate screen to portrait mode and retry.",vi:"Bạn đang sử dụng chế độ màn hình xoay ngang. Vui lòng quay màn hình theo chiều dọc và thực hiện lại."}},unable_to_load_model:{code:"unable_to_load_model",msg:{en:"Unable to load model on this device/browser. Please try another one.",vi:"Không thể load model. Vui lòng thử trình duyệt hoặc thiết bị khác."}},no_permission:{code:"no_permission",msg:{en:"Please grant the permission to access the camera.",vi:"Vui lòng cấp quyền để truy cập camera."}},no_face:{code:"no_face",msg:{en:"Face not found",vi:"Không tìm thấy khuôn mặt"}},partial_face:{code:"partial_face",msg:{en:"Face out of the box",vi:"Không tìm thấy toàn bộ khuôn mặt"}},multiple_faces:{code:"multiple_faces",msg:{en:"Too many faces",vi:"Quá nhiều khuôn mặt"}},face_too_small:{code:"face_too_small",msg:{en:"Face too small",vi:"Khuôn mặt quá nhỏ"}},face_too_large:{code:"face_too_large",msg:{en:"Face too large",vi:"Khuôn mặt quá to"}},face_out_of_box:{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"}},liveness_too_fast:{code:"liveness_too_fast",msg:{en:"Please turn your face SLOWLY",vi:"Vui lòng quay CHẬM lại"}},liveness_terminated:{code:"liveness_terminated",msg:{en:"Please try again.",vi:"Vui lòng thực hiện lại."}},liveness_terminated_face_tracking:{code:"liveness_terminated_face_tracking",msg:{en:"You need to turn your face SLOWLY.\nPlease try again.",vi:"Bạn cần quay CHẬM lại.\nVui lòng thực hiện lại."}},liveness_terminated_no_face:{code:"liveness_terminated_no_face",msg:{en:"Your face was missing for too long.\nPlease try again.",vi:"Khuôn mặt không nằm trong khung hình.\nXin vui lòng thử lại."}},liveness_terminated_time_out:{code:"liveness_terminated_time_out",msg:{en:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",vi:"Bạn cần hoàn thành động tác theo chỉ dẫn trong <%= x %> giây.\nXin vui lòng thử lại."}},card_sanity_not_good:{code:"card_sanity_not_good",msg:{en:"Card sanity not good",vi:"Card sanity chưa đạt"}},api_call_error:{code:"api_call_error",msg:{en:"Api call error",vi:"Lỗi call api"}},upload_error:{code:"upload_error",msg:{en:"Upload error",vi:"Lỗi upload"}},sanity_check_error:{code:"sanity_check_error",msg:{en:"Sanity check error",vi:"Lỗi check sanity"}},read_id_card_error:{code:"read_id_card_error",msg:{en:"Read id card error",vi:"Lỗi read id card"}},detect_id_tampering_error:{code:"detect_id_tampering_error",msg:{en:"Detect id tampering error",vi:"Lỗi detect id tampering"}},detect_id_card_error:{code:"detect_id_card_error",msg:{en:"Can't detect id card type",vi:"Không thể detect id card type"}},missing_front_id_card:{code:"missing_front_id_card",msg:{en:"Missing front id",vi:"Không tìm thấy front id"}},server_error:{code:"server_error",msg:"Server error"},client_web_setting_not_found:{code:"client_web_setting_not_found",msg:"Client Web Setting Not Found"},id_detector_validate_angle_error:{code:"id_detector_validate_angle_error",msg:{en:"Please place ID card straight, not tilted",vi:"Vui lòng đặt giấy tờ thẳng, không bị nghiêng khi chụp"}},id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",vi:"Vui lòng chụp mặt <%= side %> của giấy tờ\n (chiếm 50-95% khung hình)"}},id_detector_card_too_small:{code:"id_detector_card_too_small",msg:{en:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ lại GẦN hơn\n (chiếm 50-95% khung hình)"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ ra XA hơn\n (chiếm 50-95% khung hình)"}},glare_detected:{code:"glare_detected",msg:{en:"Glare is detected. Please adjust the shooting angle",vi:"Ảnh bị chói / lóa. Vui lòng điều chỉnh góc chụp."}},id_detector_error_front_side_no_faces:{code:"id_detector_error_front_side_no_faces",msg:{en:"Please capture the front side of ID card",vi:"Vui lòng chụp mặt trước của giấy tờ"}},id_detector_error_front_side_multiple_faces:{code:"id_detector_error_front_side_multiple_faces",msg:{en:"Please capture the front side of one ID card only (remove other items out of the frame)",vi:"Vui lòng chụp mặt trước 1 giấy tờ duy nhất"}},id_detector_error_back_side_has_faces:{code:"id_detector_error_back_side_has_faces",msg:{en:"Please capture the back side of ID card",vi:"Vui lòng chụp mặt sau của giấy tờ"}},id_detector_error_blur:{code:"id_detector_error_blur",msg:{en:"Blurry photo detected. Please capture again for a clearer image",vi:"Ảnh bị mờ. Vui lòng chụp lại để có ảnh rõ nét hơn"}},not_allowed_card_types:{code:"not_allowed_card_types",msg:{en:"Please use the required ID cards",vi:"Vui lòng sử dụng GTTT được yêu cầu"}},not_frontal_face:{code:"not_frontal_face",msg:{en:"Please look straight to camera.",vi:"Vui lòng nhìn thẳng vào camera."}},not_readable:{code:"CameraInUseError",msg:{vi:"Camera đang được sử dụng bởi ứng dụng/tab khác.",en:"Camera already in use by another app/tab."}},close_eye:{code:"close_eye",msg:{vi:"Vui lòng mở to mắt",en:"Open your eyes clearly"}}},cL={FRONTAL:"frontal",LEFT:"left",RIGHT:"right",UP:"up",DOWN:"down"},uL=Object.freeze({__proto__:null,ErrorDuration:{SHORT:500,LONG:1500,TERMINATE:3e3},Errors:sL,FaceDirection:cL,Mode:{ACTIVE:"active",PASSIVE:"passive",FLASH:"flash"},Messages:{REMAIN_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"}},TrackLivenessEvents:{start_camera:"user_activity.start",show_warmup:"user_activity.show",capture_up_face:"user_activity.up",capture_left_face:"user_activity.left",capture_right_face:"user_activity.right",capture_frontal_face:"user_activity.frontal",finish_capture:"user_activity",finish_load_model:"sdk.load_model",show_alert:"sdk_ui.show_alert",liveness_detection_done:"sdk_mode.liveness"},IDCardSide:{FRONT:"front",BACK:"back"},IDCardType:{VN:"vn.national_id"},IDCardMessage:{REMAINING_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"},TIMEOUT_INSTRUCTION:{en:"You need to take the picture within <%= x %> seconds.\nPlease try again.",vi:"Bạn cần hoàn thành việc chụp giấy tờ trong <%= x %> giây.\nVui lòng thử lại."}},EkycFlow:{FULL_FLOW:"FULL_FLOW",ID_CARD:"ID_CARD",FACE:"FACE"}});function lL(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function dL(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){lL(a,n,o,i,s,"next",e)}function s(e){lL(a,n,o,i,s,"throw",e)}i(void 0)}))}}function fL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pL(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 hL(e,t,r){return t&&pL(e.prototype,t),r&&pL(e,r),e}function mL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gL(){return(gL=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 vL(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 yL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vL(Object(r),!0).forEach((function(t){mL(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vL(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bL(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function CL(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,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw a}}return r}}(e,t)||kL(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 wL(e){return function(e){if(Array.isArray(e))return SL(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||kL(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 kL(e,t){if(e){if("string"==typeof e)return SL(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)?SL(e,t):void 0}}function SL(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}function EL(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=kL(e))||t&&e&&"number"==typeof e.length){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){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}var BL=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},_L=function(){this.__data__=[],this.size=0},xL=function(e,t){return e===t||e!=e&&t!=t},TL=function(e,t){for(var r=e.length;r--;)if(xL(e[r][0],t))return r;return-1},AL=Array.prototype.splice,IL=function(e){var t=this.__data__,r=TL(t,e);return!(r<0||(r==t.length-1?t.pop():AL.call(t,r,1),--this.size,0))},PL=function(e){var t=this.__data__,r=TL(t,e);return r<0?void 0:t[r][1]},RL=function(e){return TL(this.__data__,e)>-1},DL=function(e,t){var r=this.__data__,n=TL(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function NL(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])}}NL.prototype.clear=_L,NL.prototype.delete=IL,NL.prototype.get=PL,NL.prototype.has=RL,NL.prototype.set=DL;var OL=NL,LL=function(){this.__data__=new OL,this.size=0},ML=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},FL=function(e){return this.__data__.get(e)},UL=function(e){return this.__data__.has(e)},jL="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function VL(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zL(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return HL(null==t&&r.path)}},r.exports),r.exports}function qL(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}function HL(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var KL,WL="object"==By(jL)&&jL&&jL.Object===Object&&jL,QL="object"==("undefined"==typeof self?"undefined":By(self))&&self&&self.Object===Object&&self,GL=WL||QL||Function("return this")(),XL=GL.Symbol,YL=Object.prototype,$L=YL.hasOwnProperty,ZL=YL.toString,JL=XL?XL.toStringTag:void 0,eM=function(e){var t=$L.call(e,JL),r=e[JL];try{e[JL]=void 0;var n=!0}catch(e){}var o=ZL.call(e);return n&&(t?e[JL]=r:delete e[JL]),o},tM=Object.prototype.toString,rM=function(e){return tM.call(e)},nM=XL?XL.toStringTag:void 0,oM=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":nM&&nM in Object(e)?eM(e):rM(e)},aM=function(e){var t=By(e);return null!=e&&("object"==t||"function"==t)},iM=function(e){if(!aM(e))return!1;var t=oM(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},sM=GL["__core-js_shared__"],cM=(KL=/[^.]+$/.exec(sM&&sM.keys&&sM.keys.IE_PROTO||""))?"Symbol(src)_1."+KL:"",uM=function(e){return!!cM&&cM in e},lM=Function.prototype.toString,dM=function(e){if(null!=e){try{return lM.call(e)}catch(e){}try{return e+""}catch(e){}}return""},fM=/^\[object .+?Constructor\]$/,pM=Function.prototype,hM=Object.prototype,mM=pM.toString,gM=hM.hasOwnProperty,vM=RegExp("^"+mM.call(gM).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yM=function(e){return!(!aM(e)||uM(e))&&(iM(e)?vM:fM).test(dM(e))},bM=function(e,t){return null==e?void 0:e[t]},CM=function(e,t){var r=bM(e,t);return yM(r)?r:void 0},wM=CM(GL,"Map"),kM=CM(Object,"create"),SM=function(){this.__data__=kM?kM(null):{},this.size=0},EM=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},BM=Object.prototype.hasOwnProperty,_M=function(e){var t=this.__data__;if(kM){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return BM.call(t,e)?t[e]:void 0},xM=Object.prototype.hasOwnProperty,TM=function(e){var t=this.__data__;return kM?void 0!==t[e]:xM.call(t,e)},AM=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=kM&&void 0===t?"__lodash_hash_undefined__":t,this};function IM(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])}}IM.prototype.clear=SM,IM.prototype.delete=EM,IM.prototype.get=_M,IM.prototype.has=TM,IM.prototype.set=AM;var PM=IM,RM=function(){this.size=0,this.__data__={hash:new PM,map:new(wM||OL),string:new PM}},DM=function(e){var t=By(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},NM=function(e,t){var r=e.__data__;return DM(t)?r["string"==typeof t?"string":"hash"]:r.map},OM=function(e){var t=NM(this,e).delete(e);return this.size-=t?1:0,t},LM=function(e){return NM(this,e).get(e)},MM=function(e){return NM(this,e).has(e)},FM=function(e,t){var r=NM(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function UM(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])}}UM.prototype.clear=RM,UM.prototype.delete=OM,UM.prototype.get=LM,UM.prototype.has=MM,UM.prototype.set=FM;var jM=UM,VM=function(e,t){var r=this.__data__;if(r instanceof OL){var n=r.__data__;if(!wM||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new jM(n)}return r.set(e,t),this.size=r.size,this};function zM(e){var t=this.__data__=new OL(e);this.size=t.size}zM.prototype.clear=LL,zM.prototype.delete=ML,zM.prototype.get=FL,zM.prototype.has=UL,zM.prototype.set=VM;var qM=zM,HM=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e},KM=function(){try{var e=CM(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),WM=function(e,t,r){"__proto__"==t&&KM?KM(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},QM=Object.prototype.hasOwnProperty,GM=function(e,t,r){var n=e[t];QM.call(e,t)&&xL(n,r)&&(void 0!==r||t in e)||WM(e,t,r)},XM=function(e,t,r,n){var o=!r;r||(r={});for(var a=-1,i=t.length;++a<i;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?WM(r,s,c):GM(r,s,c)}return r},YM=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},$M=function(e){return null!=e&&"object"==By(e)},ZM=function(e){return $M(e)&&"[object Arguments]"==oM(e)},JM=Object.prototype,eF=JM.hasOwnProperty,tF=JM.propertyIsEnumerable,rF=ZM(function(){return arguments}())?ZM:function(e){return $M(e)&&eF.call(e,"callee")&&!tF.call(e,"callee")},nF=Array.isArray,oF=function(){return!1},aF=zL((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?GL.Buffer:void 0,a=(o?o.isBuffer:void 0)||oF;e.exports=a})),iF=/^(?:0|[1-9]\d*)$/,sF=function(e,t){var r=By(e);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&iF.test(e))&&e>-1&&e%1==0&&e<t},cF=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},uF={};uF["[object Float32Array]"]=uF["[object Float64Array]"]=uF["[object Int8Array]"]=uF["[object Int16Array]"]=uF["[object Int32Array]"]=uF["[object Uint8Array]"]=uF["[object Uint8ClampedArray]"]=uF["[object Uint16Array]"]=uF["[object Uint32Array]"]=!0,uF["[object Arguments]"]=uF["[object Array]"]=uF["[object ArrayBuffer]"]=uF["[object Boolean]"]=uF["[object DataView]"]=uF["[object Date]"]=uF["[object Error]"]=uF["[object Function]"]=uF["[object Map]"]=uF["[object Number]"]=uF["[object Object]"]=uF["[object RegExp]"]=uF["[object Set]"]=uF["[object String]"]=uF["[object WeakMap]"]=!1;var lF=function(e){return $M(e)&&cF(e.length)&&!!uF[oM(e)]},dF=function(e){return function(t){return e(t)}},fF=zL((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&WL.process,a=function(){try{return n&&n.require&&n.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a})),pF=fF&&fF.isTypedArray,hF=pF?dF(pF):lF,mF=Object.prototype.hasOwnProperty,gF=function(e,t){var r=nF(e),n=!r&&rF(e),o=!r&&!n&&aF(e),a=!r&&!n&&!o&&hF(e),i=r||n||o||a,s=i?YM(e.length,String):[],c=s.length;for(var u in e)!t&&!mF.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||sF(u,c))||s.push(u);return s},vF=Object.prototype,yF=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||vF)},bF=function(e,t){return function(r){return e(t(r))}},CF=bF(Object.keys,Object),wF=Object.prototype.hasOwnProperty,kF=function(e){if(!yF(e))return CF(e);var t=[];for(var r in Object(e))wF.call(e,r)&&"constructor"!=r&&t.push(r);return t},SF=function(e){return null!=e&&cF(e.length)&&!iM(e)},EF=function(e){return SF(e)?gF(e):kF(e)},BF=function(e,t){return e&&XM(t,EF(t),e)},_F=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},xF=Object.prototype.hasOwnProperty,TF=function(e){if(!aM(e))return _F(e);var t=yF(e),r=[];for(var n in e)("constructor"!=n||!t&&xF.call(e,n))&&r.push(n);return r},AF=function(e){return SF(e)?gF(e,!0):TF(e)},IF=function(e,t){return e&&XM(t,AF(t),e)},PF=zL((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?GL.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}})),RF=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t},DF=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r<n;){var i=e[r];t(i,r,e)&&(a[o++]=i)}return a},NF=function(){return[]},OF=Object.prototype.propertyIsEnumerable,LF=Object.getOwnPropertySymbols,MF=LF?function(e){return null==e?[]:(e=Object(e),DF(LF(e),(function(t){return OF.call(e,t)})))}:NF,FF=function(e,t){return XM(e,MF(e),t)},UF=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e},jF=bF(Object.getPrototypeOf,Object),VF=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)UF(t,MF(e)),e=jF(e);return t}:NF,zF=function(e,t){return XM(e,VF(e),t)},qF=function(e,t,r){var n=t(e);return nF(e)?n:UF(n,r(e))},HF=function(e){return qF(e,EF,MF)},KF=function(e){return qF(e,AF,VF)},WF=CM(GL,"DataView"),QF=CM(GL,"Promise"),GF=CM(GL,"Set"),XF=CM(GL,"WeakMap"),YF=dM(WF),$F=dM(wM),ZF=dM(QF),JF=dM(GF),eU=dM(XF),tU=oM;(WF&&"[object DataView]"!=tU(new WF(new ArrayBuffer(1)))||wM&&"[object Map]"!=tU(new wM)||QF&&"[object Promise]"!=tU(QF.resolve())||GF&&"[object Set]"!=tU(new GF)||XF&&"[object WeakMap]"!=tU(new XF))&&(tU=function(e){var t=oM(e),r="[object Object]"==t?e.constructor:void 0,n=r?dM(r):"";if(n)switch(n){case YF:return"[object DataView]";case $F:return"[object Map]";case ZF:return"[object Promise]";case JF:return"[object Set]";case eU:return"[object WeakMap]"}return t});var rU=tU,nU=Object.prototype.hasOwnProperty,oU=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&nU.call(e,"index")&&(r.index=e.index,r.input=e.input),r},aU=GL.Uint8Array,iU=function(e){var t=new e.constructor(e.byteLength);return new aU(t).set(new aU(e)),t},sU=function(e,t){var r=t?iU(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)},cU=/\w*$/,uU=function(e){var t=new e.constructor(e.source,cU.exec(e));return t.lastIndex=e.lastIndex,t},lU=XL?XL.prototype:void 0,dU=lU?lU.valueOf:void 0,fU=function(e){return dU?Object(dU.call(e)):{}},pU=function(e,t){var r=t?iU(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},hU=function(e,t,r){var n=e.constructor;switch(t){case"[object ArrayBuffer]":return iU(e);case"[object Boolean]":case"[object Date]":return new n(+e);case"[object DataView]":return sU(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return pU(e,r);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(e);case"[object RegExp]":return uU(e);case"[object Set]":return new n;case"[object Symbol]":return fU(e)}},mU=Object.create,gU=function(){function e(){}return function(t){if(!aM(t))return{};if(mU)return mU(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),vU=function(e){return"function"!=typeof e.constructor||yF(e)?{}:gU(jF(e))},yU=function(e){return $M(e)&&"[object Map]"==rU(e)},bU=fF&&fF.isMap,CU=bU?dF(bU):yU,wU=function(e){return $M(e)&&"[object Set]"==rU(e)},kU=fF&&fF.isSet,SU=kU?dF(kU):wU,EU={};EU["[object Arguments]"]=EU["[object Array]"]=EU["[object ArrayBuffer]"]=EU["[object DataView]"]=EU["[object Boolean]"]=EU["[object Date]"]=EU["[object Float32Array]"]=EU["[object Float64Array]"]=EU["[object Int8Array]"]=EU["[object Int16Array]"]=EU["[object Int32Array]"]=EU["[object Map]"]=EU["[object Number]"]=EU["[object Object]"]=EU["[object RegExp]"]=EU["[object Set]"]=EU["[object String]"]=EU["[object Symbol]"]=EU["[object Uint8Array]"]=EU["[object Uint8ClampedArray]"]=EU["[object Uint16Array]"]=EU["[object Uint32Array]"]=!0,EU["[object Error]"]=EU["[object Function]"]=EU["[object WeakMap]"]=!1;var BU=function e(t,r,n,o,a,i){var s,c=1&r,u=2&r,l=4&r;if(n&&(s=a?n(t,o,a,i):n(t)),void 0!==s)return s;if(!aM(t))return t;var d=nF(t);if(d){if(s=oU(t),!c)return RF(t,s)}else{var f=rU(t),p="[object Function]"==f||"[object GeneratorFunction]"==f;if(aF(t))return PF(t,c);if("[object Object]"==f||"[object Arguments]"==f||p&&!a){if(s=u||p?{}:vU(t),!c)return u?zF(t,IF(s,t)):FF(t,BF(s,t))}else{if(!EU[f])return a?t:{};s=hU(t,f,c)}}i||(i=new qM);var h=i.get(t);if(h)return h;i.set(t,s),SU(t)?t.forEach((function(o){s.add(e(o,r,n,o,t,i))})):CU(t)&&t.forEach((function(o,a){s.set(a,e(o,r,n,a,t,i))}));var m=d?void 0:(l?u?KF:HF:u?AF:EF)(t);return HM(m||t,(function(o,a){m&&(o=t[a=o]),GM(s,a,e(o,r,n,a,t,i))})),s},_U=function(e){return"symbol"==By(e)||$M(e)&&"[object Symbol]"==oM(e)},xU=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TU=/^\w*$/,AU=function(e,t){if(nF(e))return!1;var r=By(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!_U(e))||TU.test(e)||!xU.test(e)||null!=t&&e in Object(t)};function IU(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(IU.Cache||jM),r}IU.Cache=jM;var PU=IU,RU=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,DU=/\\(\\)?/g,NU=function(e){var t=PU((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(RU,(function(e,r,n,o){t.push(n?o.replace(DU,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),OU=XL?XL.prototype:void 0,LU=OU?OU.toString:void 0,MU=function e(t){if("string"==typeof t)return t;if(nF(t))return BL(t,e)+"";if(_U(t))return LU?LU.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},FU=function(e){return null==e?"":MU(e)},UU=function(e,t){return nF(e)?e:AU(e,t)?[e]:NU(FU(e))},jU=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0},VU=function(e){if("string"==typeof e||_U(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},zU=function(e,t){for(var r=0,n=(t=UU(t,e)).length;null!=e&&r<n;)e=e[VU(t[r++])];return r&&r==n?e:void 0},qU=function(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 a=Array(o);++n<o;)a[n]=e[n+t];return a},HU=function(e,t){return t.length<2?e:zU(e,qU(t,0,-1))},KU=function(e,t){return t=UU(t,e),null==(e=HU(e,t))||delete e[VU(jU(t))]},WU=Function.prototype,QU=Object.prototype,GU=WU.toString,XU=QU.hasOwnProperty,YU=GU.call(Object),$U=function(e){if(!$M(e)||"[object Object]"!=oM(e))return!1;var t=jF(e);if(null===t)return!0;var r=XU.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&GU.call(r)==YU},ZU=function(e){return $U(e)?void 0:e},JU=XL?XL.isConcatSpreadable:void 0,ej=function(e){return nF(e)||rF(e)||!!(JU&&e&&e[JU])},tj=function e(t,r,n,o,a){var i=-1,s=t.length;for(n||(n=ej),a||(a=[]);++i<s;){var c=t[i];r>0&&n(c)?r>1?e(c,r-1,n,o,a):UF(a,c):o||(a[a.length]=c)}return a},rj=function(e){return null!=e&&e.length?tj(e,1):[]},nj=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},oj=Math.max,aj=function(e,t,r){return t=oj(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=oj(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),nj(e,this,s)}},ij=function(e){return function(){return e}},sj=KM?function(e,t){return KM(e,"toString",{configurable:!0,enumerable:!1,value:ij(t),writable:!0})}:function(e){return e},cj=Date.now,uj=function(e){var t=0,r=0;return function(){var n=cj(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(sj),lj=function(e){return uj(aj(e,void 0,rj),e+"")}((function(e,t){var r={};if(null==e)return r;var n=!1;t=BL(t,(function(t){return t=UU(t,e),n||(n=t.length>1),t})),XM(e,KF(e),r),n&&(r=BU(r,7,ZU));for(var o=t.length;o--;)KU(r,t[o]);return r})),dj={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},fj=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return yL(yL({blazefaceModelUrl:"https://storage.googleapis.com/tfhub-tfjs-modules/tensorflow/tfjs-model/blazeface/1/default/1/model.json",opencvUrl:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js",idCardModelUrl:dj[t],wechatQRModelsUrl:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/",closeEyesModelUrl:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite"},lj(e,["tfScriptUrls"])),{},{tfScriptUrls:yL({tfUrl:"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.20.0/dist/tf.min.js",tfBackendWasmUrl:"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.20.0/dist/tf-backend-wasm.js",tfBackendCpuUrl:"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@3.20.0",tfBackendWebGlUrl:"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl@3.20.0",tfLiteUrl:"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite@0.0.1-alpha.8/dist/tf-tflite.min.js",blazefaceScriptUrl:"https://cdn.jsdelivr.net/npm/@tensorflow-models/blazeface@0.0.7"},null==e?void 0:e.tfScriptUrls)})};function pj(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.resourceRoot,r=e.initCustomUrls,n=void 0===r?{}:r,o=e.country,a=void 0===o?"vn":o;if(!t)return fj(n,a);var i="models/1.0.0/id_card/tflite/model-v3.tflite";return"ph"===a&&(i="models/1.0.0/id_card/tflite/ph_card_model.tflite"),yL(yL({blazefaceModelUrl:"".concat(t,"models/1.0.0/blazeface/model.json"),opencvUrl:"".concat(t,"opencv/4.6.0/cv.js"),idCardModelUrl:"".concat(t).concat(i),closeEyesModelUrl:"".concat(t,"models/1.0.0/close-eyes/closed_eye_detector.tflite"),wechatQRModelsUrl:"".concat(t,"models/1.0.0/webchat_qr/")},lj(n,["tfScriptUrls"])),{},{tfScriptUrls:yL({tfUrl:"".concat(t,"tfjs/3.20.0/tf.min.js"),tfBackendWasmUrl:"".concat(t,"tfjs/3.20.0/backend-wasm.js"),tfBackendCpuUrl:"".concat(t,"tfjs/3.20.0/backend-cpu.js"),tfBackendWebGlUrl:"".concat(t,"tfjs/3.20.0/backend-webgl.js"),tfLiteUrl:"".concat(t,"tflite/0.0.1-alpha.8/tflite.min.js"),blazefaceScriptUrl:"".concat(t,"blazeface/0.0.7/bf.js")},null==n?void 0:n.tfScriptUrls)})}var hj=xC.createContext();function mj(e){var t=e.value,r=e.children,n=yL({},t),o=n.customUrls,a=n.resourceRoot;return a&&(n.customUrls=pj({resourceRoot:a,initCustomUrls:o})),xC.createElement(hj.Provider,{value:n},r)}function gj(){var e=xC.useContext(hj);if(void 0===e)throw new Error("useSDKSettings must be used within a SDKSettingsProvider");return e}mj.propTypes={value:xw.shape({lang:xw.string,assetRoot:xw.string,apiClient:xw.shape({}),customUrls:xw.shape({}),resourceRoot:xw.string}).isRequired,children:xw.node.isRequired};var vj,yj=Object.freeze({__proto__:null,SDKSettingsProvider:mj,useSDKSettings:gj}),bj=qL(Object.freeze({__proto__:null,default:{}})),Cj=VL(zL((function(e,t){!function(e,t){t=t&&t.hasOwnProperty("default")?t.default:t;var r=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/read_id_card_info_sync",e,t)},e}(),n=function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};
|
7
|
+
/*! *****************************************************************************
|
8
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
9
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
10
|
+
this file except in compliance with the License. You may obtain a copy of the
|
11
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
|
13
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
15
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
16
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
17
|
+
|
18
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
19
|
+
and limitations under the License.
|
20
|
+
***************************************************************************** */function o(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==("undefined"==typeof Reflect?"undefined":By(Reflect))&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function a(e,t){if("object"==("undefined"==typeof Reflect?"undefined":By(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function i(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}c((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}var c=function(){function e(e){this.httpClient=e}return e.prototype.uploadImage=function(e){return this.httpClient.postFormData("/v1/images",e)},e.prototype.request=function(e){var t="application/pdf"===e.file.type;return this.httpClient.postFormData(t?"/v1/files":"/v1/images",e)},e.prototype.requestWithHeaders=function(e,t){return this.httpClient.postFormData("/v1/images",e,t)},e.prototype.download=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,this.httpClient.downloadFile("/v1/images/"+e)];case 1:return t=r.sent(),[4,URL.createObjectURL(t)];case 2:return[2,r.sent()]}}))}))},e.prototype.updateMetadata=function(e,t){return this.httpClient.patch("/v1/images/"+e,t)},e}(),u=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/files",e,t)},e.prototype.uploadFile=function(e){return this.httpClient.postFormData("/v1/files",e)},e.prototype.requestWithHeaders=function(e,t){return this.httpClient.postFormData("/v1/files",e,t)},e}(),l=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/compare_faces_sync",e,t)},e}(),d=function(){function e(e){this.httpClient=e}return e.prototype.getClientSettings=function(){return this.httpClient.get("/v1/client_settings")},e.prototype.request=function(){return this.httpClient.get("/v1/client_settings")},e}(),f=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/verify_face_liveness_sync",e,t)},e}(),p=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/verify_id_card_sanity_sync",e,t)},e}(),h=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/verify_portrait_sanity_sync",e,t)},e}(),m=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/detect_id_card_tampering_sync",e,t)},e.prototype.requestWithAuthHeaders=function(e,t){return this.httpClient.post("/v1/detect_id_card_tampering_sync",e,t)},e}(),g=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/search_faces_sync",e,t)},e.prototype.indexFaces=function(e,t){return this.httpClient.post("/v1/index_faces_sync",e,t)},e.prototype.deleteFaces=function(e,t){return this.httpClient.post("/v1/delete_faces",e,t)},e.prototype.downloadFaceImage=function(e){return i(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,this.httpClient.downloadFile("/v1/face_images/"+e)];case 1:return t=r.sent(),[2,URL.createObjectURL(t)]}}))}))},e}(),v=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.postFormData("/v1/convert_pdf_sync",e,t)},e}(),y=function(){function e(e){this.httpClient=e}return e.prototype.request=function(e,t){return this.httpClient.post("/v1/ekyc_pdf",e,t)},e}(),b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==jL?jL:"undefined"!=typeof self?self:{};function C(e,t){return e(t={exports:{}},t.exports),t.exports}var w=C((function(e){var t,r;t=b,r=function(){function e(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var r=e.shift();e[0]=r+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<e.length;n++){var o=e[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=n<e.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),t.push(o))}var a=t.join("/"),i=(a=a.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return i.shift()+(i.length>0?"?":"")+i.join("&")}return function(){return e("object"==By(arguments[0])?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=r():t.urljoin=r()}));function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var S=function(e,t,r,n){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(t);var i=1e3;n&&"number"==typeof n.maxKeys&&(i=n.maxKeys);var s=e.length;i>0&&s>i&&(s=i);for(var c=0;c<s;++c){var u,l,d,f,p=e[c].replace(a,"%20"),h=p.indexOf(r);h>=0?(u=p.substr(0,h),l=p.substr(h+1)):(u=p,l=""),d=decodeURIComponent(u),f=decodeURIComponent(l),k(o,d)?Array.isArray(o[d])?o[d].push(f):o[d]=[o[d],f]:o[d]=f}return o},E=function(e){switch(By(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},B=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==By(e)?Object.keys(e).map((function(n){var o=encodeURIComponent(E(n))+r;return Array.isArray(e[n])?e[n].map((function(e){return o+encodeURIComponent(E(e))})).join(t):o+encodeURIComponent(E(e[n]))})).join(t):n?encodeURIComponent(E(n))+r+encodeURIComponent(E(e)):""},_=C((function(e,t){t.decode=t.parse=S,t.encode=t.stringify=B})),x=(_.decode,_.parse,_.encode,_.stringify),T=function(){function e(e){this.authorizer=e.authorizer,this.domain=e.domain,this.onError=e.onError,this.configHeaders=e.headers}return e.prototype.get=function(e,t,r){var n=new URL(this.resolveUrl(e));return t&&(n.search=x(t)),this.request(n.toString(),{requestPath:e,method:"GET",headers:r})},e.prototype.post=function(e,t,r){var o=this.resolveUrl(e);return this.request(o,{requestPath:e,method:"POST",body:JSON.stringify(t),headers:n({"Content-Type":"application/json"},r)})},e.prototype.postFormData=function(e,t,r){var n,o=t instanceof FormData?t:(n=t,Object.entries(n).reduce((function(e,t){var r=t[0],n=t[1];return Array.isArray(n)?n.forEach((function(t,o){return e.append(r+"["+o+"]",n)})):!(n instanceof Object)||n instanceof File||n instanceof Date||n instanceof Blob?e.append(r,n):Object.entries(n).forEach((function(t,o){return e.append(r+"["+o+"]",n[o])})),e}),new FormData)),a=this.resolveUrl(e);return this.request(a,{requestPath:e,method:"POST",body:o,headers:r})},e.prototype.patch=function(e,t,r){var o=this.resolveUrl(e);return this.request(o,{requestPath:e,method:"PATCH",body:JSON.stringify(t),headers:n({"Content-Type":"application/json"},r)})},e.prototype.delete=function(e,t,r){var o=this.resolveUrl(e);return this.request(o,{requestPath:e,method:"DELETE",body:JSON.stringify(t),headers:n({"Content-Type":"application/json"},r)})},e.prototype.downloadFile=function(e){var t=this.resolveUrl(e);return this.request(t,{requestPath:e,method:"GET"},"blob")},e.prototype.request=function(e,t,r){return void 0===r&&(r="json"),i(this,void 0,void 0,(function(){var o,a,i,c;return s(this,(function(s){switch(s.label){case 0:return o={},a={},this.authorizer&&(o=this.authorizer.getHeaders(t)),this.configHeaders&&(a=this.configHeaders),t.headers=n(n(n({},t.headers),o),a),[4,fetch(e,t)];case 1:return i=s.sent(),[4,"blob"===r?i.blob():i.json()];case 2:if((c=s.sent()).errors&&this.onError)throw this.onError(c.errors),c;return[2,c]}}))}))},e.prototype.resolveUrl=function(e){return w(this.domain,e)},e}(),A=function(){function e(e){this.mocks=e}return e.prototype.get=function(e,t){return this.findInMocks(e,t)},e.prototype.post=function(e,t){return this.findInMocks(e)},e.prototype.postFormData=function(e,t){return this.findInMocks(e)},e.prototype.patch=function(e,t){return this.findInMocks(e)},e.prototype.delete=function(e,t){return this.findInMocks(e)},e.prototype.downloadFile=function(e){return this.findInMocks(e)},e.prototype.resolveUrl=function(e){return this.mocks.resolveUrl?this.mocks.resolveUrl(e):e},e.prototype.findInMocks=function(e,t){return i(this,void 0,void 0,(function(){return s(this,(function(r){return this.mocks[e]?"function"==typeof this.mocks[e]?[2,Promise.resolve(this.mocks[e](t))]:[2,Promise.resolve(this.mocks[e])]:[2,Promise.reject(new Error(e+" is not presented in mocks"))]}))}))},e}(),I=C((function(e,t){var r;e.exports=r=r||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},o=n.lib={},a=o.Base={extend:function(e){var t=r(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)}},i=o.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).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 a=0;a<o;a++){var i=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=i<<24-(n+a)%4*8}else for(a=0;a<o;a+=4)t[n+a>>>2]=r[a>>>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=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],o=function(t){t=t;var r=987654321,n=4294967295;return function(){var o=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return o/=4294967296,(o+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var s=o(4294967296*(r||e.random()));r=987654071*s(),n.push(4294967296*s()|0)}return new i.init(n,t)}}),s=n.enc={},c=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var a=t[o>>>2]>>>24-o%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).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 i.init(r,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var a=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(a))}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 i.init(r,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new i.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*c,o);if(c){for(var l=0;l<c;l+=a)this._doProcessBlock(n,l);var d=n.splice(0,c);r.sigBytes-=u}return new i.init(d,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),f=(o.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.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 f.HMAC.init(e,r).finalize(t)}}}),n.algo={});return n}(Math)})),P=C((function(e,t){var r,n,o;e.exports=(n=(r=o=I).lib.WordArray,r.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],a=0;a<r;a+=3)for(var i=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<r;s++)o.push(n.charAt(i>>>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 a=0;a<r.length;a++)o[r.charCodeAt(a)]=a}var i=r.charAt(64);if(i){var s=e.indexOf(i);-1!==s&&(t=s)}return function(e,t,r){for(var o=[],a=0,i=0;i<t;i++)if(i%4){var s=r[e.charCodeAt(i-1)]<<i%4*2,c=r[e.charCodeAt(i)]>>>6-i%4*2;o[a>>>2]|=(s|c)<<24-a%4*8,a++}return n.create(o,a)}(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},o.enc.Base64)})),R=(C((function(e,t){var r;e.exports=(r=I,function(e){var t=r,n=t.lib,o=n.WordArray,a=n.Hasher,i=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=i.SHA256=a.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],a=r[2],i=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&a^o&a,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),C=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=i+C|0,i=a,a=o,o=n,n=C+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+a|0,r[3]=r[3]+i|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=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(l),t.HmacSHA256=a._createHmacHelper(l)}(Math),r.SHA256)})),C((function(e,t){var r,n,o;e.exports=(n=(r=I).lib.Base,o=r.enc.Utf8,void(r.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),i=this._iKey=t.clone(),s=a.words,c=i.words,u=0;u<r;u++)s[u]^=1549556828,c[u]^=909522486;a.sigBytes=i.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))})),C((function(e,t){e.exports=I.HmacSHA256}))),D=function(){function e(e,t){this.accessKey=e,this.keySecret=t}return e.prototype.getHeaders=function(e){var t=function(e){function t(e){return e<10?"0"+e:e}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+(0===(r=e.getTimezoneOffset())?"Z":(n=r>0?"-":"+",r=Math.abs(r),n+t(Math.floor(r/60))+":"+t(r%60)));var r,n}(new Date);return{Authorization:this.generateAuthorization(e.requestPath,e.method,t),"X-TV-Timestamp":t}},e.prototype.generateAuthorization=function(e,t,r){var n=this.computeStringToSign(e,t,r),o=P.stringify(this.computeSignature(n));return this.formatAuthToken("TV",o)},e.prototype.formatAuthToken=function(e,t){return e+" "+this.accessKey+":"+t},e.prototype.computeStringToSign=function(e,t,r){return t+"\n"+e+"\n"+r},e.prototype.computeSignature=function(e){return R(e,this.keySecret)},e}();function N(e){switch(e){case"testing":return"https://tv-testing.trustingsocial.com/api";case"staging":return"https://tv-staging.trustingsocial.com/api";case"production":return"https://vn-vision.trustingsocial.com/api";default:return e}}function O(e,t,r,n){void 0===r&&(r="production");var o=(void 0===n?{}:n).headers,a=new D(e,t),i=N(r);return new T({authorizer:a,domain:i,headers:o})}var L=function(){function e(e){void 0===e&&(e="production");var t=new T({domain:N(e)});this.imagesService=new c(t),this.detectIDTamperingService=new m(t)}return e.prototype.uploadImage=function(e,t){return this.imagesService.requestWithHeaders(e,t)},e.prototype.detectTampering=function(e,t){return this.detectIDTamperingService.requestWithAuthHeaders(e,t)},e}();function M(e){var t=e.headerIndex;return function(e,r,o){var a=o.value,c=n({},o);return c.value=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return i(this,void 0,void 0,(function(){var r,o,i,c;return s(this,(function(s){switch(s.label){case 0:return this.transactionEnabled?[4,this.transactionManager.begin()]:[3,4];case 1:return r=s.sent(),o=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,o++)n[o]=a[i];return n}(e),(i=n({},o[t]))["X-TV-Transaction"]=r,o[t]=i,[4,a.apply(this,o)];case 2:return c=s.sent(),[4,this.transactionManager.end()];case 3:return s.sent(),[2,c];case 4:return[4,a.apply(this,e)];case 5:return[2,s.sent()]}}))}))},c}}function F(e){return void 0===e&&(e={encryptedField:"data"}),function(t,r,o){var a=o.value,c=n({},o);return c.value=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return i(this,void 0,void 0,(function(){var r,n;return s(this,(function(o){switch(o.label){case 0:return[4,a.apply(this,t)];case 1:return r=o.sent(),this.encryptionEnabled&&"string"==typeof r[e.encryptedField]?(n=this.encryptionService.decrypt(r[e.encryptedField],{transactionID:this.transactionManager.currentTransactionID}),[2,JSON.parse(n)]):[2,r]}}))}))},c}}var U=function(){function e(e){this.httpClient=e,this.transactionID="",this.totalTransactions=0,this.currentTransaction=0}return Object.defineProperty(e.prototype,"currentTransactionID",{get:function(){return this.transactionID},enumerable:!0,configurable:!0}),e.prototype.begin=function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.totalTransactions++,[4,new Promise((function(t,n){var o=window.performance.now(),a=setInterval((function(){e===r.currentTransaction&&(clearInterval(a),t(!0)),window.performance.now()-o>=3e3&&(clearInterval(a),n(new Error("Transaction timeout")))}),100)}))];case 1:return n.sent(),[4,this.httpClient.post("/v1/transactions",{})];case 2:return t=n.sent().data,this.transactionID=t.id,[2,t.id]}}))}))},e.prototype.end=function(){return i(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.httpClient.post("/v1/transactions/"+this.transactionID+"/finish")];case 1:return e=t.sent(),this.transactionID="",this.currentTransaction++,[2,e]}}))}))},e}(),j={options:{usePureJavaScript:!1}},V={},z=V,q={};V.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var o=0,a=t.length,i=t.charAt(0),s=[0];for(o=0;o<e.length;++o){for(var c=0,u=e[o];c<s.length;++c)u+=s[c]<<8,s[c]=u%a,u=u/a|0;for(;u>0;)s.push(u%a),u=u/a|0}for(o=0;0===e[o]&&o<e.length-1;++o)n+=i;for(o=s.length-1;o>=0;--o)n+=t[s[o]]}else n=function(e,t){var r=0,n=t.length,o=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var i=0,s=e.at(r);i<a.length;++i)s+=a[i]<<8,a[i]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var c="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)c+=o;for(r=a.length-1;r>=0;--r)c+=t[a[r]];return c}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},V.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=q[t];if(!r){r=q[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n}e=e.replace(/\s/g,"");var o=t.length,a=t.charAt(0),i=[0];for(n=0;n<e.length;n++){var s=r[e.charCodeAt(n)];if(void 0===s)return;for(var c=0,u=s;c<i.length;++c)u+=i[c]*o,i[c]=255&u,u>>=8;for(;u>0;)i.push(255&u),u>>=8}for(var l=0;e[l]===a&&l<e.length-1;++l)i.push(0);return"undefined"!=typeof Buffer?Buffer.from(i.reverse()):new Uint8Array(i.reverse())},C((function(e){var t=e.exports=j.util=j.util||{};function r(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function n(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(t.isArrayBuffer(e)||t.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var r=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,r)}catch(e){for(var o=0;o<r.length;++o)this.putByte(r[o])}}else(e instanceof n||"object"==By(e)&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return t.nextTick=process.nextTick,void("function"==typeof setImmediate?t.setImmediate=setImmediate:t.setImmediate=t.nextTick);if("function"==typeof setImmediate)return t.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(t.nextTick=function(e){return setImmediate(e)});if(t.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",r=[];t.setImmediate=function(t){r.push(t),1===r.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(t){if(t.source===window&&t.data===e){t.stopPropagation();var n=r.slice();r.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var n=Date.now(),o=!0,a=document.createElement("div");r=[],new MutationObserver((function(){var e=r.slice();r.length=0,e.forEach((function(e){e()}))})).observe(a,{attributes:!0});var i=t.setImmediate;t.setImmediate=function(e){Date.now()-n>15?(n=Date.now(),i(e)):(r.push(e),1===r.length&&a.setAttribute("a",o=!o))}}t.nextTick=t.setImmediate}(),t.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,t.globalScope=t.isNodejs?b:"undefined"==typeof self?window:self,t.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},t.isArrayBufferView=function(e){return e&&t.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},t.ByteBuffer=n,t.ByteStringBuffer=n,t.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},t.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},t.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},t.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},t.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},t.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},t.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(t.encodeUtf8(e))},t.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},t.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},t.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},t.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},t.ByteStringBuffer.prototype.putInt=function(e,t){r(t);var n="";do{t-=8,n+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(n)},t.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},t.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},t.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},t.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},t.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},t.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},t.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},t.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},t.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},t.ByteStringBuffer.prototype.getInt=function(e){r(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},t.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},t.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},t.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},t.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},t.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},t.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},t.ByteStringBuffer.prototype.copy=function(){var e=t.createBuffer(this.data);return e.read=this.read,e},t.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},t.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},t.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},t.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},t.ByteStringBuffer.prototype.toString=function(){return t.decodeUtf8(this.bytes())},t.DataBuffer=function(e,r){r=r||{},this.read=r.readOffset||0,this.growSize=r.growSize||1024;var n=t.isArrayBuffer(e),o=t.isArrayBufferView(e);if(n||o)return this.data=n?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in r?r.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in r&&(this.write=r.writeOffset)},t.DataBuffer.prototype.length=function(){return this.write-this.read},t.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},t.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},t.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},t.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},t.DataBuffer.prototype.putBytes=function(e,r){if(t.isArrayBufferView(e)){var n=(o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-o.byteOffset;return this.accommodate(n),new Uint8Array(this.data.buffer,this.write).set(o),this.write+=n,this}if(t.isArrayBuffer(e)){var o=new Uint8Array(e);return this.accommodate(o.byteLength),new Uint8Array(this.data.buffer).set(o,this.write),this.write+=o.byteLength,this}if(e instanceof t.DataBuffer||"object"==By(e)&&"number"==typeof e.read&&"number"==typeof e.write&&t.isArrayBufferView(e.data))return o=new Uint8Array(e.data.byteLength,e.read,e.length()),this.accommodate(o.byteLength),new Uint8Array(e.data.byteLength,this.write).set(o),this.write+=o.byteLength,this;if(e instanceof t.ByteStringBuffer&&(e=e.data,r="binary"),r=r||"binary","string"==typeof e){var a;if("hex"===r)return this.accommodate(Math.ceil(e.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.hex.decode(e,a,this.write),this;if("base64"===r)return this.accommodate(3*Math.ceil(e.length/4)),a=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.base64.decode(e,a,this.write),this;if("utf8"===r&&(e=t.encodeUtf8(e),r="binary"),"binary"===r||"raw"===r)return this.accommodate(e.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=t.binary.raw.decode(a),this;if("utf16"===r)return this.accommodate(2*e.length),a=new Uint16Array(this.data.buffer,this.write),this.write+=t.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+r)}throw Error("Invalid parameter: "+e)},t.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},t.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},t.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},t.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},t.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},t.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},t.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},t.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},t.DataBuffer.prototype.putInt=function(e,t){r(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},t.DataBuffer.prototype.putSignedInt=function(e,t){return r(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},t.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},t.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},t.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},t.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},t.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},t.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},t.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},t.DataBuffer.prototype.getInt=function(e){r(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},t.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},t.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},t.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},t.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},t.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},t.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},t.DataBuffer.prototype.copy=function(){return new t.DataBuffer(this)},t.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},t.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},t.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},t.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},t.DataBuffer.prototype.toString=function(e){var r=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return t.binary.raw.encode(r);if("hex"===e)return t.binary.hex.encode(r);if("base64"===e)return t.binary.base64.encode(r);if("utf8"===e)return t.text.utf8.decode(r);if("utf16"===e)return t.text.utf16.decode(r);throw new Error("Invalid encoding: "+e)},t.createBuffer=function(e,r){return r=r||"raw",void 0!==e&&"utf8"===r&&(e=t.encodeUtf8(e)),new t.ByteBuffer(e)},t.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},t.xorBytes=function(e,t,r){for(var n="",o="",a="",i=0,s=0;r>0;--r,++i)o=e.charCodeAt(i)^t.charCodeAt(i),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(o),++s;return n+a},t.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},t.bytesToHex=function(e){return t.createBuffer(e).toHex()},t.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],i="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";t.encode64=function(e,t){for(var r,n,a,i="",s="",c=0;c<e.length;)r=e.charCodeAt(c++),n=e.charCodeAt(c++),a=e.charCodeAt(c++),i+=o.charAt(r>>2),i+=o.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=o.charAt((15&n)<<2|a>>6),i+=isNaN(a)?"=":o.charAt(63&a)),t&&i.length>t&&(s+=i.substr(0,t)+"\r\n",i=i.substr(t));return s+i},t.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,o,i="",s=0;s<e.length;)t=a[e.charCodeAt(s++)-43],r=a[e.charCodeAt(s++)-43],n=a[e.charCodeAt(s++)-43],o=a[e.charCodeAt(s++)-43],i+=String.fromCharCode(t<<2|r>>4),64!==n&&(i+=String.fromCharCode((15&r)<<4|n>>2),64!==o&&(i+=String.fromCharCode((3&n)<<6|o)));return i},t.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},t.decodeUtf8=function(e){return decodeURIComponent(escape(e))},t.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:z.encode,decode:z.decode}},t.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},t.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var o=r=r||0,a=0;a<e.length;++a)n[o++]=e.charCodeAt(a);return t?o-r:n},t.binary.hex.encode=t.bytesToHex,t.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var o=0,a=r=r||0;for(1&e.length&&(o=1,n[a++]=parseInt(e[0],16));o<e.length;o+=2)n[a++]=parseInt(e.substr(o,2),16);return t?a-r:n},t.binary.base64.encode=function(e,t){for(var r,n,a,i="",s="",c=0;c<e.byteLength;)r=e[c++],n=e[c++],a=e[c++],i+=o.charAt(r>>2),i+=o.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=o.charAt((15&n)<<2|a>>6),i+=isNaN(a)?"=":o.charAt(63&a)),t&&i.length>t&&(s+=i.substr(0,t)+"\r\n",i=i.substr(t));return s+i},t.binary.base64.decode=function(e,t,r){var n,o,i,s,c=t;c||(c=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u<e.length;)n=a[e.charCodeAt(u++)-43],o=a[e.charCodeAt(u++)-43],i=a[e.charCodeAt(u++)-43],s=a[e.charCodeAt(u++)-43],c[l++]=n<<2|o>>4,64!==i&&(c[l++]=(15&o)<<4|i>>2,64!==s&&(c[l++]=(3&i)<<6|s));return t?l-r:c.subarray(0,l)},t.binary.base58.encode=function(e,r){return t.binary.baseN.encode(e,i,r)},t.binary.base58.decode=function(e,r){return t.binary.baseN.decode(e,i,r)},t.text={utf8:{},utf16:{}},t.text.utf8.encode=function(e,r,n){e=t.encodeUtf8(e);var o=r;o||(o=new Uint8Array(e.length));for(var a=n=n||0,i=0;i<e.length;++i)o[a++]=e.charCodeAt(i);return r?a-n:o},t.text.utf8.decode=function(e){return t.decodeUtf8(String.fromCharCode.apply(null,e))},t.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var o=new Uint16Array(n.buffer),a=r=r||0,i=r,s=0;s<e.length;++s)o[i++]=e.charCodeAt(s),a+=2;return t?a-r:n},t.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},t.deflate=function(e,r,n){if(r=t.decode64(e.deflate(t.encode64(r)).rval),n){var o=2;32&r.charCodeAt(1)&&(o=6),r=r.substring(o,r.length-4)}return r},t.inflate=function(e,r,n){var o=e.inflate(t.encode64(r)).rval;return null===o?null:t.decode64(o)};var s=function(e,r,n){if(!e)throw new Error("WebStorage not available.");var o;if(null===n?o=e.removeItem(r):(n=t.encode64(JSON.stringify(n)),o=e.setItem(r,n)),void 0!==o&&!0!==o.rval){var a=new Error(o.error.message);throw a.id=o.error.id,a.name=o.error.name,a}},c=function(e,r){if(!e)throw new Error("WebStorage not available.");var n=e.getItem(r);if(e.init)if(null===n.rval){if(n.error){var o=new Error(n.error.message);throw o.id=n.error.id,o.name=n.error.name,o}n=null}else n=n.rval;return null!==n&&(n=JSON.parse(t.decode64(n))),n},u=function(e,t,r,n){var o=c(e,t);null===o&&(o={}),o[r]=n,s(e,t,o)},l=function(e,t,r){var n=c(e,t);return null!==n&&(n=r in n?n[r]:null),n},d=function(e,t,r){var n=c(e,t);if(null!==n&&r in n){delete n[r];var o=!0;for(var a in n){o=!1;break}o&&(n=null),s(e,t,n)}},f=function(e,t){s(e,t,null)},p=function(e,t,r){var n,o=null;void 0===r&&(r=["web","flash"]);var a=!1,i=null;for(var s in r){n=r[s];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");o=e.apply(this,t),a="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,o=e.apply(this,t),a=!0)}catch(e){i=e}if(a)break}if(!a)throw i;return o};t.setItem=function(e,t,r,n,o){p(u,arguments,o)},t.getItem=function(e,t,r,n){return p(l,arguments,n)},t.removeItem=function(e,t,r,n){p(d,arguments,n)},t.clearItems=function(e,t,r){p(f,arguments,r)},t.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var h=null;t.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var o,a,i=r[n].indexOf("=");i>0?(o=r[n].substring(0,i),a=r[n].substring(i+1)):(o=r[n],a=null),o in t||(t[o]=[]),o in Object.prototype||null===a||t[o].push(unescape(a))}return t};return void 0===e?(null===h&&(h="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=h):t=r(e),t},t.parseFragment=function(e){var r=e,n="",o=e.indexOf("?");o>0&&(r=e.substring(0,o),n=e.substring(o+1));var a=r.split("/");return a.length>0&&""===a[0]&&a.shift(),{pathString:r,queryString:n,path:a,query:""===n?{}:t.getQueryVariables(n)}},t.makeRequest=function(e){var r=t.parseFragment(e),n={path:r.pathString,query:r.queryString,getPath:function(e){return void 0===e?r.path:r.path[e]},getQuery:function(e,t){var n;return void 0===e?n=r.query:(n=r.query[e])&&void 0!==t&&(n=n[t]),n},getQueryLast:function(e,t){var r=n.getQuery(e);return r?r[r.length-1]:t}};return n},t.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},t.setPath=function(e,t,r){if("object"==By(e)&&null!==e)for(var n=0,o=t.length;n<o;){var a=t[n++];if(n==o)e[a]=r;else{var i=a in e;(!i||i&&"object"!=By(e[a])||i&&null===e[a])&&(e[a]={}),e=e[a]}}},t.getPath=function(e,t,r){for(var n=0,o=t.length,a=!0;a&&n<o&&"object"==By(e)&&null!==e;){var i=t[n++];(a=i in e)&&(e=e[i])}return a?e:r},t.deletePath=function(e,t){if("object"==By(e)&&null!==e)for(var r=0,n=t.length;r<n;){var o=t[r++];if(r==n)delete e[o];else{if(!(o in e)||"object"!=By(e[o])||null===e[o])break;e=e[o]}}},t.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},t.format=function(e){for(var t,r,n=/%./g,o=0,a=[],i=0;t=n.exec(e);){(r=e.substring(i,n.lastIndex-2)).length>0&&a.push(r),i=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":o<arguments.length?a.push(arguments[1+o++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(i)),a.join("")},t.formatNumber=function(e,t,r,n){var o=e,a=isNaN(t=Math.abs(t))?2:t,i=void 0===r?",":r,s=void 0===n?".":n,c=o<0?"-":"",u=parseInt(o=Math.abs(+o||0).toFixed(a),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+s:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?i+Math.abs(o-u).toFixed(a).slice(2):"")},t.formatSize=function(e){return e>=1073741824?t.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?t.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?t.formatNumber(e/1024,0)+" KiB":t.formatNumber(e,0)+" bytes"},t.bytesFromIP=function(e){return-1!==e.indexOf(".")?t.bytesFromIPv4(e):-1!==e.indexOf(":")?t.bytesFromIPv6(e):null},t.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var r=t.createBuffer(),n=0;n<e.length;++n){var o=parseInt(e[n],10);if(isNaN(o))return null;r.putByte(o)}return r.getBytes()},t.bytesFromIPv6=function(e){for(var r=0,n=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++r,!0}))).length+r),o=t.createBuffer(),a=0;a<8;++a)if(e[a]&&0!==e[a].length){var i=t.hexToBytes(e[a]);i.length<2&&o.putByte(0),o.putBytes(i)}else o.fillWithByte(0,n),n=0;return o.getBytes()},t.bytesToIP=function(e){return 4===e.length?t.bytesToIPv4(e):16===e.length?t.bytesToIPv6(e):null},t.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},t.bytesToIPv6=function(e){if(16!==e.length)return null;for(var r=[],n=[],o=0,a=0;a<e.length;a+=2){for(var i=t.bytesToHex(e[a]+e[a+1]);"0"===i[0]&&"0"!==i;)i=i.substr(1);if("0"===i){var s=n[n.length-1],c=r.length;s&&c===s.end+1?(s.end=c,s.end-s.start>n[o].end-n[o].start&&(o=n.length-1)):n.push({start:c,end:c})}r.push(i)}if(n.length>0){var u=n[o];u.end-u.start>0&&(r.splice(u.start,u.end-u.start+1,""),0===u.start&&r.unshift(""),7===u.end&&r.push(""))}return r.join(":")},t.estimateCores=function(e,r){if("function"==typeof e&&(r=e,e={}),e=e||{},"cores"in t&&!e.update)return r(null,t.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return t.cores=navigator.hardwareConcurrency,r(null,t.cores);if("undefined"==typeof Worker)return t.cores=1,r(null,t.cores);if("undefined"==typeof Blob)return t.cores=2,r(null,t.cores);var n=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){var t=Date.now(),r=t+4;self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(o,a,i){if(0===a){var s=Math.floor(o.reduce((function(e,t){return e+t}),0)/o.length);return t.cores=Math.max(1,s),URL.revokeObjectURL(n),r(null,t.cores)}!function(e,t){for(var r=[],o=[],a=0;a<e;++a){var i=new Worker(n);i.addEventListener("message",(function(n){if(o.push(n.data),o.length===e){for(var a=0;a<e;++a)r[a].terminate();t(null,o)}})),r.push(i)}for(a=0;a<e;++a)r[a].postMessage(a)}(i,(function(t,r){o.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var o=t[n],a=r[n]=[],i=0;i<e;++i)if(n!==i){var s=t[i];(o.st>s.st&&o.st<s.et||s.st>o.st&&s.st<o.et)&&a.push(i)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(i,r)),e(o,a-1,i)}))}([],5,16)}})),j.cipher=j.cipher||{},j.cipher.algorithms=j.cipher.algorithms||{},j.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=j.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new j.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},j.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=j.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new j.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},j.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),j.cipher.algorithms[e]=t},j.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in j.cipher.algorithms?j.cipher.algorithms[e]:null};var H=j.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};function K(e,t){j.cipher.registerAlgorithm(e,(function(){return new j.aes.Algorithm(e,t)}))}H.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=j.util.createBuffer(),this.output=e.output||j.util.createBuffer(),this.mode.start(t)},H.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},H.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))},C((function(e){j.cipher=j.cipher||{};var t=e.exports=j.cipher.modes=j.cipher.modes||{};function r(e,t){if("string"==typeof e&&(e=j.util.createBuffer(e)),j.util.isArray(e)&&e.length>4){var r=e;e=j.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!j.util.isArray(e)){var o=[],a=t/4;for(n=0;n<a;++n)o.push(e.getInt32());e=o}return e}function n(e){e[e.length-1]=e[e.length-1]+1&4294967295}function o(e){return[e/4294967296|0,4294967295&e]}t.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.ecb.prototype.start=function(e){},t.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},t.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},t.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},t.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},t.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},t.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},t.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},t.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},t.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},t.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},t.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=j.util.createBuffer(),this._partialBytes=0},t.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o<this._ints;++o)this._inBlock[o]=e.getInt32()^this._outBlock[o],t.putInt32(this._inBlock[o]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),o=0;o<this._ints;++o)this._partialBlock[o]=e.getInt32()^this._outBlock[o],this._partialOutput.putInt32(this._partialBlock[o]);if(a>0)e.read-=this.blockSize;else for(o=0;o<this._ints;++o)this._inBlock[o]=this._partialBlock[o];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},t.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o<this._ints;++o)this._inBlock[o]=e.getInt32(),t.putInt32(this._inBlock[o]^this._outBlock[o]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),o=0;o<this._ints;++o)this._partialBlock[o]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[o]^this._outBlock[o]);if(a>0)e.read-=this.blockSize;else for(o=0;o<this._ints;++o)this._inBlock[o]=this._partialBlock[o];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},t.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=j.util.createBuffer(),this._partialBytes=0},t.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o<this._ints;++o)t.putInt32(e.getInt32()^this._outBlock[o]),this._inBlock[o]=this._outBlock[o];else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),o=0;o<this._ints;++o)this._partialOutput.putInt32(e.getInt32()^this._outBlock[o]);if(a>0)e.read-=this.blockSize;else for(o=0;o<this._ints;++o)this._inBlock[o]=this._outBlock[o];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},t.ofb.prototype.decrypt=t.ofb.prototype.encrypt,t.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=j.util.createBuffer(),this._partialBytes=0},t.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=r(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},t.ctr.prototype.encrypt=function(e,t,r){var o=e.length();if(0===o)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&o>=this.blockSize)for(var a=0;a<this._ints;++a)t.putInt32(e.getInt32()^this._outBlock[a]);else{var i=(this.blockSize-o)%this.blockSize;for(i>0&&(i=this.blockSize-i),this._partialOutput.clear(),a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(i>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=0}n(this._inBlock)},t.ctr.prototype.decrypt=t.ctr.prototype.encrypt,t.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=j.util.createBuffer(),this._partialBytes=0,this._R=3774873600},t.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=j.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?j.util.createBuffer(e.additionalData):j.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=j.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var a=r.length();if(12===a)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*a)))}this._inBlock=this._j0.slice(0),n(this._inBlock),this._partialBytes=0,t=j.util.createBuffer(t),this._aDataLength=o(8*t.length());var i=t.length()%this.blockSize;for(i&&t.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},t.gcm.prototype.encrypt=function(e,t,r){var o=e.length();if(0===o)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&o>=this.blockSize){for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^=e.getInt32());this._cipherLength+=this.blockSize}else{var i=(this.blockSize-o)%this.blockSize;for(i>0&&(i=this.blockSize-i),this._partialOutput.clear(),a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(i<=0||r){if(r){var s=o%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(a=0;a<this._ints;++a)this._outBlock[a]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),n(this._inBlock)},t.gcm.prototype.decrypt=function(e,t,r){var o=e.length();if(o<this.blockSize&&!(r&&o>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),n(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^this._hashBlock[a]);o<this.blockSize?this._cipherLength+=o%this.blockSize:this._cipherLength+=this.blockSize},t.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=j.util.createBuffer();var n=this._aDataLength.concat(o(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,n);var a=[];this.cipher.encrypt(this._j0,a);for(var i=0;i<this._ints;++i)this.tag.putInt32(this._s[i]^a[i]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},t.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),o=0;o<128;++o)e[o/32|0]&1<<31-o%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n);return r},t.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},t.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,o=this._m[r][n];t[0]^=o[0],t[1]^=o[1],t[2]^=o[2],t[3]^=o[3]}return t},t.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},t.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,o=16*r,a=new Array(o),i=0;i<o;++i){var s=[0,0,0,0],c=(n-1-i%n)*t;s[i/n|0]=1<<t-1<<c,a[i]=this.generateSubHashTable(this.multiply(s,e),t)}return a},t.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,o=new Array(r);o[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(o[2*a],o[a]=[]),a>>=1;for(a=2;a<n;){for(var i=1;i<a;++i){var s=o[a],c=o[i];o[a+i]=[s[0]^c[0],s[1]^c[1],s[2]^c[2],s[3]^c[3]]}a*=2}for(o[0]=[0,0,0,0],a=n+1;a<r;++a){var u=o[a^n];o[a]=[e[0]^u[0],e[1]^u[1],e[2]^u[2],e[3]^u[3]]}return o}})),j.aes=j.aes||{},j.aes.startEncrypting=function(e,t,r,n){var o=te({key:e,output:r,decrypt:!1,mode:n});return o.start(t),o},j.aes.createEncryptionCipher=function(e,t){return te({key:e,output:null,decrypt:!1,mode:t})},j.aes.startDecrypting=function(e,t,r,n){var o=te({key:e,output:r,decrypt:!0,mode:n});return o.start(t),o},j.aes.createDecryptionCipher=function(e,t){return te({key:e,output:null,decrypt:!0,mode:t})},j.aes.Algorithm=function(e,t){$||Z();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return ee(r._w,e,t,!1)},decrypt:function(e,t){return ee(r._w,e,t,!0)}}}),r._init=!1},j.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(j.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=j.util.createBuffer();for(var n=0;n<t.length;++n)r.putByte(t[n])}}else r=j.util.createBuffer(r);if(!j.util.isArray(r)){t=r,r=[];var o=t.length();if(16===o||24===o||32===o)for(o>>>=2,n=0;n<o;++n)r.push(t.getInt32())}if(!j.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var a=this.mode.name,i=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=J(r,e.decrypt&&!i),this._init=!0}},j.aes._expandKey=function(e,t){return $||Z(),J(e,t)},j.aes._updateBlock=ee,K("AES-ECB",j.cipher.modes.ecb),K("AES-CBC",j.cipher.modes.cbc),K("AES-CFB",j.cipher.modes.cfb),K("AES-OFB",j.cipher.modes.ofb),K("AES-CTR",j.cipher.modes.ctr),K("AES-GCM",j.cipher.modes.gcm);var W,Q,G,X,Y,$=!1;function Z(){$=!0,G=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;for(W=new Array(256),Q=new Array(256),X=new Array(4),Y=new Array(4),t=0;t<4;++t)X[t]=new Array(256),Y[t]=new Array(256);var r,n,o,a,i,s,c,u=0,l=0;for(t=0;t<256;++t){a=(a=l^l<<1^l<<2^l<<3^l<<4)>>8^255&a^99,W[u]=a,Q[a]=u,s=(i=e[a])<<24^a<<16^a<<8^a^i,c=((r=e[u])^(n=e[r])^(o=e[n]))<<24^(u^o)<<16^(u^n^o)<<8^u^r^o;for(var d=0;d<4;++d)X[d][u]=s,Y[d][a]=c,s=s<<24|s>>>8,c=c<<24|c>>>8;0===u?u=l=1:(u=r^e[e[e[r^o]]],l^=e[e[l]])}}function J(e,t){for(var r,n=e.slice(0),o=1,a=n.length,i=4*(a+6+1),s=a;s<i;++s)r=n[s-1],s%a==0?(r=W[r>>>16&255]<<24^W[r>>>8&255]<<16^W[255&r]<<8^W[r>>>24]^G[o]<<24,o++):a>6&&s%a==4&&(r=W[r>>>24]<<24^W[r>>>16&255]<<16^W[r>>>8&255]<<8^W[255&r]),n[s]=n[s-a]^r;if(t){for(var c,u=Y[0],l=Y[1],d=Y[2],f=Y[3],p=n.slice(0),h=(s=0,(i=n.length)-4);s<i;s+=4,h-=4)if(0===s||s===i-4)p[s]=n[h],p[s+1]=n[h+3],p[s+2]=n[h+2],p[s+3]=n[h+1];else for(var m=0;m<4;++m)c=n[h+m],p[s+(3&-m)]=u[W[c>>>24]]^l[W[c>>>16&255]]^d[W[c>>>8&255]]^f[W[255&c]];n=p}return n}function ee(e,t,r,n){var o,a,i,s,c,u,l,d,f,p,h,m,g=e.length/4-1;n?(o=Y[0],a=Y[1],i=Y[2],s=Y[3],c=Q):(o=X[0],a=X[1],i=X[2],s=X[3],c=W),u=t[0]^e[0],l=t[n?3:1]^e[1],d=t[2]^e[2],f=t[n?1:3]^e[3];for(var v=3,y=1;y<g;++y)p=o[u>>>24]^a[l>>>16&255]^i[d>>>8&255]^s[255&f]^e[++v],h=o[l>>>24]^a[d>>>16&255]^i[f>>>8&255]^s[255&u]^e[++v],m=o[d>>>24]^a[f>>>16&255]^i[u>>>8&255]^s[255&l]^e[++v],f=o[f>>>24]^a[u>>>16&255]^i[l>>>8&255]^s[255&d]^e[++v],u=p,l=h,d=m;r[0]=c[u>>>24]<<24^c[l>>>16&255]<<16^c[d>>>8&255]<<8^c[255&f]^e[++v],r[n?3:1]=c[l>>>24]<<24^c[d>>>16&255]<<16^c[f>>>8&255]<<8^c[255&u]^e[++v],r[2]=c[d>>>24]<<24^c[f>>>16&255]<<16^c[u>>>8&255]<<8^c[255&l]^e[++v],r[n?1:3]=c[f>>>24]<<24^c[u>>>16&255]<<16^c[l>>>8&255]<<8^c[255&d]^e[++v]}function te(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?j.cipher.createDecipher(r,e.key):j.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var o=null;r instanceof j.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=e,n.call(t,r)},t}function re(e,t){j.cipher.registerAlgorithm(e,(function(){return new j.des.Algorithm(e,t)}))}C((function(e){j.pki=j.pki||{};var t=e.exports=j.pki.oids=j.oids=j.oids||{};function r(e,r){t[e]=r,t[r]=e}function n(e,r){t[e]=r}r("1.2.840.113549.1.1.1","rsaEncryption"),r("1.2.840.113549.1.1.4","md5WithRSAEncryption"),r("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),r("1.2.840.113549.1.1.7","RSAES-OAEP"),r("1.2.840.113549.1.1.8","mgf1"),r("1.2.840.113549.1.1.9","pSpecified"),r("1.2.840.113549.1.1.10","RSASSA-PSS"),r("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),r("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),r("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),r("1.3.101.112","EdDSA25519"),r("1.2.840.10040.4.3","dsa-with-sha1"),r("1.3.14.3.2.7","desCBC"),r("1.3.14.3.2.26","sha1"),r("2.16.840.1.101.3.4.2.1","sha256"),r("2.16.840.1.101.3.4.2.2","sha384"),r("2.16.840.1.101.3.4.2.3","sha512"),r("1.2.840.113549.2.5","md5"),r("1.2.840.113549.1.7.1","data"),r("1.2.840.113549.1.7.2","signedData"),r("1.2.840.113549.1.7.3","envelopedData"),r("1.2.840.113549.1.7.4","signedAndEnvelopedData"),r("1.2.840.113549.1.7.5","digestedData"),r("1.2.840.113549.1.7.6","encryptedData"),r("1.2.840.113549.1.9.1","emailAddress"),r("1.2.840.113549.1.9.2","unstructuredName"),r("1.2.840.113549.1.9.3","contentType"),r("1.2.840.113549.1.9.4","messageDigest"),r("1.2.840.113549.1.9.5","signingTime"),r("1.2.840.113549.1.9.6","counterSignature"),r("1.2.840.113549.1.9.7","challengePassword"),r("1.2.840.113549.1.9.8","unstructuredAddress"),r("1.2.840.113549.1.9.14","extensionRequest"),r("1.2.840.113549.1.9.20","friendlyName"),r("1.2.840.113549.1.9.21","localKeyId"),r("1.2.840.113549.1.9.22.1","x509Certificate"),r("1.2.840.113549.1.12.10.1.1","keyBag"),r("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),r("1.2.840.113549.1.12.10.1.3","certBag"),r("1.2.840.113549.1.12.10.1.4","crlBag"),r("1.2.840.113549.1.12.10.1.5","secretBag"),r("1.2.840.113549.1.12.10.1.6","safeContentsBag"),r("1.2.840.113549.1.5.13","pkcs5PBES2"),r("1.2.840.113549.1.5.12","pkcs5PBKDF2"),r("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),r("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),r("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),r("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),r("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),r("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),r("1.2.840.113549.2.7","hmacWithSHA1"),r("1.2.840.113549.2.8","hmacWithSHA224"),r("1.2.840.113549.2.9","hmacWithSHA256"),r("1.2.840.113549.2.10","hmacWithSHA384"),r("1.2.840.113549.2.11","hmacWithSHA512"),r("1.2.840.113549.3.7","des-EDE3-CBC"),r("2.16.840.1.101.3.4.1.2","aes128-CBC"),r("2.16.840.1.101.3.4.1.22","aes192-CBC"),r("2.16.840.1.101.3.4.1.42","aes256-CBC"),r("2.5.4.3","commonName"),r("2.5.4.5","serialName"),r("2.5.4.6","countryName"),r("2.5.4.7","localityName"),r("2.5.4.8","stateOrProvinceName"),r("2.5.4.9","streetAddress"),r("2.5.4.10","organizationName"),r("2.5.4.11","organizationalUnitName"),r("2.5.4.13","description"),r("2.5.4.15","businessCategory"),r("2.5.4.17","postalCode"),r("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),r("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),r("2.16.840.1.113730.1.1","nsCertType"),r("2.16.840.1.113730.1.13","nsComment"),n("2.5.29.1","authorityKeyIdentifier"),n("2.5.29.2","keyAttributes"),n("2.5.29.3","certificatePolicies"),n("2.5.29.4","keyUsageRestriction"),n("2.5.29.5","policyMapping"),n("2.5.29.6","subtreesConstraint"),n("2.5.29.7","subjectAltName"),n("2.5.29.8","issuerAltName"),n("2.5.29.9","subjectDirectoryAttributes"),n("2.5.29.10","basicConstraints"),n("2.5.29.11","nameConstraints"),n("2.5.29.12","policyConstraints"),n("2.5.29.13","basicConstraints"),r("2.5.29.14","subjectKeyIdentifier"),r("2.5.29.15","keyUsage"),n("2.5.29.16","privateKeyUsagePeriod"),r("2.5.29.17","subjectAltName"),r("2.5.29.18","issuerAltName"),r("2.5.29.19","basicConstraints"),n("2.5.29.20","cRLNumber"),n("2.5.29.21","cRLReason"),n("2.5.29.22","expirationDate"),n("2.5.29.23","instructionCode"),n("2.5.29.24","invalidityDate"),n("2.5.29.25","cRLDistributionPoints"),n("2.5.29.26","issuingDistributionPoint"),n("2.5.29.27","deltaCRLIndicator"),n("2.5.29.28","issuingDistributionPoint"),n("2.5.29.29","certificateIssuer"),n("2.5.29.30","nameConstraints"),r("2.5.29.31","cRLDistributionPoints"),r("2.5.29.32","certificatePolicies"),n("2.5.29.33","policyMappings"),n("2.5.29.34","policyConstraints"),r("2.5.29.35","authorityKeyIdentifier"),n("2.5.29.36","policyConstraints"),r("2.5.29.37","extKeyUsage"),n("2.5.29.46","freshestCRL"),n("2.5.29.54","inhibitAnyPolicy"),r("1.3.6.1.4.1.11129.2.4.2","timestampList"),r("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),r("1.3.6.1.5.5.7.3.1","serverAuth"),r("1.3.6.1.5.5.7.3.2","clientAuth"),r("1.3.6.1.5.5.7.3.3","codeSigning"),r("1.3.6.1.5.5.7.3.4","emailProtection"),r("1.3.6.1.5.5.7.3.8","timeStamping")})),C((function(e){var t=e.exports=j.asn1=j.asn1||{};function r(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}t.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},t.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},t.create=function(e,r,n,o,a){if(j.util.isArray(o)){for(var i=[],s=0;s<o.length;++s)void 0!==o[s]&&i.push(o[s]);o=i}var c={tagClass:e,type:r,constructed:n,composed:n||j.util.isArray(o),value:o};return a&&"bitStringContents"in a&&(c.bitStringContents=a.bitStringContents,c.original=t.copy(c)),c},t.copy=function(e,r){var n;if(j.util.isArray(e)){n=[];for(var o=0;o<e.length;++o)n.push(t.copy(e[o],r));return n}return"string"==typeof e?e:(n={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:t.copy(e.value,r)},r&&!r.excludeBitStringContents&&(n.bitStringContents=e.bitStringContents),n)},t.equals=function(e,r,n){if(j.util.isArray(e)){if(!j.util.isArray(r))return!1;if(e.length!==r.length)return!1;for(var o=0;o<e.length;++o)if(!t.equals(e[o],r[o]))return!1;return!0}if(By(e)!=By(r))return!1;if("string"==typeof e)return e===r;var a=e.tagClass===r.tagClass&&e.type===r.type&&e.constructed===r.constructed&&e.composed===r.composed&&t.equals(e.value,r.value);return n&&n.includeBitStringContents&&(a=a&&e.bitStringContents===r.bitStringContents),a},t.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};t.fromDer=function(e,n){return void 0===n&&(n={strict:!0,decodeBitStrings:!0}),"boolean"==typeof n&&(n={strict:n,decodeBitStrings:!0}),"strict"in n||(n.strict=!0),"decodeBitStrings"in n||(n.decodeBitStrings=!0),"string"==typeof e&&(e=j.util.createBuffer(e)),function e(n,o,a,i){var s;r(n,o,2);var c=n.getByte();o--;var u=192&c,l=31&c;s=n.length();var d,f,p=function(e,t){var n=e.getByte();if(t--,128!==n){var o;if(128&n){var a=127&n;r(e,t,a),o=e.getInt(a<<3)}else o=n;if(o<0)throw new Error("Negative length: "+o);return o}}(n,o);if(o-=s-n.length(),void 0!==p&&p>o){if(i.strict){var h=new Error("Too few bytes to read ASN.1 value.");throw h.available=n.length(),h.remaining=o,h.requested=p,h}p=o}var m=32==(32&c);if(m)if(d=[],void 0===p)for(;;){if(r(n,o,2),n.bytes(2)===String.fromCharCode(0,0)){n.getBytes(2),o-=2;break}s=n.length(),d.push(e(n,o,a+1,i)),o-=s-n.length()}else for(;p>0;)s=n.length(),d.push(e(n,p,a+1,i)),o-=s-n.length(),p-=s-n.length();if(void 0===d&&u===t.Class.UNIVERSAL&&l===t.Type.BITSTRING&&(f=n.bytes(p)),void 0===d&&i.decodeBitStrings&&u===t.Class.UNIVERSAL&&l===t.Type.BITSTRING&&p>1){var g=n.read,v=o,y=0;if(l===t.Type.BITSTRING&&(r(n,o,1),y=n.getByte(),o--),0===y)try{s=n.length();var b=e(n,o,a+1,{verbose:i.verbose,strict:!0,decodeBitStrings:!0}),C=s-n.length();o-=C,l==t.Type.BITSTRING&&C++;var w=b.tagClass;C!==p||w!==t.Class.UNIVERSAL&&w!==t.Class.CONTEXT_SPECIFIC||(d=[b])}catch(e){}void 0===d&&(n.read=g,o=v)}if(void 0===d){if(void 0===p){if(i.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=o}if(l===t.Type.BMPSTRING)for(d="";p>0;p-=2)r(n,o,2),d+=String.fromCharCode(n.getInt16()),o-=2;else d=n.getBytes(p)}var k=void 0===f?null:{bitStringContents:f};return t.create(u,l,m,d,k)}(e,e.length(),0,n)},t.toDer=function(e){var r=j.util.createBuffer(),n=e.tagClass|e.type,o=j.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=t.equals(e,e.original))),a)o.putBytes(e.bitStringContents);else if(e.composed){e.constructed?n|=32:o.putByte(0);for(var i=0;i<e.value.length;++i)void 0!==e.value[i]&&o.putBuffer(t.toDer(e.value[i]))}else if(e.type===t.Type.BMPSTRING)for(i=0;i<e.value.length;++i)o.putInt16(e.value.charCodeAt(i));else e.type===t.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?o.putBytes(e.value.substr(1)):o.putBytes(e.value);if(r.putByte(n),o.length()<=127)r.putByte(127&o.length());else{var s=o.length(),c="";do{c+=String.fromCharCode(255&s),s>>>=8}while(s>0);for(r.putByte(128|c.length),i=c.length-1;i>=0;--i)r.putByte(c.charCodeAt(i))}return r.putBuffer(o),r},t.oidToDer=function(e){var t,r,n,o,a=e.split("."),i=j.util.createBuffer();i.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var s=2;s<a.length;++s){t=!0,r=[],n=parseInt(a[s],10);do{o=127&n,n>>>=7,t||(o|=128),r.push(o),t=!1}while(n>0);for(var c=r.length-1;c>=0;--c)i.putByte(r[c])}return i},t.derToOid=function(e){var t;"string"==typeof e&&(e=j.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var n=0;e.length()>0;)n<<=7,128&(r=e.getByte())?n+=127&r:(t+="."+(n+r),n=0);return t},t.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,o=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(s=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,n,o),t.setUTCHours(a,i,s,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(+t-l):t.setTime(+t+l)}return t},t.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,o=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),i=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var d=e.length-5,f=e.charAt(d);return"+"!==f&&"-"!==f||(u=60*parseInt(e.substr(d+1,2),10)+parseInt(e.substr(d+4,2),10),u*=6e4,"+"===f&&(u*=-1),l=!0),"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,o),t.setUTCHours(a,i,s,c),t.setTime(+t+u)):(t.setFullYear(r,n,o),t.setHours(a,i,s,c)),t},t.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+"Z"},t.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+"Z"},t.integerToDer=function(e){var t=j.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},t.derToInteger=function(e){"string"==typeof e&&(e=j.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},t.validate=function(e,r,n,o){var a=!1;if(e.tagClass!==r.tagClass&&void 0!==r.tagClass||e.type!==r.type&&void 0!==r.type)o&&(e.tagClass!==r.tagClass&&o.push("["+r.name+'] Expected tag class "'+r.tagClass+'", got "'+e.tagClass+'"'),e.type!==r.type&&o.push("["+r.name+'] Expected type "'+r.type+'", got "'+e.type+'"'));else if(e.constructed===r.constructed||void 0===r.constructed){if(a=!0,r.value&&j.util.isArray(r.value))for(var i=0,s=0;a&&s<r.value.length;++s)a=r.value[s].optional||!1,e.value[i]&&((a=t.validate(e.value[i],r.value[s],n,o))?++i:r.value[s].optional&&(a=!0)),!a&&o&&o.push("["+r.name+'] Tag class "'+r.tagClass+'", type "'+r.type+'" expected value length "'+r.value.length+'", got "'+e.value.length+'"');if(a&&n&&(r.capture&&(n[r.capture]=e.value),r.captureAsn1&&(n[r.captureAsn1]=e),r.captureBitStringContents&&"bitStringContents"in e&&(n[r.captureBitStringContents]=e.bitStringContents),r.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)n[r.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");n[r.captureBitStringValue]=e.bitStringContents.slice(1)}}else o&&o.push("["+r.name+'] Expected constructed "'+r.constructed+'", got "'+e.constructed+'"');return a};var n=/[^\\u0000-\\u00ff]/;t.prettyPrint=function(e,r,o){var a="";o=o||2,(r=r||0)>0&&(a+="\n");for(var i="",s=0;s<r*o;++s)i+=" ";switch(a+=i+"Tag: ",e.tagClass){case t.Class.UNIVERSAL:a+="Universal:";break;case t.Class.APPLICATION:a+="Application:";break;case t.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case t.Class.PRIVATE:a+="Private:"}if(e.tagClass===t.Class.UNIVERSAL)switch(a+=e.type,e.type){case t.Type.NONE:a+=" (None)";break;case t.Type.BOOLEAN:a+=" (Boolean)";break;case t.Type.INTEGER:a+=" (Integer)";break;case t.Type.BITSTRING:a+=" (Bit string)";break;case t.Type.OCTETSTRING:a+=" (Octet string)";break;case t.Type.NULL:a+=" (Null)";break;case t.Type.OID:a+=" (Object Identifier)";break;case t.Type.ODESC:a+=" (Object Descriptor)";break;case t.Type.EXTERNAL:a+=" (External or Instance of)";break;case t.Type.REAL:a+=" (Real)";break;case t.Type.ENUMERATED:a+=" (Enumerated)";break;case t.Type.EMBEDDED:a+=" (Embedded PDV)";break;case t.Type.UTF8:a+=" (UTF8)";break;case t.Type.ROID:a+=" (Relative Object Identifier)";break;case t.Type.SEQUENCE:a+=" (Sequence)";break;case t.Type.SET:a+=" (Set)";break;case t.Type.PRINTABLESTRING:a+=" (Printable String)";break;case t.Type.IA5String:a+=" (IA5String (ASCII))";break;case t.Type.UTCTIME:a+=" (UTC time)";break;case t.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case t.Type.BMPSTRING:a+=" (BMP String)"}else a+=e.type;if(a+="\n",a+=i+"Constructed: "+e.constructed+"\n",e.composed){var c=0,u="";for(s=0;s<e.value.length;++s)void 0!==e.value[s]&&(c+=1,u+=t.prettyPrint(e.value[s],r+1,o),s+1<e.value.length&&(u+=","));a+=i+"Sub values: "+c+u}else{if(a+=i+"Value: ",e.type===t.Type.OID){var l=t.derToOid(e.value);a+=l,j.pki&&j.pki.oids&&l in j.pki.oids&&(a+=" ("+j.pki.oids[l]+") ")}if(e.type===t.Type.INTEGER)try{a+=t.derToInteger(e.value)}catch(t){a+="0x"+j.util.bytesToHex(e.value)}else if(e.type===t.Type.BITSTRING){if(e.value.length>1?a+="0x"+j.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var d=e.value.charCodeAt(0);1==d?a+=" (1 unused bit shown)":d>1&&(a+=" ("+d+" unused bits shown)")}}else e.type===t.Type.OCTETSTRING?(n.test(e.value)||(a+="("+e.value+") "),a+="0x"+j.util.bytesToHex(e.value)):e.type===t.Type.UTF8?a+=j.util.decodeUtf8(e.value):e.type===t.Type.PRINTABLESTRING||e.type===t.Type.IA5String?a+=e.value:n.test(e.value)?a+="0x"+j.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}})),j.md=j.md||{},j.md.algorithms=j.md.algorithms||{},C((function(e){(e.exports=j.hmac=j.hmac||{}).create=function(){var e=null,t=null,r=null,n=null,o={start:function(o,a){if(null!==o)if("string"==typeof o){if(!((o=o.toLowerCase())in j.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');t=j.md.algorithms[o].create()}else t=o;if(null===a)a=e;else{if("string"==typeof a)a=j.util.createBuffer(a);else if(j.util.isArray(a)){var i=a;a=j.util.createBuffer();for(var s=0;s<i.length;++s)a.putByte(i[s])}var c=a.length();for(c>t.blockLength&&(t.start(),t.update(a.bytes()),a=t.digest()),r=j.util.createBuffer(),n=j.util.createBuffer(),c=a.length(),s=0;s<c;++s)i=a.at(s),r.putByte(54^i),n.putByte(92^i);if(c<t.blockLength)for(i=t.blockLength-c,s=0;s<i;++s)r.putByte(54),n.putByte(92);e=a,r=r.bytes(),n=n.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(n),t.update(e),t.digest()}};return o.digest=o.getMac,o}})),C((function(e){var t=e.exports=j.md5=j.md5||{};j.md.md5=j.md.algorithms.md5=t,t.create=function(){i||function(){r=String.fromCharCode(128),r+=j.util.fillString(String.fromCharCode(0),64),n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],o=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],a=new Array(64);for(var e=0;e<64;++e)a[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));i=!0}();var e=null,t=j.util.createBuffer(),c=new Array(16),u={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){u.messageLength=0,u.fullMessageLength=u.messageLength64=[];for(var r=u.messageLengthSize/4,n=0;n<r;++n)u.fullMessageLength.push(0);return t=j.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},u}};return u.start(),u.update=function(r,n){"utf8"===n&&(r=j.util.encodeUtf8(r));var o=r.length;u.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var a=u.fullMessageLength.length-1;a>=0;--a)u.fullMessageLength[a]+=o[1],o[1]=o[0]+(u.fullMessageLength[a]/4294967296>>>0),u.fullMessageLength[a]=u.fullMessageLength[a]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(r),s(e,c,t),(t.read>2048||0===t.length())&&t.compact(),u},u.digest=function(){var n=j.util.createBuffer();n.putBytes(t.bytes());var o=u.fullMessageLength[u.fullMessageLength.length-1]+u.messageLengthSize&u.blockLength-1;n.putBytes(r.substr(0,u.blockLength-o));for(var a,i=0,l=u.fullMessageLength.length-1;l>=0;--l)i=(a=8*u.fullMessageLength[l]+i)/4294967296>>>0,n.putInt32Le(a>>>0);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};s(d,c,n);var f=j.util.createBuffer();return f.putInt32Le(d.h0),f.putInt32Le(d.h1),f.putInt32Le(d.h2),f.putInt32Le(d.h3),f},u};var r=null,n=null,o=null,a=null,i=!1;function s(e,t,r){for(var i,s,c,u,l,d,f,p=r.length();p>=64;){for(s=e.h0,c=e.h1,u=e.h2,l=e.h3,f=0;f<16;++f)t[f]=r.getInt32Le(),i=s+(l^c&(u^l))+a[f]+t[f],s=l,l=u,u=c,c+=i<<(d=o[f])|i>>>32-d;for(;f<32;++f)i=s+(u^l&(c^u))+a[f]+t[n[f]],s=l,l=u,u=c,c+=i<<(d=o[f])|i>>>32-d;for(;f<48;++f)i=s+(c^u^l)+a[f]+t[n[f]],s=l,l=u,u=c,c+=i<<(d=o[f])|i>>>32-d;for(;f<64;++f)i=s+(u^(c|~l))+a[f]+t[n[f]],s=l,l=u,u=c,c+=i<<(d=o[f])|i>>>32-d;e.h0=e.h0+s|0,e.h1=e.h1+c|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,p-=64}}})),C((function(e){var t=e.exports=j.pem=j.pem||{};function r(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},o=0;o<e.values.length;++o)r.push(e.values[o].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var a=0,i=-1;for(o=0;o<t.length;++o,++a)if(a>65&&-1!==i){var s=t[i];","===s?(++i,t=t.substr(0,i)+"\r\n "+t.substr(i)):t=t.substr(0,i)+"\r\n"+s+t.substr(i+1),a=o-i-1,i=-1,++o}else" "!==t[o]&&"\t"!==t[o]&&","!==t[o]||(i=o);return t}function n(e){return e.replace(/^\s+/,"")}t.encode=function(e,t){t=t||{};var n,o="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(o+=r(n={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(o+=r(n={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(n={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&n.values.push(e.dekInfo.parameters),o+=r(n)),e.headers)for(var a=0;a<e.headers.length;++a)o+=r(e.headers[a]);return e.procType&&(o+="\r\n"),(o+=j.util.encode64(e.body,t.maxline||64)+"\r\n")+"-----END "+e.type+"-----\r\n"},t.decode=function(e){for(var t,r=[],o=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,i=/\r?\n/;t=o.exec(e);){var s={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:j.util.decode64(t[3])};if(r.push(s),t[2]){for(var c=t[2].split(i),u=0;t&&u<c.length;){for(var l=c[u].replace(/\s+$/,""),d=u+1;d<c.length;++d){var f=c[d];if(!/\s/.test(f[0]))break;l+=f,u=d}if(t=l.match(a)){for(var p={name:t[1],values:[]},h=t[2].split(","),m=0;m<h.length;++m)p.values.push(n(h[m]));if(s.procType)if(s.contentDomain||"Content-Domain"!==p.name)if(s.dekInfo||"DEK-Info"!==p.name)s.headers.push(p);else{if(0===p.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');s.dekInfo={algorithm:h[0],parameters:h[1]||null}}else s.contentDomain=h[0]||"";else{if("Proc-Type"!==p.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==p.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');s.procType={version:h[0],type:h[1]}}}++u}if("ENCRYPTED"===s.procType&&!s.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}})),j.des=j.des||{},j.des.startEncrypting=function(e,t,r,n){var o=fe({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return o.start(t),o},j.des.createEncryptionCipher=function(e,t){return fe({key:e,output:null,decrypt:!1,mode:t})},j.des.startDecrypting=function(e,t,r,n){var o=fe({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return o.start(t),o},j.des.createDecryptionCipher=function(e,t){return fe({key:e,output:null,decrypt:!0,mode:t})},j.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return de(r._keys,e,t,!1)},decrypt:function(e,t){return de(r._keys,e,t,!0)}}}),r._init=!1},j.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=j.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],o=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],i=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],d=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],h=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],m=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,v=[],y=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,C=0;C<g;C++){var w=e.getInt32(),k=e.getInt32();w^=(t=252645135&(w>>>4^k))<<4,w^=t=65535&((k^=t)>>>-16^w),w^=(t=858993459&(w>>>2^(k^=t<<-16)))<<2,w^=t=65535&((k^=t)>>>-16^w),w^=(t=1431655765&(w>>>1^(k^=t<<-16)))<<1,w^=t=16711935&((k^=t)>>>8^w),t=(w^=(t=1431655765&(w>>>1^(k^=t<<8)))<<1)<<8|(k^=t)>>>20&240,w=k<<24|k<<8&16711680|k>>>8&65280|k>>>24&240,k=t;for(var S=0;S<y.length;++S){y[S]?(w=w<<2|w>>>26,k=k<<2|k>>>26):(w=w<<1|w>>>27,k=k<<1|k>>>27);var E=r[(w&=-15)>>>28]|n[w>>>24&15]|o[w>>>20&15]|a[w>>>16&15]|i[w>>>12&15]|s[w>>>8&15]|c[w>>>4&15],B=u[(k&=-15)>>>28]|l[k>>>24&15]|d[k>>>20&15]|f[k>>>16&15]|p[k>>>12&15]|h[k>>>8&15]|m[k>>>4&15];t=65535&(B>>>16^E),v[b++]=E^t,v[b++]=B^t<<16}}return v}(t),this._init=!0}},re("DES-ECB",j.cipher.modes.ecb),re("DES-CBC",j.cipher.modes.cbc),re("DES-CFB",j.cipher.modes.cfb),re("DES-OFB",j.cipher.modes.ofb),re("DES-CTR",j.cipher.modes.ctr),re("3DES-ECB",j.cipher.modes.ecb),re("3DES-CBC",j.cipher.modes.cbc),re("3DES-CFB",j.cipher.modes.cfb),re("3DES-OFB",j.cipher.modes.ofb),re("3DES-CTR",j.cipher.modes.ctr);var ne=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],oe=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],ae=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],ie=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],se=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],ce=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],ue=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],le=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function de(e,t,r,n){var o,a,i=32===e.length?3:9;o=3===i?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s=t[0],c=t[1];s^=(a=252645135&(s>>>4^c))<<4,s^=(a=65535&(s>>>16^(c^=a)))<<16,s^=a=858993459&((c^=a)>>>2^s),s^=a=16711935&((c^=a<<2)>>>8^s),s=(s^=(a=1431655765&(s>>>1^(c^=a<<8)))<<1)<<1|s>>>31,c=(c^=a)<<1|c>>>31;for(var u=0;u<i;u+=3){for(var l=o[u+1],d=o[u+2],f=o[u];f!=l;f+=d){var p=c^e[f],h=(c>>>4|c<<28)^e[f+1];a=s,s=c,c=a^(oe[p>>>24&63]|ie[p>>>16&63]|ce[p>>>8&63]|le[63&p]|ne[h>>>24&63]|ae[h>>>16&63]|se[h>>>8&63]|ue[63&h])}a=s,s=c,c=a}c=c>>>1|c<<31,c^=a=1431655765&((s=s>>>1|s<<31)>>>1^c),c^=(a=16711935&(c>>>8^(s^=a<<1)))<<8,c^=(a=858993459&(c>>>2^(s^=a)))<<2,c^=a=65535&((s^=a)>>>16^c),c^=a=252645135&((s^=a<<16)>>>4^c),s^=a<<4,r[0]=s,r[1]=c}function fe(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?j.cipher.createDecipher(r,e.key):j.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var o=null;r instanceof j.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=e,n.call(t,r)},t}var pe,he=j.pkcs5=j.pkcs5||{};j.util.isNodejs&&!j.options.usePureJavaScript&&(pe=t),j.pbkdf2=he.pbkdf2=function(e,t,r,n,o,a){if("function"==typeof o&&(a=o,o=null),j.util.isNodejs&&!j.options.usePureJavaScript&&pe.pbkdf2&&(null===o||"object"!=By(o))&&(pe.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),a?4===pe.pbkdf2Sync.length?pe.pbkdf2(e,t,r,n,(function(e,t){if(e)return a(e);a(null,t.toString("binary"))})):pe.pbkdf2(e,t,r,n,o,(function(e,t){if(e)return a(e);a(null,t.toString("binary"))})):4===pe.pbkdf2Sync.length?pe.pbkdf2Sync(e,t,r,n).toString("binary"):pe.pbkdf2Sync(e,t,r,n,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in j.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=j.md[o].create()}var i=o.digestLength;if(n>4294967295*i){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var c=Math.ceil(n/i),u=n-(c-1)*i,l=j.hmac.create();l.start(o,e);var d,f,p,h="";if(!a){for(var m=1;m<=c;++m){l.start(null,null),l.update(t),l.update(j.util.int32ToBytes(m)),d=p=l.digest().getBytes();for(var g=2;g<=r;++g)l.start(null,null),l.update(p),f=l.digest().getBytes(),d=j.util.xorBytes(d,f,i),p=f;h+=m<c?d:d.substr(0,u)}return h}function v(){if(m>c)return a(null,h);l.start(null,null),l.update(t),l.update(j.util.int32ToBytes(m)),d=p=l.digest().getBytes(),g=2,y()}function y(){if(g<=r)return l.start(null,null),l.update(p),f=l.digest().getBytes(),d=j.util.xorBytes(d,f,i),p=f,++g,j.util.setImmediate(y);h+=m<c?d:d.substr(0,u),++m,v()}m=1,v()},C((function(e){var t=e.exports=j.sha256=j.sha256||{};j.md.sha256=j.md.algorithms.sha256=t,t.create=function(){n||(r=String.fromCharCode(128),r+=j.util.fillString(String.fromCharCode(0),64),o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],n=!0);var e=null,t=j.util.createBuffer(),i=new Array(64),s={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){s.messageLength=0,s.fullMessageLength=s.messageLength64=[];for(var r=s.messageLengthSize/4,n=0;n<r;++n)s.fullMessageLength.push(0);return t=j.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},s}};return s.start(),s.update=function(r,n){"utf8"===n&&(r=j.util.encodeUtf8(r));var o=r.length;s.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var c=s.fullMessageLength.length-1;c>=0;--c)s.fullMessageLength[c]+=o[1],o[1]=o[0]+(s.fullMessageLength[c]/4294967296>>>0),s.fullMessageLength[c]=s.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(r),a(e,i,t),(t.read>2048||0===t.length())&&t.compact(),s},s.digest=function(){var n=j.util.createBuffer();n.putBytes(t.bytes());var o,c=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize&s.blockLength-1;n.putBytes(r.substr(0,s.blockLength-c));for(var u=8*s.fullMessageLength[0],l=0;l<s.fullMessageLength.length-1;++l)u+=(o=8*s.fullMessageLength[l+1])/4294967296>>>0,n.putInt32(u>>>0),u=o>>>0;n.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};a(d,i,n);var f=j.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f.putInt32(d.h5),f.putInt32(d.h6),f.putInt32(d.h7),f},s};var r=null,n=!1,o=null;function a(e,t,r){for(var n,a,i,s,c,u,l,d,f,p,h,m,g,v=r.length();v>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=((n=t[c-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,a=((a=t[c-15])>>>7|a<<25)^(a>>>18|a<<14)^a>>>3,t[c]=n+t[c-7]+a+t[c-16]|0;for(u=e.h0,l=e.h1,d=e.h2,f=e.h3,p=e.h4,h=e.h5,m=e.h6,g=e.h7,c=0;c<64;++c)i=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&l|d&(u^l),n=g+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(m^p&(h^m))+o[c]+t[c],g=m,m=h,h=p,p=f+n>>>0,f=d,d=l,l=u,u=n+(a=i+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+d|0,e.h3=e.h3+f|0,e.h4=e.h4+p|0,e.h5=e.h5+h|0,e.h6=e.h6+m|0,e.h7=e.h7+g|0,v-=64}}})),C((function(e){var r=null;!j.util.isNodejs||j.options.usePureJavaScript||process.versions["node-webkit"]||(r=t),(e.exports=j.prng=j.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},n=e.md,o=new Array(32),a=0;a<32;++a)o[a]=n.create();function i(){if(t.pools[0].messageLength>=32)return s();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),s()}function s(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var o=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(o),t.generated=0}function c(e){var t=null,r=j.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var o=j.util.createBuffer();if(t)for(;o.length()<e;){var a=Math.max(1,Math.min(e-o.length(),65536)/4),i=new Uint32Array(Math.floor(a));try{t(i);for(var s=0;s<i.length;++s)o.putInt32(i[s])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(o.length()<e)for(var c,u,l,d=Math.floor(65536*Math.random());o.length()<e;)for(u=16807*(65535&d),u+=(32767&(c=16807*(d>>16)))<<16,d=4294967295&(u=(2147483647&(u+=c>>15))+(u>>31)),s=0;s<3;++s)l=d>>>(s<<3),l^=Math.floor(256*Math.random()),o.putByte(String.fromCharCode(255&l));return o.getBytes(e)}return t.pools=o,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var n=t.plugin.cipher,o=t.plugin.increment,a=t.plugin.formatKey,i=t.plugin.formatSeed,c=j.util.createBuffer();t.key=null,function u(l){if(l)return r(l);if(c.length()>=e)return r(null,c.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return j.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return s(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),s(),e()}))}(u)}));var d=n(t.key,t.seed);t.generated+=d.length,c.putBytes(d),t.key=a(n(t.key,o(t.seed))),t.seed=i(n(t.key,t.seed)),j.util.setImmediate(u)}()},t.generateSync=function(e){var r=t.plugin.cipher,n=t.plugin.increment,o=t.plugin.formatKey,a=t.plugin.formatSeed;t.key=null;for(var s=j.util.createBuffer();s.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&i();var c=r(t.key,t.seed);t.generated+=c.length,s.putBytes(c),t.key=o(r(t.key,n(t.seed))),t.seed=a(r(t.key,t.seed))}return s.getBytes(e)},r?(t.seedFile=function(e,t){r.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return r.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",o=0;o<r;o+=8)n+=String.fromCharCode(e>>o&255);t.collect(n)},t.registerWorker=function(e){e===self?t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))},t}})),C((function(e){j.random&&j.random.getBytes?e.exports=j.random:function(t){var r={},n=new Array(4),o=j.util.createBuffer();function a(){var e=j.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=j.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),j.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=j.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return j.aes._updateBlock(e,t,n,!1),o.putInt32(n[0]),o.putInt32(n[1]),o.putInt32(n[2]),o.putInt32(n[3]),o.getBytes()},r.increment=function(e){return++e[3],e},r.md=j.md.sha256;var i=a(),s=null,c=j.util.globalScope,u=c.crypto||c.msCrypto;if(u&&u.getRandomValues&&(s=function(e){return u.getRandomValues(e)}),!j.util.isNodejs&&!s){if(i.collectInt(+new Date,32),"undefined"!=typeof navigator){var l="";for(var d in navigator)try{"string"==typeof navigator[d]&&(l+=navigator[d])}catch(e){}i.collect(l),l=null}t&&(t().mousemove((function(e){i.collectInt(e.clientX,16),i.collectInt(e.clientY,16)})),t().keypress((function(e){i.collectInt(e.charCode,8)})))}if(j.random)for(var d in i)j.random[d]=i[d];else j.random=i;j.random.createInstance=a,e.exports=j.random}("undefined"!=typeof jQuery?jQuery:null)}));var me=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],ge=[1,2,3,5],ve=function(e,t){return e<<t&65535|(65535&e)>>16-t},ye=function(e,t){return(65535&e)>>t|e<<16-t&65535};j.rc2=j.rc2||{},j.rc2.expandKey=function(e,t){"string"==typeof e&&(e=j.util.createBuffer(e)),t=t||128;var r,n=e,o=e.length(),a=t,i=Math.ceil(a/8),s=255>>(7&a);for(r=o;r<128;r++)n.putByte(me[n.at(r-1)+n.at(r-o)&255]);for(n.setAt(128-i,me[n.at(128-i)&s]),r=127-i;r>=0;r--)n.setAt(r,me[n.at(r+1)^n.at(r+i)]);return n};var be,Ce=function(e,t,r){var n,o,a,i,s=!1,c=null,u=null,l=null,d=[];for(e=j.rc2.expandKey(e,t),a=0;a<64;a++)d.push(e.getInt16Le());r?(n=function(e){for(a=0;a<4;a++)e[a]+=d[i]+(e[(a+3)%4]&e[(a+2)%4])+(~e[(a+3)%4]&e[(a+1)%4]),e[a]=ve(e[a],ge[a]),i++},o=function(e){for(a=0;a<4;a++)e[a]+=d[63&e[(a+3)%4]]}):(n=function(e){for(a=3;a>=0;a--)e[a]=ye(e[a],ge[a]),e[a]-=d[i]+(e[(a+3)%4]&e[(a+2)%4])+(~e[(a+3)%4]&e[(a+1)%4]),i--},o=function(e){for(a=3;a>=0;a--)e[a]-=d[63&e[(a+3)%4]]});var f=function(e){var t=[];for(a=0;a<4;a++){var n=c.getInt16Le();null!==l&&(r?n^=l.getInt16Le():l.putInt16Le(n)),t.push(65535&n)}i=r?0:63;for(var o=0;o<e.length;o++)for(var s=0;s<e[o][0];s++)e[o][1](t);for(a=0;a<4;a++)null!==l&&(r?l.putInt16Le(t[a]):t[a]^=l.getInt16Le()),u.putInt16Le(t[a])},p=null;return p={start:function(e,t){e&&"string"==typeof e&&(e=j.util.createBuffer(e)),s=!1,c=j.util.createBuffer(),u=t||new j.util.createBuffer,l=e,p.output=u},update:function(e){for(s||c.putBuffer(e);c.length()>=8;)f([[5,n],[1,o],[6,n],[1,o],[5,n]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,c,!r);else{var n=8===c.length()?8:8-c.length();c.fillWithByte(n,n)}if(t&&(s=!0,p.update()),!r&&(t=0===c.length()))if(e)t=e(8,u,!r);else{var o=u.length(),a=u.at(o-1);a>o?t=!1:u.truncate(a)}return t}}};function we(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function ke(){return new we(null)}function Se(e,t,r,n,o,a){for(var i=16383&t,s=t>>14;--a>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=s*c+u*i;o=((c=i*c+((16383&l)<<14)+r.data[n]+o)>>28)+(l>>14)+s*u,r.data[n++]=268435455&c}return o}j.rc2.startEncrypting=function(e,t,r){var n=j.rc2.createEncryptionCipher(e,128);return n.start(t,r),n},j.rc2.createEncryptionCipher=function(e,t){return Ce(e,t,!0)},j.rc2.startDecrypting=function(e,t,r){var n=j.rc2.createDecryptionCipher(e,128);return n.start(t,r),n},j.rc2.createDecryptionCipher=function(e,t){return Ce(e,t,!1)},j.jsbn=j.jsbn||{},j.jsbn.BigInteger=we,"undefined"==typeof navigator?(we.prototype.am=Se,be=28):"Microsoft Internet Explorer"==navigator.appName?(we.prototype.am=function(e,t,r,n,o,a){for(var i=32767&t,s=t>>15;--a>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=s*c+u*i;o=((c=i*c+((32767&l)<<15)+r.data[n]+(1073741823&o))>>>30)+(l>>>15)+s*u+(o>>>30),r.data[n++]=1073741823&c}return o},be=30):"Netscape"!=navigator.appName?(we.prototype.am=function(e,t,r,n,o,a){for(;--a>=0;){var i=t*this.data[e++]+r.data[n]+o;o=Math.floor(i/67108864),r.data[n++]=67108863&i}return o},be=26):(we.prototype.am=Se,be=28),we.prototype.DB=be,we.prototype.DM=(1<<be)-1,we.prototype.DV=1<<be,we.prototype.FV=Math.pow(2,52),we.prototype.F1=52-be,we.prototype.F2=2*be-52;var Ee,Be,_e=new Array;for(Ee="0".charCodeAt(0),Be=0;Be<=9;++Be)_e[Ee++]=Be;for(Ee="a".charCodeAt(0),Be=10;Be<36;++Be)_e[Ee++]=Be;for(Ee="A".charCodeAt(0),Be=10;Be<36;++Be)_e[Ee++]=Be;function xe(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Te(e,t){var r=_e[e.charCodeAt(t)];return null==r?-1:r}function Ae(e){var t=ke();return t.fromInt(e),t}function Ie(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}function Pe(e){this.m=e}function Re(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}function De(e,t){return e&t}function Ne(e,t){return e|t}function Oe(e,t){return e^t}function Le(e,t){return e&~t}function Me(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 Fe(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function Ue(){}function je(e){return e}function Ve(e){this.r2=ke(),this.q3=ke(),we.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}Pe.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},Pe.prototype.revert=function(e){return e},Pe.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},Pe.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Pe.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Re.prototype.convert=function(e){var t=ke();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(we.ZERO)>0&&this.m.subTo(t,t),t},Re.prototype.revert=function(e){var t=ke();return e.copyTo(t),this.reduce(t),t},Re.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},Re.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Re.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},we.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},we.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},we.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,o=!1,a=0;--n>=0;){var i=8==r?255&e[n]:Te(e,n);i<0?"-"==e.charAt(n)&&(o=!0):(o=!1,0==a?this.data[this.t++]=i:a+r>this.DB?(this.data[this.t-1]|=(i&(1<<this.DB-a)-1)<<a,this.data[this.t++]=i>>this.DB-a):this.data[this.t-1]|=i<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),o&&we.ZERO.subTo(this,this)},we.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},we.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},we.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},we.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,o=this.DB-n,a=(1<<o)-1,i=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+i+1]=this.data[r]>>o|s,s=(this.data[r]&a)<<n;for(r=i-1;r>=0;--r)t.data[r]=0;t.data[i]=s,t.t=this.t+i+1,t.s=this.s,t.clamp()},we.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,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var i=r+1;i<this.t;++i)t.data[i-r-1]|=(this.data[i]&a)<<o,t.data[i-r]=this.data[i]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<o),t.t=this.t-r,t.clamp()}},we.prototype.subTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},we.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),o=r.t;for(t.t=o+n.t;--o>=0;)t.data[o]=0;for(o=0;o<n.t;++o)t.data[o+r.t]=r.am(0,n.data[o],t,o,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&we.ZERO.subTo(t,t)},we.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},we.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var o=this.abs();if(o.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=ke());var a=ke(),i=this.s,s=e.s,c=this.DB-Ie(n.data[n.t-1]);c>0?(n.lShiftTo(c,a),o.lShiftTo(c,r)):(n.copyTo(a),o.copyTo(r));var u=a.t,l=a.data[u-1];if(0!=l){var d=l*(1<<this.F1)+(u>1?a.data[u-2]>>this.F2:0),f=this.FV/d,p=(1<<this.F1)/d,h=1<<this.F2,m=r.t,g=m-u,v=null==t?ke():t;for(a.dlShiftTo(g,v),r.compareTo(v)>=0&&(r.data[r.t++]=1,r.subTo(v,r)),we.ONE.dlShiftTo(u,v),v.subTo(a,a);a.t<u;)a.data[a.t++]=0;for(;--g>=0;){var y=r.data[--m]==l?this.DM:Math.floor(r.data[m]*f+(r.data[m-1]+h)*p);if((r.data[m]+=a.am(0,y,r,g,0,u))<y)for(a.dlShiftTo(g,v),r.subTo(v,r);r.data[m]<--y;)r.subTo(v,r)}null!=t&&(r.drShiftTo(u,t),i!=s&&we.ZERO.subTo(t,t)),r.t=u,r.clamp(),c>0&&r.rShiftTo(c,r),i<0&&we.ZERO.subTo(r,r)}}},we.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[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},we.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},we.prototype.exp=function(e,t){if(e>4294967295||e<1)return we.ONE;var r=ke(),n=ke(),o=t.convert(this),a=Ie(e)-1;for(o.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,o,r);else{var i=r;r=n,n=i}return t.revert(r)},we.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,a="",i=this.t,s=this.DB-i*this.DB%t;if(i-- >0)for(s<this.DB&&(r=this.data[i]>>s)>0&&(o=!0,a=xe(r));i>=0;)s<t?(r=(this.data[i]&(1<<s)-1)<<t-s,r|=this.data[--i]>>(s+=this.DB-t)):(r=this.data[i]>>(s-=t)&n,s<=0&&(s+=this.DB,--i)),r>0&&(o=!0),o&&(a+=xe(r));return o?a:"0"},we.prototype.negate=function(){var e=ke();return we.ZERO.subTo(this,e),e},we.prototype.abs=function(){return this.s<0?this.negate():this},we.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.data[r]-e.data[r]))return t;return 0},we.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Ie(this.data[this.t-1]^this.s&this.DM)},we.prototype.mod=function(e){var t=ke();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(we.ZERO)>0&&e.subTo(t,t),t},we.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new Pe(t):new Re(t),this.exp(e,r)},we.ZERO=Ae(0),we.ONE=Ae(1),Ue.prototype.convert=je,Ue.prototype.revert=je,Ue.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},Ue.prototype.sqrTo=function(e,t){e.squareTo(t)},Ve.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=ke();return e.copyTo(t),this.reduce(t),t},Ve.prototype.revert=function(e){return e},Ve.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)},Ve.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},Ve.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var ze=[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],qe=(1<<26)/ze[ze.length-1];if(we.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},we.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=Ae(r),o=ke(),a=ke(),i="";for(this.divRemTo(n,o,a);o.signum()>0;)i=(r+a.intValue()).toString(e).substr(1)+i,o.divRemTo(n,o,a);return a.intValue().toString(e)+i},we.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),o=!1,a=0,i=0,s=0;s<e.length;++s){var c=Te(e,s);c<0?"-"==e.charAt(s)&&0==this.signum()&&(o=!0):(i=t*i+c,++a>=r&&(this.dMultiply(n),this.dAddOffset(i,0),a=0,i=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(i,0)),o&&we.ZERO.subTo(this,this)},we.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(we.ONE.shiftLeft(e-1),Ne,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(we.ONE.shiftLeft(e-1),this);else{var n=new Array,o=7&e;n.length=1+(e>>3),t.nextBytes(n),o>0?n[0]&=(1<<o)-1:n[0]=0,this.fromString(n,256)}},we.prototype.bitwiseTo=function(e,t,r){var n,o,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(o=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=a;n<e.t;++n)r.data[n]=t(o,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},we.prototype.changeBit=function(e,t){var r=we.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},we.prototype.addTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},we.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},we.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},we.prototype.multiplyLowerTo=function(e,t,r){var n,o=Math.min(this.t+e.t,t);for(r.s=0,r.t=o;o>0;)r.data[--o]=0;for(n=r.t-this.t;o<n;++o)r.data[o+this.t]=this.am(0,e.data[o],r,o,0,this.t);for(n=Math.min(e.t,t);o<n;++o)this.am(0,e.data[o],r,o,0,t-o);r.clamp()},we.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},we.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.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},we.prototype.millerRabin=function(e){var t=this.subtract(we.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,o=t.shiftRight(r),a={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},i=0;i<e;++i){do{n=new we(this.bitLength(),a)}while(n.compareTo(we.ONE)<=0||n.compareTo(t)>=0);var s=n.modPow(o,this);if(0!=s.compareTo(we.ONE)&&0!=s.compareTo(t)){for(var c=1;c++<r&&0!=s.compareTo(t);)if(0==(s=s.modPowInt(2,this)).compareTo(we.ONE))return!1;if(0!=s.compareTo(t))return!1}}return!0},we.prototype.clone=function(){var e=ke();return this.copyTo(e),e},we.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},we.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},we.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},we.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},we.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,o=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[o++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[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},we.prototype.equals=function(e){return 0==this.compareTo(e)},we.prototype.min=function(e){return this.compareTo(e)<0?this:e},we.prototype.max=function(e){return this.compareTo(e)>0?this:e},we.prototype.and=function(e){var t=ke();return this.bitwiseTo(e,De,t),t},we.prototype.or=function(e){var t=ke();return this.bitwiseTo(e,Ne,t),t},we.prototype.xor=function(e){var t=ke();return this.bitwiseTo(e,Oe,t),t},we.prototype.andNot=function(e){var t=ke();return this.bitwiseTo(e,Le,t),t},we.prototype.not=function(){for(var e=ke(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},we.prototype.shiftLeft=function(e){var t=ke();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},we.prototype.shiftRight=function(e){var t=ke();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},we.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+Me(this.data[e]);return this.s<0?this.t*this.DB:-1},we.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=Fe(this.data[r]^t);return e},we.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},we.prototype.setBit=function(e){return this.changeBit(e,Ne)},we.prototype.clearBit=function(e){return this.changeBit(e,Le)},we.prototype.flipBit=function(e){return this.changeBit(e,Oe)},we.prototype.add=function(e){var t=ke();return this.addTo(e,t),t},we.prototype.subtract=function(e){var t=ke();return this.subTo(e,t),t},we.prototype.multiply=function(e){var t=ke();return this.multiplyTo(e,t),t},we.prototype.divide=function(e){var t=ke();return this.divRemTo(e,t,null),t},we.prototype.remainder=function(e){var t=ke();return this.divRemTo(e,null,t),t},we.prototype.divideAndRemainder=function(e){var t=ke(),r=ke();return this.divRemTo(e,t,r),new Array(t,r)},we.prototype.modPow=function(e,t){var r,n,o=e.bitLength(),a=Ae(1);if(o<=0)return a;r=o<18?1:o<48?3:o<144?4:o<768?5:6,n=o<8?new Pe(t):t.isEven()?new Ve(t):new Re(t);var i=new Array,s=3,c=r-1,u=(1<<r)-1;if(i[1]=n.convert(this),r>1){var l=ke();for(n.sqrTo(i[1],l);s<=u;)i[s]=ke(),n.mulTo(l,i[s-2],i[s]),s+=2}var d,f,p=e.t-1,h=!0,m=ke();for(o=Ie(e.data[p])-1;p>=0;){for(o>=c?d=e.data[p]>>o-c&u:(d=(e.data[p]&(1<<o+1)-1)<<c-o,p>0&&(d|=e.data[p-1]>>this.DB+o-c)),s=r;0==(1&d);)d>>=1,--s;if((o-=s)<0&&(o+=this.DB,--p),h)i[d].copyTo(a),h=!1;else{for(;s>1;)n.sqrTo(a,m),n.sqrTo(m,a),s-=2;s>0?n.sqrTo(a,m):(f=a,a=m,m=f),n.mulTo(m,i[d],a)}for(;p>=0&&0==(e.data[p]&1<<o);)n.sqrTo(a,m),f=a,a=m,m=f,--o<0&&(o=this.DB-1,--p)}return n.revert(a)},we.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return we.ZERO;for(var r=e.clone(),n=this.clone(),o=Ae(1),a=Ae(0),i=Ae(0),s=Ae(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(e,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(e,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),t&&o.subTo(i,o),a.subTo(s,a)):(n.subTo(r,n),t&&i.subTo(o,i),s.subTo(a,s))}return 0!=n.compareTo(we.ONE)?we.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s},we.prototype.pow=function(e){return this.exp(e,new Ue)},we.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(),a=r.getLowestSetBit();if(a<0)return t;for(o<a&&(a=o),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,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 a>0&&r.lShiftTo(a,r),r},we.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=ze[ze.length-1]){for(t=0;t<ze.length;++t)if(r.data[0]==ze[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<ze.length;){for(var n=ze[t],o=t+1;o<ze.length&&n<qe;)n*=ze[o++];for(n=r.modInt(n);t<o;)if(n%ze[t++]==0)return!1}return r.millerRabin(e)},C((function(e){var t=e.exports=j.sha1=j.sha1||{};j.md.sha1=j.md.algorithms.sha1=t,t.create=function(){n||(r=String.fromCharCode(128),r+=j.util.fillString(String.fromCharCode(0),64),n=!0);var e=null,t=j.util.createBuffer(),a=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,n=0;n<r;++n)i.fullMessageLength.push(0);return t=j.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(r,n){"utf8"===n&&(r=j.util.encodeUtf8(r));var s=r.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(r),o(e,a,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var n=j.util.createBuffer();n.putBytes(t.bytes());var s,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;n.putBytes(r.substr(0,i.blockLength-c));for(var u=8*i.fullMessageLength[0],l=0;l<i.fullMessageLength.length-1;++l)u+=(s=8*i.fullMessageLength[l+1])/4294967296>>>0,n.putInt32(u>>>0),u=s>>>0;n.putInt32(u);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(d,a,n);var f=j.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f},i};var r=null,n=!1;function o(e,t,r){for(var n,o,a,i,s,c,u,l=r.length();l>=64;){for(o=e.h0,a=e.h1,i=e.h2,s=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,n=(o<<5|o>>>27)+(s^a&(i^s))+c+1518500249+n,c=s,s=i,i=(a<<30|a>>>2)>>>0,a=o,o=n;for(;u<20;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(o<<5|o>>>27)+(s^a&(i^s))+c+1518500249+n,c=s,s=i,i=(a<<30|a>>>2)>>>0,a=o,o=n;for(;u<32;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(o<<5|o>>>27)+(a^i^s)+c+1859775393+n,c=s,s=i,i=(a<<30|a>>>2)>>>0,a=o,o=n;for(;u<40;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(o<<5|o>>>27)+(a^i^s)+c+1859775393+n,c=s,s=i,i=(a<<30|a>>>2)>>>0,a=o,o=n;for(;u<60;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(o<<5|o>>>27)+(a&i|s&(a^i))+c+2400959708+n,c=s,s=i,i=(a<<30|a>>>2)>>>0,a=o,o=n;for(;u<80;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(o<<5|o>>>27)+(a^i^s)+c+3395469782+n,c=s,s=i,i=(a<<30|a>>>2)>>>0,a=o,o=n;e.h0=e.h0+o|0,e.h1=e.h1+a|0,e.h2=e.h2+i|0,e.h3=e.h3+s|0,e.h4=e.h4+c|0,l-=64}}})),C((function(e){var t=e.exports=j.pkcs1=j.pkcs1||{};function r(e,t,r){r||(r=j.md.sha1.create());for(var n="",o=Math.ceil(t/r.digestLength),a=0;a<o;++a){var i=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(e+i),n+=r.digest().getBytes()}return n.substring(0,t)}t.encode_rsa_oaep=function(e,t,n){var o,a,i,s;"string"==typeof n?(o=n,a=arguments[3]||void 0,i=arguments[4]||void 0):n&&(o=n.label||void 0,a=n.seed||void 0,i=n.md||void 0,n.mgf1&&n.mgf1.md&&(s=n.mgf1.md)),i?i.start():i=j.md.sha1.create(),s||(s=i);var c=Math.ceil(e.n.bitLength()/8),u=c-2*i.digestLength-2;if(t.length>u)throw(h=new Error("RSAES-OAEP input message length is too long.")).length=t.length,h.maxLength=u,h;o||(o=""),i.update(o,"raw");for(var l=i.digest(),d="",f=u-t.length,p=0;p<f;p++)d+="\0";var h,m=l.getBytes()+d+""+t;if(a){if(a.length!==i.digestLength)throw(h=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=a.length,h.digestLength=i.digestLength,h}else a=j.random.getBytes(i.digestLength);var g=r(a,c-i.digestLength-1,s),v=j.util.xorBytes(m,g,m.length),y=r(v,i.digestLength,s);return"\0"+j.util.xorBytes(a,y,a.length)+v},t.decode_rsa_oaep=function(e,t,n){var o,a,i;"string"==typeof n?(o=n,a=arguments[3]||void 0):n&&(o=n.label||void 0,a=n.md||void 0,n.mgf1&&n.mgf1.md&&(i=n.mgf1.md));var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s)throw(g=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,g.expectedLength=s,g;if(void 0===a?a=j.md.sha1.create():a.start(),i||(i=a),s<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");o||(o=""),a.update(o,"raw");for(var c=a.digest().getBytes(),u=t.charAt(0),l=t.substring(1,a.digestLength+1),d=t.substring(1+a.digestLength),f=r(d,a.digestLength,i),p=r(j.util.xorBytes(l,f,l.length),s-a.digestLength-1,i),h=j.util.xorBytes(d,p,d.length),m=h.substring(0,a.digestLength),g="\0"!==u,v=0;v<a.digestLength;++v)g|=c.charAt(v)!==m.charAt(v);for(var y=1,b=a.digestLength,C=a.digestLength;C<h.length;C++){var w=h.charCodeAt(C);g|=w&(y?65534:0),b+=y&=1&w^1}if(g||1!==h.charCodeAt(b))throw new Error("Invalid RSAES-OAEP padding.");return h.substring(b+1)}})),C((function(e){!function(){if(j.prime)e.exports=j.prime;else{var t=e.exports=j.prime=j.prime||{},r=j.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],o=new r(null);o.fromInt(30);var a=function(e,t){return e|t};t.generateProbablePrime=function(e,t,n){"function"==typeof t&&(n=t,t={});var o=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof o&&(o={name:o}),o.options=o.options||{};var a=t.prng||j.random,c={nextBytes:function(e){for(var t=a.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===o.name)return function(e,t,n,o){return"workers"in n?function(e,t,n,o){if("undefined"==typeof Worker)return i(e,t,n,o);var a=s(e,t),c=n.workers,u=n.workLoad||100,l=30*u/8,d=n.workerScript||"forge/prime.worker.js";if(-1===c)return j.util.estimateCores((function(e,t){e&&(t=2),c=t-1,f()}));function f(){c=Math.max(1,c);for(var n=[],i=0;i<c;++i)n[i]=new Worker(d);for(i=0;i<c;++i)n[i].addEventListener("message",p);var f=!1;function p(i){if(!f){var c=i.data;if(c.found){for(var d=0;d<n.length;++d)n[d].terminate();return f=!0,o(null,new r(c.prime,16))}a.bitLength()>e&&(a=s(e,t));var p=a.toString(16);i.target.postMessage({hex:p,workLoad:u}),a.dAddOffset(l,0)}}}f()}(e,t,n,o):i(e,t,n,o)}(e,c,o.options,n);throw new Error("Invalid prime generation algorithm: "+o.name)}}function i(e,t,r,o){var a=s(e,t),i=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(a.bitLength());"millerRabinTests"in r&&(i=r.millerRabinTests);var c=10;"maxBlockTime"in r&&(c=r.maxBlockTime),function e(t,r,o,a,i,c,u){var l=+new Date;do{if(t.bitLength()>r&&(t=s(r,o)),t.isProbablePrime(i))return u(null,t);t.dAddOffset(n[a++%8],0)}while(c<0||+new Date-l<c);j.util.setImmediate((function(){e(t,r,o,a,i,c,u)}))}(a,e,t,0,i,c,o)}function s(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),a,n),n.dAddOffset(31-n.mod(o).byteValue(),0),n}}()})),void 0===He)var He=j.jsbn.BigInteger;var Ke=j.util.isNodejs?t:null,We=j.asn1,Qe=j.util;j.pki=j.pki||{},j.pki.rsa=j.rsa=j.rsa||{};var Ge=j.pki,Xe=[6,4,2,4,2,4,6,2],Ye={name:"PrivateKeyInfo",tagClass:We.Class.UNIVERSAL,type:We.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:We.Class.UNIVERSAL,type:We.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:We.Class.UNIVERSAL,type:We.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:We.Class.UNIVERSAL,type:We.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},$e={name:"RSAPrivateKey",tagClass:We.Class.UNIVERSAL,type:We.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},Ze={name:"RSAPublicKey",tagClass:We.Class.UNIVERSAL,type:We.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:We.Class.UNIVERSAL,type:We.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},Je=j.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:We.Class.UNIVERSAL,type:We.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:We.Class.UNIVERSAL,type:We.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:We.Class.UNIVERSAL,type:We.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:We.Class.UNIVERSAL,type:We.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:We.Class.UNIVERSAL,type:We.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},et=function(e){var t;if(!(e.algorithm in Ge.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=Ge.oids[e.algorithm];var n=We.oidToDer(t).getBytes(),o=We.create(We.Class.UNIVERSAL,We.Type.SEQUENCE,!0,[]),a=We.create(We.Class.UNIVERSAL,We.Type.SEQUENCE,!0,[]);a.value.push(We.create(We.Class.UNIVERSAL,We.Type.OID,!1,n)),a.value.push(We.create(We.Class.UNIVERSAL,We.Type.NULL,!1,""));var i=We.create(We.Class.UNIVERSAL,We.Type.OCTETSTRING,!1,e.digest().getBytes());return o.value.push(a),o.value.push(i),We.toDer(o).getBytes()},tt=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var n;t.dP||(t.dP=t.d.mod(t.p.subtract(He.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(He.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{n=new He(j.util.bytesToHex(j.random.getBytes(t.n.bitLength()/8)),16)}while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(He.ONE));for(var o=(e=e.multiply(n.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);o.compareTo(a)<0;)o=o.add(t.p);return o.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a).multiply(n.modInverse(t.n)).mod(t.n)};function rt(e,t,r){var n=j.util.createBuffer(),o=Math.ceil(t.n.bitLength()/8);if(e.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=o-11,a}n.putByte(0),n.putByte(r);var i,s=o-3-e.length;if(0===r||1===r){i=0===r?0:255;for(var c=0;c<s;++c)n.putByte(i)}else for(;s>0;){var u=0,l=j.random.getBytes(s);for(c=0;c<s;++c)0===(i=l.charCodeAt(c))?++u:n.putByte(i);s=u}return n.putByte(0),n.putBytes(e),n}function nt(e,t,r,n){var o=Math.ceil(t.n.bitLength()/8),a=j.util.createBuffer(e),i=a.getByte(),s=a.getByte();if(0!==i||r&&0!==s&&1!==s||!r&&2!=s||r&&0===s&&void 0===n)throw new Error("Encryption block is invalid.");var c=0;if(0===s){c=o-3-n;for(var u=0;u<c;++u)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===s)for(c=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++c}else if(2===s)for(c=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++c}if(0!==a.getByte()||c!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function ot(e,t,r){"function"==typeof t&&(r=t,t={});var n={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function o(){a(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?i(t,e.q):void a(e.qBits,i))}))}function a(e,t){j.prime.generateProbablePrime(e,n,t)}function i(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var s=e.p;e.p=e.q,e.q=s}if(0!==e.p.subtract(He.ONE).gcd(e.e).compareTo(He.ONE))return e.p=null,void o();if(0!==e.q.subtract(He.ONE).gcd(e.e).compareTo(He.ONE))return e.q=null,void a(e.qBits,i);if(e.p1=e.p.subtract(He.ONE),e.q1=e.q.subtract(He.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(He.ONE))return e.p=e.q=null,void o();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void a(e.qBits,i);var c=e.e.modInverse(e.phi);e.keys={privateKey:Ge.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:Ge.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(n.prng=t.prng),o()}function at(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=j.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function it(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function st(e){return j.util.isNodejs&&"function"==typeof Ke[e]}function ct(e){return void 0!==Qe.globalScope&&"object"==By(Qe.globalScope.crypto)&&"object"==By(Qe.globalScope.crypto.subtle)&&"function"==typeof Qe.globalScope.crypto.subtle[e]}function ut(e){return void 0!==Qe.globalScope&&"object"==By(Qe.globalScope.msCrypto)&&"object"==By(Qe.globalScope.msCrypto.subtle)&&"function"==typeof Qe.globalScope.msCrypto.subtle[e]}function lt(e){for(var t=j.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}if(Ge.rsa.encrypt=function(e,t,r){var n,o=r,a=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(o=2===r,n=rt(e,t,r)):(n=j.util.createBuffer()).putBytes(e);for(var i=new He(n.toHex(),16),s=tt(i,t,o).toString(16),c=j.util.createBuffer(),u=a-Math.ceil(s.length/2);u>0;)c.putByte(0),--u;return c.putBytes(j.util.hexToBytes(s)),c.getBytes()},Ge.rsa.decrypt=function(e,t,r,n){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=o,a}var i=new He(j.util.createBuffer(e).toHex(),16);if(i.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=tt(i,t,r).toString(16),c=j.util.createBuffer(),u=o-Math.ceil(s.length/2);u>0;)c.putByte(0),--u;return c.putBytes(j.util.hexToBytes(s)),!1!==n?nt(c.getBytes(),t,r):c.getBytes()},Ge.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var n,o=(r=r||{}).prng||j.random,a={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},i=r.algorithm||"PRIMEINC";if("PRIMEINC"!==i)throw new Error("Invalid key generation algorithm: "+i);return(n={algorithm:i,state:0,bits:e,rng:a,eInt:t||65537,e:new He(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(n.eInt),n},Ge.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new He(null);r.fromInt(30);for(var n,o=0,a=function(e,t){return e|t},i=+new Date,s=0;null===e.keys&&(t<=0||s<t);){if(0===e.state){var c=null===e.p?e.pBits:e.qBits,u=c-1;0===e.pqState?(e.num=new He(c,e.rng),e.num.testBit(u)||e.num.bitwiseTo(He.ONE.shiftLeft(u),a,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),o=0,++e.pqState):1===e.pqState?e.num.bitLength()>c?e.pqState=0:e.num.isProbablePrime(it(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(Xe[o++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(He.ONE).gcd(e.e).compareTo(He.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(He.ONE),e.q1=e.q.subtract(He.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(He.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var l=e.e.modInverse(e.phi);e.keys={privateKey:Ge.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:Ge.rsa.setPublicKey(e.n,e.e)}}s+=(n=+new Date)-i,i=n}return null!==e.keys},Ge.rsa.generateKeyPair=function(e,t,r,n){if(1===arguments.length?"object"==By(e)?(r=e,e=void 0):"function"==typeof e&&(n=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(n=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(n){if(st("generateKeyPair"))return Ke.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return n(e);n(null,{privateKey:Ge.privateKeyFromPem(r),publicKey:Ge.publicKeyFromPem(t)})}));if(ct("generateKey")&&ct("exportKey"))return Qe.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:lt(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return Qe.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){n(e)})).then((function(e){if(e){var t=Ge.privateKeyFromAsn1(We.fromDer(j.util.createBuffer(e)));n(null,{privateKey:t,publicKey:Ge.setRsaPublicKey(t.n,t.e)})}}));if(ut("generateKey")&&ut("exportKey")){var o=Qe.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:lt(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return o.oncomplete=function(e){var t=e.target.result,r=Qe.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=Ge.privateKeyFromAsn1(We.fromDer(j.util.createBuffer(t)));n(null,{privateKey:r,publicKey:Ge.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){n(e)}},void(o.onerror=function(e){n(e)})}}else if(st("generateKeyPairSync")){var a=Ke.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Ge.privateKeyFromPem(a.privateKey),publicKey:Ge.publicKeyFromPem(a.publicKey)}}var i=Ge.rsa.createKeyPairGenerationState(e,t,r);if(!n)return Ge.rsa.stepKeyPairGenerationState(i,0),i.keys;ot(i,r,n)},Ge.setRsaPublicKey=Ge.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,n){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return rt(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return j.pkcs1.encode_rsa_oaep(t,e,n)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var o=t.encode(e,r,!0);return Ge.rsa.encrypt(o,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=nt(t,r,!0),e===We.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===nt(t,r,!0)}});var o=Ge.rsa.decrypt(t,r,!0,!1);return n.verify(e,o,r.n.bitLength())}};return r},Ge.setRsaPrivateKey=Ge.rsa.setPrivateKey=function(e,t,r,n,o,a,i,s){var c={n:e,e:t,d:r,p:n,q:o,dP:a,dQ:i,qInv:s,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var n=Ge.rsa.decrypt(e,c,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:nt};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return j.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(n,c,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:et},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,c.n.bitLength());return Ge.rsa.encrypt(n,c,r)}};return c},Ge.wrapRsaPrivateKey=function(e){return We.create(We.Class.UNIVERSAL,We.Type.SEQUENCE,!0,[We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,We.integerToDer(0).getBytes()),We.create(We.Class.UNIVERSAL,We.Type.SEQUENCE,!0,[We.create(We.Class.UNIVERSAL,We.Type.OID,!1,We.oidToDer(Ge.oids.rsaEncryption).getBytes()),We.create(We.Class.UNIVERSAL,We.Type.NULL,!1,"")]),We.create(We.Class.UNIVERSAL,We.Type.OCTETSTRING,!1,We.toDer(e).getBytes())])},Ge.privateKeyFromAsn1=function(e){var t,r,n,o,a,i,s,c,u={},l=[];if(We.validate(e,Ye,u,l)&&(e=We.fromDer(j.util.createBuffer(u.privateKey))),u={},l=[],!We.validate(e,$e,u,l)){var d=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw d.errors=l,d}return t=j.util.createBuffer(u.privateKeyModulus).toHex(),r=j.util.createBuffer(u.privateKeyPublicExponent).toHex(),n=j.util.createBuffer(u.privateKeyPrivateExponent).toHex(),o=j.util.createBuffer(u.privateKeyPrime1).toHex(),a=j.util.createBuffer(u.privateKeyPrime2).toHex(),i=j.util.createBuffer(u.privateKeyExponent1).toHex(),s=j.util.createBuffer(u.privateKeyExponent2).toHex(),c=j.util.createBuffer(u.privateKeyCoefficient).toHex(),Ge.setRsaPrivateKey(new He(t,16),new He(r,16),new He(n,16),new He(o,16),new He(a,16),new He(i,16),new He(s,16),new He(c,16))},Ge.privateKeyToAsn1=Ge.privateKeyToRSAPrivateKey=function(e){return We.create(We.Class.UNIVERSAL,We.Type.SEQUENCE,!0,[We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,We.integerToDer(0).getBytes()),We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,at(e.n)),We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,at(e.e)),We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,at(e.d)),We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,at(e.p)),We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,at(e.q)),We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,at(e.dP)),We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,at(e.dQ)),We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,at(e.qInv))])},Ge.publicKeyFromAsn1=function(e){var t={},r=[];if(We.validate(e,Je,t,r)){var n,o=We.derToOid(t.publicKeyOid);if(o!==Ge.oids.rsaEncryption)throw(n=new Error("Cannot read public key. Unknown OID.")).oid=o,n;e=t.rsaPublicKey}if(r=[],!We.validate(e,Ze,t,r))throw(n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,n;var a=j.util.createBuffer(t.publicKeyModulus).toHex(),i=j.util.createBuffer(t.publicKeyExponent).toHex();return Ge.setRsaPublicKey(new He(a,16),new He(i,16))},Ge.publicKeyToAsn1=Ge.publicKeyToSubjectPublicKeyInfo=function(e){return We.create(We.Class.UNIVERSAL,We.Type.SEQUENCE,!0,[We.create(We.Class.UNIVERSAL,We.Type.SEQUENCE,!0,[We.create(We.Class.UNIVERSAL,We.Type.OID,!1,We.oidToDer(Ge.oids.rsaEncryption).getBytes()),We.create(We.Class.UNIVERSAL,We.Type.NULL,!1,"")]),We.create(We.Class.UNIVERSAL,We.Type.BITSTRING,!1,[Ge.publicKeyToRSAPublicKey(e)])])},Ge.publicKeyToRSAPublicKey=function(e){return We.create(We.Class.UNIVERSAL,We.Type.SEQUENCE,!0,[We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,at(e.n)),We.create(We.Class.UNIVERSAL,We.Type.INTEGER,!1,at(e.e))])},void 0===dt)var dt=j.jsbn.BigInteger;var ft=j.asn1,pt=j.pki=j.pki||{},ht=(pt.pbe=j.pbe=j.pbe||{},pt.oids),mt={name:"EncryptedPrivateKeyInfo",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},gt={name:"PBES2Algorithms",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:ft.Class.UNIVERSAL,type:ft.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:ft.Class.UNIVERSAL,type:ft.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},vt={name:"pkcs-12PbeParams",tagClass:ft.Class.UNIVERSAL,type:ft.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:ft.Class.UNIVERSAL,type:ft.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:ft.Class.UNIVERSAL,type:ft.Type.INTEGER,constructed:!1,capture:"iterations"}]};function yt(e,t){return e.start().update(t).digest().getBytes()}function bt(e){var t;if(e){if(!(t=pt.oids[ft.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return Ct(t)}function Ct(e){var t=j.md;switch(e){case"hmacWithSHA224":t=j.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}pt.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n,o,a,i=j.random.getBytesSync(r.saltSize),s=r.count,c=ft.integerToDer(s);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var u,l,d;switch(r.algorithm){case"aes128":n=16,u=16,l=ht["aes128-CBC"],d=j.aes.createEncryptionCipher;break;case"aes192":n=24,u=16,l=ht["aes192-CBC"],d=j.aes.createEncryptionCipher;break;case"aes256":n=32,u=16,l=ht["aes256-CBC"],d=j.aes.createEncryptionCipher;break;case"des":n=8,u=8,l=ht.desCBC,d=j.des.createEncryptionCipher;break;default:throw(v=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,v}var f="hmacWith"+r.prfAlgorithm.toUpperCase(),p=Ct(f),h=j.pkcs5.pbkdf2(t,i,s,n,p),m=j.random.getBytesSync(u);(y=d(h)).start(m),y.update(ft.toDer(e)),y.finish(),a=y.output.getBytes();var g=function(e,t,r,n){var o=ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OCTETSTRING,!1,e),ft.create(ft.Class.UNIVERSAL,ft.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==n&&o.value.push(ft.create(ft.Class.UNIVERSAL,ft.Type.INTEGER,!1,j.util.hexToBytes(r.toString(16))),ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OID,!1,ft.oidToDer(pt.oids[n]).getBytes()),ft.create(ft.Class.UNIVERSAL,ft.Type.NULL,!1,"")])),o}(i,c,n,f);o=ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OID,!1,ft.oidToDer(ht.pkcs5PBES2).getBytes()),ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OID,!1,ft.oidToDer(ht.pkcs5PBKDF2).getBytes()),g]),ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OID,!1,ft.oidToDer(l).getBytes()),ft.create(ft.Class.UNIVERSAL,ft.Type.OCTETSTRING,!1,m)])])])}else{var v;if("3des"!==r.algorithm)throw(v=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,v;n=24;var y,b=new j.util.ByteBuffer(i);h=pt.pbe.generatePkcs12Key(t,b,1,s,n),m=pt.pbe.generatePkcs12Key(t,b,2,s,n),(y=j.des.createEncryptionCipher(h)).start(m),y.update(ft.toDer(e)),y.finish(),a=y.output.getBytes(),o=ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OID,!1,ft.oidToDer(ht["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[ft.create(ft.Class.UNIVERSAL,ft.Type.OCTETSTRING,!1,i),ft.create(ft.Class.UNIVERSAL,ft.Type.INTEGER,!1,c.getBytes())])])}return ft.create(ft.Class.UNIVERSAL,ft.Type.SEQUENCE,!0,[o,ft.create(ft.Class.UNIVERSAL,ft.Type.OCTETSTRING,!1,a)])},pt.decryptPrivateKeyInfo=function(e,t){var r=null,n={},o=[];if(!ft.validate(e,mt,n,o)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=o,a}var i=ft.derToOid(n.encryptionOid),s=pt.pbe.getCipher(i,n.encryptionParams,t),c=j.util.createBuffer(n.encryptedData);return s.update(c),s.finish()&&(r=ft.fromDer(s.output)),r},pt.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:ft.toDer(e).getBytes()};return j.pem.encode(r,{maxline:t})},pt.encryptedPrivateKeyFromPem=function(e){var t=j.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return ft.fromDer(t.body)},pt.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var n=pt.wrapRsaPrivateKey(pt.privateKeyToAsn1(e));return n=pt.encryptPrivateKeyInfo(n,t,r),pt.encryptedPrivateKeyToPem(n)}var o,a,i,s;switch(r.algorithm){case"aes128":o="AES-128-CBC",i=16,a=j.random.getBytesSync(16),s=j.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",i=24,a=j.random.getBytesSync(16),s=j.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",i=32,a=j.random.getBytesSync(16),s=j.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",i=24,a=j.random.getBytesSync(8),s=j.des.createEncryptionCipher;break;case"des":o="DES-CBC",i=8,a=j.random.getBytesSync(8),s=j.des.createEncryptionCipher;break;default:var c=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw c.algorithm=r.algorithm,c}var u=s(j.pbe.opensslDeriveBytes(t,a.substr(0,8),i));u.start(a),u.update(ft.toDer(pt.privateKeyToAsn1(e))),u.finish();var l={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:j.util.bytesToHex(a).toUpperCase()},body:u.output.getBytes()};return j.pem.encode(l)},pt.decryptRsaPrivateKey=function(e,t){var r=null,n=j.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==n.type&&"PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type)throw(i=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=i,i;if(n.procType&&"ENCRYPTED"===n.procType.type){var o,a;switch(n.dekInfo.algorithm){case"DES-CBC":o=8,a=j.des.createDecryptionCipher;break;case"DES-EDE3-CBC":o=24,a=j.des.createDecryptionCipher;break;case"AES-128-CBC":o=16,a=j.aes.createDecryptionCipher;break;case"AES-192-CBC":o=24,a=j.aes.createDecryptionCipher;break;case"AES-256-CBC":o=32,a=j.aes.createDecryptionCipher;break;case"RC2-40-CBC":o=5,a=function(e){return j.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":o=8,a=function(e){return j.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":o=16,a=function(e){return j.rc2.createDecryptionCipher(e,128)};break;default:var i;throw(i=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".')).algorithm=n.dekInfo.algorithm,i}var s=j.util.hexToBytes(n.dekInfo.parameters),c=a(j.pbe.opensslDeriveBytes(t,s.substr(0,8),o));if(c.start(s),c.update(j.util.createBuffer(n.body)),!c.finish())return r;r=c.output.getBytes()}else r=n.body;return null!==(r="ENCRYPTED PRIVATE KEY"===n.type?pt.decryptPrivateKeyInfo(ft.fromDer(r),t):ft.fromDer(r))&&(r=pt.privateKeyFromAsn1(r)),r},pt.pbe.generatePkcs12Key=function(e,t,r,n,o,a){var i,s;if(null==a){if(!("sha1"in j.md))throw new Error('"sha1" hash algorithm unavailable.');a=j.md.sha1.create()}var c=a.digestLength,u=a.blockLength,l=new j.util.ByteBuffer,d=new j.util.ByteBuffer;if(null!=e){for(s=0;s<e.length;s++)d.putInt16(e.charCodeAt(s));d.putInt16(0)}var f=d.length(),p=t.length(),h=new j.util.ByteBuffer;h.fillWithByte(r,u);var m=u*Math.ceil(p/u),g=new j.util.ByteBuffer;for(s=0;s<m;s++)g.putByte(t.at(s%p));var v=u*Math.ceil(f/u),y=new j.util.ByteBuffer;for(s=0;s<v;s++)y.putByte(d.at(s%f));var b=g;b.putBuffer(y);for(var C=Math.ceil(o/c),w=1;w<=C;w++){var k=new j.util.ByteBuffer;k.putBytes(h.bytes()),k.putBytes(b.bytes());for(var S=0;S<n;S++)a.start(),a.update(k.getBytes()),k=a.digest();var E=new j.util.ByteBuffer;for(s=0;s<u;s++)E.putByte(k.at(s%c));var B=Math.ceil(p/u)+Math.ceil(f/u),_=new j.util.ByteBuffer;for(i=0;i<B;i++){var x=new j.util.ByteBuffer(b.getBytes(u)),T=511;for(s=E.length()-1;s>=0;s--)T>>=8,T+=E.at(s)+x.at(s),x.setAt(s,255&T);_.putBuffer(x)}b=_,l.putBuffer(k)}return l.truncate(l.length()-o),l},pt.pbe.getCipher=function(e,t,r){switch(e){case pt.oids.pkcs5PBES2:return pt.pbe.getCipherForPBES2(e,t,r);case pt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case pt.oids["pbewithSHAAnd40BitRC2-CBC"]:return pt.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},pt.pbe.getCipherForPBES2=function(e,t,r){var n,o={},a=[];if(!ft.validate(t,gt,o,a))throw(n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,n;if((e=ft.derToOid(o.kdfOid))!==pt.oids.pkcs5PBKDF2)throw(n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,n.supportedOids=["pkcs5PBKDF2"],n;if((e=ft.derToOid(o.encOid))!==pt.oids["aes128-CBC"]&&e!==pt.oids["aes192-CBC"]&&e!==pt.oids["aes256-CBC"]&&e!==pt.oids["des-EDE3-CBC"]&&e!==pt.oids.desCBC)throw(n=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,n.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],n;var i,s,c=o.kdfSalt,u=j.util.createBuffer(o.kdfIterationCount);switch(u=u.getInt(u.length()<<3),pt.oids[e]){case"aes128-CBC":i=16,s=j.aes.createDecryptionCipher;break;case"aes192-CBC":i=24,s=j.aes.createDecryptionCipher;break;case"aes256-CBC":i=32,s=j.aes.createDecryptionCipher;break;case"des-EDE3-CBC":i=24,s=j.des.createDecryptionCipher;break;case"desCBC":i=8,s=j.des.createDecryptionCipher}var l=bt(o.prfOid),d=j.pkcs5.pbkdf2(r,c,u,i,l),f=o.encIv,p=s(d);return p.start(f),p},pt.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},o=[];if(!ft.validate(t,vt,n,o))throw(l=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=o,l;var a,i,s,c=j.util.createBuffer(n.salt),u=j.util.createBuffer(n.iterations);switch(u=u.getInt(u.length()<<3),e){case pt.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:a=24,i=8,s=j.des.startDecrypting;break;case pt.oids["pbewithSHAAnd40BitRC2-CBC"]:a=5,i=8,s=function(e,t){var r=j.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var l;throw(l=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,l}var d=bt(n.prfOid),f=pt.pbe.generatePkcs12Key(r,c,1,u,a,d);return d.start(),s(f,pt.pbe.generatePkcs12Key(r,c,2,u,i,d))},pt.pbe.opensslDeriveBytes=function(e,t,r,n){if(null==n){if(!("md5"in j.md))throw new Error('"md5" hash algorithm unavailable.');n=j.md.md5.create()}null===t&&(t="");for(var o=[yt(n,e+t)],a=16,i=1;a<r;++i,a+=16)o.push(yt(n,o[i-1]+e+t));return o.join("").substr(0,r)},C((function(e){var t=j.asn1,r=e.exports=j.pkcs7asn1=j.pkcs7asn1||{};j.pkcs7=j.pkcs7||{},j.pkcs7.asn1=r;var n={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};r.contentInfoValidator=n;var o={name:"EncryptedContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};r.envelopedDataValidator={name:"EnvelopedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},r.encryptedDataValidator={name:"EncryptedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var a={name:"SignerInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};r.signedDataValidator={name:"SignedData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},n,{name:"SignedData.Certificates",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,capture:"signerInfos",optional:!0,value:[a]}]},r.recipientInfoValidator={name:"RecipientInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:t.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}})),C((function(e){j.mgf=j.mgf||{},(e.exports=j.mgf.mgf1=j.mgf1=j.mgf1||{}).create=function(e){return{generate:function(t,r){for(var n=new j.util.ByteBuffer,o=Math.ceil(r/e.digestLength),a=0;a<o;a++){var i=new j.util.ByteBuffer;i.putInt32(a),e.start(),e.update(t+i.getBytes()),n.putBuffer(e.digest())}return n.truncate(n.length()-r),n.getBytes()}}}})),j.mgf=j.mgf||{},j.mgf.mgf1=j.mgf1,C((function(e){(e.exports=j.pss=j.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,n=e.mgf,o=r.digestLength,a=e.salt||null;if("string"==typeof a&&(a=j.util.createBuffer(a)),"saltLength"in e)t=e.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");t=a.length()}if(null!==a&&a.length()!==t)throw new Error("Given salt length does not match length of given salt.");var i=e.prng||j.random;return{encode:function(e,s){var c,u,l=s-1,d=Math.ceil(l/8),f=e.digest().getBytes();if(d<o+t+2)throw new Error("Message is too long to encrypt.");u=null===a?i.getBytesSync(t):a.bytes();var p=new j.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(f),p.putBytes(u),r.start(),r.update(p.getBytes());var h=r.digest().getBytes(),m=new j.util.ByteBuffer;m.fillWithByte(0,d-t-o-2),m.putByte(1),m.putBytes(u);var g=m.getBytes(),v=d-o-1,y=n.generate(h,v),b="";for(c=0;c<v;c++)b+=String.fromCharCode(g.charCodeAt(c)^y.charCodeAt(c));var C=65280>>8*d-l&255;return(b=String.fromCharCode(b.charCodeAt(0)&~C)+b.substr(1))+h+String.fromCharCode(188)},verify:function(e,a,i){var s,c=i-1,u=Math.ceil(c/8);if(a=a.substr(-u),u<o+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==a.charCodeAt(u-1))throw new Error("Encoded message does not end in 0xBC.");var l=u-o-1,d=a.substr(0,l),f=a.substr(l,o),p=65280>>8*u-c&255;if(0!=(d.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var h=n.generate(f,l),m="";for(s=0;s<l;s++)m+=String.fromCharCode(d.charCodeAt(s)^h.charCodeAt(s));m=String.fromCharCode(m.charCodeAt(0)&~p)+m.substr(1);var g=u-o-t-2;for(s=0;s<g;s++)if(0!==m.charCodeAt(s))throw new Error("Leftmost octets not zero as expected");if(1!==m.charCodeAt(g))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var v=m.substr(-t),y=new j.util.ByteBuffer;return y.fillWithByte(0,8),y.putBytes(e),y.putBytes(v),r.start(),r.update(y.getBytes()),f===r.digest().getBytes()}}}})),C((function(e){var t=j.asn1,r=e.exports=j.pki=j.pki||{},n=r.oids,o={};o.CN=n.commonName,o.commonName="CN",o.C=n.countryName,o.countryName="C",o.L=n.localityName,o.localityName="L",o.ST=n.stateOrProvinceName,o.stateOrProvinceName="ST",o.O=n.organizationName,o.organizationName="O",o.OU=n.organizationalUnitName,o.organizationalUnitName="OU",o.E=n.emailAddress,o.emailAddress="E";var a=j.pki.rsa.publicKeyValidator,i={name:"Certificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:t.Class.UNIVERSAL,type:t.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:t.Class.UNIVERSAL,type:t.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},a,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},s={name:"rsapss",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:t.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:t.Class.UNIVERSAL,type:t.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:t.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:t.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:t.Class.UNIVERSAL,type:t.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},c={name:"CertificationRequestInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},a,{name:"CertificationRequestInfo.attributes",tagClass:t.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0}]}]}]},u={name:"CertificationRequest",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[c,{name:"CertificationRequest.signatureAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:t.Class.UNIVERSAL,type:t.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function l(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,o=0;null===n&&o<e.attributes.length;++o)r=e.attributes[o],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}r.RDNAttributesAsArray=function(e,r){for(var a,i,s,c=[],u=0;u<e.value.length;++u){a=e.value[u];for(var l=0;l<a.value.length;++l)s={},i=a.value[l],s.type=t.derToOid(i.value[0].value),s.value=i.value[1].value,s.valueTagClass=i.value[1].type,s.type in n&&(s.name=n[s.type],s.name in o&&(s.shortName=o[s.name])),r&&(r.update(s.type),r.update(s.value)),c.push(s)}return c},r.CRIAttributesAsArray=function(e){for(var a=[],i=0;i<e.length;++i)for(var s=e[i],c=t.derToOid(s.value[0].value),u=s.value[1].value,l=0;l<u.length;++l){var d={};if(d.type=c,d.value=u[l].value,d.valueTagClass=u[l].type,d.type in n&&(d.name=n[d.type],d.name in o&&(d.shortName=o[d.name])),d.type===n.extensionRequest){d.extensions=[];for(var f=0;f<d.value.length;++f)d.extensions.push(r.certificateExtensionFromAsn1(d.value[f]))}a.push(d)}return a};var d=function(e,r,o){var a={};if(e!==n["RSASSA-PSS"])return a;o&&(a={hash:{algorithmOid:n.sha1},mgf:{algorithmOid:n.mgf1,hash:{algorithmOid:n.sha1}},saltLength:20});var i={},c=[];if(!t.validate(r,s,i,c)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=c,u}return void 0!==i.hashOid&&(a.hash=a.hash||{},a.hash.algorithmOid=t.derToOid(i.hashOid)),void 0!==i.maskGenOid&&(a.mgf=a.mgf||{},a.mgf.algorithmOid=t.derToOid(i.maskGenOid),a.mgf.hash=a.mgf.hash||{},a.mgf.hash.algorithmOid=t.derToOid(i.maskGenHashOid)),void 0!==i.saltLength&&(a.saltLength=i.saltLength.charCodeAt(0)),a};function f(e){for(var r,n,o=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),a=e.attributes,i=0;i<a.length;++i){var s=(r=a[i]).value,c=t.Type.PRINTABLESTRING;"valueTagClass"in r&&(c=r.valueTagClass)===t.Type.UTF8&&(s=j.util.encodeUtf8(s)),n=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.type).getBytes()),t.create(t.Class.UNIVERSAL,c,!1,s)])]),o.value.push(n)}return o}function p(e){for(var a,i=0;i<e.length;++i){if(void 0===(a=e[i]).name&&(a.type&&a.type in r.oids?a.name=r.oids[a.type]:a.shortName&&a.shortName in o&&(a.name=r.oids[o[a.shortName]])),void 0===a.type){if(!a.name||!(a.name in r.oids))throw(c=new Error("Attribute type not specified.")).attribute=a,c;a.type=r.oids[a.name]}if(void 0===a.shortName&&a.name&&a.name in o&&(a.shortName=o[a.name]),a.type===n.extensionRequest&&(a.valueConstructed=!0,a.valueTagClass=t.Type.SEQUENCE,!a.value&&a.extensions)){a.value=[];for(var s=0;s<a.extensions.length;++s)a.value.push(r.certificateExtensionToAsn1(h(a.extensions[s])))}var c;if(void 0===a.value)throw(c=new Error("Attribute value not specified.")).attribute=a,c}}function h(e,o){if(o=o||{},void 0===e.name&&e.id&&e.id in r.oids&&(e.name=r.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in r.oids))throw(C=new Error("Extension ID not specified.")).extension=e,C;e.id=r.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var a=0,i=0,s=0;e.digitalSignature&&(i|=128,a=7),e.nonRepudiation&&(i|=64,a=6),e.keyEncipherment&&(i|=32,a=5),e.dataEncipherment&&(i|=16,a=4),e.keyAgreement&&(i|=8,a=3),e.keyCertSign&&(i|=4,a=2),e.cRLSign&&(i|=2,a=1),e.encipherOnly&&(i|=1,a=0),e.decipherOnly&&(s|=128,a=7);var c=String.fromCharCode(a);0!==s?c+=String.fromCharCode(i)+String.fromCharCode(s):0!==i&&(c+=String.fromCharCode(i)),e.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,c)}else if("basicConstraints"===e.name)e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);var u=e.value.value;for(var l in e)!0===e[l]&&(l in n?u.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(n[l]).getBytes())):-1!==l.indexOf(".")&&u.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(l).getBytes())))}else if("nsCertType"===e.name)a=0,i=0,e.client&&(i|=128,a=7),e.server&&(i|=64,a=6),e.email&&(i|=32,a=5),e.objsign&&(i|=16,a=4),e.reserved&&(i|=8,a=3),e.sslCA&&(i|=4,a=2),e.emailCA&&(i|=2,a=1),e.objCA&&(i|=1,a=0),c=String.fromCharCode(a),0!==i&&(c+=String.fromCharCode(i)),e.value=t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,c);else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);for(var d=0;d<e.altNames.length;++d){if(c=(v=e.altNames[d]).value,7===v.type&&v.ip){if(null===(c=j.util.bytesFromIP(v.ip)))throw(C=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,C}else 8===v.type&&(c=v.oid?t.oidToDer(t.oidToDer(v.oid)):t.oidToDer(c));e.value.value.push(t.create(t.Class.CONTEXT_SPECIFIC,v.type,!1,c))}}else if("nsComment"===e.name&&o.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=t.create(t.Class.UNIVERSAL,t.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&o.cert){var p=o.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===e.name&&o.cert){if(e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),u=e.value.value,e.keyIdentifier){var h=!0===e.keyIdentifier?o.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;u.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!1,h))}if(e.authorityCertIssuer){var m=[t.create(t.Class.CONTEXT_SPECIFIC,4,!0,[f(!0===e.authorityCertIssuer?o.cert.issuer:e.authorityCertIssuer)])];u.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,m))}if(e.serialNumber){var g=j.util.hexToBytes(!0===e.serialNumber?o.cert.serialNumber:e.serialNumber);u.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===e.name){e.value=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),u=e.value.value;var v,y=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]),b=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);for(d=0;d<e.altNames.length;++d){if(c=(v=e.altNames[d]).value,7===v.type&&v.ip){if(null===(c=j.util.bytesFromIP(v.ip)))throw(C=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,C}else 8===v.type&&(c=v.oid?t.oidToDer(t.oidToDer(v.oid)):t.oidToDer(c));b.value.push(t.create(t.Class.CONTEXT_SPECIFIC,v.type,!1,c))}y.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[b])),u.push(y)}var C;if(void 0===e.value)throw(C=new Error("Extension value not specified.")).extension=e,C;return e}function m(e,r){switch(e){case n["RSASSA-PSS"]:var o=[];return void 0!==r.hash.algorithmOid&&o.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])),void 0!==r.mgf.algorithmOid&&o.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.mgf.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.mgf.hash.algorithmOid).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])])])),void 0!==r.saltLength&&o.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(r.saltLength).getBytes())])),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,o);default:return t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")}}function g(e){var r=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return r;for(var n=e.attributes,o=0;o<n.length;++o){var a=n[o],i=a.value,s=t.Type.UTF8;"valueTagClass"in a&&(s=a.valueTagClass),s===t.Type.UTF8&&(i=j.util.encodeUtf8(i));var c=!1;"valueConstructed"in a&&(c=a.valueConstructed);var u=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(a.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,s,c,i)])]);r.value.push(u)}return r}r.certificateFromPem=function(e,n,o){var a=j.pem.decode(e)[0];if("CERTIFICATE"!==a.type&&"X509 CERTIFICATE"!==a.type&&"TRUSTED CERTIFICATE"!==a.type){var i=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw i.headerType=a.type,i}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var s=t.fromDer(a.body,o);return r.certificateFromAsn1(s,n)},r.certificateToPem=function(e,n){var o={type:"CERTIFICATE",body:t.toDer(r.certificateToAsn1(e)).getBytes()};return j.pem.encode(o,{maxline:n})},r.publicKeyFromPem=function(e){var n=j.pem.decode(e)[0];if("PUBLIC KEY"!==n.type&&"RSA PUBLIC KEY"!==n.type){var o=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw o.headerType=n.type,o}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var a=t.fromDer(n.body);return r.publicKeyFromAsn1(a)},r.publicKeyToPem=function(e,n){var o={type:"PUBLIC KEY",body:t.toDer(r.publicKeyToAsn1(e)).getBytes()};return j.pem.encode(o,{maxline:n})},r.publicKeyToRSAPublicKeyPem=function(e,n){var o={type:"RSA PUBLIC KEY",body:t.toDer(r.publicKeyToRSAPublicKey(e)).getBytes()};return j.pem.encode(o,{maxline:n})},r.getPublicKeyFingerprint=function(e,n){var o,a=(n=n||{}).md||j.md.sha1.create();switch(n.type||"RSAPublicKey"){case"RSAPublicKey":o=t.toDer(r.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":o=t.toDer(r.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+n.type+'".')}a.start(),a.update(o);var i=a.digest();if("hex"===n.encoding){var s=i.toHex();return n.delimiter?s.match(/.{2}/g).join(n.delimiter):s}if("binary"===n.encoding)return i.getBytes();if(n.encoding)throw new Error('Unknown encoding "'+n.encoding+'".');return i},r.certificationRequestFromPem=function(e,n,o){var a=j.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==a.type){var i=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw i.headerType=a.type,i}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var s=t.fromDer(a.body,o);return r.certificationRequestFromAsn1(s,n)},r.certificationRequestToPem=function(e,n){var o={type:"CERTIFICATE REQUEST",body:t.toDer(r.certificationRequestToAsn1(e)).getBytes()};return j.pem.encode(o,{maxline:n})},r.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return l(e.issuer,t)},e.issuer.addField=function(t){p([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return l(e.subject,t)},e.subject.addField=function(t){p([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){p(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){p(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)h(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,n=null,o=0;null===n&&o<e.extensions.length;++o)r=e.extensions[o],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(o,a){e.md=a||j.md.sha1.create();var i=n[e.md.algorithm+"WithRSAEncryption"];if(!i){var s=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw s.algorithm=e.md.algorithm,s}e.signatureOid=e.siginfo.algorithmOid=i,e.tbsCertificate=r.getTBSCertificate(e);var c=t.toDer(e.tbsCertificate);e.md.update(c.getBytes()),e.signature=o.sign(e.md)},e.verify=function(o){var a=!1;if(!e.issued(o)){var i=o.issuer,s=e.subject;throw(h=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=i.attributes,h.actualIssuer=s.attributes,h}var c=o.md;if(null===c){if(o.signatureOid in n)switch(n[o.signatureOid]){case"sha1WithRSAEncryption":c=j.md.sha1.create();break;case"md5WithRSAEncryption":c=j.md.md5.create();break;case"sha256WithRSAEncryption":c=j.md.sha256.create();break;case"sha384WithRSAEncryption":c=j.md.sha384.create();break;case"sha512WithRSAEncryption":c=j.md.sha512.create();break;case"RSASSA-PSS":c=j.md.sha256.create()}if(null===c)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=o.signatureOid,h;var u=o.tbsCertificate||r.getTBSCertificate(o),l=t.toDer(u);c.update(l.getBytes())}if(null!==c){var d;switch(o.signatureOid){case n.sha1WithRSAEncryption:d=void 0;break;case n["RSASSA-PSS"]:var f,p,h;if(void 0===(f=n[o.signatureParameters.mgf.hash.algorithmOid])||void 0===j.md[f])throw(h=new Error("Unsupported MGF hash function.")).oid=o.signatureParameters.mgf.hash.algorithmOid,h.name=f,h;if(void 0===(p=n[o.signatureParameters.mgf.algorithmOid])||void 0===j.mgf[p])throw(h=new Error("Unsupported MGF function.")).oid=o.signatureParameters.mgf.algorithmOid,h.name=p,h;if(p=j.mgf[p].create(j.md[f].create()),void 0===(f=n[o.signatureParameters.hash.algorithmOid])||void 0===j.md[f])throw{message:"Unsupported RSASSA-PSS hash function.",oid:o.signatureParameters.hash.algorithmOid,name:f};d=j.pss.create(j.md[f].create(),p,o.signatureParameters.saltLength)}a=e.publicKey.verify(c.digest().getBytes(),o.signature,d)}return a},e.isIssuer=function(t){var r=!1,n=e.issuer,o=t.subject;if(n.hash&&o.hash)r=n.hash===o.hash;else if(n.attributes.length===o.attributes.length){var a,i;r=!0;for(var s=0;r&&s<n.attributes.length;++s)a=n.attributes[s],i=o.attributes[s],a.type===i.type&&a.value===i.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return r.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=n.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var o=e.extensions[r];if(o.id===t){var a=e.generateSubjectKeyIdentifier().getBytes();return j.util.hexToBytes(o.subjectKeyIdentifier)===a}}return!1},e},r.certificateFromAsn1=function(e,o){var a={},s=[];if(!t.validate(e,i,a,s))throw(h=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=s,h;if(t.derToOid(a.publicKeyOid)!==r.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=r.createCertificate();c.version=a.certVersion?a.certVersion.charCodeAt(0):0;var u=j.util.createBuffer(a.certSerialNumber);c.serialNumber=u.toHex(),c.signatureOid=j.asn1.derToOid(a.certSignatureOid),c.signatureParameters=d(c.signatureOid,a.certSignatureParams,!0),c.siginfo.algorithmOid=j.asn1.derToOid(a.certinfoSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,a.certinfoSignatureParams,!1),c.signature=a.certSignature;var f=[];if(void 0!==a.certValidity1UTCTime&&f.push(t.utcTimeToDate(a.certValidity1UTCTime)),void 0!==a.certValidity2GeneralizedTime&&f.push(t.generalizedTimeToDate(a.certValidity2GeneralizedTime)),void 0!==a.certValidity3UTCTime&&f.push(t.utcTimeToDate(a.certValidity3UTCTime)),void 0!==a.certValidity4GeneralizedTime&&f.push(t.generalizedTimeToDate(a.certValidity4GeneralizedTime)),f.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=f[0],c.validity.notAfter=f[1],c.tbsCertificate=a.tbsCertificate,o){var h;if(c.md=null,c.signatureOid in n)switch(n[c.signatureOid]){case"sha1WithRSAEncryption":c.md=j.md.sha1.create();break;case"md5WithRSAEncryption":c.md=j.md.md5.create();break;case"sha256WithRSAEncryption":c.md=j.md.sha256.create();break;case"sha384WithRSAEncryption":c.md=j.md.sha384.create();break;case"sha512WithRSAEncryption":c.md=j.md.sha512.create();break;case"RSASSA-PSS":c.md=j.md.sha256.create()}if(null===c.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=c.signatureOid,h;var m=t.toDer(c.tbsCertificate);c.md.update(m.getBytes())}var g=j.md.sha1.create();c.issuer.getField=function(e){return l(c.issuer,e)},c.issuer.addField=function(e){p([e]),c.issuer.attributes.push(e)},c.issuer.attributes=r.RDNAttributesAsArray(a.certIssuer,g),a.certIssuerUniqueId&&(c.issuer.uniqueId=a.certIssuerUniqueId),c.issuer.hash=g.digest().toHex();var v=j.md.sha1.create();return c.subject.getField=function(e){return l(c.subject,e)},c.subject.addField=function(e){p([e]),c.subject.attributes.push(e)},c.subject.attributes=r.RDNAttributesAsArray(a.certSubject,v),a.certSubjectUniqueId&&(c.subject.uniqueId=a.certSubjectUniqueId),c.subject.hash=v.digest().toHex(),a.certExtensions?c.extensions=r.certificateExtensionsFromAsn1(a.certExtensions):c.extensions=[],c.publicKey=r.publicKeyFromAsn1(a.subjectPublicKeyInfo),c},r.certificateExtensionsFromAsn1=function(e){for(var t=[],n=0;n<e.value.length;++n)for(var o=e.value[n],a=0;a<o.value.length;++a)t.push(r.certificateExtensionFromAsn1(o.value[a]));return t},r.certificateExtensionFromAsn1=function(e){var r={};if(r.id=t.derToOid(e.value[0].value),r.critical=!1,e.value[1].type===t.Type.BOOLEAN?(r.critical=0!==e.value[1].value.charCodeAt(0),r.value=e.value[2].value):r.value=e.value[1].value,r.id in n)if(r.name=n[r.id],"keyUsage"===r.name){var o=0,a=0;(s=t.fromDer(r.value)).value.length>1&&(o=s.value.charCodeAt(1),a=s.value.length>2?s.value.charCodeAt(2):0),r.digitalSignature=128==(128&o),r.nonRepudiation=64==(64&o),r.keyEncipherment=32==(32&o),r.dataEncipherment=16==(16&o),r.keyAgreement=8==(8&o),r.keyCertSign=4==(4&o),r.cRLSign=2==(2&o),r.encipherOnly=1==(1&o),r.decipherOnly=128==(128&a)}else if("basicConstraints"===r.name){(s=t.fromDer(r.value)).value.length>0&&s.value[0].type===t.Type.BOOLEAN?r.cA=0!==s.value[0].value.charCodeAt(0):r.cA=!1;var i=null;s.value.length>0&&s.value[0].type===t.Type.INTEGER?i=s.value[0].value:s.value.length>1&&(i=s.value[1].value),null!==i&&(r.pathLenConstraint=t.derToInteger(i))}else if("extKeyUsage"===r.name)for(var s=t.fromDer(r.value),c=0;c<s.value.length;++c){var u=t.derToOid(s.value[c].value);u in n?r[n[u]]=!0:r[u]=!0}else if("nsCertType"===r.name)o=0,(s=t.fromDer(r.value)).value.length>1&&(o=s.value.charCodeAt(1)),r.client=128==(128&o),r.server=64==(64&o),r.email=32==(32&o),r.objsign=16==(16&o),r.reserved=8==(8&o),r.sslCA=4==(4&o),r.emailCA=2==(2&o),r.objCA=1==(1&o);else if("subjectAltName"===r.name||"issuerAltName"===r.name){var l;r.altNames=[],s=t.fromDer(r.value);for(var d=0;d<s.value.length;++d){var f={type:(l=s.value[d]).type,value:l.value};switch(r.altNames.push(f),l.type){case 1:case 2:case 6:break;case 7:f.ip=j.util.bytesToIP(l.value);break;case 8:f.oid=t.derToOid(l.value)}}}else"subjectKeyIdentifier"===r.name&&(s=t.fromDer(r.value),r.subjectKeyIdentifier=j.util.bytesToHex(s.value));return r},r.certificationRequestFromAsn1=function(e,o){var a={},i=[];if(!t.validate(e,u,a,i))throw(c=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=i,c;if(t.derToOid(a.publicKeyOid)!==r.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=r.createCertificationRequest();if(s.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,s.signatureOid=j.asn1.derToOid(a.csrSignatureOid),s.signatureParameters=d(s.signatureOid,a.csrSignatureParams,!0),s.siginfo.algorithmOid=j.asn1.derToOid(a.csrSignatureOid),s.siginfo.parameters=d(s.siginfo.algorithmOid,a.csrSignatureParams,!1),s.signature=a.csrSignature,s.certificationRequestInfo=a.certificationRequestInfo,o){var c;if(s.md=null,s.signatureOid in n)switch(n[s.signatureOid]){case"sha1WithRSAEncryption":s.md=j.md.sha1.create();break;case"md5WithRSAEncryption":s.md=j.md.md5.create();break;case"sha256WithRSAEncryption":s.md=j.md.sha256.create();break;case"sha384WithRSAEncryption":s.md=j.md.sha384.create();break;case"sha512WithRSAEncryption":s.md=j.md.sha512.create();break;case"RSASSA-PSS":s.md=j.md.sha256.create()}if(null===s.md)throw(c=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=s.signatureOid,c;var f=t.toDer(s.certificationRequestInfo);s.md.update(f.getBytes())}var h=j.md.sha1.create();return s.subject.getField=function(e){return l(s.subject,e)},s.subject.addField=function(e){p([e]),s.subject.attributes.push(e)},s.subject.attributes=r.RDNAttributesAsArray(a.certificationRequestInfoSubject,h),s.subject.hash=h.digest().toHex(),s.publicKey=r.publicKeyFromAsn1(a.subjectPublicKeyInfo),s.getAttribute=function(e){return l(s,e)},s.addAttribute=function(e){p([e]),s.attributes.push(e)},s.attributes=r.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),s},r.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return l(e.subject,t)},e.subject.addField=function(t){p([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return l(e,t)},e.addAttribute=function(t){p([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){p(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){p(t),e.attributes=t},e.sign=function(o,a){e.md=a||j.md.sha1.create();var i=n[e.md.algorithm+"WithRSAEncryption"];if(!i){var s=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw s.algorithm=e.md.algorithm,s}e.signatureOid=e.siginfo.algorithmOid=i,e.certificationRequestInfo=r.getCertificationRequestInfo(e);var c=t.toDer(e.certificationRequestInfo);e.md.update(c.getBytes()),e.signature=o.sign(e.md)},e.verify=function(){var o=!1,a=e.md;if(null===a){if(e.signatureOid in n)switch(n[e.signatureOid]){case"sha1WithRSAEncryption":a=j.md.sha1.create();break;case"md5WithRSAEncryption":a=j.md.md5.create();break;case"sha256WithRSAEncryption":a=j.md.sha256.create();break;case"sha384WithRSAEncryption":a=j.md.sha384.create();break;case"sha512WithRSAEncryption":a=j.md.sha512.create();break;case"RSASSA-PSS":a=j.md.sha256.create()}if(null===a)throw(d=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,d;var i=e.certificationRequestInfo||r.getCertificationRequestInfo(e),s=t.toDer(i);a.update(s.getBytes())}if(null!==a){var c;switch(e.signatureOid){case n.sha1WithRSAEncryption:break;case n["RSASSA-PSS"]:var u,l,d;if(void 0===(u=n[e.signatureParameters.mgf.hash.algorithmOid])||void 0===j.md[u])throw(d=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,d.name=u,d;if(void 0===(l=n[e.signatureParameters.mgf.algorithmOid])||void 0===j.mgf[l])throw(d=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,d.name=l,d;if(l=j.mgf[l].create(j.md[u].create()),void 0===(u=n[e.signatureParameters.hash.algorithmOid])||void 0===j.md[u])throw(d=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,d.name=u,d;c=j.pss.create(j.md[u].create(),l,e.signatureParameters.saltLength)}o=e.publicKey.verify(a.digest().getBytes(),e.signature,c)}return o},e};var v=new Date("1950-01-01T00:00:00Z"),y=new Date("2050-01-01T00:00:00Z");function b(e){return e>=v&&e<y?t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(e)):t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(e))}r.getTBSCertificate=function(e){var n=b(e.validity.notBefore),o=b(e.validity.notAfter),a=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,j.util.hexToBytes(e.serialNumber)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.siginfo.algorithmOid).getBytes()),m(e.siginfo.algorithmOid,e.siginfo.parameters)]),f(e.issuer),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[n,o]),f(e.subject),r.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&a.value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&a.value.push(t.create(t.Class.CONTEXT_SPECIFIC,2,!0,[t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&a.value.push(r.certificateExtensionsToAsn1(e.extensions)),a},r.getCertificationRequestInfo=function(e){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),f(e.subject),r.publicKeyToAsn1(e.publicKey),g(e)])},r.distinguishedNameToAsn1=function(e){return f(e)},r.certificateToAsn1=function(e){var n=e.tbsCertificate||r.getTBSCertificate(e);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[n,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},r.certificateExtensionsToAsn1=function(e){var n=t.create(t.Class.CONTEXT_SPECIFIC,3,!0,[]),o=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);n.value.push(o);for(var a=0;a<e.length;++a)o.value.push(r.certificateExtensionToAsn1(e[a]));return n},r.certificateExtensionToAsn1=function(e){var r=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[]);r.value.push(t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.id).getBytes())),e.critical&&r.value.push(t.create(t.Class.UNIVERSAL,t.Type.BOOLEAN,!1,String.fromCharCode(255)));var n=e.value;return"string"!=typeof e.value&&(n=t.toDer(n).getBytes()),r.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,n)),r},r.certificationRequestToAsn1=function(e){var n=e.certificationRequestInfo||r.getCertificationRequestInfo(e);return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[n,t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),t.create(t.Class.UNIVERSAL,t.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},r.createCaStore=function(e){var n={certs:{}};function o(e){return a(e),n.certs[e.hash]||null}function a(e){if(!e.hash){var t=j.md.sha1.create();e.attributes=r.RDNAttributesAsArray(f(e),t),e.hash=t.digest().toHex()}}if(n.getIssuer=function(e){return o(e.issuer)},n.addCertificate=function(e){if("string"==typeof e&&(e=j.pki.certificateFromPem(e)),a(e.subject),!n.hasCertificate(e))if(e.subject.hash in n.certs){var t=n.certs[e.subject.hash];j.util.isArray(t)||(t=[t]),t.push(e),n.certs[e.subject.hash]=t}else n.certs[e.subject.hash]=e},n.hasCertificate=function(e){"string"==typeof e&&(e=j.pki.certificateFromPem(e));var n=o(e.subject);if(!n)return!1;j.util.isArray(n)||(n=[n]);for(var a=t.toDer(r.certificateToAsn1(e)).getBytes(),i=0;i<n.length;++i)if(a===t.toDer(r.certificateToAsn1(n[i])).getBytes())return!0;return!1},n.listAllCertificates=function(){var e=[];for(var t in n.certs)if(n.certs.hasOwnProperty(t)){var r=n.certs[t];if(j.util.isArray(r))for(var o=0;o<r.length;++o)e.push(r[o]);else e.push(r)}return e},n.removeCertificate=function(e){var i;if("string"==typeof e&&(e=j.pki.certificateFromPem(e)),a(e.subject),!n.hasCertificate(e))return null;var s=o(e.subject);if(!j.util.isArray(s))return i=n.certs[e.subject.hash],delete n.certs[e.subject.hash],i;for(var c=t.toDer(r.certificateToAsn1(e)).getBytes(),u=0;u<s.length;++u)c===t.toDer(r.certificateToAsn1(s[u])).getBytes()&&(i=s[u],s.splice(u,1));return 0===s.length&&delete n.certs[e.subject.hash],i},e)for(var i=0;i<e.length;++i){var s=e[i];n.addCertificate(s)}return n},r.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},r.verifyCertificateChain=function(e,t,n){"function"==typeof n&&(n={verify:n}),n=n||{};var o=(t=t.slice(0)).slice(0),a=n.validityCheckDate;void 0===a&&(a=new Date);var i=!0,s=null,c=0;do{var u=t.shift(),l=null,d=!1;if(a&&(a<u.validity.notBefore||a>u.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:r.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:a}),null===s){if(null===(l=t[0]||e.getIssuer(u))&&u.isIssuer(u)&&(d=!0,l=u),l){var f=l;j.util.isArray(f)||(f=[f]);for(var p=!1;!p&&f.length>0;){l=f.shift();try{p=l.verify(u)}catch(e){}}p||(s={message:"Certificate signature is invalid.",error:r.certificateError.bad_certificate})}null!==s||l&&!d||e.hasCertificate(u)||(s={message:"Certificate is not trusted.",error:r.certificateError.unknown_ca})}if(null===s&&l&&!u.isIssuer(l)&&(s={message:"Certificate issuer is invalid.",error:r.certificateError.bad_certificate}),null===s)for(var h={keyUsage:!0,basicConstraints:!0},m=0;null===s&&m<u.extensions.length;++m){var g=u.extensions[m];!g.critical||g.name in h||(s={message:"Certificate has an unsupported critical extension.",error:r.certificateError.unsupported_certificate})}if(null===s&&(!i||0===t.length&&(!l||d))){var v=u.getExtension("basicConstraints"),y=u.getExtension("keyUsage");null!==y&&(y.keyCertSign&&null!==v||(s={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:r.certificateError.bad_certificate})),null!==s||null===v||v.cA||(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:r.certificateError.bad_certificate}),null===s&&null!==y&&"pathLenConstraint"in v&&c-1>v.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:r.certificateError.bad_certificate})}var b=null===s||s.error,C=n.verify?n.verify(b,c,o):b;if(!0!==C)throw!0===b&&(s={message:"The application rejected the certificate.",error:r.certificateError.bad_certificate}),(C||0===C)&&("object"!=By(C)||j.util.isArray(C)?"string"==typeof C&&(s.error=C):(C.message&&(s.message=C.message),C.error&&(s.error=C.error))),s;s=null,i=!1,++c}while(t.length>0);return!0}})),C((function(e){var t=j.asn1,r=j.pki,n=e.exports=j.pkcs12=j.pkcs12||{},o={name:"ContentInfo",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},a={name:"PFX",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,capture:"version"},o,{name:"PFX.macData",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:t.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:t.Class.UNIVERSAL,type:t.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:t.Class.UNIVERSAL,type:t.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},i={name:"SafeBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},s={name:"Attribute",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:t.Class.UNIVERSAL,type:t.Type.SET,constructed:!0,capture:"values"}]},c={name:"CertBag",tagClass:t.Class.UNIVERSAL,type:t.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:t.Class.UNIVERSAL,type:t.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:t.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:t.Class.UNIVERSAL,type:t.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function u(e,t,r,n){for(var o=[],a=0;a<e.length;a++)for(var i=0;i<e[a].safeBags.length;i++){var s=e[a].safeBags[i];void 0!==n&&s.type!==n||(null!==t?void 0!==s.attributes[t]&&s.attributes[t].indexOf(r)>=0&&o.push(s):o.push(s))}return o}function l(e){if(e.composed||e.constructed){for(var t=j.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,n){var o={},a=[];if(!t.validate(e,j.pkcs7.asn1.encryptedDataValidator,o,a))throw(i=new Error("Cannot read EncryptedContentInfo.")).errors=a,i;var i,s=t.derToOid(o.contentType);if(s!==r.oids.data)throw(i=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=s,i;s=t.derToOid(o.encAlgorithm);var c=r.pbe.getCipher(s,o.encParameter,n),u=l(o.encryptedContentAsn1),d=j.util.createBuffer(u.value);if(c.update(d),!c.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return c.output.getBytes()}function f(e,n,o){if(!n&&0===e.length)return[];if((e=t.fromDer(e,n)).tagClass!==t.Class.UNIVERSAL||e.type!==t.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var a=[],s=0;s<e.value.length;s++){var u=e.value[s],l={},d=[];if(!t.validate(u,i,l,d))throw(v=new Error("Cannot read SafeBag.")).errors=d,v;var f,h,m={type:t.derToOid(l.bagId),attributes:p(l.bagAttributes)};a.push(m);var g=l.bagValue.value[0];switch(m.type){case r.oids.pkcs8ShroudedKeyBag:if(null===(g=r.decryptPrivateKeyInfo(g,o)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case r.oids.keyBag:try{m.key=r.privateKeyFromAsn1(g)}catch(e){m.key=null,m.asn1=g}continue;case r.oids.certBag:f=c,h=function(){if(t.derToOid(l.certId)!==r.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=t.derToOid(l.certId),e}var o=t.fromDer(l.cert,n);try{m.cert=r.certificateFromAsn1(o,!0)}catch(e){m.cert=null,m.asn1=o}};break;default:var v;throw(v=new Error("Unsupported PKCS#12 SafeBag type.")).oid=m.type,v}if(void 0!==f&&!t.validate(g,f,l,d))throw(v=new Error("Cannot read PKCS#12 "+f.name)).errors=d,v;h()}return a}function p(e){var n={};if(void 0!==e)for(var o=0;o<e.length;++o){var a={},i=[];if(!t.validate(e[o],s,a,i)){var c=new Error("Cannot read PKCS#12 BagAttribute.");throw c.errors=i,c}var u=t.derToOid(a.oid);if(void 0!==r.oids[u]){n[r.oids[u]]=[];for(var l=0;l<a.values.length;++l)n[r.oids[u]].push(a.values[l].value)}}return n}n.pkcs12FromAsn1=function(e,i,s){"string"==typeof i?(s=i,i=!0):void 0===i&&(i=!0);var c={};if(!t.validate(e,a,c,[]))throw(p=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=p,p;var p,h={version:c.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=j.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=u(h.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=u(h.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=u(h.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return u(h.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return u(h.safeContents,"localKeyId",e,t)}};if(3!==c.version.charCodeAt(0))throw(p=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=c.version.charCodeAt(0),p;if(t.derToOid(c.contentType)!==r.oids.data)throw(p=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=t.derToOid(c.contentType),p;var m=c.content.value[0];if(m.tagClass!==t.Class.UNIVERSAL||m.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(m=l(m),c.mac){var g=null,v=0,y=t.derToOid(c.macAlgorithm);switch(y){case r.oids.sha1:g=j.md.sha1.create(),v=20;break;case r.oids.sha256:g=j.md.sha256.create(),v=32;break;case r.oids.sha384:g=j.md.sha384.create(),v=48;break;case r.oids.sha512:g=j.md.sha512.create(),v=64;break;case r.oids.md5:g=j.md.md5.create(),v=16}if(null===g)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+y);var b=new j.util.ByteBuffer(c.macSalt),C="macIterations"in c?parseInt(j.util.bytesToHex(c.macIterations),16):1,w=n.generateKey(s,b,3,C,v,g),k=j.hmac.create();if(k.start(g,w),k.update(m.value),k.getMac().getBytes()!==c.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,n,a,i){if((n=t.fromDer(n,a)).tagClass!==t.Class.UNIVERSAL||n.type!==t.Type.SEQUENCE||!0!==n.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var s=0;s<n.value.length;s++){var c=n.value[s],u={},p=[];if(!t.validate(c,o,u,p))throw(v=new Error("Cannot read ContentInfo.")).errors=p,v;var h={encrypted:!1},m=null,g=u.content.value[0];switch(t.derToOid(u.contentType)){case r.oids.data:if(g.tagClass!==t.Class.UNIVERSAL||g.type!==t.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");m=l(g).value;break;case r.oids.encryptedData:m=d(g,i),h.encrypted=!0;break;default:var v;throw(v=new Error("Unsupported PKCS#12 contentType.")).contentType=t.derToOid(u.contentType),v}h.safeBags=f(m,a,i),e.safeContents.push(h)}}(h,m.value,i,s),h},n.toPkcs12Asn1=function(e,o,a,i){(i=i||{}).saltSize=i.saltSize||8,i.count=i.count||2048,i.algorithm=i.algorithm||i.encAlgorithm||"aes128","useMac"in i||(i.useMac=!0),"localKeyId"in i||(i.localKeyId=null),"generateLocalKeyId"in i||(i.generateLocalKeyId=!0);var s,c=i.localKeyId;if(null!==c)c=j.util.hexToBytes(c);else if(i.generateLocalKeyId)if(o){var u=j.util.isArray(o)?o[0]:o;"string"==typeof u&&(u=r.certificateFromPem(u)),(_=j.md.sha1.create()).update(t.toDer(r.certificateToAsn1(u)).getBytes()),c=_.digest().getBytes()}else c=j.random.getBytes(20);var l=[];null!==c&&l.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.localKeyId).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,c)])])),"friendlyName"in i&&l.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.friendlyName).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[t.create(t.Class.UNIVERSAL,t.Type.BMPSTRING,!1,i.friendlyName)])])),l.length>0&&(s=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,l));var d=[],f=[];null!==o&&(f=j.util.isArray(o)?o:[o]);for(var p=[],h=0;h<f.length;++h){"string"==typeof(o=f[h])&&(o=r.certificateFromPem(o));var m=0===h?s:void 0,g=r.certificateToAsn1(o),v=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.certBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.x509Certificate).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(g).getBytes())])])]),m]);p.push(v)}if(p.length>0){var y=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,p),b=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(y).getBytes())])]);d.push(b)}var C=null;if(null!==e){var w=r.wrapRsaPrivateKey(r.privateKeyToAsn1(e));C=null===a?t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.keyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[w]),s]):t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.pkcs8ShroudedKeyBag).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[r.encryptPrivateKeyInfo(w,a,i)]),s]);var k=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[C]),S=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(k).getBytes())])]);d.push(S)}var E,B=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,d);if(i.useMac){var _=j.md.sha1.create(),x=new j.util.ByteBuffer(j.random.getBytes(i.saltSize)),T=i.count,A=(e=n.generateKey(a,x,3,T,20),j.hmac.create());A.start(_,e),A.update(t.toDer(B).getBytes());var I=A.getMac();E=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.sha1).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,I.getBytes())]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,x.getBytes()),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(T).getBytes())])}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(3).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.oids.data).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,t.toDer(B).getBytes())])]),E])},n.generateKey=j.pbe.generatePkcs12Key})),C((function(e){var t=j.asn1,r=e.exports=j.pki=j.pki||{};r.pemToDer=function(e){var t=j.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return j.util.createBuffer(t.body)},r.privateKeyFromPem=function(e){var n=j.pem.decode(e)[0];if("PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type){var o=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw o.headerType=n.type,o}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var a=t.fromDer(n.body);return r.privateKeyFromAsn1(a)},r.privateKeyToPem=function(e,n){var o={type:"RSA PRIVATE KEY",body:t.toDer(r.privateKeyToAsn1(e)).getBytes()};return j.pem.encode(o,{maxline:n})},r.privateKeyInfoToPem=function(e,r){var n={type:"PRIVATE KEY",body:t.toDer(e).getBytes()};return j.pem.encode(n,{maxline:r})}}));var wt=function(e,t,r,n){var o=j.util.createBuffer(),a=e.length>>1,i=a+(1&e.length),s=e.substr(0,i),c=e.substr(a,i),u=j.util.createBuffer(),l=j.hmac.create();r=t+r;var d=Math.ceil(n/16),f=Math.ceil(n/20);l.start("MD5",s);var p=j.util.createBuffer();u.putBytes(r);for(var h=0;h<d;++h)l.start(null,null),l.update(u.getBytes()),u.putBuffer(l.digest()),l.start(null,null),l.update(u.bytes()+r),p.putBuffer(l.digest());l.start("SHA1",c);var m=j.util.createBuffer();for(u.clear(),u.putBytes(r),h=0;h<f;++h)l.start(null,null),l.update(u.getBytes()),u.putBuffer(l.digest()),l.start(null,null),l.update(u.bytes()+r),m.putBuffer(l.digest());return o.putBytes(j.util.xorBytes(p.getBytes(),m.getBytes(),n)),o},kt=function(e,t,r){var n=!1;try{var o=e.deflate(t.fragment.getBytes());t.fragment=j.util.createBuffer(o),t.length=o.length,n=!0}catch(e){}return n},St=function(e,t,r){var n=!1;try{var o=e.inflate(t.fragment.getBytes());t.fragment=j.util.createBuffer(o),t.length=o.length,n=!0}catch(e){}return n},Et=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return j.util.createBuffer(e.getBytes(r))},Bt=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},_t={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};_t.SupportedVersions=[_t.Versions.TLS_1_1,_t.Versions.TLS_1_0],_t.Version=_t.SupportedVersions[0],_t.MaxFragment=15360,_t.ConnectionEnd={server:0,client:1},_t.PRFAlgorithm={tls_prf_sha256:0},_t.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},_t.CipherType={stream:0,block:1,aead:2},_t.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},_t.CompressionMethod={none:0,deflate:1},_t.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},_t.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},_t.Alert={},_t.Alert.Level={warning:1,fatal:2},_t.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},_t.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},_t.CipherSuites={},_t.getCipherSuite=function(e){var t=null;for(var r in _t.CipherSuites){var n=_t.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},_t.handleUnexpected=function(e,t){!e.open&&e.entity===_t.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.unexpected_message}})},_t.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(_t.queue(e,_t.createAlert(e,{level:_t.Alert.Level.warning,description:_t.Alert.Description.no_renegotiation})),_t.flush(e)),e.process()},_t.parseHelloMessage=function(e,t,r){var n=null,o=e.entity===_t.ConnectionEnd.client;if(r<38)e.error(e,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}});else{var a=t.fragment,i=a.length();if(n={version:{major:a.getByte(),minor:a.getByte()},random:j.util.createBuffer(a.getBytes(32)),session_id:Et(a,1),extensions:[]},o?(n.cipher_suite=a.getBytes(2),n.compression_method=a.getByte()):(n.cipher_suites=Et(a,2),n.compression_methods=Et(a,1)),(i=r-(i-a.length()))>0){for(var s=Et(a,2);s.length()>0;)n.extensions.push({type:[s.getByte(),s.getByte()],data:Et(s,2)});if(!o)for(var c=0;c<n.extensions.length;++c){var u=n.extensions[c];if(0===u.type[0]&&0===u.type[1])for(var l=Et(u.data,2);l.length()>0&&0===l.getByte();)e.session.extensions.server_name.serverNameList.push(Et(l,2).getBytes())}}if(e.session.version&&(n.version.major!==e.session.version.major||n.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.protocol_version}});if(o)e.session.cipherSuite=_t.getCipherSuite(n.cipher_suite);else for(var d=j.util.createBuffer(n.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=_t.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.handshake_failure},cipherSuite:j.util.bytesToHex(n.cipher_suite)});e.session.compressionMethod=o?n.compression_method:_t.CompressionMethod.none}return n},_t.createSecurityParameters=function(e,t){var r=e.entity===_t.ConnectionEnd.client,n=t.random.bytes(),o=r?e.session.sp.client_random:n,a=r?n:_t.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:_t.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:a}},_t.handleServerHello=function(e,t,r){var n=_t.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var o=n.session_id.bytes();o.length>0&&o===e.session.id?(e.expect=Pt,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=xt,e.session.resuming=!1,_t.createSecurityParameters(e,n)),e.session.id=o,e.process()}},_t.handleClientHello=function(e,t,r){var n=_t.parseHelloMessage(e,t,r);if(!e.fail){var o=n.session_id.bytes(),a=null;if(e.sessionCache&&(null===(a=e.sessionCache.getSession(o))?o="":(a.version.major!==n.version.major||a.version.minor>n.version.minor)&&(a=null,o="")),0===o.length&&(o=j.random.getBytes(32)),e.session.id=o,e.session.clientHelloVersion=n.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var i,s=1;s<_t.SupportedVersions.length&&!((i=_t.SupportedVersions[s]).minor<=n.version.minor);++s);e.version={major:i.major,minor:i.minor},e.session.version=e.version}null!==a?(e.expect=Ft,e.session.resuming=!0,e.session.sp.client_random=n.random.bytes()):(e.expect=!1!==e.verifyClient?Ot:Lt,e.session.resuming=!1,_t.createSecurityParameters(e,n)),e.open=!0,_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createServerHello(e)})),e.session.resuming?(_t.queue(e,_t.createRecord(e,{type:_t.ContentType.change_cipher_spec,data:_t.createChangeCipherSpec()})),e.state.pending=_t.createConnectionState(e),e.state.current.write=e.state.pending.write,_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createFinished(e)}))):(_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createCertificate(e)})),e.fail||(_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createServerKeyExchange(e)})),!1!==e.verifyClient&&_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createCertificateRequest(e)})),_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createServerHelloDone(e)})))),_t.flush(e),e.process()}},_t.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}});var n,o,a=t.fragment,i={certificate_list:Et(a,3)},s=[];try{for(;i.certificate_list.length()>0;)n=Et(i.certificate_list,3),o=j.asn1.fromDer(n),n=j.pki.certificateFromAsn1(o,!0),s.push(n)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.bad_certificate}})}var c=e.entity===_t.ConnectionEnd.client;!c&&!0!==e.verifyClient||0!==s.length?0===s.length?e.expect=c?Tt:Lt:(c?e.session.serverCertificate=s[0]:e.session.clientCertificate=s[0],_t.verifyCertificateChain(e,s)&&(e.expect=c?Tt:Lt)):e.error(e,{message:c?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}}),e.process()},_t.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.unsupported_certificate}});e.expect=At,e.process()},_t.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.unsupported_certificate}});var n=t.fragment,o={enc_pre_master_secret:Et(n,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=j.pki.privateKeyFromPem(a)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}})}if(null===a)return e.error(e,{message:"No private key set.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}});try{var i=e.session.sp;i.pre_master_secret=a.decrypt(o.enc_pre_master_secret);var s=e.session.clientHelloVersion;if(s.major!==i.pre_master_secret.charCodeAt(0)||s.minor!==i.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){i.pre_master_secret=j.random.getBytes(48)}e.expect=Ft,null!==e.session.clientCertificate&&(e.expect=Mt),e.process()},_t.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}});var n=t.fragment,o={certificate_types:Et(n,1),certificate_authorities:Et(n,2)};e.session.certificateRequest=o,e.expect=It,e.process()},_t.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}});var n=t.fragment;n.read-=4;var o=n.bytes();n.read+=4;var a={signature:Et(n,2).getBytes()},i=j.util.createBuffer();i.putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest()),i=i.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(i,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(o),e.session.sha1.update(o)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.handshake_failure}})}e.expect=Ft,e.process()},_t.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.record_overflow}});if(null===e.serverCertificate){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.insufficient_security}},o=e.verify(e,n.alert.description,0,[]);if(!0!==o)return(o||0===o)&&("object"!=By(o)||j.util.isArray(o)?"number"==typeof o&&(n.alert.description=o):(o.message&&(n.message=o.message),o.alert&&(n.alert.description=o.alert))),e.error(e,n)}null!==e.session.certificateRequest&&(t=_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createCertificate(e)}),_t.queue(e,t)),t=_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createClientKeyExchange(e)}),_t.queue(e,t),e.expect=Nt;var a=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createCertificateVerify(e,t)})),_t.queue(e,_t.createRecord(e,{type:_t.ContentType.change_cipher_spec,data:_t.createChangeCipherSpec()})),e.state.pending=_t.createConnectionState(e),e.state.current.write=e.state.pending.write,_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createFinished(e)})),e.expect=Pt,_t.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return a(e,null);_t.getClientSignature(e,a)},_t.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.illegal_parameter}});var r=e.entity===_t.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=_t.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?Rt:Ut,e.process()},_t.handleFinished=function(e,t,r){var n=t.fragment;n.read-=4;var o=n.bytes();n.read+=4;var a=t.fragment.getBytes();(n=j.util.createBuffer()).putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest());var i=e.entity===_t.ConnectionEnd.client,s=i?"server finished":"client finished",c=e.session.sp;if((n=wt(c.master_secret,s,n.getBytes(),12)).getBytes()!==a)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.decrypt_error}});e.session.md5.update(o),e.session.sha1.update(o),(e.session.resuming&&i||!e.session.resuming&&!i)&&(_t.queue(e,_t.createRecord(e,{type:_t.ContentType.change_cipher_spec,data:_t.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,_t.queue(e,_t.createRecord(e,{type:_t.ContentType.handshake,data:_t.createFinished(e)}))),e.expect=i?Dt:jt,e.handshaking=!1,++e.handshakes,e.peerCertificate=i?e.session.serverCertificate:e.session.clientCertificate,_t.flush(e),e.isConnected=!0,e.connected(e),e.process()},_t.handleAlert=function(e,t){var r,n=t.fragment,o={level:n.getByte(),description:n.getByte()};switch(o.description){case _t.Alert.Description.close_notify:r="Connection closed.";break;case _t.Alert.Description.unexpected_message:r="Unexpected message.";break;case _t.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case _t.Alert.Description.decryption_failed:r="Decryption failed.";break;case _t.Alert.Description.record_overflow:r="Record overflow.";break;case _t.Alert.Description.decompression_failure:r="Decompression failed.";break;case _t.Alert.Description.handshake_failure:r="Handshake failure.";break;case _t.Alert.Description.bad_certificate:r="Bad certificate.";break;case _t.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case _t.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case _t.Alert.Description.certificate_expired:r="Certificate expired.";break;case _t.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case _t.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case _t.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case _t.Alert.Description.access_denied:r="Access denied.";break;case _t.Alert.Description.decode_error:r="Decode error.";break;case _t.Alert.Description.decrypt_error:r="Decrypt error.";break;case _t.Alert.Description.export_restriction:r="Export restriction.";break;case _t.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case _t.Alert.Description.insufficient_security:r="Insufficient security.";break;case _t.Alert.Description.internal_error:r="Internal error.";break;case _t.Alert.Description.user_canceled:r="User canceled.";break;case _t.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(o.description===_t.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===_t.ConnectionEnd.client?"server":"client",alert:o}),e.process()},_t.handleHandshake=function(e,t){var r=t.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return e.fragmented=t,t.fragment=j.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var a=r.bytes(o+4);r.read+=4,n in tr[e.entity][e.expect]?(e.entity!==_t.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:j.md.md5.create(),sha1:j.md.sha1.create()}),n!==_t.HandshakeType.hello_request&&n!==_t.HandshakeType.certificate_verify&&n!==_t.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),tr[e.entity][e.expect][n](e,t,o)):_t.handleUnexpected(e,t)},_t.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},_t.handleHeartbeat=function(e,t){var r=t.fragment,n=r.getByte(),o=r.getInt16(),a=r.getBytes(o);if(n===_t.HeartbeatMessageType.heartbeat_request){if(e.handshaking||o>a.length)return e.process();_t.queue(e,_t.createRecord(e,{type:_t.ContentType.heartbeat,data:_t.createHeartbeat(_t.HeartbeatMessageType.heartbeat_response,a)})),_t.flush(e)}else if(n===_t.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,j.util.createBuffer(a))}e.process()};var xt=1,Tt=2,At=3,It=4,Pt=5,Rt=6,Dt=7,Nt=8,Ot=1,Lt=2,Mt=3,Ft=4,Ut=5,jt=6,Vt=_t.handleUnexpected,zt=_t.handleChangeCipherSpec,qt=_t.handleAlert,Ht=_t.handleHandshake,Kt=_t.handleApplicationData,Wt=_t.handleHeartbeat,Qt=[];Qt[_t.ConnectionEnd.client]=[[Vt,qt,Ht,Vt,Wt],[Vt,qt,Ht,Vt,Wt],[Vt,qt,Ht,Vt,Wt],[Vt,qt,Ht,Vt,Wt],[Vt,qt,Ht,Vt,Wt],[zt,qt,Vt,Vt,Wt],[Vt,qt,Ht,Vt,Wt],[Vt,qt,Ht,Kt,Wt],[Vt,qt,Ht,Vt,Wt]],Qt[_t.ConnectionEnd.server]=[[Vt,qt,Ht,Vt,Wt],[Vt,qt,Ht,Vt,Wt],[Vt,qt,Ht,Vt,Wt],[Vt,qt,Ht,Vt,Wt],[zt,qt,Vt,Vt,Wt],[Vt,qt,Ht,Vt,Wt],[Vt,qt,Ht,Kt,Wt],[Vt,qt,Ht,Vt,Wt]];var Gt=_t.handleHelloRequest,Xt=_t.handleServerHello,Yt=_t.handleCertificate,$t=_t.handleServerKeyExchange,Zt=_t.handleCertificateRequest,Jt=_t.handleServerHelloDone,er=_t.handleFinished,tr=[];tr[_t.ConnectionEnd.client]=[[Vt,Vt,Xt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt],[Gt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Yt,$t,Zt,Jt,Vt,Vt,Vt,Vt,Vt,Vt],[Gt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,$t,Zt,Jt,Vt,Vt,Vt,Vt,Vt,Vt],[Gt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Zt,Jt,Vt,Vt,Vt,Vt,Vt,Vt],[Gt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Jt,Vt,Vt,Vt,Vt,Vt,Vt],[Gt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt],[Gt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,er],[Gt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt],[Gt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt]];var rr=_t.handleClientHello,nr=_t.handleClientKeyExchange,or=_t.handleCertificateVerify;tr[_t.ConnectionEnd.server]=[[Vt,rr,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Yt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,nr,Vt,Vt,Vt,Vt],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,or,Vt,Vt,Vt,Vt,Vt],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,er],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt]],_t.generateKeys=function(e,t){var r=wt,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var o=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===_t.Versions.TLS_1_0.major&&e.version.minor===_t.Versions.TLS_1_0.minor;a&&(o+=2*t.fixed_iv_length);var i=r(t.master_secret,"key expansion",n,o),s={client_write_MAC_key:i.getBytes(t.mac_key_length),server_write_MAC_key:i.getBytes(t.mac_key_length),client_write_key:i.getBytes(t.enc_key_length),server_write_key:i.getBytes(t.enc_key_length)};return a&&(s.client_write_IV=i.getBytes(t.fixed_iv_length),s.server_write_IV=i.getBytes(t.fixed_iv_length)),s},_t.createConnectionState=function(e){var t=e.entity===_t.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}}),!e.fail},e.session){var o=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(o),o.keys=_t.generateKeys(e,o),n.read.macKey=t?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,n.write.macKey=t?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,o),o.compression_algorithm){case _t.CompressionMethod.none:break;case _t.CompressionMethod.deflate:n.read.compressFunction=St,n.write.compressFunction=kt;break;default:throw new Error("Unsupported compression algorithm.")}}return n},_t.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=j.util.createBuffer();return r.putInt32(t),r.putBytes(j.random.getBytes(28)),r},_t.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},_t.createAlert=function(e,t){var r=j.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),_t.createRecord(e,{type:_t.ContentType.alert,data:r})},_t.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=j.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var n=e.cipherSuites[r];t.putByte(n.id[0]),t.putByte(n.id[1])}var o=t.length(),a=j.util.createBuffer();a.putByte(_t.CompressionMethod.none);var i=a.length(),s=j.util.createBuffer();if(e.virtualHost){var c=j.util.createBuffer();c.putByte(0),c.putByte(0);var u=j.util.createBuffer();u.putByte(0),Bt(u,2,j.util.createBuffer(e.virtualHost));var l=j.util.createBuffer();Bt(l,2,u),Bt(c,2,l),s.putBuffer(c)}var d=s.length();d>0&&(d+=2);var f=e.session.id,p=f.length+1+2+4+28+2+o+1+i+d,h=j.util.createBuffer();return h.putByte(_t.HandshakeType.client_hello),h.putInt24(p),h.putByte(e.version.major),h.putByte(e.version.minor),h.putBytes(e.session.sp.client_random),Bt(h,1,j.util.createBuffer(f)),Bt(h,2,t),Bt(h,1,a),d>0&&Bt(h,2,s),h},_t.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,n=j.util.createBuffer();return n.putByte(_t.HandshakeType.server_hello),n.putInt24(r),n.putByte(e.version.major),n.putByte(e.version.minor),n.putBytes(e.session.sp.server_random),Bt(n,1,j.util.createBuffer(t)),n.putByte(e.session.cipherSuite.id[0]),n.putByte(e.session.cipherSuite.id[1]),n.putByte(e.session.compressionMethod),n},_t.createCertificate=function(e){var t,r=e.entity===_t.ConnectionEnd.client,n=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,t));var o=j.util.createBuffer();if(null!==n)try{j.util.isArray(n)||(n=[n]);for(var a=null,i=0;i<n.length;++i){var s=j.pem.decode(n[i])[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var c=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw c.headerType=s.type,c}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=j.util.createBuffer(s.body);null===a&&(a=j.asn1.fromDer(u.bytes(),!1));var l=j.util.createBuffer();Bt(l,3,u),o.putBuffer(l)}n=j.pki.certificateFromAsn1(a),r?e.session.clientCertificate=n:e.session.serverCertificate=n}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.bad_certificate}})}var d=3+o.length(),f=j.util.createBuffer();return f.putByte(_t.HandshakeType.certificate),f.putInt24(d),Bt(f,3,o),f},_t.createClientKeyExchange=function(e){var t=j.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(j.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var n=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,o=j.util.createBuffer();return o.putByte(_t.HandshakeType.client_key_exchange),o.putInt24(n),o.putInt16(t.length),o.putBytes(t),o},_t.createServerKeyExchange=function(e){return j.util.createBuffer()},_t.getClientSignature=function(e,t){var r=j.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var n=null;if(e.getPrivateKey)try{n=e.getPrivateKey(e,e.session.clientCertificate),n=j.pki.privateKeyFromPem(n)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}})}null===n?e.error(e,{message:"No private key set.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.internal_error}}):t=n.sign(t,null),r(e,t)},e.getSignature(e,r,t)},_t.createCertificateVerify=function(e,t){var r=t.length+2,n=j.util.createBuffer();return n.putByte(_t.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(t.length),n.putBytes(t),n},_t.createCertificateRequest=function(e){var t=j.util.createBuffer();t.putByte(1);var r=j.util.createBuffer();for(var n in e.caStore.certs){var o=e.caStore.certs[n],a=j.pki.distinguishedNameToAsn1(o.subject),i=j.asn1.toDer(a);r.putInt16(i.length()),r.putBuffer(i)}var s=1+t.length()+2+r.length(),c=j.util.createBuffer();return c.putByte(_t.HandshakeType.certificate_request),c.putInt24(s),Bt(c,1,t),Bt(c,2,r),c},_t.createServerHelloDone=function(e){var t=j.util.createBuffer();return t.putByte(_t.HandshakeType.server_hello_done),t.putInt24(0),t},_t.createChangeCipherSpec=function(){var e=j.util.createBuffer();return e.putByte(1),e},_t.createFinished=function(e){var t=j.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===_t.ConnectionEnd.client,n=e.session.sp,o=r?"client finished":"server finished";t=wt(n.master_secret,o,t.getBytes(),12);var a=j.util.createBuffer();return a.putByte(_t.HandshakeType.finished),a.putInt24(t.length()),a.putBuffer(t),a},_t.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var n=j.util.createBuffer();n.putByte(e),n.putInt16(r),n.putBytes(t);var o=n.length(),a=Math.max(16,o-r-3);return n.putBytes(j.random.getBytes(a)),n},_t.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==_t.ContentType.handshake&&t.type!==_t.ContentType.alert&&t.type!==_t.ContentType.change_cipher_spec)){if(t.type===_t.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var n;if(t.fragment.length()<=_t.MaxFragment)n=[t];else{n=[];for(var o=t.fragment.bytes();o.length>_t.MaxFragment;)n.push(_t.createRecord(e,{type:t.type,data:j.util.createBuffer(o.slice(0,_t.MaxFragment))})),o=o.slice(_t.MaxFragment);o.length>0&&n.push(_t.createRecord(e,{type:t.type,data:j.util.createBuffer(o)}))}for(var a=0;a<n.length&&!e.fail;++a){var i=n[a];e.state.current.write.update(e,i)&&e.records.push(i)}}},_t.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var ar=function(e){switch(e){case!0:return!0;case j.pki.certificateError.bad_certificate:return _t.Alert.Description.bad_certificate;case j.pki.certificateError.unsupported_certificate:return _t.Alert.Description.unsupported_certificate;case j.pki.certificateError.certificate_revoked:return _t.Alert.Description.certificate_revoked;case j.pki.certificateError.certificate_expired:return _t.Alert.Description.certificate_expired;case j.pki.certificateError.certificate_unknown:return _t.Alert.Description.certificate_unknown;case j.pki.certificateError.unknown_ca:return _t.Alert.Description.unknown_ca;default:return _t.Alert.Description.bad_certificate}};for(var ir in _t.verifyCertificateChain=function(e,t){try{var r={};for(var n in e.verifyOptions)r[n]=e.verifyOptions[n];r.verify=function(t,r,n){ar(t);var o=e.verify(e,t,r,n);if(!0!==o){if("object"==By(o)&&!j.util.isArray(o)){var a=new Error("The application rejected the certificate.");throw a.send=!0,a.alert={level:_t.Alert.Level.fatal,description:_t.Alert.Description.bad_certificate},o.message&&(a.message=o.message),o.alert&&(a.alert.description=o.alert),a}o!==t&&(o=function(e){switch(e){case!0:return!0;case _t.Alert.Description.bad_certificate:return j.pki.certificateError.bad_certificate;case _t.Alert.Description.unsupported_certificate:return j.pki.certificateError.unsupported_certificate;case _t.Alert.Description.certificate_revoked:return j.pki.certificateError.certificate_revoked;case _t.Alert.Description.certificate_expired:return j.pki.certificateError.certificate_expired;case _t.Alert.Description.certificate_unknown:return j.pki.certificateError.certificate_unknown;case _t.Alert.Description.unknown_ca:return j.pki.certificateError.unknown_ca;default:return j.pki.certificateError.bad_certificate}}(o))}return o},j.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var o=t;("object"!=By(o)||j.util.isArray(o))&&(o={send:!0,alert:{level:_t.Alert.Level.fatal,description:ar(t)}}),"send"in o||(o.send=!0),"alert"in o||(o.alert={level:_t.Alert.Level.fatal,description:ar(o.error)}),e.error(e,o)}return!e.fail},_t.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var n in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(n):delete e[n];r.getSession=function(e){var t=null,n=null;if(e?n=j.util.bytesToHex(e):r.order.length>0&&(n=r.order[0]),null!==n&&n in r.cache)for(var o in t=r.cache[n],delete r.cache[n],r.order)if(r.order[o]===n){r.order.splice(o,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var n=r.order.shift();delete r.cache[n]}n=j.util.bytesToHex(e),r.order.push(n),r.cache[n]=t}}return r},_t.createConnection=function(e){var t;t=e.caStore?j.util.isArray(e.caStore)?j.pki.createCaStore(e.caStore):e.caStore:j.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var n in r=[],_t.CipherSuites)r.push(_t.CipherSuites[n]);var o=e.server?_t.ConnectionEnd.server:_t.ConnectionEnd.client,a=e.sessionCache?_t.createSessionCache(e.sessionCache):null,i={version:{major:_t.Version.major,minor:_t.Version.minor},entity:o,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:j.util.createBuffer(),tlsData:j.util.createBuffer(),data:j.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===_t.ConnectionEnd.client?"client":"server"),r.send&&(_t.queue(t,_t.createAlert(t,r.alert)),_t.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){i.version={major:_t.Version.major,minor:_t.Version.minor},i.record=null,i.session=null,i.peerCertificate=null,i.state={pending:null,current:null},i.expect=(_t.ConnectionEnd.client,0),i.fragmented=null,i.records=[],i.open=!1,i.handshakes=0,i.handshaking=!1,i.isConnected=!1,i.fail=!(e||void 0===e),i.input.clear(),i.tlsData.clear(),i.data.clear(),i.state.current=_t.createConnectionState(i)}};return i.reset(),i.handshake=function(e){if(i.entity!==_t.ConnectionEnd.client)i.error(i,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(i.handshaking)i.error(i,{message:"Handshake already in progress.",fatal:!1});else{i.fail&&!i.open&&0===i.handshakes&&(i.fail=!1),i.handshaking=!0;var t=null;(e=e||"").length>0&&(i.sessionCache&&(t=i.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&i.sessionCache&&null!==(t=i.sessionCache.getSession())&&(e=t.id),i.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:j.md.md5.create(),sha1:j.md.sha1.create()},t&&(i.version=t.version,i.session.sp=t.sp),i.session.sp.client_random=_t.createRandom().getBytes(),i.open=!0,_t.queue(i,_t.createRecord(i,{type:_t.ContentType.handshake,data:_t.createClientHello(i)})),_t.flush(i)}},i.process=function(e){var t=0;return e&&i.input.putBytes(e),i.fail||(null!==i.record&&i.record.ready&&i.record.fragment.isEmpty()&&(i.record=null),null===i.record&&(t=function(e){var t=0,r=e.input,n=r.length();if(n<5)t=5-n;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:j.util.createBuffer(),ready:!1};var o=e.record.version.major===e.version.major;o&&e.session&&e.session.version&&(o=e.record.version.minor===e.version.minor),o||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.protocol_version}})}return t}(i)),i.fail||null===i.record||i.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();return n<e.record.length?t=e.record.length-n:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:_t.Alert.Level.fatal,description:_t.Alert.Description.unexpected_message}})),e.record.ready=!0)),t}(i)),!i.fail&&null!==i.record&&i.record.ready&&function(e,t){var r=t.type-_t.ContentType.change_cipher_spec,n=Qt[e.entity][e.expect];r in n?n[r](e,t):_t.handleUnexpected(e,t)}(i,i.record)),t},i.prepare=function(e){return _t.queue(i,_t.createRecord(i,{type:_t.ContentType.application_data,data:j.util.createBuffer(e)})),_t.flush(i)},i.prepareHeartbeatRequest=function(e,t){return e instanceof j.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),i.expectedHeartbeatPayload=e,_t.queue(i,_t.createRecord(i,{type:_t.ContentType.heartbeat,data:_t.createHeartbeat(_t.HeartbeatMessageType.heartbeat_request,e,t)})),_t.flush(i)},i.close=function(e){if(!i.fail&&i.sessionCache&&i.session){var t={id:i.session.id,version:i.session.version,sp:i.session.sp};t.sp.keys=null,i.sessionCache.setSession(t.id,t)}i.open&&(i.open=!1,i.input.clear(),(i.isConnected||i.handshaking)&&(i.isConnected=i.handshaking=!1,_t.queue(i,_t.createAlert(i,{level:_t.Alert.Level.warning,description:_t.Alert.Description.close_notify})),_t.flush(i)),i.closed(i)),i.reset(e)},i},j.tls=j.tls||{},_t)"function"!=typeof _t[ir]&&(j.tls[ir]=_t[ir]);j.tls.prf_tls1=wt,j.tls.hmac_sha1=function(e,t,r){var n=j.hmac.create();n.start("SHA1",e);var o=j.util.createBuffer();return o.putInt32(t[0]),o.putInt32(t[1]),o.putByte(r.type),o.putByte(r.version.major),o.putByte(r.version.minor),o.putInt16(r.length),o.putBytes(r.fragment.bytes()),n.update(o.getBytes()),n.digest().getBytes()},j.tls.createSessionCache=_t.createSessionCache,j.tls.createConnection=_t.createConnection,C((function(e){var t=e.exports=j.tls;function r(e,r,o){var a=r.entity===j.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:j.cipher.createDecipher("AES-CBC",a?o.keys.server_write_key:o.keys.client_write_key),iv:a?o.keys.server_write_IV:o.keys.client_write_IV},e.write.cipherState={init:!1,cipher:j.cipher.createCipher("AES-CBC",a?o.keys.client_write_key:o.keys.server_write_key),iv:a?o.keys.client_write_IV:o.keys.server_write_IV},e.read.cipherFunction=i,e.write.cipherFunction=n,e.read.macLength=e.write.macLength=o.mac_length,e.read.macFunction=e.write.macFunction=t.hmac_sha1}function n(e,r){var n,a=!1,i=r.macFunction(r.macKey,r.sequenceNumber,e);e.fragment.putBytes(i),r.updateSequenceNumber(),n=e.version.minor===t.Versions.TLS_1_0.minor?r.cipherState.init?null:r.cipherState.iv:j.random.getBytesSync(16),r.cipherState.init=!0;var s=r.cipherState.cipher;return s.start({iv:n}),e.version.minor>=t.Versions.TLS_1_1.minor&&s.output.putBytes(n),s.update(e.fragment),s.finish(o)&&(e.fragment=s.output,e.length=e.fragment.length(),a=!0),a}function o(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function a(e,t,r){var n=!0;if(r){for(var o=t.length(),a=t.last(),i=o-1-a;i<o-1;++i)n=n&&t.at(i)==a;n&&t.truncate(a+1)}return n}function i(e,r){var n,o;n=e.version.minor===t.Versions.TLS_1_0.minor?r.cipherState.init?null:r.cipherState.iv:e.fragment.getBytes(16),r.cipherState.init=!0;var i=r.cipherState.cipher;i.start({iv:n}),i.update(e.fragment),o=i.finish(a);var s=r.macLength,c=j.random.getBytesSync(s),u=i.output.length();u>=s?(e.fragment=i.output.getBytes(u-s),c=i.output.getBytes(s)):e.fragment=i.output.getBytes(),e.fragment=j.util.createBuffer(e.fragment),e.length=e.fragment.length();var l=r.macFunction(r.macKey,r.sequenceNumber,e);return r.updateSequenceNumber(),function(e,t,r){var n=j.hmac.create();return n.start("SHA1",e),n.update(t),t=n.digest().getBytes(),n.start(null,null),n.update(r),t===n.digest().getBytes()}(r.macKey,c,l)&&o}t.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,e.cipher_type=t.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=t.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:r},t.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=t.BulkCipherAlgorithm.aes,e.cipher_type=t.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=t.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:r}})),j.debug=j.debug||{},j.debug.storage={},j.debug.get=function(e,t){var r;return void 0===e?r=j.debug.storage:e in j.debug.storage&&(r=void 0===t?j.debug.storage[e]:j.debug.storage[e][t]),r},j.debug.set=function(e,t,r){e in j.debug.storage||(j.debug.storage[e]={}),j.debug.storage[e][t]=r},j.debug.clear=function(e,t){void 0===e?j.debug.storage={}:e in j.debug.storage&&(void 0===t?delete j.debug.storage[e]:delete j.debug.storage[e][t])},C((function(e){var t=e.exports=j.sha512=j.sha512||{};j.md.sha512=j.md.algorithms.sha512=t;var r=j.sha384=j.sha512.sha384=j.sha512.sha384||{};r.create=function(){return t.create("SHA-384")},j.md.sha384=j.md.algorithms.sha384=r,j.sha512.sha256=j.sha512.sha256||{create:function(){return t.create("SHA-512/256")}},j.md["sha512/256"]=j.md.algorithms["sha512/256"]=j.sha512.sha256,j.sha512.sha224=j.sha512.sha224||{create:function(){return t.create("SHA-512/224")}},j.md["sha512/224"]=j.md.algorithms["sha512/224"]=j.sha512.sha224,t.create=function(e){if(o||(n=String.fromCharCode(128),n+=j.util.fillString(String.fromCharCode(0),128),a=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(i={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],i["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],i["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],i["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],o=!0),void 0===e&&(e="SHA-512"),!(e in i))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=i[e],r=null,c=j.util.createBuffer(),u=new Array(80),l=0;l<80;++l)u[l]=new Array(2);var d=64;switch(e){case"SHA-384":d=48;break;case"SHA-512/256":d=32;break;case"SHA-512/224":d=28}var f={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:d,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){f.messageLength=0,f.fullMessageLength=f.messageLength128=[];for(var e=f.messageLengthSize/4,n=0;n<e;++n)f.fullMessageLength.push(0);for(c=j.util.createBuffer(),r=new Array(t.length),n=0;n<t.length;++n)r[n]=t[n].slice(0);return f}};return f.start(),f.update=function(e,t){"utf8"===t&&(e=j.util.encodeUtf8(e));var n=e.length;f.messageLength+=n,n=[n/4294967296>>>0,n>>>0];for(var o=f.fullMessageLength.length-1;o>=0;--o)f.fullMessageLength[o]+=n[1],n[1]=n[0]+(f.fullMessageLength[o]/4294967296>>>0),f.fullMessageLength[o]=f.fullMessageLength[o]>>>0,n[0]=n[1]/4294967296>>>0;return c.putBytes(e),s(r,u,c),(c.read>2048||0===c.length())&&c.compact(),f},f.digest=function(){var t=j.util.createBuffer();t.putBytes(c.bytes());var o,a=f.fullMessageLength[f.fullMessageLength.length-1]+f.messageLengthSize&f.blockLength-1;t.putBytes(n.substr(0,f.blockLength-a));for(var i=8*f.fullMessageLength[0],l=0;l<f.fullMessageLength.length-1;++l)i+=(o=8*f.fullMessageLength[l+1])/4294967296>>>0,t.putInt32(i>>>0),i=o>>>0;t.putInt32(i);var d=new Array(r.length);for(l=0;l<r.length;++l)d[l]=r[l].slice(0);s(d,u,t);var p,h=j.util.createBuffer();for(p="SHA-512"===e?d.length:"SHA-384"===e?d.length-2:d.length-4,l=0;l<p;++l)h.putInt32(d[l][0]),l===p-1&&"SHA-512/224"===e||h.putInt32(d[l][1]);return h},f};var n=null,o=!1,a=null,i=null;function s(e,t,r){for(var n,o,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E,B,_,x,T,A,I,P,R,D,N,O,L,M=r.length();M>=128;){for(I=0;I<16;++I)t[I][0]=r.getInt32()>>>0,t[I][1]=r.getInt32()>>>0;for(;I<80;++I)n=(((P=(D=t[I-2])[0])>>>19|(R=D[1])<<13)^(R>>>29|P<<3)^P>>>6)>>>0,o=((P<<13|R>>>19)^(R<<3|P>>>29)^(P<<26|R>>>6))>>>0,i=(((P=(O=t[I-15])[0])>>>1|(R=O[1])<<31)^(P>>>8|R<<24)^P>>>7)>>>0,s=((P<<31|R>>>1)^(P<<24|R>>>8)^(P<<25|R>>>7))>>>0,N=t[I-7],L=t[I-16],R=o+N[1]+s+L[1],t[I][0]=n+N[0]+i+L[0]+(R/4294967296>>>0)>>>0,t[I][1]=R>>>0;for(h=e[0][0],m=e[0][1],g=e[1][0],v=e[1][1],y=e[2][0],b=e[2][1],C=e[3][0],w=e[3][1],k=e[4][0],S=e[4][1],E=e[5][0],B=e[5][1],_=e[6][0],x=e[6][1],T=e[7][0],A=e[7][1],I=0;I<80;++I)l=((k>>>14|S<<18)^(k>>>18|S<<14)^(S>>>9|k<<23))>>>0,d=(_^k&(E^_))>>>0,c=((h>>>28|m<<4)^(m>>>2|h<<30)^(m>>>7|h<<25))>>>0,u=((h<<4|m>>>28)^(m<<30|h>>>2)^(m<<25|h>>>7))>>>0,f=(h&g|y&(h^g))>>>0,p=(m&v|b&(m^v))>>>0,R=A+(((k<<18|S>>>14)^(k<<14|S>>>18)^(S<<23|k>>>9))>>>0)+((x^S&(B^x))>>>0)+a[I][1]+t[I][1],n=T+l+d+a[I][0]+t[I][0]+(R/4294967296>>>0)>>>0,o=R>>>0,i=c+f+((R=u+p)/4294967296>>>0)>>>0,s=R>>>0,T=_,A=x,_=E,x=B,E=k,B=S,k=C+n+((R=w+o)/4294967296>>>0)>>>0,S=R>>>0,C=y,w=b,y=g,b=v,g=h,v=m,h=n+i+((R=o+s)/4294967296>>>0)>>>0,m=R>>>0;R=e[0][1]+m,e[0][0]=e[0][0]+h+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+v,e[1][0]=e[1][0]+g+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+b,e[2][0]=e[2][0]+y+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+w,e[3][0]=e[3][0]+C+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+S,e[4][0]=e[4][0]+k+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+B,e[5][0]=e[5][0]+E+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+x,e[6][0]=e[6][0]+_+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+A,e[7][0]=e[7][0]+T+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,M-=128}}}));var sr=j.asn1,cr={privateKeyValidator:{name:"PrivateKeyInfo",tagClass:sr.Class.UNIVERSAL,type:sr.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:sr.Class.UNIVERSAL,type:sr.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:sr.Class.UNIVERSAL,type:sr.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:sr.Class.UNIVERSAL,type:sr.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:sr.Class.UNIVERSAL,type:sr.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},publicKeyValidator:{name:"SubjectPublicKeyInfo",tagClass:sr.Class.UNIVERSAL,type:sr.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:sr.Class.UNIVERSAL,type:sr.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:sr.Class.UNIVERSAL,type:sr.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:sr.Class.UNIVERSAL,type:sr.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},ur=cr.publicKeyValidator,lr=cr.privateKeyValidator;if(void 0===dr)var dr=j.jsbn.BigInteger;var fr=j.util.ByteBuffer,pr="undefined"==typeof Buffer?Uint8Array:Buffer;j.pki=j.pki||{},j.pki.ed25519=j.ed25519=j.ed25519||{};var hr=j.ed25519;function mr(e){var t=e.message;if(t instanceof Uint8Array||t instanceof pr)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new fr(t,r)}else if(!(t instanceof fr))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new pr(t.length()),o=0;o<n.length;++o)n[o]=t.at(o);return n}hr.constants={},hr.constants.PUBLIC_KEY_BYTE_LENGTH=32,hr.constants.PRIVATE_KEY_BYTE_LENGTH=64,hr.constants.SEED_BYTE_LENGTH=32,hr.constants.SIGN_BYTE_LENGTH=64,hr.constants.HASH_BYTE_LENGTH=64,hr.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=j.random.getBytesSync(hr.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==hr.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+hr.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=mr({message:t,encoding:"binary"});for(var r=new pr(hr.constants.PUBLIC_KEY_BYTE_LENGTH),n=new pr(hr.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=t[o];return function(e,t){var r,n=[Ur(),Ur(),Ur(),Ur()],o=Er(t,32);for(o[0]&=248,o[31]&=127,o[31]|=64,Or(n,o),Ar(e,n),r=0;r<32;++r)t[r+32]=e[r]}(r,n),{publicKey:r,privateKey:n}},hr.privateKeyFromAsn1=function(e){var t={},r=[];if(!j.asn1.validate(e,lr,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var o=j.asn1.derToOid(t.privateKeyOid),a=j.oids.EdDSA25519;if(o!==a)throw new Error('Invalid OID "'+o+'"; OID must be "'+a+'".');var i=t.privateKey;return{privateKeyBytes:mr({message:j.asn1.fromDer(i).value,encoding:"binary"})}},hr.publicKeyFromAsn1=function(e){var t={},r=[];if(!j.asn1.validate(e,ur,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var o=j.asn1.derToOid(t.publicKeyOid),a=j.oids.EdDSA25519;if(o!==a)throw new Error('Invalid OID "'+o+'"; OID must be "'+a+'".');var i=t.ed25519PublicKey;if(i.length!==hr.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return mr({message:i,encoding:"binary"})},hr.publicKeyFromPrivateKey=function(e){var t=mr({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==hr.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+hr.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new pr(hr.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},hr.sign=function(e){var t=mr(e=e||{}),r=mr({message:e.privateKey,encoding:"binary"});if(r.length===hr.constants.SEED_BYTE_LENGTH)r=hr.generateKeyPair({seed:r}).privateKey;else if(r.length!==hr.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+hr.constants.SEED_BYTE_LENGTH+" or "+hr.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new pr(hr.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,n){var o,a,i=new Float64Array(64),s=[Ur(),Ur(),Ur(),Ur()],c=Er(n,32);for(c[0]&=248,c[31]&=127,c[31]|=64,o=0;o<r;++o)e[64+o]=t[o];for(o=0;o<32;++o)e[32+o]=c[32+o];var u=Er(e.subarray(32),r+32);for(_r(u),Or(s,u),Ar(e,s),o=32;o<64;++o)e[o]=n[o];var l=Er(e,r+64);for(_r(l),o=32;o<64;++o)i[o]=0;for(o=0;o<32;++o)i[o]=u[o];for(o=0;o<32;++o)for(a=0;a<32;a++)i[o+a]+=l[o]*c[a];Br(e.subarray(32),i)}(n,t,t.length,r);for(var o=new pr(hr.constants.SIGN_BYTE_LENGTH),a=0;a<o.length;++a)o[a]=n[a];return o},hr.verify=function(e){var t=mr(e=e||{});if(void 0===e.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=mr({message:e.signature,encoding:"binary"});if(r.length!==hr.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+hr.constants.SIGN_BYTE_LENGTH);var n=mr({message:e.publicKey,encoding:"binary"});if(n.length!==hr.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+hr.constants.PUBLIC_KEY_BYTE_LENGTH);var o,a=new pr(hr.constants.SIGN_BYTE_LENGTH+t.length),i=new pr(hr.constants.SIGN_BYTE_LENGTH+t.length);for(o=0;o<hr.constants.SIGN_BYTE_LENGTH;++o)a[o]=r[o];for(o=0;o<t.length;++o)a[o+hr.constants.SIGN_BYTE_LENGTH]=t[o];return function(e,t,r,n){var o,a=new pr(32),i=[Ur(),Ur(),Ur(),Ur()],s=[Ur(),Ur(),Ur(),Ur()];if(r<64)return-1;if(function(e,t){var r=Ur(),n=Ur(),o=Ur(),a=Ur(),i=Ur(),s=Ur(),c=Ur();return Lr(e[2],vr),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),zr(o,e[1]),qr(a,o,yr),Vr(o,o,e[2]),jr(a,e[2],a),zr(i,a),zr(s,i),qr(c,s,i),qr(r,c,o),qr(r,r,a),function(e,t){var r,n=Ur();for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)zr(n,n),1!==r&&qr(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),qr(r,r,o),qr(r,r,a),qr(r,r,a),qr(e[0],r,a),zr(n,e[0]),qr(n,n,a),Pr(n,o)&&qr(e[0],e[0],Sr),zr(n,e[0]),qr(n,n,a),Pr(n,o)?-1:(Dr(e[0])===t[31]>>7&&Vr(e[0],gr,e[0]),qr(e[3],e[0],e[1]),0)}(s,n))return-1;for(o=0;o<r;++o)e[o]=t[o];for(o=0;o<32;++o)e[o+32]=n[o];var c=Er(e,r);if(_r(c),Nr(i,s,c),Or(s,t.subarray(32)),xr(i,s),Ar(a,i),r-=64,Rr(t,0,a,0)){for(o=0;o<r;++o)e[o]=0;return-1}for(o=0;o<r;++o)e[o]=t[o+64];return r}(i,a,a.length,n)>=0};var gr=Ur(),vr=Ur([1]),yr=Ur([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),br=Ur([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Cr=Ur([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),wr=Ur([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),kr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),Sr=Ur([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Er(e,t){var r=j.md.sha512.create(),n=new fr(e);r.update(n.getBytes(t),"binary");var o=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(o,"binary");for(var a=new pr(hr.constants.HASH_BYTE_LENGTH),i=0;i<64;++i)a[i]=o.charCodeAt(i);return a}function Br(e,t){var r,n,o,a;for(n=63;n>=32;--n){for(r=0,o=n-32,a=n-12;o<a;++o)t[o]+=r-16*t[n]*kr[o-(n-32)],r=t[o]+128>>8,t[o]-=256*r;t[o]+=r,t[n]=0}for(r=0,o=0;o<32;++o)t[o]+=r-(t[31]>>4)*kr[o],r=t[o]>>8,t[o]&=255;for(o=0;o<32;++o)t[o]-=r*kr[o];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function _r(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;Br(e,t)}function xr(e,t){var r=Ur(),n=Ur(),o=Ur(),a=Ur(),i=Ur(),s=Ur(),c=Ur(),u=Ur(),l=Ur();Vr(r,e[1],e[0]),Vr(l,t[1],t[0]),qr(r,r,l),jr(n,e[0],e[1]),jr(l,t[0],t[1]),qr(n,n,l),qr(o,e[3],t[3]),qr(o,o,br),qr(a,e[2],t[2]),jr(a,a,a),Vr(i,n,r),Vr(s,a,o),jr(c,a,o),jr(u,n,r),qr(e[0],i,s),qr(e[1],u,c),qr(e[2],c,s),qr(e[3],i,u)}function Tr(e,t,r){for(var n=0;n<4;++n)Fr(e[n],t[n],r)}function Ar(e,t){var r=Ur(),n=Ur(),o=Ur();!function(e,t){var r,n=Ur();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)zr(n,n),2!==r&&4!==r&&qr(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(o,t[2]),qr(r,t[0],o),qr(n,t[1],o),Ir(e,n),e[31]^=Dr(r)<<7}function Ir(e,t){var r,n,o,a=Ur(),i=Ur();for(r=0;r<16;++r)i[r]=t[r];for(Mr(i),Mr(i),Mr(i),n=0;n<2;++n){for(a[0]=i[0]-65517,r=1;r<15;++r)a[r]=i[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=i[15]-32767-(a[14]>>16&1),o=a[15]>>16&1,a[14]&=65535,Fr(i,a,1-o)}for(r=0;r<16;r++)e[2*r]=255&i[r],e[2*r+1]=i[r]>>8}function Pr(e,t){var r=new pr(32),n=new pr(32);return Ir(r,e),Ir(n,t),Rr(r,0,n,0)}function Rr(e,t,r,n){return function(e,t,r,n,o){var a,i=0;for(a=0;a<32;++a)i|=e[t+a]^r[n+a];return(1&i-1>>>8)-1}(e,t,r,n)}function Dr(e){var t=new pr(32);return Ir(t,e),1&t[0]}function Nr(e,t,r){var n,o;for(Lr(e[0],gr),Lr(e[1],vr),Lr(e[2],vr),Lr(e[3],gr),o=255;o>=0;--o)Tr(e,t,n=r[o/8|0]>>(7&o)&1),xr(t,e),xr(e,e),Tr(e,t,n)}function Or(e,t){var r=[Ur(),Ur(),Ur(),Ur()];Lr(r[0],Cr),Lr(r[1],wr),Lr(r[2],vr),qr(r[3],Cr,wr),Nr(e,r,t)}function Lr(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function Mr(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function Fr(e,t,r){for(var n,o=~(r-1),a=0;a<16;++a)n=o&(e[a]^t[a]),e[a]^=n,t[a]^=n}function Ur(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function jr(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function Vr(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function zr(e,t){qr(e,t,t)}function qr(e,t,r){var n,o,a=0,i=0,s=0,c=0,u=0,l=0,d=0,f=0,p=0,h=0,m=0,g=0,v=0,y=0,b=0,C=0,w=0,k=0,S=0,E=0,B=0,_=0,x=0,T=0,A=0,I=0,P=0,R=0,D=0,N=0,O=0,L=r[0],M=r[1],F=r[2],U=r[3],j=r[4],V=r[5],z=r[6],q=r[7],H=r[8],K=r[9],W=r[10],Q=r[11],G=r[12],X=r[13],Y=r[14],$=r[15];a+=(n=t[0])*L,i+=n*M,s+=n*F,c+=n*U,u+=n*j,l+=n*V,d+=n*z,f+=n*q,p+=n*H,h+=n*K,m+=n*W,g+=n*Q,v+=n*G,y+=n*X,b+=n*Y,C+=n*$,i+=(n=t[1])*L,s+=n*M,c+=n*F,u+=n*U,l+=n*j,d+=n*V,f+=n*z,p+=n*q,h+=n*H,m+=n*K,g+=n*W,v+=n*Q,y+=n*G,b+=n*X,C+=n*Y,w+=n*$,s+=(n=t[2])*L,c+=n*M,u+=n*F,l+=n*U,d+=n*j,f+=n*V,p+=n*z,h+=n*q,m+=n*H,g+=n*K,v+=n*W,y+=n*Q,b+=n*G,C+=n*X,w+=n*Y,k+=n*$,c+=(n=t[3])*L,u+=n*M,l+=n*F,d+=n*U,f+=n*j,p+=n*V,h+=n*z,m+=n*q,g+=n*H,v+=n*K,y+=n*W,b+=n*Q,C+=n*G,w+=n*X,k+=n*Y,S+=n*$,u+=(n=t[4])*L,l+=n*M,d+=n*F,f+=n*U,p+=n*j,h+=n*V,m+=n*z,g+=n*q,v+=n*H,y+=n*K,b+=n*W,C+=n*Q,w+=n*G,k+=n*X,S+=n*Y,E+=n*$,l+=(n=t[5])*L,d+=n*M,f+=n*F,p+=n*U,h+=n*j,m+=n*V,g+=n*z,v+=n*q,y+=n*H,b+=n*K,C+=n*W,w+=n*Q,k+=n*G,S+=n*X,E+=n*Y,B+=n*$,d+=(n=t[6])*L,f+=n*M,p+=n*F,h+=n*U,m+=n*j,g+=n*V,v+=n*z,y+=n*q,b+=n*H,C+=n*K,w+=n*W,k+=n*Q,S+=n*G,E+=n*X,B+=n*Y,_+=n*$,f+=(n=t[7])*L,p+=n*M,h+=n*F,m+=n*U,g+=n*j,v+=n*V,y+=n*z,b+=n*q,C+=n*H,w+=n*K,k+=n*W,S+=n*Q,E+=n*G,B+=n*X,_+=n*Y,x+=n*$,p+=(n=t[8])*L,h+=n*M,m+=n*F,g+=n*U,v+=n*j,y+=n*V,b+=n*z,C+=n*q,w+=n*H,k+=n*K,S+=n*W,E+=n*Q,B+=n*G,_+=n*X,x+=n*Y,T+=n*$,h+=(n=t[9])*L,m+=n*M,g+=n*F,v+=n*U,y+=n*j,b+=n*V,C+=n*z,w+=n*q,k+=n*H,S+=n*K,E+=n*W,B+=n*Q,_+=n*G,x+=n*X,T+=n*Y,A+=n*$,m+=(n=t[10])*L,g+=n*M,v+=n*F,y+=n*U,b+=n*j,C+=n*V,w+=n*z,k+=n*q,S+=n*H,E+=n*K,B+=n*W,_+=n*Q,x+=n*G,T+=n*X,A+=n*Y,I+=n*$,g+=(n=t[11])*L,v+=n*M,y+=n*F,b+=n*U,C+=n*j,w+=n*V,k+=n*z,S+=n*q,E+=n*H,B+=n*K,_+=n*W,x+=n*Q,T+=n*G,A+=n*X,I+=n*Y,P+=n*$,v+=(n=t[12])*L,y+=n*M,b+=n*F,C+=n*U,w+=n*j,k+=n*V,S+=n*z,E+=n*q,B+=n*H,_+=n*K,x+=n*W,T+=n*Q,A+=n*G,I+=n*X,P+=n*Y,R+=n*$,y+=(n=t[13])*L,b+=n*M,C+=n*F,w+=n*U,k+=n*j,S+=n*V,E+=n*z,B+=n*q,_+=n*H,x+=n*K,T+=n*W,A+=n*Q,I+=n*G,P+=n*X,R+=n*Y,D+=n*$,b+=(n=t[14])*L,C+=n*M,w+=n*F,k+=n*U,S+=n*j,E+=n*V,B+=n*z,_+=n*q,x+=n*H,T+=n*K,A+=n*W,I+=n*Q,P+=n*G,R+=n*X,D+=n*Y,N+=n*$,C+=(n=t[15])*L,i+=38*(k+=n*F),s+=38*(S+=n*U),c+=38*(E+=n*j),u+=38*(B+=n*V),l+=38*(_+=n*z),d+=38*(x+=n*q),f+=38*(T+=n*H),p+=38*(A+=n*K),h+=38*(I+=n*W),m+=38*(P+=n*Q),g+=38*(R+=n*G),v+=38*(D+=n*X),y+=38*(N+=n*Y),b+=38*(O+=n*$),a=(n=(a+=38*(w+=n*M))+(o=1)+65535)-65536*(o=Math.floor(n/65536)),i=(n=i+o+65535)-65536*(o=Math.floor(n/65536)),s=(n=s+o+65535)-65536*(o=Math.floor(n/65536)),c=(n=c+o+65535)-65536*(o=Math.floor(n/65536)),u=(n=u+o+65535)-65536*(o=Math.floor(n/65536)),l=(n=l+o+65535)-65536*(o=Math.floor(n/65536)),d=(n=d+o+65535)-65536*(o=Math.floor(n/65536)),f=(n=f+o+65535)-65536*(o=Math.floor(n/65536)),p=(n=p+o+65535)-65536*(o=Math.floor(n/65536)),h=(n=h+o+65535)-65536*(o=Math.floor(n/65536)),m=(n=m+o+65535)-65536*(o=Math.floor(n/65536)),g=(n=g+o+65535)-65536*(o=Math.floor(n/65536)),v=(n=v+o+65535)-65536*(o=Math.floor(n/65536)),y=(n=y+o+65535)-65536*(o=Math.floor(n/65536)),b=(n=b+o+65535)-65536*(o=Math.floor(n/65536)),C=(n=C+o+65535)-65536*(o=Math.floor(n/65536)),a=(n=(a+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(n/65536)),i=(n=i+o+65535)-65536*(o=Math.floor(n/65536)),s=(n=s+o+65535)-65536*(o=Math.floor(n/65536)),c=(n=c+o+65535)-65536*(o=Math.floor(n/65536)),u=(n=u+o+65535)-65536*(o=Math.floor(n/65536)),l=(n=l+o+65535)-65536*(o=Math.floor(n/65536)),d=(n=d+o+65535)-65536*(o=Math.floor(n/65536)),f=(n=f+o+65535)-65536*(o=Math.floor(n/65536)),p=(n=p+o+65535)-65536*(o=Math.floor(n/65536)),h=(n=h+o+65535)-65536*(o=Math.floor(n/65536)),m=(n=m+o+65535)-65536*(o=Math.floor(n/65536)),g=(n=g+o+65535)-65536*(o=Math.floor(n/65536)),v=(n=v+o+65535)-65536*(o=Math.floor(n/65536)),y=(n=y+o+65535)-65536*(o=Math.floor(n/65536)),b=(n=b+o+65535)-65536*(o=Math.floor(n/65536)),C=(n=C+o+65535)-65536*(o=Math.floor(n/65536)),a+=o-1+37*(o-1),e[0]=a,e[1]=i,e[2]=s,e[3]=c,e[4]=u,e[5]=l,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=m,e[11]=g,e[12]=v,e[13]=y,e[14]=b,e[15]=C}j.kem=j.kem||{};var Hr=j.jsbn.BigInteger;function Kr(e,t,r,n){e.generate=function(e,o){for(var a=new j.util.ByteBuffer,i=Math.ceil(o/n)+r,s=new j.util.ByteBuffer,c=r;c<i;++c){s.putInt32(c),t.start(),t.update(e+s.getBytes());var u=t.digest();a.putBytes(u.getBytes(n))}return a.truncate(a.length()-o),a.getBytes()}}j.kem.rsa={},j.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||j.random;return{encrypt:function(t,n){var o,a=Math.ceil(t.n.bitLength()/8);do{o=new Hr(j.util.bytesToHex(r.getBytesSync(a)),16).mod(t.n)}while(o.compareTo(Hr.ONE)<=0);var i=a-(o=j.util.hexToBytes(o.toString(16))).length;return i>0&&(o=j.util.fillString(String.fromCharCode(0),i)+o),{encapsulation:t.encrypt(o,"NONE"),key:e.generate(o,n)}},decrypt:function(t,r,n){var o=t.decrypt(r,"NONE");return e.generate(o,n)}}},j.kem.kdf1=function(e,t){Kr(this,e,0,t||e.digestLength)},j.kem.kdf2=function(e,t){Kr(this,e,1,t||e.digestLength)},j.log=j.log||{},j.log.levels=["none","error","warning","info","debug","verbose","max"];var Wr={},Qr=[],Gr=null;j.log.LEVEL_LOCKED=2,j.log.NO_LEVEL_CHECK=4,j.log.INTERPOLATE=8;for(var Xr=0;Xr<j.log.levels.length;++Xr){var Yr=j.log.levels[Xr];Wr[Yr]={index:Xr,name:Yr.toUpperCase()}}j.log.logMessage=function(e){for(var t=Wr[e.level].index,r=0;r<Qr.length;++r){var n=Qr[r];n.flags&j.log.NO_LEVEL_CHECK?n.f(e):t<=Wr[n.level].index&&n.f(n,e)}},j.log.prepareStandard=function(e){"standard"in e||(e.standard=Wr[e.level].name+" ["+e.category+"] "+e.message)},j.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||e.arguments),e.full=j.util.format.apply(this,t)}},j.log.prepareStandardFull=function(e){"standardFull"in e||(j.log.prepareStandard(e),e.standardFull=e.standard)};var $r=["error","warning","info","debug","verbose"];for(Xr=0;Xr<$r.length;++Xr)!function(e){j.log[e]=function(t,r){var n=Array.prototype.slice.call(arguments).slice(2),o={timestamp:new Date,level:e,category:t,message:r,arguments:n};j.log.logMessage(o)}}($r[Xr]);if(j.log.makeLogger=function(e){var t={flags:0,f:e};return j.log.setLevel(t,"none"),t},j.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&j.log.LEVEL_LOCKED))for(var n=0;n<j.log.levels.length;++n)if(t==j.log.levels[n]){e.level=t,r=!0;break}return r},j.log.lock=function(e,t){void 0===t||t?e.flags|=j.log.LEVEL_LOCKED:e.flags&=~j.log.LEVEL_LOCKED},j.log.addLogger=function(e){Qr.push(e)},"undefined"!=typeof console&&"log"in console){var Zr;if(console.error&&console.warn&&console.info&&console.debug){var Jr={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},en=function(e,t){j.log.prepareStandard(t);var r=Jr[t.level],n=[t.standard];n=n.concat(t.arguments.slice()),r.apply(console,n)};Zr=j.log.makeLogger(en)}else en=function(e,t){j.log.prepareStandardFull(t),console.log(t.standardFull)},Zr=j.log.makeLogger(en);j.log.setLevel(Zr,"debug"),j.log.addLogger(Zr),Gr=Zr}else console={log:function(){}};if(null!==Gr){var tn=j.util.getQueryVariables();"console.level"in tn&&j.log.setLevel(Gr,tn["console.level"].slice(-1)[0]),"console.lock"in tn&&"true"==tn["console.lock"].slice(-1)[0]&&j.log.lock(Gr)}j.log.consoleLogger=Gr,C((function(e){var t=j.asn1,r=e.exports=j.pkcs7=j.pkcs7||{};function n(e){var n={},o=[];if(!t.validate(e,r.asn1.recipientInfoValidator,n,o)){var a=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw a.errors=o,a}return{version:n.version.charCodeAt(0),issuer:j.pki.RDNAttributesAsArray(n.issuer),serialNumber:j.util.createBuffer(n.serial).toHex(),encryptedContent:{algorithm:t.derToOid(n.encAlgorithm),parameter:n.encParameter.value,content:n.encKey}}}function o(e){for(var r,n=[],o=0;o<e.length;++o)n.push((r=e[o],t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(r.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[j.pki.distinguishedNameToAsn1({attributes:r.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,j.util.hexToBytes(r.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.encryptedContent.algorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,r.encryptedContent.content)])));return n}function a(e){var r=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[j.pki.distinguishedNameToAsn1({attributes:e.issuer}),t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,j.util.hexToBytes(e.serialNumber))]),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.digestAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&r.value.push(e.authenticatedAttributesAsn1),r.value.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.signatureAlgorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")])),r.value.push(t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var n=t.create(t.Class.CONTEXT_SPECIFIC,1,!0,[]),o=0;o<e.unauthenticatedAttributes.length;++o){var a=e.unauthenticatedAttributes[o];n.values.push(i(a))}r.value.push(n)}return r}function i(e){var r;if(e.type===j.pki.oids.contentType)r=t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.value).getBytes());else if(e.type===j.pki.oids.messageDigest)r=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===j.pki.oids.signingTime){var n=new Date("1950-01-01T00:00:00Z"),o=new Date("2050-01-01T00:00:00Z"),a=e.value;if("string"==typeof a){var i=Date.parse(a);a=isNaN(i)?13===a.length?t.utcTimeToDate(a):t.generalizedTimeToDate(a):new Date(i)}r=a>=n&&a<o?t.create(t.Class.UNIVERSAL,t.Type.UTCTIME,!1,t.dateToUtcTime(a)):t.create(t.Class.UNIVERSAL,t.Type.GENERALIZEDTIME,!1,t.dateToGeneralizedTime(a))}return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.type).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[r])])}function s(e,r,n){var o={};if(!t.validate(r,n,o,[])){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw a.errors=a,a}if(t.derToOid(o.contentType)!==j.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(o.encryptedContent){var i="";if(j.util.isArray(o.encryptedContent))for(var s=0;s<o.encryptedContent.length;++s){if(o.encryptedContent[s].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");i+=o.encryptedContent[s].value}else i=o.encryptedContent;e.encryptedContent={algorithm:t.derToOid(o.encAlgorithm),parameter:j.util.createBuffer(o.encParameter.value),content:j.util.createBuffer(i)}}if(o.content){if(i="",j.util.isArray(o.content))for(s=0;s<o.content.length;++s){if(o.content[s].type!==t.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");i+=o.content[s].value}else i=o.content;e.content=j.util.createBuffer(i)}return e.version=o.version.charCodeAt(0),e.rawCapture=o,o}function c(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case j.pki.oids["aes128-CBC"]:case j.pki.oids["aes192-CBC"]:case j.pki.oids["aes256-CBC"]:t=j.aes.createDecryptionCipher(e.encryptedContent.key);break;case j.pki.oids.desCBC:case j.pki.oids["des-EDE3-CBC"]:t=j.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}r.messageFromPem=function(e){var n=j.pem.decode(e)[0];if("PKCS7"!==n.type){var o=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw o.headerType=n.type,o}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var a=t.fromDer(n.body);return r.messageFromAsn1(a)},r.messageToPem=function(e,r){var n={type:"PKCS7",body:t.toDer(e.toAsn1()).getBytes()};return j.pem.encode(n,{maxline:r})},r.messageFromAsn1=function(e){var n={},o=[];if(!t.validate(e,r.asn1.contentInfoValidator,n,o)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw a.errors=o,a}var i,s=t.derToOid(n.contentType);switch(s){case j.pki.oids.envelopedData:i=r.createEnvelopedData();break;case j.pki.oids.encryptedData:i=r.createEncryptedData();break;case j.pki.oids.signedData:i=r.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+s+" is not (yet) supported.")}return i.fromAsn1(n.content.value[0]),i},r.createSignedData=function(){var e=null;return e={type:j.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(s(e,t,r.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var n=e.rawCapture.certificates.value,o=0;o<n.length;++o)e.certificates.push(j.pki.certificateFromAsn1(n[o]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],n=0;n<e.certificates.length;++n)r.push(j.pki.certificateToAsn1(e.certificates[n]));var o=[],a=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&a.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,r)),o.length>0&&a.value[0].value.push(t.create(t.Class.CONTEXT_SPECIFIC,1,!0,o)),a.value[0].value.push(t.create(t.Class.UNIVERSAL,t.Type.SET,!0,e.signerInfos)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.type).getBytes()),a])},addSigner:function(t){var r=t.issuer,n=t.serialNumber;if(t.certificate){var o=t.certificate;"string"==typeof o&&(o=j.pki.certificateFromPem(o)),r=o.issuer.attributes,n=o.serialNumber}var a=t.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=j.pki.privateKeyFromPem(a));var i=t.digestAlgorithm||j.pki.oids.sha1;switch(i){case j.pki.oids.sha1:case j.pki.oids.sha256:case j.pki.oids.sha384:case j.pki.oids.sha512:case j.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+i)}var s=t.authenticatedAttributes||[];if(s.length>0){for(var c=!1,u=!1,l=0;l<s.length;++l){var d=s[l];if(c||d.type!==j.pki.oids.contentType){if(u||d.type!==j.pki.oids.messageDigest);else if(u=!0,c)break}else if(c=!0,u)break}if(!c||!u)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:a,version:1,issuer:r,serialNumber:n,digestAlgorithm:i,signatureAlgorithm:j.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:s,unauthenticatedAttributes:[]})},sign:function(r){var n;r=r||{},("object"!=By(e.content)||null===e.contentInfo)&&(e.contentInfo=t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(j.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof j.util.ByteBuffer?n=e.content.bytes():"string"==typeof e.content&&(n=j.util.encodeUtf8(e.content)),r.detached?e.detachedContent=t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,n):e.contentInfo.value.push(t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,n)])))),0!==e.signers.length&&function(r){var n;if(!(n=e.detachedContent?e.detachedContent:(n=e.contentInfo.value[1]).value[0]))throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var o=t.derToOid(e.contentInfo.value[0].value),s=t.toDer(n);for(var c in s.getByte(),t.getBerValueLength(s),s=s.getBytes(),r)r[c].start().update(s);for(var u=new Date,l=0;l<e.signers.length;++l){var d=e.signers[l];if(0===d.authenticatedAttributes.length){if(o!==j.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{d.authenticatedAttributesAsn1=t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var f=t.create(t.Class.UNIVERSAL,t.Type.SET,!0,[]),p=0;p<d.authenticatedAttributes.length;++p){var h=d.authenticatedAttributes[p];h.type===j.pki.oids.messageDigest?h.value=r[d.digestAlgorithm].digest():h.type===j.pki.oids.signingTime&&(h.value||(h.value=u)),f.value.push(i(h)),d.authenticatedAttributesAsn1.value.push(i(h))}s=t.toDer(f).getBytes(),d.md.start().update(s)}d.signature=d.key.sign(d.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(a(e[r]));return t}(e.signers)}(function(){for(var r={},n=0;n<e.signers.length;++n){var o=e.signers[n];(a=o.digestAlgorithm)in r||(r[a]=j.md[j.pki.oids[a]].create()),0===o.authenticatedAttributes.length?o.md=r[a]:o.md=j.md[j.pki.oids[a]].create()}for(var a in e.digestAlgorithmIdentifiers=[],r)e.digestAlgorithmIdentifiers.push(t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(a).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.NULL,!1,"")]));return r}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=j.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},r.createEncryptedData=function(){var e=null;return e={type:j.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:j.pki.oids["aes256-CBC"]},fromAsn1:function(t){s(e,t,r.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),c(e)}}},r.createEnvelopedData=function(){var e=null;return e={type:j.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:j.pki.oids["aes256-CBC"]},fromAsn1:function(t){var o=s(e,t,r.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(n(e[r]));return t}(o.recipientInfos.value)},toAsn1:function(){return t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(e.type).getBytes()),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.INTEGER,!1,t.integerToDer(e.version).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SET,!0,o(e.recipients)),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,(r=e.encryptedContent,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(j.pki.oids.data).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.SEQUENCE,!0,[t.create(t.Class.UNIVERSAL,t.Type.OID,!1,t.oidToDer(r.algorithm).getBytes()),t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,r.parameter.getBytes())]),t.create(t.Class.CONTEXT_SPECIFIC,0,!0,[t.create(t.Class.UNIVERSAL,t.Type.OCTETSTRING,!1,r.content.getBytes())])]))])])]);var r},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var o=e.recipients[n],a=o.issuer;if(o.serialNumber===t.serialNumber&&a.length===r.length){for(var i=!0,s=0;s<r.length;++s)if(a[s].type!==r[s].type||a[s].value!==r[s].value){i=!1;break}if(i)return o}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case j.pki.oids.rsaEncryption:case j.pki.oids.desCBC:var n=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=j.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}c(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:j.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var n,o,a;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case j.pki.oids["aes128-CBC"]:n=16,o=16,a=j.aes.createEncryptionCipher;break;case j.pki.oids["aes192-CBC"]:n=24,o=16,a=j.aes.createEncryptionCipher;break;case j.pki.oids["aes256-CBC"]:n=32,o=16,a=j.aes.createEncryptionCipher;break;case j.pki.oids["des-EDE3-CBC"]:n=24,o=8,a=j.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=j.util.createBuffer(j.random.getBytes(n));else if(t.length()!=n)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+n+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=j.util.createBuffer(j.random.getBytes(o));var i=a(t);if(i.start(e.encryptedContent.parameter.copy()),i.update(e.content),!i.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=i.output}for(var s=0;s<e.recipients.length;++s){var c=e.recipients[s];if(void 0===c.encryptedContent.content)switch(c.encryptedContent.algorithm){case j.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}}}})),C((function(e){var t=e.exports=j.ssh=j.ssh||{};function r(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var n=j.util.hexToBytes(r);e.putInt32(n.length),e.putBytes(n)}function n(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=j.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}t.privateKeyToPutty=function(e,t,a){var i=""===(t=t||"")?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: ssh-rsa\r\n";s+="Encryption: "+i+"\r\n",s+="Comment: "+(a=a||"")+"\r\n";var c=j.util.createBuffer();n(c,"ssh-rsa"),r(c,e.e),r(c,e.n);var u=j.util.encode64(c.bytes(),64),l=Math.floor(u.length/66)+1;s+="Public-Lines: "+l+"\r\n",s+=u;var d,f=j.util.createBuffer();if(r(f,e.d),r(f,e.p),r(f,e.q),r(f,e.qInv),t){var p=f.length()+16-1;p-=p%16;var h=o(f.bytes());h.truncate(h.length()-p+f.length()),f.putBuffer(h);var m=j.util.createBuffer();m.putBuffer(o("\0\0\0\0",t)),m.putBuffer(o("\0\0\0",t));var g=j.aes.createEncryptionCipher(m.truncate(8),"CBC");g.start(j.util.createBuffer().fillWithByte(0,16)),g.update(f.copy()),g.finish();var v=g.output;v.truncate(16),d=j.util.encode64(v.bytes(),64)}else d=j.util.encode64(f.bytes(),64);s+="\r\nPrivate-Lines: "+(l=Math.floor(d.length/66)+1)+"\r\n",s+=d;var y=o("putty-private-key-file-mac-key",t),b=j.util.createBuffer();n(b,"ssh-rsa"),n(b,i),n(b,a),b.putInt32(c.length()),b.putBuffer(c),b.putInt32(f.length()),b.putBuffer(f);var C=j.hmac.create();return C.start("sha1",y),C.update(b.bytes()),s+"\r\nPrivate-MAC: "+C.digest().toHex()+"\r\n"},t.publicKeyToOpenSSH=function(e,t){t=t||"";var o=j.util.createBuffer();return n(o,"ssh-rsa"),r(o,e.e),r(o,e.n),"ssh-rsa "+j.util.encode64(o.bytes())+" "+t},t.privateKeyToOpenSSH=function(e,t){return t?j.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):j.pki.privateKeyToPem(e)},t.getPublicKeyFingerprint=function(e,t){var o=(t=t||{}).md||j.md.md5.create(),a=j.util.createBuffer();n(a,"ssh-rsa"),r(a,e.e),r(a,e.n),o.start(),o.update(a.getBytes());var i=o.digest();if("hex"===t.encoding){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}if("binary"===t.encoding)return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return i}}));var rn="forge.task",nn={},on=0;j.debug.set(rn,"tasks",nn);var an={};j.debug.set(rn,"queues",an);var sn="ready",cn="running",un="blocked",ln="sleeping",dn="done",fn="error",pn={ready:{}};pn.ready.stop=sn,pn.ready.start=cn,pn.ready.cancel=dn,pn.ready.fail=fn,pn.running={},pn.running.stop=sn,pn.running.start=cn,pn.running.block=un,pn.running.unblock=cn,pn.running.sleep=ln,pn.running.wakeup=cn,pn.running.cancel=dn,pn.running.fail=fn,pn.blocked={},pn.blocked.stop=un,pn.blocked.start=un,pn.blocked.block=un,pn.blocked.unblock=un,pn.blocked.sleep=un,pn.blocked.wakeup=un,pn.blocked.cancel=dn,pn.blocked.fail=fn,pn.sleeping={},pn.sleeping.stop=ln,pn.sleeping.start=ln,pn.sleeping.block=ln,pn.sleeping.unblock=ln,pn.sleeping.sleep=ln,pn.sleeping.wakeup=ln,pn.sleeping.cancel=dn,pn.sleeping.fail=fn,pn.done={},pn.done.stop=dn,pn.done.start=dn,pn.done.block=dn,pn.done.unblock=dn,pn.done.sleep=dn,pn.done.wakeup=dn,pn.done.cancel=dn,pn.done.fail=fn,pn.error={},pn.error.stop=fn,pn.error.start=fn,pn.error.block=fn,pn.error.unblock=fn,pn.error.sleep=fn,pn.error.wakeup=fn,pn.error.cancel=fn,pn.error.fail=fn;var hn=function(e){this.id=-1,this.name=e.name||"?",this.parent=e.parent||null,this.run=e.run,this.subtasks=[],this.error=!1,this.state=sn,this.blocks=0,this.timeoutId=null,this.swapTime=null,this.userData=null,this.id=on++,nn[this.id]=this};hn.prototype.debug=function(e){e=e||"",j.log.debug(rn,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",an)},hn.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var r=new hn({run:t,name:e,parent:this});return r.state=cn,r.type=this.type,r.successCallback=this.successCallback||null,r.failureCallback=this.failureCallback||null,this.subtasks.push(r),this},hn.prototype.parallel=function(e,t){return j.util.isArray(e)&&(t=e,e=this.name),this.next(e,(function(r){var n=r;n.block(t.length);for(var o=function(e,r){j.task.start({type:e,run:function(e){t[r](e)},success:function(e){n.unblock()},failure:function(e){n.unblock()}})},a=0;a<t.length;a++)o(e+"__parallel-"+r.id+"-"+a,a)}))},hn.prototype.stop=function(){this.state=pn[this.state].stop},hn.prototype.start=function(){this.error=!1,this.state=pn[this.state].start,this.state===cn&&(this.start=new Date,this.run(this),mn(this,0))},hn.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=pn[this.state].block)},hn.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==dn&&(this.state=cn,mn(this,0)),this.blocks},hn.prototype.sleep=function(e){e=void 0===e?0:e,this.state=pn[this.state].sleep;var t=this;this.timeoutId=setTimeout((function(){t.timeoutId=null,t.state=cn,mn(t,0)}),e)},hn.prototype.wait=function(e){e.wait(this)},hn.prototype.wakeup=function(){this.state===ln&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=cn,mn(this,0))},hn.prototype.cancel=function(){this.state=pn[this.state].cancel,this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},hn.prototype.fail=function(e){if(this.error=!0,gn(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,mn(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;gn(t,!0)}this.failureCallback&&this.failureCallback(this)}};var mn=function e(t,r){var n=r>30||+new Date-t.swapTime>20,o=function(r){if(r++,t.state===cn)if(n&&(t.swapTime=+new Date),t.subtasks.length>0){var o=t.subtasks.shift();o.error=t.error,o.swapTime=t.swapTime,o.userData=t.userData,o.run(o),o.error||e(o,r)}else gn(t),t.error||null!==t.parent&&(t.parent.error=t.error,t.parent.swapTime=t.swapTime,t.parent.userData=t.userData,e(t.parent,r))};n?setTimeout(o,0):o(r)},gn=function(e,t){e.state=dn,delete nn[e.id],null===e.parent&&(e.type in an?0===an[e.type].length?j.log.error(rn,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):an[e.type][0]!==e?j.log.error(rn,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(an[e.type].shift(),0===an[e.type].length?delete an[e.type]:an[e.type][0].start()):j.log.error(rn,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};j.task=j.task||{},j.task.start=function(e){var t=new hn({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in an?an[e.type].push(t):(an[t.type]=[t],function(e){e.error=!1,e.state=pn[e.state].start,setTimeout((function(){e.state===cn&&(e.swapTime=+new Date,e.run(e),mn(e,0))}),0)}(t))},j.task.cancel=function(e){e in an&&(an[e]=[an[e][0]])},j.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var r in e.tasks={},t)t[r].unblock()}};return e};var vn=j,yn=function(){function e(e){this.secretKey=e}return e.prototype.encrypt=function(e,t){throw new Error("Method not implemented.")},e.prototype.decrypt=function(e,t){return function(e,t,r){void 0===r&&(r=vn.util.createBuffer(Uint8Array.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]).buffer));var n,o,a=vn.cipher.createDecipher("AES-CBC",t);return a.start({iv:r}),a.update(vn.util.createBuffer(vn.util.hexToBytes(e))),o=(n=a.output.data).charCodeAt(n.length-1),n.slice(0,-o)}(e,(r=this.secretKey,n=t.transactionID,""+r.slice(0,16)+n.slice(0,16)));var r,n},e}(),bn=function(){function e(e,t,n,o){void 0===n&&(n="production"),void 0===o&&(o={supportTransaction:!1,enableEncryption:!1}),this.transactionEnabled=o.supportTransaction||!1,this.encryptionEnabled=o.enableEncryption||!1;var a=O(e,t,n,{headers:o.httpHeaders});this.transactionManager=new U(a),this.encryptionService=new yn(t),this.compareFaceService=new l(a),this.clientSettingsService=new d(a),this.convertPDFService=new v(a),this.ekycPDFService=new y(a),this.readIDCardService=new r(a),this.requestVerifyIDCardService=new p(a),this.requestVerifyPortraitSerivce=new h(a),this.imagesService=new c(a),this.fileService=new u(a),this.verifyFaceLivenessService=new f(a),this.searchFaceService=new g(a),this.detectIDTamperingService=new m(a),this.httpClient=a}return e.prototype.enableTransaction=function(){this.transactionEnabled=!0},e.prototype.disableTransaction=function(){this.transactionEnabled=!1},e.prototype.enableEncryption=function(){this.encryptionEnabled=!0},e.prototype.disableEncryption=function(){this.encryptionEnabled=!1},e.prototype.compareFaces=function(e,t){return this.compareFaceService.request(e,t)},e.prototype.clientSettings=function(){return this.clientSettingsService.request()},e.prototype.uploadImage=function(e){return this.imagesService.request(e)},e.prototype.uploadFile=function(e){return this.fileService.uploadFile(e)},e.prototype.convertPDF=function(e,t){return this.convertPDFService.request(e,t)},e.prototype.ekycPDF=function(e,t){return this.ekycPDFService.request(e,t)},e.prototype.readIDCard=function(e,t){return this.readIDCardService.request(e,t)},e.prototype.requestVerifyIDCard=function(e,t){return this.requestVerifyIDCardService.request(e,t)},e.prototype.requestVerifyPortrait=function(e,t){return this.requestVerifyPortraitSerivce.request(e,t)},e.prototype.verifyFaceLiveness=function(e,t){return this.verifyFaceLivenessService.request(e,t)},e.prototype.searchFaces=function(e,t){return this.searchFaceService.request(e,t)},e.prototype.deleteFaces=function(e,t){return this.searchFaceService.deleteFaces(e,t)},e.prototype.indexFaces=function(e,t){return this.searchFaceService.indexFaces(e,t)},e.prototype.downloadFaceImage=function(e){return this.searchFaceService.downloadFaceImage(e)},e.prototype.downloadImage=function(e){return this.imagesService.download(e)},e.prototype.updateMetadata=function(e,t){return this.imagesService.updateMetadata(e,t)},e.prototype.detectIDTampering=function(e,t){return this.detectIDTamperingService.request(e,t)},o([M({headerIndex:1}),F(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"compareFaces",null),o([M({headerIndex:1}),F(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"convertPDF",null),o([M({headerIndex:1}),F(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"readIDCard",null),o([M({headerIndex:1}),F(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"requestVerifyIDCard",null),o([M({headerIndex:1}),F(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"requestVerifyPortrait",null),o([M({headerIndex:1}),F(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"verifyFaceLiveness",null),o([M({headerIndex:1}),F(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"searchFaces",null),o([M({headerIndex:1}),F(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"deleteFaces",null),o([M({headerIndex:1}),F(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"indexFaces",null),o([M({headerIndex:1}),F(),a("design:type",Function),a("design:paramtypes",[Object,Object]),a("design:returntype",Promise)],e.prototype,"detectIDTampering",null),e}();e.ReadIDCard=r,e.UploadImage=c,e.UploadFile=u,e.CompareFaces=l,e.ClientSettings=d,e.VerifyFaceLiveness=f,e.RequestVerifyIDCard=p,e.RequestVerifyPortrait=h,e.DetectIDTampering=m,e.SearchFaces=g,e.ConvertPDF=v,e.EkycPDF=y,e.HttpClient=T,e.MockClient=A,e.TVAuthorizer=D,e.createHelpers=function(e,t,r){void 0===r&&(r="production");var n=new D(e,t),o=function(e){switch(e){case"testing":return"https://tv-testing.trustingsocial.com/api";case"staging":return"https://tv-staging.trustingsocial.com/api";case"production":default:return"https://vn-vision.trustingsocial.com/api"}}(r);return new T({authorizer:n,domain:o})},e.createHttpClient=O,e.SimpleTrustVisionAPI=L,e.default=bn,Object.defineProperty(e,"__esModule",{value:!0})}(t,bj)}))),wj=new Uint8Array(16);function kj(){if(!vj&&!(vj="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vj(wj)}var Sj=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ej(e){return"string"==typeof e&&Sj.test(e)}for(var Bj=[],_j=0;_j<256;++_j)Bj.push((_j+256).toString(16).substr(1));function xj(e,t,r){var n=(e=e||{}).random||(e.rng||kj)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Bj[e[t+0]]+Bj[e[t+1]]+Bj[e[t+2]]+Bj[e[t+3]]+"-"+Bj[e[t+4]]+Bj[e[t+5]]+"-"+Bj[e[t+6]]+Bj[e[t+7]]+"-"+Bj[e[t+8]]+Bj[e[t+9]]+"-"+Bj[e[t+10]]+Bj[e[t+11]]+Bj[e[t+12]]+Bj[e[t+13]]+Bj[e[t+14]]+Bj[e[t+15]]).toLowerCase();if(!Ej(r))throw TypeError("Stringified UUID is invalid");return r}(n)}var Tj=function(e){return BU(e,5)},Aj=zL((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),a=r(0),i=a.BROWSER_TYPES,s=a.OS_TYPES,c=a.DEVICE_TYPES,u=r(4),l=u.checkType,d=u.broPayload,f=u.mobilePayload,p=u.wearPayload,h=u.consolePayload,m=u.stvPayload,g=u.getNavigatorInstance,v=u.isIOS13Check,y=new o,b=y.getBrowser(),C=y.getDevice(),w=y.getEngine(),k=y.getOS(),S=y.getUA(),E=i.CHROME,B=i.CHROMIUM,_=i.IE,x=i.INTERNET_EXPLORER,T=i.OPERA,A=i.FIREFOX,I=i.SAFARI,P=i.EDGE,R=i.YANDEX,D=i.MOBILE_SAFARI,N=c.MOBILE,O=c.TABLET,L=c.SMART_TV,M=c.BROWSER,F=c.WEARABLE,U=c.CONSOLE,j=s.ANDROID,V=s.WINDOWS_PHONE,z=s.IOS,q=s.WINDOWS,H=s.MAC_OS,K=function(){return k.name===s.WINDOWS&&"10"===k.version&&"string"==typeof S&&-1!==S.indexOf("Edg/")},W=function(){return b.name===P},Q=function(){return v("iPad")},G=C.type===L,X=C.type===U,Y=C.type===F,$=b.name===D||Q(),Z=b.name===B,J=function(){switch(C.type){case N:case O:return!0;default:return!1}}()||Q(),ee=C.type===N,te=C.type===O||Q(),re=C.type===M,ne=k.name===j,oe=k.name===V,ae=k.name===z||Q(),ie=b.name===E,se=b.name===A,ce=b.name===I||b.name===D,ue=b.name===T,le=b.name===x||b.name===_,de=k.version?k.version:"none",fe=k.name?k.name:"none",pe=b.major,he=b.version,me=b.name,ge=C.vendor?C.vendor:"none",ve=C.model?C.model:"none",ye=w.name,be=w.version,Ce=S,we=W()||K(),ke=b.name===R,Se=C.type,Ee=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Be=Q(),_e=v("iPhone"),xe=v("iPod"),Te=function(){var e=g(),t=e&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)}(),Ae=K(),Ie=W(),Pe=k.name===q,Re=k.name===H,De=l(C.type);e.exports={deviceDetect:function(){var e=De.isBrowser,t=De.isMobile,r=De.isTablet,n=De.isSmartTV,o=De.isConsole,a=De.isWearable;return e?d(e,b,w,k,S):n?m(n,w,k,S):o?h(o,w,k,S):t||r?f(De,C,k,S):a?p(a,w,k,S):void 0},isSmartTV:G,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ae,isChrome:ie,isFirefox:se,isSafari:ce,isOpera:ue,isIE:le,osVersion:de,osName:fe,fullBrowserVersion:pe,browserVersion:he,browserName:me,mobileVendor:ge,mobileModel:ve,engineName:ye,engineVersion:be,getUA:Ce,isEdge:we,isYandex:ke,deviceType:Se,isIOS13:Ee,isIPad13:Be,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Ie,isWindows:Pe,isMacOs:Re}},function(e,t,r){var n;
|
21
|
+
/*!
|
22
|
+
* UAParser.js v0.7.18
|
23
|
+
* Lightweight JavaScript-based User-Agent string parser
|
24
|
+
* https://github.com/faisalman/ua-parser-js
|
25
|
+
*
|
26
|
+
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
|
27
|
+
* Dual licensed under GPLv2 or MIT
|
28
|
+
*/!function(o,a){var i="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",m="console",g="mobile",v="tablet",y="smarttv",b="wearable",C={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:a},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},w={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],By(s=p[o])===c&&s.length>0?2==s.length?By(s[1])==i?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?By(s[1])!==i||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):a:this[s[0]]=l?s[1].call(this,l,s[2]):a:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):a):this[s]=l||a;d+=2}},str:function(e,t){for(var r in t)if(By(t[r])===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(C.has(t[r][n],e))return"?"===r?a:r}else if(C.has(t[r],e))return"?"===r?a:r;return e}},k={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"}}}},S={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,w.str,k.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,C.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",C.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,C.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,w.str,k.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,w.str,k.device.sprint.vendor],[u,w.str,k.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,C.trim],[u,C.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,C.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,w.str,k.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,w.str,k.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]]},E=function e(t,r){if("object"==By(t)&&(r=t,t=a),!(this instanceof e))return new e(t,r).getResult();var n=t||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),i=r?C.extend(S,r):S;return this.getBrowser=function(){var e={name:a,version:a};return w.rgx.call(e,n,i.browser),e.major=C.major(e.version),e},this.getCPU=function(){var e={architecture:a};return w.rgx.call(e,n,i.cpu),e},this.getDevice=function(){var e={vendor:a,model:a,type:a};return w.rgx.call(e,n,i.device),e},this.getEngine=function(){var e={name:a,version:a};return w.rgx.call(e,n,i.engine),e},this.getOS=function(){var e={name:a,version:a};return w.rgx.call(e,n,i.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};E.VERSION="0.7.18",E.BROWSER={NAME:l,MAJOR:"major",VERSION:p},E.CPU={ARCHITECTURE:h},E.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:m,MOBILE:g,SMARTTV:y,TABLET:v,WEARABLE:b,EMBEDDED:"embedded"},E.ENGINE={NAME:l,VERSION:p},E.OS={NAME:l,VERSION:p},By(t)!==s?(By(e)!==s&&e.exports&&(t=e.exports=E),t.UAParser=E):r(3)?(n=function(){return E}.call(t,r,t,e))===a||(e.exports=n):o&&(o.UAParser=E);var B=o&&(o.jQuery||o.Zepto);if(By(B)!==s){var _=new E;B.ua=_.getResult(),B.ua.get=function(){return _.getUA()},B.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":By(window))?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),a=o.DEVICE_TYPES,i=o.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case a.MOBILE:return{isMobile:!0};case a.TABLET:return{isTablet:!0};case a.SMART_TV:return{isSmartTV:!0};case a.CONSOLE:return{isConsole:!0};case a.WEARABLE:return{isWearable:!0};case a.BROWSER:return{isBrowser:!0};default:return i}},broPayload:function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:o}},mobilePayload:function(e,t,r,o){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:o})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])}));function Ij(){return"5.16.1"}function Pj(){return{"X-TV-Device-Model":"".concat(Aj.browserName," ").concat(Aj.browserVersion),"X-TV-OS-Version":"".concat(Aj.osName," ").concat(Aj.osVersion),"X-TV-OS-Platform":Aj.isMobile?"".concat(Aj.osName.toLowerCase(),"_web"):"web","X-TV-SDK-Version":"5.16.1"}}var Rj=Object.freeze({__proto__:null,getUAMetadata:Pj});function Dj(e){return e<10?"0".concat(e):e}function Nj(e){return"".concat(e.getFullYear(),"-").concat(Dj(e.getMonth()+1),"-").concat(Dj(e.getDate()),"T").concat(Dj(e.getHours()),":").concat(Dj(e.getMinutes()),":").concat(Dj(e.getSeconds())).concat(function(e){if(0===e)return"Z";var t=e>0?"-":"+";return e=Math.abs(e),"".concat(t+Dj(Math.floor(e/60)),":").concat(Dj(e%60))}(e.getTimezoneOffset()))}var Oj=Object.freeze({__proto__:null,rfc3339:Nj});function Lj(e,t){window.localStorage&&window.JSON&&t&&localStorage.setItem(t,JSON.stringify(e))}function Mj(e){if(window.localStorage&&window.JSON&&e){var t=localStorage.getItem(e);if(t)return JSON.parse(t)}}var Fj=Object.freeze({__proto__:null,storeData:Lj,getData:Mj,removeData:function(e){window.localStorage&&window.JSON&&e&&localStorage.removeItem(e)}}),Uj=zL((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!==jL&&jL.crypto&&(r=jL.crypto),!r)try{r=bj}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}}(),a={},i=a.lib={},s=i.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=i.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 a=0;a<o;a++){var i=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=i<<24-(n+a)%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=a.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var a=t[o>>>2]>>>24-o%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).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 a=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(a))}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=i.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,a=n.sigBytes,i=this.blockSize,s=a/(4*i),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*i,l=e.min(4*u,a);if(u){for(var d=0;d<u;d+=i)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=(i.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)}}}),a.algo={});return a}(Math)})),jj=(zL((function(e,t){var r,n,o,a,i,s;e.exports=(n=(r=s=Uj).lib,o=n.Base,a=n.WordArray,(i=r.x64={}).Word=o.extend({init:function(e,t){this.high=e,this.low=t}}),i.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 a.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)})),zL((function(e,t){var r;e.exports=(r=Uj,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)})),zL((function(e,t){var r;e.exports=(r=Uj,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 a=t[o>>>2]>>>16-o%4*8&65535;n.push(String.fromCharCode(a))}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=[],a=0;a<r;a+=2){var i=o(t[a>>>2]>>>16-a%4*8&65535);n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var r=e.length,n=[],a=0;a<r;a++)n[a>>>1]|=o(e.charCodeAt(a)<<16-a%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var o=[],a=0,i=0;i<r;i++)if(i%4){var s=n[e.charCodeAt(i-1)]<<i%4*2|n[e.charCodeAt(i)]>>>6-i%4*2;o[a>>>2]|=s<<24-a%4*8,a++}return t.create(o,a)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],a=0;a<r;a+=3)for(var i=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<r;s++)o.push(n.charAt(i>>>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 a=0;a<r.length;a++)o[r.charCodeAt(a)]=a}var i=r.charAt(64);if(i){var s=e.indexOf(i);-1!==s&&(t=s)}return n(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var o=[],a=0,i=0;i<r;i++)if(i%4){var s=n[e.charCodeAt(i-1)]<<i%4*2|n[e.charCodeAt(i)]>>>6-i%4*2;o[a>>>2]|=s<<24-a%4*8,a++}return t.create(o,a)}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 a=[],i=0;i<n;i+=3)for(var s=(r[i>>>2]>>>24-i%4*8&255)<<16|(r[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|r[i+2>>>2]>>>24-(i+2)%4*8&255,c=0;c<4&&i+.75*c<n;c++)a.push(o.charAt(s>>>6*(3-c)&63));var u=o.charAt(64);if(u)for(;a.length%4;)a.push(u);return a.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,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var i=0;i<o.length;i++)a[o.charCodeAt(i)]=i}var s=o.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(r=c)}return n(e,r,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),r.enc.Base64url)})),zL((function(e,t){var r;e.exports=(r=Uj,function(e){var t=r,n=t.lib,o=n.WordArray,a=n.Hasher,i=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=i.MD5=a.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 a=this._hash.words,i=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],C=e[t+9],w=e[t+10],k=e[t+11],S=e[t+12],E=e[t+13],B=e[t+14],_=e[t+15],x=a[0],T=a[1],A=a[2],I=a[3];x=u(x,T,A,I,i,7,s[0]),I=u(I,x,T,A,c,12,s[1]),A=u(A,I,x,T,p,17,s[2]),T=u(T,A,I,x,h,22,s[3]),x=u(x,T,A,I,m,7,s[4]),I=u(I,x,T,A,g,12,s[5]),A=u(A,I,x,T,v,17,s[6]),T=u(T,A,I,x,y,22,s[7]),x=u(x,T,A,I,b,7,s[8]),I=u(I,x,T,A,C,12,s[9]),A=u(A,I,x,T,w,17,s[10]),T=u(T,A,I,x,k,22,s[11]),x=u(x,T,A,I,S,7,s[12]),I=u(I,x,T,A,E,12,s[13]),A=u(A,I,x,T,B,17,s[14]),x=l(x,T=u(T,A,I,x,_,22,s[15]),A,I,c,5,s[16]),I=l(I,x,T,A,v,9,s[17]),A=l(A,I,x,T,k,14,s[18]),T=l(T,A,I,x,i,20,s[19]),x=l(x,T,A,I,g,5,s[20]),I=l(I,x,T,A,w,9,s[21]),A=l(A,I,x,T,_,14,s[22]),T=l(T,A,I,x,m,20,s[23]),x=l(x,T,A,I,C,5,s[24]),I=l(I,x,T,A,B,9,s[25]),A=l(A,I,x,T,h,14,s[26]),T=l(T,A,I,x,b,20,s[27]),x=l(x,T,A,I,E,5,s[28]),I=l(I,x,T,A,p,9,s[29]),A=l(A,I,x,T,y,14,s[30]),x=d(x,T=l(T,A,I,x,S,20,s[31]),A,I,g,4,s[32]),I=d(I,x,T,A,b,11,s[33]),A=d(A,I,x,T,k,16,s[34]),T=d(T,A,I,x,B,23,s[35]),x=d(x,T,A,I,c,4,s[36]),I=d(I,x,T,A,m,11,s[37]),A=d(A,I,x,T,y,16,s[38]),T=d(T,A,I,x,w,23,s[39]),x=d(x,T,A,I,E,4,s[40]),I=d(I,x,T,A,i,11,s[41]),A=d(A,I,x,T,h,16,s[42]),T=d(T,A,I,x,v,23,s[43]),x=d(x,T,A,I,C,4,s[44]),I=d(I,x,T,A,S,11,s[45]),A=d(A,I,x,T,_,16,s[46]),x=f(x,T=d(T,A,I,x,p,23,s[47]),A,I,i,6,s[48]),I=f(I,x,T,A,y,10,s[49]),A=f(A,I,x,T,B,15,s[50]),T=f(T,A,I,x,g,21,s[51]),x=f(x,T,A,I,S,6,s[52]),I=f(I,x,T,A,h,10,s[53]),A=f(A,I,x,T,w,15,s[54]),T=f(T,A,I,x,c,21,s[55]),x=f(x,T,A,I,b,6,s[56]),I=f(I,x,T,A,_,10,s[57]),A=f(A,I,x,T,v,15,s[58]),T=f(T,A,I,x,E,21,s[59]),x=f(x,T,A,I,m,6,s[60]),I=f(I,x,T,A,k,10,s[61]),A=f(A,I,x,T,p,15,s[62]),T=f(T,A,I,x,C,21,s[63]),a[0]=a[0]+x|0,a[1]=a[1]+T|0,a[2]=a[2]+A|0,a[3]=a[3]+I|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 a=e.floor(n/4294967296),i=n;r[15+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>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=a.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,o,a,i){var s=e+(t&r|~t&n)+o+i;return(s<<a|s>>>32-a)+t}function l(e,t,r,n,o,a,i){var s=e+(t&n|r&~n)+o+i;return(s<<a|s>>>32-a)+t}function d(e,t,r,n,o,a,i){var s=e+(t^r^n)+o+i;return(s<<a|s>>>32-a)+t}function f(e,t,r,n,o,a,i){var s=e+(r^(t|~n))+o+i;return(s<<a|s>>>32-a)+t}t.MD5=a._createHelper(c),t.HmacMD5=a._createHmacHelper(c)}(Math),r.MD5)})),zL((function(e,t){var r,n,o,a,i,s,c,u;e.exports=(n=(r=u=Uj).lib,o=n.WordArray,a=n.Hasher,i=r.algo,s=[],c=i.SHA1=a.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],a=r[2],i=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&a|~o&i):u<40?1859775393+(o^a^i):u<60?(o&a|o&i|a&i)-1894007588:(o^a^i)-899497514,c=i,i=a,a=o<<30|o>>>2,o=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+a|0,r[3]=r[3]+i|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=a.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=a._createHelper(c),r.HmacSHA1=a._createHmacHelper(c),u.SHA1)})),zL((function(e,t){var r;e.exports=(r=Uj,function(e){var t=r,n=t.lib,o=n.WordArray,a=n.Hasher,i=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=i.SHA256=a.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],a=r[2],i=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&a^o&a,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),C=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=i+C|0,i=a,a=o,o=n,n=C+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+a|0,r[3]=r[3]+i|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=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(l),t.HmacSHA256=a._createHmacHelper(l)}(Math),r.SHA256)})),zL((function(e,t){var r,n,o,a,i,s;e.exports=(n=(r=s=Uj).lib.WordArray,o=r.algo,a=o.SHA256,i=o.SHA224=a.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=a._createHelper(i),r.HmacSHA224=a._createHmacHelper(i),s.SHA224)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.Hasher,n=e.x64,o=n.Word,a=n.WordArray,i=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=i.SHA512=t.extend({_doReset:function(){this._hash=new a.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],a=r[2],i=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=a.high,y=a.low,b=i.high,C=i.low,w=s.high,k=s.low,S=l.high,E=l.low,B=d.high,_=d.low,x=f.high,T=f.low,A=p,I=h,P=m,R=g,D=v,N=y,O=b,L=C,M=w,F=k,U=S,j=E,V=B,z=_,q=x,H=T,K=0;K<80;K++){var W,Q,G=u[K];if(K<16)Q=G.high=0|e[t+2*K],W=G.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),ae=u[K-7],ie=ae.high,se=ae.low,ce=u[K-16],ue=ce.high,le=ce.low;Q=(Q=(Q=Z+ie+((W=J+se)>>>0<J>>>0?1:0))+ne+((W+=oe)>>>0<oe>>>0?1:0))+ue+((W+=le)>>>0<le>>>0?1:0),G.high=Q,G.low=W}var de,fe=M&U^~M&V,pe=F&j^~F&z,he=A&P^A&D^P&D,me=I&R^I&N^R&N,ge=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),ve=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ye=(M>>>14|F<<18)^(M>>>18|F<<14)^(M<<23|F>>>9),be=(F>>>14|M<<18)^(F>>>18|M<<14)^(F<<23|M>>>9),Ce=c[K],we=Ce.high,ke=Ce.low,Se=q+ye+((de=H+be)>>>0<H>>>0?1:0),Ee=ve+me;q=V,H=z,V=U,z=j,U=M,j=F,M=O+(Se=(Se=(Se=Se+fe+((de+=pe)>>>0<pe>>>0?1:0))+we+((de+=ke)>>>0<ke>>>0?1:0))+Q+((de+=W)>>>0<W>>>0?1:0))+((F=L+de|0)>>>0<L>>>0?1:0)|0,O=D,L=N,D=P,N=R,P=A,R=I,A=Se+(ge+he+(Ee>>>0<ve>>>0?1:0))+((I=de+Ee|0)>>>0<de>>>0?1:0)|0}h=n.low=h+I,n.high=p+A+(h>>>0<I>>>0?1:0),g=o.low=g+R,o.high=m+P+(g>>>0<R>>>0?1:0),y=a.low=y+N,a.high=v+D+(y>>>0<N>>>0?1:0),C=i.low=C+L,i.high=b+O+(C>>>0<L>>>0?1:0),k=s.low=k+F,s.high=w+M+(k>>>0<F>>>0?1:0),E=l.low=E+j,l.high=S+U+(E>>>0<j>>>0?1:0),_=d.low=_+z,d.high=B+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)})),zL((function(e,t){var r,n,o,a,i,s,c,u;e.exports=(n=(r=u=Uj).x64,o=n.Word,a=n.WordArray,i=r.algo,s=i.SHA512,c=i.SHA384=s.extend({_doReset:function(){this._hash=new a.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)})),zL((function(e,t){var r;e.exports=(r=Uj,function(e){var t=r,n=t.lib,o=n.WordArray,a=n.Hasher,i=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,a=0;a<24;a++){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[a]=i.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=i.create()}();var f=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new i.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 a=e[t+2*o],i=e[t+2*o+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),(T=r[o]).high^=i,T.low^=a}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,C=y.low;for(p=v.high^(b<<1|C>>>31),h=v.low^(C<<1|b>>>31),m=0;m<5;m++)(T=r[f+5*m]).high^=p,T.low^=h}for(var w=1;w<25;w++){var k=(T=r[w]).high,S=T.low,E=c[w];E<32?(p=k<<E|S>>>32-E,h=S<<E|k>>>32-E):(p=S<<E-32|k>>>64-E,h=k<<E-32|S>>>64-E);var B=d[u[w]];B.high=p,B.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[w=f+5*m],A=d[w],I=d[(f+1)%5+5*m],P=d[(f+2)%5+5*m];T.high=A.high^~I.high&P.high,T.low=A.low^~I.low&P.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),a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/a)*a>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var i=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l<c;l++){var d=i[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=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=a._createHelper(f),t.HmacSHA3=a._createHmacHelper(f)}(Math),r.SHA3)})),zL((function(e,t){var r;e.exports=(r=Uj,
|
29
|
+
/** @preserve
|
30
|
+
(c) 2012 by Cédric Mesnil. All rights reserved.
|
31
|
+
|
32
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
33
|
+
|
34
|
+
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
35
|
+
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
36
|
+
|
37
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
38
|
+
*/
|
39
|
+
function(e){var t=r,n=t.lib,o=n.WordArray,a=n.Hasher,i=t.algo,s=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=o.create([0,1518500249,1859775393,2400959708,2840853838]),f=o.create([1352829926,1548603684,1836072691,2053994217,0]),p=i.RIPEMD160=a.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_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 a,i,p,C,w,k,S,E,B,_,x,T=this._hash.words,A=d.words,I=f.words,P=s.words,R=c.words,D=u.words,N=l.words;for(k=a=T[0],S=i=T[1],E=p=T[2],B=C=T[3],_=w=T[4],r=0;r<80;r+=1)x=a+e[t+P[r]]|0,x+=r<16?h(i,p,C)+A[0]:r<32?m(i,p,C)+A[1]:r<48?g(i,p,C)+A[2]:r<64?v(i,p,C)+A[3]:y(i,p,C)+A[4],x=(x=b(x|=0,D[r]))+w|0,a=w,w=C,C=b(p,10),p=i,i=x,x=k+e[t+R[r]]|0,x+=r<16?y(S,E,B)+I[0]:r<32?v(S,E,B)+I[1]:r<48?g(S,E,B)+I[2]:r<64?m(S,E,B)+I[3]:h(S,E,B)+I[4],x=(x=b(x|=0,N[r]))+_|0,k=_,_=B,B=b(E,10),E=S,S=x;x=T[1]+p+B|0,T[1]=T[2]+C+_|0,T[2]=T[3]+w+k|0,T[3]=T[4]+a+S|0,T[4]=T[0]+i+E|0,T[0]=x},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var o=this._hash,a=o.words,i=0;i<5;i++){var s=a[i];a[i]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return o},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function h(e,t,r){return e^t^r}function m(e,t,r){return e&t|~e&r}function g(e,t,r){return(e|~t)^r}function v(e,t,r){return e&r|t&~r}function y(e,t,r){return e^(t|~r)}function b(e,t){return e<<t|e>>>32-t}t.RIPEMD160=a._createHelper(p),t.HmacRIPEMD160=a._createHmacHelper(p)}(),r.RIPEMD160)})),zL((function(e,t){var r,n,o;e.exports=(n=(r=Uj).lib.Base,o=r.enc.Utf8,void(r.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),i=this._iKey=t.clone(),s=a.words,c=i.words,u=0;u<r;u++)s[u]^=1549556828,c[u]^=909522486;a.sigBytes=i.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))})),zL((function(e,t){var r,n,o,a,i,s,c,u,l;e.exports=(o=(n=(r=l=Uj).lib).Base,a=n.WordArray,s=(i=r.algo).SHA1,c=i.HMAC,u=i.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=c.create(r.hasher,e),o=a.create(),i=a.create([1]),s=o.words,u=i.words,l=r.keySize,d=r.iterations;s.length<l;){var f=n.update(t).finalize(i);n.reset();for(var p=f.words,h=p.length,m=f,g=1;g<d;g++){m=n.finalize(m),n.reset();for(var v=m.words,y=0;y<h;y++)p[y]^=v[y]}o.concat(f),u[0]++}return o.sigBytes=4*l,o}}),r.PBKDF2=function(e,t,r){return u.create(r).compute(e,t)},l.PBKDF2)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib,n=t.Base,o=t.WordArray,a=e.algo,i=a.MD5,s=a.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:i,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,a=n.hasher.create(),i=o.create(),s=i.words,c=n.keySize,u=n.iterations;s.length<c;){r&&a.update(r),r=a.update(e).finalize(t),a.reset();for(var l=1;l<u;l++)r=a.finalize(r),a.reset();i.concat(r)}return i.sigBytes=4*c,i}});e.EvpKDF=function(e,t,r){return s.create(r).compute(e,t)}}(),r.EvpKDF)})),zL((function(e,t){var r;e.exports=void((r=Uj).lib.Cipher||function(e){var t=r,n=t.lib,o=n.Base,a=n.WordArray,i=n.BufferedBlockAlgorithm,s=t.enc,c=(s.Utf8,s.Base64),u=t.algo.EvpKDF,l=n.Cipher=i.extend({cfg:o.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:v}return function(t){return{encrypt:function(r,n,o){return e(n).encrypt(t,r,n,o)},decrypt:function(r,n,o){return e(n).decrypt(t,r,n,o)}}}}()}),d=(n.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),t.mode={}),f=n.BlockCipherMode=o.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=d.CBC=function(){var e=f.extend();function t(e,t,r){var n,o=this._iv;o?(n=o,this._iv=undefined):n=this._prevBlock;for(var a=0;a<r;a++)e[t+a]^=n[a]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,o=n.blockSize;t.call(this,e,r,o),n.encryptBlock(e,r),this._prevBlock=e.slice(r,r+o)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,o=n.blockSize,a=e.slice(r,r+o);n.decryptBlock(e,r),t.call(this,e,r,o),this._prevBlock=a}}),e}(),h=(t.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,o=n<<24|n<<16|n<<8|n,i=[],s=0;s<n;s+=4)i.push(o);var c=a.create(i,n);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},m=(n.BlockCipher=l.extend({cfg:l.cfg.extend({mode:p,padding:h}),reset:function(){var e;l.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),n.CipherParams=o.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?a.create([1398893684,1701076831]).concat(r).concat(t):t).toString(c)},parse:function(e){var t,r=c.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=a.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),m.create({ciphertext:r,salt:t})}},v=n.SerializableCipher=o.extend({cfg:o.extend({format:g}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var o=e.createEncryptor(r,n),a=o.finalize(t),i=o.cfg;return m.create({ciphertext:a,key:r,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),y=(t.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var o=u.create({keySize:t+r}).compute(e,n),i=a.create(o.words.slice(t),4*r);return o.sigBytes=4*t,m.create({key:o,iv:i,salt:n})}},b=n.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:y}),encrypt:function(e,t,r,n){var o=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=o.iv;var a=v.encrypt.call(this,e,t,o.key,n);return a.mixIn(o),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var o=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=o.iv,v.decrypt.call(this,e,t,o.key,n)}})}())})),zL((function(e,t){var r;e.exports=((r=Uj).mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,r,n){var o,a=this._iv;a?(o=a.slice(0),this._iv=void 0):o=this._prevBlock,n.encryptBlock(o,0);for(var i=0;i<r;i++)e[t+i]^=o[i]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,o=n.blockSize;t.call(this,e,r,o,n),this._prevBlock=e.slice(r,r+o)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,o=n.blockSize,a=e.slice(r,r+o);t.call(this,e,r,o,n),this._prevBlock=a}}),e}(),r.mode.CFB)})),zL((function(e,t){var r,n,o;e.exports=((o=Uj).mode.CTR=(n=(r=o.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0);var i=a.slice(0);r.encryptBlock(i,0),a[n-1]=a[n-1]+1|0;for(var s=0;s<n;s++)e[t+s]^=i[s]}}),r.Decryptor=n,r),o.mode.CTR)})),zL((function(e,t){var r;e.exports=(
|
40
|
+
/** @preserve
|
41
|
+
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
42
|
+
* derived from CryptoJS.mode.CTR
|
43
|
+
* Jan Hruby jhruby.web@gmail.com
|
44
|
+
*/
|
45
|
+
(r=Uj).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,a=this._iv,i=this._counter;a&&(i=this._counter=a.slice(0),this._iv=void 0),n(i);var s=i.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)})),zL((function(e,t){var r,n,o;e.exports=((o=Uj).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,a=this._keystream;o&&(a=this._keystream=o.slice(0),this._iv=void 0),r.encryptBlock(a,0);for(var i=0;i<n;i++)e[t+i]^=a[i]}}),r.Decryptor=n,r),o.mode.OFB)})),zL((function(e,t){var r,n;e.exports=((n=Uj).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)})),zL((function(e,t){var r;e.exports=((r=Uj).pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,o=n-r%n,a=r+o-1;e.clamp(),e.words[a>>>2]|=o<<24-a%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)})),zL((function(e,t){var r;e.exports=((r=Uj).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)})),zL((function(e,t){var r;e.exports=((r=Uj).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)})),zL((function(e,t){var r;e.exports=((r=Uj).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)})),zL((function(e,t){var r;e.exports=((r=Uj).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)})),zL((function(e,t){var r;e.exports=(r=Uj,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)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,o=[],a=[],i=[],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,a[h]=r;var m=e[r],g=e[m],v=e[g],y=257*e[h]^16843008*h;i[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),a=this._keySchedule=[],i=0;i<n;i++)i<r?a[i]=t[i]:(u=a[i-1],i%r?r>6&&i%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[i/r|0]<<24),a[i]=a[i-r]^u);for(var s=this._invKeySchedule=[],c=0;c<n;c++){if(i=n-c,c%4)var u=a[i];else u=a[i-4];s[c]=c<4||i<=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,i,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,a),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,o,a,i,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]^a[d>>>8&255]^i[255&f]^r[p++],g=n[l>>>24]^o[d>>>16&255]^a[f>>>8&255]^i[255&u]^r[p++],v=n[d>>>24]^o[f>>>16&255]^a[u>>>8&255]^i[255&l]^r[p++],y=n[f>>>24]^o[u>>>16&255]^a[l>>>8&255]^i[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)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib,n=t.WordArray,o=t.BlockCipher,a=e.algo,i=[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=a.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=i[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var o=this._subKeys=[],a=0;a<16;a++){var u=o[a]=[],l=c[a];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],a=this._lBlock,i=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((i^o[c])&l[c])>>>0];this._lBlock=i,this._rBlock=a^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=a.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)})),zL((function(e,t){var r;e.exports=(r=Uj,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 a=0;o<256;o++){var i=o%r,s=t[i>>>2]>>>24-i%4*8&255;a=(a+n[o]+s)%256;var c=n[o];n[o]=n[a],n[a]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:8,ivSize:0});function a(){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 a=e[t];e[t]=e[r],e[r]=a,n|=e[(e[t]+e[r])%256]<<24-8*o}return this._i=t,this._j=r,n}e.RC4=t._createHelper(o);var i=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--)a.call(this)}});e.RC4Drop=t._createHelper(i)}(),r.RC4)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],a=[],i=[],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 a=t.words,i=a[0],s=a[1],u=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>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++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[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);i[r]=c^u}e[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,e[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,e[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,e[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,e[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,e[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,e[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,e[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],a=[],i=[],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 a=t.words,i=a[0],s=a[1],u=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>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++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[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);i[r]=c^u}e[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,e[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,e[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,e[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,e[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,e[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,e[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,e[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)})),zL((function(e,t){e.exports=Uj}))),Vj=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=jj.MD5(jj.lib.WordArray.create(r)).toString();e(n)},r.readAsArrayBuffer(t)}))},zj=Object.freeze({__proto__:null,MD5:Vj}),qj=["tracking"],Hj=Pj(),Kj=xC.createContext(),Wj={enable:!1,accessKey:"",secretKey:"",apiUrl:"",userId:""},Qj=function(){var e=dL(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,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,a=Nj(new Date),i=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 i=Tj(o),s=o.result_object,e.next=10,Vj({blob:s.image.blob});case 10:if(e.t1=e.sent,i.result_object.image={blob:e.t1},delete i.result_object.recordedVideos,!s.qrScannedResult){e.next=18;break}return e.next=16,Vj({blob:s.qrScannedResult.image.blob});case 16:i.result_object.qrScannedResult.image.blob=e.sent,delete i.result_object.qrScannedResult.recordedVideos;case 18:return e.abrupt("break",36);case 19:return i=Tj(o),c=o.result_object,u=c.steps,l=c.frontalFaces,d=c.frontalScaledImage,f=u.map((function(e){return Vj({blob:e.image.blob})})),e.next=24,Promise.all(f);case 24:return p=e.sent,u.forEach((function(e,t){i.result_object.steps[t].image.blob=p[t]})),h=l.map((function(e){return Vj({blob:e})})),e.next=29,Promise.all(h);case 29:if(m=e.sent,l.forEach((function(e,t){i.result_object.frontalFaces[t]=m[t]})),!d){e.next=35;break}return e.next=34,Vj({blob:d});case 34:i.result_object.frontalScaledImage=e.sent;case 35:return e.abrupt("break",36);case 36:return e.abrupt("return",{tag:r,event:n,log:yL({device_time:a},i)});case 37:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Gj(e){var t,r=e.userId;if(r)t=r;else{var n=Mj("tv:user-id");if(n)t=n;else{var o=xj();t=o,Lj(o,"tv:user-id")}}return t}function Xj(e){var t=e.value,r=e.children,n=t.tracking,o=void 0===n?Wj:n,a=bL(t,qj),i=o.enable,s=void 0===i||i,c=o.accessKey,u=o.secretKey,l=o.apiUrl,d=o.userId,f=o.logSignature,p=xC.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:yL({"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 a=new Cj(c,u,l).httpClient.authorizer.getHeaders({requestPath:"/v1/log_events",method:"POST"});return fetch("".concat(l,"/v1/log_events"),{method:"POST",headers:yL({"X-TV-Timestamp":a["X-TV-Timestamp"],Authorization:a.Authorization,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}return null}),[f,s,l,c,u]),h=xC.useMemo((function(){return{"x-request-id":Gj({userId:d})}}),[d]),m=xC.useCallback(dL(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,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,a=void 0===o?{}:o,!s){e.next=11;break}return e.prev=2,e.next=5,Qj({tag:r,event:n,log:a});case 5:i=e.sent,p(i,yL(yL({},h),Hj)),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 xC.createElement(Kj.Provider,{value:yL(yL({},a),{},{sendEvent:m})},r)}Xj.propTypes={value:xw.shape({tracking:xw.shape({enable:xw.bool,accessKey:xw.string,secretKey:xw.string,apiUrl:xw.string,userId:xw.string})}).isRequired,children:xw.node.isRequired};var Yj=Object.freeze({__proto__:null,defaultTrackingConfig:Wj,getXRequestId:Gj,SDKTrackingProvider:Xj,useSDKTracking:function(){var e=xC.useContext(Kj);return xC.useMemo((function(){return void 0===e?(console.warn("useSDKTracking must be used within a SDKTrackingProvider"),{sendEvent:function(){}}):e}),[e])}});function $j(e,t){return e&&!e.endsWith("/")?[e,"/",t].join(""):[e,t].join("")}function Zj(){var e=gj();return null==e?void 0:e.assetRoot}var Jj=Object.freeze({__proto__:null,getAsset:$j,useAssetRoot:Zj,useAsset:function(e){return $j(Zj(),e)}});function eV(e){return new Promise((function(t){return setTimeout(t,e)}))}var tV=Object.freeze({__proto__:null,sleep:eV}),rV=Symbol("Comlink.proxy"),nV=Symbol("Comlink.endpoint"),oV=Symbol("Comlink.releaseProxy"),aV=Symbol("Comlink.thrown"),iV=function(e){return"object"==By(e)&&null!==e||"function"==typeof e},sV=new Map([["proxy",{canHandle:function(e){return iV(e)&&e[rV]},serialize:function(e){var t=new MessageChannel,r=t.port1,n=t.port2;return cV(e,r),[n,[n]]},deserialize:function(e){return e.start(),lV(e)}}],["throw",{canHandle:function(e){return iV(e)&&aV 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 cV(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,a=Object.assign({path:[]},n.data),i=a.id,s=a.type,c=a.path,u=(n.data.argumentList||[]).map(gV);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]]=gV(n.data.value),o=!0;break;case"APPLY":o=d.apply(l,u);break;case"CONSTRUCT":o=function(e){return Object.assign(e,Py({},rV,!0))}(Uy(d,Gy(u)));break;case"ENDPOINT":var f=new MessageChannel,p=f.port1,h=f.port2;cV(e,h),o=function(e,t){return hV.set(e,t),e}(p,[p]);break;case"RELEASE":o=void 0;break;default:return}}catch(e){o=Py({value:e},aV,0)}Promise.resolve(o).catch((function(e){return Py({value:e},aV,0)})).then((function(e){var n=Wy(mV(e),2),o=n[0],a=n[1];t.postMessage(Object.assign(Object.assign({},o),{id:i}),a),"RELEASE"===s&&(t.removeEventListener("message",r),uV(t))}))}})),t.start&&t.start()}function uV(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function lV(e,t){return fV(e,[],t)}function dV(e){if(e)throw new Error("Proxy has been released and is not useable")}function fV(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,a){if(dV(n),a===oV)return function(){return vV(e,{type:"RELEASE",path:t.map((function(e){return e.toString()}))}).then((function(){uV(e),n=!0}))};if("then"===a){if(0===t.length)return{then:function(){return o}};var i=vV(e,{type:"GET",path:t.map((function(e){return e.toString()}))}).then(gV);return i.then.bind(i)}return fV(e,[].concat(Gy(t),[a]))},set:function(r,o,a){dV(n);var i=Wy(mV(a),2),s=i[0],c=i[1];return vV(e,{type:"SET",path:[].concat(Gy(t),[o]).map((function(e){return e.toString()})),value:s},c).then(gV)},apply:function(r,o,a){dV(n);var i=t[t.length-1];if(i===nV)return vV(e,{type:"ENDPOINT"}).then(gV);if("bind"===i)return fV(e,t.slice(0,-1));var s=Wy(pV(a),2),c=s[0],u=s[1];return vV(e,{type:"APPLY",path:t.map((function(e){return e.toString()})),argumentList:c},u).then(gV)},construct:function(r,o){dV(n);var a=Wy(pV(o),2),i=a[0],s=a[1];return vV(e,{type:"CONSTRUCT",path:t.map((function(e){return e.toString()})),argumentList:i},s).then(gV)}});return o}function pV(e){var t,r=e.map(mV);return[r.map((function(e){return e[0]})),(t=r.map((function(e){return e[1]})),Array.prototype.concat.apply([],t))]}var hV=new WeakMap;function mV(e){var t,r=nb(sV);try{for(r.s();!(t=r.n()).done;){var n=Wy(t.value,2),o=n[0],a=n[1];if(a.canHandle(e)){var i=Wy(a.serialize(e),2);return[{type:"HANDLER",name:o,value:i[0]},i[1]]}}}catch(e){r.e(e)}finally{r.f()}return[{type:"RAW",value:e},hV.get(e)||[]]}function gV(e){switch(e.type){case"HANDLER":return sV.get(e.name).deserialize(e.value);case"RAW":return e.value}}function vV(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 yV=function(){if(!window.Worker)return null;var e=new Blob(['const e=Symbol("Comlink.proxy"),t=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),n=Symbol("Comlink.thrown"),a=e=>"object"==typeof e&&null!==e||"function"==typeof e,o=new Map([["proxy",{canHandle:t=>a(t)&&t[e],serialize(e){const{port1:t,port2:r}=new MessageChannel;return i(e,t),[r,[r]]},deserialize(e){return e.start(),s(e,[],t);var t}}],["throw",{canHandle:e=>a(e)&&n in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function i(t,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),m=(o.data.argumentList||[]).map(p);let g;try{const r=l.slice(0,-1).reduce(((e,t)=>e[t]),t),n=l.reduce(((e,t)=>e[t]),t);switch(s){case"GET":g=n;break;case"SET":r[l.slice(-1)[0]]=p(o.data.value),g=!0;break;case"APPLY":g=n.apply(r,m);break;case"CONSTRUCT":g=function(t){return Object.assign(t,{[e]:!0})}(new n(...m));break;case"ENDPOINT":{const{port1:e,port2:r}=new MessageChannel;i(t,r),g=function(e,t){return f.set(e,t),e}(e,[e])}break;case"RELEASE":g=void 0;break;default:return}}catch(e){g={value:e,[n]:0}}Promise.resolve(g).catch((e=>({value:e,[n]:0}))).then((e=>{const[t,n]=h(e);r.postMessage(Object.assign(Object.assign({},t),{id:c}),n),"RELEASE"===s&&(r.removeEventListener("message",a),u(r))}))})),r.start&&r.start()}function u(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function c(e){if(e)throw new Error("Proxy has been released and is not useable")}function s(e,n=[],a=function(){}){let o=!1;const i=new Proxy(a,{get(t,a){if(c(o),a===r)return()=>m(e,{type:"RELEASE",path:n.map((e=>e.toString()))}).then((()=>{u(e),o=!0}));if("then"===a){if(0===n.length)return{then:()=>i};const t=m(e,{type:"GET",path:n.map((e=>e.toString()))}).then(p);return t.then.bind(t)}return s(e,[...n,a])},set(t,r,a){c(o);const[i,u]=h(a);return m(e,{type:"SET",path:[...n,r].map((e=>e.toString())),value:i},u).then(p)},apply(r,a,i){c(o);const u=n[n.length-1];if(u===t)return m(e,{type:"ENDPOINT"}).then(p);if("bind"===u)return s(e,n.slice(0,-1));const[f,h]=l(i);return m(e,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:f},h).then(p)},construct(t,r){c(o);const[a,i]=l(r);return m(e,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:a},i).then(p)}});return i}function l(e){const t=e.map(h);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const f=new WeakMap;function h(e){for(const[t,r]of o)if(r.canHandle(e)){const[n,a]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},a]}return[{type:"RAW",value:e},f.get(e)||[]]}function p(e){switch(e.type){case"HANDLER":return o.get(e.name).deserialize(e.value);case"RAW":return e.value}}function m(e,t,r){return new Promise((n=>{const a=new Array(4).fill(0).map((()=>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===a&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),r)}))}var g=[[0,1,0],[1,-4,1],[0,1,0]];function d(e,t,r,n){return e[4*(r*t+n)]}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,a=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){a=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}(e,t)||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(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 w="frontal",E="left",S="right",M="up",k="down",A=0,_=1,R=2,L=0,P=1,O=2,T=function(e,t){var r=y(e,2),n=r[0],a=r[1],o=y(t,2),i=o[0],u=o[1];return n>u||i>a?L:n<=i&&u<=a?O:P};function j(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=y(e,2),a=n[0],o=n[1],i=y(t,2),u=i[0],c=i[1],s=[a[0],o[0]],l=[a[1],o[1]],f=[u[0],c[0]],h=[u[1],c[1]],p=[s[0]+r,s[1]-r],m=[l[0]+r,l[1]-.8*r];return T(p,f)===O&&T(m,h)===O?R:T(s,f)===L||T(l,h)===L?A:_}var F={code:"no_face",msg:{en:"Face not found",vi:"Không tìm thấy khuôn mặt"}},C={code:"partial_face",msg:{en:"Face out of the box",vi:"Không tìm thấy toàn bộ khuôn mặt"}},x={code:"multiple_faces",msg:{en:"Too many faces",vi:"Quá nhiều khuôn mặt"}},N={code:"face_too_small",msg:{en:"Face too small",vi:"Khuôn mặt quá nhỏ"}},z={code:"face_too_large",msg:{en:"Face too large",vi:"Khuôn mặt quá to"}},D={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 H(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function I(e,t){return[e[0]-t[0],e[1]-t[1]]}function K(e,t,r,n){var a=r*(4*t)+4*n;return{r:e[a],g:e[a+1],b:e[a+2]}}i({calculateBlurScoreFunc:function(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,a=0;a<t.length;a+=4){var o=(t[a]+t[a+1]+t[a+2])/3;t[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=g[0][0]*d(t,r,f-1,l-1)+g[0][1]*d(t,r,f,l-1)+g[0][2]*d(t,r,f+1,l-1)+g[1][0]*d(t,r,f-1,l)+g[1][1]*d(t,r,f,l)+g[1][2]*d(t,r,f+1,l)+g[2][0]*d(t,r,f-1,l+1)+g[2][1]*d(t,r,f,l+1)+g[2][2]*d(t,r,f+1,l+1);(h=Math.abs(h))>25&&i++,h>15&&h<25&&u++}var p=0;return i+u!==0&&(p=i/(i+u)),p},calculateFaceDirectionFunc:function(e){var t=e.landmarks,r=e.getPerfectFrontal,n=e.upDownBound,a=void 0===n?{lower:.42,upper:.7}:n,o=function(e){var t,r,n,a,o,i,u,c=y(e,4),s=c[0],l=c[1],f=c[2],h=c[3],p=I(l,s),m=H(p),g=(a=l,t=[(n=s)[0]+a[0],n[1]+a[1]],r=2,[t[0]/r,t[1]/r]),d=I(f,g),v=H(I(h,f)),b=I(h,g),w=H(b),E=(d[0]*b[0]+d[1]*b[1])/w,S=v/w;if(m>.5*w)o=(d[0]*p[0]+d[1]*p[1])/m/m;else{var M=H(I(d,function(e,t){return[e[0]*t,e[1]*t]}(b,E/w)));u=b,o=((i=d)[0]*u[1]-u[0]*i[1]>=0?1:-1)*M/m}return{left_right_score:o,up_down_score:S}}(t),i=o.left_right_score,u=o.up_down_score,c=y(t,3),s=c[0],l=c[1],f=c[2],h=l[0]-f[0],p=s[0]-f[0],m=r?.1:.3,g=u>a.upper,d=u<a.lower,v=i>=.35&&i<=.6,b=i<=-.35&&i>=-.6,A=g&&!b&&!v,_=d&&!b&&!v,R=b&&!g&&!d,L=v&&!g&&!d;return u>=a.lower&&u<=a.upper&&i>-m&&i<m&&h*p<0?{gesture:w,leftRightScore:i}:A?{gesture:M,leftRightScore:i}:_?{gesture:k,leftRightScore:i}:L?{gesture:S,leftRightScore:i}:R?{gesture:E,leftRightScore:i}:null},validatePredictionsFunc:function(e){var t,r,n,a,o,i,u,c,s,l,f,h,p,m,g,d,b,w,E,S,M,k,L,P,O,T,H,I,K,G,W,U,q,B=e.predictions,Y=e.width,Q=e.height,X=e.cropAreaCoordinates,$=null!=X?X:[[0,0],[Y,Q]],J=B.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,a=t.probability,o=t.landmarks;a<.9||o.length<6||function(e){var t=e.small,r=t.coords,n=t.area,a=e.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),p=h[0],m=h[1];f=(m[0]-p[0])*(m[1]-p[1])}return u/f}({small:{coords:[r,n]},big:{coords:$}})<=.025?e[A].push(t):e[j($,[r,n])].push(t);return e}),(v(t={},_,[]),v(t,R,[]),v(t,A,[]),t)),V=J[R].length,Z=J[_].length;if(0===V)r=Z>0?C:F;else if(V+Z>1)r=x;else{var ee=n=J[R][0],te=ee.topLeft,re=ee.bottomRight;P=$,O=y([te,re],2),T=O[0],H=O[1],I=y(P,2),K=I[0],G=I[1],W=H[0]-T[0],U=H[1]-T[1],q=G[0]-K[0],(a=W/q<U/q?W/q:U/q)<.4&&(r=N),a>.61&&(r=z),j($,(o=n.landmarks,c=o[0],s=o[1],l=o[2],f=o[3],h=o[4],p=o[5],m=.5*(c[1]+s[1]),g=m+1.5*(m-f[1]),d=f[1]-1.2*(l[1]-f[1]),b=[c[0],s[0],l[0],f[0],h[0],p[0]],w=Math.min.apply(Math,b),E=Math.min(g,d),S=Math.max.apply(Math,b),M=Math.max(g,d),k=Math.abs(f[0]-h[0])/Math.abs(f[0]-p[0]),L=f[0]-h[0]<0&&p[0]-f[0]>.05*(S-w),f[0]-h[0]>0&&p[0]-f[0]<-.05*(S-w)?(i=.2,u=.1):L?(i=.1,u=.2):k>2||k<.5?(i=.15,u=.15):(i=.05,u=.05),[[w-i*(S-w),E],[S+u*(S-w),M]]),.05*Y)!==R&&(r=D)}return{ratio:a,error:r,fullFace:n,faceRatio:a,faceNotFrontalMinThreshold:.38}},detectGlare:function(e,t,r){return function(e,t,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=K(e,t,c,s),f=l.r,h=l.g,p=l.b;f>=245&&p>=245&&h>245&&(n+=1)}return n}(e,t,function(e,t){var r=Math.floor(.025*e),n=e-r,a=Math.floor(.025*t);return[r,a,n,t-a]}(t,r))/(t*r)>=.001}});']),t=URL.createObjectURL(e);return lV(new Worker(t))}(),bV=[[0,1,0],[1,-4,1],[0,1,0]];function CV(e,t,r,n){return e[4*(r*t+n)]}function wV(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,o=0;o<t.length;o+=4){var a=(t[o]+t[o+1]+t[o+2])/3;t[o]=a}for(var i=0,s=0,c=n-1,u=r-1,l=1;l<c;l++)for(var d=1;d<u;d++){var f=bV[0][0]*CV(t,r,d-1,l-1)+bV[0][1]*CV(t,r,d,l-1)+bV[0][2]*CV(t,r,d+1,l-1)+bV[1][0]*CV(t,r,d-1,l)+bV[1][1]*CV(t,r,d,l)+bV[1][2]*CV(t,r,d+1,l)+bV[2][0]*CV(t,r,d-1,l+1)+bV[2][1]*CV(t,r,d,l+1)+bV[2][2]*CV(t,r,d+1,l+1);(f=Math.abs(f))>25&&i++,f>15&&f<25&&s++}var p=0;return i+s!==0&&(p=i/(i+s)),p}function kV(e){var t=e.width,r=e.height,n=e.getContext("2d"),o=Math.floor(t/2.8),a=Math.floor(r/2.8),i=t-o,s=r-a;return{data:n.getImageData(Math.floor(o/2),Math.floor(a/2),i,s).data,reducedWidth:i,reducedHeight:s}}function SV(){return(SV=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=kV(t),yV){e.next=3;break}return e.abrupt("return",wV(r));case 3:return e.abrupt("return",yV.calculateBlurScoreFunc(r));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function EV(e,t,r,n){return e[4*(n*t+r)]}var BV=Object.freeze({__proto__:null,calculateBlurScore:function(e){return SV.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),a=Math.floor(13.5),i=Math.floor(408.5),s=Math.floor(256.5),c=document.createElement("canvas"),u=c.getContext("2d"),l=i-o,d=s-a;c.width=l,c.height=d,u.drawImage(r,o,a,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 C=1;C<g;C++){var w=4*-EV(f,l,C,b)+EV(f,l,C,b-1)+EV(f,l,C,b+1)+EV(f,l,C-1,b)+EV(f,l,C+1,b);v+=w,y.push(w)}v/=(l-2)*(d-2);for(var k=0,S=0;S<y.length;S++){var E=y[S]-v;k+=Math.pow(E,2)}var B=Math.sqrt(k/y.length);return 1/(1+Math.pow(2,B/2-10))}});function _V(e){var t,r,n,o,a,i,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?(a=u*(n=p/m),i=(l-(t=(g-m/y)/2))*(o=h/(g-2*t))):(a=(u-(r=(m-g*y)/2))*(n=p/(m-2*r)),i=l*(o=h/g));var b=d*n,C=f*o,w=b,k=C,S=Math.max(b,C)*c;return{lostX:r,lostY:t,cropWidth:b=Math.floor(Math.min(p,b+2*S)),cropHeight:C=Math.floor(Math.min(h,C+2*S)),cropX:a=Math.floor(Math.max(0,a-S)),cropY:i=Math.floor(Math.max(0,i-S)),cropWidthWithoutPadding:w,cropHeightWithoutPadding:k}}var xV=Object.freeze({__proto__:null,analyzeVideoAndWindowSizes:_V,takePicture:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.canvas,n=t.video,o=t.cropArea,a=t.quality,i=void 0===a?1:a;if(r)e=r;else{var s=_V(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",i)}))}}),TV=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},AV=Object.freeze({__proto__:null,shuffleArray:TV}),IV={NONE:0,PARTIAL:1,FULL:2},PV=0,RV=1,DV=2,NV=function(e,t){var r=CL(e,2),n=r[0],o=r[1],a=CL(t,2),i=a[0],s=a[1];return n>s||i>o?PV:n<=i&&s<=o?DV:RV};function OV(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=CL(e,2),o=n[0],a=n[1],i=CL(t,2),s=i[0],c=i[1],u=[o[0],a[0]],l=[o[1],a[1]],d=[s[0],c[0]],f=[s[1],c[1]],p=[u[0]+r,u[1]-r],h=[l[0]+r,l[1]-.8*r];return NV(p,d)===DV&&NV(h,f)===DV?IV.FULL:NV(u,d)===PV||NV(l,f)===PV?IV.NONE:IV.PARTIAL}function LV(e){var t=e.small,r=t.coords,n=t.area,o=e.big,a=o.coords,i=o.area,s=n;if(!s){var c=CL(r,2),u=c[0],l=c[1];s=(l[0]-u[0])*(l[1]-u[1])}var d=i;if(!d){var f=CL(a,2),p=f[0],h=f[1];d=(h[0]-p[0])*(h[1]-p[1])}return s/d}function MV(e,t){var r=CL(e,2),n=r[0],o=r[1],a=CL(t,2),i=a[0],s=a[1],c=o[0]-n[0],u=o[1]-n[1],l=s[0]-i[0];return c/l<u/l?c/l:u/l}var FV=Object.freeze({__proto__:null,ContainMode:IV,rectContains:OV,rectAreaRatio:LV,rectEdgeRatio:MV,isFaceCenter:function(e,t){var r=CL(e,2),n=r[0],o=r[1],a=CL(t,2),i=a[0],s=a[1],c=o[0]-n[0],u=o[1]-n[1],l=s[0]-i[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 UV(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function jV(e,t){return[e[0]-t[0],e[1]-t[1]]}function VV(e){var t=e.landmarks,r=e.getPerfectFrontal,n=e.upDownBound,o=void 0===n?{lower:.42,upper:.7}:n,a=function(e){var t,r,n,o,a,i,s=CL(e,4),c=s[0],u=s[1],l=s[2],d=s[3],f=jV(u,c),p=UV(f),h=(n=u,2,[(t=[(r=c)[0]+n[0],r[1]+n[1]])[0]/2,t[1]/2]),m=jV(l,h),g=UV(jV(d,l)),v=jV(d,h),y=UV(v),b=(m[0]*v[0]+m[1]*v[1])/y,C=g/y;if(p>.5*y)o=(m[0]*f[0]+m[1]*f[1])/p/p;else{var w=UV(jV(m,function(e,t){return[e[0]*t,e[1]*t]}(v,b/y)));i=v,o=((a=m)[0]*i[1]-i[0]*a[1]>=0?1:-1)*w/p}return{left_right_score:o,up_down_score:C}}(t),i=a.left_right_score,s=a.up_down_score,c=CL(t,3),u=c[0],l=c[1],d=c[2],f=l[0]-d[0],p=u[0]-d[0],h=r?.1:.3,m=s>o.upper,g=s<o.lower,v=i>=.35&&i<=.6,y=i<=-.35&&i>=-.6,b=m&&!y&&!v,C=g&&!y&&!v,w=y&&!m&&!g,k=v&&!m&&!g;return s>=o.lower&&s<=o.upper&&i>-h&&i<h&&f*p<0?{gesture:cL.FRONTAL,leftRightScore:i}:b?{gesture:cL.UP,leftRightScore:i}:C?{gesture:cL.DOWN,leftRightScore:i}:k?{gesture:cL.RIGHT,leftRightScore:i}:w?{gesture:cL.LEFT,leftRightScore:i}:null}function zV(e){var t,r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E=e.predictions,B=e.width,_=e.height,x=e.cropAreaCoordinates,T=null!=x?x:[[0,0],[B,_]],A=E.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,o=t.probability,a=t.landmarks;return o<.9||a.length<6||LV({small:{coords:[r,n]},big:{coords:T}})<=.025?e[IV.NONE].push(t):e[OV(T,[r,n])].push(t),e}),(mL(t={},IV.PARTIAL,[]),mL(t,IV.FULL,[]),mL(t,IV.NONE,[]),t)),I=A[IV.FULL].length,P=A[IV.PARTIAL].length;if(0===I)r=P>0?sL.partial_face:sL.no_face;else if(I+P>1)r=sL.multiple_faces;else{var R=n=A[IV.FULL][0];(o=MV([R.topLeft,R.bottomRight],T))<.4&&(r=sL.face_too_small),o>.61&&(r=sL.face_too_large),OV(T,(c=(a=n.landmarks)[0],u=a[1],l=a[2],d=a[3],f=a[4],p=a[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),C=Math.max.apply(Math,v),w=Math.max(m,g),k=Math.abs(d[0]-f[0])/Math.abs(d[0]-p[0]),S=d[0]-f[0]<0&&p[0]-d[0]>.05*(C-y),d[0]-f[0]>0&&p[0]-d[0]<-.05*(C-y)?(i=.2,s=.1):S?(i=.1,s=.2):k>2||k<.5?(i=.15,s=.15):(i=.05,s=.05),[[y-i*(C-y),b],[C+s*(C-y),w]]),.05*B)!==IV.FULL&&(r=sL.face_out_of_box)}return{ratio:o,error:r,fullFace:n,faceRatio:o,faceNotFrontalMinThreshold:.38}}function qV(e,t){var r=t.customInstructions,n=t.customIcon,o=t.customDirectionIcon,a=t.customStepTimeConstraints,i={};return null!=r&&r[e]&&(i.instructions=r[e]),null!=n&&n[e]&&(i.icon=n[e]),null!=o&&o[e]&&(i.directionIcon=o[e]),null!=a&&a[e]&&(i.stepTimeConstraints=a[e]),i}function HV(){return(HV=dL(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(yV){e.next=2;break}return e.abrupt("return",zV(t));case 2:return e.abrupt("return",yV.validatePredictionsFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function KV(){return(KV=dL(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(yV){e.next=2;break}return e.abrupt("return",VV(t));case 2:return e.abrupt("return",yV.calculateFaceDirectionFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var WV=Object.freeze({__proto__:null,cropFaceInsideBox:function(e,t){var r=CL(e,2),n=r[0],o=r[1],a=CL(t,2),i=a[0],s=a[1];return[[Math.max(n[0],i[0]),Math.max(n[1],i[1])],[Math.min(o[0],s[0]),Math.min(o[1],s[1])]]},calculateFaceArea:function(e){var t=e.topLeft,r=e.bottomRight;return(r[0]-t[0])*(r[1]-t[1])},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,a=e.customDirectionIcon,i=e.customStepTimeConstraints;return{curStepIndex:0,steps:[].concat(wL(TV([yL({name:cL.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:$j(r,"ic_face_left.svg"),directionIcon:$j(r,"arrow_left.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},qV(cL.LEFT,{customInstructions:n,customIcon:o,customDirectionIcon:a,customStepTimeConstraints:i})),yL({name:cL.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:$j(r,"ic_face_right.svg"),directionIcon:$j(r,"arrow_right.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},qV(cL.RIGHT,{customInstructions:n,customIcon:o,customDirectionIcon:a,customStepTimeConstraints:i})),yL({name:cL.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:$j(r,"ic_face_up.svg"),directionIcon:$j(r,"arrow_up.svg"),directionIconAnimation:"slide-vertical",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},qV(cL.UP,{customInstructions:n,customIcon:o,customDirectionIcon:a,customStepTimeConstraints:i}))])),[yL({name:cL.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:$j(r,"ic_face_frontal.svg"),directionIcon:$j(r,"frontal.svg"),directionIconAnimation:"blink",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},qV(cL.FRONTAL,{customInstructions:n,customIcon:o,customDirectionIcon:a,customStepTimeConstraints:i}))])}},validatePredictions:function(e){return HV.apply(this,arguments)},calculateFaceDirection:function(e){return KV.apply(this,arguments)},faceTracker:function(){var e=[],t=[],r=[],n=[],o=[],a=0,i=0;function s(){i=a,r=wL(e),n=wL(t)}return function(c,u){var l=c.topLeft,d=c.bottomRight,f=c.landmarks,p=[],h=CL(l,2);p[0]=h[0],p[1]=h[1];var m=CL(d,2);p[2]=m[0],p[3]=m[1];var g=[],v=[];f.forEach((function(e,t){var r=CL(e,2);g[t]=r[0],v[t]=r[1]})),a=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:a};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 C=0;C<6;C++)o[C]/=(a-i)*y;for(var w=0,k=0;k<6;k++)w+=o[k];return w/=6,s(),{score:w,time:a}}}}),QV=function(){var e=dL(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)}}(),GV=Object.freeze({__proto__:null,SIZE:400,getModelPredictions:QV}),XV=Object.getOwnPropertySymbols,YV=Object.prototype.hasOwnProperty,$V=Object.prototype.propertyIsEnumerable;function ZV(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var JV,ez=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=ZV(e),a=1;a<arguments.length;a++){for(var i in r=Object(arguments[a]))YV.call(r,i)&&(o[i]=r[i]);if(XV){n=XV(r);for(var s=0;s<n.length;s++)$V.call(r,n[s])&&(o[n[s]]=r[n[s]])}}return o},tz=arguments[3],rz=arguments[4],nz=arguments[5],oz=JSON.stringify,az=function(e,t){for(var r,n=Object.keys(nz),o=0,a=n.length;o<a;o++){var i=n[o],s=nz[i].exports;if(s===e||s&&s.default===e){r=i;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(o=0,a=n.length;o<a;o++)c[i=n[o]]=i;rz[r]=["function(require,module,exports){"+e+"(self); }",c]}var u=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[r]=r,rz[u]=["function(require,module,exports){var f = require("+oz(r)+");(f.default ? f.default : f)(self);}",l];var d={};!function e(t){for(var r in d[t]=!0,rz[t][1]){var n=rz[t][1][r];d[n]||e(n)}}(u);var f="("+tz+")({"+Object.keys(d).map((function(e){return oz(e)+":["+rz[e][0]+","+oz(rz[e][1])+"]"})).join(",")+"},{},["+oz(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},iz=zL((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}}})),sz={js:!0,wasm:!0};function cz(e){if(!(this instanceof cz))return new cz(e);var t=ez({},sz,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')}cz.prototype.has_wasm=function(){if(void 0!==JV)return JV;if(JV=!1,"undefined"==typeof WebAssembly)return JV;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)&&(JV=!0),JV}catch(e){}return JV},cz.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},cz.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},cz.prototype.__base64decode=function(e){for(var t=e.replace(/[\r\n=]/g,""),r=t.length,n=new Uint8Array(3*r>>2),o=0,a=0,i=0;i<r;i++)i%4==0&&i&&(n[a++]=o>>16&255,n[a++]=o>>8&255,n[a++]=255&o),o=o<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t.charAt(i));var s=r%4*6;return 0===s?(n[a++]=o>>16&255,n[a++]=o>>8&255,n[a++]=255&o):18===s?(n[a++]=o>>10&255,n[a++]=o>>2&255):12===s&&(n[a++]=o>>4&255),n},cz.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},cz.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:ez(o,r||{})})}return this.__cache[e]},cz.prototype.__align=function(e,t){var r=e%(t=t||8);return e+(r?t-r:0)};var uz,lz,dz,fz,pz,hz,mz=cz;function gz(e,t,r,n,o,a){var i,s,c,u,l,d,f,p,h,m,g,v,y,b;for(h=0;h<a;h++){for(f=h,p=0,u=l=(i=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+i*v+u*y+l*b,l=u,u=c,i=s,r[p]=u,p++,d++;for(p--,f+=a*(o-1),u=l=(i=e[--d])*n[7],s=i,g=n[2],v=n[3],m=o-1;m>=0;m--)c=s*g+i*v+u*y+l*b,l=u,u=c,i=s,s=e[d],t[f]=r[p]+u,d--,p--,f-=a}}var vz=function(e,t,r,n){if(n){var o=new Uint16Array(e.length),a=new Float32Array(Math.max(t,r)),i=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 uz=o,lz=o*(t-1)*r,dz=o*(t+1)*r,fz=-o*n,pz=2*r,hz=-n,new Float32Array([uz,lz,dz,fz,pz,hz,(uz+lz)/(1-pz-hz),(dz+fz)/(1-pz-hz)])}(n);gz(e,o,a,i,t,r),gz(o,e,a,i,r,t)}},yz={name:"unsharp_mask",fn:function(e,t,r,n,o,a){var i,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,a,i,s,c=t*r,u=new Uint16Array(c),l=0;l<c;l++)n=e[4*l],o=e[4*l+1],a=e[4*l+2],s=n>=o&&n>=a?n:o>=a&&o>=n?o:a,i=n<=o&&n<=a?n:o<=a&&o<=n?o:a,u[l]=257*(s+i)>>1;return u}(e,t,r),C=new Uint16Array(b);vz(C,t,r,o);for(var w=n/100*4096+.5|0,k=257*a|0,S=t*r,E=0;E<S;E++)v=2*(b[E]-C[E]),Math.abs(v)>=k&&(i=e[y=4*E],s=e[y+1],c=e[y+2],d=257*((p=i>=s&&i>=c?i:s>=i&&s>=c?s:c)+(f=i<=s&&i<=c?i:s<=i&&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=i===p?65535*(s-c)/(6*(p-f))|0:s===p?21845+(65535*(c-i)/(6*(p-f))|0):43690+(65535*(i-s)/(6*(p-f))|0)),(d+=w*v+2048>>12)>65535?d=65535:d<0&&(d=0),0===l?i=s=c=d>>8:(h=2*d-(m=d<=32767?d*(4096+l)+2048>>12:d+((65535-d)*l+2048>>12))>>8,m>>=8,i=(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]=i,e[y+1]=s,e[y+2]=c)}},wasm_fn:function(e,t,r,n,o,a){if(!(0===n||o<.5)){o>2&&(o=2);var i=t*r,s=4*i,c=2*i,u=2*i,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,a),v.set(new Uint32Array(this.__memory.buffer,0,i))}},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"},bz=[{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 Cz(e){return Math.round(16383*e)}var wz=function(e,t,r,n,o){var a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k=bz[e].filter,S=1/n,E=Math.min(1,n),B=bz[e].win/E,_=Math.floor(2*(B+1)),x=new Int16Array((_+2)*r),T=0,A=!x.subarray||!x.set;for(a=0;a<r;a++){for(i=(a+.5)*S+o,s=Math.max(0,Math.floor(i-B)),u=(c=Math.min(t-1,Math.ceil(i+B)))-s+1,l=new Float32Array(u),d=new Int16Array(u),f=0,p=s,h=0;p<=c;p++,h++)f+=m=k((p+.5-i)*E),l[h]=m;for(g=0,h=0;h<l.length;h++)g+=v=l[h]/f,d[h]=Cz(v);for(d[r>>1]+=Cz(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(C=s+y,w=b-y+1,x[T++]=C,x[T++]=w,A)for(h=y;h<=b;h++)x[T++]=d[h];else x.set(d.subarray(y,b+1),T),T+=w}else x[T++]=0,x[T++]=0}return x};function kz(e){return e<0?0:e>255?255:e}var Sz=function(e,t,r,n,o,a){var i,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=a[l++],f=a[l++],p=v+4*d|0,i=s=c=u=0;f>0;f--)u=u+(g=a[l++])*e[p+3]|0,c=c+g*e[p+2]|0,s=s+g*e[p+1]|0,i=i+g*e[p]|0,p=p+4|0;t[y+3]=kz(u+8192>>14),t[y+2]=kz(c+8192>>14),t[y+1]=kz(s+8192>>14),t[y]=kz(i+8192>>14),y=y+4*n|0}y=4*(h+1)|0,v=(h+1)*r*4|0}},Ez=function(e,t,r,n,o,a){var i,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=a[l++],f=a[l++],p=v+4*d|0,i=s=c=u=0;f>0;f--)u=u+(g=a[l++])*e[p+3]|0,c=c+g*e[p+2]|0,s=s+g*e[p+1]|0,i=i+g*e[p]|0,p=p+4|0;t[y+3]=kz(u+8192>>14),t[y+2]=kz(c+8192>>14),t[y+1]=kz(s+8192>>14),t[y]=kz(i+8192>>14),y=y+4*n|0}y=4*(h+1)|0,v=(h+1)*r*4|0}},Bz=!0;try{Bz=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(e){}function _z(e,t,r){if(Bz)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 a=e[o];t[n++]=255&a,t[n++]=a>>8&255}}var xz={name:"resize",fn:function(e){var t=e.src,r=e.width,n=e.height,o=e.toWidth,a=e.toHeight,i=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*a*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,p=wz(d,r,o,i,c),h=wz(d,n,a,s,u),m=new Uint8Array(o*n*4);return Sz(t,m,r,n,o,p),Ez(m,l,n,o,a,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,a),l},wasm_fn:function(e){var t=e.src,r=e.width,n=e.height,o=e.toWidth,a=e.toHeight,i=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*a*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,p=wz(d,r,o,i,c),h=wz(d,n,a,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),C=new Uint8Array(this.__memory.buffer),w=new Uint32Array(this.__memory.buffer),k=new Uint32Array(t.buffer);return w.set(k),_z(p,C,g),_z(h,C,v),(b.exports.convolveHV||b.exports._convolveHV)(g,v,m,r,n,o,a),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,a*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,a),l},wasm_src:"AGFzbQEAAAABFAJgBn9/f39/fwBgB39/f39/f38AAg8BA2VudgZtZW1vcnkCAAEDAwIAAQQEAXAAAAcZAghjb252b2x2ZQAACmNvbnZvbHZlSFYAAQkBAArmAwLBAwEQfwJAIANFDQAgBEUNACAFQQRqIRVBACEMQQAhDQNAIA0hDkEAIRFBACEHA0AgB0ECaiESAn8gBSAHQQF0IgdqIgZBAmouAQAiEwRAQQAhCEEAIBNrIRQgFSAHaiEPIAAgDCAGLgEAakECdGohEEEAIQlBACEKQQAhCwNAIBAoAgAiB0EYdiAPLgEAIgZsIAtqIQsgB0H/AXEgBmwgCGohCCAHQRB2Qf8BcSAGbCAKaiEKIAdBCHZB/wFxIAZsIAlqIQkgD0ECaiEPIBBBBGohECAUQQFqIhQNAAsgEiATagwBC0EAIQtBACEKQQAhCUEAIQggEgshByABIA5BAnRqIApBgMAAakEOdSIGQf8BIAZB/wFIG0EQdEGAgPwHcUEAIAZBAEobIAtBgMAAakEOdSIGQf8BIAZB/wFIG0EYdEEAIAZBAEobciAJQYDAAGpBDnUiBkH/ASAGQf8BSBtBCHRBgP4DcUEAIAZBAEobciAIQYDAAGpBDnUiBkH/ASAGQf8BSBtB/wFxQQAgBkEAShtyNgIAIA4gA2ohDiARQQFqIhEgBEcNAAsgDCACaiEMIA1BAWoiDSADRw0ACwsLIQACQEEAIAIgAyAEIAUgABAAIAJBACAEIAUgBiABEAALCw=="};function Tz(e){var t=e||[],r={js:t.indexOf("js")>=0,wasm:t.indexOf("wasm")>=0};mz.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(yz),this.use(xz)}iz(Tz,mz),Tz.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 Az=Tz;function Iz(e,t){this.create=e,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=t||2e3}Iz.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},Iz.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))},Iz.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 Pz=Iz;function Rz(e){return Object.prototype.toString.call(e)}var Dz=function(e){var t=Rz(e);return"[object HTMLCanvasElement]"===t||"[object OffscreenCanvas]"===t||"[object Canvas]"===t},Nz=function(e){return"[object HTMLImageElement]"===Rz(e)},Oz=function(e){return"[object ImageBitmap]"===Rz(e)},Lz=function(e){var t=0,r=[];function n(){t<e&&r.length&&(t++,r.shift()())}return function(e){return new Promise((function(o,a){r.push((function(){e().then((function(e){o(e),t--,n()}),(function(e){a(e),t--,n()}))})),n()}))}},Mz=function(e){switch(e){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},Fz=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}))},Uz=function(){var e,t=Az;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 jz(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.floor(e)}function Vz(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.ceil(e)}var zz={},qz=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(qz=navigator.userAgent.indexOf("Safari")>=0)}catch(e){}var Hz=1;"undefined"!=typeof navigator&&(Hz=Math.min(navigator.hardwareConcurrency||1,4));var Kz,Wz,Qz={tile:1024,concurrency:Hz,features:["js","wasm","ww"],idle:2e3,createCanvas:function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r}},Gz={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0};function Xz(){return{value:az(Uz),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 Yz(e){if(!(this instanceof Yz))return new Yz(e);this.options=ez({},Qz,e||{});var t="lk_".concat(this.options.concurrency);this.__limit=zz[t]||Lz(this.options.concurrency),zz[t]||(zz[t]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}Yz.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if(!1!==Kz&&!0!==Kz&&(Kz=!1,"undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray))try{new ImageData(new Uint8ClampedArray(400),10,10),Kz=!0}catch(t){}!1!==Wz&&!0!==Wz&&(Wz=!1,"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?Wz=!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 Az(t),t.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{az((function(){})).terminate(),this.features.ww=!0;var r="wp_".concat(JSON.stringify(this.options));zz[r]?this.__workersPool=zz[r]:(this.__workersPool=new Pz(Xz,this.options.idle),zz[r]=this.__workersPool)}catch(t){}var n,o=this.__mathlib.init().then((function(t){ez(e.features,t.features)}));return n=Wz?Fz(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},Yz.prototype.resize=function(e,t,r){var n=this;this.debug("Start resize...");var o=ez({},Gz);if(isNaN(r)?r&&(o=ez(o,r)):o=ez(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 a=!1,i=null;o.cancelToken&&(i=o.cancelToken.then((function(e){throw a=!0,e}),(function(e){throw a=!0,e})));var s=Math.ceil(Math.max(3,2.5*o.unsharpRadius|0));return this.init().then((function(){if(a)return i;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:Mz(o.quality)}).then((function(e){if(a)return i;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();i&&i.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(a)return i;var s;if(Dz(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(a)return i;var r;if(s=null,n.debug("Convert raw rgba tile result to ImageData"),Kz)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"),qz?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)}),Dz(e))return o=e.getContext("2d",{alpha:Boolean(r.alpha)}),null;if(Oz(e))return c=e,d=!0,null;if(Nz(e))return Wz?(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(a)return i;n.debug("Calculate tiles");var e=function(e){var t,r,n,o,a,i,s=e.toWidth/e.width,c=e.toHeight/e.height,u=jz(e.srcTileSize*s)-2*e.destTileBorder,l=jz(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+(a=n+u+e.destTileBorder-t)>=e.toWidth&&(a=e.toWidth-t),(r=o-e.destTileBorder)<0&&(r=0),r+(i=o+l+e.destTileBorder-r)>=e.toHeight&&(i=e.toHeight-r),d={toX:t,toY:r,toWidth:a,toHeight:i,toInnerX:n,toInnerY:o,toInnerWidth:u,toInnerHeight:l,offsetX:t/s-jz(t/s),offsetY:r/c-jz(r/c),scaleX:s,scaleY:c,x:jz(t/s),y:jz(r/c),width:Vz(a/s),height:Vz(i/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(a)return i;var c,u=Wy(t.shift(),2),d=u[0],f=u[1],p=0===t.length;return s=ez({},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,a){var i=r/e,s=n/t,c=(2*a+2+1)/o;if(c>.5)return[[r,n]];var u=Math.ceil(Math.log(Math.min(i,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)}))},Yz.prototype.resizeBuffer=function(e){var t=this,r=ez({},Gz,e);return this.init().then((function(){return t.__mathlib.resizeAndUnsharp(r)}))},Yz.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]),a=o.length,i=new Uint8Array(a),s=0;s<a;s++)i[s]=o.charCodeAt(s);n(new Blob([i],{type:t}))}}))},Yz.prototype.debug=function(){};var $z=new Yz,Zz=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.minSize,o=void 0===n?720:n,a=e/t;return e>t?{desW:Math.floor(o*a),desH:o}:{desW:o,desH:Math.floor(o/a)}},Jz=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 a=document.createElement("canvas");o.onload=function(){if(o.width&&o.height&&(o.width<n||o.height<n)){var e=Zz(o.width,o.height,{minSize:n}),r=e.desW,i=e.desH;a.width=r,a.height=i,$z.resize(o,a).then((function(e){return $z.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),a=new Image;a.onload=function(){URL.revokeObjectURL(r),o.drawImage(a,0,0,n.width,n.height),n.toBlob(t,"image/jpeg",1)},a.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 a=o.width,i=o.height;r.width=a,r.height=i,URL.revokeObjectURL(t.target.src),n.drawImage(t.target,0,0),e(r)},o.src=URL.createObjectURL(t)}))}});function eq(e,t,r,n){var o=r*(4*t)+4*n;return{r:e[o],g:e[o+1],b:e[o+2]}}function tq(e,t,r){return function(e,t,r){for(var n=0,o=r[1],a=r[3],i=r[0],s=r[2],c=o;c<a;c++)for(var u=i;u<s;u++){var l=eq(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 rq(){return(rq=dL(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,yV){e.next=5;break}return e.abrupt("return",tq(o,n.width,n.height));case 5:return e.abrupt("return",yV.detectGlare(o,n.width,n.height));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var nq=Object.freeze({__proto__:null,isCardGlare:function(e){return rq.apply(this,arguments)}}),oq="internal_server_error",aq="network_error",iq=Pj();function sq(e){return 500*Math.pow(1.5,e)}function cq(e){return Array.isArray(null==e?void 0:e.errors)&&e.errors.find((function(e){return e.code===oq}))}function uq(e){return"Failed to fetch"===e.message||!e.response}function lq(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,o=t.maxInternalServerErrorRetryTimes,a=void 0===o?1:o,i=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=dL(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=dL(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,eV(sq(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===aq?n:e===oq?a:0},f=function(e){return o>0||(e===aq?void 0===o&&n>0:e===oq&&void 0===o&&a>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:i,timeInMs:performance.now()-v,args:r}),!cq(y)||!f(oq)){t.next=16;break}return t.next=15,m(oq);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:i,timeInMs:performance.now()-v,args:r}),!uq(t.t0)||!f(aq)){t.next=24;break}return t.abrupt("return",m(aq));case 24:throw t.t0;case 25:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}return u()}}function dq(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,o=t.maxInternalServerErrorRetryTimes,a=void 0===o?1:o,i=t.onDone,s=void 0===i?function(){}:i,c={get:function(e,t){var r=e[t];return"function"==typeof r&&"constructor"!==t?lq(r,{maxNetworkErrorRetryTimes:n,maxInternalServerErrorRetryTimes:a,propertyKey:t,onDone:s}):r}};return new Proxy(e,c)}var fq=Object.freeze({__proto__:null,createRetryAPIClient:dq,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,a=xC.useRef(null),i=function(){};if(null===a.current){var s=r.accessKey,c=r.secretKey,u=r.apiUrl,l=o.userId,d=Gj({userId:l});a.current=dq(new Cj(s,c,u,{httpHeaders:yL(yL({},iq),{},{"x-request-id":d})}),{onDone:i})}return{apiClient:a.current}}}),pq="BFnYsWrH",hq="KbKcY2nb",mq=function(e){return e.split("").reverse().join("")},gq=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)}))},vq=window.fetch.bind(window);function yq(e){var t,r,n=e.hasOwnProperty("words")?e.words:[],o=e.hasOwnProperty("sigBytes")?e.sigBytes:4*n.length,a=new Uint8Array(o),i=0;for(r=0;r<o;r++)t=n[r],a[i++]=t>>24,a[i++]=t>>16&255,a[i++]=t>>8&255,a[i++]=255&t;return a}var bq=function(){var e=dL(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(mq(pq)).concat(mq(hq)),e.next=3,vq.apply(void 0,i);case 3:return r=e.sent,e.next=6,r.text();case 6:return n=e.sent,o=jj.AES.decrypt(n,t),a=yq(o),e.abrupt("return",{u8arr:a});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Cq=function(){var e=dL(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,vq.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)}}(),wq=Object.freeze({__proto__:null,reverseString:mq,loadExternalScript:gq,fetchWithDecryption:bq,fetchRawResource:Cq}),kq=/\s/,Sq=function(e){for(var t=e.length;t--&&kq.test(e.charAt(t)););return t},Eq=/^\s+/,Bq=function(e){return e?e.slice(0,Sq(e)+1).replace(Eq,""):e},_q=/^[-+]0x[0-9a-f]+$/i,xq=/^0b[01]+$/i,Tq=/^0o[0-7]+$/i,Aq=parseInt,Iq=function(e){if("number"==typeof e)return e;if(_U(e))return NaN;if(aM(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=aM(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Bq(e);var r=xq.test(e);return r||Tq.test(e)?Aq(e.slice(2),r?2:8):_q.test(e)?NaN:+e},Pq=function(e){return e?1/0===(e=Iq(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},Rq=function(e){var t=Pq(e),r=t%1;return t==t?r?t-r:t:0},Dq=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=Rq(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},Nq=function(e){return Dq(2,e)},Oq=Nq(function(){var e=dL(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=t.tfUrl,n=void 0===r?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.20.0/dist/tf.min.js":r,o=t.tfBackendWasmUrl,a=void 0===o?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.20.0/dist/tf-backend-wasm.js":o,i=t.tfBackendCpuUrl,s=void 0===i?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@3.20.0":i,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,gq({url:n});case 3:return f=[],a&&f.push(a),s&&f.push(s),d&&f.push(d),u&&f.push(u),e.next=10,Promise.all(f.map((function(e){return gq({url:e})})));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());function Lq(){return(Lq=dL(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0: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,a=o.tf,e.next=6,a.enableProdMode();case 6:i=EL(n),e.prev=7,i.s();case 9:if((s=i.n()).done){e.next=23;break}return c=s.value,e.prev=11,e.next=14,a.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),i.e(e.t1);case 28:return e.prev=28,i.f(),e.finish(28);case 31:return e.next=33,a.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 Mq(){return(Mq=dL(regeneratorRuntime.mark((function e(t){var r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.modelUrl,n=window,o=n.blazeface,!r){e.next=8;break}return e.next=5,o.load({modelUrl:r});case 5:a=e.sent,e.next=11;break;case 8:return e.next=10,o.load();case 10:a=e.sent;case 11:return e.abrupt("return",{blazefaceModel:a});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fq(){return(Fq=dL(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,Cq(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 Uq(e){return jq.apply(this,arguments)}function jq(){return(jq=dL(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,n=t.options,o=void 0===n?{}:n,a=window,i=a.tflite,e.next=4,bq(r);case 4:return s=e.sent,c=s.u8arr,e.abrupt("return",i.loadTFLiteModel(c,yL({numThreads:1},o)));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Vq=Object.freeze({__proto__:null,loadTensorFlow:Oq,initTensorFlow:function(){return Lq.apply(this,arguments)},loadBlazefaceModel:function(e){return Mq.apply(this,arguments)},preloadResource:function(e){return Fq.apply(this,arguments)},loadTFLiteModel:Uq}),zq=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,a=function(e,t){return r[e-=0]};function i(e){function t(e){if("string"==typeof e)return function(e){}[a("0x5")]("while (true) {}")[a("0x0")](a("0x6"));1!=="".concat(e/e)[a("0x7")]||e%20==0?function(){return!0}[a("0x5")]("".concat(a("0x8"),"gger"))[a("0x9")](a("0xa")):function(){return!1}.constructor("debu".concat(a("0xb")))[a("0x0")](a("0xc")),t(++e)}try{if(e)return t;t(0)}catch(e){}}setInterval((function(){i()}),4e3),n=!0,o=function(e,t){var r=n?function(){if(t){var r=t[a("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=i("init");e.test(r+a("0x1"))&&t[a("0x2")](r+a("0x3"))?i():r("0")}))()}(),console.log(a("0x4"))}}),qq=Object.freeze({__proto__:null,useThemeContext:function(){return xC.useContext(sB)}});function Hq(){return(Hq=dL(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 Kq=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 Hq.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,wL(new Uint8Array(r)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""))})}))}))}))},n.readAsArrayBuffer(t)}))}}),Wq=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;fL(this,e),this.interval=t,this.second=0,this.timeStone={origin:0},this.callbacks={}}return hL(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}(),Qq=zL((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 a(e){return d(">"+p("L",e.length),e)}function i(e,t,r){var i,s,c,u,l="",f="";if("Byte"==t)(i=e.length)<=4?f=n(e)+p("\0",4-i):(f=d(">L",[r]),l=n(e));else if("Short"==t)(i=e.length)<=2?f=o(e)+p("\0\0",2-i):(f=d(">L",[r]),l=o(e));else if("Long"==t)(i=e.length)<=1?f=a(e):(f=d(">L",[r]),l=a(e));else if("Ascii"==t)(i=(s=e+"\0").length)>4?(f=d(">L",[r]),l=s):f=s+p("\0",4-i);else if("Rational"==t){if("number"==typeof e[0])i=1,c=e[0],u=e[1],s=d(">L",[c])+d(">L",[u]);else{i=e.length,s="";for(var h=0;h<i;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])i=1,c=e[0],u=e[1],s=d(">l",[c])+d(">l",[u]);else for(i=e.length,s="",h=0;h<i;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&&((i=e.length)>4?(f=d(">L",[r]),l=e):f=e+p("\0",4-i));return[d(">L",[i]),f,l]}function s(e,t,r){var n,o=Object.keys(e).length,a=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=i(l,p,8+n+r+c.length);s+=f+h+v[0]+v[1],c+=v[2]}return[a+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,a){"ÿá"==o.slice(0,2)&&"Exif\0\0"==o.slice(4,10)&&(r?n.unshift(a):(e[a]=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 a=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"!=a&&(o=f(n.endian_mark+"L",a)[0],r["1st"]=n.get_ifd(o,"1st"),513 in r["1st"]&&514 in r["1st"])){var i=r["1st"][513]+r["1st"][514],s=n.tiftag.slice(r["1st"][513],i);r.thumbnail=s}return r},r.dump=function(e){var t,n,o,a,i,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,a=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,i=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,C=s(n,"0th",0),w=C[0].length+12*l+12*f+4+C[1].length,k="",S=0,E="",B=0,_="",x=0,T="";if(l&&(S=(v=s(o,"Exif",w))[0].length+12*p+v[1].length),f&&(B=(E=s(i,"GPS",w+S).join("")).length),p&&(x=(_=s(a,"Interop",w+S+B).join("")).length),g&&(y=s(c,"1st",w+S+B+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="",I="",P="",R="\0\0\0\0";if(l){var D=d(">L",[N=8+w]);A=d(">H",[34665])+d(">H",[m.Long])+d(">L",[1])+D}if(f&&(D=d(">L",[N=8+w+S]),I=d(">H",[34853])+d(">H",[m.Long])+d(">L",[1])+D),p&&(D=d(">L",[N=8+w+S+B]),P=d(">H",[40965])+d(">H",[m.Long])+d(">L",[1])+D),g){var N;R=d(">L",[N=8+w+S+B+x]);var O="\0\0\0\0"+d(">L",[N+y[0].length+24+4+y[1].length]),L="\0\0\0\0"+d(">L",[b.length]);T=y[0]+O+L+"\0\0\0\0"+y[1]+b}var M=C[0]+A+I+R+C[1];return l&&(k=v[0]+P+v[1]),"Exif\0\0MM\0*\0\0\0\b"+M+k+E+_+T},c.prototype={get_ifd:function(e,t){var r,n={},o=f(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],a=e+2;r=["0th","1st"].indexOf(t)>-1?"Image":t;for(var i=0;i<o;i++){e=a+12*i;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=a+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],a=e[2];if(1==n)o>4?(t=f(this.endian_mark+"L",a)[0],r=f(this.endian_mark+p("B",o),this.tiftag.slice(t,t+o))):r=f(this.endian_mark+p("B",o),a.slice(0,o));else if(2==n)o>4?(t=f(this.endian_mark+"L",a)[0],r=this.tiftag.slice(t,t+o-1)):r=a.slice(0,o-1);else if(3==n)o>2?(t=f(this.endian_mark+"L",a)[0],r=f(this.endian_mark+p("H",o),this.tiftag.slice(t,t+2*o))):r=f(this.endian_mark+p("H",o),a.slice(0,2*o));else if(4==n)o>1?(t=f(this.endian_mark+"L",a)[0],r=f(this.endian_mark+p("L",o),this.tiftag.slice(t,t+4*o))):r=f(this.endian_mark+p("L",o),a);else if(5==n)if(t=f(this.endian_mark+"L",a)[0],o>1){r=[];for(var i=0;i<o;i++)r.push([f(this.endian_mark+"L",this.tiftag.slice(t+8*i,t+4+8*i))[0],f(this.endian_mark+"L",this.tiftag.slice(t+4+8*i,t+8+8*i))[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",a)[0],r=this.tiftag.slice(t,t+o)):r=a.slice(0,o);else if(9==n)o>1?(t=f(this.endian_mark+"L",a)[0],r=f(this.endian_mark+p("l",o),this.tiftag.slice(t,t+4*o))):r=f(this.endian_mark+p("l",o),a);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",a)[0],o>1)for(r=[],i=0;i<o;i++)r.push([f(this.endian_mark+"l",this.tiftag.slice(t+8*i,t+4+8*i))[0],f(this.endian_mark+"l",this.tiftag.slice(t+4+8*i,t+8+8*i))[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,a,i,s,c="",u=0,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";u<e.length;)o=(t=e.charCodeAt(u++))>>2,a=(3&t)<<4|(r=e.charCodeAt(u++))>>4,i=(15&r)<<2|(n=e.charCodeAt(u++))>>6,s=63&n,isNaN(r)?i=s=64:isNaN(n)&&(s=64),c=c+l.charAt(o)+l.charAt(a)+l.charAt(i)+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,a=null,i=null,s=null;i=e[o];){if("b"==i.toLowerCase()){if(a=t[o-1],"b"==i&&a<0&&(a+=256),a>255||a<0)throw new Error("'pack' error.");s=String.fromCharCode(a)}else if("H"==i){if((a=t[o-1])>65535||a<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(a%65536/256))+String.fromCharCode(a%256),r&&(s=s.split("").reverse().join(""))}else{if("l"!=i.toLowerCase())throw new Error("'pack' error.");if(a=t[o-1],"l"==i&&a<0&&(a+=4294967296),a>4294967295||a<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(a/16777216))+String.fromCharCode(Math.floor(a%16777216/65536))+String.fromCharCode(Math.floor(a%65536/256))+String.fromCharCode(a%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 a=[],i=0,s=1,c=null,u=null,l=null,d="";u=e[s];){if("b"==u.toLowerCase())l=1,c=(d=t.slice(i,i+l)).charCodeAt(0),"b"==u&&c>=128&&(c-=256);else if("H"==u)l=2,d=t.slice(i,i+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(i,i+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)}a.push(c),i+=l,s+=1}return a}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,a,i,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|(a=u.indexOf(e.charAt(c++)))>>2,n=(3&a)<<6|(i=u.indexOf(e.charAt(c++))),s+=String.fromCharCode(t),64!=a&&(s+=String.fromCharCode(r)),64!=i&&(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 Gq(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Xq(e,t){return e&t}function Yq(e,t){return e|t}function $q(e,t){return e^t}function Zq(e,t){return e&~t}function Jq(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 eH(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var tH,rH="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function nH(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=rH.charAt(r>>6)+rH.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=rH.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=rH.charAt(r>>2)+rH.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function oH(e){var t,r="",n=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var a=rH.indexOf(e.charAt(t));a<0||(0==n?(r+=Gq(a>>2),o=3&a,n=1):1==n?(r+=Gq(o<<2|a>>4),o=15&a,n=2):2==n?(r+=Gq(o),r+=Gq(a>>2),o=3&a,n=3):(r+=Gq(o<<2|a>>4),r+=Gq(15&a),n=0))}return 1==n&&(r+=Gq(o<<2)),r}var aH,iH=function(e){var t;if(void 0===tH){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(tH={},t=0;t<16;++t)tH[r.charAt(t)]=t;for(r=r.toLowerCase(),t=10;t<16;++t)tH[r.charAt(t)]=t;for(t=0;t<n.length;++t)tH[n.charAt(t)]=-1}var o=[],a=0,i=0;for(t=0;t<e.length;++t){var s=e.charAt(t);if("="==s)break;if(-1!=(s=tH[s])){if(void 0===s)throw new Error("Illegal character at offset "+t);a|=s,++i>=2?(o[o.length]=a,a=0,i=0):a<<=4}}if(i)throw new Error("Hex encoding incomplete: 4 bits missing");return o},sH={decode:function(e){var t;if(void 0===aH){var r="= \f\n\r\t \u2028\u2029";for(aH=Object.create(null),t=0;t<64;++t)aH["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(aH["-"]=62,aH._=63,t=0;t<r.length;++t)aH[r.charAt(t)]=-1}var n=[],o=0,a=0;for(t=0;t<e.length;++t){var i=e.charAt(t);if("="==i)break;if(-1!=(i=aH[i])){if(void 0===i)throw new Error("Illegal character at offset "+t);o|=i,++a>=4?(n[n.length]=o>>16,n[n.length]=o>>8&255,n[n.length]=255&o,o=0,a=0):o<<=6}}switch(a){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=sH.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 sH.decode(e)}},cH=1e13,uH=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var r,n,o=this.buf,a=o.length;for(r=0;r<a;++r)(n=o[r]*e+t)<cH?t=0:n-=(t=0|n/cH)*cH,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+=cH,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+=(cH+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*cH+e[r];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),lH=/^(\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)?)?$/,dH=/^(\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 fH(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var pH,hH=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="",a=e;a<t;)r=this.get(a++),n=this.get(a++),o+=String.fromCharCode(r<<8|n);return o},e.prototype.parseTime=function(e,t,r){var n=this.parseStringISO(e,t),o=(r?lH:dH).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,a=o?255:0,i="";n==a&&++e<t;)n=this.get(e);if(0==(r=t-e))return o?-1:0;if(r>4){for(i=n,r<<=3;0==(128&(+i^a));)i=+i<<1,--r;i="("+r+" bit)\n"}o&&(n-=256);for(var s=new uH(n),c=e+1;c<t;++c)s.mulAdd(256,this.get(c));return i+s.toString()},e.prototype.parseBitString=function(e,t,r){for(var n=this.get(e),o="("+((t-e-1<<3)-n)+" bit)\n",a="",i=e+1;i<t;++i){for(var s=this.get(i),c=i==t-1?n:0,u=7;u>=c;--u)a+=s>>u&1?"1":"0";if(a.length>r)return o+fH(a,r)}return o+a},e.prototype.parseOctetString=function(e,t,r){if(this.isASCII(e,t))return fH(this.parseStringISO(e,t),r);var n=t-e,o="("+n+" byte)\n";n>(r/=2)&&(t=e+r);for(var a=e;a<t;++a)o+=this.hexByte(this.get(a));return n>r&&(o+="…"),o},e.prototype.parseOID=function(e,t,r){for(var n="",o=new uH,a=0,i=e;i<t;++i){var s=this.get(i);if(o.mulAdd(128,127&s),a+=7,!(128&s)){if(""===n)if((o=o.simplify())instanceof uH)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 fH(n,r);o=new uH,a=0}}return a>0&&(n+=".incomplete"),n},e}(),mH=function(){function e(e,t,r,n,o){if(!(n instanceof gH))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 fH(this.stream.parseStringUTF(t,t+r),e);case 18:case 19:case 20:case 21:case 22:case 26:return fH(this.stream.parseStringISO(t,t+r),e);case 30:return fH(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 hH?t:new hH(t,0);var n=new hH(r),o=new gH(r),a=e.decodeLength(r),i=r.pos,s=i-n.pos,c=null,u=function(){var t=[];if(null!==a){for(var n=i+a;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 "+i)}else try{for(;;){var o=e.decode(r);if(o.tag.isEOC())break;t[t.length]=o}a=i-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===a)throw new Error("We can't skip over an invalid tag with undefined length at offset "+i);r.pos=i+Math.abs(a)}return new e(n,s,a,o,c)},e}(),gH=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 uH;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}(),vH=[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],yH=(1<<26)/vH[vH.length-1],bH=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,a="",i=this.t,s=this.DB-i*this.DB%t;if(i-- >0)for(s<this.DB&&(r=this[i]>>s)>0&&(o=!0,a=Gq(r));i>=0;)s<t?(r=(this[i]&(1<<s)-1)<<t-s,r|=this[--i]>>(s+=this.DB-t)):(r=this[i]>>(s-=t)&n,s<=0&&(s+=this.DB,--i)),r>0&&(o=!0),o&&(a+=Gq(r));return o?a:"0"},e.prototype.negate=function(){var t=EH();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)+RH(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var r=EH();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 wH(t):new kH(t),this.exp(e,r)},e.prototype.clone=function(){var e=EH();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=EH();return this.bitwiseTo(e,Xq,t),t},e.prototype.or=function(e){var t=EH();return this.bitwiseTo(e,Yq,t),t},e.prototype.xor=function(e){var t=EH();return this.bitwiseTo(e,$q,t),t},e.prototype.andNot=function(e){var t=EH();return this.bitwiseTo(e,Zq,t),t},e.prototype.not=function(){for(var e=EH(),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=EH();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=EH();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+Jq(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+=eH(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,Yq)},e.prototype.clearBit=function(e){return this.changeBit(e,Zq)},e.prototype.flipBit=function(e){return this.changeBit(e,$q)},e.prototype.add=function(e){var t=EH();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=EH();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=EH();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=EH();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=EH();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=EH(),r=EH();return this.divRemTo(e,t,r),[t,r]},e.prototype.modPow=function(e,t){var r,n,o=e.bitLength(),a=PH(1);if(o<=0)return a;r=o<18?1:o<48?3:o<144?4:o<768?5:6,n=o<8?new wH(t):t.isEven()?new SH(t):new kH(t);var i=[],s=3,c=r-1,u=(1<<r)-1;if(i[1]=n.convert(this),r>1){var l=EH();for(n.sqrTo(i[1],l);s<=u;)i[s]=EH(),n.mulTo(l,i[s-2],i[s]),s+=2}var d,f,p=e.t-1,h=!0,m=EH();for(o=RH(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)i[d].copyTo(a),h=!1;else{for(;s>1;)n.sqrTo(a,m),n.sqrTo(m,a),s-=2;s>0?n.sqrTo(a,m):(f=a,a=m,m=f),n.mulTo(m,i[d],a)}for(;p>=0&&0==(e[p]&1<<o);)n.sqrTo(a,m),f=a,a=m,m=f,--o<0&&(o=this.DB-1,--p)}return n.revert(a)},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(),a=PH(1),i=PH(0),s=PH(0),c=PH(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(a.isEven()&&i.isEven()||(a.addTo(this,a),i.subTo(t,i)),a.rShiftTo(1,a)):i.isEven()||i.subTo(t,i),i.rShiftTo(1,i);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&&a.subTo(s,a),i.subTo(c,i)):(o.subTo(n,o),r&&s.subTo(a,s),c.subTo(i,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 CH)},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(),a=r.getLowestSetBit();if(a<0)return t;for(o<a&&(a=o),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,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 a>0&&r.lShiftTo(a,r),r},e.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=vH[vH.length-1]){for(t=0;t<vH.length;++t)if(r[0]==vH[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<vH.length;){for(var n=vH[t],o=t+1;o<vH.length&&n<yH;)n*=vH[o++];for(n=r.modInt(n);t<o;)if(n%vH[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,a=!1,i=0;--o>=0;){var s=8==n?255&+t[o]:IH(t,o);s<0?"-"==t.charAt(o)&&(a=!0):(a=!1,0==i?this[this.t++]=s:i+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-i)-1)<<i,this[this.t++]=s>>this.DB-i):this[this.t-1]|=s<<i,(i+=n)>=this.DB&&(i-=this.DB))}8==n&&0!=(128&+t[0])&&(this.s=-1,i>0&&(this[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),a&&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,a=Math.floor(e/this.DB),i=this.s<<r&this.DM,s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>n|i,i=(this[s]&o)<<r;for(s=a-1;s>=0;--s)t[s]=0;t[a]=i,t.t=this.t+a+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,a=(1<<n)-1;t[0]=this[r]>>n;for(var i=r+1;i<this.t;++i)t[i-r-1]|=(this[i]&a)<<o,t[i-r]=this[i]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<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(),a=n.t;for(r.t=a+o.t;--a>=0;)r[a]=0;for(a=0;a<o.t;++a)r[a+n.t]=n.am(0,o[a],r,a,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 a=this.abs();if(a.t<o.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=EH());var i=EH(),s=this.s,c=t.s,u=this.DB-RH(o[o.t-1]);u>0?(o.lShiftTo(u,i),a.lShiftTo(u,n)):(o.copyTo(i),a.copyTo(n));var l=i.t,d=i[l-1];if(0!=d){var f=d*(1<<this.F1)+(l>1?i[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?EH():r;for(i.dlShiftTo(v,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),e.ONE.dlShiftTo(l,y),y.subTo(i,i);i.t<l;)i[i.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]+=i.am(0,b,n,v,0,l))<b)for(i.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=EH(),o=EH(),a=r.convert(this),i=RH(t)-1;for(a.copyTo(n);--i>=0;)if(r.sqrTo(n,o),(t&1<<i)>0)r.mulTo(o,a,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=PH(r),o=EH(),a=EH(),i="";for(this.divRemTo(n,o,a);o.signum()>0;)i=(r+a.intValue()).toString(e).substr(1)+i,o.divRemTo(n,o,a);return a.intValue().toString(e)+i},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),o=Math.pow(r,n),a=!1,i=0,s=0,c=0;c<t.length;++c){var u=IH(t,c);u<0?"-"==t.charAt(c)&&0==this.signum()&&(a=!0):(s=r*s+u,++i>=n&&(this.dMultiply(o),this.dAddOffset(s,0),i=0,s=0))}i>0&&(this.dMultiply(Math.pow(r,i)),this.dAddOffset(s,0)),a&&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),Yq,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=[],a=7&t;o.length=1+(t>>3),r.nextBytes(o),a>0?o[0]&=(1<<a)-1:o[0]=0,this.fromString(o,256)}},e.prototype.bitwiseTo=function(e,t,r){var n,o,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=a;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)>vH.length&&(t=vH.length);for(var a=EH(),i=0;i<t;++i){a.fromInt(vH[Math.floor(Math.random()*vH.length)]);var s=a.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=EH();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 a=r.getLowestSetBit(),i=n.getLowestSetBit();if(i<0)t(r);else{a<i&&(i=a),i>0&&(r.rShiftTo(i,r),n.rShiftTo(i,n));setTimeout((function e(){(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),(a=n.getLowestSetBit())>0&&n.rShiftTo(a,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):(i>0&&n.lShiftTo(i,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),Yq,this),this.isEven()&&this.dAddOffset(1,0);var a=this;setTimeout((function n(){a.dAddOffset(2,0),a.bitLength()>t&&a.subTo(e.ONE.shiftLeft(t-1),a),a.isProbablePrime(r)?setTimeout((function(){o()}),0):setTimeout(n,0)}),0)}else{var i=[],s=7&t;i.length=1+(t>>3),r.nextBytes(i),s>0?i[0]&=(1<<s)-1:i[0]=0,this.fromString(i,256)}},e}(),CH=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}(),wH=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}(),kH=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=EH();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(bH.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=EH();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}(),SH=function(){function e(e){this.m=e,this.r2=EH(),this.q3=EH(),bH.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=EH();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 EH(){return new bH(null)}function BH(e,t){return new bH(e,t)}var _H="undefined"!=typeof navigator;_H&&"Microsoft Internet Explorer"==navigator.appName?(bH.prototype.am=function(e,t,r,n,o,a){for(var i=32767&t,s=t>>15;--a>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*i;o=((c=i*c+((32767&l)<<15)+r[n]+(1073741823&o))>>>30)+(l>>>15)+s*u+(o>>>30),r[n++]=1073741823&c}return o},pH=30):_H&&"Netscape"!=navigator.appName?(bH.prototype.am=function(e,t,r,n,o,a){for(;--a>=0;){var i=t*this[e++]+r[n]+o;o=Math.floor(i/67108864),r[n++]=67108863&i}return o},pH=26):(bH.prototype.am=function(e,t,r,n,o,a){for(var i=16383&t,s=t>>14;--a>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*i;o=((c=i*c+((16383&l)<<14)+r[n]+o)>>28)+(l>>14)+s*u,r[n++]=268435455&c}return o},pH=28),bH.prototype.DB=pH,bH.prototype.DM=(1<<pH)-1,bH.prototype.DV=1<<pH,bH.prototype.FV=Math.pow(2,52),bH.prototype.F1=52-pH,bH.prototype.F2=2*pH-52;var xH,TH,AH=[];for(xH="0".charCodeAt(0),TH=0;TH<=9;++TH)AH[xH++]=TH;for(xH="a".charCodeAt(0),TH=10;TH<36;++TH)AH[xH++]=TH;for(xH="A".charCodeAt(0),TH=10;TH<36;++TH)AH[xH++]=TH;function IH(e,t){var r=AH[e.charCodeAt(t)];return null==r?-1:r}function PH(e){var t=EH();return t.fromInt(e),t}function RH(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}bH.ZERO=PH(0),bH.ONE=PH(1);var DH,NH,OH=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}(),LH=null;if(null==LH){LH=[],NH=0;var MH=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var FH=new Uint32Array(256);for(window.crypto.getRandomValues(FH),MH=0;MH<FH.length;++MH)LH[NH++]=255&FH[MH]}var UH=0,jH=function e(t){if((UH=UH||0)>=256||NH>=256)window.removeEventListener?window.removeEventListener("mousemove",e,!1):window.detachEvent&&window.detachEvent("onmousemove",e);else try{var r=t.x+t.y;LH[NH++]=255&r,UH+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",jH,!1):window.attachEvent&&window.attachEvent("onmousemove",jH))}function VH(){if(null==DH){for(DH=new OH;NH<256;){var e=Math.floor(65536*Math.random());LH[NH++]=255&e}for(DH.init(LH),NH=0;NH<LH.length;++NH)LH[NH]=0;NH=0}return DH.next()}var zH=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=VH()},e}(),qH=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=BH(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 a=new zH,i=[];t>2;){for(i[0]=0;0==i[0];)a.nextBytes(i);r[--t]=i[0]}return r[--t]=2,r[--t]=0,new bH(r)}(e,t);if(null==r)return null;var n=this.doPublic(r);if(null==n)return null;for(var o=n.toString(16),a=o.length,i=0;i<2*t-a;i++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,r){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=BH(e,16),this.e=parseInt(t,16),this.d=BH(r,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,r,n,o,a,i,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=BH(e,16),this.e=parseInt(t,16),this.d=BH(r,16),this.p=BH(n,16),this.q=BH(o,16),this.dmp1=BH(a,16),this.dmq1=BH(i,16),this.coeff=BH(s,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var r=new zH,n=e>>1;this.e=parseInt(t,16);for(var o=new bH(t,16);;){for(;this.p=new bH(e-n,1,r),0!=this.p.subtract(bH.ONE).gcd(o).compareTo(bH.ONE)||!this.p.isProbablePrime(10););for(;this.q=new bH(n,1,r),0!=this.q.subtract(bH.ONE).gcd(o).compareTo(bH.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var i=this.p.subtract(bH.ONE),s=this.q.subtract(bH.ONE),c=i.multiply(s);if(0==c.gcd(o).compareTo(bH.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(c),this.dmp1=this.d.mod(i),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=BH(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 a=255&r[n];a<128?o+=String.fromCharCode(a):a>191&&a<224?(o+=String.fromCharCode((31&a)<<6|63&r[n+1]),++n):(o+=String.fromCharCode((15&a)<<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 zH,o=e>>1;this.e=parseInt(t,16);var a=new bH(t,16),i=this;setTimeout((function t(){var s=function(){if(i.p.compareTo(i.q)<=0){var e=i.p;i.p=i.q,i.q=e}var n=i.p.subtract(bH.ONE),o=i.q.subtract(bH.ONE),s=n.multiply(o);0==s.gcd(a).compareTo(bH.ONE)?(i.n=i.p.multiply(i.q),i.d=a.modInverse(s),i.dmp1=i.d.mod(n),i.dmq1=i.d.mod(o),i.coeff=i.q.modInverse(i.p),setTimeout((function(){r()}),0)):setTimeout(t,0)},c=function e(){i.q=EH(),i.q.fromNumberAsync(o,1,n,(function(){i.q.subtract(bH.ONE).gcda(a,(function(t){0==t.compareTo(bH.ONE)&&i.q.isProbablePrime(10)?setTimeout(s,0):setTimeout(e,0)}))}))};setTimeout((function t(){i.p=EH(),i.p.fromNumberAsync(e-o,1,n,(function(){i.p.subtract(bH.ONE).gcda(a,(function(e){0==e.compareTo(bH.ONE)&&i.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 BH("0001"+n+"00"+e,16)}((HH[r]||"")+t(e).toString(),this.n.bitLength()/4);if(null==n)return null;var o=this.doPrivate(n);if(null==o)return null;var a=o.toString(16);return 0==(1&a.length)?a:"0"+a},e.prototype.verify=function(e,t,r){var n=BH(t,16),o=this.doPublic(n);return null==o?null:function(e){for(var t in HH)if(HH.hasOwnProperty(t)){var r=HH[t],n=r.length;if(e.substr(0,n)==r)return e.substr(n)}return e}
|
46
|
+
/*!
|
47
|
+
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
|
48
|
+
Code licensed under the BSD License:
|
49
|
+
http://developer.yahoo.com/yui/license.html
|
50
|
+
version: 2.9.0
|
51
|
+
*/(o.toString(16).replace(/^1f+00/,""))==r(e).toString()},e}(),HH={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"},KH={};KH.lang={extend:function(e,t,r){if(!t||!e)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var n=function(){};if(n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t),r){var o;for(o in r)e.prototype[o]=r[o];var a=function(){},i=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(a=function(e,t){for(o=0;o<i.length;o+=1){var r=i[o],n=t[r];"function"==typeof n&&n!=Object.prototype[r]&&(e[r]=n)}})}catch(e){}a(e.prototype,r)}}};
|
52
|
+
/**
|
53
|
+
* @fileOverview
|
54
|
+
* @name asn1-1.0.js
|
55
|
+
* @author Kenji Urushima kenji.urushima@gmail.com
|
56
|
+
* @version asn1 1.0.13 (2017-Jun-02)
|
57
|
+
* @since jsrsasign 2.1
|
58
|
+
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
59
|
+
*/
|
60
|
+
var WH={};void 0!==WH.asn1&&WH.asn1||(WH.asn1={}),WH.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 bH(n,16).xor(e).add(bH.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=WH.asn1,r=t.DERBoolean,n=t.DERInteger,o=t.DERBitString,a=t.DEROctetString,i=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,C=Object.keys(e);if(1!=C.length)throw"key of param shall be only one.";var w=C[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":"))throw"undefined key: "+w;if("bool"==w)return new r(e[w]);if("int"==w)return new n(e[w]);if("bitstr"==w)return new o(e[w]);if("octstr"==w)return new a(e[w]);if("null"==w)return new i(e[w]);if("oid"==w)return new s(e[w]);if("enum"==w)return new c(e[w]);if("utf8str"==w)return new u(e[w]);if("numstr"==w)return new l(e[w]);if("prnstr"==w)return new d(e[w]);if("telstr"==w)return new f(e[w]);if("ia5str"==w)return new p(e[w]);if("utctime"==w)return new h(e[w]);if("gentime"==w)return new m(e[w]);if("seq"==w){for(var k=e[w],S=[],E=0;E<k.length;E++){var B=b(k[E]);S.push(B)}return new g({array:S})}if("set"==w){for(k=e[w],S=[],E=0;E<k.length;E++)B=b(k[E]),S.push(B);return new v({array:S})}if("tag"==w){var _=e[w];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()}},WH.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 a=("00000000"+parseInt(e.substr(o,2),16).toString(2)).slice(-8);n+=a.substr(1,7),"0"==a.substr(0,1)&&(t=t+"."+new bH(n,2).toString(10),n="")}return t},WH.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 bH(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var a="",i=0;i<o;i++)a+="0";for(n=a+n,i=0;i<n.length-1;i+=7){var s=n.substr(i,7);i!=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("."),a=40*parseInt(o[0])+parseInt(o[1]);n+=t(a),o.splice(0,2);for(var i=0;i<o.length;i++)n+=r(o[i]);return n},WH.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""}},WH.asn1.DERAbstractString=function(e){WH.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))},KH.lang.extend(WH.asn1.DERAbstractString,WH.asn1.ASN1Object),WH.asn1.DERAbstractTime=function(e){WH.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),a=String(o.getFullYear());"utc"==t&&(a=a.substr(2,2));var i=a+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);i=i+"."+(c=c.replace(/[0]+$/,""))}}return i+"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,a){var i=new Date(Date.UTC(e,t-1,r,n,o,a,0));this.setByDate(i)},this.getFreshValueHex=function(){return this.hV}},KH.lang.extend(WH.asn1.DERAbstractTime,WH.asn1.ASN1Object),WH.asn1.DERAbstractStructured=function(e){WH.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)},KH.lang.extend(WH.asn1.DERAbstractStructured,WH.asn1.ASN1Object),WH.asn1.DERBoolean=function(){WH.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},KH.lang.extend(WH.asn1.DERBoolean,WH.asn1.ASN1Object),WH.asn1.DERInteger=function(e){WH.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=WH.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bH(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))},KH.lang.extend(WH.asn1.DERInteger,WH.asn1.ASN1Object),WH.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=WH.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}WH.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),a=parseInt(o,2).toString(16);1==a.length&&(a="0"+a),n+=a}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))},KH.lang.extend(WH.asn1.DERBitString,WH.asn1.ASN1Object),WH.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=WH.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}WH.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},KH.lang.extend(WH.asn1.DEROctetString,WH.asn1.DERAbstractString),WH.asn1.DERNull=function(){WH.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},KH.lang.extend(WH.asn1.DERNull,WH.asn1.ASN1Object),WH.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 bH(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var a="",i=0;i<o;i++)a+="0";for(n=a+n,i=0;i<n.length-1;i+=7){var s=n.substr(i,7);i!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};WH.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("."),a=40*parseInt(o[0])+parseInt(o[1]);n+=t(a),o.splice(0,2);for(var i=0;i<o.length;i++)n+=r(o[i]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var t=WH.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))},KH.lang.extend(WH.asn1.DERObjectIdentifier,WH.asn1.ASN1Object),WH.asn1.DEREnumerated=function(e){WH.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=WH.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bH(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))},KH.lang.extend(WH.asn1.DEREnumerated,WH.asn1.ASN1Object),WH.asn1.DERUTF8String=function(e){WH.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},KH.lang.extend(WH.asn1.DERUTF8String,WH.asn1.DERAbstractString),WH.asn1.DERNumericString=function(e){WH.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},KH.lang.extend(WH.asn1.DERNumericString,WH.asn1.DERAbstractString),WH.asn1.DERPrintableString=function(e){WH.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},KH.lang.extend(WH.asn1.DERPrintableString,WH.asn1.DERAbstractString),WH.asn1.DERTeletexString=function(e){WH.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},KH.lang.extend(WH.asn1.DERTeletexString,WH.asn1.DERAbstractString),WH.asn1.DERIA5String=function(e){WH.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},KH.lang.extend(WH.asn1.DERIA5String,WH.asn1.DERAbstractString),WH.asn1.DERUTCTime=function(e){WH.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))},KH.lang.extend(WH.asn1.DERUTCTime,WH.asn1.DERAbstractTime),WH.asn1.DERGeneralizedTime=function(e){WH.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))},KH.lang.extend(WH.asn1.DERGeneralizedTime,WH.asn1.DERAbstractTime),WH.asn1.DERSequence=function(e){WH.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}},KH.lang.extend(WH.asn1.DERSequence,WH.asn1.DERAbstractStructured),WH.asn1.DERSet=function(e){WH.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)},KH.lang.extend(WH.asn1.DERSet,WH.asn1.DERAbstractStructured),WH.asn1.DERTaggedObject=function(e){WH.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)))},KH.lang.extend(WH.asn1.DERTaggedObject,WH.asn1.ASN1Object);var QH,GH,XH,YH,$H=(QH=function(e,t){return(QH=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}QH(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ZH=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 $H(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)?iH(e):sH.unarmor(e),o=mH.decode(n);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=BH(t,16),r=o.sub[2].getHexStringValue(),this.e=parseInt(r,16);var a=o.sub[3].getHexStringValue();this.d=BH(a,16);var i=o.sub[4].getHexStringValue();this.p=BH(i,16);var s=o.sub[5].getHexStringValue();this.q=BH(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=BH(c,16);var u=o.sub[7].getHexStringValue();this.dmq1=BH(u,16);var l=o.sub[8].getHexStringValue();this.coeff=BH(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=BH(t,16),r=d.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=o.sub[0].getHexStringValue(),this.n=BH(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 WH.asn1.DERInteger({int:0}),new WH.asn1.DERInteger({bigint:this.n}),new WH.asn1.DERInteger({int:this.e}),new WH.asn1.DERInteger({bigint:this.d}),new WH.asn1.DERInteger({bigint:this.p}),new WH.asn1.DERInteger({bigint:this.q}),new WH.asn1.DERInteger({bigint:this.dmp1}),new WH.asn1.DERInteger({bigint:this.dmq1}),new WH.asn1.DERInteger({bigint:this.coeff})]};return new WH.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return nH(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new WH.asn1.DERSequence({array:[new WH.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new WH.asn1.DERNull]}),t=new WH.asn1.DERSequence({array:[new WH.asn1.DERInteger({bigint:this.n}),new WH.asn1.DERInteger({int:this.e})]}),r=new WH.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new WH.asn1.DERSequence({array:[e,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return nH(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}(qH),JH=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 ZH(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(oH(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return nH(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,t,r){try{return nH(this.getKey().sign(e,t,r))}catch(e){return!1}},e.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,oH(t),r)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new ZH,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}(),eK=function(e,t,r,n){if(!aM(e))return e;for(var o=-1,a=(t=UU(t,e)).length,i=a-1,s=e;null!=s&&++o<a;){var c=VU(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=i){var l=s[c];void 0===(u=n?n(l,c,s):void 0)&&(u=aM(l)?l:sF(t[o+1])?[]:{})}GM(s,c,u),s=s[c]}return e},tK=function(e,t,r){return null==e?e:eK(e,t,r)},rK=["-","-","-","-","-","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","-","-","-","-","-"],nK={},oK={SELFIE:"selfie",ID_CARD:"id_card"},aK=Nq((function(e){var t=new JH,r=e||rK.join("");return t.setPublicKey(r),t})),iK=function(e){var t=e.gesture;return{capture_time:e.captureTime,type:t,frames:e.frames}},sK=function(e){var t=e.detectedCard,r=e.captureTime,n=e.vCam,o=e.captureCount,a=e.captureDuration,i=e.captureType,s=e.cardTracking;return{capture_time:r,type:null==t?void 0:t.label,v_cam:n,capture_count:o,capture_duration:a,capture_type:i,card_tracking:s}},cK=function(){var e=dL(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 wL(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,a=o.encode(t),i=o.encode(r);window.crypto.subtle.importKey("raw",i,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,a).then((function(t){e("".concat(YH,".").concat(n(t)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),uK=function(){var e=dL(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0: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 a=yL(yL({},nK),n===oK.SELFIE?iK(o):sK(o)),i=yL(yL({},a),{},{sensor_data:"sensor data exceed 64KB"}),null!=o&&null!==(r=o.type)&&void 0!==r&&r.includes("qr")&&(a={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,cK(JSON.stringify(i),XH);case 8:return s=e.sent,e.next=11,cK(JSON.stringify(a),XH);case 11:return c=e.sent,u=Qq.dump({Exif:mL({},Qq.ExifIFD.MakerNote,c)}),l=Qq.dump({Exif:mL({},Qq.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var t=new FileReader;t.onload=function(){var t=dL(regeneratorRuntime.mark((function t(r){var n,a,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{n=Qq.insert(u,r.target.result)}catch(t){try{n=Qq.insert(l,r.target.result)}catch(t){e(o.blob)}}return t.prev=1,t.next=4,fetch(n);case 4:return a=t.sent,t.next=7,a.blob();case 7:i=t.sent,URL.revokeObjectURL(n),e(i),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(1),e(o.blob);case 15:case"end":return t.stop()}}),t,null,[[1,12]])})));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)}}(),lK=Object.freeze({__proto__:null,MODE:oK,initExifData:function(){nK={device_info:{device_brand_name:"".concat("none"===Aj.mobileVendor?"null":Aj.mobileVendor),device_model:"".concat("none"===Aj.mobileModel?"null":Aj.mobileModel),browser_version:"".concat(Aj.browserName," ").concat(Aj.browserVersion),browser_userAgent:"".concat(Aj.getUA),os:Aj.osName,os_version:Aj.osVersion},sdk_version:"5.16.1",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,t){tK(nK,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,o=e.exifKey,a=void 0===o?"":o;nK.user_action=yL({},t===oK.SELFIE?{start_selfie:r,end_selfie:n}:{start_id_card:r,end_id_card:n}),XH=xj().replace(/-/g,""),GH||(GH=aK(a)),YH=oH(GH.encrypt(XH))},writeExif:uK}),dK="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",fK=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dK,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],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;fL(this,e),this.model_path=t,this.threshold=r,this.size=Math.round(n/2),this.enable_profiling=o,this.num_threads=a}var t,r;return hL(e,[{key:"load",value:(r=dL(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,Uq({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)})),a=t[1].map((function(e){return Math.round(e)}));o[0]>a[0]&&(o=t[1].map((function(e){return Math.round(e)})),a=t[0].map((function(e){return Math.round(e)})));var i=Math.round((o[0]+a[0])/2),s=i-o[0],c=a[0]-i;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(a[0]-c,0),f=Math.max(a[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=dL(regeneratorRuntime.mark((function e(t,r){var n,o,a,i,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,a=o.tf,i=t.getContext("2d"),s=i.getImageData(0,0,t.height,t.width),c=a.tidy((function(){var e=a.browser.fromPixels(s),t=f.crop_eyes(e,r),o=t.l_img,i=t.r_img,c=f.model.predict(o).arraySync()[0],u=f.model.predict(i).arraySync()[0];return[c>n,u>n]})),u=CL(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}(),pK=function(){var e=dL(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 hK(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,r=void 0===t?100:t,n=xC.useRef([]),o=xC.useRef([]),a=(xC.useRef(!1),xC.useRef({})),i=xC.useCallback((function(e){var t=Date.now(),n=e.type;return!!(a.current[n]&&t-a.current[n]<r)||(a.current[n]=t,!1)}),[r]),s=xC.useCallback((function(e){i(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})}),[i]),c=xC.useCallback((function(e){var t,r,o,a,s,c;i(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===(a=e.rotationRate)||void 0===a?void 0:a.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}})}),[i]),u=xC.useCallback((function(){}),[c,s]),l=xC.useCallback((function(){}),[c,s]);return xC.useEffect((function(){return function(){l()}}),[l]),{motionData:n.current,orientationData:o.current,startMotion:u,stopMotion:l}}var mK=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']))},gK=function(e,t,r,n,o,a,i,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,a,i,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},vK=Pj(),yK=function(){function e(t){var r=this,n=t.container,o=t.lang,a=void 0===o?"vi":o,i=t.assetRoot,s=void 0===i?"https://unpkg.com/@tsocial/tvweb-sdk@beta/assets":i,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,v=t.country,y=void 0===v?"vn":v,b=t.idCardContext,C=t.simplifyIntegration,w=void 0===C?{}:C,k=t.exifKey,S=void 0===k?"":k;fL(this,e),mL(this,"initNativeCamera",(function(e){var t=document.createElement("div");document.body.appendChild(t);var n=xC.createRef(),o=r.component.NativeCamera;return iL.render(xC.createElement(o,gL({},e,{ref:n})),t),{openCamera:function(){n.current.click()}}})),mL(this,"runWarmUpReadIDCard",dL(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)})))),mL(this,"runPreloadEKYCResources",dL(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)})))),mL(this,"destroyView",(function(){iL.unmountComponentAtNode(r.container)})),gK(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var E=pj({resourceRoot:c,initCustomUrls:l,country:y});this.simplifyIntegration=w,this.commonSettings=yL({lang:a,assetRoot:s,customUrls:E,enableAntiDebug:f,debug:!1,warmupMessage:p,country:y,exifKey:S},b),this.component=yL(yL({},h),g)}return hL(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;iL.render(xC.createElement(mj,{value:yL({},this.commonSettings)},xC.createElement(t,gL({onClose:this.destroyView},e))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var t=this.component.ReadIDCardUIOnly;iL.render(xC.createElement(mj,{value:this.commonSettings},xC.createElement(t,gL({onClose:this.destroyView},e))),this.container)}},{key:"livenessDetection",value:function(e){var t=this.component.LivenessDetection;iL.render(xC.createElement(mj,{value:yL({},this.commonSettings)},xC.createElement(t,gL({onClose:this.destroyView},e))),this.container)}},{key:"ekycFlow",value:function(e){var t=this.component.EkycFlow;iL.render(xC.createElement(mj,{value:yL({},this.commonSettings)},xC.createElement(t,gL({onClose:this.destroyView},e))),this.container)}},{key:"compareFaces",value:function(e){var t=e.accessKey,r=e.secretKey,n=e.apiUrl,o=e.image1,a=e.image2,i=e.onSuccess,s=e.onError;dq(new Cj(t,r,n,{httpHeaders:vK})).compareFaces({image1:{id:o},image2:{id:a}}).then((function(e){i(e)})).catch((function(e){s(e)}))}}]),e}(),bK=Pj(),CK=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(fL(this,e),t&&r&&n){var o=Gj({userId:""});this.apiClient=dq(new Cj(t,r,n,{httpHeaders:yL(yL({},bK),{},{"x-request-id":o})}))}else this.apiClient=null;this.clientSettings=this.clientSettings.bind(this),this.uploadImage=this.uploadImage.bind(this),this.uploadFiles=this.uploadFiles.bind(this),this.requestVerifyIDCard=this.requestVerifyIDCard.bind(this),this.detectIDTampering=this.detectIDTampering.bind(this),this.readIDCard=this.readIDCard.bind(this),this.requestVerifyPortrait=this.requestVerifyPortrait.bind(this),this.verifyFaceLiveness=this.verifyFaceLiveness.bind(this),this.compareFaces=this.compareFaces.bind(this),this.searchFaces=this.searchFaces.bind(this),this.indexFaces=this.indexFaces.bind(this)}var t,r,n,o,a,i,s,c,u,l,d;return hL(e,[{key:"clientSettings",value:(d=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.clientSettings(t);case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"uploadImage",value:(l=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.uploadImage(t);case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"uploadFiles",value:(u=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.fileService.request(t);case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"requestVerifyIDCard",value:(c=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.requestVerifyIDCard(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"detectIDTampering",value:(s=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.detectIDTampering(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"readIDCard",value:(i=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.readIDCard(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"requestVerifyPortrait",value:(a=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.requestVerifyPortrait(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"verifyFaceLiveness",value:(o=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.verifyFaceLiveness(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"compareFaces",value:(n=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.compareFaces(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"searchFaces",value:(r=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.searchFaces(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"indexFaces",value:(t=dL(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.indexFaces(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function wK(e){return(wK="function"==typeof Symbol&&"symbol"==By(Symbol.iterator)?function(e){return By(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":By(e)})(e)}function kK(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function SK(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){kK(a,n,o,i,s,"next",e)}function s(e){kK(a,n,o,i,s,"throw",e)}i(void 0)}))}}function EK(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 BK(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _K(){return(_K=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 xK(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 TK(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xK(Object(r),!0).forEach((function(t){BK(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xK(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function AK(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function IK(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function PK(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,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw a}}return r}}(e,t)||DK(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 RK(e){return function(e){if(Array.isArray(e))return NK(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||DK(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 DK(e,t){if(e){if("string"==typeof e)return NK(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)?NK(e,t):void 0}}function NK(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}function OK(){return(OK=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 LK(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function MK(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function FK(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var UK=!1,jK=xC.createContext(null),VK="entering",zK="entered",qK=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var o,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(o="exited",n.appearStatus=VK):o=zK:o=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",n.state={status:o},n.nextCallback=null,n}MK(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==VK&&r!==zK&&(t=VK):r!==VK&&r!==zK||(t="exiting")}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},r.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===VK?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,o=this.props.nodeRef?[n]:[iL.findDOMNode(this),n],a=o[0],i=o[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!r||UK?this.safeSetState({status:zK},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,i),this.safeSetState({status:VK},(function(){t.props.onEntering(a,i),t.onTransitionEnd(c,(function(){t.safeSetState({status:zK},(function(){t.props.onEntered(a,i)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:iL.findDOMNode(this);t&&!UK?(this.props.onExit(n),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:iL.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=o[0],i=o[1];this.props.addEndListener(a,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,r=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,LK(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return xC.createElement(jK.Provider,{value:null},"function"==typeof r?r(e,n):xC.cloneElement(xC.Children.only(r),n))},t}(xC.Component);function HK(){}qK.contextType=jK,qK.propTypes={},qK.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:HK,onEntering:HK,onEntered:HK,onExit:HK,onExiting:HK,onExited:HK},qK.UNMOUNTED="unmounted",qK.EXITED="exited",qK.ENTERING=VK,qK.ENTERED=zK,qK.EXITING="exiting";var KK,WK,QK=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(r,n)||("string"==typeof r.className?r.className=r.className+" "+n:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+n)));var r,n}))},GK=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.remove(n):"string"==typeof r.className?r.className=FK(r.className,n):r.setAttribute("class",FK(r.className&&r.className.baseVal||"",n)));var r,n}))},XK=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1];t.removeClasses(o,"exit"),t.addClass(o,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1]?"appear":"enter";t.addClass(o,a,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1]?"appear":"enter";t.removeClasses(o,a),t.addClass(o,a,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,o=n?(n&&r?r+"-":"")+e:r[e];return{baseClassName:o,activeClassName:n?o+"-active":r[e+"Active"],doneClassName:n?o+"-done":r[e+"Done"]}},t}MK(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,QK(e,n))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,o=r.active,a=r.done;this.appliedClasses[t]={},n&&GK(e,n),o&&GK(e,o),a&&GK(e,a)},r.render=function(){var e=this.props,t=(e.classNames,LK(e,["classNames"]));return xC.createElement(qK,OK({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(xC.Component);XK.defaultProps={classNames:""},XK.propTypes={};var YK="out-in",$K="in-out",ZK=function(e,t,r){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),r()}},JK=((KK={})[YK]=function(e){var t=e.current,r=e.changeState;return xC.cloneElement(t,{in:!1,onExited:ZK(t,"onExited",(function(){r(VK,null)}))})},KK[$K]=function(e){var t=e.current,r=e.changeState,n=e.children;return[t,xC.cloneElement(n,{in:!0,onEntered:ZK(n,"onEntered",(function(){r(VK)}))})]},KK),eW=((WK={})[YK]=function(e){var t=e.children,r=e.changeState;return xC.cloneElement(t,{in:!0,onEntered:ZK(t,"onEntered",(function(){r(zK,xC.cloneElement(t,{in:!0}))}))})},WK[$K]=function(e){var t=e.current,r=e.children,n=e.changeState;return[xC.cloneElement(t,{in:!1,onExited:ZK(t,"onExited",(function(){n(zK,xC.cloneElement(r,{in:!0}))}))}),xC.cloneElement(r,{in:!0})]},WK),tW=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:zK,current:null},t.appeared=!1,t.changeState=function(e,r){void 0===r&&(r=t.state.current),t.setState({status:e,current:r})},t}MK(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===VK&&e.mode===$K?{status:VK}:!t.current||((r=t.current)===(n=e.children)||xC.isValidElement(r)&&xC.isValidElement(n)&&null!=r.key&&r.key===n.key)?{current:xC.cloneElement(e.children,{in:!0})}:{status:"exiting"};var r,n},r.render=function(){var e,t=this.props,r=t.children,n=t.mode,o=this.state,a=o.status,i=o.current,s={children:r,current:i,changeState:this.changeState,status:a};switch(a){case VK:e=eW[n](s);break;case"exiting":e=JK[n](s);break;case zK:e=i}return xC.createElement(jK.Provider,{value:{isMounting:!this.appeared}},e)},t}(xC.Component);tW.propTypes={},tW.defaultProps={mode:YK};var rW="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function nW(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oW(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 aW,iW=oW((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),a=r(0),i=a.BROWSER_TYPES,s=a.OS_TYPES,c=a.DEVICE_TYPES,u=r(4),l=u.checkType,d=u.broPayload,f=u.mobilePayload,p=u.wearPayload,h=u.consolePayload,m=u.stvPayload,g=u.getNavigatorInstance,v=u.isIOS13Check,y=new o,b=y.getBrowser(),C=y.getDevice(),w=y.getEngine(),k=y.getOS(),S=y.getUA(),E=i.CHROME,B=i.CHROMIUM,_=i.IE,x=i.INTERNET_EXPLORER,T=i.OPERA,A=i.FIREFOX,I=i.SAFARI,P=i.EDGE,R=i.YANDEX,D=i.MOBILE_SAFARI,N=c.MOBILE,O=c.TABLET,L=c.SMART_TV,M=c.BROWSER,F=c.WEARABLE,U=c.CONSOLE,j=s.ANDROID,V=s.WINDOWS_PHONE,z=s.IOS,q=s.WINDOWS,H=s.MAC_OS,K=function(){return k.name===s.WINDOWS&&"10"===k.version&&"string"==typeof S&&-1!==S.indexOf("Edg/")},W=function(){return b.name===P},Q=function(){return v("iPad")},G=C.type===L,X=C.type===U,Y=C.type===F,$=b.name===D||Q(),Z=b.name===B,J=function(){switch(C.type){case N:case O:return!0;default:return!1}}()||Q(),ee=C.type===N,te=C.type===O||Q(),re=C.type===M,ne=k.name===j,oe=k.name===V,ae=k.name===z||Q(),ie=b.name===E,se=b.name===A,ce=b.name===I||b.name===D,ue=b.name===T,le=b.name===x||b.name===_,de=k.version?k.version:"none",fe=k.name?k.name:"none",pe=b.major,he=b.version,me=b.name,ge=C.vendor?C.vendor:"none",ve=C.model?C.model:"none",ye=w.name,be=w.version,Ce=S,we=W()||K(),ke=b.name===R,Se=C.type,Ee=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Be=Q(),_e=v("iPhone"),xe=v("iPod"),Te=function(){var e=g(),t=e&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)}(),Ae=K(),Ie=W(),Pe=k.name===q,Re=k.name===H,De=l(C.type);e.exports={deviceDetect:function(){var e=De.isBrowser,t=De.isMobile,r=De.isTablet,n=De.isSmartTV,o=De.isConsole,a=De.isWearable;return e?d(e,b,w,k,S):n?m(n,w,k,S):o?h(o,w,k,S):t||r?f(De,C,k,S):a?p(a,w,k,S):void 0},isSmartTV:G,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ae,isChrome:ie,isFirefox:se,isSafari:ce,isOpera:ue,isIE:le,osVersion:de,osName:fe,fullBrowserVersion:pe,browserVersion:he,browserName:me,mobileVendor:ge,mobileModel:ve,engineName:ye,engineVersion:be,getUA:Ce,isEdge:we,isYandex:ke,deviceType:Se,isIOS13:Ee,isIPad13:Be,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Ie,isWindows:Pe,isMacOs:Re}},function(e,t,r){var n;
|
61
|
+
/*!
|
62
|
+
* UAParser.js v0.7.18
|
63
|
+
* Lightweight JavaScript-based User-Agent string parser
|
64
|
+
* https://github.com/faisalman/ua-parser-js
|
65
|
+
*
|
66
|
+
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
|
67
|
+
* Dual licensed under GPLv2 or MIT
|
68
|
+
*/!function(o,a){var i="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",m="console",g="mobile",v="tablet",y="smarttv",b="wearable",C={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:a},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},w={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],By(s=p[o])===c&&s.length>0?2==s.length?By(s[1])==i?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?By(s[1])!==i||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):a:this[s[0]]=l?s[1].call(this,l,s[2]):a:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):a):this[s]=l||a;d+=2}},str:function(e,t){for(var r in t)if(By(t[r])===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(C.has(t[r][n],e))return"?"===r?a:r}else if(C.has(t[r],e))return"?"===r?a:r;return e}},k={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"}}}},S={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,w.str,k.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,C.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",C.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,C.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,w.str,k.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,w.str,k.device.sprint.vendor],[u,w.str,k.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,C.trim],[u,C.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,C.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,w.str,k.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,w.str,k.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]]},E=function e(t,r){if("object"==By(t)&&(r=t,t=a),!(this instanceof e))return new e(t,r).getResult();var n=t||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),i=r?C.extend(S,r):S;return this.getBrowser=function(){var e={name:a,version:a};return w.rgx.call(e,n,i.browser),e.major=C.major(e.version),e},this.getCPU=function(){var e={architecture:a};return w.rgx.call(e,n,i.cpu),e},this.getDevice=function(){var e={vendor:a,model:a,type:a};return w.rgx.call(e,n,i.device),e},this.getEngine=function(){var e={name:a,version:a};return w.rgx.call(e,n,i.engine),e},this.getOS=function(){var e={name:a,version:a};return w.rgx.call(e,n,i.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};E.VERSION="0.7.18",E.BROWSER={NAME:l,MAJOR:"major",VERSION:p},E.CPU={ARCHITECTURE:h},E.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:m,MOBILE:g,SMARTTV:y,TABLET:v,WEARABLE:b,EMBEDDED:"embedded"},E.ENGINE={NAME:l,VERSION:p},E.OS={NAME:l,VERSION:p},By(t)!==s?(By(e)!==s&&e.exports&&(t=e.exports=E),t.UAParser=E):r(3)?(n=function(){return E}.call(t,r,t,e))===a||(e.exports=n):o&&(o.UAParser=E);var B=o&&(o.jQuery||o.Zepto);if(By(B)!==s){var _=new E;B.ua=_.getResult(),B.ua.get=function(){return _.getUA()},B.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":By(window))?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),a=o.DEVICE_TYPES,i=o.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case a.MOBILE:return{isMobile:!0};case a.TABLET:return{isTablet:!0};case a.SMART_TV:return{isSmartTV:!0};case a.CONSOLE:return{isConsole:!0};case a.WEARABLE:return{isWearable:!0};case a.BROWSER:return{isBrowser:!0};default:return i}},broPayload:function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:o}},mobilePayload:function(e,t,r,o){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:o})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])})),sW="object"==By(rW)&&rW&&rW.Object===Object&&rW,cW="object"==("undefined"==typeof self?"undefined":By(self))&&self&&self.Object===Object&&self,uW=sW||cW||Function("return this")(),lW=uW.Symbol,dW=Object.prototype,fW=dW.hasOwnProperty,pW=dW.toString,hW=lW?lW.toStringTag:void 0,mW=function(e){var t=fW.call(e,hW),r=e[hW];try{e[hW]=void 0;var n=!0}catch(e){}var o=pW.call(e);return n&&(t?e[hW]=r:delete e[hW]),o},gW=Object.prototype.toString,vW=function(e){return gW.call(e)},yW=lW?lW.toStringTag:void 0,bW=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":yW&&yW in Object(e)?mW(e):vW(e)},CW=function(e){var t=By(e);return null!=e&&("object"==t||"function"==t)},wW=function(e){if(!CW(e))return!1;var t=bW(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},kW=uW["__core-js_shared__"],SW=(aW=/[^.]+$/.exec(kW&&kW.keys&&kW.keys.IE_PROTO||""))?"Symbol(src)_1."+aW:"",EW=function(e){return!!SW&&SW in e},BW=Function.prototype.toString,_W=function(e){if(null!=e){try{return BW.call(e)}catch(e){}try{return e+""}catch(e){}}return""},xW=/^\[object .+?Constructor\]$/,TW=Function.prototype,AW=Object.prototype,IW=TW.toString,PW=AW.hasOwnProperty,RW=RegExp("^"+IW.call(PW).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),DW=function(e){return!(!CW(e)||EW(e))&&(wW(e)?RW:xW).test(_W(e))},NW=function(e,t){return null==e?void 0:e[t]},OW=function(e,t){var r=NW(e,t);return DW(r)?r:void 0},LW=function(){try{var e=OW(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),MW=function(e,t,r){"__proto__"==t&&LW?LW(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},FW=function(e,t){return e===t||e!=e&&t!=t},UW=Object.prototype.hasOwnProperty,jW=function(e,t,r){var n=e[t];UW.call(e,t)&&FW(n,r)&&(void 0!==r||t in e)||MW(e,t,r)},VW=function(e,t,r,n){var o=!r;r||(r={});for(var a=-1,i=t.length;++a<i;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?MW(r,s,c):jW(r,s,c)}return r},zW=function(e){return e},qW=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},HW=Math.max,KW=function(e,t,r){return t=HW(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=HW(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),qW(e,this,s)}},WW=function(e){return function(){return e}},QW=LW?function(e,t){return LW(e,"toString",{configurable:!0,enumerable:!1,value:WW(t),writable:!0})}:zW,GW=Date.now,XW=function(e){var t=0,r=0;return function(){var n=GW(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(QW),YW=function(e,t){return XW(KW(e,t,zW),e+"")},$W=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},ZW=function(e){return null!=e&&$W(e.length)&&!wW(e)},JW=/^(?:0|[1-9]\d*)$/,eQ=function(e,t){var r=By(e);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&JW.test(e))&&e>-1&&e%1==0&&e<t},tQ=function(e,t,r){if(!CW(r))return!1;var n=By(t);return!!("number"==n?ZW(r)&&eQ(t,r.length):"string"==n&&t in r)&&FW(r[t],e)},rQ=function(e){return YW((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,i&&tQ(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,a)}return t}))},nQ=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},oQ=function(e){return null!=e&&"object"==By(e)},aQ=function(e){return oQ(e)&&"[object Arguments]"==bW(e)},iQ=Object.prototype,sQ=iQ.hasOwnProperty,cQ=iQ.propertyIsEnumerable,uQ=aQ(function(){return arguments}())?aQ:function(e){return oQ(e)&&sQ.call(e,"callee")&&!cQ.call(e,"callee")},lQ=Array.isArray,dQ=function(){return!1},fQ=oW((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?uW.Buffer:void 0,a=(o?o.isBuffer:void 0)||dQ;e.exports=a})),pQ={};pQ["[object Float32Array]"]=pQ["[object Float64Array]"]=pQ["[object Int8Array]"]=pQ["[object Int16Array]"]=pQ["[object Int32Array]"]=pQ["[object Uint8Array]"]=pQ["[object Uint8ClampedArray]"]=pQ["[object Uint16Array]"]=pQ["[object Uint32Array]"]=!0,pQ["[object Arguments]"]=pQ["[object Array]"]=pQ["[object ArrayBuffer]"]=pQ["[object Boolean]"]=pQ["[object DataView]"]=pQ["[object Date]"]=pQ["[object Error]"]=pQ["[object Function]"]=pQ["[object Map]"]=pQ["[object Number]"]=pQ["[object Object]"]=pQ["[object RegExp]"]=pQ["[object Set]"]=pQ["[object String]"]=pQ["[object WeakMap]"]=!1;var hQ,mQ,gQ=function(e){return oQ(e)&&$W(e.length)&&!!pQ[bW(e)]},vQ=function(e){return function(t){return e(t)}},yQ=oW((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&sW.process,a=function(){try{return n&&n.require&&n.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a})),bQ=yQ&&yQ.isTypedArray,CQ=bQ?vQ(bQ):gQ,wQ=Object.prototype.hasOwnProperty,kQ=function(e,t){var r=lQ(e),n=!r&&uQ(e),o=!r&&!n&&fQ(e),a=!r&&!n&&!o&&CQ(e),i=r||n||o||a,s=i?nQ(e.length,String):[],c=s.length;for(var u in e)!t&&!wQ.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||eQ(u,c))||s.push(u);return s},SQ=Object.prototype,EQ=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||SQ)},BQ=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t},_Q=Object.prototype.hasOwnProperty,xQ=function(e){if(!CW(e))return BQ(e);var t=EQ(e),r=[];for(var n in e)("constructor"!=n||!t&&_Q.call(e,n))&&r.push(n);return r},TQ=function(e){return ZW(e)?kQ(e,!0):xQ(e)},AQ=rQ((function(e,t,r,n){VW(t,TQ(t),e,n)})),IQ=function(e,t){return function(r){return e(t(r))}},PQ=IQ(Object.getPrototypeOf,Object),RQ=Function.prototype,DQ=Object.prototype,NQ=RQ.toString,OQ=DQ.hasOwnProperty,LQ=NQ.call(Object),MQ=function(e){if(!oQ(e)||"[object Object]"!=bW(e))return!1;var t=PQ(e);if(null===t)return!0;var r=OQ.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&NQ.call(r)==LQ},FQ=function(e){if(!oQ(e))return!1;var t=bW(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!MQ(e)},UQ=YW((function(e,t){try{return qW(e,void 0,t)}catch(e){return FQ(e)?e:new Error(e)}})),jQ=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},VQ=function(e,t){return jQ(t,(function(t){return e[t]}))},zQ=Object.prototype,qQ=zQ.hasOwnProperty,HQ=function(e,t,r,n){return void 0===e||FW(e,zQ[r])&&!qQ.call(n,r)?t:e},KQ={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},WQ=function(e){return"\\"+KQ[e]},QQ=IQ(Object.keys,Object),GQ=Object.prototype.hasOwnProperty,XQ=function(e){if(!EQ(e))return QQ(e);var t=[];for(var r in Object(e))GQ.call(e,r)&&"constructor"!=r&&t.push(r);return t},YQ=function(e){return ZW(e)?kQ(e):XQ(e)},$Q=/<%=([\s\S]+?)%>/g,ZQ=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),JQ=function(e){return"symbol"==By(e)||oQ(e)&&"[object Symbol]"==bW(e)},eG=lW?lW.prototype:void 0,tG=eG?eG.toString:void 0,rG=function e(t){if("string"==typeof t)return t;if(lQ(t))return jQ(t,e)+"";if(JQ(t))return tG?tG.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},nG=function(e){return null==e?"":rG(e)},oG=/[&<>"']/g,aG=RegExp(oG.source),iG={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:$Q,variable:"",imports:{_:{escape:function(e){return(e=nG(e))&&aG.test(e)?e.replace(oG,ZQ):e}}}},sG=/\b__p \+= '';/g,cG=/\b(__p \+=) '' \+/g,uG=/(__e\(.*?\)|\b__t\)) \+\n'';/g,lG=/[()=,{}\[\]\/\s]/,dG=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fG=/($^)/,pG=/['\n\r\u2028\u2029\\]/g,hG=Object.prototype.hasOwnProperty,mG=function(e,t,r){var n=iG.imports._.templateSettings||iG;r&&tQ(e,t,r)&&(t=void 0),e=nG(e),t=AQ({},t,n,HQ);var o,a,i=AQ({},t.imports,n.imports,HQ),s=YQ(i),c=VQ(i,s),u=0,l=t.interpolate||fG,d="__p += '",f=RegExp((t.escape||fG).source+"|"+l.source+"|"+(l===$Q?dG:fG).source+"|"+(t.evaluate||fG).source+"|$","g"),p=hG.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,i,s,c){return n||(n=i),d+=e.slice(u,c).replace(pG,WQ),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var h=hG.call(t,"variable")&&t.variable;if(h){if(lG.test(h))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(sG,""):d).replace(cG,"$1").replace(uG,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=UQ((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(m.source=d,FQ(m))throw m;return m},gG=dB.table(hQ||(hQ=IK(["\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"]))),vG=dB.div(mQ||(mQ=IK(["\n position: relative;\n"]))),yG=Array.from(Array(3).keys()),bG=Array.from(Array(3).keys());function CG(e){var t=e.children,r=e.x,n=e.y,o=e.width,a=e.height,i=e.className,s=e.surroundStyle;return xC.createElement(gG,{className:i},xC.createElement("tbody",null,yG.map((function(e,i){return xC.createElement("tr",{key:e,style:{height:0===i?n:"auto"},"data-testid":"row"},bG.map((function(e,n){var c=1===i&&1===n,u="auto";return c?u=o:0===n&&(u=r),xC.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:TK({width:u,height:c?a:"auto"},c?{}:s)},c?xC.createElement(vG,{style:{width:u,height:a}},t):null)})))}))))}CG.propTypes={children:xw.node,x:xw.string,y:xw.string,width:xw.string,height:xw.string,className:xw.string,surroundStyle:xw.object},CG.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var wG=/^\s+|\s+$/g,kG=/^[-+]0x[0-9a-f]+$/i,SG=/^0b[01]+$/i,EG=/^0o[0-7]+$/i,BG=parseInt,_G="object"==By(rW)&&rW&&rW.Object===Object&&rW,xG="object"==("undefined"==typeof self?"undefined":By(self))&&self&&self.Object===Object&&self,TG=_G||xG||Function("return this")(),AG=Object.prototype.toString,IG=Math.max,PG=Math.min,RG=function(){return TG.Date.now()};function DG(e){var t=By(e);return!!e&&("object"==t||"function"==t)}function NG(e){if("number"==typeof e)return e;if(function(e){return"symbol"==By(e)||function(e){return!!e&&"object"==By(e)}(e)&&"[object Symbol]"==AG.call(e)}(e))return NaN;if(DG(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=DG(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(wG,"");var r=SG.test(e);return r||EG.test(e)?BG(e.slice(2),r?2:8):kG.test(e)?NaN:+e}var OG=function(e,t,r){var n,o,a,i,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var r=n,a=o;return n=o=void 0,u=t,i=e.apply(a,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):i}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=a}function g(){var e=RG();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?PG(r,a-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,i)}function y(){var e=RG(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),i}return t=NG(t)||0,DG(r)&&(l=!!r.leading,a=(d="maxWait"in r)?IG(NG(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?i:v(RG())},y},LG="function"==typeof Symbol&&Symbol.for,MG=LG?Symbol.for("react.element"):60103,FG=LG?Symbol.for("react.portal"):60106,UG=LG?Symbol.for("react.fragment"):60107,jG=LG?Symbol.for("react.strict_mode"):60108,VG=LG?Symbol.for("react.profiler"):60114,zG=LG?Symbol.for("react.provider"):60109,qG=LG?Symbol.for("react.context"):60110,HG=LG?Symbol.for("react.async_mode"):60111,KG=LG?Symbol.for("react.concurrent_mode"):60111,WG=LG?Symbol.for("react.forward_ref"):60112,QG=LG?Symbol.for("react.suspense"):60113,GG=LG?Symbol.for("react.suspense_list"):60120,XG=LG?Symbol.for("react.memo"):60115,YG=LG?Symbol.for("react.lazy"):60116,$G=LG?Symbol.for("react.block"):60121,ZG=LG?Symbol.for("react.fundamental"):60117,JG=LG?Symbol.for("react.responder"):60118,eX=LG?Symbol.for("react.scope"):60119;
|
69
|
+
/** @license React v16.13.1
|
70
|
+
* react-is.production.min.js
|
71
|
+
*
|
72
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
73
|
+
*
|
74
|
+
* This source code is licensed under the MIT license found in the
|
75
|
+
* LICENSE file in the root directory of this source tree.
|
76
|
+
*/function tX(e){if("object"==By(e)&&null!==e){var t=e.$$typeof;switch(t){case MG:switch(e=e.type){case HG:case KG:case UG:case VG:case jG:case QG:return e;default:switch(e=e&&e.$$typeof){case qG:case WG:case YG:case XG:case zG:return e;default:return t}}case FG:return t}}}function rX(e){return tX(e)===KG}var nX={AsyncMode:HG,ConcurrentMode:KG,ContextConsumer:qG,ContextProvider:zG,Element:MG,ForwardRef:WG,Fragment:UG,Lazy:YG,Memo:XG,Portal:FG,Profiler:VG,StrictMode:jG,Suspense:QG,isAsyncMode:function(e){return rX(e)||tX(e)===HG},isConcurrentMode:rX,isContextConsumer:function(e){return tX(e)===qG},isContextProvider:function(e){return tX(e)===zG},isElement:function(e){return"object"==By(e)&&null!==e&&e.$$typeof===MG},isForwardRef:function(e){return tX(e)===WG},isFragment:function(e){return tX(e)===UG},isLazy:function(e){return tX(e)===YG},isMemo:function(e){return tX(e)===XG},isPortal:function(e){return tX(e)===FG},isProfiler:function(e){return tX(e)===VG},isStrictMode:function(e){return tX(e)===jG},isSuspense:function(e){return tX(e)===QG},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===UG||e===KG||e===VG||e===jG||e===QG||e===GG||"object"==By(e)&&null!==e&&(e.$$typeof===YG||e.$$typeof===XG||e.$$typeof===zG||e.$$typeof===qG||e.$$typeof===WG||e.$$typeof===ZG||e.$$typeof===JG||e.$$typeof===eX||e.$$typeof===$G)},typeOf:tX},oX=(oW((function(e,t){})),oW((function(e){e.exports=nX}))),aX={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},iX={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},sX={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},cX={};function uX(e){return oX.isMemo(e)?sX:cX[e.$$typeof]||aX}cX[oX.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},cX[oX.Memo]=sX;var lX=Object.defineProperty,dX=Object.getOwnPropertyNames,fX=Object.getOwnPropertySymbols,pX=Object.getOwnPropertyDescriptor,hX=Object.getPrototypeOf,mX=Object.prototype,gX=function e(t,r,n){if("string"!=typeof r){if(mX){var o=hX(r);o&&o!==mX&&e(t,o,n)}var a=dX(r);fX&&(a=a.concat(fX(r)));for(var i=uX(t),s=uX(r),c=0;c<a.length;++c){var u=a[c];if(!(iX[u]||n&&n[u]||s&&s[u]||i&&i[u])){var l=pX(r,u);try{lX(t,u,l)}catch(e){}}}}return t};function vX(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===wK(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 yX=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],bX=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&&yX.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},CX=function(e,t){return!e||1===navigator.maxTouchPoints||navigator.plugins.length>0&&!t},wX=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}}},kX={closeButton:{top:"10px",right:"10px",left:"auto",bottom:"auto",display:"block",src:"",width:"20px",height:"auto"},popup:{backgroundColor:"#fff",padding:"5px",border:"1px solid #d7d7d7",borderRadius:"10px",overlay:{backgroundColor:"rgba(0, 0, 0, 0.5)"}}},SX=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,EX=/^\w*$/,BX=function(e,t){if(lQ(e))return!1;var r=By(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!JQ(e))||EX.test(e)||!SX.test(e)||null!=t&&e in Object(t)},_X=OW(Object,"create"),xX=function(){this.__data__=_X?_X(null):{},this.size=0},TX=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},AX=Object.prototype.hasOwnProperty,IX=function(e){var t=this.__data__;if(_X){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return AX.call(t,e)?t[e]:void 0},PX=Object.prototype.hasOwnProperty,RX=function(e){var t=this.__data__;return _X?void 0!==t[e]:PX.call(t,e)},DX=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=_X&&void 0===t?"__lodash_hash_undefined__":t,this};function NX(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])}}NX.prototype.clear=xX,NX.prototype.delete=TX,NX.prototype.get=IX,NX.prototype.has=RX,NX.prototype.set=DX;var OX=NX,LX=function(){this.__data__=[],this.size=0},MX=function(e,t){for(var r=e.length;r--;)if(FW(e[r][0],t))return r;return-1},FX=Array.prototype.splice,UX=function(e){var t=this.__data__,r=MX(t,e);return!(r<0||(r==t.length-1?t.pop():FX.call(t,r,1),--this.size,0))},jX=function(e){var t=this.__data__,r=MX(t,e);return r<0?void 0:t[r][1]},VX=function(e){return MX(this.__data__,e)>-1},zX=function(e,t){var r=this.__data__,n=MX(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function qX(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])}}qX.prototype.clear=LX,qX.prototype.delete=UX,qX.prototype.get=jX,qX.prototype.has=VX,qX.prototype.set=zX;var HX=qX,KX=OW(uW,"Map"),WX=function(){this.size=0,this.__data__={hash:new OX,map:new(KX||HX),string:new OX}},QX=function(e){var t=By(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},GX=function(e,t){var r=e.__data__;return QX(t)?r["string"==typeof t?"string":"hash"]:r.map},XX=function(e){var t=GX(this,e).delete(e);return this.size-=t?1:0,t},YX=function(e){return GX(this,e).get(e)},$X=function(e){return GX(this,e).has(e)},ZX=function(e,t){var r=GX(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function JX(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])}}JX.prototype.clear=WX,JX.prototype.delete=XX,JX.prototype.get=YX,JX.prototype.has=$X,JX.prototype.set=ZX;var eY=JX;function tY(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(tY.Cache||eY),r}tY.Cache=eY;var rY,nY,oY,aY,iY,sY=tY,cY=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uY=/\\(\\)?/g,lY=function(e){var t=sY((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(cY,(function(e,r,n,o){t.push(n?o.replace(uY,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),dY=function(e,t){return lQ(e)?e:BX(e,t)?[e]:lY(nG(e))},fY=function(e){if("string"==typeof e||JQ(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},pY=function(e,t){for(var r=0,n=(t=dY(t,e)).length;null!=e&&r<n;)e=e[fY(t[r++])];return r&&r==n?e:void 0},hY=function(e,t,r){var n=null==e?void 0:pY(e,t);return void 0===n?r:n},mY=function(e,t,r){return hY(e,t,hY(r,t,""))},gY=function(e,t,r){var n=Jj.useAsset(r);return hY(e,t,n)},vY=uL.Errors,yY=dB.div(rY||(rY=IK(["\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;"})),bY=dB.video(nY||(nY=IK(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),CY=dB.div(oY||(oY=IK(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),wY=dB(CY)(aY||(aY=IK(["\n z-index: ",";\n position: fixed;\n cursor: pointer;\n ","\n"])),2e3,(function(e){var t=e.theme;return YE(["top:",";right:",";left:",";bottom:",";display:",";width:",";height:",";"],mY(t,"closeButton.top",kX),mY(t,"closeButton.right",kX),mY(t,"closeButton.left",kX),mY(t,"closeButton.bottom",kX),mY(t,"closeButton.display",kX),mY(t,"closeButton.width",kX),mY(t,"closeButton.height",kX))})),kY=dB.div(iY||(iY=IK(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),SY=xC.createRef(),EY=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 BY(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,a=e.onVideoPlayed,i=e.flipHorizontal,s=e.videoSettings,c=e.refVideo,u=e.onError,l=e.closeButton,d=e.videoClassName,f=e.scale,p=e.defaultCameraId,h=e.onWarning,m=xC.useRef(),g=yj.useSDKSettings().lang,v=mB(),y=Yj.useSDKTracking().sendEvent,b=gY(v,"closeButton.src","ic_close.png"),C=PK(xC.useState(""),2),w=C[0],k=C[1],S=xC.useRef(!1),E=xC.useRef(!1),B=xC.useRef(!1),_=xC.useRef(),x=xC.useRef([]),T=xC.useRef(""),A=xC.useCallback((function(e){u&&u(e)}),[u]),I=xC.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(_)}),[c]);function P(){return R.apply(this,arguments)}function R(){return(R=SK(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,vX();case 3:t=e.sent,x.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),lK.addExifData("device_info.camera_list",JSON.stringify(x.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))||I()}),1e3)),xC.useEffect((function(){return function(){B.current=!0}}),[]);var D=xC.useCallback((function(){_.current||(_.current=setTimeout((function(){S.current||(k(vY.camera_timeout.msg[g]),A(vY.camera_timeout))}),2e4))}),[g,A]),N=xC.useCallback(function(){var e=SK(regeneratorRuntime.mark((function e(t){var n,o,a,i,c,u,l,d,f,p,m=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=m.length>1&&void 0!==m[1]&&m[1],o={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return h&&h("too_many_request_to_camera"),e.abrupt("return",new Promise((function(e){return e(null)})));case 5:return window.tv_last_req_camera_complete=!1,o=iW.isMobile?iW.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},a=wX(),i=a.updateTime,c=a.getStart,u=a.getEnd,e.prev=8,l=s||o,i(performance.now(),"start"),CX(iW.isMobile,iW.isIOS)&&r&&(l={}),n&&(l={}),lK.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),d={audio:!1,video:TK(TK({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)},e.next=17,EY.getUserMedia(d);case 17:return f=e.sent,e.next=20,P();case 20:if(D(),f){e.next=25;break}return k(vY.not_supported.msg[g]),A(vY.not_supported),e.abrupt("return",null);case 25:i(performance.now(),"end"),window.tv_last_req_camera_complete=!0,u()-c()<1600?y({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):y({tag:"cam_permission",event:"user_activity.allow",log:{}});try{p=f.getVideoTracks()[0].getSettings(),lK.addExifData("device_info.camera_label_dimension.got","".concat(p.width,"x").concat(p.height))}catch(e){}return e.abrupt("return",f);case 32:e.prev=32,e.t0=e.catch(8),i(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k(vY.no_permission.msg[g]),A(vY.no_permission),E.current=!0,y({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):E.current&&("NotReadableError"===e.t0.name?(A(vY.not_readable),k(vY.not_readable.msg[g])):(k(e.t0.message),A({code:e.t0.name||e.t0.code,message:e.t0.message})));case 36:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 38:case"end":return e.stop()}}),e,null,[[8,32]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,A,h,D,y]),O=xC.useCallback(SK(regeneratorRuntime.mark((function e(){var t,r,n,o,i,s,u,l,d,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>0&&void 0!==h[0]?h[0]:p,o=h.length>1&&void 0!==h[1]&&h[1],!(null!=(i=c.current)&&null!==(t=i.srcObject)&&void 0!==t&&t.id&&null!=i&&null!==(r=i.srcObject)&&void 0!==r&&r.active&&S.current)){e.next=5;break}return e.abrupt("return");case 5:return i.oncanplaythrough=function(){var e,t,r;i.play(),lK.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),S.current=!0,k("");var n=window.innerWidth,o=window.innerHeight,c=xV.analyzeVideoAndWindowSizes(i),u=c.lostX,l=void 0===u?0:u,d=c.lostY,f=void 0===d?0:d,p=Math.min(n,Math.floor(n-2*l)),h=Math.min(o,Math.floor(o-2*f));a&&a({clientWidth:n,clientHeight:o,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,N(n,o);case 8:s=e.sent,u=bX(s),l=u.deviceLabel,(d=u.isVirtual)&&(T.current+="".concat(l,", "),(f=x.current.filter((function(e){return!T.current.includes(e.label)})))[0]&&f[0].deviceId&&O(f[0].deviceId)),s||E.current||(lK.addExifData("device_info.camera_label_retry","yes"),E.current=!0,O(n,!0)),s&&B.current&&(c.current.srcObject=s,I()),!s||B.current||d||(i.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,N,a,p,I]);xC.useEffect((function(){function e(){return(e=SK(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O();case 2:return e.next=4,vX();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,I(),O(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return S.current?function(){}:(!EY||iW.browserName&&["facebook"].includes(iW.browserName.toLowerCase())||iW.getUA.includes("Zalo iOS")?(k(vY.not_supported.msg[g]),A(vY.not_supported)):t&&(iW.isAndroid&&!1===r?function(){e.apply(this,arguments)}():O()),function(){B.current&&I()})}),[c,g,r,O,I,A]);var L=xC.useCallback((function(){I(),n&&n(),y({tag:"result",event:"user_activity.cancel",log:{}})}),[n,I,y]);return xC.createElement(yY,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!w)return null;var e=vY.no_permission.msg[g];return w===e&&iW.isIOS?xC.createElement(kY,null,w," ",xC.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):xC.createElement(kY,null,w)}(),xC.createElement(bY,{ref:c,playsInline:!0,muted:!0,flipHorizontal:i,className:d,scale:f}),o,l?xC.cloneElement(l,{onClick:L,"data-testid":"close-camera"}):xC.createElement(wY,{onClick:L,"data-testid":"close-camera"},xC.createElement("img",{src:b,alt:""})))}BY.propTypes={checkCameraMode:xw.bool,frontCamera:xw.bool,onClose:xw.func,onError:xw.func,onVideoPlayed:xw.func,children:xw.node,flipHorizontal:xw.bool,videoSettings:xw.object,refVideo:xw.object,closeButton:xw.node,videoClassName:xw.string,scale:xw.number,defaultCameraId:xw.string,onWarning:xw.func},BY.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 _Y,xY=function(e,t,r){var n=function(t){Oy(o,t);var n=Hy(o);function o(){var e;return Ty(this,o),(e=n.apply(this,arguments)).updateDebounced=OG(e.forceUpdate,250,r),e}return Iy(o,[{key:"shouldComponentUpdate",value:function(){return this.updateDebounced(),!1}},{key:"componentWillUnmount",value:function(){this.updateDebounced.cancel()}},{key:"render",value:function(){return xC.createElement(e,Object.assign({},this.props))}}]),o}(xC.Component);return n.displayName="debounceRender(".concat(e.displayName||e.name||"Component",")"),gX(n,e)}(BY),TY=xC.forwardRef((function(e,t){return xC.createElement(xY,_K({},e,{refVideo:t||SY}))})),AY=dB(CG)(_Y||(_Y=IK(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: ",";\n"])),1010);function IY(){return(IY=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 PY,RY="undefined"!=typeof window?xC.useLayoutEffect:xC.useEffect,DY={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}}},NY=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],OY=function(e,t,r,n,o){var a=o.offsetX,i=o.offsetY,s=n?8:0,c=r.split(" "),u=e.top+e.height/2,l=e.left+e.width/2,d=t.height,f=t.width,p=u-d/2,h=l-f/2,m="",g="0%",v="0%";switch(c[0]){case"top":p-=d/2+e.height/2+s,m="rotate(180deg) translateX(50%)",g="100%",v="50%";break;case"bottom":p+=d/2+e.height/2+s,m="rotate(0deg) translateY(-100%) translateX(-50%)",v="50%";break;case"left":h-=f/2+e.width/2+s,m=" rotate(90deg) translateY(50%) translateX(-25%)",v="100%",g="50%";break;case"right":h+=f/2+e.width/2+s,m="rotate(-90deg) translateY(-150%) translateX(25%)",g="50%"}switch(c[1]){case"top":p=e.top,g=e.height/2+"px";break;case"bottom":p=e.top-d+e.height,g=d-e.height/2+"px";break;case"left":h=e.left,v=e.width/2+"px";break;case"right":h=e.left-f+e.width,v=f-e.width/2+"px"}return{top:p="top"===c[0]?p-i:p+i,left:h="left"===c[0]?h-a:h+a,transform:m,arrowLeft:v,arrowTop:g}},LY=function(e,t,r,n,o,a){var i=o.offsetX,s=o.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=function(e){var t={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var r=document.querySelector(e);null!==r&&(t=r.getBoundingClientRect())}return t}(a),d=Array.isArray(r)?r:[r];for((a||Array.isArray(r))&&(d=[].concat(d,NY));u<d.length;){var f={top:(c=OY(e,t,d[u],n,{offsetX:i,offsetY:s})).top,left:c.left,width:t.width,height:t.height};if(!(f.top<=l.top||f.left<=l.left||f.top+f.height>=l.top+l.height||f.left+f.width>=l.left+l.width))break;u++}return c},MY=0,FY=xC.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,o=e.onOpen,a=void 0===o?function(){}:o,i=e.onClose,s=void 0===i?function(){}:i,c=e.defaultOpen,u=void 0!==c&&c,l=e.open,d=void 0===l?void 0:l,f=e.disabled,p=void 0!==f&&f,h=e.nested,m=void 0!==h&&h,g=e.closeOnDocumentClick,v=void 0===g||g,y=e.repositionOnResize,b=void 0===y||y,C=e.closeOnEscape,w=void 0===C||C,k=e.on,S=void 0===k?["click"]:k,E=e.contentStyle,B=void 0===E?{}:E,_=e.arrowStyle,x=void 0===_?{}:_,T=e.overlayStyle,A=void 0===T?{}:T,I=e.className,P=void 0===I?"":I,R=e.position,D=void 0===R?"bottom center":R,N=e.modal,O=void 0!==N&&N,L=e.lockScroll,M=void 0!==L&&L,F=e.arrow,U=void 0===F||F,j=e.offsetX,V=void 0===j?0:j,z=e.offsetY,q=void 0===z?0:z,H=e.mouseEnterDelay,K=void 0===H?100:H,W=e.mouseLeaveDelay,Q=void 0===W?100:W,G=e.keepTooltipInside,X=void 0!==G&&G,Y=e.children,$=xC.useState(d||u),Z=$[0],J=$[1],ee=xC.useRef(null),te=xC.useRef(null),re=xC.useRef(null),ne=xC.useRef(null),oe=xC.useRef("popup-"+ ++MY),ae=!!O||!n,ie=xC.useRef(0);RY((function(){return Z?(ne.current=document.activeElement,ye(),me(),pe()):he(),function(){clearTimeout(ie.current)}}),[Z]),xC.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return a(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ae&&(null===(t=ne.current)||void 0===t||t.focus()),setTimeout((function(){return s(e)}),0))},ue=function(e){null==e||e.stopPropagation(),Z?ce(e):se(e)},le=function(e){clearTimeout(ie.current),ie.current=setTimeout((function(){return se(e)}),K)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(ie.current),ie.current=setTimeout((function(){return ce(e)}),Q)},pe=function(){ae&&M&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ae&&M&&(document.getElementsByTagName("body")[0].style.overflow="auto")},me=function(){var e,t=null==te||null===(e=te.current)||void 0===e?void 0:e.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),r=Array.prototype.slice.call(t)[0];null==r||r.focus()};xC.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var ge,ve,ye=function(){if(!ae&&Z&&(null==ee?void 0:ee.current)&&(null==ee?void 0:ee.current)&&(null==te?void 0:te.current)){var e,t,r=ee.current.getBoundingClientRect(),n=te.current.getBoundingClientRect(),o=LY(r,n,D,U,{offsetX:V,offsetY:q},X);te.current.style.top=o.top+window.scrollY+"px",te.current.style.left=o.left+window.scrollX+"px",U&&re.current&&(re.current.style.transform=o.transform,re.current.style.setProperty("-ms-transform",o.transform),re.current.style.setProperty("-webkit-transform",o.transform),re.current.style.top=(null===(e=x.top)||void 0===e?void 0:e.toString())||o.arrowTop,re.current.style.left=(null===(t=x.left)||void 0===t?void 0:t.toString())||o.arrowLeft)}};void 0===(ve=w)&&(ve=!0),xC.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),xC.useEffect((function(){if(t){var r=function(t){if(9===t.keyCode){var r,n=null==e||null===(r=e.current)||void 0===r?void 0:r.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),o=Array.prototype.slice.call(n);if(1===o.length)return void t.preventDefault();var a=o[0],i=o[o.length-1];t.shiftKey&&document.activeElement===a?(t.preventDefault(),i.focus()):document.activeElement===i&&(t.preventDefault(),a.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])}(te,Z&&ae),function(e,t){void 0===t&&(t=!0),xC.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),xC.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,Ce=function(){return xC.createElement("div",Object.assign({},(e=ae?DY.popupContent.modal:DY.popupContent.tooltip,t={className:"popup-content "+(""!==P?P.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:IY({},e,B,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!O&&S.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ae?"dialog":"tooltip",id:oe.current}),U&&!ae&&xC.createElement("div",{ref:re,style:DY.popupArrow},xC.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==P?P.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:IY({position:"absolute"},x)},xC.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},we=!(S.indexOf("hover")>=0),ke=ae?DY.overlay.modal:DY.overlay.tooltip,Se=[we&&xC.createElement("div",{key:"O","data-testid":"overlay","data-popup":ae?"modal":"tooltip",className:"popup-overlay "+(""!==P?P.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:IY({},ke,A,{pointerEvents:v&&m||ae?"auto":"none"}),onClick:v&&m?ce:void 0,tabIndex:-1},ae&&Ce()),!ae&&Ce()];return xC.createElement(xC.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":oe.current},t=Array.isArray(S)?S:[S],r=0,o=t.length;r<o;r++)switch(t[r]){case"click":e.onClick=ue;break;case"right-click":e.onContextMenu=de;break;case"hover":e.onMouseEnter=le,e.onMouseLeave=fe;break;case"focus":e.onFocus=le,e.onBlur=fe}if("function"==typeof n){var a=n(Z);return!!n&&xC.cloneElement(a,e)}return!!n&&xC.cloneElement(n,e)}(),Z&&iL.createPortal(Se,(null===(be=document.getElementById("popup-root"))&&((be=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(be)),be)))})),UY=pB(PY||(PY=IK(["\n .popup-content {\n margin: auto;\n width: 100%;\n max-width: 568px;\n ",";\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n ",";\n }\n\n .popup-overlay {\n padding: 10px;\n ",";\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"])),(function(e){var t=e.theme;return YE(["background-color:",";padding:",";border:",";border-radius:",";"],mY(t,"popup.backgroundColor",kX),mY(t,"popup.padding",kX),mY(t,"popup.border",kX),mY(t,"popup.borderRadius",kX))}),(function(e){var t=e.theme;return YE(["background-color:",";padding:",";border:",";border-radius:",";"],mY(t,"popup.backgroundColor",kX),mY(t,"popup.padding",kX),mY(t,"popup.border",kX),mY(t,"popup.borderRadius",kX))}),(function(e){var t=e.theme;return YE(["background:",";"],mY(t,"popup.overlay.backgroundColor",kX))})),jY=["open","children","overlayStyle"],VY=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=AK(e,jY);return xC.createElement(xC.Fragment,null,t&&xC.createElement(xC.Fragment,null,xC.createElement(FY,_K({overlayStyle:TK(TK({},n),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),xC.createElement(UY,null)))};VY.propTypes={open:xw.bool,children:xw.node,overlayStyle:xw.shape({})},VY.defaultProps={open:!1,children:null,overlayStyle:{}};var zY={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},qY={IDCapturing:{backgroundColor:"rgba(0, 0, 0, 0.6)",title:{color:"#fff",fontSize:"20px",fontWeight:"normal",backgroundColor:"unset"},instruction:{color:"#fff",fontSize:"16px",fontWeight:"normal",backgroundColor:"unset",border:"unset",borderRadius:"unset"},error:{color:"#fff",fontSize:"16px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px"},countdown:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px"},cardIcon:{src:"",width:"auto",height:"38px"},captureIcon:{src:"",width:"60px",height:"60px"},loadingIcon:{src:"",width:"100px",height:"100px"},timeoutPopup:{padding:"10px",text:{color:"#000",fontSize:"1rem",fontWeight:"normal",textAlign:"center",border:"unset",borderRadius:"unset"},button:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:zY.tsBlue,border:"none",borderRadius:"0.25rem",outline:"none",height:"50px"}},rectangleMask:{width:600,height:400,strokeWidth:2,strokeStyles:{},radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"},default:{fill:"none",stroke:"#fff",strokeWidth:2,strokeDasharray:"7, 4",opacity:.6},error:{fill:"rgba(234,50,35, 0.1)",strokeWidth:2,stroke:"#ea3223"}}},IDConfirmPopup:{confirmButton:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:zY.tsBlue,border:"0",borderRadius:"0.25rem",outline:"none"},retryButton:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:zY.tsBlue,border:"none",borderRadius:"0.25rem",outline:"none"},image:{borderRadius:"5px"}},QRStep:{guidelinePopup:{image:{src:"",borderRadius:"5px",backgroundColor:"#e7e6e6"},guideText:{color:zY.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",lineHeight:"20px"},countdownText:{color:zY.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",lineHeight:"20px"},startButton:{color:"#fff",fontSize:"1rem",fontWeight:"normal",backgroundColor:zY.tsBlue,border:"none",borderRadius:"3px",outline:"none",height:"66px"}},scanTooltip:{backgroundColor:"#00ce78",borderRadius:"8px",color:"#fff",padding:"10px",textAlign:"center"},scanCountdown:{textAlign:"center",color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"none",borderRadius:"3px",padding:"5px 10px"},invalidPopup:{padding:"10px",title:{color:zY.tsSecondary,fontSize:"16px",fontWeight:"bold",margin:"25px 0 0 0",padding:"0 0 0 0"},description:{color:zY.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",margin:"30px 0 0 0",padding:"0 0 0 0"},retryButton:{color:"#fff",fontSize:"1rem",fontWeight:"normal",backgroundColor:zY.tsBlue,border:"none",borderRadius:"3px",outline:"none",height:"66px",margin:"30px 0 0 0"},skipButton:{color:zY.tsBlue,fontSize:"1rem",fontWeight:"normal",backgroundColor:"unset",border:"none",borderRadius:"unset",outline:"none",height:"unset",margin:"20px 0"}},resultText:{success:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#34ce60"},error:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#ff9532"}}}},HY="default",KY="error";function WY(e){var t=e.className,r=e.width,n=e.height,o=e.type,a=e.strokeStyles,i=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=e.defaultRectStyles,l=e.errorRectStyles,d=s+.8*i,f=xC.useMemo((function(){var e;return TK((BK(e={},HY,u),BK(e,KY,l),e),a)}),[u,l,a])[o];return xC.createElement("svg",{width:r,height:n,className:t},xC.createElement("rect",{x:i/2,y:i/2,rx:s,ry:s,width:r-i,height:n-i,style:f}),xC.createElement("path",{d:"M0,".concat(d," Q0,0 ").concat(d,",0 L0,0 Z"),style:c}),xC.createElement("path",{d:"M0,".concat(n-d," Q0,").concat(n," ").concat(d,",").concat(n," L0,").concat(n," Z"),style:c}),xC.createElement("path",{d:"M".concat(r-d,",").concat(n," Q").concat(r,",").concat(n," ").concat(r,",").concat(n-d," L").concat(r,",").concat(n," Z"),style:c}),xC.createElement("path",{d:"M".concat(r-d,",0 Q").concat(r,",0 ").concat(r,",").concat(d," L").concat(r,",0 Z"),style:c}))}WY.propTypes={className:xw.string,width:xw.number,height:xw.number,strokeWidth:xw.number,strokeStyles:xw.shape({}),type:xw.oneOf([HY,KY]),radius:xw.number,paddingStyle:xw.shape({}),defaultRectStyles:xw.shape({}),errorRectStyles:xw.shape({})},WY.defaultProps={className:"",width:qY.IDCapturing.rectangleMask.width,height:qY.IDCapturing.rectangleMask.height,strokeWidth:qY.IDCapturing.rectangleMask.strokeWidth,strokeStyles:qY.IDCapturing.rectangleMask.strokeStyles,type:HY,radius:qY.IDCapturing.rectangleMask.radius,paddingStyle:qY.IDCapturing.rectangleMask.paddingStyle,defaultRectStyles:qY.IDCapturing.rectangleMask.default,errorRectStyles:qY.IDCapturing.rectangleMask.error};var QY,GY,XY=hB(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),YY=hB(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),$Y=YE([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],XY,500,YY,500),ZY=hB(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),JY=hB(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20),e$=(YE([".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;}"],ZY,JY),hB(["from,to{opacity:1;}50%{opacity:0;}"])),t$=(YE([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],e$),dB.div(QY||(QY=IK(["\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)),r$=hB(["from{background:#000;}to{}"]),n$=YE([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],r$,300),o$=dB.div(GY||(GY=IK(["\n ","\n"])),n$),a$=hB(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),i$=YE([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],a$),s$={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"}},c$=uL.Errors;function u$(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function l$(e,t){return Math.sqrt(u$(e,t))}function d$(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=window,o=n.cv,a=t.width,i=t.height,s=r;s<1&&(s=parseInt(.5*(i+a)*s,10));var c=o.imread(t),u=new o.Mat;return o.copyMakeBorder(c,u,s,s,s,s,o.BORDER_CONSTANT,new o.Scalar(0,0,0,255)),c.delete(),{mat:u,margin:s}}function f$(e,t){var r=window.cv,n=PK(t.map((function(e){return e.location})),4),o=n[0],a=n[1],i=n[2],s=n[3],c=l$(i,s),u=l$(a,o),l=Math.max(c,u),d=l$(a,i),f=l$(o,s),p=Math.max(d,f),h=[o.x,o.y,a.x,a.y,i.x,i.y,s.x,s.y],m=[0,0,l-1,0,l-1,p-1,0,p-1],g=r.imread(e),v=new r.Mat,y=new r.Size(l,p),b=r.matFromArray(4,1,r.CV_32FC2,h),C=r.matFromArray(4,1,r.CV_32FC2,m),w=r.getPerspectiveTransform(b,C);r.warpPerspective(g,v,w,y,r.INTER_LINEAR,r.BORDER_CONSTANT,new r.Scalar);var k=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),C.delete(),k}function p$(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},o={x:r.x-e.x,y:r.y-e.y},a=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),i=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(a*i))/Math.PI}function h$(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;t.forEach((function(e){var t=e.location,r=t.x,n=t.y;o=Math.min(o,r),a=Math.min(a,n),i=Math.max(i,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&a/n>=c&&(n-s)/n>=c&&(r-i)/r>=c}function m$(){return g$.apply(this,arguments)}function g$(){return(g$=SK(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=t.canvas,n=t.paddingPercent,o=void 0===n?.04:n,a=r.width,i=r.height,s=Math.floor(a*o),c=Math.floor(i*o),u=a-2*s,l=i-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(r,s,c,u,l,0,0,u,l),e.abrupt("return",nq.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v$(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,a=p$(e[r].location,e[n].location,e[o].location);if(a<70||a>110)return!1}return!0}function y$(e){return b$.apply(this,arguments)}function b$(){return(b$=SK(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.blazefaceModel,n=t.predictedIdCardCanvas,o=t.frontSide,a=n.width,i=n.height,s=Math.floor(a/3),c=Math.floor(4*i/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(i/5),s,c,0,0,s,c),e.next=12,GV.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=PK(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4||FV.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[GV.SIZE,GV.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",c$.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",c$.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",c$.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 C$,w$,k$,S$,E$,B$,_$,x$,T$,A$,I$,P$,R$,D$,N$,O$,L$,M$,F$,U$=function(e){var t=hY(e,"card.corners");if(t&&Array.isArray(t)&&t.length>0){var r=hY(t,"[0].location"),n=r.x,o=r.y;return"".concat(n,":").concat(o)}return"-1:-1"},j$=function(e,t,r){e.current=[].concat(RK(e.current),[t]),e.current.length>r&&e.current.shift()},V$=function(){var e=SK(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E,B,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=t.currentWorkingCanvas,u=t.refVirtualWorkingCanvas,l=t.refCountVirtualFrames,d=t.refVirtualFrames,f=t.refWorkingCanvas,(p=t.refCardResult).current.corners&&Array.isArray(p.current.corners)){e.next=3;break}return e.abrupt("return");case 3:return h=PK(p.current.corners,3),m=h[0],g=h[1],v=h[2],y=(null==g||null===(r=g.location)||void 0===r?void 0:r.x)-(null==m||null===(n=m.location)||void 0===n?void 0:n.x)-100,b=(null==v||null===(o=v.location)||void 0===o?void 0:o.y)-(null==g||null===(a=g.location)||void 0===a?void 0:a.y)-100,C=performance.now(),(w=u.current).width=y,w.height=b,(k=w.getContext("2d")).drawImage(c,(null==m||null===(i=m.location)||void 0===i?void 0:i.x)+50,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+50,y,b,0,0,y,b),e.next=14,new Promise((function(e){w.toBlob(function(){var t=SK(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,zj.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(RK(d.current),[n]),e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}));case 14:return C=Math.floor(performance.now()-C),S=180-C>0?180-C:0,e.next=18,new Promise((function(e){return setTimeout(e,S)}));case 18:if(!(l.current<3)){e.next=29;break}return _=performance.now(),x=f.current,k.drawImage(x,(null==m||null===(E=m.location)||void 0===E?void 0:E.x)+50,(null==m||null===(B=m.location)||void 0===B?void 0:B.y)+50,y,b,0,0,y,b),e.next=24,new Promise((function(e){w.toBlob(function(){var t=SK(regeneratorRuntime.mark((function t(r){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,zj.MD5({blob:r});case 2:n=t.sent,d.current=[].concat(RK(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)}}(),z$=function(e,t){return!(0!==t.length&&!t.includes("vn.national_id"))||t.map((function(e){return e.replace("vn.","")})).some((function(t){var r;return(null===(r=e.split("."))||void 0===r?void 0:r.filter((function(e){return"front"!==e&&"back"!==e&&"vn"!==e}))).some((function(e){return e===t}))}))},q$=["width","height","type"],H$=dB(WY)(C$||(C$=IK([""]))),K$=dB.img(w$||(w$=IK(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),W$=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return xC.createElement(o$,null,xC.createElement(tW,null,xC.createElement(XK,{key:r,timeout:{enter:300,exit:0},classNames:"splash",unmountOnExit:!1},xC.createElement(t$,null))))},Q$=dB.div(k$||(k$=IK(["\n ","\n ","\n"])),$Y,i$),G$=dB.img(S$||(S$=IK(["\n border-radius: 5px;\n opacity: 0.7;\n width: ",";\n height: ",";\n"])),(function(e){var t=e.theme;return mY(t,"IDCapturing.cardIcon.width",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.cardIcon.height",qY)})),X$=dB.div(E$||(E$=IK(["\n cursor: pointer;\n text-align: center;\n width: ",";\n height: ",";\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),(function(e){var t=e.theme;return mY(t,"IDCapturing.captureIcon.width",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.captureIcon.height",qY)}),1020,iW.isMobile?YE(["top:",";"],(function(e){return e.y})):YE(["bottom:","px;"],10)),Y$=dB.div(B$||(B$=IK(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ",";\n height: ",";\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),(function(e){var t=e.theme;return mY(t,"IDCapturing.loadingIcon.width",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.loadingIcon.height",qY)}),1020),$$=dB.div(_$||(_$=IK(["\n color: #fff;\n text-align: center;\n"]))),Z$=dB.div(x$||(x$=IK(["\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),J$=dB.div(T$||(T$=IK(["\n display: flex;\n align-items: center;\n"]))),eZ=dB($$)(A$||(A$=IK(["\n margin-left: 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n"])),(function(e){var t=e.theme;return mY(t,"IDCapturing.title.color",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.title.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.title.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.title.backgroundColor",qY)})),tZ=dB($$)(I$||(I$=IK(["\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),rZ=dB($$)(P$||(P$=IK(["\n position: absolute;\n text-align: center;\n top: ",";\n z-index: ",";\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){return e.y}),1020,(function(e){var t=e.theme;return mY(t,"IDCapturing.instruction.color",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.instruction.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.instruction.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.instruction.backgroundColor",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.instruction.border",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.instruction.borderRadius",qY)})),nZ=dB(rZ)(R$||(R$=IK(["\n padding: 5px 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){var t=e.theme;return mY(t,"IDCapturing.error.color",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.error.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.error.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.error.backgroundColor",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.error.border",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.error.borderRadius",qY)})),oZ=dB($$)(D$||(D$=IK(["\n position: absolute;\n text-align: center;\n padding: 5px 10px;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){return e.y}),1020,(function(e){var t=e.theme;return mY(t,"IDCapturing.countdown.color",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.countdown.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.countdown.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.countdown.backgroundColor",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.countdown.border",qY)}),(function(e){var t=e.theme;return mY(t,"IDCapturing.countdown.borderRadius",qY)})),aZ=(dB.div(N$||(N$=IK(["\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=AK(e,q$),a=mB(),i=Jj.useAsset("id_card_frame.png"),s=Jj.useAsset("id_card_frame_error.png"),c=function(e,t){var r,n,o,a,i,s,c;return{width:null!==(r=e.width)&&void 0!==r?r:mY(t,"IDCapturing.rectangleMask.width",qY),height:null!==(n=e.height)&&void 0!==n?n:mY(t,"IDCapturing.rectangleMask.height",qY),strokeWidth:null!==(o=e.strokeWidth)&&void 0!==o?o:mY(t,"IDCapturing.rectangleMask.strokeWidth",qY),radius:null!==(a=e.radius)&&void 0!==a?a:mY(t,"IDCapturing.rectangleMask.radius",qY),paddingStyle:null!==(i=e.paddingStyle)&&void 0!==i?i:mY(t,"IDCapturing.rectangleMask.paddingStyle",qY),defaultRectStyles:null!==(s=e.default)&&void 0!==s?s:mY(t,"IDCapturing.rectangleMask.default",qY),errorRectStyles:null!==(c=e.error)&&void 0!==c?c:mY(t,"IDCapturing.rectangleMask.error",qY)}}(e,a);return xC.createElement(Q$,{width:t,height:r},xC.createElement(K$,{src:n===KY?s:i,width:t,height:r}),xC.createElement(H$,_K({type:n},o,c)))}),iZ={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},sZ=dB.div(O$||(O$=IK(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),cZ=function(e){var t=e.contentStyle,r=yj.useSDKSettings(),n=r.lang,o=r.warmupMessage,a=o?o[n]:iZ.WARMUP_INTRO[n];return xC.createElement(VY,{open:!0,contentStyle:t},xC.createElement(sZ,{className:"warmup-message"},a))};cZ.propTypes={contentStyle:xw.shape({})},cZ.defaultProps={contentStyle:{}};var uZ=uL.IDCardMessage,lZ=dB.div(L$||(L$=IK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n ","\n"])),(function(e){var t=e.theme;return YE(["border-radius:",";padding:",";"],mY(t,"popup.borderRadius",kX),mY(t,"IDCapturing.timeoutPopup.padding",qY))})),dZ=dB.div(M$||(M$=IK(["\n ","\n"])),(function(e){var t=e.theme;return YE(["color:",";font-size:",";font-weight:",";text-align:",";border:",";border-radius:",";"],mY(t,"IDCapturing.timeoutPopup.text.color",qY),mY(t,"IDCapturing.timeoutPopup.text.fontSize",qY),mY(t,"IDCapturing.timeoutPopup.text.fontWeight",qY),mY(t,"IDCapturing.timeoutPopup.text.textAlign",qY),mY(t,"IDCapturing.timeoutPopup.text.border",qY),mY(t,"IDCapturing.timeoutPopup.text.borderRadius",qY))})),fZ=dB.button(F$||(F$=IK(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: ",";\n cursor: pointer;\n ","\n"])),(function(e){var t=e.theme;return mY(t,"IDCapturing.timeoutPopup.button.height",qY)}),(function(e){var t=e.theme;return YE(["color:",";font-size:",";font-weight:",";background-color:",";border:",";border-radius:",";outline:",";"],mY(t,"IDCapturing.timeoutPopup.button.color",qY),mY(t,"IDCapturing.timeoutPopup.button.fontSize",qY),mY(t,"IDCapturing.timeoutPopup.button.fontWeight",qY),mY(t,"IDCapturing.timeoutPopup.button.backgroundColor",qY),mY(t,"IDCapturing.timeoutPopup.button.border",qY),mY(t,"IDCapturing.timeoutPopup.button.borderRadius",qY),mY(t,"IDCapturing.timeoutPopup.button.outline",qY))})),pZ=function(e){var t=e.onOk,r=e.maxSessionTime,n=yj.useSDKSettings().lang;return xC.createElement(lZ,null,xC.createElement(dZ,{className:"popup-message"},mG(uZ.TIMEOUT_INSTRUCTION[n])({x:r})),xC.createElement(fZ,{className:"popup-button",onClick:t},s$.BTN_OK[n]))};pZ.propTypes={onOk:xw.func,maxSessionTime:xw.number},pZ.defaultProps={onOk:function(){},maxSessionTime:30};var hZ=function(){var e=PK(xC.useState(!1),2),t=e[0],r=e[1],n=PK(xC.useState(null),2),o=n[0],a=n[1],i=PK(xC.useState({}),2),s=i[0],c=i[1];return{showPopup:xC.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),a(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},mZ="SESSION_TIMEOUT",gZ="CONFIRM",vZ="QR_INVALID",yZ="QR_INSTRUCTIONS",bZ=/\s/,CZ=function(e){for(var t=e.length;t--&&bZ.test(e.charAt(t)););return t},wZ=/^\s+/,kZ=function(e){return e?e.slice(0,CZ(e)+1).replace(wZ,""):e},SZ=/^[-+]0x[0-9a-f]+$/i,EZ=/^0b[01]+$/i,BZ=/^0o[0-7]+$/i,_Z=parseInt,xZ=function(e){if("number"==typeof e)return e;if(JQ(e))return NaN;if(CW(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=CW(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=kZ(e);var r=EZ.test(e);return r||BZ.test(e)?_Z(e.slice(2),r?2:8):SZ.test(e)?NaN:+e},TZ=function(e){return e?1/0===(e=xZ(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},AZ=function(e){var t=TZ(e),r=t%1;return t==t?r?t-r:t:0},IZ=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=AZ(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},PZ=function(e){return IZ(2,e)},RZ=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e},DZ=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=xZ(r))==r?r:0),void 0!==t&&(t=(t=xZ(t))==t?t:0),RZ(xZ(e),t,r)},NZ="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function OZ(){return(OZ=SK(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?NZ: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",SK(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 LZ=PZ((function(){return OZ.apply(this,arguments)})),MZ={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},FZ={vn:.4,ph:.5},UZ={0:"top-left",1:"top-right",2:"bottom-right",3:"bottom-left",4:"cccd.front",5:"passport",6:"cmnd_old.front",7:"cmnd_old.back",8:"cmnd_new.front",9:"cmnd_new.back",10:"cccd_new.front",11:"cccd_new.back",12:"aadhaar_front",13:"aadhaar_back",14:"voter_front",15:"voter_back",16:"pan",17:"dl",18:"india_spassport",19:"aadhaar_letter",20:"pan_back",21:"passport_back",22:"unseen",23:"other",24:"BUREAU OF INTERNAL REVENUE",25:"COMMISSION ON ELECTIONS",26:"COVID VACCINATION CARD",27:"DRIVERS LICENSE",28:"HEALTH INSURANCE PHILHEALTH",29:"PAG-IBIG LOYALTY CARD",30:"PASSPORT",31:"PHILIPPINE IDENTIFICATION CARD",32:"POSTAL IDENTITY CARD",33:"PROFESSIONAL IDENTIFICATION CARD",34:"RESIDENT IDENTIFICATION CARD",35:"SOCIAL SECURITY SYSTEM",36:"UNIFIED MULTI PURPOSE ID",37:"VN_biz_license",38:"new_voter_front"};function jZ(e){var t,r,n,o,a,i=e.card,s=e.corners,c=i.box,u={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},l=c[2]-c[0],d=c[1]-c[3],f=function(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=DK(e))){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){throw e})),f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){s=!0,a=e})),f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}(s);try{for(f.s();!(a=f.n()).done;){var p=a.value;switch(p.label){case"top-left":t||(t=p.location);break;case"top-right":r||(r=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":o||(o=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![t,r,n,o].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(t.x+n.x)/2,y:(t.y+n.y)/2},m={x:(r.x+o.x)/2,y:(r.y+o.y)/2},g=u$(u,h),v=u$(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 VZ=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.country=t||"vn",this.defaultModelUrl=MZ[this.country]||MZ.vn}var t,r,n,o,a,i,s,c,u;return t=e,(r=[{key:"load",value:(u=SK(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([LZ({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=SK(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=SK(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,Vq.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,a=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),i=PK(a,3),this.out_score_name=i[0],this.out_class_name=i[1],this.out_box_name=i[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"loadResource",value:(i=SK(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,Vq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"dispose",value:(a=SK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.model&&this.model.dispose();case 1:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"predict",value:(o=SK(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E,B,_,x,T,A,I,P,R=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=R.length>1&&void 0!==R[1]?R[1]:{},n=r.imgMargin,o=r.detectThreshold,a=void 0===o?.3:o,i=r.maxNumReturns,s=void 0===i?100:i,c=window,u=c.cv,l={},d=t.width,f=t.height,l.originalWidth=d,l.originalHeight=f,p=d$({canvas:t,imgMargin:"number"==typeof n?n:FZ[this.country]}),h=p.margin,m=p.mat,g=this.inputShape.slice(1,3),v=PK(g,2),y=v[0],b=v[1],C=new u.Mat,u.resize(m,C,new u.Size(y,b),0,0,u.INTER_AREA),w=m.cols/y,k=m.rows/b,(S=document.createElement("canvas")).width=y,S.height=b,S.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(C.data),C.cols,C.rows),0,0),m.delete(),C.delete(),l.canvas=S,l.margin=h,E=performance.now(),e.next=25,this.detect(S,{detectThreshold:a,maxNumReturns:s});case 25:if(B=e.sent,_=Math.floor(performance.now()-E),x={inputImage:l,card:null,exeTime:_},T=[[],[],[],[]],A=[],I=[],B.forEach((function(e){var t=PK(e.box,4),r=t[0],n=t[1],o=t[2],a=t[3];e.clazz<=3?T[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:DZ(Math.floor((a+n)/2*w-h),0,d),y:DZ(Math.floor((r+o)/2*k-h),0,f)},scaledLocation:{x:DZ(Math.floor((a+n)/2),0,S.width),y:DZ(Math.floor((r+o)/2),0,S.height)}}):I.push({label:e.label,score:e.score,box:[DZ(Math.floor(r*k-h),0,f),DZ(Math.floor(n*w-h),0,d),DZ(Math.floor(o*k-h),0,f),DZ(Math.floor(a*w-h),0,d)]})})),T.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),A.push(e[0]))})),!(I.length>0&&4===A.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),A.sort((function(e,t){return e.clazz-t.clazz})),P=I[0],e.prev=37,jZ({card:P,corners:A})){e.next=41;break}return console.debug("Not qualified.",P,A),e.abrupt("return",x);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",x);case 46:return P.corners=A,x.card=P,e.abrupt("return",x);case 49:return e.abrupt("return",x);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return o.apply(this,arguments)})},{key:"detect",value:(n=SK(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E,B=this,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.length>1&&void 0!==_[1]?_[1]:{},n=r.detectThreshold,o=r.maxNumReturns,a=window,i=a.tf,s=t.width,c=t.height,u=i.tidy((function(){var e=i.expandDims(i.cast(i.image.resizeBilinear(i.browser.fromPixels(t),B.inputShape.slice(1,3)),"float32"));return B.model.predict(e)})),e.next=7,Promise.all([u[this.out_score_name].data(),u[this.out_class_name].data(),u[this.out_box_name].array()]);case 7:l=e.sent,d=PK(l,3),f=d[0],p=d[1],h=PK(d[2],1),m=h[0],g=Math.min(f.length,o),v=[];try{for(y=0;y<g;y++)b=f[y],C=p[y],b>n&&(k=null!==(w=UZ[Math.round(C)])&&void 0!==w?w:"NA",S=m[y],E=[S[0]*c,S[3]*s,S[2]*c,S[1]*s],v.push({score:b,clazz:C,box:E,label:k}))}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)})}])&&EK(t.prototype,r),e}();function zZ(){return(zZ=SK(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.blazefaceModelUrl,n=t.tfScriptUrls,o=t.closeEyesModelUrl,a=new fK(o),e.next=4,Vq.loadTensorFlow(n);case 4:return e.next=6,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[Vq.loadBlazefaceModel({modelUrl:r}),a.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=PK(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:a});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qZ=PZ((function(){return zZ.apply(this,arguments)})),HZ=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._onDecodeError,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._calculateScanRegion,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"environment";Ty(this,t),this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=r,this._legacyCanvasSize=t.DEFAULT_CANVAS_SIZE,this._preferredCamera=a,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof n?(this._legacyCanvasSize=n,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=n,"number"==typeof o?(this._legacyCanvasSize=o,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=o,this._scanRegion=this._calculateScanRegion(e),this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;var i=!1;e.hidden&&(e.hidden=!1,i=!0),document.body.contains(e)||(document.body.appendChild(e),i=!0),requestAnimationFrame((function(){var t=window.getComputedStyle(e);"none"===t.display&&(e.style.setProperty("display","block","important"),i=!0),"visible"!==t.visibility&&(e.style.setProperty("visibility","visible","important"),i=!0),i&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity=0,e.style.width=0,e.style.height=0)})),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),this._qrEnginePromise=t.createQrEngine()}return Iy(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=nb(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=nb(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,Py({},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=nb(t.getTracks());try{for(r.s();!(e=r.n()).done;){var n=e.value;n.stop(),t.removeTrack(n)}}catch(e){r.e(e)}finally{r.f()}}}))}},{key:"scanImage",value:function(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],c=o instanceof Worker,u=Promise.all([o||t.createQrEngine(),t._loadImage(e)]).then((function(e){var s,u,l=Wy(e,2),d=l[0],f=l[1];return o=d,s=Wy(r._drawToCanvas(f,n,a,i),2),a=s[0],u=s[1],o instanceof Worker?(c||o.postMessage({type:"inversionMode",data:"both"}),new Promise((function(e,r){var n,i,s;i=function(a){"qrResult"===a.data.type&&(o.removeEventListener("message",i),o.removeEventListener("error",s),clearTimeout(n),null!==a.data.data?e(a.data.data):r(t.NO_QR_CODE_FOUND))},s=function(e){o.removeEventListener("message",i),o.removeEventListener("error",s),clearTimeout(n);var t=e?e.message||e:"Unknown Error";r("Scanner error: "+t)},o.addEventListener("message",i),o.addEventListener("error",s),n=setTimeout((function(){return s("timeout")}),1e4);var c=u.getImageData(0,0,a.width,a.height);o.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise((function(e,r){var n=setTimeout((function(){return r("Scanner error: timeout")}),1e4);o.detect(a).then((function(n){n.length?e(n[0].rawValue):r(t.NO_QR_CODE_FOUND)})).catch((function(e){return r("Scanner error: "+(e.message||e))})).finally((function(){return clearTimeout(n)}))}))}));return n&&s&&(u=u.catch((function(){return t.scanImage(e,null,o,a,i)}))),u=u.finally((function(){c||t._postWorkerMessage(o,"close")}))}},{key:"createQrEngine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.WORKER_PATH;return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((function(t){return-1!==t.indexOf("qr_code")?new BarcodeDetector({formats:["qr_code"]}):new Worker(e)}))}},{key:"_drawToCanvas",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];r=r||document.createElement("canvas");var o=t&&t.x?t.x:0,a=t&&t.y?t.y:0,i=t&&t.width?t.width:e.width||e.videoWidth,s=t&&t.height?t.height:e.height||e.videoHeight;if(!n){var c=t&&t.downScaledWidth?t.downScaledWidth:i,u=t&&t.downScaledHeight?t.downScaledHeight:s;r.width!==c&&(r.width=c),r.height!==u&&(r.height=u)}var l=r.getContext("2d",{alpha:!1});return l.imageSmoothingEnabled=!1,l.drawImage(e,o,a,i,s,0,0,r.width,r.height),[r,l]}},{key:"_loadImage",value:function(e){if(e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||window.ImageBitmap&&e instanceof window.ImageBitmap||window.OffscreenCanvas&&e instanceof window.OffscreenCanvas)return Promise.resolve(e);if(e instanceof Image)return t._awaitImageLoad(e).then((function(){return e}));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){var r=new Image;return e instanceof File||e instanceof Blob?r.src=URL.createObjectURL(e):r.src=e,t._awaitImageLoad(r).then((function(){return(e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(r.src),r}))}return Promise.reject("Unsupported image type.")}},{key:"_awaitImageLoad",value:function(e){return new Promise((function(t,r){var n,o;e.complete&&0!==e.naturalWidth?t():(n=function(){e.removeEventListener("load",n),e.removeEventListener("error",o),t()},o=function(){e.removeEventListener("load",n),e.removeEventListener("error",o),r("Image load error")},e.addEventListener("load",n),e.addEventListener("error",o))}))}},{key:"_postWorkerMessage",value:function(e,t,r){return Promise.resolve(e).then((function(e){e instanceof Worker&&e.postMessage({type:t,data:r})}))}}]),t}();function KZ(){return WZ.apply(this,arguments)}function WZ(){return(WZ=SK(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return HZ.WORKER_PATH=mK(),e.next=3,HZ.createQrEngine(HZ.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 QZ(){return GZ.apply(this,arguments)}function GZ(){return(GZ=SK(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([KZ()]);case 2:return t=e.sent,r=PK(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)}HZ.DEFAULT_CANVAS_SIZE=400,HZ.NO_QR_CODE_FOUND="No QR code found",HZ.WORKER_PATH="qr-scanner-worker.min.js";var XZ="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function YZ(){return(YZ=SK(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=SK(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="detect.prototxt",r="detect.caffemodel",n="sr.prototxt",i="sr.caffemodel",o){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return u=[a(t),a(r),a(n),a(i)],e.next=11,Promise.all(u);case 11:l=e.sent,d=PK(l,4),f=d[0],p=d[1],h=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",p,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",h,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),o=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?XZ:r,a=function(){var e=SK(regeneratorRuntime.mark((function e(t){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(t));case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:return o=e.sent,e.abrupt("return",new Uint8Array(o));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,i();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",QZ());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var $Z=PZ((function(){return YZ.apply(this,arguments)}));function ZZ(e){return JZ.apply(this,arguments)}function JZ(){return(JZ=SK(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 eJ(e){return tJ.apply(this,arguments)}function tJ(){return(tJ=SK(regeneratorRuntime.mark((function e(t){var r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,n=!0,e.prev=2,o=performance.now(),e.next=6,ZZ({idCardModel:r});case 6:(a=performance.now())-o+.6*(a-o)>900&&(n=!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n=!1;case 13:return e.abrupt("return",{fastEnough:n});case 14:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function rJ(){return(rJ=SK(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,a=t.tfScriptUrls,i=t.wechatQRModelsUrl,s=h.length>1?h[1]:void 0,e.next=4,qZ({blazefaceModelUrl:o,tfScriptUrls:a});case 4:return c=e.sent,u=c.blazefaceModel,l=!0,d=new VZ(s),e.prev=8,e.next=11,d.load({opencvUrl:r,modelUrl:n});case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(8),e.abrupt("return",{ableToUseModel:!1});case 16:return e.next=18,$Z({modelUrl:i});case 18:return e.prev=18,e.next=21,eJ({idCardModel:d});case 21:f=e.sent,p=f.fastEnough,l=p,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),l=!1;case 29:return e.abrupt("return",{ableToUseModel:l,idCardModel:d,blazefaceModel:u});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var nJ=PZ((function(){return rJ.apply(this,arguments)})),oJ=uL.Errors;function aJ(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=xC.useRef(null);null===a.current&&(a.current=document.createElement("canvas"));var i=xC.useRef(!1),s=xC.useRef(Jz.createResizer({width:960,height:640})),c=xC.useRef(null),u=xC.useRef([{id:null,frames:[]}]),l=xC.useCallback((function(){!0===i.current&&(i.current=!1)}),[]),d=xC.useCallback((function(){u.current=[{id:null,frames:[]}]}),[]),f=xC.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),p=xC.useCallback(function(){var e=SK(regeneratorRuntime.mark((function e(t){var r,n,a,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,a=u.current,i=n.resize({srcCanvas:r}),c=i.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=xC.useCallback(SK(regeneratorRuntime.mark((function e(){var r,n,s,u,l,d,f,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:if(r=o.frameCaptureIntervalMs,n=void 0===r?180:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:s=c.current,u=t.current,i.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=a.current).width=f,m.height=h,g=m.getContext("2d");case 13:return v=performance.now(),g.drawImage(u,l,d,f,h,0,0,f,h),e.next=18,p({workingCanvas:m});case 18:if(v=Math.floor(performance.now()-v),i.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,tV.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return xC.useEffect((function(){var e=t.current;function o(){return(o=SK(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=xV.analyzeVideoAndWindowSizes(e,n),t.next=3,h();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return r&&n&&function(){o.apply(this,arguments)}(),function(){l()}}),[r,n,t,l,f,h]),{refWorkingCanvas:a,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var iJ=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,a=e.settings,i=e.shouldStartTimers,s=e.sessionTime,c=xC.useRef(),u=PK(xC.useState(0),2),l=u[0],d=u[1],f=xC.useCallback((function(){clearInterval(c.current)}),[]),p=xC.useCallback((function(){d((function(e){return e+1}))}),[]);return xC.useEffect((function(){if(i){var e=a.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var a=s-(t+=1);a<=u&&r&&r({curTimeLeft:a}),t>0&&t%e==0&&o&&o(),0===a&&(f(),n&&n())}),1e3)}return function(){f()}}),[i,t,r,f,n,o,l,a,s]),{stopTimers:f,startTimers:p}};lK.initExifData();var sJ=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onModelErrorChange,i=e.frontSide,s=e.allowedCardTypes,c=e.onDebugInfoChange,u=e.onAboutToTimeout,l=e.onSessionTimeout,d=e.onCaptureDone,f=e.outputEncryptionSettings,p=e.quality,h=xC.useRef(!1),m=PK(xC.useState(!1),2),g=m[0],v=m[1],y=xC.useRef((function(){})),b=Yj.useSDKTracking().sendEvent,C=xC.useRef(),w=xC.useRef(),k=xC.useRef(),S=yj.useSDKSettings(),E=S.debug,B=S.lang,_=S.enableAntiDebug,x=S.exifKey,T=hK(),A=T.startMotion,I=T.stopMotion,P=T.motionData,R=T.orientationData;xC.useEffect((function(){_&&zq.enableAntiDebug()}),[_]);var D=xC.useCallback(function(){var e=SK(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b({tag:i?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,y.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[b,i]),N=xC.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(void 0,t);var n=hY(t,"0.code");n&&n!==C.current&&(b({tag:i?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),C.current=n)}),[a,i,b]),O=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.allowedCardTypes,i=e.onError,s=e.frontSide,c=e.onAutoCaptureSuccess,u=e.quality,l=xC.useRef(null);null===l.current&&(l.current=document.createElement("canvas"));var d=xC.useRef(0),f=xC.useRef([]),p=xC.useRef(null);null===p.current&&(p.current=document.createElement("canvas"));var h=xC.useRef({}),m=xC.useRef([]),g=xC.useRef(""),v=xC.useRef(!1),y=xC.useRef(!1),b=xC.useRef(!1),C=xC.useRef(null),w=PK(xC.useState(!1),2),k=w[0],S=w[1],E=xC.useRef({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),B=xC.useRef({imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}),_=xC.useRef(!1),x=xC.useRef(!1),T=xC.useRef(null),A=xC.useRef(!1),I=xC.useRef({}),P=yj.useSDKSettings(),R=P.customUrls,D=P.country,N=xC.useMemo((function(){return a.length>0?a:null==o?void 0:o.allowedCardTypesFromSettings}),[a,null==o?void 0:o.allowedCardTypesFromSettings]);xC.useEffect((function(){var e=!1;function t(){return(t=SK(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||k){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,nJ(R,D);case 4:return I.current=t.sent,t.next=7,Vq.initTensorFlow();case 7:T.current=o.enableBlurCheck&&I.current.ableToUseModel,t.next=11;break;case 10:T.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:S(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[k,o,R,D]);var O=xC.useCallback((function(e){return V$({currentWorkingCanvas:e,refVirtualWorkingCanvas:p,refCountVirtualFrames:d,refVirtualFrames:f,refWorkingCanvas:l,refCardResult:h})}),[]),L=xC.useCallback((function(){!0===b.current&&(b.current=!1)}),[]),M=xC.useCallback(function(){var e=SK(regeneratorRuntime.mark((function e(t){var r,n,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,a=o.blurThreshold,i=E.current,s=B.current,v.current=!1,!(r<a&&BV.hasBetterCardBlurScore(r,i.blurScore))){e.next=18;break}if(!A.current){e.next=10;break}i.imageBlob=s.imageBlob,e.next=14;break;case 10:return e.next=12,xV.takePicture({canvas:l.current,quality:u});case 12:i.imageBlob=e.sent,i.captureTime=Date.now();case 14:i.takenAt=(new Date).getTime(),i.blurScore=r,i.detectedCard=n,i.captureType="auto";case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,u]),F=xC.useCallback(function(){var e=SK(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,x.current=!0,o=B.current,!BV.hasBetterCardBlurScore(r,o.blurScore)){e.next=14;break}return e.next=6,xV.takePicture({canvas:l.current,quality:u});case 6:o.imageBlob=e.sent,o.captureDuration+=Date.now()-o.captureTime,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,o.captureCount++,o.captureType="manual",A.current=!0;case 14:x.current=!1;case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u]),U=xC.useCallback((function(){var e=o.waitForBestImageTimeMs,t=E.current;null!==t.imageBlob&&(new Date).getTime()-t.takenAt>e&&(v.current=!0)}),[o]),j=xC.useCallback((function(){_.current=!0}),[]),V=xC.useCallback((function(){return new Promise((function(e){_.current=!1;var t=setInterval((function(){x.current||(clearInterval(t),e())}),150)}))}),[]),z=xC.useCallback(SK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t=o.blurThreshold,r=o.enableVirtualCamHashes,n=B.current;n.captureTime=Date.now(),T.current?(j(),setTimeout((function(){V().then(SK(regeneratorRuntime.mark((function o(){var a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(BV.hasBetterCardBlurScore(n.blurScore,t)||(n.error=oJ.id_detector_error_blur),a=l.current,null!==n.imageBlob){o.next=6;break}xV.takePicture({canvas:a,quality:u}).then(function(){var t=SK(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),!r){t.next=5;break}return t.next=5,O(a);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.next=10;break;case 6:if(!r){o.next=9;break}return o.next=9,O(a);case 9:e(n);case 10:case"end":return o.stop()}}),o)}))))}),2e3)):xV.takePicture({canvas:l.current,quality:u}).then(function(){var t=SK(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),!r){t.next=5;break}return t.next=5,O(l.current);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),[o,j,V,u,O]),q=xC.useCallback(SK(regeneratorRuntime.mark((function e(){var r,n,a,u,p,w,S,x,T,P,R,j,V,z,q,H,K,W,Q,G,X,Y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&k&&!b.current){e.next=2;break}return e.abrupt("return");case 2:E.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},B.current={imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0},r=o.enableAutoCapture,n=o.enableBlurCheck,a=o.enableIdDetection,u=o.country,p=o.enableVirtualCamHashes,w=I.current,S=w.idCardModel,x=w.blazefaceModel,T=w.ableToUseModel,P=C.current,R=t.current,b.current=!0,j=P.cropX,V=P.cropY,z=P.cropWidth,q=P.cropHeight,H=P.cropWidthWithoutPadding,K=P.cropHeightWithoutPadding,(W=l.current).width=z,W.height=q,Q=W.getContext("2d"),G=document.createElement("canvas"),X=G.getContext("2d"),Y=function(){var e=SK(regeneratorRuntime.mark((function e(){var t,C,w,k,I,P,$,Z;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q.drawImage(R,j,V,z,q,0,0,z,q),t=performance.now(),A.current=!1,!a||!T){e.next=63;break}return C=null,e.next=7,S.predict(W,{detectThreshold:.3});case 7:if(w=e.sent,null==o||!o.trackCardCoordinates||B.current.imageBlob||E.current.imageBlob||j$(m,U$(w),null==o?void 0:o.trackCardCoordinatesMaxLength),!w.card){e.next=60;break}if(!v.current&&r||(h.current=w.card),!v.current&&!B.current.imageBlob&&f.current.length>0&&(f.current=[],d.current=0,v.current=!1,y.current=!1),v.current&&!y.current&&(p&&setTimeout(SK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(y.current=!0,!p){e.next=4;break}return e.next=4,O(l.current);case 4:return e.next=6,c(E.current);case 6:L();case 7:case"end":return e.stop()}}),e)}))),0),v.current=!1,y.current=!1),!h$({corners:w.card.corners,width:z,height:q})){e.next=57;break}if(!v$(w.card.corners)){e.next=54;break}if(k=f$(W,w.card.corners),I=FV.rectAreaRatio({small:{area:k.width*k.height},big:{area:H*K}}),(hY(o,"enableCardTypeCheck")||N.length>0)&&"vn"===u&&(P=hY(w,"card.label",""),g.current=P,z$(P,N)||(C=oJ.not_allowed_card_types)),C){e.next=52;break}if(!(I<.5)){e.next=25;break}C=oJ.id_detector_card_too_small,e.next=52;break;case 25:if(!(I>.95)){e.next=29;break}C=oJ.id_detector_error_incomplete,e.next=52;break;case 29:return G.width=k.width,G.height=k.height,X.putImageData(k,0,0),e.next=34,m$({canvas:G});case 34:if(!e.sent){e.next=39;break}C=oJ.glare_detected,e.next=52;break;case 39:if("ph"===D){e.next=43;break}return e.next=42,y$({blazefaceModel:x,predictedIdCardCanvas:G,frontSide:s});case 42:C=e.sent;case 43:if(C){e.next=52;break}if(!n){e.next=52;break}if($=BV.calculateIdCardBlurScore({canvas:G}),!_.current){e.next=49;break}return e.next=49,F({blurScore:$,detectedCard:w.card});case 49:if(!r){e.next=52;break}return e.next=52,M({blurScore:$,detectedCard:w.card});case 52:e.next=55;break;case 54:C=oJ.id_detector_validate_angle_error;case 55:e.next=58;break;case 57:C=oJ.id_detector_error_incomplete;case 58:e.next=61;break;case 60:C=oJ.id_detector_no_cards;case 61:i(C),U();case 63:return t=Math.floor(performance.now()-t),Z=180-t>0?180-t:0,e.next=67,new Promise((function(e){return setTimeout(e,Z)}));case 67:b.current&&window.requestAnimationFrame(Y);case 68:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(Y);case 19:case"end":return e.stop()}}),e)}))),[o,k,t,i,U,c,L,D,O,s,F,M,N]);xC.useEffect((function(){var e=t.current;function o(){return(o=SK(regeneratorRuntime.mark((function t(){var r,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(C.current=xV.analyzeVideoAndWindowSizes(e,n,.05),r=C.current,o=r.cropWidth,a=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(a)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,q();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&k&&function(){o.apply(this,arguments)}()}),[r,n,t,L,q,k]);var H=xC.useCallback((function(){L()}),[L]);return xC.useEffect((function(){return H}),[H]),{refWorkingCanvas:l,stopCheckFrame:L,checkFrame:q,warmupDone:k,takePictureManually:z,refAbleToRunBurstMode:T,refVirtualFrames:f,refCardCoordinates:m,refCardLabel:g}}({refVideo:r,shouldStart:t,cropArea:n,allowedCardTypes:s,settings:o,onError:N,frontSide:i,onAutoCaptureSuccess:D,quality:p}),L=O.refWorkingCanvas,M=O.stopCheckFrame,F=O.checkFrame,U=O.warmupDone,j=O.takePictureManually,V=O.refAbleToRunBurstMode,z=O.refVirtualFrames,q=O.refCardCoordinates,H=O.refCardLabel,K=aJ({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),W=K.stopCheckFrame,Q=K.splitVideos,G=K.resetRecordedVideos,X=K.checkFrame;!function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,a=e.onChange;xC.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,i=n.current,s=t[t.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==i?void 0:i.width,"canvas.height":null==i?void 0:i.height};a&&a(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[a,t,r,n,o])}({debug:E,refRecordedVideos:K.refRecordedVideos,refWorkingCanvas:L,refVideo:r,onChange:c});var Y=xC.useCallback((function(){W(),M(),G(),l()}),[G,W,M,l]),$=xC.useCallback((function(){Q()}),[Q]),Z=iJ({lang:B,onAboutToTimeout:u,onSessionTimeout:Y,onVideoTimeLimitReached:$,settings:o,shouldStartTimers:U&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),J=Z.stopTimers,ee=Z.startTimers,te=xC.useCallback((function(){h.current=!1}),[]),re=xC.useCallback(SK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return te(),ee(),e.next=4,Promise.all([X(),F()]);case 4:case"end":return e.stop()}}),e)}))),[te,ee,X,F]),ne=xC.useCallback(SK(regeneratorRuntime.mark((function e(){var t,r,n,a,s,c,u,l,p,m,g,y,C,S,E,B,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_.length>0&&void 0!==_[0]?_[0]:{},r=t.imageBlob,n=t.error,a=t.detectedCard,s=t.captureTime,c=t.captureCount,u=t.captureDuration,l=t.captureType,!h.current){e.next=3;break}return e.abrupt("return");case 3:return h.current=!0,v(!0),W(),M(),J(),N(null),p=null==o?void 0:o.enableVirtualCamHashes,m={},p&&(g=z).current.length>0&&(m=g.current.reduce((function(e,t,r){return TK(TK({},e),{},BK({},"hash".concat(r+1),t))}),m)),y=null==o?void 0:o.trackCardCoordinates,C="[".concat(q.current.toString(),"]"),I(),lK.preWriteExif({mode:lK.MODE.ID_CARD,motionData:P,orientationData:R,startTime:w.current,endTime:Date.now(),exifKey:x}),e.next=18,lK.writeExif({mode:lK.MODE.ID_CARD,imageData:TK(TK({detectedCard:a,captureTime:s,blob:r},p?{vCam:m}:{}),{},{captureCount:c,captureDuration:u,captureType:l},y?{cardTracking:C}:{}),enableExifData:null==o?void 0:o.enableExifData});case 18:if(S=e.sent,!f||!f.key){e.next=24;break}return B=f.key,e.next=23,Kq.encrypt({blob:S,key:B});case 23:E=e.sent;case 24:d({image:{blob:S,encrypted:E,detectedCard:a},error:n,recordedVideos:[]}),v(!1),b({tag:i?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-k.current)/1e3}});case 27:case"end":return e.stop()}}),e)}))),[W,M,J,N,d,i,b,f,P,R,I,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,null==o?void 0:o.trackCardCoordinates,x,z,q]);y.current=ne;var oe=xC.useCallback(SK(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),J(),W(),V.current||M(),e.next=6,j();case 6:return t=e.sent,e.next=9,ne(t);case 9:v(!1),b({tag:i?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[j,ne,J,V,W,M,b,i]);return xC.useEffect((function(){t&&(b({tag:i?"id_front":"id_back",event:"user_activity.start",log:{}}),w.current=Date.now(),A())}),[b,i,t,A]),xC.useEffect((function(){U&&(b({tag:i?"id_front":"id_back",event:"user_activity.show",log:{}}),b({tag:i?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-w.current}}),k.current=performance.now())}),[b,i,U]),{warmupDone:U,isProcessing:g,takePictureManually:oe,restartSession:re,resetIsProcessingImageBlobTaken:te,refCardLabel:H}},cJ=uL.IDCardMessage,uJ=xC.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,a=e.refVideo,i=e.frontSide,s=e.allowedCardTypes,c=e.settings,u=e.onCaptureDone,l=e.onUISpacingChange,d=e.outputEncryptionSettings,f=mB(),p=PK(xC.useState({}),2),h=p[0],m=p[1],g=h.yDescription,v=h.yMessage,y=h.yCaptureButton,b=gY(f,"IDCapturing.captureIcon.src","ic_camera.svg"),C=gY(f,"IDCapturing.loadingIcon.src","ic_loading.png"),w=PK(xC.useState(""),2),k=w[0],S=w[1],E=yj.useSDKSettings(),B=E.debug,_=E.lang,x=PK(xC.useState(null),2),T=x[0],A=x[1],I=PK(xC.useState(""),2),P=I[0],R=I[1],D=PK(xC.useState(null),2),N=D[0],O=D[1],L=hZ(),M=L.showPopup,F=L.popupShown,U=L.popupType,j=xC.useCallback((function(e){R(null===e?"":mG(e.msg[_])({side:i?s$.FRONT[_]:s$.BACK[_]}))}),[_,i]),V=xC.useCallback((function(){A(""),M({popupType:mZ})}),[M]),z=xC.useCallback((function(){A(""),u.apply(void 0,arguments)}),[u]),q=xC.useCallback((function(e){var t=e.curTimeLeft;A(mG(cJ.REMAINING_TIME[_])({x:t}))}),[_]),H=sJ({shouldStart:!0,refVideo:a,cropArea:N,settings:c,onModelErrorChange:j,frontSide:i,allowedCardTypes:s,onDebugInfoChange:S,onSessionTimeout:V,onCaptureDone:z,onAboutToTimeout:q,outputEncryptionSettings:d}),K=H.warmupDone,W=H.isProcessing,Q=H.takePictureManually,G=H.restartSession,X=H.resetIsProcessingImageBlobTaken,Y=H.refCardLabel,$=xC.useCallback((function(){M({popupType:null}),X()}),[M,X]),Z=xC.useCallback(SK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $(),e.next=3,G();case 3:case"end":return e.stop()}}),e)}))),[G,$]),J=xC.useMemo((function(){return{backgroundColor:mY(f,"IDCapturing.backgroundColor",qY)}}),[f]);xC.useEffect((function(){if(o){var e,t,r,a,i,s,c,u=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,p=o.lostY,h=o.clientHeight;n?(i=.7*(s=d-165),r=(c=(e=p+10)+45)+20,a=(t=c+s+10)+60):(i=iW.isMobile?u-6:Math.floor(.7*u),r=(c=(e=p+10)+50)+20,a=(t=c+(s=Math.floor(Math.min(i/1.5,h-2*p-80-100)))+10)+60);var g=Math.floor((u-i)/2)+f;O({x:g,y:c,width:i,height:s,surroundStyle:J});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:a};m(v),l(v)}}),[o,n,l,J]);var ee=xC.useCallback(SK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(""),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q]);return xC.useImperativeHandle(t,(function(){return{restartSession:Z}}),[Z]),xC.createElement(xC.Fragment,null,!K&&xC.createElement(cZ,null),B&&xC.createElement(tZ,null,k),W&&xC.createElement(Y$,null,xC.createElement("img",{src:C,alt:"",className:"spin"})),N&&xC.createElement(AY,{x:"".concat(N.x,"px"),y:"".concat(N.y,"px"),width:"".concat(N.width,"px"),height:"".concat(N.height,"px"),surroundStyle:N.surroundStyle},xC.createElement(aZ,{width:N.width,height:N.height,type:P?KY:HY})),!P&&xC.createElement(rZ,{y:"".concat(g,"px"),className:"description"},r),xC.createElement("div",{style:{position:"fixed",bottom:0,left:0,color:"#fff",padding:30}},Y.current),xC.createElement("div",{style:{position:"fixed",bottom:0,left:0,color:"#fff",padding:30}},Y.current),P&&xC.createElement(nZ,{y:"".concat(g,"px")},P),!W&&(!(null!=c&&c.disableCaptureButtonIfAlert)||!P)&&xC.createElement(X$,{onClick:ee,y:"".concat(y,"px")},xC.createElement("img",{src:b,alt:""})),T&&xC.createElement(oZ,{key:T,className:"message",y:"".concat(v,"px")},T),xC.createElement(VY,{open:F},U===mZ&&xC.createElement(pZ,{onOk:Z,maxSessionTime:null==c?void 0:c.idCardSessionTime})))}));uJ.propTypes={usePortraitMask:xw.bool,description:xw.string,windowAndVideoInfo:xw.shape({}),refVideo:xw.shape({}),frontSide:xw.bool,allowedCardTypes:xw.arrayOf(xw.string),settings:xw.shape({}),onCaptureDone:xw.func,onUISpacingChange:xw.func,outputEncryptionSettings:xw.shape({})},uJ.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,allowedCardTypes:[],settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var lJ,dJ,fJ={QR_INSTRUCTIONS_TEXT:{en:xC.createElement("span",null,"Please follow the instructions below to scan QR code:",xC.createElement("br",null),xC.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:xC.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",xC.createElement("br",null),xC.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:xC.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",xC.createElement("br",null),xC.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",xC.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:xC.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",xC.createElement("br",null),xC.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",xC.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"}},pJ=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,a=e.mr,i=e.mx,s=e.my,c=e.pt,u=e.pb,l=e.pl,d=e.pr,f=e.px,p=e.py,h=t.props.style||{},m={};return null!==i&&(m.marginLeft=i,m.marginRight=i),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==a&&(m.marginRight=a),null!==f&&(m.paddingLeft=f,m.paddingRight=f),null!==p&&(m.paddingTop=p,m.paddingBottom=p),null!==c&&(m.paddingTop=c),null!==u&&(m.paddingBottom=u),null!==l&&(m.paddingLeft=l),null!==d&&(m.paddingRight=d),xC.cloneElement(t,{style:TK(TK({},h),m)})};pJ.propTypes={mt:xw.string,ml:xw.string,mr:xw.string,mb:xw.string,mx:xw.string,my:xw.string,pt:xw.string,pl:xw.string,pr:xw.string,pb:xw.string,px:xw.string,py:xw.string},pJ.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 hJ,mJ,gJ,vJ,yJ,bJ,CJ,wJ,kJ=dB.button(lJ||(lJ=IK(["\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})),SJ=(dB.a(dJ||(dJ=IK(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),["children","ratio","padding"]),EJ=dB.div(hJ||(hJ=IK(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),BJ=dB.div(mJ||(mJ=IK(["\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})),_J=function(e){var t=e.children,r=e.ratio,n=e.padding,o=AK(e,SJ);return xC.createElement(EJ,_K({ratio:r},o),xC.createElement(BJ,{padding:n},t))};_J.propTypes={children:xw.node,ratio:xw.number,padding:xw.string},_J.defaultProps={children:null,ratio:4/3,padding:"0"};var xJ,TJ,AJ,IJ,PJ,RJ=dB.div(gJ||(gJ=IK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),DJ=dB.div(vJ||(vJ=IK(["\n background: #e7e6e6;\n width: 100%;\n border-radius: ",";\n"])),(function(e){var t=e.theme;return mY(t,"QRStep.guidelinePopup.image.borderRadius",qY)})),NJ=dB.img(yJ||(yJ=IK(["\n width: 100%;\n height: auto;\n object-fit: contain;\n"]))),OJ=dB.div(bJ||(bJ=IK(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n text-align: ",";\n line-height: ",";\n"])),(function(e){var t=e.theme,r=e.$type;return mY(t,"QRStep.guidelinePopup.".concat(r,".color"),qY)}),(function(e){var t=e.theme,r=e.$type;return mY(t,"QRStep.guidelinePopup.".concat(r,".fontSize"),qY)}),(function(e){var t=e.theme,r=e.$type;return mY(t,"QRStep.guidelinePopup.".concat(r,".fontWeight"),qY)}),(function(e){var t=e.theme,r=e.$type;return mY(t,"QRStep.guidelinePopup.".concat(r,".textAlign"),qY)}),(function(e){var t=e.theme,r=e.$type;return mY(t,"QRStep.guidelinePopup.".concat(r,".lineHeight"),qY)})),LJ=dB(OJ)(CJ||(CJ=IK(["\n white-space: nowrap;\n"]))),MJ=dB(kJ)(wJ||(wJ=IK(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n"])),(function(e){var t=e.theme;return mY(t,"QRStep.guidelinePopup.startButton.color",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.guidelinePopup.startButton.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.guidelinePopup.startButton.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.guidelinePopup.startButton.backgroundColor",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.guidelinePopup.startButton.border",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.guidelinePopup.startButton.borderRadius",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.guidelinePopup.startButton.outline",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.guidelinePopup.startButton.height",qY)})),FJ=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=yj.useSDKSettings().lang,a=mB(),i=gY(a,"QRStep.guidelinePopup.image.src","qr_code_banner.png"),s=xC.useRef(n),c=PK(xC.useState((function(){return mG(fJ.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),u=c[0],l=c[1],d=Yj.useSDKTracking().sendEvent,f=xC.useRef(!1);return xC.useEffect((function(){d({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[d]),xC.useEffect((function(){var e=mG(fJ.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){s.current--,l(e({x:s.current})),s.current<=0&&(clearInterval(t),f.current||d({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),r&&r())}),1e3);return function(){clearInterval(t)}}),[o,r]),xC.createElement(RJ,null,xC.createElement(DJ,null,xC.createElement(_J,{ratio:1.6},xC.createElement(NJ,{src:i}))),xC.createElement(pJ,{mt:"30px"},xC.createElement(OJ,{$type:"guideText"},fJ.QR_INSTRUCTIONS_TEXT[o])),xC.createElement(pJ,{mt:"30px"},xC.createElement(MJ,{onClick:function(){d({tag:"id_qr",event:"user_activity.click_start",log:{}}),f.current=!0,t()}},fJ.QR_INSTRUCTIONS_START_BUTTON[o])),xC.createElement(pJ,{my:"20px"},xC.createElement(LJ,{$type:"countdownText"},u)))};FJ.propTypes={onClickStart:xw.func,onTimeout:xw.func,timeout:xw.number},FJ.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var UJ,jJ,VJ,zJ=dB.div(xJ||(xJ=IK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: ",";\n"])),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.padding",qY)})),qJ=dB.div(TJ||(TJ=IK(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n margin: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.title.color",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.title.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.title.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.title.margin",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.title.padding",qY)})),HJ=dB.div(AJ||(AJ=IK(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n text-align: ",";\n margin: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.description.color",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.description.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.description.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.description.textAlign",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.description.margin",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.description.padding",qY)})),KJ=dB(kJ)(IJ||(IJ=IK(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n margin: ",";\n"])),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.retryButton.color",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.retryButton.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.retryButton.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.retryButton.backgroundColor",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.retryButton.border",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.retryButton.borderRadius",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.retryButton.outline",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.retryButton.height",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.retryButton.margin",qY)})),WJ=dB(kJ)(PJ||(PJ=IK(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n margin: ",";\n"])),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.skipButton.color",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.skipButton.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.skipButton.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.skipButton.backgroundColor",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.skipButton.border",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.skipButton.borderRadius",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.skipButton.outline",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.skipButton.height",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.invalidPopup.skipButton.margin",qY)})),QJ=function(e){var t=e.onRetry,r=e.onSkip,n=yj.useSDKSettings().lang;return xC.createElement(zJ,null,xC.createElement(qJ,null,fJ.QR_INVALID_POPUP_TITLE[n]),xC.createElement(HJ,null,fJ.QR_INVALID_POPUP_DESCRIPTION[n]),xC.createElement(KJ,{onClick:t},fJ.QR_INVALID_POPUP_RETRY_BUTTON[n]),xC.createElement(WJ,{onClick:r},fJ.QR_INVALID_POPUP_SKIP_BUTTON[n]))};QJ.propTypes={onRetry:xw.func,onSkip:xw.func},QJ.defaultProps={onRetry:function(){},onSkip:function(){}};var GJ=dB.div(UJ||(UJ=IK(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: ",";\n top: ",";\n position: absolute;\n z-index: ",";\n color: ",";\n padding: ",";\n margin: 0 10px;\n max-width: 275px;\n text-align: ",";\n"])),(function(e){var t=e.theme;return mY(t,"QRStep.scanTooltip.backgroundColor",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.scanTooltip.borderRadius",qY)}),(function(e){return e.y}),1020,(function(e){var t=e.theme;return mY(t,"QRStep.scanTooltip.color",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.scanTooltip.padding",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.scanTooltip.textAlign",qY)})),XJ=dB.div(jJ||(jJ=IK(["\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){var t=e.arrowSize,r=e.theme;return"".concat(t,"px solid ").concat(mY(r,"QRStep.scanTooltip.backgroundColor",qY))}),(function(e){return"".concat(e.top,"px")})),YJ=function(e){var t=e.children,r=e.y;return xC.createElement(GJ,{y:r},xC.createElement(XJ,{arrowSize:10,top:-10}),t)},$J=dB.div(VJ||(VJ=IK(["\n text-align: ",";\n position: absolute;\n font-size: ",";\n font-weight: ",";\n border-radius: ",";\n padding: ",";\n background: ",";\n color: ",";\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){var t=e.theme;return mY(t,"QRStep.scanCountdown.textAlign",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.scanCountdown.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.scanCountdown.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.scanCountdown.borderRadius",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.scanCountdown.padding",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.scanCountdown.backgroundColor",qY)}),(function(e){var t=e.theme;return mY(t,"QRStep.scanCountdown.color",qY)}),(function(e){return e.y}),1020),ZJ=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function JJ(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 e3=function(){var e=SK(regeneratorRuntime.mark((function e(t,r){var n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$Z();case 2:if(n=e.sent,o=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return a=document.createElement("canvas"),i=a.getContext("2d"),e.next=11,new Promise((function(e){var r=URL.createObjectURL(t),n=new Image;n.onload=function(){var t=n.width,o=n.height;a.width=t/2,a.height=o/2,i.drawImage(n,t/2,0,a.width,a.height,0,0,a.width,a.height),URL.revokeObjectURL(r),e()},n.src=r}));case 11:return e.next=13,JJ({canvas:a,qrModel:o});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,lK.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,Kq.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}});case 25:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),t3=nW(oW((function(e,t){var r;r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height||!this.data[t*this.width+e])},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,o){for(var a=t;a<t+n;a++)for(var i=e;i<e+r;i++)this.set(i,a,!!o)},e}();t.BitMatrix=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.addOrSubtractGF=function(e,t){return e^t};var o=function(){function e(e,t,r){this.primitive=e,this.size=t,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var o=1,a=0;a<this.size;a++)this.expTable[a]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,t){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===t)return this.zero;var r=new Uint8ClampedArray(e+1);return r[0]=t,new n.default(this,r)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=function(){function e(e,t){if(0===t.length)throw new Error("No coefficients.");this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;if(n===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-n);for(var o=0;o<this.coefficients.length;o++)this.coefficients[o]=t[n+o]}}else this.coefficients=t}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(t){var r;if(this.isZero())return t;if(t.isZero())return this;var o=this.coefficients,a=t.coefficients;o.length>a.length&&(o=(r=[a,o])[0],a=r[1]);for(var i=new Uint8ClampedArray(a.length),s=a.length-o.length,c=0;c<s;c++)i[c]=a[c];for(c=s;c<a.length;c++)i[c]=n.addOrSubtractGF(o[c-s],a[c]);return new e(this.field,i)},e.prototype.multiply=function(t){if(0===t)return this.field.zero;if(1===t)return this;for(var r=this.coefficients.length,n=new Uint8ClampedArray(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,n)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var r=this.coefficients,o=r.length,a=t.coefficients,i=a.length,s=new Uint8ClampedArray(o+i-1),c=0;c<o;c++)for(var u=r[c],l=0;l<i;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,a[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new Error("Invalid degree less than 0");if(0===r)return this.field.zero;for(var n=this.coefficients.length,o=new Uint8ClampedArray(n+t),a=0;a<n;a++)o[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,o)},e.prototype.evaluateAt=function(e){var t=0;if(0===e)return this.getCoefficient(0);var r=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){t=n.addOrSubtractGF(t,e)})),t;t=this.coefficients[0];for(var o=1;o<r;o++)t=n.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[o]);return t},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(5),a=r(11),i=r(12);function s(e){var t=i.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=a.extract(e,s),u=o.decode(c.matrix);if(u)return{binaryData:u.bytes,data:u.text,chunks:u.chunks,version:u.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:"attemptBoth"};function u(e,t,r,o){void 0===o&&(o={});var a=c;Object.keys(a||{}).forEach((function(e){a[e]=o[e]||a[e]}));var i="attemptBoth"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,u="onlyInvert"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,l=n.binarize(e,t,r,i),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==a.inversionAttempts&&"invertFirst"!==a.inversionAttempts||(p=s(u?d:f)),p}u.default=u,t.default=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r){return e<t?t:e>r?r:e}var a=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,i){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new a(t,r),c=0;c<t;c++)for(var u=0;u<r;u++){var l=e[4*(u*t+c)+0],d=e[4*(u*t+c)+1],f=e[4*(u*t+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(t/8),h=Math.ceil(r/8),m=new a(p,h),g=0;g<h;g++)for(var v=0;v<p;v++){var y=0,b=1/0,C=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var w=s.get(8*v+c,8*g+u);y+=w,b=Math.min(b,w),C=Math.max(C,w)}var k=y/Math.pow(8,2);if(C-b<=24&&(k=b/2,g>0&&v>0)){var S=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<S&&(k=S)}m.set(v,g,k)}var E=n.BitMatrix.createEmpty(t,r),B=null;for(i&&(B=n.BitMatrix.createEmpty(t,r)),g=0;g<h;g++)for(v=0;v<p;v++){for(var _=o(v,2,p-3),x=o(g,2,h-3),T=(y=0,-2);T<=2;T++)for(var A=-2;A<=2;A++)y+=m.get(_+T,x+A);var I=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var P=s.get(c,u);E.set(c,u,P<=I),i&&B.set(c,u,!(P<=I))}}return i?{binarized:E,inverted:B}:{binarized:E}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),a=r(9),i=r(10);function s(e,t){for(var r=e^t,n=0;r;)n++,r&=r-1;return n}function c(e,t){return t<<1|e}var u=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],l=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e,t,r){for(var o=l[r.dataMask],a=e.height,i=function(e){var t=17+4*e.versionNumber,r=n.BitMatrix.createEmpty(t,t);r.setRegion(0,0,9,9,!0),r.setRegion(t-8,0,8,9,!0),r.setRegion(0,t-8,9,8,!0);for(var o=0,a=e.alignmentPatternCenters;o<a.length;o++)for(var i=a[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===i&&6===u||6===i&&u===t-7||i===t-7&&6===u||r.setRegion(i-2,u-2,5,5,!0)}return r.setRegion(6,9,1,t-17,!0),r.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),s=[],u=0,d=0,f=!0,p=a-1;p>0;p-=2){6===p&&p--;for(var h=0;h<a;h++)for(var m=f?a-1-h:h,g=0;g<2;g++){var v=p-g;if(!i.get(v,m)){d++;var y=e.get(v,m);o({y:m,x:v})&&(y=!y),u=c(y,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var t=function(e){var t=e.height,r=Math.floor((t-17)/4);if(r<=6)return i.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var a=t-9;a>=t-11;a--)n=c(e.get(a,o),n);var u=0;for(a=5;a>=0;a--)for(o=t-9;o>=t-11;o--)u=c(e.get(a,o),u);for(var l,d=1/0,f=0,p=i.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var m=s(n,h.infoBits);m<d&&(l=h,d=m),(m=s(u,h.infoBits))<d&&(l=h,d=m)}return d<=3?l:void 0}(e);if(!t)return null;var r=function(e){for(var t=0,r=0;r<=8;r++)6!==r&&(t=c(e.get(r,8),t));for(var n=7;n>=0;n--)6!==n&&(t=c(e.get(8,n),t));var o=e.height,a=0;for(n=o-1;n>=o-7;n--)a=c(e.get(8,n),a);for(r=o-8;r<o;r++)a=c(e.get(r,8),a);for(var i=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,m=p.formatInfo;if(h===t||h===a)return m;var g=s(t,h);g<i&&(l=m,i=g),t!==a&&(g=s(a,h))<i&&(l=m,i=g)}return i<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],a=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),a+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<a)return null;e=e.slice(0,a);for(var i=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<i;s++)for(var c=0,u=o;c<u.length;c++)u[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var l=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)o[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=o;f<p.length;f++)p[f].codewords.push(e.shift());return o}(d(e,t,r),t,r.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,t){return e+t.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,m=n;h<m.length;h++){var g=m[h],v=a.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[p++]=v[y]}try{return o.decode(f,t.versionNumber)}catch(e){return null}}t.decode=function(e){if(null==e)return null;var t=f(e);if(t)return t;for(var r=0;r<e.width;r++)for(var n=r+1;n<e.height;n++)e.get(r,n)!==e.get(n,r)&&(e.set(r,n,!e.get(r,n)),e.set(n,r,!e.get(n,r)));return f(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o,a=r(7),i=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],a=e.readBits(o);a>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var i=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+i,48+s,48+c),n+=i.toString()+s.toString()+c.toString(),a-=3}if(2===a){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");i=Math.floor(u/10),s=u%10,r.push(48+i,48+s),n+=i.toString()+s.toString()}else if(1===a){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+u),n+=u.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(o||(o={}));var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(e,t){for(var r=[],n="",o=[9,11,13][t],a=e.readBits(o);a>=2;){var i=e.readBits(11),s=Math.floor(i/45),u=i%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],a-=2}return 1===a&&(s=e.readBits(6),r.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:r,text:n}}function l(e,t){for(var r=[],n="",o=[8,16,16][t],a=e.readBits(o),i=0;i<a;i++){var s=e.readBits(8);r.push(s)}try{n+=decodeURIComponent(r.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:r,text:n}}function d(e,t){for(var r=[],n="",o=[8,10,12][t],a=e.readBits(o),s=0;s<a;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,r.push(u>>8,255&u),n+=String.fromCharCode(i.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,i,c,f,p=new a.BitStream(e),h=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};p.available()>=4;){var g=p.readBits(4);if(g===o.Terminator)return m;if(g===o.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===o.Numeric){var v=s(p,h);m.text+=v.text,(r=m.bytes).push.apply(r,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===o.Alphanumeric){var y=u(p,h);m.text+=y.text,(i=m.bytes).push.apply(i,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===o.Byte){var b=l(p,h);m.text+=b.text,(c=m.bytes).push.apply(c,b.bytes),m.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(g===o.Kanji){var C=d(p,h);m.text+=C.text,(f=m.bytes).push.apply(f,C.bytes),m.chunks.push({type:n.Kanji,bytes:C.bytes,text:C.text})}}if(0===p.available()||0===p.readBits(p.available()))return m}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e<r?e:r,o=255>>8-n<<(a=r-n);t=(this.bytes[this.byteOffset]&o)>>a,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var a;e>0&&(o=255>>(a=8-e)<<a,t=t<<e|(this.bytes[this.byteOffset]&o)>>a,this.bitOffset+=e)}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var a=new n.default(285,256,0),i=new o.default(a,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=i.evaluateAt(a.exp(u+a.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(a,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var a=t,i=r,s=e.zero,c=e.one;i.degree()>=n/2;){var u=a,l=s;if(s=c,(a=i).isZero())return null;i=u;for(var d=e.zero,f=a.getCoefficient(a.degree()),p=e.inverse(f);i.degree()>=a.degree()&&!i.isZero();){var h=i.degree()-a.degree(),m=e.multiply(i.getCoefficient(i.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),i=i.addOrSubtract(a.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),i.degree()>=a.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),i.multiply(v)]}(a,a.buildMonomial(t,1),d,t);if(null===f)return null;var p=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),o=0,a=1;a<e.size&&o<r;a++)0===t.evaluateAt(a)&&(n[o]=e.inverse(a),o++);return o!==r?null:n}(a,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,a=new Array(o),i=0;i<o;i++){for(var s=e.inverse(r[i]),c=1,u=0;u<o;u++)i!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));a[i]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(a[i]=e.multiply(a[i],s))}return a}(a,f[1],p),m=0;m<p.length;m++){var g=r.length-1-a.log(p[m]);if(g<0)return null;r[g]=n.addOrSubtractGF(r[g],h[m])}return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r,n){var o=e.x-t.x+r.x-n.x,a=e.y-t.y+r.y-n.y;if(0===o&&0===a)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:r.x-t.x,a22:r.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var i=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=i*u-s*c,d=(o*u-s*a)/l,f=(i*a-o*c)/l;return{a11:t.x-e.x+d*t.x,a12:t.y-e.y+d*t.y,a13:d,a21:n.x-e.x+f*n.x,a22:n.y-e.y+f*n.y,a23:f,a31:e.x,a32:e.y,a33:1}}t.extract=function(e,t){for(var r=function(e,t,r,n){var a=o({x:3.5,y:3.5},t,r,n);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}(0,{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),a=function(e,t){return{a11:e.a11*t.a11+e.a21*t.a12+e.a31*t.a13,a12:e.a12*t.a11+e.a22*t.a12+e.a32*t.a13,a13:e.a13*t.a11+e.a23*t.a12+e.a33*t.a13,a21:e.a11*t.a21+e.a21*t.a22+e.a31*t.a23,a22:e.a12*t.a21+e.a22*t.a22+e.a32*t.a23,a23:e.a13*t.a21+e.a23*t.a22+e.a33*t.a23,a31:e.a11*t.a31+e.a21*t.a32+e.a31*t.a33,a32:e.a12*t.a31+e.a22*t.a32+e.a32*t.a33,a33:e.a13*t.a31+e.a23*t.a32+e.a33*t.a33}}(o(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft),r),i=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=a.a13*e+a.a23*t+a.a33;return{x:(a.a11*e+a.a21*t+a.a31)/r,y:(a.a12*e+a.a22*t+a.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);i.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:i,mappingFunction:s}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function o(e){return e.reduce((function(e,t){return e+t}))}function a(e,t,r,o){var a,i,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(t.y-e.y)>Math.abs(t.x-e.x);l?(a=Math.floor(e.y),i=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(a=Math.floor(e.x),i=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-a),f=Math.abs(c-i),p=Math.floor(-d/2),h=a<s?1:-1,m=i<c?1:-1,g=!0,v=a,y=i;v!==s+h;v+=h){var b=l?y:v,C=l?v:y;if(r.get(b,C)!==g&&(g=!g,u.push({x:b,y:C}),u.length===o+1))break;if((p+=f)>0){if(y===c)break;y+=m,p-=d}}for(var w=[],k=0;k<o;k++)u[k]&&u[k+1]?w.push(n(u[k],u[k+1])):w.push(0);return w}function i(e,t,r,n){var o,i=t.y-e.y,s=t.x-e.x,c=a(e,t,r,Math.ceil(n/2)),u=a(e,{x:e.x-s,y:e.y-i},r,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(o=u.concat(l)).concat.apply(o,c)}function s(e,t){var r=o(e)/o(t),n=0;return t.forEach((function(t,o){n+=Math.pow(e[o]-t*r,2)})),{averageSize:r,error:n}}function c(e,t,r){try{var n=i(e,{x:-1,y:e.y},r,t.length),o=i(e,{x:e.x,y:-1},r,t.length),a=i(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=i(e,{x:Math.min(r.width,e.x+e.y)+1,y:Math.min(r.height,e.y+e.x)+1},r,t.length),u=s(n,t),l=s(o,t),d=s(a,t),f=s(c,t),p=Math.sqrt(u.error*u.error+l.error*l.error+d.error*d.error+f.error*f.error),h=(u.averageSize+l.averageSize+d.averageSize+f.averageSize)/4;return p+(Math.pow(u.averageSize-h,2)+Math.pow(l.averageSize-h,2)+Math.pow(d.averageSize-h,2)+Math.pow(f.averageSize-h,2))/h}catch(e){return 1/0}}function u(e,t){for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r--;for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n++;for(var o=(r+n)/2,a=Math.round(t.y);e.get(Math.round(o),a);)a--;for(var i=Math.round(t.y);e.get(Math.round(o),i);)i++;return{x:o,y:(a+i)/2}}function l(e,t,r,a,s){var u,l,d;try{u=function(e,t,r,a){var s=(o(i(e,r,a,5))/7+o(i(e,t,a,5))/7+o(i(r,e,a,5))/7+o(i(t,e,a,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,t)/s),u=Math.round(n(e,r)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(a,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-a.x+s.x,p=r.y-a.y+s.y,h=(n(a,s)+n(a,r))/2/d,m=1-3/h,g={x:a.x+m*(f-a.x),y:a.y+m*(p-a.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,a=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(a)))return o([t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1]),{x:r,y:a,score:c({x:Math.floor(r),y:Math.floor(a)},[1,1,1],e)+n({x:r,y:a},g)}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));return{alignmentPattern:h>=15&&v.length?v[0]:g,dimension:l}}t.locate=function(e){for(var t=[],r=[],a=[],i=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var a=e.get(t,n);if(a===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=a;var l=o(u)/7,d=Math.abs(u[0]-l)<l&&Math.abs(u[1]-l)<l&&Math.abs(u[2]-3*l)<3*l&&Math.abs(u[3]-l)<l&&Math.abs(u[4]-l)<l&&!a,f=o(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&a;if(d){var h=t-u[3]-u[4],m=h-u[2],g={startX:m,endX:h,y:n};(v=r.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||h>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&h>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:r.push({top:g,bottom:g})}if(p){var v,y=t-u[4],b=y-u[3];g={startX:b,y:n,endX:y},(v=i.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||y>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&y>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:i.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)l(d);t.push.apply(t,r.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),r=r.filter((function(e){return e.bottom.y===n})),a.push.apply(a,i.filter((function(e){return e.bottom.y!==n}))),i=i.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);t.push.apply(t,r.filter((function(e){return e.bottom.y-e.top.y>=2}))),a.push.apply(a,i);var f=t.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],i=o(a)/a.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:i}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score})).map((function(e,t,r){if(t>4)return null;var n=r.filter((function(e,r){return t!==r})).map((function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}})).sort((function(e,t){return e.score-t.score}));if(n.length<2)return null;var o=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:o}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));if(0===f.length)return null;var p=function(e,t,r){var o,a,i,s,c,u,l,d=n(e,t),f=n(t,r),p=n(e,r);return f>=d&&f>=p?(c=(o=[t,e,r])[0],u=o[1],l=o[2]):p>=f&&p>=d?(c=(a=[e,t,r])[0],u=a[1],l=a[2]):(c=(i=[e,r,t])[0],u=i[1],l=i[2]),(l.x-u.x)*(c.y-u.y)-(l.y-u.y)*(c.x-u.x)<0&&(c=(s=[l,c])[0],l=s[1]),{bottomLeft:c,topLeft:u,topRight:l}}(f[0].points[0],f[0].points[1],f[0].points[2]),h=p.topRight,m=p.topLeft,g=p.bottomLeft,v=l(e,a,h,m,g),y=[];v&&y.push({alignmentPattern:{x:v.alignmentPattern.x,y:v.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:v.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),C=u(e,m),w=u(e,g),k=l(e,a,b,C,w);return k&&y.push({alignmentPattern:{x:k.alignmentPattern.x,y:k.alignmentPattern.y},bottomLeft:{x:w.x,y:w.y},topLeft:{x:C.x,y:C.y},topRight:{x:b.x,y:b.y},dimension:k.dimension}),0===y.length?null:y}}]).default},e.exports=r()})));function r3(e){return n3.apply(this,arguments)}function n3(){return(n3=SK(regeneratorRuntime.mark((function e(t){var r,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(a=n.getContext("2d"),o=a.getImageData(0,0,n.width,n.height)),!(i=t3(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",i.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function o3(e){return a3.apply(this,arguments)}function a3(){return(a3=SK(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),HZ.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 i3,s3,c3,u3,l3,d3=function(){var e=SK(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,a=r,!n){e.next=6;break}return e.next=5,Jz.blobToCanvas({blob:n});case 5:a=e.sent;case 6:return i=a.getContext("2d"),e.next=9,r3({imageData:i.getImageData(0,0,a.width,a.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,o3({canvas:a,qrScannerResources:o});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),f3=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onSessionTimeout,i=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=PK(xC.useState(!1),2),l=u[0],d=u[1],f=xC.useRef((function(){})),p=xC.useRef((function(){})),h=yj.useSDKSettings().lang,m=xC.useCallback((function(){f.current.apply(f,arguments)}),[]),g=function(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.onResult,i=e.outputEncryptionSettings,s=xC.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=xC.useRef(!1),u=xC.useRef(null),l=PK(xC.useState(!1),2),d=l[0],f=l[1],p=xC.useRef({}),h=yj.useSDKSettings(),m=h.customUrls,g=h.qrSettings;xC.useEffect((function(){function e(){return(e=SK(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,$Z({modelUrl:null==m?void 0:m.wechatQRModelsUrl});case 3:p.current=e.sent,f(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[d,m]);var v=xC.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),y=xC.useCallback(SK(regeneratorRuntime.mark((function e(){var r,n,l,f,h,m,y,b,C,w,k,S,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d&&o&&!c.current){e.next=2;break}return e.abrupt("return");case 2:r=p.current,n=r.qrModel,l=r.qrScannerResources,f=r.noModel,h=u.current,m=t.current,c.current=!0,y=h.cropX,b=h.cropY,C=h.cropWidth,w=h.cropHeight,(k=s.current).width=C,k.height=w,S=k.getContext("2d"),E=function(){var e=SK(regeneratorRuntime.mark((function e(){var t,r,o,u,d,p,h,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(S.drawImage(m,y,b,C,w,0,0,C,w),t=performance.now(),f){e.next=8;break}return e.next=5,JJ({canvas:k,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,d3({canvas:k,qrScannerResources:l});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=27;break}return v(),void 0,_=r.match(ZJ),o={valid:Boolean(_)},e.next=17,xV.takePicture({canvas:s.current});case 17:return u=e.sent,e.next=20,lK.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:"boolean"!=typeof(null==g?void 0:g.enableExif)||(null==g?void 0:g.enableExif)});case 20:if(d=e.sent,!i||!i.key){e.next=26;break}return h=i.key,e.next=25,Kq.encrypt({blob:d,key:h});case 25:p=e.sent;case 26:a({result:r,validateResult:o,image:{blob:d,encrypted:p}});case 27:return B=180-t>0?180-t:0,e.next=30,new Promise((function(e){return setTimeout(e,B)}));case 30:c.current&&window.requestAnimationFrame(E);case 31:case"end":return e.stop()}var _}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(E);case 13:case"end":return e.stop()}}),e)}))),[d,o,t,v,null==g?void 0:g.enableExif,i,a]),b=xC.useCallback((function(){v()}),[v]);return xC.useEffect((function(){var e=t.current;r||b(),d&&r&&n&&e&&e.videoWidth>0&&(u.current=xV.analyzeVideoAndWindowSizes(e,n,0),y())}),[r,n,t,v,y,d,b]),xC.useEffect((function(){return b}),[b]),{refWorkingCanvas:s,stopCheckFrame:v,checkFrame:y,warmupDone:d}}({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:m,outputEncryptionSettings:c}),v=g.stopCheckFrame,y=g.checkFrame,b=g.warmupDone,C=aJ({refVideo:r,shouldStart:t&&b,cropArea:n,settings:o}),w=C.stopCheckFrame,k=C.refRecordedVideos,S=C.splitVideos,E=C.resetRecordedVideos,B=C.checkFrame;f.current=xC.useCallback((function(e){d(!0),w(),v(),p.current(),i(TK(TK({},e),null!=o&&o.enableRecording?{recordedVideos:k.current}:{})),d(!1)}),[w,i,k,v,null==o?void 0:o.enableRecording]);var _=xC.useCallback((function(){w(),v();var e=RK(k.current),t=null!=o&&o.enableRecording?{recordedVideos:e}:null;a(t),E()}),[E,w,v,a,k,o]),x=xC.useCallback((function(){S()}),[S]),T=iJ({lang:h,onAboutToTimeout:s,onSessionTimeout:_,onVideoTimeLimitReached:x,settings:o,shouldStartTimers:t&&b,sessionTime:null==o?void 0:o.scanQrLimitTimeSecond}),A=T.stopTimers,I=T.startTimers;return p.current=A,{isProcessing:l,restartSession:xC.useCallback(SK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(),e.next=3,Promise.all([B(),y()]);case 3:case"end":return e.stop()}}),e)}))),[B,y,I]),refRecordedVideos:k,warmupDone:b}};function p3(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,a=e.onCaptureDone,i=e.outputEncryptionSettings,s=PK(xC.useState(null),2),c=s[0],u=s[1],l=Jj.useAsset("qr_capture_cursor.png"),d=PK(xC.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=yj.useSDKSettings().lang,v=Yj.useSDKTracking().sendEvent,y=hZ(),b=y.showPopup,C=y.popupShown,w=y.popupType,k=PK(xC.useState(!1),2),S=k[0],E=k[1],B=PK(xC.useState(null),2),_=B[0],x=B[1],T=Jj.useAsset("ic_loading.png"),A=xC.useRef();xC.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),xC.useEffect((function(){b({popupType:yZ})}),[b]),xC.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,a=iW.isMobile?Math.min(e-6,145):145,i=a,s=o+10,c=s+90,l=c+40,d=l+i+20,f=Math.floor((e-a)/2)+n;u({x:f,y:l,width:a,height:i,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var I=xC.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),a(e)}),[a,v]),P=xC.useCallback((function(e){var t=e.validateResult.valid;x("");var r=performance.now();t?(v({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-A.current)/1e3}}),a(e)):(b({popupType:vZ}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,a,v]),R=xC.useCallback((function(e){var t=e.curTimeLeft;x(mG(fJ.REMAINING_TIME[g])({x:t}))}),[g]),D=f3({shouldStart:S,refVideo:n,cropArea:c,settings:o,onSessionTimeout:I,onCaptureDone:P,onAboutToTimeout:R,outputEncryptionSettings:i}),N=D.isProcessing,O=D.restartSession,L=D.warmupDone,M=xC.useCallback((function(){b({popupType:null})}),[b]),F=xC.useCallback(SK(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(),A.current=performance.now(),v({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,O();case 5:case"end":return e.stop()}}),e)}))),[O,M,v]),U=xC.useCallback((function(){M(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),a()}),[M,a,v]),j=xC.useCallback((function(){M(),setTimeout((function(){E(!0)}),200)}),[M]);return xC.createElement(xC.Fragment,null,!L&&xC.createElement(cZ,{contentStyle:{maxWidth:"300px"}}),c&&xC.createElement(AY,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},xC.createElement("div",null,xC.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),xC.createElement(YJ,{y:"".concat(h,"px")},fJ.QR_TOOLTIP[g]),_&&xC.createElement($J,{key:_,className:"message",y:"".concat(m,"px")},_),N&&xC.createElement(Y$,null,xC.createElement("img",{src:T,alt:"",className:"spin"})),xC.createElement(VY,{contentStyle:{maxWidth:"332px"},open:C},w===vZ&&xC.createElement(QJ,{onRetry:F,onSkip:U}),w===yZ&&xC.createElement(FJ,{onClickStart:j,onTimeout:j})))}p3.propTypes={windowAndVideoInfo:xw.shape({}),onUISpacingChange:xw.func,refVideo:xw.shape({}),settings:xw.shape({}),onCaptureDone:xw.func,outputEncryptionSettings:xw.shape({})},p3.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var h3,m3,g3,v3,y3,b3,C3,w3="SUCCESS",k3="WARNING",S3=(BK(i3={},w3,"✓"),BK(i3,k3,"!"),i3),E3=dB.div(s3||(s3=IK(["\n font-weight: normal;\n"]))),B3=dB.div(c3||(c3=IK(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){var t=e.theme,r=e.type,n=mY(t,"QRStep.resultText.".concat(r===w3?"success":"error",".mainColor"),qY);return YE(["linear-gradient(to right,","00,","ff,","00)"],n,n,n)})),_3=dB.div(u3||(u3=IK(["\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){var t=e.type,r=e.theme;return YE(["",""],mY(r,"QRStep.resultText.".concat(t===w3?"success":"error",".mainColor"),qY))})),x3=dB.div(l3||(l3=IK(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n ",";\n"])),(function(e){var t=e.type,r=e.theme,n=t===w3?"success":"error";return YE(["color:",";font-size:",";font-weight:",";"],mY(r,"QRStep.resultText.".concat(n,".textColor"),qY),mY(r,"QRStep.resultText.".concat(n,".fontSize"),qY),mY(r,"QRStep.resultText.".concat(n,".fontWeight"),qY))})),T3=function(e){var t=e.children,r=e.type,n=e.className;return xC.createElement(E3,{className:n},xC.createElement(B3,{type:r}),xC.createElement(x3,{type:r},xC.createElement(_3,{type:r},S3[r]),t),xC.createElement(B3,{type:r}))};T3.propTypes={children:xw.node,type:xw.string,className:xw.string},T3.defaultProps={children:null,type:w3,className:""};var A3,I3=dB.div(h3||(h3=IK(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),P3=dB.div(m3||(m3=IK(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),R3=dB.button(g3||(g3=IK(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n cursor: pointer;\n"]))),D3=dB(R3)(v3||(v3=IK(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n"])),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.confirmButton.color",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.confirmButton.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.confirmButton.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.confirmButton.backgroundColor",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.confirmButton.border",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.confirmButton.borderRadius",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.confirmButton.outline",qY)})),N3=dB(R3)(y3||(y3=IK(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n"])),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.retryButton.color",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.retryButton.fontSize",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.retryButton.fontWeight",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.retryButton.backgroundColor",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.retryButton.border",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.retryButton.borderRadius",qY)}),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.retryButton.outline",qY)})),O3=dB.img(b3||(b3=IK(["\n width: 100%;\n height: auto;\n object-fit: contain;\n border-radius: ",";\n"])),(function(e){var t=e.theme;return mY(t,"IDConfirmPopup.image.borderRadius",qY)})),L3=dB.div(C3||(C3=IK(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),M3=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,a=e.hasValidQR,i=e.frontSide,s=PK(xC.useState(null),2),c=s[0],u=s[1],l=yj.useSDKSettings().lang,d=Yj.useSDKTracking().sendEvent;return xC.useEffect((function(){d({tag:i?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[i,d]),xC.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),xC.createElement(I3,null,null!==a&&xC.createElement(pJ,{mb:"20px"},xC.createElement("div",null,xC.createElement(T3,{type:a?w3:k3},a?s$.CONFIRM_POPUP_VALID_QR[l]:s$.CONFIRM_POPUP_INVALID_QR[l]))),xC.createElement(_J,{ratio:1.5},xC.createElement(O3,{src:c})),o&&xC.createElement(P3,{className:"confirm-popup-error-message"},o.msg[l]),xC.createElement(L3,null,xC.createElement(N3,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},s$.BTN_TRY_AGAIN[l]),xC.createElement(D3,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},s$.BTN_USE_THIS_PICTURE[l])))};M3.propTypes={imageTaken:xw.shape({}),error:xw.shape({msg:xw.shape({})}),onConfirm:xw.func,onTryAgain:xw.func,hasValidQR:xw.bool,frontSide:xw.bool},M3.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var F3=pB(A3||(A3=IK(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),U3=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons","isLoading","allowedCardTypes"];function j3(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,a=e.defaultCameraId,i=e.globalStyle,s=e.styledComponent,c=e.frontCamera,u=e.scannerTypeCons,l=e.isLoading,d=e.allowedCardTypes,f=AK(e,U3),p=f.numberOfCaptures,h=f.stepNumber,m=f.frontSide,g=f.titleIcon,v=f.title,y=f.description,b=f.scannerType,C=f.usePortraitMask,w=f.shouldShowSpinner,k=f.handleQRCaptureDone,S=f.handleIDCardCaptureDone,E=f.handleRestartSession,B=f.refIDCardReader,_=f.handleClickConfirm,x=f.popupType,T=f.popupShown,A=f.popupProps,I=mB(),P=xC.useRef(null),R=PK(xC.useState(null),2),D=R[0],N=R[1],O=PK(xC.useState(!1),2),L=O[0],M=O[1],F=gY(I,"IDCapturing.loadingIcon.src","ic_loading.png"),U=PK(xC.useState({}),2),j=U[0],V=U[1],z=j.yTitle,q=xC.useCallback((function(e){N(e),M(!0)}),[]);xC.useEffect((function(){M(!1)}),[c]);var H=gY(I,"IDCapturing.cardIcon.src",g),K=s.CloseCameraButton;return xC.createElement(cB,{theme:zY},xC.createElement(Q$,null,xC.createElement(TY,{key:c,frontCamera:c,onVideoPlayed:q,onClose:t,flipHorizontal:c,ref:P,onError:r,defaultCameraId:a,closeButton:K||null},L&&xC.createElement(xC.Fragment,null,b===u.ID_CARD&&xC.createElement(uJ,{key:h,ref:B,windowAndVideoInfo:D,refVideo:P,settings:n,onCaptureDone:S,onUISpacingChange:V,frontSide:m,allowedCardTypes:d,description:y,usePortraitMask:C,outputEncryptionSettings:o}),b===u.QR_CODE&&xC.createElement(p3,{key:h,refVideo:P,windowAndVideoInfo:D,settings:n,onCaptureDone:k,onUISpacingChange:V,outputEncryptionSettings:o})),xC.createElement(W$,{keyForTransition:p}),xC.createElement(Z$,{y:"".concat(z,"px")},xC.createElement(tW,null,xC.createElement(XK,{key:v,timeout:{enter:500,exit:500},classNames:"flipY",unmountOnExit:!0},xC.createElement(J$,null,g&&xC.createElement(G$,{src:H,alt:""}),xC.createElement(eZ,{className:"title"},v))))),(w||l)&&xC.createElement(Y$,null,xC.createElement("img",{src:F,alt:"",className:"spin"}))),xC.createElement(VY,{open:T},x===gZ&&xC.createElement(M3,_K({},A,{onConfirm:_,onTryAgain:E,frontSide:m})))),xC.createElement(i,null))}var V3={allowedCardTypes:xw.arrayOf(xw.string),settings:xw.shape({}),onClose:xw.func,onError:xw.func,outputEncryptionSettings:xw.shape({}),defaultCameraId:xw.string,globalStyle:xw.shape({}),styledComponent:xw.shape({CloseCameraButton:xw.node}),frontCamera:xw.bool,scannerTypeCons:xw.shape({}).isRequired,isLoading:xw.bool},z3={allowedCardTypes:[],settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:F3,styledComponent:{CloseCameraButton:null},frontCamera:!1,isLoading:!1};j3.propTypes=V3,j3.defaultProps=z3;var q3=uL.IDCardSide,H3=uL.IDCardType,K3=uL.Errors,W3={ID_CARD:"id_card",QR_CODE:"qr_code"},Q3=[{scannerType:W3.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:uL.IDCardSide.FRONT,cardType:H3.VN,enableConfirmPopup:!0},{scannerType:W3.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:uL.IDCardSide.BACK,cardType:H3.VN,enableConfirmPopup:!0}],G3={scannerType:W3.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},X3=function(){return Promise.resolve({card_label:""})},Y3=function(e){var t=e.settings,r=e.onError,n=e.detectIdCard,o=void 0===n?X3:n,a=e.outputEncryptionSettings,i=e.steps,s=e.onStepDone,c=yj.useSDKSettings().lang,u=null!=i?i:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",r="ph"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||"en"===t,n={scannerType:W3.ID_CARD,title:r?"Capture Front Side of ID Card":"Mặt trước CMND/CCCD",description:r?"":"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:uL.IDCardSide.FRONT,cardType:H3.VN,enableConfirmPopup:!0},o={scannerType:W3.ID_CARD,title:r?"Capture Back Side of ID Card":"Mặt sau CMND/CCCD",description:r?"":"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:uL.IDCardSide.BACK,cardType:H3.VN,enableConfirmPopup:!0};return e?[n,o]:[n]}(hY(t,"hasBackCard",!0),c,hY(t,"country")),l=PK(xC.useState(0),2),d=l[0],f=l[1],p=PK(xC.useState(u[d]),2),h=p[0],m=p[1],g=PK(xC.useState(0),2),v=g[0],y=g[1],b=PK(xC.useState(!1),2),C=b[0],w=b[1],k=xC.useRef({}),S=xC.useRef([]),E=xC.useRef(null),B=xC.useRef(),_=xC.useRef(null),x=hZ(),T=x.showPopup,A=x.popupShown,I=x.popupType,P=x.props,R=h.scannerType,D=h.title,N=h.titleIcon,O=h.cardSide,L=h.description,M=h.usePortraitMask,F=h.cardType,U=h.enableConfirmPopup,j=xC.useCallback((function(e){e>=u.length||setTimeout((function(){f(e),m(u[e])}),200)}),[u]),V=xC.useCallback((function(){j(d+1)}),[j,d]),z=xC.useCallback((function(){setTimeout((function(){m((function(e){return TK(TK({},e),G3)}))}),200)}),[]),q=xC.useCallback((function(){T({popupType:null})}),[T]),H=xC.useCallback((function(){if(q(),E.current=null,R===W3.QR_CODE)j(d);else if(R===W3.ID_CARD){var e=null;_.current===q3.FRONT?e=0:_.current===q3.BACK&&(e=1),null!==e&&j(e),B.current.restartSession()}}),[j,d,q,R]),K=xC.useCallback(SK(regeneratorRuntime.mark((function e(){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=TK({stepNumber:d,cardSide:O,cardType:F,image:k.current},null!=t&&t.enableRecording?{recordedVideos:S.current}:{}),(R===W3.QR_CODE&&E.current||null!==(r=E.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=E.current),w(!0),e.next=5,s(n);case 5:(o=e.sent)?(_.current=o,w(!1)):(w(!1),E.current=null,V());case 7:case"end":return e.stop()}}),e)}))),[t,d,s,V,R,w,O,F]),W=xC.useCallback((function(e){var t;if(E.current=e,e&&e.recordedVideos){var r,n=e.recordedVideos;(r=S.current).push.apply(r,RK(n))}y((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);U?T({popupType:gZ,props:{hasValidQR:o,imageTaken:k.current}}):K()}),[T,U,K]),Q=xC.useCallback(function(){var e=SK(regeneratorRuntime.mark((function e(n){var i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.image,s=n.error,c=n.recordedVideos,k.current=i,S.current=c,y((function(e){return e+1})),O!==uL.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!iW.isMobile){e.next=28;break}if(l=null==i||null===(u=i.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return w(!0),e.prev=9,e.next=12,o({image:i,cardType:F,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(K3.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,e3(k.current.blob,a);case 24:return(f=e.sent)?W(f):z(),w(!1),e.abrupt("return");case 28:U?T({popupType:gZ,props:{imageTaken:k.current,error:s}}):K();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[U,T,O,t,F,o,K,z,r,W,a,w]),G=xC.useCallback((function(){q(),K()}),[K,q]);return{numberOfCaptures:v,stepNumber:d,titleIcon:N,title:D,description:L,frontSide:O===q3.FRONT,scannerType:R,usePortraitMask:M,shouldShowSpinner:C,handleQRCaptureDone:W,handleIDCardCaptureDone:Q,handleRestartSession:H,refIDCardReader:B,handleClickConfirm:G,showPopup:T,popupType:I,popupShown:A,popupProps:P}},$3=function(){this.__data__=new HX,this.size=0},Z3=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},J3=function(e){return this.__data__.get(e)},e0=function(e){return this.__data__.has(e)},t0=function(e,t){var r=this.__data__;if(r instanceof HX){var n=r.__data__;if(!KX||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new eY(n)}return r.set(e,t),this.size=r.size,this};function r0(e){var t=this.__data__=new HX(e);this.size=t.size}r0.prototype.clear=$3,r0.prototype.delete=Z3,r0.prototype.get=J3,r0.prototype.has=e0,r0.prototype.set=t0;var n0=r0,o0=function(e,t,r){(void 0!==r&&!FW(e[t],r)||void 0===r&&!(t in e))&&MW(e,t,r)},a0=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var s=a[++n];if(!1===t(o[s],s,o))break}return e},i0=oW((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?uW.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}})),s0=uW.Uint8Array,c0=function(e){var t=new e.constructor(e.byteLength);return new s0(t).set(new s0(e)),t},u0=function(e,t){var r=t?c0(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},l0=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t},d0=Object.create,f0=function(){function e(){}return function(t){if(!CW(t))return{};if(d0)return d0(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),p0=function(e){return"function"!=typeof e.constructor||EQ(e)?{}:f0(PQ(e))},h0=function(e){return oQ(e)&&ZW(e)},m0=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},g0=function(e){return VW(e,TQ(e))},v0=function(e,t,r,n,o,a,i){var s=m0(e,r),c=m0(t,r),u=i.get(c);if(u)o0(e,r,u);else{var l=a?a(s,c,r+"",e,t,i):void 0,d=void 0===l;if(d){var f=lQ(c),p=!f&&fQ(c),h=!f&&!p&&CQ(c);l=c,f||p||h?lQ(s)?l=s:h0(s)?l=l0(s):p?(d=!1,l=i0(c,!0)):h?(d=!1,l=u0(c,!0)):l=[]:MQ(c)||uQ(c)?(l=s,uQ(s)?l=g0(s):CW(s)&&!wW(s)||(l=p0(c))):d=!1}d&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),o0(e,r,l)}},y0=function e(t,r,n,o,a){t!==r&&a0(r,(function(i,s){if(a||(a=new n0),CW(i))v0(t,r,s,n,e,o,a);else{var c=o?o(m0(t,s),i,s+"",t,r,a):void 0;void 0===c&&(c=i),o0(t,s,c)}}),TQ)},b0=rQ((function(e,t,r){y0(e,t,r)})),C0={data:{country:"vn",settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},track_card_coordinates:{enable:!1,max_length:150},card_type_check:{enable:!1},blur_check:{enable:!0,threshold_web:.82},disable_capture_button_if_alert:!1,exif_data_settings:{enable:!0},id_detection:{enable:!0},limit_time_settings:{enable:!0,limit_time_second:30,video_partial_length_seconds:15},save_frame_settings:{enable:!1,frames_interval_ms:190,quality_web:80},scan_qr_settings:{enable:!0,limit_time_second:20},virtual_cam_hashes:{web:!1,mobile:!1}}}}}};function w0(e){var t=e.clientSettings,r=PK(xC.useState(null),2),n=r[0],o=r[1];return xC.useEffect((function(){var e=b0(C0,t),r=hY(e,"data.settings.sdk_settings.id_detection_settings.card_type_check.enable"),n=hY(e,"data.country"),a=hY(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),i=hY(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.enable"),s=hY(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.max_length"),c=hY(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),u=hY(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),l=hY(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),d=hY(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),f=hY(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),p=hY(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),h=hY(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),m=hY(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),g=hY(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),v=hY(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),y=hY(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),b=hY(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),C=hY(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),w=hY(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),k=hY(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(iW.isMobile?"mobile":"web")),S=hY(e,"data.card_types[0].has_back_side",!0),E=hY(e,"data.card_types",[]).map((function(e){return null==e?void 0:e.code}));o({country:n,enableRecording:a,trackCardCoordinates:i,trackCardCoordinatesMaxLength:s,enableCardTypeCheck:r,frameCaptureIntervalMs:c,idCardSessionTime:d,maxRecordingTimePerVideo:f,saveFrameQuality:u,enableTimers:l,enableAutoCapture:p,waitForBestImageTimeMs:h,enableBlurCheck:m,blurThreshold:g,disableCaptureButtonIfAlert:v,enableIdDetection:y,enableScanQr:b,scanQrLimitTimeSecond:C,enableExifData:w,enableVirtualCamHashes:k,hasBackCard:S,allowedCardTypesFromSettings:E})}),[t]),{settings:n}}var k0,S0="landscape",E0="portrait",B0="desktop",_0=uL.Errors,x0=dB.div(k0||(k0=IK(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function T0(e){var t=e.children,r=yj.useSDKSettings().lang,n=_0.wrong_orientation.msg[r],o=function(){var e=xC.useRef(window.matchMedia("(orientation: portrait)")),t=xC.useRef(e.current.matches?E0:S0),r=PK(xC.useState(t.current),2),n=r[0],o=r[1];return xC.useEffect((function(){function t(e){e.matches?o(E0):o(S0)}return e.current.addEventListener("change",t),function(){e.current.removeEventListener("change",t)}}),[]),iW.isMobile?{curOrientation:n,initOrientation:t.current}:{curOrientation:B0}}().curOrientation;return xC.createElement(xC.Fragment,null,o===S0&&xC.createElement(VY,{open:!0},xC.createElement(x0,null,n)),(o===E0||o===B0)&&xC.createElement(xC.Fragment,null,t))}function A0(e){var t=e.logCredentials,r=e.clientSettings,n=e.uiOnlyComponent,o=e.onError,a=e.detectIdCard,i=e.outputEncryptionSettings,s=e.steps,c=e.onStepDone,u=e.customTheme,l=w0({clientSettings:r}).settings,d=_K({},Y3({settings:l,onError:o,detectIdCard:a,outputEncryptionSettings:i,steps:s,onStepDone:c}));return xC.createElement(T0,null,xC.createElement(cB,{theme:u},xC.createElement(Yj.SDKTrackingProvider,{value:{tracking:TK({},t)}},xC.createElement(n,_K({},e,{settings:l,scannerTypeCons:W3},d)))))}var I0={logCredentials:xw.shape({}),clientSettings:xw.shape({}),uiOnlyComponent:xw.func,customTheme:xw.shape({}),onError:xw.func,onStepDone:xw.func,steps:xw.arrayOf(xw.shape({})),detectIdCard:xw.func,outputEncryptionSettings:xw.shape({})};A0.propTypes=I0,A0.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:j3,customTheme:{},onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var P0=function(e){var t=_K({},e),r=t.clientSettings,n=t.onError,o=t.onStepDone,a=t.logCredentials,i=t.uiOnlyComponent,s=t.detectIdCard,c=t.outputEncryptionSettings,u=t.steps,l=w0({clientSettings:r}).settings,d=xC.useCallback(function(){var e=SK(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o(TK(TK({},t),{},{restartSession:null==f?void 0:f.handleRestartSession}));case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,null==f?void 0:f.handleRestartSession]),f=_K({},Y3({settings:l,onError:n,detectIdCard:s,outputEncryptionSettings:c,steps:u,onStepDone:d}));return xC.createElement(T0,null,xC.createElement(Yj.SDKTrackingProvider,{value:{tracking:TK({},a)}},xC.createElement(i,_K({},t,{onStepDone:d,settings:l,scannerTypeCons:W3},f))))};P0.propTypes={clientSettings:xw.shape({}),onError:xw.func,onStepDone:xw.func,logCredentials:xw.shape({}),readIDCardUIOnlyComponent:xw.func,uiOnlyComponent:xw.func,sdkAdapter:xw.shape({}),steps:xw.arrayOf(xw.shape({})),detectIdCard:xw.func,outputEncryptionSettings:xw.shape({})},P0.defaultProps={clientSettings:void 0,onError:function(){},onStepDone:function(){},logCredentials:{enable:!0},readIDCardUIOnlyComponent:A0,uiOnlyComponent:j3,sdkAdapter:null,steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null},xw.shape({});var R0=Array.isArray,D0=R0,N0="object"==typeof r&&r&&r.Object===Object&&r,O0=N0,L0="object"==typeof self&&self&&self.Object===Object&&self,M0=O0||L0||Function("return this")(),F0=M0,U0=F0.Symbol,j0=U0,V0=Object.prototype,z0=V0.hasOwnProperty,q0=V0.toString,H0=j0?j0.toStringTag:void 0;function K0(e){var t=z0.call(e,H0),r=e[H0];try{e[H0]=void 0;var n=!0}catch(e){}var o=q0.call(e);return n&&(t?e[H0]=r:delete e[H0]),o}var W0=K0,Q0=Object.prototype,G0=Q0.toString;function X0(e){return G0.call(e)}var Y0=X0,$0="[object Null]",Z0="[object Undefined]",J0=j0?j0.toStringTag:void 0;function e2(e){return null==e?void 0===e?Z0:$0:J0&&J0 in Object(e)?W0(e):Y0(e)}var t2=e2;function r2(e){return null!=e&&"object"==typeof e}var n2=r2,o2="[object Symbol]";function a2(e){return"symbol"==typeof e||n2(e)&&t2(e)==o2}var i2=a2,s2=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c2=/^\w*$/;function u2(e,t){if(D0(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i2(e))||(c2.test(e)||!s2.test(e)||null!=t&&e in Object(t))}var l2=u2;function d2(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var f2=d2,p2="[object AsyncFunction]",h2="[object Function]",m2="[object GeneratorFunction]",g2="[object Proxy]";function v2(e){if(!f2(e))return!1;var t=t2(e);return t==h2||t==m2||t==p2||t==g2}var y2=v2,b2=F0["__core-js_shared__"],C2=b2,w2=function(){var e=/[^.]+$/.exec(C2&&C2.keys&&C2.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function k2(e){return!!w2&&w2 in e}var S2=k2,E2=Function.prototype,B2=E2.toString;function _2(e){if(null!=e){try{return B2.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var x2=_2,T2=/[\\^$.*+?()[\]{}|]/g,A2=/^\[object .+?Constructor\]$/,I2=Function.prototype,P2=Object.prototype,R2=I2.toString,D2=P2.hasOwnProperty,N2=RegExp("^"+R2.call(D2).replace(T2,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function O2(e){return!(!f2(e)||S2(e))&&(y2(e)?N2:A2).test(x2(e))}var L2=O2;function M2(e,t){return null==e?void 0:e[t]}var F2=M2;function U2(e,t){var r=F2(e,t);return L2(r)?r:void 0}var j2=U2,V2=j2(Object,"create"),z2=V2;function q2(){this.__data__=z2?z2(null):{},this.size=0}var H2=q2;function K2(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var W2=K2,Q2="__lodash_hash_undefined__",G2=Object.prototype,X2=G2.hasOwnProperty;function Y2(e){var t=this.__data__;if(z2){var r=t[e];return r===Q2?void 0:r}return X2.call(t,e)?t[e]:void 0}var $2=Y2,Z2=Object.prototype,J2=Z2.hasOwnProperty;function e1(e){var t=this.__data__;return z2?void 0!==t[e]:J2.call(t,e)}var t1=e1,r1="__lodash_hash_undefined__";function n1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=z2&&void 0===t?r1:t,this}var o1=n1;function a1(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])}}a1.prototype.clear=H2,a1.prototype.delete=W2,a1.prototype.get=$2,a1.prototype.has=t1,a1.prototype.set=o1;var i1=a1;function s1(){this.__data__=[],this.size=0}var c1=s1;function u1(e,t){return e===t||e!=e&&t!=t}var l1=u1;function d1(e,t){for(var r=e.length;r--;)if(l1(e[r][0],t))return r;return-1}var f1=d1,p1=Array.prototype,h1=p1.splice;function m1(e){var t=this.__data__,r=f1(t,e);return!(r<0)&&(r==t.length-1?t.pop():h1.call(t,r,1),--this.size,!0)}var g1=m1;function v1(e){var t=this.__data__,r=f1(t,e);return r<0?void 0:t[r][1]}var y1=v1;function b1(e){return f1(this.__data__,e)>-1}var C1=b1;function w1(e,t){var r=this.__data__,n=f1(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var k1=w1;function S1(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])}}S1.prototype.clear=c1,S1.prototype.delete=g1,S1.prototype.get=y1,S1.prototype.has=C1,S1.prototype.set=k1;var E1=S1,B1=j2(F0,"Map"),_1=B1;function x1(){this.size=0,this.__data__={hash:new i1,map:new(_1||E1),string:new i1}}var T1=x1;function A1(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var I1=A1;function P1(e,t){var r=e.__data__;return I1(t)?r["string"==typeof t?"string":"hash"]:r.map}var R1=P1;function D1(e){var t=R1(this,e).delete(e);return this.size-=t?1:0,t}var N1=D1;function O1(e){return R1(this,e).get(e)}var L1=O1;function M1(e){return R1(this,e).has(e)}var F1=M1;function U1(e,t){var r=R1(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var j1=U1;function V1(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])}}V1.prototype.clear=T1,V1.prototype.delete=N1,V1.prototype.get=L1,V1.prototype.has=F1,V1.prototype.set=j1;var z1=V1,q1="Expected a function";function H1(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(q1);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(H1.Cache||z1),r}H1.Cache=z1;var K1=H1,W1=500;function Q1(e){var t=K1(e,(function(e){return r.size===W1&&r.clear(),e})),r=t.cache;return t}var G1=Q1,X1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y1=/\\(\\)?/g,$1=G1((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(X1,(function(e,r,n,o){t.push(n?o.replace(Y1,"$1"):r||e)})),t})),Z1=$1;function J1(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 e5=J1,t5=1/0,r5=j0?j0.prototype:void 0,n5=r5?r5.toString:void 0;function o5(e){if("string"==typeof e)return e;if(D0(e))return e5(e,o5)+"";if(i2(e))return n5?n5.call(e):"";var t=e+"";return"0"==t&&1/e==-t5?"-0":t}var a5=o5;function i5(e){return null==e?"":a5(e)}var s5=i5;function c5(e,t){return D0(e)?e:l2(e,t)?[e]:Z1(s5(e))}var u5=c5,l5=1/0;function d5(e){if("string"==typeof e||i2(e))return e;var t=e+"";return"0"==t&&1/e==-l5?"-0":t}var f5=d5;function p5(e,t){for(var r=0,n=(t=u5(t,e)).length;null!=e&&r<n;)e=e[f5(t[r++])];return r&&r==n?e:void 0}var h5=p5;function m5(e,t,r){var n=null==e?void 0:h5(e,t);return void 0===n?r:n}var g5=m5,v5=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),a=r(0),i=a.BROWSER_TYPES,s=a.OS_TYPES,c=a.DEVICE_TYPES,u=r(4),l=u.checkType,d=u.broPayload,f=u.mobilePayload,p=u.wearPayload,h=u.consolePayload,m=u.stvPayload,g=u.getNavigatorInstance,v=u.isIOS13Check,y=new o,b=y.getBrowser(),C=y.getDevice(),w=y.getEngine(),k=y.getOS(),S=y.getUA(),E=i.CHROME,B=i.CHROMIUM,_=i.IE,x=i.INTERNET_EXPLORER,T=i.OPERA,A=i.FIREFOX,I=i.SAFARI,P=i.EDGE,R=i.YANDEX,D=i.MOBILE_SAFARI,N=c.MOBILE,O=c.TABLET,L=c.SMART_TV,M=c.BROWSER,F=c.WEARABLE,U=c.CONSOLE,j=s.ANDROID,V=s.WINDOWS_PHONE,z=s.IOS,q=s.WINDOWS,H=s.MAC_OS,K=function(){return k.name===s.WINDOWS&&"10"===k.version&&("string"==typeof S&&-1!==S.indexOf("Edg/"))},W=function(){return b.name===P},Q=function(){return v("iPad")},G=C.type===L,X=C.type===U,Y=C.type===F,$=b.name===D||Q(),Z=b.name===B,J=function(){switch(C.type){case N:case O:return!0;default:return!1}}()||Q(),ee=C.type===N,te=C.type===O||Q(),re=C.type===M,ne=k.name===j,oe=k.name===V,ae=k.name===z||Q(),ie=b.name===E,se=b.name===A,ce=b.name===I||b.name===D,ue=b.name===T,le=b.name===x||b.name===_,de=k.version?k.version:"none",fe=k.name?k.name:"none",pe=b.major,he=b.version,me=b.name,ge=C.vendor?C.vendor:"none",ve=C.model?C.model:"none",ye=w.name,be=w.version,Ce=S,we=W()||K(),ke=b.name===R,Se=C.type,Ee=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Be=Q(),_e=v("iPhone"),xe=v("iPod"),Te=function(){var e=g(),t=e&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)}(),Ae=K(),Ie=W(),Pe=k.name===q,Re=k.name===H,De=l(C.type);e.exports={deviceDetect:function(){var e=De.isBrowser,t=De.isMobile,r=De.isTablet,n=De.isSmartTV,o=De.isConsole,a=De.isWearable;return e?d(e,b,w,k,S):n?m(n,w,k,S):o?h(o,w,k,S):t||r?f(De,C,k,S):a?p(a,w,k,S):void 0},isSmartTV:G,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ae,isChrome:ie,isFirefox:se,isSafari:ce,isOpera:ue,isIE:le,osVersion:de,osName:fe,fullBrowserVersion:pe,browserVersion:he,browserName:me,mobileVendor:ge,mobileModel:ve,engineName:ye,engineVersion:be,getUA:Ce,isEdge:we,isYandex:ke,deviceType:Se,isIOS13:Ee,isIPad13:Be,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Ie,isWindows:Pe,isMacOs:Re}},function(e,t,r){var n;
|
77
|
+
/*!
|
78
|
+
* UAParser.js v0.7.18
|
79
|
+
* Lightweight JavaScript-based User-Agent string parser
|
80
|
+
* https://github.com/faisalman/ua-parser-js
|
81
|
+
*
|
82
|
+
* Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
|
83
|
+
* Dual licensed under GPLv2 or MIT
|
84
|
+
*/!function(o,a){var i="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",m="console",g="mobile",v="tablet",y="smarttv",b="wearable",C={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:a},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},w={rgx:function(e,t){for(var r,n,o,s,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(o=0;o<p.length;o++)l=u[++n],typeof(s=p[o])===c&&s.length>0?2==s.length?typeof s[1]==i?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==i||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):a:this[s[0]]=l?s[1].call(this,l,s[2]):a:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):a):this[s]=l||a;d+=2}},str:function(e,t){for(var r in t)if(typeof t[r]===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(C.has(t[r][n],e))return"?"===r?a:r}else if(C.has(t[r],e))return"?"===r?a:r;return e}},k={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"}}}},S={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,w.str,k.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,C.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",C.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,C.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,w.str,k.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,w.str,k.device.sprint.vendor],[u,w.str,k.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,C.trim],[u,C.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,C.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,w.str,k.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,w.str,k.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]]},E=function(e,t){if("object"==typeof e&&(t=e,e=a),!(this instanceof E))return new E(e,t).getResult();var r=e||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),n=t?C.extend(S,t):S;return this.getBrowser=function(){var e={name:a,version:a};return w.rgx.call(e,r,n.browser),e.major=C.major(e.version),e},this.getCPU=function(){var e={architecture:a};return w.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:a,model:a,type:a};return w.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:a,version:a};return w.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:a,version:a};return w.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};E.VERSION="0.7.18",E.BROWSER={NAME:l,MAJOR:"major",VERSION:p},E.CPU={ARCHITECTURE:h},E.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:m,MOBILE:g,SMARTTV:y,TABLET:v,WEARABLE:b,EMBEDDED:"embedded"},E.ENGINE={NAME:l,VERSION:p},E.OS={NAME:l,VERSION:p},typeof t!==s?(typeof e!==s&&e.exports&&(t=e.exports=E),t.UAParser=E):r(3)?(n=function(){return E}.call(t,r,t,e))===a||(e.exports=n):o&&(o.UAParser=E);var B=o&&(o.jQuery||o.Zepto);if(typeof B!==s){var _=new E;B.ua=_.getResult(),B.ua.get=function(){return _.getUA()},B.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),a=o.DEVICE_TYPES,i=o.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case a.MOBILE:return{isMobile:!0};case a.TABLET:return{isTablet:!0};case a.SMART_TV:return{isSmartTV:!0};case a.CONSOLE:return{isConsole:!0};case a.WEARABLE:return{isWearable:!0};case a.BROWSER:return{isBrowser:!0};default:return i}},broPayload:function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:o}},mobilePayload:function(e,t,r,o){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:o})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])})),y5="Expected a function",b5=NaN,C5="[object Symbol]",w5=/^\s+|\s+$/g,k5=/^[-+]0x[0-9a-f]+$/i,S5=/^0b[01]+$/i,E5=/^0o[0-7]+$/i,B5=parseInt,_5="object"==typeof r&&r&&r.Object===Object&&r,x5="object"==typeof self&&self&&self.Object===Object&&self,T5=_5||x5||Function("return this")(),A5=Object.prototype,I5=A5.toString,P5=Math.max,R5=Math.min,D5=function(){return T5.Date.now()};function N5(e,t,r){var n,o,a,i,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(y5);function p(t){var r=n,a=o;return n=o=void 0,u=t,i=e.apply(a,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):i}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=a}function g(){var e=D5();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?R5(r,a-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,i)}function y(){var e=D5(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),i}return t=F5(t)||0,O5(r)&&(l=!!r.leading,a=(d="maxWait"in r)?P5(F5(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?i:v(D5())},y}function O5(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function L5(e){return!!e&&"object"==typeof e}function M5(e){return"symbol"==typeof e||L5(e)&&I5.call(e)==C5}function F5(e){if("number"==typeof e)return e;if(M5(e))return b5;if(O5(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=O5(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(w5,"");var r=S5.test(e);return r||E5.test(e)?B5(e.slice(2),r?2:8):k5.test(e)?b5:+e}var U5=N5;function j5(e,t,r){class n extends xC.Component{constructor(){super(...arguments),this.updateDebounced=U5(this.forceUpdate,t,r)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return xC.createElement(e,Object.assign({},this.props))}}return n.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,WS(n,e)}function V5(){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 z5(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===By(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 q5,H5,K5,W5,Q5,G5=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],X5=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&&G5.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},Y5=function(e,t){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0&&!t)},$5=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}}},Z5={closeButton:{top:"10px",right:"10px",left:"auto",bottom:"auto",display:"block",src:"",width:"20px",height:"auto"},popup:{backgroundColor:"#fff",padding:"5px",border:"1px solid #d7d7d7",borderRadius:"10px",overlay:{backgroundColor:"rgba(0, 0, 0, 0.5)"}}},J5=function(e,t,r){return g5(e,t,g5(r,t,""))},e4=function(e,t,r){var n=Jj.useAsset(r);return g5(e,t,n)},t4=uL.Errors,r4=1e3,n4=dB.div(q5||(q5=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"])),r4,(function(e){return e.checkCameraMode&&"opacity: 0;"})),o4=dB.video(H5||(H5=Ky(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),a4=dB.div(K5||(K5=Ky(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),i4=dB(a4)(W5||(W5=Ky(["\n z-index: ",";\n position: fixed;\n cursor: pointer;\n ","\n"])),r4+1e3,(function(e){var t=e.theme;return YE(["top:",";right:",";left:",";bottom:",";display:",";width:",";height:",";"],J5(t,"closeButton.top",Z5),J5(t,"closeButton.right",Z5),J5(t,"closeButton.left",Z5),J5(t,"closeButton.bottom",Z5),J5(t,"closeButton.display",Z5),J5(t,"closeButton.width",Z5),J5(t,"closeButton.height",Z5))})),s4=dB.div(Q5||(Q5=Ky(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),r4+20),c4=xC.createRef(),u4=V5();function l4(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,a=e.onVideoPlayed,i=e.flipHorizontal,s=e.videoSettings,c=e.refVideo,u=e.onError,l=e.closeButton,d=e.videoClassName,f=e.scale,p=e.defaultCameraId,h=e.onWarning,m=xC.useRef(),g=yj.useSDKSettings().lang,v=mB(),y=Yj.useSDKTracking().sendEvent,b=e4(v,"closeButton.src","ic_close.png"),C=Wy(xC.useState(""),2),w=C[0],k=C[1],S=xC.useRef(!1),E=xC.useRef(!1),B=xC.useRef(!1),_=xC.useRef(),x=xC.useRef([]),T=xC.useRef(""),A=xC.useCallback((function(e){u&&u(e)}),[u]),I=xC.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(_)}),[c]);function P(){return R.apply(this,arguments)}function R(){return(R=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,z5();case 3:t=e.sent,x.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),lK.addExifData("device_info.camera_list",JSON.stringify(x.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))||I()}),1e3)),xC.useEffect((function(){return function(){B.current=!0}}),[]);var D=xC.useCallback((function(){_.current||(_.current=setTimeout((function(){S.current||(k(t4.camera_timeout.msg[g]),A(t4.camera_timeout))}),2e4))}),[g,A]),N=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,o,a,i,c,u,l,d,f,p,m=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=m.length>1&&void 0!==m[1]&&m[1],o={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return h&&h("too_many_request_to_camera"),e.abrupt("return",new Promise((function(e){return e(null)})));case 5:return window.tv_last_req_camera_complete=!1,o=v5.isMobile?v5.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},a=$5(),i=a.updateTime,c=a.getStart,u=a.getEnd,e.prev=8,l=s||o,i(performance.now(),"start"),Y5(v5.isMobile,v5.isIOS)&&r&&(l={}),n&&(l={}),lK.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),d={audio:!1,video:Ny(Ny({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)},e.next=17,u4.getUserMedia(d);case 17:return f=e.sent,e.next=20,P();case 20:if(D(),f){e.next=25;break}return k(t4.not_supported.msg[g]),A(t4.not_supported),e.abrupt("return",null);case 25:i(performance.now(),"end"),window.tv_last_req_camera_complete=!0,u()-c()<1600?y({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):y({tag:"cam_permission",event:"user_activity.allow",log:{}});try{p=f.getVideoTracks()[0].getSettings(),lK.addExifData("device_info.camera_label_dimension.got","".concat(p.width,"x").concat(p.height))}catch(e){}return e.abrupt("return",f);case 32:e.prev=32,e.t0=e.catch(8),i(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k(t4.no_permission.msg[g]),A(t4.no_permission),E.current=!0,y({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):E.current&&("NotReadableError"===e.t0.name?(A(t4.not_readable),k(t4.not_readable.msg[g])):(k(e.t0.message),A({code:e.t0.name||e.t0.code,message:e.t0.message})));case 36:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 38:case"end":return e.stop()}}),e,null,[[8,32]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,A,h,D,y]),O=xC.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,s,u,l,d,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>0&&void 0!==h[0]?h[0]:p,o=h.length>1&&void 0!==h[1]&&h[1],!(null!=(i=c.current)&&null!==(t=i.srcObject)&&void 0!==t&&t.id&&null!=i&&null!==(r=i.srcObject)&&void 0!==r&&r.active&&S.current)){e.next=5;break}return e.abrupt("return");case 5:return i.oncanplaythrough=function(){var e,t,r;i.play(),lK.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),S.current=!0,k("");var n=window.innerWidth,o=window.innerHeight,c=xV.analyzeVideoAndWindowSizes(i),u=c.lostX,l=void 0===u?0:u,d=c.lostY,f=void 0===d?0:d,p=Math.min(n,Math.floor(n-2*l)),h=Math.min(o,Math.floor(o-2*f));a&&a({clientWidth:n,clientHeight:o,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,N(n,o);case 8:s=e.sent,u=X5(s),l=u.deviceLabel,(d=u.isVirtual)&&(T.current+="".concat(l,", "),(f=x.current.filter((function(e){return!T.current.includes(e.label)})))[0]&&f[0].deviceId&&O(f[0].deviceId)),s||E.current||(lK.addExifData("device_info.camera_label_retry","yes"),E.current=!0,O(n,!0)),s&&B.current&&(c.current.srcObject=s,I()),!s||B.current||d||(i.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,N,a,p,I]);xC.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,O();case 2:return e.next=4,z5();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,I(),O(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return S.current?function(){}:(!u4||v5.browserName&&["facebook"].includes(v5.browserName.toLowerCase())||v5.getUA.includes("Zalo iOS")?(k(t4.not_supported.msg[g]),A(t4.not_supported)):t&&(v5.isAndroid&&!1===r?function(){e.apply(this,arguments)}():O()),function(){B.current&&I()})}),[c,g,r,O,I,A]);var L=xC.useCallback((function(){I(),n&&n(),y({tag:"result",event:"user_activity.cancel",log:{}})}),[n,I,y]);return xC.createElement(n4,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!w)return null;var e=t4.no_permission.msg[g];return w===e&&v5.isIOS?xC.createElement(s4,null,w," ",xC.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):xC.createElement(s4,null,w)}(),xC.createElement(o4,{ref:c,playsInline:!0,muted:!0,flipHorizontal:i,className:d,scale:f}),o,l?xC.cloneElement(l,{onClick:L,"data-testid":"close-camera"}):xC.createElement(i4,{onClick:L,"data-testid":"close-camera"},xC.createElement("img",{src:b,alt:""})))}l4.propTypes={checkCameraMode:xw.bool,frontCamera:xw.bool,onClose:xw.func,onError:xw.func,onVideoPlayed:xw.func,children:xw.node,flipHorizontal:xw.bool,videoSettings:xw.object,refVideo:xw.object,closeButton:xw.node,videoClassName:xw.string,scale:xw.number,defaultCameraId:xw.string,onWarning:xw.func},l4.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 d4,f4,p4,h4=j5(l4,250),m4=xC.forwardRef((function(e,t){return xC.createElement(l4,Ry({},e,{refVideo:t||c4}))})),g4=xC.forwardRef((function(e,t){return xC.createElement(h4,Ry({},e,{refVideo:t||c4}))})),v4=dB.table(d4||(d4=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"]))),y4=dB.div(f4||(f4=Ky(["\n position: relative;\n"]))),b4=Array.from(Array(3).keys()),C4=Array.from(Array(3).keys());function w4(e){var t=e.children,r=e.x,n=e.y,o=e.width,a=e.height,i=e.className,s=e.surroundStyle;return xC.createElement(v4,{className:i},xC.createElement("tbody",null,b4.map((function(e,i){return xC.createElement("tr",{key:e,style:{height:0===i?n:"auto"},"data-testid":"row"},C4.map((function(e,n){var c=1===i&&1===n,u="auto";return c?u=o:0===n&&(u=r),xC.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:Ny({width:u,height:c?a:"auto"},c?{}:s)},c?xC.createElement(y4,{style:{width:u,height:a}},t):null)})))}))))}w4.propTypes={children:xw.node,x:xw.string,y:xw.string,width:xw.string,height:xw.string,className:xw.string,surroundStyle:xw.object},w4.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var k4=dB(w4)(p4||(p4=Ky(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: ",";\n"])),r4+10);function S4(e){var t=e.className;return xC.createElement("svg",{className:t,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},xC.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),xC.createElement("desc",null,"Created with sketchtool."),xC.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},xC.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},xC.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},xC.createElement("g",{id:"Group-2"},xC.createElement("g",{id:"camera"},xC.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"})))))))}S4.propTypes={className:xw.string},S4.defaultProps={className:""};var E4=function(){return F0.Date.now()},B4=E4,_4=/\s/;function x4(e){for(var t=e.length;t--&&_4.test(e.charAt(t)););return t}var T4=x4,A4=/^\s+/;function I4(e){return e?e.slice(0,T4(e)+1).replace(A4,""):e}var P4=I4,R4=NaN,D4=/^[-+]0x[0-9a-f]+$/i,N4=/^0b[01]+$/i,O4=/^0o[0-7]+$/i,L4=parseInt;function M4(e){if("number"==typeof e)return e;if(i2(e))return R4;if(f2(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=f2(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=P4(e);var r=N4.test(e);return r||O4.test(e)?L4(e.slice(2),r?2:8):D4.test(e)?R4:+e}var F4=M4,U4="Expected a function",j4=Math.max,V4=Math.min;function z4(e,t,r){var n,o,a,i,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(U4);function p(t){var r=n,a=o;return n=o=void 0,u=t,i=e.apply(a,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):i}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=a}function g(){var e=B4();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?V4(r,a-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,i)}function y(){var e=B4(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return clearTimeout(s),s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),i}return t=F4(t)||0,f2(r)&&(l=!!r.leading,a=(d="maxWait"in r)?j4(F4(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?i:v(B4())},y}var q4=z4,H4="Expected a function";function K4(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError(H4);return f2(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),q4(e,t,{leading:n,maxWait:t,trailing:o})}var W4=K4,Q4=function(){try{var e=j2(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),G4=Q4;function X4(e,t,r){"__proto__"==t&&G4?G4(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Y4=X4,$4=Object.prototype,Z4=$4.hasOwnProperty;function J4(e,t,r){var n=e[t];Z4.call(e,t)&&l1(n,r)&&(void 0!==r||t in e)||Y4(e,t,r)}var e8=J4;function t8(e,t,r,n){var o=!r;r||(r={});for(var a=-1,i=t.length;++a<i;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?Y4(r,s,c):e8(r,s,c)}return r}var r8=t8;function n8(e){return e}var o8=n8;function a8(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 i8=a8,s8=Math.max;function c8(e,t,r){return t=s8(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=s8(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(i),i8(e,this,s)}}var u8=c8;function l8(e){return function(){return e}}var d8=l8,f8=G4?function(e,t){return G4(e,"toString",{configurable:!0,enumerable:!1,value:d8(t),writable:!0})}:o8,p8=f8,h8=800,m8=16,g8=Date.now;function v8(e){var t=0,r=0;return function(){var n=g8(),o=m8-(n-r);if(r=n,o>0){if(++t>=h8)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var y8=v8,b8=y8(p8),C8=b8;function w8(e,t){return C8(u8(e,t,o8),e+"")}var k8=w8,S8=9007199254740991;function E8(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=S8}var B8=E8;function _8(e){return null!=e&&B8(e.length)&&!y2(e)}var x8=_8,T8=9007199254740991,A8=/^(?:0|[1-9]\d*)$/;function I8(e,t){var r=typeof e;return!!(t=null==t?T8:t)&&("number"==r||"symbol"!=r&&A8.test(e))&&e>-1&&e%1==0&&e<t}var P8=I8;function R8(e,t,r){if(!f2(r))return!1;var n=typeof t;return!!("number"==n?x8(r)&&P8(t,r.length):"string"==n&&t in r)&&l1(r[t],e)}var D8=R8;function N8(e){return k8((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,i&&D8(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,a)}return t}))}var O8=N8;function L8(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var M8=L8,F8="[object Arguments]";function U8(e){return n2(e)&&t2(e)==F8}var j8=U8,V8=Object.prototype,z8=V8.hasOwnProperty,q8=V8.propertyIsEnumerable,H8=j8(function(){return arguments}())?j8:function(e){return n2(e)&&z8.call(e,"callee")&&!q8.call(e,"callee")},K8=H8;function W8(){return!1}var Q8=W8,G8=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?F0.Buffer:void 0,a=(o?o.isBuffer:void 0)||Q8;e.exports=a})),X8="[object Arguments]",Y8="[object Array]",$8="[object Boolean]",Z8="[object Date]",J8="[object Error]",e6="[object Function]",t6="[object Map]",r6="[object Number]",n6="[object Object]",o6="[object RegExp]",a6="[object Set]",i6="[object String]",s6="[object WeakMap]",c6="[object ArrayBuffer]",u6="[object DataView]",l6="[object Float32Array]",d6="[object Float64Array]",f6="[object Int8Array]",p6="[object Int16Array]",h6="[object Int32Array]",m6="[object Uint8Array]",g6="[object Uint8ClampedArray]",v6="[object Uint16Array]",y6="[object Uint32Array]",b6={};function C6(e){return n2(e)&&B8(e.length)&&!!b6[t2(e)]}b6[l6]=b6[d6]=b6[f6]=b6[p6]=b6[h6]=b6[m6]=b6[g6]=b6[v6]=b6[y6]=!0,b6[X8]=b6[Y8]=b6[c6]=b6[$8]=b6[u6]=b6[Z8]=b6[J8]=b6[e6]=b6[t6]=b6[r6]=b6[n6]=b6[o6]=b6[a6]=b6[i6]=b6[s6]=!1;var w6=C6;function k6(e){return function(t){return e(t)}}var S6=k6,E6=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&O0.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a})),B6=E6&&E6.isTypedArray,_6=B6?S6(B6):w6,x6=_6,T6=Object.prototype,A6=T6.hasOwnProperty;function I6(e,t){var r=D0(e),n=!r&&K8(e),o=!r&&!n&&G8(e),a=!r&&!n&&!o&&x6(e),i=r||n||o||a,s=i?M8(e.length,String):[],c=s.length;for(var u in e)!t&&!A6.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||P8(u,c))||s.push(u);return s}var P6=I6,R6=Object.prototype;function D6(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||R6)}var N6=D6;function O6(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}var L6=O6,M6=Object.prototype,F6=M6.hasOwnProperty;function U6(e){if(!f2(e))return L6(e);var t=N6(e),r=[];for(var n in e)("constructor"!=n||!t&&F6.call(e,n))&&r.push(n);return r}var j6=U6;function V6(e){return x8(e)?P6(e,!0):j6(e)}var z6=V6,q6=O8((function(e,t,r,n){r8(t,z6(t),e,n)})),H6=q6;function K6(e,t){return function(r){return e(t(r))}}var W6=K6,Q6=W6(Object.getPrototypeOf,Object),G6=Q6,X6="[object Object]",Y6=Function.prototype,$6=Object.prototype,Z6=Y6.toString,J6=$6.hasOwnProperty,e9=Z6.call(Object);function t9(e){if(!n2(e)||t2(e)!=X6)return!1;var t=G6(e);if(null===t)return!0;var r=J6.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Z6.call(r)==e9}var r9=t9,n9="[object DOMException]",o9="[object Error]";function a9(e){if(!n2(e))return!1;var t=t2(e);return t==o9||t==n9||"string"==typeof e.message&&"string"==typeof e.name&&!r9(e)}var i9=a9,s9=k8((function(e,t){try{return i8(e,void 0,t)}catch(e){return i9(e)?e:new Error(e)}})),c9=s9;function u9(e,t){return e5(t,(function(t){return e[t]}))}var l9=u9,d9=Object.prototype,f9=d9.hasOwnProperty;function p9(e,t,r,n){return void 0===e||l1(e,d9[r])&&!f9.call(n,r)?t:e}var h9=p9,m9={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function g9(e){return"\\"+m9[e]}var v9=g9,y9=W6(Object.keys,Object),b9=y9,C9=Object.prototype,w9=C9.hasOwnProperty;function k9(e){if(!N6(e))return b9(e);var t=[];for(var r in Object(e))w9.call(e,r)&&"constructor"!=r&&t.push(r);return t}var S9=k9;function E9(e){return x8(e)?P6(e):S9(e)}var B9=E9,_9=/<%=([\s\S]+?)%>/g,x9=_9;function T9(e){return function(t){return null==e?void 0:e[t]}}var A9=T9,I9={"&":"&","<":"<",">":">",'"':""","'":"'"},P9=A9(I9),R9=P9,D9=/[&<>"']/g,N9=RegExp(D9.source);function O9(e){return(e=s5(e))&&N9.test(e)?e.replace(D9,R9):e}var L9=O9,M9=/<%-([\s\S]+?)%>/g,F9=M9,U9=/<%([\s\S]+?)%>/g,j9=U9,V9={escape:F9,evaluate:j9,interpolate:x9,variable:"",imports:{_:{escape:L9}}},z9=V9,q9="Invalid `variable` option passed into `_.template`",H9=/\b__p \+= '';/g,K9=/\b(__p \+=) '' \+/g,W9=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Q9=/[()=,{}\[\]\/\s]/,G9=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,X9=/($^)/,Y9=/['\n\r\u2028\u2029\\]/g,$9=Object.prototype,Z9=$9.hasOwnProperty;function J9(e,t,r){var n=z9.imports._.templateSettings||z9;r&&D8(e,t,r)&&(t=void 0),e=s5(e),t=H6({},t,n,h9);var o,a,i=H6({},t.imports,n.imports,h9),s=B9(i),c=l9(i,s),u=0,l=t.interpolate||X9,d="__p += '",f=RegExp((t.escape||X9).source+"|"+l.source+"|"+(l===x9?G9:X9).source+"|"+(t.evaluate||X9).source+"|$","g"),p=Z9.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,i,s,c){return n||(n=i),d+=e.slice(u,c).replace(Y9,v9),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var h=Z9.call(t,"variable")&&t.variable;if(h){if(Q9.test(h))throw new Error(q9)}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(H9,""):d).replace(K9,"$1").replace(W9,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=c9((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(m.source=d,i9(m))throw m;return m}var e7=J9,t7=uL.Errors;function r7(e){var t=e.livenessSettings,r=e.apiClient,n=e.apiCheck,o=e.onError,a=Wy(xC.useState({face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,take_one_picture_time_ms:3e3,limit_time_liveness_check:{enable:!1,limit_time_second:45},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5},exif_data_settings:{enable:!0},record_video:{enable:!1}}),2),i=a[0],s=a[1];return xC.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=g5(e,"data.settings.sdk_settings.active_liveness_settings"),n=g5(e,"data.settings.sdk_settings.liveness_settings"),a=g5(r,"save_encoded_frames",{});a.enable&&(t={enable:!0,framesIntervalTime:a.frames_interval_ms,framesBatchLength:a.frames_batch_len});var i=g5(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});s(Ny(Ny(Ny({},r),n),{},{captureFrameSettings:t,exif_data_settings:i}))}e&&e.errors&&o(t7.server_error)})).catch((function(e){o(e)}))}),[t,r,o,n]),i}var n7={Selfie:{backgroundColor:"rgba(0, 0, 0, 0.6)",captureIcon:{src:"",width:"50px"},countdown:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px",padding:"5px 10px"},error:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px",padding:"5px 10px"},progressCircle:{radius:160,strokeWidth:3,progress:0,showErrorRing:!0,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:1,insideRingStrokeDash:"2",errorRingColor:"#df0000",errorRingWidth:1,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!1,showDashedRing:!1,showInsideRing:!0},Active:{instruction:{color:"#fff",fontSize:"20px",fontWeight:"normal",textShadow:"2px 2px 4px #000000",backgroundColor:"unset",border:"unset",borderRadius:"unset"},directionIcon:{frontal:"",left:"",right:"",up:"",width:"70px"},imageHolder:{width:"40px",height:"40px",borderRadius:"50%",border:"2px solid #fff",fontSize:"16px",color:"#fff",fontWeight:"700",frontal:"",left:"",right:"",up:""}}}},o7=function(e){var t=e.curStep,r=e.faceDirection,n=g5(t,"stepTimeConstraints.delayTime");return!!n&&(null===t.firstFrameSpottedAt?(t.name===r&&(t.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-t.firstFrameSpottedAt<n)},a7=function(e,t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E;return{radius:null!==(r=e.radius)&&void 0!==r?r:J5(t,"Selfie.progressCircle.radius",n7),strokeWidth:null!==(n=e.strokeWidth)&&void 0!==n?n:J5(t,"Selfie.progressCircle.strokeWidth",n7),progress:null!==(o=e.progress)&&void 0!==o?o:J5(t,"Selfie.progressCircle.progress",n7),showErrorRing:null!==(a=e.showErrorRing)&&void 0!==a?a:J5(t,"Selfie.progressCircle.showErrorRing",n7),activeColor:null!==(i=e.activeColor)&&void 0!==i?i:J5(t,"Selfie.progressCircle.activeColor",n7),innerPadding:null!==(s=e.innerPadding)&&void 0!==s?s:J5(t,"Selfie.progressCircle.innerPadding",n7),outsideRingColor:null!==(c=e.outsideRingColor)&&void 0!==c?c:J5(t,"Selfie.progressCircle.outsideRingColor",n7),outsideRingOpacity:null!==(u=e.outsideRingOpacity)&&void 0!==u?u:J5(t,"Selfie.progressCircle.outsideRingOpacity",n7),insideRingColor:null!==(l=e.insideRingColor)&&void 0!==l?l:J5(t,"Selfie.progressCircle.insideRingColor",n7),insideRingWidth:null!==(d=e.insideRingWidth)&&void 0!==d?d:J5(t,"Selfie.progressCircle.insideRingWidth",n7),insideRingStrokeDash:null!==(f=e.insideRingStrokeDash)&&void 0!==f?f:J5(t,"Selfie.progressCircle.insideRingStrokeDash",n7),errorRingWidth:null!==(p=e.errorRingWidth)&&void 0!==p?p:J5(t,"Selfie.progressCircle.errorRingWidth",n7),errorRingColor:null!==(h=e.errorRingColor)&&void 0!==h?h:J5(t,"Selfie.progressCircle.errorRingColor",n7),dashedRingColor:null!==(m=e.dashedRingColor)&&void 0!==m?m:J5(t,"Selfie.progressCircle.dashedRingColor",n7),dashedRingOpacity:null!==(g=e.dashedRingOpacity)&&void 0!==g?g:J5(t,"Selfie.progressCircle.dashedRingOpacity",n7),dashedRingWidth:null!==(v=e.dashedRingWidth)&&void 0!==v?v:J5(t,"Selfie.progressCircle.dashedRingWidth",n7),dashedRingLineThick:null!==(y=e.dashedRingLineThick)&&void 0!==y?y:J5(t,"Selfie.progressCircle.dashedRingLineThick",n7),dashedRingLineSpacing:null!==(b=e.dashedRingLineSpacing)&&void 0!==b?b:J5(t,"Selfie.progressCircle.dashedRingLineSpacing",n7),dashedInsideRingColor:null!==(C=e.dashedInsideRingColor)&&void 0!==C?C:J5(t,"Selfie.progressCircle.dashedInsideRingColor",n7),dashedInsideRingWidth:null!==(w=e.dashedInsideRingWidth)&&void 0!==w?w:J5(t,"Selfie.progressCircle.dashedInsideRingWidth",n7),showOutsideRing:null!==(k=e.showOutsideRing)&&void 0!==k?k:J5(t,"Selfie.progressCircle.showOutsideRing",n7),showInsideRing:null!==(S=e.showInsideRing)&&void 0!==S?S:J5(t,"Selfie.progressCircle.showInsideRing",n7),showDashedRing:null!==(E=e.showDashedRing)&&void 0!==E?E:J5(t,"Selfie.progressCircle.showDashedRing",n7)}},i7=1/0,s7=17976931348623157e292;function c7(e){return e?(e=F4(e))===i7||e===-i7?(e<0?-1:1)*s7:e==e?e:0:0===e?e:0}var u7=c7;function l7(e){var t=u7(e),r=t%1;return t==t?r?t-r:t:0}var d7=l7,f7="Expected a function";function p7(e,t){var r;if("function"!=typeof t)throw new TypeError(f7);return e=d7(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var h7=p7;function m7(e){return h7(2,e)}var g7=m7,v7=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?dK:r,e.next=3,Vq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function y7(){return b7.apply(this,arguments)}function b7(){return(b7=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.blazefaceModelUrl,n=t.tfScriptUrls,o=t.closeEyesModelUrl,a=new fK(o),e.next=4,Vq.loadTensorFlow(n);case 4:return e.next=6,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[Vq.loadBlazefaceModel({modelUrl:r}),a.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=Wy(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:a});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var C7,w7=g7(y7),k7=[],S7=function(){k7=[]},E7=function(e,t,r){r&&S7(),k7.push({id:null});var n=k7.length-1;t.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?k7[n].id=e.data.file_id:k7[n].id=-1}))},B7=function(e,t,r){r&&S7(),k7.push({id:null});var n=k7.length-1;t.uploadFiles({frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?k7[n].id=e.data.file_id:k7[n].id=-1}))},_7=function(){return new Promise((function(e){var t=setInterval((function(){k7.every((function(e){return e.id}))&&(e(),clearInterval(t))}),200)}))},x7=function(e){return e.enable?k7.some((function(e){return-1===e.id}))?null:k7:[]},T7=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.steps,n=t.apiClient,o=t.FaceDirection,a=t.outputEncryptionSettings,i=t.video,s=[],r.forEach((function(e){var t=e.name,r=e.image,i=e.frontalFaceImage;if(t!==o.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:r.leftRightScore,gesture:t})};a&&a.key?s.push(n.httpClient.post("/v1/images",Ny({base64:r.encrypted.hex},c),{"X-TV-Key":a.key})):s.push(n.uploadImage(Ny({file:r.blob},c)))}else s.push(Promise.resolve({data:{image_id:null}}));if(i.blob){var u={label:"portrait",metadata:JSON.stringify({gesture_score:i.leftRightScore,gesture:o.FRONTAL})};a&&a.key?s.push(n.httpClient.post("/v1/images",Ny({base64:i.encrypted.hex},u),{"X-TV-Key":a.key})):s.push(n.uploadImage(Ny({file:i.blob},u)))}else s.push(Promise.resolve({data:{image_id:null}}))})),c=i?n.uploadFile({file:i,label:"video"}):Promise.resolve({data:{file_id:null}}),e.next=6,Promise.all([c].concat(s));case 6:return u=e.sent,l=Qy(u),d=l[0],f=l.slice(1),r.forEach((function(e,t){e.image.imageId=f[2*t].data.image_id,e.frontalFaceImage.imageId=f[2*t+1].data.image_id})),e.abrupt("return",d);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),A7=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.faceVerificationFlowData,o=t.onLivenessDetectionDone,a=t.captureFrameSettings,i=t.FaceDirection,s=t.onError,c=t.outputEncryptionSettings,u=t.video,e.prev=1,l=n.current.steps,e.next=5,T7({steps:l,apiClient:r,FaceDirection:i,outputEncryptionSettings:c,video:u});case 5:if(0!==(d=l.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=10;break}o({error:"wrong_face_movement"}),e.next=27;break;case 10:return e.next=12,_7();case 12:if(f=x7(a)){e.next=17;break}o({error:"network_error"}),e.next=27;break;case 17:return p=r.verifyFaceLiveness({images:d.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:l.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:f}),h=r.requestVerifyPortrait({image:{id:d[d.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([p,h]);case 21:m=e.sent,g=Wy(m,2),v=g[0],y=g[1],b=!0===v.data.is_live,o({apiCheckPassed:b,verifyFaceLivenessResult:v.data,verifyFacePortraitResult:y.data,frontalFaces:d.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:l.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){var t=e.name,r=e.image;return{name:t,blob:r.blob,id:r.imageId}}))});case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(1),s({error:e.t0});case 32:case"end":return e.stop()}}),e,null,[[1,29]])})));return function(t){return e.apply(this,arguments)}}(),I7=[],P7=null,R7=!1,D7=function(){return I7},N7=function(){R7=!0,I7=[];try{P7 instanceof MediaStream&&(P7.getTracks().forEach((function(e){return e.stop()})),P7=null)}catch(e){}};function O7(e,t,r){if(e.data.size>0){var n=new Blob([e.data],{type:"video/mp4"});I7.push(n),t()}else console.error("No video have recored!"),r()}function L7(e,t,r,n){if(e&&n){var o=n.cropX,a=n.cropY,i=n.cropWidth,s=n.cropHeight;e.drawImage(t,o,a,i,s,0,0,r,r),R7||requestAnimationFrame((function(){return L7(e,t,r,n)}))}}function M7(e){return F7.apply(this,arguments)}function F7(){return(F7=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.outputImagesSize,n=t.videoEl,o=t.resultAnalyzeVideoAndWindowSizes,N7(),(i=document.createElement("canvas")).width=r,i.height=r,s=i.getContext("2d"),e.prev=6,c={width:{min:360,ideal:400},height:{min:360,ideal:400}},u={mimeType:"video/webm"},e.prev=9,P7=null==n||null===(l=n.captureStream())||void 0===l?void 0:l.clone(),d=P7.getVideoTracks()[0],e.next=14,d.applyConstraints(c);case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(9);case 18:MediaRecorder.isTypeSupported("video/mp4")&&(R7=!1,L7(s,n,r,o),P7=i.captureStream(25),u={mimeType:"video/mp4",videoBitsPerSecond:25e5}),a=new MediaRecorder(P7,u),f=function(){return new Promise((function(e,t){a.ondataavailable=function(r){return O7(r,e,t)},"inactive"!==a.state&&a.stop()}))},p=function(){var e=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f();case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),h=function(){"inactive"!==a.state&&a.stop()},a.stopVideoRecording=p,a.discardRecording=h,e.next=29;break;case 27:e.prev=27,e.t1=e.catch(6);case 29:return e.abrupt("return",{mediaRecorder:a});case 30:case"end":return e.stop()}}),e,null,[[6,27],[9,16]])})))).apply(this,arguments)}var U7,j7,V7,z7,q7,H7,K7,W7,Q7=WV.faceTracker(),G7=new Wq,X7=uL.Mode,Y7=uL.FaceDirection,$7=uL.Errors,Z7=uL.Messages,J7=uL.TrackLivenessEvents,eee=-1,tee=3,ree=3,nee={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(C7={},Py(C7,uL.FaceDirection.UP,{delayTime:0}),Py(C7,uL.FaceDirection.LEFT,{delayTime:0}),Py(C7,uL.FaceDirection.RIGHT,{delayTime:0}),Py(C7,uL.FaceDirection.FRONTAL,{delayTime:2e3}),C7),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}},oee=function(e){var t=e.apiCredentials,r=e.sdkAdapter,n=fq.useApiClient({apiCredentials:t}).apiClient;return{apiClient:r instanceof CK?r:n,apiClientFromUtils:n}};function aee(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,r=e.mode,n=e.bgCameraMask,o=e.bgCameraMaskRed,a=e.surroundStyle,i=e.cropAreaDimension,s=e.customInstructions,c=e.customIcon,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=void 0===l?nee.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?nee.captureFrameSettings:v,b=e.livenessSettings,C=e.setRemainingTime,w=void 0===C?nee.setRemainingTime:C,k=e.onProcessing,S=void 0===k?nee.onProcessing:k,E=e.customErrors,B=e.customMessages,_=e.apiCredentials,x=void 0===_?{}:_,T=e.onFramesCaptured,A=void 0===T?nee.onFramesCaptured:T,I=e.initFirstGestureTimeout,P=void 0===I?2e3:I,R=e.outputEncryptionSettings,D=e.cameraScale,N=void 0===D?1:D,O=e.passiveModeAuto,L=void 0!==O&&O,M=e.sendCustomEvent,F=e.sdkAdapter,U=void 0===F?null:F,j=xC.useState(!1),V=Wy(j,2),z=V[0],q=V[1],H=xC.useState(!1),K=Wy(H,2),W=K[0],Q=K[1],G=xC.useState(!1),X=Wy(G,2),Y=X[0],$=X[1],Z=xC.useState(!1),J=Wy(Z,2),ee=J[0],te=J[1],re=xC.useRef(null),ne=yj.useSDKSettings(),oe=ne.lang,ae=ne.assetRoot,ie=ne.customUrls,se=ne.exifKey,ce=r===X7.ACTIVE,ue=xC.useReducer((function(e){return e+1}),0),le=Wy(ue,2),de=(le[0],le[1]),fe=xC.useRef(null),pe=xC.useRef(!1),he=xC.useState(!1),me=Wy(he,2),ge=me[0],ve=me[1],ye=xC.useRef({}),be=oee({apiCredentials:x,sdkAdapter:U}),Ce=be.apiClient,we=be.apiClientFromUtils,ke=Yj.useSDKTracking(),Se=ke.sendEvent,Ee=hK(),Be=Ee.startMotion,_e=Ee.stopMotion,xe=Ee.motionData,Te=Ee.orientationData,Ae=xC.useRef(null);null===Ae.current&&(Ae.current=WV.initFaceVerificationData({assetRoot:ae,customInstructions:s,customIcon:c,customDirectionIcon:u,customStepTimeConstraints:d}));var Ie=xC.useState(),Pe=Wy(Ie,2),Re=Pe[0],De=Pe[1],Ne=xC.useCallback((function(e){De(e)}),[]),Oe=xC.useMemo((function(){return W4(Ne,500)}),[Ne]),Le=xC.useRef([]),Me=xC.useRef(),Fe=r7({livenessSettings:b,apiClient:we,apiCheck:t,onError:p}),Ue=Fe.face_tracking_setting,je=Fe.flow_interval_time_ms,Ve=Fe.limit_time_liveness_check,ze=Fe.terminate_if_no_face,qe=Fe.close_eye_detector,He=void 0===qe?{}:qe,Ke=Fe.captureFrameSettings,We=void 0===Ke?y:Ke,Qe=Fe.exif_data_settings,Ge=Fe.record_video,Xe=Fe.take_one_picture_time_ms,Ye=null==Ge?void 0:Ge.enable,$e=xC.useRef(""),Ze=xC.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==J7?void 0:J7.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===$e.current)return;$e.current=r}Se(e),M&&M(e)}}),[M,Se]),Je=xC.useMemo((function(){return W4((function(e){Ze(e)}),2e3)}),[Ze]),et=xC.useRef(0),tt=xC.useRef(),rt=xC.useRef();xC.useEffect((function(){Ze({tag:"selfie",event:null==J7?void 0:J7.start_camera,log:{}})}),[Ze]),xC.useEffect((function(){return G7.start(),lK.initExifData(),function(){G7.stop()}}),[]),xC.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(ge){t.next=13;break}return Me.current=performance.now(),t.next=4,w7(ie);case 4:return ye.current=t.sent,t.next=7,Vq.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){t.next=9;break}return t.abrupt("return");case 9:ve(!0),Ze({tag:"selfie",event:null==J7?void 0:J7.show_warmup,log:{}}),Ze({tag:"selfie",event:null==J7?void 0:J7.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Me.current}}),Me.current=null;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[ge,ie,Ze]);var nt=xC.useRef(!1),ot=xC.useCallback((function(){var e;w(""),Ae.current.curStepIndex=Ae.current.steps.length,nt.current=!0,$(!1),G7.stop(),null===(e=rt.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;Ae.current=WV.initFaceVerificationData({assetRoot:ae,customInstructions:s,customIcon:c,customDirectionIcon:u}),G7.start(),et.current=0,tt.current=null,Le.current=[],te(!1),S7(),null===(e=rt.current)||void 0===e||e.start(),nt.current=!1,de()}),je)}),[ae,s,c,u,je,w]),at=xC.useMemo((function(){return Ny(Ny({},$7),E)}),[E]),it=xC.useMemo((function(){return Ny(Ny({},Z7),B)}),[B]),st=400;xC.useEffect((function(){if(W&&Ve.enable&&ee){var e=Ve.limit_time_second+1,t=Ve.remain_time_show||10,r=Ve.format||"s";G7.start("limit",(function(n){var o=e-n;if(Ae.current.curStepIndex<Ae.current.steps.length){if(o<=t&&o>=1){var a=e7(it.REMAIN_TIME[oe]),i=o;switch(r){case"mm:ss":i=o.toString().padStart(5,"00:00");break;case"ss":i=o.toString().padStart(2,"0")}w(a({x:i}))}if(0===o){var s,c={};Object.keys(null===(s=at.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=e7(null===(t=at.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:Ve.limit_time_second})})),De(Ny(Ny({},at.liveness_terminated_time_out),{},{msg:c,duration:je})),Ze({tag:"selfie",event:null==J7?void 0:J7.show_alert,log:{alert:"liveness_terminated_time_out,"}}),ot()}}}))}}),[ot,w,W,oe,je,Ve.enable,Ve.limit_time_second,ee,at.liveness_terminated_time_out,it.REMAIN_TIME,Ve.format,Ve.remain_time_show,Ze]);var ct=xC.useCallback((function(e){var t,r,o=e.clientWidth,s=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;v5.isMobile?r=t=c:t=r=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=n;fe.current={x:f,y:p,width:t,height:r,image:h,surroundStyle:a},"object"===By(i)?fe.current=Ny(Ny({},fe.current),i):"function"==typeof i&&(fe.current=Ny(Ny({},fe.current),i({clientWidth:o,clientHeight:s,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:v5.isMobile,width:t,height:r}))),de(),Q(!0)}),[n,a,i]),ut=xC.useState(tee),lt=Wy(ut,2),dt=lt[0],ft=lt[1],pt=xC.useState(!1),ht=Wy(pt,2),mt=ht[0],gt=ht[1],vt=xC.useRef(!1),yt=xC.useCallback((function(e){gt(e),vt.current=e}),[]),bt=xC.useRef(null),Ct=xC.useRef([]),wt=xC.useCallback((function(){ft(tee),clearInterval(bt.current),yt(!0);var e=function(){var e=xy(regeneratorRuntime.mark((function e(r){var n,o,a,i,s,c,u,l,d,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r-1!=0){e.next=27;break}return clearInterval(bt.current),o=Ct.current,S(),e.next=6,null===(n=rt.current)||void 0===n?void 0:n.stopVideoRecording();case 6:return q(!0),_e(),lK.preWriteExif({mode:lK.MODE.SELFIE,motionData:xe,orientationData:Te,startTime:Date.now()-1e3*G7.duration("from_1st_frame"),endTime:Date.now(),exifKey:se}),a=o.map((function(e){return Jz.resizeBlobImg(e.blob,st,st)})),e.next=12,Promise.all(a);case 12:return i=e.sent,s=i.map((function(e,t){return lK.writeExif({mode:lK.MODE.SELFIE,imageData:Ny(Ny({},o[t]),{},{blob:e,gesture:"frontal"}),enableExifData:Qe.enable})})),e.next=16,Promise.all(s);case 16:if(c=e.sent,u={},!R||!R.key){e.next=25;break}return l=R.key,d=c.map((function(e){return Kq.encrypt({blob:e,key:l})})),e.next=23,Promise.all(d);case 23:h=e.sent,u={frontalFacesEncrypted:h};case 25:t?(g=Gy(Le.current),v=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:Y7.FRONTAL})}},y=o.map((function(e,t){return Ce.uploadImage(Ny({file:c[t]},v(e.leftRightScore)))})),R&&R.key&&(y=o.map((function(e,t){return we.httpClient.post("/v1/images",Ny({base64:u.frontalFacesEncrypted[t].hex},v(e.leftRightScore)),{"X-TV-Key":R.key})}))),Promise.all(y).then((function(e){return Ce.verifyFaceLiveness({images:e.map((function(e){return{id:e.data.image_id}})),videos:[{frames:g}]})})).then((function(e){f({apiCheckPassed:e.data.is_live,verifyFaceLivenessResult:e.data})})).catch((function(e){p({error:e})}))):U instanceof CK?(q(!0),m=Ny(Ny({mode:X7.PASSIVE,imageAddedExif:c,frontalFaceImages:o},u),{},{capturedFrames:Le.current,steps:Ae.current.steps}),f(m),q(!1)):(f(Ny(Ny({frontalFaces:c},u),{},{capturedFrames:Le.current,video:D7()})),N7()),q(!1);case 27:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();bt.current=setInterval((function(){ft((function(t){return e(t),t-1}))}),Xe/tee)}),[Xe,yt,t,f,Ce,we,p,S,R,_e,xe,Te,Qe.enable,U,se]),kt=xC.useRef({});xC.useEffect((function(){kt.current.isFirstValidFrameFoundRef=ee}),[ee]),xC.useEffect((function(){var e,r=re.current,a=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Ae.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:Y7.FRONTAL}),0})),n=r.map((function(e){return Jz.resizeBlobImg(e.blob,st,st)})),e.next=6,Promise.all(n);case 6:return o=e.sent,a="0",y.framesBatchLength>0&&(i="".concat(Math.floor(Le.current.length/y.framesBatchLength),"x").concat(y.framesBatchLength),s=Le.current.length%y.framesBatchLength>0?"+".concat(Le.current.length%y.framesBatchLength):"",a="".concat(Le.current.length,":").concat(i).concat(s)),c=o.map((function(e,t){return lK.writeExif({mode:lK.MODE.SELFIE,imageData:Ny(Ny({},r[t]),{},{blob:e,frames:a}),enableExifData:Qe.enable})})),e.next=12,Promise.all(c);case 12:return u=e.sent,l=r.map((function(e,t){return{name:e.name,blob:u[t]}})),e.next=16,Promise.all(t.map(function(){var e=xy(regeneratorRuntime.mark((function e(r,n){var o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=l.filter((function(e){return e.name===r.name})),t[n].image.blob=o[0].blob,r.frontalFaceImage.blob&&(t[n].frontalFaceImage.blob=o[1].blob),!R||!R.key){e.next=12;break}return a=R.key,e.next=7,Kq.encrypt({blob:o[0].blob,key:a});case 7:if(t[n].image.encrypted=e.sent,!r.frontalFaceImage.blob){e.next=12;break}return e.next=11,Kq.encrypt({blob:o[1].blob,key:a});case 11:t[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),i=function(){var e=xy(regeneratorRuntime.mark((function e(){var r,n,o,i,s,c,u,l,d,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Ae.current.steps,o=n[Ae.current.curStepIndex],Py(r={},uL.FaceDirection.UP,null==J7?void 0:J7.capture_up_face),Py(r,uL.FaceDirection.LEFT,null==J7?void 0:J7.capture_left_face),Py(r,uL.FaceDirection.RIGHT,null==J7?void 0:J7.capture_right_face),Py(r,uL.FaceDirection.FRONTAL,null==J7?void 0:J7.capture_frontal_face),Ze({tag:"selfie",event:r[o.name],log:{time_capture_in_seconds:((performance.now()-Me.current)/1e3).toFixed(1)}}),Ae.current.curStepIndex++,Me.current=performance.now(),Ue.enable&&"each_gesture"===Ue.limit_for&&(et.current=0),Ae.current.curStepIndex!==n.length){e.next=48;break}if(Ve.enable&&w(""),!f){e.next=48;break}return We.enable&&We.framesBatchLength>0&&Le.current.length%We.framesBatchLength>0&&(A(Le.current.slice(Le.current.length%We.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t?E7(Le.current.slice(Le.current.length%We.framesBatchLength*-1),we):U instanceof CK&&B7(Le.current.slice(Le.current.length%We.framesBatchLength*-1),Ce)),Ze({tag:"selfie",event:null==J7?void 0:J7.finish_capture,log:{time_capture_in_seconds:G7.duration("from_1st_frame")}}),S(),e.next=15,null===(i=rt.current)||void 0===i?void 0:i.stopVideoRecording();case 15:return q(!0),_e(),lK.preWriteExif({mode:lK.MODE.SELFIE,motionData:xe,orientationData:Te,startTime:Date.now()-1e3*G7.duration("from_1st_frame"),endTime:Date.now(),exifKey:se}),e.next=20,a();case 20:if(t){e.next=40;break}if(d=n.filter((function(e){return e.name!==Y7.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),m=n.filter((function(e){return e.name!==Y7.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),g=n.filter((function(e){return e.name!==Y7.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),v=null===(s=n.find((function(e){return e.name===Y7.FRONTAL})))||void 0===s||null===(c=s.image)||void 0===c?void 0:c.blob,y=null===(u=n.find((function(e){return e.name===Y7.FRONTAL})))||void 0===u||null===(l=u.image)||void 0===l?void 0:l.encrypted,!v||!h){e.next=32;break}return e.next=29,Jz.scaleImage(v,{minSize:h});case 29:e.t0=e.sent,e.next=33;break;case 32:e.t0=null;case 33:b=e.t0,v&&m.push(v),y&&g.push(y),Ze({tag:"result",event:null==J7?void 0:J7.liveness_detection_done,log:{result_object:{steps:d,frontalFaces:m,frontalScaledImage:b}}}),f(U instanceof CK?{mode:X7.ACTIVE,faceVerificationFlowData:Ae,captureFrameSettings:We,FaceDirection:Y7,capturedFrames:Le.current}:{steps:d,frontalFaces:m,frontalFacesEncrypted:g,frontalScaledImage:b,capturedFrames:Le.current}),e.next=47;break;case 40:if(!(U instanceof CK)){e.next=45;break}f({mode:X7.ACTIVE,faceVerificationFlowData:Ae,captureFrameSettings:We,FaceDirection:Y7,capturedFrames:Le.current,video:D7().length?D7()[0]:null}),N7(),e.next=47;break;case 45:return e.next=47,A7({apiClient:Ce,faceVerificationFlowData:Ae,onLivenessDetectionDone:f,captureFrameSettings:We,FaceDirection:Y7,onError:p,outputEncryptionSettings:R,video:D7().length?D7()[0]:null});case 47:q(!1);case 48:de();case 49:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=q4((function(){var e=Ae.current,t=e.curStepIndex,r=e.steps,n=r[t],o=null!==(null==n?void 0:n.image.blob),a=null!==(null==n?void 0:n.frontalFaceImage.blob),s=r.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(a||![1].includes(t)||s>=1)?(pe.current=!1,i(),c=!0):pe.current=!(!o||a),$(!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,a,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.blurScore,a=t.leftRightScore,c=t.isEyeClose,u=Ae.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!o7({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!==Y7.FRONTAL||null!==f.frontalFaceImage.blurScore&&!BV.hasBetterBlurScore(o,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=o,e.next=12,xV.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=a,f.frontalFaceImage.captureTime=Date.now(),pe.current&&(pe.current=!1,i());case 17:if(f.name!==r||null!==f.image.blurScore&&!BV.hasBetterBlurScore(o,f.image.blurScore)){e.next=29;break}return $(!0),f.image.blurScore=o,e.next=22,xV.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=a,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(h),s();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,t,r){return m.apply(this,arguments)}function m(){return(m=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===vt.current&&t===Y7.FRONTAL&&Ct.current.length<ree)){e.next=5;break}return e.next=3,xV.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(Le.current.length&&Date.now()-Le.current[Le.current.length-1].time<We.framesIntervalTime)return null;if(We.enable&&!o){var a=e.topLeft,i=e.bottomRight,s=[].concat(Gy(a),Gy(i)),c=Q7(e,0===Le.current.length),u=c.score,l=c.time,d=r.toDataURL("image/jpeg",.8);return Le.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:Le.current.length,bbox:s,original_bbox:s}),We.framesBatchLength>0&&Le.current.length%We.framesBatchLength==0&&A&&(A(Le.current.slice(-We.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t?E7(Le.current.slice(-We.framesBatchLength),we,Le.current.length===We.framesBatchLength):U instanceof CK&&B7(Le.current.slice(-We.framesBatchLength),Ce,Le.current.length===We.framesBatchLength)),u}return null}function b(e){var t=e.trackingScore,r=e.isFirstValidFrameFoundRef;if(!Ue.enable||null===t||!r)return!0;var n=Ue.web_warning_threshold,o=Ue.web_terminate_threshold,a=Ue.max_warning_time;return t<n||(t<o&&et.current<a?(et.current++,et.current===a?(De(Ny(Ny({},at.liveness_terminated_face_tracking),{},{duration:je})),Ze({tag:"selfie",event:null==J7?void 0:J7.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):De(Ny(Ny({},at.liveness_too_fast),{},{duration:1500})),!0):(De(Ny(Ny({},at.liveness_terminated),{},{duration:je})),Ze({tag:"selfie",event:null==J7?void 0:J7.show_alert,log:{alert:"liveness_terminated"}}),ot(),!1))}function C(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(ze.enable&&r){var n=ze.max_time_ms;tt.current&&t||(tt.current={time:Date.now(),frame:0}),t&&tt.current.frame++;var o=tt.current.time;t&&Date.now()-o>=n&&(De(Ny(Ny({},at.liveness_terminated_no_face),{},{duration:je})),Ze({tag:"selfie",event:null==J7?void 0:J7.show_alert,log:{alert:"liveness_terminated_no_face"}}),ot())}}function k(e,t){return E.apply(this,arguments)}function E(){return(E=xy(regeneratorRuntime.mark((function t(a,i){var s,u,f,p,h,m,g,y,w,S,E,B,_,x,T,A,I,P,R,D,O,M,F,U,j,V,z,q,H,K,W,Q,G,X,Y,$,Z;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==i?void 0:i.width)&&0!==(null==i?void 0:i.height)){t.next=2;break}return t.abrupt("return");case 2:return p=kt.current.isFirstValidFrameFoundRef,h=a.cropX,m=a.cropY,g=a.cropWidth,y=a.cropHeight,i.getContext("2d").drawImage(r,h,m,g,y,-(st*N-st)/2/N,-(st*N-st)/2/N,st,st),w=ye.current,S=w.blazefaceModel,E=w.closeEyesModel,t.next=9,Promise.all([BV.calculateBlurScore(i),GV.getModelPredictions({model:S,sCanvas:i})]);case 9:return B=t.sent,_=Wy(B,2),x=_[0],T=_[1],t.next=15,WV.validatePredictions({predictions:T,width:GV.SIZE,height:GV.SIZE});case 15:if(I=t.sent,P=I.error,R=I.fullFace,D=I.faceRatio,O=I.faceNotFrontalMinThreshold,A=P,fe.current.image=n,F=null,U=null,j=null,V=null,z=Ae.current,q=z.curStepIndex,H=z.steps,!R){t.next=44;break}return K=H[q],W=K&&K.name===Y7.FRONTAL,j=R.landmarks,t.next=33,WV.calculateFaceDirection({landmarks:j,getPerfectFrontal:W});case 33:if((Q=t.sent)&&(F=Q.gesture,U=Q.leftRightScore),G=(null==He?void 0:He.web_timeout)+d[uL.FaceDirection.FRONTAL].delayTime/1e3,!(W&&null!=He&&He.enable&&(-1===G7.duration("limit_close_eye")||G7.duration("limit_close_eye")<G))){t.next=44;break}return-1===G7.duration("limit_close_eye")&&G7.start("limit_close_eye"),t.next=40,E.predict(i,j,null==He?void 0:He.web_threshold);case 40:X=t.sent,Y=X.isEyeClose,(V=Y)&&!A&&(A=$7.close_eye);case 44:if($="no_face"===(null===(s=A)||void 0===s?void 0:s.code)||"partial_face"===(null===(u=A)||void 0===u?void 0:u.code),Z=q<H.length,C({noFace:$&&Z,isFirstValidFrameFoundRef:p}),null!==(f=A)&&void 0!==f&&f.code&&Je({tag:"selfie",event:null==J7?void 0:J7.show_alert,log:{alert:A.code}}),A&&!("face_too_small"===A.code&&F!==Y7.FRONTAL&&D>=O)){t.next=70;break}if(ce||v(T[0],i,j),!ce){t.next=58;break}if(p||(te(!0),Me.current=performance.now(),G7.start("from_1st_frame")),!b({trackingScore:v(T[0],i,j,q>=H.length),isFirstValidFrameFoundRef:p})){t.next=56;break}return t.next=56,c({faceDirection:F,canvas:i,blurScore:x,leftRightScore:U,isEyeClose:V});case 56:t.next=68;break;case 58:if(F===Y7.FRONTAL){t.next=63;break}M=at.not_frontal_face,fe.current.image=o,t.next=68;break;case 63:if(A){t.next=68;break}return p||(te(!0),G7.start("from_1st_frame")),L&&!vt.current&&0===Ct.current.length&&setTimeout((function(){wt()}),500),t.next=68,l(F,i,U);case 68:t.next=71;break;case 70:q<H.length&&(M=at[A.code],fe.current.image=o);case 71:Oe(M),e!==eee&&(e=requestAnimationFrame((function(){return k(a,i)})));case 73:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function B(){return(B=xy(regeneratorRuntime.mark((function e(){var t,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=xV.analyzeVideoAndWindowSizes(r,fe.current),(n=document.createElement("canvas")).width=st,n.height=st,(o=n.getContext("2d")).translate(st,0),o.scale(-1*N,1*N),!Ye||!r){e.next=13;break}return e.next=10,M7({outputImagesSize:st,videoEl:r,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:a=e.t0,i=a.mediaRecorder,rt.current=i,rt.current&&rt.current.start(),k(t,n);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return W&&ge&&setTimeout((function(){!function(){B.apply(this,arguments)}()}),P),function(){cancelAnimationFrame(e),e=eee}}),[P,W,oe,ce,Ce,we,t,n,o,f,p,h,g,We,S,Ue,Ve.enable,w,Oe,d,je,ot,ze,at,ge,Ze,A,R,N,wt,L,He.enable,He.web_threshold,He.web_timeout,xe,Te,_e,Qe.enable,se,Je,y.framesBatchLength,U,Ye]),xC.useEffect((function(){Re&&(clearInterval(bt.current),yt(!1),Ct.current=[]),Be()}),[Re,yt,Be]);var St=Ae.current,Et=St.curStepIndex,Bt=St.steps,_t=xC.useMemo((function(){return Bt.find((function(e){return e.name===uL.FaceDirection.FRONTAL}))}),[Bt]),xt=pe.current?_t:Bt[Et],Tt=xt&&ee?xt.instructions[oe]:null,At=xt&&ee?xt.directionIcon:"",It=xt?xt.directionIconAnimation:"";return{countdownToTakePicture:dt,cropArea:fe,curStepIndex:Et,directionIcon:At,directionIconAnimation:It,faceDetectionError:Re,handleTriggerPassiveMode:wt,handleVideoPlayed:ct,instructions:Tt,isActiveMode:ce,refVideo:re,refIsReseting:nt,showCountdown:mt,steps:Bt,videoPlayed:W,activeCapturing:Y,isFirstValidFrameFound:ee,warmupDone:ge,motionData:xe,orientationData:Te,showLoading:z}}var iee=(Py(U7={},uL.FaceDirection.LEFT,90),Py(U7,uL.FaceDirection.RIGHT,270),Py(U7,uL.FaceDirection.UP,180),Py(U7,uL.FaceDirection.DOWN,0),U7),see=hB(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),cee=dB.div(j7||(j7=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"])),iee[uL.FaceDirection.DOWN],iee[uL.FaceDirection.LEFT],iee[uL.FaceDirection.UP],iee[uL.FaceDirection.RIGHT]),uee=dB.div(V7||(V7=Ky(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var t,r=e.direction;return null!==(t=iee[r])&&void 0!==t?t:0})),lee=dB.span(z7||(z7=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"])),see),dee=dB(lee)(q7||(q7=Ky(["\n animation-delay: 0s;\n"]))),fee=dB(lee)(H7||(H7=Ky(["\n animation-delay: 0.5s;\n"]))),pee=dB(lee)(K7||(K7=Ky(["\n animation-delay: 1s;\n"]))),hee=dB.img(W7||(W7=Ky(["\n width: ",";\n"])),(function(e){var t=e.theme;return J5(t,"Selfie.Active.directionIcon.width",n7)}));function mee(e){var t=e.type,r=mB(),n=g5(r,"Selfie.Active.directionIcon.".concat(t));return null===n?xC.createElement(xC.Fragment,null):n&&null!==n?xC.createElement(hee,{src:g5(r,"Selfie.Active.directionIcon.".concat(t)),alt:""}):t!==uL.FaceDirection.FRONTAL?xC.createElement(uee,{direction:t},xC.createElement(dee,null),xC.createElement(fee,null),xC.createElement(pee,null)):xC.createElement(cee,null,xC.createElement(uee,{className:"top"},xC.createElement(dee,null),xC.createElement(fee,null),xC.createElement(pee,null)),xC.createElement(uee,{className:"right"},xC.createElement(dee,null),xC.createElement(fee,null),xC.createElement(pee,null)),xC.createElement(uee,{className:"bottom"},xC.createElement(dee,null),xC.createElement(fee,null),xC.createElement(pee,null)),xC.createElement(uee,{className:"left"},xC.createElement(dee,null),xC.createElement(fee,null),xC.createElement(pee,null)))}mee.propTypes={type:xw.oneOf([uL.FaceDirection.LEFT,uL.FaceDirection.RIGHT,uL.FaceDirection.UP,uL.FaceDirection.FRONTAL])},mee.defaultProps={type:uL.FaceDirection.LEFT};var gee,vee=uL.ErrorDuration;function yee(e){var t=e.children,r=e.errorMsg,n=e.className;return xC.isValidElement(t)?r?xC.createElement("div",{className:n},xC.cloneElement(t,{errorMsg:r})):null:r?xC.createElement("div",{className:n},r):null}function bee(e){var t=e.children,r=e.className,n=e.error,o=xC.useRef(0),a=xC.useRef(""),i=yj.useSDKSettings().lang,s=xC.useRef(vee.SHORT),c=n||{},u=c.msg,l=c.duration,d=void 0===l?vee.SHORT:l,f=null==u?void 0:u[i];return Date.now()-o.current>=s.current?(o.current=Date.now(),s.current=d,a.current=f,yee({children:t,errorMsg:f,className:r})):yee({children:t,errorMsg:a.current,className:r})}bee.propTypes={children:xw.node,className:xw.string},bee.defaultProps={className:""};var Cee=dB.circle(gee||(gee=Ky(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function wee(e){var t=e.className,r=e.style,n=e.radius,o=e.strokeWidth,a=e.progress,i=e.showErrorRing,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,C=e.dashedRingLineSpacing,w=e.dashedInsideRingColor,k=e.dashedInsideRingWidth,S=e.showOutsideRing,E=e.showInsideRing,B=e.showDashedRing,_=2*n,x=2*n,T=n-2*o,A=2*Math.PI*T,I=A-a/100*A,P=T-y/2-o/2-c,R=2*Math.PI*P,D=R-a/100*R,N=P-k/2-y/2,O=2*Math.PI*N,L=O-a/100*O,M=N-f/2-k/2,F=N-h/2-k/2;return xC.createElement("svg",{className:t,style:r,width:_,height:x,viewBox:"0 0 ".concat(_," ").concat(x),fill:"none",xmlns:"http://www.w3.org/2000/svg"},S?xC.createElement(xC.Fragment,null,xC.createElement("circle",{"data-testid":"outsideRing",opacity:l,cx:n,cy:n,r:T,stroke:u}),xC.createElement(Cee,{"data-testid":"outsideAnimateRing",cx:n,cy:n,r:T,stroke:s,strokeWidth:o,strokeLinecap:"round",strokeDasharray:"".concat(A," ").concat(A),style:{strokeDashoffset:I}})):null,B?xC.createElement(xC.Fragment,null,xC.createElement("circle",{"data-testid":"dashedRing",opacity:v,cx:n,cy:n,r:P,stroke:g,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(C)}),xC.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},xC.createElement("circle",{cx:n,cy:n,r:P,stroke:s,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(C)})),xC.createElement("g",{mask:"url(#mask0)"},xC.createElement(Cee,{"data-testid":"dashedAnimateRing",cx:n,cy:n,r:P,stroke:s,strokeWidth:y,strokeDasharray:"".concat(R," ").concat(R),style:{strokeDashoffset:D}})),xC.createElement("circle",{"data-testid":"dashedInsideRing",opacity:v,cx:n,cy:n,r:N,stroke:w,strokeWidth:k}),xC.createElement(Cee,{"data-testid":"dashedInsideAnimateRing",cx:n,cy:n,r:N,stroke:s,strokeWidth:k,strokeLinecap:"round",strokeDasharray:"".concat(O," ").concat(O),style:{strokeDashoffset:L}})):null,E?xC.createElement("circle",{"data-testid":"insideRing",strokeDasharray:p,cx:n,cy:n,r:M,stroke:d,strokeWidth:f}):null,i?xC.createElement("circle",{"data-testid":"errorRing",strokeDasharray:p,cx:n,cy:n,r:F,stroke:m,strokeWidth:h}):null)}function kee(e){var t=e.className;return xC.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xC.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 See(){return(See=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)}wee.propTypes={className:xw.string,style:xw.shape({}),radius:xw.number,strokeWidth:xw.number,progress:xw.number,showErrorRing:xw.bool,activeColor:xw.string,innerPadding:xw.number,outsideRingColor:xw.string,outsideRingOpacity:xw.number,insideRingColor:xw.string,insideRingWidth:xw.number,insideRingStrokeDash:xw.string,errorRingColor:xw.string,errorRingWidth:xw.number,dashedRingColor:xw.string,dashedRingOpacity:xw.number,dashedRingWidth:xw.number,dashedRingLineThick:xw.number,dashedRingLineSpacing:xw.number,dashedInsideRingColor:xw.string,dashedInsideRingWidth:xw.number,showOutsideRing:xw.bool,showDashedRing:xw.bool,showInsideRing:xw.bool},wee.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,showErrorRing:!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},kee.propTypes={className:xw.string},kee.defaultProps={className:""};var Eee,Bee,_ee=function(e,t){void 0===t&&(t=!0),xC.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])},xee=function(e,t){void 0===t&&(t=!0),xC.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])},Tee=function(e,t,r){void 0===r&&(r=!0),xC.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])},Aee=function(e,t){void 0===t&&(t=!0),xC.useEffect((function(){if(t){var r=function(t){if(9===t.keyCode){var r,n=null==e||null===(r=e.current)||void 0===r?void 0:r.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),o=Array.prototype.slice.call(n);if(1===o.length)return void t.preventDefault();var a=o[0],i=o[o.length-1];t.shiftKey&&document.activeElement===a?(t.preventDefault(),i.focus()):document.activeElement===i&&(t.preventDefault(),a.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])},Iee="undefined"!=typeof window?xC.useLayoutEffect:xC.useEffect,Pee={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}}},Ree=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],Dee=function(e,t,r,n,o){var a=o.offsetX,i=o.offsetY,s=n?8:0,c=r.split(" "),u=e.top+e.height/2,l=e.left+e.width/2,d=t.height,f=t.width,p=u-d/2,h=l-f/2,m="",g="0%",v="0%";switch(c[0]){case"top":p-=d/2+e.height/2+s,m="rotate(180deg) translateX(50%)",g="100%",v="50%";break;case"bottom":p+=d/2+e.height/2+s,m="rotate(0deg) translateY(-100%) translateX(-50%)",v="50%";break;case"left":h-=f/2+e.width/2+s,m=" rotate(90deg) translateY(50%) translateX(-25%)",v="100%",g="50%";break;case"right":h+=f/2+e.width/2+s,m="rotate(-90deg) translateY(-150%) translateX(25%)",g="50%"}switch(c[1]){case"top":p=e.top,g=e.height/2+"px";break;case"bottom":p=e.top-d+e.height,g=d-e.height/2+"px";break;case"left":h=e.left,v=e.width/2+"px";break;case"right":h=e.left-f+e.width,v=f-e.width/2+"px"}return{top:p="top"===c[0]?p-i:p+i,left:h="left"===c[0]?h-a:h+a,transform:m,arrowLeft:v,arrowTop:g}},Nee=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},Oee=function(e,t,r,n,o,a){var i=o.offsetX,s=o.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=Nee(a),d=Array.isArray(r)?r:[r];for((a||Array.isArray(r))&&(d=[].concat(d,Ree));u<d.length;){var f={top:(c=Dee(e,t,d[u],n,{offsetX:i,offsetY:s})).top,left:c.left,width:t.width,height:t.height};if(!(f.top<=l.top||f.left<=l.left||f.top+f.height>=l.top+l.height||f.left+f.width>=l.left+l.width))break;u++}return c},Lee=0,Mee=function(){var e=document.getElementById("popup-root");return null===e&&((e=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(e)),e},Fee=xC.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,o=e.onOpen,a=void 0===o?function(){}:o,i=e.onClose,s=void 0===i?function(){}:i,c=e.defaultOpen,u=void 0!==c&&c,l=e.open,d=void 0===l?void 0:l,f=e.disabled,p=void 0!==f&&f,h=e.nested,m=void 0!==h&&h,g=e.closeOnDocumentClick,v=void 0===g||g,y=e.repositionOnResize,b=void 0===y||y,C=e.closeOnEscape,w=void 0===C||C,k=e.on,S=void 0===k?["click"]:k,E=e.contentStyle,B=void 0===E?{}:E,_=e.arrowStyle,x=void 0===_?{}:_,T=e.overlayStyle,A=void 0===T?{}:T,I=e.className,P=void 0===I?"":I,R=e.position,D=void 0===R?"bottom center":R,N=e.modal,O=void 0!==N&&N,L=e.lockScroll,M=void 0!==L&&L,F=e.arrow,U=void 0===F||F,j=e.offsetX,V=void 0===j?0:j,z=e.offsetY,q=void 0===z?0:z,H=e.mouseEnterDelay,K=void 0===H?100:H,W=e.mouseLeaveDelay,Q=void 0===W?100:W,G=e.keepTooltipInside,X=void 0!==G&&G,Y=e.children,$=xC.useState(d||u),Z=$[0],J=$[1],ee=xC.useRef(null),te=xC.useRef(null),re=xC.useRef(null),ne=xC.useRef(null),oe=xC.useRef("popup-"+ ++Lee),ae=!!O||!n,ie=xC.useRef(0);Iee((function(){return Z?(ne.current=document.activeElement,ge(),me(),pe()):he(),function(){clearTimeout(ie.current)}}),[Z]),xC.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return a(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ae&&(null===(t=ne.current)||void 0===t||t.focus()),setTimeout((function(){return s(e)}),0))},ue=function(e){null==e||e.stopPropagation(),Z?ce(e):se(e)},le=function(e){clearTimeout(ie.current),ie.current=setTimeout((function(){return se(e)}),K)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(ie.current),ie.current=setTimeout((function(){return ce(e)}),Q)},pe=function(){ae&&M&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ae&&M&&(document.getElementsByTagName("body")[0].style.overflow="auto")},me=function(){var e,t=null==te||null===(e=te.current)||void 0===e?void 0:e.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),r=Array.prototype.slice.call(t)[0];null==r||r.focus()};xC.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var ge=function(){if(!ae&&Z&&(null==ee?void 0:ee.current)&&(null==ee?void 0:ee.current)&&(null==te?void 0:te.current)){var e,t,r=ee.current.getBoundingClientRect(),n=te.current.getBoundingClientRect(),o=Oee(r,n,D,U,{offsetX:V,offsetY:q},X);if(te.current.style.top=o.top+window.scrollY+"px",te.current.style.left=o.left+window.scrollX+"px",U&&re.current)re.current.style.transform=o.transform,re.current.style.setProperty("-ms-transform",o.transform),re.current.style.setProperty("-webkit-transform",o.transform),re.current.style.top=(null===(e=x.top)||void 0===e?void 0:e.toString())||o.arrowTop,re.current.style.left=(null===(t=x.left)||void 0===t?void 0:t.toString())||o.arrowLeft}};_ee(ce,w),Aee(te,Z&&ae),xee(ge,b),Tee(n?[te,ee]:[te],ce,v&&!m);var ve=function(){return xC.createElement("div",Object.assign({},(e=ae?Pee.popupContent.modal:Pee.popupContent.tooltip,t={className:"popup-content "+(""!==P?P.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:See({},e,B,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!O&&S.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ae?"dialog":"tooltip",id:oe.current}),U&&!ae&&xC.createElement("div",{ref:re,style:Pee.popupArrow},xC.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==P?P.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:See({position:"absolute"},x)},xC.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},ye=!(S.indexOf("hover")>=0),be=ae?Pee.overlay.modal:Pee.overlay.tooltip,Ce=[ye&&xC.createElement("div",{key:"O","data-testid":"overlay","data-popup":ae?"modal":"tooltip",className:"popup-overlay "+(""!==P?P.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:See({},be,A,{pointerEvents:v&&m||ae?"auto":"none"}),onClick:v&&m?ce:void 0,tabIndex:-1},ae&&ve()),!ae&&ve()];return xC.createElement(xC.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":oe.current},t=Array.isArray(S)?S:[S],r=0,o=t.length;r<o;r++)switch(t[r]){case"click":e.onClick=ue;break;case"right-click":e.onContextMenu=de;break;case"hover":e.onMouseEnter=le,e.onMouseLeave=fe;break;case"focus":e.onFocus=le,e.onBlur=fe}if("function"==typeof n){var a=n(Z);return!!n&&xC.cloneElement(a,e)}return!!n&&xC.cloneElement(n,e)}(),Z&&iL.createPortal(Ce,Mee()))})),Uee=pB(Eee||(Eee=Ky(["\n .popup-content {\n margin: auto;\n width: 100%;\n max-width: 568px;\n ",";\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n ",";\n }\n\n .popup-overlay {\n padding: 10px;\n ",";\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"])),(function(e){var t=e.theme;return YE(["background-color:",";padding:",";border:",";border-radius:",";"],J5(t,"popup.backgroundColor",Z5),J5(t,"popup.padding",Z5),J5(t,"popup.border",Z5),J5(t,"popup.borderRadius",Z5))}),(function(e){var t=e.theme;return YE(["background-color:",";padding:",";border:",";border-radius:",";"],J5(t,"popup.backgroundColor",Z5),J5(t,"popup.padding",Z5),J5(t,"popup.border",Z5),J5(t,"popup.borderRadius",Z5))}),(function(e){var t=e.theme;return YE(["background:",";"],J5(t,"popup.overlay.backgroundColor",Z5))})),jee=["open","children","overlayStyle"],Vee=r4+1e3,zee=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=Vy(e,jee);return xC.createElement(xC.Fragment,null,t&&xC.createElement(xC.Fragment,null,xC.createElement(Fee,Ry({overlayStyle:Ny(Ny({},n),{},{zIndex:Vee}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),xC.createElement(Uee,null)))};zee.propTypes={open:xw.bool,children:xw.node,overlayStyle:xw.shape({})},zee.defaultProps={open:!1,children:null,overlayStyle:{}};var qee={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},Hee=dB.div(Bee||(Bee=Ky(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),Kee=function(e){var t=e.contentStyle,r=yj.useSDKSettings(),n=r.lang,o=r.warmupMessage,a=o?o[n]:qee.WARMUP_INTRO[n];return xC.createElement(zee,{open:!0,contentStyle:t},xC.createElement(Hee,{className:"warmup-message"},a))};Kee.propTypes={contentStyle:xw.shape({})},Kee.defaultProps={contentStyle:{}};var Wee=500,Qee=hB(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),Gee=hB(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),Xee=YE([".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,Wee,Gee,Wee),Yee=Object.freeze({__proto__:null,animationDuration:Wee,default:Xee}),$ee=20,Zee=hB(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],$ee,$ee),Jee=hB(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],$ee,$ee),ete=YE([".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;}"],Zee,Jee),tte=Object.freeze({__proto__:null,default:ete}),rte=hB(["from,to{opacity:1;}50%{opacity:0;}"]),nte=YE([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],rte),ote=Object.freeze({__proto__:null,default:nte});function ate(){return(ate=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 ite(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function ste(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function cte(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function ute(e,t){e.classList?e.classList.add(t):cte(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function lte(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function dte(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=lte(e.className,t):e.setAttribute("class",lte(e.className&&e.className.baseVal||"",t))}var fte={disabled:!1},pte=xC.createContext(null),hte="unmounted",mte="exited",gte="entering",vte="entered",yte="exiting",bte=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var o,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(o=mte,n.appearStatus=gte):o=vte:o=t.unmountOnExit||t.mountOnEnter?hte:mte,n.state={status:o},n.nextCallback=null,n}ste(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===hte?{status:mte}: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!==gte&&r!==vte&&(t=gte):r!==gte&&r!==vte||(t=yte)}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===gte?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===mte&&this.setState({status:hte})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,o=this.props.nodeRef?[n]:[iL.findDOMNode(this),n],a=o[0],i=o[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!r||fte.disabled?this.safeSetState({status:vte},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,i),this.safeSetState({status:gte},(function(){t.props.onEntering(a,i),t.onTransitionEnd(c,(function(){t.safeSetState({status:vte},(function(){t.props.onEntered(a,i)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:iL.findDOMNode(this);t&&!fte.disabled?(this.props.onExit(n),this.safeSetState({status:yte},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:mte},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:mte},(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:iL.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=o[0],i=o[1];this.props.addEndListener(a,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===hte)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,ite(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return xC.createElement(pte.Provider,{value:null},"function"==typeof r?r(e,n):xC.cloneElement(xC.Children.only(r),n))},t}(xC.Component);function Cte(){}bte.contextType=pte,bte.propTypes={},bte.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Cte,onEntering:Cte,onEntered:Cte,onExit:Cte,onExiting:Cte,onExited:Cte},bte.UNMOUNTED=hte,bte.EXITED=mte,bte.ENTERING=gte,bte.ENTERED=vte,bte.EXITING=yte;var wte,kte,Ste=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return ute(e,t)}))},Ete=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return dte(e,t)}))},Bte=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1];t.removeClasses(o,"exit"),t.addClass(o,a?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1]?"appear":"enter";t.addClass(o,a,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),o=n[0],a=n[1]?"appear":"enter";t.removeClasses(o,a),t.addClass(o,a,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,o=n?""+(n&&r?r+"-":"")+e:r[e];return{baseClassName:o,activeClassName:n?o+"-active":r[e+"Active"],doneClassName:n?o+"-done":r[e+"Done"]}},t}ste(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,Ste(e,n))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,o=r.active,a=r.done;this.appliedClasses[t]={},n&&Ete(e,n),o&&Ete(e,o),a&&Ete(e,a)},r.render=function(){var e=this.props,t=(e.classNames,ite(e,["classNames"]));return xC.createElement(bte,ate({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(xC.Component);function _te(e,t){return e!==t&&(!xC.isValidElement(e)||!xC.isValidElement(t)||null==e.key||e.key!==t.key)}Bte.defaultProps={classNames:""},Bte.propTypes={};var xte,Tte,Ate={out:"out-in",in:"in-out"},Ite=function(e,t,r){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),r()}},Pte=((wte={})[Ate.out]=function(e){var t=e.current,r=e.changeState;return xC.cloneElement(t,{in:!1,onExited:Ite(t,"onExited",(function(){r(gte,null)}))})},wte[Ate.in]=function(e){var t=e.current,r=e.changeState,n=e.children;return[t,xC.cloneElement(n,{in:!0,onEntered:Ite(n,"onEntered",(function(){r(gte)}))})]},wte),Rte=((kte={})[Ate.out]=function(e){var t=e.children,r=e.changeState;return xC.cloneElement(t,{in:!0,onEntered:Ite(t,"onEntered",(function(){r(vte,xC.cloneElement(t,{in:!0}))}))})},kte[Ate.in]=function(e){var t=e.current,r=e.children,n=e.changeState;return[xC.cloneElement(t,{in:!1,onExited:Ite(t,"onExited",(function(){n(vte,xC.cloneElement(r,{in:!0}))}))}),xC.cloneElement(r,{in:!0})]},kte),Dte=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:vte,current:null},t.appeared=!1,t.changeState=function(e,r){void 0===r&&(r=t.state.current),t.setState({status:e,current:r})},t}ste(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===gte&&e.mode===Ate.in?{status:gte}:t.current&&_te(t.current,e.children)?{status:yte}:{current:xC.cloneElement(e.children,{in:!0})}},r.render=function(){var e,t=this.props,r=t.children,n=t.mode,o=this.state,a=o.status,i=o.current,s={children:r,current:i,changeState:this.changeState,status:a};switch(a){case gte:e=Rte[n](s);break;case yte:e=Pte[n](s);break;case vte:e=i}return xC.createElement(pte.Provider,{value:{isMounting:!this.appeared}},e)},t}(xC.Component);Dte.propTypes={},Dte.defaultProps={mode:Ate.out};var Nte=300,Ote=dB.div(xte||(xte=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"])),r4+1),Lte=hB(["from{background:#000;}to{}"]),Mte=YE([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],Lte,Nte),Fte=dB.div(Tte||(Tte=Ky(["\n ","\n"])),Mte),Ute=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return xC.createElement(Fte,null,xC.createElement(Dte,null,xC.createElement(Bte,{key:r,timeout:{enter:Nte,exit:0},classNames:"splash",unmountOnExit:!1},xC.createElement(Ote,null))))},jte=Object.freeze({__proto__:null,default:Ute}),Vte=hB(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),zte=YE([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],Vte),qte=Object.freeze({__proto__:null,default:zte}),Hte={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},Kte={IDCapturing:{backgroundColor:"rgba(0, 0, 0, 0.6)",title:{color:"#fff",fontSize:"20px",fontWeight:"normal",backgroundColor:"unset"},instruction:{color:"#fff",fontSize:"16px",fontWeight:"normal",backgroundColor:"unset",border:"unset",borderRadius:"unset"},error:{color:"#fff",fontSize:"16px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px"},countdown:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px"},cardIcon:{src:"",width:"auto",height:"38px"},captureIcon:{src:"",width:"60px",height:"60px"},loadingIcon:{src:"",width:"100px",height:"100px"},timeoutPopup:{padding:"10px",text:{color:"#000",fontSize:"1rem",fontWeight:"normal",textAlign:"center",border:"unset",borderRadius:"unset"},button:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:Hte.tsBlue,border:"none",borderRadius:"0.25rem",outline:"none",height:"50px"}},rectangleMask:{width:600,height:400,strokeWidth:2,strokeStyles:{},radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"},default:{fill:"none",stroke:"#fff",strokeWidth:2,strokeDasharray:"7, 4",opacity:.6},error:{fill:"rgba(234,50,35, 0.1)",strokeWidth:2,stroke:"#ea3223"}}},IDConfirmPopup:{confirmButton:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:Hte.tsBlue,border:"0",borderRadius:"0.25rem",outline:"none"},retryButton:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:Hte.tsBlue,border:"none",borderRadius:"0.25rem",outline:"none"},image:{borderRadius:"5px"}},QRStep:{guidelinePopup:{image:{src:"",borderRadius:"5px",backgroundColor:"#e7e6e6"},guideText:{color:Hte.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",lineHeight:"20px"},countdownText:{color:Hte.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",lineHeight:"20px"},startButton:{color:"#fff",fontSize:"1rem",fontWeight:"normal",backgroundColor:Hte.tsBlue,border:"none",borderRadius:"3px",outline:"none",height:"66px"}},scanTooltip:{backgroundColor:"#00ce78",borderRadius:"8px",color:"#fff",padding:"10px",textAlign:"center"},scanCountdown:{textAlign:"center",color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"none",borderRadius:"3px",padding:"5px 10px"},invalidPopup:{padding:"10px",title:{color:Hte.tsSecondary,fontSize:"16px",fontWeight:"bold",margin:"25px 0 0 0",padding:"0 0 0 0"},description:{color:Hte.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",margin:"30px 0 0 0",padding:"0 0 0 0"},retryButton:{color:"#fff",fontSize:"1rem",fontWeight:"normal",backgroundColor:Hte.tsBlue,border:"none",borderRadius:"3px",outline:"none",height:"66px",margin:"30px 0 0 0"},skipButton:{color:Hte.tsBlue,fontSize:"1rem",fontWeight:"normal",backgroundColor:"unset",border:"none",borderRadius:"unset",outline:"none",height:"unset",margin:"20px 0"}},resultText:{success:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#34ce60"},error:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#ff9532"}}}},Wte={DEFAULT:"default",ERROR:"error"};function Qte(e){var t=e.className,r=e.width,n=e.height,o=e.type,a=e.strokeStyles,i=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=e.defaultRectStyles,l=e.errorRectStyles,d=s+.8*i,f=xC.useMemo((function(){var e;return Ny((Py(e={},Wte.DEFAULT,u),Py(e,Wte.ERROR,l),e),a)}),[u,l,a])[o];return xC.createElement("svg",{width:r,height:n,className:t},xC.createElement("rect",{x:i/2,y:i/2,rx:s,ry:s,width:r-i,height:n-i,style:f}),xC.createElement("path",{d:"M0,".concat(d," Q0,0 ").concat(d,",0 L0,0 Z"),style:c}),xC.createElement("path",{d:"M0,".concat(n-d," Q0,").concat(n," ").concat(d,",").concat(n," L0,").concat(n," Z"),style:c}),xC.createElement("path",{d:"M".concat(r-d,",").concat(n," Q").concat(r,",").concat(n," ").concat(r,",").concat(n-d," L").concat(r,",").concat(n," Z"),style:c}),xC.createElement("path",{d:"M".concat(r-d,",0 Q").concat(r,",0 ").concat(r,",").concat(d," L").concat(r,",0 Z"),style:c}))}Qte.propTypes={className:xw.string,width:xw.number,height:xw.number,strokeWidth:xw.number,strokeStyles:xw.shape({}),type:xw.oneOf([Wte.DEFAULT,Wte.ERROR]),radius:xw.number,paddingStyle:xw.shape({}),defaultRectStyles:xw.shape({}),errorRectStyles:xw.shape({})},Qte.defaultProps={className:"",width:Kte.IDCapturing.rectangleMask.width,height:Kte.IDCapturing.rectangleMask.height,strokeWidth:Kte.IDCapturing.rectangleMask.strokeWidth,strokeStyles:Kte.IDCapturing.rectangleMask.strokeStyles,type:Wte.DEFAULT,radius:Kte.IDCapturing.rectangleMask.radius,paddingStyle:Kte.IDCapturing.rectangleMask.paddingStyle,defaultRectStyles:Kte.IDCapturing.rectangleMask.default,errorRectStyles:Kte.IDCapturing.rectangleMask.error};var Gte={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"}},Xte=50,Yte=uL.Errors,$te=function(e,t){var r,n,o,a,i,s,c;return{width:null!==(r=e.width)&&void 0!==r?r:J5(t,"IDCapturing.rectangleMask.width",Kte),height:null!==(n=e.height)&&void 0!==n?n:J5(t,"IDCapturing.rectangleMask.height",Kte),strokeWidth:null!==(o=e.strokeWidth)&&void 0!==o?o:J5(t,"IDCapturing.rectangleMask.strokeWidth",Kte),radius:null!==(a=e.radius)&&void 0!==a?a:J5(t,"IDCapturing.rectangleMask.radius",Kte),paddingStyle:null!==(i=e.paddingStyle)&&void 0!==i?i:J5(t,"IDCapturing.rectangleMask.paddingStyle",Kte),defaultRectStyles:null!==(s=e.default)&&void 0!==s?s:J5(t,"IDCapturing.rectangleMask.default",Kte),errorRectStyles:null!==(c=e.error)&&void 0!==c?c:J5(t,"IDCapturing.rectangleMask.error",Kte)}};function Zte(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function Jte(e,t){return Math.sqrt(Zte(e,t))}function ere(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=window,o=n.cv,a=t.width,i=t.height,s=r;s<1&&(s=parseInt(.5*(i+a)*s,10));var c=o.imread(t),u=new o.Mat;return o.copyMakeBorder(c,u,s,s,s,s,o.BORDER_CONSTANT,new o.Scalar(0,0,0,255)),c.delete(),{mat:u,margin:s}}function tre(e,t){var r=window.cv,n=Wy(t.map((function(e){return e.location})),4),o=n[0],a=n[1],i=n[2],s=n[3],c=Jte(i,s),u=Jte(a,o),l=Math.max(c,u),d=Jte(a,i),f=Jte(o,s),p=Math.max(d,f),h=[o.x,o.y,a.x,a.y,i.x,i.y,s.x,s.y],m=[0,0,l-1,0,l-1,p-1,0,p-1],g=r.imread(e),v=new r.Mat,y=new r.Size(l,p),b=r.matFromArray(4,1,r.CV_32FC2,h),C=r.matFromArray(4,1,r.CV_32FC2,m),w=r.getPerspectiveTransform(b,C);r.warpPerspective(g,v,w,y,r.INTER_LINEAR,r.BORDER_CONSTANT,new r.Scalar);var k=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),C.delete(),k}function rre(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},o={x:r.x-e.x,y:r.y-e.y},a=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),i=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(a*i))/Math.PI}function nre(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;t.forEach((function(e){var t=e.location,r=t.x,n=t.y;o=Math.min(o,r),a=Math.min(a,n),i=Math.max(i,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&a/n>=c&&(n-s)/n>=c&&(r-i)/r>=c}function ore(){return are.apply(this,arguments)}function are(){return(are=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=t.canvas,n=t.paddingPercent,o=void 0===n?.04:n,a=r.width,i=r.height,s=Math.floor(a*o),c=Math.floor(i*o),u=a-2*s,l=i-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(r,s,c,u,l,0,0,u,l),e.abrupt("return",nq.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ire(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,a=rre(e[r].location,e[n].location,e[o].location);if(a<70||a>110)return!1}return!0}function sre(e){return cre.apply(this,arguments)}function cre(){return(cre=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.blazefaceModel,n=t.predictedIdCardCanvas,o=t.frontSide,a=n.width,i=n.height,s=Math.floor(a/3),c=Math.floor(4*i/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(i/5),s,c,0,0,s,c),e.next=12,GV.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)&&!(FV.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[GV.SIZE,GV.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",Yte.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",Yte.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",Yte.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 ure,lre,dre,fre,pre,hre,mre,gre,vre,yre,bre,Cre,wre,kre,Sre,Ere,Bre,_re,xre,Tre,Are,Ire,Pre,Rre,Dre,Nre,Ore,Lre,Mre,Fre,Ure,jre,Vre=function(e){var t=g5(e,"card.corners");if(t&&Array.isArray(t)&&t.length>0){var r=g5(t,"[0].location"),n=r.x,o=r.y;return"".concat(n,":").concat(o)}return"-1:-1"},zre=function(e,t,r){e.current=[].concat(Gy(e.current),[t]),e.current.length>r&&e.current.shift()},qre=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E,B,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=t.currentWorkingCanvas,u=t.refVirtualWorkingCanvas,l=t.refCountVirtualFrames,d=t.refVirtualFrames,f=t.refWorkingCanvas,(p=t.refCardResult).current.corners&&Array.isArray(p.current.corners)){e.next=3;break}return e.abrupt("return");case 3:return h=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*Xte,b=(null==v||null===(o=v.location)||void 0===o?void 0:o.y)-(null==g||null===(a=g.location)||void 0===a?void 0:a.y)-2*Xte,C=performance.now(),(w=u.current).width=y,w.height=b,(k=w.getContext("2d")).drawImage(c,(null==m||null===(i=m.location)||void 0===i?void 0:i.x)+Xte,(null==m||null===(s=m.location)||void 0===s?void 0:s.y)+Xte,y,b,0,0,y,b),e.next=14,new Promise((function(e){w.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,zj.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 C=Math.floor(performance.now()-C),S=180-C>0?180-C:0,e.next=18,new Promise((function(e){return setTimeout(e,S)}));case 18:if(!(l.current<3)){e.next=29;break}return _=performance.now(),x=f.current,k.drawImage(x,(null==m||null===(E=m.location)||void 0===E?void 0:E.x)+Xte,(null==m||null===(B=m.location)||void 0===B?void 0:B.y)+Xte,y,b,0,0,y,b),e.next=24,new Promise((function(e){w.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,zj.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)}}(),Hre=function(e,t){return!(0!==t.length&&!t.includes("vn.national_id"))||t.map((function(e){return e.replace("vn.","")})).some((function(t){var r;return(null===(r=e.split("."))||void 0===r?void 0:r.filter((function(e){return"front"!==e&&"back"!==e&&"vn"!==e}))).some((function(e){return e===t}))}))},Kre=["width","height","type"],Wre=dB(Qte)(ure||(ure=Ky([""]))),Qre=dB.img(lre||(lre=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),Gre=Wee,Xre=Ute,Yre=dB.div(dre||(dre=Ky(["\n ","\n ","\n"])),Xee,zte),$re=dB.img(fre||(fre=Ky(["\n border-radius: 5px;\n opacity: 0.7;\n width: ",";\n height: ",";\n"])),(function(e){var t=e.theme;return J5(t,"IDCapturing.cardIcon.width",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.cardIcon.height",Kte)})),Zre=10,Jre=60,ene=dB.div(pre||(pre=Ky(["\n cursor: pointer;\n text-align: center;\n width: ",";\n height: ",";\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),(function(e){var t=e.theme;return J5(t,"IDCapturing.captureIcon.width",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.captureIcon.height",Kte)}),r4+20,v5.isMobile?YE(["top:",";"],(function(e){return e.y})):YE(["bottom:","px;"],Zre)),tne=dB.div(hre||(hre=Ky(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ",";\n height: ",";\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),(function(e){var t=e.theme;return J5(t,"IDCapturing.loadingIcon.width",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.loadingIcon.height",Kte)}),r4+20),rne=dB.div(mre||(mre=Ky(["\n color: #fff;\n text-align: center;\n"]))),nne=dB.div(gre||(gre=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}),r4+20),one=dB.div(vre||(vre=Ky(["\n display: flex;\n align-items: center;\n"]))),ane=dB(rne)(yre||(yre=Ky(["\n margin-left: 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n"])),(function(e){var t=e.theme;return J5(t,"IDCapturing.title.color",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.title.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.title.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.title.backgroundColor",Kte)})),ine=dB(rne)(bre||(bre=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"])),r4+30),sne=dB(rne)(Cre||(Cre=Ky(["\n position: absolute;\n text-align: center;\n top: ",";\n z-index: ",";\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){return e.y}),r4+20,(function(e){var t=e.theme;return J5(t,"IDCapturing.instruction.color",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.instruction.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.instruction.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.instruction.backgroundColor",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.instruction.border",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.instruction.borderRadius",Kte)})),cne=dB(sne)(wre||(wre=Ky(["\n padding: 5px 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){var t=e.theme;return J5(t,"IDCapturing.error.color",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.error.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.error.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.error.backgroundColor",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.error.border",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.error.borderRadius",Kte)})),une=dB(rne)(kre||(kre=Ky(["\n position: absolute;\n text-align: center;\n padding: 5px 10px;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){return e.y}),r4+20,(function(e){var t=e.theme;return J5(t,"IDCapturing.countdown.color",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.countdown.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.countdown.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.countdown.backgroundColor",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.countdown.border",Kte)}),(function(e){var t=e.theme;return J5(t,"IDCapturing.countdown.borderRadius",Kte)})),lne=(dB.div(Sre||(Sre=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,Kre),a=mB(),i=Jj.useAsset("id_card_frame.png"),s=Jj.useAsset("id_card_frame_error.png"),c=$te(e,a);return xC.createElement(Yre,{width:t,height:r},xC.createElement(Qre,{src:n===Wte.ERROR?s:i,width:t,height:r}),xC.createElement(Wre,Ry({type:n},o,c)))}),dne=function(e){var t=e.className,r=e.onClick,n=Jj.useAsset("ic_close.png");return xC.createElement(i4,{className:t,onClick:r},xC.createElement("img",{src:n,alt:""}))},fne=Object.freeze({__proto__:null,CloseCameraButton:dne}),pne=ote,hne=tte,mne=qte,gne=YE(["z-index:",";color:#ffffff;"],r4+20),vne=dB.div(Ere||(Ere=Ky(["\n ","\n"])),gne),yne=dB(bee)(Bre||(Bre=Ky(["\n ","\n ","\n ","\n ","\n font-size: ",";\n font-weight: ",";\n background: ",";\n color: ",";\n padding: ",";\n border-radius: ",";\n position: absolute;\n white-space: pre-wrap;\n text-align: center;\n max-width: 80%;\n"])),gne,(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),(function(e){return e.centerY&&YE(["top:50%;transform:translateY(-50%);"])}),(function(e){var t=e.theme;return J5(t,"Selfie.error.fontSize",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.error.fontWeight",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.error.backgroundColor",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.error.color",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.error.padding",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.error.borderRadius",n7)})),bne=dB(vne)(_re||(_re=Ky(["\n ","\n font-size: ",";\n font-weight: ",";\n background: ",";\n color: ",";\n padding: ",";\n border-radius: ",";\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.theme;return J5(t,"Selfie.countdown.fontSize",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.countdown.fontWeight",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.countdown.backgroundColor",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.countdown.color",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.countdown.padding",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.countdown.borderRadius",n7)})),Cne=dB(vne)(xre||(xre=Ky(["\n position: absolute;\n ","\n ","\n color: ",";\n font-size: ",";\n font-weight: ",";\n text-shadow: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.instruction.color",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.instruction.fontSize",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.instruction.fontWeight",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.instruction.textShadow",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.instruction.backgroundColor",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.instruction.border",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.instruction.borderRadius",n7)})),wne=dB.div(Tre||(Tre=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 v5.isMobile?"50px":"70px"}),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),r4+20),kne=dB.div(Are||(Are=Ky(["\n width: ",";\n height: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n border: ",";\n font-size: ",";\n color: ",";\n font-weight: ",";\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: ",";\n }\n"])),(function(e){var t=e.theme;return J5(t,"Selfie.Active.imageHolder.width",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.imageHolder.height",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.imageHolder.borderRadius",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.imageHolder.border",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.imageHolder.fontSize",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.imageHolder.color",n7)}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.imageHolder.fontWeight",n7)}),(function(e){return!e.active&&YE(["opacity:0.6;"])}),(function(e){var t=e.theme;return J5(t,"Selfie.Active.imageHolder.borderRadius",n7)})),Sne=dB.div(Ire||(Ire=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"])),r4+20),Ene=dB.div(Pre||(Pre=Ky(["\n cursor: pointer;\n text-align: center;\n\n img {\n width: ",";\n }\n"])),(function(e){var t=e.theme;return J5(t,"Selfie.captureIcon.width",n7)})),Bne=dB.div(Rre||(Rre=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"]))),_ne=dB.div(Dre||(Dre=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 ",";\n ",";\n"])),hne.default,pne.default),xne=dB(wee)(Nre||(Nre=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),Tne=dB(kee)(Ore||(Ore=Ky(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.theme;return J5(t,"Selfie.backgroundColor",n7)})),Ane=dB.div(Lre||(Lre=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"]))),Ine=hB(["from{opacity:1;}to{opacity:0;}"]),Pne=dB.div(Mre||(Mre=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"])),Ine),Rne=dB.div(Fre||(Fre=Ky(["\n ","\n"])),mne.default),Dne=function(e){var t=e.stepNumber,r=e.type,n=e.theme,o=g5(n,"Selfie.Active.imageHolder.".concat(r));return null===o?xC.createElement(xC.Fragment,null):o&&null!==o?xC.createElement("img",{src:o,alt:""}):xC.createElement("span",null,t)},Nne=v5.isMobile?{width:{ideal:640}}:null;function One(e){return new Promise((function(t){var r=new Image;r.onload=t,r.onerror=t,r.src=e}))}function Lne(e,t){return e?"string"==typeof e?xC.createElement("img",{className:t,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}function Mne(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,a=e.onError,i=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=e.onProcessing,f=e.customErrors,p=e.livenessSettings,h=e.apiCredentials,m=e.outputEncryptionSettings,g=e.cameraScale,v=e.defaultCameraId,y=e.passiveModeAuto,b=e.offsetFaceY,C=e.styledComponent,w=e.sdkAdapter,k=e.isLoading,S=e.frontalMinSize,E=Jj.useAsset("bg_camera_mask.png"),B=Jj.useAsset("bg_camera_mask_red.png"),_=Jj.useAsset("ic_loading.png"),x=Wy(xC.useState({}),2),T=x[0],A=x[1],I=T.yFaceDetectionError,P=T.yFaceVerificationStepsWrapper,R=Wy(xC.useState(""),2),D=R[0],N=R[1],O=mB(),L=xC.useMemo((function(){return{backgroundColor:J5(O,"Selfie.backgroundColor",n7)}}),[O]),M=xC.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,o=t+25,i=o+30;A({yFaceDetectionError:o,yFaceVerificationStepsWrapper:i+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(i);return 0!==b&&(u+b<s||u+b+r>c)?a({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=b,{y:u}}),[b,a]),F=aee({apiCheck:t,mode:r,bgCameraMask:E,bgCameraMaskRed:B,surroundStyle:L,onLivenessDetectionDone:n,onError:a,cropAreaDimension:M,customDirectionIcon:u,captureFrameSettings:i,onFramesCaptured:s,livenessSettings:p,setRemainingTime:N,customStepTimeConstraints:l,onProcessing:d,customErrors:f,apiCredentials:h,outputEncryptionSettings:m,cameraScale:g,passiveModeAuto:y,sdkAdapter:w,frontalMinSize:S}),U=F.countdownToTakePicture,j=F.cropArea,V=F.curStepIndex,z=F.directionIcon,q=F.directionIconAnimation,H=F.faceDetectionError,K=F.handleTriggerPassiveMode,W=F.handleVideoPlayed,Q=F.instructions,G=F.isActiveMode,X=F.refVideo,Y=F.showCountdown,$=F.steps,Z=F.videoPlayed,J=F.activeCapturing,ee=F.isFirstValidFrameFound,te=F.warmupDone,re=F.showLoading;xC.useEffect((function(){var e;"string"==typeof(null===(e=$[0])||void 0===e?void 0:e.directionIcon)&&Promise.all($.map((function(e){return One(e.directionIcon)})))}),[$]);var ne=C.CloseCameraButton,oe=a7(e,O);return xC.createElement(Rne,null,xC.createElement(g4,{frontCamera:c,onVideoPlayed:W,onClose:o,flipHorizontal:c,ref:X,videoSettings:Nne,onError:a,scale:g,defaultCameraId:v,closeButton:ne||null},!te&&xC.createElement(Kee,null),Z?xC.createElement(xC.Fragment,null,xC.createElement(yne,{top:I-15,className:"face-detection-error",error:H}),j.current?xC.createElement(k4,{x:"".concat(j.current.x,"px"),y:"".concat(j.current.y,"px"),width:"".concat(j.current.width,"px"),height:"".concat(j.current.height,"px"),surroundStyle:j.current.surroundStyle},xC.createElement(Tne,null),xC.createElement(xne,Ry({progress:V/$.length*100},oe,{showErrorRing:!!H&&J5(O,"Selfie.progressCircle.showErrorRing",n7)})),Y?xC.createElement(Bne,null,U):null,G?xC.createElement(xC.Fragment,null,xC.createElement(_ne,null,Lne(z,q)),J&&xC.createElement(Pne,null)):null,H&&xC.createElement(Ane,null)):null,G?xC.createElement(xC.Fragment,null,D&&xC.createElement(bne,{top:P-30},D),Q?xC.createElement(xC.Fragment,null,xC.createElement(Cne,{top:P+5,className:"instructions"},Q),xC.createElement(wne,{top:P+35},$.map((function(e,t){var r=e.name,n=e.image.objUrl;return xC.createElement(kne,{key:r,active:V>=t,className:"step-item"},n?xC.createElement("img",{src:n,alt:""}):xC.createElement(Dne,{stepNumber:t+1,type:r,theme:O}))})))):null):xC.createElement(xC.Fragment,null,!ee||H||y?null:xC.createElement(Sne,null,xC.createElement(Ene,{onClick:K},g5(O,"Selfie.captureIcon.src")?xC.createElement("img",{src:g5(O,"Selfie.captureIcon.src"),alt:""}):xC.createElement(S4,null))))):null,(re||k)&&xC.createElement(tne,null,xC.createElement("img",{src:_,alt:"",className:"spin"}))))}Mne.propTypes={apiCheck:xw.bool,frontalMinSize:xw.number,mode:xw.string,onLivenessDetectionDone:xw.func,onClose:xw.func,onError:xw.func,captureFrameSettings:xw.shape({}),onFramesCaptured:xw.func,frontCamera:xw.bool,customDirectionIcon:xw.shape({}),customStepTimeConstraints:xw.shape({}),onProcessing:xw.func,customErrors:xw.shape({}),livenessSettings:xw.shape({}),apiCredentials:xw.shape({accessKey:xw.string,secretKey:xw.string,apiUrl:xw.string}),outputEncryptionSettings:xw.shape({}),cameraScale:xw.number,defaultCameraId:xw.string,passiveModeAuto:xw.bool,offsetFaceY:xw.number,styledComponent:xw.shape({CloseCameraButton:xw.node}),sdkAdapter:xw.shape({}),isLoading:xw.bool},Mne.defaultProps={apiCheck:!1,frontalMinSize:null,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(Ure={},Py(Ure,uL.FaceDirection.LEFT,xC.createElement(mee,{type:uL.FaceDirection.LEFT})),Py(Ure,uL.FaceDirection.RIGHT,xC.createElement(mee,{type:uL.FaceDirection.RIGHT})),Py(Ure,uL.FaceDirection.UP,xC.createElement(mee,{type:uL.FaceDirection.UP})),Py(Ure,uL.FaceDirection.FRONTAL,xC.createElement(mee,{type:uL.FaceDirection.FRONTAL})),Ure),customStepTimeConstraints:(jre={},Py(jre,uL.FaceDirection.UP,{delayTime:0}),Py(jre,uL.FaceDirection.LEFT,{delayTime:0}),Py(jre,uL.FaceDirection.RIGHT,{delayTime:0}),Py(jre,uL.FaceDirection.FRONTAL,{delayTime:2e3}),jre),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null},sdkAdapter:null,isLoading:!1};var Fne,Une,jne,Vne,zne,qne=Object.freeze({__proto__:null,Text:vne,FaceDetectionError:yne,CountdownTime:bne,FaceVerificationInstructions:Cne,FaceVerificationStepsWrapper:wne,StepItem:kne,BottomButtonsOverlay:Sne,Button:Ene,CountDownOverlay:Bne,InstructionsOverlay:_ne,LivenessStyledComponent:fne,default:Mne,useLivenessDetection:aee}),Hne={SUCCESS:"SUCCESS",WARNING:"WARNING"},Kne=(Py(Fne={},Hne.SUCCESS,"✓"),Py(Fne,Hne.WARNING,"!"),Fne),Wne=dB.div(Une||(Une=Ky(["\n font-weight: normal;\n"]))),Qne=dB.div(jne||(jne=Ky(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){var t=e.theme,r=e.type,n=J5(t,"QRStep.resultText.".concat(r===Hne.SUCCESS?"success":"error",".mainColor"),Kte);return YE(["linear-gradient(to right,","00,","ff,","00)"],n,n,n)})),Gne=dB.div(Vne||(Vne=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){var t=e.type,r=e.theme;return YE(["",""],J5(r,"QRStep.resultText.".concat(t===Hne.SUCCESS?"success":"error",".mainColor"),Kte))})),Xne=dB.div(zne||(zne=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n ",";\n"])),(function(e){var t=e.type,r=e.theme,n=t===Hne.SUCCESS?"success":"error";return YE(["color:",";font-size:",";font-weight:",";"],J5(r,"QRStep.resultText.".concat(n,".textColor"),Kte),J5(r,"QRStep.resultText.".concat(n,".fontSize"),Kte),J5(r,"QRStep.resultText.".concat(n,".fontWeight"),Kte))})),Yne=function(e){var t=e.children,r=e.type,n=e.className;return xC.createElement(Wne,{className:n},xC.createElement(Qne,{type:r}),xC.createElement(Xne,{type:r},xC.createElement(Gne,{type:r},Kne[r]),t),xC.createElement(Qne,{type:r}))};Yne.propTypes={children:xw.node,type:xw.string,className:xw.string},Yne.defaultProps={children:null,type:Hne.SUCCESS,className:""};var $ne,Zne,Jne=["children","ratio","padding"],eoe=dB.div($ne||($ne=Ky(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),toe=dB.div(Zne||(Zne=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})),roe=function(e){var t=e.children,r=e.ratio,n=e.padding,o=Vy(e,Jne);return xC.createElement(eoe,Ry({ratio:r},o),xC.createElement(toe,{padding:n},t))};roe.propTypes={children:xw.node,ratio:xw.number,padding:xw.string},roe.defaultProps={children:null,ratio:4/3,padding:"0"};var noe,ooe,aoe,ioe,soe,coe,uoe,loe=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,a=e.mr,i=e.mx,s=e.my,c=e.pt,u=e.pb,l=e.pl,d=e.pr,f=e.px,p=e.py,h=t.props.style||{},m={};return null!==i&&(m.marginLeft=i,m.marginRight=i),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==a&&(m.marginRight=a),null!==f&&(m.paddingLeft=f,m.paddingRight=f),null!==p&&(m.paddingTop=p,m.paddingBottom=p),null!==c&&(m.paddingTop=c),null!==u&&(m.paddingBottom=u),null!==l&&(m.paddingLeft=l),null!==d&&(m.paddingRight=d),xC.cloneElement(t,{style:Ny(Ny({},h),m)})};loe.propTypes={mt:xw.string,ml:xw.string,mr:xw.string,mb:xw.string,mx:xw.string,my:xw.string,pt:xw.string,pl:xw.string,pr:xw.string,pb:xw.string,px:xw.string,py:xw.string},loe.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 doe=dB.div(noe||(noe=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),foe=dB.div(ooe||(ooe=Ky(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),poe=dB.button(aoe||(aoe=Ky(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n cursor: pointer;\n"]))),hoe=dB(poe)(ioe||(ioe=Ky(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n"])),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.confirmButton.color",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.confirmButton.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.confirmButton.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.confirmButton.backgroundColor",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.confirmButton.border",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.confirmButton.borderRadius",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.confirmButton.outline",Kte)})),moe=dB(poe)(soe||(soe=Ky(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n"])),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.retryButton.color",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.retryButton.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.retryButton.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.retryButton.backgroundColor",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.retryButton.border",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.retryButton.borderRadius",Kte)}),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.retryButton.outline",Kte)})),goe=dB.img(coe||(coe=Ky(["\n width: 100%;\n height: auto;\n object-fit: contain;\n border-radius: ",";\n"])),(function(e){var t=e.theme;return J5(t,"IDConfirmPopup.image.borderRadius",Kte)})),voe=dB.div(uoe||(uoe=Ky(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),yoe=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,a=e.hasValidQR,i=e.frontSide,s=Wy(xC.useState(null),2),c=s[0],u=s[1],l=yj.useSDKSettings().lang,d=Yj.useSDKTracking().sendEvent;return xC.useEffect((function(){d({tag:i?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[i,d]),xC.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),xC.createElement(doe,null,null!==a&&xC.createElement(loe,{mb:"20px"},xC.createElement("div",null,xC.createElement(Yne,{type:a?Hne.SUCCESS:Hne.WARNING},a?Gte.CONFIRM_POPUP_VALID_QR[l]:Gte.CONFIRM_POPUP_INVALID_QR[l]))),xC.createElement(roe,{ratio:1.5},xC.createElement(goe,{src:c})),o&&xC.createElement(foe,{className:"confirm-popup-error-message"},o.msg[l]),xC.createElement(voe,null,xC.createElement(moe,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},Gte.BTN_TRY_AGAIN[l]),xC.createElement(hoe,{onClick:function(){d({tag:i?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},Gte.BTN_USE_THIS_PICTURE[l])))};yoe.propTypes={imageTaken:xw.shape({}),error:xw.shape({msg:xw.shape({})}),onConfirm:xw.func,onTryAgain:xw.func,hasValidQR:xw.bool,frontSide:xw.bool},yoe.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var boe,Coe=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(){iL.unmountComponentAtNode(n)};return new Promise((function(e){iL.render(xC.createElement(yj.SDKSettingsProvider,{value:{lang:"en"}},xC.createElement(g4,{checkCameraMode:!0,frontCamera:r,onVideoPlayed:function(){o(),e(null)},onClose:o,onError:function(t){o(),e(t)}})),n)}))},woe=dB.input(boe||(boe=Ky(["\n display: none;\n"]))),koe=xC.forwardRef((function(e,t){var r=e.useFileBrowse,n=e.accept,o=e.frontCamera,a=e.onCaptureDone,i=e.outputEncryptionSettings,s=xC.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,!a){e.next=8;break}if(n=r[0],!i||!i.key){e.next=7;break}return e.next=6,Kq.encrypt({blob:n,key:i.key});case 6:o=e.sent;case 7:a({file:n,encrypted:o});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[a,i]);return xC.createElement(woe,Ry({ref:t,type:"file",accept:n,onChange:s},r?{}:{capture:o?"user":"environment"}))}));koe.propTypes={useFileBrowse:xw.bool,accept:xw.string,frontCamera:xw.bool,onCaptureDone:xw.func,outputEncryptionSettings:xw.shape({key:xw.string})},koe.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var Soe,Eoe={LANDSCAPE:"landscape",PORTRAIT:"portrait",DESKTOP:"desktop"},Boe=function(){var e=xC.useRef(window.matchMedia("(orientation: portrait)")),t=xC.useRef(e.current.matches?Eoe.PORTRAIT:Eoe.LANDSCAPE),r=Wy(xC.useState(t.current),2),n=r[0],o=r[1];return xC.useEffect((function(){function t(e){e.matches?o(Eoe.PORTRAIT):o(Eoe.LANDSCAPE)}return e.current.addEventListener("change",t),function(){e.current.removeEventListener("change",t)}}),[]),v5.isMobile?{curOrientation:n,initOrientation:t.current}:{curOrientation:Eoe.DESKTOP}},_oe=uL.Errors,xoe=dB.div(Soe||(Soe=Ky(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function Toe(e){var t=e.children,r=yj.useSDKSettings().lang,n=_oe.wrong_orientation.msg[r],o=Boe().curOrientation;return xC.createElement(xC.Fragment,null,o===Eoe.LANDSCAPE&&xC.createElement(zee,{open:!0},xC.createElement(xoe,null,n)),(o===Eoe.PORTRAIT||o===Eoe.DESKTOP)&&xC.createElement(xC.Fragment,null,t))}var Aoe={LOADING:0,FAR_FACE:1,CLOSE_FACE:2,START_FLASHING:3,STOP_DECTECTING:4},Ioe={FAR_FACE:"far",CLOSE_FACE:"close",FLASHING:"flashing"},Poe=200,Roe=v5.isMobile?200:400,Doe=0,Noe=1,Ooe={timeout:"timeout",no_face:"no_face"};function Loe(){return Moe.apply(this,arguments)}function Moe(){return(Moe=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.tfScriptUrls,n=t.closeEyesModelUrl,o=t.blazefaceModelUrl,a=new fK(n),e.next=4,Vq.loadTensorFlow(r);case 4:return e.next=6,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[Vq.loadBlazefaceModel({modelUrl:o}),a.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=Wy(s,1),u=c[0].blazefaceModel,e.abrupt("return",{closeEyesModel:a,blazefaceModel:u});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Foe=g7(Loe),Uoe=function(e,t){var r=Wy(xC.useState({}),2),n=r[0],o=r[1],a=Object.keys(n).length>0;return xC.useEffect((function(){var r=!1;return function(){var n=xy(regeneratorRuntime.mark((function n(){var a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Foe(e);case 3:if(a=n.sent,!r){n.next=6;break}return n.abrupt("return");case 6:o(a),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(0),t({error:n.t0}),console.error(n.t0);case 13:case"end":return n.stop()}}),n,null,[[0,9]])})));return function(){return n.apply(this,arguments)}}()(),function(){r=!0}}),[a,e,t]),[n,a]},joe=function(e){var t=e.width,r=e.height,n=e.cameraScale,o=document.createElement("canvas");o.width=t,o.height=r;var a=o.getContext("2d");return a.translate(t,0),a.scale(-1*n,1*n),o},Voe=function(e){var t=e.width,r=e.height,n=e.cameraScale,o=void 0===n?1:n,a=e.debug,i=void 0!==a&&a,s=Wy(xC.useState(null),2),c=s[0],u=s[1];return xC.useEffect((function(){var e=joe({width:t,height:r,cameraScale:o});return i&&(document.body.appendChild(e),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.zIndex="9999"),u(e),function(){i&&document.body.removeChild(e)}}),[o,i,r,t]),c},zoe=function(e){var t=e.videoRef,r=e.cropArea;return xC.useMemo((function(){return t.current?0===Object.keys(r).length?{}:xV.analyzeVideoAndWindowSizes(t.current,r):{}}),[t,r])},qoe=function(e){switch(e){case"partial_face":return"please_move_face_into_center_frame";case"no_face":case"face_out_of_box":return"face_not_found";case"face_too_small":return"please_move_face_closer";case"face_too_large":return"please_move_face_farther";case"eye_close":return"please_open_your_eyes";case"face_not_frontal":return"please_look_straight_at_the_camera";case"multiple_faces":return"please_only_one_face";case"face_too_high":return"please_move_face_down";default:return""}},Hoe=function(e){var t=e.width,r=e.height,n=e.debug,o=xC.useRef(null),a=xC.useMemo((function(){var e=document.createElement("canvas");return e.width=t,e.height=r,e.style.position="fixed",e.style.bottom="0",e.style.left="0",e.style.zIndex="99999",o.current=e,n&&document.body.appendChild(e),e}),[r,t,n]);return xC.useEffect((function(){return function(){n&&document.body.removeChild(o.current)}}),[n]),a},Koe=function(e,t){var r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.beginPath(),r.lineWidth="1",r.strokeStyle="red",r.rect(0,0,e.width,e.height),r.stroke(),r.closePath(),Object.entries(t).forEach((function(e,t){var n=Wy(e,2),o=n[0],a=n[1];r.beginPath(),r.fillStyle="red",r.font="16px",r.fillText("".concat(o,": ").concat(a),10,20+20*t),r.closePath()}))},Woe=xC.createContext(!1),Qoe=function(e){var t=e.children,r=e.debug;return xC.createElement(Woe.Provider,{value:r},t)};Qoe.defaultProps={debug:!1,children:null},Qoe.propTypes={debug:xw.bool,children:xw.node};var Goe=function(e,t,r){var n=e.getContext("2d");n.strokeStyle=r,n.lineWidth=1,n.beginPath(),n.rect(t.x,t.y,t.width,t.height),n.stroke(),n.closePath()},Xoe=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.getContext("2d"),o=e.width;n.strokeStyle="blue",n.fillStyle="blue",n.lineWidth=1,t.forEach((function(e){e.landmarks.forEach((function(e){n.beginPath(),n.arc(r?o-e[0]:e[0],e[1],2,0,2*Math.PI),n.fill(),n.closePath()})),n.beginPath();var t={x:r?o-e.bottomRight[0]:e.bottomRight[0],y:e.topLeft[1],width:e.bottomRight[0]-e.topLeft[0],height:e.bottomRight[1]-e.topLeft[1]};n.rect(t.x,t.y,t.width,t.height),n.stroke(),n.closePath()}))},Yoe=0,$oe=function(e){var t=e.cropArea,r=e.ovalBoundingRect,n=e.ovalPadding,o=e.baseCanvasSize;return xC.useMemo((function(){var e,a,i,s,c=t.width,u=t.height,l=t.x,d=t.y,f=Math.min(c,u)/o,p=c/f,h=u/f,m=null!==(e=null==r?void 0:r.left)&&void 0!==e?e:0,g=null!==(a=null==r?void 0:r.top)&&void 0!==a?a:0,v=null!==(i=null==r?void 0:r.right)&&void 0!==i?i:c,y=null!==(s=null==r?void 0:r.bottom)&&void 0!==s?s:u;return{left:Math.max((m-l-n.left)/f,Yoe),right:Math.min((v-l+n.right)/f,p-Yoe),top:Math.max((g-d-n.top)/f,Yoe),bottom:Math.min((y-d+n.bottom)/f,h-Yoe)}}),[t,null==r?void 0:r.bottom,null==r?void 0:r.left,null==r?void 0:r.right,null==r?void 0:r.top,n.bottom,n.left,n.right,n.top,o])},Zoe=function(e){var t=e.timeout,r=xC.useRef(null),n=xC.useCallback((function(){r.current=performance.now()}),[]),o=xC.useCallback((function(){return null===r.current?(n(),!1):performance.now()-r.current>t}),[n,t]);return{markTime:n,checkIfEllapsed:o}},Joe=function(e,t){return{topLeft:[e.topLeft[0]*t,e.topLeft[1]*t],bottomRight:[e.bottomRight[0]*t,e.bottomRight[1]*t],probability:e.probability,landmarks:e.landmarks.map((function(e){return[e[0]*t,e[1]*t]}))}},eae=function(e){var t=e.size,r=e.scale,n=void 0===r?1:r,o=e.video,a=e.baseSize,i=void 0===a?Poe:a,s=t.width,c=t.height,u=null!=o?o:{},l=u.videoWidth,d=void 0===l?Number.MAX_SAFE_INTEGER:l,f=u.videoHeight,p=void 0===f?Number.MAX_SAFE_INTEGER:f,h=Math.min(s,c)/i,m=Math.round(s/h*n),g=Math.round(c/h*n);return m>d||g>p?{width:s,height:c}:{width:m,height:g}},tae=function(e,t){var r=document.createElement("canvas"),n=r.getContext("2d"),o=t.width,a=t.height,i=Math.min(o,a);return r.width=i,r.height=i,n.fillStyle="#000",n.fillRect(0,0,i,i),n.putImageData(e,0,0),r};function rae(e){var t=e.cameraScale,r=void 0===t?1:t,n=e.isVideoPlaying,o=e.step,a=e.cropArea,i=e.videoRef,s=e.onFarFaceDetected,c=e.onFarFullFaceDetected,u=e.onCloseFaceDetected,l=e.onCloseFullFaceDetected,d=e.onFlashingFramesCaptured,f=e.frameInterval,p=void 0===f?180:f,h=e.useFaceDetectorWhenFlashing,m=e.onFaceError,g=e.onError,v=e.faceSettings,y=e.ovalBoundingRect,b=e.shouldPauseFaceDetection,C=e.closeEyesSettings,w=e.maskSettings,k=e.captureFrameSettings,S=w.ovalPadding,E=w.chinToMaskBottomPadding,B=k.frameScale,_=C.enable,x=C.timeout,T=xC.useContext(Woe),A=zoe({videoRef:i,cropArea:a}),I=xC.useMemo((function(){return eae({size:{width:A.cropWidth,height:A.cropHeight},scale:B,video:i.current})}),[B,A.cropHeight,A.cropWidth,i]),P=$oe({cropArea:a,ovalBoundingRect:y,ovalPadding:S,baseCanvasSize:Math.min(I.width,I.height)}),R=v.minFarFaceRatio,D=v.maxFarFaceRatio,N=v.closeFaceRatio,O=Voe({width:I.width,height:I.height,cameraScale:r}),L=I.height/I.width,M=Voe({width:Roe,height:Roe*L,cameraScale:r,debug:T}),F=Hoe({width:160,height:150,debug:T}),U=yj.useSDKSettings().customUrls,j=Wy(Uoe(U,g),2),V=j[0],z=j[1],q=xC.useRef(null),H=Zoe({timeout:1e3*x}),K=H.markTime,W=H.checkIfEllapsed,Q=z&&n,G=Wy(xC.useState(""),2),X=G[0],Y=G[1],$=V.closeEyesModel,Z=V.blazefaceModel,J=xC.useMemo((function(){return W4(Y,1e3)}),[]),ee=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t,r){var n,a,f,p,v,y,C,w,k,S,B,x,A,I,O,L,U,j,V,z,q,H,Q,G,X,Y,ee,te,re,ne,oe,ae,ie,se;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(null==r?void 0:r.width)&&0!==(null==r?void 0:r.height)){e.next=3;break}return e.abrupt("return");case 3:if(null!==i.current){e.next=5;break}return e.abrupt("return");case 5:if(!b){e.next=7;break}return e.abrupt("return");case 7:if(o!==Aoe.STOP_DECTECTING){e.next=9;break}return e.abrupt("return");case 9:if(n=t.cropX,a=t.cropY,f=t.cropWidth,p=t.cropHeight,v=r.width,y=r.height,(C=r.getContext("2d")).drawImage(i.current,n,a,f,p,0,0,v,y),w=C.getImageData(0,0,v,y),k=tae(w,r),S=Roe/v,T&&M.getContext("2d").drawImage(i.current,n,a,f,p,0,0,v*S,y*S),h||o!==Aoe.START_FLASHING){e.next=23;break}if("function"!=typeof d){e.next=22;break}return e.next=22,d({prediction:null,canvas:r,landmarks:null,faceArea:t,faceRatio:null});case 22:return e.abrupt("return");case 23:return e.next=25,GV.getModelPredictions({model:Z,sCanvas:k});case 25:return B=e.sent,e.next=28,WV.validatePredictions({predictions:B,width:v,height:y});case 28:return x=e.sent,A=x.fullFace,I=x.ratio,O=[[P.left,P.top],[P.right,P.bottom]],e.next=34,WV.validatePredictions({predictions:B,cropAreaCoordinates:O});case 34:if(L=e.sent,U=L.error,j=L.fullFace,V=L.faceRatio,T&&(z={left:P.left*S,top:P.top*S,right:P.right*S,bottom:P.bottom*S},Goe(M,{x:z.left,y:z.top,width:z.right-z.left,height:z.bottom-z.top},"red"),q=B.map((function(e){return Joe(e,S)})),Xoe(M,q,!0)),H=uL.FaceDirection.FRONTAL,!j){e.next=45;break}return e.next=43,WV.calculateFaceDirection({landmarks:j.landmarks,upDownBound:{lower:.35,upper:.7}});case 43:G=e.sent,H=null!==(Q=null==G?void 0:G.gesture)&&void 0!==Q?Q:"";case 45:if(!A||o!==Aoe.FAR_FACE){e.next=49;break}if("function"!=typeof s){e.next=49;break}return e.next=49,s({prediction:B[0],canvas:r,landmarks:A.landmarks,faceArea:t,faceRatio:V});case 49:if(!A||o!==Aoe.CLOSE_FACE){e.next=53;break}if("function"!=typeof u){e.next=53;break}return e.next=53,u({prediction:B[0],canvas:r,landmarks:A.landmarks,faceArea:t,faceRatio:V});case 53:if(X=null==U?void 0:U.code,e.prev=54,X!==uL.Errors.no_face.code){e.next=57;break}throw new Error("no_face");case 57:if(!(X===uL.Errors.multiple_faces.code&&B.length>1)){e.next=62;break}if(Y=WV.calculateFaceArea(B[0]),ee=WV.calculateFaceArea(B[1]),!(Y<=2*ee)){e.next=62;break}throw new Error("multiple_faces");case 62:if(H===uL.FaceDirection.FRONTAL){e.next=64;break}throw new Error("face_not_frontal");case 64:if(X!==uL.Errors.partial_face.code){e.next=69;break}if(te=WV.cropFaceInsideBox([B[0].topLeft,B[0].bottomRight],O),!(FV.rectEdgeRatio(te,O)>.95)){e.next=69;break}throw new Error("face_too_large");case 69:if(o!==Aoe.FAR_FACE){e.next=74;break}if(!(V>D)){e.next=72;break}throw new Error("face_too_large");case 72:if(!(V<R)){e.next=74;break}throw new Error("face_too_small");case 74:if(o!==Aoe.CLOSE_FACE){e.next=77;break}if(!(V<N)){e.next=77;break}throw new Error("face_too_small");case 77:if(!(Array.isArray(B)&&B.length>0&&P.bottom-B[0].bottomRight[1]>E)){e.next=79;break}throw new Error("face_too_high");case 79:if(X!==uL.Errors.face_out_of_box.code){e.next=86;break}if(o!==Aoe.FAR_FACE){e.next=83;break}if(!(V>=R&&V<=D)){e.next=83;break}throw new Error("");case 83:if(o!==Aoe.CLOSE_FACE){e.next=86;break}if(!(V>=N)){e.next=86;break}throw new Error("");case 86:e.next=91;break;case 88:e.prev=88,e.t0=e.catch(54),X=e.t0.message;case 91:if(!_){e.next=101;break}if(X){e.next=100;break}return e.next=95,$.predict(r,A.landmarks);case 95:re=e.sent,ne=W(),re.isEyeClose&&!ne&&(X="eye_close"),e.next=101;break;case 100:K();case 101:if(T&&Koe(F,{ratio:null!==(oe=null==I?void 0:I.toFixed(3))&&void 0!==oe?oe:"undefined",error:X,ovalFaceRatio:null!==(ae=null==V?void 0:V.toFixed(3))&&void 0!==ae?ae:"undefined",ovalError:null!==(ie=null==U?void 0:U.code)&&void 0!==ie?ie:"undefined",step:o===Aoe.FAR_FACE?"far":"close"}),se=qoe(X),J(se),!se){e.next=109;break}if("function"!=typeof m){e.next=108;break}return e.next=108,m({error:X,currentStep:o});case 108:return e.abrupt("return");case 109:if(!(A&&o===Aoe.FAR_FACE&&R<=V&&V<=D)){e.next=114;break}if("function"!=typeof c){e.next=114;break}return e.next=113,c({prediction:B[0],canvas:r,landmarks:A.landmarks,faceArea:t,faceRatio:V});case 113:return e.abrupt("return");case 114:if(!(A&&o===Aoe.CLOSE_FACE&&V>=N)){e.next=119;break}if("function"!=typeof l){e.next=119;break}return e.next=118,l({prediction:B[0],canvas:r,landmarks:A.landmarks,faceArea:t,faceRatio:V});case 118:return e.abrupt("return");case 119:if(!(h&&A&&o===Aoe.START_FLASHING&&V>=N)){e.next=124;break}if("function"!=typeof d){e.next=124;break}return e.next=123,d({prediction:B[0],canvas:r,landmarks:A.landmarks,faceArea:t,faceRatio:V});case 123:return e.abrupt("return");case 124:e.next=130;break;case 126:e.prev=126,e.t1=e.catch(0),console.error(e.t1),g({error:e.t1});case 130:case"end":return e.stop()}}),e,null,[[0,126],[54,88]])})));return function(t,r){return e.apply(this,arguments)}}(),[i,b,o,T,h,Z,P.left,P.top,P.right,P.bottom,_,J,R,D,N,M,d,s,u,E,$,W,K,F,m,c,l,g]);return xC.useEffect((function(){var e=null,t=!1;return Q&&function r(){e=requestAnimationFrame(function(){var e=xy(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=2;break}return e.abrupt("return");case 2:if(null!==i.current){e.next=4;break}return e.abrupt("return");case 4:if(null===q.current&&(q.current=n),!(n-q.current<p)){e.next=9;break}return r(),e.abrupt("return");case 9:return q.current=n,e.next=12,ee(A,O);case 12:r();case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}(),function(){t=!0,cancelAnimationFrame(e)}}),[O,A,ee,Q,i,p]),{warmupDone:z,faceError:X}}var nae={" ":"rgba(0,0,0,0.6)",default:"rgba(0,0,0,0.6)"},oae=null,aae=function(e){var t=e.colors,r=e.onFlashDone,n=e.framesPerColor,o=e.flashColor,a=Wy(xC.useState(oae),2),i=a[0],s=a[1],c=xC.useMemo((function(){return t.split("").reduce((function(e,t){return e+t.repeat(n)}),"")}),[t,n]),u=" "===c[i]?nae.default:o,l=xC.useCallback((function(){s((function(e){return e+1}))}),[]),d=xC.useCallback((function(){s(0)}),[]);return xC.useEffect((function(){i>c.length-1&&(s(oae),"function"==typeof r&&r())}),[i,c.length,r]),{flashingColors:c,colorIndex:i,currentColor:u,goToNextColor:l,startFlashing:d}},iae=function(e){var t,r,n=e.videoAreaWidth,o=e.videoAreaHeight,a=e.lostX,i=e.lostY;return v5.isMobile?(t=n,r=o):(t=Math.min(n,o),r=Math.min(n,o)),{width:t,height:r,x:Math.max(Math.round((n-t)/2+a),0),y:Math.max(Math.round((o-r)/2+i),0)}},sae=function(e){var t=e.onVideoPlayed,r=Wy(xC.useState(!1),2),n=r[0],o=r[1],a=Wy(xC.useState({}),2),i=a[0],s=a[1];return{onVideoPlayed:xC.useCallback((function(e){var r=iae(e);s(r),o(!0),"function"==typeof t&&t(e)}),[t]),cropArea:i,isPlaying:n}},cae=function(e){var t=e.prediction,r=e.canvas,n=e.landmarks,o=e.index,a=e.quality,i=void 0===a?.8:a,s=r.toDataURL("image/jpeg",i);return t?{label:"portrait",base64:s.split(",")[1],landmarks:n,index:o}:{label:"portrait",base64:s.split(",")[1],index:o}},uae=function(){return 60},lae=function(){var e=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",30);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),dae=20,fae=function(e){var t=Wy(xC.useState(e),2),r=t[0],n=t[1];return xC.useEffect((function(){(function(){var t=xy(regeneratorRuntime.mark((function t(){var r,o,a,i,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Promise.all([uae(),lae()]);case 3:r=t.sent,o=Wy(r,2),a=o[0],i=o[1],s=Math.max(1e3/a,1e3/i,e),n(s),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(0),console.error(t.t0),n(dae);case 15:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(){return t.apply(this,arguments)}})()()}),[e]),r},pae=function(e){var t=e.className,r=e.iconColor;return xC.createElement("svg",{className:t,width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xC.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",fill:r}),xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 36.1124C30.6895 36.1124 36.1124 30.6895 36.1124 24C36.1124 17.3105 30.6895 11.8876 24 11.8876C17.3105 11.8876 11.8876 17.3105 11.8876 24C11.8876 30.6895 17.3105 36.1124 24 36.1124ZM24 38C31.732 38 38 31.732 38 24C38 16.268 31.732 10 24 10C16.268 10 10 16.268 10 24C10 31.732 16.268 38 24 38Z",fill:"white"}),xC.createElement("path",{d:"M18.1465 20.169C18.1465 19.6236 18.5886 19.1815 19.134 19.1815C19.6793 19.1815 20.1214 19.6236 20.1214 20.169V22.1439C20.1214 22.6893 19.6793 23.1314 19.134 23.1314C18.5886 23.1314 18.1465 22.6893 18.1465 22.1439V20.169Z",fill:"white"}),xC.createElement("path",{d:"M28.0213 20.169C28.0213 19.6236 28.4634 19.1815 29.0087 19.1815C29.5541 19.1815 29.9962 19.6236 29.9962 20.169V22.1439C29.9962 22.6893 29.5541 23.1314 29.0087 23.1314C28.4634 23.1314 28.0213 22.6893 28.0213 22.1439V20.169Z",fill:"white"}),xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0714 19.1135C24.654 19.1135 25.1262 19.5858 25.1262 20.1683V24.6119C25.1262 25.7398 24.2119 26.6542 23.084 26.6542H22.5902C22.0077 26.6542 21.5354 26.1819 21.5354 25.5994C21.5354 25.0168 22.0077 24.5446 22.5902 24.5446H23.0166V20.1683C23.0166 19.5858 23.4889 19.1135 24.0714 19.1135Z",fill:"white"}),xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.8537 27.4214C29.2114 27.8813 29.1285 28.544 28.6687 28.9016C26.6697 30.4564 24.6954 30.8255 23.0184 30.5817C21.3833 30.344 20.0946 29.5339 19.3755 28.8149C18.9636 28.403 18.9636 27.7351 19.3755 27.3232C19.7875 26.9113 20.4553 26.9113 20.8672 27.3232C21.3002 27.7562 22.184 28.3286 23.322 28.4941C24.4181 28.6534 25.8176 28.4466 27.3735 27.2364C27.8334 26.8788 28.4961 26.9616 28.8537 27.4214Z",fill:"white"}),xC.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",stroke:"#DAEAFB"}))};pae.defaultProps={className:"",iconColor:"#0276F1"},pae.propTypes={className:xw.string,iconColor:xw.string};var hae,mae,gae,vae={FlashLiveness:{maskFill:"#fff",title:{hidden:!1,height:"64px",color:"#000",fontSize:"24px",fontWeight:"normal"},guideline:{text:{normal:{color:"#1d1d1d",fontSize:"16px",fontWeight:"bold",background:"#fafafa",border:"1px solid rgba(29, 29, 29, 0.04)",borderRadius:"100px",padding:"12px 16px"},flashing:{color:"#fff",fontSize:"24px",fontWeight:"bold",background:"#E54D2E",border:"1px solid rgba(29, 29, 29, 0.04)",borderRadius:"100px",padding:"12px 16px"}},icon:{color:"#0276F1"}},instruction:{color:"#1d1d1d",fontSize:"16px",fontWeight:"bold",background:"rgba(255, 255, 255, 0.8)",border:"none",borderRadius:"12px"},timeoutText:{color:"red",fontSize:"16px",fontWeight:"normal",padding:"0"},errorOverlay:{backgroundColor:"red",opacity:.2},progressBar:{mainColor:"#0276F1",secondaryColor:"#daeafb",fontSize:"16px",fontWeight:"normal"}}},yae=dB.div(hae||(hae=Ky(["\n & .indicator {\n color: ",";\n }\n\n & .gauge {\n background-color: ",";\n transition: width 0.2s ease;\n }\n"])),(function(e){var t=e.theme;return J5(t,"FlashLiveness.progressBar.mainColor",vae)}),(function(e){var t=e.theme;return J5(t,"FlashLiveness.progressBar.mainColor",vae)})),bae=dB.div(mae||(mae=Ky(["\n height: 10px;\n position: relative;\n background: ",";\n border-radius: 100px;\n margin-block-end: 8px;\n\n & > span {\n display: block;\n height: 100%;\n border-radius: 100px;\n width: 0;\n overflow: hidden;\n }\n"])),(function(e){var t=e.theme;return J5(t,"FlashLiveness.progressBar.secondaryColor",vae)})),Cae=function(e){var t=e.value,r=e.className;return xC.createElement(yae,{className:r},xC.createElement(bae,null,xC.createElement("span",{className:"gauge",style:{width:"".concat(t,"%")}})),xC.createElement("div",null,xC.createElement("span",{className:"indicator"},"• ",t,"%")))};Cae.defaultProps={value:0,className:""},Cae.propTypes={value:xw.number,className:xw.string};var wae,kae=dB.span(gae||(gae=Ky(["\n padding: 8px 12px;\n display: flex;\n align-items: center;\n flex-direction: row;\n"]))),Sae=function(e){var t=e.children,r=e.className;return xC.createElement(kae,{className:r},t)};Sae.defaultProps={children:null,className:""},Sae.propTypes={children:xw.node,className:xw.string};var Eae,Bae=dB.span(wae||(wae=Ky(["\n ","\n padding: 12px 16px;\n max-width: 200px;\n text-align: center;\n display: inline-block;\n"])),(function(e){var t=e.theme;return YE(["font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";"],J5(t,"FlashLiveness.instruction.fontSize",vae),J5(t,"FlashLiveness.instruction.color",vae),J5(t,"FlashLiveness.instruction.fontWeight",vae),J5(t,"FlashLiveness.instruction.background",vae),J5(t,"FlashLiveness.instruction.borderRadius",vae),J5(t,"FlashLiveness.instruction.border",vae))})),_ae=function(e){var t=e.children,r=e.className;return xC.createElement(Bae,{className:r},t)};_ae.defaultProps={children:null,className:""},_ae.propTypes={children:xw.node,className:xw.string};var xae,Tae,Aae=dB.div(Eae||(Eae=Ky(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1001;\n\n background-color: ",";\n"])),(function(e){return e.$overlay?"white":"transparent"})),Iae=function(e){var t=e.children,r=e.overlay,n=e.loadingComponent;return xC.createElement(Aae,{$overlay:r},r&&n,xC.createElement("div",{style:{visibility:r?"hidden":"visible"}},t))};Iae.defaultProps={children:null,overlay:!1,loadingComponent:xC.createElement(Kee,null)},Iae.propTypes={children:xw.node,overlay:xw.bool,loadingComponent:xw.node};var Pae={width:210,height:300},Rae={width:v5.isMobile?window.innerWidth:window.innerHeight,height:window.innerHeight},Dae=dB.ellipse(xae||(xae=Ky(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),Nae=dB.rect(Tae||(Tae=Ky(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n"]))),Oae=xC.forwardRef((function(e,t){var r=e.className,n=e.scale,o=e.debug,a=e.width,i=e.height,s=e.padding,c=e.verticalOffset,u=e.ovalMaskFillColor,l=(a-Pae.width)/2,d=(i-Pae.height)/2+c,f=(a+Pae.width)/2,p=(i+Pae.height)/2+c,h=l-(f-l)*(n-1)/2,m=d-(p-d)*(n-1)/2,g=(f-l)*n,v=(p-d)*n;return xC.createElement("svg",{className:r,viewBox:"0 0 ".concat(a," ").concat(i),width:a,height:i},xC.createElement("mask",{id:"OVAL_MASK"},xC.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),xC.createElement(Dae,{ref:t,cx:a/2,cy:i/2+c,rx:Pae.width/2,ry:Pae.height/2,$scale:n})),xC.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:u,mask:"url(#OVAL_MASK)"}),o&&xC.createElement("rect",{x:"0",y:"0",width:a,height:i,stroke:"red",fill:"none"}),o&&xC.createElement(Nae,{x:h-s.left,y:m-s.top,width:g+s.left+s.right,height:v+s.top+s.bottom,fill:"none",stroke:"red",strokeWidth:.5}))}));Oae.propTypes={className:xw.string,scale:xw.oneOfType([xw.number,xw.string]),debug:xw.bool,width:xw.number,height:xw.number,padding:xw.oneOfType([xw.number,xw.shape({top:xw.number,right:xw.number,bottom:xw.number,left:xw.number})]),verticalOffset:xw.number,ovalMaskFillColor:xw.string},Oae.defaultProps={className:"",scale:1,debug:!1,width:Rae.width,height:Rae.height,padding:0,verticalOffset:0,ovalMaskFillColor:"#fff"};var Lae=function(e,t,r){var n=e.smallScale,o=e.largeScale,a=e.ovalPadding,i=t.width/t.height,s=n/o,c=n*r.height,u=o*r.height,l=a.top+a.bottom,d=a.left+a.right,f=c-l,p=u-l;if(parseFloat((p*i).toFixed(2))+d>r.width){var h=((r.width-d)/t.width).toFixed(2);return{smallScale:(h*s).toFixed(2),largeScale:h}}return{smallScale:(f/t.height).toFixed(2),largeScale:(p/t.height).toFixed(2)}},Mae=function(e){var t=e.offset,r=e.ovalPadding,n=e.largeScale,o=e.ovalHeight,a=e.maskHeight,i=o/2+r.bottom;return(i+t)*n>a/2?a/2/n-i:t},Fae=function(e){xC.useEffect((function(){return function(){var t;e&&(null===(t=e.srcObject)||void 0===t||t.getTracks().forEach((function(e){e.stop()})))}}),[e])},Uae=function(){var e,t=Wy(xC.useState(null),2),r=t[0],n=t[1],o=Wy(xC.useState(!1),2),a=o[0],i=o[1],s=xC.useRef(null);return xC.useEffect((function(){if(!s.current)return function(){};var e=s.current,t=function(){n(e.getBoundingClientRect()),i(!1)},r=function(){i(!0)};return e.addEventListener("transitionstart",r),e.addEventListener("transitionend",t),function(){e.removeEventListener("transitionstart",r),e.removeEventListener("transitionend",t)}}),[]),[s,null!=r?r:null===(e=s.current)||void 0===e?void 0:e.getBoundingClientRect(),a,i]},jae=function(e){var t=e.mode,r=e.enableWriteExif,n=xC.useRef(Date.now()),o=yj.useSDKSettings().exifKey,a=xC.useCallback((function(){if(r){var e=Date.now();lK.preWriteExif({mode:t,startTime:n.current,endTime:e,exifKey:o})}}),[t,r,o]),i=xC.useCallback((function(e,t){r&&lK.addExifData(e,t)}),[r]),s=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.imageData){e.next=3;break}return e.abrupt("return",null);case 3:if(r){e.next=5;break}return e.abrupt("return",o.blob);case 5:return e.next=7,lK.writeExif({mode:t,imageData:o,enableExifData:!0});case 7:return a=e.sent,e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[t,r]);return xC.useEffect((function(){r&&lK.initExifData()}),[r]),{prepareExifData:a,writeExifData:s,addExifData:i}},Vae="Face authentication",zae="Hold still",qae="Uploading",Hae="Start",Kae="Retry",Wae="Fit your face into the oval",Qae="No face detected",Gae="Processing result",Xae="Please fit your face in the oval",Yae="Please move your face a bit closer",$ae="Please move your face a bit further",Zae="Please open your eyes",Jae="Please hold your device at eye level",eie="Multiple faces detected",tie="Please move your face down a little",rie="Move your face closer",nie={face_authentication:Vae,hold_still:zae,uploading:qae,start:Hae,continue:"Continue",retry:Kae,"face_authentication.successful":"Successful face authentication","face_authentication.unsuccessful":"Unsuccessful face authentication",move_face_into_frame:Wae,face_not_found:Qae,processing_result:Gae,please_move_face_into_center_frame:Xae,please_move_face_closer:Yae,please_move_face_farther:$ae,please_open_your_eyes:Zae,please_look_straight_at_the_camera:Jae,please_only_one_face:eie,please_move_face_down:tie,"timeout.remaining":"Remaining time: <%= remain %> seconds","timeout.expired":"You need to complete within <%= timeout %> seconds. Please try again.",move_face_closer:rie},oie="Xác thực khuôn mặt",aie="Giữ yên",iie="Đang tải lên",sie="Bắt đầu",cie="Thử lại",uie="Đưa mặt vào khung",lie="Không tìm thấy khuôn mặt",die="Đang xử lý kết quả",fie="Đưa khuôn mặt vào giữa hình oval",pie="Đưa khuôn mặt lại gần một chút",hie="Đưa khuôn mặt ra xa một chút",mie="Vui lòng mở to mắt",gie="Vui lòng đưa thiết bị ngang tầm mắt",vie="Có nhiều mặt trong khung hình",yie="Đưa khuôn mặt xuống một chút",bie="Đưa mặt lại gần",Cie={face_authentication:oie,hold_still:aie,uploading:iie,start:sie,continue:"Tiếp tục",retry:cie,"face_authentication.successful":"Xác thực khuôn mặt thành công","face_authentication.unsuccessful":"Xác thực khuôn mặt không thành công",move_face_into_frame:uie,face_not_found:lie,processing_result:die,please_move_face_into_center_frame:fie,please_move_face_closer:pie,please_move_face_farther:hie,please_open_your_eyes:mie,please_look_straight_at_the_camera:gie,please_only_one_face:vie,please_move_face_down:yie,"timeout.remaining":"Thời gian còn lại: <%= remain %> giây","timeout.expired":"Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại.",move_face_closer:bie},wie={en:nie,vi:Cie},kie=xC.createContext({}),Sie=function(e){var t,r=e.children,n=yj.useSDKSettings().lang;return xC.createElement(kie.Provider,{value:null!==(t=wie[n])&&void 0!==t?t:wie.vi},r)};Sie.propTypes={children:xw.node.isRequired};var Eie,Bie=function(){var e=xC.useContext(kie);return xC.useCallback((function(t,r){var n,o;return r?e7(null!==(n=e[t])&&void 0!==n?n:t)(r):null!==(o=e[t])&&void 0!==o?o:t}),[e])},_ie=function(){var e=xC.useRef(),t=Yj.useSDKTracking().sendEvent;return xC.useCallback((function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=performance.now(),i={};"object"===By(o)&&(i=Ny({},o),e.current&&(i.interval_vs_previous_in_ms=a-e.current)),"function"==typeof o&&(i=o({lastTimeLog:e.current})),e.current=a,t({tag:r,event:n,log:i})}),[t])},xie=function(e,t){var r=xC.useRef(e);xC.useEffect((function(){r.current=e}),[e]),xC.useEffect((function(){t&&"function"==typeof r.current&&r.current()}),[t])},Tie=Object.freeze({READY:"READY",RUNNING:"RUNNING",STOPPED:"STOPPED"}),Aie=function(e){var t=e.startTime,r=void 0===t?3:t,n=e.onCountDownDone,o=Wy(xC.useState(r),2),a=o[0],i=o[1],s=Wy(xC.useState(Tie.READY),2),c=s[0],u=s[1],l=xC.useRef(),d=xC.useCallback((function(){u(Tie.RUNNING),l.current=setInterval((function(){i((function(e){return e-1}))}),1e3)}),[]),f=xC.useCallback((function(){u(Tie.READY),i(r),clearInterval(l.current)}),[r]);return xC.useEffect((function(){0===a&&(u(Tie.STOPPED),clearInterval(l.current),"function"==typeof n&&n())}),[a,n,f,d]),{state:c,countdown:a,startCountDown:d,stopCountDown:f}},Iie=dB.span(Eie||(Eie=Ky(["\n display: inline-block;\n margin-block: 10px;\n text-align: center;\n max-width: 350px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return J5(t,"FlashLiveness.timeoutText.color",vae)}),(function(e){var t=e.theme;return J5(t,"FlashLiveness.timeoutText.fontSize",vae)}),(function(e){var t=e.theme;return J5(t,"FlashLiveness.timeoutText.fontWeight",vae)}),(function(e){var t=e.theme;return J5(t,"FlashLiveness.timeoutText.padding",vae)})),Pie=3e3,Rie=function(e){var t=e.onTimeout,r=e.timeout,n=e.shouldStart,o=e.shouldStop,a=e.onWarningMessageTimeout,i=e.timeLeftThreshold,s=Bie(),c=Wy(xC.useState(!1),2),u=c[0],l=c[1],d=xC.useCallback((function(){l(!0),setTimeout((function(){l(!1),"function"==typeof a&&a()}),Pie),"function"==typeof t&&t()}),[t,a]),f=Aie({startTime:r,onCountDownDone:d}),p=f.countdown,h=f.startCountDown,m=f.stopCountDown;return xie(h,n),xie(m,o),xC.createElement(xC.Fragment,null,!u&&p>0&&p<i&&xC.createElement(Iie,null,s("timeout.remaining",{remain:p})),u&&xC.createElement(Iie,null,s("timeout.expired",{timeout:r})))};Rie.propTypes={onTimeout:xw.func.isRequired,timeout:xw.number.isRequired,shouldStart:xw.bool.isRequired,shouldStop:xw.bool.isRequired,onWarningMessageTimeout:xw.func,timeLeftThreshold:xw.number},Rie.defaultProps={onWarningMessageTimeout:null,timeLeftThreshold:10};var Die={8:[" r rrr"," r rr"," r r rr "," r rrr "," r r r "," rr r rr"," rr r "," rr rrr"," rr r"," rrr r"," r rrr "," r r r "," r r rr"," r r r "," r rrr r"," r r "," rrr r "," r rr r"," rrr rrr"," r r "," rr r "," r rrr "," r rr "," r r rr"," r r r"," r r r"," r rr r"," r r r "," r rr r"," r rr rr"," rr rr "," rr rr"," r rrr"," r r"," r rrr"," r rr "," r rr r "," rr r "," rr r r "," r r "," rr r "," rr r "," r r r"," rr rr"," rr "," r rr "," rrr r r"," r r r"," rrr rr"," r rr"," rrr "," rr rrr"," r r "," rrr "," r r "," r r r"," r rr "," rr rr "," rrr r"," rr r r"," r r r r"," rr rrr "," rrr rr "," rrr r"," rrr rr"," r rr "," rrr r "," rr rr"," rr rr r"," r rr "," rr r"," r r rr"," r r r"," r r rrr"," rr r r"," rrr r "," rr r r"," r r "," rr r "," rr rr "," r r "],9:[" r r r "," r r r"," rrr r r "," r rrr "," r r rr"," rr r "," r r r "," r rrr "," rr rr "," rr r r "," r r rrr"," r r r r"," r rr r"," rr r r"," r rr "," rrr r "," r rr r"," rr rr "," rr r r"," rr r rr"," rr rrr "," r r r"," r r r "," rr rr r"," r rr r"," rrr rrr "," rr r r"," r r r "," rrr "," r r rr"," r r rrr"," r r r rr"," r r r "," rrr rr"," r rrr r "," rrr r "," rrr r "," rrr r "," r rr r r"," rr r r "," rr r r"," r r r"," rr rr r"," rr r r r"," r r r "," r r rr "," rr r r "," r rr r "," rr rr "," rr r "," rr r"," r r r"," rrr r"," r rr "," r r "," r r "," rrr r "," r rr "," r rr r "," r rr rr"," rr r "," r r rr "," rrr rr"," r rrr "," rrr rrr"," r rr "," r r rrr"," r rrr r"," r r rr r"," rr rr r "," r rrr "," r r rr"," rr r "," r r r "," r r r r "," r r "," r rr rr "," r rrr "," r rr "," rr rrr "," r r "," r r r r"," rr rr r"," r rr rr"," r r r "," rr rr"," r r rrr "," r r r "," rr rr rr"," r rr rrr"," rr rr "," rr r rr"," rrr rr "," rrr rr "," rr rrr "," r rrr"," rr r r"," rrr rr "," rrr rr"," rrr r r"," rr rr"," r rrr r"," r rr "," rr rrr"," rr r r"," r rr r"," r r rr "," r rr rr"," r rrr rr"," rrr r r"," r rr"," r r rr "," r r r"," rrr rrr"," rr r "," rr rr "," r r rr"," rr rrr r"," rrr r rr"," r rr r "," r r r"," r rr r"," rrr r r"," rr r rr"," rr r rrr"," r r "," r rrr"," rrr r "," r r r r"," rr rrr"," r r "," rr r "," rr r rr "," r rrr r"," rr r "," rrr r"," r rr r "," r rr r"," r rr "," r r rr"," r r r "," rr rrr"," rr rr "," r rrr "," rrr rr r"," r r rr"," rr r r "," r r r r"," r r r"],10:[" r rr r"," rrr rrr "," rr r rr "," r r rrr"," r rr r"," r r rr "," r rrr rr"," r r rr "," rr r r"," r r rr "," rr rrr "," r rr r r"," rr r rr "," r r r r "," r rrr "," r rr rr "," rr rr r"," rr r r "," r rrr r"," r r r "," r r r"," rrr r "," r r r"," rr r rrr"," r r r rr"," r rr rr"," r rr r "," rrr r r "," rr rr r"," r r rr"," r r r r"," rrr r rrr"," r r r r "," r r rrr "," r rrr rr "," rrr r"," r rrr "," r r r "," r rrr r "," r rr rrr"," r rrr rrr"," rr r r "," rr r r "," rrr r rr"," rr rrr "," rrr r "," rrr rr r"," rrr r "," r rrr r "," r r rrr r"," r r r r "," rrr r r "," rrr rrr "," rr r rr "," r r r rr"," rr r r r"," rr rr "," r rr rr "," rr rrr r"," rr rr "," r rr r "," r rrr r"," r r r r"," rr rrr "," r r "," rr r r "," rrr rr r"," rr r rr"," r rr r"," r r r"," rr r rr r"," r r rr r"," rrr rrr "," r r r r "," r r rrr "," rr r "," rrr r r "," r r rr "," r r r r "," r rrr r"," rr rrr "," r rrr rr"," rr r rr"," r r r "," r r rr r"," r r r r"," rr rr "," rrr rr "," r r r"," rr rr "," rr rrr"," r rr r"," r r rrr"," rr rr "," r rrr rr"," rr r "," r rr r "," rr r "," rr rr r "," rr rr r r"," r rrr r "," r rrr "," r rrr "," r rr rr"," rr rr rr"," rr rrr "," r r rr "," rr r r"," rr r "," rr r rr"," r rr rrr "," rr rrr r"," rr r r "," rr r rr "," r rrr "," r rr r r"," r r r "," rr rr r "," r r rr "," r rr r "," r rr r "," r rr r r"," rrr rrr"," rr r r rr"," rrr rr "," r rr rr r"," rr r r r"," r rr r"," r rr rr "," r r r "," r r rr r "," rrr r rr"," r r "," r rrr r "," r r rr r"," r r r r"," r rrr r r"," rr r rrr "," rrr rr "," r r rrr"," r r r "," rr r rr"," r rr r"," r r "," rrr r r "," rr rrr r"," rrr rr "," rr r r "," r r r r"," rrr r "," r rr rrr"," r rr r "," rrr r r"," rr r r"," r r r "," r r rrr"," rr r "," rr rr r"," r r r r"," r rr "," r rr rr "," rr r r "," rr r rrr"," rr rr r"," rrr rrr"," r r rrr"," r r r"," r r r "," rrr r r"," r rr r "," r rr rr"," rr rrr r "," r r r r"," rr r r r "," r rr r "," rr r r "," r rr "," r rr rr"," r rr rrr"," rrr r rr "," r r rrr "," r r r rr"," r r r "," r rrr r"," rr r "," rr rr"," r rr r "," rr r rr"," rr r rrr"," r rr r rr"," r r r "," r r r rr "," rr r r r"," r r r rr"," rr rr rr "," rrr r r"," r rr r r"," rr rr r "," rr r r"," r rr "," rrr rr r"," r r r "," r r rr "," rr rr r"," rrr rr rr"," r rrr "," rr rr rr"," rrr r r"," rrr r rr"," r r r "," rr rrr"," rrr rr "," rr rrr rr"," r r r"," r rrr "," r r rr"," r rr "," rr rr "," rrr r r r"," r rrr"," r r r rrr"," rrr rr"," r r rr "," r rrr r"," rr r r"," rrr r r"," rr rr rrr"," r r r r"," rrr r "," r r r r"," r r rr"," r rr rr"," rrr rr r "," r r r r r"," r r r "," r r r "," r rr r "," r r rr rr"," rrr r "," rr rr r "," r rr r r "," rr r r r"," rr rr r"," rr rrr "," rrr rrr r"," r r rrr "," r r rr"," rr r r"," rr r rr"," r r rr"," r r rr "," rrr r "," r rrr r"," r rr "," r r r "," r r r r"," rr r r "," rr rr "," rrr r r"," r rr "," rr r r"," rrr rr "," r r rr"," r r rr"," r r rr r"," r r r "," rrr rrr"," rrr rr"," r rr rr"," r r rr "," rr r r "," r rr r"," r r rrr"," rr rr rr"],11:[" rrr rrr "," r r r r r"," r r rrr"," r rr rr "," r rr rrr"," r r r r r"," rr r rrr"," rrr rrr r"," rr r r "," rr rrr rrr"," r rrr rrr"," r r r "," rr rrr r"," r rrr "," rr r rrr "," r rr rr"," rrr rr r"," rr r r "," r rrr rr"," r r rrr r"," rr r r r"," rrr r r"," r r rrr "," r rr rr r"," rr rrr r"," rrr r rrr"," rr rr r"," r rrr r "," r rr rrr "," r r rr"," rr r r "," r r r r "," r rr rr"," r rr r"," rrr rr "," rrr rr r "," rr r r r"," rr rrr rr"," rrr rr "," r rrr "," r rr r "," rrr rrr"," r rr rr rr"," r r r rr "," rr r rr rr"," r rr r "," r r r "," r rrr r "," rrr r r r"," rrr r rr "," r r r "," rr r rrr "," rrr r r"," rr rr r "," rr r r "," r rr r rrr"," r r r r"," rr r rrr "," r rr r"," r r rr"," rr r r "," rr r r"," r r r rr"," rrr r rr "," r r r r"," r rr r rr "," r r rr "," r r rr r"," r rrr rr "," r r r "," r rr r "," rr r r r"," rr r r r"," r rrr rr "," rr rrr "," rrr r r "," rrr r rr "," rr r rr"," rr rrr r"," r r rrr "," r r rr r "," r rr rr r "," rr r r r "," r r r "," rr r r "," r r r rrr "," rrr rr r"," r rr r "," rr rr r "," rr rr rr "," rrr r r "," rrr rr r r"," r r rrr "," r rr r rr"," rr rrr rr"," rr rr rr r"," r r r"," r rrr r"," rr r r r"," r r rrr "," r rr r rr"," rrr r r "," r rr r "," r rr rr "," r rr rr "," rr rrr rr "," rr rr rr "," rr r rr "," r r r r r"," rr rr rrr"," r r rr r "," r r r "," r r r r"," rr r rrr"," r rr r "," r r rr"," rrr r r"," rr rr r "," rrr r rr"," r r rr r"," rr rr r r"," r r r r "," r r rrr rr"," r rr "," r r r r "," rrr r rrr"," rrr r r r"," rr r rrr r"," rr rr r r"," rrr r r "," r rr r r "," rrr rr "," rr r rr"," r r rrr"," r r r r r "," r rrr r r"," r r rr r"," r r rrr "," r r rrr r "," r r r rr"," r rr rr "," rr rr rr "," r rrr r "," r rr rrr"," r r r r"," rrr r "," rr rr "," rr rrr "," rrr r r"," r rr r r "," r r rr "," r r rr "," r rr rr "," r r rr "," rr rr rr"," r rr "," rr r rr "," r rr r r "," r r r r"," r r r "," r rr rr "," rrr r r "," rr r r "," r r rr "," rr r rr r "," rr rrr"," rr rr rrr "," rr rr r"," r r r r "," rr r rrr"," rr rrr "," rr r r "," r rr r "," rr r r "," rr rrr r r"," rr r "," r r r rr "," rr rr rr "," rrr r "," r r rr r"," rr r r r "," rr r r r "," rrr r r"," rrr r rr"," r r r r "," rr rr r "," rrr rr "," r rr rrr"," r rr rr"," r rrr r r"," r rrr "," r rrr r"," rrr rrr r"," r r r "," r r rr "," r r rrr"," rr rr r"," r r rrr"," rrr rrr r "," rr r r r"," rrr rrr"," r r rrr r"," rr r r rr"," r r r "," rr rrr r "," rr rr r "," r r r "," r rrr "," r r r r "," r rrr r"," r r rr r "," r rr rrr "," rr r rrr"," rrr rr"," rrr r r r"," rrr rr r"," r rr r "," rr rr r r"," r r rrr "," r r r rr"," r r rrr "," rrr rr r "," rr rrr r"," rrr r rr"," r r rr rr"," rr rr "," r rr r"," r rr "," rrr r r "," r r rr "," r rrr r"," r rr r"," r r rr r"," r rr r r"," rr r rr"," rrr r rr"," r r rr"," r rrr rrr"," r rrr rr "," r r r r "," rrr r rr"," r r r r "," rrr rr rr"," r r rr rrr"," r r r r"," r rrr "," rr r r r"," rr rrr "," rr r r r"," rr r rrr "," rr r r"," r r r r"," rr rrr r"," rrr r r "," r r r "," r rr r r r"," r rr rrr r"," r r r r"," r r r rr r"," rrr r r r"," r r rrr"," rr rrr "," r r r r"," r r r"," r r rr rr"," rrr rr r"," r r rr "," r r r rr"," r rr r r "," r r r rr"," r rrr rr"," r r r"," r r rr"," r rrr r "," rr rr r "," rrr r "," rr rr r "," r r r r "," r r rr "," rrr r rr"," r rr r "," rr r r r r"," r r r r "," rr r r "," rrr rr "," rr rr rrr"," rr r rr"," r rrr rrr"," r rr r "," rr rr rr"," rr r r "," r rr rr "," r r r r "," r r r "," rr r rr "," r r rr "," r r r rr"," rr r r r "," r r rr "," r r r rr"," r r rrr"," rr rr r r"," r rrr rr r"," r rr rr"," r r rr "," r rr r r"," rr rr r "," r r rrr r"," r rrr rr "," rr rrr "," rrr r r "," rrr r r"," rrr rr "," rr r "," r rrr r rr"," r rrr r"," r rr r r "," rr r rr "," r r rr r r"," r rr r r"," rr r r "," r r r rr"," rrr rrr r"," rrr r r"," r rr r rr"," rr r r r "," rr r r "," rrr rrr "," r r rr"," r r rrr"," r r r r"," rr rr "," r r r r"," rrr rr rr"," rrr r "," r r r r r"," rrr r rrr"," rr rr "," rrr rrr "," r rrr r r "," rr r rr "," rr rr r"," rr r r"," rr r rr r"," r r r r "," r r rr r"," rrr rrr "," rr rrr r "," r rr rrr "," r rrr r"," rr r r"," r rrr "," r rr r "," rrr rrr "," rr r rr r"," rr rrr r "," rr rr rr"," rr r r"," r rr rr r"," r rrr rr"," rr r r "," r r r r "," rr r rr"," r r r r"," r rrr rr"," rr r rrr"," r r r rr "," rrr r rr r"," rrr r "," r rr r r"," r rr rrr"," rr rr rr"," r r rr rr"," r rr rr "," rr r rr"," r rr rr r"," r rrr r "," r rrr r "," rr r rrr"," r r rr "," r r r rr"," r r rrr "," r r r "," rr r r rr"," rr rr rr"," r rrr r "," rr rr "," r rr r r"," rr r r rrr"," rrr r "," r rr rr "," r rr r "," r r r rrr"," r r r rr"," rrr rr rr"," r rr rrr "," r rr rr r"," rrr r r rr"," r r r r"," r rr rrr"," r r rrr r"," r rr r r"," r rrr r r"," r r rr r"," rr rrr "," r rr r "," rr rrr r "," r r r r"," rr rr "," r rr rr"," r rr r "," r r rr r"," rr r rr"," rrr rr r "," rr rr rr"," r rr r "," r r r r rr"," rrr r r "," r r rrr "," rrr r rrr "," r r "," r r r "," r r r r"," r rr r"," r rrr r "," r r rr rr"," rrr rr r"," r rr r rr"," r rrr rr"," rr rrr r"," rr r r r"," rr rr r r "," r r rr r"," r rrr r "," r r r rr "," rrr rr r "," r rr r "," r r r r "," rrr rrr rr"," rrr r r "," r r r "," rr rr rrr"," r r r "," rr r rr "," rr r rr r"," rr rr r"," r rrr rrr "," r rr r r"," r rrr r r"," rrr r rr "," rr r r r"," r r r "," rrr rr rrr"," rr r rr "," rrr rr "," rr r rr "," rr r r rr"," rr r r "," r rr r r"," r rr r r"," r r rr r "," r r rr "," r r rr rr "," rr r r"," rrr rr r"," rr r r rr"," r rrr r"," rr r rr r"," r r r r r"," rr r r "," rr rr r"," r r r "," rr r "," r rr r"," r r r rrr"," rr r rr "," rr rr r "," r r rr "," r rr rrr"," r rrr rr"," r rr r r"," r r rrr "," r rr rr "," r rr rr"," rr rrr rr"," r r r "," rr rr r "," r r r r "," rrr r r r "," rr r rr "," rrr rr rr "," r r rr "," r r r rrr"," r r r rr "," rrr rrr "," rr rr r"," r r rr r"," r r r rrr"," r r rr r "," r r r r"," rr rr r rr"," rr r r rr "," r rrr r "," r rr rr"],12:[" rr rr rr r"," r r r rr"," r rr r r "," rr r r rr "," r rr r r"," rrr r r "," r r rr "," rrr rr r "," rr r rr "," rr rr r "," r r r r "," rr r rr r "," r r r rr"," rr rr r rr "," rr r rr "," rrr rr "," r rr r rr"," rrr rr rrr"," r rrr rr "," rr rr r "," r rr r r"," rrr rr rr "," rr r r r "," rrr r r "," r r rr "," r rr rr rr"," r rrr r "," rr rr r"," rr r r r "," rr rr r rr"," rr r r r"," r rr rr"," r r r r"," r rrr rr "," rr r rr "," rrr r r "," r rr rrr"," r rrr rrr "," r rrr rrr "," rr r r rrr"," r rr r r r"," r r r r rr"," r rrr "," r r rr rrr"," rrr r rr r"," r rrr r "," r rr r"," r rrr r "," rr rr r"," r rr r "," rrr r rr"," rr rr "," rrr r rr "," r rr rr r"," r rrr r r "," r r rr rr"," r rr rr r"," rr r r r "," rr r rrr r"," rr r r r"," r r rr rrr"," r rrr rr r"," rr rr r "," r rr r r "," r r r r"," rr rr r r"," rr r rrr"," rr r rr r"," r r r rr "," r rr r "," r rrr r r"," rrr r rr r"," r rrr rr rr"," r rr r r r"," r rr r rr"," rrr r r "," rr rrr rr "," rrr rr "," rrr rrr r"," rrr rr rr"," rrr rr rr"," r r rr rr"," rr r rr "," rr r r "," r rrr r r"," rr rr r "," rr rr rr "," rr r r "," rr r r "," rr rrr r "," rr rr rrr"," rrr r rr "," r r rr rr "," rr r r r "," rrr rr "," r rr r rr"," r r r r r"," r rr r r"," r r rr rr"," r rrr r r "," r rrr r r r"," r r rrr r"," rr r rr r"," r rr r rr "," rrr r r"," rrr r r "," rrr rrr r "," r r r rr "," rr r rr "," r rr rrr"," r rr r "," r r rr "," r r r r"," r r r r r "," r r rrr r"," rr r rr r"," r rr r rr "," r rr rr "," r r r r"," r r r r"," r r r r "," rr r r "," r r r r "," r rr rr "," rr rr r "," rr r rr rr "," rrr rr r "," r r rr r "," rr r rrr "," r rrr rrr"," rr rrr r "," r rr rrr rr"," rr r r"," rr r rr rr"," rr r r"," rrr r r "," r r rrr r "," r rr r rr r"," rrr rr r "," rr rrr r r"," r rrr r r"," rrr rrr rr "," rr rrr rr "," rr r r r"," r rrr r r"," rr r rr"," rr r r r rr"," rr rr r r"," rr rrr rr"," rr r r r"," rrr r rrr "," r r rrr r "," rrr rr r "," rr r r rrr"," r rr rr rrr"," rr r r "," r r rr r "," r rr rrr"," r r r rr rr"," r r rrr "," r r rrr "," rr rrr rrr"," r r rrr "," rr r rr r r"," rr rr rrr"," rrr r rr "," rr rr rr"," r r r r rr"," rr r rrr"," r rr r r r"," rr r r rr "," rrr rrr r"," rrr rr rr "," r r r r "," rr r rrr "," r rrr r r"," r rr r "," rr r r "," r r r rr"," r rrr rr "," r r r r r r"," r r rrr "," rr r rr"," rr r r r "," rr rrr r "," rr rrr r"," r r r "," rrr r rr"," rr rr r"," r rr r "," r rr r "," rr rr rr"," r rr rrr "," r rrr r r"," rr rr r r"," rrr rrr "," r rrr rrr"," rr r rrr r"," rr rr r r"," r rr r r"," r r rrr r"," r r r r"," rr rrr rrr "," r rr r r "," rr rr "," rr r rr "," r rr rrr r"," rr r r r "," rr r r r "," r rr r rr"," r rrr rr r"," rr r r r"," r rr r rrr"," rr r r r r"," rrr rrr r"," r rr rrr "," r r rrr r"," r r rr rr "," r r r r"," rr rr rr "," r rr r r "," r rr rr r"," rrr rrr rr"," rr rrr r r"," r rr r r"," r rr r rrr"," r r rr r"," r r r r r "," r r r r r "," r r r rr"," r r rr r "," r r rr rr"," r r r rrr r"," rr r rr rr"," r r rr r"," r r rr rr"," r r r r"," r r rrr r"," r rrr r rrr"," r r rr rr"," r r r rr"," r rr r "," r rr rrr "," r r r "," rrr r r rr"," r rrr r "," r r r r "," r rr r r"," r r rr r"," r r r rr "," rrr r r"," rr r r "," rrr r r r "," rr r r "," rr rr r "," r rr r r "," r r r rrr"," r rr rr r"," r r r r "," r r r "," r r rrr r r"," r rr r rr"," r rr r "," rrr r r "," r rr rr rr"," r rr r rr"," rr rrr "," rr rrr rr "," rrr r rr "," rrr r rr r"," r r rr rrr "," r r r r r"," rrr r rrr r"," rr r r rr "," rrr r r"," r rr r r"," rr rr r "," rr rr rrr "," r r r rrr"," rr rr rr "," rrr r rrr"," r rr rr r "," r rrr r "," r r rr "," rr r r r "," r r rr "," r r r r "," r rrr r"," rr rrr r "," rr rrr rr "," rr r r r"," rrr rr r"," r r r r rr"," r r rr r"," rrr rr r "," rr rrr rrr"," r rr rr "," rr rr "," r r rrr "," r r rr r"," r r rr r "," r r rr r r "," r r rr rrr"," r rrr rrr"," rrr r r "," r r r r r"," rr rr r rr"," rr r rrr "," rr r r r "," r r r rr"," rrr rr rrr"," r r r rrr"," r r rr r"," r r rr r "," r rrr rr"," r r rrr rr"," r r rr r r"," rr rr r r "," r rrr r"," rrr rr r r"," r rrr rr"," r rrr rr "," r rr r "," rrr r r r"," r r r r r"," r r r r"," r r r r r"," rr r r r"," r r r rr "," rrr rr r "," r rr rr r"," r rrr rr "," r rrr r rr "," rrr r r rr "," rrr rr "," rr r rr r"," r r r "," r rr r "," r rrr r"," rrr r rr r"," rr r rr"," r r rr r r"," r rrr r "," rr r r r"," rr r r "," r r rrr r"," rr rr r r r"," rrr rrr "," rr r r rrr"," rrr rr r"," r rr rrr "," rr r r "," rrr r r "," rr rrr r "," rr r r "," r rrr rrr"," r r rr "," rr rr rrr "," rrr rrr "," rrr r r r "," rrr r r r "," r r r rr"," r r rr r "," r rrr r "," r rr r r"," r r rr "," rr r rrr "," rr rr rr r "," r r r rrr"," r rr rr rr"," r rrr r rr"," rr r r rr"," r r r r"," rr rr rrr "," r rrr r r"," r rr r r r "," r r rr "," r rr r r "," rr rr r "," r rr r "," r rrr rr r"," r r rrr rr"," r r r "," r r r rr"," r r r rrr"," rr r r "," r r rrr "," r r r "," r r r r "," rr rr rr"," r rrr rr"," rr r rrr"," r rr rr r"," r r rr r"," rrr rr r"," r r r r rrr"," r rr rr "," r rr rrr "," rrr rrr r "," rr r r rr"," r r r r "," r r r "," rr rrr r"," r r r r "," rr r r "," r r rr r"," rrr r r r "," rr rr r r "," rrr r r r"," r r r r "," r rr r r"," rrr r "," rr r rr"," r rr rr "," rr rrr "," r r rr r"," rr rr rr"," rrr r rr"," rr r rr "," rrr rr rr"," rrr rr rrr "," r r rr r "," r r r rr "," r rrr r "," r r rrr "," rrr r rr "," rr r rr rr"," r r rr r"," r rr r r r"," r r rr r "," rr rr rrr"," rrr rr rr r"," r rr r "," r r r rr"," rrr rr r"," rr r rrr "," r rr rr r"," r r r rr r"," r rr r "," r r r r r "," rr r rr r "," r r rr r"," rr r r rr"," r r rrr"," r r r rr "," r r r rrr"," rr r rrr"," rrr r r "," r rrr r "," rr rrr rr"," r rr rr "," rr r rrr"," rr r rr "," r r r r r"," rr rr rr "," rr rrr rr"," rr r r "," r r r r "," rr r rr "," rrr r rr "," r rrr r r "," rr r r r r"," r rr r rr"," r rrr rr "," rr rr rr r"," r r r r"," rr rr r "," r r r r "," rr r rr r"," rr r rr r "," r r rr r "," rr rr rr "," rrr r r "," rr r r rr"," r r r "," rr r rrr"," rr r rrr "," r rrr r"," rrr r rrr"," rrr r r r"," rrr r r r"," r r r r"," r rr r rr "," rr r r r "," rr r r r"," r rrr rrr"," rr rr r rrr"," rr r r r "," rr rrr rr r"," rr r r r "," r r rrr r "," rr rrr rrr"," r r r r r "," r rrr rr"," rrr rr r "," r rr r r rr"," rrr r r r "," r rrr "," r rrr r "," r r rrr r"," r rrr r r"," rrr rr r"," rr r r rr r"," rr rr rrr"," r r r r r"," r r rrr "," rr r r r r"," r rr r r "," rr rr rrr r"," r rr rr "," rr rr r "," r r r r "," r rr r r "," rr rr r rr"," r r r "," rrr rrr r "," rr r rrr "," r rr r rr"," rrr rr rr "," rr rr rrr "," rr rr r r"," rr r r r "," r r r r"," rrr r "," r r r"," r rrr r"," r r r r"," r r rr r "," r r rr "," r r r "," rr r r "," r rr rrr"," r r r r "," r r rrr rr"," r r r r r"," r rrr rr"," rr r r r"," r rr rr "," r r rrr rr "," rrr r r r"," r rr r r "," r r rrr "," r rr r"," rr r r rr"," r r r rrr "," r r r r "," rrr r r r"," rr rrr r r"," rrr r rrr"," r rr rrr"," r rr r rrr"," rr rr r "," r rrr r r "," r rr rr"," r rr "," rrr r r rr"," rr rr r "," rr r rr "," r r r rr"," rrr r r "," rrr r r "," r r r r "," r r rrr r"," r r rr r"," r rr r r"," rr rrr r"," r r rr rrr"," r rr r r "," r rrr rrr "," rr rr r rr"," rrr rr r r "," r r r rr r"," rr rrr "," r rrr rrr"," rr rrr r "," rr r r r r"," rrr r rr rr"," r rrr rr"," r rrr r"," rr rr rrr"," r rr rrr "," r r rrr "," r rr rr "," rr rrr r"," r r r rr "," r r r rr "," rr rr rr "," rr r rr rr"," rrr rrr r r"," r rr rr"," r rr r rr "," rrr rr rr"," r r r rrr "," rr rr r r"," r r r rrr "," rrr rr rrr"," r r r r "," rr rr rr "," rr rrr r"," rr r r r "," rrr r rrr"," r rrr r "," rrr r r r"," rrr rr r r"," rrr rr r"," rr rrr r "," rr r r rr"," r r r "," rrr rrr r"," rr r r r"," r r rr "," r r r r rr"," r rrr rr r "," rr rr rr r"," r r rr "," r r r rr r"," r r rr r r"," r rr rr "," r rrr rr "," r r rr rr r"," r r rrr rrr"," rr rrr r "," r r r r r "," r r rr "," r rr r r"," r r rr r"," r r r r"," r rr r "," r r rrr rr"," rrr r rr r "," rrr r rrr"," r rrr rr "," r r rr r "," r rr rrr r"," r rr r r "," rr rr r r "," rr rr r "," r r r r r"," rr r rrr r "," r r rrr "," rr rrr rr"," r r r r"," rrr r r r"," r r r "," r rr rrr"," rr rrr rr"," rr rrr "," r r rr r rr"," r r r r r"," r r r rr "," r r rrr "," r rr rrr r"," rr rr r "," r r r "," r rr rr "," r r r "," r rr rr "," r r r r r"," r r r r "," r r rrr"," r r rr "," r r rr rr "," r rr rr rr "," r r r r"," r r r r"," r rr r "," rr r rr r "," rr rr r"," rr rrr r rr"," rrr rr rr"," r rrr r "," rrr rr r "," r r rrr"," r rr r "," rr rr r"," rrr r rr "," rr r rr r"," r r rrr r "," rr rr r r "," r rr r r"," r rr rr r"," r rr r rr "," rrr r rr"," r r r rrr"," rr r rr r"," rrr rr r"," rr r rrr r"," r rr r r"," rr r rr "," rr rr rr"," r r r r rr "," rr rr rr rr"," rr rrr r"," r rrr rr "," r r rr r"," r r r rrr"," r r rr r "," r r r rr "," r r r rr r "," r rrr r rr"," rrr rr rr "," rrr rrr rr"," r r rr rr"," r r rr "," r rr r r"," rr r r rr "," rr r r rr"," rr rr rr r"," rr r rr"," rr r r r "," r rrr rr "," rr r rr "," rr r rrr"," r rr r r"," rr r rr "," r rrr rrr "," rr r rr r"," rrr rrr "," r r rrr r"," rrr rr r r"," rr r r"," rr rrr rr"," rr r r r"," rr rrr "," rr r rrr rr"," rr r rr "," r rr rrr "," r r rr r r"," rr r r "," r r r "," r r rrr"," r r rr "," r r rrr"," rr r rr r "," rr rr r"," rr rrr r "," r r r "," r r r r"," rr rr r r"," r r r r "," r rr rr r "," rr rr rr "," rrr r rr"," r r rrr "," rrr rrr"," r r r r "," r r r r "," r rr rrr "," r rr rrr r"," rr r r rrr"," r r rrr "," rr r r r"," r r rr"," r rr rr r "," rrr r rr "," rrr r rrr "," rr r rrr "," rr r rrr "," r r r r r"," rrr rrr r"," r r rrr "," r rr r r "," rrr r r r r"," rr r r rrr "," rrr r "," rrr rr "," rrr rrr r "," rr r r r r"," r rr rr rr"," rr rrr r "," r r rr "," r r r r r"," rr rr r "," r r r r "," rr r r r"," rrr rrr "," r r rr r"," r rrr rr"," r r r r "," r r r r "," r r r r "," r rrr r "," r r r rrr"," r rrr r r"," r r rrr r "," r rrr "," r r r rr "," r rr rr "," r r r rr r"," r rr r rrr "," r rrr r r"," r rr rr "," r r r r "," r r rrr r"," rrr r r"," r r r rr"," r r r rrr "," r r r rr"," rr r r rr "," rr r r rr"," r rr rr"," rrr r r rr"," rrr r r "," rrr r rr "," rr rr rrr"," rr rrr r"," r r r rr"," rr r rr "," r r r rr"," r rr rr r r"," r rr r r "," r rr r rr"," r r rr rr"," r r rr rr "," rrr r rrr "," r r rrr "," rr r r r"," rr rrr r r "," rrr rr r rr"," r rr rrr "," r rr r rr"," r r r rrr "," rr r r "," rrr r rrr "," rrr r r r"," rrr r r r"," r r r rr "," r r r r rr"," r rr r r"," rrr r r rr"," rr rr r "," rrr rrr r"," rrr r rr"," r rr rr r"," r rr rr r "," r rr rrr r "," r rr rr"," rr rrr r r"," rr r rr rrr"," rr r r "," r rr r"," r rr r r "," rrr rr r "," r r rr rr "," r rr r "," rr r r rr"," rr r rrr "," rrr r r "," r rrr rrr r"," r r rr r"," r rr rrr "," rrr r rr"," r r r rr "," r rr rr"," rr r rr "," rrr rr r r"," rr r r "," r rrr r "," r r rr rr"," rrr r r"," rr r rr r"," rr r r rr"," r r r rr "," r r rr"," rrr rrr rr"," r r r r r"," rrr rrr "," r r r rr"," rrr r r "," rrr rrr "," rr rr rr"," rrr rr r "," r r r r "," r rrr r "," rrr r r rrr"," r rrr r "," rrr r rr "," r r r r "," rr r "," rr rr rr "," r rr r r "," r r r rr "," r r r r r"," rrr rrr rrr"," r r rr r r"," r r rr rr"," r r r r "," rr rr r r"," r rr rr r"," rrr rr "," rrr r r"," r rr rrr"," r r rr "," rr rr rr "," r r rr r "," r r rr r "," r rr r "," r r rrr"," r r r rr r"," r rrr r rr"," rr rr r r"," rr r rrr r"," rr r rr r"," r rr rr "," rrr r rrr"," r r r rr"," r r rr"," rr r r r"," rr rr r r "," rr rr r r"," rrr rr rr"," r rr rr "," r rrr rr r"," r r rr "," r rrr r r "," r rr r r r"," r r r rrr"," rr r r r r "," rr rr rr"," rr rrr "," r rrr r rr"," r r rr r "," r rr r rrr"," r r rr "," r rr r "," r rr rr r "," rr r rr"]},Nie=function(e){return xC.useMemo((function(){var t=Die[e];return t[Math.floor(Math.random()*t.length)]}),[e])},Oie=function(e){return xC.createElement("svg",Ry({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xC.createElement("path",{d:"M17.2434 6.06389L17.2438 6.06352C17.4385 5.86879 17.7519 5.86879 17.9467 6.06352C18.1314 6.24826 18.1314 6.57168 17.9467 6.75642L13.0567 11.6464L12.7031 12L13.0567 12.3535L17.9467 17.2435C18.1414 17.4383 18.1414 17.7517 17.9467 17.9464C17.7519 18.1412 17.4385 18.1412 17.2438 17.9464L12.3538 13.0564L12.0002 12.7029L11.6467 13.0564L6.75666 17.9464C6.56192 18.1412 6.24851 18.1412 6.05377 17.9464C5.85903 17.7517 5.85903 17.4383 6.05377 17.2435L10.9438 12.3535L11.2973 12L10.9438 11.6464L6.05377 6.75642C5.85903 6.56168 5.85903 6.24826 6.05377 6.05352C6.24851 5.85879 6.56192 5.85879 6.75666 6.05352L11.6467 10.9435L11.9999 11.2967L12.3534 10.9439L17.2434 6.06389Z",fill:"#5E5E5E",stroke:"#1D1D1D"}))},Lie=function(e){var t,r=(Py(t={},Ioe.FAR_FACE,0),Py(t,Ioe.CLOSE_FACE,0),Py(t,Ioe.FLASHING,0),t);return e.forEach((function(e){var t;null!=e&&null!==(t=e.metadata)&&void 0!==t&&t.type&&(r[e.metadata.type]+=1)})),r},Mie=xC.createContext({}),Fie=function(e){var t=e.apiCredentials,r=e.children,n=fq.useApiClient({apiCredentials:t}).apiClient;return xC.createElement(Mie.Provider,{value:n},r)};Fie.propTypes={apiCredentials:xw.shape({accessKey:xw.string.isRequired,secretKey:xw.string.isRequired,apiUrl:xw.string.isRequired}),children:xw.node.isRequired},Fie.defaultProps={apiCredentials:{}};var Uie=function(){return xC.useContext(Mie)},jie=function(){var e=[];return{uploadFrameBatch:function(t,r){e.push(r.httpClient.post("/v1/files",{frames:t,metadata:JSON.stringify({type:"selfie"})}))},getAllUploadedBatches:function(){var t=xy(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e);case 2:return r=t.sent,t.abrupt("return",r.map((function(e){var t,r;return{id:null!==(t=null==e||null===(r=e.data)||void 0===r?void 0:r.file_id)&&void 0!==t?t:-1}})));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),resetUploadBatches:function(){e.length=0}}},Vie=jie();function zie(){this.__data__=new E1,this.size=0}var qie=zie;function Hie(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Kie=Hie;function Wie(e){return this.__data__.get(e)}var Qie=Wie;function Gie(e){return this.__data__.has(e)}var Xie=Gie,Yie=200;function $ie(e,t){var r=this.__data__;if(r instanceof E1){var n=r.__data__;if(!_1||n.length<Yie-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new z1(n)}return r.set(e,t),this.size=r.size,this}var Zie=$ie;function Jie(e){var t=this.__data__=new E1(e);this.size=t.size}Jie.prototype.clear=qie,Jie.prototype.delete=Kie,Jie.prototype.get=Qie,Jie.prototype.has=Xie,Jie.prototype.set=Zie;var ese=Jie;function tse(e,t,r){(void 0!==r&&!l1(e[t],r)||void 0===r&&!(t in e))&&Y4(e,t,r)}var rse=tse;function nse(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),s=i.length;s--;){var c=i[e?s:++o];if(!1===r(a[c],c,a))break}return t}}var ose=nse,ase=ose(),ise=ase,sse=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?F0.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}})),cse=F0.Uint8Array,use=cse;function lse(e){var t=new e.constructor(e.byteLength);return new use(t).set(new use(e)),t}var dse=lse;function fse(e,t){var r=t?dse(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var pse=fse;function hse(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var mse=hse,gse=Object.create,vse=function(){function e(){}return function(t){if(!f2(t))return{};if(gse)return gse(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),yse=vse;function bse(e){return"function"!=typeof e.constructor||N6(e)?{}:yse(G6(e))}var Cse=bse;function wse(e){return n2(e)&&x8(e)}var kse=wse;function Sse(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ese=Sse;function Bse(e){return r8(e,z6(e))}var _se=Bse;function xse(e,t,r,n,o,a,i){var s=Ese(e,r),c=Ese(t,r),u=i.get(c);if(u)rse(e,r,u);else{var l=a?a(s,c,r+"",e,t,i):void 0,d=void 0===l;if(d){var f=D0(c),p=!f&&G8(c),h=!f&&!p&&x6(c);l=c,f||p||h?D0(s)?l=s:kse(s)?l=mse(s):p?(d=!1,l=sse(c,!0)):h?(d=!1,l=pse(c,!0)):l=[]:r9(c)||K8(c)?(l=s,K8(s)?l=_se(s):f2(s)&&!y2(s)||(l=Cse(c))):d=!1}d&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),rse(e,r,l)}}var Tse=xse;function Ase(e,t,r,n,o){e!==t&&ise(t,(function(a,i){if(o||(o=new ese),f2(a))Tse(e,t,i,r,Ase,n,o);else{var s=n?n(Ese(e,i),a,i+"",e,t,o):void 0;void 0===s&&(s=a),rse(e,i,s)}}),z6)}var Ise=Ase,Pse=O8((function(e,t,r){Ise(e,t,r)})),Rse=Pse,Dse=xC.createContext({}),Nse={},Ose=function(e){var t=e.children,r=e.clientSettings,n=e.apiCheck,o=Wy(xC.useState({}),2),a=o[0],i=o[1],s=Uie();xC.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:if("function"==typeof s.clientSettings){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,s.clientSettings();case 4:t=e.sent,i(t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[s]);var c=Nse;return Object.keys(r).length>0?c=r:n&&(c=a),xC.createElement(Dse.Provider,{value:c},t)};Ose.propTypes={children:xw.node.isRequired,clientSettings:xw.shape({}),apiCheck:xw.bool},Ose.defaultProps={clientSettings:{},apiCheck:!1};var Lse=function(){return xC.useContext(Dse)},Mse={data:{settings:{sdk_settings:{flash_liveness_settings:{capture_frame_settings:{enable:!1,frames_batch_length:10,frames_interval_time:0,frame_quality:.8,frame_scale:1},close_eyes_settings:{enable:!1,timeout:5},face_settings:{close_face_ratio:.82,max_far_face_ratio:.9,min_far_face_ratio:.8,mobile:{close_face_ratio:.95,max_far_face_ratio:.9,min_far_face_ratio:.85}},flash_settings:{colors_length:10,flash_color:"rgb(255, 0, 0)",delay_between_colors:120,flash_intensity:1,frames_per_color:4,use_face_detector_when_flashing:!1},liveness_settings:{enable_far_step:!0},timeout_settings:{enable:!0,total:30,countdown:10},exif_data_settings:{enable:!0},mask_settings:{chin_to_mask_bottom_padding:20,large_scale:.85,mobile:{chin_to_mask_bottom_padding:20,large_scale:.9,oval_padding:{bottom:20,left:20,right:20,top:0},oval_vertical_offset:60,small_scale:.65},oval_padding:{bottom:20,left:30,right:30,top:0},oval_vertical_offset:0,small_scale:.6},image_settings:{valid_face_ratio:.6,image_quality:1,crop_center_far:!0,crop_center_close:!1}}}}},imageSettings:{imageScale:1,imageQuality:1}},Fse=function(){var e=Lse();return xC.useMemo((function(){var t=Rse({},Mse,e);return{captureFrameSettings:{enable:g5(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.enable"),framesIntervalTime:g5(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frames_interval_time"),framesBatchLength:g5(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frames_batch_length"),frameScale:g5(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_scale"),frameQuality:g5(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_quality")},livenessSettings:{enableFarStep:g5(t,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.enable_far_step")},flashSettings:{flashColor:g5(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_color"),colorsLength:g5(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.colors_length"),delayBetweenColors:g5(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.delay_between_colors"),framesPerColor:g5(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.frames_per_color"),flashIntensity:g5(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_intensity"),useFaceDetectorWhenFlashing:g5(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.use_face_detector_when_flashing")},maskSettings:{smallScale:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.small_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.small_scale"),largeScale:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.large_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.large_scale"),ovalPadding:{left:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.left":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.left"),right:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.right":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.right"),top:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.top":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.top"),bottom:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.bottom":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.bottom")},ovalVerticalOffset:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_vertical_offset":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_vertical_offset"),chinToMaskBottomPadding:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.chin_to_mask_bottom_padding":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.chin_to_mask_bottom_padding")},faceSettings:{minFarFaceRatio:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.min_far_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.min_far_face_ratio"),maxFarFaceRatio:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.max_far_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.max_far_face_ratio"),closeFaceRatio:g5(t,v5.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.close_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.close_face_ratio")},closeEyesSettings:{enable:g5(t,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.enable"),timeout:g5(t,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.timeout")},exifSettings:{enable:g5(t,"data.settings.sdk_settings.flash_liveness_settings.exif_data_settings.enable")},imageSettings:{imageQuality:g5(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_quality"),validFaceRatio:g5(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.valid_face_ratio"),enableCropCenterFar:g5(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.crop_center_far"),enableCropCenterClose:g5(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.crop_center_close")},timeoutSettings:{enable:g5(t,"data.settings.sdk_settings.flash_liveness_settings.timeout_settings.enable"),total:g5(t,"data.settings.sdk_settings.flash_liveness_settings.timeout_settings.total"),countdown:g5(t,"data.settings.sdk_settings.flash_liveness_settings.timeout_settings.countdown")}}}),[e])},Use=function(e){return Array.isArray(e)?e.map((function(e){var t=e.base64,r=e.label,n=e.index,o=e.metadata;return{base64:t,label:r,index:n,metadata:JSON.stringify(o)}})):e},jse=function(e){var t=e.maskBoundingBox,r=e.faceRatio,n=e.validFaceRatio,o=e.video,a=e.shouldCropCenterSquare,i=void 0===a||a,s=e.cropArea,c=t.width*r/n,u=c/t.width,l=t.height*u,d={x:t.x-(c-t.width)/2,y:t.y-(l-t.height)/2,width:c,height:l};d.x+d.width>s.x+s.width&&(d.width=s.width,d.x=s.x),d.y+d.height>s.y+s.height&&(d.height=s.height,d.y=s.y);var f=null;if(i){var p=Math.min(d.width,d.height),h={x:d.x+d.width/2,y:d.y+d.height/2},m={x:h.x-p/2,y:h.y-p/2,width:p,height:p};f=xV.analyzeVideoAndWindowSizes(o,m)}else f=xV.analyzeVideoAndWindowSizes(o,d);var g=eae({size:{width:f.cropWidth,height:f.cropHeight},baseSize:400,video:o}),v=joe({width:g.width,height:g.height,cameraScale:1}),y=v.width,b=v.height;return v.getContext("2d").drawImage(o,f.cropX,f.cropY,f.cropWidth,f.cropHeight,0,0,y,b),v},Vse=function e(t){if("object"!==By(t)||null===t||Array.isArray(t))return t;var r={};return Object.keys(t).forEach((function(n){var o=n.replace(/([A-Z]+)/g,"_$1").toLowerCase(),a=t[n];"object"===By(t[n])&&(a=e(t[n])),r[o]=a})),r},zse=xC.createContext({enable:!1,key:""}),qse=function(e){var t=e.children,r=e.settings,n=xC.useMemo((function(){var e,t=null!==(e=null==r?void 0:r.key)&&void 0!==e?e:"";return{enable:!!t,key:t}}),[null==r?void 0:r.key]);return xC.createElement(zse.Provider,{value:n},t)};qse.propTypes={children:xw.node.isRequired,settings:xw.shape({key:xw.string})},qse.defaultProps={settings:{key:""}};var Hse,Kse,Wse,Qse,Gse,Xse,Yse,$se,Zse,Jse,ece,tce,rce,nce,oce=function(){return xC.useContext(zse)},ace=(dB.div(Hse||(Hse=Ky(["\n color: #ffffff;\n"]))),dB.div(Kse||(Kse=Ky(["\n ","\n"])),(function(e){var t=e.theme;return J5(t,"FlashLiveness.title.hidden",vae)?YE(["display:none;"]):YE(["display:flex;justify-content:center;align-items:center;width:100%;height:","};color:",";font-size:",";font-weight:",";"],J5(t,"FlashLiveness.title.height",vae),J5(t,"FlashLiveness.title.color",vae),J5(t,"FlashLiveness.title.fontSize",vae),J5(t,"FlashLiveness.title.fontWeight",vae))}))),ice=dB(Oae)(Wse||(Wse=Ky(["\n z-index: 2010;\n width: 100%;\n height: 100%;\n opacity: 1;\n margin: 0;\n"]))),sce=dB(Sae)(Qse||(Qse=Ky(["\n margin-block-start: 12px;\n z-index: ",";\n width: fit-content;\n\n & svg {\n margin-inline-end: 8px;\n width: 24px;\n height: 24px;\n }\n\n ","\n"])),r4+2,(function(e){var t=e.theme;return e.$flashing?YE(["transform:translateY(45vh);font-size:",";color:",";font-weight:",";background:rgba(0,0,0,0.35);border-radius:",";border:",";padding:",";"],J5(t,"FlashLiveness.guideline.text.flashing.fontSize",vae),J5(t,"FlashLiveness.guideline.text.flashing.color",vae),J5(t,"FlashLiveness.guideline.text.flashing.fontWeight",vae),J5(t,"FlashLiveness.guideline.text.flashing.borderRadius",vae),J5(t,"FlashLiveness.guideline.text.flashing.border",vae),J5(t,"FlashLiveness.guideline.text.flashing.padding",vae)):YE(["font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";padding:",";"],J5(t,"FlashLiveness.guideline.text.normal.fontSize",vae),J5(t,"FlashLiveness.guideline.text.normal.color",vae),J5(t,"FlashLiveness.guideline.text.normal.fontWeight",vae),J5(t,"FlashLiveness.guideline.text.normal.background",vae),J5(t,"FlashLiveness.guideline.text.normal.borderRadius",vae),J5(t,"FlashLiveness.guideline.text.normal.border",vae),J5(t,"FlashLiveness.guideline.text.normal.padding",vae))})),cce=dB(Oie)(Gse||(Gse=Ky(["\n ","\n"])),(function(e){var t=e.theme;return YE(["z-index:1001;cursor:pointer;position:fixed;top:",";right:",";left:",";bottom:",";display:",";"],J5(t,"closeButton.top",Z5),J5(t,"closeButton.right",Z5),J5(t,"closeButton.left",Z5),J5(t,"closeButton.bottom",Z5),J5(t,"closeButton.display",Z5))})),uce=dB.div(Xse||(Xse=Ky(["\n width: 100vw;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n background-color: ",";\n opacity: ",";\n z-index: ",";\n"])),(function(e){return e.$backgroundColor}),(function(e){return e.$intensity}),r4+1),lce=dB.div(Yse||(Yse=Ky(["\n background-color: ",";\n opacity: ",";\n width: 100vw;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n"])),(function(e){var t=e.theme;return J5(t,"FlashLiveness.errorOverlay.backgroundColor",vae)}),(function(e){var t=e.theme;return J5(t,"FlashLiveness.errorOverlay.opacity",vae)})),dce=dB(Cae)($se||($se=Ky(["\n margin-block-start: 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n width: 300px;\n z-index: 1002;\n"])),(function(e){var t=e.theme;return J5(t,"FlashLiveness.progressBar.mainColor",vae)}),(function(e){var t=e.theme;return J5(t,"FlashLiveness.progressBar.fontSize",vae)}),(function(e){var t=e.theme;return J5(t,"FlashLiveness.progressBar.fontWeight",vae)})),fce=dB.div(Zse||(Zse=Ky(["\n position: fixed;\n z-index: ",";\n top: 0;\n left: 50%;\n transform: translate(-50%);\n min-width: 250px;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n"])),r4+2),pce=dB.div(Jse||(Jse=Ky(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),hce=dB.div(ece||(ece=Ky(["\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n"]))),mce=v5.isMobile?{width:{ideal:640},whiteBalanceMode:"none"}:{width:{ideal:9999},whiteBalanceMode:"none"};function gce(e){var t=e.onReset,r=e.onFlashDone,n=e.apiCheck,o=e.onClose,a=e.onError,i=e.frontCamera,s=e.styledComponent,c=e.onFramesCaptured,u=Fse(),l=u.maskSettings,d=u.flashSettings,f=u.faceSettings,p=u.closeEyesSettings,h=u.livenessSettings,m=u.captureFrameSettings,g=u.exifSettings,v=u.imageSettings,y=u.timeoutSettings;if(l.smallScale>l.largeScale)throw new Error("smallScale must be smaller than largeScale");var b=Uie(),C=m.framesIntervalTime,w=xC.useRef(),k=_ie(),S=Bie(),E=xC.useContext(Woe),B=d.colorsLength,_=d.framesPerColor,x=d.delayBetweenColors,T=d.useFaceDetectorWhenFlashing,A=d.flashIntensity,I=d.flashColor,P=Nie(B),R=mB(),D=fae(C),N=xC.useRef(null),O=Wy(Uae(),4),L=O[0],M=O[1],F=O[2],U=O[3],j=Wy(xC.useState(0),2),V=j[0],z=j[1],q=Wy(xC.useState(Aoe.LOADING),2),H=q[0],K=q[1],W=Wy(xC.useState(""),2),Q=W[0],G=W[1],X=Wy(xC.useState(!1),2),Y=X[0],$=X[1],Z=xC.useRef({frames:[],images:[],total:Py({},Ioe.FAR_FACE,0)}),J=xC.useRef(!1),ee=oce(),te=jae({mode:lK.MODE.SELFIE,enableWriteExif:g.enable}),re=te.prepareExifData,ne=te.writeExifData,oe=te.addExifData,ae=Wy(xC.useState(!1),2),ie=ae[0],se=ae[1],ce=xC.useCallback((function(){G(S("move_face_into_frame"))}),[S]),ue=sae({onVideoPlayed:ce}),le=ue.onVideoPlayed,de=ue.cropArea,fe=ue.isPlaying,pe=Lae(l,Pae,{width:de.width,height:de.height}),he=pe.smallScale,me=pe.largeScale,ge=xC.useMemo((function(){return q4((function(e){var r=e.reason;Z.current.frames=[],Z.current.images=[],Z.current.total[Ioe.FAR_FACE]=0,Vie.resetUploadBatches(),h.enableFarStep&&(z(he),K(Aoe.FAR_FACE)),G(S("move_face_into_frame")),$(!1),J.current=!1,t({reason:r})}),200,{leading:!0})}),[z,he,S,h.enableFarStep,t]),ve=xC.useCallback((function(){se(!0)}),[]),ye=xC.useCallback((function(){se(!1),ge({reason:Ooe.timeout})}),[ge]),be=Mae({offset:l.ovalVerticalOffset,ovalPadding:l.ovalPadding,largeScale:me,maskHeight:de.height,ovalHeight:Pae.height}),Ce=xC.useCallback(xy(regeneratorRuntime.mark((function e(){var t,o,i,s,u,d,p,g,v,y,S,E,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(K(Aoe.STOP_DECTECTING),G(""),k("selfie_flash","user_activity.finish_flash"),k("selfie_flash","user_activity",(function(e){return{flash_liveness_in_ms:e.lastTimeLog-w.current}})),t=Z.current.frames,m.enable&&m.framesBatchLength>0&&0!==(o=t.length%m.framesBatchLength)&&(i=t.slice(-1*o),"function"==typeof c&&c(i),n&&Vie.uploadFrameBatch(Use(i),b)),s=Lie(t),!h.enableFarStep){e.next=12;break}return Z.current.images[Noe].frames=Z.current.total[Ioe.FAR_FACE],e.next=11,Z.current.images[Noe].blob;case 11:Z.current.images[Noe].blob=e.sent;case 12:return Z.current.images[Doe].frames=s[Ioe.CLOSE_FACE],e.next=15,Z.current.images[Doe].blob;case 15:return Z.current.images[Doe].blob=e.sent,re(),oe("selfie_type",uL.Mode.FLASH),oe("flash_liveness_in_ms",performance.now()-w.current),oe("far_batches",Z.current.total[Ioe.FAR_FACE]),oe("close_batches",s[Ioe.CLOSE_FACE]),oe("flash_batches",s[Ioe.FLASHING]),oe("colors",P),oe("flash_color",I),oe("frames_per_color",_),oe("frame_interval",C),oe("delay_between_colors",x),oe("use_face_detector_when_flashing",T),oe("face_settings",Vse(f)),oe("mask_settings",Vse(l)),e.next=32,Promise.all([ne({imageData:Z.current.images[Noe]}),ne({imageData:Z.current.images[Doe]})]);case 32:if(u=e.sent,d=Wy(u,2),p=d[0],g=d[1],h.enableFarStep&&(Z.current.images[Noe].blob=p),Z.current.images[Doe].blob=g,!ee.enable){e.next=54;break}if(!h.enableFarStep){e.next=50;break}return e.next=42,Promise.all([Kq.encrypt({blob:Z.current.images[Noe].blob,key:ee.key}),Kq.encrypt({blob:Z.current.images[Doe].blob,key:ee.key})]);case 42:v=e.sent,y=Wy(v,2),S=y[0],E=y[1],Z.current.images[Noe].encrypted=S,Z.current.images[Doe].encrypted=E,e.next=54;break;case 50:return e.next=52,Kq.encrypt({blob:Z.current.images[Doe].blob,key:ee.key});case 52:B=e.sent,Z.current.images[Doe].encrypted=B;case 54:if(Z.current.images=Z.current.images.filter((function(e){return!!e})),e.prev=55,"function"!=typeof r){e.next=59;break}return e.next=59,r({images:Z.current.images,frames:Z.current.frames},{colors:P,flashColor:I});case 59:e.next=64;break;case 61:e.prev=61,e.t0=e.catch(55),a({error:e.t0});case 64:case"end":return e.stop()}}),e,null,[[55,61]])}))),[k,m.enable,m.framesBatchLength,h.enableFarStep,re,oe,P,I,_,C,x,T,f,l,ne,ee.enable,ee.key,c,n,b,r,a]),we=aae({colors:P,onFlashDone:Ce,framesPerColor:_,flashColor:I}),ke=we.flashingColors,Se=we.currentColor,Ee=we.colorIndex,Be=we.startFlashing,_e=we.goToNextColor,xe=xC.useCallback((function(){h.enableFarStep&&0===Z.current.total[Ioe.FAR_FACE]&&(J.current=!0,$(!0)),Z.current.total[Ioe.FAR_FACE]+=1}),[h.enableFarStep]),Te=xC.useMemo((function(){var e,t,r,n,o=null!==(e=null==M?void 0:M.left)&&void 0!==e?e:0,a=null!==(t=null==M?void 0:M.top)&&void 0!==t?t:0,i=null!==(r=null==M?void 0:M.right)&&void 0!==r?r:de.width,s=null!==(n=null==M?void 0:M.bottom)&&void 0!==n?n:de.height;return{x:Math.max(o-l.ovalPadding.left,0),y:Math.max(a-l.ovalPadding.top,0),width:Math.min(i-o+l.ovalPadding.left+l.ovalPadding.right,de.width),height:Math.min(s-a+l.ovalPadding.top+l.ovalPadding.bottom,de.height)}}),[de.height,de.width,l.ovalPadding.bottom,l.ovalPadding.left,l.ovalPadding.right,l.ovalPadding.top,null==M?void 0:M.bottom,null==M?void 0:M.left,null==M?void 0:M.right,null==M?void 0:M.top]),Ae=xC.useCallback((function(e){var t=e.faceRatio;if(!Z.current.images[Noe]){var r=jse({maskBoundingBox:Te,faceRatio:t,validFaceRatio:v.validFaceRatio,video:N.current,shouldCropCenterSquare:v.enableCropCenterFar,cropArea:de});Z.current.images[Noe]={blob:xV.takePicture({canvas:r,quality:v.imageQuality}),gesture:"frontal",capture_time:Date.now(),step:Ioe.FAR_FACE,metadata:JSON.stringify({label:Ioe.FAR_FACE})}}z(me),U(!0),K(Aoe.CLOSE_FACE),G(S("move_face_closer"))}),[me,U,S,Te,v.validFaceRatio,v.enableCropCenterFar,v.imageQuality,de]),Ie=xC.useCallback((function(e){var t=e.faceRatio;if(!Z.current.images[Doe]){var r=jse({maskBoundingBox:Te,faceRatio:t,validFaceRatio:v.validFaceRatio,video:N.current,shouldCropCenterSquare:v.enableCropCenterClose,cropArea:de});Z.current.images[Doe]={blob:xV.takePicture({canvas:r,quality:v.imageQuality}),gesture:"frontal",capture_time:Date.now(),step:Ioe.CLOSE_FACE,metadata:JSON.stringify({label:Ioe.CLOSE_FACE})}}iL.unstable_batchedUpdates((function(){$(!1),K(Aoe.START_FLASHING),Be()}))}),[Te,v.validFaceRatio,v.enableCropCenterClose,v.imageQuality,de,Be]),Pe=Ee!==oae&&H===Aoe.START_FLASHING,Re=xC.useCallback((function(e){var t=e.prediction,r=e.canvas,o=e.landmarks;if(Pe){var a=Z.current.frames,i=cae({prediction:t,canvas:r,landmarks:o,index:a.length,quality:m.frameQuality});if(i.metadata={color:Se,type:Ioe.FLASHING},a.push(i),m.enable&&m.framesBatchLength>0&&a.length%m.framesBatchLength==0){var s=a.slice(-1*m.framesBatchLength);"function"==typeof c&&c(s),n&&Vie.uploadFrameBatch(Use(s),b)}_e()}}),[n,b,m.enable,m.frameQuality,m.framesBatchLength,Se,_e,Pe,c]),De=xC.useCallback((function(e){var t=e.error;"no_face"!==t&&"multiple_faces"!==t||"no_face"===t&&J.current&&ge({reason:Ooe.no_face})}),[ge]),Ne=xC.useCallback((function(e){var t=e.prediction,r=e.canvas,o=e.landmarks,a=Z.current.frames;h.enableFarStep||0!==a.length||(J.current=!0,$(!0));var i=cae({prediction:t,canvas:r,landmarks:o,index:a.length,quality:m.frameQuality});if(i.metadata={color:"",type:Ioe.CLOSE_FACE},a.push(i),m.enable&&m.framesBatchLength>0&&a.length%m.framesBatchLength==0){var s=a.slice(-1*m.framesBatchLength);"function"==typeof c&&c(s),n&&Vie.uploadFrameBatch(Use(s),b)}}),[n,b,m.enable,m.frameQuality,m.framesBatchLength,h.enableFarStep,c]),Oe=xC.useMemo((function(){return Ee===oae?D:Ee%_==0?0===Ee||ke[Ee-1]===ke[Ee]?D:Math.max(x,D):D}),[Ee,x,ke,D,_]),Le=rae({onError:a,isVideoPlaying:fe,step:H,cropArea:de,videoRef:N,onFarFaceDetected:xe,onFarFullFaceDetected:Ae,onCloseFaceDetected:Ne,onCloseFullFaceDetected:Ie,onFlashingFramesCaptured:Re,frameInterval:Oe,useFaceDetectorWhenFlashing:T,onFaceError:De,faceSettings:f,ovalBoundingRect:M,shouldPauseFaceDetection:F||ie,maskSettings:l,closeEyesSettings:p,captureFrameSettings:m}),Me=Le.faceError,Fe=Le.warmupDone;Fae(N.current);xie((function(){h.enableFarStep?(K(Aoe.FAR_FACE),z(he)):(K(Aoe.CLOSE_FACE),z(me)),w.current||(w.current=performance.now())}),Fe&&fe),xie((function(){return k("selfie_flash","user_activity.start")}),!0),xie((function(){return k("selfie_flash","user_activity.start_far")}),H===Aoe.FAR_FACE),xie((function(){return k("selfie_flash","user_activity.start_close")}),H===Aoe.CLOSE_FACE),xie((function(){return k("selfie_flash","user_activity.start_flash")}),H===Aoe.START_FLASHING);var Ue=Ee===oae?0:Math.min(Math.round((Ee+1)/(P.length*_)*100),100),je=s.CloseCameraButton,Ve=s.Loading;return xC.createElement(xC.Fragment,null,xC.createElement(m4,{frontCamera:i,onVideoPlayed:le,onClose:o,flipHorizontal:i,ref:N,onError:a,videoSettings:mce,closeButton:null!=je?je:xC.createElement(cce,null)},xC.createElement(Iae,{overlay:!Fe||!fe,loadingComponent:Ve},""!==Me&&xC.createElement(lce,null),xC.createElement(k4,{x:"".concat(Math.round(de.x),"px"),y:"".concat(Math.round(de.y),"px"),width:"".concat(de.width,"px"),height:"".concat(de.height,"px"),surroundStyle:{background:J5(R,"FlashLiveness.maskFill",vae)}},xC.createElement(ice,{ref:L,scale:V,debug:E,width:de.width,height:de.height,padding:l.ovalPadding,verticalOffset:be,ovalMaskFillColor:J5(R,"FlashLiveness.maskFill",vae)}),xC.createElement(hce,null,""!==Me&&H!==Aoe.FLASHING&&xC.createElement(_ae,null,S(Me)))))),xC.createElement(fce,null,xC.createElement(pce,null,Fe&&fe&&H!==Aoe.START_FLASHING&&xC.createElement(ace,null,S("face_authentication")),H!==Aoe.LOADING&&Q&&xC.createElement(sce,{$flashing:H===Aoe.START_FLASHING},H===Aoe.START_FLASHING?S("hold_still"):xC.createElement(xC.Fragment,null,xC.createElement(pae,{iconColor:J5(R,"FlashLiveness.guideline.icon.color",vae)})," ",Q)),H===Aoe.START_FLASHING&&xC.createElement(dce,{value:Ue,max:100})),xC.createElement(Rie,{onTimeout:ve,onWarningMessageTimeout:ye,timeout:y.total,shouldStart:y.enable&&Y,shouldStop:y.enable&&!Y,timeLeftThreshold:y.countdown})),H===Aoe.START_FLASHING&&xC.createElement(uce,{$backgroundColor:Se,$intensity:A}))}var vce=dB.div(tce||(tce=Ky(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n\n z-index: 1001;\n"]))),yce=dB.div(rce||(rce=Ky(["\n & > img {\n width: 100%;\n }\n\n ","\n"])),zte),bce=dB.p(nce||(nce=Ky(["\n color: #1d1d1d;\n font-size: 20px;\n"]))),Cce=function(e){var t=e.loading,r=Jj.useAsset("loader.jpg"),n=Bie();return t?xC.createElement(vce,null,xC.createElement(yce,null,xC.createElement("img",{src:r,className:"spin",alt:"loading-icon"})),xC.createElement(bce,null,n("processing_result"))):null};function wce(e){var t=e.outputEncryptionSettings,r=Uie();return{verifyFlashLiveness:xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var o,a,i,s,c,u,l,d,f,p,h,m,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.videos,a=n.images,i=n.enableFarStep,s=n.metadata,e.prev=1,c=a.filter((function(e){return!!e})),e.next=5,Promise.all(c.map((function(e){var n;return t.enable?r.httpClient.post("/v1/images",{label:"portrait",metadata:e.metadata,base64:null===(n=e.encrypted)||void 0===n?void 0:n.hex},{"X-TV-Key":t.key}):r.uploadImage({label:"portrait",metadata:e.metadata,file:e.blob})})));case 5:return u=e.sent,l=[r.verifyFaceLiveness({images:u.map((function(e){var t;return{id:null==e||null===(t=e.data)||void 0===t?void 0:t.image_id,label:"portrait"}})),videos:o,metadata:s,selfie_type:uL.Mode.FLASH})],i&&l.push(r.requestVerifyPortrait({image:{id:null===(d=u[Noe])||void 0===d||null===(f=d.data)||void 0===f?void 0:f.image_id},selfie_type:uL.Mode.FLASH})),e.next=10,Promise.all(l);case 10:return p=e.sent,h=Wy(p,2),m=h[0],g=h[1],e.abrupt("return",{uploadedImages:u,faceLivenessResult:m,portraitResult:g});case 17:return e.prev=17,e.t0=e.catch(1),console.error(e.t0),e.abrupt("return",{});case 21:case"end":return e.stop()}}),e,null,[[1,17]])})));return function(t){return e.apply(this,arguments)}}(),[r,t.enable,t.key])}}Cce.propTypes={loading:xw.bool},Cce.defaultProps={loading:!1};var kce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Array.isArray(e)?e.map((function(e,r){var n,o,a;return{name:e.step,image:{blob:e.blob,id:null!==(n=null===(o=t[r])||void 0===o||null===(a=o.data)||void 0===a?void 0:a.image_id)&&void 0!==n?n:null,metadata:e.metadata,encrypted:e.encrypted}}})):[]},Sce=["apiCheck","onLivenessDetectionDone"],Ece=function(e){var t=e.apiCheck,r=e.onLivenessDetectionDone,n=Vy(e,Sce),o=Wy(xC.useState(!1),2),a=o[0],i=o[1],s=wce({outputEncryptionSettings:oce()}).verifyFlashLiveness,c=Fse(),u=c.captureFrameSettings,l=c.flashSettings,d=c.livenessSettings,f=u.framesIntervalTime,p=d.enableFarStep,h=e.onError,m=function(){var e=xy(regeneratorRuntime.mark((function e(n,o){var a,c,d,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a={flash_color:o.flashColor,colors:o.colors,frames_per_color:l.framesPerColor,frame_interval:f,delay_between_colors:l.delayBetweenColors,use_face_detector_when_flashing:l.useFaceDetectorWhenFlashing},t){e.next=5;break}return e.next=4,r({capturedFrames:n.frames,steps:kce(n.images),metadata:a});case 4:return e.abrupt("return");case 5:if(e.prev=5,i(!0),d=null,!u.enable){e.next=14;break}return e.next=11,Vie.getAllUploadedBatches();case 11:d=e.sent,e.next=15;break;case 14:d=[{frames:Use(n.frames)}];case 15:return e.next=17,s({videos:d,images:n.images,enableFarStep:p,metadata:a});case 17:if(m=e.sent,g=m.uploadedImages,v=m.faceLivenessResult,y=m.portraitResult,Vie.resetUploadBatches(),i(!1),!v.errors){e.next=25;break}throw v.errors;case 25:if(null==y||!y.errors){e.next=27;break}throw y.errors;case 27:return e.next=29,r({capturedFrames:n.frames,steps:kce(n.images,g),apiCheckPassed:v.data.is_live,verifyFaceLivenessResult:v.data,verifyPortraitResult:null!==(c=null==y?void 0:y.data)&&void 0!==c?c:null});case 29:e.next=36;break;case 31:e.prev=31,e.t0=e.catch(5),console.error(e.t0),i(!1),h({error:e.t0});case 36:case"end":return e.stop()}}),e,null,[[5,31]])})));return function(t,r){return e.apply(this,arguments)}}();return xC.createElement(xC.Fragment,null,xC.createElement(gce,Ry({},n,{apiCheck:t,onFlashDone:m})),t&&xC.createElement(Cce,{loading:a}))},Bce=function(e){var t=e.value,r=e.children,n=Lse(),o=g5(n,"data.settings.sdk_settings.server_log_settings.enable"),a=null!=o?o:null==t?void 0:t.enable;return xC.createElement(Yj.SDKTrackingProvider,{value:{tracking:Ny(Ny({},t),{},{enable:a})}},r)};Bce.propTypes={value:xw.shape({enable:xw.bool,accessKey:xw.string,secretKey:xw.string,apiUrl:xw.string}).isRequired,children:xw.node.isRequired};var _ce=function(e){var t=e.apiCheck,r=e.debug,n=e.clientSettings,o=e.apiCredentials,a=e.logCredentials,i=e.customTheme,s=e.outputEncryptionSettings;return xC.createElement(Qoe,{debug:r},xC.createElement(Fie,{apiCredentials:o},xC.createElement(Ose,{apiCheck:t,clientSettings:n},xC.createElement(Toe,null,xC.createElement(cB,{theme:i},xC.createElement(Sie,null,xC.createElement(Bce,{value:Ny({enable:!0},a)},xC.createElement(qse,{settings:s},xC.createElement(Ece,e)))))))))};_ce.propTypes={apiCheck:xw.bool,apiCredentials:xw.shape({accessKey:xw.string,secretKey:xw.string,apiUrl:xw.string}),onReset:xw.func,onLivenessDetectionDone:xw.func,onClose:xw.func,onError:xw.func,onFramesCaptured:xw.func,frontCamera:xw.bool,styledComponent:xw.shape({CloseCameraButton:xw.node}),clientSettings:xw.shape({}),logCredentials:xw.shape({accessKey:xw.string,secretKey:xw.string,apiUrl:xw.string,userId:xw.string,logSignature:xw.shape({logUrl:xw.string,timestamp:xw.string,signature:xw.string})}),debug:xw.bool,customTheme:xw.shape({}),outputEncryptionSettings:xw.shape({key:xw.string})},_ce.defaultProps={apiCheck:!1,apiCredentials:{},onReset:function(){},onLivenessDetectionDone:function(){},onClose:function(){},onError:function(){},onFramesCaptured:function(){},frontCamera:!0,styledComponent:{CloseCameraButton:null},clientSettings:{},logCredentials:{},debug:!1,customTheme:{},outputEncryptionSettings:{key:""}};var xce,Tce,Ace,Ice=["logCredentials","clientSettings","livenessSettings","livenessComponent","customTheme"];function Pce(e){var t=e.logCredentials,r=void 0===t?{enable:!0}:t,n=e.clientSettings,o=e.livenessSettings,a=e.livenessComponent,i=void 0===a?Mne:a,s=e.customTheme,c=void 0===s?{}:s,u=Vy(e,Ice);switch(u.mode){case uL.Mode.FLASH:return xC.createElement(_ce,Ry({},u,{customTheme:c,clientSettings:n,logCredentials:r}));default:var l=g5(n,"data.settings.sdk_settings",{});return xC.createElement(Toe,null,xC.createElement(cB,{theme:c},xC.createElement(Yj.SDKTrackingProvider,{value:{tracking:Ny({},r)}},xC.createElement(i,Ry({},u,{livenessSettings:Ny(Ny(Ny({},o),null==l?void 0:l.active_liveness_settings),null==l?void 0:l.liveness_settings)})))))}}var Rce=uL.IDCardMessage,Dce=dB.div(xce||(xce=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n ","\n"])),(function(e){var t=e.theme;return YE(["border-radius:",";padding:",";"],J5(t,"popup.borderRadius",Z5),J5(t,"IDCapturing.timeoutPopup.padding",Kte))})),Nce=dB.div(Tce||(Tce=Ky(["\n ","\n"])),(function(e){var t=e.theme;return YE(["color:",";font-size:",";font-weight:",";text-align:",";border:",";border-radius:",";"],J5(t,"IDCapturing.timeoutPopup.text.color",Kte),J5(t,"IDCapturing.timeoutPopup.text.fontSize",Kte),J5(t,"IDCapturing.timeoutPopup.text.fontWeight",Kte),J5(t,"IDCapturing.timeoutPopup.text.textAlign",Kte),J5(t,"IDCapturing.timeoutPopup.text.border",Kte),J5(t,"IDCapturing.timeoutPopup.text.borderRadius",Kte))})),Oce=dB.button(Ace||(Ace=Ky(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: ",";\n cursor: pointer;\n ","\n"])),(function(e){var t=e.theme;return J5(t,"IDCapturing.timeoutPopup.button.height",Kte)}),(function(e){var t=e.theme;return YE(["color:",";font-size:",";font-weight:",";background-color:",";border:",";border-radius:",";outline:",";"],J5(t,"IDCapturing.timeoutPopup.button.color",Kte),J5(t,"IDCapturing.timeoutPopup.button.fontSize",Kte),J5(t,"IDCapturing.timeoutPopup.button.fontWeight",Kte),J5(t,"IDCapturing.timeoutPopup.button.backgroundColor",Kte),J5(t,"IDCapturing.timeoutPopup.button.border",Kte),J5(t,"IDCapturing.timeoutPopup.button.borderRadius",Kte),J5(t,"IDCapturing.timeoutPopup.button.outline",Kte))})),Lce=function(e){var t=e.onOk,r=e.maxSessionTime,n=yj.useSDKSettings().lang;return xC.createElement(Dce,null,xC.createElement(Nce,{className:"popup-message"},e7(Rce.TIMEOUT_INSTRUCTION[n])({x:r})),xC.createElement(Oce,{className:"popup-button",onClick:t},Gte.BTN_OK[n]))};Lce.propTypes={onOk:xw.func,maxSessionTime:xw.number},Lce.defaultProps={onOk:function(){},maxSessionTime:30};var Mce=function(){var e=Wy(xC.useState(!1),2),t=e[0],r=e[1],n=Wy(xC.useState(null),2),o=n[0],a=n[1],i=Wy(xC.useState({}),2),s=i[0],c=i[1];return{showPopup:xC.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),a(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},Fce={SESSION_TIMEOUT:"SESSION_TIMEOUT",CONFIRM:"CONFIRM",QR_INVALID:"QR_INVALID",QR_INSTRUCTIONS:"QR_INSTRUCTIONS"};function Uce(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}var jce=Uce;function Vce(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=F4(r))==r?r:0),void 0!==t&&(t=(t=F4(t))==t?t:0),jce(F4(e),t,r)}var zce=Vce,qce="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function Hce(){return Kce.apply(this,arguments)}function Kce(){return(Kce=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?qce: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 Wce=g7(Hce),Qce={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},Gce={vn:.4,ph:.5},Xce={0:"top-left",1:"top-right",2:"bottom-right",3:"bottom-left",4:"cccd.front",5:"passport",6:"cmnd_old.front",7:"cmnd_old.back",8:"cmnd_new.front",9:"cmnd_new.back",10:"cccd_new.front",11:"cccd_new.back",12:"aadhaar_front",13:"aadhaar_back",14:"voter_front",15:"voter_back",16:"pan",17:"dl",18:"india_spassport",19:"aadhaar_letter",20:"pan_back",21:"passport_back",22:"unseen",23:"other",24:"BUREAU OF INTERNAL REVENUE",25:"COMMISSION ON ELECTIONS",26:"COVID VACCINATION CARD",27:"DRIVERS LICENSE",28:"HEALTH INSURANCE PHILHEALTH",29:"PAG-IBIG LOYALTY CARD",30:"PASSPORT",31:"PHILIPPINE IDENTIFICATION CARD",32:"POSTAL IDENTITY CARD",33:"PROFESSIONAL IDENTIFICATION CARD",34:"RESIDENT IDENTIFICATION CARD",35:"SOCIAL SECURITY SYSTEM",36:"UNIFIED MULTI PURPOSE ID",37:"VN_biz_license",38:"new_voter_front"};function Yce(e){var t,r,n,o,a,i=e.card,s=e.corners,c=i.box,u={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},l=c[2]-c[0],d=c[1]-c[3],f=nb(s);try{for(f.s();!(a=f.n()).done;){var p=a.value;switch(p.label){case"top-left":t||(t=p.location);break;case"top-right":r||(r=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":o||(o=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![t,r,n,o].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(t.x+n.x)/2,y:(t.y+n.y)/2},m={x:(r.x+o.x)/2,y:(r.y+o.y)/2},g=Zte(u,h),v=Zte(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 $ce=function(){function e(t){Ty(this,e),this.country=t||"vn",this.defaultModelUrl=Qce[this.country]||Qce.vn}var t,r,n,o,a,i,s;return Iy(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([Wce({url:r}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"predictDummyInput",value:(i=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 i.apply(this,arguments)})},{key:"loadModel",value:(a=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,Vq.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,a=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),i=Wy(a,3),this.out_score_name=i[0],this.out_class_name=i[1],this.out_box_name=i[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"loadResource",value:(o=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?this.defaultModelUrl:r,e.next=3,Vq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),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,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E,B,_,x,T,A,I,P,R=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=R.length>1&&void 0!==R[1]?R[1]:{},n=r.imgMargin,o=r.detectThreshold,a=void 0===o?.3:o,i=r.maxNumReturns,s=void 0===i?100:i,c=window,u=c.cv,l={},d=t.width,f=t.height,l.originalWidth=d,l.originalHeight=f,p=ere({canvas:t,imgMargin:"number"==typeof n?n:Gce[this.country]}),h=p.margin,m=p.mat,g=this.inputShape.slice(1,3),v=Wy(g,2),y=v[0],b=v[1],C=new u.Mat,u.resize(m,C,new u.Size(y,b),0,0,u.INTER_AREA),w=m.cols/y,k=m.rows/b,(S=document.createElement("canvas")).width=y,S.height=b,S.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(C.data),C.cols,C.rows),0,0),m.delete(),C.delete(),l.canvas=S,l.margin=h,E=performance.now(),e.next=25,this.detect(S,{detectThreshold:a,maxNumReturns:s});case 25:if(B=e.sent,_=Math.floor(performance.now()-E),x={inputImage:l,card:null,exeTime:_},T=[[],[],[],[]],A=[],I=[],B.forEach((function(e){var t=Wy(e.box,4),r=t[0],n=t[1],o=t[2],a=t[3];e.clazz<=3?T[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:zce(Math.floor((a+n)/2*w-h),0,d),y:zce(Math.floor((r+o)/2*k-h),0,f)},scaledLocation:{x:zce(Math.floor((a+n)/2),0,S.width),y:zce(Math.floor((r+o)/2),0,S.height)}}):I.push({label:e.label,score:e.score,box:[zce(Math.floor(r*k-h),0,f),zce(Math.floor(n*w-h),0,d),zce(Math.floor(o*k-h),0,f),zce(Math.floor(a*w-h),0,d)]})})),T.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),A.push(e[0]))})),!(I.length>0&&4===A.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),A.sort((function(e,t){return e.clazz-t.clazz})),P=I[0],e.prev=37,Yce({card:P,corners:A})){e.next=41;break}return console.debug("Not qualified.",P,A),e.abrupt("return",x);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",x);case 46:return P.corners=A,x.card=P,e.abrupt("return",x);case 49:return e.abrupt("return",x);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return r.apply(this,arguments)})},{key:"detect",value:(t=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E,B=this,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.length>1&&void 0!==_[1]?_[1]:{},n=r.detectThreshold,o=r.maxNumReturns,a=window,i=a.tf,s=t.width,c=t.height,u=i.tidy((function(){var e=i.expandDims(i.cast(i.image.resizeBilinear(i.browser.fromPixels(t),B.inputShape.slice(1,3)),"float32"));return B.model.predict(e)})),e.next=7,Promise.all([u[this.out_score_name].data(),u[this.out_class_name].data(),u[this.out_box_name].array()]);case 7:l=e.sent,d=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],C=p[y],b>n&&(k=null!==(w=Xce[Math.round(C)])&&void 0!==w?w:"NA",S=m[y],E=[S[0]*c,S[3]*s,S[2]*c,S[1]*s],v.push({score:b,clazz:C,box:E,label:k}))}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 Zce{static hasCamera(){return Zce.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=Zce.DEFAULT_CANVAS_SIZE,this._preferredCamera=o,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof r?(this._legacyCanvasSize=r,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=r,"number"==typeof n?(this._legacyCanvasSize=n,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=n,this._scanRegion=this._calculateScanRegion(e),this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let a=!1;e.hidden&&(e.hidden=!1,a=!0),document.body.contains(e)||(document.body.appendChild(e),a=!0),requestAnimationFrame((()=>{const t=window.getComputedStyle(e);"none"===t.display&&(e.style.setProperty("display","block","important"),a=!0),"visible"!==t.visibility&&(e.style.setProperty("visibility","visible","important"),a=!0),a&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity=0,e.style.width=0,e.style.height=0)})),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),this._qrEnginePromise=Zce.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(),Zce._postWorkerMessage(this._qrEnginePromise,"close")}start(){return this._active&&!this._paused?Promise.resolve():("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,document.hidden?Promise.resolve():(this._paused=!1,this.$video.srcObject?(this.$video.play(),Promise.resolve()):this._getCameraStream().then((({stream:e,facingMode:t})=>{this.$video.srcObject=e,this.$video.play(),this._setVideoMirror(t),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch((()=>{})))})).catch((e=>{throw this._active=!1,e}))))}stop(){this.pause(),this._active=!1}pause(e=!1){if(this._paused=!0,!this._active)return Promise.resolve(!0);this.$video.pause();const t=()=>{const e=this.$video.srcObject?this.$video.srcObject.getTracks():[];for(const t of e)t.stop(),this.$video.srcObject.removeTrack(t);this.$video.srcObject=null};return e?(t(),Promise.resolve(!0)):new Promise((e=>setTimeout(e,300))).then((()=>!!this._paused&&(t(),!0)))}setCamera(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}static scanImage(e,t=null,r=null,n=null,o=!1,a=!1){const i=r instanceof Worker;let s=Promise.all([r||Zce.createQrEngine(),Zce._loadImage(e)]).then((([e,a])=>{let s;return r=e,[n,s]=this._drawToCanvas(a,t,n,o),r instanceof Worker?(i||r.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,t)=>{let o,a,i;a=n=>{"qrResult"===n.data.type&&(r.removeEventListener("message",a),r.removeEventListener("error",i),clearTimeout(o),null!==n.data.data?e(n.data.data):t(Zce.NO_QR_CODE_FOUND))},i=e=>{r.removeEventListener("message",a),r.removeEventListener("error",i),clearTimeout(o);const n=e?e.message||e:"Unknown Error";t("Scanner error: "+n)},r.addEventListener("message",a),r.addEventListener("error",i),o=setTimeout((()=>i("timeout")),1e4);const c=s.getImageData(0,0,n.width,n.height);r.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise(((e,t)=>{const o=setTimeout((()=>t("Scanner error: timeout")),1e4);r.detect(n).then((r=>{r.length?e(r[0].rawValue):t(Zce.NO_QR_CODE_FOUND)})).catch((e=>t("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(o)))}))}));return t&&a&&(s=s.catch((()=>Zce.scanImage(e,null,r,n,o)))),s=s.finally((()=>{i||Zce._postWorkerMessage(r,"close")})),s}setGrayscaleWeights(e,t,r,n=!0){Zce._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:t,blue:r,useIntegerApproximation:n})}setInversionMode(e){Zce._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=Zce.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=>Zce.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=Zce.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==Zce.NO_QR_CODE_FOUND&&console.log(e)}_getCameraStream(){if(!navigator.mediaDevices)return Promise.reject("Camera not found.");const e="environment"===this._preferredCamera||"user"===this._preferredCamera?"facingMode":"deviceId",t=[{width:{min:1024}},{width:{min:768}},{}];return[...t.map((t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}}))),...t].reduceRight(((e,t)=>()=>navigator.mediaDevices.getUserMedia({video:t,audio:!1}).then((e=>({stream:e,facingMode:this._getFacingMode(e)||(t.facingMode?this._preferredCamera:"environment"===this._preferredCamera?"user":"environment")}))).catch(e)),(()=>Promise.reject("Camera not found.")))()}_restartVideoStream(){const e=this._paused;return this.pause(!0).then((t=>{if(t&&!e&&this._active)return this.start()}))}_setVideoMirror(e){const t="user"===e?-1:1;this.$video.style.transform="scaleX("+t+")"}_getFacingMode(e){const t=e.getVideoTracks()[0];return t?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}static _drawToCanvas(e,t=null,r=null,n=!1){r=r||document.createElement("canvas");const o=t&&t.x?t.x:0,a=t&&t.y?t.y:0,i=t&&t.width?t.width:e.width||e.videoWidth,s=t&&t.height?t.height:e.height||e.videoHeight;if(!n){const e=t&&t.downScaledWidth?t.downScaledWidth:i,n=t&&t.downScaledHeight?t.downScaledHeight:s;r.width!==e&&(r.width=e),r.height!==n&&(r.height=n)}const c=r.getContext("2d",{alpha:!1});return c.imageSmoothingEnabled=!1,c.drawImage(e,o,a,i,s,0,0,r.width,r.height),[r,c]}static _loadImage(e){if(e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||window.ImageBitmap&&e instanceof window.ImageBitmap||window.OffscreenCanvas&&e instanceof window.OffscreenCanvas)return Promise.resolve(e);if(e instanceof Image)return Zce._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,Zce._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 Jce(){return eue.apply(this,arguments)}function eue(){return(eue=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Zce.WORKER_PATH=mK(),e.next=3,Zce.createQrEngine(Zce.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 tue(){return rue.apply(this,arguments)}function rue(){return(rue=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([Jce()]);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)}Zce.DEFAULT_CANVAS_SIZE=400,Zce.NO_QR_CODE_FOUND="No QR code found",Zce.WORKER_PATH="qr-scanner-worker.min.js";var nue="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function oue(){return aue.apply(this,arguments)}function aue(){return(aue=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=xy(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="detect.prototxt",r="detect.caffemodel",n="sr.prototxt",i="sr.caffemodel",o){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return u=[a(t),a(r),a(n),a(i)],e.next=11,Promise.all(u);case 11:l=e.sent,d=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)},i=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?nue:r,a=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,i();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",tue());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var iue=g7(oue),sue=900;function cue(e){return uue.apply(this,arguments)}function uue(){return(uue=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,sue),r.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lue(e){return due.apply(this,arguments)}function due(){return(due=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,n=!0,e.prev=2,o=performance.now(),e.next=6,cue({idCardModel:r});case 6:(a=performance.now())-o+.6*(a-o)>sue&&(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 fue(){return pue.apply(this,arguments)}function pue(){return(pue=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,a=t.tfScriptUrls,i=t.wechatQRModelsUrl,s=h.length>1?h[1]:void 0,e.next=4,w7({blazefaceModelUrl:o,tfScriptUrls:a});case 4:return c=e.sent,u=c.blazefaceModel,l=!0,d=new $ce(s),e.prev=8,e.next=11,d.load({opencvUrl:r,modelUrl:n});case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(8),e.abrupt("return",{ableToUseModel:!1});case 16:return e.next=18,iue({modelUrl:i});case 18:return e.prev=18,e.next=21,lue({idCardModel:d});case 21:f=e.sent,p=f.fastEnough,l=p,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),l=!1;case 29:return e.abrupt("return",{ableToUseModel:l,idCardModel:d,blazefaceModel:u});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var hue=g7(fue),mue=uL.Errors,gue=function(){return{imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}},vue=function(){return{imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}};function yue(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.allowedCardTypes,i=e.onError,s=e.frontSide,c=e.onAutoCaptureSuccess,u=e.quality,l=xC.useRef(null);null===l.current&&(l.current=document.createElement("canvas"));var d=xC.useRef(0),f=xC.useRef([]),p=xC.useRef(null);null===p.current&&(p.current=document.createElement("canvas"));var h=xC.useRef({}),m=xC.useRef([]),g=xC.useRef(""),v=xC.useRef(!1),y=xC.useRef(!1),b=xC.useRef(!1),C=xC.useRef(null),w=Wy(xC.useState(!1),2),k=w[0],S=w[1],E=xC.useRef(gue()),B=xC.useRef(vue()),_=xC.useRef(!1),x=xC.useRef(!1),T=xC.useRef(null),A=xC.useRef(!1),I=xC.useRef({}),P=yj.useSDKSettings(),R=P.customUrls,D=P.country,N=xC.useMemo((function(){return a.length>0?a:null==o?void 0:o.allowedCardTypesFromSettings}),[a,null==o?void 0:o.allowedCardTypesFromSettings]);xC.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||k){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,hue(R,D);case 4:return I.current=t.sent,t.next=7,Vq.initTensorFlow();case 7:T.current=o.enableBlurCheck&&I.current.ableToUseModel,t.next=11;break;case 10:T.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:S(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[k,o,R,D]);var O=xC.useCallback((function(e){return qre({currentWorkingCanvas:e,refVirtualWorkingCanvas:p,refCountVirtualFrames:d,refVirtualFrames:f,refWorkingCanvas:l,refCardResult:h})}),[]),L=xC.useCallback((function(){!0===b.current&&(b.current=!1)}),[]),M=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,a=o.blurThreshold,i=E.current,s=B.current,v.current=!1,!(r<a&&BV.hasBetterCardBlurScore(r,i.blurScore))){e.next=18;break}if(!A.current){e.next=10;break}i.imageBlob=s.imageBlob,e.next=14;break;case 10:return e.next=12,xV.takePicture({canvas:l.current,quality:u});case 12:i.imageBlob=e.sent,i.captureTime=Date.now();case 14:i.takenAt=(new Date).getTime(),i.blurScore=r,i.detectedCard=n,i.captureType="auto";case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,u]),F=xC.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,x.current=!0,o=B.current,!BV.hasBetterCardBlurScore(r,o.blurScore)){e.next=14;break}return e.next=6,xV.takePicture({canvas:l.current,quality:u});case 6:o.imageBlob=e.sent,o.captureDuration+=Date.now()-o.captureTime,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,o.captureCount++,o.captureType="manual",A.current=!0;case 14:x.current=!1;case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u]),U=xC.useCallback((function(){var e=o.waitForBestImageTimeMs,t=E.current;null!==t.imageBlob&&((new Date).getTime()-t.takenAt>e&&(v.current=!0))}),[o]),j=xC.useCallback((function(){_.current=!0}),[]),V=xC.useCallback((function(){return new Promise((function(e){_.current=!1;var t=setInterval((function(){x.current||(clearInterval(t),e())}),150)}))}),[]),z=xC.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=B.current;n.captureTime=Date.now(),T.current?(j(),setTimeout((function(){V().then(xy(regeneratorRuntime.mark((function o(){var a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(BV.hasBetterCardBlurScore(n.blurScore,t)||(n.error=mue.id_detector_error_blur),a=l.current,null!==n.imageBlob){o.next=6;break}xV.takePicture({canvas:a,quality:u}).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,O(a);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.next=10;break;case 6:if(!r){o.next=9;break}return o.next=9,O(a);case 9:e(n);case 10:case"end":return o.stop()}}),o)}))))}),2e3)):xV.takePicture({canvas:l.current,quality:u}).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,O(l.current);case 5:e(n);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),[o,j,V,u,O]),q=xC.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,a,u,p,w,S,x,T,P,R,j,V,z,q,H,K,W,Q,G,X,Y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&k&&!b.current){e.next=2;break}return e.abrupt("return");case 2:E.current=gue(),B.current=vue(),r=o.enableAutoCapture,n=o.enableBlurCheck,a=o.enableIdDetection,u=o.country,p=o.enableVirtualCamHashes,w=I.current,S=w.idCardModel,x=w.blazefaceModel,T=w.ableToUseModel,P=C.current,R=t.current,b.current=!0,j=P.cropX,V=P.cropY,z=P.cropWidth,q=P.cropHeight,H=P.cropWidthWithoutPadding,K=P.cropHeightWithoutPadding,(W=l.current).width=z,W.height=q,Q=W.getContext("2d"),G=document.createElement("canvas"),X=G.getContext("2d"),Y=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,C,w,k,I,P,$,Z;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q.drawImage(R,j,V,z,q,0,0,z,q),t=performance.now(),A.current=!1,!a||!T){e.next=63;break}return C=null,e.next=7,S.predict(W,{detectThreshold:.3});case 7:if(w=e.sent,null==o||!o.trackCardCoordinates||B.current.imageBlob||E.current.imageBlob||zre(m,Vre(w),null==o?void 0:o.trackCardCoordinatesMaxLength),!w.card){e.next=60;break}if(!v.current&&r||(h.current=w.card),!v.current&&!B.current.imageBlob&&f.current.length>0&&(f.current=[],d.current=0,v.current=!1,y.current=!1),v.current&&!y.current&&(p&&setTimeout(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(y.current=!0,!p){e.next=4;break}return e.next=4,O(l.current);case 4:return e.next=6,c(E.current);case 6:L();case 7:case"end":return e.stop()}}),e)}))),0),v.current=!1,y.current=!1),!nre({corners:w.card.corners,width:z,height:q})){e.next=57;break}if(!ire(w.card.corners)){e.next=54;break}if(k=tre(W,w.card.corners),I=FV.rectAreaRatio({small:{area:k.width*k.height},big:{area:H*K}}),(g5(o,"enableCardTypeCheck")||N.length>0)&&"vn"===u&&(P=g5(w,"card.label",""),g.current=P,Hre(P,N)||(C=mue.not_allowed_card_types)),C){e.next=52;break}if(!(I<.5)){e.next=25;break}C=mue.id_detector_card_too_small,e.next=52;break;case 25:if(!(I>.95)){e.next=29;break}C=mue.id_detector_error_incomplete,e.next=52;break;case 29:return G.width=k.width,G.height=k.height,X.putImageData(k,0,0),e.next=34,ore({canvas:G});case 34:if(!e.sent){e.next=39;break}C=mue.glare_detected,e.next=52;break;case 39:if("ph"===D){e.next=43;break}return e.next=42,sre({blazefaceModel:x,predictedIdCardCanvas:G,frontSide:s});case 42:C=e.sent;case 43:if(C){e.next=52;break}if(!n){e.next=52;break}if($=BV.calculateIdCardBlurScore({canvas:G}),!_.current){e.next=49;break}return e.next=49,F({blurScore:$,detectedCard:w.card});case 49:if(!r){e.next=52;break}return e.next=52,M({blurScore:$,detectedCard:w.card});case 52:e.next=55;break;case 54:C=mue.id_detector_validate_angle_error;case 55:e.next=58;break;case 57:C=mue.id_detector_error_incomplete;case 58:e.next=61;break;case 60:C=mue.id_detector_no_cards;case 61:i(C),U();case 63:return t=Math.floor(performance.now()-t),Z=180-t>0?180-t:0,e.next=67,new Promise((function(e){return setTimeout(e,Z)}));case 67:b.current&&window.requestAnimationFrame(Y);case 68:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(Y);case 19:case"end":return e.stop()}}),e)}))),[o,k,t,i,U,c,L,D,O,s,F,M,N]);xC.useEffect((function(){var e=t.current;function o(){return(o=xy(regeneratorRuntime.mark((function t(){var r,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(C.current=xV.analyzeVideoAndWindowSizes(e,n,.05),r=C.current,o=r.cropWidth,a=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(a)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,q();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&k&&function(){o.apply(this,arguments)}()}),[r,n,t,L,q,k]);var H=xC.useCallback((function(){L()}),[L]);return xC.useEffect((function(){return H}),[H]),{refWorkingCanvas:l,stopCheckFrame:L,checkFrame:q,warmupDone:k,takePictureManually:z,refAbleToRunBurstMode:T,refVirtualFrames:f,refCardCoordinates:m,refCardLabel:g}}var bue=function(){return{id:null,frames:[]}},Cue=180;function wue(){return[bue()]}function kue(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=xC.useRef(null);null===a.current&&(a.current=document.createElement("canvas"));var i=xC.useRef(!1),s=xC.useRef(Jz.createResizer({width:960,height:640})),c=xC.useRef(null),u=xC.useRef(wue()),l=xC.useCallback((function(){!0===i.current&&(i.current=!1)}),[]),d=xC.useCallback((function(){u.current=wue()}),[]),f=xC.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push(bue())}),[]),p=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,a,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,a=u.current,i=n.resize({srcCanvas:r}),c=i.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=xC.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?Cue:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:s=c.current,u=t.current,i.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=a.current).width=f,m.height=h,g=m.getContext("2d");case 13:return v=performance.now(),g.drawImage(u,l,d,f,h,0,0,f,h),e.next=18,p({workingCanvas:m});case 18:if(v=Math.floor(performance.now()-v),i.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,tV.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return xC.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=xV.analyzeVideoAndWindowSizes(e,n),t.next=3,h();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return r&&n&&function(){o.apply(this,arguments)}(),function(){l()}}),[r,n,t,l,f,h]),{refWorkingCanvas:a,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var Sue=function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,a=e.onChange;xC.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,i=n.current,s=t[t.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==i?void 0:i.width,"canvas.height":null==i?void 0:i.height};a&&a(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[a,t,r,n,o])},Eue=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,a=e.settings,i=e.shouldStartTimers,s=e.sessionTime,c=xC.useRef(),u=Wy(xC.useState(0),2),l=u[0],d=u[1],f=xC.useCallback((function(){clearInterval(c.current)}),[]),p=xC.useCallback((function(){d((function(e){return e+1}))}),[]);return xC.useEffect((function(){if(i){var e=a.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var a=s-(t+=1);a<=u&&r&&r({curTimeLeft:a}),t>0&&t%e==0&&o&&o(),0===a&&(f(),n&&n())}),1e3)}return function(){f()}}),[i,t,r,f,n,o,l,a,s]),{stopTimers:f,startTimers:p}};lK.initExifData();var Bue=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onModelErrorChange,i=e.frontSide,s=e.allowedCardTypes,c=e.onDebugInfoChange,u=e.onAboutToTimeout,l=e.onSessionTimeout,d=e.onCaptureDone,f=e.outputEncryptionSettings,p=e.quality,h=xC.useRef(!1),m=Wy(xC.useState(!1),2),g=m[0],v=m[1],y=xC.useRef((function(){})),b=Yj.useSDKTracking().sendEvent,C=xC.useRef(),w=xC.useRef(),k=xC.useRef(),S=yj.useSDKSettings(),E=S.debug,B=S.lang,_=S.enableAntiDebug,x=S.exifKey,T=hK(),A=T.startMotion,I=T.stopMotion,P=T.motionData,R=T.orientationData;xC.useEffect((function(){_&&zq.enableAntiDebug()}),[_]);var D=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b({tag:i?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,y.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[b,i]),N=xC.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(void 0,t);var n=g5(t,"0.code");n&&n!==C.current&&(b({tag:i?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),C.current=n)}),[a,i,b]),O=yue({refVideo:r,shouldStart:t,cropArea:n,allowedCardTypes:s,settings:o,onError:N,frontSide:i,onAutoCaptureSuccess:D,quality:p}),L=O.refWorkingCanvas,M=O.stopCheckFrame,F=O.checkFrame,U=O.warmupDone,j=O.takePictureManually,V=O.refAbleToRunBurstMode,z=O.refVirtualFrames,q=O.refCardCoordinates,H=O.refCardLabel,K=kue({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),W=K.stopCheckFrame,Q=K.splitVideos,G=K.resetRecordedVideos,X=K.checkFrame,Y=K.refRecordedVideos;Sue({debug:E,refRecordedVideos:Y,refWorkingCanvas:L,refVideo:r,onChange:c});var $=xC.useCallback((function(){W(),M(),G(),l()}),[G,W,M,l]),Z=xC.useCallback((function(){Q()}),[Q]),J=Eue({lang:B,onAboutToTimeout:u,onSessionTimeout:$,onVideoTimeLimitReached:Z,settings:o,shouldStartTimers:U&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),ee=J.stopTimers,te=J.startTimers,re=xC.useCallback((function(){h.current=!1}),[]),ne=xC.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return re(),te(),e.next=4,Promise.all([X(),F()]);case 4:case"end":return e.stop()}}),e)}))),[re,te,X,F]),oe=xC.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n,a,s,c,u,l,p,m,g,y,C,S,E,B,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_.length>0&&void 0!==_[0]?_[0]:{},r=t.imageBlob,n=t.error,a=t.detectedCard,s=t.captureTime,c=t.captureCount,u=t.captureDuration,l=t.captureType,!h.current){e.next=3;break}return e.abrupt("return");case 3:return h.current=!0,v(!0),W(),M(),ee(),N(null),p=null==o?void 0:o.enableVirtualCamHashes,m={},p&&(g=z).current.length>0&&(m=g.current.reduce((function(e,t,r){return Ny(Ny({},e),{},Py({},"hash".concat(r+1),t))}),m)),y=null==o?void 0:o.trackCardCoordinates,C="[".concat(q.current.toString(),"]"),I(),lK.preWriteExif({mode:lK.MODE.ID_CARD,motionData:P,orientationData:R,startTime:w.current,endTime:Date.now(),exifKey:x}),e.next=18,lK.writeExif({mode:lK.MODE.ID_CARD,imageData:Ny(Ny({detectedCard:a,captureTime:s,blob:r},p?{vCam:m}:{}),{},{captureCount:c,captureDuration:u,captureType:l},y?{cardTracking:C}:{}),enableExifData:null==o?void 0:o.enableExifData});case 18:if(S=e.sent,!f||!f.key){e.next=24;break}return B=f.key,e.next=23,Kq.encrypt({blob:S,key:B});case 23:E=e.sent;case 24:d({image:{blob:S,encrypted:E,detectedCard:a},error:n,recordedVideos:[]}),v(!1),b({tag:i?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-k.current)/1e3}});case 27:case"end":return e.stop()}}),e)}))),[W,M,ee,N,d,i,b,f,P,R,I,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,null==o?void 0:o.trackCardCoordinates,x,z,q]);y.current=oe;var ae=xC.useCallback(xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),ee(),W(),V.current||M(),e.next=6,j();case 6:return t=e.sent,e.next=9,oe(t);case 9:v(!1),b({tag:i?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[j,oe,ee,V,W,M,b,i]);return xC.useEffect((function(){t&&(b({tag:i?"id_front":"id_back",event:"user_activity.start",log:{}}),w.current=Date.now(),A())}),[b,i,t,A]),xC.useEffect((function(){U&&(b({tag:i?"id_front":"id_back",event:"user_activity.show",log:{}}),b({tag:i?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-w.current}}),k.current=performance.now())}),[b,i,U]),{warmupDone:U,isProcessing:g,takePictureManually:ae,restartSession:ne,resetIsProcessingImageBlobTaken:re,refCardLabel:H}},_ue=uL.IDCardMessage,xue=xC.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,a=e.refVideo,i=e.frontSide,s=e.allowedCardTypes,c=e.settings,u=e.onCaptureDone,l=e.onUISpacingChange,d=e.outputEncryptionSettings,f=mB(),p=Wy(xC.useState({}),2),h=p[0],m=p[1],g=h.yDescription,v=h.yMessage,y=h.yCaptureButton,b=e4(f,"IDCapturing.captureIcon.src","ic_camera.svg"),C=e4(f,"IDCapturing.loadingIcon.src","ic_loading.png"),w=Wy(xC.useState(""),2),k=w[0],S=w[1],E=yj.useSDKSettings(),B=E.debug,_=E.lang,x=Wy(xC.useState(null),2),T=x[0],A=x[1],I=Wy(xC.useState(""),2),P=I[0],R=I[1],D=Wy(xC.useState(null),2),N=D[0],O=D[1],L=Mce(),M=L.showPopup,F=L.popupShown,U=L.popupType,j=xC.useCallback((function(e){R(null===e?"":e7(e.msg[_])({side:i?Gte.FRONT[_]:Gte.BACK[_]}))}),[_,i]),V=xC.useCallback((function(){A(""),M({popupType:Fce.SESSION_TIMEOUT})}),[M]),z=xC.useCallback((function(){A(""),u.apply(void 0,arguments)}),[u]),q=xC.useCallback((function(e){var t=e.curTimeLeft;A(e7(_ue.REMAINING_TIME[_])({x:t}))}),[_]),H=Bue({shouldStart:!0,refVideo:a,cropArea:N,settings:c,onModelErrorChange:j,frontSide:i,allowedCardTypes:s,onDebugInfoChange:S,onSessionTimeout:V,onCaptureDone:z,onAboutToTimeout:q,outputEncryptionSettings:d}),K=H.warmupDone,W=H.isProcessing,Q=H.takePictureManually,G=H.restartSession,X=H.resetIsProcessingImageBlobTaken,Y=H.refCardLabel,$=xC.useCallback((function(){M({popupType:null}),X()}),[M,X]),Z=xC.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $(),e.next=3,G();case 3:case"end":return e.stop()}}),e)}))),[G,$]),J=xC.useMemo((function(){return{backgroundColor:J5(f,"IDCapturing.backgroundColor",Kte)}}),[f]);xC.useEffect((function(){if(o){var e,t,r,a,i,s,c,u=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,p=o.lostY,h=o.clientHeight;n?(i=.7*(s=d-165),r=(c=(e=p+10)+45)+20,a=(t=c+s+10)+60):(i=v5.isMobile?u-6:Math.floor(.7*u),r=(c=(e=p+10)+50)+20,a=(t=c+(s=Math.floor(Math.min(i/1.5,h-2*p-(Jre+2*Zre)-100)))+10)+60);var g=Math.floor((u-i)/2)+f;O({x:g,y:c,width:i,height:s,surroundStyle:J});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:a};m(v),l(v)}}),[o,n,l,J]);var ee=xC.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(""),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q]);return xC.useImperativeHandle(t,(function(){return{restartSession:Z}}),[Z]),xC.createElement(xC.Fragment,null,!K&&xC.createElement(Kee,null),B&&xC.createElement(ine,null,k),W&&xC.createElement(tne,null,xC.createElement("img",{src:C,alt:"",className:"spin"})),N&&xC.createElement(k4,{x:"".concat(N.x,"px"),y:"".concat(N.y,"px"),width:"".concat(N.width,"px"),height:"".concat(N.height,"px"),surroundStyle:N.surroundStyle},xC.createElement(lne,{width:N.width,height:N.height,type:P?Wte.ERROR:Wte.DEFAULT})),!P&&xC.createElement(sne,{y:"".concat(g,"px"),className:"description"},r),xC.createElement("div",{style:{position:"fixed",bottom:0,left:0,color:"#fff",padding:30}},Y.current),xC.createElement("div",{style:{position:"fixed",bottom:0,left:0,color:"#fff",padding:30}},Y.current),P&&xC.createElement(cne,{y:"".concat(g,"px")},P),!W&&(!(null!=c&&c.disableCaptureButtonIfAlert)||!P)&&xC.createElement(ene,{onClick:ee,y:"".concat(y,"px")},xC.createElement("img",{src:b,alt:""})),T&&xC.createElement(une,{key:T,className:"message",y:"".concat(v,"px")},T),xC.createElement(zee,{open:F},U===Fce.SESSION_TIMEOUT&&xC.createElement(Lce,{onOk:Z,maxSessionTime:null==c?void 0:c.idCardSessionTime})))}));xue.propTypes={usePortraitMask:xw.bool,description:xw.string,windowAndVideoInfo:xw.shape({}),refVideo:xw.shape({}),frontSide:xw.bool,allowedCardTypes:xw.arrayOf(xw.string),settings:xw.shape({}),onCaptureDone:xw.func,onUISpacingChange:xw.func,outputEncryptionSettings:xw.shape({})},xue.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,allowedCardTypes:[],settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var Tue,Aue,Iue,Pue,Rue,Due,Nue,Oue,Lue,Mue,Fue,Uue,jue,Vue={QR_INSTRUCTIONS_TEXT:{en:xC.createElement("span",null,"Please follow the instructions below to scan QR code:",xC.createElement("br",null),xC.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:xC.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",xC.createElement("br",null),xC.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:xC.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",xC.createElement("br",null),xC.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",xC.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:xC.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",xC.createElement("br",null),xC.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",xC.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"}},zue=dB.button(Tue||(Tue=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})),que=(dB.a(Aue||(Aue=Ky(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),dB.div(Iue||(Iue=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"])))),Hue=dB.div(Pue||(Pue=Ky(["\n background: #e7e6e6;\n width: 100%;\n border-radius: ",";\n"])),(function(e){var t=e.theme;return J5(t,"QRStep.guidelinePopup.image.borderRadius",Kte)})),Kue=dB.img(Rue||(Rue=Ky(["\n width: 100%;\n height: auto;\n object-fit: contain;\n"]))),Wue=dB.div(Due||(Due=Ky(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n text-align: ",";\n line-height: ",";\n"])),(function(e){var t=e.theme,r=e.$type;return J5(t,"QRStep.guidelinePopup.".concat(r,".color"),Kte)}),(function(e){var t=e.theme,r=e.$type;return J5(t,"QRStep.guidelinePopup.".concat(r,".fontSize"),Kte)}),(function(e){var t=e.theme,r=e.$type;return J5(t,"QRStep.guidelinePopup.".concat(r,".fontWeight"),Kte)}),(function(e){var t=e.theme,r=e.$type;return J5(t,"QRStep.guidelinePopup.".concat(r,".textAlign"),Kte)}),(function(e){var t=e.theme,r=e.$type;return J5(t,"QRStep.guidelinePopup.".concat(r,".lineHeight"),Kte)})),Que=dB(Wue)(Nue||(Nue=Ky(["\n white-space: nowrap;\n"]))),Gue=dB(zue)(Oue||(Oue=Ky(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n"])),(function(e){var t=e.theme;return J5(t,"QRStep.guidelinePopup.startButton.color",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.guidelinePopup.startButton.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.guidelinePopup.startButton.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.guidelinePopup.startButton.backgroundColor",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.guidelinePopup.startButton.border",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.guidelinePopup.startButton.borderRadius",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.guidelinePopup.startButton.outline",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.guidelinePopup.startButton.height",Kte)})),Xue=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=yj.useSDKSettings().lang,a=mB(),i=e4(a,"QRStep.guidelinePopup.image.src","qr_code_banner.png"),s=xC.useRef(n),c=Wy(xC.useState((function(){return e7(Vue.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),u=c[0],l=c[1],d=Yj.useSDKTracking().sendEvent,f=xC.useRef(!1);xC.useEffect((function(){d({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[d]),xC.useEffect((function(){var e=e7(Vue.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){s.current--,l(e({x:s.current})),s.current<=0&&(clearInterval(t),f.current||d({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),r&&r())}),1e3);return function(){clearInterval(t)}}),[o,r]);return xC.createElement(que,null,xC.createElement(Hue,null,xC.createElement(roe,{ratio:1.6},xC.createElement(Kue,{src:i}))),xC.createElement(loe,{mt:"30px"},xC.createElement(Wue,{$type:"guideText"},Vue.QR_INSTRUCTIONS_TEXT[o])),xC.createElement(loe,{mt:"30px"},xC.createElement(Gue,{onClick:function(){d({tag:"id_qr",event:"user_activity.click_start",log:{}}),f.current=!0,t()}},Vue.QR_INSTRUCTIONS_START_BUTTON[o])),xC.createElement(loe,{my:"20px"},xC.createElement(Que,{$type:"countdownText"},u)))};Xue.propTypes={onClickStart:xw.func,onTimeout:xw.func,timeout:xw.number},Xue.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var Yue,$ue,Zue,Jue=dB.div(Lue||(Lue=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: ",";\n"])),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.padding",Kte)})),ele=dB.div(Mue||(Mue=Ky(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n margin: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.title.color",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.title.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.title.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.title.margin",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.title.padding",Kte)})),tle=dB.div(Fue||(Fue=Ky(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n text-align: ",";\n margin: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.description.color",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.description.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.description.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.description.textAlign",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.description.margin",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.description.padding",Kte)})),rle=dB(zue)(Uue||(Uue=Ky(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n margin: ",";\n"])),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.retryButton.color",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.retryButton.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.retryButton.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.retryButton.backgroundColor",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.retryButton.border",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.retryButton.borderRadius",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.retryButton.outline",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.retryButton.height",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.retryButton.margin",Kte)})),nle=dB(zue)(jue||(jue=Ky(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n margin: ",";\n"])),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.skipButton.color",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.skipButton.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.skipButton.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.skipButton.backgroundColor",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.skipButton.border",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.skipButton.borderRadius",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.skipButton.outline",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.skipButton.height",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.invalidPopup.skipButton.margin",Kte)})),ole=function(e){var t=e.onRetry,r=e.onSkip,n=yj.useSDKSettings().lang;return xC.createElement(Jue,null,xC.createElement(ele,null,Vue.QR_INVALID_POPUP_TITLE[n]),xC.createElement(tle,null,Vue.QR_INVALID_POPUP_DESCRIPTION[n]),xC.createElement(rle,{onClick:t},Vue.QR_INVALID_POPUP_RETRY_BUTTON[n]),xC.createElement(nle,{onClick:r},Vue.QR_INVALID_POPUP_SKIP_BUTTON[n]))};ole.propTypes={onRetry:xw.func,onSkip:xw.func},ole.defaultProps={onRetry:function(){},onSkip:function(){}};var ale=10,ile=dB.div(Yue||(Yue=Ky(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: ",";\n top: ",";\n position: absolute;\n z-index: ",";\n color: ",";\n padding: ",";\n margin: 0 10px;\n max-width: 275px;\n text-align: ",";\n"])),(function(e){var t=e.theme;return J5(t,"QRStep.scanTooltip.backgroundColor",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.scanTooltip.borderRadius",Kte)}),(function(e){return e.y}),r4+20,(function(e){var t=e.theme;return J5(t,"QRStep.scanTooltip.color",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.scanTooltip.padding",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.scanTooltip.textAlign",Kte)})),sle=dB.div($ue||($ue=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){var t=e.arrowSize,r=e.theme;return"".concat(t,"px solid ").concat(J5(r,"QRStep.scanTooltip.backgroundColor",Kte))}),(function(e){return"".concat(e.top,"px")})),cle=function(e){var t=e.children,r=e.y;return xC.createElement(ile,{y:r},xC.createElement(sle,{arrowSize:ale,top:-ale}),t)},ule=dB.div(Zue||(Zue=Ky(["\n text-align: ",";\n position: absolute;\n font-size: ",";\n font-weight: ",";\n border-radius: ",";\n padding: ",";\n background: ",";\n color: ",";\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){var t=e.theme;return J5(t,"QRStep.scanCountdown.textAlign",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.scanCountdown.fontSize",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.scanCountdown.fontWeight",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.scanCountdown.borderRadius",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.scanCountdown.padding",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.scanCountdown.backgroundColor",Kte)}),(function(e){var t=e.theme;return J5(t,"QRStep.scanCountdown.color",Kte)}),(function(e){return e.y}),r4+20),lle=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g,dle=function(e){var t=e.match(lle);return{valid:Boolean(t)}};function fle(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 ple=function(){var e=xy(regeneratorRuntime.mark((function e(t,r){var n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,iue();case 2:if(n=e.sent,o=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return a=document.createElement("canvas"),i=a.getContext("2d"),e.next=11,new Promise((function(e){var r=URL.createObjectURL(t),n=new Image;n.onload=function(){var t=n.width,o=n.height;a.width=t/2,a.height=o/2,i.drawImage(n,t/2,0,a.width,a.height,0,0,a.width,a.height),URL.revokeObjectURL(r),e()},n.src=r}));case 11:return e.next=13,fle({canvas:a,qrModel:o});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,lK.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,Kq.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}});case 25:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),hle=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 a=t;a<t+n;a++)for(var i=e;i<e+r;i++)this.set(i,a,!!o)},e}();t.BitMatrix=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.addOrSubtractGF=function(e,t){return e^t};var o=function(){function e(e,t,r){this.primitive=e,this.size=t,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var o=1,a=0;a<this.size;a++)this.expTable[a]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,t){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===t)return this.zero;var r=new Uint8ClampedArray(e+1);return r[0]=t,new n.default(this,r)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=function(){function e(e,t){if(0===t.length)throw new Error("No coefficients.");this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;if(n===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-n);for(var o=0;o<this.coefficients.length;o++)this.coefficients[o]=t[n+o]}}else this.coefficients=t}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(t){var r;if(this.isZero())return t;if(t.isZero())return this;var o=this.coefficients,a=t.coefficients;o.length>a.length&&(o=(r=[a,o])[0],a=r[1]);for(var i=new Uint8ClampedArray(a.length),s=a.length-o.length,c=0;c<s;c++)i[c]=a[c];for(c=s;c<a.length;c++)i[c]=n.addOrSubtractGF(o[c-s],a[c]);return new e(this.field,i)},e.prototype.multiply=function(t){if(0===t)return this.field.zero;if(1===t)return this;for(var r=this.coefficients.length,n=new Uint8ClampedArray(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,n)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var r=this.coefficients,o=r.length,a=t.coefficients,i=a.length,s=new Uint8ClampedArray(o+i-1),c=0;c<o;c++)for(var u=r[c],l=0;l<i;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,a[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new Error("Invalid degree less than 0");if(0===r)return this.field.zero;for(var n=this.coefficients.length,o=new Uint8ClampedArray(n+t),a=0;a<n;a++)o[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,o)},e.prototype.evaluateAt=function(e){var t=0;if(0===e)return this.getCoefficient(0);var r=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){t=n.addOrSubtractGF(t,e)})),t;t=this.coefficients[0];for(var o=1;o<r;o++)t=n.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[o]);return t},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(5),a=r(11),i=r(12);function s(e){var t=i.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=a.extract(e,s),u=o.decode(c.matrix);if(u)return{binaryData:u.bytes,data:u.text,chunks:u.chunks,version:u.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:"attemptBoth"};function u(e,t,r,o){void 0===o&&(o={});var a=c;Object.keys(a||{}).forEach((function(e){a[e]=o[e]||a[e]}));var i="attemptBoth"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,u="onlyInvert"===a.inversionAttempts||"invertFirst"===a.inversionAttempts,l=n.binarize(e,t,r,i),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==a.inversionAttempts&&"invertFirst"!==a.inversionAttempts||(p=s(u?d:f)),p}u.default=u,t.default=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r){return e<t?t:e>r?r:e}var a=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,i){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new a(t,r),c=0;c<t;c++)for(var u=0;u<r;u++){var l=e[4*(u*t+c)+0],d=e[4*(u*t+c)+1],f=e[4*(u*t+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(t/8),h=Math.ceil(r/8),m=new a(p,h),g=0;g<h;g++)for(var v=0;v<p;v++){var y=0,b=1/0,C=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var w=s.get(8*v+c,8*g+u);y+=w,b=Math.min(b,w),C=Math.max(C,w)}var k=y/Math.pow(8,2);if(C-b<=24&&(k=b/2,g>0&&v>0)){var S=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<S&&(k=S)}m.set(v,g,k)}var E=n.BitMatrix.createEmpty(t,r),B=null;for(i&&(B=n.BitMatrix.createEmpty(t,r)),g=0;g<h;g++)for(v=0;v<p;v++){for(var _=o(v,2,p-3),x=o(g,2,h-3),T=(y=0,-2);T<=2;T++)for(var A=-2;A<=2;A++)y+=m.get(_+T,x+A);var I=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var P=s.get(c,u);E.set(c,u,P<=I),i&&B.set(c,u,!(P<=I))}}return i?{binarized:E,inverted:B}:{binarized:E}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),a=r(9),i=r(10);function s(e,t){for(var r=e^t,n=0;r;)n++,r&=r-1;return n}function c(e,t){return t<<1|e}var u=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],l=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e,t,r){for(var o=l[r.dataMask],a=e.height,i=function(e){var t=17+4*e.versionNumber,r=n.BitMatrix.createEmpty(t,t);r.setRegion(0,0,9,9,!0),r.setRegion(t-8,0,8,9,!0),r.setRegion(0,t-8,9,8,!0);for(var o=0,a=e.alignmentPatternCenters;o<a.length;o++)for(var i=a[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===i&&6===u||6===i&&u===t-7||i===t-7&&6===u||r.setRegion(i-2,u-2,5,5,!0)}return r.setRegion(6,9,1,t-17,!0),r.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),s=[],u=0,d=0,f=!0,p=a-1;p>0;p-=2){6===p&&p--;for(var h=0;h<a;h++)for(var m=f?a-1-h:h,g=0;g<2;g++){var v=p-g;if(!i.get(v,m)){d++;var y=e.get(v,m);o({y:m,x:v})&&(y=!y),u=c(y,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var t=function(e){var t=e.height,r=Math.floor((t-17)/4);if(r<=6)return i.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var a=t-9;a>=t-11;a--)n=c(e.get(a,o),n);var u=0;for(a=5;a>=0;a--)for(o=t-9;o>=t-11;o--)u=c(e.get(a,o),u);for(var l,d=1/0,f=0,p=i.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var m=s(n,h.infoBits);m<d&&(l=h,d=m),(m=s(u,h.infoBits))<d&&(l=h,d=m)}return d<=3?l:void 0}(e);if(!t)return null;var r=function(e){for(var t=0,r=0;r<=8;r++)6!==r&&(t=c(e.get(r,8),t));for(var n=7;n>=0;n--)6!==n&&(t=c(e.get(8,n),t));var o=e.height,a=0;for(n=o-1;n>=o-7;n--)a=c(e.get(8,n),a);for(r=o-8;r<o;r++)a=c(e.get(r,8),a);for(var i=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,m=p.formatInfo;if(h===t||h===a)return m;var g=s(t,h);g<i&&(l=m,i=g),t!==a&&(g=s(a,h))<i&&(l=m,i=g)}return i<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],a=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),a+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<a)return null;e=e.slice(0,a);for(var i=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<i;s++)for(var c=0,u=o;c<u.length;c++)u[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var l=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)o[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=o;f<p.length;f++)p[f].codewords.push(e.shift());return o}(d(e,t,r),t,r.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,t){return e+t.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,m=n;h<m.length;h++){var g=m[h],v=a.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[p++]=v[y]}try{return o.decode(f,t.versionNumber)}catch(e){return null}}t.decode=function(e){if(null==e)return null;var t=f(e);if(t)return t;for(var r=0;r<e.width;r++)for(var n=r+1;n<e.height;n++)e.get(r,n)!==e.get(n,r)&&(e.set(r,n,!e.get(r,n)),e.set(n,r,!e.get(n,r)));return f(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o,a=r(7),i=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],a=e.readBits(o);a>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var i=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+i,48+s,48+c),n+=i.toString()+s.toString()+c.toString(),a-=3}if(2===a){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");i=Math.floor(u/10),s=u%10,r.push(48+i,48+s),n+=i.toString()+s.toString()}else if(1===a){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+u),n+=u.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(o||(o={}));var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(e,t){for(var r=[],n="",o=[9,11,13][t],a=e.readBits(o);a>=2;){var i=e.readBits(11),s=Math.floor(i/45),u=i%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],a-=2}return 1===a&&(s=e.readBits(6),r.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:r,text:n}}function l(e,t){for(var r=[],n="",o=[8,16,16][t],a=e.readBits(o),i=0;i<a;i++){var s=e.readBits(8);r.push(s)}try{n+=decodeURIComponent(r.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:r,text:n}}function d(e,t){for(var r=[],n="",o=[8,10,12][t],a=e.readBits(o),s=0;s<a;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,r.push(u>>8,255&u),n+=String.fromCharCode(i.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,i,c,f,p=new a.BitStream(e),h=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};p.available()>=4;){var g=p.readBits(4);if(g===o.Terminator)return m;if(g===o.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===o.Numeric){var v=s(p,h);m.text+=v.text,(r=m.bytes).push.apply(r,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===o.Alphanumeric){var y=u(p,h);m.text+=y.text,(i=m.bytes).push.apply(i,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===o.Byte){var b=l(p,h);m.text+=b.text,(c=m.bytes).push.apply(c,b.bytes),m.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(g===o.Kanji){var C=d(p,h);m.text+=C.text,(f=m.bytes).push.apply(f,C.bytes),m.chunks.push({type:n.Kanji,bytes:C.bytes,text:C.text})}}if(0===p.available()||0===p.readBits(p.available()))return m}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e<r?e:r,o=255>>8-n<<(a=r-n);t=(this.bytes[this.byteOffset]&o)>>a,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var a;if(e>0)o=255>>(a=8-e)<<a,t=t<<e|(this.bytes[this.byteOffset]&o)>>a,this.bitOffset+=e}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var a=new n.default(285,256,0),i=new o.default(a,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=i.evaluateAt(a.exp(u+a.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(a,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var a=t,i=r,s=e.zero,c=e.one;i.degree()>=n/2;){var u=a,l=s;if(s=c,(a=i).isZero())return null;i=u;for(var d=e.zero,f=a.getCoefficient(a.degree()),p=e.inverse(f);i.degree()>=a.degree()&&!i.isZero();){var h=i.degree()-a.degree(),m=e.multiply(i.getCoefficient(i.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),i=i.addOrSubtract(a.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),i.degree()>=a.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),i.multiply(v)]}(a,a.buildMonomial(t,1),d,t);if(null===f)return null;var p=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),o=0,a=1;a<e.size&&o<r;a++)0===t.evaluateAt(a)&&(n[o]=e.inverse(a),o++);return o!==r?null:n}(a,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,a=new Array(o),i=0;i<o;i++){for(var s=e.inverse(r[i]),c=1,u=0;u<o;u++)i!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));a[i]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(a[i]=e.multiply(a[i],s))}return a}(a,f[1],p),m=0;m<p.length;m++){var g=r.length-1-a.log(p[m]);if(g<0)return null;r[g]=n.addOrSubtractGF(r[g],h[m])}return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r,n){var o=e.x-t.x+r.x-n.x,a=e.y-t.y+r.y-n.y;if(0===o&&0===a)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:r.x-t.x,a22:r.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var i=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=i*u-s*c,d=(o*u-s*a)/l,f=(i*a-o*c)/l;return{a11:t.x-e.x+d*t.x,a12:t.y-e.y+d*t.y,a13:d,a21:n.x-e.x+f*n.x,a22:n.y-e.y+f*n.y,a23:f,a31:e.x,a32:e.y,a33:1}}t.extract=function(e,t){for(var r=function(e,t,r,n){var a=o(e,t,r,n);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}({x:3.5,y:3.5},{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),a=function(e,t){return{a11:e.a11*t.a11+e.a21*t.a12+e.a31*t.a13,a12:e.a12*t.a11+e.a22*t.a12+e.a32*t.a13,a13:e.a13*t.a11+e.a23*t.a12+e.a33*t.a13,a21:e.a11*t.a21+e.a21*t.a22+e.a31*t.a23,a22:e.a12*t.a21+e.a22*t.a22+e.a32*t.a23,a23:e.a13*t.a21+e.a23*t.a22+e.a33*t.a23,a31:e.a11*t.a31+e.a21*t.a32+e.a31*t.a33,a32:e.a12*t.a31+e.a22*t.a32+e.a32*t.a33,a33:e.a13*t.a31+e.a23*t.a32+e.a33*t.a33}}(o(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft),r),i=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=a.a13*e+a.a23*t+a.a33;return{x:(a.a11*e+a.a21*t+a.a31)/r,y:(a.a12*e+a.a22*t+a.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);i.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:i,mappingFunction:s}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function o(e){return e.reduce((function(e,t){return e+t}))}function a(e,t,r,o){var a,i,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(t.y-e.y)>Math.abs(t.x-e.x);l?(a=Math.floor(e.y),i=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(a=Math.floor(e.x),i=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-a),f=Math.abs(c-i),p=Math.floor(-d/2),h=a<s?1:-1,m=i<c?1:-1,g=!0,v=a,y=i;v!==s+h;v+=h){var b=l?y:v,C=l?v:y;if(r.get(b,C)!==g&&(g=!g,u.push({x:b,y:C}),u.length===o+1))break;if((p+=f)>0){if(y===c)break;y+=m,p-=d}}for(var w=[],k=0;k<o;k++)u[k]&&u[k+1]?w.push(n(u[k],u[k+1])):w.push(0);return w}function i(e,t,r,n){var o,i=t.y-e.y,s=t.x-e.x,c=a(e,t,r,Math.ceil(n/2)),u=a(e,{x:e.x-s,y:e.y-i},r,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(o=u.concat(l)).concat.apply(o,c)}function s(e,t){var r=o(e)/o(t),n=0;return t.forEach((function(t,o){n+=Math.pow(e[o]-t*r,2)})),{averageSize:r,error:n}}function c(e,t,r){try{var n=i(e,{x:-1,y:e.y},r,t.length),o=i(e,{x:e.x,y:-1},r,t.length),a=i(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=i(e,{x:Math.min(r.width,e.x+e.y)+1,y:Math.min(r.height,e.y+e.x)+1},r,t.length),u=s(n,t),l=s(o,t),d=s(a,t),f=s(c,t),p=Math.sqrt(u.error*u.error+l.error*l.error+d.error*d.error+f.error*f.error),h=(u.averageSize+l.averageSize+d.averageSize+f.averageSize)/4;return p+(Math.pow(u.averageSize-h,2)+Math.pow(l.averageSize-h,2)+Math.pow(d.averageSize-h,2)+Math.pow(f.averageSize-h,2))/h}catch(e){return 1/0}}function u(e,t){for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r--;for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n++;for(var o=(r+n)/2,a=Math.round(t.y);e.get(Math.round(o),a);)a--;for(var i=Math.round(t.y);e.get(Math.round(o),i);)i++;return{x:o,y:(a+i)/2}}function l(e,t,r,a,s){var u,l,d;try{u=function(e,t,r,a){var s=(o(i(e,r,a,5))/7+o(i(e,t,a,5))/7+o(i(r,e,a,5))/7+o(i(t,e,a,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,t)/s),u=Math.round(n(e,r)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(a,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-a.x+s.x,p=r.y-a.y+s.y,h=(n(a,s)+n(a,r))/2/d,m=1-3/h,g={x:a.x+m*(f-a.x),y:a.y+m*(p-a.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,a=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(a))){var i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1];return o(i),{x:r,y:a,score:c({x:Math.floor(r),y:Math.floor(a)},[1,1,1],e)+n({x:r,y:a},g)}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));return{alignmentPattern:h>=15&&v.length?v[0]:g,dimension:l}}t.locate=function(e){for(var t=[],r=[],a=[],i=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var a=e.get(t,n);if(a===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=a;var l=o(u)/7,d=Math.abs(u[0]-l)<l&&Math.abs(u[1]-l)<l&&Math.abs(u[2]-3*l)<3*l&&Math.abs(u[3]-l)<l&&Math.abs(u[4]-l)<l&&!a,f=o(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&a;if(d){var h=t-u[3]-u[4],m=h-u[2],g={startX:m,endX:h,y:n};(v=r.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||h>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&h>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:r.push({top:g,bottom:g})}if(p){var v,y=t-u[4],b=y-u[3];g={startX:b,y:n,endX:y},(v=i.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||y>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&y>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:i.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)l(d);t.push.apply(t,r.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),r=r.filter((function(e){return e.bottom.y===n})),a.push.apply(a,i.filter((function(e){return e.bottom.y!==n}))),i=i.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);t.push.apply(t,r.filter((function(e){return e.bottom.y-e.top.y>=2}))),a.push.apply(a,i);var f=t.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],i=o(a)/a.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:i}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score})).map((function(e,t,r){if(t>4)return null;var n=r.filter((function(e,r){return t!==r})).map((function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}})).sort((function(e,t){return e.score-t.score}));if(n.length<2)return null;var o=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:o}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));if(0===f.length)return null;var p=function(e,t,r){var o,a,i,s,c,u,l,d=n(e,t),f=n(t,r),p=n(e,r);return f>=d&&f>=p?(c=(o=[t,e,r])[0],u=o[1],l=o[2]):p>=f&&p>=d?(c=(a=[e,t,r])[0],u=a[1],l=a[2]):(c=(i=[e,r,t])[0],u=i[1],l=i[2]),(l.x-u.x)*(c.y-u.y)-(l.y-u.y)*(c.x-u.x)<0&&(c=(s=[l,c])[0],l=s[1]),{bottomLeft:c,topLeft:u,topRight:l}}(f[0].points[0],f[0].points[1],f[0].points[2]),h=p.topRight,m=p.topLeft,g=p.bottomLeft,v=l(e,a,h,m,g),y=[];v&&y.push({alignmentPattern:{x:v.alignmentPattern.x,y:v.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:v.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),C=u(e,m),w=u(e,g),k=l(e,a,b,C,w);return k&&y.push({alignmentPattern:{x:k.alignmentPattern.x,y:k.alignmentPattern.y},bottomLeft:{x:w.x,y:w.y},topLeft:{x:C.x,y:C.y},topRight:{x:b.x,y:b.y},dimension:k.dimension}),0===y.length?null:y}}]).default},e.exports=r()})),mle=n(hle);function gle(e){return vle.apply(this,arguments)}function vle(){return(vle=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(a=n.getContext("2d"),o=a.getImageData(0,0,n.width,n.height)),!(i=mle(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",i.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yle(e){return ble.apply(this,arguments)}function ble(){return(ble=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),Zce.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 Cle=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,a=r,!n){e.next=6;break}return e.next=5,Jz.blobToCanvas({blob:n});case 5:a=e.sent;case 6:return i=a.getContext("2d"),e.next=9,gle({imageData:i.getImageData(0,0,a.width,a.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,yle({canvas:a,qrScannerResources:o});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function wle(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,a=e.onResult,i=e.outputEncryptionSettings,s=xC.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=xC.useRef(!1),u=xC.useRef(null),l=Wy(xC.useState(!1),2),d=l[0],f=l[1],p=xC.useRef({}),h=yj.useSDKSettings(),m=h.customUrls,g=h.qrSettings;xC.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,iue({modelUrl:null==m?void 0:m.wechatQRModelsUrl});case 3:p.current=e.sent,f(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[d,m]);var v=xC.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),y=xC.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,l,f,h,m,y,b,C,w,k,S,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d&&o&&!c.current){e.next=2;break}return e.abrupt("return");case 2:r=p.current,n=r.qrModel,l=r.qrScannerResources,f=r.noModel,h=u.current,m=t.current,c.current=!0,y=h.cropX,b=h.cropY,C=h.cropWidth,w=h.cropHeight,(k=s.current).width=C,k.height=w,S=k.getContext("2d"),E=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,o,u,d,p,h,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(S.drawImage(m,y,b,C,w,0,0,C,w),t=performance.now(),f){e.next=8;break}return e.next=5,fle({canvas:k,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,Cle({canvas:k,qrScannerResources:l});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=27;break}return v(),o=dle(r),e.next=17,xV.takePicture({canvas:s.current});case 17:return u=e.sent,e.next=20,lK.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:"boolean"!=typeof(null==g?void 0:g.enableExif)||(null==g?void 0:g.enableExif)});case 20:if(d=e.sent,!i||!i.key){e.next=26;break}return h=i.key,e.next=25,Kq.encrypt({blob:d,key:h});case 25:p=e.sent;case 26:a({result:r,validateResult:o,image:{blob:d,encrypted:p}});case 27:return B=180-t>0?180-t:0,e.next=30,new Promise((function(e){return setTimeout(e,B)}));case 30:c.current&&window.requestAnimationFrame(E);case 31:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(E);case 13:case"end":return e.stop()}}),e)}))),[d,o,t,v,null==g?void 0:g.enableExif,i,a]),b=xC.useCallback((function(){v()}),[v]);return xC.useEffect((function(){var e=t.current;r||b(),d&&r&&n&&e&&e.videoWidth>0&&(u.current=xV.analyzeVideoAndWindowSizes(e,n,0),y())}),[r,n,t,v,y,d,b]),xC.useEffect((function(){return b}),[b]),{refWorkingCanvas:s,stopCheckFrame:v,checkFrame:y,warmupDone:d}}var kle,Sle=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,a=e.onSessionTimeout,i=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=Wy(xC.useState(!1),2),l=u[0],d=u[1],f=xC.useRef((function(){})),p=xC.useRef((function(){})),h=yj.useSDKSettings().lang,m=xC.useCallback((function(){f.current.apply(f,arguments)}),[]),g=wle({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:m,outputEncryptionSettings:c}),v=g.stopCheckFrame,y=g.checkFrame,b=g.warmupDone,C=kue({refVideo:r,shouldStart:t&&b,cropArea:n,settings:o}),w=C.stopCheckFrame,k=C.refRecordedVideos,S=C.splitVideos,E=C.resetRecordedVideos,B=C.checkFrame;f.current=xC.useCallback((function(e){d(!0),w(),v(),p.current(),i(Ny(Ny({},e),null!=o&&o.enableRecording?{recordedVideos:k.current}:{})),d(!1)}),[w,i,k,v,null==o?void 0:o.enableRecording]);var _=xC.useCallback((function(){w(),v();var e=Gy(k.current),t=null!=o&&o.enableRecording?{recordedVideos:e}:null;a(t),E()}),[E,w,v,a,k,o]),x=xC.useCallback((function(){S()}),[S]),T=Eue({lang:h,onAboutToTimeout:s,onSessionTimeout:_,onVideoTimeLimitReached:x,settings:o,shouldStartTimers:t&&b,sessionTime:null==o?void 0:o.scanQrLimitTimeSecond}),A=T.stopTimers,I=T.startTimers;return p.current=A,{isProcessing:l,restartSession:xC.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(),e.next=3,Promise.all([B(),y()]);case 3:case"end":return e.stop()}}),e)}))),[B,y,I]),refRecordedVideos:k,warmupDone:b}},Ele=145;function Ble(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,a=e.onCaptureDone,i=e.outputEncryptionSettings,s=Wy(xC.useState(null),2),c=s[0],u=s[1],l=Jj.useAsset("qr_capture_cursor.png"),d=Wy(xC.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=yj.useSDKSettings().lang,v=Yj.useSDKTracking().sendEvent,y=Mce(),b=y.showPopup,C=y.popupShown,w=y.popupType,k=Wy(xC.useState(!1),2),S=k[0],E=k[1],B=Wy(xC.useState(null),2),_=B[0],x=B[1],T=Jj.useAsset("ic_loading.png"),A=xC.useRef();xC.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),xC.useEffect((function(){b({popupType:Fce.QR_INSTRUCTIONS})}),[b]),xC.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,a=v5.isMobile?Math.min(e-6,Ele):Ele,i=a,s=o+10,c=s+90,l=c+40,d=l+i+20,f=Math.floor((e-a)/2)+n;u({x:f,y:l,width:a,height:i,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var I=xC.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),a(e)}),[a,v]),P=xC.useCallback((function(e){var t=e.validateResult.valid;x("");var r=performance.now();t?(v({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-A.current)/1e3}}),a(e)):(b({popupType:Fce.QR_INVALID}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,a,v]),R=xC.useCallback((function(e){var t=e.curTimeLeft;x(e7(Vue.REMAINING_TIME[g])({x:t}))}),[g]),D=Sle({shouldStart:S,refVideo:n,cropArea:c,settings:o,onSessionTimeout:I,onCaptureDone:P,onAboutToTimeout:R,outputEncryptionSettings:i}),N=D.isProcessing,O=D.restartSession,L=D.warmupDone,M=xC.useCallback((function(){b({popupType:null})}),[b]),F=xC.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(),A.current=performance.now(),v({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,O();case 5:case"end":return e.stop()}}),e)}))),[O,M,v]),U=xC.useCallback((function(){M(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),a()}),[M,a,v]),j=xC.useCallback((function(){M(),setTimeout((function(){E(!0)}),200)}),[M]);return xC.createElement(xC.Fragment,null,!L&&xC.createElement(Kee,{contentStyle:{maxWidth:"300px"}}),c&&xC.createElement(k4,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},xC.createElement("div",null,xC.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),xC.createElement(cle,{y:"".concat(h,"px")},Vue.QR_TOOLTIP[g]),_&&xC.createElement(ule,{key:_,className:"message",y:"".concat(m,"px")},_),N&&xC.createElement(tne,null,xC.createElement("img",{src:T,alt:"",className:"spin"})),xC.createElement(zee,{contentStyle:{maxWidth:"332px"},open:C},w===Fce.QR_INVALID&&xC.createElement(ole,{onRetry:F,onSkip:U}),w===Fce.QR_INSTRUCTIONS&&xC.createElement(Xue,{onClickStart:j,onTimeout:j})))}Ble.propTypes={windowAndVideoInfo:xw.shape({}),onUISpacingChange:xw.func,refVideo:xw.shape({}),settings:xw.shape({}),onCaptureDone:xw.func,outputEncryptionSettings:xw.shape({})},Ble.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var _le=pB(kle||(kle=Ky(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),xle=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons","isLoading","allowedCardTypes"];function Tle(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,a=e.defaultCameraId,i=e.globalStyle,s=e.styledComponent,c=e.frontCamera,u=e.scannerTypeCons,l=e.isLoading,d=e.allowedCardTypes,f=Vy(e,xle),p=f.numberOfCaptures,h=f.stepNumber,m=f.frontSide,g=f.titleIcon,v=f.title,y=f.description,b=f.scannerType,C=f.usePortraitMask,w=f.shouldShowSpinner,k=f.handleQRCaptureDone,S=f.handleIDCardCaptureDone,E=f.handleRestartSession,B=f.refIDCardReader,_=f.handleClickConfirm,x=f.popupType,T=f.popupShown,A=f.popupProps,I=mB(),P=xC.useRef(null),R=Wy(xC.useState(null),2),D=R[0],N=R[1],O=Wy(xC.useState(!1),2),L=O[0],M=O[1],F=e4(I,"IDCapturing.loadingIcon.src","ic_loading.png"),U=Wy(xC.useState({}),2),j=U[0],V=U[1],z=j.yTitle,q=xC.useCallback((function(e){N(e),M(!0)}),[]);xC.useEffect((function(){M(!1)}),[c]);var H=e4(I,"IDCapturing.cardIcon.src",g),K=s.CloseCameraButton;return xC.createElement(cB,{theme:Hte},xC.createElement(Yre,null,xC.createElement(g4,{key:c,frontCamera:c,onVideoPlayed:q,onClose:t,flipHorizontal:c,ref:P,onError:r,defaultCameraId:a,closeButton:K||null},L&&xC.createElement(xC.Fragment,null,b===u.ID_CARD&&xC.createElement(xue,{key:h,ref:B,windowAndVideoInfo:D,refVideo:P,settings:n,onCaptureDone:S,onUISpacingChange:V,frontSide:m,allowedCardTypes:d,description:y,usePortraitMask:C,outputEncryptionSettings:o}),b===u.QR_CODE&&xC.createElement(Ble,{key:h,refVideo:P,windowAndVideoInfo:D,settings:n,onCaptureDone:k,onUISpacingChange:V,outputEncryptionSettings:o})),xC.createElement(Xre,{keyForTransition:p}),xC.createElement(nne,{y:"".concat(z,"px")},xC.createElement(Dte,null,xC.createElement(Bte,{key:v,timeout:{enter:Gre,exit:Gre},classNames:"flipY",unmountOnExit:!0},xC.createElement(one,null,g&&xC.createElement($re,{src:H,alt:""}),xC.createElement(ane,{className:"title"},v))))),(w||l)&&xC.createElement(tne,null,xC.createElement("img",{src:F,alt:"",className:"spin"}))),xC.createElement(zee,{open:T},x===Fce.CONFIRM&&xC.createElement(yoe,Ry({},A,{onConfirm:_,onTryAgain:E,frontSide:m})))),xC.createElement(i,null))}var Ale={allowedCardTypes:xw.arrayOf(xw.string),settings:xw.shape({}),onClose:xw.func,onError:xw.func,outputEncryptionSettings:xw.shape({}),defaultCameraId:xw.string,globalStyle:xw.shape({}),styledComponent:xw.shape({CloseCameraButton:xw.node}),frontCamera:xw.bool,scannerTypeCons:xw.shape({}).isRequired,isLoading:xw.bool},Ile={allowedCardTypes:[],settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:_le,styledComponent:{CloseCameraButton:null},frontCamera:!1,isLoading:!1};Tle.propTypes=Ale,Tle.defaultProps=Ile;var Ple=uL.IDCardSide,Rle=uL.IDCardType,Dle=uL.Errors,Nle={ID_CARD:"id_card",QR_CODE:"qr_code"},Ole=(Nle.ID_CARD,uL.IDCardSide.FRONT,Rle.VN,Nle.ID_CARD,uL.IDCardSide.BACK,Rle.VN,function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n="ph"===r||"en"===t,o={scannerType:Nle.ID_CARD,title:n?"Capture Front Side of ID Card":"Mặt trước CMND/CCCD",description:n?"":"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:uL.IDCardSide.FRONT,cardType:Rle.VN,enableConfirmPopup:!0},a={scannerType:Nle.ID_CARD,title:n?"Capture Back Side of ID Card":"Mặt sau CMND/CCCD",description:n?"":"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:uL.IDCardSide.BACK,cardType:Rle.VN,enableConfirmPopup:!0};return e?[o,a]:[o]}),Lle={scannerType:Nle.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},Mle=function(){return Promise.resolve({card_label:""})},Fle=function(e){var t=e.settings,r=e.onError,n=e.detectIdCard,o=void 0===n?Mle:n,a=e.outputEncryptionSettings,i=e.steps,s=e.onStepDone,c=yj.useSDKSettings().lang,u=null!=i?i:Ole(g5(t,"hasBackCard",!0),c,g5(t,"country")),l=Wy(xC.useState(0),2),d=l[0],f=l[1],p=Wy(xC.useState(u[d]),2),h=p[0],m=p[1],g=Wy(xC.useState(0),2),v=g[0],y=g[1],b=Wy(xC.useState(!1),2),C=b[0],w=b[1],k=xC.useRef({}),S=xC.useRef([]),E=xC.useRef(null),B=xC.useRef(),_=xC.useRef(null),x=Mce(),T=x.showPopup,A=x.popupShown,I=x.popupType,P=x.props,R=h.scannerType,D=h.title,N=h.titleIcon,O=h.cardSide,L=h.description,M=h.usePortraitMask,F=h.cardType,U=h.enableConfirmPopup,j=xC.useCallback((function(e){e>=u.length||setTimeout((function(){f(e),m(u[e])}),200)}),[u]),V=xC.useCallback((function(){j(d+1)}),[j,d]),z=xC.useCallback((function(){setTimeout((function(){m((function(e){return Ny(Ny({},e),Lle)}))}),200)}),[]),q=xC.useCallback((function(){T({popupType:null})}),[T]),H=xC.useCallback((function(){if(q(),E.current=null,R===Nle.QR_CODE)j(d);else if(R===Nle.ID_CARD){var e=null;_.current===Ple.FRONT?e=0:_.current===Ple.BACK&&(e=1),null!==e&&j(e),B.current.restartSession()}}),[j,d,q,R]),K=xC.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Ny({stepNumber:d,cardSide:O,cardType:F,image:k.current},null!=t&&t.enableRecording?{recordedVideos:S.current}:{}),(R===Nle.QR_CODE&&E.current||null!==(r=E.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=E.current),w(!0),e.next=5,s(n);case 5:(o=e.sent)?(_.current=o,w(!1)):(w(!1),E.current=null,V());case 7:case"end":return e.stop()}}),e)}))),[t,d,s,V,R,w,O,F]),W=xC.useCallback((function(e){var t;if(E.current=e,e&&e.recordedVideos){var r,n=e.recordedVideos;(r=S.current).push.apply(r,Gy(n))}y((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);U?T({popupType:Fce.CONFIRM,props:{hasValidQR:o,imageTaken:k.current}}):K()}),[T,U,K]),Q=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var i,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.image,s=n.error,c=n.recordedVideos,k.current=i,S.current=c,y((function(e){return e+1})),O!==uL.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!v5.isMobile){e.next=28;break}if(l=null==i||null===(u=i.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return w(!0),e.prev=9,e.next=12,o({image:i,cardType:F,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(Dle.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,ple(k.current.blob,a);case 24:return(f=e.sent)?W(f):z(),w(!1),e.abrupt("return");case 28:U?T({popupType:Fce.CONFIRM,props:{imageTaken:k.current,error:s}}):K();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[U,T,O,t,F,o,K,z,r,W,a,w]),G=xC.useCallback((function(){q(),K()}),[K,q]);return{numberOfCaptures:v,stepNumber:d,titleIcon:N,title:D,description:L,frontSide:O===Ple.FRONT,scannerType:R,usePortraitMask:M,shouldShowSpinner:C,handleQRCaptureDone:W,handleIDCardCaptureDone:Q,handleRestartSession:H,refIDCardReader:B,handleClickConfirm:G,showPopup:T,popupType:I,popupShown:A,popupProps:P}},Ule={data:{country:"vn",settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},track_card_coordinates:{enable:!1,max_length:150},card_type_check:{enable:!1},blur_check:{enable:!0,threshold_web:.82},disable_capture_button_if_alert:!1,exif_data_settings:{enable:!0},id_detection:{enable:!0},limit_time_settings:{enable:!0,limit_time_second:30,video_partial_length_seconds:15},save_frame_settings:{enable:!1,frames_interval_ms:190,quality_web:80},scan_qr_settings:{enable:!0,limit_time_second:20},virtual_cam_hashes:{web:!1,mobile:!1}}}}}};function jle(e){var t=e.clientSettings,r=Wy(xC.useState(null),2),n=r[0],o=r[1];return xC.useEffect((function(){var e=Rse(Ule,t),r=g5(e,"data.settings.sdk_settings.id_detection_settings.card_type_check.enable"),n=g5(e,"data.country"),a=g5(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),i=g5(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.enable"),s=g5(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.max_length"),c=g5(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),u=g5(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),l=g5(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),d=g5(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),f=g5(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),p=g5(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),h=g5(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),m=g5(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),g=g5(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),v=g5(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),y=g5(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),b=g5(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),C=g5(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),w=g5(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),k=g5(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(v5.isMobile?"mobile":"web")),S=g5(e,"data.card_types[0].has_back_side",!0),E=g5(e,"data.card_types",[]).map((function(e){return null==e?void 0:e.code}));o({country:n,enableRecording:a,trackCardCoordinates:i,trackCardCoordinatesMaxLength:s,enableCardTypeCheck:r,frameCaptureIntervalMs:c,idCardSessionTime:d,maxRecordingTimePerVideo:f,saveFrameQuality:u,enableTimers:l,enableAutoCapture:p,waitForBestImageTimeMs:h,enableBlurCheck:m,blurThreshold:g,disableCaptureButtonIfAlert:v,enableIdDetection:y,enableScanQr:b,scanQrLimitTimeSecond:C,enableExifData:w,enableVirtualCamHashes:k,hasBackCard:S,allowedCardTypesFromSettings:E})}),[t]),{settings:n}}function Vle(e){var t=e.logCredentials,r=e.clientSettings,n=e.uiOnlyComponent,o=e.onError,a=e.detectIdCard,i=e.outputEncryptionSettings,s=e.steps,c=e.onStepDone,u=e.customTheme,l=jle({clientSettings:r}).settings,d=Ry({},Fle({settings:l,onError:o,detectIdCard:a,outputEncryptionSettings:i,steps:s,onStepDone:c}));return xC.createElement(Toe,null,xC.createElement(cB,{theme:u},xC.createElement(Yj.SDKTrackingProvider,{value:{tracking:Ny({},t)}},xC.createElement(n,Ry({},e,{settings:l,scannerTypeCons:Nle},d)))))}var zle={logCredentials:xw.shape({}),clientSettings:xw.shape({}),uiOnlyComponent:xw.func,customTheme:xw.shape({}),onError:xw.func,onStepDone:xw.func,steps:xw.arrayOf(xw.shape({})),detectIdCard:xw.func,outputEncryptionSettings:xw.shape({})};Vle.propTypes=zle,Vle.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:Tle,customTheme:{},onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var qle=function(e){var t=Ry({},e),r=t.clientSettings,n=t.onError,o=t.onStepDone,a=t.logCredentials,i=t.uiOnlyComponent,s=t.detectIdCard,c=t.outputEncryptionSettings,u=t.steps,l=jle({clientSettings:r}).settings,d=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o(Ny(Ny({},t),{},{restartSession:null==f?void 0:f.handleRestartSession}));case 2:return r=e.sent,e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,null==f?void 0:f.handleRestartSession]),f=Ry({},Fle({settings:l,onError:n,detectIdCard:s,outputEncryptionSettings:c,steps:u,onStepDone:d}));return xC.createElement(Toe,null,xC.createElement(Yj.SDKTrackingProvider,{value:{tracking:Ny({},a)}},xC.createElement(i,Ry({},t,{onStepDone:d,settings:l,scannerTypeCons:Nle},f))))};function Hle(e){var t=e.sdkAdapter;return t instanceof CK?xC.createElement(qle,Ny({sdkAdapter:t},e)):xC.createElement(Vle,e)}qle.propTypes={clientSettings:xw.shape({}),onError:xw.func,onStepDone:xw.func,logCredentials:xw.shape({}),readIDCardUIOnlyComponent:xw.func,uiOnlyComponent:xw.func,sdkAdapter:xw.shape({}),steps:xw.arrayOf(xw.shape({})),detectIdCard:xw.func,outputEncryptionSettings:xw.shape({})},qle.defaultProps={clientSettings:void 0,onError:function(){},onStepDone:function(){},logCredentials:{enable:!0},readIDCardUIOnlyComponent:Vle,uiOnlyComponent:Tle,sdkAdapter:null,steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var Kle={sdkAdapter:xw.shape({})};Hle.propTypes=Kle,Hle.defaultProps={sdkAdapter:null};var Wle=uL.IDCardSide,Qle=uL.Errors;function Gle(e){return Xle.apply(this,arguments)}function Xle(){return(Xle=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.cardType,o=t.cardSide,a=t.apiClient,i=t.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(o)},!i||!i.key){e.next=4;break}return e.abrupt("return",a.httpClient.post("/v1/images",Ny({base64:r.encrypted.hex},s),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",a.uploadImage(Ny({file:r.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yle(e){return $le.apply(this,arguments)}function $le(){return($le=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.apiClient,o=t.rawString,a=t.outputEncryptionSettings,i={label:"qr_code",metadata:JSON.stringify({raw:o})},!a||!a.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",Ny({base64:r.encrypted.hex},i),{"X-TV-Key":a.key}));case 4:return e.abrupt("return",n.uploadImage(Ny({file:r.blob},i)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zle(e){return Jle.apply(this,arguments)}function Jle(){return(Jle=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 ede(e){return tde.apply(this,arguments)}function tde(){return(tde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.cardType,o=t.frontCardId,a=t.isCapturingFrontSide,i=t.backCardId,s=t.recordedVideos,c=void 0===s?[]:s,u=t.qrImageId,l=c.filter((function(e){return null!==e.id})),d=c.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=5,Promise.all(d.map((function(e){return r.fileService.request({frames:e.frames})})));case 5:return f=e.sent,p={card_type:n,image:{id:o},image2:a?void 0:{id:i},videos:[].concat(Gy(l.map((function(e){return{id:e.id}}))),Gy(f.map((function(e){return{id:e.data.file_id}}))))},u&&(p.qr1_images=[{id:u}]),e.abrupt("return",r.detectIDTampering(p));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rde(e){return nde.apply(this,arguments)}function nde(){return(nde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,n=t.apiClient,o=t.frontCardId,a=t.backCardId,i=t.isCapturingFrontSide,s=t.qrImageId,c={card_type:r,image1:i?{id:o}:{id:a}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ode(e){return ade.apply(this,arguments)}function ade(){return(ade=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,o=t.frontCardId,a=t.qrImageId,i=t.onError,s=t.recordedVideos,c=t.apiClient,u=t.cardType,l=t.cardSide,d=t.qrScannedResult,f=t.outputEncryptionSettings,l!==Wle.BACK||o){e.next=4;break}return i(Qle.missing_front_id_card),e.abrupt("return");case 4:return p=[Gle({image:n,cardType:u,cardSide:l,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&p.push(Yle({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 i(Ny(Ny({},Qle.upload_error),{},{details:g.errors})),e.abrupt("return");case 15:return y=g.data.image_id,b=(null==v||null===(r=v.data)||void 0===r?void 0:r.image_id)||a,(k=l===Wle.FRONT)?C=y:(C=o,w=y),e.next=21,Zle({imageId:y,cardType:u,apiClient:c});case 21:if(!(S=e.sent).errors){e.next=25;break}return i(Ny(Ny({},Qle.sanity_check_error),{},{details:S.errors})),e.abrupt("return");case 25:return e.next=27,rde({cardType:u,apiClient:c,frontCardId:C,backCardId:w,isCapturingFrontSide:k,qrImageId:b});case 27:if(!(E=e.sent).errors){e.next=31;break}return i(Ny(Ny({},Qle.read_id_card_error),{},{details:E.errors})),e.abrupt("return");case 31:return e.next=33,ede({apiClient:c,cardType:u,frontCardId:C,isCapturingFrontSide:k,backCardId:w,recordedVideos:s,qrImageId:b});case 33:if(!(B=e.sent).errors){e.next=37;break}return i(Ny(Ny({},Qle.detect_id_tampering_error),{},{details:B.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:S.data,tamperingInfo:B.data,cardInfo:E.data,qrImageId:b});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ide=["readIDCardUIOnlyComponent"],sde=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],cde=uL.Errors,ude=function(e){var t=e.readIDCardUIOnlyComponent,r=Vy(e,ide),n=r.onError,o=r.onStepDone,a=r.apiCredentials,i=r.logCredentials,s=r.outputEncryptionSettings,c=Vy(r,sde),u=Wy(xC.useState(null),2),l=u[0],d=u[1],f=fq.useApiClient({apiCredentials:a,logCredentials:i}).apiClient,p=xC.useRef(""),h=xC.useRef("");xC.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=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,a,i,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,a=t.cardSide,i=t.recordedVideos,c=t.qrScannedResult,u=t.image,l=null,e.prev=2,e.next=5,ode({image:u,cardSide:a,frontCardId:p.current,qrImageId:h.current,onError:n,apiClient:f,cardType:r,recordedVideos:i,qrScannedResult:c,outputEncryptionSettings:s});case 5:l=e.sent,a===uL.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({},cde.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&&xC.createElement(t,Ry({logCredentials:i,onError:n,onStepDone:m,outputEncryptionSettings:s},c,{clientSettings:l}))};function lde(){return dde.apply(this,arguments)}function dde(){return(dde=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.tfScriptUrls,a=t.blazefaceModelUrl,i=t.closeEyesModelUrl,s=new $ce,e.prev=2,Vq.loadTensorFlow(o).then((function(){Vq.loadBlazefaceModel({modelUrl:a})})),e.next=6,Promise.all([v7({closeEyesModelUrl:i}),s.loadResource({modelUrl:n}),Wce({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)}ude.propTypes={onError:xw.func,onStepDone:xw.func,apiCredentials:xw.shape({accessKey:xw.string,secretKey:xw.string,apiUrl:xw.string}),logCredentials:xw.shape({}),outputEncryptionSettings:xw.shape({}),readIDCardUIOnlyComponent:xw.func},ude.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:Hle};var fde=g7(lde),pde={retries:{id_card_sanity:3,portrait_sanity:3,face_liveness_with_card_tampering_ocr:3,compare_faces:3},services:{card_sanity:!0,card_tampering:!0,card_ocr:!0,face_sanity:!0,face_liveness:!0,compare_faces:!0,search_face:!0,index_face:!0}},hde={ID_CARD:"ID_CARD",FACE_LIVENESS:"FACE_LIVENESS",IDLE:"IDLE"},mde={},gde={REACH_RETRY_LIMIT:{en:"You have reached the retry limit. Please try again later.",vi:"Bạn đã vượt quá số lần thử. Vui lòng thử lại sau."},FAIL_STEP:{en:"Please try again at step: <%= step %>.",vi:"Vui lòng thử lại ở bước: <%= step %>."},FAIL_FRONT_CARD_SANITY:{en:"The front side of your ID card failed sanity check.",vi:"Hình ảnh Mặt trước của GTTT không đạt chất lượng yêu cầu."},FAIL_FRONT_CARD_TAMPERING:{en:"The front side of your ID card failed tampering check.",vi:"Hình ảnh Mặt trước của GTTT không hợp lệ."},FAIL_FRONT_CARD_OCR:{en:"Cannot read information on the front side of your ID card.",vi:"Không đọc được thông tin từ hình ảnh Mặt trước của GTTT."},FAIL_BACK_CARD_SANITY:{en:"The back side of your ID card failed sanity check.",vi:"Hình ảnh Mặt sau của GTTT không đạt chất lượng yêu cầu."},FAIL_BACK_CARD_TAMPERING:{en:"The back side of your ID card failed tampering check.",vi:"Hình ảnh Mặt sau của GTTT không hợp lệ."},FAIL_BACK_CARD_OCR:{en:"Cannot read information on the back side of your ID card.",vi:"Không đọc được thông tin từ hình ảnh Mặt sau của GTTT."},FAIL_FACE_SANITY:{en:"Selfie step failed sanity check.",vi:"Hình ảnh khuôn mặt không đạt chất lượng yêu cầu."},FAIL_FACE_LIVENESS:{en:"Selfie step failed liveness check.",vi:"Hình ảnh khuôn mặt không hợp lệ."},FAIL_COMPARE_FACE:{en:"Failed compare faces between ID photo and selfie.",vi:"Hình ảnh khuôn mặt trên GTTT không giống hình chụp chân dung"},RETRY_BUTTON:{en:"Retry",vi:"Thử lại"},STOP_BUTTON:{en:"Stop",vi:"Dừng"},FRONT_CARD:{en:"Front Card",vi:"Mặt trước"},BACK_CARD:{en:"Back Card",vi:"Mặt sau"},ID_CARD:{en:"ID Card",vi:"Thẻ ID"},FACE_LIVENESS:{en:"Face Liveness",vi:"Nhận diện khuôn mặt"}},vde=O8((function(e,t,r,n){Ise(e,t,r,n)})),yde=vde,bde=["restartSession"],Cde=["detectIDTamperingBackground","readIDCardBackground"],wde=["restartSession"],kde=["detectIDTamperingBackground","readIDCardBackground"];function Sde(e){return"object"===By(e)&&"function"==typeof e.then}function Ede(e){if(!Sde(e))return"pending";var t={};return Promise.race([e,t]).then((function(e){return e===t?"pending":"fulfilled"}),(function(){return"rejected"}))}var Bde,_de,xde,Tde=function(e,t){return null===t?e:t},Ade=function(e){var t=g5(e,"data.settings.sdk_settings.sdk_adapter.services",null),r=g5(e,"data.settings.sdk_settings.sdk_adapter.retries",null),n=yde(pde.services,t,Tde),o=yde(pde.retries,r,Tde);return{cardSanityRetries:o.id_card_sanity,portraitSanityRetries:o.portrait_sanity,faceLivenessCardTamperingOCRRetries:o.face_liveness_with_card_tampering_ocr,compareFacesRetries:o.compare_faces,services:n}},Ide=function(e,t){if(!g5(t,"face_sanity"))return!1;var r=g5(e,"verifyFacePortraitResult.status",""),n=g5(e,"verifyFacePortraitResult.portrait_sanity.verdict","");return"success"!==r||"good"!==n},Pde=function(){var e=xy(regeneratorRuntime.mark((function e(t,r,n){var o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E,B,_,x,T,A,I,P,R,D,N,O,L,M,F,U,j,V,z,q,H;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=!1,!g5(r,"card_tampering")){e.next=29;break}return a=g5(t.current,"frontCard.apiResult.detectIDTamperingBackground"),e.next=5,Ede(a);case 5:if("fulfilled"!==e.sent){e.next=15;break}return e.next=9,g5(t.current,"frontCard.apiResult.detectIDTamperingBackground");case 9:d=e.sent,f=d.result,p=d.message,h=Nde(f,r),t.current=Ny(Ny({},t.current),{},{frontCard:Ny(Ny({},null!==(i=null===(s=t.current)||void 0===s?void 0:s.frontCard)&&void 0!==i?i:{}),{},{apiResult:Ny(Ny({},null!==(c=null===(u=t.current)||void 0===u||null===(l=u.frontCard)||void 0===l?void 0:l.apiResult)&&void 0!==c?c:{}),{},{tamperingInfo:Ny(Ny({},null==f?void 0:f.data),{},{message:g5(p,h?"error":"success")})})})}),o=o||h;case 15:if(!n){e.next=29;break}return m=g5(t.current,"backCard.apiResult.detectIDTamperingBackground"),e.next=19,Ede(m);case 19:if("fulfilled"!==e.sent){e.next=29;break}return e.next=23,g5(t.current,"backCard.apiResult.detectIDTamperingBackground");case 23:w=e.sent,k=w.result,S=w.message,E=Nde(k,r),t.current=Ny(Ny({},t.current),{},{backCard:Ny(Ny({},null!==(g=null===(v=t.current)||void 0===v?void 0:v.backCard)&&void 0!==g?g:{}),{},{apiResult:Ny(Ny({},null!==(y=null===(b=t.current)||void 0===b||null===(C=b.backCard)||void 0===C?void 0:C.apiResult)&&void 0!==y?y:{}),{},{tamperingInfo:Ny(Ny({},null==k?void 0:k.data),{},{message:g5(S,E?"error":"success")})})})}),o=o||E;case 29:if(!g5(r,"card_ocr")){e.next=57;break}return B=g5(t.current,"frontCard.apiResult.readIDCardBackground"),e.next=33,Ede(B);case 33:if("fulfilled"!==e.sent){e.next=43;break}return e.next=37,g5(t.current,"frontCard.apiResult.readIDCardBackground");case 37:P=e.sent,R=P.result,D=P.message,N="success"===g5(R,"data.status",""),t.current=Ny(Ny({},t.current),{},{frontCard:Ny(Ny({},null!==(_=null===(x=t.current)||void 0===x?void 0:x.frontCard)&&void 0!==_?_:{}),{},{apiResult:Ny(Ny({},null!==(T=null===(A=t.current)||void 0===A||null===(I=A.frontCard)||void 0===I?void 0:I.apiResult)&&void 0!==T?T:{}),{},{cardInfo:Ny(Ny({},null==R?void 0:R.data),{},{message:g5(D,N?"success":"error")})})})}),o=o||Nde(R,r);case 43:if(!n){e.next=57;break}return O=g5(t.current,"backCard.apiResult.readIDCardBackground"),e.next=47,Ede(O);case 47:if("fulfilled"!==e.sent){e.next=57;break}return e.next=51,g5(t.current,"backCard.apiResult.readIDCardBackground");case 51:V=e.sent,z=V.result,q=V.message,H="success"===g5(z,"data.status",""),t.current=Ny(Ny({},t.current),{},{backCard:Ny(Ny({},null!==(L=null===(M=t.current)||void 0===M?void 0:M.backCard)&&void 0!==L?L:{}),{},{apiResult:Ny(Ny({},null!==(F=null===(U=t.current)||void 0===U||null===(j=U.backCard)||void 0===j?void 0:j.apiResult)&&void 0!==F?F:{}),{},{cardInfo:Ny(Ny({},null==z?void 0:z.data),{},{message:g5(q,H?"success":"error")})})})}),o=o||Nde(z,r);case 57:return e.abrupt("return",o);case 58:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),Rde=function(e){var t=g5(e,"verifyFaceLivenessResult.is_live",!1),r=g5(e,"verifyFaceLivenessResult.status","");return!t||"success"!==r},Dde=function(e,t){if(!g5(t,"card_sanity"))return!1;var r=g5(e,"apiResult.sanityResult.status",""),n=g5(e,"apiResult.sanityResult.card_sanity.verdict","");return"success"!==r||"good"!==n},Nde=function(e,t){return!!g5(e,"errors")||(g5(t,"card_tampering")&&Object.prototype.hasOwnProperty.call(null==e?void 0:e.data,"card_tampering")?"success"!==g5(e,"data.status","")||"good"!==g5(e,"data.card_tampering.verdict",""):!(!g5(t,"card_ocr")||!Object.prototype.hasOwnProperty.call(null==e?void 0:e.data,"card_information"))&&"success"!==g5(e,"data.status",""))},Ode=function(e){var t,r=g5(e,"compare_faces",[]);return"matched"!==(null===(t=r[0])||void 0===t?void 0:t.result)||1!==r.filter((function(e){return"matched"===(null==e?void 0:e.result)})).length||e.errors},Lde=function(){var e=xy(regeneratorRuntime.mark((function e(t,r,n){var o,a,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=!1,!g5(r,"card_tampering")){e.next=18;break}return e.next=4,g5(t.current,"frontCard.apiResult.detectIDTamperingBackground");case 4:if(a=e.sent,i=a.result,s=a.message,c=Nde(i,r),o=o||c,t.current=Ny(Ny({},t.current),{},{frontCard:Ny(Ny({},t.current.frontCard),{},{apiResult:Ny(Ny({},t.current.frontCard.apiResult),{},{tamperingInfo:Ny(Ny({},null==i?void 0:i.data),{},{message:g5(s,c?"error":"success")})})})}),!n){e.next=18;break}return e.next=13,g5(t.current,"backCard.apiResult.detectIDTamperingBackground");case 13:u=e.sent,l=u.result,d=Nde(l,r),o=o||d,t.current=Ny(Ny({},t.current),{},{backCard:Ny(Ny({},t.current.backCard),{},{apiResult:Ny(Ny({},t.current.backCard.apiResult),{},{tamperingInfo:Ny(Ny({},null==l?void 0:l.data),{},{message:g5(s,d?"error":"success")})})})});case 18:if(!g5(r,"card_ocr")){e.next=35;break}return e.next=21,g5(t.current,"frontCard.apiResult.readIDCardBackground");case 21:if(f=e.sent,p=f.result,h=f.message,m="success"===g5(p,"data.status",""),o=o||!m,t.current=Ny(Ny({},t.current),{},{frontCard:Ny(Ny({},t.current.frontCard),{},{apiResult:Ny(Ny({},t.current.frontCard.apiResult),{},{cardInfo:Ny(Ny({},null==p?void 0:p.data),{},{message:g5(h,m?"success":"error")})})})}),!n){e.next=35;break}return e.next=30,g5(t.current,"backCard.apiResult.readIDCardBackground");case 30:g=e.sent,v=g.result,y="success"===g5(v,"data.status",""),o=o||!y,t.current=Ny(Ny({},t.current),{},{backCard:Ny(Ny({},t.current.backCard),{},{apiResult:Ny(Ny({},t.current.backCard.apiResult),{},{cardInfo:Ny(Ny({},null==v?void 0:v.data),{},{message:g5(h,y?"success":"error")})})})});case 35:return e.abrupt("return",o);case 36:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),Mde=function e(t){for(var r in t)"message"===r||"step"===r?delete t[r]:"object"===By(t[r])&&e(t[r]);return t},Fde=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Mde(t.current),n=g5(r,"frontCard",{}),n.restartSession,o=Vy(n,bde),a=g5(r,"frontCard.apiResult",{}),a.detectIDTamperingBackground,a.readIDCardBackground,i=Vy(a,Cde),s=g5(r,"backCard",{}),s.restartSession,c=Vy(s,wde),u=g5(r,"backCard.apiResult",{}),u.detectIDTamperingBackground,u.readIDCardBackground,l=Vy(u,kde),e.abrupt("return",Ny(Ny(Ny({},r),g5(r,"frontCard",null)?{frontCard:Ny(Ny({},o),{},{apiResult:i})}:{}),g5(r,"backCard",null)?{backCard:Ny(Ny({},c),{},{apiResult:l})}:{}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ude=function(e,t,r){var n=[];if(g5(e,"frontCard.apiResult.sanityResult")&&"good"!==g5(e,"frontCard.apiResult.sanityResult.card_sanity.verdict","")){var o=g5(e,"frontCard.apiResult.sanityResult.message",null);null!=o&&o[r]?n.push(o[r]):n.push(gde.FAIL_FRONT_CARD_SANITY[r])}if(g5(e,"frontCard.apiResult.tamperingInfo")&&"good"!==g5(e,"frontCard.apiResult.tamperingInfo.card_tampering.verdict","")){var a=g5(e,"frontCard.apiResult.tamperingInfo.message",null);null!=a&&a[r]?n.push(a[r]):n.push(gde.FAIL_FRONT_CARD_TAMPERING[r])}if(g5(e,"frontCard.apiResult.cardInfo")&&"success"!==g5(e,"frontCard.apiResult.cardInfo.status","")){var i=g5(e,"frontCard.apiResult.cardInfo.message",null);null!=i&&i[r]?n.push(i[r]):n.push(gde.FAIL_FRONT_CARD_OCR[r])}if(g5(e,"backCard.apiResult.sanityResult")&&"good"!==g5(e,"backCard.apiResult.sanityResult.card_sanity.verdict","")){var s=g5(e,"backCard.apiResult.sanityResult.message",null);null!=s&&s[r]?n.push(s[r]):n.push(gde.FAIL_BACK_CARD_SANITY[r])}if(g5(e,"backCard.apiResult.tamperingInfo")&&"good"!==g5(e,"backCard.apiResult.tamperingInfo.card_tampering.verdict","")){var c=g5(e,"backCard.apiResult.tamperingInfo.message",null);null!=c&&c[r]?n.push(c[r]):n.push(gde.FAIL_BACK_CARD_TAMPERING[r])}if(g5(e,"backCard.apiResult.cardInfo")&&"success"!==g5(e,"backCard.apiResult.cardInfo.status","")){var u=g5(e,"backCard.apiResult.cardInfo.message",null);null!=u&&u[r]?n.push(u[r]):n.push(gde.FAIL_BACK_CARD_OCR[r])}if(g5(e,"faceLiveness.verifyFacePortraitResult")&&"good"!==g5(e,"faceLiveness.verifyFacePortraitResult.portrait_sanity.verdict","")){var l=g5(e,"faceLiveness.verifyFacePortraitResult.message",null);null!=l&&l[r]?n.push(l[r]):n.push(gde.FAIL_FACE_SANITY[r])}if(g5(e,"faceLiveness.verifyFaceLivenessResult")&&!g5(e,"faceLiveness.verifyFaceLivenessResult.is_live",!1)){var d=g5(e,"faceLiveness.verifyFaceLivenessResult.message",null);null!=d&&d[r]?n.push(d[r]):n.push(gde.FAIL_FACE_LIVENESS[r])}if(g5(e,"compareFaces",null)&&Ode(g5(e,"compareFaces"))){var f=g5(e,"compareFaces.message",null);null!=f&&f[r]?n.push(f[r]):n.push(gde.FAIL_COMPARE_FACE[r])}return{retryAt:t,results:n}},jde=function(e,t){var r=Array.isArray(t)?t.map((function(t){return gde[t][e]})).join(", "):gde[t][e];return e7(gde.FAIL_STEP[e])({step:r})},Vde=function(e){var t=g5(e,"frontCard.apiResult.cardInfo.card_information",[]).find((function(e){return"id"===e.field}));return g5(t,"value","")},zde=["livenessMode","sdkAdapter","onError","services","hasBackCard"],qde=uL.Errors,Hde=uL.IDCardSide,Kde=uL.FaceDirection,Wde=uL.Mode;function Qde(e){return Gde.apply(this,arguments)}function Gde(){return(Gde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S,E,B,_,x,T,A,I,P,R,D,N,O,L,M,F,U,j,V,z,q;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.hasBackCard,a=t.stepResult,i=t.frontCardId,s=t.qrImageId,c=t.sdkAdapter,u=t.onError,l=t.checkFinishAndFailCardTamperingOrOCR,d=t.refEkycResult,f=t.handleFailCardTamperingOCRBackground,p=t.services,c instanceof CK){e.next=3;break}return e.abrupt("return",a);case 3:if(h=a.cardSide,m=a.cardType,g=a.recordedVideos,v=a.qrScannedResult,y=a.image,h!==Hde.BACK||i){e.next=7;break}return u(qde.missing_front_id_card),e.abrupt("return",!1);case 7:return b=c.uploadImage,C=c.uploadFiles,w=c.requestVerifyIDCard,k=c.detectIDTampering,S=c.readIDCard,E=[b({file:null==y?void 0:y.blob,label:"id_card.".concat(m,".").concat(h)})],v&&v.image&&v.result&&E.push(b({file:v.image.blob,label:"qr_code",rawString:v.result})),e.next=12,Promise.all(E);case 12:if(B=e.sent,_=Wy(B,2),x=_[0],T=_[1],!x.errors){e.next=19;break}return u(Ny(Ny({},qde.upload_error),{},{details:x.reason})),e.abrupt("return",!1);case 19:if(A=null==x||null===(r=x.data)||void 0===r?void 0:r.image_id,I=(null==T||null===(n=T.data)||void 0===n?void 0:n.image_data)||s,h===Hde.FRONT?P=A:(P=i,R=A),D={qrImageId:I,frontCardId:P,backCardId:R},!g5(p,"card_sanity")){e.next=32;break}return e.next=26,w({card_type:m,image1:{id:h===Hde.FRONT?P:R}});case 26:if(N=e.sent,O=N.result,L=N.message,"good"===g5(O,"data.card_sanity.verdict","")&&!O.errors){e.next=31;break}return e.abrupt("return",Ny(Ny({},a),{},{apiResult:Ny(Ny({},D),{},{sanityResult:Ny(Ny({},null==O?void 0:O.data),{},{message:g5(L,"error")}),failSanity:!0})}));case 31:D=Ny(Ny({},D),{},{sanityResult:Ny(Ny({},null==O?void 0:O.data),{},{message:g5(L,"success")})});case 32:if(h!==Hde.BACK){e.next=40;break}if("function"!=typeof l||"function"!=typeof f){e.next=40;break}return e.next=36,l(d,p,o);case 36:if(!e.sent){e.next=40;break}return f(),e.abrupt("return",Ny(Ny({},a),{},{apiResult:Ny(Ny({},D),{},{failSanity:!0})}));case 40:if(!g5(p,"card_tampering")){e.next=51;break}if(F=Ny({card_type:m,image:{id:P}},h===Hde.FRONT?{image2:void 0,level:"1"}:{image2:{id:R},level:"concurrent"}),I&&(F.qr1_images=[{id:I}]),!(g.length>0)){e.next=50;break}return U=g.filter((function(e){return null!==e.id})),j=g.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=48,Promise.all(j.map((function(e){return C({frames:e.frames})})));case 48:V=e.sent,F.videos=[].concat(Gy(U.map((function(e){return{id:e.id}}))),Gy(V.map((function(e){return{id:e.data.file_id}}))));case 50:M=k(F);case 51:return g5(p,"card_ocr")&&(q={card_type:m,image1:h===Hde.FRONT?{id:P}:{id:R}},I&&(q.qr1_images={id:I}),z=S(q)),e.abrupt("return",Ny(Ny({},a),{},{apiResult:Ny(Ny({},D),{},{detectIDTamperingBackground:M,readIDCardBackground:z})}));case 53:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xde(e){return Yde.apply(this,arguments)}function Yde(){return(Yde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepResult,n=t.sdkAdapter,o=t.services,a=r.faceVerificationFlowData,i=r.captureFrameSettings,s=r.capturedFrames,c=n.uploadImage,u=n.verifyFaceLiveness,l=n.requestVerifyPortrait,d=a.current.steps,f=[],d.forEach((function(e){var t=e.name,r=e.image,n=e.frontalFaceImage;t!==Kde.FRONTAL?f.push(c({file:r.blob,label:"portrait",metadata:JSON.stringify({gesture_score:r.leftRightScore,gesture:t})})):f.push(Promise.resolve({data:{image_id:null}})),n.blob?f.push(c({file:n.blob,label:"portrait",metadata:JSON.stringify({gesture_score:n.leftRightScore,gesture:Kde.FRONTAL})})):f.push(Promise.resolve({data:{image_id:null}}))})),e.next=8,Promise.all(f);case 8:if(p=e.sent,d.forEach((function(e,t){e.image.imageId=p[2*t].data.image_id,e.frontalFaceImage.imageId=p[2*t+1].data.image_id})),0!==(h=d.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=13;break}return e.abrupt("return",{error:"wrong_face_movement"});case 13:return e.next=15,_7();case 15:if(m=x7(i)){e.next=18;break}return e.abrupt("return",{error:"network_error"});case 18:if(g={frontalFaces:h.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:d.filter((function(e){return e.image.imageId&&e.name!==Kde.FRONTAL})).map((function(e){var t=e.name,r=e.image;return{name:t,blob:r.blob,id:r.imageId}})),capturedFrames:s},!g5(o,"face_sanity")){e.next=28;break}return e.next=22,l({image:{id:h[h.length-1].frontalFaceImage.imageId}});case 22:if(v=e.sent,y=v.result,b=v.message,"good"===g5(y,"data.portrait_sanity.verdict","")&&!g5(y,"errors")){e.next=27;break}return e.abrupt("return",Ny(Ny({},g),{},{verifyFacePortraitResult:Ny(Ny({},y.data),{},{message:g5(b,"error")})}));case 27:g=Ny(Ny({},g),{},{verifyFacePortraitResult:Ny(Ny({},y.data),{},{message:g5(b,"success")})});case 28:if(!g5(o,"face_liveness")){e.next=36;break}return e.next=31,u({images:h.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:d.filter((function(e){return e.image.imageId&&e.name!==Kde.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:m});case 31:C=e.sent,w=C.result,k=C.message,S=g5(w,"data.is_live"),g=Ny(Ny({},g),{},{verifyFaceLivenessResult:Ny(Ny({},w.data),{},{message:g5(k,S?"success":"error")})});case 36:return e.abrupt("return",g);case 37:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $de(e){return Zde.apply(this,arguments)}function Zde(){return(Zde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.stepResult,n=t.sdkAdapter,o=t.services,a=r.imageAddedExif,i=r.frontalFaceImages,s=r.capturedFrames,c=n.uploadImage,u=n.verifyFaceLiveness,l=n.requestVerifyPortrait,d=i.map((function(e,t){return c({file:a[t],label:"portrait",metadata:{gesture_score:e.leftRightScore,gesture:Kde.FRONTAL}})})),e.next=6,Promise.all(d);case 6:if(f=e.sent,p=f.map((function(e){var t;return{id:null==e||null===(t=e.data)||void 0===t?void 0:t.image_id}})),h={images:p,capturedFrames:s,frontalFaces:a.map((function(e,t){var r;return{blob:e,id:null===(r=p[t])||void 0===r?void 0:r.id}}))},!g5(o,"face_sanity")){e.next=17;break}return e.next=12,l({image:{id:p[p.length-1].id}});case 12:if(m=e.sent,g=m.result,"good"===g5(g,"data.portrait_sanity.verdict","")&&!g5(g,"errors")){e.next=16;break}return e.abrupt("return",Ny(Ny({},r),{},{verifyFacePortraitResult:g.data}));case 16:h=Ny(Ny({},h),{},{verifyFacePortraitResult:g.data});case 17:return e.next=19,u({images:p.map((function(e){return{id:e.id}}))});case 19:return v=e.sent,y=v.result,e.abrupt("return",Ny(Ny({},h),{},{verifyFaceLivenessResult:y.data}));case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jde(e){return efe.apply(this,arguments)}function efe(){return(efe=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.stepResult,n=t.sdkAdapter,o=t.services,(a=r.mode)!==Wde.ACTIVE){e.next=4;break}return e.abrupt("return",Xde({stepResult:r,sdkAdapter:n,services:o}));case 4:if(a!==Wde.PASSIVE){e.next=6;break}return e.abrupt("return",$de({stepResult:r,sdkAdapter:n,services:o}));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tfe(e){return rfe.apply(this,arguments)}function rfe(){return(rfe=xy(regeneratorRuntime.mark((function e(t){var r,n,o,a,i,s,c,u,l,d,f,p,h,m,g,v,y,b,C,w,k,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.livenessMode,n=t.sdkAdapter,t.onError,o=t.services,a=t.hasBackCard,i=Vy(t,zde),n instanceof CK){e.next=3;break}return e.abrupt("return",i);case 3:if(s=n.compareFaces,c=n.searchFaces,u=n.indexFaces,l=g5(t,"frontCard.apiResult.frontCardId",null),d=g5(t,"backCard.apiResult.backCardId",null),f=null,p=g5(t,"faceLiveness.frontalFaces",[]),f=null===(r=p[p.length-1])||void 0===r?void 0:r.id,l&&(!a||d)&&f){e.next=11;break}return e.abrupt("return");case 11:if(h=Ny({},i),!g5(o,"compare_faces")){e.next=21;break}return e.next=15,s({image1:{id:l},image2:{id:f}});case 15:if(m=e.sent,g=m.result,v=m.message,!Ode(g5(g,"data"))){e.next=20;break}return e.abrupt("return",Ny(Ny({},h),{},{step:hde.ID_CARD,compareFaces:Ny(Ny({},null==g?void 0:g.data),{},{message:v})}));case 20:h=Ny(Ny({},h),{},{compareFaces:Ny(Ny({},null==g?void 0:g.data),{},{message:v})});case 21:if(!g5(o,"search_face")){e.next=30;break}return e.next=24,c({image:{id:f}});case 24:if(y=e.sent,b=y.result,!((C=g5(b,"data.faces",null))||Array.isArray(C)&&C.length)){e.next=29;break}return e.abrupt("return",Ny(Ny({},h),{},{searchFaces:null==b?void 0:b.data}));case 29:h=Ny(Ny({},h),{},{searchFaces:null==b?void 0:b.data});case 30:if(!g5(o,"index_face")){e.next=37;break}return w=Vde(t),e.next=34,u({image:Ny({id:f},w?{metadata:JSON.stringify({id:Vde(t)})}:{})});case 34:k=e.sent,S=k.result,h=Ny(Ny({},h),{},{indexFaces:null==S?void 0:S.data});case 37:return e.abrupt("return",h);case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var nfe,ofe,afe=dB.div(Bde||(Bde=Ky(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),ife=dB.button(_de||(_de=Ky(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: #0276f1;\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"]))),sfe=dB.div(xde||(xde=Ky(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),cfe=function(e){var t=e.onRetry,r=e.onStop,n=e.children,o=yj.useSDKSettings().lang;return xC.createElement(afe,null,n,xC.createElement(sfe,null,xC.createElement(ife,{onClick:r},gde.STOP_BUTTON[o]),xC.createElement(ife,{onClick:t},gde.RETRY_BUTTON[o])))};cfe.propTypes={children:xw.node,onRetry:xw.func,onStop:xw.func},cfe.defaultProps={children:null,onRetry:function(){},onStop:function(){}};var ufe=dB.div(nfe||(nfe=Ky(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),lfe=dB.button(ofe||(ofe=Ky(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: #0276f1;\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"]))),dfe=function(e){var t=e.onStop,r=e.children,n=yj.useSDKSettings().lang;return xC.createElement(ufe,null,r,xC.createElement(lfe,{onClick:t},gde.STOP_BUTTON[n]))};dfe.propTypes={children:xw.node,onStop:xw.func},dfe.defaultProps={children:null,onStop:function(){}};var ffe={FAIL_CARD_SANITY:"FAIL_CARD_SANITY",FAIL_FACE_SANITY:"FAIL_FACE_SANITY",FAIL_LIVENESS_TAMPERING_OCR_RETRY_ID:"FAIL_LIVENESS_TAMPERING_OCR_RETRY_ID",FAIL_LIVENESS_TAMPERING_OCR_RETRY_FACE:"FAIL_LIVENESS_TAMPERING_OCR_RETRY_FACE",FAIL_COMPARE_FACES:"FAIL_COMPARE_FACES",RESET_ACTIONS:"RESET_ACTIONS",SET_STEP:"SET_STEP"},pfe={currentStep:null,readIdCardKey:0,faceLivenessKey:0,cardSanityTrials:-1,compareFacesTrials:-1,portraitSanityTrials:-1,faceLivenessCardTamperingOCRTrials:-1};function hfe(e,t){switch(t.type){case ffe.FAIL_CARD_SANITY:return Ny(Ny({},e),{},{cardSanityTrials:e.cardSanityTrials+1});case ffe.FAIL_FACE_SANITY:return Ny(Ny({},e),{},{portraitSanityTrials:e.portraitSanityTrials+1,faceLivenessKey:e.faceLivenessKey+1});case ffe.FAIL_LIVENESS_TAMPERING_OCR_RETRY_ID:return Ny(Ny({},e),{},{readIdCardKey:e.readIdCardKey+1,faceLivenessCardTamperingOCRTrials:e.faceLivenessCardTamperingOCRTrials+1,currentStep:hde.ID_CARD});case ffe.FAIL_LIVENESS_TAMPERING_OCR_RETRY_FACE:return Ny(Ny({},e),{},{faceLivenessKey:e.faceLivenessKey+1,faceLivenessCardTamperingOCRTrials:e.faceLivenessCardTamperingOCRTrials+1,currentStep:hde.FACE_LIVENESS});case ffe.FAIL_COMPARE_FACES:return Ny(Ny({},e),{},{compareFacesTrials:e.compareFacesTrials+1,readIdCardKey:e.readIdCardKey+1,faceLivenessKey:e.faceLivenessKey+1,currentStep:hde.ID_CARD});case ffe.SET_STEP:return Ny(Ny({},e),{},{currentStep:t.payload});case ffe.RESET_ACTIONS:return pfe;default:return e}}var mfe=uL.IDCardSide,gfe=uL.Errors,vfe={padding:50,paddingBottom:20},yfe=function(e){var t=e.content,r=e.lang,n=e.isStopPopup,o=void 0!==n&&n;return xC.createElement(xC.Fragment,null,xC.createElement("div",{style:vfe},t.results.map((function(e,t){return xC.createElement("div",{key:t},e)}))),o?null:xC.createElement("div",{style:{padding:50,paddingBottom:0,color:"red"}},jde(r,t.retryAt)))};function bfe(e){var t=yj.useSDKSettings().lang,r=e.onDoneEkyc,n=e.readIDCardProps,o=e.livenessDetectionProps,a=e.onError,i=e.onClose,s=e.sdkAdapter,c=e.flow,u=void 0===c?uL.EkycFlow.FULL_FLOW:c,l=s.clientSettings,d=Wy(xC.useState(!1),2),f=d[0],p=d[1],h=Wy(xC.useState(!1),2),m=h[0],g=h[1],v=Wy(xC.useState(null),2),y=v[0],b=v[1],C=Wy(xC.useState(!1),2),w=C[0],k=C[1],S=Wy(xC.useReducer(hfe,pfe),2),E=S[0],B=S[1],_=E.currentStep,x=E.readIdCardKey,T=E.faceLivenessKey,A=E.cardSanityTrials,I=E.compareFacesTrials,P=E.portraitSanityTrials,R=E.faceLivenessCardTamperingOCRTrials,D=xC.useRef(mde),N=xC.useRef(),O=xC.useRef(),L=xC.useRef(),M=xC.useRef(""),F=xC.useRef(""),U=xC.useMemo((function(){return Ade(y)}),[y]),j=U.cardSanityRetries,V=U.portraitSanityRetries,z=U.faceLivenessCardTamperingOCRRetries,q=U.compareFacesRetries,H=U.services,K=xC.useMemo((function(){return u===uL.EkycFlow.FULL_FLOW||u===uL.EkycFlow.ID_CARD}),[u]),W=xC.useMemo((function(){return u===uL.EkycFlow.FULL_FLOW||u===uL.EkycFlow.FACE}),[u]),Q=g5(y,"data.card_types[0].has_back_side",!0),G=2===g5(n,"steps",[]).length||Q;xC.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,l();case 2:t=e.sent,b(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[l,s]),xC.useEffect((function(){B(K?{type:ffe.SET_STEP,payload:hde.ID_CARD}:{type:ffe.SET_STEP,payload:hde.FACE_LIVENESS})}),[K]),xC.useEffect((function(){(A>=j||P>=V||I>=q||R>=z)&&g(!0)}),[j,A,I,q,V,P,z,R,r]);var X=xC.useCallback((function(){B({type:"RESET_ACTIONS"}),p(!1),g(!1),D.current=mde,N.current=null,O.current=null}),[]);xC.useEffect((function(){return function(){return X()}}),[X]);var Y=xC.useCallback((function(){A+1<j?(O.current=Ude(D.current,hde.ID_CARD,t),N.current=function(){B({type:ffe.FAIL_CARD_SANITY}),k(!1),"function"==typeof L.current&&L.current()},p(!0)):g(!0)}),[j,A,t]),$=xC.useCallback((function(){R+1<z?(O.current=Ude(D.current,hde.ID_CARD,t),N.current=function(){B({type:ffe.FAIL_LIVENESS_TAMPERING_OCR_RETRY_ID}),k(!1)},p(!0)):g(!0)}),[z,R,t]),Z=xC.useCallback((function(){P+1<V?(O.current=Ude(D.current,hde.FACE_LIVENESS,t),N.current=function(){B({type:ffe.FAIL_FACE_SANITY}),k(!1)},p(!0)):g(!0)}),[V,P,t]),J=xC.useCallback((function(e,r){R+1<z?(O.current=Ude(D.current,e,t),e===hde.ID_CARD?N.current=function(){B({type:ffe.FAIL_LIVENESS_TAMPERING_OCR_RETRY_ID}),r||(D.current=mde)}:N.current=function(){B({type:ffe.FAIL_LIVENESS_TAMPERING_OCR_RETRY_FACE})},p(!0)):g(!0)}),[z,R,t]),ee=xC.useCallback((function(){I+1<q?(O.current=Ude(D.current,[hde.ID_CARD,hde.FACE_LIVENESS],t),N.current=function(){B({type:ffe.FAIL_COMPARE_FACES}),D.current=mde,k(!1)},p(!0)):g(!0)}),[q,I,t]),te=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!K){e.next=6;break}return e.next=3,Lde(D,H,G);case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",hde.ID_CARD);case 6:if(!t){e.next=8;break}return e.abrupt("return",hde.FACE_LIVENESS);case 8:return e.abrupt("return",!1);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[K,H,G]),re=xC.useCallback(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,tfe(Ny(Ny({},D.current),{},{livenessMode:o.mode,sdkAdapter:s,onError:a,services:H,hasBackCard:G}));case 3:if(!(t=e.sent)){e.next=12;break}if(D.current=Ny(Ny({},D.current),t),!g5(t,"step",null)){e.next=10;break}ee(),e.next=12;break;case 10:return Fde(D).then((function(e){r(e)})),e.abrupt("return");case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),a(Ny(Ny({},gfe.api_call_error),{},{details:e.t0}));case 17:case"end":return e.stop()}}),e,null,[[0,14]])}))),[G,o.mode,s,a,H,ee,r]),ne=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,o,i,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof g5(t,"restartSession")&&(L.current=t.restartSession),k(!0),_!==hde.ID_CARD){e.next=62;break}if(g5(t,"cardSide")!==mfe.FRONT){e.next=33;break}return e.next=6,Qde({stepResult:t,frontCardId:M.current,qrImageId:F.current,onError:a,sdkAdapter:s,services:H});case 6:if(!(n=e.sent)){e.next=12;break}M.current=n.apiResult.frontCardId,F.current=n.apiResult.qrImageId,e.next=14;break;case 12:return k(!1),e.abrupt("return",!0);case 14:if(D.current=Ny(Ny({},D.current),{},{frontCard:n}),!Dde(n,H)){e.next=18;break}return Y(),e.abrupt("return",mfe.FRONT);case 18:if(G){e.next=31;break}if(!W){e.next=23;break}B({type:ffe.SET_STEP,payload:hde.FACE_LIVENESS}),e.next=31;break;case 23:return e.next=25,Lde(D,H,G);case 25:if(!e.sent){e.next=29;break}return $(),e.abrupt("return");case 29:return Fde(D).then((function(e){r(e)})),e.abrupt("return");case 31:e.next=60;break;case 33:if(g5(t,"cardSide")!==mfe.BACK){e.next=60;break}return e.next=36,Pde(D,H,G);case 36:if(!e.sent){e.next=41;break}$(),e.next=60;break;case 41:return e.next=43,Qde({hasBackCard:G,stepResult:t,frontCardId:M.current,qrImageId:F.current,sdkAdapter:s,onError:a,refEkycResult:D,services:H,checkFinishAndFailCardTamperingOrOCR:Pde,handleFailCardTamperingOCRBackground:$});case 43:if(o=e.sent,D.current=Ny(Ny({},D.current),{},{backCard:o}),!Dde(o,H)){e.next=48;break}return Y(),e.abrupt("return",mfe.BACK);case 48:if(!W){e.next=52;break}B({type:ffe.SET_STEP,payload:hde.FACE_LIVENESS}),e.next=60;break;case 52:return e.next=54,Lde(D,H,G);case 54:if(!e.sent){e.next=58;break}return $(),e.abrupt("return");case 58:return Fde(D).then((function(e){r(e)})),e.abrupt("return");case 60:e.next=89;break;case 62:if(_!==hde.FACE_LIVENESS){e.next=89;break}if(!K){e.next=77;break}return e.next=66,Pde(D,H,G);case 66:if(!e.sent){e.next=70;break}return $(),k(!1),e.abrupt("return");case 70:return e.next=72,Lde(D,H,G);case 72:if(!e.sent){e.next=77;break}return B({type:ffe.FAIL_LIVENESS_TAMPERING_OCR_RETRY_ID}),k(!1),e.abrupt("return");case 77:return e.next=79,Jde({stepResult:t,sdkAdapter:s,services:H});case 79:if(i=e.sent,D.current=Ny(Ny({},D.current),{},{faceLiveness:i}),!Ide(i,H)){e.next=85;break}Z(),e.next=89;break;case 85:return e.next=87,te(Rde(i));case 87:(c=e.sent)?J(c,!Rde(i)):K?re():Fde(D).then((function(e){r(e)}));case 89:k(!1);case 90:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[G,H,_,s,K,W,r,a,Y,$,Z,te,re,J]),oe=xC.useCallback((function(){p(!1),N.current()}),[]),ae=xC.useCallback((function(){p(!1),g(!1),Fde(D).then((function(e){r(e),B({type:ffe.SET_STEP,payload:hde.IDLE})}))}),[r]);return xC.createElement(xC.Fragment,null,_===hde.ID_CARD?xC.createElement(Hle,Ry({},n,e,{onStepDone:ne,sdkAdapter:s,onError:a,onClose:i,clientSettings:y,key:x,isLoading:w})):null,_===hde.FACE_LIVENESS?xC.createElement(Pce,Ry({},o,e,{onLivenessDetectionDone:ne,sdkAdapter:s,onError:a,onClose:i,clientSettings:y,key:T,isLoading:w})):null,xC.createElement(zee,{open:f||m},f&&xC.createElement(cfe,{onRetry:oe,onStop:ae},xC.createElement(yfe,{content:O.current,lang:t})),m&&xC.createElement(dfe,{onStop:ae},xC.createElement(yfe,{content:O.current,lang:t,isStopPopup:!0}))))}function Cfe(e){var t=e.logCredentials,r=e.ekycFlowComponent;return xC.createElement(Toe,null,xC.createElement(Yj.SDKTrackingProvider,{value:{tracking:Ny({},t)}},xC.createElement(r,e)))}bfe.propTypes={sdkAdapter:xw.shape({}),onDoneEkyc:xw.func,onError:xw.func,onClose:xw.func,readIDCardProps:xw.shape({}),livenessDetectionProps:xw.shape({})},bfe.defaultProps={sdkAdapter:null,onDoneEkyc:function(){},onError:function(){},onClose:function(){},readIDCardProps:{},livenessDetectionProps:{}},Cfe.propTypes={logCredentials:xw.shape({}),clientSettings:xw.shape({}),ekycFlowComponent:xw.func},Cfe.defaultProps={logCredentials:void 0,clientSettings:void 0,ekycFlowComponent:bfe};var wfe,kfe,Sfe,Efe,Bfe,_fe,xfe,Tfe,Afe,Ife,Pfe,Rfe,Dfe=function(){return{checkCamera:Coe,LivenessDetection:Pce,NativeCamera:koe,ReadIDCardUIOnly:Hle,ReadIDCardWithApiCall:ude,EkycFlow:Cfe,warmUpReadIdCard:hue,preloadEKYCResources:fde,getListCamera:z5,FlashLiveness:_ce}},Nfe=aee,Ofe=Vy(qne,["useLivenessDetection"]);function Lfe(e){var t=e.className;return xC.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xC.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 Mfe(e){var t=e.isActive;return xC.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xC.createElement("g",{opacity:t?1:.3},xC.createElement("rect",{x:"0.5",width:"44",height:"44",rx:"8",fill:"url(#paint0_linear_1680_23125)"}),xC.createElement("g",{clipPath:"url(#clip0_1680_23125)"},xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.5 12C16.9772 12 12.5 16.4772 12.5 22C12.5 27.5228 16.9772 32 22.5 32C28.0228 32 32.5 27.5228 32.5 22C32.5 16.4772 28.0228 12 22.5 12ZM10.5 22C10.5 15.3726 15.8726 10 22.5 10C29.1274 10 34.5 15.3726 34.5 22C34.5 28.6274 29.1274 34 22.5 34C15.8726 34 10.5 28.6274 10.5 22Z",fill:"white"}),xC.createElement("path",{d:"M18.5 19.5C18.5 20.3284 17.8284 21 17 21C16.1716 21 15.5 20.3284 15.5 19.5C15.5 18.6716 16.1716 18 17 18C17.8284 18 18.5 18.6716 18.5 19.5Z",fill:"white"}),xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5 27C12.5 26.4477 12.9477 26 13.5 26H19C19.5523 26 20 26.4477 20 27C20 27.5523 19.5523 28 19 28H13.5C12.9477 28 12.5 27.5523 12.5 27Z",fill:"white"}))),xC.createElement("defs",null,xC.createElement("linearGradient",{id:"paint0_linear_1680_23125",x1:"22.5",y1:"0",x2:"22.5",y2:"44",gradientUnits:"userSpaceOnUse"},xC.createElement("stop",{stopColor:"#1797FF"}),xC.createElement("stop",{offset:"1",stopColor:"#7DD8FF"})),xC.createElement("clipPath",{id:"clip0_1680_23125"},xC.createElement("rect",{width:"24",height:"24",fill:"white",transform:"translate(10.5 10)"}))))}function Ffe(e){var t=e.isActive;return xC.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xC.createElement("g",{opacity:t?1:.3},xC.createElement("rect",{width:"44",height:"44",rx:"8",transform:"matrix(-1 0 0 1 44.5 0)",fill:"url(#paint0_linear_1680_23314)"}),xC.createElement("g",{clipPath:"url(#clip0_1680_23314)"},xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.5 12C28.0228 12 32.5 16.4772 32.5 22C32.5 27.5228 28.0228 32 22.5 32C16.9772 32 12.5 27.5228 12.5 22C12.5 16.4772 16.9772 12 22.5 12ZM34.5 22C34.5 15.3726 29.1274 10 22.5 10C15.8726 10 10.5 15.3726 10.5 22C10.5 28.6274 15.8726 34 22.5 34C29.1274 34 34.5 28.6274 34.5 22Z",fill:"white"}),xC.createElement("path",{d:"M26.5 19.5C26.5 20.3284 27.1716 21 28 21C28.8284 21 29.5 20.3284 29.5 19.5C29.5 18.6716 28.8284 18 28 18C27.1716 18 26.5 18.6716 26.5 19.5Z",fill:"white"}),xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.5 27C32.5 26.4477 32.0523 26 31.5 26H26C25.4477 26 25 26.4477 25 27C25 27.5523 25.4477 28 26 28H31.5C32.0523 28 32.5 27.5523 32.5 27Z",fill:"white"}))),xC.createElement("defs",null,xC.createElement("linearGradient",{id:"paint0_linear_1680_23314",x1:"22",y1:"0",x2:"22",y2:"44",gradientUnits:"userSpaceOnUse"},xC.createElement("stop",{stopColor:"#1797FF"}),xC.createElement("stop",{offset:"1",stopColor:"#7DD8FF"})),xC.createElement("clipPath",{id:"clip0_1680_23314"},xC.createElement("rect",{width:"24",height:"24",fill:"white",transform:"matrix(-1 0 0 1 34.5 10)"}))))}function Ufe(e){var t=e.isActive;return xC.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xC.createElement("g",{opacity:t?1:.3},xC.createElement("rect",{x:"0.5",width:"44",height:"44",rx:"8",fill:"url(#paint0_linear_1680_23117)"}),xC.createElement("g",{clipPath:"url(#clip0_1680_23117)"},xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.5 12C28.0228 12 32.5 16.4772 32.5 22C32.5 27.5228 28.0228 32 22.5 32C16.9772 32 12.5 27.5228 12.5 22C12.5 16.4772 16.9772 12 22.5 12ZM34.5 22C34.5 15.3726 29.1274 10 22.5 10C15.8726 10 10.5 15.3726 10.5 22C10.5 28.6274 15.8726 34 22.5 34C29.1274 34 34.5 28.6274 34.5 22Z",fill:"white"}),xC.createElement("path",{d:"M25.5 16.5C25.5 17.3284 26.1716 18 27 18C27.8284 18 28.5 17.3284 28.5 16.5C28.5 15.6716 27.8284 15 27 15C26.1716 15 25.5 15.6716 25.5 16.5Z",fill:"white"}),xC.createElement("path",{d:"M16.5 16.5C16.5 17.3284 17.1716 18 18 18C18.8284 18 19.5 17.3284 19.5 16.5C19.5 15.6716 18.8284 15 18 15C17.1716 15 16.5 15.6716 16.5 16.5Z",fill:"white"}),xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.5 22C26.5 21.4477 26.0224 21 25.4333 21H19.5667C18.9776 21 18.5 21.4477 18.5 22C18.5 22.5523 18.9776 23 19.5667 23H25.4333C26.0224 23 26.5 22.5523 26.5 22Z",fill:"white"}))),xC.createElement("defs",null,xC.createElement("linearGradient",{id:"paint0_linear_1680_23117",x1:"22.5",y1:"0",x2:"22.5",y2:"44",gradientUnits:"userSpaceOnUse"},xC.createElement("stop",{stopColor:"#1797FF"}),xC.createElement("stop",{offset:"1",stopColor:"#7DD8FF"})),xC.createElement("clipPath",{id:"clip0_1680_23117"},xC.createElement("rect",{width:"24",height:"24",fill:"white",transform:"matrix(-1 0 0 1 34.5 10)"}))))}function jfe(e){var t=e.isActive;return xC.createElement("svg",{width:"45",height:"44",viewBox:"0 0 45 44",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xC.createElement("g",{opacity:t?1:.3},xC.createElement("rect",{x:"0.5",width:"44",height:"44",rx:"8",fill:"url(#paint0_linear_1680_23140)"}),xC.createElement("g",{clipPath:"url(#clip0_1680_23140)"},xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.5 12C28.0228 12 32.5 16.4772 32.5 22C32.5 27.5228 28.0228 32 22.5 32C16.9772 32 12.5 27.5228 12.5 22C12.5 16.4772 16.9772 12 22.5 12ZM34.5 22C34.5 15.3726 29.1274 10 22.5 10C15.8726 10 10.5 15.3726 10.5 22C10.5 28.6274 15.8726 34 22.5 34C29.1274 34 34.5 28.6274 34.5 22Z",fill:"white"}),xC.createElement("path",{d:"M25.5 18.5C25.5 19.3284 26.1716 20 27 20C27.8284 20 28.5 19.3284 28.5 18.5C28.5 17.6716 27.8284 17 27 17C26.1716 17 25.5 17.6716 25.5 18.5Z",fill:"white"}),xC.createElement("path",{d:"M16.5 18.5C16.5 19.3284 17.1716 20 18 20C18.8284 20 19.5 19.3284 19.5 18.5C19.5 17.6716 18.8284 17 18 17C17.1716 17 16.5 17.6716 16.5 18.5Z",fill:"white"}),xC.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.5 26C26.5 25.4477 26.0224 25 25.4333 25H19.5667C18.9776 25 18.5 25.4477 18.5 26C18.5 26.5523 18.9776 27 19.5667 27H25.4333C26.0224 27 26.5 26.5523 26.5 26Z",fill:"white"}))),xC.createElement("defs",null,xC.createElement("linearGradient",{id:"paint0_linear_1680_23140",x1:"22.5",y1:"0",x2:"22.5",y2:"44",gradientUnits:"userSpaceOnUse"},xC.createElement("stop",{stopColor:"#1797FF"}),xC.createElement("stop",{offset:"1",stopColor:"#7DD8FF"})),xC.createElement("clipPath",{id:"clip0_1680_23140"},xC.createElement("rect",{width:"24",height:"24",fill:"white",transform:"matrix(-1 0 0 1 34.5 10)"}))))}Lfe.propTypes={className:xw.string},Lfe.defaultProps={className:""},Mfe.propTypes={isActive:xw.bool},Mfe.defaultProps={isActive:!0},Ffe.propTypes={isActive:xw.bool},Ffe.defaultProps={isActive:!0},Ufe.propTypes={isActive:xw.bool},Ufe.defaultProps={isActive:!0},jfe.propTypes={isActive:xw.bool},jfe.defaultProps={isActive:!0};var Vfe,zfe,qfe,Hfe,Kfe,Wfe,Qfe,Gfe,Xfe,Yfe,$fe,Zfe,Jfe,epe,tpe,rpe=S4,npe=Ofe.Text,ope=Ofe.FaceDetectionError,ape=Ofe.FaceVerificationInstructions,ipe=Ofe.FaceVerificationStepsWrapper,spe=Ofe.StepItem,cpe=Ofe.BottomButtonsOverlay,upe=Ofe.Button,lpe=Ofe.CountDownOverlay,dpe=Ofe.CountdownTime,fpe=dB(wee)(wfe||(wfe=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),ppe=dB(Lfe)(kfe||(kfe=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)"})),hpe=dB(ape)(Sfe||(Sfe=Ky(["\n font-size: 18px;\n color: #38383d;\n text-shadow: none;\n font-weight: 600;\n"]))),mpe=dB(ope)(Efe||(Efe=Ky(["\n color: #ff424e;\n background-color: unset;\n"]))),gpe=dB(dpe)(Bfe||(Bfe=Ky(["\n background-color: unset;\n color: #ff424e;\n font-size: 18px;\n"]))),vpe=dB(spe)(_fe||(_fe=Ky(["\n /* border-color: #1aa7ff;\n color: #1aa7ff; */\n width: 44px;\n height: 44px;\n opacity: 1;\n img {\n border-radius: 8px;\n width: 44px;\n }\n"]))),ype=dB.div(xfe||(xfe=Ky(["\n cursor: pointer;\n text-align: center;\n z-index: ",";\n position: absolute;\n top: 20px;\n left: 20px;\n img {\n width: 12px;\n }\n"])),r4+100),bpe=dB(npe)(Tfe||(Tfe=Ky(["\n position: absolute;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n text-align: center;\n padding: 0 1.75rem;\n color: #38383d;\n\n ","\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)})),Cpe=dB.span(Afe||(Afe=Ky(["\n position: absolute;\n bottom: 5px;\n color: #38383d;\n font-size: 14px;\n z-index: ",";\n"])),r4+20),wpe=hB(["from{opacity:1;}to{opacity:0;}"]),kpe=dB.div(Ife||(Ife=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"])),wpe),Spe=v5.isMobile?{width:640}:null,Epe={background:"#fff",opacity:1};function Bpe(e){return new Promise((function(t){var r=new Image;r.onload=t,r.onerror=t,r.src=e}))}function _pe(e){var t,r,n=e.apiCheck,o=e.mode,a=e.onLivenessDetectionDone,i=e.onClose,s=e.onError,c=e.captureFrameSettings,u=e.onFramesCaptured,l=e.frontCamera,d=e.customStepTimeConstraints,f=e.onProcessing,p=e.customErrors,h=e.customMessages,m=e.livenessSettings,g=e.customInstructions,v=e.apiCredentials,y=e.title,b=e.subInstructions,C=Jj.useAsset("bg_camera_mask.png"),w=Jj.useAsset("bg_camera_mask_red.png"),k=Jj.useAsset("ic_close_black.png"),S=Wy(xC.useState({}),2),E=S[0],B=S[1],_=E.yFaceVerificationStepsWrapper,x=Wy(xC.useState(""),2),T=x[0],A=x[1],I=Wy(xC.useState(!1),2),P=I[0],R=I[1],D=xC.useCallback((function(e){var t=e.lostY,r=e.height,n=t+25,o=n+30;return B({yFaceDetectionError:n,yFaceVerificationStepsWrapper:o+r-45*r/350/2-8}),{y:Math.floor(o)}}),[]),N=Nfe({apiCheck:n,mode:o,bgCameraMask:C,bgCameraMaskRed:w,surroundStyle:Epe,onLivenessDetectionDone:a,onError:s,cropAreaDimension:D,captureFrameSettings:c,onFramesCaptured:u,livenessSettings:m,setRemainingTime:A,customStepTimeConstraints:d,onProcessing:f,customErrors:p,customMessages:h,customInstructions:g,apiCredentials:v}),O=N.countdownToTakePicture,L=N.cropArea,M=N.curStepIndex,F=N.faceDetectionError,U=N.handleTriggerPassiveMode,j=N.handleVideoPlayed,V=N.instructions,z=N.isActiveMode,q=N.refVideo,H=N.showCountdown,K=N.steps,W=N.videoPlayed,Q=N.isFirstValidFrameFound,G=N.warmupDone,X=N.activeCapturing,Y=xC.useRef(0);if(window.innerHeight-((null===(t=L.current)||void 0===t?void 0:t.y)+(null===(r=L.current)||void 0===r?void 0:r.height))-110<60){var $,Z=window.innerHeight-(null===($=L.current)||void 0===$?void 0:$.y)-170;Y.current=(L.current.height-Z)/2,L.current.width=Z,L.current.height=Z}xC.useEffect((function(){Promise.all(K.map((function(e){return Bpe(e.directionIcon)}))).then((function(){return R(!0)}))}),[K]);var J=xC.useRef(!1);xC.useEffect((function(){Q||(J.current=!1)}),[Q]),F&&F.code.includes("terminated")&&(J.current=!0);var ee=xC.useCallback((function(e,t){switch(e){case"left":return xC.createElement(Mfe,{isActive:t});case"right":return xC.createElement(Ffe,{isActive:t});case"up":return xC.createElement(Ufe,{isActive:t});case"frontal":return xC.createElement(jfe,{isActive:t});default:return null}}),[]);return xC.createElement(g4,{frontCamera:l,onVideoPlayed:j,flipHorizontal:l,ref:q,videoSettings:Spe,onError:s,onClose:i,closeButton:xC.createElement(ype,null,xC.createElement("img",{src:k,alt:""}))},!G&&xC.createElement(Kee,null),W&&P?xC.createElement(xC.Fragment,null,xC.createElement(bpe,{top:20},"".concat(y)),xC.createElement(mpe,{top:_-Y.current,className:"face-detection-error",error:F}),T&&xC.createElement(gpe,{top:L.current.y-15},T),L.current?xC.createElement(k4,{x:"".concat(L.current.x+Y.current,"px"),y:"".concat(L.current.y,"px"),width:"".concat(L.current.width,"px"),height:"".concat(L.current.height,"px"),surroundStyle:L.current.surroundStyle},xC.createElement(ppe,{color:"#fff"}),xC.createElement(fpe,{progress:M/K.length*100,showErrorRing:!!F,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:5,errorRingWidth:0,insideRingStrokeDash:"none",insideRingColor:"#1AA7FF"}),H?xC.createElement(lpe,null,O):null,z&&X?xC.createElement(kpe,null):null):null,z?xC.createElement(xC.Fragment,null,Q&&!J.current&&xC.createElement(ipe,{bottom:60},K.map((function(e,t){var r=e.name,n=e.image.objUrl;return xC.createElement(vpe,{key:r,className:"step-item"},n?xC.createElement("img",{src:n,alt:""}):ee(e.name,M>=t))}))),V?xC.createElement(xC.Fragment,null,xC.createElement(hpe,{bottom:30,className:"instructions"},"".concat(V)),xC.createElement(Cpe,null,b)):null):xC.createElement(xC.Fragment,null,F?null:xC.createElement(cpe,null,xC.createElement(upe,{onClick:U},xC.createElement(rpe,null))))):null)}function xpe(e){return xC.createElement(Pce,Ry({},e,{livenessComponent:_pe}))}_pe.propTypes={apiCheck:xw.bool,mode:xw.string,onLivenessDetectionDone:xw.func,onClose:xw.func,onError:xw.func,captureFrameSettings:xw.shape({}),onFramesCaptured:xw.func,frontCamera:xw.bool,customStepTimeConstraints:xw.shape({}),onProcessing:xw.func,customErrors:xw.shape({}),customMessages:xw.shape({}),livenessSettings:xw.shape({}),customInstructions:xw.shape({}),apiCredentials:xw.shape({accessKey:xw.string,secretKey:xw.string,apiUrl:xw.string}),title:xw.string,subInstructions:xw.string},_pe.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customStepTimeConstraints:(Pfe={},Py(Pfe,uL.FaceDirection.UP,{delayTime:0}),Py(Pfe,uL.FaceDirection.LEFT,{delayTime:0}),Py(Pfe,uL.FaceDirection.RIGHT,{delayTime:0}),Py(Pfe,uL.FaceDirection.FRONTAL,{delayTime:2e3}),Pfe),onProcessing:function(){},customErrors:{no_face:{code:"no_face",msg:{en:"Face is not detected.",vi:"Không nhận diện được khuôn mặt."}},multiple_faces:{code:"multiple_faces",msg:{en:"There are more than one face in the frame",vi:"Nhiều khuôn mặt xuất hiện trong khung hình"}},face_too_small:{code:"face_too_small",msg:{en:"The face is too small",vi:"Khuôn mặt quá nhỏ"}},face_too_large:{code:"face_too_large",msg:{en:"The face is too big",vi:"Khuôn mặt quá lớn"}},face_out_of_box:{code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt nằm ngoài khung ảnh"}},liveness_terminated_time_out:{code:"liveness_terminated_time_out",msg:{en:"The face verification need to be completed in <%= x %> seconds.\nPlease try again.",vi:"Xác thực khuôn mặt cần thực hiện trong <%= x %> giây.\nVui lòng thử lại."}}},customMessages:{REMAIN_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %>"}},customInstructions:(Rfe={},Py(Rfe,uL.FaceDirection.LEFT,{en:"Please turn to the left",vi:"Xoay trái"}),Py(Rfe,uL.FaceDirection.RIGHT,{en:"Please turn to the right",vi:"Xoay phải"}),Py(Rfe,uL.FaceDirection.UP,{en:"Please look up",vi:"Ngẩng lên"}),Py(Rfe,uL.FaceDirection.FRONTAL,{en:"Please look straight to camera",vi:"Nhìn thẳng"}),Rfe),livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},title:"Chụp khuôn mặt",subInstructions:"Xin giữ khuôn mặt nằm trong khung ảnh"};var Tpe,Ape,Ipe,Ppe=Yee,Rpe=qte,Dpe=jte,Npe=Ppe.animationDuration,Ope=Dpe.default,Lpe=dB.div(Vfe||(Vfe=Ky(["\n ","\n ","\n"])),Ppe.default,Rpe.default),Mpe=(dB.img(zfe||(zfe=Ky(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),80),Fpe=10,Upe=60,jpe=dB.div(qfe||(qfe=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"])),Upe,r4+20,v5.isMobile?YE(["top:",";"],(function(e){return e.y})):YE(["bottom:","px;"],Fpe)),Vpe=dB.div(Hfe||(Hfe=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"])),Mpe,Mpe,r4+20),zpe=dB.div(Kfe||(Kfe=Ky(["\n color: #fff;\n text-align: center;\n"]))),qpe=dB.div(Wfe||(Wfe=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}),r4+20),Hpe=dB.div(Qfe||(Qfe=Ky(["\n display: flex;\n align-items: center;\n"]))),Kpe=dB(zpe)(Gfe||(Gfe=Ky(["\n font-size: ","px;\n color: #38383d;\n font-weight: 500;\n"])),v5.isMobile?16:24),Wpe=dB.div(Xfe||(Xfe=Ky(["\n margin: 0 auto;\n padding: 0 5px;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),r4+20),Qpe=dB(zpe)(Yfe||(Yfe=Ky(["\n text-align: center;\n color: ",";\n font-weight: 500;\n padding: 5px 10px;\n font-size: ","px;\n"])),(function(e){return e.theme.dangerColor}),v5.isMobile?14:16),Gpe=function(e){var t=e.children,r=e.y;return xC.createElement(Wpe,{y:r},xC.createElement(Qpe,null,t))},Xpe=dB(Qte)($fe||($fe=Ky(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),Ype=dB(zpe)(Zfe||(Zfe=Ky(["\n color: ",";\n font-weight: 500;\n padding: 5px 10px;\n font-size: ","px;\n position: absolute;\n text-align: center;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.theme.dangerColor}),v5.isMobile?14:16,(function(e){return e.y}),r4+20),$pe=dB(zpe)(Jfe||(Jfe=Ky(["\n font-weight: normal;\n padding: 5px 10px;\n color: #38383d;\n font-size: ","px;\n position: absolute;\n text-align: center;\n top: ",";\n z-index: ",";\n"])),v5.isMobile?14:16,(function(e){return e.y}),r4+20),Zpe=dB.div(epe||(epe=Ky(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),Jpe=dB(Zpe)(tpe||(tpe=Ky(["\n z-index: ",";\n position: absolute;\n ","\n top: 16px;\n width: 24px;\n"])),r4+100,v5.isMobile?"left: 16px;":"right: 16px;"),ehe=uL.Errors,the={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:"Nhìn ổn đấy!"},BTN_TRY_AGAIN:{en:"Try again",vi:"Chụp 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"}},rhe=Ny(Ny({},ehe),{},{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"}}}),nhe=uL.IDCardMessage,ohe=dB.div(Tpe||(Tpe=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),ahe=dB.div(Ape||(Ape=Ky(["\n text-align: center;\n font-size: 1rem;\n"]))),ihe=dB.button(Ipe||(Ipe=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.primaryColor})),she=function(e){var t=e.onOk,r=e.maxSessionTime,n=yj.useSDKSettings().lang;return xC.createElement(ohe,null,xC.createElement(ahe,null,e7(nhe.TIMEOUT_INSTRUCTION[n])({x:r})),xC.createElement(ihe,{onClick:t},the.BTN_OK[n]))};she.propTypes={onOk:xw.func,maxSessionTime:xw.number},she.defaultProps={onOk:function(){},maxSessionTime:30};var che,uhe,lhe,dhe=uL.IDCardMessage,fhe=xC.forwardRef((function(e,t){var r,n=e.usePortraitMask,o=e.windowAndVideoInfo,a=e.refVideo,i=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=Wy(xC.useState({}),2),f=d[0],p=d[1],h=f.yErrorMessage,m=f.yDescription,g=f.yCaptureButton,v=f.yMessage,y=Jj.useAsset("ic_camera.png"),b=Jj.useAsset("ic_camera_disabled.png"),C=Jj.useAsset("ic_id_front.png"),w=Jj.useAsset("ic_id_back.png"),k=Jj.useAsset("ic_loading.png"),S=yj.useSDKSettings().lang,E=Wy(xC.useState(""),2),B=E[0],_=E[1],x=Wy(xC.useState(null),2),T=x[0],A=x[1],I=qq.useThemeContext(),P=Wy(xC.useState(null),2),R=P[0],D=P[1],N=I.primaryColor,O=I.dangerColor,L=Mce(),M=L.showPopup,F=L.popupShown,U=L.popupType,j=xC.useRef((function(){})),V=xC.useCallback((function(e){_(null===e?"":e7(rhe[e.code].msg[S])({side:i?the.FRONT[S]:the.BACK[S]}))}),[S,i]),z=xC.useCallback((function(){D(""),M({popupType:Fce.SESSION_TIMEOUT})}),[M]),q=xC.useCallback((function(e){var t=e.curTimeLeft;D(e7(dhe.REMAINING_TIME[S])({x:t}))}),[S]),H=Bue({shouldStart:!0,refVideo:a,cropArea:T,settings:s,onModelErrorChange:V,frontSide:i,onSessionTimeout:z,onCaptureDone:c,onAboutToTimeout:q,outputEncryptionSettings:l}),K=H.warmupDone,W=H.isProcessing,Q=H.takePictureManually,G=H.restartSession,X=H.resetIsProcessingImageBlobTaken,Y=xC.useCallback((function(){M({popupType:null}),X()}),[M,X]),$=xC.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Y(),e.next=3,G();case 3:case"end":return e.stop()}}),e)}))),[G,Y]);j.current=$,xC.useEffect((function(){if(o){var e,t,r,a,i,s,c,l,d=o.videoAreaWidth,f=o.videoAreaHeight,h=o.lostX,m=o.lostY,g=o.clientHeight;n?(s=.7*(c=f-165),r=(l=(e=m+10)+45)+20,a=l+c+70):(s=v5.isMobile?d-8:Math.floor(.7*d),c=Math.floor(Math.min(s/1.5,g-2*m-(Upe+2*Fpe)-145)),r=(t=(l=(e=m+16)+(v5.isMobile?40:65))+c+10)+(v5.isMobile?35:25),i=v5.isMobile?t+60:e+30,a=t+158);var v=Math.floor((d-s)/2)+h;A({x:v,y:l,width:s,height:c,surroundStyle:{background:"#fff"}});var y={yTitle:e,yErrorMessage:t,yMessage:r,yDescription:i,yCaptureButton:a};p(y),u(y)}}),[o,n,u]);var Z=xC.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(""),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q]);xC.useImperativeHandle(t,(function(){return{restartSession:$}}),[$]);var J=!(W||null!=s&&s.disableCaptureButtonIfAlert&&B);return xC.createElement(xC.Fragment,null,!K&&xC.createElement(Kee,null),W&&xC.createElement(Vpe,null,xC.createElement("img",{src:k,alt:"",className:"spin"})),T&&xC.createElement(k4,{x:"".concat(T.x,"px"),y:"".concat(T.y,"px"),width:"".concat(T.width,"px"),height:"".concat(T.height,"px"),surroundStyle:T.surroundStyle},xC.createElement(Xpe,{strokeStyles:(r={},Py(r,Wte.DEFAULT,{fill:"none",strokeWidth:5,stroke:N}),Py(r,Wte.ERROR,{fill:"none",strokeWidth:5,stroke:N}),r),paddingStyle:{fill:"#fff"},strokeWidth:5,errorColor:O,width:T.width,height:T.height,type:B?Wte.ERROR:Wte.DEFAULT})),B&&xC.createElement(Gpe,{y:"".concat(h,"px")},B),xC.createElement($pe,{y:"".concat(m,"px")},v5.isMobile&&xC.createElement("div",null,xC.createElement("img",{src:i?C:w,width:70,height:45,alt:""})),"Đặt CMND/CCCD của bạn vào giữa khung. Hình ảnh rõ ràng, không bị chói, mờ & cắt góc."),xC.createElement(jpe,{onClick:J?Z:null,y:"".concat(g,"px")},xC.createElement("img",{src:J?y:b,alt:""})),R&&xC.createElement(Ype,{key:R,y:"".concat(v,"px")},R),xC.createElement(zee,{open:F},U===Fce.SESSION_TIMEOUT&&xC.createElement(she,{onOk:$,maxSessionTime:null==s?void 0:s.idCardSessionTime})))}));fhe.propTypes={usePortraitMask:xw.bool,windowAndVideoInfo:xw.shape({}),refVideo:xw.shape({}),frontSide:xw.bool,settings:xw.shape({}),onCaptureDone:xw.func,onUISpacingChange:xw.func,outputEncryptionSettings:xw.shape({})},fhe.defaultProps={usePortraitMask:!1,windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var phe,hhe,mhe,ghe,vhe,yhe,bhe,Che,whe,khe=dB.button(che||(che=Ky(["\n background: #0b74e5;\n height: 44px;\n border-radius: 4px;\n border: 0;\n padding: 0 20px;\n color: #fff;\n cursor: pointer;\n font-size: 16px;\n font-weight: 500;\n width: 160px;\n"]))),She=dB.button(uhe||(uhe=Ky(["\n background: #fff;\n height: 44px;\n border-radius: 4px;\n border: 1px solid #0b74e5;\n padding: 0 20px;\n color: #0b74e5;\n cursor: pointer;\n font-size: 16px;\n font-weight: 500;\n width: 160px;\n &:focus {\n outline: none;\n box-shadow: none;\n }\n"]))),Ehe=(dB.a(lhe||(lhe=Ky(["\n text-decoration: underline;\n font-size: 16px;\n color: #000;\n cursor: pointer;\n"]))),dB.div(phe||(phe=Ky(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"])))),Bhe=dB.div(hhe||(hhe=Ky(["\n text-align: center;\n font-size: 1rem;\n color: ",";\n margin-top: 10px;\n"])),(function(e){return e.theme.dangerColor})),_he=dB.div(mhe||(mhe=Ky(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n"]))),xhe=dB.div(ghe||(ghe=Ky(["\n margin-right: 5px;\n"]))),The=dB.div(vhe||(vhe=Ky(["\n margin-left: 5px;\n"]))),Ahe=dB.img(yhe||(yhe=Ky(["\n ",";\n border-radius: 12px;\n border: 5px solid #1aa7ff;\n margin-top: 30px;\n ",";\n"])),!v5.isMobile&&YE(["height:","px;"],(function(e){return e.calHeight-300})),(function(e){return e.calHeight>0&&v5.isMobile&&YE(["width:","px;height:","px;border:none;border-radius:8px;"],window.innerWidth-30,e.calHeight)})),Ihe=dB.div(bhe||(bhe=Ky(["\n font-size: ","px;\n font-weight: 500;\n color: #38383d;\n"])),v5.isMobile?16:24),Phe=dB.div(Che||(Che=Ky(["\n margin: 8px 0;\n font-size: ","px;\n font-weight: normal;\n color: #38383d;\n text-align: center;\n"])),v5.isMobile?14:16),Rhe=dB.div(whe||(whe=Ky(["\n margin-top: 20px;\n font-size: ","px;\n font-weight: normal;\n color: #38383d;\n text-align: center;\n"])),v5.isMobile?14:16),Dhe=function(e){var t=e.title,r=e.imageTaken,n=e.onConfirm,o=e.onTryAgain,a=e.error,i=e.hasValidQR,s=Wy(xC.useState(null),2),c=s[0],u=s[1],l=yj.useSDKSettings().lang,d=Jj.useAsset("ic_close.png"),f=Jj.useAsset("ic_close_desktop.png"),p=Wy(xC.useState(v5.isMobile?0:window.innerHeight),2),h=p[0],m=p[1],g=xC.useRef();xC.useEffect((function(){var e;return r&&(e=URL.createObjectURL(r.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[r]);return xC.createElement(Ehe,null,null!==i&&xC.createElement(loe,{mb:"20px"},xC.createElement("div",null,xC.createElement(Yne,{type:i?Hne.SUCCESS:Hne.WARNING},i?the.CONFIRM_POPUP_VALID_QR[l]:the.CONFIRM_POPUP_INVALID_QR[l]))),xC.createElement(Ihe,null,t),!v5.isMobile&&xC.createElement(Phe,null,"Đặt CMND / CCCD của bạn vào giữa khung. Hình ảnh rõ ràng, không bị chói mờ & cắt góc."),xC.createElement(Ahe,{ref:g,src:c,calHeight:h,onLoad:function(){if(v5.isMobile){var e=g.current,t=e.height/e.width,r=(window.innerWidth-30)*t;m(r)}}}),xC.createElement(Rhe,null,"Nhìn ổn chứ? Bạn có thể tự chụp lại để có ảnh tốt hơn."),a&&xC.createElement(Bhe,{className:"confirm-popup-error-message"},a.msg[l]),xC.createElement(_he,null,xC.createElement(xhe,null,xC.createElement(She,{type:"button",onClick:o},the.BTN_TRY_AGAIN[l])),xC.createElement(The,null,xC.createElement(khe,{onClick:n},the.BTN_USE_THIS_PICTURE[l]))),xC.createElement(Jpe,{onClick:o},xC.createElement("img",{src:v5.isMobile?d:f,alt:""})))};Dhe.propTypes={imageTaken:xw.shape({}),error:xw.shape({msg:xw.shape({})}),onConfirm:xw.func,onTryAgain:xw.func,hasValidQR:xw.bool,title:xw.string},Dhe.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,title:""};var Nhe,Ohe={primaryColor:"#1AA7FF",dangerColor:"#FF424E"},Lhe={SESSION_TIMEOUT:"SESSION_TIMEOUT",CONFIRM:"CONFIRM",QR_INVALID:"QR_INVALID"},Mhe=pB(Nhe||(Nhe=Ky(["\n"]))),Fhe=uL.IDCardSide,Uhe=uL.IDCardType,jhe=uL.Errors,Vhe={ID_CARD:"id_card",QR_CODE:"qr_code"},zhe=[{scannerType:Vhe.ID_CARD,title:"Chụp mặt trước",cardSide:uL.IDCardSide.FRONT,cardType:Uhe.VN,frontCamera:!1,enableConfirmPopup:!0},{scannerType:Vhe.ID_CARD,title:"Chụp mặt sau",cardSide:uL.IDCardSide.BACK,cardType:Uhe.VN,frontCamera:!1,enableConfirmPopup:!0}];function qhe(e){var t=e.onClose,r=e.onError,n=e.clientSettings,o=e.onStepDone,a=e.steps,i=e.outputEncryptionSettings,s=e.detectIdCard,c=Wy(xC.useState(0),2),u=c[0],l=c[1],d=Wy(xC.useState(a[u]),2),f=d[0],p=d[1],h=xC.useRef(null),m=Wy(xC.useState(null),2),g=m[0],v=m[1],y=Wy(xC.useState(!1),2),b=y[0],C=y[1],w=Wy(xC.useState(0),2),k=w[0],S=w[1],E=xC.useRef(),B=f.scannerType,_=f.frontCamera,x=f.title,T=f.cardSide,A=f.usePortraitMask,I=f.enableConfirmPopup,P=f.cardType,R=Jj.useAsset("ic_close.png"),D=Jj.useAsset("ic_close_desktop.png"),N=Jj.useAsset("ic_loading.png"),O=T===Fhe.FRONT,L=Mce(),M=L.showPopup,F=L.popupShown,U=L.popupType,j=L.props,V=Wy(xC.useState(!1),2),z=V[0],q=V[1],H=xC.useRef(null),K=xC.useRef(null),W=xC.useRef([]),Q=jle({clientSettings:n}).settings,G=Wy(xC.useState({}),2),X=G[0],Y=G[1],$=X.yTitle,Z=Yj.useSDKTracking().sendEvent,J=xC.useCallback((function(e){v(e),C(!0)}),[]);xC.useEffect((function(){C(!1)}),[_]);var ee=xC.useCallback((function(){M({popupType:null})}),[M]),te=xC.useCallback((function(e){e>=a.length||setTimeout((function(){l(e),p(a[e])}),200)}),[a]),re=xC.useCallback((function(){te(u+1)}),[te,u]),ne=xC.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={stepNumber:u,cardSide:T,cardType:P,image:H.current,recordedVideos:null!=Q&&Q.enableRecording?W.current:[]},(B===Vhe.QR_CODE||null!==(t=K.current)&&void 0!==t&&t.result)&&(r.qrScannedResult=K.current),q(!0),e.next=5,o(r);case 5:Z({tag:"result",event:"sdk_mode.read_id_card_one_side",log:{result_object:r}}),q(!1),K.current=null,re();case 9:case"end":return e.stop()}}),e)}))),[Q,u,o,re,B,Z,T,P]),oe=xC.useCallback((function(){ee(),K.current=null,B===Vhe.QR_CODE?te(u):B===Vhe.ID_CARD&&(Z({tag:O?"id_front":"id_back",event:"user_activity.retry",log:{}}),E.current.restartSession())}),[te,u,ee,B,O,Z]),ae=xC.useCallback((function(){ee(),Z({tag:O?"id_front":"id_back",event:"user_activity.submit",log:{}}),ne()}),[ne,ee,Z,O]),ie=xC.useCallback((function(e){var t;if(K.current=e,e){var r,n=e.recordedVideos;(r=W.current).push.apply(r,Gy(n))}S((function(e){return e+1}));var o=null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid;I?M({popupType:Lhe.CONFIRM,props:{hasValidQR:o,imageTaken:H.current}}):ne()}),[M,I,ne]),se=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,o,a,c,u,l,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,o=t.error,a=t.recordedVideos,H.current=n,W.current=a,S((function(e){return e+1})),T!==uL.IDCardSide.FRONT){e.next=30;break}if(!Q.enableScanQr||!v5.isMobile){e.next=30;break}if(u=null==n||null===(c=n.detectedCard)||void 0===c?void 0:c.label){e.next=20;break}return q(!0),e.prev=9,e.next=12,s({image:n,cardType:P,cardSide:T});case 12:l=e.sent,u=l.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(jhe.detect_id_card_error);case 19:q(!1);case 20:if(o||!u||!"vn.cccd_new.front".includes(u)){e.next=30;break}return q(!0),e.next=24,ple(H.current.blob,i);case 24:if(!(d=e.sent)){e.next=29;break}return ie(d),q(!1),e.abrupt("return");case 29:q(!1);case 30:I?M({popupType:Lhe.CONFIRM,props:{title:x,imageTaken:H.current,error:o}}):ne();case 31:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[I,M,T,Q,P,s,ne,r,ie,i,x]);return xC.createElement(cB,{theme:Ohe},xC.createElement(Lpe,null,xC.createElement(g4,{key:_,frontCamera:_,onVideoPlayed:J,onClose:t,flipHorizontal:_,ref:h,onError:r,closeButton:xC.createElement(Jpe,null,xC.createElement("img",{src:v5.isMobile?R:D,alt:""}))},b&&xC.createElement(xC.Fragment,null,B===Vhe.ID_CARD&&xC.createElement(fhe,{key:u,ref:E,windowAndVideoInfo:g,refVideo:h,settings:Q,onCaptureDone:se,onUISpacingChange:Y,frontSide:O,usePortraitMask:A,outputEncryptionSettings:i})),xC.createElement(Ope,{keyForTransition:k}),xC.createElement(qpe,{y:"".concat($,"px")},xC.createElement(Dte,null,xC.createElement(Bte,{key:x,timeout:{enter:Npe,exit:Npe},classNames:"flipY",unmountOnExit:!0},xC.createElement(Hpe,null,xC.createElement(Kpe,null,x))))),z&&xC.createElement(Vpe,null,xC.createElement("img",{src:N,alt:"",className:"spin"}))),xC.createElement(zee,{open:F,overlayStyle:{padding:0},contentStyle:{maxWidth:"none",width:"100%",height:"100%",borderRadius:0}},U===Lhe.CONFIRM&&xC.createElement(Dhe,Ry({},j,{onConfirm:ae,onTryAgain:oe})))),xC.createElement(Mhe,null))}qhe.propTypes={onClose:xw.func,onError:xw.func,clientSettings:xw.shape({}),detectIdCard:xw.func,onStepDone:xw.func,steps:xw.arrayOf(xw.shape({})),outputEncryptionSettings:xw.shape({})},qhe.defaultProps={onClose:function(){},onError:function(){},clientSettings:{},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:zhe,outputEncryptionSettings:null};var Hhe=["tracking","clientSettings"];function Khe(e){var t=e.tracking,r=e.clientSettings,n=Vy(e,Hhe),o=xC.useMemo((function(){return g5(r,"data.settings.sdk_settings.server_log_settings.enable",null==t?void 0:t.enable)}),[r,t]);return xC.createElement(Toe,null,xC.createElement(Yj.SDKTrackingProvider,{value:{tracking:Ny(Ny({},t),{},{enable:o})}},xC.createElement(qhe,Ry({},n,{clientSettings:r}))))}Khe.propTypes={tracking:xw.shape({}),clientSettings:xw.shape({})},Khe.defaultProps={tracking:void 0,clientSettings:void 0};var Whe=uL.Errors,Qhe=function(e){var t=e.onClose,r=e.onError,n=e.detectIdCard,o=e.steps,a=e.onStepDone,i=e.apiCredentials,s=e.tracking,c=Wy(xC.useState(null),2),u=c[0],l=c[1],d=fq.useApiClient({apiCredentials:i,tracking:s}).apiClient,f=xC.useRef(""),p=xC.useRef("");xC.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,d.clientSettings();case 2:t=e.sent,l(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[d]);var h=xC.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,i,s,c,u,l,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.stepNumber,i=t.recordedVideos,s=t.qrScannedResult,c=t.image,u=o[n],l=u.cardType,h=u.cardSide,m=null,e.prev=3,e.next=6,ode({image:c,cardSide:h,frontCardId:f.current,qrImageId:p.current,onError:r,apiClient:d,cardType:l,recordedVideos:i,qrScannedResult:s});case 6:m=e.sent,h===uL.IDCardSide.FRONT&&(f.current=m.cardInfo.image1.id),p.current=m.qrImageId,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),r(Ny(Ny({},Whe.api_call_error),{},{details:e.t0}));case 14:m&&a(Ny(Ny({},t),{},{apiResult:m}));case 15:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t){return e.apply(this,arguments)}}(),[d,r,o,a]);return u&&xC.createElement(Khe,{tracking:s,onClose:t,onError:r,clientSettings:u,detectIdCard:n,onStepDone:h,steps:o})};Qhe.propTypes={onClose:xw.func,onError:xw.func,detectIdCard:xw.func,onStepDone:xw.func,steps:xw.arrayOf(xw.shape({})),apiCredentials:xw.shape({accessKey:xw.string,secretKey:xw.string,apiUrl:xw.string}),tracking:xw.shape({})},Qhe.defaultProps={onClose:function(){},onError:function(){},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:zhe,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},tracking:void 0};var Ghe=function(e){Oy(r,e);var t=Hy(r);function r(e){return Ty(this,r),t.call(this,Ny(Ny({},e),{},{baseComponent:Dfe(),component:{LivenessDetection:xpe,ReadIDCardUIOnly:Khe,ReadIDCardWithApiCall:Qhe}}))}return r}(yK);t.APIUtils=fq,t.AntiDebugUtils=zq,t.AssetUtils=Jj,t.AsyncUtils=tV,t.BaseTVWebSDK=yK,t.BlurUtils=BV,t.CameraUtils=xV,t.CloseEyesDetector=fK,t.CommonUtils=AV,t.Constants=uL,t.CoordinateUtils=FV,t.CryptoUtils=Kq,t.DEFAULT_CLOSE_EYE_MODEL=dK,t.ExifUtils=lK,t.FaceUtils=WV,t.GlareUtils=nq,t.HashUtils=zj,t.ImageUtils=Jz,t.LoadResourceUtils=wq,t.LocalStorageUtils=Fj,t.ModelUtils=Vq,t.PredictionUtils=GV,t.SDK=Ghe,t.SDKAdapter=CK,t.SDKTimer=Wq,t.ScannerType=W3,t.SettingsContext=yj,t.ThemeUtils=qq,t.TimeUtils=Oj,t.TrackingContext=Yj,t.UserAgentUtils=Rj,t.defaultClientSettings=C0,t.defaultReadIDCardSteps=Q3,t.getCustomUrlsBySettings=pj,t.getQrScannerWorkerPath=mK,t.getSDKVersion=Ij,t.requestMotionPermission=pK,t.useDeviceMotion=hK,Object.defineProperty(t,"__esModule",{value:!0})}));
|