@tsocial/tvweb-sdk.tcb 0.0.0-beta.1729481098436 → 0.0.0-beta.1729497130610

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.
@@ -34,7 +34,7 @@ function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=o.create([0,1,2,
34
34
  * derived from CryptoJS.mode.CTR
35
35
  * Jan Hruby jhruby.web@gmail.com
36
36
  */
37
- (r=cD).mode.CTRGladman=function(){var e=r.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function n(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var o=e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,o=r.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0),n(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c<o;c++)e[t+c]^=s[c]}});return e.Decryptor=o,e}(),r.mode.CTRGladman)})),WP((function(e,t){var r,n,o;e.exports=((o=cD).mode.OFB=(n=(r=o.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,o=this._iv,i=this._keystream;o&&(i=this._keystream=o.slice(0),this._iv=void 0),r.encryptBlock(i,0);for(var a=0;a<n;a++)e[t+a]^=i[a]}}),r.Decryptor=n,r),o.mode.OFB)})),WP((function(e,t){var r,n;e.exports=((n=cD).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)})),WP((function(e,t){var r;e.exports=((r=cD).pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,o=n-r%n,i=r+o-1;e.clamp(),e.words[i>>>2]|=o<<24-i%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)})),WP((function(e,t){var r;e.exports=((r=cD).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)})),WP((function(e,t){var r;e.exports=((r=cD).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)})),WP((function(e,t){var r;e.exports=((r=cD).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)})),WP((function(e,t){var r;e.exports=((r=cD).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)})),WP((function(e,t){var r;e.exports=(r=cD,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)})),WP((function(e,t){var r;e.exports=(r=cD,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,o=[],i=[],a=[],s=[],c=[],u=[],l=[],d=[],f=[],h=[];!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 p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,o[r]=p,i[p]=r;var m=e[r],g=e[m],v=e[g],y=257*e[p]^16843008*p;a[r]=y<<24|y>>>8,s[r]=y<<16|y>>>16,c[r]=y<<8|y>>>24,u[r]=y,y=16843009*v^65537*g^257*m^16843008*r,l[p]=y<<24|y>>>8,d[p]=y<<16|y>>>16,f[p]=y<<8|y>>>24,h[p]=y,r?(r=m^e[e[e[v^m]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),i=this._keySchedule=[],a=0;a<n;a++)a<r?i[a]=t[a]:(u=i[a-1],a%r?r>6&&a%r==4&&(u=o[u>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u]):(u=o[(u=u<<8|u>>>24)>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u],u^=p[a/r|0]<<24),i[a]=i[a-r]^u);for(var s=this._invKeySchedule=[],c=0;c<n;c++){if(a=n-c,c%4)var u=i[a];else u=i[a-4];s[c]=c<4||a<=4?u:l[o[u>>>24]]^d[o[u>>>16&255]]^f[o[u>>>8&255]]^h[o[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,o)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,d,f,h,i),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,o,i,a,s){for(var c=this._nRounds,u=e[t]^r[0],l=e[t+1]^r[1],d=e[t+2]^r[2],f=e[t+3]^r[3],h=4,p=1;p<c;p++){var m=n[u>>>24]^o[l>>>16&255]^i[d>>>8&255]^a[255&f]^r[h++],g=n[l>>>24]^o[d>>>16&255]^i[f>>>8&255]^a[255&u]^r[h++],v=n[d>>>24]^o[f>>>16&255]^i[u>>>8&255]^a[255&l]^r[h++],y=n[f>>>24]^o[u>>>16&255]^i[l>>>8&255]^a[255&d]^r[h++];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[h++],g=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[255&u])^r[h++],v=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[h++],y=(s[f>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&d])^r[h++],e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)})),WP((function(e,t){var r;e.exports=(r=cD,function(){var e=r,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var o=this._subKeys=[],i=0;i<16;i++){var u=o[i]=[],l=c[i];for(r=0;r<24;r++)u[r/6|0]|=t[(s[r]-1+l)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(s[r+24]-1+l)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var d=this._invSubKeys=[];for(r=0;r<16;r++)d[r]=o[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var o=r[n],i=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^o[c])&l[c])>>>0];this._lBlock=a,this._rBlock=i^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,f.call(this,1,1431655765),h.call(this,8,16711935),h.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 h(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=o._createHelper(d);var p=i.TripleDES=o.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),o=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(o))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(p)}(),r.TripleDES)})),WP((function(e,t){var r;e.exports=(r=cD,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var a=o%r,s=t[a>>>2]>>>24-a%4*8&255;i=(i+n[o]+s)%256;var c=n[o];n[o]=n[i],n[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,r=this._j,n=0,o=0;o<4;o++){r=(r+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[r],e[r]=i,n|=e[(e[t]+e[r])%256]<<24-8*o}return this._i=t,this._j=r,n}e.RC4=t._createHelper(o);var a=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)})),WP((function(e,t){var r;e.exports=(r=cD,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)o[r]^=n[r+4&7];if(t){var i=t.words,a=i[0],s=i[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;for(o[0]^=u,o[1]^=d,o[2]^=l,o[3]^=f,o[4]^=u,o[5]^=d,o[6]^=l,o[7]^=f,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),e[t+n]^=o[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,s=n>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)})),WP((function(e,t){var r;e.exports=(r=cD,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],a=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)c.call(this);for(o=0;o<8;o++)n[o]^=r[o+4&7];if(t){var i=t.words,a=i[0],s=i[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;for(n[0]^=u,n[1]^=d,n[2]^=l,n[3]^=f,n[4]^=u,n[5]^=d,n[6]^=l,n[7]^=f,o=0;o<4;o++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),e[t+n]^=o[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,s=n>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)})),WP((function(e,t){e.exports=cD}))),lD=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=uD.MD5(uD.lib.WordArray.create(r)).toString();e(n)},r.readAsArrayBuffer(t)}))},dD=Object.freeze({__proto__:null,MD5:lD,base64ToMD5:function(e){var t=e.base64;return uD.MD5(t).toString()}}),fD=["tracking"],hD=ZM(),pD=hv.createContext(),mD={enable:!1,accessKey:"",secretKey:"",apiUrl:"",userId:""},gD=function(){var e=EP(kP().mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,h,p,m;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.tag,n=t.event,o=t.log,i=nD(new Date),a=o,e.t0=n,e.next="sdk_mode.read_id_card_one_side"===e.t0?6:"sdk_mode.liveness"===e.t0?19:36;break;case 6:return a=GM(o),s=o.result_object,e.next=10,lD({blob:s.image.blob});case 10:if(e.t1=e.sent,a.result_object.image={blob:e.t1},delete a.result_object.recordedVideos,!s.qrScannedResult){e.next=18;break}return e.next=16,lD({blob:s.qrScannedResult.image.blob});case 16:a.result_object.qrScannedResult.image.blob=e.sent,delete a.result_object.qrScannedResult.recordedVideos;case 18:return e.abrupt("break",36);case 19:return a=GM(o),c=o.result_object,u=c.steps,l=c.frontalFaces,d=c.frontalScaledImage,f=u.map((function(e){return lD({blob:e.image.blob})})),e.next=24,Promise.all(f);case 24:return h=e.sent,u.forEach((function(e,t){a.result_object.steps[t].image.blob=h[t]})),p=l.map((function(e){return lD({blob:e})})),e.next=29,Promise.all(p);case 29:if(m=e.sent,l.forEach((function(e,t){a.result_object.frontalFaces[t]=m[t]})),!d){e.next=35;break}return e.next=34,lD({blob:d});case 34:a.result_object.frontalScaledImage=e.sent;case 35:return e.abrupt("break",36);case 36:return e.abrupt("return",{tag:r,event:n,log:_P({device_time:i},a)});case 37:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function vD(e){var t,r=e.userId;if(r)t=r;else{var n=aD("tv:user-id");if(n)t=n;else{var o=QM();t=o,iD(o,"tv:user-id")}}return t}function yD(e){var t=e.value,r=e.children,n=t.tracking,o=void 0===n?mD:n,i=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,fD),a=o.enable,s=void 0!==a&&a,c=o.accessKey,u=o.secretKey,l=o.apiUrl,d=o.userId,f=o.logSignature,h=hv.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:_P({"X-TV-Timestamp":r,Authorization:n,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}if(s){if(!l||!c||!u)return console.warn("apiUrl, accessKey and secretKey are required when tracking is enabled"),null;var i=new jM(c,u,l).httpClient.authorizer.getHeaders({requestPath:"/v1/log_events",method:"POST"});return fetch("".concat(l,"/v1/log_events"),{method:"POST",headers:_P({"X-TV-Timestamp":i["X-TV-Timestamp"],Authorization:i.Authorization,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}return null}),[f,s,l,c,u]),p=hv.useMemo((function(){return{"x-request-id":vD({userId:d})}}),[d]),m=hv.useCallback(EP(kP().mark((function e(){var t,r,n,o,i,a,c=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.tag,n=t.event,o=t.log,i=void 0===o?{}:o,!s){e.next=11;break}return e.prev=2,e.next=5,gD({tag:r,event:n,log:i});case 5:a=e.sent,h(a,_P(_P({},p),hD)),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]])}))),[h,p,s]);return hv.createElement(pD.Provider,{value:_P(_P({},i),{},{sendEvent:m})},r)}yD.propTypes={value:Fv.shape({tracking:Fv.shape({enable:Fv.bool,accessKey:Fv.string,secretKey:Fv.string,apiUrl:Fv.string,userId:Fv.string})}).isRequired,children:Fv.node.isRequired};var bD,wD,_D,kD,CD,SD,BD,ED,xD,ID,AD,PD,TD,RD,MD,DD,LD,OD,ND,FD,VD=Object.freeze({__proto__:null,defaultTrackingConfig:mD,getXRequestId:vD,SDKTrackingProvider:yD,useSDKTracking:function(){var e=hv.useContext(pD);return hv.useMemo((function(){return void 0===e?(console.warn("useSDKTracking must be used within a SDKTrackingProvider"),{sendEvent:function(){}}):e}),[e])}}),jD=(PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(CD={not_supported:"Camera không được hỗ trợ. Vui lòng thử trình duyệt hoặc thiết bị khác.",camera_timeout:"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:"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:"Không thể load model. Vui lòng thử trình duyệt hoặc thiết bị khác.",no_permission:"Vui lòng cấp quyền để truy cập camera.",no_face:"Không tìm thấy khuôn mặt",partial_face:"Không tìm thấy toàn bộ khuôn mặt",multiple_faces:"Quá nhiều khuôn mặt",face_too_small:"Khuôn mặt quá nhỏ",face_too_large:"Khuôn mặt quá to",face_out_of_box:"Khuôn mặt không nằm trọn vẹn trong khung ảnh",liveness_too_fast:"Vui lòng quay CHẬM lại",liveness_terminated:"Vui lòng thực hiện lại.",liveness_terminated_face_tracking:"Bạn cần quay CHẬM lại.\nVui lòng thực hiện lại.",liveness_terminated_no_face:"Khuôn mặt không nằm trong khung hình.\nXin vui lòng thử lại.",liveness_terminated_time_out:"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:"Card sanity chưa đạt",api_call_error:"Lỗi call api",upload_error:"Lỗi upload",sanity_check_error:"Lỗi check sanity",read_id_card_error:"Lỗi read id card",detect_id_tampering_error:"Lỗi detect id tampering",detect_id_card_error:"Không thể detect id card type",missing_front_id_card:"Không tìm thấy front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Vui lòng đặt giấy tờ thẳng, không bị nghiêng khi chụp",id_detector_no_cards:"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:"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:"Vui lòng đưa giấy tờ ra XA hơn\n (chiếm 50-95% khung hình)",glare_detected:"Ảnh bị chói / lóa. Vui lòng điều chỉnh góc chụp.",id_detector_error_front_side_no_faces:"Vui lòng chụp mặt trước của giấy tờ",id_detector_error_front_side_multiple_faces:"Vui lòng chụp mặt trước 1 giấy tờ duy nhất",id_detector_error_back_side_has_faces:"Vui lòng chụp mặt sau của giấy tờ",id_detector_error_blur:"Ảnh bị mờ. Vui lòng chụp lại để có ảnh rõ nét hơn",not_frontal_face:"Vui lòng nhìn thẳng vào camera.",not_readable:"Camera đang được sử dụng bởi ứng dụng/tab khác.",close_eye:"Vui lòng mở to mắt",front_card_title:"Mặt trước CMND/CCCD",back_card_title:"Mặt sau CMND/CCCD",qr_title:"Quét mã QR trên CCCD",front_card_description:"Vui lòng đặt CMND mặt trước vào trong khung",back_card_description:"Vui lòng đặt CMND mặt sau vào trong khung",btn_ok:"Tôi đã hiểu",front:"trước",back:"sau",btn_use_this_picture:"Dùng ảnh này",btn_try_again:"Thử lại",confirm_popup_valid_qr:"Đã quét được mã QR",confirm_popup_invalid_qr:"Không quét được mã QR",remaining_time:"Thời gian còn lại: <%= x %> giây",timeout_instruction:"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.",warmup_intro:"Đang khởi động, vui lòng chờ trong giây lát..."},null==bP||null===(bD=vP)||void 0===bD?void 0:bD.LEFT,"Quay mặt chậm qua trái"),null==bP||null===(wD=vP)||void 0===wD?void 0:wD.RIGHT,"Quay mặt chậm qua phải"),null==bP||null===(_D=vP)||void 0===_D?void 0:_D.UP,"Ngước mặt chậm lên trên"),null==bP||null===(kD=vP)||void 0===kD?void 0:kD.FRONTAL,"Nhìn thẳng camera"),"qr_instructions_text","Vui lòng quét mã QR theo hướng dẫn sau:\n Đư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","Tiến hành quét mã QR"),"qr_instructions_countdown","Bắt đầu trong <%= x %> giây"),"qr_invalid_popup_title","QR không hợp lệ"),"qr_invalid_popup_description","Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR code trên CCCD thật"),"qr_invalid_popup_retry_button","Quét lại QR (trên CCCD)"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(CD,"qr_invalid_popup_skip_button","Bỏ qua"),"qr_tooltip","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"),"session_timeout_popup_description","Quá thời gian quét. Vui lòng thực hiện lại.\n Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và 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","Thử lại"),"session_timeout_popup_skip_button","Bỏ qua"),"flash_liveness.title","Xác thực khuôn mặt"),"flash_liveness.instruction.far_step","Đưa mặt vào khung"),"flash_liveness.instruction.close_step","Đưa mặt lại gần"),"flash_liveness.instruction.flash_step","Giữ yên"),"flash_liveness.error.no_face","Không tìm thấy khuôn mặt"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(CD,"flash_liveness.processing","Đang xử lý kết quả"),"flash_liveness.error.partial_face","Đưa khuôn mặt vào giữa hình oval"),"flash_liveness.error.face_too_small","Đưa khuôn mặt lại gần một chút"),"flash_liveness.error.face_too_large","Đưa khuôn mặt ra xa một chút"),"flash_liveness.error.close_eye","Vui lòng mở to mắt"),"flash_liveness.error.face_not_frontal","Vui lòng đưa thiết bị ngang tầm mắt"),"flash_liveness.error.multiple_faces","Có nhiều mặt trong khung hình"),"flash_liveness.error.face_too_high","Đưa khuôn mặt xuống một chút"),"flash_liveness.error.face_too_blurry","Ảnh bị mờ, vui lòng giữ yên điện thoại"),"flash_liveness.error.face_not_qualified","Vui lòng không đeo kiếng, khẩu trang, hay để mặt bị che"),PP(PP(PP(PP(CD,"flash_liveness.timeout.remaining","Thời gian còn lại: <%= remain %> giây"),"flash_liveness.timeout.expired","Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại."),"flash_liveness.error.face_too_bright","Khuôn mặt quá sáng. Vui lòng điều chỉnh để có ánh sáng phù hợp."),"flash_liveness.error.face_too_dark","Khuôn mặt quá tối. Vui lòng điều chỉnh để có ánh sáng tốt hơn.")),UD=(PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(ID={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",qr_title:"Scan QR code on ID card",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bP||null===(SD=vP)||void 0===SD?void 0:SD.LEFT,"Turn your face to the left"),null==bP||null===(BD=vP)||void 0===BD?void 0:BD.RIGHT,"Turn your face to the right"),null==bP||null===(ED=vP)||void 0===ED?void 0:ED.UP,"Turn your face up"),null==bP||null===(xD=vP)||void 0===xD?void 0:xD.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(ID,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(ID,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),PP(PP(PP(PP(ID,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),zD=(PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(MD={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",qr_title:"Scan QR code on ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bP||null===(AD=vP)||void 0===AD?void 0:AD.LEFT,"Turn your face to the left"),null==bP||null===(PD=vP)||void 0===PD?void 0:PD.RIGHT,"Turn your face to the right"),null==bP||null===(TD=vP)||void 0===TD?void 0:TD.UP,"Turn your face up"),null==bP||null===(RD=vP)||void 0===RD?void 0:RD.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(MD,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(MD,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),PP(PP(PP(PP(MD,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),qD=(PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(FD={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",qr_title:"Scan QR code on ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bP||null===(DD=vP)||void 0===DD?void 0:DD.LEFT,"Turn your face to the left"),null==bP||null===(LD=vP)||void 0===LD?void 0:LD.RIGHT,"Turn your face to the right"),null==bP||null===(OD=vP)||void 0===OD?void 0:OD.UP,"Turn your face up"),null==bP||null===(ND=vP)||void 0===ND?void 0:ND.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(FD,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(FD,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),PP(PP(PP(PP(FD,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),WD=hv.createContext(jD),HD=function(e){var t=e.value,r=e.children,n=t.lang,o=void 0===n?"vi":n,i=t.country,a=void 0===i?"vn":i,s=t.customTexts,c=void 0===s?{}:s,u=hv.useMemo((function(){var e=Object.assign({},function(e,t){return"vn"===t?"vi"===e?jD:UD:"ph"===t?zD:"in"===t?qD:jD}(o,a));return Object.keys(c).length>0&&Object.keys(c).forEach((function(t){var r,n,i,a=(null===(n=null===(r=null==c?void 0:c[t])||void 0===r?void 0:r.msg)||void 0===n?void 0:n[o])||(null===(i=null==c?void 0:c[t])||void 0===i?void 0:i[o])||(null==c?void 0:c[t]);e[t]=a})),e}),[a,c,o]);return hv.createElement(WD.Provider,{value:u},r)},KD={};function QD(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:KD,t=hv.useContext(WD);return void 0===t&&console.error("useSDKLocale must be used within a SDKLocaleProvider"),hv.useMemo((function(){return Object.assign(Object.assign({},t),e)}),[t,e])}var GD=Object.freeze({__proto__:null,SDKLocaleProvider:HD,useSDKLocale:QD});function XD(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(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(a,s)}c((n=n.apply(e,t||[])).next())}))}function YD(e,t){return e&&!e.endsWith("/")?[e,"/",t].join(""):[e,t].join("")}function $D(){var e=OM();return null==e?void 0:e.assetRoot}function ZD(e){return YD($D(),e)}var JD=Object.freeze({__proto__:null,getAsset:YD,useAssetRoot:$D,useAsset:ZD}),eL=hv.createContext({}),tL=function(e){var t=e.children,r=e.mode,n=OM(),o=n.enableVoice,i=function(e,t){var r=ZD("audio/".concat(t,"/move_face_into_frame.mp3")),n=ZD("audio/".concat(t,"/move_face_closer.mp3")),o=ZD("audio/".concat(t,"/please_hold_still.mp3")),i=ZD("audio/".concat(t,"/keep_front_id_fit_border.mp3")),a=ZD("audio/".concat(t,"/keep_back_id_fit_border.mp3"));return hv.useMemo((function(){switch(e){case"flash":return{move_face_into_frame:r,move_face_closer:n,please_hold_still:o};case"id_card":return{keep_front_id_fit_border:i,keep_back_id_fit_border:a};default:return{}}}),[o,a,i,e,n,r])}(r,n.lang),a=RP(hv.useState({}),2),s=a[0],c=a[1];return hv.useEffect((function(){var e;o&&(e=i,XD(void 0,void 0,void 0,kP().mark((function t(){var r,n;return kP().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("object"===SP(e)&&0!==Object.values(e).length){t.next=2;break}return t.abrupt("return",{});case 2:return r=Object.entries(e).reduce((function(e,t){var r=RP(t,2),n=r[0],o=r[1];return e[n]=new Audio(o),e}),{}),n=Object.values(r).map((function(e){return new Promise((function(t,r){e.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA?t():(e.addEventListener("suspend",(function(){console.warn("Audio loading suspended. Audio might not play smoothly."),t()})),e.addEventListener("canplay",(function(){t()})),e.addEventListener("canplaythrough",(function(){t()})),e.addEventListener("error",(function(t){if(null===e.error)return console.error("An unknown error occurred."),void r(t);switch(e.error.code){case MediaError.MEDIA_ERR_ABORTED:console.error("The fetching process for the media resource was aborted by the user agent at the user's request.");break;case MediaError.MEDIA_ERR_NETWORK:console.error("A network error caused the audio download to fail.");break;case MediaError.MEDIA_ERR_DECODE:console.error("The media data could not be decoded.");break;case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:console.error("The media resource indicated by the src attribute was not suitable.");break;default:console.error("An unknown error occurred.")}r(t)})))}))})),t.next=6,Promise.all(n);case 6:return t.abrupt("return",r);case 7:case"end":return t.stop()}}),t)})))).then(c).catch((function(e){console.error("Error initializing audio:",e)}))}),[o,i]),hv.createElement(eL.Provider,{value:s},t)},rL=Object.freeze({__proto__:null,VoiceProvider:tL,useVoicePlayer:function(){var e=hv.useContext(eL),t=hv.useRef(null);return{playVoice:hv.useCallback((function(r){try{if(r===t.current&&!e[r].ended)return;if(t.current){var n=e[t.current];n.pause(),n.currentTime=0}var o=e[r];if(o instanceof HTMLAudioElement==0)return;o.play(),t.current=r}catch(e){console.error("Error playing audio:",e)}}),[e])}}}),nL=hv.createContext(null),oL=function(e){var t=e.children,r=hv.useRef(null),n=hv.useRef(null);return hv.useEffect((function(){var e,t;return window.Accelerometer&&((e=new Accelerometer({frequency:10})).addEventListener("reading",(function(){r.current={x:e.x,y:e.y,z:e.z}})),e.start()),window.Gyroscope&&((t=new Gyroscope({frequency:10})).addEventListener("reading",(function(){n.current={x:t.x,y:t.y,z:t.z}})),t.start()),function(){e&&e.stop(),t&&t.stop()}}),[]),hv.createElement(nL.Provider,{value:{getAccelerometer:function(){return r.current},getGyroscope:function(){return n.current}}},t)};oL.propTypes={children:Fv.node},oL.defaultProps={children:null};var iL=Object.freeze({__proto__:null,useSensors:function(){return hv.useContext(nL)},SensorsProvider:oL});function aL(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(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(a,s)}c((n=n.apply(e,t||[])).next())}))}var sL={401:"invalid_license_exception",400:"invalid_parameter_exception",429:"rate_limit_exception",500:"internal_server_error",unknown:"unknown_license_error",invalid_license:"invalid_license",invalid_app_id:"invalid_app_id",invalid_date:"invalid_date",license_expired:"license_expired",invalid_signature:"invalid_signature",missing_url:"missing_url"};function cL(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function uL(e){var t,r="",n=0,o=0;for(t=0;t<e.length&&"="!==e.charAt(t);++t){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t));i<0||(0===n?(r+=cL(i>>2),o=3&i,n=1):1===n?(r+=cL(o<<2|i>>4),o=15&i,n=2):2===n?(r+=cL(o),r+=cL(i>>2),o=3&i,n=3):(r+=cL(o<<2|i>>4),r+=cL(15&i),n=0))}return 1===n&&(r+=cL(o<<2)),r}function lL(e){for(var t="",r=0;r<e.length;r+=2){var n=e.slice(r,r+2),o=parseInt(n,16);t+=String.fromCharCode(o)}return t}var dL=function(e){var t=RP(lL(uL(e)).split(";;"),4),r=t[1];return{mode:"offline"!==r&&"online"!==r?"offline":r,license:t[2],signature:t[3]}},fL="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function hL(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 pL=function(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}(Object.freeze({__proto__:null,default:{}})),mL=hL((function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==SP(e)?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:pL.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var o=0,i=Math.min(e.length,r),a=t;a<i;a++){var s=e.charCodeAt(a)-48;o*=n,o+=s>=49?s-49+10:s>=17?s-17+10:s}return o}o.isBN=function(e){return e instanceof o||null!==e&&"object"==SP(e)&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==SP(e))return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,n):(this._parseBase(e,t,o),"le"===n&&this._initArray(this.toArray(),t,n)))},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===n)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=s(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=s(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,s=Math.min(i,i-a)+r,u=0,l=r;l<s;l+=n)u=c(e,l,l+n,t),this.imuln(o),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var d=1;for(u=c(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u<n;u++){for(var l=c>>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(a=(o=0|e.words[p])*(i=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a<this.length;a++){var s=this.words[a],c=(16777215&(s<<o|i)).toString(16);n=0!=(i=s>>>24-o&16777215)||a!==this.length-1?u[6-c.length]+c+n:c+n,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?m+n:u[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r(void 0!==i),this.toArrayLike(i,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(i),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s<i;s++)u[s]=0}else{for(s=0;s<i-o;s++)u[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[i-s-1]=a}return u},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)i=(t=(0|r.words[a])-(0|n.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<r.length;a++)i=(t=(0|r.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,r){var n,o,i,a=e.words,s=t.words,c=r.words,u=0,l=0|a[0],d=8191&l,f=l>>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,k=0|a[4],C=8191&k,S=k>>>13,B=0|a[5],E=8191&B,x=B>>>13,I=0|a[6],A=8191&I,P=I>>>13,T=0|a[7],R=8191&T,M=T>>>13,D=0|a[8],L=8191&D,O=D>>>13,N=0|a[9],F=8191&N,V=N>>>13,j=0|s[0],U=8191&j,z=j>>>13,q=0|s[1],W=8191&q,H=q>>>13,K=0|s[2],Q=8191&K,G=K>>>13,X=0|s[3],Y=8191&X,$=X>>>13,Z=0|s[4],J=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ne=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],de=8191&le,fe=le>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(o=(o=Math.imul(d,z))+Math.imul(f,U)|0))<<13)|0;u=((i=Math.imul(f,z))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),o=(o=Math.imul(p,z))+Math.imul(m,U)|0,i=Math.imul(m,z);var ve=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(o=(o=o+Math.imul(d,H)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,H)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,U),o=(o=Math.imul(v,z))+Math.imul(y,U)|0,i=Math.imul(y,z),n=n+Math.imul(p,W)|0,o=(o=o+Math.imul(p,H)|0)+Math.imul(m,W)|0,i=i+Math.imul(m,H)|0;var ye=(u+(n=n+Math.imul(d,Q)|0)|0)+((8191&(o=(o=o+Math.imul(d,G)|0)+Math.imul(f,Q)|0))<<13)|0;u=((i=i+Math.imul(f,G)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,U),o=(o=Math.imul(w,z))+Math.imul(_,U)|0,i=Math.imul(_,z),n=n+Math.imul(v,W)|0,o=(o=o+Math.imul(v,H)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,H)|0,n=n+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,G)|0;var be=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(o=(o=o+Math.imul(d,$)|0)+Math.imul(f,Y)|0))<<13)|0;u=((i=i+Math.imul(f,$)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(C,U),o=(o=Math.imul(C,z))+Math.imul(S,U)|0,i=Math.imul(S,z),n=n+Math.imul(w,W)|0,o=(o=o+Math.imul(w,H)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,H)|0,n=n+Math.imul(v,Q)|0,o=(o=o+Math.imul(v,G)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(p,Y)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(m,Y)|0,i=i+Math.imul(m,$)|0;var we=(u+(n=n+Math.imul(d,J)|0)|0)+((8191&(o=(o=o+Math.imul(d,ee)|0)+Math.imul(f,J)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(E,U),o=(o=Math.imul(E,z))+Math.imul(x,U)|0,i=Math.imul(x,z),n=n+Math.imul(C,W)|0,o=(o=o+Math.imul(C,H)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,G)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,G)|0,n=n+Math.imul(v,Y)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,$)|0,n=n+Math.imul(p,J)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,J)|0,i=i+Math.imul(m,ee)|0;var _e=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(o=(o=o+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;u=((i=i+Math.imul(f,ne)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,U),o=(o=Math.imul(A,z))+Math.imul(P,U)|0,i=Math.imul(P,z),n=n+Math.imul(E,W)|0,o=(o=o+Math.imul(E,H)|0)+Math.imul(x,W)|0,i=i+Math.imul(x,H)|0,n=n+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,G)|0)+Math.imul(S,Q)|0,i=i+Math.imul(S,G)|0,n=n+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(_,Y)|0,i=i+Math.imul(_,$)|0,n=n+Math.imul(v,J)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0;var ke=(u+(n=n+Math.imul(d,ie)|0)|0)+((8191&(o=(o=o+Math.imul(d,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,U),o=(o=Math.imul(R,z))+Math.imul(M,U)|0,i=Math.imul(M,z),n=n+Math.imul(A,W)|0,o=(o=o+Math.imul(A,H)|0)+Math.imul(P,W)|0,i=i+Math.imul(P,H)|0,n=n+Math.imul(E,Q)|0,o=(o=o+Math.imul(E,G)|0)+Math.imul(x,Q)|0,i=i+Math.imul(x,G)|0,n=n+Math.imul(C,Y)|0,o=(o=o+Math.imul(C,$)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,$)|0,n=n+Math.imul(w,J)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(_,J)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(v,re)|0,o=(o=o+Math.imul(v,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var Ce=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(o=(o=o+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,U),o=(o=Math.imul(L,z))+Math.imul(O,U)|0,i=Math.imul(O,z),n=n+Math.imul(R,W)|0,o=(o=o+Math.imul(R,H)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,H)|0,n=n+Math.imul(A,Q)|0,o=(o=o+Math.imul(A,G)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(E,Y)|0,o=(o=o+Math.imul(E,$)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,$)|0,n=n+Math.imul(C,J)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0,n=n+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,i=i+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(o=(o=o+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,U),o=(o=Math.imul(F,z))+Math.imul(V,U)|0,i=Math.imul(V,z),n=n+Math.imul(L,W)|0,o=(o=o+Math.imul(L,H)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,H)|0,n=n+Math.imul(R,Q)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,G)|0,n=n+Math.imul(A,Y)|0,o=(o=o+Math.imul(A,$)|0)+Math.imul(P,Y)|0,i=i+Math.imul(P,$)|0,n=n+Math.imul(E,J)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(x,J)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(v,ce)|0,o=(o=o+Math.imul(v,ue)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,ue)|0,n=n+Math.imul(p,de)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,fe)|0;var Be=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(o=(o=o+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;u=((i=i+Math.imul(f,me)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(F,W),o=(o=Math.imul(F,H))+Math.imul(V,W)|0,i=Math.imul(V,H),n=n+Math.imul(L,Q)|0,o=(o=o+Math.imul(L,G)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,G)|0,n=n+Math.imul(R,Y)|0,o=(o=o+Math.imul(R,$)|0)+Math.imul(M,Y)|0,i=i+Math.imul(M,$)|0,n=n+Math.imul(A,J)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(E,re)|0,o=(o=o+Math.imul(E,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,o=(o=o+Math.imul(w,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,n=n+Math.imul(v,de)|0,o=(o=o+Math.imul(v,fe)|0)+Math.imul(y,de)|0,i=i+Math.imul(y,fe)|0;var Ee=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,Q),o=(o=Math.imul(F,G))+Math.imul(V,Q)|0,i=Math.imul(V,G),n=n+Math.imul(L,Y)|0,o=(o=o+Math.imul(L,$)|0)+Math.imul(O,Y)|0,i=i+Math.imul(O,$)|0,n=n+Math.imul(R,J)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(M,J)|0,i=i+Math.imul(M,ee)|0,n=n+Math.imul(A,re)|0,o=(o=o+Math.imul(A,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,n=n+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,o=(o=o+Math.imul(w,fe)|0)+Math.imul(_,de)|0,i=i+Math.imul(_,fe)|0;var xe=(u+(n=n+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,me)|0)+Math.imul(y,pe)|0))<<13)|0;u=((i=i+Math.imul(y,me)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,Y),o=(o=Math.imul(F,$))+Math.imul(V,Y)|0,i=Math.imul(V,$),n=n+Math.imul(L,J)|0,o=(o=o+Math.imul(L,ee)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,ee)|0,n=n+Math.imul(R,re)|0,o=(o=o+Math.imul(R,ne)|0)+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,n=n+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,ae)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,ae)|0,n=n+Math.imul(E,ce)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,ue)|0,n=n+Math.imul(C,de)|0,o=(o=o+Math.imul(C,fe)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,fe)|0;var Ie=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,me)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,J),o=(o=Math.imul(F,ee))+Math.imul(V,J)|0,i=Math.imul(V,ee),n=n+Math.imul(L,re)|0,o=(o=o+Math.imul(L,ne)|0)+Math.imul(O,re)|0,i=i+Math.imul(O,ne)|0,n=n+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,n=n+Math.imul(A,ce)|0,o=(o=o+Math.imul(A,ue)|0)+Math.imul(P,ce)|0,i=i+Math.imul(P,ue)|0,n=n+Math.imul(E,de)|0,o=(o=o+Math.imul(E,fe)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,fe)|0;var Ae=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((i=i+Math.imul(S,me)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,re),o=(o=Math.imul(F,ne))+Math.imul(V,re)|0,i=Math.imul(V,ne),n=n+Math.imul(L,ie)|0,o=(o=o+Math.imul(L,ae)|0)+Math.imul(O,ie)|0,i=i+Math.imul(O,ae)|0,n=n+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(M,ce)|0,i=i+Math.imul(M,ue)|0,n=n+Math.imul(A,de)|0,o=(o=o+Math.imul(A,fe)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,fe)|0;var Pe=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,ie),o=(o=Math.imul(F,ae))+Math.imul(V,ie)|0,i=Math.imul(V,ae),n=n+Math.imul(L,ce)|0,o=(o=o+Math.imul(L,ue)|0)+Math.imul(O,ce)|0,i=i+Math.imul(O,ue)|0,n=n+Math.imul(R,de)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(M,de)|0,i=i+Math.imul(M,fe)|0;var Te=(u+(n=n+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,me)|0)+Math.imul(P,pe)|0))<<13)|0;u=((i=i+Math.imul(P,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,ce),o=(o=Math.imul(F,ue))+Math.imul(V,ce)|0,i=Math.imul(V,ue),n=n+Math.imul(L,de)|0,o=(o=o+Math.imul(L,fe)|0)+Math.imul(O,de)|0,i=i+Math.imul(O,fe)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,me)|0)+Math.imul(M,pe)|0))<<13)|0;u=((i=i+Math.imul(M,me)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,de),o=(o=Math.imul(F,fe))+Math.imul(V,de)|0,i=Math.imul(V,fe);var Me=(u+(n=n+Math.imul(L,pe)|0)|0)+((8191&(o=(o=o+Math.imul(L,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((i=i+Math.imul(O,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var De=(u+(n=Math.imul(F,pe))|0)+((8191&(o=(o=Math.imul(F,me))+Math.imul(V,pe)|0))<<13)|0;return u=((i=Math.imul(V,me))+(o>>>13)|0)+(De>>>26)|0,De&=67108863,c[0]=ge,c[1]=ve,c[2]=ye,c[3]=be,c[4]=we,c[5]=_e,c[6]=ke,c[7]=Ce,c[8]=Se,c[9]=Be,c[10]=Ee,c[11]=xe,c[12]=Ie,c[13]=Ae,c[14]=Pe,c[15]=Te,c[16]=Re,c[17]=Me,c[18]=De,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=f),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var a=o;o=0;for(var s=67108863&n,c=Math.min(i,t.length-1),u=Math.max(0,i-e.length+1);u<=c;u++){var l=i-u,d=(0|e.words[l])*(0|t.words[u]),f=67108863&d;s=67108863&(f=f+s|0),o+=(a=(a=a+(d/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}r.words[i]=s,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,o=0;o<t;o++)n|=(1&e)<<t-o-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a<i;a++)n[a]=t[e[a]],o[a]=r[e[a]]},m.prototype.transform=function(e,t,r,n,o,i){this.permute(i,e,t,r,n,o);for(var a=1;a<o;a<<=1)for(var s=a<<1,c=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),l=0;l<o;l+=s)for(var d=c,f=u,h=0;h<a;h++){var p=r[l+h],m=n[l+h],g=r[l+h+a],v=n[l+h+a],y=d*g-f*v;v=d*v+f*g,g=y,r[l+h]=p+g,n[l+h]=m+v,r[l+h+a]=p-g,n[l+h+a]=m-v,h!==s&&(y=c*d-u*f,f=c*f+u*d,d=y)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,o=0;for(r=r/2|0;r;r>>>=1)o++;return 1<<o+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var o=e[n];e[n]=e[r-n-1],e[r-n-1]=o,o=t[n],t[n]=-t[r-n-1],t[r-n-1]=-o}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var o=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&o,r=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function(e,t,n,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],n[2*a]=8191&i,i>>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)n[a]=0;r(0===i),r(0==(-8192&i))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(n),i=this.stub(n),a=new Array(n),s=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,u,n),this.transform(a,i,s,c,n,o),this.transform(u,i,l,d,n,o);for(var h=0;h<n;h++){var p=s[h]*l[h]-c[h]*d[h];c[h]=s[h]*d[h]+c[h]*l[h],s[h]=p}return this.conjugate(s,c,n),this.transform(s,c,f,i,n,o),this.conjugate(f,i,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),p(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,i=(67108863&o)+(67108863&t);t>>=26,t+=o/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,o=r%26;t[r]=(e.words[n]&1<<o)>>>o}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,c=(0|this.words[t])-s<<n;this.words[t]=c|a,a=s>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this.strip()},o.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,n){var o;r("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,c=n;if(o-=a,o=Math.max(0,o),c){for(var u=0;u<a;u++)c.words[u]=this.words[u];c.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=o);u--){var d=0|this.words[u];this.words[u]=l<<26-i|d>>>i,l=d&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<<t;return!(this.length<=n||!(this.words[n]&o))},o.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,n){var o,i,a=e.length+n;this._expand(a);var s=0;for(o=0;o<e.length;o++){i=(0|this.words[o+n])+s;var c=(0|e.words[o])*t;s=((i-=67108863&c)>>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)s=(i=(0|this.words[o+n])+s)>>26,this.words[o+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,o=0;o<this.length;o++)s=(i=-(0|this.words[o])+s)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,c=n.length-i.length;if("mod"!==t){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,s&&(s.words[c]=1));for(var d=c-1;d>=0;d--){var f=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(f=Math.min(f/a|0,67108863),n._ishlnsubmul(i,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=f)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(t*n+(0|this.words[o]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*t;this.words[n]=o/e|0,t=o%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(c)):(n.isub(t),s.isub(i),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,f=1;0==(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,a=n;0!==i&&a<this.length;a++){var s=0|this.words[a];i=(s+=i)>>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new k(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function C(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(y,v),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&r)<<4|i>>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(b,v),n(w,v),n(_,v),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},k.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g<p);var v=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(v),d=v.redSqr(),h=h.redMul(d),p=g}return f},k.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},k.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var d=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}c=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new C(e)},n(C,k),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,fL)})),gL=vL;function vL(e,t){if(!e)throw new Error(t||"Assertion failed")}vL.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var yL,bL=hL((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),i=o>>8,a=255&o;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}})),wL=hL((function(e,t){var r=t;r.assert=gL,r.toArray=bL.toArray,r.zero2=bL.zero2,r.toHex=bL.toHex,r.encode=bL.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var o=1<<t+1,i=e.clone(),a=0;a<n.length;a++){var s,c=i.andln(o-1);i.isOdd()?(s=c>(o>>1)-1?(o>>1)-c:c,i.isubn(s)):s=0,n[a]=s,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,s,c=e.andln(3)+o&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!=(n=e.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!=(n=t.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*o===a+1&&(o=1-o),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new mL(e,"hex","le")}})),_L=function(e){return yL||(yL=new kL(null)),yL.generate(e)};function kL(e){this.rand=e}var CL=kL;if(kL.prototype.generate=function(e){return this._rand(e)},kL.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==("undefined"==typeof self?"undefined":SP(self)))self.crypto&&self.crypto.getRandomValues?kL.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?kL.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==("undefined"==typeof window?"undefined":SP(window))&&(kL.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var SL=pL;if("function"!=typeof SL.randomBytes)throw new Error("Not supported");kL.prototype._rand=function(e){return SL.randomBytes(e)}}catch(_I){}_L.Rand=CL;var BL=wL.getNAF,EL=wL.getJSF,xL=wL.assert;function IL(e,t){this.type=e,this.p=new mL(t.p,16),this.red=t.prime?mL.red(t.prime):mL.mont(this.p),this.zero=new mL(0).toRed(this.red),this.one=new mL(1).toRed(this.red),this.two=new mL(2).toRed(this.red),this.n=t.n&&new mL(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var AL=IL;function PL(e,t){this.curve=e,this.type=t,this.precomputed=null}IL.prototype.point=function(){throw new Error("Not implemented")},IL.prototype.validate=function(){throw new Error("Not implemented")},IL.prototype._fixedNafMul=function(e,t){xL(e.precomputed);var r=e._getDoubles(),n=BL(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var i,a,s=[];for(i=0;i<n.length;i+=r.step){a=0;for(var c=i+r.step-1;c>=i;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=o;d>0;d--){for(i=0;i<s.length;i++)(a=s[i])===d?l=l.mixedAdd(r.points[i]):a===-d&&(l=l.mixedAdd(r.points[i].neg()));u=u.add(l)}return u.toP()},IL.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,i=BL(t,r,this._bitLength),a=this.jpoint(null,null,null),s=i.length-1;s>=0;s--){for(var c=0;s>=0&&0===i[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=i[s];xL(0!==u),a="affine"===e.type?u>0?a.mixedAdd(o[u-1>>1]):a.mixedAdd(o[-u-1>>1].neg()):u>0?a.add(o[u-1>>1]):a.add(o[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},IL.prototype._wnafMulAdd=function(e,t,r,n,o){var i,a,s,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,d=0;for(i=0;i<n;i++){var f=(s=t[i])._getNAFPoints(e);c[i]=f.wnd,u[i]=f.points}for(i=n-1;i>=1;i-=2){var h=i-1,p=i;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=EL(r[h],r[p]);for(d=Math.max(v[0].length,d),l[h]=new Array(d),l[p]=new Array(d),a=0;a<d;a++){var y=0|v[0][a],b=0|v[1][a];l[h][a]=g[3*(y+1)+(b+1)],l[p][a]=0,u[h]=m}}else l[h]=BL(r[h],c[h],this._bitLength),l[p]=BL(r[p],c[p],this._bitLength),d=Math.max(l[h].length,d),d=Math.max(l[p].length,d)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(i=d;i>=0;i--){for(var k=0;i>=0;){var C=!0;for(a=0;a<n;a++)_[a]=0|l[a][i],0!==_[a]&&(C=!1);if(!C)break;k++,i--}if(i>=0&&k++,w=w.dblp(k),i<0)break;for(a=0;a<n;a++){var S=_[a];0!==S&&(S>0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(i=0;i<n;i++)u[i]=null;return o?w:w.toP()},IL.BasePoint=PL,PL.prototype.eq=function(){throw new Error("Not implemented")},PL.prototype.validate=function(){return this.curve.validate(this)},IL.prototype.decodePoint=function(e,t){e=wL.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?xL(e[e.length-1]%2==0):7===e[0]&&xL(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},PL.prototype.encodeCompressed=function(e){return this.encode(e,!0)},PL.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},PL.prototype.encode=function(e,t){return wL.encode(this._encode(t),e)},PL.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},PL.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},PL.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},PL.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},PL.prototype._getBeta=function(){return null},PL.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var TL=hL((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}}})),RL=wL.assert;function ML(e){AL.call(this,"short",e),this.a=new mL(e.a,16).toRed(this.red),this.b=new mL(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}TL(ML,AL);var DL=ML;function LL(e,t,r,n){AL.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new mL(t,16),this.y=new mL(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function OL(e,t,r,n){AL.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new mL(0)):(this.x=new mL(t,16),this.y=new mL(r,16),this.z=new mL(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function NL(e){AL.call(this,"mont",e),this.a=new mL(e.a,16).toRed(this.red),this.b=new mL(e.b,16).toRed(this.red),this.i4=new mL(4).toRed(this.red).redInvm(),this.two=new mL(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}ML.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new mL(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new mL(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],RL(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new mL(e.a,16),b:new mL(e.b,16)}})):this._getEndoBasis(r)}}},ML.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:mL.mont(e),r=new mL(2).toRed(t).redInvm(),n=r.redNeg(),o=new mL(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},ML.prototype._getEndoBasis=function(e){for(var t,r,n,o,i,a,s,c,u,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,f=this.n.clone(),h=new mL(1),p=new mL(0),m=new mL(0),g=new mL(1),v=0;0!==d.cmpn(0);){var y=f.div(d);c=f.sub(y.mul(d)),u=m.sub(y.mul(h));var b=g.sub(y.mul(p));if(!n&&c.cmp(l)<0)t=s.neg(),r=h,n=c.neg(),o=u;else if(n&&2==++v)break;s=c,f=d,d=c,m=h,h=u,g=p,p=b}i=c.neg(),a=u;var w=n.sqr().add(o.sqr());return i.sqr().add(a.sqr()).cmp(w)>=0&&(i=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),i.negative&&(i=i.neg(),a=a.neg()),[{a:n,b:o},{a:i,b:a}]},ML.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),a=o.mul(r.a),s=i.mul(n.a),c=o.mul(r.b),u=i.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},ML.prototype.pointFromX=function(e,t){(e=new mL(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},ML.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},ML.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var a=this._endoSplit(t[i]),s=e[i],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),n[2*i]=s,n[2*i+1]=c,o[2*i]=a.k1,o[2*i+1]=a.k2}for(var u=this._wnafMulAdd(1,n,o,2*i,r),l=0;l<2*i;l++)n[l]=null,o[l]=null;return u},TL(LL,AL.BasePoint),ML.prototype.point=function(e,t,r){return new LL(this,e,t,r)},ML.prototype.pointFromJSON=function(e,t){return LL.fromJSON(this,e,t)},LL.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},LL.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},LL.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},LL.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},LL.prototype.isInfinity=function(){return this.inf},LL.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},LL.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},LL.prototype.getX=function(){return this.x.fromRed()},LL.prototype.getY=function(){return this.y.fromRed()},LL.prototype.mul=function(e){return e=new mL(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},LL.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},LL.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},LL.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},LL.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},LL.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},TL(OL,AL.BasePoint),ML.prototype.jpoint=function(e,t,r){return new OL(this,e,t,r)},OL.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},OL.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},OL.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(o),c=i.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),d=n.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(i.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,h,p)},OL.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=o.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(l).redISub(l),f=s.redMul(l.redISub(d)).redISub(o.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,f,h)},OL.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),u=a.redAdd(a);for(t=0;t<e;t++){var l=i.redSqr(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=i.redMul(d),m=h.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),v=h.redMul(g);v=v.redIAdd(v).redISub(f);var y=u.redMul(s);t+1<e&&(c=c.redMul(f)),i=m,s=y,u=v}return this.curve.jpoint(i,u.redMul(o),s)},OL.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},OL.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),c=s.redSqr().redISub(a).redISub(a),u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=s.redMul(a.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=f.redIAdd(f);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},OL.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);e=c;var u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),t=s.redMul(a.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),m=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=h.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},OL.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=t.redSqr(),a=r.redSqr(),s=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(a),l=s.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),f=a.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=s.redMul(d).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},OL.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(i)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=o.redIAdd(a).redSqr().redISub(i).redISub(s).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(s).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(a.redMul(s)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(d,f,h)},OL.prototype.mul=function(e,t){return e=new mL(e,t),this.curve._wnafMul(this,e)},OL.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},OL.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},OL.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},OL.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},TL(NL,AL);var FL=NL;function VL(e,t,r){AL.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new mL(t,16),this.z=new mL(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}NL.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},TL(VL,AL.BasePoint),NL.prototype.decodePoint=function(e,t){return this.point(wL.toArray(e,t),1)},NL.prototype.point=function(e,t){return new VL(this,e,t)},NL.prototype.pointFromJSON=function(e){return VL.fromJSON(this,e)},VL.prototype.precompute=function(){},VL.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},VL.fromJSON=function(e,t){return new VL(e,t[0],t[1]||e.one)},VL.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},VL.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},VL.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),o=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,o)},VL.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},VL.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(r),a=o.redMul(n),s=t.z.redMul(i.redAdd(a).redSqr()),c=t.x.redMul(i.redISub(a).redSqr());return this.curve.point(s,c)},VL.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var i=o.length-1;i>=0;i--)0===o[i]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},VL.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},VL.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},VL.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},VL.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},VL.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var jL=wL.assert;function UL(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,AL.call(this,"edwards",e),this.a=new mL(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new mL(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new mL(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),jL(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}TL(UL,AL);var zL=UL;function qL(e,t,r,n,o){AL.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new mL(t,16),this.y=new mL(r,16),this.z=n?new mL(n,16):this.curve.one,this.t=o&&new mL(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}UL.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},UL.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},UL.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},UL.prototype.pointFromX=function(e,t){(e=new mL(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),i=n.redMul(o.redInvm()),a=i.redSqrt();if(0!==a.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},UL.prototype.pointFromY=function(e,t){(e=new mL(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),i=n.redMul(o.redInvm());if(0===i.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=i.redSqrt();if(0!==a.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},UL.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(o)},TL(qL,AL.BasePoint),UL.prototype.pointFromJSON=function(e){return qL.fromJSON(this,e)},UL.prototype.point=function(e,t,r,n){return new qL(this,e,t,r,n)},qL.fromJSON=function(e,t){return new qL(e,t[0],t[1],t[2])},qL.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},qL.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},qL.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=n.redAdd(t),a=i.redSub(r),s=n.redSub(t),c=o.redMul(a),u=i.redMul(s),l=o.redMul(s),d=a.redMul(i);return this.curve.point(c,u,d,l)},qL.prototype._projDbl=function(){var e,t,r,n,o,i,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(o=this.z.redSqr(),i=u.redSub(o).redISub(o),e=a.redSub(s).redISub(c).redMul(i),t=u.redMul(n.redSub(c)),r=u.redMul(i))}else n=s.redAdd(c),o=this.curve._mulC(this.z).redSqr(),i=n.redSub(o).redSub(o),e=this.curve._mulC(a.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(i);return this.curve.point(e,t,r)},qL.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},qL.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),a=o.redSub(n),s=o.redAdd(n),c=r.redAdd(t),u=i.redMul(a),l=s.redMul(c),d=i.redMul(c),f=a.redMul(s);return this.curve.point(u,l,f,d)},qL.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),o=n.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(i).redMul(a),c=o.redSub(s),u=o.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),d=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(i))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(i)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},qL.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},qL.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},qL.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},qL.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},qL.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},qL.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},qL.prototype.getX=function(){return this.normalize(),this.x.fromRed()},qL.prototype.getY=function(){return this.normalize(),this.y.fromRed()},qL.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},qL.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},qL.prototype.toP=qL.prototype.normalize,qL.prototype.mixedAdd=qL.prototype.add;var WL=hL((function(e,t){var r=t;r.base=AL,r.short=DL,r.mont=FL,r.edwards=zL}));function HL(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function KL(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function QL(e){return 1===e.length?"0"+e:e}function GL(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var XL={inherits:TL,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var i=e.charCodeAt(o);i<128?r[n++]=i:i<2048?(r[n++]=i>>6|192,r[n++]=63&i|128):HL(e,o)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++o)),r[n++]=i>>18|240,r[n++]=i>>12&63|128,r[n++]=i>>6&63|128,r[n++]=63&i|128):(r[n++]=i>>12|224,r[n++]=i>>6&63|128,r[n++]=63&i|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},toHex:function(e){for(var t="",r=0;r<e.length;r++)t+=QL(e[r].toString(16));return t},htonl:KL,toHex32:function(e,t){for(var r="",n=0;n<e.length;n++){var o=e[n];"little"===t&&(o=KL(o)),r+=GL(o.toString(16))}return r},zero2:QL,zero8:GL,join32:function(e,t,r,n){var o=r-t;gL(o%4==0);for(var i=new Array(o/4),a=0,s=t;a<i.length;a++,s+=4){var c;c="big"===n?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],i[a]=c>>>0}return i},split32:function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n<e.length;n++,o+=4){var i=e[n];"big"===t?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,o){return e+t+r+n+o>>>0},sum64:function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,a=(i<n?1:0)+r+o;e[t]=a>>>0,e[t+1]=i},sum64_hi:function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,o,i,a,s){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+i>>>0)<i?1:0,e+r+o+a+(c+=(u=u+s>>>0)<s?1:0)>>>0},sum64_4_lo:function(e,t,r,n,o,i,a,s){return t+n+i+s>>>0},sum64_5_hi:function(e,t,r,n,o,i,a,s,c,u){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+i>>>0)<i?1:0,l+=(d=d+s>>>0)<s?1:0,e+r+o+a+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},sum64_5_lo:function(e,t,r,n,o,i,a,s,c,u){return t+n+i+s+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function YL(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var $L=YL;YL.prototype.update=function(e,t){if(e=XL.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=XL.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},YL.prototype.digest=function(e){return this.update(this._pad()),gL(null===this.pending),this._digest(e)},YL.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n};var ZL={BlockHash:$L},JL=XL.rotr32;function eO(e,t,r){return e&t^~e&r}function tO(e,t,r){return e&t^e&r^t&r}var rO=eO,nO=tO,oO=XL.rotl32,iO=XL.sum32,aO=XL.sum32_5,sO=function(e,t,r,n){return 0===e?eO(t,r,n):1===e||3===e?function(e,t,r){return e^t^r}(t,r,n):2===e?tO(t,r,n):void 0},cO=ZL.BlockHash,uO=[1518500249,1859775393,2400959708,3395469782];function lO(){if(!(this instanceof lO))return new lO;cO.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}XL.inherits(lO,cO);var dO=lO;lO.blockSize=512,lO.outSize=160,lO.hmacStrength=80,lO.padLength=64,lO.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=oO(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],c=this.h[4];for(n=0;n<r.length;n++){var u=~~(n/20),l=aO(oO(o,5),sO(u,i,a,s),c,r[n],uO[u]);c=s,s=a,a=oO(i,30),i=o,o=l}this.h[0]=iO(this.h[0],o),this.h[1]=iO(this.h[1],i),this.h[2]=iO(this.h[2],a),this.h[3]=iO(this.h[3],s),this.h[4]=iO(this.h[4],c)},lO.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h,"big"):XL.split32(this.h,"big")};var fO=XL.sum32,hO=XL.sum32_4,pO=XL.sum32_5,mO=rO,gO=nO,vO=function(e){return JL(e,2)^JL(e,13)^JL(e,22)},yO=function(e){return JL(e,6)^JL(e,11)^JL(e,25)},bO=function(e){return JL(e,7)^JL(e,18)^e>>>3},wO=function(e){return JL(e,17)^JL(e,19)^e>>>10},_O=ZL.BlockHash,kO=[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];function CO(){if(!(this instanceof CO))return new CO;_O.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=kO,this.W=new Array(64)}XL.inherits(CO,_O);var SO=CO;function BO(){if(!(this instanceof BO))return new BO;SO.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}CO.blockSize=512,CO.outSize=256,CO.hmacStrength=192,CO.padLength=64,CO.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=hO(wO(r[n-2]),r[n-7],bO(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],c=this.h[4],u=this.h[5],l=this.h[6],d=this.h[7];for(gL(this.k.length===r.length),n=0;n<r.length;n++){var f=pO(d,yO(c),mO(c,u,l),this.k[n],r[n]),h=fO(vO(o),gO(o,i,a));d=l,l=u,u=c,c=fO(s,f),s=a,a=i,i=o,o=fO(f,h)}this.h[0]=fO(this.h[0],o),this.h[1]=fO(this.h[1],i),this.h[2]=fO(this.h[2],a),this.h[3]=fO(this.h[3],s),this.h[4]=fO(this.h[4],c),this.h[5]=fO(this.h[5],u),this.h[6]=fO(this.h[6],l),this.h[7]=fO(this.h[7],d)},CO.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h,"big"):XL.split32(this.h,"big")},XL.inherits(BO,SO);var EO=BO;BO.blockSize=512,BO.outSize=224,BO.hmacStrength=192,BO.padLength=64,BO.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h.slice(0,7),"big"):XL.split32(this.h.slice(0,7),"big")};var xO=XL.rotr64_hi,IO=XL.rotr64_lo,AO=XL.shr64_hi,PO=XL.shr64_lo,TO=XL.sum64,RO=XL.sum64_hi,MO=XL.sum64_lo,DO=XL.sum64_4_hi,LO=XL.sum64_4_lo,OO=XL.sum64_5_hi,NO=XL.sum64_5_lo,FO=ZL.BlockHash,VO=[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];function jO(){if(!(this instanceof jO))return new jO;FO.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=VO,this.W=new Array(160)}XL.inherits(jO,FO);var UO=jO;function zO(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function qO(e,t,r,n,o,i){var a=t&n^~t&i;return a<0&&(a+=4294967296),a}function WO(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function HO(e,t,r,n,o,i){var a=t&n^t&i^n&i;return a<0&&(a+=4294967296),a}function KO(e,t){var r=xO(e,t,28)^xO(t,e,2)^xO(t,e,7);return r<0&&(r+=4294967296),r}function QO(e,t){var r=IO(e,t,28)^IO(t,e,2)^IO(t,e,7);return r<0&&(r+=4294967296),r}function GO(e,t){var r=xO(e,t,14)^xO(e,t,18)^xO(t,e,9);return r<0&&(r+=4294967296),r}function XO(e,t){var r=IO(e,t,14)^IO(e,t,18)^IO(t,e,9);return r<0&&(r+=4294967296),r}function YO(e,t){var r=xO(e,t,1)^xO(e,t,8)^AO(e,t,7);return r<0&&(r+=4294967296),r}function $O(e,t){var r=IO(e,t,1)^IO(e,t,8)^PO(e,t,7);return r<0&&(r+=4294967296),r}function ZO(e,t){var r=xO(e,t,19)^xO(t,e,29)^AO(e,t,6);return r<0&&(r+=4294967296),r}function JO(e,t){var r=IO(e,t,19)^IO(t,e,29)^PO(e,t,6);return r<0&&(r+=4294967296),r}function eN(){if(!(this instanceof eN))return new eN;UO.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}jO.blockSize=1024,jO.outSize=512,jO.hmacStrength=192,jO.padLength=128,jO.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var o=ZO(r[n-4],r[n-3]),i=JO(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],c=YO(r[n-30],r[n-29]),u=$O(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=DO(o,i,a,s,c,u,l,d),r[n+1]=LO(o,i,a,s,c,u,l,d)}},jO.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],o=this.h[1],i=this.h[2],a=this.h[3],s=this.h[4],c=this.h[5],u=this.h[6],l=this.h[7],d=this.h[8],f=this.h[9],h=this.h[10],p=this.h[11],m=this.h[12],g=this.h[13],v=this.h[14],y=this.h[15];gL(this.k.length===r.length);for(var b=0;b<r.length;b+=2){var w=v,_=y,k=GO(d,f),C=XO(d,f),S=zO(d,0,h,0,m),B=qO(0,f,0,p,0,g),E=this.k[b],x=this.k[b+1],I=r[b],A=r[b+1],P=OO(w,_,k,C,S,B,E,x,I,A),T=NO(w,_,k,C,S,B,E,x,I,A);w=KO(n,o),_=QO(n,o),k=WO(n,0,i,0,s),C=HO(0,o,0,a,0,c);var R=RO(w,_,k,C),M=MO(w,_,k,C);v=m,y=g,m=h,g=p,h=d,p=f,d=RO(u,l,P,T),f=MO(l,l,P,T),u=s,l=c,s=i,c=a,i=n,a=o,n=RO(P,T,R,M),o=MO(P,T,R,M)}TO(this.h,0,n,o),TO(this.h,2,i,a),TO(this.h,4,s,c),TO(this.h,6,u,l),TO(this.h,8,d,f),TO(this.h,10,h,p),TO(this.h,12,m,g),TO(this.h,14,v,y)},jO.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h,"big"):XL.split32(this.h,"big")},XL.inherits(eN,UO);var tN=eN;eN.blockSize=1024,eN.outSize=384,eN.hmacStrength=192,eN.padLength=128,eN.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h.slice(0,12),"big"):XL.split32(this.h.slice(0,12),"big")};var rN={sha1:dO,sha224:EO,sha256:SO,sha384:tN,sha512:UO},nN=XL.rotl32,oN=XL.sum32,iN=XL.sum32_3,aN=XL.sum32_4,sN=ZL.BlockHash;function cN(){if(!(this instanceof cN))return new cN;sN.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}XL.inherits(cN,sN);var uN=cN;function lN(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function dN(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function fN(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}cN.blockSize=512,cN.outSize=160,cN.hmacStrength=192,cN.padLength=64,cN.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],o=this.h[2],i=this.h[3],a=this.h[4],s=r,c=n,u=o,l=i,d=a,f=0;f<80;f++){var h=oN(nN(aN(r,lN(f,n,o,i),e[hN[f]+t],dN(f)),mN[f]),a);r=a,a=i,i=nN(o,10),o=n,n=h,h=oN(nN(aN(s,lN(79-f,c,u,l),e[pN[f]+t],fN(f)),gN[f]),d),s=d,d=l,l=nN(u,10),u=c,c=h}h=iN(this.h[1],o,l),this.h[1]=iN(this.h[2],i,d),this.h[2]=iN(this.h[3],a,s),this.h[3]=iN(this.h[4],r,c),this.h[4]=iN(this.h[0],n,u),this.h[0]=h},cN.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h,"little"):XL.split32(this.h,"little")};var hN=[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],pN=[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],mN=[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],gN=[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],vN={ripemd160:uN};function yN(e,t,r){if(!(this instanceof yN))return new yN(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(XL.toArray(t,r))}var bN=yN;yN.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),gL(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},yN.prototype.update=function(e,t){return this.inner.update(e,t),this},yN.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var wN=hL((function(e,t){var r=t;r.utils=XL,r.common=ZL,r.sha=rN,r.ripemd=vN,r.hmac=bN,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160})),_N={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},kN=hL((function(e,t){var r,n=t,o=wL.assert;function i(e){"short"===e.type?this.curve=new WL.short(e):"edwards"===e.type?this.curve=new WL.edwards(e):this.curve=new WL.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:wN.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:wN.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:wN.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:wN.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:wN.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:wN.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:wN.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=_N}catch(e){r=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:wN.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function CN(e){if(!(this instanceof CN))return new CN(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=bL.toArray(e.entropy,e.entropyEnc||"hex"),r=bL.toArray(e.nonce,e.nonceEnc||"hex"),n=bL.toArray(e.pers,e.persEnc||"hex");gL(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var SN=CN;CN.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},CN.prototype._hmac=function(){return new wN.hmac(this.hash,this.K)},CN.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},CN.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=bL.toArray(e,t),r=bL.toArray(r,n),gL(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},CN.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=bL.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var i=o.slice(0,e);return this._update(r),this._reseed++,bL.encode(i,t)};var BN=wL.assert;function EN(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var xN=EN;EN.fromPublic=function(e,t,r){return t instanceof EN?t:new EN(e,{pub:t,pubEnc:r})},EN.fromPrivate=function(e,t,r){return t instanceof EN?t:new EN(e,{priv:t,privEnc:r})},EN.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},EN.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},EN.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},EN.prototype._importPrivate=function(e,t){this.priv=new mL(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},EN.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?BN(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||BN(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},EN.prototype.derive=function(e){return e.validate()||BN(e.validate(),"public point not validated"),e.mul(this.priv).getX()},EN.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},EN.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},EN.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var IN=wL.assert;function AN(e,t){if(e instanceof AN)return e;this._importDER(e,t)||(IN(e.r&&e.s,"Signature without r or s"),this.r=new mL(e.r,16),this.s=new mL(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var PN=AN;function TN(){this.place=0}function RN(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,a=t.place;i<n;i++,a++)o<<=8,o|=e[a],o>>>=0;return!(o<=127)&&(t.place=a,o)}function MN(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function DN(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}AN.prototype._importDER=function(e,t){e=wL.toArray(e,t);var r=new TN;if(48!==e[r.place++])return!1;var n=RN(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=RN(e,r);if(!1===o)return!1;var i=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var a=RN(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new mL(i),this.s=new mL(s),this.recoveryParam=null,!0},AN.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=MN(t),r=MN(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];DN(n,t.length),(n=n.concat(t)).push(2),DN(n,r.length);var o=n.concat(r),i=[48];return DN(i,o.length),i=i.concat(o),wL.encode(i,e)};var LN=wL.assert;function ON(e){if(!(this instanceof ON))return new ON(e);"string"==typeof e&&(LN(Object.prototype.hasOwnProperty.call(kN,e),"Unknown curve "+e),e=kN[e]),e instanceof kN.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var NN=ON;ON.prototype.keyPair=function(e){return new xN(this,e)},ON.prototype.keyFromPrivate=function(e,t){return xN.fromPrivate(this,e,t)},ON.prototype.keyFromPublic=function(e,t){return xN.fromPublic(this,e,t)},ON.prototype.genKeyPair=function(e){e||(e={});for(var t=new SN({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||_L(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new mL(2));;){var o=new mL(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},ON.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},ON.prototype.sign=function(e,t,r,n){"object"==SP(r)&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new mL(e,16));for(var o=this.n.byteLength(),i=t.getPrivate().toArray("be",o),a=e.toArray("be",o),s=new SN({hash:this.hash,entropy:i,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new mL(1)),u=0;;u++){var l=n.k?n.k(u):new mL(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var d=this.g.mul(l);if(!d.isInfinity()){var f=d.getX(),h=f.umod(this.n);if(0!==h.cmpn(0)){var p=l.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==f.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new PN({r:h,s:p,recoveryParam:m})}}}}}},ON.prototype.verify=function(e,t,r,n){e=this._truncateToN(new mL(e,16)),r=this.keyFromPublic(r,n);var o=(t=new PN(t,"hex")).r,i=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var a,s=i.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},ON.prototype.recoverPubKey=function(e,t,r,n){LN((3&r)===r,"The recovery param is more than two bits"),t=new PN(t,n);var o=this.n,i=new mL(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var l=t.r.invm(o),d=o.sub(i).mul(l).umod(o),f=s.mul(l).umod(o);return this.g.mulAdd(d,a,f)},ON.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new PN(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var FN=wL.assert,VN=wL.parseBytes,jN=wL.cachedProperty;function UN(e,t){this.eddsa=e,this._secret=VN(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=VN(t.pub)}UN.fromPublic=function(e,t){return t instanceof UN?t:new UN(e,{pub:t})},UN.fromSecret=function(e,t){return t instanceof UN?t:new UN(e,{secret:t})},UN.prototype.secret=function(){return this._secret},jN(UN,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),jN(UN,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),jN(UN,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),jN(UN,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),jN(UN,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),jN(UN,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),UN.prototype.sign=function(e){return FN(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},UN.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},UN.prototype.getSecret=function(e){return FN(this._secret,"KeyPair is public only"),wL.encode(this.secret(),e)},UN.prototype.getPublic=function(e){return wL.encode(this.pubBytes(),e)};var zN=UN,qN=wL.assert,WN=wL.cachedProperty,HN=wL.parseBytes;function KN(e,t){this.eddsa=e,"object"!=SP(t)&&(t=HN(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),qN(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof mL&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}WN(KN,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),WN(KN,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),WN(KN,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),WN(KN,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),KN.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},KN.prototype.toHex=function(){return wL.encode(this.toBytes(),"hex").toUpperCase()};var QN=KN,GN=wL.assert,XN=wL.parseBytes;function YN(e){if(GN("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof YN))return new YN(e);e=kN[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=wN.sha512}var $N=YN;YN.prototype.sign=function(e,t){e=XN(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),o=this.g.mul(n),i=this.encodePoint(o),a=this.hashInt(i,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:s,Rencoded:i})},YN.prototype.verify=function(e,t,r){e=XN(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),n.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(n.pub().mul(o)).eq(i)},YN.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return wL.intFromLE(e.digest()).umod(this.curve.n)},YN.prototype.keyFromPublic=function(e){return zN.fromPublic(this,e)},YN.prototype.keyFromSecret=function(e){return zN.fromSecret(this,e)},YN.prototype.makeSignature=function(e){return e instanceof QN?e:new QN(this,e)},YN.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},YN.prototype.decodePoint=function(e){var t=(e=wL.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),o=wL.intFromLE(r);return this.curve.pointFromY(o,n)},YN.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},YN.prototype.decodeInt=function(e){return wL.intFromLE(e)},YN.prototype.isPoint=function(e){return e instanceof this.pointClass};var ZN=hL((function(e,t){var r=t;r.version="6.5.4",r.utils=wL,r.rand=_L,r.curve=WL,r.curves=kN,r.ec=NN,r.eddsa=$N}));function JN(e,t){var r=tF();return(JN=function(e,t){return r[e-=328]})(e,t)}var eF=JN;function tF(){var e=["Mjci1ul8mm","2188593Xclinx","44P0rKKsZK","+faHkP3QC3","49435752zDNrFx","D9EKOWS+U4","ssRdXLZEX8","5taCaWi","112HtQvaP","KA==","519563fhtZhq","KoZIzj0DAQ","13oIMCDS","ytJdcsPxrD","5733052jFPnGP","2292997RniAsr","12pHfASS","MfPrcYTM70","170DvkwlC","000","2a8648ce3d","0301070342","DepBO8t60S","cDQgAE9h6Z","294554LvBncQ","911403nzCtnZ","1ZtAkYC","3059301306"];return(tF=function(){return e})()}!function(e,t){for(var r=JN,n=tF();;)try{if(771712==-parseInt(r(349))/1*(parseInt(r(347))/2)+parseInt(r(352))/3+-parseInt(r(337))/4*(-parseInt(r(330))/5)+-parseInt(r(339))/6*(-parseInt(r(338))/7)+-parseInt(r(331))/8*(-parseInt(r(348))/9)+-parseInt(r(341))/10*(-parseInt(r(333))/11)+-parseInt(r(355))/12*(parseInt(r(335))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}();var rF,nF=(rF=eF(350)+"072a8648ce3d02010608"+eF(343)+eF(344)+eF(342),uL("MFkwEwYHKoZIzj0CAQYI"+eF(334)+eF(346)+eF(345)+eF(336)+eF(354)+eF(353)+eF(351)+eF(328)+eF(340)+eF(329)+eF(332)).replace(rF,"")),oF=new ZN.ec("p256").keyFromPublic(nF,"hex");function iF(e,t){return aL(this,void 0,void 0,kP().mark((function r(){var n,o;return kP().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,function(e){return aL(this,void 0,void 0,kP().mark((function t(){var r,n;return kP().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(new TextEncoder).encode(e),t.next=3,crypto.subtle.digest("SHA-256",r);case 3:return n=t.sent,t.abrupt("return",Array.from(new Uint8Array(n)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""));case 5:case"end":return t.stop()}}),t)})))}(e);case 3:return n=r.sent,o=uL(t),r.abrupt("return",oF.verify(n,o));case 8:return r.prev=8,r.t0=r.catch(0),r.abrupt("return",(console.error(r.t0),!1));case 11:case"end":return r.stop()}}),r,null,[[0,8]])})))}function aF(e,t){return aL(this,void 0,void 0,kP().mark((function r(){var n,o,i,a;return kP().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,iF(e,t);case 2:if(r.sent){r.next=4;break}return r.abrupt("return",{isValid:!1,error:sL.invalid_signature});case 4:if("string"==typeof(n=JSON.parse(e)).app_id&&n.app_id===window.location.hostname){r.next=7;break}return r.abrupt("return",{isValid:!1,error:sL.invalid_app_id});case 7:return o=new Date,i=new Date(n.expired_at),a=new Date(n.created_at),r.abrupt("return","Invalid Date"===i.toString()||"Invalid Date"===a.toString()?{isValid:!1,error:sL.invalid_date}:o<=a||o>=i?{isValid:!1,error:sL.license_expired}:{isValid:!0,error:null});case 9:case"end":return r.stop()}}),r)})))}function sF(e,t){return aL(this,void 0,void 0,kP().mark((function r(){var n,o,i,a,s,c,u,l,d;return kP().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,iF(e,t);case 2:if(r.sent){r.next=4;break}return r.abrupt("return",{isValid:!1,error:sL.invalid_signature});case 4:if((n=JSON.parse(e)).url){r.next=7;break}return r.abrupt("return",{isValid:!1,error:sL.missing_url});case 7:return o=null,r.prev=8,r.next=11,fetch("".concat(n.url,"/v1/verify_license"),{method:"POST",body:JSON.stringify({license_id:n.id,app_id:window.location.hostname}),headers:{"Content-Type":"application/json"}});case 11:o=r.sent,r.next=17;break;case 14:r.prev=14,r.t0=r.catch(8),console.error(r.t0);case 17:if(null!==o){r.next=19;break}return r.abrupt("return",function(){return aL(this,void 0,void 0,kP().mark((function e(){var t,r,n,o;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(t=localStorage.getItem("tv:sdk-license"))){e.next=3;break}return e.abrupt("return",{isValid:!1,error:sL.invalid_license});case 3:return r=dL(t),n=r.license,o=r.signature,e.abrupt("return",aF(lL(uL(n)),o));case 5:case"end":return e.stop()}}),e)})))}());case 19:if(200===(i=o.status)){r.next=23;break}return a=i.toString(),r.abrupt("return",{isValid:!1,error:a in sL?sL[a]:sL.unknown});case 23:return r.next=25,o.json();case 25:if(s=r.sent,!(Array.isArray(s.errors)&&s.errors.length>0)){r.next=28;break}return r.abrupt("return",(console.error(s.errors[0]),{isValid:!1,error:sL.invalid_license}));case 28:return c=dL(s.data.license_key),u=c.license,l=c.signature,d=lL(uL(u)),r.next=31,iF(d,l);case 31:if(!r.sent){r.next=35;break}r.t1=(localStorage.setItem("tv:sdk-license",s.data.license_key),{isValid:!0,error:null}),r.next=36;break;case 35:r.t1={isValid:!1,error:sL.invalid_signature};case 36:return r.abrupt("return",r.t1);case 37:case"end":return r.stop()}}),r,null,[[8,14]])})))}function cF(e){return aL(this,void 0,void 0,kP().mark((function t(){var r,n,o,i,a;return kP().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e){t.next=3;break}return t.abrupt("return",{isValid:!1,error:sL.invalid_license});case 3:if(r=dL(e),n=r.mode,o=r.license,i=r.signature,a=lL(uL(o)),"offline"!==n){t.next=10;break}return t.next=7,aF(a,i);case 7:t.t0=t.sent,t.next=18;break;case 10:if("online"!==n){t.next=16;break}return t.next=13,sF(a,i);case 13:t.t1=t.sent,t.next=17;break;case 16:t.t1={isValid:!1,error:sL.invalid_license};case 17:t.t0=t.t1;case 18:return t.abrupt("return",t.t0);case 21:return t.prev=21,t.t2=t.catch(0),t.abrupt("return",(console.error(t.t2),{isValid:!1,error:sL.unknown}));case 24:case"end":return t.stop()}}),t,null,[[0,21]])})))}var uF=function(e,t,r){var n=null==e?void 0:cM(e,t);return void 0===n?r:n},lF=function(e,t){var r=uF(e,t),n=uF(e,t+"_web");return null!=n?n:r},dF=Object.freeze({__proto__:null,getWebSetting:lF}),fF=hv.createContext(!1),hF={invalid_license:"license_invalid",invalid_license_exception:"license_invalid",invalid_parameter_exception:"license_invalid",rate_limit_exception:"license_rate_limit_exceeded",internal_server_error:"license_internal_server_error",unknown_license_error:"license_unknown_error",invalid_app_id:"license_invalid",invalid_date:"license_invalid",license_expired:"license_invalid",invalid_signature:"license_invalid",missing_url:"license_invalid"},pF=function(e){var t=e.children,r=e.clientSettings,n=e.onError,o=RP(hv.useState(!1),2),i=o[0],a=o[1],s=!!r,c=s?lF(r,"data.settings.sdk_settings.license_settings.license_key"):null;return hv.useEffect((function(){s&&XD(void 0,void 0,void 0,kP().mark((function e(){var t;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,cF(c);case 2:t=e.sent,a(t.isValid),t.isValid||n(mP[hF[t.error]]);case 5:case"end":return e.stop()}}),e)})))}),[s,c,n]),i?hv.createElement(fF.Provider,{value:i},t):null},mF=Object.freeze({__proto__:null,LicenseProvider:pF,useLicenseVerifier:function(){return hv.useContext(fF)}});function gF(e){return new Promise((function(t){return setTimeout(t,e)}))}var vF=Object.freeze({__proto__:null,sleep:gF}),yF=Symbol("Comlink.proxy"),bF=Symbol("Comlink.endpoint"),wF=Symbol("Comlink.releaseProxy"),_F=Symbol("Comlink.thrown"),kF=function(e){return"object"==rg(e)&&null!==e||"function"==typeof e},CF=new Map([["proxy",{canHandle:function(e){return kF(e)&&e[yF]},serialize:function(e){var t=new MessageChannel,r=t.port1,n=t.port2;return SF(e,r),[n,[n]]},deserialize:function(e){return e.start(),EF(e)}}],["throw",{canHandle:function(e){return kF(e)&&_F 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 SF(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;t.addEventListener("message",(function r(n){if(n&&n.data){var o,i=Object.assign({path:[]},n.data),a=i.id,s=i.type,c=i.path,u=(n.data.argumentList||[]).map(RF);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]]=RF(n.data.value),o=!0;break;case"APPLY":o=d.apply(l,u);break;case"CONSTRUCT":o=function(e){return Object.assign(e,cg({},yF,!0))}(Ym(d,vg(u)));break;case"ENDPOINT":var f=new MessageChannel,h=f.port1,p=f.port2;SF(e,p),o=function(e,t){return PF.set(e,t),e}(h,[h]);break;case"RELEASE":o=void 0;break;default:return}}catch(e){o=cg({value:e},_F,0)}Promise.resolve(o).catch((function(e){return cg({value:e},_F,0)})).then((function(e){var n=gg(TF(e),2),o=n[0],i=n[1];t.postMessage(Object.assign(Object.assign({},o),{id:a}),i),"RELEASE"===s&&(t.removeEventListener("message",r),BF(t))}))}})),t.start&&t.start()}function BF(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function EF(e,t){return IF(e,[],t)}function xF(e){if(e)throw new Error("Proxy has been released and is not useable")}function IF(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=!1,o=new Proxy(r,{get:function(r,i){if(xF(n),i===wF)return function(){return MF(e,{type:"RELEASE",path:t.map((function(e){return e.toString()}))}).then((function(){BF(e),n=!0}))};if("then"===i){if(0===t.length)return{then:function(){return o}};var a=MF(e,{type:"GET",path:t.map((function(e){return e.toString()}))}).then(RF);return a.then.bind(a)}return IF(e,[].concat(vg(t),[i]))},set:function(r,o,i){xF(n);var a=gg(TF(i),2),s=a[0],c=a[1];return MF(e,{type:"SET",path:[].concat(vg(t),[o]).map((function(e){return e.toString()})),value:s},c).then(RF)},apply:function(r,o,i){xF(n);var a=t[t.length-1];if(a===bF)return MF(e,{type:"ENDPOINT"}).then(RF);if("bind"===a)return IF(e,t.slice(0,-1));var s=gg(AF(i),2),c=s[0],u=s[1];return MF(e,{type:"APPLY",path:t.map((function(e){return e.toString()})),argumentList:c},u).then(RF)},construct:function(r,o){xF(n);var i=gg(AF(o),2),a=i[0],s=i[1];return MF(e,{type:"CONSTRUCT",path:t.map((function(e){return e.toString()})),argumentList:a},s).then(RF)}});return o}function AF(e){var t,r=e.map(TF);return[r.map((function(e){return e[0]})),(t=r.map((function(e){return e[1]})),Array.prototype.concat.apply([],t))]}var PF=new WeakMap;function TF(e){var t,r=Cg(CF);try{for(r.s();!(t=r.n()).done;){var n=gg(t.value,2),o=n[0],i=n[1];if(i.canHandle(e)){var a=gg(i.serialize(e),2);return[{type:"HANDLER",name:o,value:a[0]},a[1]]}}}catch(e){r.e(e)}finally{r.f()}return[{type:"RAW",value:e},PF.get(e)||[]]}function RF(e){switch(e.type){case"HANDLER":return CF.get(e.name).deserialize(e.value);case"RAW":return e.value}}function MF(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 DF=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(),l(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:s,type:l,path:d}=Object.assign({path:[]},o.data),h=(o.data.argumentList||[]).map(g);let m;try{const r=d.slice(0,-1).reduce(((e,t)=>e[t]),t),n=d.reduce(((e,t)=>e[t]),t);switch(l){case"GET":m=n;break;case"SET":r[d.slice(-1)[0]]=g(o.data.value),m=!0;break;case"APPLY":m=n.apply(r,h);break;case"CONSTRUCT":m=function(t){return Object.assign(t,{[e]:!0})}(new n(...h));break;case"ENDPOINT":{const{port1:e,port2:r}=new MessageChannel;i(t,r),m=function(e,t){return u.set(e,t),e}(e,[e])}break;case"RELEASE":m=void 0;break;default:return}}catch(e){m={value:e,[n]:0}}Promise.resolve(m).catch((e=>({value:e,[n]:0}))).then((e=>{const[t,n]=_(e);r.postMessage(Object.assign(Object.assign({},t),{id:s}),n),"RELEASE"===l&&(r.removeEventListener("message",a),c(r))}))})),r.start&&r.start()}function c(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function s(e){if(e)throw new Error("Proxy has been released and is not useable")}function l(e,n=[],a=function(){}){let o=!1;const i=new Proxy(a,{get(t,a){if(s(o),a===r)return()=>h(e,{type:"RELEASE",path:n.map((e=>e.toString()))}).then((()=>{c(e),o=!0}));if("then"===a){if(0===n.length)return{then:()=>i};const t=h(e,{type:"GET",path:n.map((e=>e.toString()))}).then(g);return t.then.bind(t)}return l(e,[...n,a])},set(t,r,a){s(o);const[i,c]=_(a);return h(e,{type:"SET",path:[...n,r].map((e=>e.toString())),value:i},c).then(g)},apply(r,a,i){s(o);const c=n[n.length-1];if(c===t)return h(e,{type:"ENDPOINT"}).then(g);if("bind"===c)return l(e,n.slice(0,-1));const[u,_]=d(i);return h(e,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:u},_).then(g)},construct(t,r){s(o);const[a,i]=d(r);return h(e,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:a},i).then(g)}});return i}function d(e){const t=e.map(_);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const u=new WeakMap;function _(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},u.get(e)||[]]}function g(e){switch(e.type){case"HANDLER":return o.get(e.name).deserialize(e.value);case"RAW":return e.value}}function h(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 m=[[0,1,0],[1,-4,1],[0,1,0]];function f(e,t,r,n){return e[4*(r*t+n)]}function p(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function v(e,t,r){return(t=p(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){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,c=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){l=!0,a=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(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}const k="frontal",w="left",P="right",S="up",E="down";var L=0,M=1,C=2,A=0,R=1,O=2,V=function(e,t){var r=y(e,2),n=r[0],a=r[1],o=y(t,2),i=o[0],c=o[1];return n>c||i>a?A:n<=i&&c<=a?O:R};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),c=i[0],s=i[1],l=[a[0],o[0]],d=[a[1],o[1]],u=[c[0],s[0]],_=[c[1],s[1]],g=[l[0]+r,l[1]-r],h=[d[0]+r,d[1]-.8*r];return V(g,u)===O&&V(h,_)===O?C:V(l,u)===A||V(d,_)===A?L:M}const x=Object.assign(Object.assign({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."}},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."}},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"},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."}}},{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."}},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. Please try again.",vi:"Bạn cần quay CHẬM lại. Vui 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. Please try again.",vi:"Khuôn mặt không nằm trong khung hình. Xin 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. Please try again.",vi:"Bạn cần hoàn thành động tác theo chỉ dẫn trong <%= x %> giây. Xin vui lòng thử lại."}},liveness_blurry:{code:"liveness_blurry",msg:{en:"Image is too blurry. Please ensure your face is in focus.",vi:"Hình ảnh bị mờ. Vui lòng đảm bảo khuôn mặt của bạn rõ nét."}},card_sanity_not_good:{code:"card_sanity_not_good",msg:{en:"Card sanity not good",vi:"Card sanity chưa đạt"}},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"}},client_web_setting_not_found:{code:"client_web_setting_not_found",msg:"Client Web Setting Not Found"},id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Please capture the <%= side %> side of ID card (occupy 50-95% of the frame)",vi:"Vui lòng chụp mặt <%= side %> của giấy tờ (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 (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ lại GẦN hơn (chiếm 50-95% khung hình)"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please move ID card FARTHER (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ ra XA hơ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."}},close_eye:{code:"close_eye",msg:{vi:"Vui lòng mở to mắt",en:"Open your eyes clearly"}}}),{license_invalid:{code:"license_invalid",msg:{en:"Invalid license",vi:"License không hợp lệ"}},license_rate_limit_exceeded:{code:"license_rate_limit_exceeded",msg:{en:"Invalid license",vi:"Quá số lần thử"}},license_internal_server_error:{code:"license_internal_server_error",msg:{en:"Internal server error",vi:"Lỗi server"}},license_unknown_error:{code:"license_unknown_error",msg:{en:"Unknown error",vi:"Lỗi không xác định"}}});function I(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function T(e,t){return[e[0]-t[0],e[1]-t[1]]}function D(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,c=0,s=n-1,l=r-1,d=1;d<s;d++)for(var u=1;u<l;u++){var _=m[0][0]*f(t,r,u-1,d-1)+m[0][1]*f(t,r,u,d-1)+m[0][2]*f(t,r,u+1,d-1)+m[1][0]*f(t,r,u-1,d)+m[1][1]*f(t,r,u,d)+m[1][2]*f(t,r,u+1,d)+m[2][0]*f(t,r,u-1,d+1)+m[2][1]*f(t,r,u,d+1)+m[2][2]*f(t,r,u+1,d+1);(_=Math.abs(_))>25&&i++,_>15&&_<25&&c++}var g=0;return i+c!==0&&(g=i/(i+c)),g},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,c,s=y(e,4),l=s[0],d=s[1],u=s[2],_=s[3],g=T(d,l),h=I(g),m=(a=d,t=[(n=l)[0]+a[0],n[1]+a[1]],r=2,[t[0]/r,t[1]/r]),f=T(u,m),p=I(T(_,u)),v=T(_,m),b=I(v),k=(f[0]*v[0]+f[1]*v[1])/b,w=p/b;if(h>.5*b)o=(f[0]*g[0]+f[1]*g[1])/h/h;else{var P=I(T(f,function(e,t){return[e[0]*t,e[1]*t]}(v,k/b)));c=v,o=((i=f)[0]*c[1]-c[0]*i[1]>=0?1:-1)*P/h}return{left_right_score:o,up_down_score:w}}(t),i=o.left_right_score,c=o.up_down_score,s=y(t,3),l=s[0],d=s[1],u=s[2],_=d[0]-u[0],g=l[0]-u[0],h=r?.1:.3,m=c>a.upper,f=c<a.lower,p=i>=.35&&i<=.6,v=i<=-.35&&i>=-.6,b=m&&!v&&!p,L=f&&!v&&!p,M=v&&!m&&!f,C=p&&!m&&!f;return c>=a.lower&&c<=a.upper&&i>-h&&i<h&&_*g<0?{gesture:k,leftRightScore:i}:b?{gesture:S,leftRightScore:i}:L?{gesture:E,leftRightScore:i}:C?{gesture:P,leftRightScore:i}:M?{gesture:w,leftRightScore:i}:null},validatePredictionsFunc:function(e){var t,r,n,a,o,i,c,s,l,d,u,_,g,h,m,f,p,b,k,w,P,S,E,A,R,O,V,I,T,D,F,N,H=e.predictions,K=e.width,q=e.height,Y=e.cropAreaCoordinates,G=null!=Y?Y:[[0,0],[K,q]],U=H.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,c=n;if(!c){var s=y(r,2),l=s[0],d=s[1];c=(d[0]-l[0])*(d[1]-l[1])}var u=i;if(!u){var _=y(o,2),g=_[0],h=_[1];u=(h[0]-g[0])*(h[1]-g[1])}return c/u}({small:{coords:[r,n]},big:{coords:G}})<=.025?e[L].push(t):e[j(G,[r,n])].push(t);return e}),v(v(v({},M,[]),C,[]),L,[])),W=U[C].length,z=U[M].length;if(0===W)t=z>0?x.partial_face:x.no_face;else if(W+z>1)t=x.multiple_faces;else{var B=r=U[C][0],X=B.topLeft,Q=B.bottomRight;E=G,A=y([X,Q],2),R=A[0],O=A[1],V=y(E,2),I=V[0],T=V[1],D=O[0]-R[0],F=O[1]-R[1],N=T[0]-I[0],(n=D/N<F/N?D/N:F/N)<.4&&(t=x.face_too_small),n>.61&&(t=x.face_too_large),j(G,(a=r.landmarks,c=a[0],s=a[1],l=a[2],d=a[3],u=a[4],_=a[5],g=.5*(c[1]+s[1]),h=g+1.5*(g-d[1]),m=d[1]-1.2*(l[1]-d[1]),f=[c[0],s[0],l[0],d[0],u[0],_[0]],p=Math.min.apply(Math,f),b=Math.min(h,m),k=Math.max.apply(Math,f),w=Math.max(h,m),P=Math.abs(d[0]-u[0])/Math.abs(d[0]-_[0]),S=d[0]-u[0]<0&&_[0]-d[0]>.05*(k-p),d[0]-u[0]>0&&_[0]-d[0]<-.05*(k-p)?(o=.2,i=.1):S?(o=.1,i=.2):P>2||P<.5?(o=.15,i=.15):(o=.05,i=.05),[[p-o*(k-p),b],[k+i*(k-p),w]]),.05*K)!==C&&(t=x.face_out_of_box)}return{ratio:n,error:t,fullFace:r,faceRatio:n,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],c=r[2],s=a;s<o;s++)for(var l=i;l<c;l++){var d=D(e,t,s,l),u=d.r,_=d.g,g=d.b;u>=245&&g>=245&&_>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 EF(new Worker(t))}(),LF=[[0,1,0],[1,-4,1],[0,1,0]];function OF(e,t,r,n){return e[4*(r*t+n)]}function NF(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,o=0;o<t.length;o+=4){var i=(t[o]+t[o+1]+t[o+2])/3;t[o]=i}for(var a=0,s=0,c=n-1,u=r-1,l=1;l<c;l++)for(var d=1;d<u;d++){var f=LF[0][0]*OF(t,r,d-1,l-1)+LF[0][1]*OF(t,r,d,l-1)+LF[0][2]*OF(t,r,d+1,l-1)+LF[1][0]*OF(t,r,d-1,l)+LF[1][1]*OF(t,r,d,l)+LF[1][2]*OF(t,r,d+1,l)+LF[2][0]*OF(t,r,d-1,l+1)+LF[2][1]*OF(t,r,d,l+1)+LF[2][2]*OF(t,r,d+1,l+1);(f=Math.abs(f))>25&&a++,f>15&&f<25&&s++}var h=0;return a+s!==0&&(h=a/(a+s)),h}function FF(e){var t=e.width,r=e.height,n=e.getContext("2d"),o=Math.floor(t/2.8),i=Math.floor(r/2.8),a=t-o,s=r-i;return{data:n.getImageData(Math.floor(o/2),Math.floor(i/2),a,s).data,reducedWidth:a,reducedHeight:s}}function VF(){return(VF=EP(kP().mark((function e(t){var r;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=FF(t),DF){e.next=3;break}return e.abrupt("return",NF(r));case 3:return e.abrupt("return",DF.calculateBlurScoreFunc(r));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jF(e,t,r,n){return e[4*(n*t+r)]}var UF=Object.freeze({__proto__:null,calculateBlurScore:function(e){return VF.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},hasSameBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null!==t&&Math.abs(e-t)<r},hasBetterCardBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||t-e>r},calculateIdCardBlurScore:function(e){var t=e.canvas,r=document.createElement("canvas"),n=r.getContext("2d");r.width=430,r.height=270,n.drawImage(t,0,0,r.width,r.height);var o=Math.floor(129),i=Math.floor(13.5),a=Math.floor(408.5),s=Math.floor(256.5),c=document.createElement("canvas"),u=c.getContext("2d"),l=a-o,d=s-i;c.width=l,c.height=d,u.drawImage(r,o,i,l,d,0,0,l,d);for(var f=u.getImageData(0,0,l,d).data,h=0;h<f.length;h+=4){var p=Math.round(.299*f[h]+.587*f[h+1]+.114*f[h+2]);f[h]=p}for(var m=d-1,g=l-1,v=0,y=[],b=1;b<m;b++)for(var w=1;w<g;w++){var _=4*-jF(f,l,w,b)+jF(f,l,w,b-1)+jF(f,l,w,b+1)+jF(f,l,w-1,b)+jF(f,l,w+1,b);v+=_,y.push(_)}v/=(l-2)*(d-2);for(var k=0,C=0;C<y.length;C++){var S=y[C]-v;k+=Math.pow(S,2)}var B=Math.sqrt(k/y.length);return 1/(1+Math.pow(2,B/2-10))}});function zF(e){var t,r,n,o,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=s.x,l=s.y,d=s.width,f=s.height,h=e.videoWidth,p=e.videoHeight,m=window.innerWidth,g=window.innerHeight,v=m/g,y=h/p;v<y?(i=u*(n=h/m),a=(l-(t=(g-m/y)/2))*(o=p/(g-2*t))):(i=(u-(r=(m-g*y)/2))*(n=h/(m-2*r)),a=l*(o=p/g));var b=d*n,w=f*o,_=b,k=w,C=Math.max(b,w)*c;return{lostX:r,lostY:t,cropWidth:b=Math.floor(Math.min(h,b+2*C)),cropHeight:w=Math.floor(Math.min(p,w+2*C)),cropX:i=Math.floor(Math.max(0,i-C)),cropY:a=Math.floor(Math.max(0,a-C)),cropWidthWithoutPadding:_,cropHeightWithoutPadding:k}}var qF=Object.freeze({__proto__:null,analyzeVideoAndWindowSizes:zF,takePicture:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.canvas,n=t.video,o=t.cropArea,i=t.quality,a=void 0===i?1:i;if(r)e=r;else{var s=zF(n,o),c=s.cropWidth,u=s.cropHeight,l=s.cropX,d=s.cropY,f=(e=document.createElement("canvas")).getContext("2d");e.width=c,e.height=u,f.drawImage(n,l,d,c,u,0,0,c,u)}return new Promise((function(t){e.toBlob(t,"image/jpeg",a)}))}}),WF=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},HF=Object.freeze({__proto__:null,shuffleArray:WF}),KF={NONE:0,PARTIAL:1,FULL:2},QF=function(e,t){var r=RP(e,2),n=r[0],o=r[1],i=RP(t,2),a=i[0],s=i[1];return n>s||a>o?0:n<=a&&s<=o?2:1};function GF(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=RP(e,2),o=n[0],i=n[1],a=RP(t,2),s=a[0],c=a[1],u=[o[0],i[0]],l=[o[1],i[1]],d=[s[0],c[0]],f=[s[1],c[1]],h=[u[0]+r,u[1]-r],p=[l[0]+r,l[1]-.8*r];return 2===QF(h,d)&&2===QF(p,f)?KF.FULL:0===QF(u,d)||0===QF(l,f)?KF.NONE:KF.PARTIAL}function XF(e){var t=e.small,r=t.coords,n=t.area,o=e.big,i=o.coords,a=o.area,s=n;if(!s){var c=RP(r,2),u=c[0],l=c[1];s=(l[0]-u[0])*(l[1]-u[1])}var d=a;if(!d){var f=RP(i,2),h=f[0],p=f[1];d=(p[0]-h[0])*(p[1]-h[1])}return s/d}function YF(e,t){var r=RP(e,2),n=r[0],o=r[1],i=RP(t,2),a=i[0],s=i[1],c=o[0]-n[0],u=o[1]-n[1],l=s[0]-a[0];return c/l<u/l?c/l:u/l}var $F=Object.freeze({__proto__:null,ContainMode:KF,rectContains:GF,rectAreaRatio:XF,rectEdgeRatio:YF,isFaceCenter:function(e,t){var r=RP(e,2),n=r[0],o=r[1],i=RP(t,2),a=i[0],s=i[1],c=o[0]-n[0],u=o[1]-n[1],l=s[0]-a[0],d=Math.abs(n[0]-(l-c)/2)/l<.2,f=Math.abs(n[1]-(l-u)/2)/l<.2;return!(!d||!f)}});function ZF(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function JF(e,t){return[e[0]-t[0],e[1]-t[1]]}function eV(e){var t=e.landmarks,r=e.getPerfectFrontal,n=e.upDownBound,o=void 0===n?{lower:.42,upper:.7}:n,i=function(e){var t,r,n,o,i,a,s=RP(e,4),c=s[0],u=s[1],l=s[2],d=s[3],f=JF(u,c),h=ZF(f),p=(n=u,2,[(t=[(r=c)[0]+n[0],r[1]+n[1]])[0]/2,t[1]/2]),m=JF(l,p),g=ZF(JF(d,l)),v=JF(d,p),y=ZF(v),b=(m[0]*v[0]+m[1]*v[1])/y,w=g/y;if(h>.5*y)o=(m[0]*f[0]+m[1]*f[1])/h/h;else{var _=ZF(JF(m,function(e,t){return[e[0]*t,e[1]*t]}(v,b/y)));a=v,o=((i=m)[0]*a[1]-a[0]*i[1]>=0?1:-1)*_/h}return{left_right_score:o,up_down_score:w}}(t),a=i.left_right_score,s=i.up_down_score,c=RP(t,3),u=c[0],l=c[1],d=c[2],f=l[0]-d[0],h=u[0]-d[0],p=r?.1:.3,m=s>o.upper,g=s<o.lower,v=a>=.35&&a<=.6,y=a<=-.35&&a>=-.6,b=m&&!y&&!v,w=g&&!y&&!v,_=y&&!m&&!g,k=v&&!m&&!g;return s>=o.lower&&s<=o.upper&&a>-p&&a<p&&f*h<0?{gesture:vP.FRONTAL,leftRightScore:a}:b?{gesture:vP.UP,leftRightScore:a}:w?{gesture:vP.DOWN,leftRightScore:a}:k?{gesture:vP.RIGHT,leftRightScore:a}:_?{gesture:vP.LEFT,leftRightScore:a}:null}function tV(e){var t,r,n,o=e.predictions,i=e.width,a=e.height,s=e.cropAreaCoordinates,c=null!=s?s:[[0,0],[i,a]],u=o.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,o=t.probability,i=t.landmarks;return o<.9||i.length<6||XF({small:{coords:[r,n]},big:{coords:c}})<=.025?e[KF.NONE].push(t):e[GF(c,[r,n])].push(t),e}),PP(PP(PP({},KF.PARTIAL,[]),KF.FULL,[]),KF.NONE,[])),l=u[KF.FULL].length,d=u[KF.PARTIAL].length;if(0===l)t=d>0?gP.partial_face:gP.no_face;else if(l+d>1)t=gP.multiple_faces;else{var f=r=u[KF.FULL][0];(n=YF([f.topLeft,f.bottomRight],c))<.4&&(t=gP.face_too_small),n>.61&&(t=gP.face_too_large),GF(c,function(e){var t,r,n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],c=e[5],u=.5*(n[1]+o[1]),l=u+1.5*(u-a[1]),d=a[1]-1.2*(i[1]-a[1]),f=[n[0],o[0],i[0],a[0],s[0],c[0]],h=Math.min.apply(Math,f),p=Math.min(l,d),m=Math.max.apply(Math,f),g=Math.max(l,d),v=Math.abs(a[0]-s[0])/Math.abs(a[0]-c[0]),y=a[0]-s[0]<0&&c[0]-a[0]>.05*(m-h);return a[0]-s[0]>0&&c[0]-a[0]<-.05*(m-h)?(t=.2,r=.1):y?(t=.1,r=.2):v>2||v<.5?(t=.15,r=.15):(t=.05,r=.05),[[h-t*(m-h),p],[m+r*(m-h),g]]}(r.landmarks),.05*i)!==KF.FULL&&(t=gP.face_out_of_box)}return{ratio:n,error:t,fullFace:r,faceRatio:n,faceNotFrontalMinThreshold:.38}}function rV(e,t){var r=t.customInstructions,n=t.customIcon,o=t.customDirectionIcon,i=t.customStepTimeConstraints,a={};return null!=r&&r[e]&&(a.instructions=r[e]),null!=n&&n[e]&&(a.icon=n[e]),null!=o&&o[e]&&(a.directionIcon=o[e]),null!=i&&i[e]&&(a.stepTimeConstraints=i[e]),a}function nV(){return(nV=EP(kP().mark((function e(t){return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(DF){e.next=2;break}return e.abrupt("return",tV(t));case 2:return e.abrupt("return",DF.validatePredictionsFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oV(){return(oV=EP(kP().mark((function e(t){return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(DF){e.next=2;break}return e.abrupt("return",eV(t));case 2:return e.abrupt("return",DF.calculateFaceDirectionFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var iV=Object.freeze({__proto__:null,cropFaceInsideBox:function(e,t){var r=RP(e,2),n=r[0],o=r[1],i=RP(t,2),a=i[0],s=i[1];return[[Math.max(n[0],a[0]),Math.max(n[1],a[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,i=e.customDirectionIcon,a=e.customStepTimeConstraints,s=e.Locale,c=e.lang;return{curStepIndex:0,steps:[].concat(MP(WF([_P({name:vP.LEFT,instructions:PP({},c,null==s?void 0:s[null==vP?void 0:vP.LEFT]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:YD(r,"ic_face_left.svg"),directionIcon:YD(r,"arrow_left.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},rV(vP.LEFT,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a})),_P({name:vP.RIGHT,instructions:PP({},c,null==s?void 0:s[null==vP?void 0:vP.RIGHT]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:YD(r,"ic_face_right.svg"),directionIcon:YD(r,"arrow_right.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},rV(vP.RIGHT,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a})),_P({name:vP.UP,instructions:PP({},c,null==s?void 0:s[null==vP?void 0:vP.UP]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:YD(r,"ic_face_up.svg"),directionIcon:YD(r,"arrow_up.svg"),directionIconAnimation:"slide-vertical",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},rV(vP.UP,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a}))])),[_P({name:vP.FRONTAL,instructions:PP({},c,null==s?void 0:s[null==vP?void 0:vP.FRONTAL]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:YD(r,"ic_face_frontal.svg"),directionIcon:YD(r,"frontal.svg"),directionIconAnimation:"blink",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},rV(vP.FRONTAL,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a}))])}},validatePredictions:function(e){return nV.apply(this,arguments)},calculateFaceDirection:function(e){return oV.apply(this,arguments)},faceTracker:function(){var e=[],t=[],r=[],n=[],o=[],i=0,a=0;function s(){a=i,r=MP(e),n=MP(t)}return function(c,u){var l=c.topLeft,d=c.bottomRight,f=c.landmarks,h=[],p=RP(l,2);h[0]=p[0],h[1]=p[1];var m=RP(d,2);h[2]=m[0],h[3]=m[1];var g=[],v=[];f.forEach((function(e,t){var r=RP(e,2);g[t]=r[0],v[t]=r[1]})),i=Date.now();var y=h[2]-h[0];if(e=[].concat(g),t=[].concat(v),!r.length&&!n.length||u)return s(),{score:0,time:i};for(var b=0;b<6;b++)o[b]=Math.sqrt((e[b]-r[b])*(e[b]-r[b])+(t[b]-n[b])*(t[b]-n[b]));for(var w=0;w<6;w++)o[w]/=(i-a)*y;for(var _=0,k=0;k<6;k++)_+=o[k];return _/=6,s(),{score:_,time:i}}}}),aV=function(){var e=EP(kP().mark((function e(t){var r,n;return kP().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)}}(),sV=Object.freeze({__proto__:null,SIZE:400,getModelPredictions:aV}),cV=Object.getOwnPropertySymbols,uV=Object.prototype.hasOwnProperty,lV=Object.prototype.propertyIsEnumerable;function dV(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var fV,hV=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=dV(e),i=1;i<arguments.length;i++){for(var a in r=Object(arguments[i]))uV.call(r,a)&&(o[a]=r[a]);if(cV){n=cV(r);for(var s=0;s<n.length;s++)lV.call(r,n[s])&&(o[n[s]]=r[n[s]])}}return o},pV=arguments[3],mV=arguments[4],gV=arguments[5],vV=JSON.stringify,yV=function(e,t){for(var r,n=Object.keys(gV),o=0,i=n.length;o<i;o++){var a=n[o],s=gV[a].exports;if(s===e||s&&s.default===e){r=a;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(o=0,i=n.length;o<i;o++)c[a=n[o]]=a;mV[r]=["function(require,module,exports){"+e+"(self); }",c]}var u=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[r]=r,mV[u]=["function(require,module,exports){var f = require("+vV(r)+");(f.default ? f.default : f)(self);}",l];var d={};!function e(t){for(var r in d[t]=!0,mV[t][1]){var n=mV[t][1][r];d[n]||e(n)}}(u);var f="("+pV+")({"+Object.keys(d).map((function(e){return vV(e)+":["+mV[e][0]+","+vV(mV[e][1])+"]"})).join(",")+"},{},["+vV(u)+"])",h=window.URL||window.webkitURL||window.mozURL||window.msURL,p=new Blob([f],{type:"text/javascript"});if(t&&t.bare)return p;var m=h.createObjectURL(p),g=new Worker(m);return g.objectURL=m,g},bV=WP((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}}})),wV={js:!0,wasm:!0};function _V(e){if(!(this instanceof _V))return new _V(e);var t=hV({},wV,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')}_V.prototype.has_wasm=function(){if(void 0!==fV)return fV;if(fV=!1,"undefined"==typeof WebAssembly)return fV;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)&&(fV=!0),fV}catch(e){}return fV},_V.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},_V.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},_V.prototype.__base64decode=function(e){for(var t=e.replace(/[\r\n=]/g,""),r=t.length,n=new Uint8Array(3*r>>2),o=0,i=0,a=0;a<r;a++)a%4==0&&a&&(n[i++]=o>>16&255,n[i++]=o>>8&255,n[i++]=255&o),o=o<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t.charAt(a));var s=r%4*6;return 0===s?(n[i++]=o>>16&255,n[i++]=o>>8&255,n[i++]=255&o):18===s?(n[i++]=o>>10&255,n[i++]=o>>2&255):12===s&&(n[i++]=o>>4&255),n},_V.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},_V.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:hV(o,r||{})})}return this.__cache[e]},_V.prototype.__align=function(e,t){var r=e%(t=t||8);return e+(r?t-r:0)};var kV,CV,SV,BV,EV,xV,IV=_V;function AV(e,t,r,n,o,i){var a,s,c,u,l,d,f,h,p,m,g,v,y,b;for(p=0;p<i;p++){for(f=p,h=0,u=l=(a=e[d=p*o])*n[6],g=n[0],v=n[1],y=n[4],b=n[5],m=0;m<o;m++)c=(s=e[d])*g+a*v+u*y+l*b,l=u,u=c,a=s,r[h]=u,h++,d++;for(h--,f+=i*(o-1),u=l=(a=e[--d])*n[7],s=a,g=n[2],v=n[3],m=o-1;m>=0;m--)c=s*g+a*v+u*y+l*b,l=u,u=c,a=s,s=e[d],t[f]=r[h]+u,d--,h--,f-=i}}var PV={name:"unsharp_mask",fn:function(e,t,r,n,o,i){var a,s,c,u,l,d,f,h,p,m,g,v,y;if(!(0===n||o<.5)){o>2&&(o=2);var b=function(e,t,r){for(var n,o,i,a,s,c=t*r,u=new Uint16Array(c),l=0;l<c;l++)n=e[4*l],o=e[4*l+1],i=e[4*l+2],s=n>=o&&n>=i?n:o>=i&&o>=n?o:i,a=n<=o&&n<=i?n:o<=i&&o<=n?o:i,u[l]=257*(s+a)>>1;return u}(e,t,r),w=new Uint16Array(b);!function(e,t,r,n){if(n){var o=new Uint16Array(e.length),i=new Float32Array(Math.max(t,r)),a=function(e){e<.5&&(e=.5);var t=Math.exp(.527076)/e,r=Math.exp(-t),n=Math.exp(-2*t),o=(1-r)*(1-r)/(1+2*t*r-n);return kV=o,CV=o*(t-1)*r,SV=o*(t+1)*r,BV=-o*n,EV=2*r,xV=-n,new Float32Array([kV,CV,SV,BV,EV,xV,(kV+CV)/(1-EV-xV),(SV+BV)/(1-EV-xV)])}(n);AV(e,o,i,a,t,r),AV(o,e,i,a,r,t)}}(w,t,r,o);for(var _=n/100*4096+.5|0,k=257*i|0,C=t*r,S=0;S<C;S++)v=2*(b[S]-w[S]),Math.abs(v)>=k&&(a=e[y=4*S],s=e[y+1],c=e[y+2],d=257*((h=a>=s&&a>=c?a:s>=a&&s>=c?s:c)+(f=a<=s&&a<=c?a:s<=a&&s<=c?s:c))>>1,f===h?u=l=0:(l=d<=32767?4095*(h-f)/(h+f)|0:4095*(h-f)/(510-h-f)|0,u=a===h?65535*(s-c)/(6*(h-f))|0:s===h?21845+(65535*(c-a)/(6*(h-f))|0):43690+(65535*(a-s)/(6*(h-f))|0)),(d+=_*v+2048>>12)>65535?d=65535:d<0&&(d=0),0===l?a=s=c=d>>8:(p=2*d-(m=d<=32767?d*(4096+l)+2048>>12:d+((65535-d)*l+2048>>12))>>8,m>>=8,a=(g=u+21845&65535)>=43690?p:g>=32767?p+(6*(m-p)*(43690-g)+32768>>16):g>=10922?m:p+(6*(m-p)*g+32768>>16),s=(g=65535&u)>=43690?p:g>=32767?p+(6*(m-p)*(43690-g)+32768>>16):g>=10922?m:p+(6*(m-p)*g+32768>>16),c=(g=u-21845&65535)>=43690?p:g>=32767?p+(6*(m-p)*(43690-g)+32768>>16):g>=10922?m:p+(6*(m-p)*g+32768>>16)),e[y]=a,e[y+1]=s,e[y+2]=c)}},wasm_fn:function(e,t,r,n,o,i){if(!(0===n||o<.5)){o>2&&(o=2);var a=t*r,s=4*a,c=2*a,u=2*a,l=4*Math.max(t,r),d=s,f=d+c,h=f+u,p=h+u,m=p+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,h,p,m,t,r,o),(y=g.exports.unsharp||g.exports._unsharp)(0,0,d,f,t,r,n,i),v.set(new Uint32Array(this.__memory.buffer,0,a))}},wasm_src:"AGFzbQEAAAABMQZgAXwBfGACfX8AYAZ/f39/f38AYAh/f39/f39/fQBgBH9/f38AYAh/f39/f39/fwACGQIDZW52A2V4cAAAA2VudgZtZW1vcnkCAAEDBgUBAgMEBQQEAXAAAAdMBRZfX2J1aWxkX2dhdXNzaWFuX2NvZWZzAAEOX19nYXVzczE2X2xpbmUAAgpibHVyTW9ubzE2AAMHaHNsX2wxNgAEB3Vuc2hhcnAABQkBAAqJEAXZAQEGfAJAIAFE24a6Q4Ia+z8gALujIgOaEAAiBCAEoCIGtjgCECABIANEAAAAAAAAAMCiEAAiBbaMOAIUIAFEAAAAAAAA8D8gBKEiAiACoiAEIAMgA6CiRAAAAAAAAPA/oCAFoaMiArY4AgAgASAEIANEAAAAAAAA8L+gIAKioiIHtjgCBCABIAQgA0QAAAAAAADwP6AgAqKiIgO2OAIIIAEgBSACoiIEtow4AgwgASACIAegIAVEAAAAAAAA8D8gBqGgIgKjtjgCGCABIAMgBKEgAqO2OAIcCwu3AwMDfwR9CHwCQCADKgIUIQkgAyoCECEKIAMqAgwhCyADKgIIIQwCQCAEQX9qIgdBAEgiCA0AIAIgAC8BALgiDSADKgIYu6IiDiAJuyIQoiAOIAq7IhGiIA0gAyoCBLsiEqIgAyoCALsiEyANoqCgoCIPtjgCACACQQRqIQIgAEECaiEAIAdFDQAgBCEGA0AgAiAOIBCiIA8iDiARoiANIBKiIBMgAC8BALgiDaKgoKAiD7Y4AgAgAkEEaiECIABBAmohACAGQX9qIgZBAUoNAAsLAkAgCA0AIAEgByAFbEEBdGogAEF+ai8BACIIuCINIAu7IhGiIA0gDLsiEqKgIA0gAyoCHLuiIg4gCrsiE6KgIA4gCbsiFKKgIg8gAkF8aioCALugqzsBACAHRQ0AIAJBeGohAiAAQXxqIQBBACAFQQF0ayEHIAEgBSAEQQF0QXxqbGohBgNAIAghAyAALwEAIQggBiANIBGiIAO4Ig0gEqKgIA8iECAToqAgDiAUoqAiDyACKgIAu6CrOwEAIAYgB2ohBiAAQX5qIQAgAkF8aiECIBAhDiAEQX9qIgRBAUoNAAsLCwvfAgIDfwZ8AkAgB0MAAAAAWw0AIARE24a6Q4Ia+z8gB0MAAAA/l7ujIgyaEAAiDSANoCIPtjgCECAEIAxEAAAAAAAAAMCiEAAiDraMOAIUIAREAAAAAAAA8D8gDaEiCyALoiANIAwgDKCiRAAAAAAAAPA/oCAOoaMiC7Y4AgAgBCANIAxEAAAAAAAA8L+gIAuioiIQtjgCBCAEIA0gDEQAAAAAAADwP6AgC6KiIgy2OAIIIAQgDiALoiINtow4AgwgBCALIBCgIA5EAAAAAAAA8D8gD6GgIgujtjgCGCAEIAwgDaEgC6O2OAIcIAYEQCAFQQF0IQogBiEJIAIhCANAIAAgCCADIAQgBSAGEAIgACAKaiEAIAhBAmohCCAJQX9qIgkNAAsLIAVFDQAgBkEBdCEIIAUhAANAIAIgASADIAQgBiAFEAIgAiAIaiECIAFBAmohASAAQX9qIgANAAsLC7wBAQV/IAMgAmwiAwRAQQAgA2shBgNAIAAoAgAiBEEIdiIHQf8BcSECAn8gBEH/AXEiAyAEQRB2IgRB/wFxIgVPBEAgAyIIIAMgAk8NARoLIAQgBCAHIAIgA0kbIAIgBUkbQf8BcQshCAJAIAMgAk0EQCADIAVNDQELIAQgByAEIAMgAk8bIAIgBUsbQf8BcSEDCyAAQQRqIQAgASADIAhqQYECbEEBdjsBACABQQJqIQEgBkEBaiIGDQALCwvTBgEKfwJAIAazQwAAgEWUQwAAyEKVu0QAAAAAAADgP6CqIQ0gBSAEbCILBEAgB0GBAmwhDgNAQQAgAi8BACADLwEAayIGQQF0IgdrIAcgBkEASBsgDk8EQCAAQQJqLQAAIQUCfyAALQAAIgYgAEEBai0AACIESSIJRQRAIAYiCCAGIAVPDQEaCyAFIAUgBCAEIAVJGyAGIARLGwshCAJ/IAYgBE0EQCAGIgogBiAFTQ0BGgsgBSAFIAQgBCAFSxsgCRsLIgogCGoiD0GBAmwiEEEBdiERQQAhDAJ/QQAiCSAIIApGDQAaIAggCmsiCUH/H2wgD0H+AyAIayAKayAQQYCABEkbbSEMIAYgCEYEQCAEIAVrQf//A2wgCUEGbG0MAQsgBSAGayAGIARrIAQgCEYiBhtB//8DbCAJQQZsbUHVqgFBqtUCIAYbagshCSARIAcgDWxBgBBqQQx1aiIGQQAgBkEAShsiBkH//wMgBkH//wNIGyEGAkACfwJAIAxB//8DcSIFBEAgBkH//wFKDQEgBUGAIGogBmxBgBBqQQx2DAILIAZBCHYiBiEFIAYhBAwCCyAFIAZB//8Dc2xBgBBqQQx2IAZqCyIFQQh2IQcgBkEBdCAFa0EIdiIGIQQCQCAJQdWqAWpB//8DcSIFQanVAksNACAFQf//AU8EQEGq1QIgBWsgByAGa2xBBmxBgIACakEQdiAGaiEEDAELIAchBCAFQanVAEsNACAFIAcgBmtsQQZsQYCAAmpBEHYgBmohBAsCfyAGIgUgCUH//wNxIghBqdUCSw0AGkGq1QIgCGsgByAGa2xBBmxBgIACakEQdiAGaiAIQf//AU8NABogByIFIAhBqdUASw0AGiAIIAcgBmtsQQZsQYCAAmpBEHYgBmoLIQUgCUGr1QJqQf//A3EiCEGp1QJLDQAgCEH//wFPBEBBqtUCIAhrIAcgBmtsQQZsQYCAAmpBEHYgBmohBgwBCyAIQanVAEsEQCAHIQYMAQsgCCAHIAZrbEEGbEGAgAJqQRB2IAZqIQYLIAEgBDoAACABQQFqIAU6AAAgAUECaiAGOgAACyADQQJqIQMgAkECaiECIABBBGohACABQQRqIQEgC0F/aiILDQALCwsL"},TV=[{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 RV(e){return Math.round(16383*e)}var MV=function(e,t,r,n,o){var i,a,s,c,u,l,d,f,h,p,m,g,v,y,b,w,_,k=TV[e].filter,C=1/n,S=Math.min(1,n),B=TV[e].win/S,E=Math.floor(2*(B+1)),x=new Int16Array((E+2)*r),I=0,A=!x.subarray||!x.set;for(i=0;i<r;i++){for(a=(i+.5)*C+o,s=Math.max(0,Math.floor(a-B)),u=(c=Math.min(t-1,Math.ceil(a+B)))-s+1,l=new Float32Array(u),d=new Int16Array(u),f=0,h=s,p=0;h<=c;h++,p++)f+=m=k((h+.5-a)*S),l[p]=m;for(g=0,p=0;p<l.length;p++)g+=v=l[p]/f,d[p]=RV(v);for(d[r>>1]+=RV(1-g),y=0;y<d.length&&0===d[y];)y++;if(y<d.length){for(b=d.length-1;b>0&&0===d[b];)b--;if(w=s+y,_=b-y+1,x[I++]=w,x[I++]=_,A)for(p=y;p<=b;p++)x[I++]=d[p];else x.set(d.subarray(y,b+1),I),I+=_}else x[I++]=0,x[I++]=0}return x};function DV(e){return e<0?0:e>255?255:e}var LV=!0;try{LV=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(e){}function OV(e,t,r){if(LV)t.set(function(e){return new Uint8Array(e.buffer,0,e.byteLength)}(e),r);else for(var n=r,o=0;o<e.length;o++){var i=e[o];t[n++]=255&i,t[n++]=i>>8&255}}var NV={name:"resize",fn:function(e){var t=e.src,r=e.width,n=e.height,o=e.toWidth,i=e.toHeight,a=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,c=e.offsetX||0,u=e.offsetY||0,l=e.dest||new Uint8Array(o*i*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,h=MV(d,r,o,a,c),p=MV(d,n,i,s,u),m=new Uint8Array(o*n*4);return function(e,t,r,n,o,i){var a,s,c,u,l,d,f,h,p,m,g,v=0,y=0;for(p=0;p<n;p++){for(l=0,m=0;m<o;m++){for(d=i[l++],f=i[l++],h=v+4*d|0,a=s=c=u=0;f>0;f--)u=u+(g=i[l++])*e[h+3]|0,c=c+g*e[h+2]|0,s=s+g*e[h+1]|0,a=a+g*e[h]|0,h=h+4|0;t[y+3]=DV(u+8192>>14),t[y+2]=DV(c+8192>>14),t[y+1]=DV(s+8192>>14),t[y]=DV(a+8192>>14),y=y+4*n|0}y=4*(p+1)|0,v=(p+1)*r*4|0}}(t,m,r,n,o,h),function(e,t,r,n,o,i){var a,s,c,u,l,d,f,h,p,m,g,v=0,y=0;for(p=0;p<n;p++){for(l=0,m=0;m<o;m++){for(d=i[l++],f=i[l++],h=v+4*d|0,a=s=c=u=0;f>0;f--)u=u+(g=i[l++])*e[h+3]|0,c=c+g*e[h+2]|0,s=s+g*e[h+1]|0,a=a+g*e[h]|0,h=h+4|0;t[y+3]=DV(u+8192>>14),t[y+2]=DV(c+8192>>14),t[y+1]=DV(s+8192>>14),t[y]=DV(a+8192>>14),y=y+4*n|0}y=4*(p+1)|0,v=(p+1)*r*4|0}}(m,l,n,o,i,p),f||function(e,t,r){for(var n=3,o=t*r*4|0;n<o;)e[n]=255,n=n+4|0}(l,o,i),l},wasm_fn:function(e){var t=e.src,r=e.width,n=e.height,o=e.toWidth,i=e.toHeight,a=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,c=e.offsetX||0,u=e.offsetY||0,l=e.dest||new Uint8Array(o*i*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,h=MV(d,r,o,a,c),p=MV(d,n,i,s,u),m=this.__align(0+Math.max(t.byteLength,l.byteLength)),g=this.__align(m+n*o*4),v=this.__align(g+h.byteLength),y=v+p.byteLength,b=this.__instance("resize",y),w=new Uint8Array(this.__memory.buffer),_=new Uint32Array(this.__memory.buffer),k=new Uint32Array(t.buffer);return _.set(k),OV(h,w,g),OV(p,w,v),(b.exports.convolveHV||b.exports._convolveHV)(g,v,m,r,n,o,i),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,i*o)),f||function(e,t,r){for(var n=3,o=t*r*4|0;n<o;)e[n]=255,n=n+4|0}(l,o,i),l},wasm_src:"AGFzbQEAAAABFAJgBn9/f39/fwBgB39/f39/f38AAg8BA2VudgZtZW1vcnkCAAEDAwIAAQQEAXAAAAcZAghjb252b2x2ZQAACmNvbnZvbHZlSFYAAQkBAArmAwLBAwEQfwJAIANFDQAgBEUNACAFQQRqIRVBACEMQQAhDQNAIA0hDkEAIRFBACEHA0AgB0ECaiESAn8gBSAHQQF0IgdqIgZBAmouAQAiEwRAQQAhCEEAIBNrIRQgFSAHaiEPIAAgDCAGLgEAakECdGohEEEAIQlBACEKQQAhCwNAIBAoAgAiB0EYdiAPLgEAIgZsIAtqIQsgB0H/AXEgBmwgCGohCCAHQRB2Qf8BcSAGbCAKaiEKIAdBCHZB/wFxIAZsIAlqIQkgD0ECaiEPIBBBBGohECAUQQFqIhQNAAsgEiATagwBC0EAIQtBACEKQQAhCUEAIQggEgshByABIA5BAnRqIApBgMAAakEOdSIGQf8BIAZB/wFIG0EQdEGAgPwHcUEAIAZBAEobIAtBgMAAakEOdSIGQf8BIAZB/wFIG0EYdEEAIAZBAEobciAJQYDAAGpBDnUiBkH/ASAGQf8BSBtBCHRBgP4DcUEAIAZBAEobciAIQYDAAGpBDnUiBkH/ASAGQf8BSBtB/wFxQQAgBkEAShtyNgIAIA4gA2ohDiARQQFqIhEgBEcNAAsgDCACaiEMIA1BAWoiDSADRw0ACwsLIQACQEEAIAIgAyAEIAUgABAAIAJBACAEIAUgBiABEAALCw=="};function FV(e){var t=e||[],r={js:t.indexOf("js")>=0,wasm:t.indexOf("wasm")>=0};IV.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(PV),this.use(NV)}bV(FV,IV),FV.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 VV=FV;function jV(e,t){this.create=e,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=t||2e3}jV.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},jV.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))},jV.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 UV=jV;function zV(e){return Object.prototype.toString.call(e)}var qV=function(e){var t=zV(e);return"[object HTMLCanvasElement]"===t||"[object OffscreenCanvas]"===t||"[object Canvas]"===t},WV=function(e){switch(e){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},HV=function(){var e,t=VV;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 KV(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.floor(e)}function QV(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.ceil(e)}var GV={},XV=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(XV=navigator.userAgent.indexOf("Safari")>=0)}catch(_I){}var YV=1;"undefined"!=typeof navigator&&(YV=Math.min(navigator.hardwareConcurrency||1,4));var $V,ZV,JV={tile:1024,concurrency:YV,features:["js","wasm","ww"],idle:2e3,createCanvas:function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r}},ej={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0};function tj(){return{value:yV(HV),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 rj(e){if(!(this instanceof rj))return new rj(e);this.options=hV({},JV,e||{});var t="lk_".concat(this.options.concurrency);this.__limit=GV[t]||function(e){var t=0,r=[];function n(){t<e&&r.length&&(t++,r.shift()())}return function(e){return new Promise((function(o,i){r.push((function(){e().then((function(e){o(e),t--,n()}),(function(e){i(e),t--,n()}))})),n()}))}}(this.options.concurrency),GV[t]||(GV[t]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}rj.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if(!1!==$V&&!0!==$V&&($V=!1,"undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray))try{new ImageData(new Uint8ClampedArray(400),10,10),$V=!0}catch(t){}!1!==ZV&&!0!==ZV&&(ZV=!1,"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?ZV=!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 VV(t),t.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{yV((function(){})).terminate(),this.features.ww=!0;var r="wp_".concat(JSON.stringify(this.options));GV[r]?this.__workersPool=GV[r]:(this.__workersPool=new UV(tj,this.options.idle),GV[r]=this.__workersPool)}catch(t){}var n,o=this.__mathlib.init().then((function(t){hV(e.features,t.features)}));return n=ZV?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}))}(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},rj.prototype.resize=function(e,t,r){var n=this;this.debug("Start resize...");var o=hV({},ej);if(isNaN(r)?r&&(o=hV(o,r)):o=hV(o,{quality:r}),o.toWidth=t.width,o.toHeight=t.height,o.width=e.naturalWidth||e.width,o.height=e.naturalHeight||e.height,0===t.width||0===t.height)return Promise.reject(new Error("Invalid output size: ".concat(t.width,"x").concat(t.height)));o.unsharpRadius>2&&(o.unsharpRadius=2);var i=!1,a=null;o.cancelToken&&(a=o.cancelToken.then((function(e){throw i=!0,e}),(function(e){throw i=!0,e})));var s=Math.ceil(Math.max(3,2.5*o.unsharpRadius|0));return this.init().then((function(){if(i)return a;if(n.features.cib){var r=t.getContext("2d",{alpha:Boolean(o.alpha)});return n.debug("Resize via createImageBitmap()"),createImageBitmap(e,{resizeWidth:o.toWidth,resizeHeight:o.toHeight,resizeQuality:WV(o.quality)}).then((function(e){if(i)return a;if(!o.unsharpAmount)return r.drawImage(e,0,0),e.close(),r=null,n.debug("Finished!"),t;n.debug("Unsharp result");var s=n.options.createCanvas(o.toWidth,o.toHeight),c=s.getContext("2d",{alpha:Boolean(o.alpha)});c.drawImage(e,0,0),e.close();var u=c.getImageData(0,0,o.toWidth,o.toHeight);return n.__mathlib.unsharp_mask(u.data,o.toWidth,o.toHeight,o.unsharpAmount,o.unsharpRadius,o.unsharpThreshold),r.putImageData(u,0,0),s.width=s.height=0,u=c=s=r=null,n.debug("Finished!"),t}))}var c={},u=function(e){return Promise.resolve().then((function(){return n.features.ww?new Promise((function(t,r){var o=n.__workersPool.acquire();a&&a.catch((function(e){return r(e)})),o.value.onmessage=function(e){o.release(),e.data.err?r(e.data.err):t(e.data.result)},o.value.postMessage({opts:e,features:n.__requested_features,preload:{wasm_nodule:n.__mathlib.__}},[e.src.buffer])})):n.__mathlib.resizeAndUnsharp(e,c)}))},l=function(e,t,r){var o,c,l,d=!1,f=function(t){return n.__limit((function(){if(i)return a;var s;if(qV(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 h={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(h)})).then((function(e){if(i)return a;var r;if(s=null,n.debug("Convert raw rgba tile result to ImageData"),$V)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"),XV?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)}),qV(e))return o=e.getContext("2d",{alpha:Boolean(r.alpha)}),null;if(function(e){return"[object ImageBitmap]"===zV(e)}(e))return c=e,d=!0,null;if(function(e){return"[object HTMLImageElement]"===zV(e)}(e))return ZV?(n.debug("Decode image via createImageBitmap"),createImageBitmap(e).then((function(e){c=e})).catch((function(e){return null}))):null;throw new Error('Pica: ".from" should be Image, Canvas or ImageBitmap')})).then((function(){if(i)return a;n.debug("Calculate tiles");var e=function(e){var t,r,n,o,i,a,s=e.toWidth/e.width,c=e.toHeight/e.height,u=KV(e.srcTileSize*s)-2*e.destTileBorder,l=KV(e.srcTileSize*c)-2*e.destTileBorder;if(u<1||l<1)throw new Error("Internal error in pica: target tile width/height is too small.");var d,f=[];for(o=0;o<e.toHeight;o+=l)for(n=0;n<e.toWidth;n+=u)(t=n-e.destTileBorder)<0&&(t=0),t+(i=n+u+e.destTileBorder-t)>=e.toWidth&&(i=e.toWidth-t),(r=o-e.destTileBorder)<0&&(r=0),r+(a=o+l+e.destTileBorder-r)>=e.toHeight&&(a=e.toHeight-r),d={toX:t,toY:r,toWidth:i,toHeight:a,toInnerX:n,toInnerY:o,toInnerWidth:u,toInnerHeight:l,offsetX:t/s-KV(t/s),offsetY:r/c-KV(r/c),scaleX:s,scaleY:c,x:KV(t/s),y:KV(r/c),width:QV(i/s),height:QV(a/c)},f.push(d);return f}({width:r.width,height:r.height,srcTileSize:n.options.tile,toWidth:r.toWidth,toHeight:r.toHeight,destTileBorder:s}).map((function(e){return f(e)}));function o(){c&&(d||c.close(),c=null)}return n.debug("Process tiles"),Promise.all(e).then((function(){return n.debug("Finished!"),o(),t}),(function(e){throw o(),e}))}))};return function e(t,r,o,s){if(i)return a;var c,u=gg(t.shift(),2),d=u[0],f=u[1],h=0===t.length;return s=hV({},s,{toWidth:d,toHeight:f,quality:h?s.quality:Math.min(1,s.quality)}),h||(c=n.options.createCanvas(d,f)),l(r,h?o:c,s).then((function(){return h?o:(s.width=d,s.height=f,e(t,c,o,s))})).then((function(e){return c&&(c.width=c.height=0),e}))}(function(e,t,r,n,o,i){var a=r/e,s=n/t,c=(2*i+2+1)/o;if(c>.5)return[[r,n]];var u=Math.ceil(Math.log(Math.min(a,s))/Math.log(c));if(u<=1)return[[r,n]];for(var l=[],d=0;d<u;d++){var f=Math.round(Math.pow(Math.pow(e,u-d-1)*Math.pow(r,d+1),1/u)),h=Math.round(Math.pow(Math.pow(t,u-d-1)*Math.pow(n,d+1),1/u));l.push([f,h])}return l}(o.width,o.height,o.toWidth,o.toHeight,n.options.tile,s),e,t,o)}))},rj.prototype.resizeBuffer=function(e){var t=this,r=hV({},ej,e);return this.init().then((function(){return t.__mathlib.resizeAndUnsharp(r)}))},rj.prototype.toBlob=function(e,t,r){return t=t||"image/png",new Promise((function(n){if(e.toBlob)e.toBlob((function(e){return n(e)}),t,r);else if(e.convertToBlob)n(e.convertToBlob({type:t,quality:r}));else{for(var o=atob(e.toDataURL(t,r).split(",")[1]),i=o.length,a=new Uint8Array(i),s=0;s<i;s++)a[s]=o.charCodeAt(s);n(new Blob([a],{type:t}))}}))},rj.prototype.debug=function(){};var nj=new rj,oj=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.minSize,o=void 0===n?720:n,i=e/t;return e>t?{desW:Math.floor(o*i),desH:o}:{desW:o,desH:Math.floor(o/i)}},ij=Object.freeze({__proto__:null,scaleImage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.minSize,n=void 0===r?720:r;return new Promise((function(t){var r=URL.createObjectURL(e),o=new Image;o.src=r;var i=document.createElement("canvas");o.onload=function(){if(o.width&&o.height&&(o.width<n||o.height<n)){var e=oj(o.width,o.height,{minSize:n}),r=e.desW,a=e.desH;i.width=r,i.height=a,nj.resize(o,i).then((function(e){return nj.toBlob(e,"image/jpeg",1)})).then((function(e){return t(e)}))}else t(null)}}))},createResizer:function(e){var t=e.width,r=e.height,n=document.createElement("canvas"),o=n.getContext("2d");return n.width=t,n.height=r,{resize:function(e){var t=e.srcCanvas;return o.drawImage(t,0,0,n.width,n.height),n}}},resizeBlobImg:function(e,t,r){var n=document.createElement("canvas"),o=n.getContext("2d");return n.width=t,n.height=r,new Promise((function(t){var r=URL.createObjectURL(e),i=new Image;i.onload=function(){URL.revokeObjectURL(r),o.drawImage(i,0,0,n.width,n.height),n.toBlob(t,"image/jpeg",1)},i.src=r}))},blobToCanvas:function(e){var t=e.blob;return new Promise((function(e){var r=document.createElement("canvas"),n=r.getContext("2d"),o=new Image;o.onload=function(t){var i=o.width,a=o.height;r.width=i,r.height=a,URL.revokeObjectURL(t.target.src),n.drawImage(t.target,0,0),e(r)},o.src=URL.createObjectURL(t)}))}});function aj(e,t,r,n){var o=r*(4*t)+4*n;return{r:e[o],g:e[o+1],b:e[o+2]}}function sj(e,t,r){return function(e,t,r){for(var n=0,o=r[1],i=r[3],a=r[0],s=r[2],c=o;c<i;c++)for(var u=a;u<s;u++){var l=aj(e,t,c,u),d=l.r,f=l.g,h=l.b;d>=245&&h>=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 cj(){return(cj=EP(kP().mark((function e(t){var r,n,o;return kP().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,DF){e.next=5;break}return e.abrupt("return",sj(o,n.width,n.height));case 5:return e.abrupt("return",DF.detectGlare(o,n.width,n.height));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var uj=Object.freeze({__proto__:null,isCardGlare:function(e){return cj.apply(this,arguments)}});function lj(){return new Promise((function(e){navigator.permissions&&"function"==typeof navigator.permissions.query?navigator.permissions.query({name:"geolocation"}).then((function(t){"granted"===t.state?navigator.geolocation.getCurrentPosition((function(t){e({long:t.coords.longitude,lat:t.coords.latitude})}),(function(){return e(null)})):e(null)})).catch((function(){return e(null)})):e(null)}))}var dj=Object.freeze({__proto__:null,getLongAndLat:lj}),fj="internal_server_error",hj="network_error",pj=ZM();function mj(e){return 500*Math.pow(1.5,e)}function gj(e){return Array.isArray(null==e?void 0:e.errors)&&e.errors.find((function(e){return e.code===fj}))}function vj(e){return"Failed to fetch"===e.message||!e.response}function yj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,o=t.maxInternalServerErrorRetryTimes,i=void 0===o?1:o,a=t.propertyKey,s=t.onDone;return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var c=this;function u(e,t){return l.apply(this,arguments)}function l(){return(l=EP(kP().mark((function t(o,l){var d,f,h,p,m,g,v,y,b=arguments;return kP().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return g=function(){return(g=EP(kP().mark((function e(t){var r,n;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p(t),n=h(t)-r,e.next=4,gF(mj(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)},p=function(e){return e===l?Math.max(o-1,0):h(e)-1},h=function(e){return e===hj?n:e===fj?i:0},f=function(e){return o>0||(e===hj?void 0===o&&n>0:e===fj&&void 0===o&&i>0)},d=b.length>2&&void 0!==b[2]?b[2]:0,v=performance.now(),t.prev=7,t.next=10,e.apply(c,r);case 10:if(y=t.sent,s({response:y,retryCount:d,propertyKey:a,timeInMs:performance.now()-v,args:r}),!gj(y)||!f(fj)){t.next=16;break}return t.next=15,m(fj);case 15:return t.abrupt("return",t.sent);case 16:return t.abrupt("return",y);case 19:if(t.prev=19,t.t0=t.catch(7),s({error:t.t0,retryCount:d,propertyKey:a,timeInMs:performance.now()-v,args:r}),!vj(t.t0)||!f(hj)){t.next=24;break}return t.abrupt("return",m(hj));case 24:throw t.t0;case 25:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}return u()}}function bj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,o=t.maxInternalServerErrorRetryTimes,i=void 0===o?1:o,a=t.onDone,s=void 0===a?function(){}:a,c={get:function(e,t){var r=e[t];return"function"==typeof r&&"constructor"!==t?yj(r,{maxNetworkErrorRetryTimes:n,maxInternalServerErrorRetryTimes:i,propertyKey:t,onDone:s}):r}};return new Proxy(e,c)}var wj=Object.freeze({__proto__:null,createRetryAPIClient:bj,useApiClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCredentials,r=void 0===t?{}:t,n=e.tracking,o=void 0===n?{}:n,i=hv.useRef(null),a=function(){};if(null===i.current){var s=r.accessKey,c=r.secretKey,u=r.apiUrl,l=o.userId,d=vD({userId:l});i.current=bj(new jM(s,c,u,{httpHeaders:_P(_P({},pj),{},{"x-request-id":d})}),{onDone:a})}return{apiClient:i.current}}}),_j="BFnYsWrH",kj="KbKcY2nb",Cj=function(e){return e.split("").reverse().join("")},Sj=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)}))},Bj=window.fetch.bind(window);function Ej(e){var t,r,n=e.hasOwnProperty("words")?e.words:[],o=e.hasOwnProperty("sigBytes")?e.sigBytes:4*n.length,i=new Uint8Array(o),a=0;for(r=0;r<o;r++)t=n[r],i[a++]=t>>24,i[a++]=t>>16&255,i[a++]=t>>8&255,i[a++]=255&t;return i}var xj=function(){var e=EP(kP().mark((function e(){var t,r,n,o,i,a=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(Cj(_j)).concat(Cj(kj)),e.next=3,Bj.apply(void 0,a);case 3:return r=e.sent,e.next=6,r.text();case 6:return n=e.sent,o=uD.AES.decrypt(n,t),i=Ej(o),e.abrupt("return",{u8arr:i});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ij=function(){var e=EP(kP().mark((function e(){var t,r,n=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Bj.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)}}(),Aj=Object.freeze({__proto__:null,reverseString:Cj,loadExternalScript:Sj,fetchWithDecryption:xj,fetchRawResource:Ij}),Pj=/\s/,Tj=/^\s+/,Rj=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Pj.test(e.charAt(t)););return t}(e)+1).replace(Tj,""):e},Mj=/^[-+]0x[0-9a-f]+$/i,Dj=/^0b[01]+$/i,Lj=/^0o[0-7]+$/i,Oj=parseInt,Nj=function(e){return e?1/0===(e=function(e){if("number"==typeof e)return e;if(GR(e))return NaN;if(nT(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=nT(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Rj(e);var r=Dj.test(e);return r||Lj.test(e)?Oj(e.slice(2),r?2:8):Mj.test(e)?NaN:+e}(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},Fj=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=function(e){var t=Nj(e),r=t%1;return t==t?r?t-r:t:0}(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},Vj=function(e){return Fj(2,e)},jj=Vj(function(){var e=EP(kP().mark((function e(){var t,r,n,o,i,a,s,c,u,l,d,f,h=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.tfUrl,n=void 0===r?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.20.0/dist/tf.min.js":r,o=t.tfBackendWasmUrl,i=void 0===o?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.20.0/dist/tf-backend-wasm.js":o,a=t.tfBackendCpuUrl,s=void 0===a?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@3.20.0":a,c=t.tfLiteUrl,u=void 0===c?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite@0.0.1-alpha.8/dist/tf-tflite.min.js":c,l=t.blazefaceScriptUrl,d=void 0===l?"https://cdn.jsdelivr.net/npm/@tensorflow-models/blazeface@0.0.7":l,e.next=3,Sj({url:n});case 3:return f=[],i&&f.push(i),s&&f.push(s),d&&f.push(d),u&&f.push(u),e.next=10,Promise.all(f.map((function(e){return Sj({url:e})})));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());function Uj(){return(Uj=EP(kP().mark((function e(){var t,r,n,o,i,a,s,c,u=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},r=t.preferredBackends,n=void 0===r?["wasm","cpu"]:r,!window.tv_model_backend_init||window.tv_model_backend_init[0]!==n[0]){e.next=3;break}return e.abrupt("return");case 3:return o=window,i=o.tf,e.next=6,i.enableProdMode();case 6:a=OP(n),e.prev=7,a.s();case 9:if((s=a.n()).done){e.next=23;break}return c=s.value,e.prev=11,e.next=14,i.setBackend(c);case 14:return e.abrupt("break",23);case 17:if(e.prev=17,e.t0=e.catch(11),c!==n[n.length-1]){e.next=21;break}throw e.t0;case 21:e.next=9;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(7),a.e(e.t1);case 28:return e.prev=28,a.f(),e.finish(28);case 31:return e.next=33,i.ready();case 33:window.tv_model_backend_init=n;case 34:case"end":return e.stop()}}),e,null,[[7,25,28,31],[11,17]])})))).apply(this,arguments)}function zj(){return(zj=EP(kP().mark((function e(t){var r,n,o,i;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.modelUrl,n=window,o=n.blazeface,!r){e.next=8;break}return e.next=5,o.load({modelUrl:r});case 5:i=e.sent,e.next=11;break;case 8:return e.next=10,o.load();case 10:i=e.sent;case 11:return e.abrupt("return",{blazefaceModel:i});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qj(){return(qj=EP(kP().mark((function e(t){var r,n,o;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,e.next=3,Ij(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 Wj(e){return Hj.apply(this,arguments)}function Hj(){return(Hj=EP(kP().mark((function e(t){var r,n,o,i,a,s,c;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,n=t.options,o=void 0===n?{}:n,i=window,a=i.tflite,e.next=4,xj(r);case 4:return s=e.sent,c=s.u8arr,e.abrupt("return",a.loadTFLiteModel(c,_P({numThreads:1},o)));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Kj=Object.freeze({__proto__:null,loadTensorFlow:jj,initTensorFlow:function(){return Uj.apply(this,arguments)},loadBlazefaceModel:function(e){return zj.apply(this,arguments)},preloadResource:function(e){return qj.apply(this,arguments)},loadTFLiteModel:Wj}),Qj=Object.freeze({__proto__:null,enableAntiDebug:function(){var e,t,r=["action","gger","stateObject","apply","chain","test","input","Hello World!","constructor","counter","length","debu","call"];e=r,t=185,function(t){for(;--t;)e.push(e.shift())}(++t);var n,o,i=function(e,t){return r[e-=0]};function a(e){function t(e){if("string"==typeof e)return function(e){}[i("0x5")]("while (true) {}")[i("0x0")](i("0x6"));1!=="".concat(e/e)[i("0x7")]||e%20==0?function(){return!0}[i("0x5")]("".concat(i("0x8"),"gger"))[i("0x9")](i("0xa")):function(){return!1}.constructor("debu".concat(i("0xb")))[i("0x0")](i("0xc")),t(++e)}try{if(e)return t;t(0)}catch(e){}}setInterval((function(){a()}),4e3),n=!0,o=function(e,t){var r=n?function(){if(t){var r=t[i("0x0")](e,arguments);return t=null,r}}:function(){};return n=!1,r},function(){o(this,(function(){var e=new RegExp("function *\\( *\\)"),t=new RegExp("\\+\\+ *(?:_0x(?:[a-f0-9]){4,6}|(?:\\b|\\d)[a-z0-9]{1,4}(?:\\b|\\d))","i"),r=a("init");e.test(r+i("0x1"))&&t[i("0x2")](r+i("0x3"))?a():r("0")}))()}(),console.log(i("0x4"))}}),Gj=Object.freeze({__proto__:null,useThemeContext:function(){return hv.useContext(sw)}});function Xj(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Yj(e,t){return e&t}function $j(e,t){return e|t}function Zj(e,t){return e^t}function Jj(e,t){return e&~t}function eU(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 tU(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var rU,nU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function oU(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=nU.charAt(r>>6)+nU.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=nU.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=nU.charAt(r>>2)+nU.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function iU(e){var t,r="",n=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var i=nU.indexOf(e.charAt(t));i<0||(0==n?(r+=Xj(i>>2),o=3&i,n=1):1==n?(r+=Xj(o<<2|i>>4),o=15&i,n=2):2==n?(r+=Xj(o),r+=Xj(i>>2),o=3&i,n=3):(r+=Xj(o<<2|i>>4),r+=Xj(15&i),n=0))}return 1==n&&(r+=Xj(o<<2)),r}var aU,sU={decode:function(e){var t;if(void 0===aU){var r="= \f\n\r\t \u2028\u2029";for(aU=Object.create(null),t=0;t<64;++t)aU["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(aU["-"]=62,aU._=63,t=0;t<r.length;++t)aU[r.charAt(t)]=-1}var n=[],o=0,i=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=aU[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);o|=a,++i>=4?(n[n.length]=o>>16,n[n.length]=o>>8&255,n[n.length]=255&o,o=0,i=0):o<<=6}}switch(i){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=o>>10;break;case 3:n[n.length]=o>>16,n[n.length]=o>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=sU.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 sU.decode(e)}},cU=1e13,uU=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var r,n,o=this.buf,i=o.length;for(r=0;r<i;++r)(n=o[r]*e+t)<cU?t=0:n-=(t=0|n/cU)*cU,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+=cU,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+=(cU+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*cU+e[r];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),lU=/^(\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)?)?$/,dU=/^(\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 fU(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var hU,pU=function(){function e(t,r){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=r)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,r){for(var n="",o=e;o<t;++o)if(n+=this.hexByte(this.get(o)),!0!==r)switch(15&o){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},e.prototype.isASCII=function(e,t){for(var r=e;r<t;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var r="",n=e;n<t;++n)r+=String.fromCharCode(this.get(n));return r},e.prototype.parseStringUTF=function(e,t){for(var r="",n=e;n<t;){var o=this.get(n++);r+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(n++)):String.fromCharCode((15&o)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},e.prototype.parseStringBMP=function(e,t){for(var r,n,o="",i=e;i<t;)r=this.get(i++),n=this.get(i++),o+=String.fromCharCode(r<<8|n);return o},e.prototype.parseTime=function(e,t,r){var n=this.parseStringISO(e,t),o=(r?lU:dU).exec(n);return o?(r&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),n=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(n+=":"+o[5],o[6]&&(n+=":"+o[6],o[7]&&(n+="."+o[7]))),o[8]&&(n+=" UTC","Z"!=o[8]&&(n+=o[8],o[9]&&(n+=":"+o[9]))),n):"Unrecognized time: "+n},e.prototype.parseInteger=function(e,t){for(var r,n=this.get(e),o=n>127,i=o?255:0,a="";n==i&&++e<t;)n=this.get(e);if(0==(r=t-e))return o?-1:0;if(r>4){for(a=n,r<<=3;0==(128&(+a^i));)a=+a<<1,--r;a="("+r+" bit)\n"}o&&(n-=256);for(var s=new uU(n),c=e+1;c<t;++c)s.mulAdd(256,this.get(c));return a+s.toString()},e.prototype.parseBitString=function(e,t,r){for(var n=this.get(e),o="("+((t-e-1<<3)-n)+" bit)\n",i="",a=e+1;a<t;++a){for(var s=this.get(a),c=a==t-1?n:0,u=7;u>=c;--u)i+=s>>u&1?"1":"0";if(i.length>r)return o+fU(i,r)}return o+i},e.prototype.parseOctetString=function(e,t,r){if(this.isASCII(e,t))return fU(this.parseStringISO(e,t),r);var n=t-e,o="("+n+" byte)\n";n>(r/=2)&&(t=e+r);for(var i=e;i<t;++i)o+=this.hexByte(this.get(i));return n>r&&(o+="…"),o},e.prototype.parseOID=function(e,t,r){for(var n="",o=new uU,i=0,a=e;a<t;++a){var s=this.get(a);if(o.mulAdd(128,127&s),i+=7,!(128&s)){if(""===n)if((o=o.simplify())instanceof uU)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 fU(n,r);o=new uU,i=0}}return i>0&&(n+=".incomplete"),n},e}(),mU=function(){function e(e,t,r,n,o){if(!(n instanceof gU))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 fU(this.stream.parseStringUTF(t,t+r),e);case 18:case 19:case 20:case 21:case 22:case 26:return fU(this.stream.parseStringISO(t,t+r),e);case 30:return fU(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 pU?t:new pU(t,0);var n=new pU(r),o=new gU(r),i=e.decodeLength(r),a=r.pos,s=a-n.pos,c=null,u=function(){var t=[];if(null!==i){for(var n=a+i;r.pos<n;)t[t.length]=e.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var o=e.decode(r);if(o.tag.isEOC())break;t[t.length]=o}i=a-r.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(o.tagConstructed)c=u();else if(o.isUniversal()&&(3==o.tagNumber||4==o.tagNumber))try{if(3==o.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");c=u();for(var l=0;l<c.length;++l)if(c[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){c=null}if(null===c){if(null===i)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);r.pos=a+Math.abs(i)}return new e(n,s,i,o,c)},e}(),gU=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 uU;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}(),vU=[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],yU=(1<<26)/vU[vU.length-1],bU=function(){function e(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,o=!1,i="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(r=this[a]>>s)>0&&(o=!0,i=Xj(r));a>=0;)s<t?(r=(this[a]&(1<<s)-1)<<t-s,r|=this[--a]>>(s+=this.DB-t)):(r=this[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(o=!0),o&&(i+=Xj(r));return o?i:"0"},e.prototype.negate=function(){var t=SU();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)+RU(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var r=SU();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 _U(t):new kU(t),this.exp(e,r)},e.prototype.clone=function(){var e=SU();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=SU();return this.bitwiseTo(e,Yj,t),t},e.prototype.or=function(e){var t=SU();return this.bitwiseTo(e,$j,t),t},e.prototype.xor=function(e){var t=SU();return this.bitwiseTo(e,Zj,t),t},e.prototype.andNot=function(e){var t=SU();return this.bitwiseTo(e,Jj,t),t},e.prototype.not=function(){for(var e=SU(),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=SU();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=SU();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+eU(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+=tU(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,$j)},e.prototype.clearBit=function(e){return this.changeBit(e,Jj)},e.prototype.flipBit=function(e){return this.changeBit(e,Zj)},e.prototype.add=function(e){var t=SU();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=SU();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=SU();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=SU();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=SU();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=SU(),r=SU();return this.divRemTo(e,t,r),[t,r]},e.prototype.modPow=function(e,t){var r,n,o=e.bitLength(),i=TU(1);if(o<=0)return i;r=o<18?1:o<48?3:o<144?4:o<768?5:6,n=o<8?new _U(t):t.isEven()?new CU(t):new kU(t);var a=[],s=3,c=r-1,u=(1<<r)-1;if(a[1]=n.convert(this),r>1){var l=SU();for(n.sqrTo(a[1],l);s<=u;)a[s]=SU(),n.mulTo(l,a[s-2],a[s]),s+=2}var d,f,h=e.t-1,p=!0,m=SU();for(o=RU(e[h])-1;h>=0;){for(o>=c?d=e[h]>>o-c&u:(d=(e[h]&(1<<o+1)-1)<<c-o,h>0&&(d|=e[h-1]>>this.DB+o-c)),s=r;0==(1&d);)d>>=1,--s;if((o-=s)<0&&(o+=this.DB,--h),p)a[d].copyTo(i),p=!1;else{for(;s>1;)n.sqrTo(i,m),n.sqrTo(m,i),s-=2;s>0?n.sqrTo(i,m):(f=i,i=m,m=f),n.mulTo(m,a[d],i)}for(;h>=0&&0==(e[h]&1<<o);)n.sqrTo(i,m),f=i,i=m,m=f,--o<0&&(o=this.DB-1,--h)}return n.revert(i)},e.prototype.modInverse=function(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return e.ZERO;for(var n=t.clone(),o=this.clone(),i=TU(1),a=TU(0),s=TU(0),c=TU(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;o.isEven();)o.rShiftTo(1,o),r?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(t,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(t,c),c.rShiftTo(1,c);n.compareTo(o)>=0?(n.subTo(o,n),r&&i.subTo(s,i),a.subTo(c,a)):(o.subTo(n,o),r&&s.subTo(i,s),c.subTo(a,c))}return 0!=o.compareTo(e.ONE)?e.ZERO:c.compareTo(t)>=0?c.subtract(t):c.signum()<0?(c.addTo(t,c),c.signum()<0?c.add(t):c):c},e.prototype.pow=function(e){return this.exp(e,new wU)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},e.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=vU[vU.length-1]){for(t=0;t<vU.length;++t)if(r[0]==vU[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<vU.length;){for(var n=vU[t],o=t+1;o<vU.length&&n<yU;)n*=vU[o++];for(n=r.modInt(n);t<o;)if(n%vU[t++]==0)return!1}return r.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var o=t.length,i=!1,a=0;--o>=0;){var s=8==n?255&+t[o]:PU(t,o);s<0?"-"==t.charAt(o)&&(i=!0):(i=!1,0==a?this[this.t++]=s:a+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,(a+=n)>=this.DB&&(a-=this.DB))}8==n&&0!=(128&+t[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var r=e%this.DB,n=this.DB-r,o=(1<<n)-1,i=Math.floor(e/this.DB),a=this.s<<r&this.DM,s=this.t-1;s>=0;--s)t[s+i+1]=this[s]>>n|a,a=(this[s]&o)<<r;for(s=i-1;s>=0;--s)t[s]=0;t[i]=a,t.t=this.t+i+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,o=this.DB-n,i=(1<<n)-1;t[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)t[a-r-1]|=(this[a]&i)<<o,t[a-r]=this[a]>>n;n>0&&(t[this.t-r-1]|=(this.s&i)<<o),t.t=this.t-r,t.clamp()}},e.prototype.subTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},e.prototype.multiplyTo=function(t,r){var n=this.abs(),o=t.abs(),i=n.t;for(r.t=i+o.t;--i>=0;)r[i]=0;for(i=0;i<o.t;++i)r[i+n.t]=n.am(0,o[i],r,i,0,n.t);r.s=0,r.clamp(),this.s!=t.s&&e.ZERO.subTo(r,r)},e.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,r,n){var o=t.abs();if(!(o.t<=0)){var i=this.abs();if(i.t<o.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=SU());var a=SU(),s=this.s,c=t.s,u=this.DB-RU(o[o.t-1]);u>0?(o.lShiftTo(u,a),i.lShiftTo(u,n)):(o.copyTo(a),i.copyTo(n));var l=a.t,d=a[l-1];if(0!=d){var f=d*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0),h=this.FV/f,p=(1<<this.F1)/f,m=1<<this.F2,g=n.t,v=g-l,y=null==r?SU():r;for(a.dlShiftTo(v,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),e.ONE.dlShiftTo(l,y),y.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--v>=0;){var b=n[--g]==d?this.DM:Math.floor(n[g]*h+(n[g-1]+m)*p);if((n[g]+=a.am(0,b,n,v,0,l))<b)for(a.dlShiftTo(v,y),n.subTo(y,n);n[g]<--b;)n.subTo(y,n)}null!=r&&(n.drShiftTo(l,r),s!=c&&e.ZERO.subTo(r,r)),n.t=l,n.clamp(),u>0&&n.rShiftTo(u,n),s<0&&e.ZERO.subTo(n,n)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,r){if(t>4294967295||t<1)return e.ONE;var n=SU(),o=SU(),i=r.convert(this),a=RU(t)-1;for(i.copyTo(n);--a>=0;)if(r.sqrTo(n,o),(t&1<<a)>0)r.mulTo(o,i,n);else{var s=n;n=o,o=s}return r.revert(n)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=TU(r),o=SU(),i=SU(),a="";for(this.divRemTo(n,o,i);o.signum()>0;)a=(r+i.intValue()).toString(e).substr(1)+a,o.divRemTo(n,o,i);return i.intValue().toString(e)+a},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),o=Math.pow(r,n),i=!1,a=0,s=0,c=0;c<t.length;++c){var u=PU(t,c);u<0?"-"==t.charAt(c)&&0==this.signum()&&(i=!0):(s=r*s+u,++a>=n&&(this.dMultiply(o),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(r,a)),this.dAddOffset(s,0)),i&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,n){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),$j,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var o=[],i=7&t;o.length=1+(t>>3),r.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},e.prototype.bitwiseTo=function(e,t,r){var n,o,i=Math.min(e.t,this.t);for(n=0;n<i;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=i;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},e.prototype.changeBit=function(t,r){var n=e.ONE.shiftLeft(t);return this.bitwiseTo(n,r,n),n},e.prototype.addTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var o=r.t-this.t;n<o;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(o=Math.min(e.t,t);n<o;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()},e.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},e.prototype.millerRabin=function(t){var r=this.subtract(e.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var o=r.shiftRight(n);(t=t+1>>1)>vU.length&&(t=vU.length);for(var i=SU(),a=0;a<t;++a){i.fromInt(vU[Math.floor(Math.random()*vU.length)]);var s=i.modPow(o,this);if(0!=s.compareTo(e.ONE)&&0!=s.compareTo(r)){for(var c=1;c++<n&&0!=s.compareTo(r);)if(0==(s=s.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=s.compareTo(r))return!1}}return!0},e.prototype.square=function(){var e=SU();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var r=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(r.compareTo(n)<0){var o=r;r=n,n=o}var i=r.getLowestSetBit(),a=n.getLowestSetBit();if(a<0)t(r);else{i<a&&(a=i),a>0&&(r.rShiftTo(a,r),n.rShiftTo(a,n));setTimeout((function e(){(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(e,0):(a>0&&n.lShiftTo(a,n),setTimeout((function(){t(n)}),0))}),10)}},e.prototype.fromNumberAsync=function(t,r,n,o){if("number"==typeof r)if(t<2)this.fromInt(1);else{this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),$j,this),this.isEven()&&this.dAddOffset(1,0);var i=this;setTimeout((function n(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(e.ONE.shiftLeft(t-1),i),i.isProbablePrime(r)?setTimeout((function(){o()}),0):setTimeout(n,0)}),0)}else{var a=[],s=7&t;a.length=1+(t>>3),r.nextBytes(a),s>0?a[0]&=(1<<s)-1:a[0]=0,this.fromString(a,256)}},e}(),wU=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}(),_U=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}(),kU=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=SU();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(bU.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=SU();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}(),CU=function(){function e(e){this.m=e,this.r2=SU(),this.q3=SU(),bU.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=SU();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 SU(){return new bU(null)}function BU(e,t){return new bU(e,t)}var EU="undefined"!=typeof navigator;EU&&"Microsoft Internet Explorer"==navigator.appName?(bU.prototype.am=function(e,t,r,n,o,i){for(var a=32767&t,s=t>>15;--i>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;o=((c=a*c+((32767&l)<<15)+r[n]+(1073741823&o))>>>30)+(l>>>15)+s*u+(o>>>30),r[n++]=1073741823&c}return o},hU=30):EU&&"Netscape"!=navigator.appName?(bU.prototype.am=function(e,t,r,n,o,i){for(;--i>=0;){var a=t*this[e++]+r[n]+o;o=Math.floor(a/67108864),r[n++]=67108863&a}return o},hU=26):(bU.prototype.am=function(e,t,r,n,o,i){for(var a=16383&t,s=t>>14;--i>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;o=((c=a*c+((16383&l)<<14)+r[n]+o)>>28)+(l>>14)+s*u,r[n++]=268435455&c}return o},hU=28),bU.prototype.DB=hU,bU.prototype.DM=(1<<hU)-1,bU.prototype.DV=1<<hU,bU.prototype.FV=Math.pow(2,52),bU.prototype.F1=52-hU,bU.prototype.F2=2*hU-52;var xU,IU,AU=[];for(xU="0".charCodeAt(0),IU=0;IU<=9;++IU)AU[xU++]=IU;for(xU="a".charCodeAt(0),IU=10;IU<36;++IU)AU[xU++]=IU;for(xU="A".charCodeAt(0),IU=10;IU<36;++IU)AU[xU++]=IU;function PU(e,t){var r=AU[e.charCodeAt(t)];return null==r?-1:r}function TU(e){var t=SU();return t.fromInt(e),t}function RU(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}bU.ZERO=TU(0),bU.ONE=TU(1);var MU,DU,LU=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}(),OU=null;if(null==OU){OU=[],DU=0;var NU=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var FU=new Uint32Array(256);for(window.crypto.getRandomValues(FU),NU=0;NU<FU.length;++NU)OU[DU++]=255&FU[NU]}var VU=0,jU=function e(t){if((VU=VU||0)>=256||DU>=256)window.removeEventListener?window.removeEventListener("mousemove",e,!1):window.detachEvent&&window.detachEvent("onmousemove",e);else try{var r=t.x+t.y;OU[DU++]=255&r,VU+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",jU,!1):window.attachEvent&&window.attachEvent("onmousemove",jU))}function UU(){if(null==MU){for(MU=new LU;DU<256;){var e=Math.floor(65536*Math.random());OU[DU++]=255&e}for(MU.init(OU),DU=0;DU<OU.length;++DU)OU[DU]=0;DU=0}return MU.next()}var zU=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=UU()},e}(),qU=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=BU(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=this.n.bitLength()+7>>3,r=function(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=e.length-1;n>=0&&t>0;){var o=e.charCodeAt(n--);o<128?r[--t]=o:o>127&&o<2048?(r[--t]=63&o|128,r[--t]=o>>6|192):(r[--t]=63&o|128,r[--t]=o>>6&63|128,r[--t]=o>>12|224)}r[--t]=0;for(var i=new zU,a=[];t>2;){for(a[0]=0;0==a[0];)i.nextBytes(a);r[--t]=a[0]}return r[--t]=2,r[--t]=0,new bU(r)}(e,t);if(null==r)return null;var n=this.doPublic(r);if(null==n)return null;for(var o=n.toString(16),i=o.length,a=0;a<2*t-i;a++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,r){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=BU(e,16),this.e=parseInt(t,16),this.d=BU(r,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,r,n,o,i,a,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=BU(e,16),this.e=parseInt(t,16),this.d=BU(r,16),this.p=BU(n,16),this.q=BU(o,16),this.dmp1=BU(i,16),this.dmq1=BU(a,16),this.coeff=BU(s,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var r=new zU,n=e>>1;this.e=parseInt(t,16);for(var o=new bU(t,16);;){for(;this.p=new bU(e-n,1,r),0!=this.p.subtract(bU.ONE).gcd(o).compareTo(bU.ONE)||!this.p.isProbablePrime(10););for(;this.q=new bU(n,1,r),0!=this.q.subtract(bU.ONE).gcd(o).compareTo(bU.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var i=this.p;this.p=this.q,this.q=i}var a=this.p.subtract(bU.ONE),s=this.q.subtract(bU.ONE),c=a.multiply(s);if(0==c.gcd(o).compareTo(bU.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(c),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=BU(e,16),r=this.doPrivate(t);return null==r?null:function(e,t){for(var r=e.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=t-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var o="";++n<r.length;){var i=255&r[n];i<128?o+=String.fromCharCode(i):i>191&&i<224?(o+=String.fromCharCode((31&i)<<6|63&r[n+1]),++n):(o+=String.fromCharCode((15&i)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return o}(r,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,r){var n=new zU,o=e>>1;this.e=parseInt(t,16);var i=new bU(t,16),a=this;setTimeout((function t(){var s=function(){if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var n=a.p.subtract(bU.ONE),o=a.q.subtract(bU.ONE),s=n.multiply(o);0==s.gcd(i).compareTo(bU.ONE)?(a.n=a.p.multiply(a.q),a.d=i.modInverse(s),a.dmp1=a.d.mod(n),a.dmq1=a.d.mod(o),a.coeff=a.q.modInverse(a.p),setTimeout((function(){r()}),0)):setTimeout(t,0)},c=function e(){a.q=SU(),a.q.fromNumberAsync(o,1,n,(function(){a.q.subtract(bU.ONE).gcda(i,(function(t){0==t.compareTo(bU.ONE)&&a.q.isProbablePrime(10)?setTimeout(s,0):setTimeout(e,0)}))}))};setTimeout((function t(){a.p=SU(),a.p.fromNumberAsync(e-o,1,n,(function(){a.p.subtract(bU.ONE).gcda(i,(function(e){0==e.compareTo(bU.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(t,0)}))}))}),0)}),0)},e.prototype.sign=function(e,t,r){var n=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var r=t-e.length-6,n="",o=0;o<r;o+=2)n+="ff";return BU("0001"+n+"00"+e,16)}((WU[r]||"")+t(e).toString(),this.n.bitLength()/4);if(null==n)return null;var o=this.doPrivate(n);if(null==o)return null;var i=o.toString(16);return 0==(1&i.length)?i:"0"+i},e.prototype.verify=function(e,t,r){var n=BU(t,16),o=this.doPublic(n);return null==o?null:function(e){for(var t in WU)if(WU.hasOwnProperty(t)){var r=WU[t],n=r.length;if(e.substr(0,n)==r)return e.substr(n)}return e}
37
+ (r=cD).mode.CTRGladman=function(){var e=r.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function n(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var o=e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,o=r.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0),n(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c<o;c++)e[t+c]^=s[c]}});return e.Decryptor=o,e}(),r.mode.CTRGladman)})),WP((function(e,t){var r,n,o;e.exports=((o=cD).mode.OFB=(n=(r=o.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,o=this._iv,i=this._keystream;o&&(i=this._keystream=o.slice(0),this._iv=void 0),r.encryptBlock(i,0);for(var a=0;a<n;a++)e[t+a]^=i[a]}}),r.Decryptor=n,r),o.mode.OFB)})),WP((function(e,t){var r,n;e.exports=((n=cD).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)})),WP((function(e,t){var r;e.exports=((r=cD).pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,o=n-r%n,i=r+o-1;e.clamp(),e.words[i>>>2]|=o<<24-i%4*8,e.sigBytes+=o},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)})),WP((function(e,t){var r;e.exports=((r=cD).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)})),WP((function(e,t){var r;e.exports=((r=cD).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)})),WP((function(e,t){var r;e.exports=((r=cD).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)})),WP((function(e,t){var r;e.exports=((r=cD).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)})),WP((function(e,t){var r;e.exports=(r=cD,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)})),WP((function(e,t){var r;e.exports=(r=cD,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,o=[],i=[],a=[],s=[],c=[],u=[],l=[],d=[],f=[],h=[];!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 p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,o[r]=p,i[p]=r;var m=e[r],g=e[m],v=e[g],y=257*e[p]^16843008*p;a[r]=y<<24|y>>>8,s[r]=y<<16|y>>>16,c[r]=y<<8|y>>>24,u[r]=y,y=16843009*v^65537*g^257*m^16843008*r,l[p]=y<<24|y>>>8,d[p]=y<<16|y>>>16,f[p]=y<<8|y>>>24,h[p]=y,r?(r=m^e[e[e[v^m]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),i=this._keySchedule=[],a=0;a<n;a++)a<r?i[a]=t[a]:(u=i[a-1],a%r?r>6&&a%r==4&&(u=o[u>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u]):(u=o[(u=u<<8|u>>>24)>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u],u^=p[a/r|0]<<24),i[a]=i[a-r]^u);for(var s=this._invKeySchedule=[],c=0;c<n;c++){if(a=n-c,c%4)var u=i[a];else u=i[a-4];s[c]=c<4||a<=4?u:l[o[u>>>24]]^d[o[u>>>16&255]]^f[o[u>>>8&255]]^h[o[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,o)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,d,f,h,i),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,o,i,a,s){for(var c=this._nRounds,u=e[t]^r[0],l=e[t+1]^r[1],d=e[t+2]^r[2],f=e[t+3]^r[3],h=4,p=1;p<c;p++){var m=n[u>>>24]^o[l>>>16&255]^i[d>>>8&255]^a[255&f]^r[h++],g=n[l>>>24]^o[d>>>16&255]^i[f>>>8&255]^a[255&u]^r[h++],v=n[d>>>24]^o[f>>>16&255]^i[u>>>8&255]^a[255&l]^r[h++],y=n[f>>>24]^o[u>>>16&255]^i[l>>>8&255]^a[255&d]^r[h++];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[h++],g=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[f>>>8&255]<<8|s[255&u])^r[h++],v=(s[d>>>24]<<24|s[f>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[h++],y=(s[f>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&d])^r[h++],e[t]=m,e[t+1]=g,e[t+2]=v,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),r.AES)})),WP((function(e,t){var r;e.exports=(r=cD,function(){var e=r,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var o=this._subKeys=[],i=0;i<16;i++){var u=o[i]=[],l=c[i];for(r=0;r<24;r++)u[r/6|0]|=t[(s[r]-1+l)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(s[r+24]-1+l)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var d=this._invSubKeys=[];for(r=0;r<16;r++)d[r]=o[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],f.call(this,4,252645135),f.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),f.call(this,1,1431655765);for(var n=0;n<16;n++){for(var o=r[n],i=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^o[c])&l[c])>>>0];this._lBlock=a,this._rBlock=i^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,f.call(this,1,1431655765),h.call(this,8,16711935),h.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 h(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=o._createHelper(d);var p=i.TripleDES=o.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),o=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(o))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(p)}(),r.TripleDES)})),WP((function(e,t){var r;e.exports=(r=cD,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],o=0;o<256;o++)n[o]=o;o=0;for(var i=0;o<256;o++){var a=o%r,s=t[a>>>2]>>>24-a%4*8&255;i=(i+n[o]+s)%256;var c=n[o];n[o]=n[i],n[i]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,r=this._j,n=0,o=0;o<4;o++){r=(r+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[r],e[r]=i,n|=e[(e[t]+e[r])%256]<<24-8*o}return this._i=t,this._j=r,n}e.RC4=t._createHelper(o);var a=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)})),WP((function(e,t){var r;e.exports=(r=cD,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)o[r]^=n[r+4&7];if(t){var i=t.words,a=i[0],s=i[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;for(o[0]^=u,o[1]^=d,o[2]^=l,o[3]^=f,o[4]^=u,o[5]^=d,o[6]^=l,o[7]^=f,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),e[t+n]^=o[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,s=n>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)})),WP((function(e,t){var r;e.exports=(r=cD,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],a=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)c.call(this);for(o=0;o<8;o++)n[o]^=r[o+4&7];if(t){var i=t.words,a=i[0],s=i[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=u>>>16|4294901760&l,f=l<<16|65535&u;for(n[0]^=u,n[1]^=d,n[2]^=l,n[3]^=f,n[4]^=u,n[5]^=d,n[6]^=l,n[7]^=f,o=0;o<4;o++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)o[n]=16711935&(o[n]<<8|o[n]>>>24)|4278255360&(o[n]<<24|o[n]>>>8),e[t+n]^=o[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],o=65535&n,s=n>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)})),WP((function(e,t){e.exports=cD}))),lD=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=uD.MD5(uD.lib.WordArray.create(r)).toString();e(n)},r.readAsArrayBuffer(t)}))},dD=Object.freeze({__proto__:null,MD5:lD,base64ToMD5:function(e){var t=e.base64;return uD.MD5(t).toString()}}),fD=["tracking"],hD=ZM(),pD=hv.createContext(),mD={enable:!1,accessKey:"",secretKey:"",apiUrl:"",userId:""},gD=function(){var e=EP(kP().mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,h,p,m;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.tag,n=t.event,o=t.log,i=nD(new Date),a=o,e.t0=n,e.next="sdk_mode.read_id_card_one_side"===e.t0?6:"sdk_mode.liveness"===e.t0?19:36;break;case 6:return a=GM(o),s=o.result_object,e.next=10,lD({blob:s.image.blob});case 10:if(e.t1=e.sent,a.result_object.image={blob:e.t1},delete a.result_object.recordedVideos,!s.qrScannedResult){e.next=18;break}return e.next=16,lD({blob:s.qrScannedResult.image.blob});case 16:a.result_object.qrScannedResult.image.blob=e.sent,delete a.result_object.qrScannedResult.recordedVideos;case 18:return e.abrupt("break",36);case 19:return a=GM(o),c=o.result_object,u=c.steps,l=c.frontalFaces,d=c.frontalScaledImage,f=u.map((function(e){return lD({blob:e.image.blob})})),e.next=24,Promise.all(f);case 24:return h=e.sent,u.forEach((function(e,t){a.result_object.steps[t].image.blob=h[t]})),p=l.map((function(e){return lD({blob:e})})),e.next=29,Promise.all(p);case 29:if(m=e.sent,l.forEach((function(e,t){a.result_object.frontalFaces[t]=m[t]})),!d){e.next=35;break}return e.next=34,lD({blob:d});case 34:a.result_object.frontalScaledImage=e.sent;case 35:return e.abrupt("break",36);case 36:return e.abrupt("return",{tag:r,event:n,log:_P({device_time:i},a)});case 37:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function vD(e){var t,r=e.userId;if(r)t=r;else{var n=aD("tv:user-id");if(n)t=n;else{var o=QM();t=o,iD(o,"tv:user-id")}}return t}function yD(e){var t=e.value,r=e.children,n=t.tracking,o=void 0===n?mD:n,i=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,fD),a=o.enable,s=void 0!==a&&a,c=o.accessKey,u=o.secretKey,l=o.apiUrl,d=o.userId,f=o.logSignature,h=hv.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:_P({"X-TV-Timestamp":r,Authorization:n,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}if(s){if(!l||!c||!u)return console.warn("apiUrl, accessKey and secretKey are required when tracking is enabled"),null;var i=new jM(c,u,l).httpClient.authorizer.getHeaders({requestPath:"/v1/log_events",method:"POST"});return fetch("".concat(l,"/v1/log_events"),{method:"POST",headers:_P({"X-TV-Timestamp":i["X-TV-Timestamp"],Authorization:i.Authorization,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}return null}),[f,s,l,c,u]),p=hv.useMemo((function(){return{"x-request-id":vD({userId:d})}}),[d]),m=hv.useCallback(EP(kP().mark((function e(){var t,r,n,o,i,a,c=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.tag,n=t.event,o=t.log,i=void 0===o?{}:o,!s){e.next=11;break}return e.prev=2,e.next=5,gD({tag:r,event:n,log:i});case 5:a=e.sent,h(a,_P(_P({},p),hD)),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]])}))),[h,p,s]);return hv.createElement(pD.Provider,{value:_P(_P({},i),{},{sendEvent:m})},r)}yD.propTypes={value:Fv.shape({tracking:Fv.shape({enable:Fv.bool,accessKey:Fv.string,secretKey:Fv.string,apiUrl:Fv.string,userId:Fv.string})}).isRequired,children:Fv.node.isRequired};var bD,wD,_D,kD,CD,SD,BD,ED,xD,ID,AD,PD,TD,RD,MD,DD,LD,OD,ND,FD,VD=Object.freeze({__proto__:null,defaultTrackingConfig:mD,getXRequestId:vD,SDKTrackingProvider:yD,useSDKTracking:function(){var e=hv.useContext(pD);return hv.useMemo((function(){return void 0===e?(console.warn("useSDKTracking must be used within a SDKTrackingProvider"),{sendEvent:function(){}}):e}),[e])}}),jD=(PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(CD={not_supported:"Camera không được hỗ trợ. Vui lòng thử trình duyệt hoặc thiết bị khác.",camera_timeout:"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:"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:"Không thể load model. Vui lòng thử trình duyệt hoặc thiết bị khác.",no_permission:"Vui lòng cấp quyền để truy cập camera.",no_face:"Không tìm thấy khuôn mặt",partial_face:"Không tìm thấy toàn bộ khuôn mặt",multiple_faces:"Quá nhiều khuôn mặt",face_too_small:"Khuôn mặt quá nhỏ",face_too_large:"Khuôn mặt quá to",face_out_of_box:"Khuôn mặt không nằm trọn vẹn trong khung ảnh",liveness_too_fast:"Vui lòng quay CHẬM lại",liveness_terminated:"Vui lòng thực hiện lại.",liveness_terminated_face_tracking:"Bạn cần quay CHẬM lại.\nVui lòng thực hiện lại.",liveness_terminated_no_face:"Khuôn mặt không nằm trong khung hình.\nXin vui lòng thử lại.",liveness_terminated_time_out:"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:"Card sanity chưa đạt",api_call_error:"Lỗi call api",upload_error:"Lỗi upload",sanity_check_error:"Lỗi check sanity",read_id_card_error:"Lỗi read id card",detect_id_tampering_error:"Lỗi detect id tampering",detect_id_card_error:"Không thể detect id card type",missing_front_id_card:"Không tìm thấy front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Vui lòng đặt giấy tờ thẳng, không bị nghiêng khi chụp",id_detector_no_cards:"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:"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:"Vui lòng đưa giấy tờ ra XA hơn\n (chiếm 50-95% khung hình)",glare_detected:"Ảnh bị chói / lóa. Vui lòng điều chỉnh góc chụp.",id_detector_error_front_side_no_faces:"Vui lòng chụp mặt trước của giấy tờ",id_detector_error_front_side_multiple_faces:"Vui lòng chụp mặt trước 1 giấy tờ duy nhất",id_detector_error_back_side_has_faces:"Vui lòng chụp mặt sau của giấy tờ",id_detector_error_blur:"Ảnh bị mờ. Vui lòng chụp lại để có ảnh rõ nét hơn",not_frontal_face:"Vui lòng nhìn thẳng vào camera.",not_readable:"Camera đang được sử dụng bởi ứng dụng/tab khác.",close_eye:"Vui lòng mở to mắt",front_card_title:"Mặt trước CMND/CCCD",back_card_title:"Mặt sau CMND/CCCD",qr_title:"Quét mã QR trên CCCD",front_card_description:"Vui lòng đặt CMND mặt trước vào trong khung",back_card_description:"Vui lòng đặt CMND mặt sau vào trong khung",btn_ok:"Tôi đã hiểu",front:"trước",back:"sau",btn_use_this_picture:"Dùng ảnh này",btn_try_again:"Thử lại",confirm_popup_valid_qr:"Đã quét được mã QR",confirm_popup_invalid_qr:"Không quét được mã QR",remaining_time:"Thời gian còn lại: <%= x %> giây",timeout_instruction:"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.",warmup_intro:"Đang khởi động, vui lòng chờ trong giây lát..."},null==bP||null===(bD=vP)||void 0===bD?void 0:bD.LEFT,"Quay mặt chậm qua trái"),null==bP||null===(wD=vP)||void 0===wD?void 0:wD.RIGHT,"Quay mặt chậm qua phải"),null==bP||null===(_D=vP)||void 0===_D?void 0:_D.UP,"Ngước mặt chậm lên trên"),null==bP||null===(kD=vP)||void 0===kD?void 0:kD.FRONTAL,"Nhìn thẳng camera"),"qr_instructions_text","Vui lòng quét mã QR theo hướng dẫn sau:\n Đư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","Tiến hành quét mã QR"),"qr_instructions_countdown","Bắt đầu trong <%= x %> giây"),"qr_invalid_popup_title","QR không hợp lệ"),"qr_invalid_popup_description","Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR code trên CCCD thật"),"qr_invalid_popup_retry_button","Quét lại QR (trên CCCD)"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(CD,"qr_invalid_popup_skip_button","Bỏ qua"),"qr_tooltip","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"),"session_timeout_popup_description","Quá thời gian quét. Vui lòng thực hiện lại.\n Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và 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","Thử lại"),"session_timeout_popup_skip_button","Bỏ qua"),"flash_liveness.title","Xác thực khuôn mặt"),"flash_liveness.instruction.far_step","Đưa mặt vào khung"),"flash_liveness.instruction.close_step","Đưa mặt lại gần"),"flash_liveness.instruction.flash_step","Giữ yên"),"flash_liveness.error.no_face","Không tìm thấy khuôn mặt"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(CD,"flash_liveness.processing","Đang xử lý kết quả"),"flash_liveness.error.partial_face","Đưa khuôn mặt vào giữa hình oval"),"flash_liveness.error.face_too_small","Đưa khuôn mặt lại gần một chút"),"flash_liveness.error.face_too_large","Đưa khuôn mặt ra xa một chút"),"flash_liveness.error.close_eye","Vui lòng mở to mắt"),"flash_liveness.error.face_not_frontal","Vui lòng đưa thiết bị ngang tầm mắt"),"flash_liveness.error.multiple_faces","Có nhiều mặt trong khung hình"),"flash_liveness.error.face_too_high","Đưa khuôn mặt xuống một chút"),"flash_liveness.error.face_too_blurry","Ảnh bị mờ, vui lòng giữ yên điện thoại"),"flash_liveness.error.face_not_qualified","Vui lòng không đeo kiếng, khẩu trang, hay để mặt bị che"),PP(PP(PP(PP(CD,"flash_liveness.timeout.remaining","Thời gian còn lại: <%= remain %> giây"),"flash_liveness.timeout.expired","Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại."),"flash_liveness.error.face_too_bright","Khuôn mặt quá sáng. Vui lòng điều chỉnh để có ánh sáng phù hợp."),"flash_liveness.error.face_too_dark","Khuôn mặt quá tối. Vui lòng điều chỉnh để có ánh sáng tốt hơn.")),UD=(PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(ID={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",qr_title:"Scan QR code on ID card",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bP||null===(SD=vP)||void 0===SD?void 0:SD.LEFT,"Turn your face to the left"),null==bP||null===(BD=vP)||void 0===BD?void 0:BD.RIGHT,"Turn your face to the right"),null==bP||null===(ED=vP)||void 0===ED?void 0:ED.UP,"Turn your face up"),null==bP||null===(xD=vP)||void 0===xD?void 0:xD.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(ID,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(ID,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),PP(PP(PP(PP(ID,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),zD=(PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(MD={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",qr_title:"Scan QR code on ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bP||null===(AD=vP)||void 0===AD?void 0:AD.LEFT,"Turn your face to the left"),null==bP||null===(PD=vP)||void 0===PD?void 0:PD.RIGHT,"Turn your face to the right"),null==bP||null===(TD=vP)||void 0===TD?void 0:TD.UP,"Turn your face up"),null==bP||null===(RD=vP)||void 0===RD?void 0:RD.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(MD,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(MD,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),PP(PP(PP(PP(MD,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),qD=(PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(FD={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",qr_title:"Scan QR code on ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bP||null===(DD=vP)||void 0===DD?void 0:DD.LEFT,"Turn your face to the left"),null==bP||null===(LD=vP)||void 0===LD?void 0:LD.RIGHT,"Turn your face to the right"),null==bP||null===(OD=vP)||void 0===OD?void 0:OD.UP,"Turn your face up"),null==bP||null===(ND=vP)||void 0===ND?void 0:ND.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(FD,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),PP(PP(PP(PP(PP(PP(PP(PP(PP(PP(FD,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),PP(PP(PP(PP(FD,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),WD=hv.createContext(jD),HD=function(e){var t=e.value,r=e.children,n=t.lang,o=void 0===n?"vi":n,i=t.country,a=void 0===i?"vn":i,s=t.customTexts,c=void 0===s?{}:s,u=hv.useMemo((function(){var e=Object.assign({},function(e,t){return"vn"===t?"vi"===e?jD:UD:"ph"===t?zD:"in"===t?qD:jD}(o,a));return Object.keys(c).length>0&&Object.keys(c).forEach((function(t){var r,n,i,a=(null===(n=null===(r=null==c?void 0:c[t])||void 0===r?void 0:r.msg)||void 0===n?void 0:n[o])||(null===(i=null==c?void 0:c[t])||void 0===i?void 0:i[o])||(null==c?void 0:c[t]);e[t]=a})),e}),[a,c,o]);return hv.createElement(WD.Provider,{value:u},r)},KD={};function QD(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:KD,t=hv.useContext(WD);return void 0===t&&console.error("useSDKLocale must be used within a SDKLocaleProvider"),hv.useMemo((function(){return Object.assign(Object.assign({},t),e)}),[t,e])}var GD=Object.freeze({__proto__:null,SDKLocaleProvider:HD,useSDKLocale:QD});function XD(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(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(a,s)}c((n=n.apply(e,t||[])).next())}))}function YD(e,t){return e&&!e.endsWith("/")?[e,"/",t].join(""):[e,t].join("")}function $D(){var e=OM();return null==e?void 0:e.assetRoot}function ZD(e){return YD($D(),e)}var JD=Object.freeze({__proto__:null,getAsset:YD,useAssetRoot:$D,useAsset:ZD}),eL=hv.createContext({}),tL=function(e){var t=e.children,r=e.mode,n=OM(),o=n.enableVoice,i=function(e,t){var r=ZD("audio/".concat(t,"/move_face_into_frame.mp3")),n=ZD("audio/".concat(t,"/move_face_closer.mp3")),o=ZD("audio/".concat(t,"/please_hold_still.mp3")),i=ZD("audio/".concat(t,"/keep_front_id_fit_border.mp3")),a=ZD("audio/".concat(t,"/keep_back_id_fit_border.mp3"));return hv.useMemo((function(){switch(e){case"flash":return{move_face_into_frame:r,move_face_closer:n,please_hold_still:o};case"id_card":return{keep_front_id_fit_border:i,keep_back_id_fit_border:a};default:return{}}}),[o,a,i,e,n,r])}(r,n.lang),a=RP(hv.useState({}),2),s=a[0],c=a[1];return hv.useEffect((function(){var e;o&&(e=i,XD(void 0,void 0,void 0,kP().mark((function t(){var r,n;return kP().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("object"===SP(e)&&0!==Object.values(e).length){t.next=2;break}return t.abrupt("return",{});case 2:return r=Object.entries(e).reduce((function(e,t){var r=RP(t,2),n=r[0],o=r[1];return e[n]=new Audio(o),e}),{}),n=Object.values(r).map((function(e){return new Promise((function(t,r){e.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA?t():(e.addEventListener("suspend",(function(){console.warn("Audio loading suspended. Audio might not play smoothly."),t()})),e.addEventListener("canplay",(function(){t()})),e.addEventListener("canplaythrough",(function(){t()})),e.addEventListener("error",(function(t){if(null===e.error)return console.error("An unknown error occurred."),void r(t);switch(e.error.code){case MediaError.MEDIA_ERR_ABORTED:console.error("The fetching process for the media resource was aborted by the user agent at the user's request.");break;case MediaError.MEDIA_ERR_NETWORK:console.error("A network error caused the audio download to fail.");break;case MediaError.MEDIA_ERR_DECODE:console.error("The media data could not be decoded.");break;case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:console.error("The media resource indicated by the src attribute was not suitable.");break;default:console.error("An unknown error occurred.")}r(t)})))}))})),t.next=6,Promise.all(n);case 6:return t.abrupt("return",r);case 7:case"end":return t.stop()}}),t)})))).then(c).catch((function(e){console.error("Error initializing audio:",e)}))}),[o,i]),hv.createElement(eL.Provider,{value:s},t)},rL=Object.freeze({__proto__:null,VoiceProvider:tL,useVoicePlayer:function(){var e=hv.useContext(eL),t=hv.useRef(null);return{playVoice:hv.useCallback((function(r){try{if(r===t.current&&!e[r].ended)return;if(t.current){var n=e[t.current];n.pause(),n.currentTime=0}var o=e[r];if(o instanceof HTMLAudioElement==0)return;o.play(),t.current=r}catch(e){console.error("Error playing audio:",e)}}),[e])}}}),nL=hv.createContext(null),oL=function(e){var t=e.children,r=hv.useRef(null),n=hv.useRef(null);return hv.useEffect((function(){var e,t;return window.Accelerometer&&((e=new Accelerometer({frequency:10})).addEventListener("reading",(function(){r.current={x:e.x,y:e.y,z:e.z}})),e.start()),window.Gyroscope&&((t=new Gyroscope({frequency:10})).addEventListener("reading",(function(){n.current={x:t.x,y:t.y,z:t.z}})),t.start()),function(){e&&e.stop(),t&&t.stop()}}),[]),hv.createElement(nL.Provider,{value:{getAccelerometer:function(){return r.current},getGyroscope:function(){return n.current}}},t)};oL.propTypes={children:Fv.node},oL.defaultProps={children:null};var iL=Object.freeze({__proto__:null,useSensors:function(){return hv.useContext(nL)},SensorsProvider:oL});function aL(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(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(a,s)}c((n=n.apply(e,t||[])).next())}))}var sL={401:"invalid_license_exception",400:"invalid_parameter_exception",429:"rate_limit_exception",500:"internal_server_error",unknown:"unknown_license_error",invalid_license:"invalid_license",invalid_app_id:"invalid_app_id",invalid_date:"invalid_date",license_expired:"license_expired",invalid_signature:"invalid_signature",missing_url:"missing_url"};function cL(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function uL(e){var t,r="",n=0,o=0;for(t=0;t<e.length&&"="!==e.charAt(t);++t){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t));i<0||(0===n?(r+=cL(i>>2),o=3&i,n=1):1===n?(r+=cL(o<<2|i>>4),o=15&i,n=2):2===n?(r+=cL(o),r+=cL(i>>2),o=3&i,n=3):(r+=cL(o<<2|i>>4),r+=cL(15&i),n=0))}return 1===n&&(r+=cL(o<<2)),r}function lL(e){for(var t="",r=0;r<e.length;r+=2){var n=e.slice(r,r+2),o=parseInt(n,16);t+=String.fromCharCode(o)}return t}var dL=function(e){var t=RP(lL(uL(e)).split(";;"),4),r=t[1];return{mode:"offline"!==r&&"online"!==r?"offline":r,license:t[2],signature:t[3]}},fL="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function hL(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 pL=function(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}(Object.freeze({__proto__:null,default:{}})),mL=hL((function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==SP(e)?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:pL.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var o=0,i=Math.min(e.length,r),a=t;a<i;a++){var s=e.charCodeAt(a)-48;o*=n,o+=s>=49?s-49+10:s>=17?s-17+10:s}return o}o.isBN=function(e){return e instanceof o||null!==e&&"object"==SP(e)&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==SP(e))return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,n):(this._parseBase(e,t,o),"le"===n&&this._initArray(this.toArray(),t,n)))},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===n)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=s(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=s(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,s=Math.min(i,i-a)+r,u=0,l=r;l<s;l+=n)u=c(e,l,l+n,t),this.imuln(o),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var d=1;for(u=c(e,l,e.length,t),l=0;l<a;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u<n;u++){for(var l=c>>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(a=(o=0|e.words[p])*(i=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a<this.length;a++){var s=this.words[a],c=(16777215&(s<<o|i)).toString(16);n=0!=(i=s>>>24-o&16777215)||a!==this.length-1?u[6-c.length]+c+n:c+n,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?m+n:u[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r(void 0!==i),this.toArrayLike(i,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(i),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[s]=a;for(;s<i;s++)u[s]=0}else{for(s=0;s<i-o;s++)u[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),u[i-s-1]=a}return u},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)i=(t=(0|r.words[a])-(0|n.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<r.length;a++)i=(t=(0|r.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,r){var n,o,i,a=e.words,s=t.words,c=r.words,u=0,l=0|a[0],d=8191&l,f=l>>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,k=0|a[4],C=8191&k,S=k>>>13,B=0|a[5],E=8191&B,x=B>>>13,I=0|a[6],A=8191&I,P=I>>>13,T=0|a[7],R=8191&T,M=T>>>13,D=0|a[8],L=8191&D,O=D>>>13,N=0|a[9],F=8191&N,V=N>>>13,j=0|s[0],U=8191&j,z=j>>>13,q=0|s[1],W=8191&q,H=q>>>13,K=0|s[2],Q=8191&K,G=K>>>13,X=0|s[3],Y=8191&X,$=X>>>13,Z=0|s[4],J=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ne=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,le=0|s[8],de=8191&le,fe=le>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(o=(o=Math.imul(d,z))+Math.imul(f,U)|0))<<13)|0;u=((i=Math.imul(f,z))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),o=(o=Math.imul(p,z))+Math.imul(m,U)|0,i=Math.imul(m,z);var ve=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(o=(o=o+Math.imul(d,H)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,H)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,U),o=(o=Math.imul(v,z))+Math.imul(y,U)|0,i=Math.imul(y,z),n=n+Math.imul(p,W)|0,o=(o=o+Math.imul(p,H)|0)+Math.imul(m,W)|0,i=i+Math.imul(m,H)|0;var ye=(u+(n=n+Math.imul(d,Q)|0)|0)+((8191&(o=(o=o+Math.imul(d,G)|0)+Math.imul(f,Q)|0))<<13)|0;u=((i=i+Math.imul(f,G)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,U),o=(o=Math.imul(w,z))+Math.imul(_,U)|0,i=Math.imul(_,z),n=n+Math.imul(v,W)|0,o=(o=o+Math.imul(v,H)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,H)|0,n=n+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,G)|0;var be=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(o=(o=o+Math.imul(d,$)|0)+Math.imul(f,Y)|0))<<13)|0;u=((i=i+Math.imul(f,$)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(C,U),o=(o=Math.imul(C,z))+Math.imul(S,U)|0,i=Math.imul(S,z),n=n+Math.imul(w,W)|0,o=(o=o+Math.imul(w,H)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,H)|0,n=n+Math.imul(v,Q)|0,o=(o=o+Math.imul(v,G)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(p,Y)|0,o=(o=o+Math.imul(p,$)|0)+Math.imul(m,Y)|0,i=i+Math.imul(m,$)|0;var we=(u+(n=n+Math.imul(d,J)|0)|0)+((8191&(o=(o=o+Math.imul(d,ee)|0)+Math.imul(f,J)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(E,U),o=(o=Math.imul(E,z))+Math.imul(x,U)|0,i=Math.imul(x,z),n=n+Math.imul(C,W)|0,o=(o=o+Math.imul(C,H)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,G)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,G)|0,n=n+Math.imul(v,Y)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,$)|0,n=n+Math.imul(p,J)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,J)|0,i=i+Math.imul(m,ee)|0;var _e=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(o=(o=o+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;u=((i=i+Math.imul(f,ne)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,U),o=(o=Math.imul(A,z))+Math.imul(P,U)|0,i=Math.imul(P,z),n=n+Math.imul(E,W)|0,o=(o=o+Math.imul(E,H)|0)+Math.imul(x,W)|0,i=i+Math.imul(x,H)|0,n=n+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,G)|0)+Math.imul(S,Q)|0,i=i+Math.imul(S,G)|0,n=n+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(_,Y)|0,i=i+Math.imul(_,$)|0,n=n+Math.imul(v,J)|0,o=(o=o+Math.imul(v,ee)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0;var ke=(u+(n=n+Math.imul(d,ie)|0)|0)+((8191&(o=(o=o+Math.imul(d,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,U),o=(o=Math.imul(R,z))+Math.imul(M,U)|0,i=Math.imul(M,z),n=n+Math.imul(A,W)|0,o=(o=o+Math.imul(A,H)|0)+Math.imul(P,W)|0,i=i+Math.imul(P,H)|0,n=n+Math.imul(E,Q)|0,o=(o=o+Math.imul(E,G)|0)+Math.imul(x,Q)|0,i=i+Math.imul(x,G)|0,n=n+Math.imul(C,Y)|0,o=(o=o+Math.imul(C,$)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,$)|0,n=n+Math.imul(w,J)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(_,J)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(v,re)|0,o=(o=o+Math.imul(v,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,ae)|0;var Ce=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(o=(o=o+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,U),o=(o=Math.imul(L,z))+Math.imul(O,U)|0,i=Math.imul(O,z),n=n+Math.imul(R,W)|0,o=(o=o+Math.imul(R,H)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,H)|0,n=n+Math.imul(A,Q)|0,o=(o=o+Math.imul(A,G)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(E,Y)|0,o=(o=o+Math.imul(E,$)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,$)|0,n=n+Math.imul(C,J)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(v,ie)|0,o=(o=o+Math.imul(v,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0,n=n+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,i=i+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(o=(o=o+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,U),o=(o=Math.imul(F,z))+Math.imul(V,U)|0,i=Math.imul(V,z),n=n+Math.imul(L,W)|0,o=(o=o+Math.imul(L,H)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,H)|0,n=n+Math.imul(R,Q)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,G)|0,n=n+Math.imul(A,Y)|0,o=(o=o+Math.imul(A,$)|0)+Math.imul(P,Y)|0,i=i+Math.imul(P,$)|0,n=n+Math.imul(E,J)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(x,J)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(v,ce)|0,o=(o=o+Math.imul(v,ue)|0)+Math.imul(y,ce)|0,i=i+Math.imul(y,ue)|0,n=n+Math.imul(p,de)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,fe)|0;var Be=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(o=(o=o+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;u=((i=i+Math.imul(f,me)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(F,W),o=(o=Math.imul(F,H))+Math.imul(V,W)|0,i=Math.imul(V,H),n=n+Math.imul(L,Q)|0,o=(o=o+Math.imul(L,G)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,G)|0,n=n+Math.imul(R,Y)|0,o=(o=o+Math.imul(R,$)|0)+Math.imul(M,Y)|0,i=i+Math.imul(M,$)|0,n=n+Math.imul(A,J)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(E,re)|0,o=(o=o+Math.imul(E,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,o=(o=o+Math.imul(w,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,n=n+Math.imul(v,de)|0,o=(o=o+Math.imul(v,fe)|0)+Math.imul(y,de)|0,i=i+Math.imul(y,fe)|0;var Ee=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,Q),o=(o=Math.imul(F,G))+Math.imul(V,Q)|0,i=Math.imul(V,G),n=n+Math.imul(L,Y)|0,o=(o=o+Math.imul(L,$)|0)+Math.imul(O,Y)|0,i=i+Math.imul(O,$)|0,n=n+Math.imul(R,J)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(M,J)|0,i=i+Math.imul(M,ee)|0,n=n+Math.imul(A,re)|0,o=(o=o+Math.imul(A,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,n=n+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,o=(o=o+Math.imul(w,fe)|0)+Math.imul(_,de)|0,i=i+Math.imul(_,fe)|0;var xe=(u+(n=n+Math.imul(v,pe)|0)|0)+((8191&(o=(o=o+Math.imul(v,me)|0)+Math.imul(y,pe)|0))<<13)|0;u=((i=i+Math.imul(y,me)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(F,Y),o=(o=Math.imul(F,$))+Math.imul(V,Y)|0,i=Math.imul(V,$),n=n+Math.imul(L,J)|0,o=(o=o+Math.imul(L,ee)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,ee)|0,n=n+Math.imul(R,re)|0,o=(o=o+Math.imul(R,ne)|0)+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,n=n+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,ae)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,ae)|0,n=n+Math.imul(E,ce)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,ue)|0,n=n+Math.imul(C,de)|0,o=(o=o+Math.imul(C,fe)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,fe)|0;var Ie=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,me)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,J),o=(o=Math.imul(F,ee))+Math.imul(V,J)|0,i=Math.imul(V,ee),n=n+Math.imul(L,re)|0,o=(o=o+Math.imul(L,ne)|0)+Math.imul(O,re)|0,i=i+Math.imul(O,ne)|0,n=n+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,n=n+Math.imul(A,ce)|0,o=(o=o+Math.imul(A,ue)|0)+Math.imul(P,ce)|0,i=i+Math.imul(P,ue)|0,n=n+Math.imul(E,de)|0,o=(o=o+Math.imul(E,fe)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,fe)|0;var Ae=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((i=i+Math.imul(S,me)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,re),o=(o=Math.imul(F,ne))+Math.imul(V,re)|0,i=Math.imul(V,ne),n=n+Math.imul(L,ie)|0,o=(o=o+Math.imul(L,ae)|0)+Math.imul(O,ie)|0,i=i+Math.imul(O,ae)|0,n=n+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(M,ce)|0,i=i+Math.imul(M,ue)|0,n=n+Math.imul(A,de)|0,o=(o=o+Math.imul(A,fe)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,fe)|0;var Pe=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,ie),o=(o=Math.imul(F,ae))+Math.imul(V,ie)|0,i=Math.imul(V,ae),n=n+Math.imul(L,ce)|0,o=(o=o+Math.imul(L,ue)|0)+Math.imul(O,ce)|0,i=i+Math.imul(O,ue)|0,n=n+Math.imul(R,de)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(M,de)|0,i=i+Math.imul(M,fe)|0;var Te=(u+(n=n+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,me)|0)+Math.imul(P,pe)|0))<<13)|0;u=((i=i+Math.imul(P,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,ce),o=(o=Math.imul(F,ue))+Math.imul(V,ce)|0,i=Math.imul(V,ue),n=n+Math.imul(L,de)|0,o=(o=o+Math.imul(L,fe)|0)+Math.imul(O,de)|0,i=i+Math.imul(O,fe)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,me)|0)+Math.imul(M,pe)|0))<<13)|0;u=((i=i+Math.imul(M,me)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(F,de),o=(o=Math.imul(F,fe))+Math.imul(V,de)|0,i=Math.imul(V,fe);var Me=(u+(n=n+Math.imul(L,pe)|0)|0)+((8191&(o=(o=o+Math.imul(L,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((i=i+Math.imul(O,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var De=(u+(n=Math.imul(F,pe))|0)+((8191&(o=(o=Math.imul(F,me))+Math.imul(V,pe)|0))<<13)|0;return u=((i=Math.imul(V,me))+(o>>>13)|0)+(De>>>26)|0,De&=67108863,c[0]=ge,c[1]=ve,c[2]=ye,c[3]=be,c[4]=we,c[5]=_e,c[6]=ke,c[7]=Ce,c[8]=Se,c[9]=Be,c[10]=Ee,c[11]=xe,c[12]=Ie,c[13]=Ae,c[14]=Pe,c[15]=Te,c[16]=Re,c[17]=Me,c[18]=De,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=f),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var a=o;o=0;for(var s=67108863&n,c=Math.min(i,t.length-1),u=Math.max(0,i-e.length+1);u<=c;u++){var l=i-u,d=(0|e.words[l])*(0|t.words[u]),f=67108863&d;s=67108863&(f=f+s|0),o+=(a=(a=a+(d/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}r.words[i]=s,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,o=0;o<t;o++)n|=(1&e)<<t-o-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a<i;a++)n[a]=t[e[a]],o[a]=r[e[a]]},m.prototype.transform=function(e,t,r,n,o,i){this.permute(i,e,t,r,n,o);for(var a=1;a<o;a<<=1)for(var s=a<<1,c=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),l=0;l<o;l+=s)for(var d=c,f=u,h=0;h<a;h++){var p=r[l+h],m=n[l+h],g=r[l+h+a],v=n[l+h+a],y=d*g-f*v;v=d*v+f*g,g=y,r[l+h]=p+g,n[l+h]=m+v,r[l+h+a]=p-g,n[l+h+a]=m-v,h!==s&&(y=c*d-u*f,f=c*f+u*d,d=y)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,o=0;for(r=r/2|0;r;r>>>=1)o++;return 1<<o+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var o=e[n];e[n]=e[r-n-1],e[r-n-1]=o,o=t[n],t[n]=-t[r-n-1],t[r-n-1]=-o}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var o=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&o,r=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function(e,t,n,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],n[2*a]=8191&i,i>>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)n[a]=0;r(0===i),r(0==(-8192&i))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(n),i=this.stub(n),a=new Array(n),s=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,u,n),this.transform(a,i,s,c,n,o),this.transform(u,i,l,d,n,o);for(var h=0;h<n;h++){var p=s[h]*l[h]-c[h]*d[h];c[h]=s[h]*d[h]+c[h]*l[h],s[h]=p}return this.conjugate(s,c,n),this.transform(s,c,f,i,n,o),this.conjugate(f,i,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),p(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,i=(67108863&o)+(67108863&t);t>>=26,t+=o/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,o=r%26;t[r]=(e.words[n]&1<<o)>>>o}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,c=(0|this.words[t])-s<<n;this.words[t]=c|a,a=s>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this.strip()},o.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,n){var o;r("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,c=n;if(o-=a,o=Math.max(0,o),c){for(var u=0;u<a;u++)c.words[u]=this.words[u];c.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=o);u--){var d=0|this.words[u];this.words[u]=l<<26-i|d>>>i,l=d&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<<t;return!(this.length<=n||!(this.words[n]&o))},o.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,n){var o,i,a=e.length+n;this._expand(a);var s=0;for(o=0;o<e.length;o++){i=(0|this.words[o+n])+s;var c=(0|e.words[o])*t;s=((i-=67108863&c)>>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)s=(i=(0|this.words[o+n])+s)>>26,this.words[o+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,o=0;o<this.length;o++)s=(i=-(0|this.words[o])+s)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,c=n.length-i.length;if("mod"!==t){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,s&&(s.words[c]=1));for(var d=c-1;d>=0;d--){var f=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(f=Math.min(f/a|0,67108863),n._ishlnsubmul(i,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=f)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(t*n+(0|this.words[o]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*t;this.words[n]=o/e|0,t=o%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(c)):(n.isub(t),s.isub(i),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,f=1;0==(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,a=n;0!==i&&a<this.length;a++){var s=0|this.words[a];i=(s+=i)>>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new k(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function C(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(y,v),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&r)<<4|i>>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(b,v),n(w,v),n(_,v),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},k.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g<p);var v=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(v),d=v.redSqr(),h=h.redMul(d),p=g}return f},k.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},k.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var d=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===n&&0===l)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}c=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new C(e)},n(C,k),C.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},C.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},C.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},C.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},C.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,fL)})),gL=vL;function vL(e,t){if(!e)throw new Error(t||"Assertion failed")}vL.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var yL,bL=hL((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),i=o>>8,a=255&o;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}})),wL=hL((function(e,t){var r=t;r.assert=gL,r.toArray=bL.toArray,r.zero2=bL.zero2,r.toHex=bL.toHex,r.encode=bL.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var o=1<<t+1,i=e.clone(),a=0;a<n.length;a++){var s,c=i.andln(o-1);i.isOdd()?(s=c>(o>>1)-1?(o>>1)-c:c,i.isubn(s)):s=0,n[a]=s,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,s,c=e.andln(3)+o&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!=(n=e.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!=(n=t.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*o===a+1&&(o=1-o),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new mL(e,"hex","le")}})),_L=function(e){return yL||(yL=new kL(null)),yL.generate(e)};function kL(e){this.rand=e}var CL=kL;if(kL.prototype.generate=function(e){return this._rand(e)},kL.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==("undefined"==typeof self?"undefined":SP(self)))self.crypto&&self.crypto.getRandomValues?kL.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?kL.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==("undefined"==typeof window?"undefined":SP(window))&&(kL.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var SL=pL;if("function"!=typeof SL.randomBytes)throw new Error("Not supported");kL.prototype._rand=function(e){return SL.randomBytes(e)}}catch(_I){}_L.Rand=CL;var BL=wL.getNAF,EL=wL.getJSF,xL=wL.assert;function IL(e,t){this.type=e,this.p=new mL(t.p,16),this.red=t.prime?mL.red(t.prime):mL.mont(this.p),this.zero=new mL(0).toRed(this.red),this.one=new mL(1).toRed(this.red),this.two=new mL(2).toRed(this.red),this.n=t.n&&new mL(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var AL=IL;function PL(e,t){this.curve=e,this.type=t,this.precomputed=null}IL.prototype.point=function(){throw new Error("Not implemented")},IL.prototype.validate=function(){throw new Error("Not implemented")},IL.prototype._fixedNafMul=function(e,t){xL(e.precomputed);var r=e._getDoubles(),n=BL(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var i,a,s=[];for(i=0;i<n.length;i+=r.step){a=0;for(var c=i+r.step-1;c>=i;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=o;d>0;d--){for(i=0;i<s.length;i++)(a=s[i])===d?l=l.mixedAdd(r.points[i]):a===-d&&(l=l.mixedAdd(r.points[i].neg()));u=u.add(l)}return u.toP()},IL.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,i=BL(t,r,this._bitLength),a=this.jpoint(null,null,null),s=i.length-1;s>=0;s--){for(var c=0;s>=0&&0===i[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=i[s];xL(0!==u),a="affine"===e.type?u>0?a.mixedAdd(o[u-1>>1]):a.mixedAdd(o[-u-1>>1].neg()):u>0?a.add(o[u-1>>1]):a.add(o[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},IL.prototype._wnafMulAdd=function(e,t,r,n,o){var i,a,s,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,d=0;for(i=0;i<n;i++){var f=(s=t[i])._getNAFPoints(e);c[i]=f.wnd,u[i]=f.points}for(i=n-1;i>=1;i-=2){var h=i-1,p=i;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=EL(r[h],r[p]);for(d=Math.max(v[0].length,d),l[h]=new Array(d),l[p]=new Array(d),a=0;a<d;a++){var y=0|v[0][a],b=0|v[1][a];l[h][a]=g[3*(y+1)+(b+1)],l[p][a]=0,u[h]=m}}else l[h]=BL(r[h],c[h],this._bitLength),l[p]=BL(r[p],c[p],this._bitLength),d=Math.max(l[h].length,d),d=Math.max(l[p].length,d)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(i=d;i>=0;i--){for(var k=0;i>=0;){var C=!0;for(a=0;a<n;a++)_[a]=0|l[a][i],0!==_[a]&&(C=!1);if(!C)break;k++,i--}if(i>=0&&k++,w=w.dblp(k),i<0)break;for(a=0;a<n;a++){var S=_[a];0!==S&&(S>0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(i=0;i<n;i++)u[i]=null;return o?w:w.toP()},IL.BasePoint=PL,PL.prototype.eq=function(){throw new Error("Not implemented")},PL.prototype.validate=function(){return this.curve.validate(this)},IL.prototype.decodePoint=function(e,t){e=wL.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?xL(e[e.length-1]%2==0):7===e[0]&&xL(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},PL.prototype.encodeCompressed=function(e){return this.encode(e,!0)},PL.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},PL.prototype.encode=function(e,t){return wL.encode(this._encode(t),e)},PL.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},PL.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},PL.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},PL.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},PL.prototype._getBeta=function(){return null},PL.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var TL=hL((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}}})),RL=wL.assert;function ML(e){AL.call(this,"short",e),this.a=new mL(e.a,16).toRed(this.red),this.b=new mL(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}TL(ML,AL);var DL=ML;function LL(e,t,r,n){AL.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new mL(t,16),this.y=new mL(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function OL(e,t,r,n){AL.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new mL(0)):(this.x=new mL(t,16),this.y=new mL(r,16),this.z=new mL(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function NL(e){AL.call(this,"mont",e),this.a=new mL(e.a,16).toRed(this.red),this.b=new mL(e.b,16).toRed(this.red),this.i4=new mL(4).toRed(this.red).redInvm(),this.two=new mL(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}ML.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new mL(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new mL(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],RL(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new mL(e.a,16),b:new mL(e.b,16)}})):this._getEndoBasis(r)}}},ML.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:mL.mont(e),r=new mL(2).toRed(t).redInvm(),n=r.redNeg(),o=new mL(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},ML.prototype._getEndoBasis=function(e){for(var t,r,n,o,i,a,s,c,u,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,f=this.n.clone(),h=new mL(1),p=new mL(0),m=new mL(0),g=new mL(1),v=0;0!==d.cmpn(0);){var y=f.div(d);c=f.sub(y.mul(d)),u=m.sub(y.mul(h));var b=g.sub(y.mul(p));if(!n&&c.cmp(l)<0)t=s.neg(),r=h,n=c.neg(),o=u;else if(n&&2==++v)break;s=c,f=d,d=c,m=h,h=u,g=p,p=b}i=c.neg(),a=u;var w=n.sqr().add(o.sqr());return i.sqr().add(a.sqr()).cmp(w)>=0&&(i=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),i.negative&&(i=i.neg(),a=a.neg()),[{a:n,b:o},{a:i,b:a}]},ML.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),a=o.mul(r.a),s=i.mul(n.a),c=o.mul(r.b),u=i.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},ML.prototype.pointFromX=function(e,t){(e=new mL(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},ML.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},ML.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var a=this._endoSplit(t[i]),s=e[i],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),n[2*i]=s,n[2*i+1]=c,o[2*i]=a.k1,o[2*i+1]=a.k2}for(var u=this._wnafMulAdd(1,n,o,2*i,r),l=0;l<2*i;l++)n[l]=null,o[l]=null;return u},TL(LL,AL.BasePoint),ML.prototype.point=function(e,t,r){return new LL(this,e,t,r)},ML.prototype.pointFromJSON=function(e,t){return LL.fromJSON(this,e,t)},LL.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},LL.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},LL.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},LL.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},LL.prototype.isInfinity=function(){return this.inf},LL.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},LL.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},LL.prototype.getX=function(){return this.x.fromRed()},LL.prototype.getY=function(){return this.y.fromRed()},LL.prototype.mul=function(e){return e=new mL(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},LL.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},LL.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},LL.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},LL.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},LL.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},TL(OL,AL.BasePoint),ML.prototype.jpoint=function(e,t,r){return new OL(this,e,t,r)},OL.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},OL.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},OL.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(o),c=i.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),d=n.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(i.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(f,h,p)},OL.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=o.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(l).redISub(l),f=s.redMul(l.redISub(d)).redISub(o.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,f,h)},OL.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),u=a.redAdd(a);for(t=0;t<e;t++){var l=i.redSqr(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=i.redMul(d),m=h.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),v=h.redMul(g);v=v.redIAdd(v).redISub(f);var y=u.redMul(s);t+1<e&&(c=c.redMul(f)),i=m,s=y,u=v}return this.curve.jpoint(i,u.redMul(o),s)},OL.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},OL.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),c=s.redSqr().redISub(a).redISub(a),u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=s.redMul(a.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=f.redIAdd(f);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},OL.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);e=c;var u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),t=s.redMul(a.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),m=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=h.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},OL.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=t.redSqr(),a=r.redSqr(),s=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(a),l=s.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),f=a.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=s.redMul(d).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},OL.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(i)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=o.redIAdd(a).redSqr().redISub(i).redISub(s).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(s).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(a.redMul(s)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(d,f,h)},OL.prototype.mul=function(e,t){return e=new mL(e,t),this.curve._wnafMul(this,e)},OL.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},OL.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},OL.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},OL.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},TL(NL,AL);var FL=NL;function VL(e,t,r){AL.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new mL(t,16),this.z=new mL(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}NL.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},TL(VL,AL.BasePoint),NL.prototype.decodePoint=function(e,t){return this.point(wL.toArray(e,t),1)},NL.prototype.point=function(e,t){return new VL(this,e,t)},NL.prototype.pointFromJSON=function(e){return VL.fromJSON(this,e)},VL.prototype.precompute=function(){},VL.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},VL.fromJSON=function(e,t){return new VL(e,t[0],t[1]||e.one)},VL.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},VL.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},VL.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),o=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,o)},VL.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},VL.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(r),a=o.redMul(n),s=t.z.redMul(i.redAdd(a).redSqr()),c=t.x.redMul(i.redISub(a).redSqr());return this.curve.point(s,c)},VL.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var i=o.length-1;i>=0;i--)0===o[i]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},VL.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},VL.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},VL.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},VL.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},VL.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var jL=wL.assert;function UL(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,AL.call(this,"edwards",e),this.a=new mL(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new mL(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new mL(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),jL(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}TL(UL,AL);var zL=UL;function qL(e,t,r,n,o){AL.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new mL(t,16),this.y=new mL(r,16),this.z=n?new mL(n,16):this.curve.one,this.t=o&&new mL(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}UL.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},UL.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},UL.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},UL.prototype.pointFromX=function(e,t){(e=new mL(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),i=n.redMul(o.redInvm()),a=i.redSqrt();if(0!==a.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},UL.prototype.pointFromY=function(e,t){(e=new mL(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),i=n.redMul(o.redInvm());if(0===i.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=i.redSqrt();if(0!==a.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},UL.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(o)},TL(qL,AL.BasePoint),UL.prototype.pointFromJSON=function(e){return qL.fromJSON(this,e)},UL.prototype.point=function(e,t,r,n){return new qL(this,e,t,r,n)},qL.fromJSON=function(e,t){return new qL(e,t[0],t[1],t[2])},qL.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},qL.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},qL.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=n.redAdd(t),a=i.redSub(r),s=n.redSub(t),c=o.redMul(a),u=i.redMul(s),l=o.redMul(s),d=a.redMul(i);return this.curve.point(c,u,d,l)},qL.prototype._projDbl=function(){var e,t,r,n,o,i,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(o=this.z.redSqr(),i=u.redSub(o).redISub(o),e=a.redSub(s).redISub(c).redMul(i),t=u.redMul(n.redSub(c)),r=u.redMul(i))}else n=s.redAdd(c),o=this.curve._mulC(this.z).redSqr(),i=n.redSub(o).redSub(o),e=this.curve._mulC(a.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(i);return this.curve.point(e,t,r)},qL.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},qL.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),a=o.redSub(n),s=o.redAdd(n),c=r.redAdd(t),u=i.redMul(a),l=s.redMul(c),d=i.redMul(c),f=a.redMul(s);return this.curve.point(u,l,f,d)},qL.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),o=n.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(i).redMul(a),c=o.redSub(s),u=o.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),d=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(i))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(i)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},qL.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},qL.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},qL.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},qL.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},qL.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},qL.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},qL.prototype.getX=function(){return this.normalize(),this.x.fromRed()},qL.prototype.getY=function(){return this.normalize(),this.y.fromRed()},qL.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},qL.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},qL.prototype.toP=qL.prototype.normalize,qL.prototype.mixedAdd=qL.prototype.add;var WL=hL((function(e,t){var r=t;r.base=AL,r.short=DL,r.mont=FL,r.edwards=zL}));function HL(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function KL(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function QL(e){return 1===e.length?"0"+e:e}function GL(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var XL={inherits:TL,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var i=e.charCodeAt(o);i<128?r[n++]=i:i<2048?(r[n++]=i>>6|192,r[n++]=63&i|128):HL(e,o)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++o)),r[n++]=i>>18|240,r[n++]=i>>12&63|128,r[n++]=i>>6&63|128,r[n++]=63&i|128):(r[n++]=i>>12|224,r[n++]=i>>6&63|128,r[n++]=63&i|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},toHex:function(e){for(var t="",r=0;r<e.length;r++)t+=QL(e[r].toString(16));return t},htonl:KL,toHex32:function(e,t){for(var r="",n=0;n<e.length;n++){var o=e[n];"little"===t&&(o=KL(o)),r+=GL(o.toString(16))}return r},zero2:QL,zero8:GL,join32:function(e,t,r,n){var o=r-t;gL(o%4==0);for(var i=new Array(o/4),a=0,s=t;a<i.length;a++,s+=4){var c;c="big"===n?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],i[a]=c>>>0}return i},split32:function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n<e.length;n++,o+=4){var i=e[n];"big"===t?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,o){return e+t+r+n+o>>>0},sum64:function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,a=(i<n?1:0)+r+o;e[t]=a>>>0,e[t+1]=i},sum64_hi:function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,o,i,a,s){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+i>>>0)<i?1:0,e+r+o+a+(c+=(u=u+s>>>0)<s?1:0)>>>0},sum64_4_lo:function(e,t,r,n,o,i,a,s){return t+n+i+s>>>0},sum64_5_hi:function(e,t,r,n,o,i,a,s,c,u){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+i>>>0)<i?1:0,l+=(d=d+s>>>0)<s?1:0,e+r+o+a+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},sum64_5_lo:function(e,t,r,n,o,i,a,s,c,u){return t+n+i+s+u>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function YL(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var $L=YL;YL.prototype.update=function(e,t){if(e=XL.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=XL.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},YL.prototype.digest=function(e){return this.update(this._pad()),gL(null===this.pending),this._digest(e)},YL.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n};var ZL={BlockHash:$L},JL=XL.rotr32;function eO(e,t,r){return e&t^~e&r}function tO(e,t,r){return e&t^e&r^t&r}var rO=eO,nO=tO,oO=XL.rotl32,iO=XL.sum32,aO=XL.sum32_5,sO=function(e,t,r,n){return 0===e?eO(t,r,n):1===e||3===e?function(e,t,r){return e^t^r}(t,r,n):2===e?tO(t,r,n):void 0},cO=ZL.BlockHash,uO=[1518500249,1859775393,2400959708,3395469782];function lO(){if(!(this instanceof lO))return new lO;cO.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}XL.inherits(lO,cO);var dO=lO;lO.blockSize=512,lO.outSize=160,lO.hmacStrength=80,lO.padLength=64,lO.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=oO(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],c=this.h[4];for(n=0;n<r.length;n++){var u=~~(n/20),l=aO(oO(o,5),sO(u,i,a,s),c,r[n],uO[u]);c=s,s=a,a=oO(i,30),i=o,o=l}this.h[0]=iO(this.h[0],o),this.h[1]=iO(this.h[1],i),this.h[2]=iO(this.h[2],a),this.h[3]=iO(this.h[3],s),this.h[4]=iO(this.h[4],c)},lO.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h,"big"):XL.split32(this.h,"big")};var fO=XL.sum32,hO=XL.sum32_4,pO=XL.sum32_5,mO=rO,gO=nO,vO=function(e){return JL(e,2)^JL(e,13)^JL(e,22)},yO=function(e){return JL(e,6)^JL(e,11)^JL(e,25)},bO=function(e){return JL(e,7)^JL(e,18)^e>>>3},wO=function(e){return JL(e,17)^JL(e,19)^e>>>10},_O=ZL.BlockHash,kO=[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];function CO(){if(!(this instanceof CO))return new CO;_O.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=kO,this.W=new Array(64)}XL.inherits(CO,_O);var SO=CO;function BO(){if(!(this instanceof BO))return new BO;SO.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}CO.blockSize=512,CO.outSize=256,CO.hmacStrength=192,CO.padLength=64,CO.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=hO(wO(r[n-2]),r[n-7],bO(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],c=this.h[4],u=this.h[5],l=this.h[6],d=this.h[7];for(gL(this.k.length===r.length),n=0;n<r.length;n++){var f=pO(d,yO(c),mO(c,u,l),this.k[n],r[n]),h=fO(vO(o),gO(o,i,a));d=l,l=u,u=c,c=fO(s,f),s=a,a=i,i=o,o=fO(f,h)}this.h[0]=fO(this.h[0],o),this.h[1]=fO(this.h[1],i),this.h[2]=fO(this.h[2],a),this.h[3]=fO(this.h[3],s),this.h[4]=fO(this.h[4],c),this.h[5]=fO(this.h[5],u),this.h[6]=fO(this.h[6],l),this.h[7]=fO(this.h[7],d)},CO.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h,"big"):XL.split32(this.h,"big")},XL.inherits(BO,SO);var EO=BO;BO.blockSize=512,BO.outSize=224,BO.hmacStrength=192,BO.padLength=64,BO.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h.slice(0,7),"big"):XL.split32(this.h.slice(0,7),"big")};var xO=XL.rotr64_hi,IO=XL.rotr64_lo,AO=XL.shr64_hi,PO=XL.shr64_lo,TO=XL.sum64,RO=XL.sum64_hi,MO=XL.sum64_lo,DO=XL.sum64_4_hi,LO=XL.sum64_4_lo,OO=XL.sum64_5_hi,NO=XL.sum64_5_lo,FO=ZL.BlockHash,VO=[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];function jO(){if(!(this instanceof jO))return new jO;FO.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=VO,this.W=new Array(160)}XL.inherits(jO,FO);var UO=jO;function zO(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function qO(e,t,r,n,o,i){var a=t&n^~t&i;return a<0&&(a+=4294967296),a}function WO(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function HO(e,t,r,n,o,i){var a=t&n^t&i^n&i;return a<0&&(a+=4294967296),a}function KO(e,t){var r=xO(e,t,28)^xO(t,e,2)^xO(t,e,7);return r<0&&(r+=4294967296),r}function QO(e,t){var r=IO(e,t,28)^IO(t,e,2)^IO(t,e,7);return r<0&&(r+=4294967296),r}function GO(e,t){var r=xO(e,t,14)^xO(e,t,18)^xO(t,e,9);return r<0&&(r+=4294967296),r}function XO(e,t){var r=IO(e,t,14)^IO(e,t,18)^IO(t,e,9);return r<0&&(r+=4294967296),r}function YO(e,t){var r=xO(e,t,1)^xO(e,t,8)^AO(e,t,7);return r<0&&(r+=4294967296),r}function $O(e,t){var r=IO(e,t,1)^IO(e,t,8)^PO(e,t,7);return r<0&&(r+=4294967296),r}function ZO(e,t){var r=xO(e,t,19)^xO(t,e,29)^AO(e,t,6);return r<0&&(r+=4294967296),r}function JO(e,t){var r=IO(e,t,19)^IO(t,e,29)^PO(e,t,6);return r<0&&(r+=4294967296),r}function eN(){if(!(this instanceof eN))return new eN;UO.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}jO.blockSize=1024,jO.outSize=512,jO.hmacStrength=192,jO.padLength=128,jO.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var o=ZO(r[n-4],r[n-3]),i=JO(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],c=YO(r[n-30],r[n-29]),u=$O(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=DO(o,i,a,s,c,u,l,d),r[n+1]=LO(o,i,a,s,c,u,l,d)}},jO.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],o=this.h[1],i=this.h[2],a=this.h[3],s=this.h[4],c=this.h[5],u=this.h[6],l=this.h[7],d=this.h[8],f=this.h[9],h=this.h[10],p=this.h[11],m=this.h[12],g=this.h[13],v=this.h[14],y=this.h[15];gL(this.k.length===r.length);for(var b=0;b<r.length;b+=2){var w=v,_=y,k=GO(d,f),C=XO(d,f),S=zO(d,0,h,0,m),B=qO(0,f,0,p,0,g),E=this.k[b],x=this.k[b+1],I=r[b],A=r[b+1],P=OO(w,_,k,C,S,B,E,x,I,A),T=NO(w,_,k,C,S,B,E,x,I,A);w=KO(n,o),_=QO(n,o),k=WO(n,0,i,0,s),C=HO(0,o,0,a,0,c);var R=RO(w,_,k,C),M=MO(w,_,k,C);v=m,y=g,m=h,g=p,h=d,p=f,d=RO(u,l,P,T),f=MO(l,l,P,T),u=s,l=c,s=i,c=a,i=n,a=o,n=RO(P,T,R,M),o=MO(P,T,R,M)}TO(this.h,0,n,o),TO(this.h,2,i,a),TO(this.h,4,s,c),TO(this.h,6,u,l),TO(this.h,8,d,f),TO(this.h,10,h,p),TO(this.h,12,m,g),TO(this.h,14,v,y)},jO.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h,"big"):XL.split32(this.h,"big")},XL.inherits(eN,UO);var tN=eN;eN.blockSize=1024,eN.outSize=384,eN.hmacStrength=192,eN.padLength=128,eN.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h.slice(0,12),"big"):XL.split32(this.h.slice(0,12),"big")};var rN={sha1:dO,sha224:EO,sha256:SO,sha384:tN,sha512:UO},nN=XL.rotl32,oN=XL.sum32,iN=XL.sum32_3,aN=XL.sum32_4,sN=ZL.BlockHash;function cN(){if(!(this instanceof cN))return new cN;sN.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}XL.inherits(cN,sN);var uN=cN;function lN(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function dN(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function fN(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}cN.blockSize=512,cN.outSize=160,cN.hmacStrength=192,cN.padLength=64,cN.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],o=this.h[2],i=this.h[3],a=this.h[4],s=r,c=n,u=o,l=i,d=a,f=0;f<80;f++){var h=oN(nN(aN(r,lN(f,n,o,i),e[hN[f]+t],dN(f)),mN[f]),a);r=a,a=i,i=nN(o,10),o=n,n=h,h=oN(nN(aN(s,lN(79-f,c,u,l),e[pN[f]+t],fN(f)),gN[f]),d),s=d,d=l,l=nN(u,10),u=c,c=h}h=iN(this.h[1],o,l),this.h[1]=iN(this.h[2],i,d),this.h[2]=iN(this.h[3],a,s),this.h[3]=iN(this.h[4],r,c),this.h[4]=iN(this.h[0],n,u),this.h[0]=h},cN.prototype._digest=function(e){return"hex"===e?XL.toHex32(this.h,"little"):XL.split32(this.h,"little")};var hN=[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],pN=[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],mN=[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],gN=[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],vN={ripemd160:uN};function yN(e,t,r){if(!(this instanceof yN))return new yN(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(XL.toArray(t,r))}var bN=yN;yN.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),gL(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},yN.prototype.update=function(e,t){return this.inner.update(e,t),this},yN.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var wN=hL((function(e,t){var r=t;r.utils=XL,r.common=ZL,r.sha=rN,r.ripemd=vN,r.hmac=bN,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160})),_N={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},kN=hL((function(e,t){var r,n=t,o=wL.assert;function i(e){"short"===e.type?this.curve=new WL.short(e):"edwards"===e.type?this.curve=new WL.edwards(e):this.curve=new WL.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:wN.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:wN.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:wN.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:wN.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:wN.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:wN.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:wN.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=_N}catch(e){r=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:wN.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function CN(e){if(!(this instanceof CN))return new CN(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=bL.toArray(e.entropy,e.entropyEnc||"hex"),r=bL.toArray(e.nonce,e.nonceEnc||"hex"),n=bL.toArray(e.pers,e.persEnc||"hex");gL(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var SN=CN;CN.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},CN.prototype._hmac=function(){return new wN.hmac(this.hash,this.K)},CN.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},CN.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=bL.toArray(e,t),r=bL.toArray(r,n),gL(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},CN.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=bL.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var i=o.slice(0,e);return this._update(r),this._reseed++,bL.encode(i,t)};var BN=wL.assert;function EN(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var xN=EN;EN.fromPublic=function(e,t,r){return t instanceof EN?t:new EN(e,{pub:t,pubEnc:r})},EN.fromPrivate=function(e,t,r){return t instanceof EN?t:new EN(e,{priv:t,privEnc:r})},EN.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},EN.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},EN.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},EN.prototype._importPrivate=function(e,t){this.priv=new mL(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},EN.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?BN(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||BN(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},EN.prototype.derive=function(e){return e.validate()||BN(e.validate(),"public point not validated"),e.mul(this.priv).getX()},EN.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},EN.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},EN.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var IN=wL.assert;function AN(e,t){if(e instanceof AN)return e;this._importDER(e,t)||(IN(e.r&&e.s,"Signature without r or s"),this.r=new mL(e.r,16),this.s=new mL(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var PN=AN;function TN(){this.place=0}function RN(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,a=t.place;i<n;i++,a++)o<<=8,o|=e[a],o>>>=0;return!(o<=127)&&(t.place=a,o)}function MN(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function DN(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}AN.prototype._importDER=function(e,t){e=wL.toArray(e,t);var r=new TN;if(48!==e[r.place++])return!1;var n=RN(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=RN(e,r);if(!1===o)return!1;var i=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var a=RN(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new mL(i),this.s=new mL(s),this.recoveryParam=null,!0},AN.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=MN(t),r=MN(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];DN(n,t.length),(n=n.concat(t)).push(2),DN(n,r.length);var o=n.concat(r),i=[48];return DN(i,o.length),i=i.concat(o),wL.encode(i,e)};var LN=wL.assert;function ON(e){if(!(this instanceof ON))return new ON(e);"string"==typeof e&&(LN(Object.prototype.hasOwnProperty.call(kN,e),"Unknown curve "+e),e=kN[e]),e instanceof kN.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var NN=ON;ON.prototype.keyPair=function(e){return new xN(this,e)},ON.prototype.keyFromPrivate=function(e,t){return xN.fromPrivate(this,e,t)},ON.prototype.keyFromPublic=function(e,t){return xN.fromPublic(this,e,t)},ON.prototype.genKeyPair=function(e){e||(e={});for(var t=new SN({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||_L(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new mL(2));;){var o=new mL(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},ON.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},ON.prototype.sign=function(e,t,r,n){"object"==SP(r)&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new mL(e,16));for(var o=this.n.byteLength(),i=t.getPrivate().toArray("be",o),a=e.toArray("be",o),s=new SN({hash:this.hash,entropy:i,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new mL(1)),u=0;;u++){var l=n.k?n.k(u):new mL(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var d=this.g.mul(l);if(!d.isInfinity()){var f=d.getX(),h=f.umod(this.n);if(0!==h.cmpn(0)){var p=l.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==f.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new PN({r:h,s:p,recoveryParam:m})}}}}}},ON.prototype.verify=function(e,t,r,n){e=this._truncateToN(new mL(e,16)),r=this.keyFromPublic(r,n);var o=(t=new PN(t,"hex")).r,i=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var a,s=i.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},ON.prototype.recoverPubKey=function(e,t,r,n){LN((3&r)===r,"The recovery param is more than two bits"),t=new PN(t,n);var o=this.n,i=new mL(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var l=t.r.invm(o),d=o.sub(i).mul(l).umod(o),f=s.mul(l).umod(o);return this.g.mulAdd(d,a,f)},ON.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new PN(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var FN=wL.assert,VN=wL.parseBytes,jN=wL.cachedProperty;function UN(e,t){this.eddsa=e,this._secret=VN(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=VN(t.pub)}UN.fromPublic=function(e,t){return t instanceof UN?t:new UN(e,{pub:t})},UN.fromSecret=function(e,t){return t instanceof UN?t:new UN(e,{secret:t})},UN.prototype.secret=function(){return this._secret},jN(UN,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),jN(UN,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),jN(UN,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),jN(UN,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),jN(UN,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),jN(UN,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),UN.prototype.sign=function(e){return FN(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},UN.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},UN.prototype.getSecret=function(e){return FN(this._secret,"KeyPair is public only"),wL.encode(this.secret(),e)},UN.prototype.getPublic=function(e){return wL.encode(this.pubBytes(),e)};var zN=UN,qN=wL.assert,WN=wL.cachedProperty,HN=wL.parseBytes;function KN(e,t){this.eddsa=e,"object"!=SP(t)&&(t=HN(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),qN(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof mL&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}WN(KN,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),WN(KN,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),WN(KN,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),WN(KN,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),KN.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},KN.prototype.toHex=function(){return wL.encode(this.toBytes(),"hex").toUpperCase()};var QN=KN,GN=wL.assert,XN=wL.parseBytes;function YN(e){if(GN("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof YN))return new YN(e);e=kN[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=wN.sha512}var $N=YN;YN.prototype.sign=function(e,t){e=XN(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),o=this.g.mul(n),i=this.encodePoint(o),a=this.hashInt(i,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:s,Rencoded:i})},YN.prototype.verify=function(e,t,r){e=XN(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),n.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(n.pub().mul(o)).eq(i)},YN.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return wL.intFromLE(e.digest()).umod(this.curve.n)},YN.prototype.keyFromPublic=function(e){return zN.fromPublic(this,e)},YN.prototype.keyFromSecret=function(e){return zN.fromSecret(this,e)},YN.prototype.makeSignature=function(e){return e instanceof QN?e:new QN(this,e)},YN.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},YN.prototype.decodePoint=function(e){var t=(e=wL.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),o=wL.intFromLE(r);return this.curve.pointFromY(o,n)},YN.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},YN.prototype.decodeInt=function(e){return wL.intFromLE(e)},YN.prototype.isPoint=function(e){return e instanceof this.pointClass};var ZN=hL((function(e,t){var r=t;r.version="6.5.4",r.utils=wL,r.rand=_L,r.curve=WL,r.curves=kN,r.ec=NN,r.eddsa=$N}));function JN(e,t){var r=tF();return(JN=function(e,t){return r[e-=312]})(e,t)}var eF=JN;function tF(){var e=["92mZhTFU","3d02010608","ssRdXLZEX8","6887UKyrmr","7433076mDDyYZ","000","KoZIzj0DAQ","0301070342","Mjci1ul8mm","072a8648ce","ZIzj0CAQYI","3059301306","4215408xtrKqx","14522016QCDTgd","+faHkP3QC3","2a8648ce3d","DepBO8t60S","MfPrcYTM70","3173228IhaAyQ","1010664CbFTIv","44P0rKKsZK","879130oVflWy","KA=="];return(tF=function(){return e})()}!function(e,t){for(var r=JN,n=tF();;)try{if(586751==parseInt(r(319))/1*(-parseInt(r(316))/2)+parseInt(r(312))/3+parseInt(r(334))/4+-parseInt(r(314))/5+parseInt(r(328))/6+parseInt(r(320))/7+-parseInt(r(329))/8)break;n.push(n.shift())}catch(e){n.push(n.shift())}}();var rF,nF=(rF=eF(327)+eF(325)+eF(317)+eF(331)+eF(323)+eF(321),uL("MFkwEwYHKo"+eF(326)+eF(322)+"cDQgAE9h6Z"+eF(332)+"ytJdcsPxrD"+eF(330)+eF(313)+eF(324)+"D9EKOWS+U4"+eF(333)+eF(318)+eF(315)).replace(rF,"")),oF=new ZN.ec("p256").keyFromPublic(nF,"hex");function iF(e,t){return aL(this,void 0,void 0,kP().mark((function r(){var n,o;return kP().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,function(e){return aL(this,void 0,void 0,kP().mark((function t(){var r,n;return kP().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(new TextEncoder).encode(e),t.next=3,crypto.subtle.digest("SHA-256",r);case 3:return n=t.sent,t.abrupt("return",Array.from(new Uint8Array(n)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""));case 5:case"end":return t.stop()}}),t)})))}(e);case 3:return n=r.sent,o=uL(t),r.abrupt("return",oF.verify(n,o));case 8:return r.prev=8,r.t0=r.catch(0),r.abrupt("return",(console.error(r.t0),!1));case 11:case"end":return r.stop()}}),r,null,[[0,8]])})))}function aF(e,t){return aL(this,void 0,void 0,kP().mark((function r(){var n,o,i,a;return kP().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,iF(e,t);case 2:if(r.sent){r.next=4;break}return r.abrupt("return",{isValid:!1,error:sL.invalid_signature});case 4:if("string"==typeof(n=JSON.parse(e)).app_id&&n.app_id===window.location.hostname){r.next=7;break}return r.abrupt("return",{isValid:!1,error:sL.invalid_app_id});case 7:return o=new Date,i=new Date(n.expired_at),a=new Date(n.created_at),r.abrupt("return","Invalid Date"===i.toString()||"Invalid Date"===a.toString()?{isValid:!1,error:sL.invalid_date}:o<=a||o>=i?{isValid:!1,error:sL.license_expired}:{isValid:!0,error:null});case 9:case"end":return r.stop()}}),r)})))}function sF(e,t){return aL(this,void 0,void 0,kP().mark((function r(){var n,o,i,a,s,c,u,l,d;return kP().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,iF(e,t);case 2:if(r.sent){r.next=4;break}return r.abrupt("return",{isValid:!1,error:sL.invalid_signature});case 4:if((n=JSON.parse(e)).url){r.next=7;break}return r.abrupt("return",{isValid:!1,error:sL.missing_url});case 7:return o=null,r.prev=8,r.next=11,fetch("".concat(n.url,"/v1/verify_license"),{method:"POST",body:JSON.stringify({license_id:n.id,app_id:window.location.hostname}),headers:{"Content-Type":"application/json"}});case 11:o=r.sent,r.next=17;break;case 14:r.prev=14,r.t0=r.catch(8),console.error(r.t0);case 17:if(null!==o){r.next=19;break}return r.abrupt("return",function(){return aL(this,void 0,void 0,kP().mark((function e(){var t,r,n,o;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(t=localStorage.getItem("tv:sdk-license"))){e.next=3;break}return e.abrupt("return",{isValid:!1,error:sL.invalid_license});case 3:return r=dL(t),n=r.license,o=r.signature,e.abrupt("return",aF(lL(uL(n)),o));case 5:case"end":return e.stop()}}),e)})))}());case 19:if(200===(i=o.status)){r.next=23;break}return a=i.toString(),r.abrupt("return",{isValid:!1,error:a in sL?sL[a]:sL.unknown});case 23:return r.next=25,o.json();case 25:if(s=r.sent,!(Array.isArray(s.errors)&&s.errors.length>0)){r.next=28;break}return r.abrupt("return",(console.error(s.errors[0]),{isValid:!1,error:sL.invalid_license}));case 28:return c=dL(s.data.license_key),u=c.license,l=c.signature,d=lL(uL(u)),r.next=31,iF(d,l);case 31:if(!r.sent){r.next=35;break}r.t1=(localStorage.setItem("tv:sdk-license",s.data.license_key),{isValid:!0,error:null}),r.next=36;break;case 35:r.t1={isValid:!1,error:sL.invalid_signature};case 36:return r.abrupt("return",r.t1);case 37:case"end":return r.stop()}}),r,null,[[8,14]])})))}function cF(e){return aL(this,void 0,void 0,kP().mark((function t(){var r,n,o,i,a;return kP().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e){t.next=3;break}return t.abrupt("return",{isValid:!1,error:sL.invalid_license});case 3:if(r=dL(e),n=r.mode,o=r.license,i=r.signature,a=lL(uL(o)),"offline"!==n){t.next=10;break}return t.next=7,aF(a,i);case 7:t.t0=t.sent,t.next=18;break;case 10:if("online"!==n){t.next=16;break}return t.next=13,sF(a,i);case 13:t.t1=t.sent,t.next=17;break;case 16:t.t1={isValid:!1,error:sL.invalid_license};case 17:t.t0=t.t1;case 18:return t.abrupt("return",t.t0);case 21:return t.prev=21,t.t2=t.catch(0),t.abrupt("return",(console.error(t.t2),{isValid:!1,error:sL.unknown}));case 24:case"end":return t.stop()}}),t,null,[[0,21]])})))}var uF=function(e,t,r){var n=null==e?void 0:cM(e,t);return void 0===n?r:n},lF=function(e,t){var r=uF(e,t),n=uF(e,t+"_web");return null!=n?n:r},dF=Object.freeze({__proto__:null,getWebSetting:lF}),fF=hv.createContext(!1),hF={invalid_license:"license_invalid",invalid_license_exception:"license_invalid",invalid_parameter_exception:"license_invalid",rate_limit_exception:"license_rate_limit_exceeded",internal_server_error:"license_internal_server_error",unknown_license_error:"license_unknown_error",invalid_app_id:"license_invalid",invalid_date:"license_invalid",license_expired:"license_invalid",invalid_signature:"license_invalid",missing_url:"license_invalid"},pF=function(e){var t=e.children,r=e.clientSettings,n=e.onError,o=RP(hv.useState(!1),2),i=o[0],a=o[1],s=!!r,c=s?lF(r,"data.settings.sdk_settings.license_settings.license_key"):null;return hv.useEffect((function(){s&&XD(void 0,void 0,void 0,kP().mark((function e(){var t;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,cF(c);case 2:t=e.sent,a(t.isValid),t.isValid||n(mP[hF[t.error]]);case 5:case"end":return e.stop()}}),e)})))}),[s,c,n]),i?hv.createElement(fF.Provider,{value:i},t):null},mF=Object.freeze({__proto__:null,LicenseProvider:pF,useLicenseVerifier:function(){return hv.useContext(fF)}});function gF(e){return new Promise((function(t){return setTimeout(t,e)}))}var vF=Object.freeze({__proto__:null,sleep:gF}),yF=Symbol("Comlink.proxy"),bF=Symbol("Comlink.endpoint"),wF=Symbol("Comlink.releaseProxy"),_F=Symbol("Comlink.thrown"),kF=function(e){return"object"==rg(e)&&null!==e||"function"==typeof e},CF=new Map([["proxy",{canHandle:function(e){return kF(e)&&e[yF]},serialize:function(e){var t=new MessageChannel,r=t.port1,n=t.port2;return SF(e,r),[n,[n]]},deserialize:function(e){return e.start(),EF(e)}}],["throw",{canHandle:function(e){return kF(e)&&_F 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 SF(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;t.addEventListener("message",(function r(n){if(n&&n.data){var o,i=Object.assign({path:[]},n.data),a=i.id,s=i.type,c=i.path,u=(n.data.argumentList||[]).map(RF);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]]=RF(n.data.value),o=!0;break;case"APPLY":o=d.apply(l,u);break;case"CONSTRUCT":o=function(e){return Object.assign(e,cg({},yF,!0))}(Ym(d,vg(u)));break;case"ENDPOINT":var f=new MessageChannel,h=f.port1,p=f.port2;SF(e,p),o=function(e,t){return PF.set(e,t),e}(h,[h]);break;case"RELEASE":o=void 0;break;default:return}}catch(e){o=cg({value:e},_F,0)}Promise.resolve(o).catch((function(e){return cg({value:e},_F,0)})).then((function(e){var n=gg(TF(e),2),o=n[0],i=n[1];t.postMessage(Object.assign(Object.assign({},o),{id:a}),i),"RELEASE"===s&&(t.removeEventListener("message",r),BF(t))}))}})),t.start&&t.start()}function BF(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function EF(e,t){return IF(e,[],t)}function xF(e){if(e)throw new Error("Proxy has been released and is not useable")}function IF(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=!1,o=new Proxy(r,{get:function(r,i){if(xF(n),i===wF)return function(){return MF(e,{type:"RELEASE",path:t.map((function(e){return e.toString()}))}).then((function(){BF(e),n=!0}))};if("then"===i){if(0===t.length)return{then:function(){return o}};var a=MF(e,{type:"GET",path:t.map((function(e){return e.toString()}))}).then(RF);return a.then.bind(a)}return IF(e,[].concat(vg(t),[i]))},set:function(r,o,i){xF(n);var a=gg(TF(i),2),s=a[0],c=a[1];return MF(e,{type:"SET",path:[].concat(vg(t),[o]).map((function(e){return e.toString()})),value:s},c).then(RF)},apply:function(r,o,i){xF(n);var a=t[t.length-1];if(a===bF)return MF(e,{type:"ENDPOINT"}).then(RF);if("bind"===a)return IF(e,t.slice(0,-1));var s=gg(AF(i),2),c=s[0],u=s[1];return MF(e,{type:"APPLY",path:t.map((function(e){return e.toString()})),argumentList:c},u).then(RF)},construct:function(r,o){xF(n);var i=gg(AF(o),2),a=i[0],s=i[1];return MF(e,{type:"CONSTRUCT",path:t.map((function(e){return e.toString()})),argumentList:a},s).then(RF)}});return o}function AF(e){var t,r=e.map(TF);return[r.map((function(e){return e[0]})),(t=r.map((function(e){return e[1]})),Array.prototype.concat.apply([],t))]}var PF=new WeakMap;function TF(e){var t,r=Cg(CF);try{for(r.s();!(t=r.n()).done;){var n=gg(t.value,2),o=n[0],i=n[1];if(i.canHandle(e)){var a=gg(i.serialize(e),2);return[{type:"HANDLER",name:o,value:a[0]},a[1]]}}}catch(e){r.e(e)}finally{r.f()}return[{type:"RAW",value:e},PF.get(e)||[]]}function RF(e){switch(e.type){case"HANDLER":return CF.get(e.name).deserialize(e.value);case"RAW":return e.value}}function MF(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 DF=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(),l(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:s,type:l,path:d}=Object.assign({path:[]},o.data),h=(o.data.argumentList||[]).map(g);let m;try{const r=d.slice(0,-1).reduce(((e,t)=>e[t]),t),n=d.reduce(((e,t)=>e[t]),t);switch(l){case"GET":m=n;break;case"SET":r[d.slice(-1)[0]]=g(o.data.value),m=!0;break;case"APPLY":m=n.apply(r,h);break;case"CONSTRUCT":m=function(t){return Object.assign(t,{[e]:!0})}(new n(...h));break;case"ENDPOINT":{const{port1:e,port2:r}=new MessageChannel;i(t,r),m=function(e,t){return u.set(e,t),e}(e,[e])}break;case"RELEASE":m=void 0;break;default:return}}catch(e){m={value:e,[n]:0}}Promise.resolve(m).catch((e=>({value:e,[n]:0}))).then((e=>{const[t,n]=_(e);r.postMessage(Object.assign(Object.assign({},t),{id:s}),n),"RELEASE"===l&&(r.removeEventListener("message",a),c(r))}))})),r.start&&r.start()}function c(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function s(e){if(e)throw new Error("Proxy has been released and is not useable")}function l(e,n=[],a=function(){}){let o=!1;const i=new Proxy(a,{get(t,a){if(s(o),a===r)return()=>h(e,{type:"RELEASE",path:n.map((e=>e.toString()))}).then((()=>{c(e),o=!0}));if("then"===a){if(0===n.length)return{then:()=>i};const t=h(e,{type:"GET",path:n.map((e=>e.toString()))}).then(g);return t.then.bind(t)}return l(e,[...n,a])},set(t,r,a){s(o);const[i,c]=_(a);return h(e,{type:"SET",path:[...n,r].map((e=>e.toString())),value:i},c).then(g)},apply(r,a,i){s(o);const c=n[n.length-1];if(c===t)return h(e,{type:"ENDPOINT"}).then(g);if("bind"===c)return l(e,n.slice(0,-1));const[u,_]=d(i);return h(e,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:u},_).then(g)},construct(t,r){s(o);const[a,i]=d(r);return h(e,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:a},i).then(g)}});return i}function d(e){const t=e.map(_);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const u=new WeakMap;function _(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},u.get(e)||[]]}function g(e){switch(e.type){case"HANDLER":return o.get(e.name).deserialize(e.value);case"RAW":return e.value}}function h(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 m=[[0,1,0],[1,-4,1],[0,1,0]];function f(e,t,r,n){return e[4*(r*t+n)]}function p(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function v(e,t,r){return(t=p(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){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,c=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){l=!0,a=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(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}const k="frontal",w="left",P="right",S="up",E="down";var L=0,M=1,C=2,A=0,R=1,O=2,V=function(e,t){var r=y(e,2),n=r[0],a=r[1],o=y(t,2),i=o[0],c=o[1];return n>c||i>a?A:n<=i&&c<=a?O:R};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),c=i[0],s=i[1],l=[a[0],o[0]],d=[a[1],o[1]],u=[c[0],s[0]],_=[c[1],s[1]],g=[l[0]+r,l[1]-r],h=[d[0]+r,d[1]-.8*r];return V(g,u)===O&&V(h,_)===O?C:V(l,u)===A||V(d,_)===A?L:M}const x=Object.assign(Object.assign({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."}},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."}},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"},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."}}},{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."}},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. Please try again.",vi:"Bạn cần quay CHẬM lại. Vui 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. Please try again.",vi:"Khuôn mặt không nằm trong khung hình. Xin 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. Please try again.",vi:"Bạn cần hoàn thành động tác theo chỉ dẫn trong <%= x %> giây. Xin vui lòng thử lại."}},liveness_blurry:{code:"liveness_blurry",msg:{en:"Image is too blurry. Please ensure your face is in focus.",vi:"Hình ảnh bị mờ. Vui lòng đảm bảo khuôn mặt của bạn rõ nét."}},card_sanity_not_good:{code:"card_sanity_not_good",msg:{en:"Card sanity not good",vi:"Card sanity chưa đạt"}},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"}},client_web_setting_not_found:{code:"client_web_setting_not_found",msg:"Client Web Setting Not Found"},id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Please capture the <%= side %> side of ID card (occupy 50-95% of the frame)",vi:"Vui lòng chụp mặt <%= side %> của giấy tờ (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 (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ lại GẦN hơn (chiếm 50-95% khung hình)"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please move ID card FARTHER (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ ra XA hơ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."}},close_eye:{code:"close_eye",msg:{vi:"Vui lòng mở to mắt",en:"Open your eyes clearly"}}}),{license_invalid:{code:"license_invalid",msg:{en:"Invalid license",vi:"License không hợp lệ"}},license_rate_limit_exceeded:{code:"license_rate_limit_exceeded",msg:{en:"Invalid license",vi:"Quá số lần thử"}},license_internal_server_error:{code:"license_internal_server_error",msg:{en:"Internal server error",vi:"Lỗi server"}},license_unknown_error:{code:"license_unknown_error",msg:{en:"Unknown error",vi:"Lỗi không xác định"}}});function I(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function T(e,t){return[e[0]-t[0],e[1]-t[1]]}function D(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,c=0,s=n-1,l=r-1,d=1;d<s;d++)for(var u=1;u<l;u++){var _=m[0][0]*f(t,r,u-1,d-1)+m[0][1]*f(t,r,u,d-1)+m[0][2]*f(t,r,u+1,d-1)+m[1][0]*f(t,r,u-1,d)+m[1][1]*f(t,r,u,d)+m[1][2]*f(t,r,u+1,d)+m[2][0]*f(t,r,u-1,d+1)+m[2][1]*f(t,r,u,d+1)+m[2][2]*f(t,r,u+1,d+1);(_=Math.abs(_))>25&&i++,_>15&&_<25&&c++}var g=0;return i+c!==0&&(g=i/(i+c)),g},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,c,s=y(e,4),l=s[0],d=s[1],u=s[2],_=s[3],g=T(d,l),h=I(g),m=(a=d,t=[(n=l)[0]+a[0],n[1]+a[1]],r=2,[t[0]/r,t[1]/r]),f=T(u,m),p=I(T(_,u)),v=T(_,m),b=I(v),k=(f[0]*v[0]+f[1]*v[1])/b,w=p/b;if(h>.5*b)o=(f[0]*g[0]+f[1]*g[1])/h/h;else{var P=I(T(f,function(e,t){return[e[0]*t,e[1]*t]}(v,k/b)));c=v,o=((i=f)[0]*c[1]-c[0]*i[1]>=0?1:-1)*P/h}return{left_right_score:o,up_down_score:w}}(t),i=o.left_right_score,c=o.up_down_score,s=y(t,3),l=s[0],d=s[1],u=s[2],_=d[0]-u[0],g=l[0]-u[0],h=r?.1:.3,m=c>a.upper,f=c<a.lower,p=i>=.35&&i<=.6,v=i<=-.35&&i>=-.6,b=m&&!v&&!p,L=f&&!v&&!p,M=v&&!m&&!f,C=p&&!m&&!f;return c>=a.lower&&c<=a.upper&&i>-h&&i<h&&_*g<0?{gesture:k,leftRightScore:i}:b?{gesture:S,leftRightScore:i}:L?{gesture:E,leftRightScore:i}:C?{gesture:P,leftRightScore:i}:M?{gesture:w,leftRightScore:i}:null},validatePredictionsFunc:function(e){var t,r,n,a,o,i,c,s,l,d,u,_,g,h,m,f,p,b,k,w,P,S,E,A,R,O,V,I,T,D,F,N,H=e.predictions,K=e.width,q=e.height,Y=e.cropAreaCoordinates,G=null!=Y?Y:[[0,0],[K,q]],U=H.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,c=n;if(!c){var s=y(r,2),l=s[0],d=s[1];c=(d[0]-l[0])*(d[1]-l[1])}var u=i;if(!u){var _=y(o,2),g=_[0],h=_[1];u=(h[0]-g[0])*(h[1]-g[1])}return c/u}({small:{coords:[r,n]},big:{coords:G}})<=.025?e[L].push(t):e[j(G,[r,n])].push(t);return e}),v(v(v({},M,[]),C,[]),L,[])),W=U[C].length,z=U[M].length;if(0===W)t=z>0?x.partial_face:x.no_face;else if(W+z>1)t=x.multiple_faces;else{var B=r=U[C][0],X=B.topLeft,Q=B.bottomRight;E=G,A=y([X,Q],2),R=A[0],O=A[1],V=y(E,2),I=V[0],T=V[1],D=O[0]-R[0],F=O[1]-R[1],N=T[0]-I[0],(n=D/N<F/N?D/N:F/N)<.4&&(t=x.face_too_small),n>.61&&(t=x.face_too_large),j(G,(a=r.landmarks,c=a[0],s=a[1],l=a[2],d=a[3],u=a[4],_=a[5],g=.5*(c[1]+s[1]),h=g+1.5*(g-d[1]),m=d[1]-1.2*(l[1]-d[1]),f=[c[0],s[0],l[0],d[0],u[0],_[0]],p=Math.min.apply(Math,f),b=Math.min(h,m),k=Math.max.apply(Math,f),w=Math.max(h,m),P=Math.abs(d[0]-u[0])/Math.abs(d[0]-_[0]),S=d[0]-u[0]<0&&_[0]-d[0]>.05*(k-p),d[0]-u[0]>0&&_[0]-d[0]<-.05*(k-p)?(o=.2,i=.1):S?(o=.1,i=.2):P>2||P<.5?(o=.15,i=.15):(o=.05,i=.05),[[p-o*(k-p),b],[k+i*(k-p),w]]),.05*K)!==C&&(t=x.face_out_of_box)}return{ratio:n,error:t,fullFace:r,faceRatio:n,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],c=r[2],s=a;s<o;s++)for(var l=i;l<c;l++){var d=D(e,t,s,l),u=d.r,_=d.g,g=d.b;u>=245&&g>=245&&_>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 EF(new Worker(t))}(),LF=[[0,1,0],[1,-4,1],[0,1,0]];function OF(e,t,r,n){return e[4*(r*t+n)]}function NF(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,o=0;o<t.length;o+=4){var i=(t[o]+t[o+1]+t[o+2])/3;t[o]=i}for(var a=0,s=0,c=n-1,u=r-1,l=1;l<c;l++)for(var d=1;d<u;d++){var f=LF[0][0]*OF(t,r,d-1,l-1)+LF[0][1]*OF(t,r,d,l-1)+LF[0][2]*OF(t,r,d+1,l-1)+LF[1][0]*OF(t,r,d-1,l)+LF[1][1]*OF(t,r,d,l)+LF[1][2]*OF(t,r,d+1,l)+LF[2][0]*OF(t,r,d-1,l+1)+LF[2][1]*OF(t,r,d,l+1)+LF[2][2]*OF(t,r,d+1,l+1);(f=Math.abs(f))>25&&a++,f>15&&f<25&&s++}var h=0;return a+s!==0&&(h=a/(a+s)),h}function FF(e){var t=e.width,r=e.height,n=e.getContext("2d"),o=Math.floor(t/2.8),i=Math.floor(r/2.8),a=t-o,s=r-i;return{data:n.getImageData(Math.floor(o/2),Math.floor(i/2),a,s).data,reducedWidth:a,reducedHeight:s}}function VF(){return(VF=EP(kP().mark((function e(t){var r;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=FF(t),DF){e.next=3;break}return e.abrupt("return",NF(r));case 3:return e.abrupt("return",DF.calculateBlurScoreFunc(r));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jF(e,t,r,n){return e[4*(n*t+r)]}var UF=Object.freeze({__proto__:null,calculateBlurScore:function(e){return VF.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},hasSameBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null!==t&&Math.abs(e-t)<r},hasBetterCardBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||t-e>r},calculateIdCardBlurScore:function(e){var t=e.canvas,r=document.createElement("canvas"),n=r.getContext("2d");r.width=430,r.height=270,n.drawImage(t,0,0,r.width,r.height);var o=Math.floor(129),i=Math.floor(13.5),a=Math.floor(408.5),s=Math.floor(256.5),c=document.createElement("canvas"),u=c.getContext("2d"),l=a-o,d=s-i;c.width=l,c.height=d,u.drawImage(r,o,i,l,d,0,0,l,d);for(var f=u.getImageData(0,0,l,d).data,h=0;h<f.length;h+=4){var p=Math.round(.299*f[h]+.587*f[h+1]+.114*f[h+2]);f[h]=p}for(var m=d-1,g=l-1,v=0,y=[],b=1;b<m;b++)for(var w=1;w<g;w++){var _=4*-jF(f,l,w,b)+jF(f,l,w,b-1)+jF(f,l,w,b+1)+jF(f,l,w-1,b)+jF(f,l,w+1,b);v+=_,y.push(_)}v/=(l-2)*(d-2);for(var k=0,C=0;C<y.length;C++){var S=y[C]-v;k+=Math.pow(S,2)}var B=Math.sqrt(k/y.length);return 1/(1+Math.pow(2,B/2-10))}});function zF(e){var t,r,n,o,i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=s.x,l=s.y,d=s.width,f=s.height,h=e.videoWidth,p=e.videoHeight,m=window.innerWidth,g=window.innerHeight,v=m/g,y=h/p;v<y?(i=u*(n=h/m),a=(l-(t=(g-m/y)/2))*(o=p/(g-2*t))):(i=(u-(r=(m-g*y)/2))*(n=h/(m-2*r)),a=l*(o=p/g));var b=d*n,w=f*o,_=b,k=w,C=Math.max(b,w)*c;return{lostX:r,lostY:t,cropWidth:b=Math.floor(Math.min(h,b+2*C)),cropHeight:w=Math.floor(Math.min(p,w+2*C)),cropX:i=Math.floor(Math.max(0,i-C)),cropY:a=Math.floor(Math.max(0,a-C)),cropWidthWithoutPadding:_,cropHeightWithoutPadding:k}}var qF=Object.freeze({__proto__:null,analyzeVideoAndWindowSizes:zF,takePicture:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.canvas,n=t.video,o=t.cropArea,i=t.quality,a=void 0===i?1:i;if(r)e=r;else{var s=zF(n,o),c=s.cropWidth,u=s.cropHeight,l=s.cropX,d=s.cropY,f=(e=document.createElement("canvas")).getContext("2d");e.width=c,e.height=u,f.drawImage(n,l,d,c,u,0,0,c,u)}return new Promise((function(t){e.toBlob(t,"image/jpeg",a)}))}}),WF=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},HF=Object.freeze({__proto__:null,shuffleArray:WF}),KF={NONE:0,PARTIAL:1,FULL:2},QF=function(e,t){var r=RP(e,2),n=r[0],o=r[1],i=RP(t,2),a=i[0],s=i[1];return n>s||a>o?0:n<=a&&s<=o?2:1};function GF(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=RP(e,2),o=n[0],i=n[1],a=RP(t,2),s=a[0],c=a[1],u=[o[0],i[0]],l=[o[1],i[1]],d=[s[0],c[0]],f=[s[1],c[1]],h=[u[0]+r,u[1]-r],p=[l[0]+r,l[1]-.8*r];return 2===QF(h,d)&&2===QF(p,f)?KF.FULL:0===QF(u,d)||0===QF(l,f)?KF.NONE:KF.PARTIAL}function XF(e){var t=e.small,r=t.coords,n=t.area,o=e.big,i=o.coords,a=o.area,s=n;if(!s){var c=RP(r,2),u=c[0],l=c[1];s=(l[0]-u[0])*(l[1]-u[1])}var d=a;if(!d){var f=RP(i,2),h=f[0],p=f[1];d=(p[0]-h[0])*(p[1]-h[1])}return s/d}function YF(e,t){var r=RP(e,2),n=r[0],o=r[1],i=RP(t,2),a=i[0],s=i[1],c=o[0]-n[0],u=o[1]-n[1],l=s[0]-a[0];return c/l<u/l?c/l:u/l}var $F=Object.freeze({__proto__:null,ContainMode:KF,rectContains:GF,rectAreaRatio:XF,rectEdgeRatio:YF,isFaceCenter:function(e,t){var r=RP(e,2),n=r[0],o=r[1],i=RP(t,2),a=i[0],s=i[1],c=o[0]-n[0],u=o[1]-n[1],l=s[0]-a[0],d=Math.abs(n[0]-(l-c)/2)/l<.2,f=Math.abs(n[1]-(l-u)/2)/l<.2;return!(!d||!f)}});function ZF(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function JF(e,t){return[e[0]-t[0],e[1]-t[1]]}function eV(e){var t=e.landmarks,r=e.getPerfectFrontal,n=e.upDownBound,o=void 0===n?{lower:.42,upper:.7}:n,i=function(e){var t,r,n,o,i,a,s=RP(e,4),c=s[0],u=s[1],l=s[2],d=s[3],f=JF(u,c),h=ZF(f),p=(n=u,2,[(t=[(r=c)[0]+n[0],r[1]+n[1]])[0]/2,t[1]/2]),m=JF(l,p),g=ZF(JF(d,l)),v=JF(d,p),y=ZF(v),b=(m[0]*v[0]+m[1]*v[1])/y,w=g/y;if(h>.5*y)o=(m[0]*f[0]+m[1]*f[1])/h/h;else{var _=ZF(JF(m,function(e,t){return[e[0]*t,e[1]*t]}(v,b/y)));a=v,o=((i=m)[0]*a[1]-a[0]*i[1]>=0?1:-1)*_/h}return{left_right_score:o,up_down_score:w}}(t),a=i.left_right_score,s=i.up_down_score,c=RP(t,3),u=c[0],l=c[1],d=c[2],f=l[0]-d[0],h=u[0]-d[0],p=r?.1:.3,m=s>o.upper,g=s<o.lower,v=a>=.35&&a<=.6,y=a<=-.35&&a>=-.6,b=m&&!y&&!v,w=g&&!y&&!v,_=y&&!m&&!g,k=v&&!m&&!g;return s>=o.lower&&s<=o.upper&&a>-p&&a<p&&f*h<0?{gesture:vP.FRONTAL,leftRightScore:a}:b?{gesture:vP.UP,leftRightScore:a}:w?{gesture:vP.DOWN,leftRightScore:a}:k?{gesture:vP.RIGHT,leftRightScore:a}:_?{gesture:vP.LEFT,leftRightScore:a}:null}function tV(e){var t,r,n,o=e.predictions,i=e.width,a=e.height,s=e.cropAreaCoordinates,c=null!=s?s:[[0,0],[i,a]],u=o.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,o=t.probability,i=t.landmarks;return o<.9||i.length<6||XF({small:{coords:[r,n]},big:{coords:c}})<=.025?e[KF.NONE].push(t):e[GF(c,[r,n])].push(t),e}),PP(PP(PP({},KF.PARTIAL,[]),KF.FULL,[]),KF.NONE,[])),l=u[KF.FULL].length,d=u[KF.PARTIAL].length;if(0===l)t=d>0?gP.partial_face:gP.no_face;else if(l+d>1)t=gP.multiple_faces;else{var f=r=u[KF.FULL][0];(n=YF([f.topLeft,f.bottomRight],c))<.4&&(t=gP.face_too_small),n>.61&&(t=gP.face_too_large),GF(c,function(e){var t,r,n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],c=e[5],u=.5*(n[1]+o[1]),l=u+1.5*(u-a[1]),d=a[1]-1.2*(i[1]-a[1]),f=[n[0],o[0],i[0],a[0],s[0],c[0]],h=Math.min.apply(Math,f),p=Math.min(l,d),m=Math.max.apply(Math,f),g=Math.max(l,d),v=Math.abs(a[0]-s[0])/Math.abs(a[0]-c[0]),y=a[0]-s[0]<0&&c[0]-a[0]>.05*(m-h);return a[0]-s[0]>0&&c[0]-a[0]<-.05*(m-h)?(t=.2,r=.1):y?(t=.1,r=.2):v>2||v<.5?(t=.15,r=.15):(t=.05,r=.05),[[h-t*(m-h),p],[m+r*(m-h),g]]}(r.landmarks),.05*i)!==KF.FULL&&(t=gP.face_out_of_box)}return{ratio:n,error:t,fullFace:r,faceRatio:n,faceNotFrontalMinThreshold:.38}}function rV(e,t){var r=t.customInstructions,n=t.customIcon,o=t.customDirectionIcon,i=t.customStepTimeConstraints,a={};return null!=r&&r[e]&&(a.instructions=r[e]),null!=n&&n[e]&&(a.icon=n[e]),null!=o&&o[e]&&(a.directionIcon=o[e]),null!=i&&i[e]&&(a.stepTimeConstraints=i[e]),a}function nV(){return(nV=EP(kP().mark((function e(t){return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(DF){e.next=2;break}return e.abrupt("return",tV(t));case 2:return e.abrupt("return",DF.validatePredictionsFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oV(){return(oV=EP(kP().mark((function e(t){return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(DF){e.next=2;break}return e.abrupt("return",eV(t));case 2:return e.abrupt("return",DF.calculateFaceDirectionFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var iV=Object.freeze({__proto__:null,cropFaceInsideBox:function(e,t){var r=RP(e,2),n=r[0],o=r[1],i=RP(t,2),a=i[0],s=i[1];return[[Math.max(n[0],a[0]),Math.max(n[1],a[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,i=e.customDirectionIcon,a=e.customStepTimeConstraints,s=e.Locale,c=e.lang;return{curStepIndex:0,steps:[].concat(MP(WF([_P({name:vP.LEFT,instructions:PP({},c,null==s?void 0:s[null==vP?void 0:vP.LEFT]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:YD(r,"ic_face_left.svg"),directionIcon:YD(r,"arrow_left.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},rV(vP.LEFT,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a})),_P({name:vP.RIGHT,instructions:PP({},c,null==s?void 0:s[null==vP?void 0:vP.RIGHT]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:YD(r,"ic_face_right.svg"),directionIcon:YD(r,"arrow_right.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},rV(vP.RIGHT,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a})),_P({name:vP.UP,instructions:PP({},c,null==s?void 0:s[null==vP?void 0:vP.UP]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:YD(r,"ic_face_up.svg"),directionIcon:YD(r,"arrow_up.svg"),directionIconAnimation:"slide-vertical",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},rV(vP.UP,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a}))])),[_P({name:vP.FRONTAL,instructions:PP({},c,null==s?void 0:s[null==vP?void 0:vP.FRONTAL]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:YD(r,"ic_face_frontal.svg"),directionIcon:YD(r,"frontal.svg"),directionIconAnimation:"blink",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},rV(vP.FRONTAL,{customInstructions:n,customIcon:o,customDirectionIcon:i,customStepTimeConstraints:a}))])}},validatePredictions:function(e){return nV.apply(this,arguments)},calculateFaceDirection:function(e){return oV.apply(this,arguments)},faceTracker:function(){var e=[],t=[],r=[],n=[],o=[],i=0,a=0;function s(){a=i,r=MP(e),n=MP(t)}return function(c,u){var l=c.topLeft,d=c.bottomRight,f=c.landmarks,h=[],p=RP(l,2);h[0]=p[0],h[1]=p[1];var m=RP(d,2);h[2]=m[0],h[3]=m[1];var g=[],v=[];f.forEach((function(e,t){var r=RP(e,2);g[t]=r[0],v[t]=r[1]})),i=Date.now();var y=h[2]-h[0];if(e=[].concat(g),t=[].concat(v),!r.length&&!n.length||u)return s(),{score:0,time:i};for(var b=0;b<6;b++)o[b]=Math.sqrt((e[b]-r[b])*(e[b]-r[b])+(t[b]-n[b])*(t[b]-n[b]));for(var w=0;w<6;w++)o[w]/=(i-a)*y;for(var _=0,k=0;k<6;k++)_+=o[k];return _/=6,s(),{score:_,time:i}}}}),aV=function(){var e=EP(kP().mark((function e(t){var r,n;return kP().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)}}(),sV=Object.freeze({__proto__:null,SIZE:400,getModelPredictions:aV}),cV=Object.getOwnPropertySymbols,uV=Object.prototype.hasOwnProperty,lV=Object.prototype.propertyIsEnumerable;function dV(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var fV,hV=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=dV(e),i=1;i<arguments.length;i++){for(var a in r=Object(arguments[i]))uV.call(r,a)&&(o[a]=r[a]);if(cV){n=cV(r);for(var s=0;s<n.length;s++)lV.call(r,n[s])&&(o[n[s]]=r[n[s]])}}return o},pV=arguments[3],mV=arguments[4],gV=arguments[5],vV=JSON.stringify,yV=function(e,t){for(var r,n=Object.keys(gV),o=0,i=n.length;o<i;o++){var a=n[o],s=gV[a].exports;if(s===e||s&&s.default===e){r=a;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(o=0,i=n.length;o<i;o++)c[a=n[o]]=a;mV[r]=["function(require,module,exports){"+e+"(self); }",c]}var u=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[r]=r,mV[u]=["function(require,module,exports){var f = require("+vV(r)+");(f.default ? f.default : f)(self);}",l];var d={};!function e(t){for(var r in d[t]=!0,mV[t][1]){var n=mV[t][1][r];d[n]||e(n)}}(u);var f="("+pV+")({"+Object.keys(d).map((function(e){return vV(e)+":["+mV[e][0]+","+vV(mV[e][1])+"]"})).join(",")+"},{},["+vV(u)+"])",h=window.URL||window.webkitURL||window.mozURL||window.msURL,p=new Blob([f],{type:"text/javascript"});if(t&&t.bare)return p;var m=h.createObjectURL(p),g=new Worker(m);return g.objectURL=m,g},bV=WP((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}}})),wV={js:!0,wasm:!0};function _V(e){if(!(this instanceof _V))return new _V(e);var t=hV({},wV,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')}_V.prototype.has_wasm=function(){if(void 0!==fV)return fV;if(fV=!1,"undefined"==typeof WebAssembly)return fV;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)&&(fV=!0),fV}catch(e){}return fV},_V.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},_V.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},_V.prototype.__base64decode=function(e){for(var t=e.replace(/[\r\n=]/g,""),r=t.length,n=new Uint8Array(3*r>>2),o=0,i=0,a=0;a<r;a++)a%4==0&&a&&(n[i++]=o>>16&255,n[i++]=o>>8&255,n[i++]=255&o),o=o<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t.charAt(a));var s=r%4*6;return 0===s?(n[i++]=o>>16&255,n[i++]=o>>8&255,n[i++]=255&o):18===s?(n[i++]=o>>10&255,n[i++]=o>>2&255):12===s&&(n[i++]=o>>4&255),n},_V.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},_V.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:hV(o,r||{})})}return this.__cache[e]},_V.prototype.__align=function(e,t){var r=e%(t=t||8);return e+(r?t-r:0)};var kV,CV,SV,BV,EV,xV,IV=_V;function AV(e,t,r,n,o,i){var a,s,c,u,l,d,f,h,p,m,g,v,y,b;for(p=0;p<i;p++){for(f=p,h=0,u=l=(a=e[d=p*o])*n[6],g=n[0],v=n[1],y=n[4],b=n[5],m=0;m<o;m++)c=(s=e[d])*g+a*v+u*y+l*b,l=u,u=c,a=s,r[h]=u,h++,d++;for(h--,f+=i*(o-1),u=l=(a=e[--d])*n[7],s=a,g=n[2],v=n[3],m=o-1;m>=0;m--)c=s*g+a*v+u*y+l*b,l=u,u=c,a=s,s=e[d],t[f]=r[h]+u,d--,h--,f-=i}}var PV={name:"unsharp_mask",fn:function(e,t,r,n,o,i){var a,s,c,u,l,d,f,h,p,m,g,v,y;if(!(0===n||o<.5)){o>2&&(o=2);var b=function(e,t,r){for(var n,o,i,a,s,c=t*r,u=new Uint16Array(c),l=0;l<c;l++)n=e[4*l],o=e[4*l+1],i=e[4*l+2],s=n>=o&&n>=i?n:o>=i&&o>=n?o:i,a=n<=o&&n<=i?n:o<=i&&o<=n?o:i,u[l]=257*(s+a)>>1;return u}(e,t,r),w=new Uint16Array(b);!function(e,t,r,n){if(n){var o=new Uint16Array(e.length),i=new Float32Array(Math.max(t,r)),a=function(e){e<.5&&(e=.5);var t=Math.exp(.527076)/e,r=Math.exp(-t),n=Math.exp(-2*t),o=(1-r)*(1-r)/(1+2*t*r-n);return kV=o,CV=o*(t-1)*r,SV=o*(t+1)*r,BV=-o*n,EV=2*r,xV=-n,new Float32Array([kV,CV,SV,BV,EV,xV,(kV+CV)/(1-EV-xV),(SV+BV)/(1-EV-xV)])}(n);AV(e,o,i,a,t,r),AV(o,e,i,a,r,t)}}(w,t,r,o);for(var _=n/100*4096+.5|0,k=257*i|0,C=t*r,S=0;S<C;S++)v=2*(b[S]-w[S]),Math.abs(v)>=k&&(a=e[y=4*S],s=e[y+1],c=e[y+2],d=257*((h=a>=s&&a>=c?a:s>=a&&s>=c?s:c)+(f=a<=s&&a<=c?a:s<=a&&s<=c?s:c))>>1,f===h?u=l=0:(l=d<=32767?4095*(h-f)/(h+f)|0:4095*(h-f)/(510-h-f)|0,u=a===h?65535*(s-c)/(6*(h-f))|0:s===h?21845+(65535*(c-a)/(6*(h-f))|0):43690+(65535*(a-s)/(6*(h-f))|0)),(d+=_*v+2048>>12)>65535?d=65535:d<0&&(d=0),0===l?a=s=c=d>>8:(p=2*d-(m=d<=32767?d*(4096+l)+2048>>12:d+((65535-d)*l+2048>>12))>>8,m>>=8,a=(g=u+21845&65535)>=43690?p:g>=32767?p+(6*(m-p)*(43690-g)+32768>>16):g>=10922?m:p+(6*(m-p)*g+32768>>16),s=(g=65535&u)>=43690?p:g>=32767?p+(6*(m-p)*(43690-g)+32768>>16):g>=10922?m:p+(6*(m-p)*g+32768>>16),c=(g=u-21845&65535)>=43690?p:g>=32767?p+(6*(m-p)*(43690-g)+32768>>16):g>=10922?m:p+(6*(m-p)*g+32768>>16)),e[y]=a,e[y+1]=s,e[y+2]=c)}},wasm_fn:function(e,t,r,n,o,i){if(!(0===n||o<.5)){o>2&&(o=2);var a=t*r,s=4*a,c=2*a,u=2*a,l=4*Math.max(t,r),d=s,f=d+c,h=f+u,p=h+u,m=p+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,h,p,m,t,r,o),(y=g.exports.unsharp||g.exports._unsharp)(0,0,d,f,t,r,n,i),v.set(new Uint32Array(this.__memory.buffer,0,a))}},wasm_src:"AGFzbQEAAAABMQZgAXwBfGACfX8AYAZ/f39/f38AYAh/f39/f39/fQBgBH9/f38AYAh/f39/f39/fwACGQIDZW52A2V4cAAAA2VudgZtZW1vcnkCAAEDBgUBAgMEBQQEAXAAAAdMBRZfX2J1aWxkX2dhdXNzaWFuX2NvZWZzAAEOX19nYXVzczE2X2xpbmUAAgpibHVyTW9ubzE2AAMHaHNsX2wxNgAEB3Vuc2hhcnAABQkBAAqJEAXZAQEGfAJAIAFE24a6Q4Ia+z8gALujIgOaEAAiBCAEoCIGtjgCECABIANEAAAAAAAAAMCiEAAiBbaMOAIUIAFEAAAAAAAA8D8gBKEiAiACoiAEIAMgA6CiRAAAAAAAAPA/oCAFoaMiArY4AgAgASAEIANEAAAAAAAA8L+gIAKioiIHtjgCBCABIAQgA0QAAAAAAADwP6AgAqKiIgO2OAIIIAEgBSACoiIEtow4AgwgASACIAegIAVEAAAAAAAA8D8gBqGgIgKjtjgCGCABIAMgBKEgAqO2OAIcCwu3AwMDfwR9CHwCQCADKgIUIQkgAyoCECEKIAMqAgwhCyADKgIIIQwCQCAEQX9qIgdBAEgiCA0AIAIgAC8BALgiDSADKgIYu6IiDiAJuyIQoiAOIAq7IhGiIA0gAyoCBLsiEqIgAyoCALsiEyANoqCgoCIPtjgCACACQQRqIQIgAEECaiEAIAdFDQAgBCEGA0AgAiAOIBCiIA8iDiARoiANIBKiIBMgAC8BALgiDaKgoKAiD7Y4AgAgAkEEaiECIABBAmohACAGQX9qIgZBAUoNAAsLAkAgCA0AIAEgByAFbEEBdGogAEF+ai8BACIIuCINIAu7IhGiIA0gDLsiEqKgIA0gAyoCHLuiIg4gCrsiE6KgIA4gCbsiFKKgIg8gAkF8aioCALugqzsBACAHRQ0AIAJBeGohAiAAQXxqIQBBACAFQQF0ayEHIAEgBSAEQQF0QXxqbGohBgNAIAghAyAALwEAIQggBiANIBGiIAO4Ig0gEqKgIA8iECAToqAgDiAUoqAiDyACKgIAu6CrOwEAIAYgB2ohBiAAQX5qIQAgAkF8aiECIBAhDiAEQX9qIgRBAUoNAAsLCwvfAgIDfwZ8AkAgB0MAAAAAWw0AIARE24a6Q4Ia+z8gB0MAAAA/l7ujIgyaEAAiDSANoCIPtjgCECAEIAxEAAAAAAAAAMCiEAAiDraMOAIUIAREAAAAAAAA8D8gDaEiCyALoiANIAwgDKCiRAAAAAAAAPA/oCAOoaMiC7Y4AgAgBCANIAxEAAAAAAAA8L+gIAuioiIQtjgCBCAEIA0gDEQAAAAAAADwP6AgC6KiIgy2OAIIIAQgDiALoiINtow4AgwgBCALIBCgIA5EAAAAAAAA8D8gD6GgIgujtjgCGCAEIAwgDaEgC6O2OAIcIAYEQCAFQQF0IQogBiEJIAIhCANAIAAgCCADIAQgBSAGEAIgACAKaiEAIAhBAmohCCAJQX9qIgkNAAsLIAVFDQAgBkEBdCEIIAUhAANAIAIgASADIAQgBiAFEAIgAiAIaiECIAFBAmohASAAQX9qIgANAAsLC7wBAQV/IAMgAmwiAwRAQQAgA2shBgNAIAAoAgAiBEEIdiIHQf8BcSECAn8gBEH/AXEiAyAEQRB2IgRB/wFxIgVPBEAgAyIIIAMgAk8NARoLIAQgBCAHIAIgA0kbIAIgBUkbQf8BcQshCAJAIAMgAk0EQCADIAVNDQELIAQgByAEIAMgAk8bIAIgBUsbQf8BcSEDCyAAQQRqIQAgASADIAhqQYECbEEBdjsBACABQQJqIQEgBkEBaiIGDQALCwvTBgEKfwJAIAazQwAAgEWUQwAAyEKVu0QAAAAAAADgP6CqIQ0gBSAEbCILBEAgB0GBAmwhDgNAQQAgAi8BACADLwEAayIGQQF0IgdrIAcgBkEASBsgDk8EQCAAQQJqLQAAIQUCfyAALQAAIgYgAEEBai0AACIESSIJRQRAIAYiCCAGIAVPDQEaCyAFIAUgBCAEIAVJGyAGIARLGwshCAJ/IAYgBE0EQCAGIgogBiAFTQ0BGgsgBSAFIAQgBCAFSxsgCRsLIgogCGoiD0GBAmwiEEEBdiERQQAhDAJ/QQAiCSAIIApGDQAaIAggCmsiCUH/H2wgD0H+AyAIayAKayAQQYCABEkbbSEMIAYgCEYEQCAEIAVrQf//A2wgCUEGbG0MAQsgBSAGayAGIARrIAQgCEYiBhtB//8DbCAJQQZsbUHVqgFBqtUCIAYbagshCSARIAcgDWxBgBBqQQx1aiIGQQAgBkEAShsiBkH//wMgBkH//wNIGyEGAkACfwJAIAxB//8DcSIFBEAgBkH//wFKDQEgBUGAIGogBmxBgBBqQQx2DAILIAZBCHYiBiEFIAYhBAwCCyAFIAZB//8Dc2xBgBBqQQx2IAZqCyIFQQh2IQcgBkEBdCAFa0EIdiIGIQQCQCAJQdWqAWpB//8DcSIFQanVAksNACAFQf//AU8EQEGq1QIgBWsgByAGa2xBBmxBgIACakEQdiAGaiEEDAELIAchBCAFQanVAEsNACAFIAcgBmtsQQZsQYCAAmpBEHYgBmohBAsCfyAGIgUgCUH//wNxIghBqdUCSw0AGkGq1QIgCGsgByAGa2xBBmxBgIACakEQdiAGaiAIQf//AU8NABogByIFIAhBqdUASw0AGiAIIAcgBmtsQQZsQYCAAmpBEHYgBmoLIQUgCUGr1QJqQf//A3EiCEGp1QJLDQAgCEH//wFPBEBBqtUCIAhrIAcgBmtsQQZsQYCAAmpBEHYgBmohBgwBCyAIQanVAEsEQCAHIQYMAQsgCCAHIAZrbEEGbEGAgAJqQRB2IAZqIQYLIAEgBDoAACABQQFqIAU6AAAgAUECaiAGOgAACyADQQJqIQMgAkECaiECIABBBGohACABQQRqIQEgC0F/aiILDQALCwsL"},TV=[{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 RV(e){return Math.round(16383*e)}var MV=function(e,t,r,n,o){var i,a,s,c,u,l,d,f,h,p,m,g,v,y,b,w,_,k=TV[e].filter,C=1/n,S=Math.min(1,n),B=TV[e].win/S,E=Math.floor(2*(B+1)),x=new Int16Array((E+2)*r),I=0,A=!x.subarray||!x.set;for(i=0;i<r;i++){for(a=(i+.5)*C+o,s=Math.max(0,Math.floor(a-B)),u=(c=Math.min(t-1,Math.ceil(a+B)))-s+1,l=new Float32Array(u),d=new Int16Array(u),f=0,h=s,p=0;h<=c;h++,p++)f+=m=k((h+.5-a)*S),l[p]=m;for(g=0,p=0;p<l.length;p++)g+=v=l[p]/f,d[p]=RV(v);for(d[r>>1]+=RV(1-g),y=0;y<d.length&&0===d[y];)y++;if(y<d.length){for(b=d.length-1;b>0&&0===d[b];)b--;if(w=s+y,_=b-y+1,x[I++]=w,x[I++]=_,A)for(p=y;p<=b;p++)x[I++]=d[p];else x.set(d.subarray(y,b+1),I),I+=_}else x[I++]=0,x[I++]=0}return x};function DV(e){return e<0?0:e>255?255:e}var LV=!0;try{LV=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(e){}function OV(e,t,r){if(LV)t.set(function(e){return new Uint8Array(e.buffer,0,e.byteLength)}(e),r);else for(var n=r,o=0;o<e.length;o++){var i=e[o];t[n++]=255&i,t[n++]=i>>8&255}}var NV={name:"resize",fn:function(e){var t=e.src,r=e.width,n=e.height,o=e.toWidth,i=e.toHeight,a=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,c=e.offsetX||0,u=e.offsetY||0,l=e.dest||new Uint8Array(o*i*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,h=MV(d,r,o,a,c),p=MV(d,n,i,s,u),m=new Uint8Array(o*n*4);return function(e,t,r,n,o,i){var a,s,c,u,l,d,f,h,p,m,g,v=0,y=0;for(p=0;p<n;p++){for(l=0,m=0;m<o;m++){for(d=i[l++],f=i[l++],h=v+4*d|0,a=s=c=u=0;f>0;f--)u=u+(g=i[l++])*e[h+3]|0,c=c+g*e[h+2]|0,s=s+g*e[h+1]|0,a=a+g*e[h]|0,h=h+4|0;t[y+3]=DV(u+8192>>14),t[y+2]=DV(c+8192>>14),t[y+1]=DV(s+8192>>14),t[y]=DV(a+8192>>14),y=y+4*n|0}y=4*(p+1)|0,v=(p+1)*r*4|0}}(t,m,r,n,o,h),function(e,t,r,n,o,i){var a,s,c,u,l,d,f,h,p,m,g,v=0,y=0;for(p=0;p<n;p++){for(l=0,m=0;m<o;m++){for(d=i[l++],f=i[l++],h=v+4*d|0,a=s=c=u=0;f>0;f--)u=u+(g=i[l++])*e[h+3]|0,c=c+g*e[h+2]|0,s=s+g*e[h+1]|0,a=a+g*e[h]|0,h=h+4|0;t[y+3]=DV(u+8192>>14),t[y+2]=DV(c+8192>>14),t[y+1]=DV(s+8192>>14),t[y]=DV(a+8192>>14),y=y+4*n|0}y=4*(p+1)|0,v=(p+1)*r*4|0}}(m,l,n,o,i,p),f||function(e,t,r){for(var n=3,o=t*r*4|0;n<o;)e[n]=255,n=n+4|0}(l,o,i),l},wasm_fn:function(e){var t=e.src,r=e.width,n=e.height,o=e.toWidth,i=e.toHeight,a=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,c=e.offsetX||0,u=e.offsetY||0,l=e.dest||new Uint8Array(o*i*4),d=void 0===e.quality?3:e.quality,f=e.alpha||!1,h=MV(d,r,o,a,c),p=MV(d,n,i,s,u),m=this.__align(0+Math.max(t.byteLength,l.byteLength)),g=this.__align(m+n*o*4),v=this.__align(g+h.byteLength),y=v+p.byteLength,b=this.__instance("resize",y),w=new Uint8Array(this.__memory.buffer),_=new Uint32Array(this.__memory.buffer),k=new Uint32Array(t.buffer);return _.set(k),OV(h,w,g),OV(p,w,v),(b.exports.convolveHV||b.exports._convolveHV)(g,v,m,r,n,o,i),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,i*o)),f||function(e,t,r){for(var n=3,o=t*r*4|0;n<o;)e[n]=255,n=n+4|0}(l,o,i),l},wasm_src:"AGFzbQEAAAABFAJgBn9/f39/fwBgB39/f39/f38AAg8BA2VudgZtZW1vcnkCAAEDAwIAAQQEAXAAAAcZAghjb252b2x2ZQAACmNvbnZvbHZlSFYAAQkBAArmAwLBAwEQfwJAIANFDQAgBEUNACAFQQRqIRVBACEMQQAhDQNAIA0hDkEAIRFBACEHA0AgB0ECaiESAn8gBSAHQQF0IgdqIgZBAmouAQAiEwRAQQAhCEEAIBNrIRQgFSAHaiEPIAAgDCAGLgEAakECdGohEEEAIQlBACEKQQAhCwNAIBAoAgAiB0EYdiAPLgEAIgZsIAtqIQsgB0H/AXEgBmwgCGohCCAHQRB2Qf8BcSAGbCAKaiEKIAdBCHZB/wFxIAZsIAlqIQkgD0ECaiEPIBBBBGohECAUQQFqIhQNAAsgEiATagwBC0EAIQtBACEKQQAhCUEAIQggEgshByABIA5BAnRqIApBgMAAakEOdSIGQf8BIAZB/wFIG0EQdEGAgPwHcUEAIAZBAEobIAtBgMAAakEOdSIGQf8BIAZB/wFIG0EYdEEAIAZBAEobciAJQYDAAGpBDnUiBkH/ASAGQf8BSBtBCHRBgP4DcUEAIAZBAEobciAIQYDAAGpBDnUiBkH/ASAGQf8BSBtB/wFxQQAgBkEAShtyNgIAIA4gA2ohDiARQQFqIhEgBEcNAAsgDCACaiEMIA1BAWoiDSADRw0ACwsLIQACQEEAIAIgAyAEIAUgABAAIAJBACAEIAUgBiABEAALCw=="};function FV(e){var t=e||[],r={js:t.indexOf("js")>=0,wasm:t.indexOf("wasm")>=0};IV.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(PV),this.use(NV)}bV(FV,IV),FV.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 VV=FV;function jV(e,t){this.create=e,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=t||2e3}jV.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},jV.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))},jV.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 UV=jV;function zV(e){return Object.prototype.toString.call(e)}var qV=function(e){var t=zV(e);return"[object HTMLCanvasElement]"===t||"[object OffscreenCanvas]"===t||"[object Canvas]"===t},WV=function(e){switch(e){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},HV=function(){var e,t=VV;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 KV(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.floor(e)}function QV(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.ceil(e)}var GV={},XV=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(XV=navigator.userAgent.indexOf("Safari")>=0)}catch(_I){}var YV=1;"undefined"!=typeof navigator&&(YV=Math.min(navigator.hardwareConcurrency||1,4));var $V,ZV,JV={tile:1024,concurrency:YV,features:["js","wasm","ww"],idle:2e3,createCanvas:function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r}},ej={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0};function tj(){return{value:yV(HV),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 rj(e){if(!(this instanceof rj))return new rj(e);this.options=hV({},JV,e||{});var t="lk_".concat(this.options.concurrency);this.__limit=GV[t]||function(e){var t=0,r=[];function n(){t<e&&r.length&&(t++,r.shift()())}return function(e){return new Promise((function(o,i){r.push((function(){e().then((function(e){o(e),t--,n()}),(function(e){i(e),t--,n()}))})),n()}))}}(this.options.concurrency),GV[t]||(GV[t]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}rj.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if(!1!==$V&&!0!==$V&&($V=!1,"undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray))try{new ImageData(new Uint8ClampedArray(400),10,10),$V=!0}catch(t){}!1!==ZV&&!0!==ZV&&(ZV=!1,"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?ZV=!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 VV(t),t.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{yV((function(){})).terminate(),this.features.ww=!0;var r="wp_".concat(JSON.stringify(this.options));GV[r]?this.__workersPool=GV[r]:(this.__workersPool=new UV(tj,this.options.idle),GV[r]=this.__workersPool)}catch(t){}var n,o=this.__mathlib.init().then((function(t){hV(e.features,t.features)}));return n=ZV?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}))}(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},rj.prototype.resize=function(e,t,r){var n=this;this.debug("Start resize...");var o=hV({},ej);if(isNaN(r)?r&&(o=hV(o,r)):o=hV(o,{quality:r}),o.toWidth=t.width,o.toHeight=t.height,o.width=e.naturalWidth||e.width,o.height=e.naturalHeight||e.height,0===t.width||0===t.height)return Promise.reject(new Error("Invalid output size: ".concat(t.width,"x").concat(t.height)));o.unsharpRadius>2&&(o.unsharpRadius=2);var i=!1,a=null;o.cancelToken&&(a=o.cancelToken.then((function(e){throw i=!0,e}),(function(e){throw i=!0,e})));var s=Math.ceil(Math.max(3,2.5*o.unsharpRadius|0));return this.init().then((function(){if(i)return a;if(n.features.cib){var r=t.getContext("2d",{alpha:Boolean(o.alpha)});return n.debug("Resize via createImageBitmap()"),createImageBitmap(e,{resizeWidth:o.toWidth,resizeHeight:o.toHeight,resizeQuality:WV(o.quality)}).then((function(e){if(i)return a;if(!o.unsharpAmount)return r.drawImage(e,0,0),e.close(),r=null,n.debug("Finished!"),t;n.debug("Unsharp result");var s=n.options.createCanvas(o.toWidth,o.toHeight),c=s.getContext("2d",{alpha:Boolean(o.alpha)});c.drawImage(e,0,0),e.close();var u=c.getImageData(0,0,o.toWidth,o.toHeight);return n.__mathlib.unsharp_mask(u.data,o.toWidth,o.toHeight,o.unsharpAmount,o.unsharpRadius,o.unsharpThreshold),r.putImageData(u,0,0),s.width=s.height=0,u=c=s=r=null,n.debug("Finished!"),t}))}var c={},u=function(e){return Promise.resolve().then((function(){return n.features.ww?new Promise((function(t,r){var o=n.__workersPool.acquire();a&&a.catch((function(e){return r(e)})),o.value.onmessage=function(e){o.release(),e.data.err?r(e.data.err):t(e.data.result)},o.value.postMessage({opts:e,features:n.__requested_features,preload:{wasm_nodule:n.__mathlib.__}},[e.src.buffer])})):n.__mathlib.resizeAndUnsharp(e,c)}))},l=function(e,t,r){var o,c,l,d=!1,f=function(t){return n.__limit((function(){if(i)return a;var s;if(qV(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 h={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(h)})).then((function(e){if(i)return a;var r;if(s=null,n.debug("Convert raw rgba tile result to ImageData"),$V)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"),XV?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)}),qV(e))return o=e.getContext("2d",{alpha:Boolean(r.alpha)}),null;if(function(e){return"[object ImageBitmap]"===zV(e)}(e))return c=e,d=!0,null;if(function(e){return"[object HTMLImageElement]"===zV(e)}(e))return ZV?(n.debug("Decode image via createImageBitmap"),createImageBitmap(e).then((function(e){c=e})).catch((function(e){return null}))):null;throw new Error('Pica: ".from" should be Image, Canvas or ImageBitmap')})).then((function(){if(i)return a;n.debug("Calculate tiles");var e=function(e){var t,r,n,o,i,a,s=e.toWidth/e.width,c=e.toHeight/e.height,u=KV(e.srcTileSize*s)-2*e.destTileBorder,l=KV(e.srcTileSize*c)-2*e.destTileBorder;if(u<1||l<1)throw new Error("Internal error in pica: target tile width/height is too small.");var d,f=[];for(o=0;o<e.toHeight;o+=l)for(n=0;n<e.toWidth;n+=u)(t=n-e.destTileBorder)<0&&(t=0),t+(i=n+u+e.destTileBorder-t)>=e.toWidth&&(i=e.toWidth-t),(r=o-e.destTileBorder)<0&&(r=0),r+(a=o+l+e.destTileBorder-r)>=e.toHeight&&(a=e.toHeight-r),d={toX:t,toY:r,toWidth:i,toHeight:a,toInnerX:n,toInnerY:o,toInnerWidth:u,toInnerHeight:l,offsetX:t/s-KV(t/s),offsetY:r/c-KV(r/c),scaleX:s,scaleY:c,x:KV(t/s),y:KV(r/c),width:QV(i/s),height:QV(a/c)},f.push(d);return f}({width:r.width,height:r.height,srcTileSize:n.options.tile,toWidth:r.toWidth,toHeight:r.toHeight,destTileBorder:s}).map((function(e){return f(e)}));function o(){c&&(d||c.close(),c=null)}return n.debug("Process tiles"),Promise.all(e).then((function(){return n.debug("Finished!"),o(),t}),(function(e){throw o(),e}))}))};return function e(t,r,o,s){if(i)return a;var c,u=gg(t.shift(),2),d=u[0],f=u[1],h=0===t.length;return s=hV({},s,{toWidth:d,toHeight:f,quality:h?s.quality:Math.min(1,s.quality)}),h||(c=n.options.createCanvas(d,f)),l(r,h?o:c,s).then((function(){return h?o:(s.width=d,s.height=f,e(t,c,o,s))})).then((function(e){return c&&(c.width=c.height=0),e}))}(function(e,t,r,n,o,i){var a=r/e,s=n/t,c=(2*i+2+1)/o;if(c>.5)return[[r,n]];var u=Math.ceil(Math.log(Math.min(a,s))/Math.log(c));if(u<=1)return[[r,n]];for(var l=[],d=0;d<u;d++){var f=Math.round(Math.pow(Math.pow(e,u-d-1)*Math.pow(r,d+1),1/u)),h=Math.round(Math.pow(Math.pow(t,u-d-1)*Math.pow(n,d+1),1/u));l.push([f,h])}return l}(o.width,o.height,o.toWidth,o.toHeight,n.options.tile,s),e,t,o)}))},rj.prototype.resizeBuffer=function(e){var t=this,r=hV({},ej,e);return this.init().then((function(){return t.__mathlib.resizeAndUnsharp(r)}))},rj.prototype.toBlob=function(e,t,r){return t=t||"image/png",new Promise((function(n){if(e.toBlob)e.toBlob((function(e){return n(e)}),t,r);else if(e.convertToBlob)n(e.convertToBlob({type:t,quality:r}));else{for(var o=atob(e.toDataURL(t,r).split(",")[1]),i=o.length,a=new Uint8Array(i),s=0;s<i;s++)a[s]=o.charCodeAt(s);n(new Blob([a],{type:t}))}}))},rj.prototype.debug=function(){};var nj=new rj,oj=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.minSize,o=void 0===n?720:n,i=e/t;return e>t?{desW:Math.floor(o*i),desH:o}:{desW:o,desH:Math.floor(o/i)}},ij=Object.freeze({__proto__:null,scaleImage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.minSize,n=void 0===r?720:r;return new Promise((function(t){var r=URL.createObjectURL(e),o=new Image;o.src=r;var i=document.createElement("canvas");o.onload=function(){if(o.width&&o.height&&(o.width<n||o.height<n)){var e=oj(o.width,o.height,{minSize:n}),r=e.desW,a=e.desH;i.width=r,i.height=a,nj.resize(o,i).then((function(e){return nj.toBlob(e,"image/jpeg",1)})).then((function(e){return t(e)}))}else t(null)}}))},createResizer:function(e){var t=e.width,r=e.height,n=document.createElement("canvas"),o=n.getContext("2d");return n.width=t,n.height=r,{resize:function(e){var t=e.srcCanvas;return o.drawImage(t,0,0,n.width,n.height),n}}},resizeBlobImg:function(e,t,r){var n=document.createElement("canvas"),o=n.getContext("2d");return n.width=t,n.height=r,new Promise((function(t){var r=URL.createObjectURL(e),i=new Image;i.onload=function(){URL.revokeObjectURL(r),o.drawImage(i,0,0,n.width,n.height),n.toBlob(t,"image/jpeg",1)},i.src=r}))},blobToCanvas:function(e){var t=e.blob;return new Promise((function(e){var r=document.createElement("canvas"),n=r.getContext("2d"),o=new Image;o.onload=function(t){var i=o.width,a=o.height;r.width=i,r.height=a,URL.revokeObjectURL(t.target.src),n.drawImage(t.target,0,0),e(r)},o.src=URL.createObjectURL(t)}))}});function aj(e,t,r,n){var o=r*(4*t)+4*n;return{r:e[o],g:e[o+1],b:e[o+2]}}function sj(e,t,r){return function(e,t,r){for(var n=0,o=r[1],i=r[3],a=r[0],s=r[2],c=o;c<i;c++)for(var u=a;u<s;u++){var l=aj(e,t,c,u),d=l.r,f=l.g,h=l.b;d>=245&&h>=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 cj(){return(cj=EP(kP().mark((function e(t){var r,n,o;return kP().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,DF){e.next=5;break}return e.abrupt("return",sj(o,n.width,n.height));case 5:return e.abrupt("return",DF.detectGlare(o,n.width,n.height));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var uj=Object.freeze({__proto__:null,isCardGlare:function(e){return cj.apply(this,arguments)}});function lj(){return new Promise((function(e){navigator.permissions&&"function"==typeof navigator.permissions.query?navigator.permissions.query({name:"geolocation"}).then((function(t){"granted"===t.state?navigator.geolocation.getCurrentPosition((function(t){e({long:t.coords.longitude,lat:t.coords.latitude})}),(function(){return e(null)})):e(null)})).catch((function(){return e(null)})):e(null)}))}var dj=Object.freeze({__proto__:null,getLongAndLat:lj}),fj="internal_server_error",hj="network_error",pj=ZM();function mj(e){return 500*Math.pow(1.5,e)}function gj(e){return Array.isArray(null==e?void 0:e.errors)&&e.errors.find((function(e){return e.code===fj}))}function vj(e){return"Failed to fetch"===e.message||!e.response}function yj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,o=t.maxInternalServerErrorRetryTimes,i=void 0===o?1:o,a=t.propertyKey,s=t.onDone;return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var c=this;function u(e,t){return l.apply(this,arguments)}function l(){return(l=EP(kP().mark((function t(o,l){var d,f,h,p,m,g,v,y,b=arguments;return kP().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return g=function(){return(g=EP(kP().mark((function e(t){var r,n;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p(t),n=h(t)-r,e.next=4,gF(mj(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)},p=function(e){return e===l?Math.max(o-1,0):h(e)-1},h=function(e){return e===hj?n:e===fj?i:0},f=function(e){return o>0||(e===hj?void 0===o&&n>0:e===fj&&void 0===o&&i>0)},d=b.length>2&&void 0!==b[2]?b[2]:0,v=performance.now(),t.prev=7,t.next=10,e.apply(c,r);case 10:if(y=t.sent,s({response:y,retryCount:d,propertyKey:a,timeInMs:performance.now()-v,args:r}),!gj(y)||!f(fj)){t.next=16;break}return t.next=15,m(fj);case 15:return t.abrupt("return",t.sent);case 16:return t.abrupt("return",y);case 19:if(t.prev=19,t.t0=t.catch(7),s({error:t.t0,retryCount:d,propertyKey:a,timeInMs:performance.now()-v,args:r}),!vj(t.t0)||!f(hj)){t.next=24;break}return t.abrupt("return",m(hj));case 24:throw t.t0;case 25:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}return u()}}function bj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,o=t.maxInternalServerErrorRetryTimes,i=void 0===o?1:o,a=t.onDone,s=void 0===a?function(){}:a,c={get:function(e,t){var r=e[t];return"function"==typeof r&&"constructor"!==t?yj(r,{maxNetworkErrorRetryTimes:n,maxInternalServerErrorRetryTimes:i,propertyKey:t,onDone:s}):r}};return new Proxy(e,c)}var wj=Object.freeze({__proto__:null,createRetryAPIClient:bj,useApiClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCredentials,r=void 0===t?{}:t,n=e.tracking,o=void 0===n?{}:n,i=hv.useRef(null),a=function(){};if(null===i.current){var s=r.accessKey,c=r.secretKey,u=r.apiUrl,l=o.userId,d=vD({userId:l});i.current=bj(new jM(s,c,u,{httpHeaders:_P(_P({},pj),{},{"x-request-id":d})}),{onDone:a})}return{apiClient:i.current}}}),_j="BFnYsWrH",kj="KbKcY2nb",Cj=function(e){return e.split("").reverse().join("")},Sj=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)}))},Bj=window.fetch.bind(window);function Ej(e){var t,r,n=e.hasOwnProperty("words")?e.words:[],o=e.hasOwnProperty("sigBytes")?e.sigBytes:4*n.length,i=new Uint8Array(o),a=0;for(r=0;r<o;r++)t=n[r],i[a++]=t>>24,i[a++]=t>>16&255,i[a++]=t>>8&255,i[a++]=255&t;return i}var xj=function(){var e=EP(kP().mark((function e(){var t,r,n,o,i,a=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(Cj(_j)).concat(Cj(kj)),e.next=3,Bj.apply(void 0,a);case 3:return r=e.sent,e.next=6,r.text();case 6:return n=e.sent,o=uD.AES.decrypt(n,t),i=Ej(o),e.abrupt("return",{u8arr:i});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ij=function(){var e=EP(kP().mark((function e(){var t,r,n=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Bj.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)}}(),Aj=Object.freeze({__proto__:null,reverseString:Cj,loadExternalScript:Sj,fetchWithDecryption:xj,fetchRawResource:Ij}),Pj=/\s/,Tj=/^\s+/,Rj=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Pj.test(e.charAt(t)););return t}(e)+1).replace(Tj,""):e},Mj=/^[-+]0x[0-9a-f]+$/i,Dj=/^0b[01]+$/i,Lj=/^0o[0-7]+$/i,Oj=parseInt,Nj=function(e){return e?1/0===(e=function(e){if("number"==typeof e)return e;if(GR(e))return NaN;if(nT(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=nT(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Rj(e);var r=Dj.test(e);return r||Lj.test(e)?Oj(e.slice(2),r?2:8):Mj.test(e)?NaN:+e}(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},Fj=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=function(e){var t=Nj(e),r=t%1;return t==t?r?t-r:t:0}(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},Vj=function(e){return Fj(2,e)},jj=Vj(function(){var e=EP(kP().mark((function e(){var t,r,n,o,i,a,s,c,u,l,d,f,h=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.tfUrl,n=void 0===r?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.20.0/dist/tf.min.js":r,o=t.tfBackendWasmUrl,i=void 0===o?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.20.0/dist/tf-backend-wasm.js":o,a=t.tfBackendCpuUrl,s=void 0===a?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@3.20.0":a,c=t.tfLiteUrl,u=void 0===c?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite@0.0.1-alpha.8/dist/tf-tflite.min.js":c,l=t.blazefaceScriptUrl,d=void 0===l?"https://cdn.jsdelivr.net/npm/@tensorflow-models/blazeface@0.0.7":l,e.next=3,Sj({url:n});case 3:return f=[],i&&f.push(i),s&&f.push(s),d&&f.push(d),u&&f.push(u),e.next=10,Promise.all(f.map((function(e){return Sj({url:e})})));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());function Uj(){return(Uj=EP(kP().mark((function e(){var t,r,n,o,i,a,s,c,u=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},r=t.preferredBackends,n=void 0===r?["wasm","cpu"]:r,!window.tv_model_backend_init||window.tv_model_backend_init[0]!==n[0]){e.next=3;break}return e.abrupt("return");case 3:return o=window,i=o.tf,e.next=6,i.enableProdMode();case 6:a=OP(n),e.prev=7,a.s();case 9:if((s=a.n()).done){e.next=23;break}return c=s.value,e.prev=11,e.next=14,i.setBackend(c);case 14:return e.abrupt("break",23);case 17:if(e.prev=17,e.t0=e.catch(11),c!==n[n.length-1]){e.next=21;break}throw e.t0;case 21:e.next=9;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(7),a.e(e.t1);case 28:return e.prev=28,a.f(),e.finish(28);case 31:return e.next=33,i.ready();case 33:window.tv_model_backend_init=n;case 34:case"end":return e.stop()}}),e,null,[[7,25,28,31],[11,17]])})))).apply(this,arguments)}function zj(){return(zj=EP(kP().mark((function e(t){var r,n,o,i;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.modelUrl,n=window,o=n.blazeface,!r){e.next=8;break}return e.next=5,o.load({modelUrl:r});case 5:i=e.sent,e.next=11;break;case 8:return e.next=10,o.load();case 10:i=e.sent;case 11:return e.abrupt("return",{blazefaceModel:i});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qj(){return(qj=EP(kP().mark((function e(t){var r,n,o;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,e.next=3,Ij(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 Wj(e){return Hj.apply(this,arguments)}function Hj(){return(Hj=EP(kP().mark((function e(t){var r,n,o,i,a,s,c;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,n=t.options,o=void 0===n?{}:n,i=window,a=i.tflite,e.next=4,xj(r);case 4:return s=e.sent,c=s.u8arr,e.abrupt("return",a.loadTFLiteModel(c,_P({numThreads:1},o)));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Kj=Object.freeze({__proto__:null,loadTensorFlow:jj,initTensorFlow:function(){return Uj.apply(this,arguments)},loadBlazefaceModel:function(e){return zj.apply(this,arguments)},preloadResource:function(e){return qj.apply(this,arguments)},loadTFLiteModel:Wj}),Qj=Object.freeze({__proto__:null,enableAntiDebug:function(){var e,t,r=["action","gger","stateObject","apply","chain","test","input","Hello World!","constructor","counter","length","debu","call"];e=r,t=185,function(t){for(;--t;)e.push(e.shift())}(++t);var n,o,i=function(e,t){return r[e-=0]};function a(e){function t(e){if("string"==typeof e)return function(e){}[i("0x5")]("while (true) {}")[i("0x0")](i("0x6"));1!=="".concat(e/e)[i("0x7")]||e%20==0?function(){return!0}[i("0x5")]("".concat(i("0x8"),"gger"))[i("0x9")](i("0xa")):function(){return!1}.constructor("debu".concat(i("0xb")))[i("0x0")](i("0xc")),t(++e)}try{if(e)return t;t(0)}catch(e){}}setInterval((function(){a()}),4e3),n=!0,o=function(e,t){var r=n?function(){if(t){var r=t[i("0x0")](e,arguments);return t=null,r}}:function(){};return n=!1,r},function(){o(this,(function(){var e=new RegExp("function *\\( *\\)"),t=new RegExp("\\+\\+ *(?:_0x(?:[a-f0-9]){4,6}|(?:\\b|\\d)[a-z0-9]{1,4}(?:\\b|\\d))","i"),r=a("init");e.test(r+i("0x1"))&&t[i("0x2")](r+i("0x3"))?a():r("0")}))()}(),console.log(i("0x4"))}}),Gj=Object.freeze({__proto__:null,useThemeContext:function(){return hv.useContext(sw)}});function Xj(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Yj(e,t){return e&t}function $j(e,t){return e|t}function Zj(e,t){return e^t}function Jj(e,t){return e&~t}function eU(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 tU(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var rU,nU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function oU(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=nU.charAt(r>>6)+nU.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=nU.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=nU.charAt(r>>2)+nU.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function iU(e){var t,r="",n=0,o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var i=nU.indexOf(e.charAt(t));i<0||(0==n?(r+=Xj(i>>2),o=3&i,n=1):1==n?(r+=Xj(o<<2|i>>4),o=15&i,n=2):2==n?(r+=Xj(o),r+=Xj(i>>2),o=3&i,n=3):(r+=Xj(o<<2|i>>4),r+=Xj(15&i),n=0))}return 1==n&&(r+=Xj(o<<2)),r}var aU,sU={decode:function(e){var t;if(void 0===aU){var r="= \f\n\r\t \u2028\u2029";for(aU=Object.create(null),t=0;t<64;++t)aU["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(aU["-"]=62,aU._=63,t=0;t<r.length;++t)aU[r.charAt(t)]=-1}var n=[],o=0,i=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=aU[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);o|=a,++i>=4?(n[n.length]=o>>16,n[n.length]=o>>8&255,n[n.length]=255&o,o=0,i=0):o<<=6}}switch(i){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=o>>10;break;case 3:n[n.length]=o>>16,n[n.length]=o>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=sU.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 sU.decode(e)}},cU=1e13,uU=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var r,n,o=this.buf,i=o.length;for(r=0;r<i;++r)(n=o[r]*e+t)<cU?t=0:n-=(t=0|n/cU)*cU,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+=cU,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+=(cU+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*cU+e[r];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),lU=/^(\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)?)?$/,dU=/^(\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 fU(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var hU,pU=function(){function e(t,r){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=r)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,r){for(var n="",o=e;o<t;++o)if(n+=this.hexByte(this.get(o)),!0!==r)switch(15&o){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},e.prototype.isASCII=function(e,t){for(var r=e;r<t;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var r="",n=e;n<t;++n)r+=String.fromCharCode(this.get(n));return r},e.prototype.parseStringUTF=function(e,t){for(var r="",n=e;n<t;){var o=this.get(n++);r+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(n++)):String.fromCharCode((15&o)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},e.prototype.parseStringBMP=function(e,t){for(var r,n,o="",i=e;i<t;)r=this.get(i++),n=this.get(i++),o+=String.fromCharCode(r<<8|n);return o},e.prototype.parseTime=function(e,t,r){var n=this.parseStringISO(e,t),o=(r?lU:dU).exec(n);return o?(r&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),n=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(n+=":"+o[5],o[6]&&(n+=":"+o[6],o[7]&&(n+="."+o[7]))),o[8]&&(n+=" UTC","Z"!=o[8]&&(n+=o[8],o[9]&&(n+=":"+o[9]))),n):"Unrecognized time: "+n},e.prototype.parseInteger=function(e,t){for(var r,n=this.get(e),o=n>127,i=o?255:0,a="";n==i&&++e<t;)n=this.get(e);if(0==(r=t-e))return o?-1:0;if(r>4){for(a=n,r<<=3;0==(128&(+a^i));)a=+a<<1,--r;a="("+r+" bit)\n"}o&&(n-=256);for(var s=new uU(n),c=e+1;c<t;++c)s.mulAdd(256,this.get(c));return a+s.toString()},e.prototype.parseBitString=function(e,t,r){for(var n=this.get(e),o="("+((t-e-1<<3)-n)+" bit)\n",i="",a=e+1;a<t;++a){for(var s=this.get(a),c=a==t-1?n:0,u=7;u>=c;--u)i+=s>>u&1?"1":"0";if(i.length>r)return o+fU(i,r)}return o+i},e.prototype.parseOctetString=function(e,t,r){if(this.isASCII(e,t))return fU(this.parseStringISO(e,t),r);var n=t-e,o="("+n+" byte)\n";n>(r/=2)&&(t=e+r);for(var i=e;i<t;++i)o+=this.hexByte(this.get(i));return n>r&&(o+="…"),o},e.prototype.parseOID=function(e,t,r){for(var n="",o=new uU,i=0,a=e;a<t;++a){var s=this.get(a);if(o.mulAdd(128,127&s),i+=7,!(128&s)){if(""===n)if((o=o.simplify())instanceof uU)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 fU(n,r);o=new uU,i=0}}return i>0&&(n+=".incomplete"),n},e}(),mU=function(){function e(e,t,r,n,o){if(!(n instanceof gU))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 fU(this.stream.parseStringUTF(t,t+r),e);case 18:case 19:case 20:case 21:case 22:case 26:return fU(this.stream.parseStringISO(t,t+r),e);case 30:return fU(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 pU?t:new pU(t,0);var n=new pU(r),o=new gU(r),i=e.decodeLength(r),a=r.pos,s=a-n.pos,c=null,u=function(){var t=[];if(null!==i){for(var n=a+i;r.pos<n;)t[t.length]=e.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var o=e.decode(r);if(o.tag.isEOC())break;t[t.length]=o}i=a-r.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(o.tagConstructed)c=u();else if(o.isUniversal()&&(3==o.tagNumber||4==o.tagNumber))try{if(3==o.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");c=u();for(var l=0;l<c.length;++l)if(c[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){c=null}if(null===c){if(null===i)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);r.pos=a+Math.abs(i)}return new e(n,s,i,o,c)},e}(),gU=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 uU;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}(),vU=[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],yU=(1<<26)/vU[vU.length-1],bU=function(){function e(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,o=!1,i="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(r=this[a]>>s)>0&&(o=!0,i=Xj(r));a>=0;)s<t?(r=(this[a]&(1<<s)-1)<<t-s,r|=this[--a]>>(s+=this.DB-t)):(r=this[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(o=!0),o&&(i+=Xj(r));return o?i:"0"},e.prototype.negate=function(){var t=SU();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)+RU(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var r=SU();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 _U(t):new kU(t),this.exp(e,r)},e.prototype.clone=function(){var e=SU();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=SU();return this.bitwiseTo(e,Yj,t),t},e.prototype.or=function(e){var t=SU();return this.bitwiseTo(e,$j,t),t},e.prototype.xor=function(e){var t=SU();return this.bitwiseTo(e,Zj,t),t},e.prototype.andNot=function(e){var t=SU();return this.bitwiseTo(e,Jj,t),t},e.prototype.not=function(){for(var e=SU(),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=SU();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=SU();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+eU(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+=tU(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,$j)},e.prototype.clearBit=function(e){return this.changeBit(e,Jj)},e.prototype.flipBit=function(e){return this.changeBit(e,Zj)},e.prototype.add=function(e){var t=SU();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=SU();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=SU();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=SU();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=SU();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=SU(),r=SU();return this.divRemTo(e,t,r),[t,r]},e.prototype.modPow=function(e,t){var r,n,o=e.bitLength(),i=TU(1);if(o<=0)return i;r=o<18?1:o<48?3:o<144?4:o<768?5:6,n=o<8?new _U(t):t.isEven()?new CU(t):new kU(t);var a=[],s=3,c=r-1,u=(1<<r)-1;if(a[1]=n.convert(this),r>1){var l=SU();for(n.sqrTo(a[1],l);s<=u;)a[s]=SU(),n.mulTo(l,a[s-2],a[s]),s+=2}var d,f,h=e.t-1,p=!0,m=SU();for(o=RU(e[h])-1;h>=0;){for(o>=c?d=e[h]>>o-c&u:(d=(e[h]&(1<<o+1)-1)<<c-o,h>0&&(d|=e[h-1]>>this.DB+o-c)),s=r;0==(1&d);)d>>=1,--s;if((o-=s)<0&&(o+=this.DB,--h),p)a[d].copyTo(i),p=!1;else{for(;s>1;)n.sqrTo(i,m),n.sqrTo(m,i),s-=2;s>0?n.sqrTo(i,m):(f=i,i=m,m=f),n.mulTo(m,a[d],i)}for(;h>=0&&0==(e[h]&1<<o);)n.sqrTo(i,m),f=i,i=m,m=f,--o<0&&(o=this.DB-1,--h)}return n.revert(i)},e.prototype.modInverse=function(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return e.ZERO;for(var n=t.clone(),o=this.clone(),i=TU(1),a=TU(0),s=TU(0),c=TU(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;o.isEven();)o.rShiftTo(1,o),r?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(t,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(t,c),c.rShiftTo(1,c);n.compareTo(o)>=0?(n.subTo(o,n),r&&i.subTo(s,i),a.subTo(c,a)):(o.subTo(n,o),r&&s.subTo(i,s),c.subTo(a,c))}return 0!=o.compareTo(e.ONE)?e.ZERO:c.compareTo(t)>=0?c.subtract(t):c.signum()<0?(c.addTo(t,c),c.signum()<0?c.add(t):c):c},e.prototype.pow=function(e){return this.exp(e,new wU)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(o<i&&(i=o),i>0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},e.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=vU[vU.length-1]){for(t=0;t<vU.length;++t)if(r[0]==vU[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<vU.length;){for(var n=vU[t],o=t+1;o<vU.length&&n<yU;)n*=vU[o++];for(n=r.modInt(n);t<o;)if(n%vU[t++]==0)return!1}return r.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var o=t.length,i=!1,a=0;--o>=0;){var s=8==n?255&+t[o]:PU(t,o);s<0?"-"==t.charAt(o)&&(i=!0):(i=!1,0==a?this[this.t++]=s:a+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,(a+=n)>=this.DB&&(a-=this.DB))}8==n&&0!=(128&+t[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var r=e%this.DB,n=this.DB-r,o=(1<<n)-1,i=Math.floor(e/this.DB),a=this.s<<r&this.DM,s=this.t-1;s>=0;--s)t[s+i+1]=this[s]>>n|a,a=(this[s]&o)<<r;for(s=i-1;s>=0;--s)t[s]=0;t[i]=a,t.t=this.t+i+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,o=this.DB-n,i=(1<<n)-1;t[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)t[a-r-1]|=(this[a]&i)<<o,t[a-r]=this[a]>>n;n>0&&(t[this.t-r-1]|=(this.s&i)<<o),t.t=this.t-r,t.clamp()}},e.prototype.subTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},e.prototype.multiplyTo=function(t,r){var n=this.abs(),o=t.abs(),i=n.t;for(r.t=i+o.t;--i>=0;)r[i]=0;for(i=0;i<o.t;++i)r[i+n.t]=n.am(0,o[i],r,i,0,n.t);r.s=0,r.clamp(),this.s!=t.s&&e.ZERO.subTo(r,r)},e.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,r,n){var o=t.abs();if(!(o.t<=0)){var i=this.abs();if(i.t<o.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=SU());var a=SU(),s=this.s,c=t.s,u=this.DB-RU(o[o.t-1]);u>0?(o.lShiftTo(u,a),i.lShiftTo(u,n)):(o.copyTo(a),i.copyTo(n));var l=a.t,d=a[l-1];if(0!=d){var f=d*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0),h=this.FV/f,p=(1<<this.F1)/f,m=1<<this.F2,g=n.t,v=g-l,y=null==r?SU():r;for(a.dlShiftTo(v,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),e.ONE.dlShiftTo(l,y),y.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--v>=0;){var b=n[--g]==d?this.DM:Math.floor(n[g]*h+(n[g-1]+m)*p);if((n[g]+=a.am(0,b,n,v,0,l))<b)for(a.dlShiftTo(v,y),n.subTo(y,n);n[g]<--b;)n.subTo(y,n)}null!=r&&(n.drShiftTo(l,r),s!=c&&e.ZERO.subTo(r,r)),n.t=l,n.clamp(),u>0&&n.rShiftTo(u,n),s<0&&e.ZERO.subTo(n,n)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,r){if(t>4294967295||t<1)return e.ONE;var n=SU(),o=SU(),i=r.convert(this),a=RU(t)-1;for(i.copyTo(n);--a>=0;)if(r.sqrTo(n,o),(t&1<<a)>0)r.mulTo(o,i,n);else{var s=n;n=o,o=s}return r.revert(n)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=TU(r),o=SU(),i=SU(),a="";for(this.divRemTo(n,o,i);o.signum()>0;)a=(r+i.intValue()).toString(e).substr(1)+a,o.divRemTo(n,o,i);return i.intValue().toString(e)+a},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),o=Math.pow(r,n),i=!1,a=0,s=0,c=0;c<t.length;++c){var u=PU(t,c);u<0?"-"==t.charAt(c)&&0==this.signum()&&(i=!0):(s=r*s+u,++a>=n&&(this.dMultiply(o),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(r,a)),this.dAddOffset(s,0)),i&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,n){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),$j,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var o=[],i=7&t;o.length=1+(t>>3),r.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},e.prototype.bitwiseTo=function(e,t,r){var n,o,i=Math.min(e.t,this.t);for(n=0;n<i;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=i;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},e.prototype.changeBit=function(t,r){var n=e.ONE.shiftLeft(t);return this.bitwiseTo(n,r,n),n},e.prototype.addTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var o=r.t-this.t;n<o;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(o=Math.min(e.t,t);n<o;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()},e.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},e.prototype.millerRabin=function(t){var r=this.subtract(e.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var o=r.shiftRight(n);(t=t+1>>1)>vU.length&&(t=vU.length);for(var i=SU(),a=0;a<t;++a){i.fromInt(vU[Math.floor(Math.random()*vU.length)]);var s=i.modPow(o,this);if(0!=s.compareTo(e.ONE)&&0!=s.compareTo(r)){for(var c=1;c++<n&&0!=s.compareTo(r);)if(0==(s=s.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=s.compareTo(r))return!1}}return!0},e.prototype.square=function(){var e=SU();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var r=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(r.compareTo(n)<0){var o=r;r=n,n=o}var i=r.getLowestSetBit(),a=n.getLowestSetBit();if(a<0)t(r);else{i<a&&(a=i),a>0&&(r.rShiftTo(a,r),n.rShiftTo(a,n));setTimeout((function e(){(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(e,0):(a>0&&n.lShiftTo(a,n),setTimeout((function(){t(n)}),0))}),10)}},e.prototype.fromNumberAsync=function(t,r,n,o){if("number"==typeof r)if(t<2)this.fromInt(1);else{this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),$j,this),this.isEven()&&this.dAddOffset(1,0);var i=this;setTimeout((function n(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(e.ONE.shiftLeft(t-1),i),i.isProbablePrime(r)?setTimeout((function(){o()}),0):setTimeout(n,0)}),0)}else{var a=[],s=7&t;a.length=1+(t>>3),r.nextBytes(a),s>0?a[0]&=(1<<s)-1:a[0]=0,this.fromString(a,256)}},e}(),wU=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}(),_U=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}(),kU=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=SU();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(bU.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=SU();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}(),CU=function(){function e(e){this.m=e,this.r2=SU(),this.q3=SU(),bU.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=SU();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 SU(){return new bU(null)}function BU(e,t){return new bU(e,t)}var EU="undefined"!=typeof navigator;EU&&"Microsoft Internet Explorer"==navigator.appName?(bU.prototype.am=function(e,t,r,n,o,i){for(var a=32767&t,s=t>>15;--i>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;o=((c=a*c+((32767&l)<<15)+r[n]+(1073741823&o))>>>30)+(l>>>15)+s*u+(o>>>30),r[n++]=1073741823&c}return o},hU=30):EU&&"Netscape"!=navigator.appName?(bU.prototype.am=function(e,t,r,n,o,i){for(;--i>=0;){var a=t*this[e++]+r[n]+o;o=Math.floor(a/67108864),r[n++]=67108863&a}return o},hU=26):(bU.prototype.am=function(e,t,r,n,o,i){for(var a=16383&t,s=t>>14;--i>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;o=((c=a*c+((16383&l)<<14)+r[n]+o)>>28)+(l>>14)+s*u,r[n++]=268435455&c}return o},hU=28),bU.prototype.DB=hU,bU.prototype.DM=(1<<hU)-1,bU.prototype.DV=1<<hU,bU.prototype.FV=Math.pow(2,52),bU.prototype.F1=52-hU,bU.prototype.F2=2*hU-52;var xU,IU,AU=[];for(xU="0".charCodeAt(0),IU=0;IU<=9;++IU)AU[xU++]=IU;for(xU="a".charCodeAt(0),IU=10;IU<36;++IU)AU[xU++]=IU;for(xU="A".charCodeAt(0),IU=10;IU<36;++IU)AU[xU++]=IU;function PU(e,t){var r=AU[e.charCodeAt(t)];return null==r?-1:r}function TU(e){var t=SU();return t.fromInt(e),t}function RU(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}bU.ZERO=TU(0),bU.ONE=TU(1);var MU,DU,LU=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}(),OU=null;if(null==OU){OU=[],DU=0;var NU=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var FU=new Uint32Array(256);for(window.crypto.getRandomValues(FU),NU=0;NU<FU.length;++NU)OU[DU++]=255&FU[NU]}var VU=0,jU=function e(t){if((VU=VU||0)>=256||DU>=256)window.removeEventListener?window.removeEventListener("mousemove",e,!1):window.detachEvent&&window.detachEvent("onmousemove",e);else try{var r=t.x+t.y;OU[DU++]=255&r,VU+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",jU,!1):window.attachEvent&&window.attachEvent("onmousemove",jU))}function UU(){if(null==MU){for(MU=new LU;DU<256;){var e=Math.floor(65536*Math.random());OU[DU++]=255&e}for(MU.init(OU),DU=0;DU<OU.length;++DU)OU[DU]=0;DU=0}return MU.next()}var zU=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=UU()},e}(),qU=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=BU(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=this.n.bitLength()+7>>3,r=function(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=e.length-1;n>=0&&t>0;){var o=e.charCodeAt(n--);o<128?r[--t]=o:o>127&&o<2048?(r[--t]=63&o|128,r[--t]=o>>6|192):(r[--t]=63&o|128,r[--t]=o>>6&63|128,r[--t]=o>>12|224)}r[--t]=0;for(var i=new zU,a=[];t>2;){for(a[0]=0;0==a[0];)i.nextBytes(a);r[--t]=a[0]}return r[--t]=2,r[--t]=0,new bU(r)}(e,t);if(null==r)return null;var n=this.doPublic(r);if(null==n)return null;for(var o=n.toString(16),i=o.length,a=0;a<2*t-i;a++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,r){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=BU(e,16),this.e=parseInt(t,16),this.d=BU(r,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,r,n,o,i,a,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=BU(e,16),this.e=parseInt(t,16),this.d=BU(r,16),this.p=BU(n,16),this.q=BU(o,16),this.dmp1=BU(i,16),this.dmq1=BU(a,16),this.coeff=BU(s,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var r=new zU,n=e>>1;this.e=parseInt(t,16);for(var o=new bU(t,16);;){for(;this.p=new bU(e-n,1,r),0!=this.p.subtract(bU.ONE).gcd(o).compareTo(bU.ONE)||!this.p.isProbablePrime(10););for(;this.q=new bU(n,1,r),0!=this.q.subtract(bU.ONE).gcd(o).compareTo(bU.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var i=this.p;this.p=this.q,this.q=i}var a=this.p.subtract(bU.ONE),s=this.q.subtract(bU.ONE),c=a.multiply(s);if(0==c.gcd(o).compareTo(bU.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(c),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=BU(e,16),r=this.doPrivate(t);return null==r?null:function(e,t){for(var r=e.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=t-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var o="";++n<r.length;){var i=255&r[n];i<128?o+=String.fromCharCode(i):i>191&&i<224?(o+=String.fromCharCode((31&i)<<6|63&r[n+1]),++n):(o+=String.fromCharCode((15&i)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return o}(r,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,r){var n=new zU,o=e>>1;this.e=parseInt(t,16);var i=new bU(t,16),a=this;setTimeout((function t(){var s=function(){if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var n=a.p.subtract(bU.ONE),o=a.q.subtract(bU.ONE),s=n.multiply(o);0==s.gcd(i).compareTo(bU.ONE)?(a.n=a.p.multiply(a.q),a.d=i.modInverse(s),a.dmp1=a.d.mod(n),a.dmq1=a.d.mod(o),a.coeff=a.q.modInverse(a.p),setTimeout((function(){r()}),0)):setTimeout(t,0)},c=function e(){a.q=SU(),a.q.fromNumberAsync(o,1,n,(function(){a.q.subtract(bU.ONE).gcda(i,(function(t){0==t.compareTo(bU.ONE)&&a.q.isProbablePrime(10)?setTimeout(s,0):setTimeout(e,0)}))}))};setTimeout((function t(){a.p=SU(),a.p.fromNumberAsync(e-o,1,n,(function(){a.p.subtract(bU.ONE).gcda(i,(function(e){0==e.compareTo(bU.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(t,0)}))}))}),0)}),0)},e.prototype.sign=function(e,t,r){var n=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var r=t-e.length-6,n="",o=0;o<r;o+=2)n+="ff";return BU("0001"+n+"00"+e,16)}((WU[r]||"")+t(e).toString(),this.n.bitLength()/4);if(null==n)return null;var o=this.doPrivate(n);if(null==o)return null;var i=o.toString(16);return 0==(1&i.length)?i:"0"+i},e.prototype.verify=function(e,t,r){var n=BU(t,16),o=this.doPublic(n);return null==o?null:function(e){for(var t in WU)if(WU.hasOwnProperty(t)){var r=WU[t],n=r.length;if(e.substr(0,n)==r)return e.substr(n)}return e}
38
38
  /*!
39
39
  Copyright (c) 2011, Yahoo! Inc. All rights reserved.
40
40
  Code licensed under the BSD License:
@@ -49,7 +49,7 @@ function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=o.create([0,1,2,
49
49
  * @since jsrsasign 2.1
50
50
  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
51
51
  */
52
- var KU={};void 0!==KU.asn1&&KU.asn1||(KU.asn1={}),KU.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 bU(n,16).xor(e).add(bU.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=KU.asn1,r=t.DERBoolean,n=t.DERInteger,o=t.DERBitString,i=t.DEROctetString,a=t.DERNull,s=t.DERObjectIdentifier,c=t.DEREnumerated,u=t.DERUTF8String,l=t.DERNumericString,d=t.DERPrintableString,f=t.DERTeletexString,h=t.DERIA5String,p=t.DERUTCTime,m=t.DERGeneralizedTime,g=t.DERSequence,v=t.DERSet,y=t.DERTaggedObject,b=t.ASN1Util.newObject,w=Object.keys(e);if(1!=w.length)throw"key of param shall be only one.";var _=w[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+_+":"))throw"undefined key: "+_;if("bool"==_)return new r(e[_]);if("int"==_)return new n(e[_]);if("bitstr"==_)return new o(e[_]);if("octstr"==_)return new i(e[_]);if("null"==_)return new a(e[_]);if("oid"==_)return new s(e[_]);if("enum"==_)return new c(e[_]);if("utf8str"==_)return new u(e[_]);if("numstr"==_)return new l(e[_]);if("prnstr"==_)return new d(e[_]);if("telstr"==_)return new f(e[_]);if("ia5str"==_)return new h(e[_]);if("utctime"==_)return new p(e[_]);if("gentime"==_)return new m(e[_]);if("seq"==_){for(var k=e[_],C=[],S=0;S<k.length;S++){var B=b(k[S]);C.push(B)}return new g({array:C})}if("set"==_){for(k=e[_],C=[],S=0;S<k.length;S++)B=b(k[S]),C.push(B);return new v({array:C})}if("tag"==_){var E=e[_];if("[object Array]"===Object.prototype.toString.call(E)&&3==E.length){var x=b(E[2]);return new y({tag:E[0],explicit:E[1],obj:x})}var I={};if(void 0!==E.explicit&&(I.explicit=E.explicit),void 0!==E.tag&&(I.tag=E.tag),void 0===E.obj)throw"obj shall be specified for 'tag'.";return I.obj=b(E.obj),new y(I)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},KU.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),o=2;o<e.length;o+=2){var i=("00000000"+parseInt(e.substr(o,2),16).toString(2)).slice(-8);n+=i.substr(1,7),"0"==i.substr(0,1)&&(t=t+"."+new bU(n,2).toString(10),n="")}return t},KU.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 bU(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);return n},KU.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""}},KU.asn1.DERAbstractString=function(e){KU.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))},HU.lang.extend(KU.asn1.DERAbstractString,KU.asn1.ASN1Object),KU.asn1.DERAbstractTime=function(e){KU.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,r){var n=this.zeroPadding,o=this.localDateToUTC(e),i=String(o.getFullYear());"utc"==t&&(i=i.substr(2,2));var a=i+n(String(o.getMonth()+1),2)+n(String(o.getDate()),2)+n(String(o.getHours()),2)+n(String(o.getMinutes()),2)+n(String(o.getSeconds()),2);if(!0===r){var s=o.getMilliseconds();if(0!=s){var c=n(String(s),3);a=a+"."+(c=c.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,r,n,o,i){var a=new Date(Date.UTC(e,t-1,r,n,o,i,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},HU.lang.extend(KU.asn1.DERAbstractTime,KU.asn1.ASN1Object),KU.asn1.DERAbstractStructured=function(e){KU.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)},HU.lang.extend(KU.asn1.DERAbstractStructured,KU.asn1.ASN1Object),KU.asn1.DERBoolean=function(){KU.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},HU.lang.extend(KU.asn1.DERBoolean,KU.asn1.ASN1Object),KU.asn1.DERInteger=function(e){KU.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=KU.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bU(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))},HU.lang.extend(KU.asn1.DERInteger,KU.asn1.ASN1Object),KU.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=KU.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}KU.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var o=e.substr(r,8),i=parseInt(o,2).toString(16);1==i.length&&(i="0"+i),n+=i}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},HU.lang.extend(KU.asn1.DERBitString,KU.asn1.ASN1Object),KU.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=KU.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}KU.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},HU.lang.extend(KU.asn1.DEROctetString,KU.asn1.DERAbstractString),KU.asn1.DERNull=function(){KU.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},HU.lang.extend(KU.asn1.DERNull,KU.asn1.ASN1Object),KU.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 bU(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};KU.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var t=KU.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))},HU.lang.extend(KU.asn1.DERObjectIdentifier,KU.asn1.ASN1Object),KU.asn1.DEREnumerated=function(e){KU.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=KU.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bU(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))},HU.lang.extend(KU.asn1.DEREnumerated,KU.asn1.ASN1Object),KU.asn1.DERUTF8String=function(e){KU.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},HU.lang.extend(KU.asn1.DERUTF8String,KU.asn1.DERAbstractString),KU.asn1.DERNumericString=function(e){KU.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},HU.lang.extend(KU.asn1.DERNumericString,KU.asn1.DERAbstractString),KU.asn1.DERPrintableString=function(e){KU.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},HU.lang.extend(KU.asn1.DERPrintableString,KU.asn1.DERAbstractString),KU.asn1.DERTeletexString=function(e){KU.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},HU.lang.extend(KU.asn1.DERTeletexString,KU.asn1.DERAbstractString),KU.asn1.DERIA5String=function(e){KU.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},HU.lang.extend(KU.asn1.DERIA5String,KU.asn1.DERAbstractString),KU.asn1.DERUTCTime=function(e){KU.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))},HU.lang.extend(KU.asn1.DERUTCTime,KU.asn1.DERAbstractTime),KU.asn1.DERGeneralizedTime=function(e){KU.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))},HU.lang.extend(KU.asn1.DERGeneralizedTime,KU.asn1.DERAbstractTime),KU.asn1.DERSequence=function(e){KU.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}},HU.lang.extend(KU.asn1.DERSequence,KU.asn1.DERAbstractStructured),KU.asn1.DERSet=function(e){KU.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)},HU.lang.extend(KU.asn1.DERSet,KU.asn1.DERAbstractStructured),KU.asn1.DERTaggedObject=function(e){KU.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)))},HU.lang.extend(KU.asn1.DERTaggedObject,KU.asn1.ASN1Object);var QU,GU=(QU=function(e,t){return(QU=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}QU(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),XU=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 GU(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)?function(e){var t;if(void 0===rU){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(rU={},t=0;t<16;++t)rU[r.charAt(t)]=t;for(r=r.toLowerCase(),t=10;t<16;++t)rU[r.charAt(t)]=t;for(t=0;t<n.length;++t)rU[n.charAt(t)]=-1}var o=[],i=0,a=0;for(t=0;t<e.length;++t){var s=e.charAt(t);if("="==s)break;if(-1!=(s=rU[s])){if(void 0===s)throw new Error("Illegal character at offset "+t);i|=s,++a>=2?(o[o.length]=i,i=0,a=0):i<<=4}}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return o}(e):sU.unarmor(e),o=mU.decode(n);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=BU(t,16),r=o.sub[2].getHexStringValue(),this.e=parseInt(r,16);var i=o.sub[3].getHexStringValue();this.d=BU(i,16);var a=o.sub[4].getHexStringValue();this.p=BU(a,16);var s=o.sub[5].getHexStringValue();this.q=BU(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=BU(c,16);var u=o.sub[7].getHexStringValue();this.dmq1=BU(u,16);var l=o.sub[8].getHexStringValue();this.coeff=BU(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=BU(t,16),r=d.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=o.sub[0].getHexStringValue(),this.n=BU(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 KU.asn1.DERInteger({int:0}),new KU.asn1.DERInteger({bigint:this.n}),new KU.asn1.DERInteger({int:this.e}),new KU.asn1.DERInteger({bigint:this.d}),new KU.asn1.DERInteger({bigint:this.p}),new KU.asn1.DERInteger({bigint:this.q}),new KU.asn1.DERInteger({bigint:this.dmp1}),new KU.asn1.DERInteger({bigint:this.dmq1}),new KU.asn1.DERInteger({bigint:this.coeff})]};return new KU.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return oU(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new KU.asn1.DERSequence({array:[new KU.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new KU.asn1.DERNull]}),t=new KU.asn1.DERSequence({array:[new KU.asn1.DERInteger({bigint:this.n}),new KU.asn1.DERInteger({int:this.e})]}),r=new KU.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new KU.asn1.DERSequence({array:[e,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return oU(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}(qU),YU=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 XU(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(iU(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return oU(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,t,r){try{return oU(this.getKey().sign(e,t,r))}catch(e){return!1}},e.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,iU(t),r)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new XU,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}(),$U=["-","-","-","-","-","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","-","-","-","-","-"];function ZU(e){return JU.apply(this,arguments)}function JU(){return(JU=EP(kP().mark((function e(t){var r,n,o;return kP().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)}function ez(e){return MP(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}var tz=function(e){var t=e.base64,r=e.key;return new Promise((function(e){ZU({key:r}).then((function(r){var n=function(e){return Uint8Array.from(atob(e),(function(e){return e.charCodeAt(0)})).buffer}(t);window.crypto.subtle.importKey("raw",r,"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){e({hex:ez(t)})}))}))})).catch((function(t){console.error("EncryptBase64 error: ",t),e(t)}))}))},rz=function(e){var t=new YU,r=$U.join("");return t.setPublicKey(r),iU(t.encrypt(e))},nz=function(e,t){return new Promise((function(r){var n=(new TextEncoder).encode(e);window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(e){r({hex:ez(e)})})).catch((function(t){console.error("EncryptString error: ",t),r(e)}))}))};function oz(e,t){return iz.apply(this,arguments)}function iz(){return(iz=EP(kP().mark((function e(t,r){var n,o,i;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.slice(0,16),o=r.slice(-16),(i=new Uint8Array(32)).set(new Uint8Array(n),0),i.set(new Uint8Array(o),n.byteLength),e.abrupt("return",window.crypto.subtle.importKey("raw",i,"AES-GCM",!0,["encrypt","decrypt"]));case 9:return e.prev=9,e.t0=e.catch(0),console.error("combineKeys error: ",e.t0),e.abrupt("return",null);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}var az,sz,cz,uz=Object.freeze({__proto__:null,processKey:ZU,encryptBase64:tz,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;ZU({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){e({hex:ez(t)})}))}))}))},n.readAsArrayBuffer(t)}))},encryptWithRSAPublicKey:rz,encryptString:nz,combineKeys:oz}),lz=function(){var e=EP(kP().mark((function e(t,r){var n,o,i,a,s,c,u,l,d;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",new Promise((function(e){return e(null)})));case 2:return e.prev=2,e.next=5,ZU({key:r});case 5:return n=e.sent,e.next=8,window.crypto.subtle.importKey("raw",n,"AES-GCM",!0,["encrypt","decrypt"]);case 8:return o=e.sent,e.next=11,window.crypto.subtle.exportKey("raw",o);case 11:return i=e.sent,a=QM().replace(/-/g,""),s=new TextEncoder,c=s.encode(a),e.next=17,oz(i,c);case 17:return u=e.sent,e.next=20,nz(t,u);case 20:return l=e.sent,e.next=23,rz(a);case 23:return d=e.sent,e.abrupt("return","".concat(l.hex,"::").concat(d));case 27:return e.prev=27,e.t0=e.catch(2),console.error("encryptFrameMetadata error: ",e.t0),e.abrupt("return",t);case 31:case"end":return e.stop()}}),e,null,[[2,27]])})));return function(t,r){return e.apply(this,arguments)}}(),dz=Object.freeze({__proto__:null,encryptFrameBase64:function(e,t){return new Promise(e?function(r){tz({base64:e,key:t}).then((function(e){r(e.hex)})).catch((function(t){console.error("encryptFrameBase64 error: ",t),r(e)}))}:function(e){return e(null)})},encryptFrameMetadata:lz}),fz=AP((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;xP(this,e),this.interval=t,this.second=0,this.timeStone={origin:0},this.callbacks={}}),[{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={}}}]),hz=WP((function(e,t){!function(){var r={};function n(e){return d(">"+h("B",e.length),e)}function o(e){return d(">"+h("H",e.length),e)}function i(e){return d(">"+h("L",e.length),e)}function a(e,t,r){var a,s,c,u,l="",f="";if("Byte"==t)(a=e.length)<=4?f=n(e)+h("\0",4-a):(f=d(">L",[r]),l=n(e));else if("Short"==t)(a=e.length)<=2?f=o(e)+h("\0\0",2-a):(f=d(">L",[r]),l=o(e));else if("Long"==t)(a=e.length)<=1?f=i(e):(f=d(">L",[r]),l=i(e));else if("Ascii"==t)(a=(s=e+"\0").length)>4?(f=d(">L",[r]),l=s):f=s+h("\0",4-a);else if("Rational"==t){if("number"==typeof e[0])a=1,c=e[0],u=e[1],s=d(">L",[c])+d(">L",[u]);else{a=e.length,s="";for(var p=0;p<a;p++)c=e[p][0],u=e[p][1],s+=d(">L",[c])+d(">L",[u])}f=d(">L",[r]),l=s}else if("SRational"==t){if("number"==typeof e[0])a=1,c=e[0],u=e[1],s=d(">l",[c])+d(">l",[u]);else for(a=e.length,s="",p=0;p<a;p++)c=e[p][0],u=e[p][1],s+=d(">l",[c])+d(">l",[u]);f=d(">L",[r]),l=s}else"Undefined"==t&&((a=e.length)>4?(f=d(">L",[r]),l=e):f=e+h("\0",4-a));return[d(">L",[a]),f,l]}function s(e,t,r){var n,o=Object.keys(e).length,i=d(">H",[o]);n=["0th","1st"].indexOf(t)>-1?2+12*o+4:2+12*o;var s="",c="";for(var u in e)if("string"==typeof u&&(u=parseInt(u)),!("0th"==t&&[34665,34853].indexOf(u)>-1||"Exif"==t&&40965==u||"1st"==t&&[513,514].indexOf(u)>-1)){var l=e[u],f=d(">H",[u]),h=g[t][u].type,p=d(">H",[m[h]]);"number"==typeof l&&(l=[l]);var v=a(l,h,8+n+r+c.length);s+=f+p+v[0]+v[1],c+=v[2]}return[i+s,c]}function c(e){var t;if("ÿØ"==e.slice(0,2))t=function(e){for(var t,r=0;r<e.length;r++)if("ÿá"==(t=e[r]).slice(0,2)&&"Exif\0\0"==t.slice(4,10))return t;return null}(p(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=p(e).filter((function(e){return!("ÿá"==e.slice(0,2)&&"Exif\0\0"==e.slice(4,10))})).join("");return t&&(r="data:image/jpeg;base64,"+u(r)),r},r.insert=function(e,t){var r=!1;if("Exif\0\0"!=e.slice(0,6))throw new Error("Given data is not exif.");if("ÿØ"==t.slice(0,2));else{if("data:image/jpeg;base64,"!=t.slice(0,23)&&"data:image/jpg;base64,"!=t.slice(0,22))throw new Error("Given data is not jpeg.");t=l(t.split(",")[1]),r=!0}var n="ÿá"+d(">H",[e.length+2])+e,o=function(e,t){var r=!1,n=[];return e.forEach((function(o,i){"ÿá"==o.slice(0,2)&&"Exif\0\0"==o.slice(4,10)&&(r?n.unshift(i):(e[i]=t,r=!0))})),n.forEach((function(t){e.splice(t,1)})),!r&&t&&(e=[e[0],t].concat(e.slice(1))),e.join("")}(p(t),n);return r&&(o="data:image/jpeg;base64,"+u(o)),o},r.load=function(e){var t;if("string"!=typeof e)throw new Error("'load' gots invalid type argument.");if("ÿØ"==e.slice(0,2))t=e;else if("data:image/jpeg;base64,"==e.slice(0,23)||"data:image/jpg;base64,"==e.slice(0,22))t=l(e.split(",")[1]);else{if("Exif"!=e.slice(0,4))throw new Error("'load' gots invalid file data.");t=e.slice(6)}var r={"0th":{},Exif:{},GPS:{},Interop:{},"1st":{},thumbnail:null},n=new c(t);if(null===n.tiftag)return r;"II"==n.tiftag.slice(0,2)?n.endian_mark="<":n.endian_mark=">";var o=f(n.endian_mark+"L",n.tiftag.slice(4,8))[0];r["0th"]=n.get_ifd(o,"0th");var i=r["0th"].first_ifd_pointer;if(delete r["0th"].first_ifd_pointer,34665 in r["0th"]&&(o=r["0th"][34665],r.Exif=n.get_ifd(o,"Exif")),34853 in r["0th"]&&(o=r["0th"][34853],r.GPS=n.get_ifd(o,"GPS")),40965 in r.Exif&&(o=r.Exif[40965],r.Interop=n.get_ifd(o,"Interop")),"\0\0\0\0"!=i&&(o=f(n.endian_mark+"L",i)[0],r["1st"]=n.get_ifd(o,"1st"),513 in r["1st"]&&514 in r["1st"])){var a=r["1st"][513]+r["1st"][514],s=n.tiftag.slice(r["1st"][513],a);r.thumbnail=s}return r},r.dump=function(e){var t,n,o,i,a,c,u=(t=e,JSON.parse(JSON.stringify(t))),l=!1,f=!1,h=!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,h=!0,i=u.Interop):Object.keys(o).indexOf(r.ExifIFD.InteroperabilityTag.toString())>-1&&delete o[40965]):Object.keys(n).indexOf(r.ImageIFD.ExifTag.toString())>-1&&delete n[34665],"GPS"in u&&Object.keys(u.GPS).length?(n[r.ImageIFD.GPSTag]=1,f=!0,a=u.GPS):Object.keys(n).indexOf(r.ImageIFD.GPSTag.toString())>-1&&delete n[r.ImageIFD.GPSTag],"1st"in u&&"thumbnail"in u&&null!=u.thumbnail&&(g=!0,u["1st"][513]=1,u["1st"][514]=1,c=u["1st"]);var v,y,b,w=s(n,"0th",0),_=w[0].length+12*l+12*f+4+w[1].length,k="",C=0,S="",B=0,E="",x=0,I="";if(l&&(C=(v=s(o,"Exif",_))[0].length+12*h+v[1].length),f&&(B=(S=s(a,"GPS",_+C).join("")).length),h&&(x=(E=s(i,"Interop",_+C+B).join("")).length),g&&(y=s(c,"1st",_+C+B+x),(b=function(e){for(var t=p(e);"ÿà"<=t[1].slice(0,2)&&t[1].slice(0,2)<="ÿï";)t=[t[0]].concat(t.slice(2));return t.join("")}(u.thumbnail)).length>64e3))throw new Error("Given thumbnail is too large. max 64kB");var A="",P="",T="",R="\0\0\0\0";if(l){var M=d(">L",[D=8+_]);A=d(">H",[34665])+d(">H",[m.Long])+d(">L",[1])+M}if(f&&(M=d(">L",[D=8+_+C]),P=d(">H",[34853])+d(">H",[m.Long])+d(">L",[1])+M),h&&(M=d(">L",[D=8+_+C+B]),T=d(">H",[40965])+d(">H",[m.Long])+d(">L",[1])+M),g){var D;R=d(">L",[D=8+_+C+B+x]);var L="\0\0\0\0"+d(">L",[D+y[0].length+24+4+y[1].length]),O="\0\0\0\0"+d(">L",[b.length]);I=y[0]+L+O+"\0\0\0\0"+y[1]+b}var N=w[0]+A+P+R+w[1];return l&&(k=v[0]+T+v[1]),"Exif\0\0MM\0*\0\0\0\b"+N+k+S+E+I},c.prototype={get_ifd:function(e,t){var r,n={},o=f(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],i=e+2;r=["0th","1st"].indexOf(t)>-1?"Image":t;for(var a=0;a<o;a++){e=i+12*a;var s=f(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],c=[f(this.endian_mark+"H",this.tiftag.slice(e+2,e+4))[0],f(this.endian_mark+"L",this.tiftag.slice(e+4,e+8))[0],this.tiftag.slice(e+8,e+12)];s in g[r]&&(n[s]=this.convert_value(c))}return"0th"==t&&(e=i+12*o,n.first_ifd_pointer=this.tiftag.slice(e,e+4)),n},convert_value:function(e){var t,r=null,n=e[0],o=e[1],i=e[2];if(1==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+h("B",o),this.tiftag.slice(t,t+o))):r=f(this.endian_mark+h("B",o),i.slice(0,o));else if(2==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=this.tiftag.slice(t,t+o-1)):r=i.slice(0,o-1);else if(3==n)o>2?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+h("H",o),this.tiftag.slice(t,t+2*o))):r=f(this.endian_mark+h("H",o),i.slice(0,2*o));else if(4==n)o>1?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+h("L",o),this.tiftag.slice(t,t+4*o))):r=f(this.endian_mark+h("L",o),i);else if(5==n)if(t=f(this.endian_mark+"L",i)[0],o>1){r=[];for(var a=0;a<o;a++)r.push([f(this.endian_mark+"L",this.tiftag.slice(t+8*a,t+4+8*a))[0],f(this.endian_mark+"L",this.tiftag.slice(t+4+8*a,t+8+8*a))[0]])}else r=[f(this.endian_mark+"L",this.tiftag.slice(t,t+4))[0],f(this.endian_mark+"L",this.tiftag.slice(t+4,t+8))[0]];else if(7==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=this.tiftag.slice(t,t+o)):r=i.slice(0,o);else if(9==n)o>1?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+h("l",o),this.tiftag.slice(t,t+4*o))):r=f(this.endian_mark+h("l",o),i);else{if(10!=n)throw new Error("Exif might be wrong. Got incorrect value type to decode. type:"+n);if(t=f(this.endian_mark+"L",i)[0],o>1)for(r=[],a=0;a<o;a++)r.push([f(this.endian_mark+"l",this.tiftag.slice(t+8*a,t+4+8*a))[0],f(this.endian_mark+"l",this.tiftag.slice(t+4+8*a,t+8+8*a))[0]]);else r=[f(this.endian_mark+"l",this.tiftag.slice(t,t+4))[0],f(this.endian_mark+"l",this.tiftag.slice(t+4,t+8))[0]]}return r instanceof Array&&1==r.length?r[0]:r}},"undefined"!=typeof window&&"function"==typeof window.btoa)var u=window.btoa;if(void 0===u&&(u=function(e){for(var t,r,n,o,i,a,s,c="",u=0,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";u<e.length;)o=(t=e.charCodeAt(u++))>>2,i=(3&t)<<4|(r=e.charCodeAt(u++))>>4,a=(15&r)<<2|(n=e.charCodeAt(u++))>>6,s=63&n,isNaN(r)?a=s=64:isNaN(n)&&(s=64),c=c+l.charAt(o)+l.charAt(i)+l.charAt(a)+l.charAt(s);return c}),"undefined"!=typeof window&&"function"==typeof window.atob)var l=window.atob;function d(e,t){if(!(t instanceof Array))throw new Error("'pack' error. Got invalid type argument.");if(e.length-1!=t.length)throw new Error("'pack' error. "+(e.length-1)+" marks, "+t.length+" elements.");var r;if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("");r=!1}for(var n="",o=1,i=null,a=null,s=null;a=e[o];){if("b"==a.toLowerCase()){if(i=t[o-1],"b"==a&&i<0&&(i+=256),i>255||i<0)throw new Error("'pack' error.");s=String.fromCharCode(i)}else if("H"==a){if((i=t[o-1])>65535||i<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(i%65536/256))+String.fromCharCode(i%256),r&&(s=s.split("").reverse().join(""))}else{if("l"!=a.toLowerCase())throw new Error("'pack' error.");if(i=t[o-1],"l"==a&&i<0&&(i+=4294967296),i>4294967295||i<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(i/16777216))+String.fromCharCode(Math.floor(i%16777216/65536))+String.fromCharCode(Math.floor(i%65536/256))+String.fromCharCode(i%256),r&&(s=s.split("").reverse().join(""))}n+=s,o+=1}return n}function f(e,t){if("string"!=typeof t)throw new Error("'unpack' error. Got invalid type argument.");for(var r,n=0,o=1;o<e.length;o++)if("b"==e[o].toLowerCase())n+=1;else if("h"==e[o].toLowerCase())n+=2;else{if("l"!=e[o].toLowerCase())throw new Error("'unpack' error. Got invalid mark.");n+=4}if(n!=t.length)throw new Error("'unpack' error. Mismatch between symbol and string length. "+n+":"+t.length);if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("'unpack' error.");r=!1}for(var i=[],a=0,s=1,c=null,u=null,l=null,d="";u=e[s];){if("b"==u.toLowerCase())l=1,c=(d=t.slice(a,a+l)).charCodeAt(0),"b"==u&&c>=128&&(c-=256);else if("H"==u)l=2,d=t.slice(a,a+l),r&&(d=d.split("").reverse().join("")),c=256*d.charCodeAt(0)+d.charCodeAt(1);else{if("l"!=u.toLowerCase())throw new Error("'unpack' error. "+u);l=4,d=t.slice(a,a+l),r&&(d=d.split("").reverse().join("")),c=16777216*d.charCodeAt(0)+65536*d.charCodeAt(1)+256*d.charCodeAt(2)+d.charCodeAt(3),"l"==u&&c>=2147483648&&(c-=4294967296)}i.push(c),a+=l,s+=1}return i}function h(e,t){for(var r="",n=0;n<t;n++)r+=e;return r}function p(e){if("ÿØ"!=e.slice(0,2))throw new Error("Given data isn't JPEG.");for(var t=2,r=["ÿØ"];;){if("ÿÚ"==e.slice(t,t+2)){r.push(e.slice(t));break}var n=t+f(">H",e.slice(t+2,t+4))[0]+2;if(r.push(e.slice(t,n)),(t=n)>=e.length)throw new Error("Wrong JPEG data.")}return r}void 0===l&&(l=function(e){var t,r,n,o,i,a,s="",c=0,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<e.length;)t=u.indexOf(e.charAt(c++))<<2|(o=u.indexOf(e.charAt(c++)))>>4,r=(15&o)<<4|(i=u.indexOf(e.charAt(c++)))>>2,n=(3&i)<<6|(a=u.indexOf(e.charAt(c++))),s+=String.fromCharCode(t),64!=i&&(s+=String.fromCharCode(r)),64!=a&&(s+=String.fromCharCode(n));return s});var m={Byte:1,Ascii:2,Short:3,Long:4,Rational:5,Undefined:7,SLong:9,SRational:10},g={Image:{11:{name:"ProcessingSoftware",type:"Ascii"},254:{name:"NewSubfileType",type:"Long"},255:{name:"SubfileType",type:"Short"},256:{name:"ImageWidth",type:"Long"},257:{name:"ImageLength",type:"Long"},258:{name:"BitsPerSample",type:"Short"},259:{name:"Compression",type:"Short"},262:{name:"PhotometricInterpretation",type:"Short"},263:{name:"Threshholding",type:"Short"},264:{name:"CellWidth",type:"Short"},265:{name:"CellLength",type:"Short"},266:{name:"FillOrder",type:"Short"},269:{name:"DocumentName",type:"Ascii"},270:{name:"ImageDescription",type:"Ascii"},271:{name:"Make",type:"Ascii"},272:{name:"Model",type:"Ascii"},273:{name:"StripOffsets",type:"Long"},274:{name:"Orientation",type:"Short"},277:{name:"SamplesPerPixel",type:"Short"},278:{name:"RowsPerStrip",type:"Long"},279:{name:"StripByteCounts",type:"Long"},282:{name:"XResolution",type:"Rational"},283:{name:"YResolution",type:"Rational"},284:{name:"PlanarConfiguration",type:"Short"},290:{name:"GrayResponseUnit",type:"Short"},291:{name:"GrayResponseCurve",type:"Short"},292:{name:"T4Options",type:"Long"},293:{name:"T6Options",type:"Long"},296:{name:"ResolutionUnit",type:"Short"},301:{name:"TransferFunction",type:"Short"},305:{name:"Software",type:"Ascii"},306:{name:"DateTime",type:"Ascii"},315:{name:"Artist",type:"Ascii"},316:{name:"HostComputer",type:"Ascii"},317:{name:"Predictor",type:"Short"},318:{name:"WhitePoint",type:"Rational"},319:{name:"PrimaryChromaticities",type:"Rational"},320:{name:"ColorMap",type:"Short"},321:{name:"HalftoneHints",type:"Short"},322:{name:"TileWidth",type:"Short"},323:{name:"TileLength",type:"Short"},324:{name:"TileOffsets",type:"Short"},325:{name:"TileByteCounts",type:"Short"},330:{name:"SubIFDs",type:"Long"},332:{name:"InkSet",type:"Short"},333:{name:"InkNames",type:"Ascii"},334:{name:"NumberOfInks",type:"Short"},336:{name:"DotRange",type:"Byte"},337:{name:"TargetPrinter",type:"Ascii"},338:{name:"ExtraSamples",type:"Short"},339:{name:"SampleFormat",type:"Short"},340:{name:"SMinSampleValue",type:"Short"},341:{name:"SMaxSampleValue",type:"Short"},342:{name:"TransferRange",type:"Short"},343:{name:"ClipPath",type:"Byte"},344:{name:"XClipPathUnits",type:"Long"},345:{name:"YClipPathUnits",type:"Long"},346:{name:"Indexed",type:"Short"},347:{name:"JPEGTables",type:"Undefined"},351:{name:"OPIProxy",type:"Short"},512:{name:"JPEGProc",type:"Long"},513:{name:"JPEGInterchangeFormat",type:"Long"},514:{name:"JPEGInterchangeFormatLength",type:"Long"},515:{name:"JPEGRestartInterval",type:"Short"},517:{name:"JPEGLosslessPredictors",type:"Short"},518:{name:"JPEGPointTransforms",type:"Short"},519:{name:"JPEGQTables",type:"Long"},520:{name:"JPEGDCTables",type:"Long"},521:{name:"JPEGACTables",type:"Long"},529:{name:"YCbCrCoefficients",type:"Rational"},530:{name:"YCbCrSubSampling",type:"Short"},531:{name:"YCbCrPositioning",type:"Short"},532:{name:"ReferenceBlackWhite",type:"Rational"},700:{name:"XMLPacket",type:"Byte"},18246:{name:"Rating",type:"Short"},18249:{name:"RatingPercent",type:"Short"},32781:{name:"ImageID",type:"Ascii"},33421:{name:"CFARepeatPatternDim",type:"Short"},33422:{name:"CFAPattern",type:"Byte"},33423:{name:"BatteryLevel",type:"Rational"},33432:{name:"Copyright",type:"Ascii"},33434:{name:"ExposureTime",type:"Rational"},34377:{name:"ImageResources",type:"Byte"},34665:{name:"ExifTag",type:"Long"},34675:{name:"InterColorProfile",type:"Undefined"},34853:{name:"GPSTag",type:"Long"},34857:{name:"Interlace",type:"Short"},34858:{name:"TimeZoneOffset",type:"Long"},34859:{name:"SelfTimerMode",type:"Short"},37387:{name:"FlashEnergy",type:"Rational"},37388:{name:"SpatialFrequencyResponse",type:"Undefined"},37389:{name:"Noise",type:"Undefined"},37390:{name:"FocalPlaneXResolution",type:"Rational"},37391:{name:"FocalPlaneYResolution",type:"Rational"},37392:{name:"FocalPlaneResolutionUnit",type:"Short"},37393:{name:"ImageNumber",type:"Long"},37394:{name:"SecurityClassification",type:"Ascii"},37395:{name:"ImageHistory",type:"Ascii"},37397:{name:"ExposureIndex",type:"Rational"},37398:{name:"TIFFEPStandardID",type:"Byte"},37399:{name:"SensingMethod",type:"Short"},40091:{name:"XPTitle",type:"Byte"},40092:{name:"XPComment",type:"Byte"},40093:{name:"XPAuthor",type:"Byte"},40094:{name:"XPKeywords",type:"Byte"},40095:{name:"XPSubject",type:"Byte"},50341:{name:"PrintImageMatching",type:"Undefined"},50706:{name:"DNGVersion",type:"Byte"},50707:{name:"DNGBackwardVersion",type:"Byte"},50708:{name:"UniqueCameraModel",type:"Ascii"},50709:{name:"LocalizedCameraModel",type:"Byte"},50710:{name:"CFAPlaneColor",type:"Byte"},50711:{name:"CFALayout",type:"Short"},50712:{name:"LinearizationTable",type:"Short"},50713:{name:"BlackLevelRepeatDim",type:"Short"},50714:{name:"BlackLevel",type:"Rational"},50715:{name:"BlackLevelDeltaH",type:"SRational"},50716:{name:"BlackLevelDeltaV",type:"SRational"},50717:{name:"WhiteLevel",type:"Short"},50718:{name:"DefaultScale",type:"Rational"},50719:{name:"DefaultCropOrigin",type:"Short"},50720:{name:"DefaultCropSize",type:"Short"},50721:{name:"ColorMatrix1",type:"SRational"},50722:{name:"ColorMatrix2",type:"SRational"},50723:{name:"CameraCalibration1",type:"SRational"},50724:{name:"CameraCalibration2",type:"SRational"},50725:{name:"ReductionMatrix1",type:"SRational"},50726:{name:"ReductionMatrix2",type:"SRational"},50727:{name:"AnalogBalance",type:"Rational"},50728:{name:"AsShotNeutral",type:"Short"},50729:{name:"AsShotWhiteXY",type:"Rational"},50730:{name:"BaselineExposure",type:"SRational"},50731:{name:"BaselineNoise",type:"Rational"},50732:{name:"BaselineSharpness",type:"Rational"},50733:{name:"BayerGreenSplit",type:"Long"},50734:{name:"LinearResponseLimit",type:"Rational"},50735:{name:"CameraSerialNumber",type:"Ascii"},50736:{name:"LensInfo",type:"Rational"},50737:{name:"ChromaBlurRadius",type:"Rational"},50738:{name:"AntiAliasStrength",type:"Rational"},50739:{name:"ShadowScale",type:"SRational"},50740:{name:"DNGPrivateData",type:"Byte"},50741:{name:"MakerNoteSafety",type:"Short"},50778:{name:"CalibrationIlluminant1",type:"Short"},50779:{name:"CalibrationIlluminant2",type:"Short"},50780:{name:"BestQualityScale",type:"Rational"},50781:{name:"RawDataUniqueID",type:"Byte"},50827:{name:"OriginalRawFileName",type:"Byte"},50828:{name:"OriginalRawFileData",type:"Undefined"},50829:{name:"ActiveArea",type:"Short"},50830:{name:"MaskedAreas",type:"Short"},50831:{name:"AsShotICCProfile",type:"Undefined"},50832:{name:"AsShotPreProfileMatrix",type:"SRational"},50833:{name:"CurrentICCProfile",type:"Undefined"},50834:{name:"CurrentPreProfileMatrix",type:"SRational"},50879:{name:"ColorimetricReference",type:"Short"},50931:{name:"CameraCalibrationSignature",type:"Byte"},50932:{name:"ProfileCalibrationSignature",type:"Byte"},50934:{name:"AsShotProfileName",type:"Byte"},50935:{name:"NoiseReductionApplied",type:"Rational"},50936:{name:"ProfileName",type:"Byte"},50937:{name:"ProfileHueSatMapDims",type:"Long"},50938:{name:"ProfileHueSatMapData1",type:"Float"},50939:{name:"ProfileHueSatMapData2",type:"Float"},50940:{name:"ProfileToneCurve",type:"Float"},50941:{name:"ProfileEmbedPolicy",type:"Long"},50942:{name:"ProfileCopyright",type:"Byte"},50964:{name:"ForwardMatrix1",type:"SRational"},50965:{name:"ForwardMatrix2",type:"SRational"},50966:{name:"PreviewApplicationName",type:"Byte"},50967:{name:"PreviewApplicationVersion",type:"Byte"},50968:{name:"PreviewSettingsName",type:"Byte"},50969:{name:"PreviewSettingsDigest",type:"Byte"},50970:{name:"PreviewColorSpace",type:"Long"},50971:{name:"PreviewDateTime",type:"Ascii"},50972:{name:"RawImageDigest",type:"Undefined"},50973:{name:"OriginalRawFileDigest",type:"Undefined"},50974:{name:"SubTileBlockSize",type:"Long"},50975:{name:"RowInterleaveFactor",type:"Long"},50981:{name:"ProfileLookTableDims",type:"Long"},50982:{name:"ProfileLookTableData",type:"Float"},51008:{name:"OpcodeList1",type:"Undefined"},51009:{name:"OpcodeList2",type:"Undefined"},51022:{name:"OpcodeList3",type:"Undefined"}},Exif:{33434:{name:"ExposureTime",type:"Rational"},33437:{name:"FNumber",type:"Rational"},34850:{name:"ExposureProgram",type:"Short"},34852:{name:"SpectralSensitivity",type:"Ascii"},34855:{name:"ISOSpeedRatings",type:"Short"},34856:{name:"OECF",type:"Undefined"},34864:{name:"SensitivityType",type:"Short"},34865:{name:"StandardOutputSensitivity",type:"Long"},34866:{name:"RecommendedExposureIndex",type:"Long"},34867:{name:"ISOSpeed",type:"Long"},34868:{name:"ISOSpeedLatitudeyyy",type:"Long"},34869:{name:"ISOSpeedLatitudezzz",type:"Long"},36864:{name:"ExifVersion",type:"Undefined"},36867:{name:"DateTimeOriginal",type:"Ascii"},36868:{name:"DateTimeDigitized",type:"Ascii"},37121:{name:"ComponentsConfiguration",type:"Undefined"},37122:{name:"CompressedBitsPerPixel",type:"Rational"},37377:{name:"ShutterSpeedValue",type:"SRational"},37378:{name:"ApertureValue",type:"Rational"},37379:{name:"BrightnessValue",type:"SRational"},37380:{name:"ExposureBiasValue",type:"SRational"},37381:{name:"MaxApertureValue",type:"Rational"},37382:{name:"SubjectDistance",type:"Rational"},37383:{name:"MeteringMode",type:"Short"},37384:{name:"LightSource",type:"Short"},37385:{name:"Flash",type:"Short"},37386:{name:"FocalLength",type:"Rational"},37396:{name:"SubjectArea",type:"Short"},37500:{name:"MakerNote",type:"Undefined"},37510:{name:"UserComment",type:"Ascii"},37520:{name:"SubSecTime",type:"Ascii"},37521:{name:"SubSecTimeOriginal",type:"Ascii"},37522:{name:"SubSecTimeDigitized",type:"Ascii"},40960:{name:"FlashpixVersion",type:"Undefined"},40961:{name:"ColorSpace",type:"Short"},40962:{name:"PixelXDimension",type:"Long"},40963:{name:"PixelYDimension",type:"Long"},40964:{name:"RelatedSoundFile",type:"Ascii"},40965:{name:"InteroperabilityTag",type:"Long"},41483:{name:"FlashEnergy",type:"Rational"},41484:{name:"SpatialFrequencyResponse",type:"Undefined"},41486:{name:"FocalPlaneXResolution",type:"Rational"},41487:{name:"FocalPlaneYResolution",type:"Rational"},41488:{name:"FocalPlaneResolutionUnit",type:"Short"},41492:{name:"SubjectLocation",type:"Short"},41493:{name:"ExposureIndex",type:"Rational"},41495:{name:"SensingMethod",type:"Short"},41728:{name:"FileSource",type:"Undefined"},41729:{name:"SceneType",type:"Undefined"},41730:{name:"CFAPattern",type:"Undefined"},41985:{name:"CustomRendered",type:"Short"},41986:{name:"ExposureMode",type:"Short"},41987:{name:"WhiteBalance",type:"Short"},41988:{name:"DigitalZoomRatio",type:"Rational"},41989:{name:"FocalLengthIn35mmFilm",type:"Short"},41990:{name:"SceneCaptureType",type:"Short"},41991:{name:"GainControl",type:"Short"},41992:{name:"Contrast",type:"Short"},41993:{name:"Saturation",type:"Short"},41994:{name:"Sharpness",type:"Short"},41995:{name:"DeviceSettingDescription",type:"Undefined"},41996:{name:"SubjectDistanceRange",type:"Short"},42016:{name:"ImageUniqueID",type:"Ascii"},42032:{name:"CameraOwnerName",type:"Ascii"},42033:{name:"BodySerialNumber",type:"Ascii"},42034:{name:"LensSpecification",type:"Rational"},42035:{name:"LensMake",type:"Ascii"},42036:{name:"LensModel",type:"Ascii"},42037:{name:"LensSerialNumber",type:"Ascii"},42240:{name:"Gamma",type:"Rational"}},GPS:{0:{name:"GPSVersionID",type:"Byte"},1:{name:"GPSLatitudeRef",type:"Ascii"},2:{name:"GPSLatitude",type:"Rational"},3:{name:"GPSLongitudeRef",type:"Ascii"},4:{name:"GPSLongitude",type:"Rational"},5:{name:"GPSAltitudeRef",type:"Byte"},6:{name:"GPSAltitude",type:"Rational"},7:{name:"GPSTimeStamp",type:"Rational"},8:{name:"GPSSatellites",type:"Ascii"},9:{name:"GPSStatus",type:"Ascii"},10:{name:"GPSMeasureMode",type:"Ascii"},11:{name:"GPSDOP",type:"Rational"},12:{name:"GPSSpeedRef",type:"Ascii"},13:{name:"GPSSpeed",type:"Rational"},14:{name:"GPSTrackRef",type:"Ascii"},15:{name:"GPSTrack",type:"Rational"},16:{name:"GPSImgDirectionRef",type:"Ascii"},17:{name:"GPSImgDirection",type:"Rational"},18:{name:"GPSMapDatum",type:"Ascii"},19:{name:"GPSDestLatitudeRef",type:"Ascii"},20:{name:"GPSDestLatitude",type:"Rational"},21:{name:"GPSDestLongitudeRef",type:"Ascii"},22:{name:"GPSDestLongitude",type:"Rational"},23:{name:"GPSDestBearingRef",type:"Ascii"},24:{name:"GPSDestBearing",type:"Rational"},25:{name:"GPSDestDistanceRef",type:"Ascii"},26:{name:"GPSDestDistance",type:"Rational"},27:{name:"GPSProcessingMethod",type:"Undefined"},28:{name:"GPSAreaInformation",type:"Undefined"},29:{name:"GPSDateStamp",type:"Ascii"},30:{name:"GPSDifferential",type:"Short"},31:{name:"GPSHPositioningError",type:"Rational"}},Interop:{1:{name:"InteroperabilityIndex",type:"Ascii"}}};g["0th"]=g.Image,g["1st"]=g.Image,r.TAGS=g,r.ImageIFD={ProcessingSoftware:11,NewSubfileType:254,SubfileType:255,ImageWidth:256,ImageLength:257,BitsPerSample:258,Compression:259,PhotometricInterpretation:262,Threshholding:263,CellWidth:264,CellLength:265,FillOrder:266,DocumentName:269,ImageDescription:270,Make:271,Model:272,StripOffsets:273,Orientation:274,SamplesPerPixel:277,RowsPerStrip:278,StripByteCounts:279,XResolution:282,YResolution:283,PlanarConfiguration:284,GrayResponseUnit:290,GrayResponseCurve:291,T4Options:292,T6Options:293,ResolutionUnit:296,TransferFunction:301,Software:305,DateTime:306,Artist:315,HostComputer:316,Predictor:317,WhitePoint:318,PrimaryChromaticities:319,ColorMap:320,HalftoneHints:321,TileWidth:322,TileLength:323,TileOffsets:324,TileByteCounts:325,SubIFDs:330,InkSet:332,InkNames:333,NumberOfInks:334,DotRange:336,TargetPrinter:337,ExtraSamples:338,SampleFormat:339,SMinSampleValue:340,SMaxSampleValue:341,TransferRange:342,ClipPath:343,XClipPathUnits:344,YClipPathUnits:345,Indexed:346,JPEGTables:347,OPIProxy:351,JPEGProc:512,JPEGInterchangeFormat:513,JPEGInterchangeFormatLength:514,JPEGRestartInterval:515,JPEGLosslessPredictors:517,JPEGPointTransforms:518,JPEGQTables:519,JPEGDCTables:520,JPEGACTables:521,YCbCrCoefficients:529,YCbCrSubSampling:530,YCbCrPositioning:531,ReferenceBlackWhite:532,XMLPacket:700,Rating:18246,RatingPercent:18249,ImageID:32781,CFARepeatPatternDim:33421,CFAPattern:33422,BatteryLevel:33423,Copyright:33432,ExposureTime:33434,ImageResources:34377,ExifTag:34665,InterColorProfile:34675,GPSTag:34853,Interlace:34857,TimeZoneOffset:34858,SelfTimerMode:34859,FlashEnergy:37387,SpatialFrequencyResponse:37388,Noise:37389,FocalPlaneXResolution:37390,FocalPlaneYResolution:37391,FocalPlaneResolutionUnit:37392,ImageNumber:37393,SecurityClassification:37394,ImageHistory:37395,ExposureIndex:37397,TIFFEPStandardID:37398,SensingMethod:37399,XPTitle:40091,XPComment:40092,XPAuthor:40093,XPKeywords:40094,XPSubject:40095,PrintImageMatching:50341,DNGVersion:50706,DNGBackwardVersion:50707,UniqueCameraModel:50708,LocalizedCameraModel:50709,CFAPlaneColor:50710,CFALayout:50711,LinearizationTable:50712,BlackLevelRepeatDim:50713,BlackLevel:50714,BlackLevelDeltaH:50715,BlackLevelDeltaV:50716,WhiteLevel:50717,DefaultScale:50718,DefaultCropOrigin:50719,DefaultCropSize:50720,ColorMatrix1:50721,ColorMatrix2:50722,CameraCalibration1:50723,CameraCalibration2:50724,ReductionMatrix1:50725,ReductionMatrix2:50726,AnalogBalance:50727,AsShotNeutral:50728,AsShotWhiteXY:50729,BaselineExposure:50730,BaselineNoise:50731,BaselineSharpness:50732,BayerGreenSplit:50733,LinearResponseLimit:50734,CameraSerialNumber:50735,LensInfo:50736,ChromaBlurRadius:50737,AntiAliasStrength:50738,ShadowScale:50739,DNGPrivateData:50740,MakerNoteSafety:50741,CalibrationIlluminant1:50778,CalibrationIlluminant2:50779,BestQualityScale:50780,RawDataUniqueID:50781,OriginalRawFileName:50827,OriginalRawFileData:50828,ActiveArea:50829,MaskedAreas:50830,AsShotICCProfile:50831,AsShotPreProfileMatrix:50832,CurrentICCProfile:50833,CurrentPreProfileMatrix:50834,ColorimetricReference:50879,CameraCalibrationSignature:50931,ProfileCalibrationSignature:50932,AsShotProfileName:50934,NoiseReductionApplied:50935,ProfileName:50936,ProfileHueSatMapDims:50937,ProfileHueSatMapData1:50938,ProfileHueSatMapData2:50939,ProfileToneCurve:50940,ProfileEmbedPolicy:50941,ProfileCopyright:50942,ForwardMatrix1:50964,ForwardMatrix2:50965,PreviewApplicationName:50966,PreviewApplicationVersion:50967,PreviewSettingsName:50968,PreviewSettingsDigest:50969,PreviewColorSpace:50970,PreviewDateTime:50971,RawImageDigest:50972,OriginalRawFileDigest:50973,SubTileBlockSize:50974,RowInterleaveFactor:50975,ProfileLookTableDims:50981,ProfileLookTableData:50982,OpcodeList1:51008,OpcodeList2:51009,OpcodeList3:51022,NoiseProfile:51041},r.ExifIFD={ExposureTime:33434,FNumber:33437,ExposureProgram:34850,SpectralSensitivity:34852,ISOSpeedRatings:34855,OECF:34856,SensitivityType:34864,StandardOutputSensitivity:34865,RecommendedExposureIndex:34866,ISOSpeed:34867,ISOSpeedLatitudeyyy:34868,ISOSpeedLatitudezzz:34869,ExifVersion:36864,DateTimeOriginal:36867,DateTimeDigitized:36868,ComponentsConfiguration:37121,CompressedBitsPerPixel:37122,ShutterSpeedValue:37377,ApertureValue:37378,BrightnessValue:37379,ExposureBiasValue:37380,MaxApertureValue:37381,SubjectDistance:37382,MeteringMode:37383,LightSource:37384,Flash:37385,FocalLength:37386,SubjectArea:37396,MakerNote:37500,UserComment:37510,SubSecTime:37520,SubSecTimeOriginal:37521,SubSecTimeDigitized:37522,FlashpixVersion:40960,ColorSpace:40961,PixelXDimension:40962,PixelYDimension:40963,RelatedSoundFile:40964,InteroperabilityTag:40965,FlashEnergy:41483,SpatialFrequencyResponse:41484,FocalPlaneXResolution:41486,FocalPlaneYResolution:41487,FocalPlaneResolutionUnit:41488,SubjectLocation:41492,ExposureIndex:41493,SensingMethod:41495,FileSource:41728,SceneType:41729,CFAPattern:41730,CustomRendered:41985,ExposureMode:41986,WhiteBalance:41987,DigitalZoomRatio:41988,FocalLengthIn35mmFilm:41989,SceneCaptureType:41990,GainControl:41991,Contrast:41992,Saturation:41993,Sharpness:41994,DeviceSettingDescription:41995,SubjectDistanceRange:41996,ImageUniqueID:42016,CameraOwnerName:42032,BodySerialNumber:42033,LensSpecification:42034,LensMake:42035,LensModel:42036,LensSerialNumber:42037,Gamma:42240},r.GPSIFD={GPSVersionID:0,GPSLatitudeRef:1,GPSLatitude:2,GPSLongitudeRef:3,GPSLongitude:4,GPSAltitudeRef:5,GPSAltitude:6,GPSTimeStamp:7,GPSSatellites:8,GPSStatus:9,GPSMeasureMode:10,GPSDOP:11,GPSSpeedRef:12,GPSSpeed:13,GPSTrackRef:14,GPSTrack:15,GPSImgDirectionRef:16,GPSImgDirection:17,GPSMapDatum:18,GPSDestLatitudeRef:19,GPSDestLatitude:20,GPSDestLongitudeRef:21,GPSDestLongitude:22,GPSDestBearingRef:23,GPSDestBearing:24,GPSDestDistanceRef:25,GPSDestDistance:26,GPSProcessingMethod:27,GPSAreaInformation:28,GPSDateStamp:29,GPSDifferential:30,GPSHPositioningError:31},r.InteropIFD={InteroperabilityIndex:1},r.GPSHelper={degToDmsRational:function(e){var t=Math.abs(e),r=t%1*60,n=r%1*60;return[[Math.floor(t),1],[Math.floor(r),1],[Math.round(100*n),100]]},dmsRationalToDeg:function(e,t){var r="S"===t||"W"===t?-1:1;return(e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600)*r}},e.exports&&(t=e.exports=r),t.piexif=r}()})),pz=function(e,t,r){return null==e?e:function(e,t,r,n){if(!nT(e))return e;for(var o=-1,i=(t=aM(t,e)).length,a=i-1,s=e;null!=s&&++o<i;){var c=sM(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var l=s[c];void 0===(u=n?n(l,c,s):void 0)&&(u=nT(l)?l:qT(t[o+1])?[]:{})}TT(s,c,u),s=s[c]}return e}(e,t,r)},mz={},gz={SELFIE:"selfie",ID_CARD:"id_card"},vz=Vj((function(e){var t=new YU,r=e||$U.join("");return t.setPublicKey(r),t})),yz=function(e){var t=e.gesture,r=e.captureTime,n=e.frames,o=e.blurScore,i=e.selfieLabel,a=e.brightnessScore,s=e.accelerometer,c=e.gyroscope;return{capture_time:r,type:t,frames:n,blur_score:o,selfie_label:i,qualify_score:e.qualifyScore,accelerometer:s,gyroscope:c,brightness_score:a}},bz=function(e){var t=e.detectedCard,r=e.captureTime,n=e.vCam,o=e.captureCount,i=e.captureDuration,a=e.captureType,s=e.cardTracking;return{capture_time:r,type:null==t?void 0:t.label,v_cam:n,capture_count:o,capture_duration:i,capture_type:a,card_tracking:s}},wz=function(){var e=EP(kP().mark((function e(t,r){var n;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return MP(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},e.abrupt("return",new Promise((function(e){var o=new TextEncoder,i=o.encode(t),a=o.encode(r);window.crypto.subtle.importKey("raw",a,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,i).then((function(t){e("".concat(cz,".").concat(n(t)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),_z=function(){var e=EP(kP().mark((function e(t){var r,n,o,i,a,s,c,u,l;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.mode,o=t.imageData,t.enableExifData){e.next=3;break}return e.abrupt("return",new Promise((function(e){return e(o.blob)})));case 3:return i=_P(_P({},mz),n===gz.SELFIE?yz(o):bz(o)),a=_P(_P({},i),{},{sensor_data:"sensor data exceed 64KB"}),null!=o&&null!==(r=o.type)&&void 0!==r&&r.includes("qr")&&(i={capture_time:null==o?void 0:o.captureTime,type:null==o?void 0:o.type,qr_string:null==o?void 0:o.result}),e.next=8,wz(JSON.stringify(a),sz);case 8:return s=e.sent,e.next=11,wz(JSON.stringify(i),sz);case 11:return c=e.sent,u=hz.dump({Exif:PP({},hz.ExifIFD.MakerNote,c)}),l=hz.dump({Exif:PP({},hz.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var t=new FileReader;t.onload=function(){var t=EP(kP().mark((function t(r){var n,i,a;return kP().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{n=hz.insert(u,r.target.result)}catch(t){try{n=hz.insert(l,r.target.result)}catch(t){e(o.blob)}}return t.prev=1,t.next=4,fetch(n);case 4:return i=t.sent,t.next=7,i.blob();case 7:a=t.sent,URL.revokeObjectURL(n),e(a),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)}}(),kz=Object.freeze({__proto__:null,MODE:gz,initExifData:function(){mz={device_info:{device_brand_name:"".concat("none"===YM.mobileVendor?"null":YM.mobileVendor),device_model:"".concat("none"===YM.mobileModel?"null":YM.mobileModel),browser_version:"".concat(YM.browserName," ").concat(YM.browserVersion),browser_userAgent:"".concat(YM.getUA),os:YM.osName,os_version:YM.osVersion},sdk_version:"5.23.1",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,t){pz(mz,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,i=void 0===o?"":o;mz.user_action=_P({},t===gz.SELFIE?{start_selfie:r,end_selfie:n}:{start_id_card:r,end_id_card:n}),sz=QM().replace(/-/g,""),az||(az=vz(i)),cz=iU(az.encrypt(sz))},writeExif:_z}),Cz=function(e,t,r){(void 0!==r&&!FP(e[t],r)||void 0===r&&!(t in e))&&AT(e,t,r)},Sz=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),a=i.length;a--;){var s=i[++n];if(!1===t(o[s],s,o))break}return e},Bz=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},Ez=function(e,t,r,n,o,i,a){var s=Bz(e,r),c=Bz(t,r),u=a.get(c);if(u)Cz(e,r,u);else{var l=i?i(s,c,r+"",e,t,a):void 0,d=void 0===l;if(d){var f=VT(c),h=!f&&UT(c),p=!f&&!h&&XT(c);l=c,f||h||p?VT(s)?l=s:function(e){return MT(e)&&nR(e)}(s)?l=uR(s):h?(d=!1,l=cR(c,!0)):p?(d=!1,l=NR(c,!0)):l=[]:gM(c)||FT(c)?(l=s,FT(s)?l=function(e){return RT(e,sR(e))}(s):nT(s)&&!oT(s)||(l=UR(c))):d=!1}d&&(a.set(c,l),o(l,c,n,i,a),a.delete(c)),Cz(e,r,l)}},xz=function e(t,r,n,o,i){t!==r&&Sz(r,(function(a,s){if(i||(i=new xT),nT(a))Ez(t,r,s,n,e,o,i);else{var c=o?o(Bz(t,s),a,s+"",t,r,i):void 0;void 0===c&&(c=a),Cz(t,s,c)}}),sR)},Iz=function(e,t){return AM(SM(e,t,EM),e+"")},Az=function(e,t,r){if(!nT(r))return!1;var n=rg(t);return!!("number"==n?nR(r)&&qT(t,r.length):"string"==n&&t in r)&&FP(r[t],e)},Pz=function(e){return Iz((function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&Az(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t}))},Tz=Pz((function(e,t,r,n){xz(e,t,r,n)})),Rz={enableGetClientSettings:!0,enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:!0,enableVerifySanityIDCard:!0,enableVerifyFaceLiveness:!0,enableDetectIDCardTampering:!0,enableReadIDCardInfo:!0,enableRegisterFace:!0,enableAuthenticateFace:!0},Mz=Object.freeze({__proto__:null,getEnabledServices:function(e,t){var r=function(e){if(!e)return Rz;var t=e.enableUploadFrames,r=e.enableUploadImages,n=void 0===r||r,o=e.enableGetClientSettings,i=n&&e.enableVerifySanityPortrait,a=n&&e.enableVerifySanityIDCard,s=n&&e.enableDetectIDCardTampering,c=n&&e.enableReadIDCardInfo;return{enableGetClientSettings:o,enableUploadFrames:t,enableUploadImages:n,enableVerifySanityPortrait:i,enableVerifySanityIDCard:a,enableVerifyFaceLiveness:n&&e.enableVerifyFaceLiveness,enableDetectIDCardTampering:s,enableReadIDCardInfo:c,enableRegisterFace:n&&e.enableRegisterFace,enableAuthenticateFace:n&&e.enableAuthenticateFace}}(e),n=function(e){return{enableGetClientSettings:!0,enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:uF(e,"data.settings.enable_verify_portrait_sanity",!0),enableVerifySanityIDCard:uF(e,"data.settings.enable_verify_id_card_sanity",!0),enableVerifyFaceLiveness:uF(e,"data.settings.enable_verify_face_liveness",!0),enableDetectIDCardTampering:uF(e,"data.settings.enable_detect_id_card_tampering",!0),enableReadIDCardInfo:uF(e,"data.settings.enable_read_id_card_info",!0),enableRegisterFace:uF(e,"data.settings.enable_face_registration",!0),enableAuthenticateFace:uF(e,"data.settings.enable_face_authentication",!0)}}(t),o=_P({},Rz);return Tz(o,r,n,(function(e,t){return(null==e||e)&&(null==t||t)}))}}),Dz=function(e){var t=e.slice(0,2),r=e.slice(2,4),n=e.slice(4,8);return new Date("".concat(n,"-").concat(r,"-").concat(t))},Lz=function(e){return!Number.isNaN(e.getTime())&&e<=new Date},Oz={CCCD:{validate:function(e){var t=e.split("|"),r=Dz(t[3]),n=Dz(t[6]);return 7===t.length&&Boolean(e.match(/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g))&&Lz(r)&&Lz(n)&&r<n}},TCC:{validate:function(e){var t=e.split("|"),r=Dz(t[3]),n=Dz(t[6]);return 11===t.length&&Boolean(e.match(/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}/g))&&Lz(r)&&Lz(n)&&r<n}}},Nz=Object.freeze({__proto__:null,validateIdQRContent:function(e){var t=function(e){var t=e[6];if(!t||8!==t.length)return null;var r=Dz(t);return Lz(r)?r>=new Date("2024-07-01")?Oz.TCC:Oz.CCCD:null}(e.split("|"));return t?{valid:t.validate(e)}:{valid:!1}}}),Fz=function(e){return e===yP.ACTIVE?"active":e===yP.PASSIVE?"passive":"string"==typeof e&&e.startsWith("flash")?"flash":"active"},Vz=Object.freeze({__proto__:null,getLivenessMode:Fz}),jz="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",Uz=function(){return AP((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jz,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.342,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:368,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;xP(this,e),this.model_path=t,this.threshold=r,this.size=Math.round(n/2),this.enable_profiling=o,this.num_threads=i}),[{key:"load",value:(t=EP(kP().mark((function e(){var t,r,n,o=this;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,e.next=3,Wj({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 t.apply(this,arguments)})},{key:"crop_eyes",value:function(e,t){var r=this,n=window.tf,o=t[0].map((function(e){return Math.round(e)})),i=t[1].map((function(e){return Math.round(e)}));o[0]>i[0]&&(o=t[1].map((function(e){return Math.round(e)})),i=t[0].map((function(e){return Math.round(e)})));var a=Math.round((o[0]+i[0])/2),s=a-o[0],c=i[0]-a;s>=this.size&&(s=this.size),c>=this.size&&(c=this.size);var u=Math.max(o[0]-s,0),l=Math.max(o[1]-s,0),d=Math.max(i[0]-c,0),f=Math.max(i[1]-c,0);return n.tidy((function(){var t=e.slice([l,u,0],[2*s,2*s,3]),o=e.slice([f,d,0],[2*c,2*c,3]);return{l_img:t=n.expandDims(n.image.resizeBilinear(t,[r.input_width,r.input_height])),r_img:o=n.expandDims(n.image.resizeBilinear(o,[r.input_width,r.input_height]))}}))}},{key:"predict",value:(e=EP(kP().mark((function e(t,r){var n,o,i,a,s,c,u,l,d,f=this,h=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=h.length>2&&void 0!==h[2]?h[2]:this.threshold,o=window,i=o.tf,a=t.getContext("2d"),s=a.getImageData(0,0,t.height,t.width),c=i.tidy((function(){var e=i.browser.fromPixels(s),t=f.crop_eyes(e,r),o=t.l_img,a=t.r_img,c=f.model.predict(o).arraySync()[0],u=f.model.predict(a).arraySync()[0];return[c>n,u>n]})),u=RP(c,2),l=u[0],d=u[1],e.abrupt("return",{isEyeClose:l||d});case 6:case"end":return e.stop()}}),e,this)}))),function(t,r){return e.apply(this,arguments)})}]);var e,t}(),zz="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.1.0/libs/opencv-4.9.0.js",qz=Vj(function(){var e=EP(kP().mark((function e(){var t,r,n,o=arguments;return kP().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?zz:r,e.abrupt("return",new Promise((function(e,t){try{if(window.cv)return void e();var r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("type","text/javascript"),r.setAttribute("id","opencvjs"),r.addEventListener("load",EP(kP().mark((function t(){return kP().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)}catch(e){console.error(e)}})));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),Wz=AP((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.02,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:127.5,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.3855;xP(this,e),this.c1=t,this.c2=r,this.maxDiffThreshold=n}),[{key:"sigMoid",value:function(e){var t=window.cv;e.convertTo(e,t.CV_32FC3);var r=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(this.c2,this.c2,this.c2)),n=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(-this.c1,-this.c1,-this.c1)),o=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(1,1,1));return t.subtract(e,r,e),t.multiply(e,n,e),t.exp(e,e),t.add(e,o,e),t.divide(o,e,e),r.delete(),n.delete(),o.delete(),e}},{key:"faceResize",value:function(e,t){var r=window.cv,n=new r.Mat,o=e.rows<t.height?r.INTER_CUBIC:r.INTER_AREA;return r.resize(e,n,t,0,0,o),n}},{key:"checkValidFaceSide",value:function(e){return e.every((function(e){return!e.empty()}))}},{key:"divideFace",value:function(e,t){var r=window.cv;if(0===t.length)return[!1,[null,null,null,null,null]];var n=t[0],o=n[0],i=n[1],a=n[2],s=n[3],c=e.roi(new r.Rect(s,o,i-s,a-o)),u=e.roi(new r.Rect(s,o,(i-s)/2,(a-o)/2)),l=e.roi(new r.Rect(s,o+(a-o)/2,(i-s)/2,(a-o)/2)),d=e.roi(new r.Rect(s+(i-s)/2,o,(i-s)/2,(a-o)/2)),f=e.roi(new r.Rect((i+s)/2,(a+o)/2,(i-s)/2,(a-o)/2));if(!this.checkValidFaceSide([c,u,l,d,f]))return c.delete(),u.delete(),l.delete(),d.delete(),f.delete(),[!1,[null,null,null,null,null]];var h=this.faceResize(u,new r.Size(80,128)),p=this.faceResize(l,new r.Size(80,128)),m=this.faceResize(d,new r.Size(80,128)),g=this.faceResize(f,new r.Size(80,128)),v=this.faceResize(c,new r.Size(320,512));return c.delete(),u.delete(),l.delete(),d.delete(),f.delete(),[!0,[h,p,m,g,v]]}},{key:"measureBrightness",value:function(e,t){if("hls"!==t&&"arithmetic"!==t)return-1;var r=window.cv;if("arithmetic"===t){var n=this.sigMoid(e);r.multiply(n,n,n);var o=new r.MatVector;r.split(n,o);for(var i=o.get(0),a=1;a<o.size();a+=1){var s=o.get(a);r.add(i,s,i),s.delete()}r.sqrt(i,i);var c=new r.Mat(i.rows,i.cols,i.type(),new r.Scalar(Math.sqrt(3)));r.divide(i,c,i);var u=r.mean(i);return c.delete(),o.delete(),i.delete(),u[0]}if("hls"===t){var l=new r.Mat;r.cvtColor(e,l,r.COLOR_RGB2HLS);var d=new r.MatVector;r.split(l,d);var f=d.get(1);f=this.sigMoid(f);var h=r.mean(f);return l.delete(),d.delete(),f.delete(),h[0]}return-1}},{key:"predict",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"hls",n=null;try{var o=window,i=o.cv;n=i.imread(e);var a=this.divideFace(n,t),s=a[0],c=a[1],u=[],l=null;if(!s)return n.delete(),l;var d,f=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,p=OP(c);try{for(p.s();!(d=p.n()).done;){var m=d.value,g=this.measureBrightness(m,r);u.push(g),f=Math.max(f,g),h=Math.min(h,g),m.delete()}}catch(e){p.e(e)}finally{p.f()}var v=f-h;return l=v>this.maxDiffThreshold?h:u[u.length-1],n.delete(),l}catch(e){return n&&n.delete(),console.error(e),null}}},{key:"score",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=this.predict(e,t,o);return null===i?{score:1,message:"good"}:i<r?{score:i,message:"face_too_dark"}:i>n?{score:i,message:"face_too_bright"}:{score:i,message:"good"}}}],[{key:"hasBetterBrightnessScore",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||e-t>r}},{key:"hasSameBrightnessScore",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null!==t&&Math.abs(e-t)<r}},{key:"METHOD",get:function(){return{HLS:"hls",ARITHMETIC:"arithmetic"}}},{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.opencvUrl;return XD(this,void 0,void 0,kP().mark((function e(){return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qz({url:t});case 2:case"end":return e.stop()}}),e)})))}},{key:"log",value:function(){var e=window.cv;console.log("build info",e.getBuildInformation())}}]),Hz="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.2.0/models/qualify/qualify_model.tflite",Kz=[.50612009,.42543493,.38282761],Qz=[.26589054,.24521921,.24127836],Gz=["normal","beard","mask_chin"],Xz={0:"normal",1:"beard",2:"mask",3:"object",4:"mask_chin"},Yz={beard:.3689,mask:.6337,mask_chin:.2315,object:.3942,normal:.5541};function $z(e,t,r){return Math.max(t,Math.min(e,r))}function Zz(e){for(var t=0,r=1;r<e.length;r++)e[r]>e[t]&&(t=r);return t}var Jz=function(){return AP((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hz;xP(this,e),this.modelPath=t}),[{key:"init",value:(t=EP(kP().mark((function e(){var t,r,n=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},r=t.opencvUrl,e.next=3,qz({url:r});case 3:return e.next=5,Wj({modelUrl:this.modelPath});case 5:this.model=e.sent;case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"normalize",value:function(e){var t=window.cv,r=255;e.convertTo(e,t.CV_32FC3);var n=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(r*Kz[0],r*Kz[1],r*Kz[2])),o=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(r*Qz[0],r*Qz[1],r*Qz[2]));return t.subtract(e,n,e),t.divide(e,o,e),n.delete(),o.delete(),e}},{key:"transform",value:function(e){var t=window.cv,r=new t.Mat;return t.resize(e,r,new t.Size(224,224)),e.delete(),this.normalize(r)}},{key:"forward",value:function(e){var t=window,r=t.tf,n=t.cv;n.cvtColor(e,e,n.COLOR_RGBA2RGB);var o=r.tensor(e.data32F,[e.rows,e.cols,e.channels()]);e.delete();var i=r.transpose(o,[2,0,1]),a=r.expandDims(i,0),s=this.model.predict(a);return o.dispose(),i.dispose(),a.dispose(),Array.from(s.dataSync())}},{key:"process",value:function(e){e=this.transform(e);var t=this.forward(e),r=Math.log(function(e){for(var t=0,r=0;r<e.length;r++)t+=e[r];return t}(function(e){for(var t=[],r=0;r<e.length;r++)t[r]=Math.exp(e[r]);return t}(t))),n=function(e){for(var t=[],r=0,n=Math.max.apply(Math,MP(e)),o=0;o<e.length;o++)e[o]=Math.exp(e[o]-n),r+=e[o];for(var i=0;i<e.length;i++)t[i]=e[i]/r;return t}(t);return[r,Math.max.apply(Math,MP(n)),n]}},{key:"cropFace",value:function(e,t){var r=t[0],n=t[1],o=t[3],i=Math.floor(n[0]-r[0]),a=Math.max(0,Math.floor(r[0]-1*i)),s=Math.max(0,Math.floor(r[1]-1.3*i)),c=Math.min(Math.floor(n[0]+1*i),e.cols),u=Math.min(Math.floor(o[1]+.9*i),e.rows),l=window.cv;return e.roi(new l.Rect(a,s,c-a,u-s))}},{key:"predict",value:(e=EP(kP().mark((function e(t,r){var n,o,i,a,s,c,u,l,d,f,h,p,m,g,v,y,b=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=b.length>2&&void 0!==b[2]?b[2]:.11,o=b.length>3&&void 0!==b[3]?b[3]:Gz,e.prev=2,i=window,a=i.cv,s=a.imread(t),c=this.cropFace(s,r),s.delete(),u=this.process(c),l=RP(u,3),d=l[0],f=l[1],h=l[2],p=$z(d,5,23),m=1-(p-5)/18,g=Zz(h),v=Xz[g],!(m>n)){e.next=15;break}return e.abrupt("return",[!1,m]);case 15:y=0;case 16:if(!(y<o.length)){e.next=22;break}if(v!==o[y]){e.next=19;break}return e.abrupt("return",[!0,0]);case 19:y++,e.next=16;break;case 22:if(!(f<Yz[v])){e.next=24;break}return e.abrupt("return",[!0,0]);case 24:return e.abrupt("return",[!1,1]);case 27:return e.prev=27,e.t0=e.catch(2),console.error("NotQualifiedDetector error",e.t0),e.abrupt("return",[!0,0]);case 31:case"end":return e.stop()}}),e,this,[[2,27]])}))),function(t,r){return e.apply(this,arguments)})}]);var e,t}(),eq=function(){var e=EP(kP().mark((function e(){return kP().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 tq(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,r=void 0===t?100:t,n=hv.useRef([]),o=hv.useRef([]),i=(hv.useRef(!1),hv.useRef({})),a=hv.useCallback((function(e){var t=Date.now(),n=e.type;return!!(i.current[n]&&t-i.current[n]<r)||(i.current[n]=t,!1)}),[r]),s=hv.useCallback((function(e){a(e)||o.current.push({time:Date.now(),alpha:null==e?void 0:e.alpha,beta:null==e?void 0:e.beta,gamma:null==e?void 0:e.gamma})}),[a]),c=hv.useCallback((function(e){var t,r,o,i,s,c;a(e)||n.current.push({time:Date.now(),Accelerometer:{x:null==e||null===(t=e.acceleration)||void 0===t?void 0:t.x,y:null==e||null===(r=e.acceleration)||void 0===r?void 0:r.y,z:null==e||null===(o=e.acceleration)||void 0===o?void 0:o.z},Gyroscope:{z:null==e||null===(i=e.rotationRate)||void 0===i?void 0:i.alpha,x:null==e||null===(s=e.rotationRate)||void 0===s?void 0:s.beta,y:null==e||null===(c=e.rotationRate)||void 0===c?void 0:c.gamma}})}),[a]),u=hv.useCallback((function(){}),[c,s]),l=hv.useCallback((function(){}),[c,s]);return hv.useEffect((function(){return function(){l()}}),[l]),{motionData:n.current,orientationData:o.current,startMotion:u,stopMotion:l}}var rq=Pz((function(e,t,r,n){RT(t,sR(t),e,n)})),nq=function(e){if(!MT(e))return!1;var t=rT(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!gM(e)},oq=Iz((function(e,t){try{return kM(e,void 0,t)}catch(e){return nq(e)?e:new Error(e)}})),iq=Object.prototype,aq=iq.hasOwnProperty,sq=function(e,t,r,n){return void 0===e||FP(e,iq[r])&&!aq.call(n,r)?t:e},cq={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},uq=function(e){return"\\"+cq[e]},lq=/<%=([\s\S]+?)%>/g,dq=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),fq=/[&<>"']/g,hq=RegExp(fq.source),pq={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:lq,variable:"",imports:{_:{escape:function(e){return(e=iM(e))&&hq.test(e)?e.replace(fq,dq):e}}}},mq=/\b__p \+= '';/g,gq=/\b(__p \+=) '' \+/g,vq=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yq=/[()=,{}\[\]\/\s]/,bq=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,wq=/($^)/,_q=/['\n\r\u2028\u2029\\]/g,kq=Object.prototype.hasOwnProperty,Cq=function(e,t,r){var n=pq.imports._.templateSettings||pq;r&&Az(e,t,r)&&(t=void 0),e=iM(e),t=rq({},t,n,sq);var o,i,a=rq({},t.imports,n.imports,sq),s=oR(a),c=function(e,t){return NP(t,(function(t){return e[t]}))}(a,s),u=0,l=t.interpolate||wq,d="__p += '",f=RegExp((t.escape||wq).source+"|"+l.source+"|"+(l===lq?bq:wq).source+"|"+(t.evaluate||wq).source+"|$","g"),h=kq.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,a,s,c){return n||(n=a),d+=e.slice(u,c).replace(_q,uq),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var p=kq.call(t,"variable")&&t.variable;if(p){if(yq.test(p))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(mq,""):d).replace(gq,"$1").replace(vq,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=oq((function(){return Function(s,h+"return "+d).apply(void 0,c)}));if(m.source=d,nq(m))throw m;return m},Sq=function(){var e=QD();return hv.useCallback((function(t,r){var n,o;return r?Cq(null!==(o=e[t])&&void 0!==o?o:t)(r):null!==(n=e[t])&&void 0!==n?n:t}),[e])},Bq=function(e){hv.useEffect((function(){!function(e){new Promise((function(t,r){var n=new Image;n.onload=t,n.onerror=r,n.src=e}))}(e)}),[e])},Eq=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']))},xq=Pz((function(e,t,r){xz(e,t,r)})),Iq=ZM(),Aq=AP((function e(t){var r=this,n=t.container,o=t.lang,i=void 0===o?"vi":o,a=t.assetRoot,s=t.resourceRoot,c=t.customUrls,u=void 0===c?{}:c,l=t.enableAntiDebug,d=void 0===l||l,f=t.warmupMessage,h=t.baseComponent,p=t.component,m=void 0===p?{}:p,g=t.country,v=void 0===g?"vn":g,y=t.idCardContext,b=t.exifKey,w=void 0===b?"":b,_=t.themeVersion,k=void 0===_?"v2":_,C=t.enableVoice,S=void 0!==C&&C;xP(this,e),PP(this,"getDeviceInfo",EP(kP().mark((function e(){var t,r;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={id:null,udid:null,sn:null,imei:null,manufacturer:JM(),deviceName:eD(),wlanMac:null,phoneNumber:null,location:{latitude:null,longitude:null}},e.next=3,lj();case 3:return r=e.sent,t.location.latitude=(null==r?void 0:r.lat)||null,t.location.longitude=(null==r?void 0:r.long)||null,e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})))),PP(this,"initNativeCamera",(function(e){var t=document.createElement("div");document.body.appendChild(t);var n=hv.createRef(),o=r.component.NativeCamera;return hP.render(hv.createElement(o,TP({},e,{ref:n})),t),{openCamera:function(){n.current.click()}}})),PP(this,"runWarmUpReadIDCard",EP(kP().mark((function e(){var t;return kP().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)})))),PP(this,"runPreloadEKYCResources",EP(kP().mark((function e(){var t;return kP().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)})))),PP(this,"destroyView",(function(){hP.unmountComponentAtNode(r.container)})),function(e,t,r,n,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,i,a,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var B=MM({resourceRoot:s,initCustomUrls:u,country:v});this.commonSettings=_P({lang:i,assetRoot:a,customUrls:B,enableAntiDebug:d,debug:!1,warmupMessage:f,country:v,exifKey:w,themeVersion:k,enableVoice:S},y),this.component=xq({},h,m)}),[{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,r=_P(_P({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{});hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(HD,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:r}},hv.createElement(tL,{mode:"id_card"},hv.createElement(t,TP({onClose:this.destroyView},e))))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var t=this.component.ReadIDCardUIOnly,r=_P(_P({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{});hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(HD,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:r}},hv.createElement(pF,{clientSettings:null==e?void 0:e.clientSettings,onError:null==e?void 0:e.onError},hv.createElement(tL,{mode:"id_card"},hv.createElement(t,TP({onClose:this.destroyView},e)))))),this.container)}},{key:"livenessDetection",value:function(e){var t=this.component,r=t.LivenessDetection,n=t.CustomComponent,o=_P(_P(_P(_P({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{}),(null==e?void 0:e.customInstructions)||{}),(null==e?void 0:e.customMessages)||{});hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(HD,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:o}},hv.createElement(tL,{mode:Fz(e.mode)},hv.createElement(r,TP({onClose:this.destroyView},e,{customComponent:n}))))),this.container)}},{key:"ekycFlow",value:function(e){var t=this.component.EkycFlow,r=(null==e?void 0:e.customTexts)||{};hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(HD,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:r}},hv.createElement(t,TP({onClose:this.destroyView},e)))),this.container)}},{key:"flashLiveness",value:function(e){var t=this.component.FlashLiveness;hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(t,TP({onClose:this.destroyView},e))),this.container)}},{key:"faceAuthentication",value:function(e){var t=this.component,r=t.FaceAuthentication,n=t.LivenessDetection,o=t.CustomComponent,i=_P(_P(_P(_P({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{}),(null==e?void 0:e.customInstructions)||{}),(null==e?void 0:e.customMessages)||{});hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(HD,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:i}},hv.createElement(tL,{mode:Fz(e.authMethod)},hv.createElement(r,TP({onClose:this.destroyView},e,{livenessDetectionComponent:n,customComponent:o}))))),this.container)}},{key:"compareFaces",value:function(e){var t=e.accessKey,r=e.secretKey,n=e.apiUrl,o=e.image1,i=e.image2,a=e.onSuccess,s=e.onError;bj(new jM(t,r,n,{httpHeaders:Iq})).compareFaces({image1:{id:o},image2:{id:i}}).then((function(e){a(e)})).catch((function(e){s(e)}))}}]),Pq=ZM(),Tq=function(){return AP((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(xP(this,e),t&&r&&n){var o=vD({userId:""});this.apiClient=bj(new jM(t,r,n,{httpHeaders:_P(_P({},Pq),{},{"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)}),[{key:"clientSettings",value:(l=EP(kP().mark((function e(t){var r;return kP().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 l.apply(this,arguments)})},{key:"uploadImage",value:(u=EP(kP().mark((function e(t){var r;return kP().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 u.apply(this,arguments)})},{key:"uploadFiles",value:(c=EP(kP().mark((function e(t){var r,n,o=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:{},!this.apiClient){e.next=6;break}return e.next=4,this.apiClient.httpClient.post("/v1/files",t,r);case 4:return n=e.sent,e.abrupt("return",n);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"requestVerifyIDCard",value:(s=EP(kP().mark((function e(t){var r;return kP().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 s.apply(this,arguments)})},{key:"detectIDTampering",value:(a=EP(kP().mark((function e(t){var r;return kP().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 a.apply(this,arguments)})},{key:"readIDCard",value:(i=EP(kP().mark((function e(t){var r;return kP().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:(o=EP(kP().mark((function e(t){var r;return kP().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 o.apply(this,arguments)})},{key:"verifyFaceLiveness",value:(n=EP(kP().mark((function e(t){var r;return kP().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 n.apply(this,arguments)})},{key:"compareFaces",value:(r=EP(kP().mark((function e(t){var r;return kP().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 r.apply(this,arguments)})},{key:"searchFaces",value:(t=EP(kP().mark((function e(t){var r;return kP().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 t.apply(this,arguments)})},{key:"indexFaces",value:(e=EP(kP().mark((function e(t){var r;return kP().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(t){return e.apply(this,arguments)})}]);var e,t,r,n,o,i,a,s,c,u,l}();function Rq(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 Mq(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rq(Object(r),!0).forEach((function(t){Vq(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rq(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Dq(){Dq=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:B(e,r,s)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var f="suspendedStart",h="executing",p="completed",m={};function g(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(P([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=y.prototype=g.prototype=Object.create(b);function C(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==rg(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function B(t,r,n){var o=f;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=E(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=d(t,r,n);if("normal"===u.type){if(o=n.done?p:"suspendedYield",u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=p,n.method="throw",n.arg=u.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function x(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function P(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(rg(t)+" is not iterable")}return v.prototype=y,o(k,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},C(S.prototype),u(S.prototype,s,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=P,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.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 i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},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),I(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;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Lq(e){var t=function(e,t){if("object"!=rg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=rg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==rg(t)?t:t+""}function Oq(e){return(Oq="function"==typeof Symbol&&"symbol"==rg(Symbol.iterator)?function(e){return rg(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":rg(e)})(e)}function Nq(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Fq(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Nq(i,n,o,a,s,"next",e)}function s(e){Nq(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Vq(e,t,r){return(t=Lq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jq(){return(jq=Object.assign?Object.assign.bind():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 Uq(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function zq(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||Wq(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 qq(e){return function(e){if(Array.isArray(e))return Hq(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wq(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 Wq(e,t){if(e){if("string"==typeof e)return Hq(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)?Hq(e,t):void 0}}function Hq(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 Kq=Array.isArray,Qq="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Gq(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 Xq,Yq="object"==rg(Qq)&&Qq&&Qq.Object===Object&&Qq,$q="object"==("undefined"==typeof self?"undefined":rg(self))&&self&&self.Object===Object&&self,Zq=Yq||$q||Function("return this")(),Jq=Zq.Symbol,eW=Object.prototype,tW=eW.hasOwnProperty,rW=eW.toString,nW=Jq?Jq.toStringTag:void 0,oW=Object.prototype.toString,iW=Jq?Jq.toStringTag:void 0,aW=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":iW&&iW in Object(e)?function(e){var t=tW.call(e,nW),r=e[nW];try{e[nW]=void 0;var n=!0}catch(e){}var o=rW.call(e);return n&&(t?e[nW]=r:delete e[nW]),o}(e):function(e){return oW.call(e)}(e)},sW=function(e){return null!=e&&"object"==rg(e)},cW=function(e){return"symbol"==rg(e)||sW(e)&&"[object Symbol]"==aW(e)},uW=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lW=/^\w*$/,dW=function(e){var t=rg(e);return null!=e&&("object"==t||"function"==t)},fW=function(e){if(!dW(e))return!1;var t=aW(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},hW=Zq["__core-js_shared__"],pW=(Xq=/[^.]+$/.exec(hW&&hW.keys&&hW.keys.IE_PROTO||""))?"Symbol(src)_1."+Xq:"",mW=Function.prototype.toString,gW=/^\[object .+?Constructor\]$/,vW=Function.prototype,yW=Object.prototype,bW=vW.toString,wW=yW.hasOwnProperty,_W=RegExp("^"+bW.call(wW).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kW=function(e){return!(!dW(e)||function(e){return!!pW&&pW in e}(e))&&(fW(e)?_W:gW).test(function(e){if(null!=e){try{return mW.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))},CW=function(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return kW(r)?r:void 0},SW=CW(Object,"create"),BW=Object.prototype.hasOwnProperty,EW=Object.prototype.hasOwnProperty;function xW(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])}}xW.prototype.clear=function(){this.__data__=SW?SW(null):{},this.size=0},xW.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xW.prototype.get=function(e){var t=this.__data__;if(SW){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return BW.call(t,e)?t[e]:void 0},xW.prototype.has=function(e){var t=this.__data__;return SW?void 0!==t[e]:EW.call(t,e)},xW.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=SW&&void 0===t?"__lodash_hash_undefined__":t,this};var IW=xW,AW=function(e,t){return e===t||e!=e&&t!=t},PW=function(e,t){for(var r=e.length;r--;)if(AW(e[r][0],t))return r;return-1},TW=Array.prototype.splice;function RW(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])}}RW.prototype.clear=function(){this.__data__=[],this.size=0},RW.prototype.delete=function(e){var t=this.__data__,r=PW(t,e);return!(r<0||(r==t.length-1?t.pop():TW.call(t,r,1),--this.size,0))},RW.prototype.get=function(e){var t=this.__data__,r=PW(t,e);return r<0?void 0:t[r][1]},RW.prototype.has=function(e){return PW(this.__data__,e)>-1},RW.prototype.set=function(e,t){var r=this.__data__,n=PW(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var MW=RW,DW=CW(Zq,"Map"),LW=function(e,t){var r=e.__data__;return function(e){var t=rg(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map};function OW(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])}}OW.prototype.clear=function(){this.size=0,this.__data__={hash:new IW,map:new(DW||MW),string:new IW}},OW.prototype.delete=function(e){var t=LW(this,e).delete(e);return this.size-=t?1:0,t},OW.prototype.get=function(e){return LW(this,e).get(e)},OW.prototype.has=function(e){return LW(this,e).has(e)},OW.prototype.set=function(e,t){var r=LW(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};var NW=OW;function FW(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(FW.Cache||NW),r}FW.Cache=NW;var VW=FW,jW=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,UW=/\\(\\)?/g,zW=function(e){var t=VW((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(jW,(function(e,r,n,o){t.push(n?o.replace(UW,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),qW=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},WW=Jq?Jq.prototype:void 0,HW=WW?WW.toString:void 0,KW=function e(t){if("string"==typeof t)return t;if(Kq(t))return qW(t,e)+"";if(cW(t))return HW?HW.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},QW=function(e){return null==e?"":KW(e)},GW=function(e,t){return Kq(e)?e:function(e,t){if(Kq(e))return!1;var r=rg(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!cW(e))||lW.test(e)||!uW.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:zW(QW(e))},XW=function(e){if("string"==typeof e||cW(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},YW=function(e,t,r){var n=null==e?void 0:function(e,t){for(var r=0,n=(t=GW(t,e)).length;null!=e&&r<n;)e=e[XW(t[r++])];return r&&r==n?e:void 0}(e,t);return void 0===n?r:n},$W=Gq((function(e,t){!function(r,n){var o="function",i="undefined",a="object",s="string",c="model",u="name",l="type",d="vendor",f="version",h="architecture",p="console",m="mobile",g="tablet",v="smarttv",y="wearable",b="embedded",w="Amazon",_="Apple",k="ASUS",C="BlackBerry",S="Google",B="Huawei",E="LG",x="Microsoft",I="Motorola",A="Samsung",P="Sharp",T="Sony",R="Xiaomi",M="Zebra",D="Facebook",L="Chromium OS",O="Mac OS",N=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},F=function(e,t){return rg(e)===s&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},j=function(e,t){if(rg(e)===s)return e=e.replace(/^\s\s*/,""),rg(t)===i?e:e.substring(0,500)},U=function(e,t){for(var r,i,s,c,u,l,d=0;d<t.length&&!u;){var f=t[d],h=t[d+1];for(r=i=0;r<f.length&&!u&&f[r];)if(u=f[r++].exec(e))for(s=0;s<h.length;s++)l=u[++i],rg(c=h[s])===a&&c.length>0?2===c.length?rg(c[1])==o?this[c[0]]=c[1].call(this,l):this[c[0]]=c[1]:3===c.length?rg(c[1])!==o||c[1].exec&&c[1].test?this[c[0]]=l?l.replace(c[1],c[2]):n:this[c[0]]=l?c[1].call(this,l,c[2]):n:4===c.length&&(this[c[0]]=l?c[3].call(this,l.replace(c[1],c[2])):n):this[c]=l||n;d+=2}},z=function(e,t){for(var r in t)if(rg(t[r])===a&&t[r].length>0){for(var o=0;o<t[r].length;o++)if(F(t[r][o],e))return"?"===r?n:r}else if(F(t[r],e))return"?"===r?n:r;return e},q={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"},W={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,f],[/opios[\/ ]+([\w\.]+)/i],[f,[u,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[f,[u,"Opera"]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[u,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[u,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[u,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[u,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[u,"Smart Lenovo Browser"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure Browser"],f],[/\bfocus\/([\w\.]+)/i],[f,[u,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[f,[u,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[u,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[u,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[f,[u,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 Browser"]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 Browser"],f],[/samsungbrowser\/([\w\.]+)/i],[f,[u,"Samsung Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],f],[/metasr[\/ ]?([\d\.]+)/i],[f,[u,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[u,f],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,D],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[u,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[u,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,"Chrome WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[u,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[f,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[u,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[u,f],[/(cobalt)\/([\w\.]+)/i],[u,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,V]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[d,A],[l,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[d,A],[l,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[d,_],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[d,_],[l,g]],[/(macintosh);/i],[c,[d,_]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[d,P],[l,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[d,B],[l,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[d,B],[l,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[d,R],[l,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[d,R],[l,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[d,"OPPO"],[l,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[d,"Vivo"],[l,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[d,"Realme"],[l,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[d,I],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[d,I],[l,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[d,E],[l,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[d,E],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[d,"Lenovo"],[l,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[d,"Nokia"],[l,m]],[/(pixel c)\b/i],[c,[d,S],[l,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[d,S],[l,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[d,T],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[d,T],[l,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[d,"OnePlus"],[l,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[d,w],[l,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[d,w],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,d,[l,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[d,C],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[d,k],[l,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[d,k],[l,m]],[/(nexus 9)/i],[c,[d,"HTC"],[l,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[c,/_/g," "],[l,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[d,"Acer"],[l,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[d,"Meizu"],[l,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[d,"Ulefone"],[l,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,c,[l,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,c,[l,g]],[/(surface duo)/i],[c,[d,x],[l,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[d,"Fairphone"],[l,m]],[/(u304aa)/i],[c,[d,"AT&T"],[l,m]],[/\bsie-(\w*)/i],[c,[d,"Siemens"],[l,m]],[/\b(rct\w+) b/i],[c,[d,"RCA"],[l,g]],[/\b(venue[\d ]{2,7}) b/i],[c,[d,"Dell"],[l,g]],[/\b(q(?:mv|ta)\w+) b/i],[c,[d,"Verizon"],[l,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[d,"Barnes & Noble"],[l,g]],[/\b(tm\d{3}\w+) b/i],[c,[d,"NuVision"],[l,g]],[/\b(k88) b/i],[c,[d,"ZTE"],[l,g]],[/\b(nx\d{3}j) b/i],[c,[d,"ZTE"],[l,m]],[/\b(gen\d{3}) b.+49h/i],[c,[d,"Swiss"],[l,m]],[/\b(zur\d{3}) b/i],[c,[d,"Swiss"],[l,g]],[/\b((zeki)?tb.*\b) b/i],[c,[d,"Zeki"],[l,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],c,[l,g]],[/\b(ns-?\w{0,9}) b/i],[c,[d,"Insignia"],[l,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[d,"NextBook"],[l,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],c,[l,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],c,[l,m]],[/\b(ph-1) /i],[c,[d,"Essential"],[l,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[d,"Envizen"],[l,g]],[/\b(trio[-\w\. ]+) b/i],[c,[d,"MachSpeed"],[l,g]],[/\btu_(1491) b/i],[c,[d,"Rotor"],[l,g]],[/(shield[\w ]+) b/i],[c,[d,"Nvidia"],[l,g]],[/(sprint) (\w+)/i],[d,c,[l,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[d,x],[l,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[d,M],[l,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[d,M],[l,m]],[/smart-tv.+(samsung)/i],[d,[l,v]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[d,A],[l,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,E],[l,v]],[/(apple) ?tv/i],[d,[c,"Apple TV"],[l,v]],[/crkey/i],[[c,"Chromecast"],[d,S],[l,v]],[/droid.+aft(\w+)( bui|\))/i],[c,[d,w],[l,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[d,P],[l,v]],[/(bravia[\w ]+)( bui|\))/i],[c,[d,T],[l,v]],[/(mitv-\w{5}) bui/i],[c,[d,R],[l,v]],[/Hbbtv.*(technisat) (.*);/i],[d,c,[l,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,j],[c,j],[l,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,c,[l,p]],[/droid.+; (shield) bui/i],[c,[d,"Nvidia"],[l,p]],[/(playstation [345portablevi]+)/i],[c,[d,T],[l,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[d,x],[l,p]],[/((pebble))app/i],[d,c,[l,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[d,_],[l,y]],[/droid.+; (glass) \d/i],[c,[d,S],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[c,[d,M],[l,y]],[/(quest( 2| pro)?)/i],[c,[d,D],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,b]],[/(aeobc)\b/i],[c,[d,w],[l,b]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[l,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,f],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[u,[f,z,q]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,z,q],[u,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,O],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,f],[/\(bb(10);/i],[f,[u,C]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[u,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[u,"Chromecast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,L],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,f],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,f]]},H=function e(t,c){if(rg(t)===a&&(c=t,t=n),!(this instanceof e))return new e(t,c).getResult();var u=rg(r)!==i&&r.navigator?r.navigator:n,l=t||(u&&u.userAgent?u.userAgent:""),d=u&&u.userAgentData?u.userAgentData:n,f=c?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}(W,c):W,h=u&&u.userAgent==l;return this.getBrowser=function(){var e,t={};return t.name=n,t.version=n,U.call(t,l,f.browser),t.major=rg(e=t.version)===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n,h&&u&&u.brave&&rg(u.brave.isBrave)==o&&(t.name="Brave"),t},this.getCPU=function(){var e={};return e.architecture=n,U.call(e,l,f.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,U.call(e,l,f.device),h&&!e.type&&d&&d.mobile&&(e.type=m),h&&"Macintosh"==e.model&&u&&rg(u.standalone)!==i&&u.maxTouchPoints&&u.maxTouchPoints>2&&(e.model="iPad",e.type=g),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,U.call(e,l,f.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,U.call(e,l,f.os),h&&!e.name&&d&&"Unknown"!=d.platform&&(e.name=d.platform.replace(/chrome os/i,L).replace(/macos/i,O)),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 l},this.setUA=function(e){return l=rg(e)===s&&e.length>500?j(e,500):e,this},this.setUA(l),this};H.VERSION="1.0.37",H.BROWSER=N([u,f,"major"]),H.CPU=N([h]),H.DEVICE=N([c,d,l,p,m,v,g,y,b]),H.ENGINE=H.OS=N([u,f]),e.exports&&(t=e.exports=H),t.UAParser=H;var K=rg(r)!==i&&(r.jQuery||r.Zepto);if(K&&!K.ua){var Q=new H;K.ua=Q.getResult(),K.ua.get=function(){return Q.getUA()},K.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var r in t)K.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":rg(window))?window:Qq)})),ZW=Gq((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r,n=(r=hv)&&"object"==rg(r)&&"default"in r?r.default:r,o=new $W,i=o.getBrowser(),a=o.getCPU(),s=o.getDevice(),c=o.getEngine(),u=o.getOS(),l=o.getUA(),d=function(e){return o.setUA(e)},f=function(e){if(e){var t=new $W(e);return{UA:t,browser:t.getBrowser(),cpu:t.getCPU(),device:t.getDevice(),engine:t.getEngine(),os:t.getOS(),ua:t.getUA(),setUserAgent:function(e){return t.setUA(e)}}}console.error("No userAgent string was provided")},h=Object.freeze({ClientUAInstance:o,browser:i,cpu:a,device:s,engine:c,os:u,ua:l,setUa:d,parseUserAgent:f});function p(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 m(e){return(m="function"==typeof Symbol&&"symbol"==rg(Symbol.iterator)?function(e){return rg(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":rg(e)})(e)}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(){return(v=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 y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(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 C="mobile",S="tablet",B="smarttv",E="console",x="wearable",I="embedded",A=void 0,P={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},T={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},R={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},M=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";return e||t},D=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},L=function(e){var t=D();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},O=function(e,t,r,n){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){g(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{vendor:M(t.vendor),model:M(t.model),os:M(r.name),osVersion:M(r.version),ua:M(n)})},N=function(e){return e.type===C},F=function(e){return e.type===S},V=function(e){var t=e.type;return t===C||t===S},j=function(e){return e.type===B},U=function(e){return e.type===A},z=function(e){return e.type===x},q=function(e){return e.type===E},W=function(e){return e.type===I},H=function(e){var t=e.vendor;return M(t)},K=function(e){var t=e.model;return M(t)},Q=function(e){var t=e.type;return M(t,"browser")},G=function(e){return e.name===T.Android},X=function(e){return e.name===T.Windows},Y=function(e){return e.name===T.MAC_OS},$=function(e){return e.name===T.WindowsPhone},Z=function(e){return e.name===T.IOS},J=function(e){var t=e.version;return M(t)},ee=function(e){var t=e.name;return M(t)},te=function(e){return e.name===P.Chrome},re=function(e){return e.name===P.Firefox},ne=function(e){return e.name===P.Chromium},oe=function(e){return e.name===P.Edge},ie=function(e){return e.name===P.Yandex},ae=function(e){var t=e.name;return t===P.Safari||t===P.MobileSafari},se=function(e){return e.name===P.MobileSafari},ce=function(e){return e.name===P.Opera},ue=function(e){var t=e.name;return t===P.InternetExplorer||t===P.Ie},le=function(e){return e.name===P.MIUI},de=function(e){return e.name===P.SamsungBrowser},fe=function(e){var t=e.version;return M(t)},he=function(e){var t=e.major;return M(t)},pe=function(e){var t=e.name;return M(t)},me=function(e){var t=e.name;return M(t)},ge=function(e){var t=e.version;return M(t)},ve=function(){var e=D(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)},ye=function(e){return"string"==typeof e&&-1!==e.indexOf("Edg/")},be=function(){var e=D();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream},we=function(){return L("iPad")},_e=function(){return L("iPhone")},ke=function(){return L("iPod")},Ce=function(e){return M(e)};function Se(e){var t=e||h,r=t.device,n=t.browser,o=t.os,i=t.engine,a=t.ua;return{isSmartTV:j(r),isConsole:q(r),isWearable:z(r),isEmbedded:W(r),isMobileSafari:se(n)||we(),isChromium:ne(n),isMobile:V(r)||we(),isMobileOnly:N(r),isTablet:F(r)||we(),isBrowser:U(r),isDesktop:U(r),isAndroid:G(o),isWinPhone:$(o),isIOS:Z(o)||we(),isChrome:te(n),isFirefox:re(n),isSafari:ae(n),isOpera:ce(n),isIE:ue(n),osVersion:J(o),osName:ee(o),fullBrowserVersion:fe(n),browserVersion:he(n),browserName:pe(n),mobileVendor:H(r),mobileModel:K(r),engineName:me(i),engineVersion:ge(i),getUA:Ce(a),isEdge:oe(n)||ye(a),isYandex:ie(n),deviceType:Q(r),isIOS13:be(),isIPad13:we(),isIPhone13:_e(),isIPod13:ke(),isElectron:ve(),isEdgeChromium:ye(a),isLegacyEdge:oe(n)&&!ye(a),isWindows:X(o),isMacOs:Y(o),isMIUI:le(n),isSamsungBrowser:de(n)}}var Be=j(s),Ee=q(s),xe=z(s),Ie=W(s),Ae=se(i)||we(),Pe=ne(i),Te=V(s)||we(),Re=N(s),Me=F(s)||we(),De=U(s),Le=U(s),Oe=G(u),Ne=$(u),Fe=Z(u)||we(),Ve=te(i),je=re(i),Ue=ae(i),ze=ce(i),qe=ue(i),We=J(u),He=ee(u),Ke=fe(i),Qe=he(i),Ge=pe(i),Xe=H(s),Ye=K(s),$e=me(c),Ze=ge(c),Je=Ce(l),et=oe(i)||ye(l),tt=ie(i),rt=Q(s),nt=be(),ot=we(),it=_e(),at=ke(),st=ve(),ct=ye(l),ut=oe(i)&&!ye(l),lt=X(u),dt=Y(u),ft=le(i),ht=de(i);function pt(e){var t=e||window.navigator.userAgent;return f(t)}t.AndroidView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Oe?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.BrowserTypes=P,t.BrowserView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return De?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.ConsoleView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Ee?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.CustomView=function(e){var t=e.renderWithFragment,r=e.children,o=(e.viewClassName,e.style,e.condition),i=w(e,["renderWithFragment","children","viewClassName","style","condition"]);return o?t?n.createElement(hv.Fragment,null,r):n.createElement("div",i,r):null},t.IEView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return qe?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.IOSView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Fe?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.MobileOnlyView=function(e){var t=e.renderWithFragment,r=e.children,o=(e.viewClassName,e.style,w(e,["renderWithFragment","children","viewClassName","style"]));return Re?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.MobileView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Te?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.OsTypes=T,t.SmartTVView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Be?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.TabletView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Me?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.WearableView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return xe?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.WinPhoneView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Ne?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.browserName=Ge,t.browserVersion=Qe,t.deviceDetect=function(e){var t=e?f(e):h,r=t.device,n=t.browser,o=t.engine,i=t.os,a=t.ua,s=function(e){switch(e){case C:return{isMobile:!0};case S:return{isTablet:!0};case B:return{isSmartTV:!0};case E:return{isConsole:!0};case x:return{isWearable:!0};case A:return{isBrowser:!0};case I:return{isEmbedded:!0};default:return R}}(r.type),c=s.isBrowser,u=s.isMobile,l=s.isTablet,d=s.isSmartTV,p=s.isConsole,m=s.isWearable,g=s.isEmbedded;return c?function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:M(t.major),browserFullVersion:M(t.version),browserName:M(t.name),engineName:M(r.name),engineVersion:M(r.version),osName:M(n.name),osVersion:M(n.version),userAgent:M(o)}}(c,n,o,i,a):d?function(e,t,r,n){return{isSmartTV:e,engineName:M(t.name),engineVersion:M(t.version),osName:M(r.name),osVersion:M(r.version),userAgent:M(n)}}(d,o,i,a):p?function(e,t,r,n){return{isConsole:e,engineName:M(t.name),engineVersion:M(t.version),osName:M(r.name),osVersion:M(r.version),userAgent:M(n)}}(p,o,i,a):u||l?O(s,r,i,a):m?function(e,t,r,n){return{isWearable:e,engineName:M(t.name),engineVersion:M(t.version),osName:M(r.name),osVersion:M(r.version),userAgent:M(n)}}(m,o,i,a):g?function(e,t,r,n,o){return{isEmbedded:e,vendor:M(t.vendor),model:M(t.model),engineName:M(r.name),engineVersion:M(r.version),osName:M(n.name),osVersion:M(n.version),userAgent:M(o)}}(g,r,o,i,a):void 0},t.deviceType=rt,t.engineName=$e,t.engineVersion=Ze,t.fullBrowserVersion=Ke,t.getSelectorsByUserAgent=function(e){if(e&&"string"==typeof e){var t=f(e);return Se({device:t.device,browser:t.browser,os:t.os,engine:t.engine,ua:t.ua})}console.error("No valid user agent string was provided")},t.getUA=Je,t.isAndroid=Oe,t.isBrowser=De,t.isChrome=Ve,t.isChromium=Pe,t.isConsole=Ee,t.isDesktop=Le,t.isEdge=et,t.isEdgeChromium=ct,t.isElectron=st,t.isEmbedded=Ie,t.isFirefox=je,t.isIE=qe,t.isIOS=Fe,t.isIOS13=nt,t.isIPad13=ot,t.isIPhone13=it,t.isIPod13=at,t.isLegacyEdge=ut,t.isMIUI=ft,t.isMacOs=dt,t.isMobile=Te,t.isMobileOnly=Re,t.isMobileSafari=Ae,t.isOpera=ze,t.isSafari=Ue,t.isSamsungBrowser=ht,t.isSmartTV=Be,t.isTablet=Me,t.isWearable=xe,t.isWinPhone=Ne,t.isWindows=lt,t.isYandex=tt,t.mobileModel=Ye,t.mobileVendor=Xe,t.osName=He,t.osVersion=We,t.parseUserAgent=f,t.setUserAgent=function(e){return d(e)},t.useDeviceData=pt,t.useDeviceSelectors=function(e){var t=pt(e||window.navigator.userAgent);return[Se(t),t]},t.useMobileOrientation=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(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)?k(e,t):void 0}}(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.")}()}(hv.useState((function(){var e=window.innerWidth>window.innerHeight?90:0;return{isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"}})),2),t=e[0],r=e[1],n=hv.useCallback((function(){var e=window.innerWidth>window.innerHeight?90:0,n={isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"};t.orientation!==n.orientation&&r(n)}),[t.orientation]);return hv.useEffect((function(){return void 0!==("undefined"==typeof window?"undefined":m(window))&&Te&&(n(),window.addEventListener("load",n,!1),window.addEventListener("resize",n,!1)),function(){window.removeEventListener("resize",n,!1),window.removeEventListener("load",n,!1)}}),[n]),t},t.withOrientationChange=function(e){return function(t){function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=function(e,t){if(t&&("object"==rg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _(e)}(this,y(r).call(this,e))).isEventListenerAdded=!1,t.handleOrientationChange=t.handleOrientationChange.bind(_(t)),t.onOrientationChange=t.onOrientationChange.bind(_(t)),t.onPageLoad=t.onPageLoad.bind(_(t)),t.state={isLandscape:!1,isPortrait:!1},t}var o;return function(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&&b(e,t)}(r,t),(o=[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var e=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:0===e,isLandscape:90===e})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){void 0!==("undefined"==typeof window?"undefined":m(window))&&Te&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return n.createElement(e,v({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,o),r}(n.Component)}})),JW=function(){try{var e=CW(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),eH=function(e,t,r){"__proto__"==t&&JW?JW(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},tH=Object.prototype.hasOwnProperty,rH=function(e,t,r){var n=e[t];tH.call(e,t)&&AW(n,r)&&(void 0!==r||t in e)||eH(e,t,r)},nH=function(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var s=t[i],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?eH(r,s,c):rH(r,s,c)}return r},oH=function(e){return e},iH=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)},aH=Math.max,sH=function(e){return function(){return e}},cH=JW?function(e,t){return JW(e,"toString",{configurable:!0,enumerable:!1,value:sH(t),writable:!0})}:oH,uH=Date.now,lH=function(e){var t=0,r=0;return function(){var n=uH(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(cH),dH=function(e,t){return lH(function(e,t,r){return t=aH(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=aH(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),iH(e,this,s)}}(e,t,oH),e+"")},fH=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},hH=function(e){return null!=e&&fH(e.length)&&!fW(e)},pH=/^(?:0|[1-9]\d*)$/,mH=function(e,t){var r=rg(e);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&pH.test(e))&&e>-1&&e%1==0&&e<t},gH=function(e,t,r){if(!dW(r))return!1;var n=rg(t);return!!("number"==n?hH(r)&&mH(t,r.length):"string"==n&&t in r)&&AW(r[t],e)},vH=function(e){return dH((function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&gH(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t}))},yH=function(e){return sW(e)&&"[object Arguments]"==aW(e)},bH=Object.prototype,wH=bH.hasOwnProperty,_H=bH.propertyIsEnumerable,kH=yH(function(){return arguments}())?yH:function(e){return sW(e)&&wH.call(e,"callee")&&!_H.call(e,"callee")},CH=function(){return!1},SH=Gq((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?Zq.Buffer:void 0,i=(o?o.isBuffer:void 0)||CH;e.exports=i})),BH={};BH["[object Float32Array]"]=BH["[object Float64Array]"]=BH["[object Int8Array]"]=BH["[object Int16Array]"]=BH["[object Int32Array]"]=BH["[object Uint8Array]"]=BH["[object Uint8ClampedArray]"]=BH["[object Uint16Array]"]=BH["[object Uint32Array]"]=!0,BH["[object Arguments]"]=BH["[object Array]"]=BH["[object ArrayBuffer]"]=BH["[object Boolean]"]=BH["[object DataView]"]=BH["[object Date]"]=BH["[object Error]"]=BH["[object Function]"]=BH["[object Map]"]=BH["[object Number]"]=BH["[object Object]"]=BH["[object RegExp]"]=BH["[object Set]"]=BH["[object String]"]=BH["[object WeakMap]"]=!1;var EH=Gq((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&Yq.process,i=function(){try{return n&&n.require&&n.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i})),xH=EH&&EH.isTypedArray,IH=xH?function(e){return function(t){return e(t)}}(xH):function(e){return sW(e)&&fH(e.length)&&!!BH[aW(e)]},AH=Object.prototype.hasOwnProperty,PH=function(e,t){var r=Kq(e),n=!r&&kH(e),o=!r&&!n&&SH(e),i=!r&&!n&&!o&&IH(e),a=r||n||o||i,s=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=s.length;for(var u in e)!t&&!AH.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||mH(u,c))||s.push(u);return s},TH=Object.prototype,RH=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||TH)},MH=Object.prototype.hasOwnProperty,DH=function(e){if(!dW(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=RH(e),r=[];for(var n in e)("constructor"!=n||!t&&MH.call(e,n))&&r.push(n);return r},LH=function(e){return hH(e)?PH(e,!0):DH(e)},OH=vH((function(e,t,r,n){nH(t,LH(t),e,n)})),NH=function(e,t){return function(r){return e(t(r))}},FH=NH(Object.getPrototypeOf,Object),VH=Function.prototype,jH=Object.prototype,UH=VH.toString,zH=jH.hasOwnProperty,qH=UH.call(Object),WH=function(e){if(!sW(e)||"[object Object]"!=aW(e))return!1;var t=FH(e);if(null===t)return!0;var r=zH.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&UH.call(r)==qH},HH=function(e){if(!sW(e))return!1;var t=aW(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!WH(e)},KH=dH((function(e,t){try{return iH(e,void 0,t)}catch(e){return HH(e)?e:new Error(e)}})),QH=Object.prototype,GH=QH.hasOwnProperty,XH=function(e,t,r,n){return void 0===e||AW(e,QH[r])&&!GH.call(n,r)?t:e},YH={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$H=function(e){return"\\"+YH[e]},ZH=NH(Object.keys,Object),JH=Object.prototype.hasOwnProperty,eK=function(e){return hH(e)?PH(e):function(e){if(!RH(e))return ZH(e);var t=[];for(var r in Object(e))JH.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)},tK=/<%=([\s\S]+?)%>/g,rK=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),nK=/[&<>"']/g,oK=RegExp(nK.source),iK={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:tK,variable:"",imports:{_:{escape:function(e){return(e=QW(e))&&oK.test(e)?e.replace(nK,rK):e}}}},aK=/\b__p \+= '';/g,sK=/\b(__p \+=) '' \+/g,cK=/(__e\(.*?\)|\b__t\)) \+\n'';/g,uK=/[()=,{}\[\]\/\s]/,lK=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dK=/($^)/,fK=/['\n\r\u2028\u2029\\]/g,hK=Object.prototype.hasOwnProperty,pK=function(e,t,r){var n=iK.imports._.templateSettings||iK;r&&gH(e,t,r)&&(t=void 0),e=QW(e),t=OH({},t,n,XH);var o,i,a=OH({},t.imports,n.imports,XH),s=eK(a),c=function(e,t){return qW(t,(function(t){return e[t]}))}(a,s),u=0,l=t.interpolate||dK,d="__p += '",f=RegExp((t.escape||dK).source+"|"+l.source+"|"+(l===tK?lK:dK).source+"|"+(t.evaluate||dK).source+"|$","g"),h=hK.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,a,s,c){return n||(n=a),d+=e.slice(u,c).replace(fK,$H),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var p=hK.call(t,"variable")&&t.variable;if(p){if(uK.test(p))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(aK,""):d).replace(sK,"$1").replace(cK,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=KH((function(){return Function(s,h+"return "+d).apply(void 0,c)}));if(m.source=d,HH(m))throw m;return m},mK=vw.table.withConfig({displayName:"PlacementArea__Table",componentId:"sc-111697v-0"})(["width:100%;height:100%;td{text-align:center;vertical-align:middle;padding:0;border:0;}border-spacing:0;table-layout:auto;border-collapse:collapse;"]),gK=vw.div.withConfig({displayName:"PlacementArea__ChildrenWrapper",componentId:"sc-111697v-1"})(["position:relative;"]),vK=Array.from(Array(3).keys()),yK=Array.from(Array(3).keys());function bK(e){var t=e.children,r=e.x,n=e.y,o=e.width,i=e.height,a=e.className,s=e.surroundStyle;return hv.createElement(mK,{className:a},hv.createElement("tbody",null,vK.map((function(e,a){return hv.createElement("tr",{key:e,style:{height:0===a?n:"auto"},"data-testid":"row"},yK.map((function(e,n){var c=1===a&&1===n,u="auto";return c?u=o:0===n&&(u=r),hv.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:Mq({width:u,height:c?i:"auto"},c?{}:s)},c?hv.createElement(gK,{style:{width:u,height:i}},t):null)})))}))))}bK.propTypes={children:Fv.node,x:Fv.string,y:Fv.string,width:Fv.string,height:Fv.string,className:Fv.string,surroundStyle:Fv.object},bK.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var wK=/^\s+|\s+$/g,_K=/^[-+]0x[0-9a-f]+$/i,kK=/^0b[01]+$/i,CK=/^0o[0-7]+$/i,SK=parseInt,BK="object"==rg(Qq)&&Qq&&Qq.Object===Object&&Qq,EK="object"==("undefined"==typeof self?"undefined":rg(self))&&self&&self.Object===Object&&self,xK=BK||EK||Function("return this")(),IK=Object.prototype.toString,AK=Math.max,PK=Math.min,TK=function(){return xK.Date.now()};function RK(e){var t=rg(e);return!!e&&("object"==t||"function"==t)}function MK(e){if("number"==typeof e)return e;if(function(e){return"symbol"==rg(e)||function(e){return!!e&&"object"==rg(e)}(e)&&"[object Symbol]"==IK.call(e)}(e))return NaN;if(RK(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=RK(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(wK,"");var r=kK.test(e);return r||CK.test(e)?SK(e.slice(2),r?2:8):_K.test(e)?NaN:+e}var DK=function(e,t,r){var n,o,i,a,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=n,i=o;return n=o=void 0,u=t,a=e.apply(i,r)}function p(e){return u=e,s=setTimeout(g,t),l?h(e):a}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=i}function g(){var e=TK();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?PK(r,i-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?h(e):(n=o=void 0,a)}function y(){var e=TK(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return p(c);if(d)return s=setTimeout(g,t),h(c)}return void 0===s&&(s=setTimeout(g,t)),a}return t=MK(t)||0,RK(r)&&(l=!!r.leading,i=(d="maxWait"in r)?AK(MK(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?a:v(TK())},y},LK="function"==typeof Symbol&&Symbol.for,OK=LK?Symbol.for("react.element"):60103,NK=LK?Symbol.for("react.portal"):60106,FK=LK?Symbol.for("react.fragment"):60107,VK=LK?Symbol.for("react.strict_mode"):60108,jK=LK?Symbol.for("react.profiler"):60114,UK=LK?Symbol.for("react.provider"):60109,zK=LK?Symbol.for("react.context"):60110,qK=LK?Symbol.for("react.async_mode"):60111,WK=LK?Symbol.for("react.concurrent_mode"):60111,HK=LK?Symbol.for("react.forward_ref"):60112,KK=LK?Symbol.for("react.suspense"):60113,QK=LK?Symbol.for("react.suspense_list"):60120,GK=LK?Symbol.for("react.memo"):60115,XK=LK?Symbol.for("react.lazy"):60116,YK=LK?Symbol.for("react.block"):60121,$K=LK?Symbol.for("react.fundamental"):60117,ZK=LK?Symbol.for("react.responder"):60118,JK=LK?Symbol.for("react.scope"):60119;
52
+ var KU={};void 0!==KU.asn1&&KU.asn1||(KU.asn1={}),KU.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 bU(n,16).xor(e).add(bU.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=KU.asn1,r=t.DERBoolean,n=t.DERInteger,o=t.DERBitString,i=t.DEROctetString,a=t.DERNull,s=t.DERObjectIdentifier,c=t.DEREnumerated,u=t.DERUTF8String,l=t.DERNumericString,d=t.DERPrintableString,f=t.DERTeletexString,h=t.DERIA5String,p=t.DERUTCTime,m=t.DERGeneralizedTime,g=t.DERSequence,v=t.DERSet,y=t.DERTaggedObject,b=t.ASN1Util.newObject,w=Object.keys(e);if(1!=w.length)throw"key of param shall be only one.";var _=w[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+_+":"))throw"undefined key: "+_;if("bool"==_)return new r(e[_]);if("int"==_)return new n(e[_]);if("bitstr"==_)return new o(e[_]);if("octstr"==_)return new i(e[_]);if("null"==_)return new a(e[_]);if("oid"==_)return new s(e[_]);if("enum"==_)return new c(e[_]);if("utf8str"==_)return new u(e[_]);if("numstr"==_)return new l(e[_]);if("prnstr"==_)return new d(e[_]);if("telstr"==_)return new f(e[_]);if("ia5str"==_)return new h(e[_]);if("utctime"==_)return new p(e[_]);if("gentime"==_)return new m(e[_]);if("seq"==_){for(var k=e[_],C=[],S=0;S<k.length;S++){var B=b(k[S]);C.push(B)}return new g({array:C})}if("set"==_){for(k=e[_],C=[],S=0;S<k.length;S++)B=b(k[S]),C.push(B);return new v({array:C})}if("tag"==_){var E=e[_];if("[object Array]"===Object.prototype.toString.call(E)&&3==E.length){var x=b(E[2]);return new y({tag:E[0],explicit:E[1],obj:x})}var I={};if(void 0!==E.explicit&&(I.explicit=E.explicit),void 0!==E.tag&&(I.tag=E.tag),void 0===E.obj)throw"obj shall be specified for 'tag'.";return I.obj=b(E.obj),new y(I)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},KU.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),o=2;o<e.length;o+=2){var i=("00000000"+parseInt(e.substr(o,2),16).toString(2)).slice(-8);n+=i.substr(1,7),"0"==i.substr(0,1)&&(t=t+"."+new bU(n,2).toString(10),n="")}return t},KU.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 bU(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);return n},KU.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""}},KU.asn1.DERAbstractString=function(e){KU.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))},HU.lang.extend(KU.asn1.DERAbstractString,KU.asn1.ASN1Object),KU.asn1.DERAbstractTime=function(e){KU.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,r){var n=this.zeroPadding,o=this.localDateToUTC(e),i=String(o.getFullYear());"utc"==t&&(i=i.substr(2,2));var a=i+n(String(o.getMonth()+1),2)+n(String(o.getDate()),2)+n(String(o.getHours()),2)+n(String(o.getMinutes()),2)+n(String(o.getSeconds()),2);if(!0===r){var s=o.getMilliseconds();if(0!=s){var c=n(String(s),3);a=a+"."+(c=c.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,r,n,o,i){var a=new Date(Date.UTC(e,t-1,r,n,o,i,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},HU.lang.extend(KU.asn1.DERAbstractTime,KU.asn1.ASN1Object),KU.asn1.DERAbstractStructured=function(e){KU.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)},HU.lang.extend(KU.asn1.DERAbstractStructured,KU.asn1.ASN1Object),KU.asn1.DERBoolean=function(){KU.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},HU.lang.extend(KU.asn1.DERBoolean,KU.asn1.ASN1Object),KU.asn1.DERInteger=function(e){KU.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=KU.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bU(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))},HU.lang.extend(KU.asn1.DERInteger,KU.asn1.ASN1Object),KU.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=KU.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}KU.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var o=e.substr(r,8),i=parseInt(o,2).toString(16);1==i.length&&(i="0"+i),n+=i}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},HU.lang.extend(KU.asn1.DERBitString,KU.asn1.ASN1Object),KU.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=KU.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}KU.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},HU.lang.extend(KU.asn1.DEROctetString,KU.asn1.DERAbstractString),KU.asn1.DERNull=function(){KU.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},HU.lang.extend(KU.asn1.DERNull,KU.asn1.ASN1Object),KU.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 bU(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};KU.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var t=KU.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))},HU.lang.extend(KU.asn1.DERObjectIdentifier,KU.asn1.ASN1Object),KU.asn1.DEREnumerated=function(e){KU.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=KU.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bU(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))},HU.lang.extend(KU.asn1.DEREnumerated,KU.asn1.ASN1Object),KU.asn1.DERUTF8String=function(e){KU.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},HU.lang.extend(KU.asn1.DERUTF8String,KU.asn1.DERAbstractString),KU.asn1.DERNumericString=function(e){KU.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},HU.lang.extend(KU.asn1.DERNumericString,KU.asn1.DERAbstractString),KU.asn1.DERPrintableString=function(e){KU.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},HU.lang.extend(KU.asn1.DERPrintableString,KU.asn1.DERAbstractString),KU.asn1.DERTeletexString=function(e){KU.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},HU.lang.extend(KU.asn1.DERTeletexString,KU.asn1.DERAbstractString),KU.asn1.DERIA5String=function(e){KU.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},HU.lang.extend(KU.asn1.DERIA5String,KU.asn1.DERAbstractString),KU.asn1.DERUTCTime=function(e){KU.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))},HU.lang.extend(KU.asn1.DERUTCTime,KU.asn1.DERAbstractTime),KU.asn1.DERGeneralizedTime=function(e){KU.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))},HU.lang.extend(KU.asn1.DERGeneralizedTime,KU.asn1.DERAbstractTime),KU.asn1.DERSequence=function(e){KU.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}},HU.lang.extend(KU.asn1.DERSequence,KU.asn1.DERAbstractStructured),KU.asn1.DERSet=function(e){KU.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)},HU.lang.extend(KU.asn1.DERSet,KU.asn1.DERAbstractStructured),KU.asn1.DERTaggedObject=function(e){KU.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)))},HU.lang.extend(KU.asn1.DERTaggedObject,KU.asn1.ASN1Object);var QU,GU=(QU=function(e,t){return(QU=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}QU(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),XU=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 GU(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)?function(e){var t;if(void 0===rU){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(rU={},t=0;t<16;++t)rU[r.charAt(t)]=t;for(r=r.toLowerCase(),t=10;t<16;++t)rU[r.charAt(t)]=t;for(t=0;t<n.length;++t)rU[n.charAt(t)]=-1}var o=[],i=0,a=0;for(t=0;t<e.length;++t){var s=e.charAt(t);if("="==s)break;if(-1!=(s=rU[s])){if(void 0===s)throw new Error("Illegal character at offset "+t);i|=s,++a>=2?(o[o.length]=i,i=0,a=0):i<<=4}}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return o}(e):sU.unarmor(e),o=mU.decode(n);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=BU(t,16),r=o.sub[2].getHexStringValue(),this.e=parseInt(r,16);var i=o.sub[3].getHexStringValue();this.d=BU(i,16);var a=o.sub[4].getHexStringValue();this.p=BU(a,16);var s=o.sub[5].getHexStringValue();this.q=BU(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=BU(c,16);var u=o.sub[7].getHexStringValue();this.dmq1=BU(u,16);var l=o.sub[8].getHexStringValue();this.coeff=BU(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=BU(t,16),r=d.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=o.sub[0].getHexStringValue(),this.n=BU(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 KU.asn1.DERInteger({int:0}),new KU.asn1.DERInteger({bigint:this.n}),new KU.asn1.DERInteger({int:this.e}),new KU.asn1.DERInteger({bigint:this.d}),new KU.asn1.DERInteger({bigint:this.p}),new KU.asn1.DERInteger({bigint:this.q}),new KU.asn1.DERInteger({bigint:this.dmp1}),new KU.asn1.DERInteger({bigint:this.dmq1}),new KU.asn1.DERInteger({bigint:this.coeff})]};return new KU.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return oU(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new KU.asn1.DERSequence({array:[new KU.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new KU.asn1.DERNull]}),t=new KU.asn1.DERSequence({array:[new KU.asn1.DERInteger({bigint:this.n}),new KU.asn1.DERInteger({int:this.e})]}),r=new KU.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new KU.asn1.DERSequence({array:[e,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return oU(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}(qU),YU=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 XU(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(iU(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return oU(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,t,r){try{return oU(this.getKey().sign(e,t,r))}catch(e){return!1}},e.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,iU(t),r)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new XU,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}(),$U=["-","-","-","-","-","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","-","-","-","-","-"];function ZU(e){return JU.apply(this,arguments)}function JU(){return(JU=EP(kP().mark((function e(t){var r,n,o;return kP().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)}function ez(e){return MP(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}var tz=function(e){var t=e.base64,r=e.key;return new Promise((function(e){ZU({key:r}).then((function(r){var n=function(e){return Uint8Array.from(atob(e),(function(e){return e.charCodeAt(0)})).buffer}(t);window.crypto.subtle.importKey("raw",r,"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){e({hex:ez(t)})}))}))})).catch((function(t){console.error("EncryptBase64 error: ",t),e(t)}))}))},rz=function(e){var t=new YU,r=$U.join("");return t.setPublicKey(r),iU(t.encrypt(e))},nz=function(e,t){return new Promise((function(r){var n=(new TextEncoder).encode(e);window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(e){r({hex:ez(e)})})).catch((function(t){console.error("EncryptString error: ",t),r(e)}))}))};function oz(e,t){return iz.apply(this,arguments)}function iz(){return(iz=EP(kP().mark((function e(t,r){var n,o,i;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.slice(0,16),o=r.slice(-16),(i=new Uint8Array(32)).set(new Uint8Array(n),0),i.set(new Uint8Array(o),n.byteLength),e.abrupt("return",window.crypto.subtle.importKey("raw",i,"AES-GCM",!0,["encrypt","decrypt"]));case 9:return e.prev=9,e.t0=e.catch(0),console.error("combineKeys error: ",e.t0),e.abrupt("return",null);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}var az,sz,cz,uz=Object.freeze({__proto__:null,processKey:ZU,encryptBase64:tz,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;ZU({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){e({hex:ez(t)})}))}))}))},n.readAsArrayBuffer(t)}))},encryptWithRSAPublicKey:rz,encryptString:nz,combineKeys:oz}),lz=function(){var e=EP(kP().mark((function e(t,r){var n,o,i,a,s,c,u,l,d;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",new Promise((function(e){return e(null)})));case 2:return e.prev=2,e.next=5,ZU({key:r});case 5:return n=e.sent,e.next=8,window.crypto.subtle.importKey("raw",n,"AES-GCM",!0,["encrypt","decrypt"]);case 8:return o=e.sent,e.next=11,window.crypto.subtle.exportKey("raw",o);case 11:return i=e.sent,a=QM().replace(/-/g,""),s=new TextEncoder,c=s.encode(a),e.next=17,oz(i,c);case 17:return u=e.sent,e.next=20,nz(t,u);case 20:return l=e.sent,e.next=23,rz(a);case 23:return d=e.sent,e.abrupt("return","".concat(l.hex,"::").concat(d));case 27:return e.prev=27,e.t0=e.catch(2),console.error("encryptFrameMetadata error: ",e.t0),e.abrupt("return",t);case 31:case"end":return e.stop()}}),e,null,[[2,27]])})));return function(t,r){return e.apply(this,arguments)}}(),dz=Object.freeze({__proto__:null,encryptFrameBase64:function(e,t){return new Promise(e?function(r){tz({base64:e,key:t}).then((function(e){r(e.hex)})).catch((function(t){console.error("encryptFrameBase64 error: ",t),r(e)}))}:function(e){return e(null)})},encryptFrameMetadata:lz}),fz=AP((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;xP(this,e),this.interval=t,this.second=0,this.timeStone={origin:0},this.callbacks={}}),[{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={}}}]),hz=WP((function(e,t){!function(){var r={};function n(e){return d(">"+h("B",e.length),e)}function o(e){return d(">"+h("H",e.length),e)}function i(e){return d(">"+h("L",e.length),e)}function a(e,t,r){var a,s,c,u,l="",f="";if("Byte"==t)(a=e.length)<=4?f=n(e)+h("\0",4-a):(f=d(">L",[r]),l=n(e));else if("Short"==t)(a=e.length)<=2?f=o(e)+h("\0\0",2-a):(f=d(">L",[r]),l=o(e));else if("Long"==t)(a=e.length)<=1?f=i(e):(f=d(">L",[r]),l=i(e));else if("Ascii"==t)(a=(s=e+"\0").length)>4?(f=d(">L",[r]),l=s):f=s+h("\0",4-a);else if("Rational"==t){if("number"==typeof e[0])a=1,c=e[0],u=e[1],s=d(">L",[c])+d(">L",[u]);else{a=e.length,s="";for(var p=0;p<a;p++)c=e[p][0],u=e[p][1],s+=d(">L",[c])+d(">L",[u])}f=d(">L",[r]),l=s}else if("SRational"==t){if("number"==typeof e[0])a=1,c=e[0],u=e[1],s=d(">l",[c])+d(">l",[u]);else for(a=e.length,s="",p=0;p<a;p++)c=e[p][0],u=e[p][1],s+=d(">l",[c])+d(">l",[u]);f=d(">L",[r]),l=s}else"Undefined"==t&&((a=e.length)>4?(f=d(">L",[r]),l=e):f=e+h("\0",4-a));return[d(">L",[a]),f,l]}function s(e,t,r){var n,o=Object.keys(e).length,i=d(">H",[o]);n=["0th","1st"].indexOf(t)>-1?2+12*o+4:2+12*o;var s="",c="";for(var u in e)if("string"==typeof u&&(u=parseInt(u)),!("0th"==t&&[34665,34853].indexOf(u)>-1||"Exif"==t&&40965==u||"1st"==t&&[513,514].indexOf(u)>-1)){var l=e[u],f=d(">H",[u]),h=g[t][u].type,p=d(">H",[m[h]]);"number"==typeof l&&(l=[l]);var v=a(l,h,8+n+r+c.length);s+=f+p+v[0]+v[1],c+=v[2]}return[i+s,c]}function c(e){var t;if("ÿØ"==e.slice(0,2))t=function(e){for(var t,r=0;r<e.length;r++)if("ÿá"==(t=e[r]).slice(0,2)&&"Exif\0\0"==t.slice(4,10))return t;return null}(p(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=p(e).filter((function(e){return!("ÿá"==e.slice(0,2)&&"Exif\0\0"==e.slice(4,10))})).join("");return t&&(r="data:image/jpeg;base64,"+u(r)),r},r.insert=function(e,t){var r=!1;if("Exif\0\0"!=e.slice(0,6))throw new Error("Given data is not exif.");if("ÿØ"==t.slice(0,2));else{if("data:image/jpeg;base64,"!=t.slice(0,23)&&"data:image/jpg;base64,"!=t.slice(0,22))throw new Error("Given data is not jpeg.");t=l(t.split(",")[1]),r=!0}var n="ÿá"+d(">H",[e.length+2])+e,o=function(e,t){var r=!1,n=[];return e.forEach((function(o,i){"ÿá"==o.slice(0,2)&&"Exif\0\0"==o.slice(4,10)&&(r?n.unshift(i):(e[i]=t,r=!0))})),n.forEach((function(t){e.splice(t,1)})),!r&&t&&(e=[e[0],t].concat(e.slice(1))),e.join("")}(p(t),n);return r&&(o="data:image/jpeg;base64,"+u(o)),o},r.load=function(e){var t;if("string"!=typeof e)throw new Error("'load' gots invalid type argument.");if("ÿØ"==e.slice(0,2))t=e;else if("data:image/jpeg;base64,"==e.slice(0,23)||"data:image/jpg;base64,"==e.slice(0,22))t=l(e.split(",")[1]);else{if("Exif"!=e.slice(0,4))throw new Error("'load' gots invalid file data.");t=e.slice(6)}var r={"0th":{},Exif:{},GPS:{},Interop:{},"1st":{},thumbnail:null},n=new c(t);if(null===n.tiftag)return r;"II"==n.tiftag.slice(0,2)?n.endian_mark="<":n.endian_mark=">";var o=f(n.endian_mark+"L",n.tiftag.slice(4,8))[0];r["0th"]=n.get_ifd(o,"0th");var i=r["0th"].first_ifd_pointer;if(delete r["0th"].first_ifd_pointer,34665 in r["0th"]&&(o=r["0th"][34665],r.Exif=n.get_ifd(o,"Exif")),34853 in r["0th"]&&(o=r["0th"][34853],r.GPS=n.get_ifd(o,"GPS")),40965 in r.Exif&&(o=r.Exif[40965],r.Interop=n.get_ifd(o,"Interop")),"\0\0\0\0"!=i&&(o=f(n.endian_mark+"L",i)[0],r["1st"]=n.get_ifd(o,"1st"),513 in r["1st"]&&514 in r["1st"])){var a=r["1st"][513]+r["1st"][514],s=n.tiftag.slice(r["1st"][513],a);r.thumbnail=s}return r},r.dump=function(e){var t,n,o,i,a,c,u=(t=e,JSON.parse(JSON.stringify(t))),l=!1,f=!1,h=!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,h=!0,i=u.Interop):Object.keys(o).indexOf(r.ExifIFD.InteroperabilityTag.toString())>-1&&delete o[40965]):Object.keys(n).indexOf(r.ImageIFD.ExifTag.toString())>-1&&delete n[34665],"GPS"in u&&Object.keys(u.GPS).length?(n[r.ImageIFD.GPSTag]=1,f=!0,a=u.GPS):Object.keys(n).indexOf(r.ImageIFD.GPSTag.toString())>-1&&delete n[r.ImageIFD.GPSTag],"1st"in u&&"thumbnail"in u&&null!=u.thumbnail&&(g=!0,u["1st"][513]=1,u["1st"][514]=1,c=u["1st"]);var v,y,b,w=s(n,"0th",0),_=w[0].length+12*l+12*f+4+w[1].length,k="",C=0,S="",B=0,E="",x=0,I="";if(l&&(C=(v=s(o,"Exif",_))[0].length+12*h+v[1].length),f&&(B=(S=s(a,"GPS",_+C).join("")).length),h&&(x=(E=s(i,"Interop",_+C+B).join("")).length),g&&(y=s(c,"1st",_+C+B+x),(b=function(e){for(var t=p(e);"ÿà"<=t[1].slice(0,2)&&t[1].slice(0,2)<="ÿï";)t=[t[0]].concat(t.slice(2));return t.join("")}(u.thumbnail)).length>64e3))throw new Error("Given thumbnail is too large. max 64kB");var A="",P="",T="",R="\0\0\0\0";if(l){var M=d(">L",[D=8+_]);A=d(">H",[34665])+d(">H",[m.Long])+d(">L",[1])+M}if(f&&(M=d(">L",[D=8+_+C]),P=d(">H",[34853])+d(">H",[m.Long])+d(">L",[1])+M),h&&(M=d(">L",[D=8+_+C+B]),T=d(">H",[40965])+d(">H",[m.Long])+d(">L",[1])+M),g){var D;R=d(">L",[D=8+_+C+B+x]);var L="\0\0\0\0"+d(">L",[D+y[0].length+24+4+y[1].length]),O="\0\0\0\0"+d(">L",[b.length]);I=y[0]+L+O+"\0\0\0\0"+y[1]+b}var N=w[0]+A+P+R+w[1];return l&&(k=v[0]+T+v[1]),"Exif\0\0MM\0*\0\0\0\b"+N+k+S+E+I},c.prototype={get_ifd:function(e,t){var r,n={},o=f(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],i=e+2;r=["0th","1st"].indexOf(t)>-1?"Image":t;for(var a=0;a<o;a++){e=i+12*a;var s=f(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],c=[f(this.endian_mark+"H",this.tiftag.slice(e+2,e+4))[0],f(this.endian_mark+"L",this.tiftag.slice(e+4,e+8))[0],this.tiftag.slice(e+8,e+12)];s in g[r]&&(n[s]=this.convert_value(c))}return"0th"==t&&(e=i+12*o,n.first_ifd_pointer=this.tiftag.slice(e,e+4)),n},convert_value:function(e){var t,r=null,n=e[0],o=e[1],i=e[2];if(1==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+h("B",o),this.tiftag.slice(t,t+o))):r=f(this.endian_mark+h("B",o),i.slice(0,o));else if(2==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=this.tiftag.slice(t,t+o-1)):r=i.slice(0,o-1);else if(3==n)o>2?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+h("H",o),this.tiftag.slice(t,t+2*o))):r=f(this.endian_mark+h("H",o),i.slice(0,2*o));else if(4==n)o>1?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+h("L",o),this.tiftag.slice(t,t+4*o))):r=f(this.endian_mark+h("L",o),i);else if(5==n)if(t=f(this.endian_mark+"L",i)[0],o>1){r=[];for(var a=0;a<o;a++)r.push([f(this.endian_mark+"L",this.tiftag.slice(t+8*a,t+4+8*a))[0],f(this.endian_mark+"L",this.tiftag.slice(t+4+8*a,t+8+8*a))[0]])}else r=[f(this.endian_mark+"L",this.tiftag.slice(t,t+4))[0],f(this.endian_mark+"L",this.tiftag.slice(t+4,t+8))[0]];else if(7==n)o>4?(t=f(this.endian_mark+"L",i)[0],r=this.tiftag.slice(t,t+o)):r=i.slice(0,o);else if(9==n)o>1?(t=f(this.endian_mark+"L",i)[0],r=f(this.endian_mark+h("l",o),this.tiftag.slice(t,t+4*o))):r=f(this.endian_mark+h("l",o),i);else{if(10!=n)throw new Error("Exif might be wrong. Got incorrect value type to decode. type:"+n);if(t=f(this.endian_mark+"L",i)[0],o>1)for(r=[],a=0;a<o;a++)r.push([f(this.endian_mark+"l",this.tiftag.slice(t+8*a,t+4+8*a))[0],f(this.endian_mark+"l",this.tiftag.slice(t+4+8*a,t+8+8*a))[0]]);else r=[f(this.endian_mark+"l",this.tiftag.slice(t,t+4))[0],f(this.endian_mark+"l",this.tiftag.slice(t+4,t+8))[0]]}return r instanceof Array&&1==r.length?r[0]:r}},"undefined"!=typeof window&&"function"==typeof window.btoa)var u=window.btoa;if(void 0===u&&(u=function(e){for(var t,r,n,o,i,a,s,c="",u=0,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";u<e.length;)o=(t=e.charCodeAt(u++))>>2,i=(3&t)<<4|(r=e.charCodeAt(u++))>>4,a=(15&r)<<2|(n=e.charCodeAt(u++))>>6,s=63&n,isNaN(r)?a=s=64:isNaN(n)&&(s=64),c=c+l.charAt(o)+l.charAt(i)+l.charAt(a)+l.charAt(s);return c}),"undefined"!=typeof window&&"function"==typeof window.atob)var l=window.atob;function d(e,t){if(!(t instanceof Array))throw new Error("'pack' error. Got invalid type argument.");if(e.length-1!=t.length)throw new Error("'pack' error. "+(e.length-1)+" marks, "+t.length+" elements.");var r;if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("");r=!1}for(var n="",o=1,i=null,a=null,s=null;a=e[o];){if("b"==a.toLowerCase()){if(i=t[o-1],"b"==a&&i<0&&(i+=256),i>255||i<0)throw new Error("'pack' error.");s=String.fromCharCode(i)}else if("H"==a){if((i=t[o-1])>65535||i<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(i%65536/256))+String.fromCharCode(i%256),r&&(s=s.split("").reverse().join(""))}else{if("l"!=a.toLowerCase())throw new Error("'pack' error.");if(i=t[o-1],"l"==a&&i<0&&(i+=4294967296),i>4294967295||i<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(i/16777216))+String.fromCharCode(Math.floor(i%16777216/65536))+String.fromCharCode(Math.floor(i%65536/256))+String.fromCharCode(i%256),r&&(s=s.split("").reverse().join(""))}n+=s,o+=1}return n}function f(e,t){if("string"!=typeof t)throw new Error("'unpack' error. Got invalid type argument.");for(var r,n=0,o=1;o<e.length;o++)if("b"==e[o].toLowerCase())n+=1;else if("h"==e[o].toLowerCase())n+=2;else{if("l"!=e[o].toLowerCase())throw new Error("'unpack' error. Got invalid mark.");n+=4}if(n!=t.length)throw new Error("'unpack' error. Mismatch between symbol and string length. "+n+":"+t.length);if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("'unpack' error.");r=!1}for(var i=[],a=0,s=1,c=null,u=null,l=null,d="";u=e[s];){if("b"==u.toLowerCase())l=1,c=(d=t.slice(a,a+l)).charCodeAt(0),"b"==u&&c>=128&&(c-=256);else if("H"==u)l=2,d=t.slice(a,a+l),r&&(d=d.split("").reverse().join("")),c=256*d.charCodeAt(0)+d.charCodeAt(1);else{if("l"!=u.toLowerCase())throw new Error("'unpack' error. "+u);l=4,d=t.slice(a,a+l),r&&(d=d.split("").reverse().join("")),c=16777216*d.charCodeAt(0)+65536*d.charCodeAt(1)+256*d.charCodeAt(2)+d.charCodeAt(3),"l"==u&&c>=2147483648&&(c-=4294967296)}i.push(c),a+=l,s+=1}return i}function h(e,t){for(var r="",n=0;n<t;n++)r+=e;return r}function p(e){if("ÿØ"!=e.slice(0,2))throw new Error("Given data isn't JPEG.");for(var t=2,r=["ÿØ"];;){if("ÿÚ"==e.slice(t,t+2)){r.push(e.slice(t));break}var n=t+f(">H",e.slice(t+2,t+4))[0]+2;if(r.push(e.slice(t,n)),(t=n)>=e.length)throw new Error("Wrong JPEG data.")}return r}void 0===l&&(l=function(e){var t,r,n,o,i,a,s="",c=0,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<e.length;)t=u.indexOf(e.charAt(c++))<<2|(o=u.indexOf(e.charAt(c++)))>>4,r=(15&o)<<4|(i=u.indexOf(e.charAt(c++)))>>2,n=(3&i)<<6|(a=u.indexOf(e.charAt(c++))),s+=String.fromCharCode(t),64!=i&&(s+=String.fromCharCode(r)),64!=a&&(s+=String.fromCharCode(n));return s});var m={Byte:1,Ascii:2,Short:3,Long:4,Rational:5,Undefined:7,SLong:9,SRational:10},g={Image:{11:{name:"ProcessingSoftware",type:"Ascii"},254:{name:"NewSubfileType",type:"Long"},255:{name:"SubfileType",type:"Short"},256:{name:"ImageWidth",type:"Long"},257:{name:"ImageLength",type:"Long"},258:{name:"BitsPerSample",type:"Short"},259:{name:"Compression",type:"Short"},262:{name:"PhotometricInterpretation",type:"Short"},263:{name:"Threshholding",type:"Short"},264:{name:"CellWidth",type:"Short"},265:{name:"CellLength",type:"Short"},266:{name:"FillOrder",type:"Short"},269:{name:"DocumentName",type:"Ascii"},270:{name:"ImageDescription",type:"Ascii"},271:{name:"Make",type:"Ascii"},272:{name:"Model",type:"Ascii"},273:{name:"StripOffsets",type:"Long"},274:{name:"Orientation",type:"Short"},277:{name:"SamplesPerPixel",type:"Short"},278:{name:"RowsPerStrip",type:"Long"},279:{name:"StripByteCounts",type:"Long"},282:{name:"XResolution",type:"Rational"},283:{name:"YResolution",type:"Rational"},284:{name:"PlanarConfiguration",type:"Short"},290:{name:"GrayResponseUnit",type:"Short"},291:{name:"GrayResponseCurve",type:"Short"},292:{name:"T4Options",type:"Long"},293:{name:"T6Options",type:"Long"},296:{name:"ResolutionUnit",type:"Short"},301:{name:"TransferFunction",type:"Short"},305:{name:"Software",type:"Ascii"},306:{name:"DateTime",type:"Ascii"},315:{name:"Artist",type:"Ascii"},316:{name:"HostComputer",type:"Ascii"},317:{name:"Predictor",type:"Short"},318:{name:"WhitePoint",type:"Rational"},319:{name:"PrimaryChromaticities",type:"Rational"},320:{name:"ColorMap",type:"Short"},321:{name:"HalftoneHints",type:"Short"},322:{name:"TileWidth",type:"Short"},323:{name:"TileLength",type:"Short"},324:{name:"TileOffsets",type:"Short"},325:{name:"TileByteCounts",type:"Short"},330:{name:"SubIFDs",type:"Long"},332:{name:"InkSet",type:"Short"},333:{name:"InkNames",type:"Ascii"},334:{name:"NumberOfInks",type:"Short"},336:{name:"DotRange",type:"Byte"},337:{name:"TargetPrinter",type:"Ascii"},338:{name:"ExtraSamples",type:"Short"},339:{name:"SampleFormat",type:"Short"},340:{name:"SMinSampleValue",type:"Short"},341:{name:"SMaxSampleValue",type:"Short"},342:{name:"TransferRange",type:"Short"},343:{name:"ClipPath",type:"Byte"},344:{name:"XClipPathUnits",type:"Long"},345:{name:"YClipPathUnits",type:"Long"},346:{name:"Indexed",type:"Short"},347:{name:"JPEGTables",type:"Undefined"},351:{name:"OPIProxy",type:"Short"},512:{name:"JPEGProc",type:"Long"},513:{name:"JPEGInterchangeFormat",type:"Long"},514:{name:"JPEGInterchangeFormatLength",type:"Long"},515:{name:"JPEGRestartInterval",type:"Short"},517:{name:"JPEGLosslessPredictors",type:"Short"},518:{name:"JPEGPointTransforms",type:"Short"},519:{name:"JPEGQTables",type:"Long"},520:{name:"JPEGDCTables",type:"Long"},521:{name:"JPEGACTables",type:"Long"},529:{name:"YCbCrCoefficients",type:"Rational"},530:{name:"YCbCrSubSampling",type:"Short"},531:{name:"YCbCrPositioning",type:"Short"},532:{name:"ReferenceBlackWhite",type:"Rational"},700:{name:"XMLPacket",type:"Byte"},18246:{name:"Rating",type:"Short"},18249:{name:"RatingPercent",type:"Short"},32781:{name:"ImageID",type:"Ascii"},33421:{name:"CFARepeatPatternDim",type:"Short"},33422:{name:"CFAPattern",type:"Byte"},33423:{name:"BatteryLevel",type:"Rational"},33432:{name:"Copyright",type:"Ascii"},33434:{name:"ExposureTime",type:"Rational"},34377:{name:"ImageResources",type:"Byte"},34665:{name:"ExifTag",type:"Long"},34675:{name:"InterColorProfile",type:"Undefined"},34853:{name:"GPSTag",type:"Long"},34857:{name:"Interlace",type:"Short"},34858:{name:"TimeZoneOffset",type:"Long"},34859:{name:"SelfTimerMode",type:"Short"},37387:{name:"FlashEnergy",type:"Rational"},37388:{name:"SpatialFrequencyResponse",type:"Undefined"},37389:{name:"Noise",type:"Undefined"},37390:{name:"FocalPlaneXResolution",type:"Rational"},37391:{name:"FocalPlaneYResolution",type:"Rational"},37392:{name:"FocalPlaneResolutionUnit",type:"Short"},37393:{name:"ImageNumber",type:"Long"},37394:{name:"SecurityClassification",type:"Ascii"},37395:{name:"ImageHistory",type:"Ascii"},37397:{name:"ExposureIndex",type:"Rational"},37398:{name:"TIFFEPStandardID",type:"Byte"},37399:{name:"SensingMethod",type:"Short"},40091:{name:"XPTitle",type:"Byte"},40092:{name:"XPComment",type:"Byte"},40093:{name:"XPAuthor",type:"Byte"},40094:{name:"XPKeywords",type:"Byte"},40095:{name:"XPSubject",type:"Byte"},50341:{name:"PrintImageMatching",type:"Undefined"},50706:{name:"DNGVersion",type:"Byte"},50707:{name:"DNGBackwardVersion",type:"Byte"},50708:{name:"UniqueCameraModel",type:"Ascii"},50709:{name:"LocalizedCameraModel",type:"Byte"},50710:{name:"CFAPlaneColor",type:"Byte"},50711:{name:"CFALayout",type:"Short"},50712:{name:"LinearizationTable",type:"Short"},50713:{name:"BlackLevelRepeatDim",type:"Short"},50714:{name:"BlackLevel",type:"Rational"},50715:{name:"BlackLevelDeltaH",type:"SRational"},50716:{name:"BlackLevelDeltaV",type:"SRational"},50717:{name:"WhiteLevel",type:"Short"},50718:{name:"DefaultScale",type:"Rational"},50719:{name:"DefaultCropOrigin",type:"Short"},50720:{name:"DefaultCropSize",type:"Short"},50721:{name:"ColorMatrix1",type:"SRational"},50722:{name:"ColorMatrix2",type:"SRational"},50723:{name:"CameraCalibration1",type:"SRational"},50724:{name:"CameraCalibration2",type:"SRational"},50725:{name:"ReductionMatrix1",type:"SRational"},50726:{name:"ReductionMatrix2",type:"SRational"},50727:{name:"AnalogBalance",type:"Rational"},50728:{name:"AsShotNeutral",type:"Short"},50729:{name:"AsShotWhiteXY",type:"Rational"},50730:{name:"BaselineExposure",type:"SRational"},50731:{name:"BaselineNoise",type:"Rational"},50732:{name:"BaselineSharpness",type:"Rational"},50733:{name:"BayerGreenSplit",type:"Long"},50734:{name:"LinearResponseLimit",type:"Rational"},50735:{name:"CameraSerialNumber",type:"Ascii"},50736:{name:"LensInfo",type:"Rational"},50737:{name:"ChromaBlurRadius",type:"Rational"},50738:{name:"AntiAliasStrength",type:"Rational"},50739:{name:"ShadowScale",type:"SRational"},50740:{name:"DNGPrivateData",type:"Byte"},50741:{name:"MakerNoteSafety",type:"Short"},50778:{name:"CalibrationIlluminant1",type:"Short"},50779:{name:"CalibrationIlluminant2",type:"Short"},50780:{name:"BestQualityScale",type:"Rational"},50781:{name:"RawDataUniqueID",type:"Byte"},50827:{name:"OriginalRawFileName",type:"Byte"},50828:{name:"OriginalRawFileData",type:"Undefined"},50829:{name:"ActiveArea",type:"Short"},50830:{name:"MaskedAreas",type:"Short"},50831:{name:"AsShotICCProfile",type:"Undefined"},50832:{name:"AsShotPreProfileMatrix",type:"SRational"},50833:{name:"CurrentICCProfile",type:"Undefined"},50834:{name:"CurrentPreProfileMatrix",type:"SRational"},50879:{name:"ColorimetricReference",type:"Short"},50931:{name:"CameraCalibrationSignature",type:"Byte"},50932:{name:"ProfileCalibrationSignature",type:"Byte"},50934:{name:"AsShotProfileName",type:"Byte"},50935:{name:"NoiseReductionApplied",type:"Rational"},50936:{name:"ProfileName",type:"Byte"},50937:{name:"ProfileHueSatMapDims",type:"Long"},50938:{name:"ProfileHueSatMapData1",type:"Float"},50939:{name:"ProfileHueSatMapData2",type:"Float"},50940:{name:"ProfileToneCurve",type:"Float"},50941:{name:"ProfileEmbedPolicy",type:"Long"},50942:{name:"ProfileCopyright",type:"Byte"},50964:{name:"ForwardMatrix1",type:"SRational"},50965:{name:"ForwardMatrix2",type:"SRational"},50966:{name:"PreviewApplicationName",type:"Byte"},50967:{name:"PreviewApplicationVersion",type:"Byte"},50968:{name:"PreviewSettingsName",type:"Byte"},50969:{name:"PreviewSettingsDigest",type:"Byte"},50970:{name:"PreviewColorSpace",type:"Long"},50971:{name:"PreviewDateTime",type:"Ascii"},50972:{name:"RawImageDigest",type:"Undefined"},50973:{name:"OriginalRawFileDigest",type:"Undefined"},50974:{name:"SubTileBlockSize",type:"Long"},50975:{name:"RowInterleaveFactor",type:"Long"},50981:{name:"ProfileLookTableDims",type:"Long"},50982:{name:"ProfileLookTableData",type:"Float"},51008:{name:"OpcodeList1",type:"Undefined"},51009:{name:"OpcodeList2",type:"Undefined"},51022:{name:"OpcodeList3",type:"Undefined"}},Exif:{33434:{name:"ExposureTime",type:"Rational"},33437:{name:"FNumber",type:"Rational"},34850:{name:"ExposureProgram",type:"Short"},34852:{name:"SpectralSensitivity",type:"Ascii"},34855:{name:"ISOSpeedRatings",type:"Short"},34856:{name:"OECF",type:"Undefined"},34864:{name:"SensitivityType",type:"Short"},34865:{name:"StandardOutputSensitivity",type:"Long"},34866:{name:"RecommendedExposureIndex",type:"Long"},34867:{name:"ISOSpeed",type:"Long"},34868:{name:"ISOSpeedLatitudeyyy",type:"Long"},34869:{name:"ISOSpeedLatitudezzz",type:"Long"},36864:{name:"ExifVersion",type:"Undefined"},36867:{name:"DateTimeOriginal",type:"Ascii"},36868:{name:"DateTimeDigitized",type:"Ascii"},37121:{name:"ComponentsConfiguration",type:"Undefined"},37122:{name:"CompressedBitsPerPixel",type:"Rational"},37377:{name:"ShutterSpeedValue",type:"SRational"},37378:{name:"ApertureValue",type:"Rational"},37379:{name:"BrightnessValue",type:"SRational"},37380:{name:"ExposureBiasValue",type:"SRational"},37381:{name:"MaxApertureValue",type:"Rational"},37382:{name:"SubjectDistance",type:"Rational"},37383:{name:"MeteringMode",type:"Short"},37384:{name:"LightSource",type:"Short"},37385:{name:"Flash",type:"Short"},37386:{name:"FocalLength",type:"Rational"},37396:{name:"SubjectArea",type:"Short"},37500:{name:"MakerNote",type:"Undefined"},37510:{name:"UserComment",type:"Ascii"},37520:{name:"SubSecTime",type:"Ascii"},37521:{name:"SubSecTimeOriginal",type:"Ascii"},37522:{name:"SubSecTimeDigitized",type:"Ascii"},40960:{name:"FlashpixVersion",type:"Undefined"},40961:{name:"ColorSpace",type:"Short"},40962:{name:"PixelXDimension",type:"Long"},40963:{name:"PixelYDimension",type:"Long"},40964:{name:"RelatedSoundFile",type:"Ascii"},40965:{name:"InteroperabilityTag",type:"Long"},41483:{name:"FlashEnergy",type:"Rational"},41484:{name:"SpatialFrequencyResponse",type:"Undefined"},41486:{name:"FocalPlaneXResolution",type:"Rational"},41487:{name:"FocalPlaneYResolution",type:"Rational"},41488:{name:"FocalPlaneResolutionUnit",type:"Short"},41492:{name:"SubjectLocation",type:"Short"},41493:{name:"ExposureIndex",type:"Rational"},41495:{name:"SensingMethod",type:"Short"},41728:{name:"FileSource",type:"Undefined"},41729:{name:"SceneType",type:"Undefined"},41730:{name:"CFAPattern",type:"Undefined"},41985:{name:"CustomRendered",type:"Short"},41986:{name:"ExposureMode",type:"Short"},41987:{name:"WhiteBalance",type:"Short"},41988:{name:"DigitalZoomRatio",type:"Rational"},41989:{name:"FocalLengthIn35mmFilm",type:"Short"},41990:{name:"SceneCaptureType",type:"Short"},41991:{name:"GainControl",type:"Short"},41992:{name:"Contrast",type:"Short"},41993:{name:"Saturation",type:"Short"},41994:{name:"Sharpness",type:"Short"},41995:{name:"DeviceSettingDescription",type:"Undefined"},41996:{name:"SubjectDistanceRange",type:"Short"},42016:{name:"ImageUniqueID",type:"Ascii"},42032:{name:"CameraOwnerName",type:"Ascii"},42033:{name:"BodySerialNumber",type:"Ascii"},42034:{name:"LensSpecification",type:"Rational"},42035:{name:"LensMake",type:"Ascii"},42036:{name:"LensModel",type:"Ascii"},42037:{name:"LensSerialNumber",type:"Ascii"},42240:{name:"Gamma",type:"Rational"}},GPS:{0:{name:"GPSVersionID",type:"Byte"},1:{name:"GPSLatitudeRef",type:"Ascii"},2:{name:"GPSLatitude",type:"Rational"},3:{name:"GPSLongitudeRef",type:"Ascii"},4:{name:"GPSLongitude",type:"Rational"},5:{name:"GPSAltitudeRef",type:"Byte"},6:{name:"GPSAltitude",type:"Rational"},7:{name:"GPSTimeStamp",type:"Rational"},8:{name:"GPSSatellites",type:"Ascii"},9:{name:"GPSStatus",type:"Ascii"},10:{name:"GPSMeasureMode",type:"Ascii"},11:{name:"GPSDOP",type:"Rational"},12:{name:"GPSSpeedRef",type:"Ascii"},13:{name:"GPSSpeed",type:"Rational"},14:{name:"GPSTrackRef",type:"Ascii"},15:{name:"GPSTrack",type:"Rational"},16:{name:"GPSImgDirectionRef",type:"Ascii"},17:{name:"GPSImgDirection",type:"Rational"},18:{name:"GPSMapDatum",type:"Ascii"},19:{name:"GPSDestLatitudeRef",type:"Ascii"},20:{name:"GPSDestLatitude",type:"Rational"},21:{name:"GPSDestLongitudeRef",type:"Ascii"},22:{name:"GPSDestLongitude",type:"Rational"},23:{name:"GPSDestBearingRef",type:"Ascii"},24:{name:"GPSDestBearing",type:"Rational"},25:{name:"GPSDestDistanceRef",type:"Ascii"},26:{name:"GPSDestDistance",type:"Rational"},27:{name:"GPSProcessingMethod",type:"Undefined"},28:{name:"GPSAreaInformation",type:"Undefined"},29:{name:"GPSDateStamp",type:"Ascii"},30:{name:"GPSDifferential",type:"Short"},31:{name:"GPSHPositioningError",type:"Rational"}},Interop:{1:{name:"InteroperabilityIndex",type:"Ascii"}}};g["0th"]=g.Image,g["1st"]=g.Image,r.TAGS=g,r.ImageIFD={ProcessingSoftware:11,NewSubfileType:254,SubfileType:255,ImageWidth:256,ImageLength:257,BitsPerSample:258,Compression:259,PhotometricInterpretation:262,Threshholding:263,CellWidth:264,CellLength:265,FillOrder:266,DocumentName:269,ImageDescription:270,Make:271,Model:272,StripOffsets:273,Orientation:274,SamplesPerPixel:277,RowsPerStrip:278,StripByteCounts:279,XResolution:282,YResolution:283,PlanarConfiguration:284,GrayResponseUnit:290,GrayResponseCurve:291,T4Options:292,T6Options:293,ResolutionUnit:296,TransferFunction:301,Software:305,DateTime:306,Artist:315,HostComputer:316,Predictor:317,WhitePoint:318,PrimaryChromaticities:319,ColorMap:320,HalftoneHints:321,TileWidth:322,TileLength:323,TileOffsets:324,TileByteCounts:325,SubIFDs:330,InkSet:332,InkNames:333,NumberOfInks:334,DotRange:336,TargetPrinter:337,ExtraSamples:338,SampleFormat:339,SMinSampleValue:340,SMaxSampleValue:341,TransferRange:342,ClipPath:343,XClipPathUnits:344,YClipPathUnits:345,Indexed:346,JPEGTables:347,OPIProxy:351,JPEGProc:512,JPEGInterchangeFormat:513,JPEGInterchangeFormatLength:514,JPEGRestartInterval:515,JPEGLosslessPredictors:517,JPEGPointTransforms:518,JPEGQTables:519,JPEGDCTables:520,JPEGACTables:521,YCbCrCoefficients:529,YCbCrSubSampling:530,YCbCrPositioning:531,ReferenceBlackWhite:532,XMLPacket:700,Rating:18246,RatingPercent:18249,ImageID:32781,CFARepeatPatternDim:33421,CFAPattern:33422,BatteryLevel:33423,Copyright:33432,ExposureTime:33434,ImageResources:34377,ExifTag:34665,InterColorProfile:34675,GPSTag:34853,Interlace:34857,TimeZoneOffset:34858,SelfTimerMode:34859,FlashEnergy:37387,SpatialFrequencyResponse:37388,Noise:37389,FocalPlaneXResolution:37390,FocalPlaneYResolution:37391,FocalPlaneResolutionUnit:37392,ImageNumber:37393,SecurityClassification:37394,ImageHistory:37395,ExposureIndex:37397,TIFFEPStandardID:37398,SensingMethod:37399,XPTitle:40091,XPComment:40092,XPAuthor:40093,XPKeywords:40094,XPSubject:40095,PrintImageMatching:50341,DNGVersion:50706,DNGBackwardVersion:50707,UniqueCameraModel:50708,LocalizedCameraModel:50709,CFAPlaneColor:50710,CFALayout:50711,LinearizationTable:50712,BlackLevelRepeatDim:50713,BlackLevel:50714,BlackLevelDeltaH:50715,BlackLevelDeltaV:50716,WhiteLevel:50717,DefaultScale:50718,DefaultCropOrigin:50719,DefaultCropSize:50720,ColorMatrix1:50721,ColorMatrix2:50722,CameraCalibration1:50723,CameraCalibration2:50724,ReductionMatrix1:50725,ReductionMatrix2:50726,AnalogBalance:50727,AsShotNeutral:50728,AsShotWhiteXY:50729,BaselineExposure:50730,BaselineNoise:50731,BaselineSharpness:50732,BayerGreenSplit:50733,LinearResponseLimit:50734,CameraSerialNumber:50735,LensInfo:50736,ChromaBlurRadius:50737,AntiAliasStrength:50738,ShadowScale:50739,DNGPrivateData:50740,MakerNoteSafety:50741,CalibrationIlluminant1:50778,CalibrationIlluminant2:50779,BestQualityScale:50780,RawDataUniqueID:50781,OriginalRawFileName:50827,OriginalRawFileData:50828,ActiveArea:50829,MaskedAreas:50830,AsShotICCProfile:50831,AsShotPreProfileMatrix:50832,CurrentICCProfile:50833,CurrentPreProfileMatrix:50834,ColorimetricReference:50879,CameraCalibrationSignature:50931,ProfileCalibrationSignature:50932,AsShotProfileName:50934,NoiseReductionApplied:50935,ProfileName:50936,ProfileHueSatMapDims:50937,ProfileHueSatMapData1:50938,ProfileHueSatMapData2:50939,ProfileToneCurve:50940,ProfileEmbedPolicy:50941,ProfileCopyright:50942,ForwardMatrix1:50964,ForwardMatrix2:50965,PreviewApplicationName:50966,PreviewApplicationVersion:50967,PreviewSettingsName:50968,PreviewSettingsDigest:50969,PreviewColorSpace:50970,PreviewDateTime:50971,RawImageDigest:50972,OriginalRawFileDigest:50973,SubTileBlockSize:50974,RowInterleaveFactor:50975,ProfileLookTableDims:50981,ProfileLookTableData:50982,OpcodeList1:51008,OpcodeList2:51009,OpcodeList3:51022,NoiseProfile:51041},r.ExifIFD={ExposureTime:33434,FNumber:33437,ExposureProgram:34850,SpectralSensitivity:34852,ISOSpeedRatings:34855,OECF:34856,SensitivityType:34864,StandardOutputSensitivity:34865,RecommendedExposureIndex:34866,ISOSpeed:34867,ISOSpeedLatitudeyyy:34868,ISOSpeedLatitudezzz:34869,ExifVersion:36864,DateTimeOriginal:36867,DateTimeDigitized:36868,ComponentsConfiguration:37121,CompressedBitsPerPixel:37122,ShutterSpeedValue:37377,ApertureValue:37378,BrightnessValue:37379,ExposureBiasValue:37380,MaxApertureValue:37381,SubjectDistance:37382,MeteringMode:37383,LightSource:37384,Flash:37385,FocalLength:37386,SubjectArea:37396,MakerNote:37500,UserComment:37510,SubSecTime:37520,SubSecTimeOriginal:37521,SubSecTimeDigitized:37522,FlashpixVersion:40960,ColorSpace:40961,PixelXDimension:40962,PixelYDimension:40963,RelatedSoundFile:40964,InteroperabilityTag:40965,FlashEnergy:41483,SpatialFrequencyResponse:41484,FocalPlaneXResolution:41486,FocalPlaneYResolution:41487,FocalPlaneResolutionUnit:41488,SubjectLocation:41492,ExposureIndex:41493,SensingMethod:41495,FileSource:41728,SceneType:41729,CFAPattern:41730,CustomRendered:41985,ExposureMode:41986,WhiteBalance:41987,DigitalZoomRatio:41988,FocalLengthIn35mmFilm:41989,SceneCaptureType:41990,GainControl:41991,Contrast:41992,Saturation:41993,Sharpness:41994,DeviceSettingDescription:41995,SubjectDistanceRange:41996,ImageUniqueID:42016,CameraOwnerName:42032,BodySerialNumber:42033,LensSpecification:42034,LensMake:42035,LensModel:42036,LensSerialNumber:42037,Gamma:42240},r.GPSIFD={GPSVersionID:0,GPSLatitudeRef:1,GPSLatitude:2,GPSLongitudeRef:3,GPSLongitude:4,GPSAltitudeRef:5,GPSAltitude:6,GPSTimeStamp:7,GPSSatellites:8,GPSStatus:9,GPSMeasureMode:10,GPSDOP:11,GPSSpeedRef:12,GPSSpeed:13,GPSTrackRef:14,GPSTrack:15,GPSImgDirectionRef:16,GPSImgDirection:17,GPSMapDatum:18,GPSDestLatitudeRef:19,GPSDestLatitude:20,GPSDestLongitudeRef:21,GPSDestLongitude:22,GPSDestBearingRef:23,GPSDestBearing:24,GPSDestDistanceRef:25,GPSDestDistance:26,GPSProcessingMethod:27,GPSAreaInformation:28,GPSDateStamp:29,GPSDifferential:30,GPSHPositioningError:31},r.InteropIFD={InteroperabilityIndex:1},r.GPSHelper={degToDmsRational:function(e){var t=Math.abs(e),r=t%1*60,n=r%1*60;return[[Math.floor(t),1],[Math.floor(r),1],[Math.round(100*n),100]]},dmsRationalToDeg:function(e,t){var r="S"===t||"W"===t?-1:1;return(e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600)*r}},e.exports&&(t=e.exports=r),t.piexif=r}()})),pz=function(e,t,r){return null==e?e:function(e,t,r,n){if(!nT(e))return e;for(var o=-1,i=(t=aM(t,e)).length,a=i-1,s=e;null!=s&&++o<i;){var c=sM(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var l=s[c];void 0===(u=n?n(l,c,s):void 0)&&(u=nT(l)?l:qT(t[o+1])?[]:{})}TT(s,c,u),s=s[c]}return e}(e,t,r)},mz={},gz={SELFIE:"selfie",ID_CARD:"id_card"},vz=Vj((function(e){var t=new YU,r=e||$U.join("");return t.setPublicKey(r),t})),yz=function(e){var t=e.gesture,r=e.captureTime,n=e.frames,o=e.blurScore,i=e.selfieLabel,a=e.brightnessScore,s=e.accelerometer,c=e.gyroscope;return{capture_time:r,type:t,frames:n,blur_score:o,selfie_label:i,qualify_score:e.qualifyScore,accelerometer:s,gyroscope:c,brightness_score:a}},bz=function(e){var t=e.detectedCard,r=e.captureTime,n=e.vCam,o=e.captureCount,i=e.captureDuration,a=e.captureType,s=e.cardTracking;return{capture_time:r,type:null==t?void 0:t.label,v_cam:n,capture_count:o,capture_duration:i,capture_type:a,card_tracking:s}},wz=function(){var e=EP(kP().mark((function e(t,r){var n;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return MP(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},e.abrupt("return",new Promise((function(e){var o=new TextEncoder,i=o.encode(t),a=o.encode(r);window.crypto.subtle.importKey("raw",a,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,i).then((function(t){e("".concat(cz,".").concat(n(t)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),_z=function(){var e=EP(kP().mark((function e(t){var r,n,o,i,a,s,c,u,l;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.mode,o=t.imageData,t.enableExifData){e.next=3;break}return e.abrupt("return",new Promise((function(e){return e(o.blob)})));case 3:return i=_P(_P({},mz),n===gz.SELFIE?yz(o):bz(o)),a=_P(_P({},i),{},{sensor_data:"sensor data exceed 64KB"}),null!=o&&null!==(r=o.type)&&void 0!==r&&r.includes("qr")&&(i={capture_time:null==o?void 0:o.captureTime,type:null==o?void 0:o.type,qr_string:null==o?void 0:o.result}),e.next=8,wz(JSON.stringify(a),sz);case 8:return s=e.sent,e.next=11,wz(JSON.stringify(i),sz);case 11:return c=e.sent,u=hz.dump({Exif:PP({},hz.ExifIFD.MakerNote,c)}),l=hz.dump({Exif:PP({},hz.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var t=new FileReader;t.onload=function(){var t=EP(kP().mark((function t(r){var n,i,a;return kP().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{n=hz.insert(u,r.target.result)}catch(t){try{n=hz.insert(l,r.target.result)}catch(t){e(o.blob)}}return t.prev=1,t.next=4,fetch(n);case 4:return i=t.sent,t.next=7,i.blob();case 7:a=t.sent,URL.revokeObjectURL(n),e(a),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)}}(),kz=Object.freeze({__proto__:null,MODE:gz,initExifData:function(){mz={device_info:{device_brand_name:"".concat("none"===YM.mobileVendor?"null":YM.mobileVendor),device_model:"".concat("none"===YM.mobileModel?"null":YM.mobileModel),browser_version:"".concat(YM.browserName," ").concat(YM.browserVersion),browser_userAgent:"".concat(YM.getUA),os:YM.osName,os_version:YM.osVersion},sdk_version:"5.23.1",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,t){pz(mz,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,i=void 0===o?"":o;mz.user_action=_P({},t===gz.SELFIE?{start_selfie:r,end_selfie:n}:{start_id_card:r,end_id_card:n}),sz=QM().replace(/-/g,""),az||(az=vz(i)),cz=iU(az.encrypt(sz))},writeExif:_z}),Cz=function(e,t,r){(void 0!==r&&!FP(e[t],r)||void 0===r&&!(t in e))&&AT(e,t,r)},Sz=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),a=i.length;a--;){var s=i[++n];if(!1===t(o[s],s,o))break}return e},Bz=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},Ez=function(e,t,r,n,o,i,a){var s=Bz(e,r),c=Bz(t,r),u=a.get(c);if(u)Cz(e,r,u);else{var l=i?i(s,c,r+"",e,t,a):void 0,d=void 0===l;if(d){var f=VT(c),h=!f&&UT(c),p=!f&&!h&&XT(c);l=c,f||h||p?VT(s)?l=s:function(e){return MT(e)&&nR(e)}(s)?l=uR(s):h?(d=!1,l=cR(c,!0)):p?(d=!1,l=NR(c,!0)):l=[]:gM(c)||FT(c)?(l=s,FT(s)?l=function(e){return RT(e,sR(e))}(s):nT(s)&&!oT(s)||(l=UR(c))):d=!1}d&&(a.set(c,l),o(l,c,n,i,a),a.delete(c)),Cz(e,r,l)}},xz=function e(t,r,n,o,i){t!==r&&Sz(r,(function(a,s){if(i||(i=new xT),nT(a))Ez(t,r,s,n,e,o,i);else{var c=o?o(Bz(t,s),a,s+"",t,r,i):void 0;void 0===c&&(c=a),Cz(t,s,c)}}),sR)},Iz=function(e,t){return AM(SM(e,t,EM),e+"")},Az=function(e,t,r){if(!nT(r))return!1;var n=rg(t);return!!("number"==n?nR(r)&&qT(t,r.length):"string"==n&&t in r)&&FP(r[t],e)},Pz=function(e){return Iz((function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&Az(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t}))},Tz=Pz((function(e,t,r,n){xz(e,t,r,n)})),Rz={enableGetClientSettings:!0,enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:!0,enableVerifySanityIDCard:!0,enableVerifyFaceLiveness:!0,enableDetectIDCardTampering:!0,enableReadIDCardInfo:!0,enableRegisterFace:!0,enableAuthenticateFace:!0},Mz=Object.freeze({__proto__:null,getEnabledServices:function(e,t){var r=function(e){if(!e)return Rz;var t=e.enableUploadFrames,r=e.enableUploadImages,n=void 0===r||r,o=e.enableGetClientSettings,i=n&&e.enableVerifySanityPortrait,a=n&&e.enableVerifySanityIDCard,s=n&&e.enableDetectIDCardTampering,c=n&&e.enableReadIDCardInfo;return{enableGetClientSettings:o,enableUploadFrames:t,enableUploadImages:n,enableVerifySanityPortrait:i,enableVerifySanityIDCard:a,enableVerifyFaceLiveness:n&&e.enableVerifyFaceLiveness,enableDetectIDCardTampering:s,enableReadIDCardInfo:c,enableRegisterFace:n&&e.enableRegisterFace,enableAuthenticateFace:n&&e.enableAuthenticateFace}}(e),n=function(e){return{enableGetClientSettings:!0,enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:uF(e,"data.settings.enable_verify_portrait_sanity",!0),enableVerifySanityIDCard:uF(e,"data.settings.enable_verify_id_card_sanity",!0),enableVerifyFaceLiveness:uF(e,"data.settings.enable_verify_face_liveness",!0),enableDetectIDCardTampering:uF(e,"data.settings.enable_detect_id_card_tampering",!0),enableReadIDCardInfo:uF(e,"data.settings.enable_read_id_card_info",!0),enableRegisterFace:uF(e,"data.settings.enable_face_registration",!0),enableAuthenticateFace:uF(e,"data.settings.enable_face_authentication",!0)}}(t),o=_P({},Rz);return Tz(o,r,n,(function(e,t){return(null==e||e)&&(null==t||t)}))}}),Dz=function(e){var t=e.slice(0,2),r=e.slice(2,4),n=e.slice(4,8);return new Date("".concat(n,"-").concat(r,"-").concat(t))},Lz=function(e){return!Number.isNaN(e.getTime())&&e<=new Date},Oz={CCCD:{validate:function(e){var t=e.split("|"),r=Dz(t[3]),n=Dz(t[6]);return 7===t.length&&Boolean(e.match(/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g))&&Lz(r)&&Lz(n)&&r<n}},TCC:{validate:function(e){var t=e.split("|"),r=Dz(t[3]),n=Dz(t[6]);return 11===t.length&&Boolean(e.match(/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}/g))&&Lz(r)&&Lz(n)&&r<n}}},Nz=Object.freeze({__proto__:null,validateIdQRContent:function(e){var t=function(e){var t=e[6];if(!t||8!==t.length)return null;var r=Dz(t);return Lz(r)?r>=new Date("2024-07-01")?Oz.TCC:Oz.CCCD:null}(e.split("|"));return t?{valid:t.validate(e)}:{valid:!1}}}),Fz=function(e){return e===yP.ACTIVE?"active":e===yP.PASSIVE?"passive":"string"==typeof e&&e.startsWith("flash")?"flash":"active"},Vz=Object.freeze({__proto__:null,getLivenessMode:Fz}),jz="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",Uz=function(){return AP((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jz,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.342,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:368,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;xP(this,e),this.model_path=t,this.threshold=r,this.size=Math.round(n/2),this.enable_profiling=o,this.num_threads=i}),[{key:"load",value:(t=EP(kP().mark((function e(){var t,r,n,o=this;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,e.next=3,Wj({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 t.apply(this,arguments)})},{key:"crop_eyes",value:function(e,t){var r=this,n=window.tf,o=t[0].map((function(e){return Math.round(e)})),i=t[1].map((function(e){return Math.round(e)}));o[0]>i[0]&&(o=t[1].map((function(e){return Math.round(e)})),i=t[0].map((function(e){return Math.round(e)})));var a=Math.round((o[0]+i[0])/2),s=a-o[0],c=i[0]-a;s>=this.size&&(s=this.size),c>=this.size&&(c=this.size);var u=Math.max(o[0]-s,0),l=Math.max(o[1]-s,0),d=Math.max(i[0]-c,0),f=Math.max(i[1]-c,0);return n.tidy((function(){var t=e.slice([l,u,0],[2*s,2*s,3]),o=e.slice([f,d,0],[2*c,2*c,3]);return{l_img:t=n.expandDims(n.image.resizeBilinear(t,[r.input_width,r.input_height])),r_img:o=n.expandDims(n.image.resizeBilinear(o,[r.input_width,r.input_height]))}}))}},{key:"predict",value:(e=EP(kP().mark((function e(t,r){var n,o,i,a,s,c,u,l,d,f=this,h=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=h.length>2&&void 0!==h[2]?h[2]:this.threshold,o=window,i=o.tf,a=t.getContext("2d"),s=a.getImageData(0,0,t.height,t.width),c=i.tidy((function(){var e=i.browser.fromPixels(s),t=f.crop_eyes(e,r),o=t.l_img,a=t.r_img,c=f.model.predict(o).arraySync()[0],u=f.model.predict(a).arraySync()[0];return[c>n,u>n]})),u=RP(c,2),l=u[0],d=u[1],e.abrupt("return",{isEyeClose:l||d});case 6:case"end":return e.stop()}}),e,this)}))),function(t,r){return e.apply(this,arguments)})}]);var e,t}(),zz="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.1.0/libs/opencv-4.9.0.js",qz=Vj(function(){var e=EP(kP().mark((function e(){var t,r,n,o=arguments;return kP().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?zz:r,e.abrupt("return",new Promise((function(e,t){try{if(window.cv)return void e();var r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("type","text/javascript"),r.setAttribute("id","opencvjs"),r.addEventListener("load",EP(kP().mark((function t(){return kP().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)}catch(e){console.error(e)}})));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),Wz=AP((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.02,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:127.5,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.3855;xP(this,e),this.c1=t,this.c2=r,this.maxDiffThreshold=n}),[{key:"sigMoid",value:function(e){var t=window.cv;e.convertTo(e,t.CV_32FC3);var r=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(this.c2,this.c2,this.c2)),n=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(-this.c1,-this.c1,-this.c1)),o=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(1,1,1));return t.subtract(e,r,e),t.multiply(e,n,e),t.exp(e,e),t.add(e,o,e),t.divide(o,e,e),r.delete(),n.delete(),o.delete(),e}},{key:"faceResize",value:function(e,t){var r=window.cv,n=new r.Mat,o=e.rows<t.height?r.INTER_CUBIC:r.INTER_AREA;return r.resize(e,n,t,0,0,o),n}},{key:"checkValidFaceSide",value:function(e){return e.every((function(e){return!e.empty()}))}},{key:"divideFace",value:function(e,t){var r=window.cv;if(0===t.length)return[!1,[null,null,null,null,null]];var n=t[0],o=n[0],i=n[1],a=n[2],s=n[3],c=e.roi(new r.Rect(s,o,i-s,a-o)),u=e.roi(new r.Rect(s,o,(i-s)/2,(a-o)/2)),l=e.roi(new r.Rect(s,o+(a-o)/2,(i-s)/2,(a-o)/2)),d=e.roi(new r.Rect(s+(i-s)/2,o,(i-s)/2,(a-o)/2)),f=e.roi(new r.Rect((i+s)/2,(a+o)/2,(i-s)/2,(a-o)/2));if(!this.checkValidFaceSide([c,u,l,d,f]))return c.delete(),u.delete(),l.delete(),d.delete(),f.delete(),[!1,[null,null,null,null,null]];var h=this.faceResize(u,new r.Size(80,128)),p=this.faceResize(l,new r.Size(80,128)),m=this.faceResize(d,new r.Size(80,128)),g=this.faceResize(f,new r.Size(80,128)),v=this.faceResize(c,new r.Size(320,512));return c.delete(),u.delete(),l.delete(),d.delete(),f.delete(),[!0,[h,p,m,g,v]]}},{key:"measureBrightness",value:function(e,t){if("hls"!==t&&"arithmetic"!==t)return-1;var r=window.cv;if("arithmetic"===t){var n=this.sigMoid(e);r.multiply(n,n,n);var o=new r.MatVector;r.split(n,o);for(var i=o.get(0),a=1;a<o.size();a+=1){var s=o.get(a);r.add(i,s,i),s.delete()}r.sqrt(i,i);var c=new r.Mat(i.rows,i.cols,i.type(),new r.Scalar(Math.sqrt(3)));r.divide(i,c,i);var u=r.mean(i);return c.delete(),o.delete(),i.delete(),u[0]}if("hls"===t){var l=new r.Mat;r.cvtColor(e,l,r.COLOR_RGB2HLS);var d=new r.MatVector;r.split(l,d);var f=d.get(1);f=this.sigMoid(f);var h=r.mean(f);return l.delete(),d.delete(),f.delete(),h[0]}return-1}},{key:"predict",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"hls",n=null;try{var o=window,i=o.cv;n=i.imread(e);var a=this.divideFace(n,t),s=a[0],c=a[1],u=[],l=null;if(!s)return n.delete(),l;var d,f=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY,p=OP(c);try{for(p.s();!(d=p.n()).done;){var m=d.value,g=this.measureBrightness(m,r);u.push(g),f=Math.max(f,g),h=Math.min(h,g),m.delete()}}catch(e){p.e(e)}finally{p.f()}var v=f-h;return l=v>this.maxDiffThreshold?h:u[u.length-1],n.delete(),l}catch(e){return n&&n.delete(),console.error(e),null}}},{key:"score",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=this.predict(e,t,o);return null===i?{score:1,message:"good"}:i<r?{score:i,message:"face_too_dark"}:i>n?{score:i,message:"face_too_bright"}:{score:i,message:"good"}}}],[{key:"hasBetterBrightnessScore",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||e-t>r}},{key:"hasSameBrightnessScore",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null!==t&&Math.abs(e-t)<r}},{key:"METHOD",get:function(){return{HLS:"hls",ARITHMETIC:"arithmetic"}}},{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.opencvUrl;return XD(this,void 0,void 0,kP().mark((function e(){return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,qz({url:t});case 2:case"end":return e.stop()}}),e)})))}},{key:"log",value:function(){var e=window.cv;console.log("build info",e.getBuildInformation())}}]),Hz="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.2.0/models/qualify/qualify_model.tflite",Kz=[.50612009,.42543493,.38282761],Qz=[.26589054,.24521921,.24127836],Gz=["normal","beard","mask_chin"],Xz={0:"normal",1:"beard",2:"mask",3:"object",4:"mask_chin"},Yz={beard:.3689,mask:.6337,mask_chin:.2315,object:.3942,normal:.5541};function $z(e,t,r){return Math.max(t,Math.min(e,r))}function Zz(e){for(var t=0,r=1;r<e.length;r++)e[r]>e[t]&&(t=r);return t}var Jz=function(){return AP((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hz;xP(this,e),this.modelPath=t}),[{key:"init",value:(t=EP(kP().mark((function e(){var t,r,n=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},r=t.opencvUrl,e.next=3,qz({url:r});case 3:return e.next=5,Wj({modelUrl:this.modelPath});case 5:this.model=e.sent;case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"normalize",value:function(e){var t=window.cv,r=255;e.convertTo(e,t.CV_32FC3);var n=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(r*Kz[0],r*Kz[1],r*Kz[2])),o=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(r*Qz[0],r*Qz[1],r*Qz[2]));return t.subtract(e,n,e),t.divide(e,o,e),n.delete(),o.delete(),e}},{key:"transform",value:function(e){var t=window.cv,r=new t.Mat;return t.resize(e,r,new t.Size(224,224)),e.delete(),this.normalize(r)}},{key:"forward",value:function(e){var t=window,r=t.tf,n=t.cv;n.cvtColor(e,e,n.COLOR_RGBA2RGB);var o=r.tensor(e.data32F,[e.rows,e.cols,e.channels()]);e.delete();var i=r.transpose(o,[2,0,1]),a=r.expandDims(i,0),s=this.model.predict(a);return o.dispose(),i.dispose(),a.dispose(),Array.from(s.dataSync())}},{key:"process",value:function(e){e=this.transform(e);var t=this.forward(e),r=Math.log(function(e){for(var t=0,r=0;r<e.length;r++)t+=e[r];return t}(function(e){for(var t=[],r=0;r<e.length;r++)t[r]=Math.exp(e[r]);return t}(t))),n=function(e){for(var t=[],r=0,n=Math.max.apply(Math,MP(e)),o=0;o<e.length;o++)e[o]=Math.exp(e[o]-n),r+=e[o];for(var i=0;i<e.length;i++)t[i]=e[i]/r;return t}(t);return[r,Math.max.apply(Math,MP(n)),n]}},{key:"cropFace",value:function(e,t){var r=t[0],n=t[1],o=t[3],i=Math.floor(n[0]-r[0]),a=Math.max(0,Math.floor(r[0]-1*i)),s=Math.max(0,Math.floor(r[1]-1.3*i)),c=Math.min(Math.floor(n[0]+1*i),e.cols),u=Math.min(Math.floor(o[1]+.9*i),e.rows),l=window.cv;return e.roi(new l.Rect(a,s,c-a,u-s))}},{key:"predict",value:(e=EP(kP().mark((function e(t,r){var n,o,i,a,s,c,u,l,d,f,h,p,m,g,v,y,b=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=b.length>2&&void 0!==b[2]?b[2]:.11,o=b.length>3&&void 0!==b[3]?b[3]:Gz,e.prev=2,i=window,a=i.cv,s=a.imread(t),c=this.cropFace(s,r),s.delete(),u=this.process(c),l=RP(u,3),d=l[0],f=l[1],h=l[2],p=$z(d,5,23),m=1-(p-5)/18,g=Zz(h),v=Xz[g],!(m>n)){e.next=15;break}return e.abrupt("return",[!1,m]);case 15:y=0;case 16:if(!(y<o.length)){e.next=22;break}if(v!==o[y]){e.next=19;break}return e.abrupt("return",[!0,0]);case 19:y++,e.next=16;break;case 22:if(!(f<Yz[v])){e.next=24;break}return e.abrupt("return",[!0,0]);case 24:return e.abrupt("return",[!1,1]);case 27:return e.prev=27,e.t0=e.catch(2),console.error("NotQualifiedDetector error",e.t0),e.abrupt("return",[!0,0]);case 31:case"end":return e.stop()}}),e,this,[[2,27]])}))),function(t,r){return e.apply(this,arguments)})}]);var e,t}(),eq=function(){var e=EP(kP().mark((function e(){return kP().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 tq(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,r=void 0===t?100:t,n=hv.useRef([]),o=hv.useRef([]),i=(hv.useRef(!1),hv.useRef({})),a=hv.useCallback((function(e){var t=Date.now(),n=e.type;return!!(i.current[n]&&t-i.current[n]<r)||(i.current[n]=t,!1)}),[r]),s=hv.useCallback((function(e){a(e)||o.current.push({time:Date.now(),alpha:null==e?void 0:e.alpha,beta:null==e?void 0:e.beta,gamma:null==e?void 0:e.gamma})}),[a]),c=hv.useCallback((function(e){var t,r,o,i,s,c;a(e)||n.current.push({time:Date.now(),Accelerometer:{x:null==e||null===(t=e.acceleration)||void 0===t?void 0:t.x,y:null==e||null===(r=e.acceleration)||void 0===r?void 0:r.y,z:null==e||null===(o=e.acceleration)||void 0===o?void 0:o.z},Gyroscope:{z:null==e||null===(i=e.rotationRate)||void 0===i?void 0:i.alpha,x:null==e||null===(s=e.rotationRate)||void 0===s?void 0:s.beta,y:null==e||null===(c=e.rotationRate)||void 0===c?void 0:c.gamma}})}),[a]),u=hv.useCallback((function(){}),[c,s]),l=hv.useCallback((function(){}),[c,s]);return hv.useEffect((function(){return function(){l()}}),[l]),{motionData:n.current,orientationData:o.current,startMotion:u,stopMotion:l}}var rq=Pz((function(e,t,r,n){RT(t,sR(t),e,n)})),nq=function(e){if(!MT(e))return!1;var t=rT(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!gM(e)},oq=Iz((function(e,t){try{return kM(e,void 0,t)}catch(e){return nq(e)?e:new Error(e)}})),iq=Object.prototype,aq=iq.hasOwnProperty,sq=function(e,t,r,n){return void 0===e||FP(e,iq[r])&&!aq.call(n,r)?t:e},cq={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},uq=function(e){return"\\"+cq[e]},lq=/<%=([\s\S]+?)%>/g,dq=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),fq=/[&<>"']/g,hq=RegExp(fq.source),pq={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:lq,variable:"",imports:{_:{escape:function(e){return(e=iM(e))&&hq.test(e)?e.replace(fq,dq):e}}}},mq=/\b__p \+= '';/g,gq=/\b(__p \+=) '' \+/g,vq=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yq=/[()=,{}\[\]\/\s]/,bq=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,wq=/($^)/,_q=/['\n\r\u2028\u2029\\]/g,kq=Object.prototype.hasOwnProperty,Cq=function(e,t,r){var n=pq.imports._.templateSettings||pq;r&&Az(e,t,r)&&(t=void 0),e=iM(e),t=rq({},t,n,sq);var o,i,a=rq({},t.imports,n.imports,sq),s=oR(a),c=function(e,t){return NP(t,(function(t){return e[t]}))}(a,s),u=0,l=t.interpolate||wq,d="__p += '",f=RegExp((t.escape||wq).source+"|"+l.source+"|"+(l===lq?bq:wq).source+"|"+(t.evaluate||wq).source+"|$","g"),h=kq.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,a,s,c){return n||(n=a),d+=e.slice(u,c).replace(_q,uq),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var p=kq.call(t,"variable")&&t.variable;if(p){if(yq.test(p))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(mq,""):d).replace(gq,"$1").replace(vq,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=oq((function(){return Function(s,h+"return "+d).apply(void 0,c)}));if(m.source=d,nq(m))throw m;return m},Sq=function(){var e=QD();return hv.useCallback((function(t,r){var n,o;return r?Cq(null!==(o=e[t])&&void 0!==o?o:t)(r):null!==(n=e[t])&&void 0!==n?n:t}),[e])},Bq=function(e){hv.useEffect((function(){!function(e){new Promise((function(t,r){var n=new Image;n.onload=t,n.onerror=r,n.src=e}))}(e)}),[e])},Eq=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']))},xq=Pz((function(e,t,r){xz(e,t,r)})),Iq=ZM(),Aq=AP((function e(t){var r=this,n=t.container,o=t.lang,i=void 0===o?"vi":o,a=t.assetRoot,s=t.resourceRoot,c=t.customUrls,u=void 0===c?{}:c,l=t.enableAntiDebug,d=void 0===l||l,f=t.warmupMessage,h=t.baseComponent,p=t.component,m=void 0===p?{}:p,g=t.country,v=void 0===g?"vn":g,y=t.idCardContext,b=t.exifKey,w=void 0===b?"":b,_=t.themeVersion,k=void 0===_?"v2":_,C=t.enableVoice,S=void 0!==C&&C;xP(this,e),PP(this,"getDeviceInfo",EP(kP().mark((function e(){var t,r;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={id:null,udid:null,sn:null,imei:null,manufacturer:JM(),deviceName:eD(),wlanMac:null,phoneNumber:null,location:{latitude:null,longitude:null}},e.next=3,lj();case 3:return r=e.sent,t.location.latitude=(null==r?void 0:r.lat)||null,t.location.longitude=(null==r?void 0:r.long)||null,e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})))),PP(this,"initNativeCamera",(function(e){var t=document.createElement("div");document.body.appendChild(t);var n=hv.createRef(),o=r.component.NativeCamera;return hP.render(hv.createElement(o,TP({},e,{ref:n})),t),{openCamera:function(){n.current.click()}}})),PP(this,"runWarmUpReadIDCard",EP(kP().mark((function e(){var t;return kP().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)})))),PP(this,"runPreloadEKYCResources",EP(kP().mark((function e(){var t;return kP().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)})))),PP(this,"destroyView",(function(){hP.unmountComponentAtNode(r.container)})),function(e,t,r,n,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,i,a,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var B=MM({resourceRoot:s,initCustomUrls:u,country:v});this.commonSettings=_P({lang:i,assetRoot:a,customUrls:B,enableAntiDebug:d,debug:!1,warmupMessage:f,country:v,exifKey:w,themeVersion:k,enableVoice:S},y),this.component=xq({},h,m)}),[{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,r=_P(_P({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{});hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(HD,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:r}},hv.createElement(tL,{mode:"id_card"},hv.createElement(t,TP({onClose:this.destroyView},e))))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var t,r=this.component.ReadIDCardUIOnly,n=_P(_P({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{});hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(HD,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:n}},hv.createElement(pF,{clientSettings:null!==(t=null==e?void 0:e.clientSettings)&&void 0!==t?t:{},onError:null==e?void 0:e.onError},hv.createElement(tL,{mode:"id_card"},hv.createElement(r,TP({onClose:this.destroyView},e)))))),this.container)}},{key:"livenessDetection",value:function(e){var t=this.component,r=t.LivenessDetection,n=t.CustomComponent,o=_P(_P(_P(_P({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{}),(null==e?void 0:e.customInstructions)||{}),(null==e?void 0:e.customMessages)||{});hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(HD,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:o}},hv.createElement(tL,{mode:Fz(e.mode)},hv.createElement(r,TP({onClose:this.destroyView},e,{customComponent:n}))))),this.container)}},{key:"ekycFlow",value:function(e){var t=this.component.EkycFlow,r=(null==e?void 0:e.customTexts)||{};hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(HD,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:r}},hv.createElement(t,TP({onClose:this.destroyView},e)))),this.container)}},{key:"flashLiveness",value:function(e){var t=this.component.FlashLiveness;hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(t,TP({onClose:this.destroyView},e))),this.container)}},{key:"faceAuthentication",value:function(e){var t=this.component,r=t.FaceAuthentication,n=t.LivenessDetection,o=t.CustomComponent,i=_P(_P(_P(_P({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{}),(null==e?void 0:e.customInstructions)||{}),(null==e?void 0:e.customMessages)||{});hP.render(hv.createElement(LM,{value:this.commonSettings},hv.createElement(HD,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:i}},hv.createElement(tL,{mode:Fz(e.authMethod)},hv.createElement(r,TP({onClose:this.destroyView},e,{livenessDetectionComponent:n,customComponent:o}))))),this.container)}},{key:"compareFaces",value:function(e){var t=e.accessKey,r=e.secretKey,n=e.apiUrl,o=e.image1,i=e.image2,a=e.onSuccess,s=e.onError;bj(new jM(t,r,n,{httpHeaders:Iq})).compareFaces({image1:{id:o},image2:{id:i}}).then((function(e){a(e)})).catch((function(e){s(e)}))}}]),Pq=ZM(),Tq=function(){return AP((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(xP(this,e),t&&r&&n){var o=vD({userId:""});this.apiClient=bj(new jM(t,r,n,{httpHeaders:_P(_P({},Pq),{},{"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)}),[{key:"clientSettings",value:(l=EP(kP().mark((function e(t){var r;return kP().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 l.apply(this,arguments)})},{key:"uploadImage",value:(u=EP(kP().mark((function e(t){var r;return kP().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 u.apply(this,arguments)})},{key:"uploadFiles",value:(c=EP(kP().mark((function e(t){var r,n,o=arguments;return kP().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:{},!this.apiClient){e.next=6;break}return e.next=4,this.apiClient.httpClient.post("/v1/files",t,r);case 4:return n=e.sent,e.abrupt("return",n);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"requestVerifyIDCard",value:(s=EP(kP().mark((function e(t){var r;return kP().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 s.apply(this,arguments)})},{key:"detectIDTampering",value:(a=EP(kP().mark((function e(t){var r;return kP().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 a.apply(this,arguments)})},{key:"readIDCard",value:(i=EP(kP().mark((function e(t){var r;return kP().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:(o=EP(kP().mark((function e(t){var r;return kP().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 o.apply(this,arguments)})},{key:"verifyFaceLiveness",value:(n=EP(kP().mark((function e(t){var r;return kP().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 n.apply(this,arguments)})},{key:"compareFaces",value:(r=EP(kP().mark((function e(t){var r;return kP().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 r.apply(this,arguments)})},{key:"searchFaces",value:(t=EP(kP().mark((function e(t){var r;return kP().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 t.apply(this,arguments)})},{key:"indexFaces",value:(e=EP(kP().mark((function e(t){var r;return kP().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(t){return e.apply(this,arguments)})}]);var e,t,r,n,o,i,a,s,c,u,l}();function Rq(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 Mq(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rq(Object(r),!0).forEach((function(t){Vq(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rq(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Dq(){Dq=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:B(e,r,s)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var f="suspendedStart",h="executing",p="completed",m={};function g(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(P([])));_&&_!==r&&n.call(_,a)&&(b=_);var k=y.prototype=g.prototype=Object.create(b);function C(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,i,a,s){var c=d(e[o],e,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==rg(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function B(t,r,n){var o=f;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=E(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=d(t,r,n);if("normal"===u.type){if(o=n.done?p:"suspendedYield",u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=p,n.method="throw",n.arg=u.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function x(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 I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function P(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(rg(t)+" is not iterable")}return v.prototype=y,o(k,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},C(S.prototype),u(S.prototype,s,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new S(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=P,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.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 i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},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),I(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;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Lq(e){var t=function(e,t){if("object"!=rg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=rg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==rg(t)?t:t+""}function Oq(e){return(Oq="function"==typeof Symbol&&"symbol"==rg(Symbol.iterator)?function(e){return rg(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":rg(e)})(e)}function Nq(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Fq(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Nq(i,n,o,a,s,"next",e)}function s(e){Nq(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Vq(e,t,r){return(t=Lq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jq(){return(jq=Object.assign?Object.assign.bind():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 Uq(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function zq(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||Wq(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 qq(e){return function(e){if(Array.isArray(e))return Hq(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wq(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 Wq(e,t){if(e){if("string"==typeof e)return Hq(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)?Hq(e,t):void 0}}function Hq(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 Kq=Array.isArray,Qq="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Gq(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 Xq,Yq="object"==rg(Qq)&&Qq&&Qq.Object===Object&&Qq,$q="object"==("undefined"==typeof self?"undefined":rg(self))&&self&&self.Object===Object&&self,Zq=Yq||$q||Function("return this")(),Jq=Zq.Symbol,eW=Object.prototype,tW=eW.hasOwnProperty,rW=eW.toString,nW=Jq?Jq.toStringTag:void 0,oW=Object.prototype.toString,iW=Jq?Jq.toStringTag:void 0,aW=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":iW&&iW in Object(e)?function(e){var t=tW.call(e,nW),r=e[nW];try{e[nW]=void 0;var n=!0}catch(e){}var o=rW.call(e);return n&&(t?e[nW]=r:delete e[nW]),o}(e):function(e){return oW.call(e)}(e)},sW=function(e){return null!=e&&"object"==rg(e)},cW=function(e){return"symbol"==rg(e)||sW(e)&&"[object Symbol]"==aW(e)},uW=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lW=/^\w*$/,dW=function(e){var t=rg(e);return null!=e&&("object"==t||"function"==t)},fW=function(e){if(!dW(e))return!1;var t=aW(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},hW=Zq["__core-js_shared__"],pW=(Xq=/[^.]+$/.exec(hW&&hW.keys&&hW.keys.IE_PROTO||""))?"Symbol(src)_1."+Xq:"",mW=Function.prototype.toString,gW=/^\[object .+?Constructor\]$/,vW=Function.prototype,yW=Object.prototype,bW=vW.toString,wW=yW.hasOwnProperty,_W=RegExp("^"+bW.call(wW).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kW=function(e){return!(!dW(e)||function(e){return!!pW&&pW in e}(e))&&(fW(e)?_W:gW).test(function(e){if(null!=e){try{return mW.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))},CW=function(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return kW(r)?r:void 0},SW=CW(Object,"create"),BW=Object.prototype.hasOwnProperty,EW=Object.prototype.hasOwnProperty;function xW(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])}}xW.prototype.clear=function(){this.__data__=SW?SW(null):{},this.size=0},xW.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xW.prototype.get=function(e){var t=this.__data__;if(SW){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return BW.call(t,e)?t[e]:void 0},xW.prototype.has=function(e){var t=this.__data__;return SW?void 0!==t[e]:EW.call(t,e)},xW.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=SW&&void 0===t?"__lodash_hash_undefined__":t,this};var IW=xW,AW=function(e,t){return e===t||e!=e&&t!=t},PW=function(e,t){for(var r=e.length;r--;)if(AW(e[r][0],t))return r;return-1},TW=Array.prototype.splice;function RW(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])}}RW.prototype.clear=function(){this.__data__=[],this.size=0},RW.prototype.delete=function(e){var t=this.__data__,r=PW(t,e);return!(r<0||(r==t.length-1?t.pop():TW.call(t,r,1),--this.size,0))},RW.prototype.get=function(e){var t=this.__data__,r=PW(t,e);return r<0?void 0:t[r][1]},RW.prototype.has=function(e){return PW(this.__data__,e)>-1},RW.prototype.set=function(e,t){var r=this.__data__,n=PW(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var MW=RW,DW=CW(Zq,"Map"),LW=function(e,t){var r=e.__data__;return function(e){var t=rg(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map};function OW(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])}}OW.prototype.clear=function(){this.size=0,this.__data__={hash:new IW,map:new(DW||MW),string:new IW}},OW.prototype.delete=function(e){var t=LW(this,e).delete(e);return this.size-=t?1:0,t},OW.prototype.get=function(e){return LW(this,e).get(e)},OW.prototype.has=function(e){return LW(this,e).has(e)},OW.prototype.set=function(e,t){var r=LW(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};var NW=OW;function FW(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(FW.Cache||NW),r}FW.Cache=NW;var VW=FW,jW=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,UW=/\\(\\)?/g,zW=function(e){var t=VW((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(jW,(function(e,r,n,o){t.push(n?o.replace(UW,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),qW=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},WW=Jq?Jq.prototype:void 0,HW=WW?WW.toString:void 0,KW=function e(t){if("string"==typeof t)return t;if(Kq(t))return qW(t,e)+"";if(cW(t))return HW?HW.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},QW=function(e){return null==e?"":KW(e)},GW=function(e,t){return Kq(e)?e:function(e,t){if(Kq(e))return!1;var r=rg(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!cW(e))||lW.test(e)||!uW.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:zW(QW(e))},XW=function(e){if("string"==typeof e||cW(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},YW=function(e,t,r){var n=null==e?void 0:function(e,t){for(var r=0,n=(t=GW(t,e)).length;null!=e&&r<n;)e=e[XW(t[r++])];return r&&r==n?e:void 0}(e,t);return void 0===n?r:n},$W=Gq((function(e,t){!function(r,n){var o="function",i="undefined",a="object",s="string",c="model",u="name",l="type",d="vendor",f="version",h="architecture",p="console",m="mobile",g="tablet",v="smarttv",y="wearable",b="embedded",w="Amazon",_="Apple",k="ASUS",C="BlackBerry",S="Google",B="Huawei",E="LG",x="Microsoft",I="Motorola",A="Samsung",P="Sharp",T="Sony",R="Xiaomi",M="Zebra",D="Facebook",L="Chromium OS",O="Mac OS",N=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},F=function(e,t){return rg(e)===s&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},j=function(e,t){if(rg(e)===s)return e=e.replace(/^\s\s*/,""),rg(t)===i?e:e.substring(0,500)},U=function(e,t){for(var r,i,s,c,u,l,d=0;d<t.length&&!u;){var f=t[d],h=t[d+1];for(r=i=0;r<f.length&&!u&&f[r];)if(u=f[r++].exec(e))for(s=0;s<h.length;s++)l=u[++i],rg(c=h[s])===a&&c.length>0?2===c.length?rg(c[1])==o?this[c[0]]=c[1].call(this,l):this[c[0]]=c[1]:3===c.length?rg(c[1])!==o||c[1].exec&&c[1].test?this[c[0]]=l?l.replace(c[1],c[2]):n:this[c[0]]=l?c[1].call(this,l,c[2]):n:4===c.length&&(this[c[0]]=l?c[3].call(this,l.replace(c[1],c[2])):n):this[c]=l||n;d+=2}},z=function(e,t){for(var r in t)if(rg(t[r])===a&&t[r].length>0){for(var o=0;o<t[r].length;o++)if(F(t[r][o],e))return"?"===r?n:r}else if(F(t[r],e))return"?"===r?n:r;return e},q={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"},W={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,f],[/opios[\/ ]+([\w\.]+)/i],[f,[u,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[f,[u,"Opera"]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[u,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[u,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[u,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[u,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[u,"Smart Lenovo Browser"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure Browser"],f],[/\bfocus\/([\w\.]+)/i],[f,[u,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[f,[u,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[u,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[u,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[f,[u,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 Browser"]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 Browser"],f],[/samsungbrowser\/([\w\.]+)/i],[f,[u,"Samsung Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],f],[/metasr[\/ ]?([\d\.]+)/i],[f,[u,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[u,f],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,D],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[u,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[u,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,"Chrome WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[u,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[f,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[u,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[u,f],[/(cobalt)\/([\w\.]+)/i],[u,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,V]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[c,[d,A],[l,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[d,A],[l,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[d,_],[l,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[d,_],[l,g]],[/(macintosh);/i],[c,[d,_]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[d,P],[l,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[d,B],[l,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[d,B],[l,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[c,/_/g," "],[d,R],[l,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[d,R],[l,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[d,"OPPO"],[l,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[d,"Vivo"],[l,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[d,"Realme"],[l,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[c,[d,I],[l,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[d,I],[l,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[d,E],[l,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[d,E],[l,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[d,"Lenovo"],[l,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[d,"Nokia"],[l,m]],[/(pixel c)\b/i],[c,[d,S],[l,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[d,S],[l,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[c,[d,T],[l,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[d,T],[l,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[d,"OnePlus"],[l,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[d,w],[l,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[d,w],[l,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,d,[l,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[d,C],[l,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[d,k],[l,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[d,k],[l,m]],[/(nexus 9)/i],[c,[d,"HTC"],[l,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[c,/_/g," "],[l,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[d,"Acer"],[l,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[d,"Meizu"],[l,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[d,"Ulefone"],[l,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,c,[l,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,c,[l,g]],[/(surface duo)/i],[c,[d,x],[l,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[d,"Fairphone"],[l,m]],[/(u304aa)/i],[c,[d,"AT&T"],[l,m]],[/\bsie-(\w*)/i],[c,[d,"Siemens"],[l,m]],[/\b(rct\w+) b/i],[c,[d,"RCA"],[l,g]],[/\b(venue[\d ]{2,7}) b/i],[c,[d,"Dell"],[l,g]],[/\b(q(?:mv|ta)\w+) b/i],[c,[d,"Verizon"],[l,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[d,"Barnes & Noble"],[l,g]],[/\b(tm\d{3}\w+) b/i],[c,[d,"NuVision"],[l,g]],[/\b(k88) b/i],[c,[d,"ZTE"],[l,g]],[/\b(nx\d{3}j) b/i],[c,[d,"ZTE"],[l,m]],[/\b(gen\d{3}) b.+49h/i],[c,[d,"Swiss"],[l,m]],[/\b(zur\d{3}) b/i],[c,[d,"Swiss"],[l,g]],[/\b((zeki)?tb.*\b) b/i],[c,[d,"Zeki"],[l,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],c,[l,g]],[/\b(ns-?\w{0,9}) b/i],[c,[d,"Insignia"],[l,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[d,"NextBook"],[l,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],c,[l,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],c,[l,m]],[/\b(ph-1) /i],[c,[d,"Essential"],[l,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[d,"Envizen"],[l,g]],[/\b(trio[-\w\. ]+) b/i],[c,[d,"MachSpeed"],[l,g]],[/\btu_(1491) b/i],[c,[d,"Rotor"],[l,g]],[/(shield[\w ]+) b/i],[c,[d,"Nvidia"],[l,g]],[/(sprint) (\w+)/i],[d,c,[l,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[d,x],[l,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[d,M],[l,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[d,M],[l,m]],[/smart-tv.+(samsung)/i],[d,[l,v]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[d,A],[l,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,E],[l,v]],[/(apple) ?tv/i],[d,[c,"Apple TV"],[l,v]],[/crkey/i],[[c,"Chromecast"],[d,S],[l,v]],[/droid.+aft(\w+)( bui|\))/i],[c,[d,w],[l,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[d,P],[l,v]],[/(bravia[\w ]+)( bui|\))/i],[c,[d,T],[l,v]],[/(mitv-\w{5}) bui/i],[c,[d,R],[l,v]],[/Hbbtv.*(technisat) (.*);/i],[d,c,[l,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,j],[c,j],[l,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,c,[l,p]],[/droid.+; (shield) bui/i],[c,[d,"Nvidia"],[l,p]],[/(playstation [345portablevi]+)/i],[c,[d,T],[l,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[d,x],[l,p]],[/((pebble))app/i],[d,c,[l,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[d,_],[l,y]],[/droid.+; (glass) \d/i],[c,[d,S],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[c,[d,M],[l,y]],[/(quest( 2| pro)?)/i],[c,[d,D],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,b]],[/(aeobc)\b/i],[c,[d,w],[l,b]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[l,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[l,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[u,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,f],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[u,[f,z,q]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,z,q],[u,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,O],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,f],[/\(bb(10);/i],[f,[u,C]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[u,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[u,"Chromecast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,L],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,f],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,f]]},H=function e(t,c){if(rg(t)===a&&(c=t,t=n),!(this instanceof e))return new e(t,c).getResult();var u=rg(r)!==i&&r.navigator?r.navigator:n,l=t||(u&&u.userAgent?u.userAgent:""),d=u&&u.userAgentData?u.userAgentData:n,f=c?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}(W,c):W,h=u&&u.userAgent==l;return this.getBrowser=function(){var e,t={};return t.name=n,t.version=n,U.call(t,l,f.browser),t.major=rg(e=t.version)===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n,h&&u&&u.brave&&rg(u.brave.isBrave)==o&&(t.name="Brave"),t},this.getCPU=function(){var e={};return e.architecture=n,U.call(e,l,f.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,U.call(e,l,f.device),h&&!e.type&&d&&d.mobile&&(e.type=m),h&&"Macintosh"==e.model&&u&&rg(u.standalone)!==i&&u.maxTouchPoints&&u.maxTouchPoints>2&&(e.model="iPad",e.type=g),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,U.call(e,l,f.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,U.call(e,l,f.os),h&&!e.name&&d&&"Unknown"!=d.platform&&(e.name=d.platform.replace(/chrome os/i,L).replace(/macos/i,O)),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 l},this.setUA=function(e){return l=rg(e)===s&&e.length>500?j(e,500):e,this},this.setUA(l),this};H.VERSION="1.0.37",H.BROWSER=N([u,f,"major"]),H.CPU=N([h]),H.DEVICE=N([c,d,l,p,m,v,g,y,b]),H.ENGINE=H.OS=N([u,f]),e.exports&&(t=e.exports=H),t.UAParser=H;var K=rg(r)!==i&&(r.jQuery||r.Zepto);if(K&&!K.ua){var Q=new H;K.ua=Q.getResult(),K.ua.get=function(){return Q.getUA()},K.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var r in t)K.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":rg(window))?window:Qq)})),ZW=Gq((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r,n=(r=hv)&&"object"==rg(r)&&"default"in r?r.default:r,o=new $W,i=o.getBrowser(),a=o.getCPU(),s=o.getDevice(),c=o.getEngine(),u=o.getOS(),l=o.getUA(),d=function(e){return o.setUA(e)},f=function(e){if(e){var t=new $W(e);return{UA:t,browser:t.getBrowser(),cpu:t.getCPU(),device:t.getDevice(),engine:t.getEngine(),os:t.getOS(),ua:t.getUA(),setUserAgent:function(e){return t.setUA(e)}}}console.error("No userAgent string was provided")},h=Object.freeze({ClientUAInstance:o,browser:i,cpu:a,device:s,engine:c,os:u,ua:l,setUa:d,parseUserAgent:f});function p(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 m(e){return(m="function"==typeof Symbol&&"symbol"==rg(Symbol.iterator)?function(e){return rg(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":rg(e)})(e)}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(){return(v=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 y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(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 C="mobile",S="tablet",B="smarttv",E="console",x="wearable",I="embedded",A=void 0,P={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},T={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},R={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},M=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";return e||t},D=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},L=function(e){var t=D();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},O=function(e,t,r,n){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){g(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{vendor:M(t.vendor),model:M(t.model),os:M(r.name),osVersion:M(r.version),ua:M(n)})},N=function(e){return e.type===C},F=function(e){return e.type===S},V=function(e){var t=e.type;return t===C||t===S},j=function(e){return e.type===B},U=function(e){return e.type===A},z=function(e){return e.type===x},q=function(e){return e.type===E},W=function(e){return e.type===I},H=function(e){var t=e.vendor;return M(t)},K=function(e){var t=e.model;return M(t)},Q=function(e){var t=e.type;return M(t,"browser")},G=function(e){return e.name===T.Android},X=function(e){return e.name===T.Windows},Y=function(e){return e.name===T.MAC_OS},$=function(e){return e.name===T.WindowsPhone},Z=function(e){return e.name===T.IOS},J=function(e){var t=e.version;return M(t)},ee=function(e){var t=e.name;return M(t)},te=function(e){return e.name===P.Chrome},re=function(e){return e.name===P.Firefox},ne=function(e){return e.name===P.Chromium},oe=function(e){return e.name===P.Edge},ie=function(e){return e.name===P.Yandex},ae=function(e){var t=e.name;return t===P.Safari||t===P.MobileSafari},se=function(e){return e.name===P.MobileSafari},ce=function(e){return e.name===P.Opera},ue=function(e){var t=e.name;return t===P.InternetExplorer||t===P.Ie},le=function(e){return e.name===P.MIUI},de=function(e){return e.name===P.SamsungBrowser},fe=function(e){var t=e.version;return M(t)},he=function(e){var t=e.major;return M(t)},pe=function(e){var t=e.name;return M(t)},me=function(e){var t=e.name;return M(t)},ge=function(e){var t=e.version;return M(t)},ve=function(){var e=D(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)},ye=function(e){return"string"==typeof e&&-1!==e.indexOf("Edg/")},be=function(){var e=D();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream},we=function(){return L("iPad")},_e=function(){return L("iPhone")},ke=function(){return L("iPod")},Ce=function(e){return M(e)};function Se(e){var t=e||h,r=t.device,n=t.browser,o=t.os,i=t.engine,a=t.ua;return{isSmartTV:j(r),isConsole:q(r),isWearable:z(r),isEmbedded:W(r),isMobileSafari:se(n)||we(),isChromium:ne(n),isMobile:V(r)||we(),isMobileOnly:N(r),isTablet:F(r)||we(),isBrowser:U(r),isDesktop:U(r),isAndroid:G(o),isWinPhone:$(o),isIOS:Z(o)||we(),isChrome:te(n),isFirefox:re(n),isSafari:ae(n),isOpera:ce(n),isIE:ue(n),osVersion:J(o),osName:ee(o),fullBrowserVersion:fe(n),browserVersion:he(n),browserName:pe(n),mobileVendor:H(r),mobileModel:K(r),engineName:me(i),engineVersion:ge(i),getUA:Ce(a),isEdge:oe(n)||ye(a),isYandex:ie(n),deviceType:Q(r),isIOS13:be(),isIPad13:we(),isIPhone13:_e(),isIPod13:ke(),isElectron:ve(),isEdgeChromium:ye(a),isLegacyEdge:oe(n)&&!ye(a),isWindows:X(o),isMacOs:Y(o),isMIUI:le(n),isSamsungBrowser:de(n)}}var Be=j(s),Ee=q(s),xe=z(s),Ie=W(s),Ae=se(i)||we(),Pe=ne(i),Te=V(s)||we(),Re=N(s),Me=F(s)||we(),De=U(s),Le=U(s),Oe=G(u),Ne=$(u),Fe=Z(u)||we(),Ve=te(i),je=re(i),Ue=ae(i),ze=ce(i),qe=ue(i),We=J(u),He=ee(u),Ke=fe(i),Qe=he(i),Ge=pe(i),Xe=H(s),Ye=K(s),$e=me(c),Ze=ge(c),Je=Ce(l),et=oe(i)||ye(l),tt=ie(i),rt=Q(s),nt=be(),ot=we(),it=_e(),at=ke(),st=ve(),ct=ye(l),ut=oe(i)&&!ye(l),lt=X(u),dt=Y(u),ft=le(i),ht=de(i);function pt(e){var t=e||window.navigator.userAgent;return f(t)}t.AndroidView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Oe?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.BrowserTypes=P,t.BrowserView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return De?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.ConsoleView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Ee?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.CustomView=function(e){var t=e.renderWithFragment,r=e.children,o=(e.viewClassName,e.style,e.condition),i=w(e,["renderWithFragment","children","viewClassName","style","condition"]);return o?t?n.createElement(hv.Fragment,null,r):n.createElement("div",i,r):null},t.IEView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return qe?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.IOSView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Fe?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.MobileOnlyView=function(e){var t=e.renderWithFragment,r=e.children,o=(e.viewClassName,e.style,w(e,["renderWithFragment","children","viewClassName","style"]));return Re?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.MobileView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Te?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.OsTypes=T,t.SmartTVView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Be?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.TabletView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Me?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.WearableView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return xe?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.WinPhoneView=function(e){var t=e.renderWithFragment,r=e.children,o=w(e,["renderWithFragment","children"]);return Ne?t?n.createElement(hv.Fragment,null,r):n.createElement("div",o,r):null},t.browserName=Ge,t.browserVersion=Qe,t.deviceDetect=function(e){var t=e?f(e):h,r=t.device,n=t.browser,o=t.engine,i=t.os,a=t.ua,s=function(e){switch(e){case C:return{isMobile:!0};case S:return{isTablet:!0};case B:return{isSmartTV:!0};case E:return{isConsole:!0};case x:return{isWearable:!0};case A:return{isBrowser:!0};case I:return{isEmbedded:!0};default:return R}}(r.type),c=s.isBrowser,u=s.isMobile,l=s.isTablet,d=s.isSmartTV,p=s.isConsole,m=s.isWearable,g=s.isEmbedded;return c?function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:M(t.major),browserFullVersion:M(t.version),browserName:M(t.name),engineName:M(r.name),engineVersion:M(r.version),osName:M(n.name),osVersion:M(n.version),userAgent:M(o)}}(c,n,o,i,a):d?function(e,t,r,n){return{isSmartTV:e,engineName:M(t.name),engineVersion:M(t.version),osName:M(r.name),osVersion:M(r.version),userAgent:M(n)}}(d,o,i,a):p?function(e,t,r,n){return{isConsole:e,engineName:M(t.name),engineVersion:M(t.version),osName:M(r.name),osVersion:M(r.version),userAgent:M(n)}}(p,o,i,a):u||l?O(s,r,i,a):m?function(e,t,r,n){return{isWearable:e,engineName:M(t.name),engineVersion:M(t.version),osName:M(r.name),osVersion:M(r.version),userAgent:M(n)}}(m,o,i,a):g?function(e,t,r,n,o){return{isEmbedded:e,vendor:M(t.vendor),model:M(t.model),engineName:M(r.name),engineVersion:M(r.version),osName:M(n.name),osVersion:M(n.version),userAgent:M(o)}}(g,r,o,i,a):void 0},t.deviceType=rt,t.engineName=$e,t.engineVersion=Ze,t.fullBrowserVersion=Ke,t.getSelectorsByUserAgent=function(e){if(e&&"string"==typeof e){var t=f(e);return Se({device:t.device,browser:t.browser,os:t.os,engine:t.engine,ua:t.ua})}console.error("No valid user agent string was provided")},t.getUA=Je,t.isAndroid=Oe,t.isBrowser=De,t.isChrome=Ve,t.isChromium=Pe,t.isConsole=Ee,t.isDesktop=Le,t.isEdge=et,t.isEdgeChromium=ct,t.isElectron=st,t.isEmbedded=Ie,t.isFirefox=je,t.isIE=qe,t.isIOS=Fe,t.isIOS13=nt,t.isIPad13=ot,t.isIPhone13=it,t.isIPod13=at,t.isLegacyEdge=ut,t.isMIUI=ft,t.isMacOs=dt,t.isMobile=Te,t.isMobileOnly=Re,t.isMobileSafari=Ae,t.isOpera=ze,t.isSafari=Ue,t.isSamsungBrowser=ht,t.isSmartTV=Be,t.isTablet=Me,t.isWearable=xe,t.isWinPhone=Ne,t.isWindows=lt,t.isYandex=tt,t.mobileModel=Ye,t.mobileVendor=Xe,t.osName=He,t.osVersion=We,t.parseUserAgent=f,t.setUserAgent=function(e){return d(e)},t.useDeviceData=pt,t.useDeviceSelectors=function(e){var t=pt(e||window.navigator.userAgent);return[Se(t),t]},t.useMobileOrientation=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(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)?k(e,t):void 0}}(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.")}()}(hv.useState((function(){var e=window.innerWidth>window.innerHeight?90:0;return{isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"}})),2),t=e[0],r=e[1],n=hv.useCallback((function(){var e=window.innerWidth>window.innerHeight?90:0,n={isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"};t.orientation!==n.orientation&&r(n)}),[t.orientation]);return hv.useEffect((function(){return void 0!==("undefined"==typeof window?"undefined":m(window))&&Te&&(n(),window.addEventListener("load",n,!1),window.addEventListener("resize",n,!1)),function(){window.removeEventListener("resize",n,!1),window.removeEventListener("load",n,!1)}}),[n]),t},t.withOrientationChange=function(e){return function(t){function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=function(e,t){if(t&&("object"==rg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _(e)}(this,y(r).call(this,e))).isEventListenerAdded=!1,t.handleOrientationChange=t.handleOrientationChange.bind(_(t)),t.onOrientationChange=t.onOrientationChange.bind(_(t)),t.onPageLoad=t.onPageLoad.bind(_(t)),t.state={isLandscape:!1,isPortrait:!1},t}var o;return function(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&&b(e,t)}(r,t),(o=[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var e=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:0===e,isLandscape:90===e})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){void 0!==("undefined"==typeof window?"undefined":m(window))&&Te&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return n.createElement(e,v({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,o),r}(n.Component)}})),JW=function(){try{var e=CW(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),eH=function(e,t,r){"__proto__"==t&&JW?JW(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},tH=Object.prototype.hasOwnProperty,rH=function(e,t,r){var n=e[t];tH.call(e,t)&&AW(n,r)&&(void 0!==r||t in e)||eH(e,t,r)},nH=function(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var s=t[i],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?eH(r,s,c):rH(r,s,c)}return r},oH=function(e){return e},iH=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)},aH=Math.max,sH=function(e){return function(){return e}},cH=JW?function(e,t){return JW(e,"toString",{configurable:!0,enumerable:!1,value:sH(t),writable:!0})}:oH,uH=Date.now,lH=function(e){var t=0,r=0;return function(){var n=uH(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(cH),dH=function(e,t){return lH(function(e,t,r){return t=aH(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=aH(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),iH(e,this,s)}}(e,t,oH),e+"")},fH=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},hH=function(e){return null!=e&&fH(e.length)&&!fW(e)},pH=/^(?:0|[1-9]\d*)$/,mH=function(e,t){var r=rg(e);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&pH.test(e))&&e>-1&&e%1==0&&e<t},gH=function(e,t,r){if(!dW(r))return!1;var n=rg(t);return!!("number"==n?hH(r)&&mH(t,r.length):"string"==n&&t in r)&&AW(r[t],e)},vH=function(e){return dH((function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&gH(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t}))},yH=function(e){return sW(e)&&"[object Arguments]"==aW(e)},bH=Object.prototype,wH=bH.hasOwnProperty,_H=bH.propertyIsEnumerable,kH=yH(function(){return arguments}())?yH:function(e){return sW(e)&&wH.call(e,"callee")&&!_H.call(e,"callee")},CH=function(){return!1},SH=Gq((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?Zq.Buffer:void 0,i=(o?o.isBuffer:void 0)||CH;e.exports=i})),BH={};BH["[object Float32Array]"]=BH["[object Float64Array]"]=BH["[object Int8Array]"]=BH["[object Int16Array]"]=BH["[object Int32Array]"]=BH["[object Uint8Array]"]=BH["[object Uint8ClampedArray]"]=BH["[object Uint16Array]"]=BH["[object Uint32Array]"]=!0,BH["[object Arguments]"]=BH["[object Array]"]=BH["[object ArrayBuffer]"]=BH["[object Boolean]"]=BH["[object DataView]"]=BH["[object Date]"]=BH["[object Error]"]=BH["[object Function]"]=BH["[object Map]"]=BH["[object Number]"]=BH["[object Object]"]=BH["[object RegExp]"]=BH["[object Set]"]=BH["[object String]"]=BH["[object WeakMap]"]=!1;var EH=Gq((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&Yq.process,i=function(){try{return n&&n.require&&n.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i})),xH=EH&&EH.isTypedArray,IH=xH?function(e){return function(t){return e(t)}}(xH):function(e){return sW(e)&&fH(e.length)&&!!BH[aW(e)]},AH=Object.prototype.hasOwnProperty,PH=function(e,t){var r=Kq(e),n=!r&&kH(e),o=!r&&!n&&SH(e),i=!r&&!n&&!o&&IH(e),a=r||n||o||i,s=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=s.length;for(var u in e)!t&&!AH.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||mH(u,c))||s.push(u);return s},TH=Object.prototype,RH=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||TH)},MH=Object.prototype.hasOwnProperty,DH=function(e){if(!dW(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=RH(e),r=[];for(var n in e)("constructor"!=n||!t&&MH.call(e,n))&&r.push(n);return r},LH=function(e){return hH(e)?PH(e,!0):DH(e)},OH=vH((function(e,t,r,n){nH(t,LH(t),e,n)})),NH=function(e,t){return function(r){return e(t(r))}},FH=NH(Object.getPrototypeOf,Object),VH=Function.prototype,jH=Object.prototype,UH=VH.toString,zH=jH.hasOwnProperty,qH=UH.call(Object),WH=function(e){if(!sW(e)||"[object Object]"!=aW(e))return!1;var t=FH(e);if(null===t)return!0;var r=zH.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&UH.call(r)==qH},HH=function(e){if(!sW(e))return!1;var t=aW(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!WH(e)},KH=dH((function(e,t){try{return iH(e,void 0,t)}catch(e){return HH(e)?e:new Error(e)}})),QH=Object.prototype,GH=QH.hasOwnProperty,XH=function(e,t,r,n){return void 0===e||AW(e,QH[r])&&!GH.call(n,r)?t:e},YH={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$H=function(e){return"\\"+YH[e]},ZH=NH(Object.keys,Object),JH=Object.prototype.hasOwnProperty,eK=function(e){return hH(e)?PH(e):function(e){if(!RH(e))return ZH(e);var t=[];for(var r in Object(e))JH.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)},tK=/<%=([\s\S]+?)%>/g,rK=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),nK=/[&<>"']/g,oK=RegExp(nK.source),iK={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:tK,variable:"",imports:{_:{escape:function(e){return(e=QW(e))&&oK.test(e)?e.replace(nK,rK):e}}}},aK=/\b__p \+= '';/g,sK=/\b(__p \+=) '' \+/g,cK=/(__e\(.*?\)|\b__t\)) \+\n'';/g,uK=/[()=,{}\[\]\/\s]/,lK=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dK=/($^)/,fK=/['\n\r\u2028\u2029\\]/g,hK=Object.prototype.hasOwnProperty,pK=function(e,t,r){var n=iK.imports._.templateSettings||iK;r&&gH(e,t,r)&&(t=void 0),e=QW(e),t=OH({},t,n,XH);var o,i,a=OH({},t.imports,n.imports,XH),s=eK(a),c=function(e,t){return qW(t,(function(t){return e[t]}))}(a,s),u=0,l=t.interpolate||dK,d="__p += '",f=RegExp((t.escape||dK).source+"|"+l.source+"|"+(l===tK?lK:dK).source+"|"+(t.evaluate||dK).source+"|$","g"),h=hK.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,a,s,c){return n||(n=a),d+=e.slice(u,c).replace(fK,$H),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var p=hK.call(t,"variable")&&t.variable;if(p){if(uK.test(p))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(aK,""):d).replace(sK,"$1").replace(cK,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=KH((function(){return Function(s,h+"return "+d).apply(void 0,c)}));if(m.source=d,HH(m))throw m;return m},mK=vw.table.withConfig({displayName:"PlacementArea__Table",componentId:"sc-111697v-0"})(["width:100%;height:100%;td{text-align:center;vertical-align:middle;padding:0;border:0;}border-spacing:0;table-layout:auto;border-collapse:collapse;"]),gK=vw.div.withConfig({displayName:"PlacementArea__ChildrenWrapper",componentId:"sc-111697v-1"})(["position:relative;"]),vK=Array.from(Array(3).keys()),yK=Array.from(Array(3).keys());function bK(e){var t=e.children,r=e.x,n=e.y,o=e.width,i=e.height,a=e.className,s=e.surroundStyle;return hv.createElement(mK,{className:a},hv.createElement("tbody",null,vK.map((function(e,a){return hv.createElement("tr",{key:e,style:{height:0===a?n:"auto"},"data-testid":"row"},yK.map((function(e,n){var c=1===a&&1===n,u="auto";return c?u=o:0===n&&(u=r),hv.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:Mq({width:u,height:c?i:"auto"},c?{}:s)},c?hv.createElement(gK,{style:{width:u,height:i}},t):null)})))}))))}bK.propTypes={children:Fv.node,x:Fv.string,y:Fv.string,width:Fv.string,height:Fv.string,className:Fv.string,surroundStyle:Fv.object},bK.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var wK=/^\s+|\s+$/g,_K=/^[-+]0x[0-9a-f]+$/i,kK=/^0b[01]+$/i,CK=/^0o[0-7]+$/i,SK=parseInt,BK="object"==rg(Qq)&&Qq&&Qq.Object===Object&&Qq,EK="object"==("undefined"==typeof self?"undefined":rg(self))&&self&&self.Object===Object&&self,xK=BK||EK||Function("return this")(),IK=Object.prototype.toString,AK=Math.max,PK=Math.min,TK=function(){return xK.Date.now()};function RK(e){var t=rg(e);return!!e&&("object"==t||"function"==t)}function MK(e){if("number"==typeof e)return e;if(function(e){return"symbol"==rg(e)||function(e){return!!e&&"object"==rg(e)}(e)&&"[object Symbol]"==IK.call(e)}(e))return NaN;if(RK(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=RK(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(wK,"");var r=kK.test(e);return r||CK.test(e)?SK(e.slice(2),r?2:8):_K.test(e)?NaN:+e}var DK=function(e,t,r){var n,o,i,a,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=n,i=o;return n=o=void 0,u=t,a=e.apply(i,r)}function p(e){return u=e,s=setTimeout(g,t),l?h(e):a}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=i}function g(){var e=TK();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?PK(r,i-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?h(e):(n=o=void 0,a)}function y(){var e=TK(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return p(c);if(d)return s=setTimeout(g,t),h(c)}return void 0===s&&(s=setTimeout(g,t)),a}return t=MK(t)||0,RK(r)&&(l=!!r.leading,i=(d="maxWait"in r)?AK(MK(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?a:v(TK())},y},LK="function"==typeof Symbol&&Symbol.for,OK=LK?Symbol.for("react.element"):60103,NK=LK?Symbol.for("react.portal"):60106,FK=LK?Symbol.for("react.fragment"):60107,VK=LK?Symbol.for("react.strict_mode"):60108,jK=LK?Symbol.for("react.profiler"):60114,UK=LK?Symbol.for("react.provider"):60109,zK=LK?Symbol.for("react.context"):60110,qK=LK?Symbol.for("react.async_mode"):60111,WK=LK?Symbol.for("react.concurrent_mode"):60111,HK=LK?Symbol.for("react.forward_ref"):60112,KK=LK?Symbol.for("react.suspense"):60113,QK=LK?Symbol.for("react.suspense_list"):60120,GK=LK?Symbol.for("react.memo"):60115,XK=LK?Symbol.for("react.lazy"):60116,YK=LK?Symbol.for("react.block"):60121,$K=LK?Symbol.for("react.fundamental"):60117,ZK=LK?Symbol.for("react.responder"):60118,JK=LK?Symbol.for("react.scope"):60119;
53
53
  /** @license React v16.13.1
54
54
  * react-is.production.min.js
55
55
  *