You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
431 lines
1.3 MiB
431 lines
1.3 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[273,5,7,10,13],{"+GGh":function(ct,$e){ct.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAA4CAYAAAAB3jHPAAAAAXNSR0IArs4c6QAAIABJREFUeF7VXQm4VVXZfvc+5yKzMqiAgpggqGihoBI4Zz+iQA7VX2Fa+GeFmjnmjAZmDlnmDGaDY5KzJmmWAiKIoCihmAN/ySTDvRcF4e691v+s4VvrW2vvcwFB8r/lcy/n7LP32nu9+/3e7/2+tU+CLfwjpaw0NmJfIcRBSYK+Uoq+QNIdEu0AtJMSLaSUABJzZPWn+iUlEiRQb6l37MvsfbOdfs+9qf5htnav6ffsvoP9+mPSsej4+iM0Jr5vPR4aIF0o9po6ziccPx1GnbWQZvzqNfef/rd9j7+uXhPmIqn36XN6H+rf+n/+dTV+2o/6kNq/39YfT72m3le7Vj/Cnq76tx4TGx9tS2Olz5RByc/EZgBNSlm3enU+TAiMkhJHSshtHULchKkrok5WnUY8SQxwNNf2hAmMRWD5ARMG9H4tWAxQ/XHoPQ5kt4cAVBZrHgF2Mw/kePwBYC2ozUDo+OoTFosMr24y7eTpCbY3SzzBZvLN9TMAor/55DMAWYAawHkwanAkBkgejAROvy8POPOe+r/+DL8R2N+14LNZAJNStmpoEGcikWdLKTvpiTbjt0zkJ5z4J5hgDjhiEY01zwyOXAL2spNtZ8GAx5wtAdgxEk14xJh6v3qGOdvFLGlhwW4SN/4YyHRw4lkGWn8DEPsyINkhqG2ILYhBPBNZkEjzOQNcYiILngCYFoAJ387MhQZm8Lq5ERzg1DW078cMZdjPMxyBrTlu+kQAU2GwYXV+shS4HJA7xUwQhjB+J9vwVRIiOZB8fCSgxmGxVriii2+ugmeamD1jINn9EbtE4GiWcdm5hGHa7LOMMQtA4myjgMNkgLmHolDpmMO8Xgh9jOk8Y9kwrMFTZCweBl1YJEC60OrBpc8tlislSNtkgDU0ZEcJyGshsSftj3RTyDY8DHqQ0WT5z/gwYmck0Gc018EkW6qOgU0hyQQkAiVjKQ6gCBh0IYJwG9wpZpyffPwsvBCI7CxpQLEJKw2DFmQObIEmsmAmIKoIYNkmABPTUoEOY4Ar01c0Bxx4zekujrONBpiUMmlYnY2TAhcWgUoXn7NVOCFmxi2DWZo3UcVPWnPC338+DIMUEnniwIFg1bANoYkN3z6hKN4kHvDhfuz4Kf5bgV82fv45SlzcHR8JZhNmiInY30onCQpnkoXPKEzaa8kBw/WT0Vs8iSiGT7eNvTEJSGXsSMB101nCWpsMMCll2/rG/C5IObJ0fyWhhYtcg2LOVDrQM3CVZYf2rmThylxLC1wmjHkmZ47EjhUzldWHPAz7z7OzY+cUjJ8BrBD+SliRk6AGkxXLjmFi9rLb+OyQ2I2HNgMYCp8UqoIkwF7dECTm/Hxm6PUY6asCW0Xj4aF0A9iys76BrVatlT2xLnsUwN5lmxb1lmUp+0aYzTGms0K+jHn03UFnGv12IcwCLdZrBl5G+xj28rosAB7p9xjAdFk2afz+BgrDM7G2DY8MXJQJhnrHgsnpJBLVnuGcfrPMRKHKC/DYiiDbwtsVOiu0VgQPobXA6DJIpsk2BlwUr2puq8CVrM9nSCl3qLmRmyDLGnzCYpvATToPjc2xBhf3BJaIDaOEgbJJCrfcQii7GYpa0CcWnnUjVqwh3mNPjN8onCE4CxBTkYfFAVfbmvDivuBpSRNODdN7z8sDisS5YS8OUGLF5kAXTO9GoKymBtNhsSF7oRZz6X2T2CaTx56YeZ1pKworLMTpKbPbkS2hJ5v8VzKC7ElocOj3ufnJw6yJmep9PTRrQXiNZGmxhgXiVLb+eKI/7w1fm4UGx4+Z0t805vj+6rsQZl8KssiCkekZiMJZoKMYu3EDlYdH87nQYCV/zYGWrAhrW5BN4TPSyGB1IXkjUMU2KQWYEvT1jflDNTVXs5NOe+ci36KxTBgrUcKse5/FhWGSxDyZtT5jbJ7ROIvEZm1pxhgxctGi2FBiYs6fH4tsB+e0Ry49N1hdNunMVHMdvV0RG6TceCU7g7JIprGYliL7j0BIQA6YtcTzcopjEzBWCrD6xqbx5dmiDR8MEH4CS7LGguC2zGbvHjdOJ6iL2R0HErGYByTZEVEm6mKhf59nk5p7GNebzb0+5KG0zEujffnxxzovZK8yc5JPJoU0o4GYCLcOPL3uhT1tw4BEmShljZqwrQPvslFrtFpfi8Acu/Y+bJvLxLXZJmDL3WjBZ7TPJeWTNXfEtHPsTbl7l4Q1p48S9gpSeDvhzbEM2RpcvLvXLEj0GALw2AHTCTkwc13FP8MSg3j8gfYKb4aAee0YYkbwQtyK94KFELIRTa4BAnPimScWbxOzkQuNTpOZC0EVgbJaowdeWBraVHARk7MbUVbqG7O53EQNdhqAi9XsotQ9ZCYSVZy9aEf+tTKroCDACSuMccxJGEFrwBXXO0krkX/WXHUgMocj0BY8L+bjheMPC85xCOSMRTmKYTnmWZVlnAQ0MkZZ6ORsZBiIFb6t/OSuvjkWD7dec3HwEdkHCdImIC0IkfWN2Wgp5MTm2ctncz5k+QzS1QV5GHJWga9TEtOQsHf74gdnnRLhfhlAuVHLAeHxFjAakVLIlLwo7uuFjg0dI0ch3NU+mS3C2Ysm1o4lAFHg3PtSkGEXA7ZiVhdZDsyOCQvhvjLw8cdAUxPQqq1zbJgPxrsmmi8fbQKmgk0dwFThur4hfyuoLbJNiU3M1Na2JEJR7N1773f5SVKvzZ4JTLxVYP9BCU4+JQ3EcZ4DaWozx6A2wZnGhzTuef36VwJ990hw8CEpttnGZHUkHeMwzNlHZ6n8WPqE7Ws1XXwm6tVwBCv92EvAOyeK7jrP2JjnRX6gdfXfe0eiW/cElbpY+JtZ8cxjwDJ3Zo6/PJCj5+4pRo6uOFarxV5e/IcZ5CcFVxAi6+vzCyTElbV25sNV5E3RHattCSILJqKd5lHuc4L6lUCHjl4XvThN4pZfCQwakuDU01J3+OeelXj8YYHvn57ic7txUe6TCdrYsJ/f57zXJa67Ose22wJXX1tFtc68ffcfBJYuZQItYMvimQ/6YooD91dn1Uy9lJ2/895cOch3TVAI4zqMd0sEhmuUQartXpmV4+F7BXbomuCEkyrYrpPVZA7AFmT29BQLrl8H3D6uSf/+zgVVtN2WWyD+8/rYrMuCj/WThka6mprBVD9XQ2O+WLXc1Ear94LcNoFg9njVbEU6yTfQ4De3CsyaIXHWT1Ls1tuEgBkveIB9/zR1l5nP3jlBQIGsWgW+/s0UXxqaGn1FfV52O8dLOpyanxt+meOV2RLHfzXFUUcrTjXvXTE2x8L3agCs5MSPO66CoUOpUGR1novpTMtZkCmCM5PlGcx7XrU6Ivj2UT+XJWc14iWLgT/+tgkrlgHbtEpw/EkV9FTXEAnynIU3GzYpHD/3eIY5UwUOPLKK/Q5PSzspFBgTe2/rsLwRfV4by2r66jU2ZiNzIR/eMHsxK8Ig00x4oWzDpJ29O/5wh8QzT0m0aw9cNLaCrjubC/viCxK3EoONSakMrn9PnyLxuzsE1q0DBgxM8N3vVdCylTRmKpm0etD+3x8sBy44J8c2LYFrf1FFq1YeCMuWAuvXS+QiwRVjM7RsBfzkJ5WwAVICkyYJvD5PYsyYKr7w+Zi9yOTyuotCriNS3hHq2IwVsq0Ad2Ak8zSoL/pEgfwqdR0euz/DvFcEKpUEI0dV0LlLgtt/3rSx811zu+9c3gKpZnrfkLjZO6W+mPr6bJKEPL5sh1x7ufTfkYANipY9uM4iBssyibvvlPjrZIk2bYELxqbYuTtxCjCdA0yFSCI/e4w3/iFxzZUCQgA77Zzg7PMr2K6DVYLRtmr8990t8JfJAkcNS3HC19QdyxILu08len9waobWrYEbfl01p22L7+r3pZc2YfFi4Oc/r0OH7QygQ1amYFg0g4m9uJ5Ruy+tOQadqWUMZ/UYszOUfpv8cIaZzwv0H1TBoMMr+NPvsmDqPl4j0LASqNsmQYfO5gY0p+5lBP2LPjji1CqS6pbTXrTfRDUP1jfkK6DanEsR5jYNCshuqK6rwTKJupK2XLN8KXDjLwTe+adEq9bA+Zek2NXqKTITlAa79QavwQjQWZbg6acEHnlQ4OO1QMuWgMqIOnUCzjqviq7dCOWeYVYuBy48P0OaAFddW0X79uaaNjYA7ZX+sILiww+BM8/I9Pu/uL7KevwTrFsnccbpBnzX/6LOnXPRn2OTxa6BBxJ1P1C4jOqHzfZzmWvp22xIL3lWe/N1gV57mRAZ1w4fnJjjvQUCXzqhij0HmthH2k/9XrUMaL+9Gb953bZFsxthS7CXPouGBrm/kNmMmuxVs72lhotuNcCcl4DbbxRY8xHQc9cEY85KsMOO9BnPANMJYIONyFeJwMsvCTxwr8DSJUDrNsCxx6cYcmiCCTcJzH5Zok0b4MxzKtitV9gtcdstEjNfFFp7DTvasNf6JuCi8zNUqsAll1XRpjXwwVLgggsydOoIXHV1NWjvefddiSuvzLDXXgl+dEbFsleYRIRt0+bKFboanI9lgKKth6Bdx/hUResiBOIG+7ksKxFI5r4o8PSfMnTdJcVXf1gpFL2nPJLjtek5Dv9aFb36m2ukW4i0EPMMtsUAtqoxPwtCXFdrhy57DPqvLOE6wW0/zcT93FckrhsvcMR/JfjGSSmqFX8El5lIYHUjsHiR2d+CN4Hn/irwwTJDgocenuLYryZo184AM88kJtwq8cocgXPOUwCzrAngnXckxo3N0a0bMPanVVTs8R55SODRRwQOOTTFid9Wd3OChQsFfnp5js6dgauuqvPGv5T4+98E7r5HYMTICoZrkIZMpXFC5ElJTuBphWGmEBpLWnH04gvbb28uoTdJqUwzf67Ex+sE9hlQYauCQkO3foXE767PkGXAN8+oolOXotm6cIHEk3dm+vqM+EEVnbqR4eqTjS0FLj079fXZBAl5SmGnPENkHQzerih6YZThmUmQWPR+gm7Use/2Z/UTEqxfJ6E01rTnJWbNlPrCpBXgC/0TjDw+QY8elCz45EJ1eS5ZBHTdyQv7rCnB1VflePufEudfWMHuuydYtRJYvFjixl/l2qYY/7Mq2lqzccEbEtdck+tTvu46G0otcCZOFJg5U+DHP65gj74KkBZgZLba307Ys1BHbEBi3/+u3c8VZ5yG6EI9tmwJcPt1TRA5cOBhKQ4ZVkGSWmDYysXatQkeuK0Jy96XOPiYKvofZBKm4vIziVnPSMz6a4b2HROMHFOHOpsIkWzZogBb1dD0PCQO4jstgEi/WezHCgrBtAPWqkNAcwFRAh98AMydLfHqHAMulRmpn+23Bw4+PMVBhyTav3KekvXXyNl243QTDvzxXoHJTwnU1UGz0vLlxr2mnxNPSnHIIRVHPXPmADfdaITxySenGDzY0+u55zahvj68xHv3S3D6aUYBE58Ri2kQsUzxk/ZzqSOargvWz6VeU4VqAHNmSvz5gUyHsr5fqGD4N1IkFWOdrFkDPHB7hmXvC+y8W4pDh6f46KMEa1ZLfPSRxNrV0FJlzYf27w8lPqw3d3zvfSs46ARlD3F/c8tBTDHYuxKyZ7jLks4Cd3Fru+jETQSstR8n+N93BN57N8G7b0u8+0+p/Rz+Q8Dacy8TFn1HKIlQ3ymxQ5cEbVoz595OyLSpEr+ZIDRTbd8Z2H6HRIdepacUm533EwUuAkeCaVNz3Hmnubf33TfBD36gwCOx+kPglpsNs6mjf7haYslS4KAhKUZ9S4Gw2O1RKzvknRHBmsLSfi6+ZC0U3q7TARIL35KY9Nsc6z6W2OMLFQz7ptKIEk/cIzB/jhn3hn6q1QSt2gOt2yVYuViiab3El0+qQ7fdSxtrNrS7Db6f1DdkywODlfRFjGj9epmwt6+zkKrM04fuFxpMTq9scCgb3mDMGRXsNzAU9mpM69cbLdexoxmhuqMvvTjTgBl7eRVduviSlQLJI48IPPaoAZjKTn/5yzpUnNHoNdefHswxebLA/5xSwYD9Urfec9EiiVWruGaxWicyKJ0k5fVFtwo9XOhB4Ym6H7brkKLjjlxjmb///a7E/ROatGYbdUYVHXdM8MYrArOnCrRsDbRsnWCbVkDLVgnq1L9bAa3aJWjd1gCrrqUddwLMmy4w/dEMHbumGKEY+lP4UQBbJ6VsYVjH1+tI+SpGUXcR4TsUuEXAKc/og6US554utNnZ83MJeu4KvDpbaTLg4MMSdIzqBaTdvAbg3keC2S9J/OtfEgpg+w6wtVAFdwZqHcFVF2qSYMJtAi9OFzj+hBTDhhlRzMd/469zvPqqxF79Eqiy0tlnVdB3j9R9njyvSy/P9E1y3TVVtGvrFxHfdY/AlKlRy+0WnpyBB6UY+pWKaWtmq4vUtVr4tmHY7ruFpR/fPm2SBgrfngVtScjaE7kAZjyeY++DK2hdblJt9lkFADMCI2IIx2glYHJL9dUJm3yXPq7u8A7beQa7ZrzAvLkSF12eoncfqi0aozYAbVxQllIDZvpUidMswKg2aAxQVwDVF2P2LImbbszRp0+iM01P/H78552baQa6bGwVP78qw/4DU4w60WSYJN6VVrzo4iZ03znBxRcpK8P8qOM986zAa6+bvN7cFPY9/Yv3k7FwEJmdwWIXtg/ypvrunWK/wanzwniPPVkXpsBtxrRymcQDt2bYvluCEaOreo8v/DnHgjkC+x1RQd+BRvS/+GSOt+cKDD62ip13N9ePj3KzERXtoBAigwkLwMXqgC5196+5i8ysCr7g4moLsG+PTtG9h5kIqjsWWnHouDYsP/awwGuvSYw5PcV+6kIpRnLg8iFNsdxV43Mt9pXn1bGDme81axIsWSSw6+cSrF4NnPXjTJeQbrihirvuEpgyReCSS6rYeSefGT/9jMQDk3J8+cgUJxxfCYDsskVbtyONpc6KazLvjfHuB7ZSyN5csS3BM0u3Asgu4FDgWrNGQmXOrduZG5tC56RbmtCjT4rh31F6McHfHszwj5kCXzymin6Djef1/IM53pyV44hRdeixBzn8WxpWfn9O5BOLhI71hjPHwiJXfZuzAds7hBhsc07ltNMr2Hcgay5kx1qxAvjZuAwNjcD3Tq3oNp8Fb0osWCDxr/+V6N4jwSWXVDDvdaW5MsNw51S1JzZuXI7evROce46ZGNV9cMllTZrlzj27il7K0GXHKvO2KNvTIHOMFrvxcT8XsXf0YJPoCTnxQtrpzwpMeyrHoSMr2GeQ6fZ463WBJ36foU//Cr70dZMV/v2hHP+YkeOLR1fRb4hiQ2AKA1j3PT4dYc/nONE2hTA2hdZCwaod2pRljiT2g85Rq93MDhzAOGiJwYaNSLBjl7AnngDpLIAw5mDKc1J7XApg/ZUGi9hrxXJg7KWZFvfKR1N+Ef0ooO3SM8HAAQmO/HKKhx8SeOIJgWOOSTFihOo/S3DDrzPNkKNHpzhg/woefSTH408K7LVngjNON+GRziXomeIemLMqavRz0fMiyEh13ai+wTDsjQ+7LHg2+ZtrMh0S/3tMFV12Mcw07yWBZyZl2GdwBUOGW4A9mGH+TIFBCmCDTVlJMdiCWTkO/1Ydeuy5FQBGRqtuyHOEZYvYpCeoEMy6Fny5mrSJhUcU0GliuAbr1dtoNfNsL/KRjAXgmgapaUHCajChAaYZjOqd9lgKUKp+uHYN0KED0LVbgu7dE/Tpk2L33iaj0vU6qbonMqxcAVx6WVXrKwVu1YEx9rImXS8980dV/OxnGbIcuOTiKrp19ezlRbMntNIFtAxspk5IPfjq9Cxb6UN7DRSwFFuU4XvmDfstWihx941N2LZTgu+eb6oQ6rxmPJPjxadzHKDaco4weksx2PwZuQbYXipEwjDYVgWYKhXJ3JSKaLUNFYWJ1eg9/7p10Ws8VyKwJiwIVEeEEvnDj03QRZUwainLEoD+/VnDYGMUwAaQkPYspfa1eBGw3XYJWrfyz2HgzKPObd48geuvz7Wpe+V4I4TJLH7iSWVf5FqbrV3LvC+nN2t1RNTo5yqUj4pdqAawvijuRTurUbo0wjj3f5mUYe4MgUFHVnHAkYa9VEh+7LcZ3psvcNSoOvTsZ/b53EMC82dagA0x2075U44FL29FBmtokAOFyGbWzOSsmekqoa50Qv1QNEmeySiEEQ+qjxDANleD9R/AFnFYMAa6MYizvoapQufttwm89JLA0KEpjj9OCXdCc4KsCTj/giadBLRoAYy/ok5XFPQWcTko6ufiRqrXX56hqF/eACju8zI3DPlfHnSG4DWALMjVGG++okkbrd85vwXadzTsqEA68YomrP1I4qQL69C6vQHj84rBZuY4kDHY1BKAvfOqQPe+Keq22ZzZKf+sadepV+062NZdcNuVSXos6MGnh4840zUU9Jz1uDDWIfI1iVEnp9jJPVGMheIAyH7i1ZiefFxqv0plkfsOMD1j7of9zW+SNWuhi+Ivz5JQvf2jR1dw7rmZnrBxP62ic2ff2aFC7B/uzjFtmve2hg1VGs3bHJ+sn6u4PM0/ycYCK3hWlwFfuIDDP2Fn/hyBJ+7J0XWXBF8fY8KjGteSf0k8cGMT2nVIMEqFTctqCmBvWIDt+UUTIqc+mOOtiMHuGdeENtsmGHn6ljdb9VVetSqbJKVqOCxmjWYiPWsQaMIuA28VeGHPS0qewS66vIJevcNMs/iZUPdMVD7YNGFDJBW5aWTmLv9oDfDO2yaUqv/eessUz9VP//4JWrVO8MI0gSFDUpz0bWKvRPeY3XJrhvnzDVIP2D/FrJeFBuU++yQYfXJVG8Y8lHldZLDOWYtbEw4oUYcE1RvjEBn0dkXspbZV9caFbwkcflwV/Q4w2aN6/cHbm/D+2xL9D67ggKMUkMz1e84C7ABiMFkOsN9f1oQOOyYY/sNPCWCNjXJk1pQ9bNIlW4e0K2nK2qFDH8p6izZJ0AxGCYP2Is2V0iHyNYljv5qiqyrdEHlRbhCHO3uB1WZ/fUZqy2HMaUqDGf1mkgQDrl9en+P110LxppoJBwxUWWGKxkaJm27KdYY5flwdOnU0PtqcVyT+eH+G5Sug21e+fWIFgw5MMWeOxO0TMw2yLl2BH55ah07bWwnger8+nX4udRTnyLOFGI31EhOubEKaJjjl4ipatjFh8I3ZAk/fn+ny0LfOa4EWrXxv2vMPZXhjpoACGDHYNMtgh32rDrvsmWDdGuDe8evRZdcUQ0/5lACmFn3U14vFUghbxGG990zkugyP5rKGLcFDo94ElsEiEGxqxCeAOVvDAu3663LdD6ay0969EuzeJ0HPngkqqTJWJS4bm+mu1mOOTjFyZEUXsO+7L8O8eeZEVPfq90+tog8r+KpS0sQ7Mt2wqN4fPbqqvTPz/FKWGZKYL31aNO9qZY2Etv+LTFIyVkOtZq4OgW3GswJT/5yhV78UR59oEpS35wk8eXcOmUsMGV5FPxsGKbOc8rAJkRxgL0/O8drzObr1StFn/wreXyB0VtmrfwVDTmBNe5s6OTW2d0bIypX5BVKIK023M1voYAEWG6qOgOxTdIwQprwsbspLcM2VuWawI45M0Hn7Ev8lzh6ZTTFjusTChYbB+u9HIdtXApQwb6d6vVw53ofnV+ZI3Hxzjt12U0ZqVXcfzJgpcMcdJrANHpziuK9U7OfD8f/7fYkJd2RYsgQ44MAUJ46qmNKMlQ2+pdmGSnsOcT8XD33uORO1njzI2phJ/Kvfj92VYcGrQoNrt35GT02+J8eCV3N8fnAFg44xK7K4868A9ubMHPtbBlPDXrlI4tGb4kUiCQ77ZhW77LXlfTG3R7XwdtVK8ZaUwkpwq7vIWWSt0y5rc2miha8NWR7M5FkB9/3eaKOTvptg5x683GP9LzIzLVBd246QmPyUxD/mSQwfkWqWotDofTsDOvO6TxDMOCXmzJbo0TM1pSMdw4F778tx4IEpdt2FXdRo/GpPaz8G/vxUjqFDK6hrYT07FiZj1vH9XEa3mUK1GV9BvEf99CTa4x570lrvL5TYYafEmMkSaFoPvPqCQP9DDeA8E5rTbFgBfNgo0bZjgjZqfYL9Wb0K+PebAmtXS70EbsddEnTuvuXBZWfFH7h+RTZaSOhHBzgRTwxmc/W4yZBCIKXzZm8+WXBR1Chat0ranA5fEkYNWxwoJMRKQOXCtMOM3n+4pM1/njokfKXCH8fUQml8Roe6fi57ecqzSPZYb9ZSboDCDVZfMuJZZCDqo+dMBDqMWqhtskC2hTuOe9aXtTZKwOZneev+FcBWWRYrV9qHn9jnQjhmYCHLWWGW3RyTxGGO2n/c62xVAVuiX9YVYUDuGcddFm6hUMrGqMwbuKwxkbGift+inh5SFzBhwfOyXhTdEDUWajhd5sbNPS/vVxkLwYTigP3ouPEjxtli3rBx0fpjKimzp+oYMDJ5ty6kwqMVeLFhpTwqyzP7+CbrFdk+Kzc5rAmGgMDNTj/J1oTVpR2f9fnISvaHueClhXOdlfLFtvHlKvkcH4Dabzz+kqcc8vHHK5u5LcF73A3pUenHHMc8ltI38fgwGQr+sjComSnQZlG/l40spvvCh2ueJBjg+vf+k+AqhEgazMrl+XgppX5cOQ8tpH0cqAg0FF6C8GjeNKAku4Jub2aF8IyUmbcOhO7zHqD+ooWh2JxQWIaqOX5b5iKX3mWmLLxwRgjARNvYjLK8D58/z4u5+oy9eGnIEGsZG1Hpi/YXeW/sixsC0PEI8B9EWamyU4/QXLU8f0hIOdL3yDNwBOEy7KDgIKTzIt1m9JrJ/uLqALceyA7heWFxvwZc5qYPWYyySTqeC7cUGtkXbzlTzQK9Occ+YK/gKc/hMjNiFJrwWODHXRMOaPaGdmslLRiL4p+Vm2gby1qfJfaqyWCWudqu+kC8ICH3DrQQN0i9nAkeemuA5QviBjyR4LbvF/SQswH8Hy6RKGkncgAjPeYcXN42ZCHnkGelm2E6AAAD+0lEQVRGSOzKH1qiXo+deQ0Yp3N4qAsfM24AxdYiukm3mivQXoZpm9VjkZYKWoVKmJYCCQH8P0hc7tDN5qarVsme+fp8RgLsEJSG2OTwk3AMRYhk4t7oK+Ik3zlqxBlNeLhqh3bD9ZEHL3XTel/KG8H2wPYXz3w5u3mmtJqFgGSf7+U9L/7lBfRlUdTxsBH9XLavPmh1LnxzWvH5XqTTNOi5+Heds+HCW34jfBbA1SyD0QAVyMR68aiU0n0RA4GNWw3crqAJDSaWDFnSdTxRcP5V6EkZmmFs44BIsLTbB59nbBVkogQtb8HQ0TST1GgeNKuuoy5V620V+7lIXId9XoEdET1Ul8KotyWYeGcsFQAsAhuNn7du/78BmJ7jZbLtCqm+SgYjOZBo8t1vJ9L9SgLanr4CxoVLF6O8KOfCnodFfSfU/GYPHlNt1utiBLMqXBZrWTICLw9vG6vDnKhmHliweJYW01rJ4Jz/Gs+6D8AWe16u+G2g4x+NXgTkZwVcG8VgLHwlqz4Q4/JcXrjhDI9NrGUsvqCWjM3Q/CSghAzkcGgnKQhrBCT2RQ/m074gHlsr8Q2i3yevKXqIietWdRgmC8LqJ7Ijyso+Ud8XufFkRRjWKfpjhrCN1UD3QHENAPWJ+c4l2uazBK5NAhgNfOUyeZTIxbVSyj1rtvcUtBdv3YnB51UYTyYCrRSFRseKhUdbUjilAYQt2AqcBRuDhyEunEmg22PzCfR/M8DZG0n7Xny1kOuI8N/XGDrxJUCyxjB5bKGdUe6BGZvjswYvrrA3YWza8V+anyzz5HIJuZMX4xGQ7IUOrA57W9I6SnObcn1kB1X21ES7HW/pdnVJe+c7fchqp56Frd/L2CHUV/wxTNED4aLnpjbbgOj67X3rs7YaeFYYfWmoL1KzgnWUKRJhUxh2hqtXJJswi1tn082qcKoC+YrF4kzI5GwhTatPmbCn9Y/mlLxnRdiKs8TAlmB1OKJcl60ycFIVwLxEYbYo7F3csZPtPKc4q3PPzOJLz7jeKa6q5mHQCfvIjCVPzGSUZqy+Bah8nzGg4vAZ9IluHdxs9FE2C2CeGWTdikUYJmR+YiKTL0lg29AyiA7jMsNIcFO9O8j+yNWNDFq2AolAEyxKYUzpFrMwg1gzCmeyWo+5dNmlLYAHX9VCvhfvnbflo9jzYiHUM5H1x+w4wkyRHHuzDWfaoKOWNyFv9LRvvQ23CMD4cFX4XLEE+8lcDIHEHlLKPkDaXUrZDkjaSSlaGJ4jozNkmbJw6r6ElAGPVweIGXmo5fZGWTHbuevMniAjM+jnonbnuMmwpExEwAn6vwrmKhP2hcdXhv1cpKvCLzEtbrP14LLpR/o/JBqhquSiLD0AAAAASUVORK5CYII="},"+NIl":function(ct,$e,Q){(function(se){se(Q("VrN/"))})(function(se){"use strict";se.defineMode("stex",function(W,k){"use strict";function X(c,u){c.cmdState.push(u)}function D(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function B(c){var u=c.cmdState.pop();u&&u.closeBracket()}function G(c){for(var u=c.cmdState,f=u.length-1;f>=0;f--){var s=u[f];if(s.name=="DEFAULT")continue;return s}return{styleIdentifier:function(){return null}}}function j(c,u,f){return function(){this.name=c,this.bracketNo=0,this.style=u,this.styles=f,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=j("importmodule","tag",["string","builtin"]),P.documentclass=j("documentclass","tag",["","atom"]),P.usepackage=j("usepackage","tag",["atom"]),P.begin=j("begin","tag",["atom"]),P.end=j("end","tag",["atom"]),P.label=j("label","tag",["atom"]),P.ref=j("ref","tag",["atom"]),P.eqref=j("eqref","tag",["atom"]),P.cite=j("cite","tag",["atom"]),P.bibitem=j("bibitem","tag",["atom"]),P.Bibitem=j("Bibitem","tag",["atom"]),P.RBibitem=j("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(c,u){c.f=u}function y(c,u){var f;if(c.match(/^\\[a-zA-Z@]+/)){var s=c.current().slice(1);return f=P.hasOwnProperty(s)?P[s]:P.DEFAULT,f=new f,X(u,f),I(u,p),f.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return I(u,function(a,d){return m(a,d,"\\]")}),"keyword";if(c.match("\\("))return I(u,function(a,d){return m(a,d,"\\)")}),"keyword";if(c.match("$$"))return I(u,function(a,d){return m(a,d,"$$")}),"keyword";if(c.match("$"))return I(u,function(a,d){return m(a,d,"$")}),"keyword";var r=c.next();if(r=="%")return c.skipToEnd(),"comment";if(r=="}"||r=="]"){if(f=D(u),f)f.closeBracket(r),I(u,p);else return"error";return"bracket"}else return r=="{"||r=="["?(f=P.DEFAULT,f=new f,X(u,f),"bracket"):/\d/.test(r)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),f=G(u),f.name=="begin"&&(f.argument=c.current()),f.styleIdentifier())}function m(c,u,f){if(c.eatSpace())return null;if(f&&c.match(f))return I(u,y),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variable-2";if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/]/))return"tag";if(c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var s=c.next();return s=="{"||s=="}"||s=="["||s=="]"||s=="("||s==")"?"bracket":s=="%"?(c.skipToEnd(),"comment"):"error"}function p(c,u){var f=c.peek(),s;return f=="{"||f=="["?(s=D(u),s.openBracket(f),c.eat(f),I(u,y),"bracket"):/[ \t\r]/.test(f)?(c.eat(f),null):(I(u,y),B(u),y(c,u))}return{startState:function(){var c=k.inMathMode?function(u,f){return m(u,f)}:y;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,u){return u.f(c,u)},blankLine:function(c){c.f=y,c.cmdState.length=0},lineComment:"%"}}),se.defineMIME("text/x-stex","stex"),se.defineMIME("text/x-latex","stex")})},"+ua5":function(ct,$e,Q){},"19Vz":function(ct,$e,Q){(function(se){se(Q("VrN/"))})(function(se){se.defineOption("placeholder","",function(j,P,I){var y=I&&I!=se.Init;if(P&&!y)j.on("blur",D),j.on("change",B),j.on("swapDoc",B),se.on(j.getInputField(),"compositionupdate",j.state.placeholderCompose=function(){X(j)}),B(j);else if(!P&&y){j.off("blur",D),j.off("change",B),j.off("swapDoc",B),se.off(j.getInputField(),"compositionupdate",j.state.placeholderCompose),W(j);var m=j.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}P&&!j.hasFocus()&&D(j)});function W(j){j.state.placeholder&&(j.state.placeholder.parentNode.removeChild(j.state.placeholder),j.state.placeholder=null)}function k(j){W(j);var P=j.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=j.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var I=j.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),P.appendChild(I),j.display.lineSpace.insertBefore(P,j.display.lineSpace.firstChild)}function X(j){setTimeout(function(){var P=!1,I=j.getInputField();I.nodeName=="TEXTAREA"?P=!I.value:j.lineCount()==1&&(P=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),P?k(j):W(j)},20)}function D(j){G(j)&&k(j)}function B(j){var P=j.getWrapperElement(),I=G(j);P.className=P.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?k(j):W(j)}function G(j){return j.lineCount()===1&&j.getLine(0)===""}})},"1eCo":function(ct,$e,Q){(function(se){se(Q("VrN/"))})(function(se){"use strict";var W={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},k={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};se.defineMode("xml",function(X,D){var B=X.indentUnit,G={},j=D.htmlMode?W:k;for(var P in j)G[P]=j[P];for(var P in D)G[P]=D[P];var I,y;function m(l,_){function h(N){return _.tokenize=N,N(l,_)}var g=l.next();if(g=="<")return l.eat("!")?l.eat("[")?l.match("CDATA[")?h(u("atom","]]>")):null:l.match("--")?h(u("comment","-->")):l.match("DOCTYPE",!0,!0)?(l.eatWhile(/[\w\._\-]/),h(f(1))):null:l.eat("?")?(l.eatWhile(/[\w\._\-]/),_.tokenize=u("meta","?>"),"meta"):(I=l.eat("/")?"closeTag":"openTag",_.tokenize=p,"tag bracket");if(g=="&"){var T;return l.eat("#")?l.eat("x")?T=l.eatWhile(/[a-fA-F\d]/)&&l.eat(";"):T=l.eatWhile(/[\d]/)&&l.eat(";"):T=l.eatWhile(/[\w\.\-:]/)&&l.eat(";"),T?"atom":"error"}else return l.eatWhile(/[^&<]/),null}m.isInText=!0;function p(l,_){var h=l.next();if(h==">"||h=="/"&&l.eat(">"))return _.tokenize=m,I=h==">"?"endTag":"selfcloseTag","tag bracket";if(h=="=")return I="equals",null;if(h=="<"){_.tokenize=m,_.state=d,_.tagName=_.tagStart=null;var g=_.tokenize(l,_);return g?g+" tag error":"tag error"}else return/[\'\"]/.test(h)?(_.tokenize=c(h),_.stringStartCol=l.column(),_.tokenize(l,_)):(l.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(l){var _=function(h,g){for(;!h.eol();)if(h.next()==l){g.tokenize=p;break}return"string"};return _.isInAttribute=!0,_}function u(l,_){return function(h,g){for(;!h.eol();){if(h.match(_)){g.tokenize=m;break}h.next()}return l}}function f(l){return function(_,h){for(var g;(g=_.next())!=null;){if(g=="<")return h.tokenize=f(l+1),h.tokenize(_,h);if(g==">")if(l==1){h.tokenize=m;break}else return h.tokenize=f(l-1),h.tokenize(_,h)}return"meta"}}function s(l,_,h){this.prev=l.context,this.tagName=_,this.indent=l.indented,this.startOfLine=h,(G.doNotIndent.hasOwnProperty(_)||l.context&&l.context.noIndent)&&(this.noIndent=!0)}function r(l){l.context&&(l.context=l.context.prev)}function a(l,_){for(var h;;){if(!l.context)return;if(h=l.context.tagName,!G.contextGrabbers.hasOwnProperty(h)||!G.contextGrabbers[h].hasOwnProperty(_))return;r(l)}}function d(l,_,h){return l=="openTag"?(h.tagStart=_.column(),L):l=="closeTag"?S:d}function L(l,_,h){return l=="word"?(h.tagName=_.current(),y="tag",O):G.allowMissingTagName&&l=="endTag"?(y="tag bracket",O(l,_,h)):(y="error",L)}function S(l,_,h){if(l=="word"){var g=_.current();return h.context&&h.context.tagName!=g&&G.implicitlyClosed.hasOwnProperty(h.context.tagName)&&r(h),h.context&&h.context.tagName==g||G.matchClosing===!1?(y="tag",x):(y="tag error",R)}else return G.allowMissingTagName&&l=="endTag"?(y="tag bracket",x(l,_,h)):(y="error",R)}function x(l,_,h){return l!="endTag"?(y="error",x):(r(h),d)}function R(l,_,h){return y="error",x(l,_,h)}function O(l,_,h){if(l=="word")return y="attribute",w;if(l=="endTag"||l=="selfcloseTag"){var g=h.tagName,T=h.tagStart;return h.tagName=h.tagStart=null,l=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(g)?a(h,g):(a(h,g),h.context=new s(h,g,T==h.indented)),d}return y="error",O}function w(l,_,h){return l=="equals"?E:(G.allowMissing||(y="error"),O(l,_,h))}function E(l,_,h){return l=="string"?b:l=="word"&&G.allowUnquoted?(y="string",O):(y="error",O(l,_,h))}function b(l,_,h){return l=="string"?b:O(l,_,h)}return{startState:function(l){var _={tokenize:m,state:d,indented:l||0,tagName:null,tagStart:null,context:null};return l!=null&&(_.baseIndent=l),_},token:function(l,_){if(!_.tagName&&l.sol()&&(_.indented=l.indentation()),l.eatSpace())return null;I=null;var h=_.tokenize(l,_);return(h||I)&&h!="comment"&&(y=null,_.state=_.state(I||h,l,_),y&&(h=y=="error"?h+" error":y)),h},indent:function(l,_,h){var g=l.context;if(l.tokenize.isInAttribute)return l.tagStart==l.indented?l.stringStartCol+1:l.indented+B;if(g&&g.noIndent)return se.Pass;if(l.tokenize!=p&&l.tokenize!=m)return h?h.match(/^(\s*)/)[0].length:0;if(l.tagName)return G.multilineTagIndentPastTag!==!1?l.tagStart+l.tagName.length+2:l.tagStart+B*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(_))return 0;var T=_&&/^<(\/)?([\w_:\.-]*)/.exec(_);if(T&&T[1])for(;g;)if(g.tagName==T[2]){g=g.prev;break}else if(G.implicitlyClosed.hasOwnProperty(g.tagName))g=g.prev;else break;else if(T)for(;g;){var N=G.contextGrabbers[g.tagName];if(N&&N.hasOwnProperty(T[2]))g=g.prev;else break}for(;g&&g.prev&&!g.startOfLine;)g=g.prev;return g?g.indent+B:l.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(l){l.state==E&&(l.state=O)},xmlCurrentTag:function(l){return l.tagName?{name:l.tagName,close:l.type=="closeTag"}:null},xmlCurrentContext:function(l){for(var _=[],h=l.context;h;h=h.prev)h.tagName&&_.push(h.tagName);return _.reverse()}}}),se.defineMIME("text/xml","xml"),se.defineMIME("application/xml","xml"),se.mimeModes.hasOwnProperty("text/html")||se.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"55Ip":function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return a});var se=Q("Ty5D"),W=Q("dI71"),k=Q("q1tI"),X=Q.n(k),D=Q("YS25"),B=Q("17x9"),G=Q.n(B),j=Q("wx14"),P=Q("zLVn"),I=Q("9R94"),y=function(E){Object(W.a)(b,E);function b(){for(var _,h=arguments.length,g=new Array(h),T=0;T<h;T++)g[T]=arguments[T];return _=E.call.apply(E,[this].concat(g))||this,_.history=Object(D.a)(_.props),_}var l=b.prototype;return l.render=function(){return X.a.createElement(se.c,{history:this.history,children:this.props.children})},b}(X.a.Component),m=function(E){Object(W.a)(b,E);function b(){for(var _,h=arguments.length,g=new Array(h),T=0;T<h;T++)g[T]=arguments[T];return _=E.call.apply(E,[this].concat(g))||this,_.history=Object(D.b)(_.props),_}var l=b.prototype;return l.render=function(){return X.a.createElement(se.c,{history:this.history,children:this.props.children})},b}(X.a.Component),p=function(b,l){return typeof b=="function"?b(l):b},c=function(b,l){return typeof b=="string"?Object(D.c)(b,null,null,l):b},u=function(b){return b},f=X.a.forwardRef;typeof f=="undefined"&&(f=u);function s(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var r=f(function(E,b){var l=E.innerRef,_=E.navigate,h=E.onClick,g=Object(P.a)(E,["innerRef","navigate","onClick"]),T=g.target,N=Object(j.a)({},g,{onClick:function(Y){try{h&&h(Y)}catch(U){throw Y.preventDefault(),U}!Y.defaultPrevented&&Y.button===0&&(!T||T==="_self")&&!s(Y)&&(Y.preventDefault(),_())}});return u!==f?N.ref=b||l:N.ref=l,X.a.createElement("a",N)}),a=f(function(E,b){var l=E.component,_=l===void 0?r:l,h=E.replace,g=E.to,T=E.innerRef,N=Object(P.a)(E,["component","replace","to","innerRef"]);return X.a.createElement(se.e.Consumer,null,function(V){V||Object(I.a)(!1);var Y=V.history,U=c(p(g,V.location),V.location),A=U?Y.createHref(U):"",J=Object(j.a)({},N,{href:A,navigate:function(){var oe=p(g,V.location),fe=h?Y.replace:Y.push;fe(oe)}});return u!==f?J.ref=b||T:J.innerRef=T,X.a.createElement(_,J)})});if(!1)var d,L;var S=function(b){return b},x=X.a.forwardRef;typeof x=="undefined"&&(x=S);function R(){for(var E=arguments.length,b=new Array(E),l=0;l<E;l++)b[l]=arguments[l];return b.filter(function(_){return _}).join(" ")}var O=x(function(E,b){var l=E["aria-current"],_=l===void 0?"page":l,h=E.activeClassName,g=h===void 0?"active":h,T=E.activeStyle,N=E.className,V=E.exact,Y=E.isActive,U=E.location,A=E.sensitive,J=E.strict,ne=E.style,oe=E.to,fe=E.innerRef,ke=Object(P.a)(E,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return X.a.createElement(se.e.Consumer,null,function(Oe){Oe||Object(I.a)(!1);var Me=U||Oe.location,Be=c(p(oe,Me),Me),Pe=Be.pathname,be=Pe&&Pe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),le=be?Object(se.f)(Me.pathname,{path:be,exact:V,sensitive:A,strict:J}):null,Le=!!(Y?Y(le,Me):le),tt=Le?R(N,g):N,nt=Le?Object(j.a)({},ne,{},T):ne,lt=Object(j.a)({"aria-current":Le&&_||null,className:tt,style:nt,to:Be},ke);return S!==x?lt.ref=b||fe:lt.innerRef=fe,X.a.createElement(a,lt)})});if(!1)var w},"5VLF":function(ct,$e,Q){"use strict";var se,W;function k(X,D,B){var G=function(j,P){return X.js_beautify(j,P)};return G.js=X.js_beautify,G.css=D.css_beautify,G.html=B.html_beautify,G.js_beautify=X.js_beautify,G.css_beautify=D.css_beautify,G.html_beautify=B.html_beautify,G}!(se=[Q("6UM0"),Q("TXwP"),Q("psGv")],W=function(X,D,B){return k(X,D,B)}.apply($e,se),W!==void 0&&(ct.exports=W))},"6UM0":function(ct,$e,Q){var se,W;(function(){var k;(function(){"use strict";var D=[function(P,I,y){var m=y(1).Beautifier,p=y(5).Options;function c(u,f){var s=new m(u,f);return s.beautify()}P.exports=c,P.exports.defaultOptions=function(){return new p}},function(P,I,y){var m=y(2).Output,p=y(3).Token,c=y(4),u=y(5).Options,f=y(7).Tokenizer,s=y(7).line_starters,r=y(7).positionable_operators,a=y(7).TOKEN;function d(A,J){return J.indexOf(A)!==-1}function L(A){return A.replace(/^\s+/g,"")}function S(A){for(var J={},ne=0;ne<A.length;ne++)J[A[ne].replace(/-/g,"_")]=A[ne];return J}function x(A,J){return A&&A.type===a.RESERVED&&A.text===J}function R(A,J){return A&&A.type===a.RESERVED&&d(A.text,J)}var O=["case","return","do","if","throw","else","await","break","continue","async"],w=["before-newline","after-newline","preserve-newline"],E=S(w),b=[E.before_newline,E.preserve_newline],l={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _(A,J){if(J.multiline_frame||J.mode===l.ForInitializer||J.mode===l.Conditional)return;A.remove_indent(J.start_line_index)}function h(A){A=A.replace(c.allLineBreaks,`
|
|
`);for(var J=[],ne=A.indexOf(`
|
|
`);ne!==-1;)J.push(A.substring(0,ne)),A=A.substring(ne+1),ne=A.indexOf(`
|
|
`);return A.length&&J.push(A),J}function g(A){return A===l.ArrayLiteral}function T(A){return d(A,[l.Expression,l.ForInitializer,l.Conditional])}function N(A,J){for(var ne=0;ne<A.length;ne++){var oe=A[ne].trim();if(oe.charAt(0)!==J)return!1}return!0}function V(A,J){for(var ne=0,oe=A.length,fe;ne<oe;ne++)if(fe=A[ne],fe&&fe.indexOf(J)!==0)return!1;return!0}function Y(A,J){J=J||{},this._source_text=A||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new u(J)}Y.prototype.create_flags=function(A,J){var ne=0;A&&(ne=A.indentation_level,!this._output.just_added_newline()&&A.line_indent_level>ne&&(ne=A.line_indent_level));var oe={mode:J,parent:A,last_token:A?A.last_token:new p(a.START_BLOCK,""),last_word:A?A.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:ne,alignment:0,line_indent_level:A?A.line_indent_level:ne,start_line_index:this._output.get_line_number(),ternary_depth:0};return oe},Y.prototype._reset=function(A){var J=A.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,J),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(l.BlockStatement);var ne=new f(A,this._options);return this._tokens=ne.tokenize(),A},Y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A,J=this._reset(this._source_text),ne=this._options.eol;this._options.eol==="auto"&&(ne=`
|
|
`,J&&c.lineBreak.test(J||"")&&(ne=J.match(c.lineBreak)[0]));for(var oe=this._tokens.next();oe;)this.handle_token(oe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=oe,oe=this._tokens.next();return A=this._output.get_code(ne),A},Y.prototype.handle_token=function(A,J){A.type===a.START_EXPR?this.handle_start_expr(A):A.type===a.END_EXPR?this.handle_end_expr(A):A.type===a.START_BLOCK?this.handle_start_block(A):A.type===a.END_BLOCK?this.handle_end_block(A):A.type===a.WORD?this.handle_word(A):A.type===a.RESERVED?this.handle_word(A):A.type===a.SEMICOLON?this.handle_semicolon(A):A.type===a.STRING?this.handle_string(A):A.type===a.EQUALS?this.handle_equals(A):A.type===a.OPERATOR?this.handle_operator(A):A.type===a.COMMA?this.handle_comma(A):A.type===a.BLOCK_COMMENT?this.handle_block_comment(A,J):A.type===a.COMMENT?this.handle_comment(A,J):A.type===a.DOT?this.handle_dot(A):A.type===a.EOF?this.handle_eof(A):A.type===a.UNKNOWN?this.handle_unknown(A,J):this.handle_unknown(A,J)},Y.prototype.handle_whitespace_and_comments=function(A,J){var ne=A.newlines,oe=this._options.keep_array_indentation&&g(this._flags.mode);if(A.comments_before)for(var fe=A.comments_before.next();fe;)this.handle_whitespace_and_comments(fe,J),this.handle_token(fe,J),fe=A.comments_before.next();if(oe)for(var ke=0;ke<ne;ke+=1)this.print_newline(ke>0,J);else if(this._options.max_preserve_newlines&&ne>this._options.max_preserve_newlines&&(ne=this._options.max_preserve_newlines),this._options.preserve_newlines&&ne>1){this.print_newline(!1,J);for(var Oe=1;Oe<ne;Oe+=1)this.print_newline(!0,J)}};var U=["async","break","continue","return","throw","yield"];Y.prototype.allow_wrap_or_preserved_newline=function(A,J){if(J=J===void 0?!1:J,this._output.just_added_newline())return;var ne=this._options.preserve_newlines&&A.newlines||J,oe=d(this._flags.last_token.text,r)||d(A.text,r);if(oe){var fe=d(this._flags.last_token.text,r)&&d(this._options.operator_position,b)||d(A.text,r);ne=ne&&fe}if(ne)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,U))return;this._output.set_wrap_point()}},Y.prototype.print_newline=function(A,J){if(!J&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var ne=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&x(ne,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(A)&&(this._flags.multiline_frame=!0)},Y.prototype.print_token_line_indentation=function(A){this._output.just_added_newline()&&(this._options.keep_array_indentation&&A.newlines&&(A.text==="["||g(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(A.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},Y.prototype.print_token=function(A){if(this._output.raw){this._output.add_raw_token(A);return}if(this._options.comma_first&&A.previous&&A.previous.type===a.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var J=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(J),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(A),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(A),this._output.non_breaking_space=!0,this._output.add_token(A.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},Y.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Y.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Y.prototype.set_mode=function(A){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,A),this._flags=this.create_flags(this._previous_flags,A),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Y.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===l.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Y.prototype.start_of_object_property=function(){return this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},Y.prototype.start_of_statement=function(A){var J=!1;return J=J||R(this._flags.last_token,["var","let","const"])&&A.type===a.WORD,J=J||x(this._flags.last_token,"do"),J=J||!(this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement)&&R(this._flags.last_token,U)&&!A.newlines,J=J||x(this._flags.last_token,"else")&&!(x(A,"if")&&!A.comments_before),J=J||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===l.ForInitializer||this._previous_flags.mode===l.Conditional),J=J||this._flags.last_token.type===a.WORD&&this._flags.mode===l.BlockStatement&&!this._flags.in_case&&!(A.text==="--"||A.text==="++")&&this._last_last_text!=="function"&&A.type!==a.WORD&&A.type!==a.RESERVED,J=J||this._flags.mode===l.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),J?(this.set_mode(l.Statement),this.indent(),this.handle_whitespace_and_comments(A,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A,R(A,["do","for","if","while"])),!0):!1},Y.prototype.handle_start_expr=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A);var J=l.Expression;if(A.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(A),this.set_mode(J),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}J=l.ArrayLiteral,g(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),d(this._flags.last_token.type,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,J=l.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,J=l.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&A.whitespace_before===""?this._output.space_before_token=!1:(d(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var ne=this._tokens.peek(-3);if(this._options.space_after_named_function&&ne){var oe=this._tokens.peek(-4);R(ne,["async","function"])||ne.text==="*"&&R(oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===l.ObjectLiteral?(ne.text==="{"||ne.text===","||ne.text==="*"&&(oe.text==="{"||oe.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(A);(this._flags.last_token.type===a.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&d(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(A,A.newlines),this.print_token(A),this.set_mode(J),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Y.prototype.handle_end_expr=function(A){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(A,A.text==="]"&&g(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(A),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===l.Conditional&&(this._previous_flags.mode=l.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Y.prototype.handle_start_block=function(A){this.handle_whitespace_and_comments(A);var J=this._tokens.peek(),ne=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(l.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(l.BlockStatement):ne&&(d(ne.text,[":",","])&&d(J.type,[a.STRING,a.WORD,a.RESERVED])||d(J.text,["get","set","..."])&&d(ne.type,[a.WORD,a.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(ne.text,[":",","])?this.set_mode(l.BlockStatement):this.set_mode(l.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(l.BlockStatement):d(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(l.ObjectLiteral):this.set_mode(l.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var oe=!J.comments_before&&J.text==="}",fe=oe&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var ke=0,Oe=null;this._flags.inline_frame=!0;do if(ke+=1,Oe=this._tokens.peek(ke-1),Oe.newlines){this._flags.inline_frame=!1;break}while(Oe.type!==a.EOF&&!(Oe.type===a.END_BLOCK&&Oe.opened===A))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(fe||this._flags.last_token.type===a.EQUALS||R(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(g(this._previous_flags.mode)&&(this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(A),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(this._flags.last_token.type===a.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(A),this.indent(),!oe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},Y.prototype.handle_end_block=function(A){for(this.handle_whitespace_and_comments(A);this._flags.mode===l.Statement;)this.restore_mode();var J=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!J?this._output.space_before_token=!0:this._options.brace_style==="expand"?J||this.print_newline():J||(g(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(A)},Y.prototype.handle_word=function(A){if(A.type===a.RESERVED){if(d(A.text,["set","get"])&&this._flags.mode!==l.ObjectLiteral)A.type=a.WORD;else if(A.text==="import"&&d(this._tokens.peek().text,["(","."]))A.type=a.WORD;else if(d(A.text,["as","from"])&&!this._flags.import_block)A.type=a.WORD;else if(this._flags.mode===l.ObjectLiteral){var J=this._tokens.peek();J.text===":"&&(A.type=a.WORD)}}if(this.start_of_statement(A)?R(this._flags.last_token,["var","let","const"])&&A.type===a.WORD&&(this._flags.declaration_statement=!0):A.newlines&&!T(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(A),this.print_newline()):this.handle_whitespace_and_comments(A),this._flags.do_block&&!this._flags.do_while)if(x(A,"while")){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&x(A,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===l.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(A,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(A),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A)),x(A,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&(!this._output.just_added_blankline()&&!A.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,U)?this._output.space_before_token=!0:x(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(T(this._flags.mode)||g(this._flags.mode))||this.print_newline(),this.print_token(A),this._flags.last_word=A.text;return}var ne="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?ne="SPACE":R(A,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines?ne="NEWLINE":(ne="SPACE",this._output.space_before_token=!0):ne="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===l.BlockStatement?ne="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&T(this._flags.mode)?ne="SPACE":this._flags.last_token.type===a.STRING?ne="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&d(this._last_last_text,["{",","]))?ne="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?ne="SPACE":ne="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,ne="NEWLINE"),R(A,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?ne="SPACE":ne="NEWLINE"),R(A,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===l.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&A.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var oe=this._output.current_line;oe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else ne==="NEWLINE"?R(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(A,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!R(A,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(A,"if")&&x(A.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(A,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&g(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():ne==="SPACE"&&(this._output.space_before_token=!0);A.previous&&(A.previous.type===a.WORD||A.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(A),this._flags.last_word=A.text,A.type===a.RESERVED&&(A.text==="do"?this._flags.do_block=!0:A.text==="if"?this._flags.if_block=!0:A.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(A,"from")&&(this._flags.import_block=!1))},Y.prototype.handle_semicolon=function(A){this.start_of_statement(A)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(A);for(var J=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&x(J,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(A)},Y.prototype.handle_string=function(A){A.text.startsWith("`")&&A.newlines===0&&A.whitespace_before===""&&(A.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(A)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(A),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(A):A.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(A.previous.text==="]"||A.previous.text===")")&&A.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(A)},Y.prototype.handle_equals=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0},Y.prototype.handle_comma=function(A){this.handle_whitespace_and_comments(A,!0),this.print_token(A),this._output.space_before_token=!0,this._flags.declaration_statement?(T(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)):this._flags.mode===l.ObjectLiteral||this._flags.mode===l.Statement&&this._flags.parent.mode===l.ObjectLiteral?(this._flags.mode===l.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(A)},Y.prototype.handle_operator=function(A){var J=A.text==="*"&&(R(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),ne=d(A.text,["-","+"])&&(d(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||d(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(A)){var oe=!J;this.handle_whitespace_and_comments(A,oe)}if(A.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(A);return}if(A.text==="::"){this.print_token(A);return}if(this._flags.last_token.type===a.OPERATOR&&d(this._options.operator_position,b)&&this.allow_wrap_or_preserved_newline(A),A.text===":"&&this._flags.in_case){this.print_token(A),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var fe=!0,ke=!0,Oe=!1;if(A.text===":"?this._flags.ternary_depth===0?fe=!1:(this._flags.ternary_depth-=1,Oe=!0):A.text==="?"&&(this._flags.ternary_depth+=1),!ne&&!J&&this._options.preserve_newlines&&d(A.text,r)){var Me=A.text===":",Be=Me&&Oe,Pe=Me&&!Oe;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!Pe,this.print_token(A),(!Me||Be)&&this.allow_wrap_or_preserved_newline(A),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!Me||Be?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(A):this._output.space_before_token=!1,this.print_token(A),this._output.space_before_token=!0;return;case E.preserve_newline:Pe||this.allow_wrap_or_preserved_newline(A),fe=!(this._output.just_added_newline()||Pe),this._output.space_before_token=fe,this.print_token(A),this._output.space_before_token=!0;return}}if(J){this.allow_wrap_or_preserved_newline(A),fe=!1;var be=this._tokens.peek();ke=be&&d(be.type,[a.WORD,a.RESERVED])}else if(A.text==="...")this.allow_wrap_or_preserved_newline(A),fe=this._flags.last_token.type===a.START_BLOCK,ke=!1;else if(d(A.text,["--","++","!","~"])||ne){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(A),fe=!1,ke=!1,A.newlines&&(A.text==="--"||A.text==="++"||A.text==="~")){var le=R(this._flags.last_token,O)&&A.newlines;le&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(le,!0)}this._flags.last_token.text===";"&&T(this._flags.mode)&&(fe=!0),this._flags.last_token.type===a.RESERVED?fe=!0:this._flags.last_token.type===a.END_EXPR?fe=!(this._flags.last_token.text==="]"&&(A.text==="--"||A.text==="++")):this._flags.last_token.type===a.OPERATOR&&(fe=d(A.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(A.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(ke=!0)),(this._flags.mode===l.BlockStatement&&!this._flags.inline_frame||this._flags.mode===l.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||fe,this.print_token(A),this._output.space_before_token=ke},Y.prototype.handle_block_comment=function(A,J){if(this._output.raw){this._output.add_raw_token(A),A.directives&&A.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(A.directives){this.print_newline(!1,J),this.print_token(A),A.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(A.text)&&!A.newlines){this._output.space_before_token=!0,this.print_token(A),this._output.space_before_token=!0;return}else this.print_block_commment(A,J)},Y.prototype.print_block_commment=function(A,J){var ne=h(A.text),oe,fe=!1,ke=!1,Oe=A.whitespace_before,Me=Oe.length;if(this.print_newline(!1,J),this.print_token_line_indentation(A),this._output.add_token(ne[0]),this.print_newline(!1,J),ne.length>1){for(ne=ne.slice(1),fe=N(ne,"*"),ke=V(ne,Oe),fe&&(this._flags.alignment=1),oe=0;oe<ne.length;oe++)fe?(this.print_token_line_indentation(A),this._output.add_token(L(ne[oe]))):ke&&ne[oe]?(this.print_token_line_indentation(A),this._output.add_token(ne[oe].substring(Me))):(this._output.current_line.set_indent(-1),this._output.add_token(ne[oe])),this.print_newline(!1,J);this._flags.alignment=0}},Y.prototype.handle_comment=function(A,J){A.newlines?this.print_newline(!1,J):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(A),this.print_newline(!1,J)},Y.prototype.handle_dot=function(A){this.start_of_statement(A)||this.handle_whitespace_and_comments(A,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(A,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(A)},Y.prototype.handle_unknown=function(A,J){this.print_token(A),A.text[A.text.length-1]===`
|
|
`&&this.print_newline(!1,J)},Y.prototype.handle_eof=function(A){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(A)},P.exports.Beautifier=Y},function(P){function I(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}I.prototype.clone_empty=function(){var p=new I(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},I.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},I.prototype.has_match=function(p){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(p))return!0;return!1},I.prototype.set_indent=function(p,c){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(p){this.__items.push(p);var c=p.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=p.length-c:this.__character_count+=p.length},I.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function y(p,c){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),c=c||"",p.indent_level>0&&(c=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}y.prototype.get_indent_size=function(p,c){var u=this.__base_string_length;return c=c||0,p<0&&(u=0),u+=p*this.__indent_size,u+=c,u},y.prototype.get_indent_string=function(p,c){var u=this.__base_string;return c=c||0,p<0&&(p=0,u=""),c+=p*this.__indent_size,this.__ensure_cache(c),u+=this.__cache[c],u},y.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var p=this.__cache.length,c=0,u="";this.__indent_size&&p>=this.__indent_size&&(c=Math.floor(p/this.__indent_size),p-=c*this.__indent_size,u=new Array(c+1).join(this.__indent_string)),p&&(u+=new Array(p+1).join(" ")),this.__cache.push(u)};function m(p,c){this.__indent_cache=new y(p,c),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,c){return this.__indent_cache.get_indent_string(p,c)},m.prototype.get_indent_size=function(p,c){return this.__indent_cache.get_indent_size(p,c)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(u=u.replace(/[\n]/g,p)),u},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,c){return p=p||0,c=c||0,this.next_line.set_indent(p,c),this.__lines.length>1?(this.current_line.set_indent(p,c),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var c=0;c<p.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(p){for(var c=this.__lines.length;p<c;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,c){for(var u=this.__lines.length-2;u>=0;){var f=this.__lines[u];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==c){this.__lines.splice(u+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},P.exports.Output=m},function(P){function I(y,m,p,c){this.type=y,this.text=m,this.comments_before=null,this.newlines=p||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}P.exports.Token=I},function(P,I){var y="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",c="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",u="(?:\\\\u[0-9a-fA-F]{4}|["+y+p+"])",f="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+c+"])*";I.identifier=new RegExp(u+f,"g"),I.identifierStart=new RegExp(u),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+p+c+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|
|
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(P,I,y){var m=y(6).Options,p=["before-newline","after-newline","preserve-newline"];function c(u){m.call(this,u,"js");var f=this.raw_options.brace_style||null;f==="expand-strict"?this.raw_options.brace_style="expand":f==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r<s.length;r++)s[r]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[r];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new m,P.exports.Options=c},function(P){function I(p,c){this.raw_options=y(p,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(p,c){var u=this.raw_options[p],f=c||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(f=u.concat()):typeof u=="string"&&(f=u.split(/[^a-zA-Z0-9_\/\-]+/)),f},I.prototype._get_boolean=function(p,c){var u=this.raw_options[p],f=u===void 0?!!c:!!u;return f},I.prototype._get_characters=function(p,c){var u=this.raw_options[p],f=c||"";return typeof u=="string"&&(f=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},I.prototype._get_number=function(p,c){var u=this.raw_options[p];c=parseInt(c,10),isNaN(c)&&(c=0);var f=parseInt(u,10);return isNaN(f)&&(f=c),f},I.prototype._get_selection=function(p,c,u){var f=this._get_selection_list(p,c,u);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f[0]},I.prototype._get_selection_list=function(p,c,u){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[c[0]],!this._is_valid_selection(u,c))throw new Error("Invalid Default Value!");var f=this._get_array(p,u);if(!this._is_valid_selection(f,c))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f},I.prototype._is_valid_selection=function(p,c){return p.length&&c.length&&!p.some(function(u){return c.indexOf(u)===-1})};function y(p,c){var u={};p=m(p);var f;for(f in p)f!==c&&(u[f]=p[f]);if(c&&p[c])for(f in p[c])u[f]=p[c][f];return u}function m(p){var c={},u;for(u in p){var f=u.replace(/-/g,"_");c[f]=p[u]}return c}P.exports.Options=I,P.exports.normalizeOpts=m,P.exports.mergeOpts=y},function(P,I,y){var m=y(8).InputScanner,p=y(9).Tokenizer,c=y(9).TOKEN,u=y(13).Directives,f=y(4),s=y(12).Pattern,r=y(14).TemplatablePattern;function a(N,V){return V.indexOf(N)!==-1}var d={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:c.START,RAW:c.RAW,EOF:c.EOF},L=new u(/\/\*/,/\*\//),S=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,x=/[0-9]/,R=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),w=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";w=w.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),w="\\?\\.(?!\\d) "+w,w=w.replace(/ /g,"|");var E=new RegExp(w),b="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),l=b.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+l.join("|")+")$"),h,g=function(N,V){p.call(this,N,V),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var Y=new s(this._input),U=new r(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(f.identifier).matching(f.identifierMatch),number:Y.matching(S),punct:Y.matching(E),comment:Y.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:Y.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:Y.matching(/<!--/),html_comment_end:Y.matching(/-->/),include:Y.starting_with(/#include/).until_after(f.lineBreak),shebang:Y.starting_with(/#!/).until_after(f.lineBreak),xml:Y.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};g.prototype=new p,g.prototype._is_comment=function(N){return N.type===d.COMMENT||N.type===d.BLOCK_COMMENT||N.type===d.UNKNOWN},g.prototype._is_opening=function(N){return N.type===d.START_BLOCK||N.type===d.START_EXPR},g.prototype._is_closing=function(N,V){return(N.type===d.END_BLOCK||N.type===d.END_EXPR)&&V&&(N.text==="]"&&V.text==="["||N.text===")"&&V.text==="("||N.text==="}"&&V.text==="{")},g.prototype._reset=function(){h=!1},g.prototype._get_next_token=function(N,V){var Y=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(d.EOF,""):(Y=Y||this._read_non_javascript(U),Y=Y||this._read_string(U),Y=Y||this._read_word(N),Y=Y||this._read_singles(U),Y=Y||this._read_comment(U),Y=Y||this._read_regexp(U,N),Y=Y||this._read_xml(U,N),Y=Y||this._read_punctuation(),Y=Y||this._create_token(d.UNKNOWN,this._input.next()),Y)},g.prototype._read_word=function(N){var V;if(V=this.__patterns.identifier.read(),V!=="")return V=V.replace(f.allLineBreaks,`
|
|
`),!(N.type===d.DOT||N.type===d.RESERVED&&(N.text==="set"||N.text==="get"))&&_.test(V)?(V==="in"||V==="of")&&(N.type===d.WORD||N.type===d.STRING)?this._create_token(d.OPERATOR,V):this._create_token(d.RESERVED,V):this._create_token(d.WORD,V);if(V=this.__patterns.number.read(),V!=="")return this._create_token(d.WORD,V)},g.prototype._read_singles=function(N){var V=null;return N==="("||N==="["?V=this._create_token(d.START_EXPR,N):N===")"||N==="]"?V=this._create_token(d.END_EXPR,N):N==="{"?V=this._create_token(d.START_BLOCK,N):N==="}"?V=this._create_token(d.END_BLOCK,N):N===";"?V=this._create_token(d.SEMICOLON,N):N==="."&&R.test(this._input.peek(1))?V=this._create_token(d.DOT,N):N===","&&(V=this._create_token(d.COMMA,N)),V&&this._input.next(),V},g.prototype._read_punctuation=function(){var N=this.__patterns.punct.read();if(N!=="")return N==="="?this._create_token(d.EQUALS,N):N==="?."?this._create_token(d.DOT,N):this._create_token(d.OPERATOR,N)},g.prototype._read_non_javascript=function(N){var V="";if(N==="#"){if(this._is_first_token()&&(V=this.__patterns.shebang.read(),V))return this._create_token(d.UNKNOWN,V.trim()+`
|
|
`);if(V=this.__patterns.include.read(),V)return this._create_token(d.UNKNOWN,V.trim()+`
|
|
`);N=this._input.next();var Y="#";if(this._input.hasNext()&&this._input.testChar(x)){do N=this._input.next(),Y+=N;while(this._input.hasNext()&&N!=="#"&&N!=="=");return N==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(Y+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(Y+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,Y)}this._input.back()}else if(N==="<"&&this._is_first_token()){if(V=this.__patterns.html_comment_start.read(),V){for(;this._input.hasNext()&&!this._input.testChar(f.newline);)V+=this._input.next();return h=!0,this._create_token(d.COMMENT,V)}}else if(h&&N==="-"&&(V=this.__patterns.html_comment_end.read(),V))return h=!1,this._create_token(d.COMMENT,V);return null},g.prototype._read_comment=function(N){var V=null;if(N==="/"){var Y="";if(this._input.peek(1)==="*"){Y=this.__patterns.block_comment.read();var U=L.get_directives(Y);U&&U.ignore==="start"&&(Y+=L.readIgnored(this._input)),Y=Y.replace(f.allLineBreaks,`
|
|
`),V=this._create_token(d.BLOCK_COMMENT,Y),V.directives=U}else this._input.peek(1)==="/"&&(Y=this.__patterns.comment.read(),V=this._create_token(d.COMMENT,Y))}return V},g.prototype._read_string=function(N){if(N==="`"||N==="'"||N==='"'){var V=this._input.next();return this.has_char_escapes=!1,N==="`"?V+=this._read_string_recursive("`",!0,"${"):V+=this._read_string_recursive(N),this.has_char_escapes&&this._options.unescape_strings&&(V=T(V)),this._input.peek()===N&&(V+=this._input.next()),V=V.replace(f.allLineBreaks,`
|
|
`),this._create_token(d.STRING,V)}return null},g.prototype._allow_regexp_or_xml=function(N){return N.type===d.RESERVED&&a(N.text,["return","case","throw","else","do","typeof","yield"])||N.type===d.END_EXPR&&N.text===")"&&N.opened.previous.type===d.RESERVED&&a(N.opened.previous.text,["if","while","for"])||a(N.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},g.prototype._read_regexp=function(N,V){if(N==="/"&&this._allow_regexp_or_xml(V)){for(var Y=this._input.next(),U=!1,A=!1;this._input.hasNext()&&(U||A||this._input.peek()!==N)&&!this._input.testChar(f.newline);)Y+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?A=!0:this._input.peek()==="]"&&(A=!1)),this._input.next();return this._input.peek()===N&&(Y+=this._input.next(),Y+=this._input.read(f.identifier)),this._create_token(d.STRING,Y)}return null},g.prototype._read_xml=function(N,V){if(this._options.e4x&&N==="<"&&this._allow_regexp_or_xml(V)){var Y="",U=this.__patterns.xml.read_match();if(U){for(var A=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),J=A.indexOf("{")===0,ne=0;U;){var oe=!!U[1],fe=U[2],ke=!!U[U.length-1]||fe.slice(0,8)==="![CDATA[";if(!ke&&(fe===A||J&&fe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(oe?--ne:++ne),Y+=U[0],ne<=0)break;U=this.__patterns.xml.read_match()}return U||(Y+=this._input.match(/[\s\S]*/g)[0]),Y=Y.replace(f.allLineBreaks,`
|
|
`),this._create_token(d.STRING,Y)}}return null};function T(N){for(var V="",Y=0,U=new m(N),A=null;U.hasNext();)if(A=U.match(/([\s]|[^\\]|\\\\)+/g),A&&(V+=A[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")A=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")A=U.match(/u([0-9A-Fa-f]{4})/g);else{V+="\\",U.hasNext()&&(V+=U.next());continue}if(!A)return N;if(Y=parseInt(A[1],16),Y>126&&Y<=255&&A[0].indexOf("x")===0)return N;if(Y>=0&&Y<32){V+="\\"+A[0];continue}else Y===34||Y===39||Y===92?V+="\\"+String.fromCharCode(Y):V+=String.fromCharCode(Y)}return V}g.prototype._read_string_recursive=function(N,V,Y){var U,A;N==="'"?A=this.__patterns.single_quote:N==='"'?A=this.__patterns.double_quote:N==="`"?A=this.__patterns.template_text:N==="}"&&(A=this.__patterns.template_expression);for(var J=A.read(),ne="";this._input.hasNext();){if(ne=this._input.next(),ne===N||!V&&f.newline.test(ne)){this._input.back();break}else ne==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),ne+=this._input.next()):Y&&(Y==="${"&&ne==="$"&&this._input.peek()==="{"&&(ne+=this._input.next()),Y===ne&&(N==="`"?ne+=this._read_string_recursive("}",V,"`"):ne+=this._read_string_recursive("`",V,"${"),this._input.hasNext()&&(ne+=this._input.next())));ne+=A.read(),J+=ne}return J},P.exports.Tokenizer=g,P.exports.TOKEN=d,P.exports.positionable_operators=O.slice(),P.exports.line_starters=b.slice()},function(P){var I=RegExp.prototype.hasOwnProperty("sticky");function y(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},y.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},y.prototype.__match=function(m,p){m.lastIndex=p;var c=m.exec(this.__input);return c&&!(I&&m.sticky)&&(c.index!==p&&(c=null)),c},y.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},y.prototype.testChar=function(m,p){var c=this.peek(p);return m.lastIndex=0,c!==null&&m.test(c)},y.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},y.prototype.read=function(m,p,c){var u="",f;return m&&(f=this.match(m),f&&(u+=f[0])),p&&(f||!m)&&(u+=this.readUntil(p,c)),u},y.prototype.readUntil=function(m,p){var c="",u=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(u=f.index,p&&(u+=f[0].length)):u=this.__input_length,c=this.__input.substring(this.__position,u),this.__position=u,c},y.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},y.prototype.get_regexp=function(m,p){var c=null,u="g";return p&&I&&(u="y"),typeof m=="string"&&m!==""?c=new RegExp(m,u):m&&(c=new RegExp(m.source,u)),c},y.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(m){var p=this.__position,c=this.readUntilAfter(m);return this.__position=p,c},y.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},P.exports.InputScanner=y},function(P,I,y){var m=y(8).InputScanner,p=y(3).Token,c=y(10).TokenStream,u=y(11).WhitespacePattern,f={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(r,a){this._input=new m(r),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var r,a=new p(f.START,""),d=null,L=[],S=new c;a.type!==f.EOF;){for(r=this._get_next_token(a,d);this._is_comment(r);)S.add(r),r=this._get_next_token(a,d);S.isEmpty()||(r.comments_before=S,S=new c),r.parent=d,this._is_opening(r)?(L.push(d),d=r):d&&this._is_closing(r,d)&&(r.opened=d,d.closed=r,d=L.pop(),r.parent=d),r.previous=a,a.next=r,this.__tokens.add(r),a=r}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(r,a){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(f.RAW,d):this._create_token(f.EOF,"")},s.prototype._is_comment=function(r){return!1},s.prototype._is_opening=function(r){return!1},s.prototype._is_closing=function(r,a){return!1},s.prototype._create_token=function(r,a){var d=new p(r,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},P.exports.Tokenizer=s,P.exports.TOKEN=f},function(P){function I(y){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=y}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position<this.__tokens_length},I.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__tokens[this.__position],this.__position+=1),y},I.prototype.peek=function(y){var m=null;return y=y||0,y+=this.__position,y>=0&&y<this.__tokens_length&&(m=this.__tokens[y]),m},I.prototype.add=function(y){this.__parent_token&&(y.parent=this.__parent_token),this.__tokens.push(y),this.__tokens_length+=1},P.exports.TokenStream=I},function(P,I,y){var m=y(12).Pattern;function p(c,u){m.call(this,c,u),u?this._line_regexp=this._input.get_regexp(u._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new m,p.prototype.__set_whitespace_patterns=function(c,u){c+="\\t ",u+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+u+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+u+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var u=this.__split(this._newline_regexp,c);this.newline_count=u.length-1,this.whitespace_before_token=u[this.newline_count]}return c},p.prototype.matching=function(c,u){var f=this._create();return f.__set_whitespace_patterns(c,u),f._update(),f},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(c,u){c.lastIndex=0;for(var f=0,s=[],r=c.exec(u);r;)s.push(u.substring(f,r.index)),f=r.index+r[0].length,r=c.exec(u);return f<u.length?s.push(u.substring(f,u.length)):s.push(""),s},P.exports.WhitespacePattern=p},function(P){function I(y,m){this._input=y,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}I.prototype.read=function(){var y=this._input.read(this._starting_pattern);return(!this._starting_pattern||y)&&(y+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),y},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(y){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(y),m._update(),m},I.prototype.until=function(y){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(y),m._update(),m},I.prototype.starting_with=function(y){var m=this._create();return m._starting_pattern=this._input.get_regexp(y,!0),m._update(),m},I.prototype.matching=function(y){var m=this._create();return m._match_pattern=this._input.get_regexp(y,!0),m._update(),m},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},P.exports.Pattern=I},function(P){function I(y,m){y=typeof y=="string"?y:y.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+m,"g")}I.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(y);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(y);return m},I.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},P.exports.Directives=I},function(P,I,y){var m=y(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(u,f){m.call(this,u,f),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),f&&(this.__template_pattern=this._input.get_regexp(f.__template_pattern),this._excluded=Object.assign(this._excluded,f._excluded),this._disabled=Object.assign(this._disabled,f._disabled));var s=new m(u);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new m,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(u){var f=this._create();return f._disabled[u]=!0,f._update(),f},c.prototype.read_options=function(u){var f=this._create();for(var s in p)f._disabled[s]=u.templating.indexOf(s)===-1;return f._update(),f},c.prototype.exclude=function(u){var f=this._create();return f._excluded[u]=!0,f._update(),f},c.prototype.read=function(){var u="";this._match_pattern?u=this._input.read(this._starting_pattern):u=this._input.read(this._starting_pattern,this.__template_pattern);for(var f=this._read_template();f;)this._match_pattern?f+=this._input.read(this._match_pattern):f+=this._input.readUntil(this.__template_pattern),u+=f,f=this._read_template();return this._until_after&&(u+=this._input.readUntilAfter(this._until_pattern)),u},c.prototype.__set_templated_pattern=function(){var u=[];this._disabled.php||u.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||u.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||u.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(u.push(this.__patterns.django._starting_pattern.source),u.push(this.__patterns.django_value._starting_pattern.source),u.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||u.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&u.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+u.join("|")+")")},c.prototype._read_template=function(){var u="",f=this._input.peek();if(f==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(u=u||this.__patterns.erb.read())}else f==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(u=u||this.__patterns.handlebars_comment.read(),u=u||this.__patterns.handlebars_unescaped.read(),u=u||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(u=u||this.__patterns.django_value.read()),this._excluded.django||(u=u||this.__patterns.django_comment.read(),u=u||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(u=u||this.__patterns.smarty_comment.read(),u=u||this.__patterns.smarty_literal.read(),u=u||this.__patterns.smarty.read()));return u},P.exports.TemplatablePattern=c}],B={};function G(P){var I=B[P];if(I!==void 0)return I.exports;var y=B[P]={exports:{}};return D[P](y,y.exports,G),y.exports}var j=G(0);k=j})();var X=k;!(se=[],W=function(){return{js_beautify:X}}.apply($e,se),W!==void 0&&(ct.exports=W))})()},"6nfa":function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___24EuS",flex_space_between:"flex_space_between___H0sq_",flex_box_vertical_center:"flex_box_vertical_center___lroQv",flex_box_center_end:"flex_box_center_end___2zqAg",flex_box_column:"flex_box_column___1sePp",row:"row___FQAuJ",title:"title___1l3-g",tagsWrap:"tagsWrap___18FE-",action:"action___asdVT",bar:"bar___M_nl0",name:"name___BKyJY",active:"active___1eybt",tagsBorderWrap:"tagsBorderWrap___1NzgL"}},"7Cbv":function(ct,$e,Q){"use strict";var se=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),W=new Uint8Array(16);function k(){if(!se)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return se(W)}var X=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function D(p){return typeof p=="string"&&X.test(p)}for(var B=D,G=[],j=0;j<256;++j)G.push((j+256).toString(16).substr(1));function P(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,u=(G[p[c+0]]+G[p[c+1]]+G[p[c+2]]+G[p[c+3]]+"-"+G[p[c+4]]+G[p[c+5]]+"-"+G[p[c+6]]+G[p[c+7]]+"-"+G[p[c+8]]+G[p[c+9]]+"-"+G[p[c+10]]+G[p[c+11]]+G[p[c+12]]+G[p[c+13]]+G[p[c+14]]+G[p[c+15]]).toLowerCase();if(!B(u))throw TypeError("Stringified UUID is invalid");return u}var I=P;function y(p,c,u){p=p||{};var f=p.random||(p.rng||k)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,c){u=u||0;for(var s=0;s<16;++s)c[u+s]=f[s];return c}return I(f)}var m=$e.a=y},"7ahc":function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return L});var se=Q("k1fw"),W=Q("0Owb"),k=Q("+L6B"),X=Q("2/Rp"),D=Q("y8nQ"),B=Q("Vl3Y"),G=Q("tJVT"),j=Q("OaEy"),P=Q("2fM7"),I=Q("q1tI"),y=Q.n(I),m=Q("VrN/"),p=Q.n(m),c=Q("p77/"),u=Q.n(c),f=Q("c5Ni"),s=Q.n(f),r=P.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},d={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};$e.b=function(S){var x=S.callback,R=S.onCancel,O=Object(I.useState)("python"),w=Object(G.a)(O,2),E=w[0],b=w[1];function l(h){b(d[h][1])}function _(h){x(h)}return y.a.createElement(B.a,Object(W.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:_}),y.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(P.a,{onChange:l},Object.keys(d).map(function(h){return y.a.createElement(r,{key:h,value:h},d[h][0])}))),y.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(L,{mode:E})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(X.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function L(S){var x=S.value,R=S.onChange,O=S.mode,w=S.options,E=w===void 0?{}:w,b=Object(I.useRef)(),l=Object(I.useState)(),_=Object(G.a)(l,2),h=_[0],g=_[1];return Object(I.useEffect)(function(){if(h){function T(N){var V=N.getValue();R&&R(V)}return h.on("change",T),function(){h.off("change",T)}}},[h,R]),Object(I.useEffect)(function(){h&&h.setOption("mode",O)},[h,O]),Object(I.useEffect)(function(){h&&((x!==h.getValue()||x==="")&&setTimeout(function(){h.setValue(x||" ")},300))},[h,x]),Object(I.useEffect)(function(){if(b.current&&!h){var T=p.a.fromTextArea(b.current,Object(se.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));g(T)}},[b.current,h]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:b}))}},"7qnI":function(ct,$e,Q){"use strict";var se=Q("5Dmo"),W=Q("3S7+"),k=Q("fWQN"),X=Q("mtLc"),D=Q("yKVA"),B=Q("879j"),G=Q("5NDa"),j=Q("5rEg"),P=Q("q1tI"),I=Q.n(P),y=Q("O2Wb"),m=Q.n(y),p=j.a.TextArea,c=function(u){Object(D.a)(s,u);var f=Object(B.a)(s);function s(){return Object(k.a)(this,s),f.apply(this,arguments)}return Object(X.a)(s,[{key:"render",value:function(){var a=this,d=this.props,L=d.index,S=d.onAnswerChange,x=d.addChildAnswer,R=d.exerciseIsPublish,O=d.answers,w=d.activeOptionErrorIndex,E=d.flex,b=E===void 0?"0 0 1000px":E;return I.a.createElement("div",{className:m.a.flex},I.a.createElement("div",{className:"".concat(m.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",L+1,"):"),I.a.createElement("div",{className:"".concat(m.a.flex," ").concat(m.a.flex1),style:{flexDirection:"column"}},O.map(function(l,_){var h="".concat(L,"-").concat(_);return I.a.createElement("div",{className:"".concat(m.a.flex," ").concat(m.a.flex1),key:_},I.a.createElement("div",{className:m.a.flex1,style:{flex:b}},I.a.createElement("div",null,I.a.createElement(p,{className:h===w?m.a.error:"",spellCheck:!1,rows:4,value:l||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(_==0?"":"(\u53EF\u9009)"),onChange:function(T){return S(L,_,T.target.value)},style:{minHeight:95}}))),!R&&I.a.createElement(I.a.Fragment,null,_!=0&&I.a.createElement(W.a,{title:"\u5220\u9664"},I.a.createElement("i",{className:"".concat(m.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return a.props.deleteChildAnswer(L,_)},style:{float:"right"}})),_===0&&I.a.createElement(W.a,{title:"\u5220\u9664"},I.a.createElement("i",{className:"".concat(m.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return a.props.deleteChildAnswermain(L,_)},style:{float:"right"}})),I.a.createElement(W.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},I.a.createElement("i",{className:"".concat(m.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return x(L)},style:{float:"right",visibility:_==O.length-1?"":"hidden"}}))))})))}}]),s}(P.Component);$e.a=c},"8EBN":function(ct,$e,Q){(function(se){se(Q("VrN/"))})(function(se){"use strict";se.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var W=0;W<se.modeInfo.length;W++){var k=se.modeInfo[W];k.mimes&&(k.mime=k.mimes[0])}se.findModeByMIME=function(X){X=X.toLowerCase();for(var D=0;D<se.modeInfo.length;D++){var B=se.modeInfo[D];if(B.mime==X)return B;if(B.mimes){for(var G=0;G<B.mimes.length;G++)if(B.mimes[G]==X)return B}}if(/\+xml$/.test(X))return se.findModeByMIME("application/xml");if(/\+json$/.test(X))return se.findModeByMIME("application/json")},se.findModeByExtension=function(X){X=X.toLowerCase();for(var D=0;D<se.modeInfo.length;D++){var B=se.modeInfo[D];if(B.ext){for(var G=0;G<B.ext.length;G++)if(B.ext[G]==X)return B}}},se.findModeByFileName=function(X){for(var D=0;D<se.modeInfo.length;D++){var B=se.modeInfo[D];if(B.file&&B.file.test(X))return B}var G=X.lastIndexOf("."),j=G>-1&&X.substring(G+1,X.length);if(j)return se.findModeByExtension(j)},se.findModeByName=function(X){X=X.toLowerCase();for(var D=0;D<se.modeInfo.length;D++){var B=se.modeInfo[D];if(B.name.toLowerCase()==X)return B;if(B.alias){for(var G=0;G<B.alias.length;G++)if(B.alias[G].toLowerCase()==X)return B}}}})},"8WcF":function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___2fahw",flex_space_between:"flex_space_between___1h4HM",flex_box_vertical_center:"flex_box_vertical_center___2kxeE",flex_box_center_end:"flex_box_center_end___OjPB4",flex_box_column:"flex_box_column___3zY1h",orderWrap:"orderWrap___VQuq1",orderIconWrap:"orderIconWrap___18q7W",orderAsc:"orderAsc___3WBGg",orderDesc:"orderDesc____ipxK",active:"active___3EMfI",cursorPointer:"cursorPointer___3og_L",orderTextWrap:"orderTextWrap___XQlmv"}},"8hTe":function(ct,$e,Q){ct.exports={button:"button___1wy9m"}},"8mKB":function(ct,$e,Q){"use strict";var se=Q("rePB"),W=Q("1OyB"),k=Q("vuIU"),X=Q("Ji7U"),D=Q("md7G"),B=Q("foSv"),G=Q("q1tI"),j=Q.n(G),P=Q("m+aA"),I=Q("TSYQ"),y=Q.n(I),m=Q("4IlW");function p(E){var b=E.pageXOffset,l="scrollLeft";if(typeof b!="number"){var _=E.document;b=_.documentElement[l],typeof b!="number"&&(b=_.body[l])}return b}function c(E){var b,l,_=E.ownerDocument,h=_.body,g=_&&_.documentElement,T=E.getBoundingClientRect();return b=T.left,l=T.top,b-=g.clientLeft||h.clientLeft||0,l-=g.clientTop||h.clientTop||0,{left:b,top:l}}function u(E){var b=c(E),l=E.ownerDocument,_=l.defaultView||l.parentWindow;return b.left+=p(_),b.left}function f(E){var b=s();return function(){var _=Object(B.a)(E),h;if(b){var g=Object(B.a)(this).constructor;h=Reflect.construct(_,arguments,g)}else h=_.apply(this,arguments);return Object(D.a)(this,h)}}function s(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(E){return!1}}var r=function(E){Object(X.a)(l,E);var b=f(l);function l(){var _;return Object(W.a)(this,l),_=b.apply(this,arguments),_.onHover=function(h){var g=_.props,T=g.onHover,N=g.index;T(h,N)},_.onClick=function(h){var g=_.props,T=g.onClick,N=g.index;T(h,N)},_.onKeyDown=function(h){var g=_.props,T=g.onClick,N=g.index;h.keyCode===13&&T(h,N)},_}return Object(k.a)(l,[{key:"getClassName",value:function(){var h=this.props,g=h.prefixCls,T=h.index,N=h.value,V=h.allowHalf,Y=h.focused,U=T+1,A=g;return N===0&&T===0&&Y?A+=" ".concat(g,"-focused"):V&&N+.5>=U&&N<U?(A+=" ".concat(g,"-half ").concat(g,"-active"),Y&&(A+=" ".concat(g,"-focused"))):(A+=U<=N?" ".concat(g,"-full"):" ".concat(g,"-zero"),U===N&&Y&&(A+=" ".concat(g,"-focused"))),A}},{key:"render",value:function(){var h=this.onHover,g=this.onClick,T=this.onKeyDown,N=this.props,V=N.disabled,Y=N.prefixCls,U=N.character,A=N.characterRender,J=N.index,ne=N.count,oe=N.value,fe=typeof U=="function"?U(this.props):U,ke=j.a.createElement("li",{className:this.getClassName()},j.a.createElement("div",{onClick:V?null:g,onKeyDown:V?null:T,onMouseMove:V?null:h,role:"radio","aria-checked":oe>J?"true":"false","aria-posinset":J+1,"aria-setsize":ne,tabIndex:V?-1:0},j.a.createElement("div",{className:"".concat(Y,"-first")},fe),j.a.createElement("div",{className:"".concat(Y,"-second")},fe)));return A&&(ke=A(ke,this.props)),ke}}]),l}(j.a.Component);function a(E,b){var l=Object.keys(E);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(E);b&&(_=_.filter(function(h){return Object.getOwnPropertyDescriptor(E,h).enumerable})),l.push.apply(l,_)}return l}function d(E){for(var b=1;b<arguments.length;b++){var l=arguments[b]!=null?arguments[b]:{};b%2?a(Object(l),!0).forEach(function(_){Object(se.a)(E,_,l[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(l)):a(Object(l)).forEach(function(_){Object.defineProperty(E,_,Object.getOwnPropertyDescriptor(l,_))})}return E}function L(E){var b=S();return function(){var _=Object(B.a)(E),h;if(b){var g=Object(B.a)(this).constructor;h=Reflect.construct(_,arguments,g)}else h=_.apply(this,arguments);return Object(D.a)(this,h)}}function S(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(E){return!1}}function x(){}var R=function(E){Object(X.a)(l,E);var b=L(l);function l(_){var h;Object(W.a)(this,l),h=b.call(this,_),h.onHover=function(T,N){var V=h.props.onHoverChange,Y=h.getStarValue(N,T.pageX),U=h.state.cleanedValue;Y!==U&&h.setState({hoverValue:Y,cleanedValue:null}),V(Y)},h.onMouseLeave=function(){var T=h.props.onHoverChange;h.setState({hoverValue:void 0,cleanedValue:null}),T(void 0)},h.onClick=function(T,N){var V=h.props.allowClear,Y=h.state.value,U=h.getStarValue(N,T.pageX),A=!1;V&&(A=U===Y),h.onMouseLeave(),h.changeValue(A?0:U),h.setState({cleanedValue:A?U:null})},h.onFocus=function(){var T=h.props.onFocus;h.setState({focused:!0}),T&&T()},h.onBlur=function(){var T=h.props.onBlur;h.setState({focused:!1}),T&&T()},h.onKeyDown=function(T){var N=T.keyCode,V=h.props,Y=V.count,U=V.allowHalf,A=V.onKeyDown,J=V.direction,ne=J==="rtl",oe=h.state.value;N===m.a.RIGHT&&oe<Y&&!ne?(U?oe+=.5:oe+=1,h.changeValue(oe),T.preventDefault()):N===m.a.LEFT&&oe>0&&!ne||N===m.a.RIGHT&&oe>0&&ne?(U?oe-=.5:oe-=1,h.changeValue(oe),T.preventDefault()):N===m.a.LEFT&&oe<Y&&ne&&(U?oe+=.5:oe+=1,h.changeValue(oe),T.preventDefault()),A&&A(T)},h.saveRef=function(T){return function(N){h.stars[T]=N}},h.saveRate=function(T){h.rate=T};var g=_.value;return g===void 0&&(g=_.defaultValue),h.stars={},h.state={value:g,focused:!1,cleanedValue:null},h}return Object(k.a)(l,[{key:"componentDidMount",value:function(){var h=this.props,g=h.autoFocus,T=h.disabled;g&&!T&&this.focus()}},{key:"getStarDOM",value:function(h){return Object(P.a)(this.stars[h])}},{key:"getStarValue",value:function(h,g){var T=this.props,N=T.allowHalf,V=T.direction,Y=V==="rtl",U=h+1;if(N){var A=this.getStarDOM(h),J=u(A),ne=A.clientWidth;(Y&&g-J>ne/2||!Y&&g-J<ne/2)&&(U-=.5)}return U}},{key:"focus",value:function(){var h=this.props.disabled;h||this.rate.focus()}},{key:"blur",value:function(){var h=this.props.disabled;h||this.rate.blur()}},{key:"changeValue",value:function(h){var g=this.props.onChange;"value"in this.props||this.setState({value:h}),g(h)}},{key:"render",value:function(){for(var h=this.props,g=h.count,T=h.allowHalf,N=h.style,V=h.prefixCls,Y=h.disabled,U=h.className,A=h.character,J=h.characterRender,ne=h.tabIndex,oe=h.direction,fe=this.state,ke=fe.value,Oe=fe.hoverValue,Me=fe.focused,Be=[],Pe=Y?"".concat(V,"-disabled"):"",be=0;be<g;be+=1)Be.push(j.a.createElement(r,{ref:this.saveRef(be),index:be,count:g,disabled:Y,prefixCls:"".concat(V,"-star"),allowHalf:T,value:Oe===void 0?ke:Oe,onClick:this.onClick,onHover:this.onHover,key:be,character:A,characterRender:J,focused:Me}));var le=y()(V,Pe,U,Object(se.a)({},"".concat(V,"-rtl"),oe==="rtl"));return j.a.createElement("ul",{className:le,style:N,onMouseLeave:Y?null:this.onMouseLeave,tabIndex:Y?-1:ne,onFocus:Y?null:this.onFocus,onBlur:Y?null:this.onBlur,onKeyDown:Y?null:this.onKeyDown,ref:this.saveRate,role:"radiogroup"},Be)}}],[{key:"getDerivedStateFromProps",value:function(h,g){return"value"in h&&h.value!==void 0?d(d({},g),{},{value:h.value}):g}}]),l}(j.a.Component);R.defaultProps={defaultValue:0,count:5,allowHalf:!1,allowClear:!0,style:{},prefixCls:"rc-rate",onChange:x,character:"\u2605",onHoverChange:x,tabIndex:0,direction:"ltr"};var O=R,w=$e.a=O},"9Bee":function(ct,$e,Q){"use strict";var se=Q("DYRE"),W=Q("zeV3"),k=Q("+L6B"),X=Q("2/Rp"),D=Q("k1fw"),B=Q("9og8"),G=Q("tJVT"),j=Q("WmNS"),P=Q.n(j),I=Q("q1tI"),y=Q.n(I),m=Q("vg9a"),p=Q("DlQD"),c=Q.n(p),u=Q("rUJ1");function f(K,v){var C=K.match(/^(\s+)(?:```)/);if(C===null)return v;var F=C[1];return v.split(`
|
|
`).map(function(q){var H=q.match(/^\s+/);if(H===null)return q;var ue=Object(G.a)(H,1),He=ue[0];return He.length>=F.length?q.slice(F.length):q}).join(`
|
|
`)}var s=[],r=["<ul>"],a=new c.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function L(){s.length=0,r=["<ul>"]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(K,v,C,F){if(v>=K.length||K[v].level<=C)return v;var q=K[v];F.push("<li><a href='#"+q.anchor+"'>"+q.text+"</a>"),v++;var H=[];return v=x(K,v,q.level,H),H.length>0&&(F.push("<ul>"),H.forEach(function(ue){F.push(ue)}),F.push("</ul>")),F.push("</li>"),v=x(K,v,C,F),v}function R(){return x(s,0,0,r),r.push("</ul>"),r.join("")}var O={heading:function(v){var C=d.exec(v);if(C)return{type:"heading",raw:C[0],depth:C[1].length,text:C[2]}},fences:function(v){var C=this.rules.block.fences.exec(v);if(C){var F=C[0],q=f(F,C[3]||""),H=C[2]?C[2].trim():C[2];if(["latex","katex","math"].indexOf(H)>=0){var ue=b(),He=q;q=ue,l[ue]={type:"block",expression:He}}return{type:"code",raw:F,lang:H,text:q}}}},w=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,b=function(){return"__special_katext_id_".concat(E++,"__")},l={};function _(){return l}function h(){E=0,l={}}function g(K){return K=K.replace(w,function(v,C){var F=b();return l[F]={type:"inline",expression:C},F}),K}var T=a.listitem;a.listitem=function(K){return T(g(K))};var N=a.paragraph;a.paragraph=function(K){return N(g(K))};var V=a.tablecell;a.tablecell=function(K,v){return V(g(K),v)},a.code=function(K,v,C){var F=(v||"").match(/\S*/)[0];return F?["latex","katex","math"].indexOf(F)>=0?"<p class='editormd-tex'>".concat(K,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(v,'">').concat(C?K:Object(u.escape)(K,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(C?K:Object(u.escape)(K,!0))+"</code></pre>"},a.heading=function(K,v,C){var F=this.options.headerPrefix+C.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:F,level:v,text:K}),"<h"+v+' id="'+F+'">'+K+"</h"+v+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:O,renderer:a});var Y=c.a,U=Q("SJMd"),A=Q("ulZh"),J=Q.n(A),ne=Q("m3rI"),oe=Q("Oy/b"),fe=Q("p5ED"),ke=Q("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Oe=function(K,v){return(Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,F){C.__proto__=F}||function(C,F){for(var q in F)Object.prototype.hasOwnProperty.call(F,q)&&(C[q]=F[q])})(K,v)};function Me(K,v){function C(){this.constructor=K}Oe(K,v),K.prototype=v===null?Object.create(v):(C.prototype=v.prototype,new C)}function Be(K,v,C,F){return new(C||(C=Promise))(function(q,H){function ue(At){try{Xe(F.next(At))}catch(We){H(We)}}function He(At){try{Xe(F.throw(At))}catch(We){H(We)}}function Xe(At){var We;At.done?q(At.value):(We=At.value,We instanceof C?We:new C(function(mt){mt(We)})).then(ue,He)}Xe((F=F.apply(K,v||[])).next())})}function Pe(K,v){var C,F,q,H,ue={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return H={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function He(Xe){return function(At){return function(We){if(C)throw new TypeError("Generator is already executing.");for(;ue;)try{if(C=1,F&&(q=2&We[0]?F.return:We[0]?F.throw||((q=F.return)&&q.call(F),0):F.next)&&!(q=q.call(F,We[1])).done)return q;switch(F=0,q&&(We=[2&We[0],q.value]),We[0]){case 0:case 1:q=We;break;case 4:return ue.label++,{value:We[1],done:!1};case 5:ue.label++,F=We[1],We=[0];continue;case 7:We=ue.ops.pop(),ue.trys.pop();continue;default:if(!(q=ue.trys,(q=q.length>0&&q[q.length-1])||We[0]!==6&&We[0]!==2)){ue=0;continue}if(We[0]===3&&(!q||We[1]>q[0]&&We[1]<q[3])){ue.label=We[1];break}if(We[0]===6&&ue.label<q[1]){ue.label=q[1],q=We;break}if(q&&ue.label<q[2]){ue.label=q[2],ue.ops.push(We);break}q[2]&&ue.ops.pop(),ue.trys.pop();continue}We=v.call(K,ue)}catch(mt){We=[6,mt],F=0}finally{C=q=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([Xe,At])}}}function be(){for(var K=0,v=0,C=arguments.length;v<C;v++)K+=arguments[v].length;var F=Array(K),q=0;for(v=0;v<C;v++)for(var H=arguments[v],ue=0,He=H.length;ue<He;ue++,q++)F[q]=H[ue];return F}var le=function(){function K(){}return K.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},K.setAttributes=function(v,C){for(var F=0,q=C;F<q.length;F++){var H=q[F],ue=H[0],He=H[1];v.setAttribute(ue,He)}},K.createRect=function(v,C,F){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",v.toString()),q.setAttribute("height",C.toString()),F&&K.setAttributes(q,F),q},K.createLine=function(v,C,F,q,H){var ue=document.createElementNS("http://www.w3.org/2000/svg","line");return ue.setAttribute("x1",v.toString()),ue.setAttribute("y1",C.toString()),ue.setAttribute("x2",F.toString()),ue.setAttribute("y2",q.toString()),H&&K.setAttributes(ue,H),ue},K.createPolygon=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg","polygon");return F.setAttribute("points",v),C&&K.setAttributes(F,C),F},K.createCircle=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg","circle");return F.setAttribute("cx",(v/2).toString()),F.setAttribute("cy",(v/2).toString()),F.setAttribute("r",v.toString()),C&&K.setAttributes(F,C),F},K.createEllipse=function(v,C,F){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(v/2).toString()),q.setAttribute("cy",(C/2).toString()),q.setAttribute("rx",(v/2).toString()),q.setAttribute("ry",(C/2).toString()),F&&K.setAttributes(q,F),q},K.createGroup=function(v){var C=document.createElementNS("http://www.w3.org/2000/svg","g");return v&&K.setAttributes(C,v),C},K.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},K.createMarker=function(v,C,F,q,H,ue,He){var Xe=document.createElementNS("http://www.w3.org/2000/svg","marker");return K.setAttributes(Xe,[["id",v],["orient",C],["markerWidth",F.toString()],["markerHeight",q.toString()],["refX",H.toString()],["refY",ue.toString()]]),Xe.appendChild(He),Xe},K.createText=function(v){var C=document.createElementNS("http://www.w3.org/2000/svg","text");return C.setAttribute("x","0"),C.setAttribute("y","0"),v&&K.setAttributes(C,v),C},K.createTSpan=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg","tspan");return F.textContent=v,C&&K.setAttributes(F,C),F},K.createImage=function(v){var C=document.createElementNS("http://www.w3.org/2000/svg","image");return v&&K.setAttributes(C,v),C},K.createPoint=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return F.x=v,F.y=C,F},K.createPath=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg","path");return F.setAttribute("d",v),C&&K.setAttributes(F,C),F},K}(),Le=function(){function K(){}return K.addKey=function(v){K.key=v},Object.defineProperty(K,"isLicensed",{get:function(){return!!K.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(K.key)},enumerable:!1,configurable:!0}),K}(),tt=function(){function K(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return K.prototype.rasterize=function(v,C,F){var q=this;return new Promise(function(H){var ue=F!==void 0?F:document.createElement("canvas");v===null&&(q.markersOnly=!0,q.naturalSize=!1);var He=document.createElementNS("http://www.w3.org/2000/svg","svg");He.setAttribute("xmlns","http://www.w3.org/2000/svg"),He.setAttribute("width",C.width.baseVal.valueAsString),He.setAttribute("height",C.height.baseVal.valueAsString),He.setAttribute("viewBox","0 0 "+C.viewBox.baseVal.width.toString()+" "+C.viewBox.baseVal.height.toString()),He.innerHTML=C.innerHTML,q.naturalSize===!0?(He.width.baseVal.value=v.naturalWidth,He.height.baseVal.value=v.naturalHeight):q.width!==void 0&&q.height!==void 0&&(He.width.baseVal.value=q.width,He.height.baseVal.value=q.height),ue.width=He.width.baseVal.value,ue.height=He.height.baseVal.value;var Xe=He.outerHTML,At=ue.getContext("2d");q.markersOnly!==!0&&At.drawImage(v,0,0,ue.width,ue.height);var We=window.URL,mt=new Image(ue.width,ue.height);mt.setAttribute("crossOrigin","anonymous");var Zt=new Blob([Xe],{type:"image/svg+xml"}),Fn=We.createObjectURL(Zt);mt.onload=function(){At.drawImage(mt,0,0),We.revokeObjectURL(Fn);var Zn=ue.toDataURL(q.imageType,q.imageQuality);H(Zn)},mt.src=Fn})},K}(),nt=function(){},lt=function(){function K(v){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+v+"_"}return Object.defineProperty(K.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),K.prototype.addClass=function(v){return this.styleSheet===void 0&&this.addStyleSheet(),v.name=""+this.classNamePrefix+v.localName,this.classes.push(v),this.styleSheet.sheet.insertRule("."+v.name+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length),v},K.prototype.addRule=function(v){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(v),this.styleSheet.sheet.insertRule(v.selector+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length)},K.prototype.addStyleSheet=function(){var v;this.styleSheet=document.createElement("style"),((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).appendChild(this.styleSheet),this.addRule(new Et("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Et("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Et("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ve("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ve("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},K.prototype.removeStyleSheet=function(){var v;this.styleSheet&&(((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},K}(),Et=function(K,v){this.selector=K,this.style=v},Ve=function(K,v){this.localName=K,this.style=v},Qe=function(){function K(v,C,F,q,H){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=v,this.displayMode=C,this.markerItems=F,this.uiStyleSettings=q,this.styles=H,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return K.prototype.show=function(v){var C=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var F=document.createElement("div");F.className=this.toolbarBlockStyleClass.name,F.style.whiteSpace="nowrap",this.uiContainer.appendChild(F),this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(H){var ue=document.createElement("div");ue.className=""+C.toolbarButtonStyleClass.name,ue.setAttribute("data-type-name",H.typeName),ue.innerHTML=H.icon,ue.addEventListener("click",function(){C.markerToolbarButtonClicked(ue,H)}),C.buttons.push(ue),C.markerButtons.push(ue)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(q,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},K.prototype.addButtonClickListener=function(v){this.buttonClickListeners.push(v)},K.prototype.removeButtonClickListener=function(v){this.buttonClickListeners.indexOf(v)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(v),1)},K.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},K.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var v=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var C=0;C<this.markerButtons.length;C++)C<v||C===v&&this.markerButtons.length-1===v?this.markerButtonBlock.appendChild(this.markerButtons[C]):(C===v&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[C]))}},K.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},K.prototype.resetButtonStyles=function(){var v=this;this.buttons.forEach(function(C){C.className=C.className.replace(v.uiStyleSettings.toolbarButtonStyleColorsClassName?v.uiStyleSettings.toolbarButtonStyleColorsClassName:v.toolbarButtonStyleColorsClass.name,"").trim(),C.className=C.className.replace(v.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?v.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:v.toolbarActiveButtonStyleColorsClass.name,"").trim(),C.className+=" "+(v.uiStyleSettings.toolbarButtonStyleColorsClassName?v.uiStyleSettings.toolbarButtonStyleColorsClassName:v.toolbarButtonStyleColorsClass.name)})},K.prototype.addActionButton=function(v,C,F){var q=this,H=document.createElement("div");switch(H.className=""+this.toolbarButtonStyleClass.name,H.innerHTML=C,H.setAttribute("data-action",F),H.addEventListener("click",function(){q.actionToolbarButtonClicked(H,F)}),F){case"select":H.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":H.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":H.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":H.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":H.style.fill=this.uiStyleSettings.closeButtonColor}v.appendChild(H),this.buttons.push(H)},K.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ve("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Ve("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ve("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ve("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Ve("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var v=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ve("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*v)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*v)+`px;
|
|
padding: `+v+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ve("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ve("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Et("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Et("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},K.prototype.markerToolbarButtonClicked=function(v,C){this.setActiveButton(v),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(F){return F("marker",C)}),this.markerButtonOverflowBlock.style.display="none"},K.prototype.actionToolbarButtonClicked=function(v,C){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(F){return F("action",C)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},K.prototype.setActiveButton=function(v){this.resetButtonStyles(),v.className=v.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),v.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},K.prototype.setActiveMarkerButton=function(v){var C=this.markerButtons.find(function(F){return F.getAttribute("data-type-name")===v});C&&this.setActiveButton(C)},K.prototype.setCurrentMarker=function(v){var C=this;this.currentMarker=v,this.buttons.filter(function(F){return/delete|notes/.test(F.getAttribute("data-action"))}).forEach(function(F){C.currentMarker===void 0?(F.style.fillOpacity="0.4",F.style.pointerEvents="none"):(F.style.fillOpacity="1",F.style.pointerEvents="all")})},K}(),ut=function(){function K(v,C,F,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=v,this.displayMode=C,this.uiStyleSettings=F,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return K.prototype.addStyles=function(){var v;this.toolboxStyleClass=this.styles.addClass(new Ve("toolbox",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: sans-serif;
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Ve("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var C=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ve("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ve("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ve("toolbox-panel-row",`
|
|
display: flex;
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
cursor: default;
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
box-sizing: content-box;
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Ve("toolbox-panel-row_colors",`
|
|
background-color: `+((v=this.uiStyleSettings.toolboxBackgroundColor)!==null&&v!==void 0?v:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ve("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
|
|
padding: `+C+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ve("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ve("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Et("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Et("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},K.prototype.show=function(v){var C;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolboxStyleClass.name+" "+((C=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},K.prototype.setPanelButtons=function(v){var C,F,q=this;this.panels=v,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((C=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((F=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(H){var ue;H.uiStyleSettings=q.uiStyleSettings;var He=document.createElement("div");He.className=q.toolboxButtonStyleClass.name+" "+((ue=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ue!==void 0?ue:q.toolboxButtonStyleColorsClass.name),He.innerHTML=H.icon,He.title=H.title,He.addEventListener("click",function(){q.panelButtonClick(H)}),q.panelButtons.push(He),q.buttonRow.appendChild(He)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},K.prototype.panelButtonClick=function(v){var C=this,F=-1;if(v!==this.activePanel){F=this.panels.indexOf(v),this.panelRow.innerHTML="";var q=v.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=v}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){C.displayMode==="inline"?C.panelRow.style.display="none":C.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(H,ue){var He,Xe;H.className=C.toolboxButtonStyleClass.name+" "+(ue===F?""+((He=C.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&He!==void 0?He:C.toolboxActiveButtonStyleColorsClass.name):""+((Xe=C.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Xe!==void 0?Xe:C.toolboxButtonStyleColorsClass.name))})},K}(),gt=function(K,v){this.title=K,this.icon=v},ot=function(K){function v(C,F,q,H){var ue=K.call(this,C,H||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ue.colors=[],ue.addTransparent=!1,ue.colorBoxes=[],ue.colors=F,ue.currentColor=q,ue.setCurrentColor=ue.setCurrentColor.bind(ue),ue.getColorBox=ue.getColorBox.bind(ue),ue}return Me(v,K),v.prototype.getUi=function(){var C=this,F=document.createElement("div");return F.style.overflow="hidden",F.style.whiteSpace="nowrap",this.colors.forEach(function(q){var H=C.getColorBox(q);F.appendChild(H),C.colorBoxes.push(H)}),F},v.prototype.getColorBox=function(C){var F=this,q=this.uiStyleSettings.toolbarHeight/4,H=this.uiStyleSettings.toolbarHeight-q,ue=document.createElement("div");ue.style.display="inline-block",ue.style.boxSizing="content-box",ue.style.width=H-2+"px",ue.style.height=H-2+"px",ue.style.padding="1px",ue.style.marginRight="2px",ue.style.marginBottom="2px",ue.style.borderWidth="2px",ue.style.borderStyle="solid",ue.style.borderRadius=(H+2)/2+"px",ue.style.borderColor=C===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ue.addEventListener("click",function(){F.setCurrentColor(C,ue)});var He=document.createElement("div");return He.style.display="inline-block",He.style.width=H-2+"px",He.style.height=H-2+"px",He.style.backgroundColor=C,He.style.borderRadius=H/2+"px",C==="transparent"&&(He.style.fill=this.uiStyleSettings.toolboxAccentColor,He.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),ue.appendChild(He),ue},v.prototype.setCurrentColor=function(C,F){var q=this;this.currentColor=C,this.colorBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(C)},v}(gt),it=function(){function K(v,C,F){this._state="new",this._isSelected=!1,this._container=v,this._overlayContainer=C,this.globalSettings=F,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(K.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(v){return!1},Object.defineProperty(K.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),K.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},K.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},K.prototype.pointerDown=function(v,C){},K.prototype.dblClick=function(v,C){},K.prototype.manipulate=function(v){},K.prototype.pointerUp=function(v){this.stateChanged()},K.prototype.dispose=function(){},K.prototype.addMarkerVisualToContainer=function(v){this.container.childNodes.length>0?this.container.insertBefore(v,this.container.childNodes[0]):this.container.appendChild(v)},K.prototype.getState=function(){return{typeName:K.typeName,state:this.state,notes:this.notes}},K.prototype.restoreState=function(v){this._state=v.state,this.notes=v.notes},K.prototype.scale=function(v,C){},K.prototype.colorChanged=function(v){this.onColorChanged&&this.onColorChanged(v),this.stateChanged()},K.prototype.fillColorChanged=function(v){this.onFillColorChanged&&this.onFillColorChanged(v),this.stateChanged()},K.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var v=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),v.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(v)&&this.onStateChanged(this)}},K.typeName="MarkerBase",K}(),rt=function(){function K(){this.findGripByVisual=this.findGripByVisual.bind(this)}return K.prototype.findGripByVisual=function(v){return this.topLeft.ownsTarget(v)?this.topLeft:this.topCenter.ownsTarget(v)?this.topCenter:this.topRight.ownsTarget(v)?this.topRight:this.centerLeft.ownsTarget(v)?this.centerLeft:this.centerRight.ownsTarget(v)?this.centerRight:this.bottomLeft.ownsTarget(v)?this.bottomLeft:this.bottomCenter.ownsTarget(v)?this.bottomCenter:this.bottomRight.ownsTarget(v)?this.bottomRight:void 0},K}(),Pt=function(){function K(){this.GRIP_SIZE=10,this.visual=le.createGroup(),this.visual.appendChild(le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(le.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return K.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},K}(),It=function(){function K(){}return K.toITransformMatrix=function(v){return{a:v.a,b:v.b,c:v.c,d:v.d,e:v.e,f:v.f}},K.toSVGMatrix=function(v,C){return v.a=C.a,v.b=C.b,v.c=C.c,v.d=C.d,v.e=C.e,v.f=C.f,v},K}(),wt=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.left=0,H.top=0,H.width=0,H.height=0,H.defaultSize={x:50,y:20},H.offsetX=0,H.offsetY=0,H.rotationAngle=0,H.CB_DISTANCE=10,H._suppressMarkerCreateEvent=!1,H.container.transform.baseVal.appendItem(le.createTransform()),H.setupControlBox(),H}return Me(v,K),Object.defineProperty(v.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"visual",{get:function(){return this._visual},set:function(C){this._visual=C;var F=le.createTransform();this._visual.transform.baseVal.appendItem(F)},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(C){return!!K.prototype.ownsTarget.call(this,C)||!!(this.controlGrips.findGripByVisual(C)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(C))},v.prototype.pointerDown=function(C,F){K.prototype.pointerDown.call(this,C,F),this.state==="new"&&(this.left=C.x,this.top=C.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var q=this.unrotatePoint(C);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(F),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(F)){this.activeGrip=this.rotatorGrip;var H=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=H.x-this.width/2,this.top=H.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ue=this.container.transform.baseVal.getItem(0);ue.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ue,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},v.prototype.pointerUp=function(C){var F=this.state;K.prototype.pointerUp.call(this,C),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(C),this._state="select",F==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},v.prototype.moveVisual=function(C){this.visual.style.transform="translate("+C.x+"px, "+C.y+"px)"},v.prototype.manipulate=function(C){var F=this.unrotatePoint(C);this.state==="creating"?this.resize(C):this.state==="move"?(this.left=this.manipulationStartLeft+(F.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(F.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(F):this.state==="rotate"&&this.rotate(C)},v.prototype.resize=function(C){var F=this.manipulationStartLeft,q=this.manipulationStartWidth,H=this.manipulationStartTop,ue=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:F=this.manipulationStartLeft+C.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-F;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+C.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:H=this.manipulationStartTop+C.y-this.manipulationStartY,ue=this.manipulationStartHeight+this.manipulationStartTop-H;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ue=this.manipulationStartHeight+C.y-this.manipulationStartY}q>=0?(this.left=F,this.width=q):(this.left=F+q,this.width=-q),ue>=0?(this.top=H,this.height=ue):(this.top=H+ue,this.height=-ue),this.setSize()},v.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},v.prototype.rotate=function(C){if(Math.abs(C.x-this.centerX)>.1){var F=Math.sign(C.x-this.centerX);this.rotationAngle=180*Math.atan((C.y-this.centerY)/(C.x-this.centerX))/Math.PI+90*F,this.applyRotation()}},v.prototype.applyRotation=function(){var C=this.container.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(C,0)},v.prototype.rotatePoint=function(C){if(this.rotationAngle===0)return C;var F=this.container.getCTM(),q=le.createPoint(C.x,C.y);return{x:(q=q.matrixTransform(F)).x,y:q.y}},v.prototype.unrotatePoint=function(C){if(this.rotationAngle===0)return C;var F=this.container.getCTM();F=F.inverse();var q=le.createPoint(C.x,C.y);return{x:(q=q.matrixTransform(F)).x,y:q.y}},v.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=le.createGroup();var C=le.createTransform();C.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(C),this.container.appendChild(this.controlBox),this.controlRect=le.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=le.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new rt,this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){var C=this.controlBox.transform.baseVal.getItem(0);C.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(C,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},v.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},v.prototype.createGrip=function(){var C=new Pt;return C.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(C.visual),C},v.prototype.positionGrips=function(){var C=this.controlGrips.topLeft.GRIP_SIZE,F=-C/2,q=F,H=(this.width+this.CB_DISTANCE)/2-C/2,ue=(this.height+this.CB_DISTANCE)/2-C/2,He=this.height+this.CB_DISTANCE-C/2,Xe=this.width+this.CB_DISTANCE-C/2;this.positionGrip(this.controlGrips.topLeft.visual,F,q),this.positionGrip(this.controlGrips.topCenter.visual,H,q),this.positionGrip(this.controlGrips.topRight.visual,Xe,q),this.positionGrip(this.controlGrips.centerLeft.visual,F,ue),this.positionGrip(this.controlGrips.centerRight.visual,Xe,ue),this.positionGrip(this.controlGrips.bottomLeft.visual,F,He),this.positionGrip(this.controlGrips.bottomCenter.visual,H,He),this.positionGrip(this.controlGrips.bottomRight.visual,Xe,He),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,H,q-3*this.CB_DISTANCE)},v.prototype.positionGrip=function(C,F,q){var H=C.transform.baseVal.getItem(0);H.setTranslate(F,q),C.transform.baseVal.replaceItem(H,0)},v.prototype.hideControlBox=function(){this.controlBox.style.display="none"},v.prototype.showControlBox=function(){this.controlBox.style.display=""},v.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:It.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:It.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},K.prototype.getState.call(this))},v.prototype.restoreState=function(C){K.prototype.restoreState.call(this,C);var F=C;this.left=F.left,this.top=F.top,this.width=F.width,this.height=F.height,this.rotationAngle=F.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(It.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,F.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(It.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,F.containerTransformMatrix))},v.prototype.scale=function(C,F){K.prototype.scale.call(this,C,F);var q=this.rotatePoint({x:this.left,y:this.top}),H=this.unrotatePoint({x:q.x*C,y:q.y*F});this.left=H.x,this.top=H.y,this.width=this.width*C,this.height=this.height*F,this.adjustControlBox()},v}(it),Tt=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.fillColor="transparent",H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.opacity=1,H.setStrokeColor=H.setStrokeColor.bind(H),H.setFillColor=H.setFillColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.createVisual=H.createVisual.bind(H),H}return Me(v,K),v.prototype.ownsTarget=function(C){return!(!K.prototype.ownsTarget.call(this,C)&&C!==this.visual)},v.prototype.createVisual=function(){this.visual=le.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,F){K.prototype.pointerDown.call(this,C,F),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},v.prototype.manipulate=function(C){K.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){K.prototype.resize.call(this,C),this.setSize()},v.prototype.setSize=function(){K.prototype.setSize.call(this),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(C){K.prototype.pointerUp.call(this,C),this.setSize()},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},v.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},K.prototype.getState.call(this))},v.prototype.restoreState=function(C){var F=C;this.fillColor=F.fillColor,this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.opacity=F.opacity,this.createVisual(),K.prototype.restoreState.call(this,C),this.setSize()},v.prototype.scale=function(C,F){K.prototype.scale.call(this,C,F),this.setSize()},v.title="Rectangle marker",v}(wt),Wt=function(K){function v(C,F,q,H){var ue=K.call(this,C,H||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ue.widths=[],ue.widthBoxes=[],ue.widths=F,ue.currentWidth=q,ue.setCurrentWidth=ue.setCurrentWidth.bind(ue),ue}return Me(v,K),v.prototype.getUi=function(){var C=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",this.widths.forEach(function(q){var H=document.createElement("div");H.style.display="flex",H.style.flexGrow="2",H.style.alignItems="center",H.style.justifyContent="space-between",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.borderColor=q===C.currentWidth?C.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){C.setCurrentWidth(q,H)}),F.appendChild(H);var ue=document.createElement("div");ue.innerText=q.toString(),ue.style.marginRight="5px",H.appendChild(ue);var He=document.createElement("div");He.style.minHeight="20px",He.style.flexGrow="2",He.style.display="flex",He.style.alignItems="center";var Xe=document.createElement("hr");Xe.style.minWidth="20px",Xe.style.border="0px",Xe.style.borderTop=q+"px solid "+C.uiStyleSettings.toolboxColor,Xe.style.flexGrow="2",He.appendChild(Xe),H.appendChild(He),C.widthBoxes.push(H)}),F},v.prototype.setCurrentWidth=function(C,F){var q=this;this.currentWidth=C,this.widthBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},v}(gt),Ct=function(K){function v(C,F,q,H){var ue=K.call(this,C,H||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ue.styles=[],ue.styleBoxes=[],ue.styles=F,ue.currentStyle=q,ue.setCurrentStyle=ue.setCurrentStyle.bind(ue),ue}return Me(v,K),v.prototype.getUi=function(){var C=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",this.styles.forEach(function(q){var H=document.createElement("div");H.style.display="flex",H.style.alignItems="center",H.style.justifyContent="space-between",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.overflow="hidden",H.style.maxWidth=100/C.styles.length-5+"%",H.style.borderColor=q===C.currentStyle?C.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){C.setCurrentStyle(q,H)}),F.appendChild(H);var ue=document.createElement("div");ue.style.minHeight="20px",ue.style.flexGrow="2",ue.style.overflow="hidden";var He=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+C.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(q!==""?'stroke-dasharray="'+q+'"':"")+` />
|
|
</svg>`;ue.innerHTML=He,H.appendChild(ue),C.styleBoxes.push(H)}),F},v.prototype.setCurrentStyle=function(C,F){var q=this;this.currentStyle=C,this.styleBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},v}(gt),bt=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.strokeColor=q.defaultColor,H.strokeWidth=q.defaultStrokeWidth,H.strokeDasharray=q.defaultStrokeDasharray,H.strokePanel=new ot("Line color",q.defaultColorSet,q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new Wt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ct("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return Me(v,K),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=K.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="FrameMarker",v.title="Frame marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',v}(Tt),ze=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Kt=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.x1=0,H.y1=0,H.x2=0,H.y2=0,H.defaultLength=50,H.manipulationStartX=0,H.manipulationStartY=0,H.manipulationStartX1=0,H.manipulationStartY1=0,H.manipulationStartX2=0,H.manipulationStartY2=0,H.setupControlBox(),H}return Me(v,K),v.prototype.ownsTarget=function(C){return!!K.prototype.ownsTarget.call(this,C)||!(!this.grip1.ownsTarget(C)&&!this.grip2.ownsTarget(C))},v.prototype.pointerDown=function(C,F){K.prototype.pointerDown.call(this,C,F),this.manipulationStartX=C.x,this.manipulationStartY=C.y,this.state==="new"&&(this.x1=C.x,this.y1=C.y,this.x2=C.x,this.y2=C.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(F)?this.activeGrip=this.grip1:this.grip2.ownsTarget(F)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},v.prototype.pointerUp=function(C){var F=this.state;K.prototype.pointerUp.call(this,C),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(C),this._state="select",F==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},v.prototype.adjustVisual=function(){},v.prototype.manipulate=function(C){this.state==="creating"?this.resize(C):this.state==="move"?(this.x1=this.manipulationStartX1+C.x-this.manipulationStartX,this.y1=this.manipulationStartY1+C.y-this.manipulationStartY,this.x2=this.manipulationStartX2+C.x-this.manipulationStartX,this.y2=this.manipulationStartY2+C.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(C)},v.prototype.resize=function(C){switch(this.activeGrip){case this.grip1:this.x1=C.x,this.y1=C.y;break;case this.grip2:case void 0:this.x2=C.x,this.y2=C.y}this.adjustVisual(),this.adjustControlBox()},v.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=le.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){this.positionGrips()},v.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},v.prototype.createGrip=function(){var C=new Pt;return C.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(C.visual),C},v.prototype.positionGrips=function(){var C=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-C/2,this.y1-C/2),this.positionGrip(this.grip2.visual,this.x2-C/2,this.y2-C/2)},v.prototype.positionGrip=function(C,F,q){var H=C.transform.baseVal.getItem(0);H.setTranslate(F,q),C.transform.baseVal.replaceItem(H,0)},v.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},K.prototype.getState.call(this))},v.prototype.restoreState=function(C){K.prototype.restoreState.call(this,C);var F=C;this.x1=F.x1,this.y1=F.y1,this.x2=F.x2,this.y2=F.y2},v.prototype.scale=function(C,F){K.prototype.scale.call(this,C,F),this.x1=this.x1*C,this.y1=this.y1*F,this.x2=this.x2*C,this.y2=this.y2*F,this.adjustVisual(),this.adjustControlBox()},v}(it),St=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.setStrokeColor=H.setStrokeColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.strokeColor=q.defaultColor,H.strokeWidth=q.defaultStrokeWidth,H.strokeDasharray=q.defaultStrokeDasharray,H.strokePanel=new ot("Line color",q.defaultColorSet,q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new Wt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ct("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return Me(v,K),v.prototype.ownsTarget=function(C){return!(!K.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorLine&&C!==this.visibleLine)},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorLine=le.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=le.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,F){K.prototype.pointerDown.call(this,C,F),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},v.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),le.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},K.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){K.prototype.restoreState.call(this,C);var F=C;this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.createVisual(),this.adjustVisual()},v.typeName="LineMarker",v.title="Line marker",v.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',v}(Kt),Ke=function(K){function v(C,F,q,H){var ue=K.call(this,C,H||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ue.fonts=[],ue.fontBoxes=[],ue.fonts=F,ue.currentFont=q,ue.setCurrentFont=ue.setCurrentFont.bind(ue),ue}return Me(v,K),v.prototype.getUi=function(){var C=this,F=document.createElement("div");return F.style.overflow="hidden",F.style.flexGrow="2",this.fonts.forEach(function(q){var H=document.createElement("div");H.style.display="inline-block",H.style.alignItems="center",H.style.justifyContent="space-between",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.overflow="hidden",H.style.maxWidth=100/C.fonts.length-5+"%",H.style.borderColor=q===C.currentFont?C.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){C.setCurrentFont(q,H)}),F.appendChild(H);var ue=document.createElement("div");ue.style.display="flex",ue.style.minHeight="20px",ue.style.flexGrow="2",ue.style.fontFamily=q,ue.style.overflow="hidden";var He=document.createElement("div");He.style.whiteSpace="nowrap",He.style.overflow="hidden",He.style.textOverflow="ellipsis",He.innerHTML="The quick brown fox jumps over the lazy dog",ue.appendChild(He),H.appendChild(ue),C.fontBoxes.push(H)}),F},v.prototype.setCurrentFont=function(C,F){var q=this;this.currentFont=C,this.fontBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},v}(gt),at=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.color="transparent",H.padding=5,H.DEFAULT_TEXT="your text here",H.text=H.DEFAULT_TEXT,H.isMoved=!1,H.color=q.defaultColor,H.fontFamily=q.defaultFontFamily,H.defaultSize={x:100,y:30},H.setColor=H.setColor.bind(H),H.setFont=H.setFont.bind(H),H.renderText=H.renderText.bind(H),H.sizeText=H.sizeText.bind(H),H.textEditDivClicked=H.textEditDivClicked.bind(H),H.showTextEditor=H.showTextEditor.bind(H),H.setSize=H.setSize.bind(H),H.positionTextEditor=H.positionTextEditor.bind(H),H.colorPanel=new ot("Color",q.defaultColorSet,q.defaultColor),H.colorPanel.onColorChanged=H.setColor,H.fontFamilyPanel=new Ke("Font",q.defaultFontFamilies,q.defaultFontFamily),H.fontFamilyPanel.onFontChanged=H.setFont,H}return Me(v,K),v.prototype.ownsTarget=function(C){if(K.prototype.ownsTarget.call(this,C)||C===this.visual||C===this.textElement||C===this.bgRectangle)return!0;var F=!1;return this.textElement.childNodes.forEach(function(q){q===C&&(F=!0)}),F},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.bgRectangle=le.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=le.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},v.prototype.pointerDown=function(C,F){K.prototype.pointerDown.call(this,C,F),this.isMoved=!1,this.pointerDownPoint=C,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},v.prototype.renderText=function(){var C=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(F){C.textElement.appendChild(le.createTSpan(F.trim()===""?" ":F.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},v.prototype.getTextScale=function(){var C=this.textElement.getBBox(),F=1;if(C.width>0&&C.height>0){var q=(1*this.width-this.width*this.padding*2/100)/C.width,H=(1*this.height-this.height*this.padding*2/100)/C.height;F=Math.min(q,H)}return F},v.prototype.getTextPosition=function(C){var F=this.textElement.getBBox(),q=0,H=0;return F.width>0&&F.height>0&&(q=(this.width-F.width*C)/2,H=this.height/2-F.height*C/2),{x:q,y:H}},v.prototype.sizeText=function(){var C=this.textElement.getBBox(),F=this.getTextScale(),q=this.getTextPosition(F);q.y-=C.y*F,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+F+", "+F+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(F,F))},v.prototype.manipulate=function(C){K.prototype.manipulate.call(this,C),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(C.x-this.pointerDownPoint.x)>5||Math.abs(C.y-this.pointerDownPoint.y)>5)},v.prototype.resize=function(C){K.prototype.resize.call(this,C),this.isMoved=!0,this.setSize(),this.sizeText()},v.prototype.setSize=function(){K.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},v.prototype.pointerUp=function(C){var F=this.state;F==="creating"&&(this._suppressMarkerCreateEvent=!0),K.prototype.pointerUp.call(this,C),this.setSize(),(F==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},v.prototype.showTextEditor=function(){var C=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(F){F.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var F=Number.parseFloat(C.textEditor.style.fontSize);C.textEditor.clientWidth>=Number.parseInt(C.textEditor.style.maxWidth)&&F>.9;)F-=.1,C.textEditor.style.fontSize=Math.max(F,.9)+"em"}),this.textEditor.addEventListener("keyup",function(F){F.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(F){if(F.clipboardData){var q=F.clipboardData.getData("text"),H=window.getSelection();if(!H.rangeCount)return!1;H.deleteFromDocument(),H.getRangeAt(0).insertNode(document.createTextNode(q)),F.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){C.textEditDivClicked(C.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},v.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var C=this.getTextScale(),F=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),q=this.textElement.getBBox(),H={x:q.width*C,y:q.height*C};F.x-=H.x/2,F.y-=H.y/2,this.textEditor.style.top=F.y+"px",this.textEditor.style.left=F.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-F.x+"px",this.textEditor.style.fontSize=Math.max(16*C,12)+"px",this.textElement.style.display="none"}},v.prototype.textEditDivClicked=function(C){this.text=C.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},v.prototype.select=function(){K.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},v.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),K.prototype.deselect.call(this)},v.prototype.dblClick=function(C,F){K.prototype.dblClick.call(this,C,F),this.showTextEditor()},v.prototype.setColor=function(C){this.textElement&&le.setAttributes(this.textElement,[["fill",C]]),this.color=C,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(C)},v.prototype.setFont=function(C){this.textElement&&le.setAttributes(this.textElement,[["font-family",C]]),this.fontFamily=C,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},v.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},v.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},K.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){var F=C;this.color=F.color,this.fontFamily=F.fontFamily,this.padding=F.padding,this.text=F.text,this.createVisual(),K.prototype.restoreState.call(this,C),this.setSize()},v.prototype.scale=function(C,F){K.prototype.scale.call(this,C,F),this.setSize(),this.sizeText(),this.positionTextEditor()},v.typeName="TextMarker",v.title="Text marker",v.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',v}(wt),Ce=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.color="transparent",H.lineWidth=3,H.drawing=!1,H.pixelRatio=1,H.color=q.defaultColor,H.lineWidth=q.defaultStrokeWidth,H.pixelRatio=q.freehandPixelRatio,H.setColor=H.setColor.bind(H),H.addCanvas=H.addCanvas.bind(H),H.finishCreation=H.finishCreation.bind(H),H.setLineWidth=H.setLineWidth.bind(H),H.colorPanel=new ot("Color",q.defaultColorSet,q.defaultColor),H.colorPanel.onColorChanged=H.setColor,H.lineWidthPanel=new Wt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),H.lineWidthPanel.onWidthChanged=H.setLineWidth,H}return Me(v,K),v.prototype.ownsTarget=function(C){return!(!K.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.drawingImage)},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.drawingImage=le.createImage(),this.visual.appendChild(this.drawingImage);var C=le.createTransform();this.visual.transform.baseVal.appendItem(C),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,F){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(C.x,C.y),this.drawing=!0):K.prototype.pointerDown.call(this,C,F)},v.prototype.manipulate=function(C){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(C.x,C.y),this.canvasContext.stroke()):K.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){K.prototype.resize.call(this,C),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(C){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):K.prototype.pointerUp.call(this,C)},v.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},v.prototype.select=function(){this.state==="creating"&&this.finishCreation(),K.prototype.select.call(this)},v.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),K.prototype.deselect.call(this)},v.prototype.finishCreation=function(){for(var C=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),F=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],q=F[0],H=F[1],ue=F[2],He=F[3],Xe=!1,At=0;At<this.canvasElement.height;At++)for(var We=0;We<this.canvasElement.width;We++)C.data[At*this.canvasElement.width*4+4*We+3]>0&&(Xe=!0,At<H&&(H=At),We<q&&(q=We),At>He&&(He=At),We>ue&&(ue=We));if(Xe){this.left=q/this.pixelRatio,this.top=H/this.pixelRatio,this.width=(ue-q)/this.pixelRatio,this.height=(He-H)/this.pixelRatio;var mt=document.createElement("canvas");mt.width=ue-q,mt.height=He-H,mt.getContext("2d").putImageData(this.canvasContext.getImageData(q,H,ue-q,He-H),0,0),this.drawingImgUrl=mt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},v.prototype.setDrawingImage=function(){le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},v.prototype.setColor=function(C){this.color=C,this.colorChanged(C)},v.prototype.setLineWidth=function(C){this.lineWidth=C},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({drawingImgUrl:this.drawingImgUrl},K.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){this.createVisual(),K.prototype.restoreState.call(this,C),this.drawingImgUrl=C.drawingImgUrl,this.setDrawingImage()},v.prototype.scale=function(C,F){K.prototype.scale.call(this,C,F),this.setDrawingImage()},v.typeName="FreehandMarker",v.title="Freehand marker",v.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',v}(wt),Ee=function(K){function v(C,F,q){var H=K.call(this,C,q||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return H.typeBoxes=[],H.currentType=F,H.setCurrentType=H.setCurrentType.bind(H),H}return Me(v,K),v.prototype.getUi=function(){var C=this,F=document.createElement("div");F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2";for(var q=function(He){var Xe="both";switch(He){case 0:Xe="both";break;case 1:Xe="start";break;case 2:Xe="end";break;case 3:Xe="none"}var At=document.createElement("div");if(At.style.display="flex",At.style.flexGrow="2",At.style.alignItems="center",At.style.justifyContent="space-between",At.style.padding="5px",At.style.borderWidth="2px",At.style.borderStyle="solid",At.style.borderColor=Xe===H.currentType?H.uiStyleSettings.toolboxAccentColor:"transparent",At.addEventListener("click",function(){C.setCurrentType(Xe,At)}),F.appendChild(At),Xe==="both"||Xe==="start"){var We=document.createElement("div");We.style.display="flex",We.style.alignItems="center",We.style.minHeight="20px",We.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(H.uiStyleSettings!==void 0?H.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,We.style.marginLeft="5px",At.appendChild(We)}var mt=document.createElement("div");mt.style.display="flex",mt.style.alignItems="center",mt.style.minHeight="20px",mt.style.flexGrow="2";var Zt=document.createElement("hr");if(Zt.style.minWidth="20px",Zt.style.border="0px",Zt.style.borderTop="3px solid "+(H.uiStyleSettings!==void 0?H.uiStyleSettings.toolboxColor:"#eeeeee"),Zt.style.flexGrow="2",mt.appendChild(Zt),At.appendChild(mt),Xe==="both"||Xe==="end"){var Fn=document.createElement("div");Fn.style.display="flex",Fn.style.alignItems="center",Fn.style.minHeight="20px",Fn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(H.uiStyleSettings!==void 0?H.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Fn.style.marginRight="5px",At.appendChild(Fn)}H.typeBoxes.push(At)},H=this,ue=0;ue<4;ue++)q(ue);return F},v.prototype.setCurrentType=function(C,F){var q=this;this.currentType=C,this.typeBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},v}(gt),Te=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.arrowType="end",H.arrowBaseHeight=10,H.arrowBaseWidth=10,H.getArrowPoints=H.getArrowPoints.bind(H),H.setArrowType=H.setArrowType.bind(H),H.arrowTypePanel=new Ee("Arrow type","end"),H.arrowTypePanel.onArrowTypeChanged=H.setArrowType,H}return Me(v,K),v.prototype.ownsTarget=function(C){return!(!K.prototype.ownsTarget.call(this,C)&&C!==this.arrow1&&C!==this.arrow2)},v.prototype.getArrowPoints=function(C,F){var q=this.arrowBaseWidth+2*this.strokeWidth,H=this.arrowBaseHeight+2*this.strokeWidth;return C-q/2+","+(F+H/2)+" "+C+","+(F-H/2)+" "+(C+q/2)+","+(F+H/2)},v.prototype.createTips=function(){this.arrow1=le.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=le.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow2)},v.prototype.pointerDown=function(C,F){K.prototype.pointerDown.call(this,C,F),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(K.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",le.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),le.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),F=this.arrow1.transform.baseVal.getItem(0);F.setRotate(C,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(F,0);var q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(C+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},v.prototype.setArrowType=function(C){this.arrowType=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({arrowType:this.arrowType},K.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){K.prototype.restoreState.call(this,C);var F=C;this.arrowType=F.arrowType,this.createTips(),this.adjustVisual()},v.typeName="ArrowMarker",v.title="Arrow marker",v.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',v}(St),ee=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.fillColor=q.defaultFillColor,H.strokeWidth=0,H.fillPanel=new ot("Color",q.defaultColorSet,q.defaultFillColor),H.fillPanel.onColorChanged=H.setFillColor,H}return Me(v,K),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=K.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="CoverMarker",v.title="Cover marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',v}(Tt),ae=function(K){function v(C,F,q,H){var ue=K.call(this,C,H||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ue.opacities=[],ue.opacityBoxes=[],ue.opacities=F,ue.currentOpacity=q,ue.setCurrentOpacity=ue.setCurrentOpacity.bind(ue),ue}return Me(v,K),v.prototype.getUi=function(){var C=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",F.style.justifyContent="space-between",this.opacities.forEach(function(q){var H=document.createElement("div");H.style.display="flex",H.style.alignItems="center",H.style.justifyContent="center",H.style.padding="5px",H.style.borderWidth="2px",H.style.borderStyle="solid",H.style.borderColor=q===C.currentOpacity?C.uiStyleSettings.toolboxAccentColor:"transparent",H.addEventListener("click",function(){C.setCurrentOpacity(q,H)}),F.appendChild(H);var ue=document.createElement("div");ue.innerText=100*q+"%",H.appendChild(ue),C.opacityBoxes.push(H)}),F},v.prototype.setCurrentOpacity=function(C,F){var q=this;this.currentOpacity=C,this.opacityBoxes.forEach(function(H){H.style.borderColor=H===F?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},v}(gt),de=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.setOpacity=H.setOpacity.bind(H),H.fillColor=q.defaultHighlightColor,H.strokeWidth=0,H.opacity=q.defaultHighlightOpacity,H.fillPanel=new ot("Color",q.defaultColorSet,H.fillColor),H.fillPanel.onColorChanged=H.setFillColor,H.opacityPanel=new ae("Opacity",q.defaultOpacitySteps,H.opacity),H.opacityPanel.onOpacityChanged=H.setOpacity,H}return Me(v,K),v.prototype.setOpacity=function(C){this.opacity=C,this.visual&&le.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=K.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="HighlightMarker",v.title="Highlight marker",v.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',v}(ee),pe='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',_e=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.bgColor="transparent",H.tipPosition={x:0,y:0},H.tipBase1Position={x:0,y:0},H.tipBase2Position={x:0,y:0},H.tipMoving=!1,H.color=q.defaultStrokeColor,H.bgColor=q.defaultFillColor,H.fontFamily=q.defaultFontFamily,H.defaultSize={x:100,y:30},H.setBgColor=H.setBgColor.bind(H),H.getTipPoints=H.getTipPoints.bind(H),H.positionTip=H.positionTip.bind(H),H.setTipPoints=H.setTipPoints.bind(H),H.colorPanel=new ot("Text color",q.defaultColorSet,H.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),H.colorPanel.onColorChanged=H.setColor,H.bgColorPanel=new ot("Fill color",q.defaultColorSet,H.bgColor,pe),H.bgColorPanel.onColorChanged=H.setBgColor,H.fontFamilyPanel=new Ke("Font",q.defaultFontFamilies,q.defaultFontFamily),H.fontFamilyPanel.onFontChanged=H.setFont,H.tipGrip=new Pt,H.tipGrip.visual.transform.baseVal.appendItem(le.createTransform()),H.controlBox.appendChild(H.tipGrip.visual),H}return Me(v,K),v.prototype.ownsTarget=function(C){return K.prototype.ownsTarget.call(this,C)||this.tipGrip.ownsTarget(C)||this.tip===C},v.prototype.createTip=function(){le.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=le.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},v.prototype.pointerDown=function(C,F){this.state==="new"&&K.prototype.pointerDown.call(this,C,F),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(F)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):K.prototype.pointerDown.call(this,C,F)},v.prototype.pointerUp=function(C){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,K.prototype.pointerUp.call(this,C);else{var F=this.state==="creating";K.prototype.pointerUp.call(this,C),this.setTipPoints(F),this.positionTip()}},v.prototype.manipulate=function(C){if(this.tipMoving){var F=this.unrotatePoint(C);this.tipPosition={x:F.x-this.manipulationStartLeft,y:F.y-this.manipulationStartTop},this.positionTip()}else K.prototype.manipulate.call(this,C)},v.prototype.setBgColor=function(C){this.bgRectangle&&this.tip&&(le.setAttributes(this.bgRectangle,[["fill",C]]),le.setAttributes(this.tip,[["fill",C]])),this.bgColor=C,this.fillColorChanged(C)},v.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},v.prototype.setTipPoints=function(C){C===void 0&&(C=!1);var F=Math.min(this.height/2,15),q=this.height/5;C&&(this.tipPosition={x:F+q/2,y:this.height+20});var H=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?H<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(q=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:F,y:0},this.tipBase2Position={x:F+q,y:0}):(this.tipBase1Position={x:0,y:F},this.tipBase2Position={x:0,y:F+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?H<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(q=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-F-q,y:0},this.tipBase2Position={x:this.width-F,y:0}):(this.tipBase1Position={x:this.width,y:F},this.tipBase2Position={x:this.width,y:F+q}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?H<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(q=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-F-q,y:this.height},this.tipBase2Position={x:this.width-F,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-F-q},this.tipBase2Position={x:this.width,y:this.height-F}):H<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(q=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:F,y:this.height},this.tipBase2Position={x:F+q,y:this.height}):(this.tipBase1Position={x:0,y:this.height-F},this.tipBase2Position={x:0,y:this.height-F-q})},v.prototype.resize=function(C){K.prototype.resize.call(this,C),this.positionTip()},v.prototype.positionTip=function(){le.setAttributes(this.tip,[["points",this.getTipPoints()]]);var C=this.tipGrip.visual.transform.baseVal.getItem(0);C.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(C,0)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.select=function(){this.positionTip(),K.prototype.select.call(this)},v.prototype.getState=function(){var C=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},K.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){var F=C;this.bgColor=F.bgColor,this.tipPosition=F.tipPosition,K.prototype.restoreState.call(this,C),this.createTip(),this.setTipPoints()},v.prototype.scale=function(C,F){K.prototype.scale.call(this,C,F),this.tipPosition={x:this.tipPosition.x*C,y:this.tipPosition.y*F},this.positionTip()},v.typeName="CalloutMarker",v.title="Callout marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',v}(at),Re=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.fillColor="transparent",H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.opacity=1,H.strokeColor=q.defaultColor,H.strokeWidth=q.defaultStrokeWidth,H.strokeDasharray=q.defaultStrokeDasharray,H.fillColor=q.defaultFillColor,H.setStrokeColor=H.setStrokeColor.bind(H),H.setFillColor=H.setFillColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.setOpacity=H.setOpacity.bind(H),H.createVisual=H.createVisual.bind(H),H.strokePanel=new ot("Line color",be(q.defaultColorSet,["transparent"]),q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.fillPanel=new ot("Fill color",be(q.defaultColorSet,["transparent"]),H.fillColor,pe),H.fillPanel.onColorChanged=H.setFillColor,H.strokeWidthPanel=new Wt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ct("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H.opacityPanel=new ae("Opacity",q.defaultOpacitySteps,H.opacity),H.opacityPanel.onOpacityChanged=H.setOpacity,H}return Me(v,K),v.prototype.ownsTarget=function(C){return!(!K.prototype.ownsTarget.call(this,C)&&C!==this.visual)},v.prototype.createVisual=function(){this.visual=le.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,F){K.prototype.pointerDown.call(this,C,F),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},v.prototype.manipulate=function(C){K.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){K.prototype.resize.call(this,C),this.setSize()},v.prototype.setSize=function(){K.prototype.setSize.call(this),le.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},v.prototype.pointerUp=function(C){K.prototype.pointerUp.call(this,C),this.setSize()},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},v.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(C),this.stateChanged()},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.setOpacity=function(C){this.opacity=C,this.visual&&le.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},K.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){var F=C;this.fillColor=F.fillColor,this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.opacity=F.opacity,this.createVisual(),K.prototype.restoreState.call(this,C),this.setSize()},v.prototype.scale=function(C,F){K.prototype.scale.call(this,C,F),this.setSize()},v.typeName="EllipseMarker",v.title="Ellipse marker",v.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',v}(wt),De=function(K){function v(C,F,q){return K.call(this,C,F,q)||this}return Me(v,K),Object.defineProperty(v.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(C){return!(!K.prototype.ownsTarget.call(this,C)&&C!==this.tip1&&C!==this.tip2)},v.prototype.createTips=function(){this.tip1=le.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.tip1),this.tip2=le.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.tip2)},v.prototype.pointerDown=function(C,F){K.prototype.pointerDown.call(this,C,F),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(K.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(le.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),F=this.tip1.transform.baseVal.getItem(0);F.setRotate(C,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(F,0);var q=this.tip2.transform.baseVal.getItem(0);q.setRotate(C+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=K.prototype.getState.call(this);return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){K.prototype.restoreState.call(this,C),this.createTips(),this.adjustVisual()},v.typeName="MeasurementMarker",v.title="Measurement marker",v.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',v}(St),Ze=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.strokePanel.colors=q.defaultColorSet,H.fillColor="transparent",H}return Me(v,K),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=K.prototype.getState.call(this);return C.typeName=v.typeName,C},v.typeName="EllipseFrameMarker",v.title="Ellipse frame marker",v.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',v}(Re),dt=function(){function K(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(K.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),K.prototype.addUndoStep=function(v){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(v)||(this.undoStack.push(v),JSON.stringify(this.lastRedoStep)!==JSON.stringify(v)&&this.redoStack.splice(0,this.redoStack.length))},K.prototype.replaceLastUndoStep=function(v){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=v)},K.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},K.prototype.undo=function(){if(this.undoStack.length>1){var v=this.undoStack.pop();return v!==void 0&&this.redoStack.push(v),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},K.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},K}(),ht=function(K){function v(C,F,q){var H=K.call(this,C,F,q)||this;return H.strokeColor="transparent",H.strokeWidth=0,H.strokeDasharray="",H.curveX=0,H.curveY=0,H.manipulationStartCurveX=0,H.manipulationStartCurveY=0,H.setStrokeColor=H.setStrokeColor.bind(H),H.setStrokeWidth=H.setStrokeWidth.bind(H),H.setStrokeDasharray=H.setStrokeDasharray.bind(H),H.positionGrips=H.positionGrips.bind(H),H.addControlGrips=H.addControlGrips.bind(H),H.adjustVisual=H.adjustVisual.bind(H),H.setupControlBox=H.setupControlBox.bind(H),H.resize=H.resize.bind(H),H.strokeColor=q.defaultColor,H.strokeWidth=q.defaultStrokeWidth,H.strokeDasharray=q.defaultStrokeDasharray,H.strokePanel=new ot("Line color",q.defaultColorSet,q.defaultColor),H.strokePanel.onColorChanged=H.setStrokeColor,H.strokeWidthPanel=new Wt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),H.strokeWidthPanel.onWidthChanged=H.setStrokeWidth,H.strokeStylePanel=new Ct("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),H.strokeStylePanel.onStyleChanged=H.setStrokeDasharray,H}return Me(v,K),v.prototype.ownsTarget=function(C){return!(!K.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorCurve&&C!==this.visibleCurve&&!this.curveGrip.ownsTarget(C))},v.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorCurve=le.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=le.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(C,F){K.prototype.pointerDown.call(this,C,F),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=C.x,this.curveY=C.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(F)&&(this.activeGrip=this.curveGrip,this._state="resize")},v.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),le.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setupControlBox=function(){K.prototype.setupControlBox.call(this),this.curveControlLine1=le.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=le.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},v.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,K.prototype.addControlGrips.call(this)},v.prototype.positionGrips=function(){K.prototype.positionGrips.call(this);var C=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-C/2,this.curveY-C/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},v.prototype.manipulate=function(C){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+C.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+C.y-this.manipulationStartY),K.prototype.manipulate.call(this,C)},v.prototype.resize=function(C){this.activeGrip===this.curveGrip&&(this.curveX=C.x,this.curveY=C.y),K.prototype.resize.call(this,C),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},v.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},v.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},v.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual()},v.prototype.scale=function(C,F){this.curveX=this.curveX*C,this.curveY=this.curveY*F,K.prototype.scale.call(this,C,F)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},K.prototype.getState.call(this));return C.typeName=v.typeName,C},v.prototype.restoreState=function(C){K.prototype.restoreState.call(this,C);var F=C;this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.curveX=F.curveX,this.curveY=F.curveY,this.createVisual(),this.adjustVisual()},v.typeName="CurveMarker",v.title="Curve marker",v.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',v}(Kt),Ft=function(){function K(v,C){C===void 0&&(C=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=v,this.cancelable=C}return Object.defineProperty(K.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),K.prototype.preventDefault=function(){this._defaultPrevented=!0},K}(),vt=function(K){function v(C,F,q){var H=K.call(this,C,!1)||this;return H.dataUrl=F,H.state=q,H}return Me(v,K),v}(Ft),Ge=function(K){function v(C,F,q){q===void 0&&(q=!1);var H=K.call(this,C,q)||this;return H.marker=F,H}return Me(v,K),v}(Ft),en=function(){function K(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return K.prototype.addEventListener=function(v,C){this[v].push(C)},K.prototype.removeEventListener=function(v,C){var F=this[v].indexOf(C);F>-1&&this[v].splice(F,1)},K}(),je=function(){function K(v){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ze,this._isOpen=!1,this.undoRedoManager=new dt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new en,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=K.instanceCounter++,this.styles=new lt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=v,this.targetRoot=document.body,this.width=v.clientWidth,this.height=v.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(K.prototype,"ALL_MARKER_TYPES",{get:function(){return[bt,Ce,Te,at,Ze,Re,de,_e,De,ee,St,ht]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[bt,Ce,Te,at,Re,de,_e]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"BASIC_MARKER_TYPES",{get:function(){return[bt,Ce,Te,at,de]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(v){var C=this;this._availableMarkerTypes.splice(0),v.forEach(function(F){if(typeof F=="string"){var q=C.ALL_MARKER_TYPES.find(function(H){return H.typeName===F});q!==void 0&&C._availableMarkerTypes.push(q)}else C._availableMarkerTypes.push(F)})},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(v){this._zoomLevel=v,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),K.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Le.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},K.prototype.show=function(){var v=this;this.styles.styleSheetRoot===void 0&&nt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=nt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(C){return C(new Ft(v))})},K.prototype.render=function(){return Be(this,void 0,void 0,function(){var v;return Pe(this,function(C){switch(C.label){case 0:return this.setCurrentMarker(),(v=new tt).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.markersOnly=this.renderMarkersOnly,v.width=this.renderWidth,v.height=this.renderHeight,[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return C.sent(),[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,C.sent()]}})})},K.prototype.close=function(v){var C=this;if(v===void 0&&(v=!1),this.isOpen){var F=!1;v||this.eventListeners.beforeclose.forEach(function(q){var H=new Ft(C,!0);q(H),H.defaultPrevented&&(F=!0)}),F||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(q){return q(new Ft(C))}),this.detachEvents(),this._isOpen=!1)}},K.prototype.addMarkersToToolbar=function(){for(var v,C=[],F=0;F<arguments.length;F++)C[F]=arguments[F];(v=this._availableMarkerTypes).push.apply(v,C)},K.prototype.addRenderEventListener=function(v){this.addEventListener("render",function(C){v(C.dataUrl,C.state)})},K.prototype.removeRenderEventListener=function(v){},K.prototype.addCloseEventListener=function(v){this.addEventListener("close",function(){v()})},K.prototype.removeCloseEventListener=function(v){},K.prototype.setupResizeObserver=function(){var v=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){v.resize(v.target.clientWidth,v.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return v.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},K.prototype.onPopupTargetResize=function(){var v=1*this.target.clientWidth/this.target.clientHeight,C=this.editorCanvas.clientWidth/v>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*v:this.editorCanvas.clientWidth,F=C<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/v;this.resize(C,F)},K.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},K.prototype.resize=function(v,C){this._isResizing=!0;var F=v/this.imageWidth,q=C/this.imageHeight;this.imageWidth=Math.round(v),this.imageHeight=Math.round(C),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(F,q),this._isResizing=!1},K.prototype.scaleMarkers=function(v,C){var F,q=this;this._currentMarker&&this._currentMarker instanceof at?this._currentMarker.scale(v,C):(F=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(H){H!==q._currentMarker&&H.scale(v,C)}),F!==void 0&&this.setCurrentMarker(F)},K.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},K.prototype.setTopLeft=function(){var v=this.editingTarget.getBoundingClientRect(),C=this.editorCanvas.getBoundingClientRect();this.left=v.left-C.left,this.top=v.top-C.top},K.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},K.prototype.addDefs=function(){for(var v,C=[],F=0;F<arguments.length;F++)C[F]=arguments[F];this.defs=le.createDefs(),this.addDefsToImage(),(v=this.defs).append.apply(v,C)},K.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},K.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},K.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},K.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},K.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},K.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},K.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},K.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var v=document.createElement("a");v.href="https://markerjs.com/",v.target="_blank",v.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',v.title="Powered by marker.js",v.style.display="grid",v.style.alignItems="center",v.style.justifyItems="center",v.style.padding="3px",v.style.width="20px",v.style.height="20px",this.logoUI.appendChild(v),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},K.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},K.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},K.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},K.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Qe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new ut(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},K.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},K.prototype.removeMarker=function(v){this.markerImage.removeChild(v.container),this.markers.indexOf(v)>-1&&this.markers.splice(this.markers.indexOf(v),1),v.dispose()},K.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},K.prototype.toolbarButtonClicked=function(v,C){if(v==="marker"&&C!==void 0)this.createNewMarker(C);else if(v==="action")switch(C){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},K.prototype.deleteSelectedMarker=function(){var v=this;if(this._currentMarker!==void 0){var C=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var H=new Ge(v,v._currentMarker,!0);q(H),H.defaultPrevented&&(C=!0)}),!C){var F=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(q){return q(new Ge(v,F))})}}},K.prototype.clear=function(){var v=this,C=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ue){var He=new Ge(v,void 0,!0);ue(He),He.defaultPrevented&&(C=!0)}),!C)){this.setCurrentMarker();for(var F=function(ue){var He=q.markers[ue];q.setCurrentMarker(q.markers[ue]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(Xe){return Xe(new Ge(v,He))})},q=this,H=this.markers.length-1;H>=0;H--)F(H);this.addUndoStep()}},Object.defineProperty(K.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),K.prototype.showNotesEditor=function(){var v;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(v=this._currentMarker.notes)!==null&&v!==void 0?v:"",this.overlayContainer.appendChild(this.notesArea))},K.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},K.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},K.prototype.addUndoStep=function(){var v=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var C=this.getState(),F=this.undoRedoManager.getLastUndoStep();if(!F||F.width===C.width&&F.height===C.height){var q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(C),q<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(H){return H(new Ft(v))})}else this.undoRedoManager.replaceLastUndoStep(C),this.eventListeners.statechange.forEach(function(H){return H(new Ft(v))})}},K.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},K.prototype.undoStep=function(){var v=this,C=this.undoRedoManager.undo();C!==void 0&&(this.restoreState(C),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(F){return F(new Ft(v))}))},K.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},K.prototype.redoStep=function(){var v=this,C=this.undoRedoManager.redo();C!==void 0&&(this.restoreState(C),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(F){return F(new Ft(v))}))},K.prototype.stepZoom=function(){var v=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=v<this.zoomSteps.length-1?this.zoomSteps[v+1]:this.zoomSteps[0]},K.prototype.panTo=function(v){this.contentDiv.scrollBy({left:this.prevPanPoint.x-v.x,top:this.prevPanPoint.y-v.y}),this.prevPanPoint=v},K.prototype.startRenderAndClose=function(){return Be(this,void 0,void 0,function(){var v,C,F=this;return Pe(this,function(q){switch(q.label){case 0:return[4,this.render()];case 1:return v=q.sent(),C=this.getState(),this.eventListeners.render.forEach(function(H){return H(new vt(F,v,C))}),this.close(!0),[2]}})})},K.prototype.getState=function(v){v===!0&&this.setCurrentMarker();var C={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(F){return C.markers.push(F.getState())}),C},K.prototype.restoreState=function(v){var C=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);v.markers.forEach(function(F){var q=C._availableMarkerTypes.find(function(ue){return ue.typeName===F.typeName});if(q!==void 0){var H=C.addNewMarker(q);H.restoreState(F),C.markers.push(H)}}),v.width&&v.height&&(v.width!==this.imageWidth||v.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/v.width,this.imageHeight/v.height),this.eventListeners.restorestate.forEach(function(F){return F(new Ft(C))})},K.prototype.addNewMarker=function(v){var C=le.createGroup();return this.markerImage.appendChild(C),new v(C,this.overlayContainer,this.settings)},K.prototype.createNewMarker=function(v){var C,F=this;(C=typeof v=="string"?this._availableMarkerTypes.find(function(q){return q.typeName===v}):v)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(C),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(C.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(q){return q(new Ge(F,F._currentMarker))}))},K.prototype.markerCreated=function(v){var C=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(v),this.setCurrentMarker(v),v instanceof Ce&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ce):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(F){return F(new Ge(C,C._currentMarker))})},K.prototype.colorChanged=function(v){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=v,this.settings.defaultStrokeColor=v)},K.prototype.fillColorChanged=function(v){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=v)},K.prototype.markerStateChanged=function(v){var C=this;this.eventListeners.markerchange.forEach(function(F){return F(new Ge(C,v))})},K.prototype.setCurrentMarker=function(v){var C=this;this._currentMarker!==v&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(F){return F(new Ge(C,C._currentMarker))})),this._currentMarker=v,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(F){return F(new Ge(C,C._currentMarker))}))},K.prototype.onPointerDown=function(v){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||v.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var C=this.markers.find(function(F){return F.ownsTarget(v.target)});C!==void 0?(this.setCurrentMarker(C),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(v.clientX,v.clientY),v.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:v.clientX,y:v.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(v.clientX,v.clientY))},K.prototype.onDblClick=function(v){if(this._isFocused||this.focus(),this.mode==="select"){var C=this.markers.find(function(F){return F.ownsTarget(v.target)});C!==void 0&&C!==this._currentMarker&&this.setCurrentMarker(C),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(v.clientX,v.clientY),v.target):this.setCurrentMarker()}},K.prototype.onPointerMove=function(v){this.touchPoints!==1&&v.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||v.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(v.clientX,v.clientY)):this.zoomLevel>1&&this.panTo({x:v.clientX,y:v.clientY}))},K.prototype.onPointerUp=function(v){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(v.clientX,v.clientY)),this.isDragging=!1,this.addUndoStep()},K.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},K.prototype.onKeyUp=function(v){this._currentMarker===void 0||this.notesArea!==void 0||v.key!=="Delete"&&v.key!=="Backspace"||this.deleteSelectedMarker()},K.prototype.clientToLocalCoordinates=function(v,C){var F=this.markerImage.getBoundingClientRect();return{x:(v-F.left)/this.zoomLevel,y:(C-F.top)/this.zoomLevel}},K.prototype.onWindowResize=function(){this.positionUI()},K.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},K.prototype.addLicenseKey=function(v){Le.addKey(v)},K.prototype.addEventListener=function(v,C){this.eventListeners.addEventListener(v,C)},K.prototype.removeEventListener=function(v,C){this.eventListeners.removeEventListener(v,C)},K.prototype.renderState=function(v){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(v),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(K.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),K.prototype.focus=function(){var v=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(C){return C(new Ft(v))}))},K.prototype.blur=function(){var v=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(C){return C(new Ft(v))}))},K.instanceCounter=0,K}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var un=function(K,v){return(un=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,F){C.__proto__=F}||function(C,F){for(var q in F)Object.prototype.hasOwnProperty.call(F,q)&&(C[q]=F[q])})(K,v)};function yt(K,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function C(){this.constructor=K}un(K,v),K.prototype=v===null?Object.create(v):(C.prototype=v.prototype,new C)}function Nt(K,v,C,F){return new(C||(C=Promise))(function(q,H){function ue(At){try{Xe(F.next(At))}catch(We){H(We)}}function He(At){try{Xe(F.throw(At))}catch(We){H(We)}}function Xe(At){var We;At.done?q(At.value):(We=At.value,We instanceof C?We:new C(function(mt){mt(We)})).then(ue,He)}Xe((F=F.apply(K,v||[])).next())})}function Gt(K,v){var C,F,q,H,ue={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return H={next:He(0),throw:He(1),return:He(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function He(Xe){return function(At){return function(We){if(C)throw new TypeError("Generator is already executing.");for(;ue;)try{if(C=1,F&&(q=2&We[0]?F.return:We[0]?F.throw||((q=F.return)&&q.call(F),0):F.next)&&!(q=q.call(F,We[1])).done)return q;switch(F=0,q&&(We=[2&We[0],q.value]),We[0]){case 0:case 1:q=We;break;case 4:return ue.label++,{value:We[1],done:!1};case 5:ue.label++,F=We[1],We=[0];continue;case 7:We=ue.ops.pop(),ue.trys.pop();continue;default:if(!(q=ue.trys,(q=q.length>0&&q[q.length-1])||We[0]!==6&&We[0]!==2)){ue=0;continue}if(We[0]===3&&(!q||We[1]>q[0]&&We[1]<q[3])){ue.label=We[1];break}if(We[0]===6&&ue.label<q[1]){ue.label=q[1],q=We;break}if(q&&ue.label<q[2]){ue.label=q[2],ue.ops.push(We);break}q[2]&&ue.ops.pop(),ue.trys.pop();continue}We=v.call(K,ue)}catch(mt){We=[6,mt],F=0}finally{C=q=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([Xe,At])}}}var on=function(){function K(){}return K.addKey=function(v){K.key=v},Object.defineProperty(K,"isLicensed",{get:function(){return!!K.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(K.key)},enumerable:!1,configurable:!0}),K}(),Je=function(){function K(){}return K.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},K.setAttributes=function(v,C){for(var F=0,q=C;F<q.length;F++){var H=q[F],ue=H[0],He=H[1];v.setAttribute(ue,He)}},K.createRect=function(v,C,F){var q=document.createElementNS("http://www.w3.org/2000/svg","rect");return q.setAttribute("width",v.toString()),q.setAttribute("height",C.toString()),F&&K.setAttributes(q,F),q},K.createLine=function(v,C,F,q,H){var ue=document.createElementNS("http://www.w3.org/2000/svg","line");return ue.setAttribute("x1",v.toString()),ue.setAttribute("y1",C.toString()),ue.setAttribute("x2",F.toString()),ue.setAttribute("y2",q.toString()),H&&K.setAttributes(ue,H),ue},K.createPolygon=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg","polygon");return F.setAttribute("points",v),C&&K.setAttributes(F,C),F},K.createCircle=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg","circle");return F.setAttribute("cx",(v/2).toString()),F.setAttribute("cy",(v/2).toString()),F.setAttribute("r",v.toString()),C&&K.setAttributes(F,C),F},K.createEllipse=function(v,C,F){var q=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return q.setAttribute("cx",(v/2).toString()),q.setAttribute("cy",(C/2).toString()),q.setAttribute("rx",(v/2).toString()),q.setAttribute("ry",(C/2).toString()),F&&K.setAttributes(q,F),q},K.createGroup=function(v){var C=document.createElementNS("http://www.w3.org/2000/svg","g");return v&&K.setAttributes(C,v),C},K.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},K.createMarker=function(v,C,F,q,H,ue,He){var Xe=document.createElementNS("http://www.w3.org/2000/svg","marker");return K.setAttributes(Xe,[["id",v],["orient",C],["markerWidth",F.toString()],["markerHeight",q.toString()],["refX",H.toString()],["refY",ue.toString()]]),Xe.appendChild(He),Xe},K.createText=function(v){var C=document.createElementNS("http://www.w3.org/2000/svg","text");return C.setAttribute("x","0"),C.setAttribute("y","0"),v&&K.setAttributes(C,v),C},K.createTSpan=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg","tspan");return F.textContent=v,C&&K.setAttributes(F,C),F},K.createImage=function(v){var C=document.createElementNS("http://www.w3.org/2000/svg","image");return v&&K.setAttributes(C,v),C},K.createPoint=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return F.x=v,F.y=C,F},K.createPath=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg","path");return F.setAttribute("d",v),C&&K.setAttributes(F,C),F},K.createElement=function(v,C){var F=document.createElementNS("http://www.w3.org/2000/svg",v);return C&&K.setAttributes(F,C),F},K.getHollowRectanglePath=function(v,C,F,q,H,ue,He,Xe){return"M"+v+","+C+"V"+(C+q)+"H"+(v+F)+"V"+C+"H"+H+"V"+ue+"H"+(H+He)+"V"+(ue+Xe)+"H"+H+"V"+C+"Z"},K}(),xt=function(){function K(v){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+v+"_"}return Object.defineProperty(K.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),K.prototype.addClass=function(v){return this.styleSheet===void 0&&this.addStyleSheet(),v.name=""+this.classNamePrefix+v.localName,this.classes.push(v),this.styleSheet.sheet.insertRule("."+v.name+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length),v},K.prototype.addRule=function(v){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(v),this.styleSheet.sheet.insertRule(v.selector+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length)},K.prototype.addStyleSheet=function(){var v;this.styleSheet=document.createElement("style"),((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).appendChild(this.styleSheet),this.addRule(new Ut("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ut("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ut("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new zt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new zt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},K.prototype.removeStyleSheet=function(){var v;this.styleSheet&&(((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},K}(),Ut=function(K,v){this.selector=K,this.style=v},zt=function(K,v){this.localName=K,this.style=v},hn=function(){function K(){this.blocks=[],this.display=""}return K.prototype.addButtonBlock=function(v){v.className=this.blockClassName,v.buttonClassName=this.buttonClassName,v.buttonColorsClassName=this.buttonColorsClassName,v.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(v)},K.prototype.addElementBlock=function(v){v.className===void 0&&(v.className=this.blockClassName),this.blocks.push(v)},K.prototype.getUI=function(){var v=document.createElement("div");return v.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,v.style.display=this.display,this.blocks.forEach(function(C){return v.appendChild(C.getUI())}),v},K}(),Ln=function(){function K(){}return K.prototype.getUI=function(){var v=document.createElement("div");if(v.className=this.className,this.minWidth!==void 0&&(v.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":v.style.justifyContent="flex-start";break;case"center":v.style.justifyContent="center";break;case"end":v.style.justifyContent="flex-end"}return v.style.whiteSpace="nowrap",v},K}(),gn=function(K){function v(){var C=K!==null&&K.apply(this,arguments)||this;return C.buttons=[],C}return yt(v,K),v.prototype.addButton=function(C){C.className=this.buttonClassName,C.colorsClassName=this.buttonColorsClassName,C.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(C)},v.prototype.getUI=function(){var C=K.prototype.getUI.call(this);return this.buttons.forEach(function(F){return C.appendChild(F.getUI())}),C},v}(Ln),Jt=function(){function K(v,C){this._isActive=!1,this._isHidden=!1,this._icon=v,this.title=C,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(K.prototype,"icon",{get:function(){return this._icon},set:function(v){this._icon=v,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isActive",{get:function(){return this._isActive},set:function(v){this._isActive=v,this.adjustClassName()},enumerable:!1,configurable:!0}),K.prototype.getUI=function(){var v=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return v.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},K.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},K.prototype.hide=function(){this._isHidden=!0},K}(),Rt=function(K){function v(){var C=K!==null&&K.apply(this,arguments)||this;return C.elements=[],C}return yt(v,K),v.prototype.addElement=function(C){this.elements.push(C)},v.prototype.getUI=function(){var C=K.prototype.getUI.call(this);return this.elements.forEach(function(F){return C.appendChild(F)}),C},v}(Ln),Vn=function(){function K(v,C){this.horizontal=v,this.vertical=C}return Object.defineProperty(K.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),K.prototype.getVerticalLength=function(v){return v/this.ratio},K.prototype.getHorizontalLength=function(v){return v*this.ratio},K}(),kn=function(){function K(){}return K.getIcon=function(v,C){if(v>0&&C>0){var F=new Vn(v,C),q=F.ratio>=1?20:F.getHorizontalLength(20),H=F.ratio<1?20:F.getVerticalLength(20),ue=document.createElementNS("http://www.w3.org/2000/svg","svg");ue.setAttribute("xmlns","http://www.w3.org/2000/svg"),ue.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ue);var He=Je.createDefs();ue.appendChild(He);var Xe=Je.createElement("clipPath",[["id","text-bg-clip"]]);He.appendChild(Xe);var At=Je.createPath(Je.getHollowRectanglePath((24-q)/2,(24-H)/2,q,H,(24-q)/2+2,(24-H)/2+2,q-4,H-4));ue.appendChild(At);var We=Je.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);We.appendChild(Je.createTSpan(v+":"+C)),ue.appendChild(We);var mt=We.getBBox();Je.setAttributes(We,[["x",((24-mt.width)/2).toString()],["y",((24-mt.height)/2-mt.y).toString()]]);var Zt=Je.createPath(Je.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(mt.width))/2,(24-Math.ceil(mt.height))/2,Math.ceil(mt.width),Math.ceil(mt.height)));return Xe.appendChild(Zt),Je.setAttributes(At,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ue),ue.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},K}(),Cn=function(K){function v(C,F,q){var H=K.call(this,C,F)||this;return H.isDropdownOpen=!1,H.onClick=H.dropdownButtonClicked,H.dropdownButtons=q,H}return yt(v,K),v.prototype.setupDropdown=function(){var C=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(F){F.className=C.className,F.colorsClassName=C.colorsClassName,C.dropdownBlock.appendChild(F.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},v.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},v.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},v.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},v.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},v.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},v}(Jt),Qt=function(){function K(v,C){this.GRIP_SIZE=10,this.color=v,this.fillColor=C,this.visual=Je.createGroup(),this.visual.appendChild(Je.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Je.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return K.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},K.prototype.setCenter=function(v,C){this.visual.childNodes.forEach(function(F){return Je.setAttributes(F,[["cx",v.toString()],["cy",C.toString()]])})},K}(),Gn=function(){function K(v,C,F,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=v,this.canvasHeight=C,this.margin=F,this.container=q,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(K.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(v){this._aspectRatio=v,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.gridContainer&&Je.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(v){this._zoomFactor=v,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),K.prototype.open=function(){var v=this;this.cropShadeElement=Je.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Je.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var C=0;C<this.numberOfGridLines;C++)this.horizontalGridLines.push(Je.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Je.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(F){return v.gridContainer.appendChild(F)}),this.verticalGridLines.forEach(function(F){return v.gridContainer.appendChild(F)}),this.cropRectElement=Je.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Qt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Qt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Qt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Qt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},K.prototype.setCropRectangle=function(v){this.cropRect=v;var C=Object.assign({},this.cropRect);this.zoomFactor!==1&&(C.width=this.cropRect.width*this.zoomFactor,C.height=this.cropRect.height*this.zoomFactor,C.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-C.width/2,C.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-C.height/2),Je.setAttributes(this.cropRectElement,[["x",C.x.toString()],["y",C.y.toString()],["width",C.width.toString()],["height",C.height.toString()]]);var F=C.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(H,ue){var He=C.y+F*(ue+1);Je.setAttributes(H,[["x1",""+C.x],["y1",""+He],["x2",""+(C.x+C.width)],["y2",""+He]])});var q=C.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(H,ue){var He=C.x+q*(ue+1);Je.setAttributes(H,[["x1",""+He],["y1",""+C.y],["x2",""+He],["y2",""+(C.y+C.height)]])}),Je.setAttributes(this.cropShadeElement,[["d",Je.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,C.x,C.y,C.width,C.height)]]),this.topLeftGrip.setCenter(C.x,C.y),this.topRightGrip.setCenter(C.x+C.width,C.y),this.bottomLeftGrip.setCenter(C.x,C.y+C.height),this.bottomRightGrip.setCenter(C.x+C.width,C.y+C.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},K.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},K.prototype.clientToLocalCoordinates=function(v,C){var F=this.container.getBoundingClientRect();return{x:v-F.left+this.margin,y:C-F.top+this.margin}},K.prototype.onPointerDown=function(v){this.container.setPointerCapture(v.pointerId),this.previousPoint=this.clientToLocalCoordinates(v.clientX,v.clientY),this.cropRectElement===v.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(v.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(v.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(v.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(v.target)&&(this.activeGrip=this.bottomRightGrip)},K.prototype.onPointerMove=function(v){if(this.isMoving)this.move(this.clientToLocalCoordinates(v.clientX,v.clientY));else if(this.activeGrip){var C=this.clientToLocalCoordinates(v.clientX,v.clientY);this.resize(C)}v.preventDefault()},K.prototype.onPointerUp=function(v){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(v.pointerId)},K.prototype.move=function(v){var C=v.x-this.previousPoint.x,F=v.y-this.previousPoint.y;this.zoomFactor!==1&&(C=-C/this.zoomFactor,F=-F/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+C),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+F),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=v},K.prototype.resize=function(v){var C=Object.assign({},this.cropRect),F=v.x-this.previousPoint.x,q=v.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:C.x+F<this.margin&&(F=this.margin-C.x),C.x+=F,C.width=this.cropRect.x+this.cropRect.width-C.x;break;case this.bottomRightGrip:case this.topRightGrip:C.width+F>this.canvasWidth*this.zoomFactor&&(F=this.canvasWidth*this.zoomFactor-C.width),C.width+=F}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(C.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(F),C.height=this.aspectRatio.getVerticalLength(C.width)):(C.y+=q,C.height=this.cropRect.y+this.cropRect.height-C.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?C.height=this.aspectRatio.getVerticalLength(C.width):C.height+=q}C.width<10&&(C.x=this.cropRect.x,C.width=10),C.height<10&&(C.y=this.cropRect.y,C.height=10),this.previousPoint=v,C.x>=this.margin&&C.y>=this.margin&&C.x-this.margin+C.width<=this.canvasWidth&&C.y-this.margin+C.height<=this.canvasHeight&&(this.cropRect=C,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},K.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var v=this.cropRect.x+this.cropRect.width/2,C=this.cropRect.y+this.cropRect.height/2,F=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);F/this.canvasWidth<q/this.canvasHeight?this.cropRect.width=F:this.cropRect.height=q,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=v-this.cropRect.width/2,this.cropRect.y=C-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},K.prototype.getRescaledRect=function(v,C,F,q,H,ue){var He=F/v,Xe=q/C;return{x:(H.x-ue)*He+ue,y:(H.y-ue)*Xe+ue,width:H.width*He,height:H.height*Xe}},K.prototype.scaleCanvas=function(v,C){var F=this.getRescaledRect(this.canvasWidth,this.canvasHeight,v,C,this.cropRect,this.margin);this.canvasWidth=v,this.canvasHeight=C,this.onCropChange&&this.onCropChange(F),this.setCropRectangle(F)},K}(),ei=function(){function K(v){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=v,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(K.prototype,"angle",{get:function(){return this._angle},set:function(v){this._angle=v,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),K.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},K.prototype.onPointerDown=function(v){this.controlContainer.setPointerCapture(v.pointerId),this.isDragging=!0,this.previousPoint={x:v.clientX,y:v.clientY}},K.prototype.onPointerMove=function(v){this.isDragging&&(this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.previousPoint.x=v.clientX)},K.prototype.onPointerUp=function(v){this.isDragging&&this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(v.pointerId)},K.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var v=this.angleLabelText.getBBox();Je.setAttributes(this.angleLabelElement,[["x",((this.width-v.width)/2).toString()],["y",(this.height/2).toString()]])}},K.prototype.positionScaleShape=function(){if(this.scaleShape){var v=this.scaleShape.transform.baseVal.getItem(0);v.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(v,0)}},K.prototype.getVisual=function(){var v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttribute("xmlns","http://www.w3.org/2000/svg"),v.setAttribute("width",this.width+"px"),v.setAttribute("height",this.height+"px"),v.setAttribute("viewBox","0 0 "+this.width+" "+this.height),v.style.flexShrink="0",document.body.appendChild(v);for(var C="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,F=1;F<=this.width/5+10;F++){var q=F%5==0?this.height/3:this.height/6;C+="h4v"+-q+"h1v"+q}C+="v1H0Z",this.scaleShape=Je.createPath(C);var H=Je.createTransform();this.scaleShape.transform.baseVal.appendItem(H),v.appendChild(this.scaleShape),this.angleLabelElement=Je.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Je.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ue=Je.createTSpan("");return ue.innerHTML="°",this.angleLabelElement.appendChild(ue),v.appendChild(this.angleLabelElement),document.body.removeChild(v),v},K}(),Xn=function(){function K(){this.naturalSize=!1,this.imageType="image/png"}return K.prototype.rasterize=function(v,C,F,q,H,ue,He){var Xe=this;return new Promise(function(At){var We=document.createElement("canvas");We.width=v.width.baseVal.value-2*q,We.height=v.height.baseVal.value-2*q;var mt=1,Zt=1;Xe.naturalSize===!0?(mt=C.naturalWidth/(v.width.baseVal.value-2*q)/ue,Zt=C.naturalHeight/(v.height.baseVal.value-2*q)/He,We.width=C.naturalWidth/ue,We.height=C.naturalHeight/He):Xe.width!==void 0&&Xe.height!==void 0&&(mt=Xe.width/F.width,Zt=Xe.height/F.height,We.width*=mt,We.height*=Zt);var Fn=We.getContext("2d");Fn.translate(We.width/2,We.height/2),Fn.rotate(H*Math.PI/180),Fn.scale(ue,He),Fn.translate(-We.width/2,-We.height/2),Fn.drawImage(C,0,0,We.width,We.height);var Zn=document.createElement("canvas");Zn.width=F.width*mt,Zn.height=F.height*Zt,Zn.getContext("2d").putImageData(Fn.getImageData((F.x-q)*mt,(F.y-q)*Zt,F.width*mt,F.height*Zt),0,0),At(Zn.toDataURL(Xe.imageType,Xe.imageQuality))})},K}(),et=function(){function K(v){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=K.instanceCounter++,this.styles=new xt(this.instanceNo),this.target=v,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(K.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(v){this._zoomToCropEnabled=v,v?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"gridLines",{get:function(){return this._gridLines},set:function(v){this._gridLines=v,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(v){this._rotationAngle=v,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"aspectRatio",{get:function(){var v;return(v=this._aspectRatio)!==null&&v!==void 0?v:this.aspectRatios[0]},set:function(v){this._aspectRatio=v},enumerable:!1,configurable:!0}),K.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},K.prototype.show=function(){this.showUI(),this.open()},K.prototype.close=function(v){v===void 0&&(v=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),v||this.closeEventListeners.forEach(function(C){return C()}),this._isOpen=!1)},K.prototype.addRenderEventListener=function(v){this.renderEventListeners.push(v)},K.prototype.removeRenderEventListener=function(v){this.renderEventListeners.indexOf(v)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(v),1)},K.prototype.addCloseEventListener=function(v){this.closeEventListeners.push(v)},K.prototype.removeCloseEventListener=function(v){this.closeEventListeners.indexOf(v)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(v),1)},K.prototype.setupResizeObserver=function(){var v=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){v.resize(v.target.clientWidth,v.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},K.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var v=1*this.target.clientWidth/this.target.clientHeight,C=this.contentDiv.clientWidth/v>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*v:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,F=C+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/v;this.resize(C,F)}},K.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},K.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Je.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},K.prototype.resize=function(v,C){this.imageWidth=Math.round(v),this.imageHeight=Math.round(C),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},K.prototype.setEditingTarget=function(){var v=document.createElement("canvas");v.width=this.target.naturalWidth,v.height=this.target.naturalHeight,v.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var C=v.toDataURL();Je.setAttributes(this.editingTarget,[["href",C]]),this.setEditingTargetSize()},K.prototype.setTopLeft=function(){var v=this.target.getBoundingClientRect(),C=this.editorCanvas.getBoundingClientRect();this.left=v.left-C.left-this.CANVAS_MARGIN,this.top=v.top-C.top-this.CANVAS_MARGIN},K.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Je.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Je.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Je.createGroup(),this.editingTargetRotationScaleContainer=Je.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var v=Je.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(v);var C=Je.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(C),this.editingTargetContainer=Je.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},K.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},K.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Je.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Gn(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},K.prototype.zoomToCrop=function(){if(this.cropRect){var v=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,C=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=v+"px "+C+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-v+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-C+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},K.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},K.prototype.cropRectChanged=function(v){this.cropRect=v,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},K.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},K.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},K.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},K.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var v=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,C=this.target.offsetTop>v+this.CANVAS_MARGIN?this.target.offsetTop-(v+this.CANVAS_MARGIN):0;this.coverDiv.style.top=C+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},K.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},K.prototype.addTopToolbar=function(){var v=this;this.topToolbar=new hn,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var C=new gn;C.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(C);var F=[];this.aspectRatios.forEach(function(Zt){var Fn=new Jt(kn.getIcon(Zt.horizontal,Zt.vertical),Zt.horizontal===0&&Zt.vertical===0?"FREE":Zt.horizontal+":"+Zt.vertical);Fn.onClick=function(){return v.ratioButtonClicked(Zt)},F.push(Fn)}),this.aspectRatioButton=new Cn(kn.getIcon(0,0),"Aspect ratio",F),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,C.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var q=new Jt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");q.isActive=this.isGridVisible,q.onClick=function(){v.isGridVisible=!v.isGridVisible,q.isActive=v.isGridVisible},C.addButton(q);var H=new Jt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(H.isActive=this.zoomToCropEnabled,H.onClick=function(){v.zoomToCropEnabled=!v.zoomToCropEnabled,H.isActive=v.zoomToCropEnabled},C.addButton(H),!on.isLicensed){var ue=new Rt;this.topToolbar.addElementBlock(ue);var He=document.createElement("div");He.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Xe=document.createElement("a");Xe.style.color="currentColor",Xe.href="https://markerjs.com/products/cropro",Xe.target="_blank",Xe.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',He.appendChild(Xe),ue.addElement(He)}var At=new gn;At.minWidth=3*this.toolbarHeight+"px",At.contentAlign="end",this.topToolbar.addButtonBlock(At);var We=new Jt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");We.onClick=this.startRenderAndClose,At.addButton(We),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(We.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var mt=new Jt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");mt.onClick=this.close,At.addButton(mt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(mt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},K.prototype.addBottomToolbar=function(){var v=this;this.bottomToolbar=new hn,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var C=new gn;C.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(C);var F=new Jt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");F.onClick=this.rotateLeftButtonClicked,C.addButton(F);var q=new Jt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");q.onClick=this.rotateRightButtonClicked,C.addButton(q);var H=new Rt;H.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(H),this.straightener=new ei("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(At){v.rotateBy(At),v.straightener.angle=v.rotationAngle},H.addElement(this.straightener.getUI());var ue=new gn;ue.minWidth=2*this.toolbarHeight+"px",ue.contentAlign="end",this.bottomToolbar.addButtonBlock(ue);var He=new Jt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");He.onClick=this.flipHorizontallyButtonClicked,ue.addButton(He);var Xe=new Jt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");Xe.onClick=this.flipVerticallyButtonClicked,ue.addButton(Xe)},K.prototype.ratioButtonClicked=function(v){this.aspectRatio=v,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},K.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=kn.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},K.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Vn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},K.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},K.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},K.prototype.restoreState=function(v){if(v){var C=this.cropLayer.getRescaledRect(v.width,v.height,this.imageWidth,this.imageHeight,v.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(C),this.cropRectChanged(C),this.flippedHorizontally=v.flippedHorizontally,this.flippedVertically=v.flippedVertically,this.applyFlip(),this.rotationAngle=v.rotationAngle,this.applyRotation()}},K.prototype.clientToLocalCoordinates=function(v,C){var F=this.cropImage.getBoundingClientRect();return{x:v-F.left,y:C-F.top}},K.prototype.onWindowResize=function(){this.positionUI()},K.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var v=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},K.prototype.rotateLeftButtonClicked=function(){var v=this.rotationAngle-90;this.rotationAngle%90!=0&&(v+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(v)},K.prototype.rotateRightButtonClicked=function(){var v=this.rotationAngle+90;this.rotationAngle%90!=0&&(v-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(v)},K.prototype.rotateTo=function(v){v=(v=v>180?v-360:v)<=-180?v+360:v,this.rotationAngle=v,this.applyRotation()},K.prototype.rotateBy=function(v){this.rotateTo((this.rotationAngle+v)%360)},K.prototype.applyRotation=function(){var v=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var C=this.editingTargetRotationContainer.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(C,0);var F=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/F.width,this.imageHeight/F.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=v},K.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},K.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},K.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},K.prototype.startRenderAndClose=function(){return Nt(this,void 0,void 0,function(){var v,C;return Gt(this,function(F){switch(F.label){case 0:return[4,this.render()];case 1:return v=F.sent(),C=this.getState(),this.renderEventListeners.forEach(function(q){return q(v,C)}),this.close(!0),[2]}})})},K.prototype.render=function(){return Nt(this,void 0,void 0,function(){var v;return Gt(this,function(C){switch(C.label){case 0:return(v=new Xn).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.width=this.renderWidth,v.height=this.renderHeight,this.unzoomFromCrop(),Je.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,v.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return C.sent(),[4,v.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,C.sent()]}})})},K.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new zt("toolbar",`
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
overflow: hidden;
|
|
line-height: 0px;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new zt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new zt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var v=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new zt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*v)+`px;
|
|
height: `+(this.toolbarHeight-2*v)+`px;
|
|
padding: `+v+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new zt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new zt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new Ut("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ut("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new zt("toolbar_dropdown",`
|
|
position: absolute;
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
z-index: 20;
|
|
white-space: normal;
|
|
box-sizing: content-box;
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
line-height: 0px;
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new zt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new zt("toolbar_straightener_block",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new zt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*v)+`px;
|
|
padding: `+v+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new zt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},K.instanceCounter=0,K}(),jt=Q("8hTe"),Wn=Q.n(jt),mn=/<pre[^>]*>/g;function sn(K){var v=document.createElement("div");return v.innerHTML=K,v.childNodes.length===0?"":v.childNodes[0].nodeValue}var Dn=$e.a=function(K){var v=K.value,C=v===void 0?"":v,F=K.edit,q=F===void 0?!1:F,H=K.className,ue=K.showTextOnly,He=K.showLines,Xe=K.replaces,At=K.zoomImg,We=K.hasMask,mt=K.style,Zt=mt===void 0?{}:mt,Fn=K.stylesPrev,Zn=Fn===void 0?{}:Fn,fn=String(C),Mt=Object(I.useRef)(),Bt=Object(I.useRef)(),tn=Object(I.useState)(""),nn=Object(G.a)(tn,2),yn=nn[0],qn=nn[1],ln=Object(I.useState)("office"),ci=Object(G.a)(ln,2),cr=ci[0],gr=ci[1],_r=function(){var Pn=new et(Bt.current);Pn.displayMode="popup",Pn.addRenderEventListener(function(){var pi=Object(B.a)(P.a.mark(function pn(mi){var Yn;return P.a.wrap(function(Si){for(;;)switch(Si.prev=Si.next){case 0:return Mt.current.style.display="none",Si.next=3,Object(ke.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:mi}});case 3:Yn=Si.sent,Yn!=null&&Yn.id&&Xe(Bt.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(Yn==null?void 0:Yn.id,"?type=").concat(Yn.content_type));case 5:case"end":return Si.stop()}},pn)}));return function(pn){return pi.apply(this,arguments)}}()),Pn.show()},Wr=function(){var Pn=new je(Bt.current);Pn.settings.displayMode="popup",Pn.addEventListener("render",function(){var pi=Object(B.a)(P.a.mark(function pn(mi){var Yn;return P.a.wrap(function(Si){for(;;)switch(Si.prev=Si.next){case 0:if(Mt.current.style.display="none",!Bt.current){Si.next=6;break}return Si.next=4,Object(ke.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:mi.dataUrl}});case 4:Yn=Si.sent,Yn!=null&&Yn.id&&Xe(Bt.current.getAttribute("src").replace(ne.a.API_SERVER,""),"/api/attachments/".concat(Yn==null?void 0:Yn.id,"?type=").concat(Yn.content_type));case 6:case"end":return Si.stop()}},pn)}));return function(pn){return pi.apply(this,arguments)}}()),Pn.show(),window.markerArea=Pn},fi=Object(I.useMemo)(function(){Mt.current&&(Mt.current.style.zIndex=-1);try{var ai=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Pn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;fn=fn.replace(ai,"("+ne.a.API_SERVER+"/api/attachments/").replace(Pn,'"'+ne.a.API_SERVER+"/api/attachments/").replace(pi,'"'+ne.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(nr){}var pn=Y(fn),mi=_();if(fn.match(/\[TOC\]/)&&(pn=pn.replace("<p>[TOC]</p>",R()),L()),pn=pn.replace(/(__special_katext_id_\d+__)/g,function(nr,Si){var Pi=mi[Si],Gr=Pi.type,Qi=Pi.expression;return Object(oe.renderToString)(sn(Qi)||"",{displayMode:Gr==="block",throwOnError:!1,output:"html"})}),pn=pn.replace(/▁/g,"\u2581\u2581\u2581"),h(),ue){var Yn=document.createElement("div");return Yn.innerHTML=pn,Yn.innerText}return setTimeout(function(){return Kr()},500),pn},[fn]),Di=Object(I.useRef)();S.WebkitLineClamp=He,He&&(Zt=Object(D.a)(Object(D.a)({},Zt),S));function dr(ai){var Pn=ai.target;if(Pn.tagName.toUpperCase()==="IMG"){if(At){var pi=Pn.getAttribute("src");qn(pi),gr("image")}}else if(Pn.tagName.toUpperCase()==="A"){var pn=Pn.getAttribute("href");if(pn.indexOf("office")>-1)ai.preventDefault(),qn(pn),gr("office");else if(pn.indexOf("application/pdf")>-1)ai.preventDefault(),qn(pn),gr("pdf");else if(pn.indexOf("text/html")>-1)ai.preventDefault(),qn(pn),gr("html");else if(pn.startsWith("#")){ai.preventDefault();var mi=document.getElementById(pn.replace("#",""));mi&&mi.scrollIntoView(!0)}}}var Kr=function(){var Pn,pi=(Pn=Di.current)===null||Pn===void 0?void 0:Pn.querySelectorAll("video");pi==null||pi.forEach(function(pn){if(pn.oncontextmenu=function(){return!1},pn.src.indexOf(".m3u8")>-1&&!pn.canPlayType("application/vnd.apple.mpegurl")){if(J.a.isSupported()){var mi=new J.a;mi.loadSource(pn.src),mi.attachMedia(pn)}}})};Object(I.useEffect)(function(){if(Di.current&&fi&&(fi.match(mn)&&window.PR.prettyPrint()),Di.current)return Di.current.addEventListener("click",dr),function(){Di.current.removeEventListener("click",dr),h(),L()}},[fi,Di.current,dr]);var Ar=function(Pn){if(!q)return;Pn.target.nodeName==="IMG"?(Mt.current.style.zIndex=1,Mt.current.style.display="flex",Mt.current.style.width=Pn.target.clientWidth+"px",Mt.current.style.height=Pn.target.clientHeight+"px",Mt.current.style.top=Pn.target.offsetTop+"px",Mt.current.style.left=Pn.target.offsetLeft+"px",Bt.current.src=Pn.target.getAttribute("src")):Mt.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Di,style:Object(D.a)({},Zt),className:"".concat(H||""," markdown-body ").concat(Wn.a.mdBody),onMouseOver:Ar,dangerouslySetInnerHTML:{__html:fi}}),y.a.createElement("div",{ref:Mt,className:Wn.a.button},y.a.createElement(W.a,null,y.a.createElement(X.a,{onClick:function(){return _r()}},"\u88C1\u526A"),y.a.createElement(X.a,{onClick:function(){return Wr()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:Bt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(fe.a,{close:!0,data:yn,type:yn!=null&&yn.length?cr:"",style:Object(D.a)({},Zn),onClose:function(){return qn("")}}))}},"9JIy":function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___Hq8-r",flex_space_between:"flex_space_between___3Nl1U",flex_box_vertical_center:"flex_box_vertical_center___1hgum",flex_box_center_end:"flex_box_center_end___i5ldC",flex_box_column:"flex_box_column____1u-K",table:"table___2yPMl"}},"9VGf":function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return k});var se=Q("q1tI"),W=Q.n(se);function k(X,D){var B=Object(se.useRef)();Object(se.useEffect)(function(){B.current=X}),Object(se.useEffect)(function(){function G(){B.current()}if(D!==null){var j=setInterval(G,D);return function(){return clearInterval(j)}}},[D])}},BU3w:function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return B});var se=Q("MNnm"),W="rc-util-key";function k(G){if(G.attachTo)return G.attachTo;var j=document.querySelector("head");return j||document.body}function X(G){var j,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(se.a)())return null;var I=document.createElement("style");if((j=P.csp)===null||j===void 0?void 0:j.nonce){var y;I.nonce=(y=P.csp)===null||y===void 0?void 0:y.nonce}I.innerHTML=G;var m=k(P),p=m.firstChild;return P.prepend&&m.prepend?m.prepend(I):P.prepend&&p?m.insertBefore(I,p):m.appendChild(I),I}var D=new Map;function B(G,j){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=k(P);if(!D.has(I)){var y=X("",P),m=y.parentNode;D.set(I,m),m.removeChild(y)}var p=Array.from(D.get(I).children).find(function(r){return r.tagName==="STYLE"&&r[W]===j});if(p){var c,u;if(((c=P.csp)===null||c===void 0?void 0:c.nonce)&&p.nonce!==((u=P.csp)===null||u===void 0?void 0:u.nonce)){var f;p.nonce=(f=P.csp)===null||f===void 0?void 0:f.nonce}return p.innerHTML!==G&&(p.innerHTML=G),p}var s=X(G,P);return s[W]=j,s}},Bd2K:function(ct,$e,Q){(function(se){se(Q("VrN/"),Q("osHv"))})(function(se){se.defineOption("autoCloseTags",!1,function(P,I,y){if(y!=se.Init&&y&&P.removeKeyMap("autoCloseTags"),!I)return;var m={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(m["'/'"]=function(p){return B(p)}),(typeof I!="object"||I.whenOpening!==!1)&&(m["'>'"]=function(p){return X(p)}),P.addKeyMap(m)});var W=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],k=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(P){if(P.getOption("disableInput"))return se.Pass;for(var I=P.listSelections(),y=[],m=P.getOption("autoCloseTags"),p=0;p<I.length;p++){if(!I[p].empty())return se.Pass;var c=I[p].head,u=P.getTokenAt(c),f=se.innerMode(P.getMode(),u.state),s=f.state,r=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(s),a=r&&r.name;if(!a)return se.Pass;var d=f.mode.configuration=="html",L=typeof m=="object"&&m.dontCloseTags||d&&W,S=typeof m=="object"&&m.indentTags||d&&k;u.end>c.ch&&(a=a.slice(0,a.length-u.end+c.ch));var x=a.toLowerCase();if(!a||u.type=="string"&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||u.string.length==1)||u.type=="tag"&&r.close||u.string.indexOf("/")==c.ch-u.start-1||L&&G(L,x)>-1||j(P,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(s)||[],a,c,!0))return se.Pass;var R=typeof m=="object"&&m.emptyTags;if(R&&G(R,a)>-1){y[p]={text:"/>",newPos:se.Pos(c.line,c.ch+2)};continue}var O=S&&G(S,x)>-1;y[p]={indent:O,text:">"+(O?`
|
|
|
|
`:"")+"</"+a+">",newPos:O?se.Pos(c.line+1,0):se.Pos(c.line,c.ch+1)}}for(var w=typeof m=="object"&&m.dontIndentOnAutoClose,p=I.length-1;p>=0;p--){var E=y[p];P.replaceRange(E.text,I[p].head,I[p].anchor,"+insert");var b=P.listSelections().slice(0);b[p]={head:E.newPos,anchor:E.newPos},P.setSelections(b),!w&&E.indent&&(P.indentLine(E.newPos.line,null,!0),P.indentLine(E.newPos.line+1,null,!0))}}function D(P,I){for(var y=P.listSelections(),m=[],p=I?"/":"</",c=P.getOption("autoCloseTags"),u=typeof c=="object"&&c.dontIndentOnSlash,f=0;f<y.length;f++){if(!y[f].empty())return se.Pass;var s=y[f].head,r=P.getTokenAt(s),a=se.innerMode(P.getMode(),r.state),d=a.state;if(I&&(r.type=="string"||r.string.charAt(0)!="<"||r.start!=s.ch-1))return se.Pass;var L,S=a.mode.name!="xml"&&P.getMode().name=="htmlmixed";if(S&&a.mode.name=="javascript")L=p+"script";else if(S&&a.mode.name=="css")L=p+"style";else{var x=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(d);if(!x||x.length&&j(P,x,x[x.length-1],s))return se.Pass;L=p+x[x.length-1]}P.getLine(s.line).charAt(r.end)!=">"&&(L+=">"),m[f]=L}if(P.replaceSelections(m),y=P.listSelections(),!u)for(var f=0;f<y.length;f++)(f==y.length-1||y[f].head.line<y[f+1].head.line)&&P.indentLine(y[f].head.line)}function B(P){return P.getOption("disableInput")?se.Pass:D(P,!0)}se.commands.closeTag=function(P){return D(P)};function G(P,I){if(P.indexOf)return P.indexOf(I);for(var y=0,m=P.length;y<m;++y)if(P[y]==I)return y;return-1}function j(P,I,y,m,p){if(!se.scanForClosingTag)return!1;var c=Math.min(P.lastLine()+1,m.line+500),u=se.scanForClosingTag(P,m,null,c);if(!u||u.tag!=y)return!1;for(var f=p?1:0,s=I.length-1;s>=0&&I[s]==y;s--)++f;m=u.to;for(var s=1;s<f;s++){var r=se.scanForClosingTag(P,m,null,c);if(!r||r.tag!=y)return!1;m=r.to}return!0}})},BdwD:function(ct,$e,Q){"use strict";var se=Q("+L6B"),W=Q("2/Rp"),k=Q("0Owb"),X=Q("k1fw"),D=Q("q1tI"),B=Q.n(D),G=Q("FOrL"),j=Q.n(G),P=function(y){var m=y.buttonProps,p=m===void 0?{}:m,c=y.styles,u=c===void 0?{}:c,f=y.customText,s=y.ButtonText,r=y.ButtonClick,a=y.Buttonclass,d=y.ButtonTwo;return B.a.createElement("section",{className:"tc animated fadeIn",style:Object(X.a)(Object(X.a)({},{color:"#999",margin:"200px auto"}),u)},B.a.createElement("img",{src:j.a}),B.a.createElement("p",{className:"mt20 font14"},f||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),s&&B.a.createElement(W.a,Object(k.a)({className:a,onClick:r},p),s),d&&d)};$e.a=P},BjJ7:function(ct,$e,Q){"use strict";Q.d($e,"d",function(){return W}),Q.d($e,"c",function(){return k}),Q.d($e,"e",function(){return X}),Q.d($e,"b",function(){return D}),Q.d($e,"a",function(){return G});var se=Q("m3rI");function W(j){var P=!0;if(j.length>0){for(var I=0;I<j.length;I++)if(j[I].compile_success==0||!j[I].compile_success){P=!1;break}}else P=!1;return P}function k(j){for(var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],y=0;y<j.length;y++){var m=j[y],p=P?"".concat(P,"/").concat(m.name):"".concat(m.name);I.push({title:m.name,isLeaf:!(m.type==="tree"),key:p})}return I}function X(j,P,I){for(var y=0;y<j.length;y++){var m=j[y];if(m.key===P){m.children=I;break}m.children&&X(m.children,P,I)}return j}function D(j,P,I){var y;return function(){var m=this,p=arguments,c=function(){y=null,I||j.apply(m,p)},u=I&&!y;clearTimeout(y),y=setTimeout(c,P),u&&j.apply(m,p)}}var B=!0,G=se.a.API_SERVER},Bq7L:function(ct,$e){ct.exports="data:image/png;base64,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"},"C+DQ":function(ct,$e,Q){},DlQD:function(ct,$e,Q){(function(se,W){ct.exports=W()})(this,function(){"use strict";function se(Ce,Ee){for(var Te=0;Te<Ee.length;Te++){var ee=Ee[Te];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(Ce,ee.key,ee)}}function W(Ce,Ee,Te){return Ee&&se(Ce.prototype,Ee),Te&&se(Ce,Te),Ce}function k(Ce,Ee){if(!Ce)return;if(typeof Ce=="string")return X(Ce,Ee);var Te=Object.prototype.toString.call(Ce).slice(8,-1);if(Te==="Object"&&Ce.constructor&&(Te=Ce.constructor.name),Te==="Map"||Te==="Set")return Array.from(Ce);if(Te==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Te))return X(Ce,Ee)}function X(Ce,Ee){(Ee==null||Ee>Ce.length)&&(Ee=Ce.length);for(var Te=0,ee=new Array(Ee);Te<Ee;Te++)ee[Te]=Ce[Te];return ee}function D(Ce,Ee){var Te;if(typeof Symbol=="undefined"||Ce[Symbol.iterator]==null){if(Array.isArray(Ce)||(Te=k(Ce))||Ee&&Ce&&typeof Ce.length=="number"){Te&&(Ce=Te);var ee=0;return function(){return ee>=Ce.length?{done:!0}:{done:!1,value:Ce[ee++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Te=Ce[Symbol.iterator](),Te.next.bind(Te)}function B(Ce,Ee){return Ee={exports:{}},Ce(Ee,Ee.exports),Ee.exports}var G=B(function(Ce){function Ee(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Te(ee){Ce.exports.defaults=ee}Ce.exports={defaults:Ee(),getDefaults:Ee,changeDefaults:Te}}),j=G.defaults,P=G.getDefaults,I=G.changeDefaults,y=/[&<>"']/,m=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,u={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(Ee){return u[Ee]};function s(Ce,Ee){if(Ee){if(y.test(Ce))return Ce.replace(m,f)}else if(p.test(Ce))return Ce.replace(c,f);return Ce}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(Ce){return Ce.replace(r,function(Ee,Te){return Te=Te.toLowerCase(),Te==="colon"?":":Te.charAt(0)==="#"?Te.charAt(1)==="x"?String.fromCharCode(parseInt(Te.substring(2),16)):String.fromCharCode(+Te.substring(1)):""})}var d=/(^|[^\[])\^/g;function L(Ce,Ee){Ce=Ce.source||Ce,Ee=Ee||"";var Te={replace:function(ae,de){return de=de.source||de,de=de.replace(d,"$1"),Ce=Ce.replace(ae,de),Te},getRegex:function(){return new RegExp(Ce,Ee)}};return Te}var S=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ce,Ee,Te){if(Ce){var ee;try{ee=decodeURIComponent(a(Te)).replace(S,"").toLowerCase()}catch(ae){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}Ee&&!x.test(Te)&&(Te=l(Ee,Te));try{Te=encodeURI(Te).replace(/%25/g,"%")}catch(ae){return null}return Te}var O={},w=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,b=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(Ce,Ee){O[" "+Ce]||(w.test(Ce)?O[" "+Ce]=Ce+"/":O[" "+Ce]=T(Ce,"/",!0)),Ce=O[" "+Ce];var Te=Ce.indexOf(":")===-1;return Ee.substring(0,2)==="//"?Te?Ee:Ce.replace(E,"$1")+Ee:Ee.charAt(0)==="/"?Te?Ee:Ce.replace(b,"$1")+Ee:Ce+Ee}var _={exec:function(){}};function h(Ce){for(var Ee=1,Te,ee;Ee<arguments.length;Ee++){Te=arguments[Ee];for(ee in Te)Object.prototype.hasOwnProperty.call(Te,ee)&&(Ce[ee]=Te[ee])}return Ce}function g(Ce,Ee){var Te=Ce.replace(/\|/g,function(de,pe,_e){for(var Re=!1,De=pe;--De>=0&&_e[De]==="\\";)Re=!Re;return Re?"|":" |"}),ee=Te.split(/ \|/),ae=0;if(ee.length>Ee)ee.splice(Ee);else for(;ee.length<Ee;)ee.push("");for(;ae<ee.length;ae++)ee[ae]=ee[ae].trim().replace(/\\\|/g,"|");return ee}function T(Ce,Ee,Te){var ee=Ce.length;if(ee===0)return"";for(var ae=0;ae<ee;){var de=Ce.charAt(ee-ae-1);if(de===Ee&&!Te)ae++;else if(de!==Ee&&Te)ae++;else break}return Ce.substr(0,ee-ae)}function N(Ce,Ee){if(Ce.indexOf(Ee[1])===-1)return-1;for(var Te=Ce.length,ee=0,ae=0;ae<Te;ae++)if(Ce[ae]==="\\")ae++;else if(Ce[ae]===Ee[0])ee++;else if(Ce[ae]===Ee[1]&&(ee--,ee<0))return ae;return-1}function V(Ce){Ce&&Ce.sanitize&&!Ce.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var Y={escape:s,unescape:a,edit:L,cleanUrl:R,resolveUrl:l,noopTest:_,merge:h,splitCells:g,rtrim:T,findClosingBracket:N,checkSanitizeDeprecation:V},U=G.defaults,A=Y.rtrim,J=Y.splitCells,ne=Y.escape,oe=Y.findClosingBracket;function fe(Ce,Ee,Te){var ee=Ee.href,ae=Ee.title?ne(Ee.title):null,de=Ce[1].replace(/\\([\[\]])/g,"$1");return Ce[0].charAt(0)!=="!"?{type:"link",raw:Te,href:ee,title:ae,text:de}:{type:"image",raw:Te,href:ee,title:ae,text:ne(de)}}function ke(Ce,Ee){var Te=Ce.match(/^(\s+)(?:```)/);if(Te===null)return Ee;var ee=Te[1];return Ee.split(`
|
|
`).map(function(ae){var de=ae.match(/^\s+/);if(de===null)return ae;var pe=de[0];return pe.length>=ee.length?ae.slice(ee.length):ae}).join(`
|
|
`)}var Oe=function(){function Ce(Te){this.options=Te||U}var Ee=Ce.prototype;return Ee.space=function(ee){var ae=this.rules.block.newline.exec(ee);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
|
|
`}},Ee.code=function(ee,ae){var de=this.rules.block.code.exec(ee);if(de){var pe=ae[ae.length-1];if(pe&&pe.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var _e=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?_e:A(_e,`
|
|
`)}}},Ee.fences=function(ee){var ae=this.rules.block.fences.exec(ee);if(ae){var de=ae[0],pe=ke(de,ae[3]||"");return{type:"code",raw:de,lang:ae[2]?ae[2].trim():ae[2],text:pe}}},Ee.heading=function(ee){var ae=this.rules.block.heading.exec(ee);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},Ee.nptable=function(ee){var ae=this.rules.block.nptable.exec(ee);if(ae){var de={type:"table",header:J(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ae[0]};if(de.header.length===de.align.length){var pe=de.align.length,_e;for(_e=0;_e<pe;_e++)/^ *-+: *$/.test(de.align[_e])?de.align[_e]="right":/^ *:-+: *$/.test(de.align[_e])?de.align[_e]="center":/^ *:-+ *$/.test(de.align[_e])?de.align[_e]="left":de.align[_e]=null;for(pe=de.cells.length,_e=0;_e<pe;_e++)de.cells[_e]=J(de.cells[_e],de.header.length);return de}}},Ee.hr=function(ee){var ae=this.rules.block.hr.exec(ee);if(ae)return{type:"hr",raw:ae[0]}},Ee.blockquote=function(ee){var ae=this.rules.block.blockquote.exec(ee);if(ae){var de=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:de}}},Ee.list=function(ee){var ae=this.rules.block.list.exec(ee);if(ae){for(var de=ae[0],pe=ae[2],_e=pe.length>1,Re=pe[pe.length-1]===")",De={type:"list",raw:de,ordered:_e,start:_e?+pe.slice(0,-1):"",loose:!1,items:[]},Ze=ae[0].match(this.rules.block.item),dt=!1,ht,Ft,vt,Ge,en,je,un,yt=Ze.length,Nt=0;Nt<yt;Nt++)ht=Ze[Nt],de=ht,Ft=ht.length,ht=ht.replace(/^ *([*+-]|\d+[.)]) */,""),~ht.indexOf(`
|
|
`)&&(Ft-=ht.length,ht=this.options.pedantic?ht.replace(/^ {1,4}/gm,""):ht.replace(new RegExp("^ {1,"+Ft+"}","gm"),"")),Nt!==yt-1&&(vt=this.rules.block.bullet.exec(Ze[Nt+1])[0],(_e?vt.length===1||!Re&&vt[vt.length-1]===")":vt.length>1||this.options.smartLists&&vt!==pe)&&(Ge=Ze.slice(Nt+1).join(`
|
|
`),De.raw=De.raw.substring(0,De.raw.length-Ge.length),Nt=yt-1)),en=dt||/\n\n(?!\s*$)/.test(ht),Nt!==yt-1&&(dt=ht.charAt(ht.length-1)===`
|
|
`,en||(en=dt)),en&&(De.loose=!0),je=/^\[[ xX]\] /.test(ht),un=void 0,je&&(un=ht[1]!==" ",ht=ht.replace(/^\[[ xX]\] +/,"")),De.items.push({type:"list_item",raw:de,task:je,checked:un,loose:en,text:ht});return De}},Ee.html=function(ee){var ae=this.rules.block.html.exec(ee);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):ne(ae[0]):ae[0]}},Ee.def=function(ee){var ae=this.rules.block.def.exec(ee);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var de=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:ae[0],href:ae[2],title:ae[3]}}},Ee.table=function(ee){var ae=this.rules.block.table.exec(ee);if(ae){var de={type:"table",header:J(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[]};if(de.header.length===de.align.length){de.raw=ae[0];var pe=de.align.length,_e;for(_e=0;_e<pe;_e++)/^ *-+: *$/.test(de.align[_e])?de.align[_e]="right":/^ *:-+: *$/.test(de.align[_e])?de.align[_e]="center":/^ *:-+ *$/.test(de.align[_e])?de.align[_e]="left":de.align[_e]=null;for(pe=de.cells.length,_e=0;_e<pe;_e++)de.cells[_e]=J(de.cells[_e].replace(/^ *\| *| *\| *$/g,""),de.header.length);return de}}},Ee.lheading=function(ee){var ae=this.rules.block.lheading.exec(ee);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1]}},Ee.paragraph=function(ee){var ae=this.rules.block.paragraph.exec(ee);if(ae)return{type:"paragraph",raw:ae[0],text:ae[1].charAt(ae[1].length-1)===`
|
|
`?ae[1].slice(0,-1):ae[1]}},Ee.text=function(ee,ae){var de=this.rules.block.text.exec(ee);if(de){var pe=ae[ae.length-1];return pe&&pe.type==="text"?{raw:de[0],text:de[0]}:{type:"text",raw:de[0],text:de[0]}}},Ee.escape=function(ee){var ae=this.rules.inline.escape.exec(ee);if(ae)return{type:"escape",raw:ae[0],text:ne(ae[1])}},Ee.tag=function(ee,ae,de){var pe=this.rules.inline.tag.exec(ee);if(pe)return!ae&&/^<a /i.test(pe[0])?ae=!0:ae&&/^<\/a>/i.test(pe[0])&&(ae=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(pe[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(pe[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:pe[0],inLink:ae,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):ne(pe[0]):pe[0]}},Ee.link=function(ee){var ae=this.rules.inline.link.exec(ee);if(ae){var de=oe(ae[2],"()");if(de>-1){var pe=ae[0].indexOf("!")===0?5:4,_e=pe+ae[1].length+de;ae[2]=ae[2].substring(0,de),ae[0]=ae[0].substring(0,_e).trim(),ae[3]=""}var Re=ae[2],De="";if(this.options.pedantic){var Ze=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Re);Ze?(Re=Ze[1],De=Ze[3]):De=""}else De=ae[3]?ae[3].slice(1,-1):"";Re=Re.trim().replace(/^<([\s\S]*)>$/,"$1");var dt=fe(ae,{href:Re&&Re.replace(this.rules.inline._escapes,"$1"),title:De&&De.replace(this.rules.inline._escapes,"$1")},ae[0]);return dt}},Ee.reflink=function(ee,ae){var de;if((de=this.rules.inline.reflink.exec(ee))||(de=this.rules.inline.nolink.exec(ee))){var pe=(de[2]||de[1]).replace(/\s+/g," ");if(pe=ae[pe.toLowerCase()],!pe||!pe.href){var _e=de[0].charAt(0);return{type:"text",raw:_e,text:_e}}var Re=fe(de,pe,de[0]);return Re}},Ee.strong=function(ee,ae,de){de===void 0&&(de="");var pe=this.rules.inline.strong.start.exec(ee);if(pe&&(!pe[1]||pe[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ae=ae.slice(-1*ee.length);var _e=pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;_e.lastIndex=0;for(var Re;(pe=_e.exec(ae))!=null;)if(Re=this.rules.inline.strong.middle.exec(ae.slice(0,pe.index+3)),Re)return{type:"strong",raw:ee.slice(0,Re[0].length),text:ee.slice(2,Re[0].length-2)}}},Ee.em=function(ee,ae,de){de===void 0&&(de="");var pe=this.rules.inline.em.start.exec(ee);if(pe&&(!pe[1]||pe[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ae=ae.slice(-1*ee.length);var _e=pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;_e.lastIndex=0;for(var Re;(pe=_e.exec(ae))!=null;)if(Re=this.rules.inline.em.middle.exec(ae.slice(0,pe.index+2)),Re)return{type:"em",raw:ee.slice(0,Re[0].length),text:ee.slice(1,Re[0].length-1)}}},Ee.codespan=function(ee){var ae=this.rules.inline.code.exec(ee);if(ae){var de=ae[2].replace(/\n/g," "),pe=/[^ ]/.test(de),_e=de.startsWith(" ")&&de.endsWith(" ");return pe&&_e&&(de=de.substring(1,de.length-1)),de=ne(de,!0),{type:"codespan",raw:ae[0],text:de}}},Ee.br=function(ee){var ae=this.rules.inline.br.exec(ee);if(ae)return{type:"br",raw:ae[0]}},Ee.del=function(ee){var ae=this.rules.inline.del.exec(ee);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},Ee.autolink=function(ee,ae){var de=this.rules.inline.autolink.exec(ee);if(de){var pe,_e;return de[2]==="@"?(pe=ne(this.options.mangle?ae(de[1]):de[1]),_e="mailto:"+pe):(pe=ne(de[1]),_e=pe),{type:"link",raw:de[0],text:pe,href:_e,tokens:[{type:"text",raw:pe,text:pe}]}}},Ee.url=function(ee,ae){var de;if(de=this.rules.inline.url.exec(ee)){var pe,_e;if(de[2]==="@")pe=ne(this.options.mangle?ae(de[0]):de[0]),_e="mailto:"+pe;else{var Re;do Re=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(Re!==de[0]);pe=ne(de[0]),de[1]==="www."?_e="http://"+pe:_e=pe}return{type:"link",raw:de[0],text:pe,href:_e,tokens:[{type:"text",raw:pe,text:pe}]}}},Ee.inlineText=function(ee,ae,de){var pe=this.rules.inline.text.exec(ee);if(pe){var _e;return ae?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):ne(pe[0]):pe[0]:_e=ne(this.options.smartypants?de(pe[0]):pe[0]),{type:"text",raw:pe[0],text:_e}}},Ce}(),Me=Y.noopTest,Be=Y.edit,Pe=Y.merge,be={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Me,table:Me,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Be(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Be(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Be(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",be._comment=/<!--(?!-?>)[\s\S]*?-->/,be.html=Be(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Be(be._paragraph).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.blockquote=Be(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=Pe({},be),be.gfm=Pe({},be.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),be.gfm.nptable=Be(be.gfm.nptable).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.gfm.table=Be(be.gfm.table).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.pedantic=Pe({},be.normal,{html:Be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Me,paragraph:Be(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var le={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Me,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Me,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};le._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",le.punctuation=Be(le.punctuation).replace(/punctuation/g,le._punctuation).getRegex(),le._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",le._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",le.em.start=Be(le.em.start).replace(/punctuation/g,le._punctuation).getRegex(),le.em.middle=Be(le.em.middle).replace(/punctuation/g,le._punctuation).replace(/overlapSkip/g,le._overlapSkip).getRegex(),le.em.endAst=Be(le.em.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.em.endUnd=Be(le.em.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.start=Be(le.strong.start).replace(/punctuation/g,le._punctuation).getRegex(),le.strong.middle=Be(le.strong.middle).replace(/punctuation/g,le._punctuation).replace(/blockSkip/g,le._blockSkip).getRegex(),le.strong.endAst=Be(le.strong.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.endUnd=Be(le.strong.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.blockSkip=Be(le._blockSkip,"g").getRegex(),le.overlapSkip=Be(le._overlapSkip,"g").getRegex(),le._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,le._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,le._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,le.autolink=Be(le.autolink).replace("scheme",le._scheme).replace("email",le._email).getRegex(),le._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,le.tag=Be(le.tag).replace("comment",be._comment).replace("attribute",le._attribute).getRegex(),le._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,le._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,le._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,le.link=Be(le.link).replace("label",le._label).replace("href",le._href).replace("title",le._title).getRegex(),le.reflink=Be(le.reflink).replace("label",le._label).getRegex(),le.reflinkSearch=Be(le.reflinkSearch,"g").replace("reflink",le.reflink).replace("nolink",le.nolink).getRegex(),le.normal=Pe({},le),le.pedantic=Pe({},le.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Be(/^!?\[(label)\]\((.*?)\)/).replace("label",le._label).getRegex(),reflink:Be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le._label).getRegex()}),le.gfm=Pe({},le.normal,{escape:Be(le.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),le.gfm.url=Be(le.gfm.url,"i").replace("email",le.gfm._extended_email).getRegex(),le.breaks=Pe({},le.gfm,{br:Be(le.br).replace("{2,}","*").getRegex(),text:Be(le.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Le={block:be,inline:le},tt=G.defaults,nt=Le.block,lt=Le.inline;function Et(Ce){return Ce.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Ve(Ce){var Ee="",Te,ee,ae=Ce.length;for(Te=0;Te<ae;Te++)ee=Ce.charCodeAt(Te),Math.random()>.5&&(ee="x"+ee.toString(16)),Ee+="&#"+ee+";";return Ee}var Qe=function(){function Ce(Te){this.tokens=[],this.tokens.links=Object.create(null),this.options=Te||tt,this.options.tokenizer=this.options.tokenizer||new Oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:nt.normal,inline:lt.normal};this.options.pedantic?(ee.block=nt.pedantic,ee.inline=lt.pedantic):this.options.gfm&&(ee.block=nt.gfm,this.options.breaks?ee.inline=lt.breaks:ee.inline=lt.gfm),this.tokenizer.rules=ee}Ce.lex=function(ee,ae){var de=new Ce(ae);return de.lex(ee)};var Ee=Ce.prototype;return Ee.lex=function(ee){return ee=ee.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ee,this.tokens,!0),this.inline(this.tokens),this.tokens},Ee.blockTokens=function(ee,ae,de){ae===void 0&&(ae=[]),de===void 0&&(de=!0),ee=ee.replace(/^ +$/gm,"");for(var pe,_e,Re,De;ee;){if(pe=this.tokenizer.space(ee)){ee=ee.substring(pe.raw.length),pe.type&&ae.push(pe);continue}if(pe=this.tokenizer.code(ee,ae)){ee=ee.substring(pe.raw.length),pe.type?ae.push(pe):(De=ae[ae.length-1],De.raw+=`
|
|
`+pe.raw,De.text+=`
|
|
`+pe.text);continue}if(pe=this.tokenizer.fences(ee)){ee=ee.substring(pe.raw.length),ae.push(pe);continue}if(pe=this.tokenizer.heading(ee)){ee=ee.substring(pe.raw.length),ae.push(pe);continue}if(pe=this.tokenizer.nptable(ee)){ee=ee.substring(pe.raw.length),ae.push(pe);continue}if(pe=this.tokenizer.hr(ee)){ee=ee.substring(pe.raw.length),ae.push(pe);continue}if(pe=this.tokenizer.blockquote(ee)){ee=ee.substring(pe.raw.length),pe.tokens=this.blockTokens(pe.text,[],de),ae.push(pe);continue}if(pe=this.tokenizer.list(ee)){for(ee=ee.substring(pe.raw.length),Re=pe.items.length,_e=0;_e<Re;_e++)pe.items[_e].tokens=this.blockTokens(pe.items[_e].text,[],!1);ae.push(pe);continue}if(pe=this.tokenizer.html(ee)){ee=ee.substring(pe.raw.length),ae.push(pe);continue}if(de&&(pe=this.tokenizer.def(ee))){ee=ee.substring(pe.raw.length),this.tokens.links[pe.tag]||(this.tokens.links[pe.tag]={href:pe.href,title:pe.title});continue}if(pe=this.tokenizer.table(ee)){ee=ee.substring(pe.raw.length),ae.push(pe);continue}if(pe=this.tokenizer.lheading(ee)){ee=ee.substring(pe.raw.length),ae.push(pe);continue}if(de&&(pe=this.tokenizer.paragraph(ee))){ee=ee.substring(pe.raw.length),ae.push(pe);continue}if(pe=this.tokenizer.text(ee,ae)){ee=ee.substring(pe.raw.length),pe.type?ae.push(pe):(De=ae[ae.length-1],De.raw+=`
|
|
`+pe.raw,De.text+=`
|
|
`+pe.text);continue}if(ee){var Ze="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(Ze);break}else throw new Error(Ze)}}return ae},Ee.inline=function(ee){var ae,de,pe,_e,Re,De,Ze=ee.length;for(ae=0;ae<Ze;ae++){De=ee[ae];switch(De.type){case"paragraph":case"text":case"heading":{De.tokens=[],this.inlineTokens(De.text,De.tokens);break}case"table":{for(De.tokens={header:[],cells:[]},_e=De.header.length,de=0;de<_e;de++)De.tokens.header[de]=[],this.inlineTokens(De.header[de],De.tokens.header[de]);for(_e=De.cells.length,de=0;de<_e;de++)for(Re=De.cells[de],De.tokens.cells[de]=[],pe=0;pe<Re.length;pe++)De.tokens.cells[de][pe]=[],this.inlineTokens(Re[pe],De.tokens.cells[de][pe]);break}case"blockquote":{this.inline(De.tokens);break}case"list":{for(_e=De.items.length,de=0;de<_e;de++)this.inline(De.items[de].tokens);break}}}return ee},Ee.inlineTokens=function(ee,ae,de,pe,_e){ae===void 0&&(ae=[]),de===void 0&&(de=!1),pe===void 0&&(pe=!1),_e===void 0&&(_e="");var Re,De=ee,Ze;if(this.tokens.links){var dt=Object.keys(this.tokens.links);if(dt.length>0)for(;(Ze=this.tokenizer.rules.inline.reflinkSearch.exec(De))!=null;)dt.includes(Ze[0].slice(Ze[0].lastIndexOf("[")+1,-1))&&(De=De.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ze=this.tokenizer.rules.inline.blockSkip.exec(De))!=null;)De=De.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ee;){if(Re=this.tokenizer.escape(ee)){ee=ee.substring(Re.raw.length),ae.push(Re);continue}if(Re=this.tokenizer.tag(ee,de,pe)){ee=ee.substring(Re.raw.length),de=Re.inLink,pe=Re.inRawBlock,ae.push(Re);continue}if(Re=this.tokenizer.link(ee)){ee=ee.substring(Re.raw.length),Re.type==="link"&&(Re.tokens=this.inlineTokens(Re.text,[],!0,pe)),ae.push(Re);continue}if(Re=this.tokenizer.reflink(ee,this.tokens.links)){ee=ee.substring(Re.raw.length),Re.type==="link"&&(Re.tokens=this.inlineTokens(Re.text,[],!0,pe)),ae.push(Re);continue}if(Re=this.tokenizer.strong(ee,De,_e)){ee=ee.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],de,pe),ae.push(Re);continue}if(Re=this.tokenizer.em(ee,De,_e)){ee=ee.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],de,pe),ae.push(Re);continue}if(Re=this.tokenizer.codespan(ee)){ee=ee.substring(Re.raw.length),ae.push(Re);continue}if(Re=this.tokenizer.br(ee)){ee=ee.substring(Re.raw.length),ae.push(Re);continue}if(Re=this.tokenizer.del(ee)){ee=ee.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],de,pe),ae.push(Re);continue}if(Re=this.tokenizer.autolink(ee,Ve)){ee=ee.substring(Re.raw.length),ae.push(Re);continue}if(!de&&(Re=this.tokenizer.url(ee,Ve))){ee=ee.substring(Re.raw.length),ae.push(Re);continue}if(Re=this.tokenizer.inlineText(ee,pe,Et)){ee=ee.substring(Re.raw.length),_e=Re.raw.slice(-1),ae.push(Re);continue}if(ee){var ht="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(ht);break}else throw new Error(ht)}}return ae},W(Ce,null,[{key:"rules",get:function(){return{block:nt,inline:lt}}}]),Ce}(),ut=G.defaults,gt=Y.cleanUrl,ot=Y.escape,it=function(){function Ce(Te){this.options=Te||ut}var Ee=Ce.prototype;return Ee.code=function(ee,ae,de){var pe=(ae||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight(ee,pe);_e!=null&&_e!==ee&&(de=!0,ee=_e)}return pe?'<pre><code class="'+this.options.langPrefix+ot(pe,!0)+'">'+(de?ee:ot(ee,!0))+`</code></pre>
|
|
`:"<pre><code>"+(de?ee:ot(ee,!0))+`</code></pre>
|
|
`},Ee.blockquote=function(ee){return`<blockquote>
|
|
`+ee+`</blockquote>
|
|
`},Ee.html=function(ee){return ee},Ee.heading=function(ee,ae,de,pe){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+pe.slug(de)+'">'+ee+"</h"+ae+`>
|
|
`:"<h"+ae+">"+ee+"</h"+ae+`>
|
|
`},Ee.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Ee.list=function(ee,ae,de){var pe=ae?"ol":"ul",_e=ae&&de!==1?' start="'+de+'"':"";return"<"+pe+_e+`>
|
|
`+ee+"</"+pe+`>
|
|
`},Ee.listitem=function(ee){return"<li>"+ee+`</li>
|
|
`},Ee.checkbox=function(ee){return"<input "+(ee?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ee.paragraph=function(ee){return"<p>"+ee+`</p>
|
|
`},Ee.table=function(ee,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ee+`</thead>
|
|
`+ae+`</table>
|
|
`},Ee.tablerow=function(ee){return`<tr>
|
|
`+ee+`</tr>
|
|
`},Ee.tablecell=function(ee,ae){var de=ae.header?"th":"td",pe=ae.align?"<"+de+' align="'+ae.align+'">':"<"+de+">";return pe+ee+"</"+de+`>
|
|
`},Ee.strong=function(ee){return"<strong>"+ee+"</strong>"},Ee.em=function(ee){return"<em>"+ee+"</em>"},Ee.codespan=function(ee){return"<code>"+ee+"</code>"},Ee.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ee.del=function(ee){return"<del>"+ee+"</del>"},Ee.link=function(ee,ae,de){if(ee=gt(this.options.sanitize,this.options.baseUrl,ee),ee===null)return de;var pe='<a href="'+ot(ee)+'"';return ae&&(pe+=' title="'+ae+'"'),pe+=">"+de+"</a>",pe},Ee.image=function(ee,ae,de){if(ee=gt(this.options.sanitize,this.options.baseUrl,ee),ee===null)return de;var pe='<img src="'+ee+'" alt="'+de+'"';return ae&&(pe+=' title="'+ae+'"'),pe+=this.options.xhtml?"/>":">",pe},Ee.text=function(ee){return ee},Ce}(),rt=function(){function Ce(){}var Ee=Ce.prototype;return Ee.strong=function(ee){return ee},Ee.em=function(ee){return ee},Ee.codespan=function(ee){return ee},Ee.del=function(ee){return ee},Ee.html=function(ee){return ee},Ee.text=function(ee){return ee},Ee.link=function(ee,ae,de){return""+de},Ee.image=function(ee,ae,de){return""+de},Ee.br=function(){return""},Ce}(),Pt=function(){function Ce(){this.seen={}}var Ee=Ce.prototype;return Ee.slug=function(ee){var ae=ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var de=ae;do this.seen[de]++,ae=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},Ce}(),It=G.defaults,wt=Y.unescape,Tt=function(){function Ce(Te){this.options=Te||It,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new rt,this.slugger=new Pt}Ce.parse=function(ee,ae){var de=new Ce(ae);return de.parse(ee)};var Ee=Ce.prototype;return Ee.parse=function(ee,ae){ae===void 0&&(ae=!0);var de="",pe,_e,Re,De,Ze,dt,ht,Ft,vt,Ge,en,je,un,yt,Nt,Gt,on,Je,xt=ee.length;for(pe=0;pe<xt;pe++){Ge=ee[pe];switch(Ge.type){case"space":continue;case"hr":{de+=this.renderer.hr();continue}case"heading":{de+=this.renderer.heading(this.parseInline(Ge.tokens),Ge.depth,wt(this.parseInline(Ge.tokens,this.textRenderer)),this.slugger);continue}case"code":{de+=this.renderer.code(Ge.text,Ge.lang,Ge.escaped);continue}case"table":{for(Ft="",ht="",De=Ge.header.length,_e=0;_e<De;_e++)ht+=this.renderer.tablecell(this.parseInline(Ge.tokens.header[_e]),{header:!0,align:Ge.align[_e]});for(Ft+=this.renderer.tablerow(ht),vt="",De=Ge.cells.length,_e=0;_e<De;_e++){for(dt=Ge.tokens.cells[_e],ht="",Ze=dt.length,Re=0;Re<Ze;Re++)ht+=this.renderer.tablecell(this.parseInline(dt[Re]),{header:!1,align:Ge.align[Re]});vt+=this.renderer.tablerow(ht)}de+=this.renderer.table(Ft,vt);continue}case"blockquote":{vt=this.parse(Ge.tokens),de+=this.renderer.blockquote(vt);continue}case"list":{for(en=Ge.ordered,je=Ge.start,un=Ge.loose,De=Ge.items.length,vt="",_e=0;_e<De;_e++)Nt=Ge.items[_e],Gt=Nt.checked,on=Nt.task,yt="",Nt.task&&(Je=this.renderer.checkbox(Gt),un?Nt.tokens.length>0&&Nt.tokens[0].type==="text"?(Nt.tokens[0].text=Je+" "+Nt.tokens[0].text,Nt.tokens[0].tokens&&Nt.tokens[0].tokens.length>0&&Nt.tokens[0].tokens[0].type==="text"&&(Nt.tokens[0].tokens[0].text=Je+" "+Nt.tokens[0].tokens[0].text)):Nt.tokens.unshift({type:"text",text:Je}):yt+=Je),yt+=this.parse(Nt.tokens,un),vt+=this.renderer.listitem(yt,on,Gt);de+=this.renderer.list(vt,en,je);continue}case"html":{de+=this.renderer.html(Ge.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(Ge.tokens));continue}case"text":{for(vt=Ge.tokens?this.parseInline(Ge.tokens):Ge.text;pe+1<xt&&ee[pe+1].type==="text";)Ge=ee[++pe],vt+=`
|
|
`+(Ge.tokens?this.parseInline(Ge.tokens):Ge.text);de+=ae?this.renderer.paragraph(vt):vt;continue}default:{var Ut='Token with "'+Ge.type+'" type was not found.';if(this.options.silent){console.error(Ut);return}else throw new Error(Ut)}}}return de},Ee.parseInline=function(ee,ae){ae=ae||this.renderer;var de="",pe,_e,Re=ee.length;for(pe=0;pe<Re;pe++){_e=ee[pe];switch(_e.type){case"escape":{de+=ae.text(_e.text);break}case"html":{de+=ae.html(_e.text);break}case"link":{de+=ae.link(_e.href,_e.title,this.parseInline(_e.tokens,ae));break}case"image":{de+=ae.image(_e.href,_e.title,_e.text);break}case"strong":{de+=ae.strong(this.parseInline(_e.tokens,ae));break}case"em":{de+=ae.em(this.parseInline(_e.tokens,ae));break}case"codespan":{de+=ae.codespan(_e.text);break}case"br":{de+=ae.br();break}case"del":{de+=ae.del(this.parseInline(_e.tokens,ae));break}case"text":{de+=ae.text(_e.text);break}default:{var De='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(De);return}else throw new Error(De)}}}return de},Ce}(),Wt=Y.merge,Ct=Y.checkSanitizeDeprecation,bt=Y.escape,ze=G.getDefaults,Kt=G.changeDefaults,St=G.defaults;function Ke(Ce,Ee,Te){if(typeof Ce=="undefined"||Ce===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ce!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ce)+", string expected");if(typeof Ee=="function"&&(Te=Ee,Ee=null),Ee=Wt({},Ke.defaults,Ee||{}),Ct(Ee),Te){var ee=Ee.highlight,ae;try{ae=Qe.lex(Ce,Ee)}catch(Re){return Te(Re)}var de=function(De){var Ze;if(!De)try{Ze=Tt.parse(ae,Ee)}catch(dt){De=dt}return Ee.highlight=ee,De?Te(De):Te(null,Ze)};if(!ee||ee.length<3)return de();if(delete Ee.highlight,!ae.length)return de();var pe=0;Ke.walkTokens(ae,function(Re){Re.type==="code"&&(pe++,setTimeout(function(){ee(Re.text,Re.lang,function(De,Ze){if(De)return de(De);Ze!=null&&Ze!==Re.text&&(Re.text=Ze,Re.escaped=!0),pe--,pe===0&&de()})},0))}),pe===0&&de();return}try{var _e=Qe.lex(Ce,Ee);return Ee.walkTokens&&Ke.walkTokens(_e,Ee.walkTokens),Tt.parse(_e,Ee)}catch(Re){if(Re.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Ee.silent)return"<p>An error occurred:</p><pre>"+bt(Re.message+"",!0)+"</pre>";throw Re}}Ke.options=Ke.setOptions=function(Ce){return Wt(Ke.defaults,Ce),Kt(Ke.defaults),Ke},Ke.getDefaults=ze,Ke.defaults=St,Ke.use=function(Ce){var Ee=Wt({},Ce);if(Ce.renderer&&function(){var ee=Ke.defaults.renderer||new it,ae=function(_e){var Re=ee[_e];ee[_e]=function(){for(var De=arguments.length,Ze=new Array(De),dt=0;dt<De;dt++)Ze[dt]=arguments[dt];var ht=Ce.renderer[_e].apply(ee,Ze);return ht===!1&&(ht=Re.apply(ee,Ze)),ht}};for(var de in Ce.renderer)ae(de);Ee.renderer=ee}(),Ce.tokenizer&&function(){var ee=Ke.defaults.tokenizer||new Oe,ae=function(_e){var Re=ee[_e];ee[_e]=function(){for(var De=arguments.length,Ze=new Array(De),dt=0;dt<De;dt++)Ze[dt]=arguments[dt];var ht=Ce.tokenizer[_e].apply(ee,Ze);return ht===!1&&(ht=Re.apply(ee,Ze)),ht}};for(var de in Ce.tokenizer)ae(de);Ee.tokenizer=ee}(),Ce.walkTokens){var Te=Ke.defaults.walkTokens;Ee.walkTokens=function(ee){Ce.walkTokens(ee),Te&&Te(ee)}}Ke.setOptions(Ee)},Ke.walkTokens=function(Ce,Ee){for(var Te=D(Ce),ee;!(ee=Te()).done;){var ae=ee.value;Ee(ae);switch(ae.type){case"table":{for(var de=D(ae.tokens.header),pe;!(pe=de()).done;){var _e=pe.value;Ke.walkTokens(_e,Ee)}for(var Re=D(ae.tokens.cells),De;!(De=Re()).done;)for(var Ze=De.value,dt=D(Ze),ht;!(ht=dt()).done;){var Ft=ht.value;Ke.walkTokens(Ft,Ee)}break}case"list":{Ke.walkTokens(ae.items,Ee);break}default:ae.tokens&&Ke.walkTokens(ae.tokens,Ee)}}},Ke.Parser=Tt,Ke.parser=Tt.parse,Ke.Renderer=it,Ke.TextRenderer=rt,Ke.Lexer=Qe,Ke.lexer=Qe.lex,Ke.Tokenizer=Oe,Ke.Slugger=Pt,Ke.parse=Ke;var at=Ke;return at})},ELLl:function(ct,$e,Q){(function(se){se(Q("VrN/"))})(function(se){var W={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},k=se.Pos;se.defineOption("autoCloseBrackets",!1,function(u,f,s){s&&s!=se.Init&&(u.removeKeyMap(D),u.state.closeBrackets=null),f&&(B(X(f,"pairs")),u.state.closeBrackets=f,u.addKeyMap(D))});function X(u,f){return f=="pairs"&&typeof u=="string"?u:typeof u=="object"&&u[f]!=null?u[f]:W[f]}var D={Backspace:P,Enter:I};function B(u){for(var f=0;f<u.length;f++){var s=u.charAt(f),r="'"+s+"'";D[r]||(D[r]=G(s))}}B(W.pairs+"`");function G(u){return function(f){return m(f,u)}}function j(u){var f=u.state.closeBrackets;if(!f||f.override)return f;var s=u.getModeAt(u.getCursor());return s.closeBrackets||f}function P(u){var f=j(u);if(!f||u.getOption("disableInput"))return se.Pass;for(var s=X(f,"pairs"),r=u.listSelections(),a=0;a<r.length;a++){if(!r[a].empty())return se.Pass;var d=p(u,r[a].head);if(!d||s.indexOf(d)%2!=0)return se.Pass}for(var a=r.length-1;a>=0;a--){var L=r[a].head;u.replaceRange("",k(L.line,L.ch-1),k(L.line,L.ch+1),"+delete")}}function I(u){var f=j(u),s=f&&X(f,"explode");if(!s||u.getOption("disableInput"))return se.Pass;for(var r=u.listSelections(),a=0;a<r.length;a++){if(!r[a].empty())return se.Pass;var d=p(u,r[a].head);if(!d||s.indexOf(d)%2!=0)return se.Pass}u.operation(function(){var L=u.lineSeparator()||`
|
|
`;u.replaceSelection(L+L,null),u.execCommand("goCharLeft"),r=u.listSelections();for(var S=0;S<r.length;S++){var x=r[S].head.line;u.indentLine(x,null,!0),u.indentLine(x+1,null,!0)}})}function y(u){var f=se.cmpPos(u.anchor,u.head)>0;return{anchor:new k(u.anchor.line,u.anchor.ch+(f?-1:1)),head:new k(u.head.line,u.head.ch+(f?1:-1))}}function m(u,f){var s=j(u);if(!s||u.getOption("disableInput"))return se.Pass;var r=X(s,"pairs"),a=r.indexOf(f);if(a==-1)return se.Pass;for(var d=X(s,"closeBefore"),L=X(s,"triples"),S=r.charAt(a+1)==f,x=u.listSelections(),R=a%2==0,O,w=0;w<x.length;w++){var E=x[w],b=E.head,l,_=u.getRange(b,k(b.line,b.ch+1));if(R&&!E.empty())l="surround";else if((S||!R)&&_==f)S&&c(u,b)?l="both":L.indexOf(f)>=0&&u.getRange(b,k(b.line,b.ch+3))==f+f+f?l="skipThree":l="skip";else if(S&&b.ch>1&&L.indexOf(f)>=0&&u.getRange(k(b.line,b.ch-2),b)==f+f){if(b.ch>2&&/\bstring/.test(u.getTokenTypeAt(k(b.line,b.ch-2))))return se.Pass;l="addFour"}else if(S){var h=b.ch==0?" ":u.getRange(k(b.line,b.ch-1),b);if(!se.isWordChar(_)&&h!=f&&!se.isWordChar(h))l="both";else return se.Pass}else if(R&&(_.length===0||/\s/.test(_)||d.indexOf(_)>-1))l="both";else return se.Pass;if(!O)O=l;else if(O!=l)return se.Pass}var g=a%2?r.charAt(a-1):f,T=a%2?f:r.charAt(a+1);u.operation(function(){if(O=="skip")u.execCommand("goCharRight");else if(O=="skipThree")for(var N=0;N<3;N++)u.execCommand("goCharRight");else if(O=="surround"){for(var V=u.getSelections(),N=0;N<V.length;N++)V[N]=g+V[N]+T;u.replaceSelections(V,"around"),V=u.listSelections().slice();for(var N=0;N<V.length;N++)V[N]=y(V[N]);u.setSelections(V)}else O=="both"?(u.replaceSelection(g+T,null),u.triggerElectric(g+T),u.execCommand("goCharLeft")):O=="addFour"&&(u.replaceSelection(g+g+g+g,"before"),u.execCommand("goCharRight"))})}function p(u,f){var s=u.getRange(k(f.line,f.ch-1),k(f.line,f.ch+1));return s.length==2?s:null}function c(u,f){var s=u.getTokenAt(k(f.line,f.ch+1));return/\bstring/.test(s.type)&&s.start==f.ch&&(f.ch==0||!/\bstring/.test(u.getTokenTypeAt(f)))}})},FOrL:function(ct,$e,Q){ct.exports=Q.p+"static/nodata.a6b3f948.png"},Fhpe:function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___1W7Bl",flex_space_between:"flex_space_between___3S4Sp",flex_box_vertical_center:"flex_box_vertical_center___5mGEA",flex_box_center_end:"flex_box_center_end___1blqp",flex_box_column:"flex_box_column___4i1E0",CustomCss:"CustomCss___3thFA",CustomTipsModalCss:"CustomTipsModalCss___2aNwC",dropdownmenus:"dropdownmenus___19dGk",popupClassNames:"popupClassNames___3LOFQ",selectdown:"selectdown___1_utH"}},HmJG:function(ct,$e,Q){},JAbv:function(ct,$e){ct.exports="data:image/png;base64,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"},KOXS:function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___4BHX-",flex_space_between:"flex_space_between___fH2oM",flex_box_vertical_center:"flex_box_vertical_center___TgSS9",flex_box_center_end:"flex_box_center_end___1vKaD",flex_box_column:"flex_box_column___1kCgI",input:"input___2mV-b",dropdown:"dropdown___1QKW2",menu:"menu___37CBn",text:"text___159fF",b1:"b1___2uGyF",b2:"b2___2DXw1"}},LdHM:function(ct,$e,Q){"use strict";Q.d($e,"b",function(){return d}),Q.d($e,"a",function(){return S});var se=Q("1OyB"),W=Q("vuIU"),k=Q("Ji7U"),X=Q("LK+K"),D=Q("q1tI"),B=Q("rePB"),G=Q("Ff2n"),j=Q("ODXe"),P=Q("4IlW"),I=Q("bX4T"),y=Q("YrtM"),m=Q("TSYQ"),p=Q.n(m),c=Q("+nKL"),u=Q("8OUc"),f=function(J,ne){var oe=J.prefixCls,fe=J.id,ke=J.flattenOptions,Oe=J.childrenAsData,Me=J.values,Be=J.searchValue,Pe=J.multiple,be=J.defaultActiveFirstOption,le=J.height,Le=J.itemHeight,tt=J.notFoundContent,nt=J.open,lt=J.menuItemSelectedIcon,Et=J.virtual,Ve=J.onSelect,Qe=J.onToggleOpen,ut=J.onActiveValue,gt=J.onScroll,ot=J.onMouseEnter,it="".concat(oe,"-item"),rt=Object(y.a)(function(){return ke},[nt,ke],function(at,Ce){return Ce[0]&&at[1]!==Ce[1]}),Pt=D.useRef(null),It=function(Ce){Ce.preventDefault()},wt=function(Ce){Pt.current&&Pt.current.scrollTo({index:Ce})},Tt=function(Ce){for(var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Te=rt.length,ee=0;ee<Te;ee+=1){var ae=(Ce+ee*Ee+Te)%Te,de=rt[ae],pe=de.group,_e=de.data;if(!pe&&!_e.disabled)return ae}return-1},Wt=D.useState(function(){return Tt(0)}),Ct=Object(j.a)(Wt,2),bt=Ct[0],ze=Ct[1],Kt=function(Ce){ze(Ce);var Ee=rt[Ce];if(!Ee){ut(null,-1);return}ut(Ee.data.value,Ce)};D.useEffect(function(){Kt(be!==!1?Tt(0):-1)},[rt.length,Be]),D.useEffect(function(){var at=setTimeout(function(){if(!Pe&&nt&&Me.size===1){var Ce=Array.from(Me)[0],Ee=rt.findIndex(function(Te){var ee=Te.data;return ee.value===Ce});Kt(Ee),wt(Ee)}});return function(){return clearTimeout(at)}},[nt]);var St=function(Ce){Ce!==void 0&&Ve(Ce,{selected:!Me.has(Ce)}),Pe||Qe(!1)};if(D.useImperativeHandle(ne,function(){return{onKeyDown:function(Ce){var Ee=Ce.which;switch(Ee){case P.a.UP:case P.a.DOWN:{var Te=0;if(Ee===P.a.UP?Te=-1:Ee===P.a.DOWN&&(Te=1),Te!==0){var ee=Tt(bt+Te,Te);wt(ee),Kt(ee)}break}case P.a.ENTER:{var ae=rt[bt];ae&&!ae.data.disabled?St(ae.data.value):St(void 0),nt&&Ce.preventDefault();break}case P.a.ESC:Qe(!1)}},onKeyUp:function(){},scrollTo:function(Ce){wt(Ce)}}}),rt.length===0)return D.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),className:"".concat(it,"-empty"),onMouseDown:It},tt);function Ke(at){var Ce=rt[at];if(!Ce)return null;var Ee=Ce.data||{},Te=Ee.value,ee=Ee.label,ae=Ee.children,de=Object(I.a)(Ee,!0),pe=Oe?ae:ee;return Ce?D.createElement("div",Object.assign({"aria-label":typeof pe=="string"?pe:null},de,{key:at,role:"option",id:"".concat(fe,"_list_").concat(at),"aria-selected":Me.has(Te)}),Te):null}return D.createElement(D.Fragment,null,D.createElement("div",{role:"listbox",id:"".concat(fe,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ke(bt-1),Ke(bt),Ke(bt+1)),D.createElement(c.a,{itemKey:"key",ref:Pt,data:rt,height:le,itemHeight:Le,fullHeight:!1,onMouseDown:It,onScroll:gt,virtual:Et,onMouseEnter:ot},function(at,Ce){var Ee,Te=at.group,ee=at.groupOption,ae=at.data,de=ae.label,pe=ae.key;if(Te)return D.createElement("div",{className:p()(it,"".concat(it,"-group"))},de!==void 0?de:pe);var _e=ae.disabled,Re=ae.value,De=ae.title,Ze=ae.children,dt=ae.style,ht=ae.className,Ft=Object(G.a)(ae,["disabled","value","title","children","style","className"]),vt=Me.has(Re),Ge="".concat(it,"-option"),en=p()(it,Ge,ht,(Ee={},Object(B.a)(Ee,"".concat(Ge,"-grouped"),ee),Object(B.a)(Ee,"".concat(Ge,"-active"),bt===Ce&&!_e),Object(B.a)(Ee,"".concat(Ge,"-disabled"),_e),Object(B.a)(Ee,"".concat(Ge,"-selected"),vt),Ee)),je=Oe?Ze:de,un=!lt||typeof lt=="function"||vt;return D.createElement("div",Object.assign({},Ft,{"aria-selected":vt,className:en,title:De,onMouseMove:function(){if(bt===Ce||_e)return;Kt(Ce)},onClick:function(){_e||St(Re)},style:dt}),D.createElement("div",{className:"".concat(Ge,"-content")},je||Re),D.isValidElement(lt)||vt,un&&D.createElement(u.a,{className:"".concat(it,"-option-state"),customizeIcon:lt,customizeIconProps:{isSelected:vt}},vt?"\u2713":null))}))},s=D.forwardRef(f);s.displayName="OptionList";var r=s,a=function(){return null};a.isSelectOption=!0;var d=a,L=function(){return null};L.isSelectOptGroup=!0;var S=L,x=Q("VTBJ"),R=Q("Zm9Q");function O(A){var J=A.key,ne=A.props,oe=ne.children,fe=ne.value,ke=Object(G.a)(ne,["children","value"]);return Object(x.a)({key:J,value:fe!==void 0?fe:J,children:oe},ke)}function w(A){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(A).map(function(ne,oe){if(!D.isValidElement(ne)||!ne.type)return null;var fe=ne.type.isSelectOptGroup,ke=ne.key,Oe=ne.props,Me=Oe.children,Be=Object(G.a)(Oe,["children"]);return J||!fe?O(ne):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(ke===null?oe:ke,"__"),label:ke},Be),{},{options:w(Me)})}).filter(function(ne){return ne})}var E=Q("2Qr1"),b=Q("qNPg"),l=Q("U8pU"),_=Q("Kwbf"),h=Q("WKfj");function g(A){var J=A.mode,ne=A.options,oe=A.children,fe=A.backfill,ke=A.allowClear,Oe=A.placeholder,Me=A.getInputElement,Be=A.showSearch,Pe=A.onSearch,be=A.defaultOpen,le=A.autoFocus,Le=A.labelInValue,tt=A.value,nt=A.inputValue,lt=A.optionLabelProp,Et=J==="multiple"||J==="tags",Ve=Be!==void 0?Be:Et||J==="combobox",Qe=ne||w(oe);if(Object(_.a)(J!=="tags"||Qe.every(function(it){return!it.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),J==="tags"||J==="combobox"){var ut=Qe.some(function(it){return it.options?it.options.some(function(rt){return typeof("value"in rt?rt.value:rt.key)=="number"}):typeof("value"in it?it.value:it.key)=="number"});Object(_.a)(!ut,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)(J!=="combobox"||!lt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)(J==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(_.a)(J==="combobox"||!Me,"`getInputElement` only work with `combobox` mode."),Object(_.b)(J!=="combobox"||!Me||!ke||!Oe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Pe&&!Ve&&J!=="combobox"&&J!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!be||le,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),tt!=null){var gt=Object(h.d)(tt);Object(_.a)(!Le||gt.every(function(it){return Object(l.a)(it)==="object"&&("key"in it||"value"in it)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!Et||Array.isArray(tt),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var ot=null;Object(R.a)(oe).some(function(it){if(!D.isValidElement(it)||!it.type)return!1;var rt=it.type;if(rt.isSelectOption)return!1;if(rt.isSelectOptGroup){var Pt=Object(R.a)(it.props.children).every(function(It){return!D.isValidElement(It)||!it.type||It.type.isSelectOption?!0:(ot=It.type,!1)});return!Pt}return ot=rt,!0}),ot&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ot.displayName||ot.name||ot,"`.")),Object(_.a)(nt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var T=g,N=Object(b.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:w,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:T,fillOptionsWithMissingValue:E.a}),V=function(A){Object(k.a)(ne,A);var J=Object(X.a)(ne);function ne(){var oe;return Object(se.a)(this,ne),oe=J.apply(this,arguments),oe.selectRef=D.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(W.a)(ne,[{key:"render",value:function(){return D.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),ne}(D.Component);V.Option=d,V.OptGroup=S;var Y=V,U=$e.c=Y},LicW:function(ct,$e,Q){"use strict";var se=Q("T2oS"),W=Q("W9HT"),k=Q("5Dmo"),X=Q("3S7+"),D=Q("q1tI"),B=Q.n(D),G=Q("ZJlW"),j=Q.n(G),P=Q("m3rI"),I=Q("TSYQ"),y=Q.n(I),m=Q("1vsH"),p=Q("z4EP"),c=Q.n(p),u=Q("+GGh"),f=Q.n(u),s=Q("cFMs"),r=Q.n(s),a=Q("BdwD"),d=function(S){var x=S.className,R=S.dataSource,O=R===void 0?[]:R,w=S.col,E=w===void 0?4:w,b=S.right,l=S.bottom,_=l===void 0?23:l,h=S.precision,g=h===void 0?0:h,T=S.wrapWidth,N=T===void 0?1200:T,V=S.trackEventItems,Y=S.loading;debugger;var U=Math.floor((N-(E-1)*b)/E);return B.a.createElement(W.a,{spinning:Y},B.a.createElement("div",{className:y()(j.a.list,x)},!!O.length&&O.map(function(A,J){var ne=A.name,oe=A.id,fe=A.identifier,ke=A.featured,Oe=A.school_name,Me=A.image_url,Be=A.excellent;return B.a.createElement("div",{key:oe,className:j.a.wrap,style:{width:U,marginRight:(1+J)%E===0?0:b+g,marginBottom:_}},B.a.createElement("a",{target:"_blank",href:"/paths/".concat(fe),className:j.a.li,onClick:function(be){be.preventDefault(),V&&Object(m.cb)([V]),Object(m.S)("/paths/".concat(fe))}},B.a.createElement("div",{className:j.a.img},B.a.createElement("img",{className:j.a.cover,src:"".concat(P.a.IMG_SERVER,"/").concat(Me)}),ke===1&&B.a.createElement("img",{className:j.a.sign,src:c.a}),ke===2&&B.a.createElement("img",{className:j.a.sign,src:""}),ke===3&&B.a.createElement("img",{className:j.a.sign,src:f.a}),ke===4&&B.a.createElement("img",{className:j.a.sign,src:""}),ke===5&&B.a.createElement("img",{className:j.a.sign,src:r.a})),B.a.createElement("div",{className:j.a.name},B.a.createElement(X.a,{title:ne},B.a.createElement("span",{className:j.a.e},ne))),B.a.createElement(X.a,{title:"\u53D1\u5E03\u5355\u4F4D\uFF1A".concat(Oe)},B.a.createElement("div",{className:j.a.unit},B.a.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),Oe)),B.a.createElement("div",{className:j.a.tags},B.a.createElement(X.a,{placement:"bottom",title:"\u7AE0\u8282\u6570"},B.a.createElement("span",null,B.a.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),B.a.createElement("span",null,A.stages_count))),B.a.createElement(X.a,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},B.a.createElement("span",null,B.a.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),B.a.createElement("span",null,A.members_count))),Be&&B.a.createElement("div",{className:j.a.tag},"\u5F00\u653E\u8BFE\u7A0B"))))}),!O.length&&B.a.createElement(a.a,null)))};$e.a=d},M8RZ:function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return P});var se=Q("fWQN"),W=Q("mtLc"),k=Q("yKVA"),X=Q("879j"),D=Q("q1tI"),B=Q.n(D),G=Q("i8i4"),j=Q.n(G),P=function(I){Object(k.a)(m,I);var y=Object(X.a)(m);function m(p){var c;Object(se.a)(this,m),c=y.call(this,p);var u=window.document;return c.node=u.createElement("div"),u.body.appendChild(c.node),c}return Object(W.a)(m,[{key:"render",value:function(){var c=this.props.children;return Object(G.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(B.a.Component)},MEgm:function(ct,$e){ct.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAA8CAYAAADGxTD9AAAAAXNSR0IArs4c6QAAFoFJREFUeF7tXQl4k1W6fv8sTbqvlJa2tJSy74ugsiMqq4AKIlDUueNwR2dGHR0XdLwixW3uuF6Xq3O9o15nxuUiIIsCsijK1pa20NJ937eke5tmmec7f/40TfInaUNK6+R7nj5Jk7Of93z/t55w8JBnBYbwCnBDeOyeoXtWAB4Ae0AwpFeA+1SWbbA1A07KQSID6JWT0ivAyThIpBwgBSQy4+fCq0T4jANnrEdlWFkpjK/0ndAetd/znpMaTO0LZcz74tsxti0xjqVXfeNYZcZyxvHSuK3GbDYX03iMbbLy5nOz+pzGbGDrwpfj52DQG2DQAwad8Gcwvudf9ToDQN/pDdBrDYBFWfqMry/UAytP9fjPjJ/rYVHf2L7Qph4GaA0tOj1UnBYqvd6gMugMKr0OKoOOq+UMhhQ5DGfHPRNWMaSRaxy8bQBzPGAZAI3AFMAoAIJtnBnA2WaagdlU39iOAKKeje85FKY2TYDkwWh+APi2ebD0AJ8HMn/AzAHFA4x9Jxwss7bN5yXUpbnwB4SvY3Nu9LmwLr36NIKWAEhA1BlMgOUBCAZYBtJe761Byx+A3vV54Av1efDrtUawm4G+N+D5MfUcHH5s7H890KnqNjRWNGkaqlXqhgp1VV1JwxkOSJUAqUB0xk4s0Q4FgIty4KEweM8Yba+ARCmBzBuQeksgVXKQKugVkAdIoRwhhU+EHJycg0GrNz01Whs6UJhegtLsCmi7tI0GYC8H7osYTPhuO2Z3D9a19gB4sO6Mm8flFSKBd4QcyuFS+MbKIfOWMM6v69KjIq8WhVlFaKpvAQeuFsCr/gh45wmsbXHzsPrcvAfAfV6yn18FjgN8YmUInKiAd4TMJObUlNQj42wWutq7SNtXA9zrIVC88nts7Bgsq+AB8GDZiUEyDrm/BAFj5PBLUAASniNnpeSgvLCSjZADl8dBev8ubD41GIbsAfBg2IVBOAaSnUNnK6GM5DlyQ5UKmSlZ6GjvJBiT5epdGRSP7MRGzbUcvgfA13L1h0DfPtFyBE9VMKuMVqNH2rl0NNapBG78vQ98b9+B2xuu1VQ8AL5WKz+E+pV6cQiaqoAyXAp9tx5pyZfQUNdoBDEKAG5VEhJzrsWUPAC+Fqs+RPsMnOgF3xg5dBod0i9eRmM9D2IAFYB03m5sKRnoqXkAPNArPsT7CxingE+UFDqdHpfSMtHYYJIecn2hnL8DG+sGcooeAA/kav9M+gpIkEMZJYdBq0PqxXS0NDcLMvEFKRTzB1Kx8wD4ZwKqgZ6G/2g5vCPlaGttR+rFZMaRiSSQvLILW58YqPF4ADxQK/1z64cDs05IlByqqiqRX5gvKHV6gLspCYknB2LKHgAPxCr/TPuQ+XAImOQFzsDh0pVLUDcJ5jWUSaGcuBMbW9099WsOYDKYU8Qbi5zqshnZ6e41uGrtSxScU3NQhErR1UBhae4hstkaBiiWzDtSykSJri4NLmYmQ6s1dfz6bmx7xD0z7Gn1mgN4bX48CyapP9eBI/NLXZ5v3JYAzHlnOGvnyMJSqNO7TG36xMjYe41KB22r+GGR+nC48aNIVrb4780o2+OYkYTOVWLRnijk/JcKee+qoVHzMqE5zXlvOGLW+0MRIsXBGUVouuweJ9bys7HwjpJBldaJk2vcH/brP9aLRb1V11aisLzAKEpwWimks3Zic4bLm2qngUED4K5GHWpOttuda+U3bSj83ya7ZeLvCcD1f+HBd3hOMVQXeQDL/DhsVI1l71MerUXOm/zjzhYRV1lfmsC+Sn28FtmviZcV6t/wUSRGbQ5g/575RRWKPuE1c3Ma8+sgXPcmf7gynqvH5d3OO7DkARIowigzwDEtPxcLryApmrK7cGqtYwB31evQ3Wx94Bz3xJcgOThwrBd0Wj1Ssi6gW8sfTA44swuJ8zje9ewWGjQAdmZ2OW+rkPIwRfeJ09UAsH+CHGuuxLNOzj9Yjfz37R8axTAp1hWPBnmsOuu02BtXCL3Ges8IhOvLRkPmI0FjSie+ud55u//YB4Iw+w0e/Febkh+qQe47apea9Y2VQeYrQXlNGcpqeubFQfKrJGz9wKXG7VQeNADuqNKi6FNrrmU+9rqfOlDxtf3HudMAfkuFmPV+iN0QgMyXG6BK6xE1gqYpsDI5jnX9071VKHYwrklPhWDa88NY+csvNiDj2XrRJZ/7fgRG3xfIvv8qrgAdFc4Jq4MdwHQoCcQkA6fmXIBOz8v4HNAog2zcc9gsviguoNutAKZHsdRHYnd4y76LgU+UHKr0TvxwFx+y54iIu7WX9Ww8SwGS8/mp8YkBmPNuBHv/7fwSHph6A0jBshQhVqbGIWiKAgUfqnFue42p22HzvHHzyZHs/+83VKB8r/ihoRQjkuMp6IVShvYlFGLyjlCEzVXanIZXiJS5Y4laizSij+78/2lisrRA8kAJCz53RKO2BLL+ic5tr0btaftiGZXrrNGhu6n/IoQwJt+RMrbOJTVFqG4030vJX3dj632Oxt6f790K4CWHohF5s29/xmW3DoH98Oyex9TY3wRh9mvij1f15S4cWVBiBWCBW2vb9fhqZIFpEyNv9sGSQzFsDCdWlqHqqDgIiIsv+DyKlS39/xac3lSJpd9EI+Im1+Z9+YUGZPyHbaYVMlOB0DneNtdo5J3+GL7Ih31HcraYtYPmXPSx/SdeXzeORAifETJ0dnYivTgFBoMgRpEMLF24G5tP97VNR+WHJIBL97TgtBm37i+AJV4c1hbEsywEc8XOHJRHl5Si7rTtBASZLwfi4n7xXmydT60rR8XBNkx/IQwhM3s4cMgsJVOqCDT1Z5xLZij6W7MowMxFFkcbLPZ9R7UWX8XwFoOrSd4jOUilMuRWZkHdZq78cpdliJ5xtZNFBwTAxAW+u7nMap1uOhbDTEo1p9qR8oh95Ywe9YJp68fESpT8oyc9K+x6JUas8GPtB09TIGoV/55Eg45qHTprtSj8qMmmFWLKs6GY8scwNOdqcGBSEas3KjEAN3xotGRcV9xLPjafBJnFEv4tyPTRsZtKUfu9NUBJTApf6NOrD1dAYw7gikOt0Hc7r+SHTFcys6W7AOwVLIFXoBQ16iqU1BdaTvOJ3dj2iitzt6w7IADuqNHiq2jr0357xWgow2UoP9CK8/9eDZ8YOXxjZPAZaXyNkcN7uBRHF5dh7gcRGH1vIHQaA/ZE5ovKjk4rcUYzmt9oOW7L5i0Ox28tQ/Xxdkz+YyimPhvGPvsyPA8albV8GLXaF4u+iu61nqIAPhGD8Pk+aM7R4MBk/pC4QuYA3juqAJo+yK/XvRUOkpPdBWB6qpHuo9F0I73sgsU0uTYZFOShc93gb2x5wAD89YQiDLteyUBKDgVSZGI3+bOUb0e0L6EAEx8PRfQaP6gyOnFytbhts68Apr5vOT0SYXO9Uba3BT9sqMSNn0QiblMAOuu12BNpffDIbLYqLY4dPnMSA/CKlFgET1UyRdVcdnc0b7HvB7MIQWP2jiJlk8OVqgy0a6wU4H27sW1df+d+zTjwiRXlTF60R6TFd1Rq0VbSjbYyLdpLu9FW2s2UoxG3+qK1RIumzC67GnN/AEwmqmlJw5D3ngppO+pBjgCSYet+bGfc35IW7olih4mIQK4M44EsBuC1hfHswDYkd+LECuv2zNunC0wcORXMAaxR060nzsNB6ith9mp3cWAaiVewFBQnUaEqRVVzudXgOEjWJGHrAedHLV5ywDjw/rGFWF86Gu2lWrSV8cCM3xbIjPoElB+3VjHw0gbaIsHlXPyPZvyUWCU6I0sAtxV3Y/QvApH332pRTxx56TgJZwLOBtUYyP0kKPhrE87dX92rL6k3hzvrEtiTgwBZ+HGTybsmBuCN6jHMyO8M0eElU5w9MgfwF2F5fTKBCXZodwKY3MoE4rauVmTX2vQkF4dCOfFqpOcPGIBtycArLsQieLoS3a16ZL/WaFOWkyo4hN3gjejVPMdLe7oOWa+YUlms9tkcwAR2Uuh0HXrsH1folCuZYgjWF4/m+9pRh6w/Wfe1+EAUgiYp8M0NJezJILiubQGYAmvu7hjnDHZZmeY8DQ5MtC8nmwOY5Gq6b81Z8o6UMYuIOwFM3gvv4TLGjDJqkqHVWcd8SICXdmHbU86OW6zcNQWwI/OX5aAJ6IdnFqO1yPZNR8RJJz8dhomPhfSqShz/4NQipwAcscwHSw/zNuDv76hA+X5rJwYFDJFtmQKFzA+MLQCbx1VUHmlD9bE2m3sx/qFg5tBRZ3bh0PRipzlwfwHgVgADkAdL2F1zZc1FqG/v/RQzjrmbg9e0JGy60t85UD23AniZUfsmj9P+sdZchTRWAgxxMb943jtli7Tt5HnrRsnnLWg4T/cS9KaEXwZi5EZ/pulLjB45KkHyYe7bauS8pWIXdDgTzDPrtXCM+00w62BPTD46q+2HPToCcNQqXyzay1srLM1/5rNYkRyL4GlKNKZ24pu59mMkzDnwoZnF0DQ5H5o546VhzH3ubgBLlRLI/Tk0dzQjX51pc185cCeTkLhk0AL4ttxR8BvlxdyZx5bwygu5Q8l1KRDJpxTk0pKnYU4Aoti7/EEu1/Zyba/YB3Kn2nJ5Lvh8BAtTtKRvbyxBwwUe8M5Go60rjudd2xmdODzLcbCNIwBPfT4Mk5/iXbv2QihXpsUxsaTuTAeOLrRvZTIHcOmXLcy06CyRJYgcL+4GMF1XJQ+RsvvWLjcmQ0fXadogCbh7diHxY2fHb1nOrRz4rtYxTNkp+byZhQ7OejUc4Yt9cHBKEVryeDFAUM7MvWurMuIQOEGB6hNtOH4Lr8WS6eq23HhUHm5F+tP1vcSIcb8NwqQdoaDNNHQD437Lc1BnwinZ3b7G8xS+0BvLvuNjILLfaETqY44TbB0BeOmRaEQs8WXOhs8CckUDzVdfHoWAcV6oOtYGstjYo8FuRhPGToyJ4lRKW4rQ2NUTa2I+N7o8UAq/cTuxvl/hcG4DMGUd3FHNx9ReebWRKV7ktiVtPPcdFZIf4j1vzgJ4WlIYJj0RCl0nKWRFzGIhELl0dZ383bt9MaORy3j6i8NwfHk5yFohgI3abS3U4OCMYuja7XM3ewCmw3Fn3RjQfWP15ztwZJ44Z70tLx5+cXKTLdpZAP90TxW0rc4H4ox9MAgRS33dzoFp/BTYQ0p4i6YZha1Z9qb03m5s+3V/uLDbAEw3uaxM4e2+KY/VIucNFWb+aRjGPxzCrA57YwuY2coZAFMg9205o9j9tln/2Yi0p8Q5oxiAzZUpciuTB45kZqLkR2qgvtSFZcd47isQZVc4cnHbA/DIDf6Y/7cRrDlH1hMyMZKFoOj/mnDmvt5KD3FmWk+BYtb5IXYjHzx/9pdVIB3BWRqzPYgF+5B+cP6BHq6ozuhinsKrSSRGyPwl7B7izJZU6ETynDhAL4X0hp3Ycr6v/bsNwObKy+m7K9njnUxUxIVJO039Qy2yX1c5BeDrP4xAfGIgU1b2jym06doVJi4GYOK0ltYJqlN9vA2Xkhow+9VwZtKjCKqa4+0smozeH1taJhrMQ/XtAfjmUyMx7EY+auzriYUmscnWJt1Zn8BiCLLfVCH10d5xIRMeDcaMl8L7urd9Kn/xyVpc+bPjzJM+NUpc2FsCCQeUdRRA1S3OeDjg4lQor9uIjc5rpO60Qlz39nCM+RUf6GKuTC3aH4WoFX4sFpZEgbV5fE6cmAx8OanBJJemP1uHzBfFbcCWgBJkYP8xcqzJ4uMdiAiYFBif+VIjU/JINhfk5rz31YzDr8kZxTxsZJc9NKNYNFlTDMAhsxRYfpZ/AjnjQt7UOZYd7LRn6pD1cu85DmUAc3L6SQgJ2rXNKOiwK0ZQbu9Du7Dtzb4cErdwYDLe316eAJKDyQa7L77HsxS9zg8Lv4hC7Q/tOL25EreejrULYJKdKZWGLBDkzeuLTGquxJFiSMmHJZ+1IOvlBjRl8Y9LYTz0XrAXU8KneQaEvYMjBmDzWGjhCSS2MaSg3lHJ6wskEhR+ZB2nS8qQJUUs8wVF01Ecx8Wn6pD9qu3DPeU53hJCQVXkkcx/X42uut6MTswD2hcwiZUlzxz9NkduZxq6DeJiCgeu2RsY/zTsuFotOnELgEes9MXifbzt0zLFhsBNFgaSOYmckYFJGfIf44XmbMcy2vTdYSzwh+jgtCITUClIvTmvmylrAo1Y7osFX45glhLiyidXlZuC16nPVem8ZYBk9q8nFNq0CdsCsLmVwBnuO/EPIZj+Ap+SRFkkDeesbd3CmAkMI1b4ghwfw+bxMjwRJcSeWF1u/aTggDlvDwc5X8htT0Q28eK/tzD7OMm+7ibBNl+tKUO9zn7WDQd8loRtm5wdk1sALERz0SBI9qOYh/GP8KYtSxKi0djPTxnjWsnBwXEcA5Wt5Ehq48y91UyuJgpf5I15n4xgSiEBjoiSK/dEFYgGukTe4ouFe3rAe+GBGuT/pXfyprkcbysugvqxBDB9tvRIDBMHaPxkEqv+js/oGLbAGzNfCYeuXQ9dFz9fUlDDjNkVFAdB4ZZkUbEkGi/FKUet9mNxGgK1FGhw8ck6u2lPVJZMWgRicvpQZJwJ+KfaWYZ2OeUaOq8LOosvVo7iTCgxuVuvQW53msO6UnC3PI/Eow4LuksGnvnncIz/XTDqz3bgyIJSZqqypUA5M0CxMj9urWTiABFpuhvqE/iFMpKjDGaSUZedGMnuM7jwYA3yP7CdeXzT0RgMX+xjU7myBWAy7y0+EA3/0V649Hw9Lu3qSZ2nQKA7ahLYD6pYEkXiHVtSivqztrmv5RqSKzv/AzX70/fxN4ToYFL0XdBk3rJBThvy/rnzMhT62TNyahTpMtFhsO1OF9aEfsYgHKFTfoeVDh8PbuHANJCJj4ewC0QIGOQgEMvh6i+IKw609hIpxv8+mAWp0O0+ZftanLo0hOKRyUYrBl4aG5mvKOWo6ojtRY+72x+z3+Lz8egOhrofOxhXpUd8+h+tc9oS7g9EAF0EYvwJLNJc6n/qQOW3bb0SVS3XhTyYK5LjUL6vlUXJNSaLixlOrSnHZ55MeSaU5fE1pjrEilPNOiqkMtSiSmc/1oNxbXDPJSFxp6P23AZgRx17vu/HCtAD5mo/5t3Rpp2p6aFHji4VBgdaIwd0SsFN2YlE/tZAEfIAuB848lRxbQUq9Plo0ts3hxp7+HY3ti33ANi19fbUvsor0GFoRZHOvk1Y6FIC7q5dSPzcw4Gv8iZ4mnNtBQp0l9BlcHzFAAeu0h8B48V+JdQjQri2D57a/VyBBkMNanSOw1WNCt0bSUh82FZXHgD3cwM81VxbAT10yNWlQm+6vceupKuTQTJ7J7ZYGZE9AHZtHzy1XViBSn0B1Hpnr5jlziZh642WV7V6AOzCBniqurYCnWhDodZ2upGtliXA9l3Y9r75dx4Au7YHntourkChLhOdDjxzPV1wKl8oxpn/Fp0HwC5ugKe6ayvQbGhAuc75SwY5cB8lIfFeoVcPgF1bf09tl1fAgDxdut0wS+supIt2Y8v3zELxqSz7ajsnXZ6Sp4F/rRVoMFShRmf/yq3eK8JljcSE6dsxu9sD4H8trAzK2eqgQ54uDXohPdyJUXLgnkxC4sseADuxWJ4i7l+Ban0JGvW2U+9t9c4B7QZIJ3oA7P698fTgxAo0GepRobN/qaFlMxy4/f8E90wA8RE2tUgAAAAASUVORK5CYII="},NQs2:function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___3K14R",flex_space_between:"flex_space_between___1KE7t",flex_box_vertical_center:"flex_box_vertical_center___3Yslx",flex_box_center_end:"flex_box_center_end___2RmV-",flex_box_column:"flex_box_column___3k3IQ",banner:"banner___3caau",content:"content___fxe_p",btns:"btns___Vv-WB"}},NcEG:function(ct,$e,Q){"use strict";Q.r($e);var se=Q("+L6B"),W=Q("2/Rp"),k=Q("5NDa"),X=Q("5rEg"),D=Q("Znn+"),B=Q("ZTPi"),G=Q("2qtc"),j=Q("kLXV"),P=Q("14J3"),I=Q("BMrR"),y=Q("jCWc"),m=Q("kPKH"),p=Q("sPJy"),c=Q("bE4q"),u=Q("/zsF"),f=Q("PArb"),s=Q("miYZ"),r=Q("tsqr"),a=Q("9og8"),d=Q("k1fw"),L=Q("oBTY"),S=Q("y8nQ"),x=Q("Vl3Y"),R=Q("tJVT"),O=Q("PpiC"),w=Q("B9cy"),E=Q("Ol7k"),b=Q("lUTK"),l=Q("BvKs"),_=Q("WmNS"),h=Q.n(_),g=Q("q1tI"),T=Q.n(g),N=Q("Ty5D"),V=Q("55Ip"),Y=Q("9kvl"),U=Q("tgas"),A=Q("jb+D"),J=Q("BdwD"),ne=Q("giR+"),oe=Q("fyUT"),fe=Q("sRBo"),ke=Q("kaz8"),Oe=Q("5Dmo"),Me=Q("3S7+"),Be=Q("V0Rq"),Pe=Q("Ot1p"),be=Q("9Bee"),le=Q("xvzu"),Le=Q.n(le),tt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],nt=function(De,Ze){var dt=De.problemset,ht=De.globalSetting,Ft=De.loading,vt=De.dispatch,Ge=De.onRef,en=Ge===void 0?function(){}:Ge,je=De.editData,un=Object(O.a)(De,["problemset","globalSetting","loading","dispatch","onRef","editData"]),yt=Object(g.useState)([]),Nt=Object(R.a)(yt,2),Gt=Nt[0],on=Nt[1],Je=Object(g.useState)(),xt=Object(R.a)(Je,2),Ut=xt[0],zt=xt[1],hn=Object(g.useState)([]),Ln=Object(R.a)(hn,2),gn=Ln[0],Jt=Ln[1],Rt=Object(g.useState)(""),Vn=Object(R.a)(Rt,2),kn=Vn[0],Cn=Vn[1],Qt=Object(g.useState)(5),Gn=Object(R.a)(Qt,2),ei=Gn[0],Xn=Gn[1],et=Object(g.useState)(!1),jt=Object(R.a)(et,2),Wn=jt[0],mn=jt[1],sn=Object(N.i)();Object(g.useEffect)(function(){on(["","","",""])},[]),Object(g.useEffect)(function(){if(!(je!=null&&je.question_choices)){mn(!0);return}Cn(je==null?void 0:je.question_title),Xn(parseInt(je==null?void 0:je.question_score)),on(je==null?void 0:je.question_choices.map(function(H){return H.choice_text}));var q=[];je==null||je.standard_answer.map(function(H,ue){q.push(H-1)}),Jt(q)},[je]),Object(g.useImperativeHandle)(Ze,function(){return{onSave:Dn,isEdit:Wn}});var Dn=function(){var q=Object(a.a)(h.a.mark(function H(){var ue,He,Xe;return h.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:if(kn){We.next=3;break}return r.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),We.abrupt("return",!1);case 3:if(ue=Gt.findIndex(function(mt){return!mt}),!(ue>-1)){We.next=7;break}return r.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(tt[ue]," \u9009\u9879\u7684\u5185\u5BB9")),We.abrupt("return",!1);case 7:if(gn.length){We.next=10;break}return r.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),We.abrupt("return",!1);case 10:if(!(gn.length<1)){We.next=13;break}return r.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),We.abrupt("return",!1);case 13:if(He=Gt.map(function(mt,Zt){return{choice_text:mt,is_answer:gn.includes(Zt)?Zt+1:0}}),!je.question_id){We.next=20;break}return We.next=17,vt({type:"exercise/editExerciseQuestion",payload:{id:je.question_id,question_title:kn,question_type:1,question_score:"5.0",question_choices:He.map(function(mt){return mt.choice_text}),standard_answers:He.filter(function(mt){return mt.is_answer}).map(function(mt){return mt.is_answer})}});case 17:Xe=We.sent,We.next=23;break;case 20:return We.next=22,vt({type:"exercise/addExerciseQuestion",payload:{categoryId:sn.categoryId,question_title:kn,question_type:1,question_score:"5.0",question_choices:He.map(function(mt){return mt.choice_text}),standard_answers:He.filter(function(mt){return mt.is_answer}).map(function(mt){return mt.is_answer})}});case 22:Xe=We.sent;case 23:Xe.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),mn(!1),vt({type:"exercise/editExercise",payload:Object(d.a)({},sn)}));case 24:case"end":return We.stop()}},H)}));return function(){return q.apply(this,arguments)}}(),K=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],v=function(){var q=Object(a.a)(h.a.mark(function H(ue){return h.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:Xe.t0=ue.id,Xe.next=Xe.t0==="del"?3:Xe.t0==="up"||Xe.t0==="down"?5:Xe.t0==="edit"?9:11;break;case 3:return j.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function We(){return h.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(Be.n)({id:je.question_id});case 2:vt({type:"exercise/editExercise",payload:Object(d.a)({},sn)});case 3:case"end":return Zt.stop()}},We)}))()}}),Xe.abrupt("break",11);case 5:return Xe.next=7,vt({type:"exercise/exeriseMoveUpDown",payload:{id:je.question_id,opr:ue.id}});case 7:return vt({type:"exercise/editExercise",payload:Object(d.a)({},sn)}),Xe.abrupt("break",11);case 9:return mn(!0),Xe.abrupt("break",11);case 11:case"end":return Xe.stop()}},H)}));return function(ue){return q.apply(this,arguments)}}(),C=function(){var H;return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},je.key,"\u3001\u591A\u9009\u9898"),"\uFF08",je.question_score,"\u5206\uFF09"),!je.hideAction&&K.map(function(ue,He){return ue.id==="up"&&je.key===1||ue.id==="down"&&je.key===je.len?null:T.a.createElement(Me.a,{key:He,placement:"bottom",title:ue.name},T.a.createElement("span",{onClick:function(){return v(ue)},className:ue.icon}))})),T.a.createElement("div",{className:"mt5"},T.a.createElement(be.a,{value:je.question_title})),T.a.createElement("div",{className:Le.a.questionChoices},je==null||((H=je.question_choices)===null||H===void 0)?void 0:H.map(function(ue,He){return T.a.createElement(I.a,null,T.a.createElement(m.a,null,T.a.createElement(ke.a,{key:He,checked:je.standard_answer.includes(He+1),disabled:!0},tt[He],".")),T.a.createElement(m.a,{flex:"1"},T.a.createElement("span",{className:"c-black font14"},T.a.createElement(be.a,{value:ue.choice_text}))))})))},F=function(){return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),T.a.createElement("p",{className:Le.a.titleWrap},T.a.createElement("span",{className:Le.a.required},"*"),T.a.createElement("span",{className:Le.a.title},"\u9898\u5E72\uFF1A")),T.a.createElement(Pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:kn,onChange:function(ue){return Cn(ue)}}),T.a.createElement("p",{className:Le.a.titleWrap},T.a.createElement("span",{className:Le.a.required},"*"),T.a.createElement("span",{className:Le.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",T.a.createElement("span",{className:Le.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Gt.map(function(H,ue){return T.a.createElement("div",{className:Le.a.choiceWrap,key:ue},T.a.createElement(Me.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},T.a.createElement("div",{className:"".concat(Le.a.answer," ").concat(gn.includes(ue)?Le.a.activeAnswer:""),onClick:function(){gn.includes(ue)?Jt(gn.filter(function(Xe){return Xe!==ue})):Jt([].concat(Object(L.a)(gn),[ue]))}},tt[ue])),T.a.createElement("div",{className:Le.a.editorWrap},Ut===ue?T.a.createElement(Pe.a,{id:"single-question-option-".concat(ue),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:H,onChange:function(Xe){Gt[ue]=Xe,on(Gt)}}):T.a.createElement("div",{className:Le.a.htmlWrap,onClick:function(){return zt(ue)}},T.a.createElement(be.a,{value:H}))),ue>1&&T.a.createElement(Me.a,{title:"\u5220\u9664"},T.a.createElement("i",{className:"".concat(Le.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return on(Gt.filter(function(Xe,At){return At!==ue}))}})),ue<7&&ue===Gt.length-1&&T.a.createElement(Me.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},T.a.createElement("i",{className:"".concat(Le.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return on([].concat(Object(L.a)(Gt),[""]))}})))}),T.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),T.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",T.a.createElement(oe.a,{value:ei,max:1e4,min:-1,onChange:function(ue){Xn(ue)}})," \u5206"),T.a.createElement("aside",{className:"tr"},je.question_id&&T.a.createElement(W.a,{type:"default",onClick:function(){return mn(!1)}},"\u53D6\u6D88"),T.a.createElement(W.a,{className:"ml20",type:"primary",onClick:function(){return Dn()}},"\u4FDD\u5B58")))};return T.a.createElement("section",{className:Le.a.wrap},!Wn&&C(),Wn&&F())},lt=Object(Y.a)(function(Re){var De=Re.problemset,Ze=Re.loading,dt=Re.globalSetting;return{problemset:De,globalSetting:dt,loading:Ze.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(nt)),Et=Q("7Kak"),Ve=Q("9yH6"),Qe=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ut=function(De,Ze){var dt=De.problemset,ht=De.globalSetting,Ft=De.loading,vt=De.dispatch,Ge=De.onRef,en=Ge===void 0?function(){}:Ge,je=De.editData,un=Object(O.a)(De,["problemset","globalSetting","loading","dispatch","onRef","editData"]),yt=Object(g.useState)([]),Nt=Object(R.a)(yt,2),Gt=Nt[0],on=Nt[1],Je=Object(g.useState)(),xt=Object(R.a)(Je,2),Ut=xt[0],zt=xt[1],hn=Object(g.useState)([]),Ln=Object(R.a)(hn,2),gn=Ln[0],Jt=Ln[1],Rt=Object(g.useState)(""),Vn=Object(R.a)(Rt,2),kn=Vn[0],Cn=Vn[1],Qt=Object(g.useState)(0),Gn=Object(R.a)(Qt,2),ei=Gn[0],Xn=Gn[1],et=Object(g.useState)(!1),jt=Object(R.a)(et,2),Wn=jt[0],mn=jt[1],sn=Object(N.i)();Object(g.useEffect)(function(){on(["","","",""])},[]),Object(g.useEffect)(function(){if(!(je!=null&&je.question_choices)){mn(!0);return}Cn(je==null?void 0:je.question_title),Xn(parseInt(je==null?void 0:je.question_score)),on(je==null?void 0:je.question_choices.map(function(H){return H.choice_text}));var q=[];je==null||je.standard_answer.map(function(H,ue){q.push(H-1)}),Jt(q)},[je]),Object(g.useImperativeHandle)(Ze,function(){return{onSave:Dn,isEdit:Wn}});var Dn=function(){var q=Object(a.a)(h.a.mark(function H(){var ue,He,Xe;return h.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:if(kn){We.next=3;break}return r.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),We.abrupt("return",!1);case 3:if(ue=Gt.findIndex(function(mt){return!mt}),!(ue>-1)){We.next=7;break}return r.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Qe[ue]," \u9009\u9879\u7684\u5185\u5BB9")),We.abrupt("return",!1);case 7:if(gn.length){We.next=10;break}return r.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),We.abrupt("return",!1);case 10:if(!(gn.length<1)){We.next=13;break}return r.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),We.abrupt("return",!1);case 13:if(He=Gt.map(function(mt,Zt){return{choice_text:mt,is_answer:gn.includes(Zt)?Zt+1:0}}),!je.question_id){We.next=20;break}return We.next=17,Object(U.u)({id:je.question_id,question_title:kn,question_type:1,question_score:ei,question_choices:He.map(function(mt){return mt.choice_text}),standard_answers:He.filter(function(mt){return mt.is_answer}).map(function(mt){return mt.is_answer})});case 17:Xe=We.sent,We.next=23;break;case 20:return We.next=22,Object(U.a)({exercise_bank_id:sn.topicId,question_title:kn,question_type:1,question_score:"5.0",question_choices:He.map(function(mt){return mt.choice_text}),standard_answers:He.filter(function(mt){return mt.is_answer}).map(function(mt){return mt.is_answer})});case 22:Xe=We.sent;case 23:return Xe.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),mn(!1)),We.next=26,vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},sn)});case 26:case"end":return We.stop()}},H)}));return function(){return q.apply(this,arguments)}}(),K=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],v=function(){var q=Object(a.a)(h.a.mark(function H(ue){return h.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:Xe.t0=ue.id,Xe.next=Xe.t0==="del"?3:Xe.t0==="up"||Xe.t0==="down"?5:Xe.t0==="edit"?9:11;break;case 3:return j.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function We(){return h.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(U.e)({pollsId:je.question_id});case 2:vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},sn)});case 3:case"end":return Zt.stop()}},We)}))()}}),Xe.abrupt("break",11);case 5:return Xe.next=7,Object(U.j)({exerciseId:je==null?void 0:je.question_id,opr:ue.id});case 7:return vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},sn)}),Xe.abrupt("break",11);case 9:return mn(!0),Xe.abrupt("break",11);case 11:case"end":return Xe.stop()}},H)}));return function(ue){return q.apply(this,arguments)}}(),C=function(){var H;return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},je.key,"\u3001\u5355\u9009\u9898"),"\uFF08",je.question_score,"\u5206\uFF09"),!je.hideAction&&K.map(function(ue,He){return ue.id==="up"&&je.key===1||ue.id==="down"&&je.key===je.len?null:T.a.createElement(Me.a,{key:He,placement:"bottom",title:ue.name},T.a.createElement("span",{onClick:function(){return v(ue)},className:ue.icon}))})),T.a.createElement("div",{className:"mt5"},T.a.createElement(be.a,{value:je.question_title})),T.a.createElement("div",{className:Le.a.questionChoices},je==null||((H=je.question_choices)===null||H===void 0)?void 0:H.map(function(ue,He){return T.a.createElement(I.a,null,T.a.createElement(m.a,null,T.a.createElement(Ve.a,{key:He,checked:je.standard_answer.includes(He+1),disabled:!0},Qe[He],".")),T.a.createElement(m.a,{flex:"1"},T.a.createElement("span",{className:"c-black font14"},T.a.createElement(be.a,{value:ue.choice_text}))))})))},F=function(){return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),T.a.createElement("p",{className:Le.a.titleWrap},T.a.createElement("span",{className:Le.a.required},"*"),T.a.createElement("span",{className:Le.a.title},"\u9898\u5E72\uFF1A")),T.a.createElement(Pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:kn,onChange:function(ue){return Cn(ue)}}),T.a.createElement("p",{className:Le.a.titleWrap},T.a.createElement("span",{className:Le.a.required},"*"),T.a.createElement("span",{className:Le.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",T.a.createElement("span",{className:Le.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Gt.map(function(H,ue){return T.a.createElement("div",{className:Le.a.choiceWrap,key:ue},T.a.createElement(Me.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},T.a.createElement("div",{className:"".concat(Le.a.answer," ").concat(gn.includes(ue)?Le.a.activeAnswer:""),onClick:function(){gn.includes(ue)?Jt(gn.filter(function(Xe){return Xe!==ue})):Jt([].concat(Object(L.a)(gn),[ue]))}},Qe[ue])),T.a.createElement("div",{className:Le.a.editorWrap},Ut===ue?T.a.createElement(Pe.a,{id:"single-question-option-".concat(ue),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:H,onChange:function(Xe){Gt[ue]=Xe,on(Gt)}}):T.a.createElement("div",{className:Le.a.htmlWrap,onClick:function(){return zt(ue)}},T.a.createElement(be.a,{value:H}))),ue>1&&T.a.createElement(Me.a,{title:"\u5220\u9664"},T.a.createElement("i",{className:"".concat(Le.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return on(Gt.filter(function(Xe,At){return At!==ue}))}})),ue<7&&ue===Gt.length-1&&T.a.createElement(Me.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},T.a.createElement("i",{className:"".concat(Le.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return on([].concat(Object(L.a)(Gt),[""]))}})))}),T.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),T.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",T.a.createElement(oe.a,{value:ei,max:1e4,min:-1,onChange:function(ue){Xn(ue)}})," \u5206"),T.a.createElement("aside",{className:"tr"},je.question_id&&T.a.createElement(W.a,{type:"default",onClick:function(){return mn(!1)}},"\u53D6\u6D88"),T.a.createElement(W.a,{className:"ml20",type:"primary",onClick:function(){return Dn()}},"\u4FDD\u5B58")))};return T.a.createElement("section",{className:Le.a.wrap},!Wn&&C(),Wn&&F())},gt=Object(Y.a)(function(Re){var De=Re.problemset,Ze=Re.loading,dt=Re.globalSetting;return{problemset:De,globalSetting:dt,loading:Ze.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(ut)),ot=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],it=function(De,Ze){var dt=De.problemset,ht=De.globalSetting,Ft=De.loading,vt=De.dispatch,Ge=De.onRef,en=Ge===void 0?function(){}:Ge,je=De.editData,un=Object(O.a)(De,["problemset","globalSetting","loading","dispatch","onRef","editData"]),yt=Object(g.useState)(),Nt=Object(R.a)(yt,2),Gt=Nt[0],on=Nt[1],Je=Object(g.useState)(""),xt=Object(R.a)(Je,2),Ut=xt[0],zt=xt[1],hn=Object(g.useState)(!1),Ln=Object(R.a)(hn,2),gn=Ln[0],Jt=Ln[1],Rt=Object(g.useState)(5),Vn=Object(R.a)(Rt,2),kn=Vn[0],Cn=Vn[1],Qt=Object(N.i)();Object(g.useEffect)(function(){if(!(je!=null&&je.question_choices)){Jt(!0);return}zt(je==null?void 0:je.question_title),Cn(je==null?void 0:je.question_score),on(je.standard_answer[0]+"")},[je]),Object(g.useImperativeHandle)(Ze,function(){return{onSave:Gn,isEdit:gn}});var Gn=function(){var Wn=Object(a.a)(h.a.mark(function mn(){var sn,Dn;return h.a.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(Ut){v.next=3;break}return r.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),v.abrupt("return",!1);case 3:if(Gt){v.next=6;break}return r.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),v.abrupt("return",!1);case 6:if(sn=[{choice_text:"\u6B63\u786E",is_answer:Gt==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Gt==="2"?2:0}],!je.question_id){v.next=13;break}return v.next=10,Object(U.u)({id:je.question_id,question_title:Ut,question_type:2,question_score:kn,question_choices:sn.map(function(C){return C.choice_text}),standard_answers:sn.filter(function(C){return C.is_answer}).map(function(C){return C.is_answer})});case 10:Dn=v.sent,v.next=16;break;case 13:return v.next=15,Object(U.a)({exercise_bank_id:Qt.topicId,question_title:Ut,question_type:2,question_score:kn,question_choices:sn.map(function(C){return C.choice_text}),standard_answers:sn.filter(function(C){return C.is_answer}).map(function(C){return C.is_answer})});case 15:Dn=v.sent;case 16:return Dn.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),Jt(!1)),vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Qt)}),v.abrupt("return",{name:Ut,choices:sn});case 19:case"end":return v.stop()}},mn)}));return function(){return Wn.apply(this,arguments)}}(),ei=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Xn=function(){var Wn=Object(a.a)(h.a.mark(function mn(sn){return h.a.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:K.t0=sn.id,K.next=K.t0==="del"?3:K.t0==="up"||K.t0==="down"?5:K.t0==="edit"?9:11;break;case 3:return j.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function C(){return h.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(U.e)({pollsId:je.question_id});case 2:vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Qt)});case 3:case"end":return q.stop()}},C)}))()}}),K.abrupt("break",11);case 5:return K.next=7,Object(U.j)({exerciseId:je==null?void 0:je.question_id,opr:sn.id});case 7:return vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Qt)}),K.abrupt("break",11);case 9:return Jt(!0),K.abrupt("break",11);case 11:case"end":return K.stop()}},mn)}));return function(sn){return Wn.apply(this,arguments)}}(),et=function(){var mn;return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},je.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",je.question_score,"\u5206\uFF09"),!je.hideAction&&ei.map(function(sn,Dn){return sn.id==="up"&&je.key===1||sn.id==="down"&&je.key===je.len?null:T.a.createElement(Me.a,{key:Dn,placement:"bottom",title:sn.name},T.a.createElement("span",{onClick:function(){return Xn(sn)},className:sn.icon}))})),T.a.createElement("div",{className:"mt5"},je.question_title),T.a.createElement("div",{className:Le.a.questionChoices},je==null||((mn=je.question_choices)===null||mn===void 0)?void 0:mn.map(function(sn,Dn){return T.a.createElement(Ve.a,{key:Dn,checked:je.standard_answer.includes(Dn+1),disabled:!0},ot[Dn],". ",T.a.createElement("span",{className:"c-black font14"},sn.choice_text))})))},jt=function(){return T.a.createElement("aside",null,T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),T.a.createElement("p",{className:Le.a.titleWrap},T.a.createElement("span",{className:Le.a.required},"*"),T.a.createElement("span",{className:Le.a.title},"\u9898\u5E72\uFF1A")),T.a.createElement(Pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ut,onChange:function(sn){return zt(sn)}}),T.a.createElement("p",{className:Le.a.titleWrap},T.a.createElement("span",{className:Le.a.required},"*"),T.a.createElement("span",{className:Le.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",T.a.createElement("span",{className:Le.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),T.a.createElement(Ve.a.Group,{buttonStyle:"solid",value:Gt,onChange:function(sn){return on(sn.target.value)}},T.a.createElement(Ve.a.Button,{value:"1",className:"".concat(Le.a.radio," mr40")},"\u6B63\u786E"),T.a.createElement(Ve.a.Button,{value:"2",className:Le.a.radio},"\u9519\u8BEF")),T.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),T.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",T.a.createElement(oe.a,{value:kn,max:1e4,min:-1,onChange:function(sn){Cn(sn)}})," \u5206"),T.a.createElement("aside",{className:"tr"},je.question_id&&T.a.createElement(W.a,{type:"default",onClick:function(){return Jt(!1)}},"\u53D6\u6D88"),T.a.createElement(W.a,{className:"ml20",type:"primary",onClick:function(){return Gn()}},"\u4FDD\u5B58")))};return T.a.createElement("section",{className:Le.a.wrap},!gn&&et(),gn&&jt())},rt=Object(Y.a)(function(Re){var De=Re.problemset,Ze=Re.loading,dt=Re.globalSetting;return{problemset:De,globalSetting:dt,loading:Ze.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(it)),Pt=Q("kqOp"),It=Q("7qnI"),wt=Q("1vsH"),Tt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Wt=function(De,Ze){var dt=De.problemset,ht=De.globalSetting,Ft=De.loading,vt=De.dispatch,Ge=De.editData,en=Object(O.a)(De,["problemset","globalSetting","loading","dispatch","editData"]),je=Object(g.useState)(""),un=Object(R.a)(je,2),yt=un[0],Nt=un[1],Gt=Object(g.useState)(""),on=Object(R.a)(Gt,2),Je=on[0],xt=on[1],Ut=Object(g.useState)([]),zt=Object(R.a)(Ut,2),hn=zt[0],Ln=zt[1],gn=Object(g.useState)(""),Jt=Object(R.a)(gn,2),Rt=Jt[0],Vn=Jt[1],kn=Object(g.useState)(),Cn=Object(R.a)(kn,2),Qt=Cn[0],Gn=Cn[1],ei=Object(g.useState)(!1),Xn=Object(R.a)(ei,2),et=Xn[0],jt=Xn[1],Wn=Object(g.useState)(5),mn=Object(R.a)(Wn,2),sn=mn[0],Dn=mn[1],K=Object(g.useState)(!1),v=Object(R.a)(K,2),C=v[0],F=v[1],q=Object(N.i)();Object(g.useEffect)(function(){if(!(Ge!=null&&Ge.question_title)){F(!0);return}Nt(Ge==null?void 0:Ge.question_title),Gn(Ge==null?void 0:Ge.is_ordered),Dn(Ge==null?void 0:Ge.question_score);var fn=Ge==null?void 0:Ge.standard_answer.map(function(Mt){return Mt.answer_text});Ln(fn)},[dt.editData]),Object(g.useEffect)(function(){jt(!1)},[C]),Object(g.useImperativeHandle)(Ze,function(){return{onSave:H,isEdit:C}});var H=function(){var fn=Object(a.a)(h.a.mark(function Mt(){var Bt,tn,nn;return h.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(Bt=[],tn=!1,hn.forEach(function(ln,ci){Bt.push({choice_id:ci+1,answer_text:[]}),ln.forEach(function(cr,gr){Bt[ci].answer_text.push(cr),(!cr||!Object(wt.db)(cr,1e4))&&(Vn("".concat(ci,"-").concat(gr)),r.b.info(cr?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),tn=!0)})}),!tn){qn.next=5;break}return qn.abrupt("return",!1);case 5:if(!Ge.question_id){qn.next=11;break}return qn.next=8,Object(U.u)({id:Ge.question_id,question_title:yt,question_type:3,question_score:sn,is_ordered:Qt,standard_answers:Bt});case 8:nn=qn.sent,qn.next=14;break;case 11:return qn.next=13,Object(U.a)({exercise_bank_id:q.topicId,question_title:yt,question_type:3,question_score:sn,is_ordered:Qt,standard_answers:Bt});case 13:nn=qn.sent;case 14:return nn.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),F(!1)),vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},q)}),qn.abrupt("return",{name:yt,analysis:Je,standard_answers:Bt,is_ordered:Qt});case 17:case"end":return qn.stop()}},Mt)}));return function(){return fn.apply(this,arguments)}}(),ue=function(Mt,Bt,tn){var nn=hn.slice();if(Bt&&nn.splice(Mt,Bt),tn&&et)for(var yn=0;yn<tn;yn++)nn.splice(Mt+yn,0,[""]);jt(!0),Ln(nn)},He=function(Mt,Bt,tn){Vn("");var nn=hn.slice();nn[Mt][Bt]=tn,Ln(nn)},Xe=function(Mt){var Bt=hn.slice();Bt[Mt]=[].concat(Object(L.a)(Bt[Mt]),[""]),Ln(Bt)},At=function(Mt,Bt){var tn=hn.slice();if(!tn[Mt][Bt]){tn[Mt]=tn[Mt].filter(function(nn,yn){return yn!==Bt}),Ln(tn);return}j.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Le.a.modal,onOk:function(){tn[Mt]=tn[Mt].filter(function(yn,qn){return qn!==Bt}),Ln(tn)}})},We=function(Mt){j.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Le.a.modal,onOk:function(){var tn=hn.slice();tn=hn.filter(function(nn,yn){return Mt!==yn}),Ln(tn)}})},mt=function(){return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),T.a.createElement("div",null,T.a.createElement(Pt.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:yt,onChange:function(Bt){return Nt(Bt)},showNullButton:!0,onPlaceholderChange:ue})),T.a.createElement("div",{className:"mt20"},hn.map(function(Mt,Bt){return T.a.createElement(It.a,{key:Bt,answers:Mt,index:Bt,is_md:!0,activeOptionErrorIndex:Rt,onAnswerChange:He,addChildAnswer:Xe,deleteChildAnswer:At,deleteChildAnswermain:We})})),T.a.createElement("div",{className:"mt20"},hn.length>1&&T.a.createElement("span",null,T.a.createElement(ke.a,{checked:Qt,onChange:function(Bt){return Gn(Bt.target.checked)},className:"".concat(Le.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),T.a.createElement("span",{className:"".concat(Le.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),T.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",T.a.createElement(oe.a,{value:sn,max:1e4,min:-1,onChange:function(Bt){Dn(Bt)}})," \u5206"),T.a.createElement("aside",{className:"tr"},Ge.question_id&&T.a.createElement(W.a,{type:"default",onClick:function(){return F(!1)}},"\u53D6\u6D88"),T.a.createElement(W.a,{className:"ml20",type:"primary",onClick:function(){return H()}},"\u4FDD\u5B58")))},Zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Fn=function(){var fn=Object(a.a)(h.a.mark(function Mt(Bt){return h.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:nn.t0=Bt.id,nn.next=nn.t0==="del"?3:nn.t0==="up"||nn.t0==="down"?5:nn.t0==="edit"?9:11;break;case 3:return j.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function qn(){return h.a.wrap(function(ci){for(;;)switch(ci.prev=ci.next){case 0:return ci.next=2,Object(U.e)({pollsId:Ge.question_id});case 2:vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},q)});case 3:case"end":return ci.stop()}},qn)}))()}}),nn.abrupt("break",11);case 5:return nn.next=7,Object(U.j)({exerciseId:Ge==null?void 0:Ge.question_id,opr:Bt.id});case 7:return vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},q)}),nn.abrupt("break",11);case 9:return F(!0),nn.abrupt("break",11);case 11:case"end":return nn.stop()}},Mt)}));return function(Bt){return fn.apply(this,arguments)}}(),Zn=function(){var Mt;return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},Ge.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",Ge.question_score,"\u5206\uFF09"),!Ge.hideAction&&Zt.map(function(Bt,tn){return Bt.id==="up"&&Ge.key===1||Bt.id==="down"&&Ge.key===Ge.len?null:T.a.createElement(Me.a,{key:tn,placement:"bottom",title:Bt.name},T.a.createElement("span",{onClick:function(){return Fn(Bt)},className:Bt.icon}))})),T.a.createElement("div",{className:"mt5"},Ge.question_title),T.a.createElement("div",{className:Le.a.questionChoices},Ge==null||((Mt=Ge.standard_answer)===null||Mt===void 0)?void 0:Mt.map(function(Bt,tn){return T.a.createElement(I.a,null,T.a.createElement(m.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",Bt.choice_id,"\uFF09\uFF1A"),T.a.createElement(m.a,{flex:"1"},T.a.createElement(X.a,{key:tn,checked:Ge.standard_answer.includes(tn),disabled:!0,value:Bt.answer_text})))})))};return T.a.createElement("section",{className:Le.a.wrap},!C&&Zn(),C&&mt())},Ct=Object(Y.a)(function(Re){var De=Re.problemset,Ze=Re.loading,dt=Re.globalSetting;return{problemset:De,globalSetting:dt,loading:Ze.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(Wt)),bt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ze=function(De,Ze){var dt=De.problemset,ht=De.globalSetting,Ft=De.loading,vt=De.dispatch,Ge=De.onRef,en=Ge===void 0?function(){}:Ge,je=De.editData,un=Object(O.a)(De,["problemset","globalSetting","loading","dispatch","onRef","editData"]),yt=Object(g.useState)(""),Nt=Object(R.a)(yt,2),Gt=Nt[0],on=Nt[1],Je=Object(g.useState)(""),xt=Object(R.a)(Je,2),Ut=xt[0],zt=xt[1],hn=Object(g.useState)(""),Ln=Object(R.a)(hn,2),gn=Ln[0],Jt=Ln[1],Rt=Object(g.useState)(5),Vn=Object(R.a)(Rt,2),kn=Vn[0],Cn=Vn[1],Qt=Object(g.useState)(!1),Gn=Object(R.a)(Qt,2),ei=Gn[0],Xn=Gn[1],et=Object(N.i)();Object(g.useEffect)(function(){var K;if(!(je!=null&&je.question_title)){Xn(!0);return}on(je==null?void 0:je.question_title),Jt(je==null||((K=je.standard_answer)===null||K===void 0)?void 0:K[0]),Cn(je==null?void 0:je.question_score)},[dt.editData]),Object(g.useImperativeHandle)(Ze,function(){return{onSave:jt,isEdit:ei}});var jt=function(){var K=Object(a.a)(h.a.mark(function v(){var C;return h.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:if(Gt){q.next=3;break}return r.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),q.abrupt("return",!1);case 3:if(!je.question_id){q.next=9;break}return q.next=6,Object(U.u)({id:je.question_id,question_title:Gt,question_type:4,question_score:kn,standard_answers:[gn]});case 6:C=q.sent,q.next=12;break;case 9:return q.next=11,Object(U.a)({exercise_bank_id:et.topicId,question_title:Gt,question_type:4,question_score:kn,standard_answers:[gn]});case 11:C=q.sent;case 12:return C.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),Xn(!1),vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},et)})),q.abrupt("return",{name:Gt,answer_texts:[gn],analysis:Ut});case 14:case"end":return q.stop()}},v)}));return function(){return K.apply(this,arguments)}}(),Wn=function(){return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u7B80\u7B54\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),T.a.createElement(Pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Gt,onChange:function(C){return on(C)}}),T.a.createElement("p",{className:Le.a.titleWrap},T.a.createElement("span",{className:Le.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),T.a.createElement(Pe.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:gn,onChange:function(C){return Jt(C)}}),T.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",T.a.createElement(oe.a,{value:kn,max:1e4,min:-1,onChange:function(C){Cn(C)}})," \u5206"),T.a.createElement("aside",{className:"tr"},je.question_id&&T.a.createElement(W.a,{type:"default",onClick:function(){return Xn(!1)}},"\u53D6\u6D88"),T.a.createElement(W.a,{className:"ml20",type:"primary",onClick:function(){return jt()}},"\u4FDD\u5B58")))},mn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],sn=function(){var K=Object(a.a)(h.a.mark(function v(C){return h.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:q.t0=C.id,q.next=q.t0==="del"?3:q.t0==="up"||q.t0==="down"?5:q.t0==="edit"?9:11;break;case 3:return j.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function ue(){return h.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return Xe.next=2,Object(U.e)({pollsId:je.question_id});case 2:vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},et)});case 3:case"end":return Xe.stop()}},ue)}))()}}),q.abrupt("break",11);case 5:return q.next=7,Object(U.j)({exerciseId:je==null?void 0:je.question_id,opr:C.id});case 7:return vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},et)}),q.abrupt("break",11);case 9:return Xn(!0),q.abrupt("break",11);case 11:case"end":return q.stop()}},v)}));return function(C){return K.apply(this,arguments)}}(),Dn=function(){return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},je.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",je.question_score,"\u5206\uFF09"),!je.hideAction&&mn.map(function(v,C){return v.id==="up"&&je.key===1||v.id==="down"&&je.key===je.len?null:T.a.createElement(Me.a,{key:C,placement:"bottom",title:v.name},T.a.createElement("span",{onClick:function(){return sn(v)},className:v.icon}))})),T.a.createElement("div",{className:"mt5"},je.question_title),T.a.createElement("div",{className:Le.a.questionChoices},T.a.createElement("p",null,T.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),T.a.createElement(be.a,{value:gn})))};return T.a.createElement("section",{className:Le.a.wrap},!ei&&Dn(),ei&&Wn())},Kt=Object(Y.a)(function(Re){var De=Re.problemset,Ze=Re.loading,dt=Re.globalSetting;return{problemset:De,globalSetting:dt,loading:Ze.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(ze)),St=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ke=function(De,Ze){var dt=De.problemset,ht=De.globalSetting,Ft=De.loading,vt=De.dispatch,Ge=De.editData,en=Object(O.a)(De,["problemset","globalSetting","loading","dispatch","editData"]),je=Object(g.useState)(""),un=Object(R.a)(je,2),yt=un[0],Nt=un[1],Gt=Object(g.useState)(""),on=Object(R.a)(Gt,2),Je=on[0],xt=on[1],Ut=Object(g.useState)(""),zt=Object(R.a)(Ut,2),hn=zt[0],Ln=zt[1],gn=Object(g.useState)([]),Jt=Object(R.a)(gn,2),Rt=Jt[0],Vn=Jt[1],kn=Object(g.useState)(""),Cn=Object(R.a)(kn,2),Qt=Cn[0],Gn=Cn[1],ei=Object(g.useState)(),Xn=Object(R.a)(ei,2),et=Xn[0],jt=Xn[1],Wn=Object(g.useState)(!1),mn=Object(R.a)(Wn,2),sn=mn[0],Dn=mn[1],K=Object(g.useState)([]),v=Object(R.a)(K,2),C=v[0],F=v[1],q=Object(g.useState)(!1),H=Object(R.a)(q,2),ue=H[0],He=H[1],Xe=Object(N.i)();Object(g.useEffect)(function(){var Zn;Ge.edit&&He(!0),Nt(Ge.shixun_name),xt(Ge.question_title);var fn=[];(Zn=Ge.shixun)===null||Zn===void 0||Zn.map(function(Mt){fn.push(Mt.challenge_score)}),F(fn)},[Ge]),Object(g.useEffect)(function(){Dn(!1)},[ue]),Object(g.useImperativeHandle)(Ze,function(){return{onSave:At,isEdit:ue}});var At=function(){var Zn=Object(a.a)(h.a.mark(function fn(){var Mt,Bt,tn;return h.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:if(Mt=[],Bt=!1,!Bt){yn.next=4;break}return yn.abrupt("return",!1);case 4:if(!Ge.question_id){yn.next=10;break}return yn.next=7,Object(U.u)({id:Ge.question_id,question_title:Je,shixun_name:yt,shixun_id:Ge.shixun_id,question_type:5,question_scores:C});case 7:tn=yn.sent,yn.next=13;break;case 10:return yn.next=12,Object(U.a)({exercise_bank_id:Xe.topicId,question_title:Je,shixun_name:yt,shixun_id:Ge.shixun_id,question_type:5,question_scores:C});case 12:tn=yn.sent;case 13:return tn.status===0&&(r.b.success("\u4FDD\u5B58\u6210\u529F"),He(!1)),yn.next=16,vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Xe)});case 16:return yn.abrupt("return",{name:Je,analysis:hn,standard_answers:Mt,is_ordered:et});case 17:case"end":return yn.stop()}},fn)}));return function(){return Zn.apply(this,arguments)}}(),We=function(){var fn;return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),T.a.createElement("div",{className:"mt10"},T.a.createElement(X.a,{defaultValue:yt,onChange:function(Bt){Nt(Bt.target.value)}})),T.a.createElement("div",{className:"mt10"},T.a.createElement(Pe.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:Je,onChange:function(Bt){xt(Bt)}})),T.a.createElement("div",{className:"mt20"},(fn=Ge.shixun)===null||fn===void 0?void 0:fn.map(function(Mt,Bt){return T.a.createElement(I.a,{gutter:[20,20]},T.a.createElement(m.a,{flex:"1"},Bt+1,".",Mt.challenge_name),T.a.createElement(m.a,null,T.a.createElement(oe.a,{defaultValue:C[Bt],onChange:function(nn){C[Bt]=nn,F(C),console.log("srore:L",C[Bt])}})))})),T.a.createElement("div",{className:"mt20"},Rt.length>1&&T.a.createElement("span",null,T.a.createElement(ke.a,{checked:et,onChange:function(Bt){return jt(Bt.target.checked)},className:"".concat(Le.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),T.a.createElement("span",{className:"".concat(Le.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),T.a.createElement("aside",{className:"tr"},!(Ge!=null&&Ge.edit)&&T.a.createElement(W.a,{type:"default",onClick:function(){return He(!1)}},"\u53D6\u6D88"),T.a.createElement(W.a,{className:"ml20",type:"primary",onClick:function(){return At()}},"\u4FDD\u5B58")))},mt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],Zt=function(){var Zn=Object(a.a)(h.a.mark(function fn(Mt){return h.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:tn.t0=Mt.id,tn.next=tn.t0==="del"?3:tn.t0==="up"||tn.t0==="down"?5:tn.t0==="edit"?9:11;break;case 3:return j.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk:function(){return Object(a.a)(h.a.mark(function yn(){return h.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(U.e)({pollsId:Ge.question_id});case 2:vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Xe)});case 3:case"end":return ln.stop()}},yn)}))()}}),tn.abrupt("break",11);case 5:return tn.next=7,Object(U.j)({exerciseId:Ge==null?void 0:Ge.question_id,opr:Mt.id});case 7:return vt({type:"polls/getExerciseBanks",payload:Object(d.a)({},Xe)}),tn.abrupt("break",11);case 9:return He(!0),tn.abrupt("break",11);case 11:case"end":return tn.stop()}},fn)}));return function(Mt){return Zn.apply(this,arguments)}}(),Fn=function(){var fn;return T.a.createElement("aside",null,T.a.createElement("div",{className:Le.a.questionType},T.a.createElement("div",null,T.a.createElement("span",{className:"font16 c-blue"},Ge.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",Ge.question_score,"\u5206\uFF09"),T.a.createElement("div",{className:"tr"},T.a.createElement(V.a,{target:"_blank",to:"/shixuns/".concat(Ge.shixun_identifier,"/challenges")},"\u5B9E\u8BAD\u8BE6\u60C5"),!Ge.hideAction&&mt.map(function(Mt,Bt){return Mt.id==="up"&&Ge.key===1||Mt.id==="down"&&Ge.key===Ge.len?null:T.a.createElement(Me.a,{key:Bt,placement:"bottom",title:Mt.name},T.a.createElement("span",{onClick:function(){return Zt(Mt)},className:Mt.icon}))}))),T.a.createElement("div",{className:"font16"},Ge.shixun_name),T.a.createElement("div",{className:"mt30"}),(fn=Ge.shixun)===null||fn===void 0?void 0:fn.map(function(Mt,Bt){return T.a.createElement("div",{key:Bt},"\u7B2C",Bt+1,"\u5173 ",T.a.createElement("span",{className:"ml10"},Mt.challenge_name)," ",T.a.createElement("span",{className:"ml10"},Mt.challenge_score))}))};return T.a.createElement("section",{className:Le.a.wrap},!ue&&Fn(),ue&&We())},at=Object(Y.a)(function(Re){var De=Re.problemset,Ze=Re.loading,dt=Re.globalSetting;return{problemset:De,globalSetting:dt,loading:Ze.effects}},null,null,{forwardRef:!0})(Object(g.forwardRef)(Ke)),Ce=Q("UU91"),Ee=Q.n(Ce),Te=Q("fJjg"),ee=l.a.SubMenu,ae=E.a.Content,de=E.a.Sider,pe=function(De){var Ze,dt,ht,Ft,vt,Ge,en,je,un,yt,Nt,Gt,on,Je,xt,Ut,zt,hn,Ln,gn,Jt,Rt,Vn,kn,Cn,Qt,Gn,ei,Xn,et,jt,Wn,mn,sn,Dn,K,v,C,F,q,H,ue,He,Xe,At,We,mt,Zt,Fn,Zn,fn,Mt,Bt,tn,nn,yn,qn,ln=De.polls,ci=De.globalSetting,cr=De.loading,gr=De.user,_r=De.dispatch,Wr=Object(O.a)(De,["polls","globalSetting","loading","user","dispatch"]),fi=Object(N.i)(),Di=Object(N.h)(),dr=gr.userInfo,Kr=x.a.useForm(),Ar=Object(R.a)(Kr,1),ai=Ar[0],Pn=Object(g.useState)([]),pi=Object(R.a)(Pn,2),pn=pi[0],mi=pi[1],Yn=Object(g.useState)(!1),nr=Object(R.a)(Yn,2),Si=nr[0],Pi=nr[1],Gr=[{name:"\u9009\u62E9\u9898",id:0},{name:"\u5224\u65AD\u9898",id:2},{name:"\u586B\u7A7A\u9898",id:3},{name:"\u7B80\u7B54\u9898",id:4},{name:"\u5B9E\u8BAD\u9898",id:5}],Qi=Object(g.useRef)();Object(g.useEffect)(function(){var gi;if((gi=ln.exerciseBanks)!==null&&gi!==void 0&&gi.exercise_questions){var Kn,Ci,Ti,qi,kt;mi(Object(L.a)((Kn=ln.exerciseBanks)===null||Kn===void 0?void 0:Kn.exercise_questions)),ai.setFieldsValue({exercise_name:(Ci=ln.exerciseBanks)===null||Ci===void 0||((Ti=Ci.exercise)===null||Ti===void 0)?void 0:Ti.exercise_name,exercise_description:(qi=ln.exerciseBanks)===null||qi===void 0||((kt=qi.exercise)===null||kt===void 0)?void 0:kt.exercise_description})}},[ln.exerciseBanks]),Object(g.useEffect)(function(){_r({type:"polls/getExerciseBanks",payload:Object(d.a)({},fi)})},[fi.categoryId]);var Sr=function(){var gi=Object(a.a)(h.a.mark(function Kn(){var Ci,Ti,qi;return h.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.next=2,ai.validateFields();case 2:return qi=ai.getFieldValue(),qi.is_md=!0,qi.topicId=(Ci=ln.exerciseBanks)===null||Ci===void 0||((Ti=Ci.exercise)===null||Ti===void 0)?void 0:Ti.id,Pi(!1),rn.next=8,Object(U.v)(Object(d.a)({},qi));case 8:_r({type:"polls/getExerciseBanks",payload:Object(d.a)({},fi)});case 9:case"end":return rn.stop()}},Kn)}));return function(){return gi.apply(this,arguments)}}(),ir=function(){var gi=Object(a.a)(h.a.mark(function Kn(Ci){var Ti;return h.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Qi==null?void 0:Qi.current;case 2:if(Ti=kt.sent,!(Ti!=null&&Ti.isEdit)){kt.next=6;break}return r.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898"),kt.abrupt("return");case 6:Ci===5?_r({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}):mi([].concat(Object(L.a)(pn),[{question_type:Ci}]));case 7:case"end":return kt.stop()}},Kn)}));return function(Ci){return gi.apply(this,arguments)}}(),Zi=function(){_r({type:"userDetail/setActionTabs",payload:{key:"UserDetail-SendToClass",params:{object_id:[fi.topicId],object_type:"exercise"}}})},zr=function(){return pn==null?void 0:pn.map(function(Kn,Ci){if(Kn.key=Ci+1,Kn.len=pn.length,Kn.question_type===0)return T.a.createElement("aside",null,T.a.createElement(gt,{ref:Qi,editData:Kn}),T.a.createElement(f.a,null));if(Kn.question_type===1)return T.a.createElement("aside",null,T.a.createElement(lt,{ref:Qi,editData:Kn}),T.a.createElement(f.a,null));if(Kn.question_type===2)return T.a.createElement("aside",null,T.a.createElement(rt,{ref:Qi,editData:Kn}),T.a.createElement(f.a,null));if(Kn.question_type===3)return T.a.createElement("aside",null,T.a.createElement(Ct,{editData:Kn}),T.a.createElement(f.a,null));if(Kn.question_type===4)return T.a.createElement("aside",null,T.a.createElement(Kt,{editData:Kn}),T.a.createElement(f.a,null));if(Kn.question_type===5)return T.a.createElement("aside",null,T.a.createElement(at,{editData:Kn}),T.a.createElement(f.a,null))})};return T.a.createElement("section",{className:"edu-container"},T.a.createElement("section",{className:"animated fadeIn"},T.a.createElement("aside",{className:"mt10"},dr&&T.a.createElement(c.a,{separator:">"},T.a.createElement(c.a.Item,null,T.a.createElement(V.a,{to:"/users/".concat(fi.username,"/").concat(fi.topictype==="personal"?"topics":"topicbank","/").concat(fi.topictype)},fi.topictype==="personal"?"\u6211\u7684\u9898\u5E93":"\u516C\u5171\u9898\u5E93")),T.a.createElement(c.a.Item,null,"\u8BE6\u60C5"))),T.a.createElement("aside",{className:[Ee.a.title,"mt20"].join(" ")},T.a.createElement(I.a,{style:{width:"100%"},align:"middle"},T.a.createElement(m.a,{flex:"1"},T.a.createElement("strong",{className:"font20 ml5"},(Ze=ln.exerciseBanks)===null||Ze===void 0||((dt=Ze.exercise)===null||dt===void 0)?void 0:dt.exercise_name),T.a.createElement(wt.m,{status:[(ht=ln.exerciseBanks)!==null&&ht!==void 0&&(Ft=ht.exercise)!==null&&Ft!==void 0&&Ft.is_public?"\u516C\u5F00":"\u79C1\u6709"]})),T.a.createElement(m.a,null,T.a.createElement(V.a,{className:"font16 c-light-black",to:"/users/".concat(dr.login,"/topics/").concat(fi.topictype)},"\u8FD4\u56DE"))))),T.a.createElement("section",{className:[Ee.a.bg,"pl30","pr30","pb30","mt20 relative"].join(" ")},T.a.createElement("div",{className:Ee.a.export},((vt=ln.exerciseBanks)===null||vt===void 0?void 0:vt.authorize)&&T.a.createElement(T.a.Fragment,null,T.a.createElement("a",{onClick:function(Kn){Kn.preventDefault(),j.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){var Ci=Object(a.a)(h.a.mark(function qi(){var kt;return h.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(A.g)({object_type:"normal",object_id:[fi.topicId]});case 2:kt=Yt.sent,kt.status===0&&Y.d.push("/users/".concat(fi.username,"/topics/personal"));case 4:case"end":return Yt.stop()}},qi)}));function Ti(){return Ci.apply(this,arguments)}return Ti}()})}},"\u5220\u9664"),T.a.createElement(V.a,{to:"/users/".concat(dr.login,"/topics/").concat(fi.topicId,"/").concat(fi.topictype,"/exercise/edit")},"\u7F16\u8F91")),T.a.createElement("a",{onClick:function(Kn){Kn.preventDefault(),Zi()}},"\u53D1\u9001")),T.a.createElement(B.a,{className:Ee.a.tabs},T.a.createElement(B.a.TabPane,{tab:T.a.createElement("span",{className:"font16 pt10 pb12"},"\u5185\u5BB9\u8BE6\u60C5"),key:"1"},T.a.createElement("div",{className:"c-light-black"},(Ge=ln.exerciseBanks)===null||Ge===void 0||((en=Ge.exercise)===null||en===void 0)?void 0:en.exercise_description))),Si&&T.a.createElement(x.a,{layout:"vertical",form:ai},T.a.createElement(x.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u6807\u9898\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},T.a.createElement(X.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),T.a.createElement(x.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},T.a.createElement(X.a.TextArea,{rows:6,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26"})),T.a.createElement(x.a.Item,{className:"tr"},T.a.createElement(W.a,{type:"primary",onClick:function(){Sr()}},"\u4FDD\u5B58")))),T.a.createElement("p",{className:"mt10",style:{display:"flex"}},T.a.createElement("span",{className:"fl",style:{flex:"1"}},!!((je=ln.exerciseBanks)!==null&&je!==void 0&&(un=je.exercise_types)!==null&&un!==void 0&&un.q_singles)&&T.a.createElement("span",{className:"ml20"},"\u5355\u9009\u9898",(yt=ln.exerciseBanks)===null||yt===void 0||((Nt=yt.exercise_types)===null||Nt===void 0)?void 0:Nt.q_singles,"\u9898\uFF0C\u5171",(Gt=ln.exerciseBanks)===null||Gt===void 0||((on=Gt.exercise_types)===null||on===void 0)?void 0:on.q_singles_scores,"\u5206"),!!((Je=ln.exerciseBanks)!==null&&Je!==void 0&&(xt=Je.exercise_types)!==null&&xt!==void 0&&xt.q_doubles)&&T.a.createElement("span",{className:"ml20"},"\u591A\u9009\u9898",(Ut=ln.exerciseBanks)===null||Ut===void 0||((zt=Ut.exercise_types)===null||zt===void 0)?void 0:zt.q_doubles,"\u9898\uFF0C\u5171",(hn=ln.exerciseBanks)===null||hn===void 0||((Ln=hn.exercise_types)===null||Ln===void 0)?void 0:Ln.q_doubles_scores,"\u5206"),!!((gn=ln.exerciseBanks)!==null&&gn!==void 0&&(Jt=gn.exercise_types)!==null&&Jt!==void 0&&Jt.q_judges)&&T.a.createElement("span",{className:"ml20"},"\u5224\u65AD\u9898",(Rt=ln.exerciseBanks)===null||Rt===void 0||((Vn=Rt.exercise_types)===null||Vn===void 0)?void 0:Vn.q_judges,"\u9898\uFF0C\u5171",(kn=ln.exerciseBanks)===null||kn===void 0||((Cn=kn.exercise_types)===null||Cn===void 0)?void 0:Cn.q_judges_scores,"\u5206"),!!((Qt=ln.exerciseBanks)!==null&&Qt!==void 0&&(Gn=Qt.exercise_types)!==null&&Gn!==void 0&&Gn.q_nulls)&&T.a.createElement("span",{className:"ml20"},"\u586B\u7A7A\u9898",(ei=ln.exerciseBanks)===null||ei===void 0||((Xn=ei.exercise_types)===null||Xn===void 0)?void 0:Xn.q_nulls,"\u9898\uFF0C\u5171",(et=ln.exerciseBanks)===null||et===void 0||((jt=et.exercise_types)===null||jt===void 0)?void 0:jt.q_nulls_scores,"\u5206"),!!((Wn=ln.exerciseBanks)!==null&&Wn!==void 0&&(mn=Wn.exercise_types)!==null&&mn!==void 0&&mn.q_mains)&&T.a.createElement("span",{className:"ml20"},"\u7B80\u7B54\u9898",(sn=ln.exerciseBanks)===null||sn===void 0||((Dn=sn.exercise_types)===null||Dn===void 0)?void 0:Dn.q_mains,"\u9898\uFF0C\u5171",(K=ln.exerciseBanks)===null||K===void 0||((v=K.exercise_types)===null||v===void 0)?void 0:v.q_mains_scores,"\u5206"),!!((C=ln.exerciseBanks)!==null&&C!==void 0&&(F=C.exercise_types)!==null&&F!==void 0&&F.q_shixuns)&&T.a.createElement("span",{className:"ml20"},"\u5B9E\u8BAD\u9898",(q=ln.exerciseBanks)===null||q===void 0||((H=q.exercise_types)===null||H===void 0)?void 0:H.q_shixuns,"\u9898\uFF0C\u5171",(ue=ln.exerciseBanks)===null||ue===void 0||((He=ue.exercise_types)===null||He===void 0)?void 0:He.q_shixuns_scores,"\u5206"),!!((Xe=ln.exerciseBanks)!==null&&Xe!==void 0&&(At=Xe.exercise_types)!==null&&At!==void 0&&At.q_pros)&&T.a.createElement("span",{className:"ml20"},"\u7F16\u7A0B\u9898",(We=ln.exerciseBanks)===null||We===void 0||((mt=We.exercise_types)===null||mt===void 0)?void 0:mt.q_pros,"\u9898\uFF0C\u5171",(Zt=ln.exerciseBanks)===null||Zt===void 0||((Fn=Zt.exercise_types)===null||Fn===void 0)?void 0:Fn.q_pros_scores,"\u5206")),T.a.createElement("span",{className:"fr"},!!((Zn=ln.exerciseBanks)!==null&&Zn!==void 0&&(fn=Zn.exercise_types)!==null&&fn!==void 0&&fn.q_counts)&&T.a.createElement("span",null,"\u5408\u8BA1 ",T.a.createElement("span",{className:"color-blue"},(Mt=ln.exerciseBanks)===null||Mt===void 0||((Bt=Mt.exercise_types)===null||Bt===void 0)?void 0:Bt.q_counts)," \u9898\uFF0C \u5171 ",T.a.createElement("span",{className:"".concat(((tn=ln.exerciseBanks)===null||tn===void 0||((nn=tn.exercise_types)===null||nn===void 0)?void 0:nn.q_scores)>100?"color-red font-bd":"color-orange")},(yn=ln.exerciseBanks)===null||yn===void 0||((qn=yn.exercise_types)===null||qn===void 0)?void 0:qn.q_scores)," \u5206"))),T.a.createElement("section",{className:[Ee.a.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},pn!=""&&zr(),pn==""&&T.a.createElement(J.a,null)),T.a.createElement(Te.a,null))},_e=$e.default=Object(Y.a)(function(Re){var De=Re.polls,Ze=Re.loading,dt=Re.user,ht=Re.globalSetting;return{polls:De,globalSetting:ht,user:dt,loading:Ze.effects}})(pe)},Nf5h:function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return j}),Q.d($e,"h",function(){return u}),Q.d($e,"l",function(){return a}),Q.d($e,"e",function(){return O}),Q.d($e,"i",function(){return l}),Q.d($e,"j",function(){return be}),Q.d($e,"c",function(){return le.a}),Q.d($e,"b",function(){return Et}),Q.d($e,"g",function(){return gt}),Q.d($e,"f",function(){return Pt}),Q.d($e,"k",function(){return St}),Q.d($e,"d",function(){return Ee});var se=Q("q1tI"),W=Q.n(se),k=Q("NQs2"),X=Q.n(k),D=Q("ygoZ"),B=Q.n(D),G=function(ee){var ae=ee.dataSource,de=ae===void 0?[]:ae,pe=ee.img,_e=ee.imgWidth,Re=_e===void 0?346:_e,De=ee.title,Ze=ee.sunTitle,dt=ee.bannerExtraContent;return W.a.createElement("div",{className:X.a.banner},W.a.createElement("div",{className:X.a.content},W.a.createElement("aside",null,W.a.createElement("p",null,W.a.createElement("b",null,De),W.a.createElement("span",null,Ze)),de.length>0&&W.a.createElement("div",{className:X.a.btns},de.map(function(ht,Ft){return W.a.createElement("div",{key:Ft,onClick:ht.click},ht.name,ht.sign?W.a.createElement("img",{src:B.a,width:39}):null)})),dt),W.a.createElement("img",{style:{marginTop:33,marginRight:38},src:pe,width:Re})))},j=G,P=Q("tJVT"),I=Q("6nfa"),y=Q.n(I),m=Q("TSYQ"),p=Q.n(m),c=function(ee){var ae=ee.dataSource,de=ae===void 0?[]:ae,pe=ee.value,_e=ee.onChange,Re=ee.className,De=ee.title,Ze=ee.titleWidth,dt=Ze===void 0?41:Ze,ht=ee.style,Ft=ht===void 0?{}:ht,vt=ee.fontColor,Ge=vt===void 0?"#6A7283":vt,en=Object(se.useState)(0),je=Object(P.a)(en,2),un=je[0],yt=je[1],Nt=Object(se.useState)(!1),Gt=Object(P.a)(Nt,2),on=Gt[0],Je=Gt[1],xt=Object(se.useRef)(null);return Object(se.useEffect)(function(){if(de.length!==0){var Ut;(xt==null||((Ut=xt.current)===null||Ut===void 0)?void 0:Ut.clientHeight)>92?yt(1):yt(0)}de.length===0&&yt(0)},[de]),W.a.createElement("div",{className:p()(y.a.row,Re),style:Ft},W.a.createElement("div",{style:{width:dt,marginTop:on?12:4},className:y.a.title},De),W.a.createElement("div",{className:on?"".concat(y.a.tagsWrap," ").concat(y.a.tagsBorderWrap):y.a.tagsWrap},W.a.createElement("div",{className:y.a.bar,style:un>0?{height:un===1?92:"auto",overflow:un===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},W.a.createElement("div",{className:y.a.name,ref:xt},de==null?void 0:de.map(function(Ut){return W.a.createElement("span",{onClick:function(){return _e(Ut.id)},key:Ut.id,title:Ut.name,style:{color:Ge},className:pe===Ut.id?y.a.active:""},Ut.name)}))),!!un&&W.a.createElement(se.Fragment,null,un===1?W.a.createElement("div",{onClick:function(){var zt;yt(2),(xt==null||((zt=xt.current)===null||zt===void 0)?void 0:zt.clientHeight)>205?Je(!0):Je(!1)},className:y.a.action},"\u5C55\u5F00",W.a.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):W.a.createElement("div",{onClick:function(){yt(1),Je(!1)},className:y.a.action},"\u6536\u8D77",W.a.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},u=c,f=Q("cz0n"),s=Q.n(f),r=function(ee){var ae=ee.dataSource,de=ae===void 0?[]:ae,pe=ee.value,_e=ee.onChange,Re=ee.className;return W.a.createElement("div",{className:p()(s.a.tabs,Re)},de.map(function(De){return W.a.createElement("span",{onClick:function(){return _e(De.id)},className:pe===De.id?s.a.active:"",key:De.id},De.name)}))},a=r,d=Q("5NDa"),L=Q("5rEg"),S=Q("KOXS"),x=Q.n(S),R=function(ee){var ae,de=ee.dataSource,pe=de===void 0?[]:de,_e=ee.value,Re=ee.onChange,De=ee.className,Ze=ee.style,dt=Ze===void 0?{}:Ze,ht=ee.placeholder,Ft=Object(se.useState)(""),vt=Object(P.a)(Ft,2),Ge=vt[0],en=vt[1],je=Object(se.useState)(""),un=Object(P.a)(je,2),yt=un[0],Nt=un[1];Object(se.useEffect)(function(){var Je;(Je=JSON.stringify(_e))!==null&&Je!==void 0&&Je.includes("{")?(en(_e.id),Nt(_e.value)):Nt(_e)},[_e]);var Gt=function(){Re(yt,Ge||null)},on=function(xt){if(xt===Ge)return;en(xt),Re(yt,xt)};return W.a.createElement("div",{className:p()(x.a.input,De),style:dt},!!pe.length&&W.a.createElement("div",{className:x.a.dropdown},W.a.createElement("div",{className:x.a.text},(ae=pe.find(function(Je){return Je.id===Ge}))===null||ae===void 0?void 0:ae.name,W.a.createElement("i",{className:"iconfont icon-zhankai4"}),W.a.createElement("b",{className:x.a.b1}),W.a.createElement("b",{className:x.a.b2})),W.a.createElement("div",{className:x.a.menu},pe.map(function(Je,xt){return W.a.createElement("div",{key:xt,onClick:function(){return on(Je.id)}},Je.name)}))),W.a.createElement(L.a,{onPressEnter:Gt,value:yt,onChange:function(xt){return Nt(xt.target.value)},bordered:!1,placeholder:ht}),W.a.createElement("i",{onClick:Gt,className:"iconfont icon-sousuo9 font14 pl10 current"}))},O=R,w=Q("f9pc"),E=Q.n(w),b=function(ee){var ae=ee.value,de=ee.onChange,pe=ee.className,_e=ee.total,Re=ee.pageSize,De=ee.style,Ze=De===void 0?{}:De,dt=ae<2,ht=ae>=Math.ceil(_e/Re);return _e<=Re?W.a.createElement(W.a.Fragment,null):W.a.createElement("div",{className:p()(E.a.quickPager,pe),style:Ze},W.a.createElement("div",{onClick:function(){dt||de(ae-1,"prev")},className:dt?E.a.disabled:""},"\u4E0A\u4E00\u9875"),W.a.createElement("div",{onClick:function(){ht||de(ae+1,"next")},className:ht?E.a.disabled:""},"\u4E0B\u4E00\u9875"))},l=b,_=Q("T2oS"),h=Q("W9HT"),g=Q("pC0b"),T=Q("GzdX"),N=Q("5Dmo"),V=Q("3S7+"),Y=Q("Oe0F"),U=Q.n(Y),A=Q("m3rI"),J=Q("1vsH"),ne=Q("JAbv"),oe=Q.n(ne),fe=Q("Bq7L"),ke=Q.n(fe),Oe=Q("MEgm"),Me=Q.n(Oe),Be=Q("BdwD"),Pe=function(ee){var ae=ee.className,de=ee.dataSource,pe=de===void 0?[]:de,_e=ee.col,Re=_e===void 0?4:_e,De=ee.right,Ze=ee.bottom,dt=Ze===void 0?23:Ze,ht=ee.precision,Ft=ht===void 0?0:ht,vt=ee.wrapWidth,Ge=vt===void 0?1200:vt,en=ee.trackEventItems,je=ee.loading,un=Math.floor((Ge-(Re-1)*De)/Re);return W.a.createElement(h.a,{spinning:je},W.a.createElement("div",{className:p()(U.a.list,ae)},!!pe.length&&pe.map(function(yt,Nt){var Gt=yt.name,on=yt.id,Je=yt.identifier,xt=yt.power,Ut=yt.cover_image_id,zt=yt.pic;return W.a.createElement("div",{className:U.a.wrap,key:on,style:{width:un,marginRight:(1+Nt)%Re===0?0:De+Ft,marginBottom:dt}},W.a.createElement("a",{target:"_blank",href:"/shixuns/".concat(Je,"/challenges"),className:U.a.li,onClick:function(Ln){Ln.preventDefault(),en&&Object(J.cb)([en]),xt&&Object(J.S)("/shixuns/".concat(Je,"/challenges"))}},W.a.createElement("div",{className:U.a.img},W.a.createElement("img",{className:U.a.cover,src:Ut?"".concat(A.a.API_SERVER,"/api/attachments/").concat(Ut):"".concat(A.a.IMG_SERVER,"/").concat(zt)}),yt.is_jupyter&&W.a.createElement("img",{className:U.a.sign,src:oe.a}),yt.is_jupyter_lab&&W.a.createElement("img",{className:U.a.sign,src:ke.a}),yt.is_unity_3d&&W.a.createElement("img",{className:U.a.sign,src:Me.a})),W.a.createElement("div",{className:U.a.name},W.a.createElement(V.a,{title:Gt||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},W.a.createElement("span",{className:U.a.e},Gt||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),W.a.createElement("div",{className:U.a.tags},W.a.createElement(V.a,{placement:"bottom",title:"\u5173\u5361\u6570"},W.a.createElement("span",null,W.a.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr3"}),W.a.createElement("span",null,yt.challenges_count))),!!yt.myshixuns_count&&W.a.createElement(V.a,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},W.a.createElement("span",null,W.a.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),W.a.createElement("span",null,yt.myshixuns_count))),W.a.createElement(V.a,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},W.a.createElement("span",null,W.a.createElement("span",null,yt.level))),W.a.createElement("div",{className:U.a.rate},W.a.createElement(T.a,{allowHalf:!0,disabled:!0,defaultValue:yt.score_info}),W.a.createElement("span",null,"\xA0",yt.score_info?"".concat(yt.score_info,"\u5206"):"5\u5206")))),!xt&&W.a.createElement("div",{className:U.a.lockWrap},W.a.createElement("img",{src:"".concat(A.a.IMG_SERVER,"/images/educoder/icon/lockclose.svg")}),W.a.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!pe.length&&W.a.createElement(Be.a,null)))},be=Pe,le=Q("LicW"),Le=Q("iL++"),tt=Q.n(Le),nt=Q("xiVL"),lt=function(ee){var ae=ee.className,de=ee.dataSource,pe=de===void 0?[]:de,_e=ee.col,Re=_e===void 0?4:_e,De=ee.right,Ze=ee.bottom,dt=Ze===void 0?23:Ze,ht=ee.precision,Ft=ht===void 0?0:ht,vt=ee.wrapWidth,Ge=vt===void 0?1200:vt,en=ee.trackEventItems,je=ee.loading,un=Math.floor((Ge-(Re-1)*De)/Re);return W.a.createElement(h.a,{spinning:je},W.a.createElement("div",{className:p()(tt.a.list,ae)},!!pe.length&&pe.map(function(yt,Nt){var Gt=yt.subject_identifier,on=yt.id,Je=yt.identifier,xt=yt.power,Ut=yt.is_public!=0&&yt.is_public;return W.a.createElement("div",{className:tt.a.wrap,key:on,style:{width:un,marginRight:(1+Nt)%Re===0?0:De+Ft,marginBottom:dt}},W.a.createElement("a",{className:tt.a.li,onClick:function(hn){hn.preventDefault()}},W.a.createElement("div",{className:tt.a.top},W.a.createElement(V.a,{title:yt.name},W.a.createElement("div",{className:tt.a.name},yt.name)),W.a.createElement("img",{className:tt.a.img,src:A.a.IMG_SERVER+"/images/"+yt.avatar_url}),W.a.createElement("div",{className:tt.a.text},yt.creator),Gt&&W.a.createElement("div",{className:tt.a.btns},W.a.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),W.a.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),Ut&&W.a.createElement("div",{className:tt.a.sign},"\u516C\u5F00")),W.a.createElement("div",{className:tt.a.bottom},yt.visits>0&&W.a.createElement(V.a,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},W.a.createElement("span",null,W.a.createElement("i",{className:"iconfont icon-liulanyan"}),W.a.createElement("span",null,yt.visits))),yt.course_members_count>0&&W.a.createElement(V.a,{title:"\u6210\u5458",placement:"bottom"},W.a.createElement("span",null,W.a.createElement("i",{className:"iconfont icon-chengyuan"}),yt.course_members_count)),yt.tasks_count>0&&W.a.createElement(V.a,{title:"\u4F5C\u4E1A",placement:"bottom"},W.a.createElement("span",null,W.a.createElement("i",{className:"iconfont icon-zuoye"}),yt.tasks_count)),yt.is_end?W.a.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):W.a.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),W.a.createElement("div",{className:tt.a.lockWrap},yt.is_accessible?W.a.createElement(W.a.Fragment,null,Gt&&W.a.createElement("div",{onClick:function(){return Object(J.S)("/paths/".concat(Gt))}},"\u8FDB\u5165\u5B9E\u8DF5\u8BFE\u7A0B"),W.a.createElement("div",{onClick:function(hn){en&&Object(J.cb)([en]),Object(J.S)(yt.first_category_url)}},"\u8FDB\u5165\u6559\u5B66\u8BFE\u5802")):W.a.createElement(W.a.Fragment,null,W.a.createElement("img",{src:"".concat(A.a.IMG_SERVER,"/images/educoder/icon/lockclose.svg")}),W.a.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165"))))}),!pe.length&&W.a.createElement(Be.a,null)))},Et=lt,Ve=Q("f0W+"),Qe=Q.n(Ve),ut=function(ee){var ae=ee.dataSource,de=ae===void 0?[]:ae,pe=ee.value,_e=ee.onChange,Re=ee.className,De=ee.style,Ze=De===void 0?{}:De,dt=ee.tabBarExtraContent;return W.a.createElement("div",{className:p()(Qe.a.tabs,Re),style:Ze},W.a.createElement("div",{className:Qe.a.tabsWrap},de.map(function(ht,Ft){return W.a.createElement("div",{onClick:function(){return _e(ht.id)},className:pe===ht.id?Qe.a.active:"",key:Ft},ht.name)})),W.a.createElement("div",{className:Qe.a.tabBar},dt))},gt=ut,ot=Q("9JIy"),it=Q.n(ot),rt=function(ee){var ae=ee.className,de=ee.style,pe=de===void 0?{}:de,_e=ee.children;return W.a.createElement("div",{className:p()(it.a.table,ae),style:pe},_e)},Pt=rt,It=Q("qVdP"),wt=Q("jsC+"),Tt=Q("lUTK"),Wt=Q("BvKs"),Ct=Q("8WcF"),bt=Q.n(Ct),ze=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}],Kt=function(ee){var ae,de=ee.sortValue,pe=ee.dropValue,_e=ee.className,Re=ee.onSort,De=ee.onDrop,Ze=ee.dataSource,dt=Ze===void 0?ze:Ze;return W.a.createElement("div",{className:p()(bt.a.orderWrap,_e)},W.a.createElement(wt.a,{overlay:W.a.createElement(Wt.a,null,dt.map(function(ht,Ft){return W.a.createElement(Wt.a.Item,{key:Ft,onClick:function(){return De(ht.id)}},ht.name)}))},W.a.createElement("span",{className:bt.a.orderTextWrap},(ae=dt.find(function(ht){return pe===ht.id}))===null||ae===void 0?void 0:ae.name)),W.a.createElement("span",{className:bt.a.orderIconWrap},W.a.createElement("span",{className:bt.a.orderAsc},W.a.createElement("i",{className:de==="asc"?"iconfont icon-sanjiaoxing-up font12 ".concat(bt.a.cursorPointer," ").concat(bt.a.active):"iconfont icon-sanjiaoxing-up font12 ".concat(bt.a.cursorPointer),onClick:function(){return Re(de==="asc"?"desc":"asc")}})),W.a.createElement("span",{className:bt.a.orderDesc},W.a.createElement("i",{className:de==="desc"?"iconfont icon-sanjiaoxing-down font12 ".concat(bt.a.cursorPointer," ").concat(bt.a.active):"iconfont icon-sanjiaoxing-down font12 ".concat(bt.a.cursorPointer),onClick:function(){return Re(de==="asc"?"desc":"asc")}}))))},St=Kt,Ke=Q("siWv"),at=Q.n(Ke),Ce=function(ee){var ae=ee.className,de=ee.style,pe=ee.children,_e=ee.onClick;return W.a.createElement("div",{onClick:_e,className:p()(at.a.btn,ae),style:de},pe)},Ee=Ce},Nska:function(ct,$e,Q){ct.exports={title:"title___18s87",radioWrap:"radioWrap___3ZobS",radio:"radio___19YEl",colorFF0000:"colorFF0000___2BuLq",pagination:"pagination___18hXH"}},O2Wb:function(ct,$e,Q){ct.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},Oe0F:function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___1lU21",flex_space_between:"flex_space_between___3CfJd",flex_box_vertical_center:"flex_box_vertical_center___20q2h",flex_box_center_end:"flex_box_center_end___1jeZT",flex_box_column:"flex_box_column___2EyZF",list:"list___3Kz8E",wrap:"wrap___12_X7",lockWrap:"lockWrap___9zL4z",li:"li___2bcH1",cover:"cover___1j6mq",img:"img___3itdG",sign:"sign___1Bm21",name:"name___3H1zU",e:"e___1W7k4",tags:"tags___G1tID",rate:"rate___aZiJa"}},Ot1p:function(ct,$e,Q){"use strict";var se=Q("2qtc"),W=Q("kLXV"),k=Q("rAM+"),X=Q("miYZ"),D=Q("tsqr"),B=Q("9og8"),G=Q("tJVT"),j=Q("jrin"),P=Q("WmNS"),I=Q.n(P),y=Q("q1tI"),m=Q.n(y),p=Q("VrN/"),c=Q.n(p),u=Q("bdgK"),f=Q("p77/"),s=Q("Bd2K"),r=Q("ELLl"),a=Q("19Vz"),d=Q("lZu9"),L=Q("+NIl"),S=Q("kSUc"),x=Q("9Bee"),R=function(_e){var Re=_e.value,De=Re===void 0?"":Re,Ze=_e.className,dt=_e.showTextOnly,ht=_e.showLines,Ft=_e.style,vt=Ft===void 0?{}:Ft,Ge=Object(y.useMemo)(function(){return""},[De]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ge}}))},O=Q("0Owb"),w=Q("dejd"),E=Q("C+DQ"),b=Q("1vsH"),l=Q("m3rI"),_=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function h(_e){var Re=_e.onActionCallback,De=_e.title,Ze=_e.icon,dt=_e.actionName,ht=_e.className,Ft=ht===void 0?"":ht,vt=_e.children;function Ge(){Re(dt)}return m.a.createElement("a",{title:De,className:Ft,onClick:Ge},m.a.createElement("i",{className:"md-iconfont ".concat(Ze)}),vt)}var g=function(_e){var Re=_e.watch,De=_e.showNullButton,Ze=_e.onActionCallback,dt=_e.fullScreen,ht=_e.insertTemp,Ft=_e.hidetoolBar,vt=_e.uuid,Ge=_e.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(b.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(b.F)("_educoder_session"),"&key=").concat(vt,"&api=").concat(encodeURIComponent(l.a.PROXY_SERVER)));var en=[].concat(_,[{title:"".concat(Re?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Re?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!Ft&&en.map(function(je,un){return m.a.createElement("li",{key:un},je.actionName?m.a.createElement(h,Object(O.a)({},je,{onActionCallback:Ze})):m.a.createElement("span",{className:"v-line"}))}),De?m.a.createElement("li",null,m.a.createElement(h,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ze},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ht&&m.a.createElement("li",null,m.a.createElement(h,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ht),onActionCallback:Ze},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(h,{icon:"".concat(dt?"icon-shrink":"icon-enlarge"),title:dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ze})))},T=Q("M8RZ"),N=Q("+L6B"),V=Q("2/Rp"),Y=Q("y8nQ"),U=Q("Vl3Y"),A=Q("5NDa"),J=Q("5rEg"),ne={labelCol:{span:4},wrapperCol:{span:20}},oe=function(_e){var Re=_e.callback,De=_e.onCancel;function Ze(dt){Re(dt)}return m.a.createElement(U.a,Object(O.a)({},ne,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ze}),m.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(J.a,null)),m.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(J.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(V.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},fe=Q("7ahc"),ke=Q("HmJG"),Oe=Q("BjJ7"),Me=U.a.useForm,Be={width:280,marginRight:10},Pe={labelCol:{span:5},wrapperCol:{span:19}},be=function(_e){var Re=_e.callback,De=_e.onCancel,Ze=Me(),dt=Object(G.a)(Ze,1),ht=dt[0];function Ft(en){Re(en)}function vt(en,je){if(en.status===-1){D.b.error(en.message);return}ht.setFieldsValue({src:"/api/attachments/".concat(en.id),type:je.type})}function Ge(en){var je=en.target.files[0];Le(je,vt)}return m.a.createElement(U.a,Object(O.a)({form:ht},Pe,{className:"upload-image-panel",onFinish:Ft}),m.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(J.a,{style:Be})),m.a.createElement(le,{onFileChange:Ge}))),m.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(J.a,{style:{width:264}})),m.a.createElement(U.a.Item,{style:{textAlign:"right"}},m.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(V.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))};function le(_e){var Re=_e.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Re}))}function Le(_e,Re){if(!_e)throw new String("\u6CA1\u6709\u6587\u4EF6");var De=new FormData;De.append("editormd-image-file",_e),De.append("file_param_name","editormd-image-file"),De.append("byxhr","true");var Ze=new window.XMLHttpRequest;Ze.withCredentials=!0,Ze.addEventListener("load",function(dt){Re(JSON.parse(dt.target.responseText),_e)},!1),Ze.addEventListener("error",function(dt){console.error(dt)},!1),Ze.open("POST","".concat(Oe.a,"/api/attachments.json")),Ze.send(De)}var tt=Q("giR+"),nt=Q("fyUT"),lt=Q("7Kak"),Et=Q("9yH6"),Ve=Et.a.Group,Qe={margin:"0 8px"},ut=function(_e){var Re=_e.callback,De=_e.onCancel;function Ze(dt){Re(dt)}return m.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ze},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:Qe},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:Qe},"\u884C\u6570"),m.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(nt.a,null)),m.a.createElement("span",{style:Qe},"\u5217\u6570"),m.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(nt.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:Qe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(U.a.Item,{name:"align"},m.a.createElement(Ve,null,m.a.createElement(Et.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(Et.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(Et.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(Et.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(V.a,{type:"ghost",onClick:De},"\u53D6\u6D88")))},gt=Q("ErOA"),ot=Q("7Cbv"),it="link",rt="upload-image",Pt="code-block",It="add-table",wt="------------",Tt={default:wt,left:":".concat(wt),center:":".concat(wt,":"),right:"".concat(wt,":")},Wt=Q("9VGf"),Ct,bt;function ze(){}var Kt=0,St=1e4,Ke="\u2581",at=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Ce(_e){return/^\d+$/.test(_e)?"".concat(_e,"px"):_e}var Ee=navigator.platform.toUpperCase().indexOf("MAC")>=0,Te=Ee?"Cmd":"Ctrl",ee=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ae=(Ct={},Object(j.a)(Ct,Te+"-B","bold"),Object(j.a)(Ct,Te+"-I","italic"),Ct),de=(bt={},Object(j.a)(bt,it,"\u6DFB\u52A0\u94FE\u63A5"),Object(j.a)(bt,Pt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(j.a)(bt,rt,"\u6DFB\u52A0\u6587\u4EF6"),Object(j.a)(bt,It,"\u6DFB\u52A0\u8868\u683C"),bt),pe=$e.a=function(_e){var Re=_e.defaultValue,De=Re===void 0?"":Re,Ze=_e.onChange,dt=_e.width,ht=dt===void 0?"100%":dt,Ft=_e.height,vt=Ft===void 0?400:Ft,Ge=_e.miniToolbar,en=Ge===void 0?!1:Ge,je=_e.isFocus,un=je===void 0?!1:je,yt=_e.watch,Nt=_e.insertTemp,Gt=_e.mode,on=Gt===void 0?"markdown":Gt,Je=_e.id,xt=Je===void 0?"markdown-editor-id":Je,Ut=_e.showResizeBar,zt=Ut===void 0?!1:Ut,hn=_e.noStorage,Ln=hn===void 0?!1:hn,gn=_e.showNullButton,Jt=gn===void 0?!1:gn,Rt=_e.hidetoolBar,Vn=Rt===void 0?!1:Rt,kn=_e.fullScreen,Cn=kn===void 0?!1:kn,Qt=_e.onBlur,Gn=_e.onCMBeforeChange,ei=_e.onFullScreen,Xn=_e.className,et=Xn===void 0?"":Xn,jt=_e.disablePaste,Wn=jt===void 0?!1:jt,mn=_e.placeholder,sn=mn===void 0?"":mn,Dn=_e.values,K=Dn===void 0?"":Dn,v=Object(y.useState)(null),C=Object(G.a)(v,2),F=C[0],q=C[1],H=Object(y.useState)(De),ue=Object(G.a)(H,2),He=ue[0],Xe=ue[1],At=Object(y.useState)(yt),We=Object(G.a)(At,2),mt=We[0],Zt=We[1],Fn=Object(y.useState)(Cn),Zn=Object(G.a)(Fn,2),fn=Zn[0],Mt=Zn[1],Bt=Object(y.useState)(""),tn=Object(G.a)(Bt,2),nn=tn[0],yn=tn[1],qn=Object(y.useState)(0),ln=Object(G.a)(qn,2),ci=ln[0],cr=ln[1],gr=Object(y.useState)(vt),_r=Object(G.a)(gr,2),Wr=_r[0],fi=_r[1],Di=Object(y.useState)(!1),dr=Object(G.a)(Di,2),Kr=dr[0],Ar=dr[1],ai=Object(y.useRef)(Object(ot.a)()),Pn=Object(y.useRef)(!1),pi=Object(y.useRef)(),pn=Object(y.useRef)(),mi=Object(y.useRef)(),Yn=Object(y.useRef)(),nr=Object(y.useRef)(),Si=function(){var kt=Object(B.a)(I.a.mark(function rn(){var Yt,wn;return I.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ti.next=2,Object(gt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ai.current}});case 2:wn=ti.sent,wn!=null&&(Yt=wn.attachments)!==null&&Yt!==void 0&&Yt.length&&(console.log("cm:",F,pn),wn.attachments.map(function(Nn){Nn.content_type.indexOf("image")>-1?F.replaceSelection(".concat(Nn.content_type,")")):Nn.content_type.indexOf("video")>-1?F.replaceSelection('<video width="100%" controls src="'.concat(l.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Nn.content_type.indexOf("pdf")>-1?F.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Nn.id,"?type=").concat(Nn.content_type,'&disposition=inline" target="_blank">').concat(Nn.name,"</a>")):F.replaceSelection("[".concat(Nn.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Nn.id,"?type=").concat(Nn.content_type,")"))}));case 4:case"end":return ti.stop()}},rn)}));return function(){return kt.apply(this,arguments)}}();Object(y.useEffect)(function(){Xe(K),F==null||F.setValue(K)},[K]),Object(y.useEffect)(function(){ei==null||ei(fn)},[fn]),Object(y.useEffect)(function(){if(pn.current){var kt=c.a.fromTextArea(pn.current,{mode:on,lineNumbers:!en,lineWrapping:!0,value:De,autoCloseTags:!0,autoCloseBrackets:!0});un&&kt.focus();function rn(Yt,wn){if(Wn){wn.preventDefault();return}var jn=wn.clipboardData;if(jn){var ti=jn.types.toString(),Nn=jn.items;if(ti==="Files"||jn.types.indexOf("Files")>-1){if(wn.preventDefault(),on=="stex")return;try{var Ai,rr=Nn[1];((Ai=Nn[0])===null||Ai===void 0?void 0:Ai.kind)==="file"&&(rr=Nn[0]);var An=rr.getAsFile(),Or=An.name.split(".").pop();Le(An,function(Jn){if(Jn.id){var Xi,Gi,vr;(An==null||((Xi=An.type)===null||Xi===void 0)?void 0:Xi.indexOf("image"))>-1?kt.replaceSelection(".concat(Jn.content_type,")")):(An==null||((Gi=An.type)===null||Gi===void 0)?void 0:Gi.indexOf("video"))>-1?kt.replaceSelection('<video width="100%" controls src="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Jn.id,'"></video>')):(An==null||((vr=An.type)===null||vr===void 0)?void 0:vr.indexOf("pdf"))>-1?kt.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Jn.id,"?type=").concat(An.type,'&disposition=inline" target="_blank">').concat(An.name,"</a>")):ee.includes(Or)?kt.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Jn.id,'?type=office&disposition=inline" target="_blank">').concat(An.name,"</a>")):kt.replaceSelection("[".concat(An.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Jn.id,"?type=").concat(Jn.content_type,")"))}else(Jn==null?void 0:Jn.status)===401&&(document.location.href="/user/login")})}catch(Jn){D.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return kt.on("paste",rn),kt.on("dragleave",function(Yt,wn){mi.current.classList.remove("mouse-hover-md")}),kt.on("dragover",function(Yt,wn){mi.current.classList.add("mouse-hover-md")}),kt.on("drop",function(Yt,wn){mi.current.classList.add("mouse-hover-md");var jn;if(jn=wn.dataTransfer.files,jn.length>0){wn.preventDefault(),wn.stopPropagation();for(var ti=function(rr){var An=jn[rr],Or=An.name.split(".").pop();Le(An,function(Jn){if(Jn.id){var Xi,Gi,vr;(An==null||((Xi=An.type)===null||Xi===void 0)?void 0:Xi.indexOf("image"))>-1?kt.replaceSelection(".concat(Jn.content_type,")")):(An==null||((Gi=An.type)===null||Gi===void 0)?void 0:Gi.indexOf("video"))>-1?kt.replaceSelection('<video width="100%" controls src="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Jn.id,'"></video>')):(An==null||((vr=An.type)===null||vr===void 0)?void 0:vr.indexOf("pdf"))>-1?kt.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Jn.id,"?type=").concat(An.type,'&disposition=inline" target="_blank">').concat(An.name,"</a>")):ee.includes(Or)?kt.replaceSelection('<a href="'.concat(l.a.API_SERVER,"/api/attachments/").concat(Jn.id,'?type=office&disposition=inline" target="_blank">').concat(An.name,"</a>")):kt.replaceSelection("[".concat(An.name,"](").concat(l.a.API_SERVER,"/api/attachments/").concat(Jn.id,"?type=").concat(Jn.content_type,")"))}else(Jn==null?void 0:Jn.status)===401&&(document.location.href="/user/login")})},Nn=0;Nn<jn.length;Nn++)ti(Nn)}}),q(kt),function(){kt.off("paste",rn)}}},[]);var Pi=Object(y.useCallback)(function(){if(mi.current)try{}catch(kt){console.log(kt,"---- to set md editor body height")}},[Wr,mi,fn]);Object(y.useEffect)(function(){function kt(){var Yt=new u.default(function(wn){var jn=Object(k.a)(wn),ti;try{for(jn.s();!(ti=jn.n()).done;){var Nn=ti.value;(Nn.target.offsetHeight>0||Nn.target.offsetWidth>0)&&(Pi(),F.setSize("100%","100%"),F.refresh())}}catch(Ai){jn.e(Ai)}finally{jn.f()}});return Yt.observe(pn.current.parentElement),Yt}if(F){var rn=kt();return function(){rn.unobserve(pn.current.parentElement)}}},[F,Pi]),Object(y.useEffect)(function(){if(F){for(var kt=[],rn=function(){var Nn=wn[Yt];jn=Object(G.a)(Nn,2);var Ai=jn[0],rr=jn[1],An=Object(j.a)({},Ai,function(){Gr(rr)});kt.push(An),F.addKeyMap(An)},Yt=0,wn=Object.entries(ae);Yt<wn.length;Yt++){var jn;rn()}return pi.current=setInterval(function(){Pn.current&&Si()},4e3),function(){clearInterval(pi.current);var ti=Object(k.a)(kt),Nn;try{for(ti.s();!(Nn=ti.n()).done;){var Ai=Nn.value;F.removeKeyMap(Ai)}}catch(rr){ti.e(rr)}finally{ti.f()}}}},[F]),Object(y.useEffect)(function(){Cn!==fn&&Mt(Cn)},[Cn]),Object(Wt.a)(function(){if(!Ln&&ci>0){var kt=new Date().getTime(),rn=window.sessionStorage.getItem(xt);kt>=ci+St&&(!rn||rn!==He)&&(window.sessionStorage.setItem(xt,He),Ar(!0))}},St),Object(y.useEffect)(function(){Zt(yt)},[F,yt]),Object(y.useEffect)(function(){F&&(un&&F.focus())},[F,un]),Object(y.useEffect)(function(){if(mt&&F){var kt=F.getScrollerElement();function rn(Yt){var wn=Yt.target;if(nr.current){var jn=wn.scrollTop/wn.scrollHeight;nr.current.scrollTop=nr.current.scrollHeight*jn}}return kt.addEventListener("scroll",rn),function(){kt.removeEventListener("scroll",rn)}}},[F,mt]),Object(y.useEffect)(function(){if(F&&Gn){function kt(rn,Yt){Gn(rn,Yt)}return F.on("beforeChange",kt),function(){F.off("beforeChange",kt)}}},[F,Gn]),Object(y.useEffect)(function(){if(F&&Qt){function kt(){Qt(F.getValue())}return F.on("blur",kt),function(){F.off("blur",kt)}}},[F,Qt]),Object(y.useEffect)(function(){if(F){function kt(rn){var Yt=rn.getValue();Xe(Yt),cr(new Date().getTime()),rn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ze&&Ze(Yt)}return F.on("change",kt),function(){F.off("change",kt)}}},[F,Ze]),Object(y.useEffect)(function(){F&&(De==null?(F.setValue(""),Xe("")):De!==F.getValue()&&(F.setValue(De),Xe(De),F.setCursor(F.lineCount(),0)))},[F,De]);var Gr=Object(y.useCallback)(function(kt){var rn=F.getCursor(),Yt=F.getSelection(),wn=Yt.split(`
|
|
`);switch(kt){case"bold":return F.replaceSelection("**"+Yt+"**"),Yt===""&&F.setCursor(rn.line,rn.ch+2),F.focus();case"italic":return F.replaceSelection("*"+Yt+"*"),Yt===""&&F.setCursor(rn.line,rn.ch+1),F.focus();case"code":return F.replaceSelection("`"+Yt+"`"),Yt===""&&F.setCursor(rn.line,rn.ch+1),F.focus();case"inline-latex":return F.replaceSelection("`$$"+Yt+"$$`"),Yt===""&&F.setCursor(rn.line,rn.ch+3),F.focus();case"latex":return F.replaceSelection("```latex\n"+Yt+"\n```"),F.setCursor(rn.line+1,Yt.length+1),F.focus();case"line-break":return F.replaceSelection(`<br/>
|
|
`),F.focus();case"list-ul":return Yt===""?F.replaceSelection("- "+Yt):F.replaceSelection(wn.map(function(jn){return jn===""?"":"- ".concat(jn)}).join(`
|
|
`)),F.focus();case"list-ol":return Yt===""?F.replaceSelection("1. "+Yt):F.replaceSelection(wn.map(function(jn,ti){return jn===""?"":"".concat(ti+1,". ").concat(jn)}).join(`
|
|
`)),F.focus();case"add-null-ch":return Yt===""&&F.setCursor(rn.line,rn.ch+1),F.replaceSelection(Ke),F.focus();case"inster-template-1":return Yt===""&&F.setCursor(rn.line,rn.ch),F.replaceSelection(at),F.focus();case"eraser":return F.setValue(""),F.focus();case"trigger-watch":return Zt(!mt),F.focus();case"trigger-full-screen":return Mt(!fn),F.focus();case it:yn(it);return;case Pt:yn(Pt);return;case rt:yn(rt);return;case It:yn(It);return;default:throw new Error}},[F,mt,fn]),Qi=Object(y.useCallback)(function(kt){yn("");switch(nn){case it:var rn=kt.title,Yt=kt.link;return F.replaceSelection("[".concat(rn,"](").concat(Yt,")")),F.focus();case Pt:var wn=kt.language,jn=kt.content;return F.replaceSelection(["```"+wn,jn,"```"].join(`
|
|
`)),F.focus();case rt:var ti=kt.src,Nn=kt.alt;return Nn?F.replaceSelection(".concat(ti,' "').concat(Nn,'" )')):F.replaceSelection("")),F.focus();case It:for(var Ai=kt.row,rr=kt.col,An=kt.align,Or=`
|
|
`,Jn=0;Jn<Ai;Jn++){for(var Xi=[],Gi=[],vr=0;vr<rr;vr++)Jn===1&&Gi.push(Tt[An]),Xi.push(" ");Jn===1&&(Or+="| ".concat(Gi.join(" | "),` |
|
|
`)),Or+="| ".concat(Xi.join(rr===1?"":" | "),` |
|
|
`)}return F.replaceSelection(Or+`
|
|
`),F.focus();default:throw new Error}},[F,nn]),Sr=Object(y.useMemo)(function(){switch(nn){case it:return m.a.createElement(oe,{callback:Qi,onCancel:ir});case Pt:return m.a.createElement(fe.b,{callback:Qi,onCancel:ir});case rt:return m.a.createElement(be,{callback:Qi,onCancel:ir});case It:return m.a.createElement(ut,{callback:Qi,onCancel:ir});default:return null}},[nn]);function ir(){yn("")}Object(y.useEffect)(function(){if(Yn.current){var kt=Yn.current,rn=!1,Yt=0;function wn(Nn){rn=!0,Yt=Nn.pageY}function jn(){rn=!1}function ti(Nn){if(rn){var Ai=Nn.pageY-Yt;Ai<0&&(Ai=0),Ai>300&&(Ai=300);var rr=vt+Ai+"px";fi(rr)}}return kt.addEventListener("mousedown",wn),document.addEventListener("mousemove",ti),document.addEventListener("mouseup",jn),function(){kt.removeEventListener("mousedown",wn),document.removeEventListener("mousemove",ti),document.removeEventListener("mouseup",jn)}}},[F,Yn]),Object(y.useEffect)(function(){fi(vt)},[vt]);var Zi=Ce(ht),zr=Ce(Wr),gi={width:Zi,height:zr},Kn=Object(y.useMemo)(function(){if(ci){var kt=new Date(ci),rn=kt.getHours(),Yt=kt.getMinutes(),wn=kt.getSeconds();return rn=rn<10?"0"+rn:rn,Yt=Yt<10?"0"+Yt:Yt,wn=wn<10?"0"+wn:wn,"".concat(rn,":").concat(Yt,":").concat(wn)}return 0},[ci]);function Ci(){window.sessionStorage.removeItem(xt),Ar(!1),cr(0)}function Ti(){Ar(!1),cr(0),F.setValue(window.sessionStorage.getItem(xt))}function qi(kt,rn){var Yt=F.getValue();Yt=Yt.replace(kt,rn),Xe(Yt),F==null||F.setValue(Yt)}return m.a.createElement(y.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:mi},m.a.createElement("div",{className:"markdown-editor-container ".concat(et," ").concat(mt?"on-preview":""," ").concat(en?"mini":""," ").concat(fn?"full-screen":""),style:gi},m.a.createElement(g,{insertTemp:Nt,watch:mt,fullScreen:fn,showNullButton:Jt,onActionCallback:Gr,hidetoolBar:Vn,uuid:ai.current,setOpenPhones:function(){Pn.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:pn,placeholder:sn})),mt?m.a.createElement("div",{ref:nr,className:"preview-container"},on==="stex"&&m.a.createElement(R,{value:He}),on!=="stex"&&m.a.createElement(x.a,{edit:!0,value:He,replaces:qi})):null))),zt?m.a.createElement("a",{ref:Yn,className:"editor-resize"}):null,m.a.createElement(T.a,null,de[nn]?m.a.createElement(W.a,{centered:!0,title:de[nn],visible:!0,onCancel:ir,footer:null,className:"markdown-popup-form"},Sr):null))}},SJMd:function(ct,$e){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var Q,se,W,k=!1,X,D;window.PR_SHOULD_USE_CONTINUATION=!0;var B,G;(function(){var j=window,P=["break,continue,do,else,for,if,return,while"],I=[P,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],y=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[y,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],p=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[y,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],u="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",r=[P,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],a=[P,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],d=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],L=[m,c,p,f,s,r,a,d],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",R="kwd",O="com",w="typ",E="lit",b="pun",l="pln",_="tag",h="dec",g="src",T="atn",N="atv",V="nocode",Y="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(Ve){for(var Qe=0,ut=!1,gt=!1,ot=0,it=Ve.length;ot<it;++ot){var rt=Ve[ot];if(rt.ignoreCase)gt=!0;else if(/[a-z]/i.test(rt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ut=!0,gt=!1;break}}var Pt={b:8,t:9,n:10,v:11,f:12,r:13};function It(bt){var ze=bt.charCodeAt(0);if(ze!==92)return ze;var Kt=bt.charAt(1);return ze=Pt[Kt],ze||("0"<=Kt&&Kt<="7"?parseInt(bt.substring(1),8):Kt==="u"||Kt==="x"?parseInt(bt.substring(2),16):bt.charCodeAt(1))}function wt(bt){if(bt<32)return(bt<16?"\\x0":"\\x")+bt.toString(16);var ze=String.fromCharCode(bt);return ze==="\\"||ze==="-"||ze==="]"||ze==="^"?"\\"+ze:ze}function Tt(bt){var ze=bt.substring(1,bt.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Kt=[],St=ze[0]==="^",Ke=["["];St&&Ke.push("^");for(var at=St?1:0,Ce=ze.length;at<Ce;++at){var Ee=ze[at];if(/\\[bdsw]/i.test(Ee))Ke.push(Ee);else{var Te=It(Ee),ee;at+2<Ce&&ze[at+1]==="-"?(ee=It(ze[at+2]),at+=2):ee=Te,Kt.push([Te,ee]),ee<65||Te>122||(ee<65||Te>90||Kt.push([Math.max(65,Te)|32,Math.min(ee,90)|32]),ee<97||Te>122||Kt.push([Math.max(97,Te)&~32,Math.min(ee,122)&~32]))}}Kt.sort(function(_e,Re){return _e[0]-Re[0]||Re[1]-_e[1]});for(var ae=[],de=[],at=0;at<Kt.length;++at){var pe=Kt[at];pe[0]<=de[1]+1?de[1]=Math.max(de[1],pe[1]):ae.push(de=pe)}for(var at=0;at<ae.length;++at){var pe=ae[at];Ke.push(wt(pe[0])),pe[1]>pe[0]&&(pe[1]+1>pe[0]&&Ke.push("-"),Ke.push(wt(pe[1])))}return Ke.push("]"),Ke.join("")}function Wt(bt){for(var ze=bt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Kt=ze.length,St=[],Ke=0,at=0;Ke<Kt;++Ke){var Ce=ze[Ke];if(Ce==="(")++at;else if(Ce.charAt(0)==="\\"){var Ee=+Ce.substring(1);Ee&&(Ee<=at?St[Ee]=-1:ze[Ke]=wt(Ee))}}for(var Ke=1;Ke<St.length;++Ke)St[Ke]===-1&&(St[Ke]=++Qe);for(var Ke=0,at=0;Ke<Kt;++Ke){var Ce=ze[Ke];if(Ce==="(")++at,St[at]||(ze[Ke]="(?:");else if(Ce.charAt(0)==="\\"){var Ee=+Ce.substring(1);Ee&&Ee<=at&&(ze[Ke]="\\"+St[Ee])}}for(var Ke=0;Ke<Kt;++Ke)ze[Ke]==="^"&&ze[Ke+1]!=="^"&&(ze[Ke]="");if(bt.ignoreCase&&ut)for(var Ke=0;Ke<Kt;++Ke){var Ce=ze[Ke],Te=Ce.charAt(0);Ce.length>=2&&Te==="["?ze[Ke]=Tt(Ce):Te!=="\\"&&(ze[Ke]=Ce.replace(/[a-zA-Z]/g,function(de){var pe=de.charCodeAt(0);return"["+String.fromCharCode(pe&~32,pe|32)+"]"}))}return ze.join("")}for(var Ct=[],ot=0,it=Ve.length;ot<it;++ot){var rt=Ve[ot];if(rt.global||rt.multiline)throw new Error(""+rt);Ct.push("(?:"+Wt(rt)+")")}return new RegExp(Ct.join("|"),gt?"gi":"g")}function A(Ve,Qe){var ut=/(?:^|\s)nocode(?:\s|$)/,gt=[],ot=0,it=[],rt=0;function Pt(It){var wt=It.nodeType;if(wt==1){if(ut.test(It.className))return;for(var Tt=It.firstChild;Tt;Tt=Tt.nextSibling)Pt(Tt);var Wt=It.nodeName.toLowerCase();(Wt==="br"||Wt==="li")&&(gt[rt]=`
|
|
`,it[rt<<1]=ot++,it[rt++<<1|1]=It)}else if(wt==3||wt==4){var Ct=It.nodeValue;Ct.length&&(Qe?Ct=Ct.replace(/\r\n?/g,`
|
|
`):Ct=Ct.replace(/[ \t\r\n]+/g," "),gt[rt]=Ct,it[rt<<1]=ot,ot+=Ct.length,it[rt++<<1|1]=It)}}return Pt(Ve),{sourceCode:gt.join("").replace(/\n$/,""),spans:it}}function J(Ve,Qe,ut,gt,ot){if(!ut)return;var it={sourceNode:Ve,pre:1,langExtension:null,numberLines:null,sourceCode:ut,spans:null,basePos:Qe,decorations:null};gt(it),ot.push.apply(ot,it.decorations)}var ne=/\S/;function oe(Ve){for(var Qe=void 0,ut=Ve.firstChild;ut;ut=ut.nextSibling){var gt=ut.nodeType;Qe=gt===1?Qe?Ve:ut:gt===3&&ne.test(ut.nodeValue)?Ve:Qe}return Qe===Ve?void 0:Qe}function fe(Ve,Qe){var ut={},gt;(function(){for(var rt=Ve.concat(Qe),Pt=[],It={},wt=0,Tt=rt.length;wt<Tt;++wt){var Wt=rt[wt],Ct=Wt[3];if(Ct)for(var bt=Ct.length;--bt>=0;)ut[Ct.charAt(bt)]=Wt;var ze=Wt[1],Kt=""+ze;It.hasOwnProperty(Kt)||(Pt.push(ze),It[Kt]=null)}Pt.push(/[\0-\uffff]/),gt=U(Pt)})();var ot=Qe.length,it=function(rt){for(var Pt=rt.sourceCode,It=rt.basePos,wt=rt.sourceNode,Tt=[It,l],Wt=0,Ct=Pt.match(gt)||[],bt={},ze=0,Kt=Ct.length;ze<Kt;++ze){var St=Ct[ze],Ke=bt[St],at=void 0,Ce;if(typeof Ke=="string")Ce=!1;else{var Ee=ut[St.charAt(0)];if(Ee)at=St.match(Ee[1]),Ke=Ee[0];else{for(var Te=0;Te<ot;++Te)if(Ee=Qe[Te],at=St.match(Ee[1]),at){Ke=Ee[0];break}at||(Ke=l)}Ce=Ke.length>=5&&Ke.substring(0,5)==="lang-",Ce&&!(at&&typeof at[1]=="string")&&(Ce=!1,Ke=g),Ce||(bt[St]=Ke)}var ee=Wt;if(Wt+=St.length,!Ce)Tt.push(It+ee,Ke);else{var ae=at[1],de=St.indexOf(ae),pe=de+ae.length;at[2]&&(pe=St.length-at[2].length,de=pe-ae.length);var _e=Ke.substring(5);J(wt,It+ee,St.substring(0,de),it,Tt),J(wt,It+ee+de,ae,le(_e,ae),Tt),J(wt,It+ee+pe,St.substring(pe),it,Tt)}}rt.decorations=Tt};return it}function ke(Ve){var Qe=[],ut=[];Ve.tripleQuotedStrings?Qe.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ve.multiLineStrings?Qe.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Qe.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ve.verbatimStrings&&ut.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var gt=Ve.hashComments;gt&&(Ve.cStyleComments?(gt>1?Qe.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Qe.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ut.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Qe.push([O,/^#[^\r\n]*/,null,"#"])),Ve.cStyleComments&&(ut.push([O,/^\/\/[^\r\n]*/,null]),ut.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ot=Ve.regexLiterals;if(ot){var it=ot>1?"":`
|
|
\r`,rt=it?".":"[\\S\\s]",Pt="/(?=[^/*"+it+"])(?:[^/\\x5B\\x5C"+it+"]|\\x5C"+rt+"|\\x5B(?:[^\\x5C\\x5D"+it+"]|\\x5C"+rt+")*(?:\\x5D|$))+/";ut.push(["lang-regex",RegExp("^"+Y+"("+Pt+")")])}var It=Ve.types;It&&ut.push([w,It]);var wt=(""+Ve.keywords).replace(/^ | $/g,"");wt.length&&ut.push([R,new RegExp("^(?:"+wt.replace(/[\s,]+/g,"|")+")\\b"),null]),Qe.push([l,/^\s+/,null,` \r
|
|
\xA0`]);var Tt="^.[^\\s\\w.$@'\"`/\\\\]*";return Ve.regexLiterals&&(Tt+="(?!s*/)"),ut.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[w,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[l,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[l,/^\\[\s\S]?/,null],[b,new RegExp(Tt),null]),fe(Qe,ut)}var Oe=ke({keywords:L,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Me(Ve,Qe,ut){for(var gt=/(?:^|\s)nocode(?:\s|$)/,ot=/\r\n?|\n/,it=Ve.ownerDocument,rt=it.createElement("li");Ve.firstChild;)rt.appendChild(Ve.firstChild);var Pt=[rt];function It(ze){var Kt=ze.nodeType;if(Kt==1&&!gt.test(ze.className))if(ze.nodeName==="br")wt(ze),ze.parentNode&&ze.parentNode.removeChild(ze);else for(var St=ze.firstChild;St;St=St.nextSibling)It(St);else if((Kt==3||Kt==4)&&ut){var Ke=ze.nodeValue,at=Ke.match(ot);if(at){var Ce=Ke.substring(0,at.index);ze.nodeValue=Ce;var Ee=Ke.substring(at.index+at[0].length);if(Ee){var Te=ze.parentNode;Te.insertBefore(it.createTextNode(Ee),ze.nextSibling)}wt(ze),Ce||ze.parentNode.removeChild(ze)}}}function wt(ze){for(;!ze.nextSibling;)if(ze=ze.parentNode,!ze)return;function Kt(at,Ce){var Ee=Ce?at.cloneNode(!1):at,Te=at.parentNode;if(Te){var ee=Kt(Te,1),ae=at.nextSibling;ee.appendChild(Ee);for(var de=ae;de;de=ae)ae=de.nextSibling,ee.appendChild(de)}return Ee}for(var St=Kt(ze.nextSibling,0),Ke;(Ke=St.parentNode)&&Ke.nodeType===1;)St=Ke;Pt.push(St)}for(var Tt=0;Tt<Pt.length;++Tt)It(Pt[Tt]);Qe===(Qe|0)&&Pt[0].setAttribute("value",Qe);var Wt=it.createElement("ol");Wt.className="linenums";for(var Ct=Math.max(0,Qe-1|0)||0,Tt=0,bt=Pt.length;Tt<bt;++Tt)rt=Pt[Tt],rt.className="L"+(Tt+Ct)%10,rt.firstChild||rt.appendChild(it.createTextNode("\xA0")),Wt.appendChild(rt);Ve.appendChild(Wt)}function Be(Ve){var Qe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Qe=Qe&&+Qe[1]<=8;var ut=/\n/g,gt=Ve.sourceCode,ot=gt.length,it=0,rt=Ve.spans,Pt=rt.length,It=0,wt=Ve.decorations,Tt=wt.length,Wt=0;wt[Tt]=ot;var Ct,bt;for(bt=Ct=0;bt<Tt;)wt[bt]!==wt[bt+2]?(wt[Ct++]=wt[bt++],wt[Ct++]=wt[bt++]):bt+=2;for(Tt=Ct,bt=Ct=0;bt<Tt;){for(var ze=wt[bt],Kt=wt[bt+1],St=bt+2;St+2<=Tt&&wt[St+1]===Kt;)St+=2;wt[Ct++]=ze,wt[Ct++]=Kt,bt=St}Tt=wt.length=Ct;var Ke=Ve.sourceNode,at="";Ke&&(at=Ke.style.display,Ke.style.display="none");try{for(var Ce=null;It<Pt;){var Ee=rt[It],Te=rt[It+2]||ot,ee=wt[Wt+2]||ot,St=Math.min(Te,ee),ae=rt[It+1],de;if(ae.nodeType!==1&&(de=gt.substring(it,St))){Qe&&(de=de.replace(ut,"\r")),ae.nodeValue=de;var pe=ae.ownerDocument,_e=pe.createElement("span");_e.className=wt[Wt+1];var Re=ae.parentNode;Re.replaceChild(_e,ae),_e.appendChild(ae),it<Te&&(rt[It+1]=ae=pe.createTextNode(gt.substring(St,Te)),Re.insertBefore(ae,_e.nextSibling))}it=St,it>=Te&&(It+=2),it>=ee&&(Wt+=2)}}finally{Ke&&(Ke.style.display=at)}}var Pe={};function be(Ve,Qe){for(var ut=Qe.length;--ut>=0;){var gt=Qe[ut];Pe.hasOwnProperty(gt)?j.console&&console.warn("cannot override language handler %s",gt):Pe[gt]=Ve}}function le(Ve,Qe){return Ve&&Pe.hasOwnProperty(Ve)||(Ve=/^\s*</.test(Qe)?"default-markup":"default-code"),Pe[Ve]}be(Oe,["default-code"]),be(fe([],[[l,/^[^<?]+/],[h,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[b,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),be(fe([[l,/^[\s]+/,null,` \r
|
|
`],[N,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[T,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[b,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),be(fe([],[[N,/^[\s\S]+/]]),["uq.val"]),be(ke({keywords:m,hashComments:!0,cStyleComments:!0,types:S}),["c","cc","cpp","cxx","cyc","m"]),be(ke({keywords:"null,true,false"}),["json"]),be(ke({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),["cs"]),be(ke({keywords:p,cStyleComments:!0}),["java"]),be(ke({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),be(ke({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),be(ke({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),be(ke({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),be(ke({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),be(ke({keywords:u,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),be(fe([],[[x,/^[\s\S]+/]]),["regex"]);function Le(Ve){var Qe=Ve.langExtension;try{var ut=A(Ve.sourceNode,Ve.pre),gt=ut.sourceCode;Ve.sourceCode=gt,Ve.spans=ut.spans,Ve.basePos=0,le(Qe,gt)(Ve),Be(Ve)}catch(ot){j.console&&console.log(ot&&ot.stack||ot)}}function tt(Ve,Qe,ut){var gt=ut||!1,ot=Qe||null,it=document.createElement("div");it.innerHTML="<pre>"+Ve+"</pre>",it=it.firstChild,gt&&Me(it,gt,!0);var rt={langExtension:ot,numberLines:gt,sourceNode:it,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Le(rt),it.innerHTML}function nt(Ve,Qe){var ut=Qe||document.body,gt=ut.ownerDocument||document;function ot(Ee){return ut.getElementsByTagName(Ee)}for(var it=[ot("pre"),ot("code"),ot("xmp")],rt=[],Pt=0;Pt<it.length;++Pt)for(var It=0,wt=it[Pt].length;It<wt;++It)rt.push(it[Pt][It]);it=null;var Tt=Date;Tt.now||(Tt={now:function(){return+new Date}});var Wt=0,Ct=/\blang(?:uage)?-([\w.]+)(?!\S)/,bt=/\bprettyprint\b/,ze=/\bprettyprinted\b/,Kt=/pre|xmp/i,St=/^code$/i,Ke=/^(?:pre|code|xmp)$/i,at={};function Ce(){for(var Ee=j.PR_SHOULD_USE_CONTINUATION?Tt.now()+250:Infinity;Wt<rt.length&&Tt.now()<Ee;Wt++){for(var Te=rt[Wt],ee=at,ae=Te;ae=ae.previousSibling;){var de=ae.nodeType,pe=(de===7||de===8)&&ae.nodeValue;if(pe?!/^\??prettify\b/.test(pe):de!==3||/\S/.test(ae.nodeValue))break;if(pe){ee={},pe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(yt,Nt,Gt){ee[Nt]=Gt});break}}var _e=Te.className;if((ee!==at||bt.test(_e))&&!ze.test(_e)){for(var Re=!1,De=Te.parentNode;De;De=De.parentNode){var Ze=De.tagName;if(Ke.test(Ze)&&De.className&&bt.test(De.className)){Re=!0;break}}if(!Re){Te.className+=" prettyprinted";var dt=ee.lang;if(!dt){dt=_e.match(Ct);var ht;!dt&&(ht=oe(Te))&&St.test(ht.tagName)&&(dt=ht.className.match(Ct)),dt&&(dt=dt[1])}var Ft;if(Kt.test(Te.tagName))Ft=1;else{var vt=Te.currentStyle,Ge=gt.defaultView,en=vt?vt.whiteSpace:Ge&&Ge.getComputedStyle?Ge.getComputedStyle(Te,null).getPropertyValue("white-space"):0;Ft=en&&en.substring(0,3)==="pre"}var je=ee.linenums;(je=je==="true"||+je)||(je=_e.match(/\blinenums\b(?::(\d+))?/),je=je?je[1]&&je[1].length?+je[1]:!0:!1),je&&Me(Te,je,Ft);var un={langExtension:dt,sourceNode:Te,numberLines:je,pre:Ft,sourceCode:null,basePos:null,spans:null,decorations:null};Le(un)}}}Wt<rt.length?j.setTimeout(Ce,250):typeof Ve=="function"&&Ve()}Ce()}var lt=j.PR={createSimpleLexer:fe,registerLangHandler:be,sourceDecorator:ke,PR_ATTRIB_NAME:T,PR_ATTRIB_VALUE:N,PR_COMMENT:O,PR_DECLARATION:h,PR_KEYWORD:R,PR_LITERAL:E,PR_NOCODE:V,PR_PLAIN:l,PR_PUNCTUATION:b,PR_SOURCE:g,PR_STRING:x,PR_TAG:_,PR_TYPE:w,prettyPrintOne:k?j.prettyPrintOne=tt:B=tt,prettyPrint:G=k?j.prettyPrint=nt:G=nt},Et=j.define;typeof Et=="function"&&Et.amd&&Et("google-code-prettify",[],function(){return lt})})()},TXwP:function(ct,$e,Q){var se,W;(function(){var k;(function(){"use strict";var D=[,,function(P){function I(p){this.__parent=p,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}I.prototype.clone_empty=function(){var p=new I(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},I.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},I.prototype.has_match=function(p){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(p))return!0;return!1},I.prototype.set_indent=function(p,c){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(p){this.__items.push(p);var c=p.lastIndexOf(`
|
|
`);c!==-1?this.__character_count=p.length-c:this.__character_count+=p.length},I.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function y(p,c){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),c=c||"",p.indent_level>0&&(c=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}y.prototype.get_indent_size=function(p,c){var u=this.__base_string_length;return c=c||0,p<0&&(u=0),u+=p*this.__indent_size,u+=c,u},y.prototype.get_indent_string=function(p,c){var u=this.__base_string;return c=c||0,p<0&&(p=0,u=""),c+=p*this.__indent_size,this.__ensure_cache(c),u+=this.__cache[c],u},y.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var p=this.__cache.length,c=0,u="";this.__indent_size&&p>=this.__indent_size&&(c=Math.floor(p/this.__indent_size),p-=c*this.__indent_size,u=new Array(c+1).join(this.__indent_string)),p&&(u+=new Array(p+1).join(" ")),this.__cache.push(u)};function m(p,c){this.__indent_cache=new y(p,c),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(p,c){return this.__indent_cache.get_indent_string(p,c)},m.prototype.get_indent_size=function(p,c){return this.__indent_cache.get_indent_size(p,c)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(p){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
|
|
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var u=this.__lines.join(`
|
|
`);return p!==`
|
|
`&&(u=u.replace(/[\n]/g,p)),u},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(p,c){return p=p||0,c=c||0,this.next_line.set_indent(p,c),this.__lines.length>1?(this.current_line.set_indent(p,c),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(p){for(var c=0;c<p.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},m.prototype.remove_indent=function(p){for(var c=this.__lines.length;p<c;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(p,c){for(var u=this.__lines.length-2;u>=0;){var f=this.__lines[u];if(f.is_empty())break;if(f.item(0).indexOf(p)!==0&&f.item(-1)!==c){this.__lines.splice(u+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},P.exports.Output=m},,,,function(P){function I(p,c){this.raw_options=y(p,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}I.prototype._get_array=function(p,c){var u=this.raw_options[p],f=c||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(f=u.concat()):typeof u=="string"&&(f=u.split(/[^a-zA-Z0-9_\/\-]+/)),f},I.prototype._get_boolean=function(p,c){var u=this.raw_options[p],f=u===void 0?!!c:!!u;return f},I.prototype._get_characters=function(p,c){var u=this.raw_options[p],f=c||"";return typeof u=="string"&&(f=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),f},I.prototype._get_number=function(p,c){var u=this.raw_options[p];c=parseInt(c,10),isNaN(c)&&(c=0);var f=parseInt(u,10);return isNaN(f)&&(f=c),f},I.prototype._get_selection=function(p,c,u){var f=this._get_selection_list(p,c,u);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f[0]},I.prototype._get_selection_list=function(p,c,u){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[c[0]],!this._is_valid_selection(u,c))throw new Error("Invalid Default Value!");var f=this._get_array(p,u);if(!this._is_valid_selection(f,c))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
|
|
`+c+`
|
|
You passed in: '`+this.raw_options[p]+"'");return f},I.prototype._is_valid_selection=function(p,c){return p.length&&c.length&&!p.some(function(u){return c.indexOf(u)===-1})};function y(p,c){var u={};p=m(p);var f;for(f in p)f!==c&&(u[f]=p[f]);if(c&&p[c])for(f in p[c])u[f]=p[c][f];return u}function m(p){var c={},u;for(u in p){var f=u.replace(/-/g,"_");c[f]=p[u]}return c}P.exports.Options=I,P.exports.normalizeOpts=m,P.exports.mergeOpts=y},,function(P){var I=RegExp.prototype.hasOwnProperty("sticky");function y(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},y.prototype.peek=function(m){var p=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(p=this.__input.charAt(m)),p},y.prototype.__match=function(m,p){m.lastIndex=p;var c=m.exec(this.__input);return c&&!(I&&m.sticky)&&(c.index!==p&&(c=null)),c},y.prototype.test=function(m,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(m,p):!1},y.prototype.testChar=function(m,p){var c=this.peek(p);return m.lastIndex=0,c!==null&&m.test(c)},y.prototype.match=function(m){var p=this.__match(m,this.__position);return p?this.__position+=p[0].length:p=null,p},y.prototype.read=function(m,p,c){var u="",f;return m&&(f=this.match(m),f&&(u+=f[0])),p&&(f||!m)&&(u+=this.readUntil(p,c)),u},y.prototype.readUntil=function(m,p){var c="",u=this.__position;m.lastIndex=this.__position;var f=m.exec(this.__input);return f?(u=f.index,p&&(u+=f[0].length)):u=this.__input_length,c=this.__input.substring(this.__position,u),this.__position=u,c},y.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},y.prototype.get_regexp=function(m,p){var c=null,u="g";return p&&I&&(u="y"),typeof m=="string"&&m!==""?c=new RegExp(m,u):m&&(c=new RegExp(m.source,u)),c},y.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(m){var p=this.__position,c=this.readUntilAfter(m);return this.__position=p,c},y.prototype.lookBack=function(m){var p=this.__position-1;return p>=m.length&&this.__input.substring(p-m.length,p).toLowerCase()===m},P.exports.InputScanner=y},,,,,function(P){function I(y,m){y=typeof y=="string"?y:y.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+m,"g")}I.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(y);p;)m[p[1]]=p[2],p=this.__directive_pattern.exec(y);return m},I.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},P.exports.Directives=I},,function(P,I,y){var m=y(16).Beautifier,p=y(17).Options;function c(u,f){var s=new m(u,f);return s.beautify()}P.exports=c,P.exports.defaultOptions=function(){return new p}},function(P,I,y){var m=y(17).Options,p=y(2).Output,c=y(8).InputScanner,u=y(13).Directives,f=new u(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,a=/\s/,d=/(?:\s|\n)+/g,L=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,S=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(R,O){this._source_text=R||"",this._options=new m(O),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}x.prototype.eatString=function(R){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return O},x.prototype.eatWhitespace=function(R){for(var O=a.test(this._input.peek()),w=0;a.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
|
|
`&&((w===0||w<this._options.max_preserve_newlines)&&(w++,this._output.add_new_line(!0)));return O},x.prototype.foundNestedPseudoClass=function(){for(var R=0,O=1,w=this._input.peek(O);w;){if(w==="{")return!0;if(w==="(")R+=1;else if(w===")"){if(R===0)return!1;R-=1}else if(w===";"||w==="}")return!1;O++,w=this._input.peek(O)}return!1},x.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},x.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},x.prototype.indent=function(){this._indentLevel++},x.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,O=this._options.eol;O==="auto"&&(O=`
|
|
`,R&&s.test(R||"")&&(O=R.match(s)[0])),R=R.replace(r,`
|
|
`);var w=R.match(/^[\t ]*/)[0];this._output=new p(this._options,w),this._input=new c(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var E=0,b=!1,l=!1,_=!1,h=!1,g=!1,T=!1,N=this._ch,V=!1,Y,U,A;Y=this._input.read(d),U=Y!=="",A=N,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),N=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var J=this._input.read(L),ne=f.get_directives(J);ne&&ne.ignore==="start"&&(J+=f.readIgnored(this._input)),this.print_string(J),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(S)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var oe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);oe.match(/[ :]$/)&&(oe=this.eatString(": ").replace(/\s$/,""),this.print_string(oe),this._output.space_before_token=!0),oe=oe.replace(/\s$/,""),oe==="extend"?h=!0:oe==="import"&&(g=!0),oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,oe in this.CONDITIONAL_GROUP_RULE&&(_=!0)):!b&&E===0&&oe.indexOf(":")!==-1&&(l=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")l&&(l=!1,this.outdent()),_?(_=!1,b=this._indentLevel>=this._nestedLevel):b=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&b&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(A==="("?this._output.space_before_token=!1:A!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),A==="{"&&this._output.trim(!0),g=!1,h=!1,l&&(this.outdent(),l=!1),this.print_string(this._ch),b=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var fe=0;fe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;fe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[fe])){V=!0;break}(b||_)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!h&&E===0?(this.print_string(":"),l||(l=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ke=A==='"'||A==="'";this.preserveSingleSpace(ke||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")V=!1,E===0?(l&&(this.outdent(),l=!1),h=!1,g=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),E++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),E&&(E--,this.outdent()));else{var Oe=!1;this._input.lookBack("with")&&(Oe=!0),this.preserveSingleSpace(U||Oe),this.print_string(this._ch),l&&A==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),T=!0):(this.eatWhitespace(),E++,this.indent())}else if(this._ch===")")E&&(E--,this.outdent()),T&&this._input.peek()===";"&&this._options.selector_separator_newline&&(T=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!l||T)&&E===0&&!g&&!h?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!l&&E===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&a.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),a.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Me=A==='"'||A==="'";this.preserveSingleSpace(Me||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&V&&this._output.add_new_line()}var Be=this._output.get_code(O);return Be},P.exports.Beautifier=x},function(P,I,y){var m=y(6).Options;function p(c){m.call(this,c,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var u=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||u;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<f.length;s++)f[s]!=="expand"?this.brace_style="collapse":this.brace_style=f[s]}p.prototype=new m,P.exports.Options=p}],B={};function G(P){var I=B[P];if(I!==void 0)return I.exports;var y=B[P]={exports:{}};return D[P](y,y.exports,G),y.exports}var j=G(15);k=j})();var X=k;!(se=[],W=function(){return{css_beautify:X}}.apply($e,se),W!==void 0&&(ct.exports=W))})()},UU91:function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___W-luD",flex_space_between:"flex_space_between___MDZOl",flex_box_vertical_center:"flex_box_vertical_center___GF3w8",flex_box_center_end:"flex_box_center_end___UZLKo",flex_box_column:"flex_box_column___26ZEG",bg:"bg___Lrg3h",containerTitle:"containerTitle___36aFc",containerDesc:"containerDesc___1ITIo",listItem:"listItem___3yIgk",info:"info___1J349",title:"title___1poFp",titleLeft:"titleLeft___1G4yJ",titleRight:"titleRight___3ZAtk",acitons:"acitons___rsUze",export:"export___23Ina"}},"VrN/":function(ct,$e,Q){(function(se,W){ct.exports=W()})(this,function(){"use strict";var se=navigator.userAgent,W=navigator.platform,k=/gecko\/\d/i.test(se),X=/MSIE \d/.test(se),D=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(se),B=/Edge\/(\d+)/.exec(se),G=X||D||B,j=G&&(X?document.documentMode||6:+(B||D)[1]),P=!B&&/WebKit\//.test(se),I=P&&/Qt\/\d+\.\d+/.test(se),y=!B&&/Chrome\//.test(se),m=/Opera\//.test(se),p=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(se),u=/PhantomJS/.test(se),f=!B&&/AppleWebKit/.test(se)&&/Mobile\/\w+/.test(se),s=/Android/.test(se),r=f||s||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(se),a=f||/Mac/.test(W),d=/\bCrOS\b/.test(se),L=/win/i.test(W),S=m&&se.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(m=!1,P=!0);var x=a&&(I||m&&(S==null||S<12.11)),R=k||G&&j>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var w=function(e,t){var i=e.className,n=O(t).exec(i);if(n){var o=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(o?n[1]+o:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function b(e,t){return E(e).appendChild(t)}function l(e,t,i,n){var o=document.createElement(e);if(i&&(o.className=i),n&&(o.style.cssText=n),typeof t=="string")o.appendChild(document.createTextNode(t));else if(t)for(var M=0;M<t.length;++M)o.appendChild(t[M]);return o}function _(e,t,i,n){var o=l(e,t,i,n);return o.setAttribute("role","presentation"),o}var h;document.createRange?h=function(e,t,i,n){var o=document.createRange();return o.setEnd(n||e,i),o.setStart(e,t),o}:h=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(o){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function g(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function T(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function N(e,t){var i=e.className;O(t).test(i)||(e.className+=(i?" ":"")+t)}function V(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!O(i[n]).test(t)&&(t+=" "+i[n]);return t}var Y=function(e){e.select()};f?Y=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(Y=function(e){try{e.select()}catch(t){}});function U(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function A(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function J(e,t,i,n,o){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var M=n||0,z=o||0;;){var Z=e.indexOf(" ",M);if(Z<0||Z>=t)return z+(t-M);z+=Z-M,z+=i-z%i,M=Z+1}}var ne=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};ne.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ne.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function oe(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var fe=50,ke={toString:function(){return"CodeMirror.Pass"}},Oe={scroll:!1},Me={origin:"*mouse"},Be={origin:"+move"};function Pe(e,t,i){for(var n=0,o=0;;){var M=e.indexOf(" ",n);M==-1&&(M=e.length);var z=M-n;if(M==e.length||o+z>=t)return n+Math.min(z,t-o);if(o+=M-n,o+=i-o%i,n=M+1,o>=t)return n}}var be=[""];function le(e){for(;be.length<=e;)be.push(Le(be)+" ");return be[e]}function Le(e){return e[e.length-1]}function tt(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function nt(e,t,i){for(var n=0,o=i(t);n<e.length&&i(e[n])<=o;)n++;e.splice(n,0,t)}function lt(){}function Et(e,t){var i;return Object.create?i=Object.create(e):(lt.prototype=e,i=new lt),t&&A(t,i),i}var Ve=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Qe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ve.test(e))}function ut(e,t){return t?t.source.indexOf("\\w")>-1&&Qe(e)?!0:t.test(e):Qe(e)}function gt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ot=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function it(e){return e.charCodeAt(0)>=768&&ot.test(e)}function rt(e,t,i){for(;(i<0?t>0:t<e.length)&&it(e.charAt(t));)t+=i;return t}function Pt(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var o=(t+i)/2,M=n<0?Math.ceil(o):Math.floor(o);if(M==t)return e(M)?t:i;e(M)?i=M:t=M+n}}function It(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var o=!1,M=0;M<e.length;++M){var z=e[M];(z.from<i&&z.to>t||t==i&&z.to==t)&&(n(Math.max(z.from,t),Math.min(z.to,i),z.level==1?"rtl":"ltr",M),o=!0)}o||n(t,i,"ltr")}var wt=null;function Tt(e,t,i){var n;wt=null;for(var o=0;o<e.length;++o){var M=e[o];if(M.from<t&&M.to>t)return o;M.to==t&&(M.from!=M.to&&i=="before"?n=o:wt=o),M.from==t&&(M.from!=M.to&&i!="before"?n=o:wt=o)}return n!=null?n:wt}var Wt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ie){return ie<=247?e.charAt(ie):1424<=ie&&ie<=1524?"R":1536<=ie&&ie<=1785?t.charAt(ie-1536):1774<=ie&&ie<=2220?"r":8192<=ie&&ie<=8203?"w":ie==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,M=/[LRr]/,z=/[Lb1n]/,Z=/[1n]/;function $(ie,ge,xe){this.level=ie,this.from=ge,this.to=xe}return function(ie,ge){var xe=ge=="ltr"?"L":"R";if(ie.length==0||ge=="ltr"&&!n.test(ie))return!1;for(var Fe=ie.length,Ne=[],qe=0;qe<Fe;++qe)Ne.push(i(ie.charCodeAt(qe)));for(var st=0,_t=xe;st<Fe;++st){var Lt=Ne[st];Lt=="m"?Ne[st]=_t:_t=Lt}for(var Ht=0,Dt=xe;Ht<Fe;++Ht){var Vt=Ne[Ht];Vt=="1"&&Dt=="r"?Ne[Ht]="n":M.test(Vt)&&(Dt=Vt,Vt=="r"&&(Ne[Ht]="R"))}for(var dn=1,$t=Ne[0];dn<Fe-1;++dn){var Sn=Ne[dn];Sn=="+"&&$t=="1"&&Ne[dn+1]=="1"?Ne[dn]="1":Sn==","&&$t==Ne[dn+1]&&($t=="1"||$t=="n")&&(Ne[dn]=$t),$t=Sn}for(var hi=0;hi<Fe;++hi){var zi=Ne[hi];if(zi==",")Ne[hi]="N";else if(zi=="%"){var wi=void 0;for(wi=hi+1;wi<Fe&&Ne[wi]=="%";++wi);for(var yr=hi&&Ne[hi-1]=="!"||wi<Fe&&Ne[wi]=="1"?"1":"N",fr=hi;fr<wi;++fr)Ne[fr]=yr;hi=wi-1}}for(var Ni=0,pr=xe;Ni<Fe;++Ni){var Ji=Ne[Ni];pr=="L"&&Ji=="1"?Ne[Ni]="L":M.test(Ji)&&(pr=Ji)}for(var Ki=0;Ki<Fe;++Ki)if(o.test(Ne[Ki])){var Ui=void 0;for(Ui=Ki+1;Ui<Fe&&o.test(Ne[Ui]);++Ui);for(var Li=(Ki?Ne[Ki-1]:xe)=="L",mr=(Ui<Fe?Ne[Ui]:xe)=="L",Ua=Li==mr?Li?"L":"R":xe,ca=Ki;ca<Ui;++ca)Ne[ca]=Ua;Ki=Ui-1}for(var tr=[],Hr,Vi=0;Vi<Fe;)if(z.test(Ne[Vi])){var ps=Vi;for(++Vi;Vi<Fe&&z.test(Ne[Vi]);++Vi);tr.push(new $(0,ps,Vi))}else{var qr=Vi,va=tr.length,ya=ge=="rtl"?1:0;for(++Vi;Vi<Fe&&Ne[Vi]!="L";++Vi);for(var ur=qr;ur<Vi;)if(Z.test(Ne[ur])){qr<ur&&(tr.splice(va,0,new $(1,qr,ur)),va+=ya);var Ba=ur;for(++ur;ur<Vi&&Z.test(Ne[ur]);++ur);tr.splice(va,0,new $(2,Ba,ur)),va+=ya,qr=ur}else++ur;qr<Vi&&tr.splice(va,0,new $(1,qr,Vi))}return ge=="ltr"&&(tr[0].level==1&&(Hr=ie.match(/^\s+/))&&(tr[0].from=Hr[0].length,tr.unshift(new $(0,0,Hr[0].length))),Le(tr).level==1&&(Hr=ie.match(/\s+$/))&&(Le(tr).to-=Hr[0].length,tr.push(new $(0,Fe-Hr[0].length,Fe)))),ge=="rtl"?tr.reverse():tr}}();function Ct(e,t){var i=e.order;return i==null&&(i=e.order=Wt(e.text,t)),i}var bt=[],ze=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||bt).concat(i)}};function Kt(e,t){return e._handlers&&e._handlers[t]||bt}function St(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,o=n&&n[t];if(o){var M=oe(o,i);M>-1&&(n[t]=o.slice(0,M).concat(o.slice(M+1)))}}}function Ke(e,t){var i=Kt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),o=0;o<i.length;++o)i[o].apply(null,n)}function at(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ke(e,i||t.type,e,t),de(t)||t.codemirrorIgnore}function Ce(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)oe(i,t[n])==-1&&i.push(t[n])}function Ee(e,t){return Kt(e,t).length>0}function Te(e){e.prototype.on=function(t,i){ze(this,t,i)},e.prototype.off=function(t,i){St(this,t,i)}}function ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function de(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function pe(e){ee(e),ae(e)}function _e(e){return e.target||e.srcElement}function Re(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),a&&e.ctrlKey&&t==1&&(t=3),t}var De=function(){if(G&&j<9)return!1;var e=l("div");return"draggable"in e||"dragDrop"in e}(),Ze;function dt(e){if(Ze==null){var t=l("span","\u200B");b(e,l("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ze=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&j<8))}var i=Ze?l("span","\u200B"):l("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ht;function Ft(e){if(ht!=null)return ht;var t=b(e,document.createTextNode("A\u062EA")),i=h(t,0,1).getBoundingClientRect(),n=h(t,1,2).getBoundingClientRect();return E(e),!i||i.left==i.right?!1:ht=n.right-i.right<3}var vt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var o=e.indexOf(`
|
|
`,t);o==-1&&(o=e.length);var M=e.slice(t,e.charAt(o-1)=="\r"?o-1:o),z=M.indexOf("\r");z!=-1?(i.push(M.slice(0,z)),t+=z+1):(i.push(M),t=o+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Ge=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},en=function(){var e=l("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),je=null;function un(e){if(je!=null)return je;var t=b(e,l("span","x")),i=t.getBoundingClientRect(),n=h(t,0,1).getBoundingClientRect();return je=Math.abs(i.left-n.left)>1}var yt={},Nt={};function Gt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),yt[e]=t}function on(e,t){Nt[e]=t}function Je(e){if(typeof e=="string"&&Nt.hasOwnProperty(e))e=Nt[e];else if(e&&typeof e.name=="string"&&Nt.hasOwnProperty(e.name)){var t=Nt[e.name];typeof t=="string"&&(t={name:t}),e=Et(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Je("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Je("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function xt(e,t){t=Je(t);var i=yt[t.name];if(!i)return xt(e,"text/plain");var n=i(e,t);if(Ut.hasOwnProperty(t.name)){var o=Ut[t.name];for(var M in o){if(!o.hasOwnProperty(M))continue;n.hasOwnProperty(M)&&(n["_"+M]=n[M]),n[M]=o[M]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var z in t.modeProps)n[z]=t.modeProps[z];return n}var Ut={};function zt(e,t){var i=Ut.hasOwnProperty(e)?Ut[e]:Ut[e]={};A(t,i)}function hn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var o=t[n];o instanceof Array&&(o=o.concat([])),i[n]=o}return i}function Ln(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function gn(e,t,i){return e.startState?e.startState(t,i):!0}var Jt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Jt.prototype.eol=function(){return this.pos>=this.string.length},Jt.prototype.sol=function(){return this.pos==this.lineStart},Jt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Jt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Jt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Jt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Jt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Jt.prototype.skipToEnd=function(){this.pos=this.string.length},Jt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Jt.prototype.backUp=function(e){this.pos-=e},Jt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=J(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},Jt.prototype.indentation=function(){return J(this.string,null,this.tabSize)-(this.lineStart?J(this.string,this.lineStart,this.tabSize):0)},Jt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(z){return i?z.toLowerCase():z},o=this.string.substr(this.pos,e.length);if(n(o)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var M=this.string.slice(this.pos).match(e);return M&&M.index>0?null:(M&&t!==!1&&(this.pos+=M[0].length),M)}},Jt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Jt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Jt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Jt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Rt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var o=i.children[n],M=o.chunkSize();if(t<M){i=o;break}t-=M}return i.lines[t]}function Vn(e,t,i){var n=[],o=t.line;return e.iter(t.line,i.line+1,function(M){var z=M.text;o==i.line&&(z=z.slice(0,i.ch)),o==t.line&&(z=z.slice(t.ch)),n.push(z),++o}),n}function kn(e,t,i){var n=[];return e.iter(t,i,function(o){n.push(o.text)}),n}function Cn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Qt(e){if(e.parent==null)return null;for(var t=e.parent,i=oe(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var o=0;!(n.children[o]==t);++o)i+=n.children[o].chunkSize();return i+t.first}function Gn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var o=e.children[n],M=o.height;if(t<M){e=o;continue e}t-=M,i+=o.chunkSize()}return i}while(!e.lines);for(var z=0;z<e.lines.length;++z){var Z=e.lines[z],$=Z.height;if(t<$)break;t-=$}return i+z}function ei(e,t){return t>=e.first&&t<e.first+e.size}function Xn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,i){if(i===void 0&&(i=null),!(this instanceof et))return new et(e,t,i);this.line=e,this.ch=t,this.sticky=i}function jt(e,t){return e.line-t.line||e.ch-t.ch}function Wn(e,t){return e.sticky==t.sticky&&jt(e,t)==0}function mn(e){return et(e.line,e.ch)}function sn(e,t){return jt(e,t)<0?t:e}function Dn(e,t){return jt(e,t)<0?e:t}function K(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function v(e,t){if(t.line<e.first)return et(e.first,0);var i=e.first+e.size-1;return t.line>i?et(i,Rt(e,i).text.length):C(t,Rt(e,t.line).text.length)}function C(e,t){var i=e.ch;return i==null||i>t?et(e.line,t):i<0?et(e.line,0):e}function F(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=v(e,t[n]);return i}var q=function(e,t){this.state=e,this.lookAhead=t},H=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};H.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},H.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},H.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},H.fromSaved=function(e,t,i){return t instanceof q?new H(e,hn(e.mode,t.state),i,t.lookAhead):new H(e,hn(e.mode,t),i)},H.prototype.save=function(e){var t=e!==!1?hn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new q(t,this.maxLookAhead):t};function ue(e,t,i,n){var o=[e.state.modeGen],M={};fn(e,t.text,e.doc.mode,i,function(ie,ge){return o.push(ie,ge)},M,n);for(var z=i.state,Z=function(ie){i.baseTokens=o;var ge=e.state.overlays[ie],xe=1,Fe=0;i.state=!0,fn(e,t.text,ge.mode,i,function(Ne,qe){for(var st=xe;Fe<Ne;){var _t=o[xe];_t>Ne&&o.splice(xe,1,Ne,o[xe+1],_t),xe+=2,Fe=Math.min(Ne,_t)}if(!qe)return;if(ge.opaque)o.splice(st,xe-st,Ne,"overlay "+qe),xe=st+2;else for(;st<xe;st+=2){var Lt=o[st+1];o[st+1]=(Lt?Lt+" ":"")+"overlay "+qe}},M),i.state=z,i.baseTokens=null,i.baseTokenPos=1},$=0;$<e.state.overlays.length;++$)Z($);return{styles:o,classes:M.bgClass||M.textClass?M:null}}function He(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Xe(e,Qt(t)),o=t.text.length>e.options.maxHighlightLength&&hn(e.doc.mode,n.state),M=ue(e,t,n);o&&(n.state=o),t.stateAfter=n.save(!o),t.styles=M.styles,M.classes?t.styleClasses=M.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Xe(e,t,i){var n=e.doc,o=e.display;if(!n.mode.startState)return new H(n,!0,t);var M=Mt(e,t,i),z=M>n.first&&Rt(n,M-1).stateAfter,Z=z?H.fromSaved(n,z,M):new H(n,gn(n.mode),M);return n.iter(M,t,function($){At(e,$.text,Z);var ie=Z.line;$.stateAfter=ie==t-1||ie%5==0||ie>=o.viewFrom&&ie<o.viewTo?Z.save():null,Z.nextLine()}),i&&(n.modeFrontier=Z.line),Z}function At(e,t,i,n){var o=e.doc.mode,M=new Jt(t,e.options.tabSize,i);for(M.start=M.pos=n||0,t==""&&We(o,i.state);!M.eol();)mt(o,M,i.state),M.start=M.pos}function We(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Ln(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function mt(e,t,i,n){for(var o=0;o<10;o++){n&&(n[0]=Ln(e,i).mode);var M=e.token(t,i);if(t.pos>t.start)return M}throw new Error("Mode "+e.name+" failed to advance stream.")}var Zt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Fn(e,t,i,n){var o=e.doc,M=o.mode,z;t=v(o,t);var Z=Rt(o,t.line),$=Xe(e,t.line,i),ie=new Jt(Z.text,e.options.tabSize,$),ge;for(n&&(ge=[]);(n||ie.pos<t.ch)&&!ie.eol();)ie.start=ie.pos,z=mt(M,ie,$.state),n&&ge.push(new Zt(ie,z,hn(o.mode,$.state)));return n?ge:new Zt(ie,z,$.state)}function Zn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function fn(e,t,i,n,o,M,z){var Z=i.flattenSpans;Z==null&&(Z=e.options.flattenSpans);var $=0,ie=null,ge=new Jt(t,e.options.tabSize,n),xe,Fe=e.options.addModeClass&&[null];for(t==""&&Zn(We(i,n.state),M);!ge.eol();){if(ge.pos>e.options.maxHighlightLength?(Z=!1,z&&At(e,t,n,ge.pos),ge.pos=t.length,xe=null):xe=Zn(mt(i,ge,n.state,Fe),M),Fe){var Ne=Fe[0].name;Ne&&(xe="m-"+(xe?Ne+" "+xe:Ne))}if(!Z||ie!=xe){for(;$<ge.start;)$=Math.min(ge.start,$+5e3),o($,ie);ie=xe}ge.start=ge.pos}for(;$<ge.pos;){var qe=Math.min(ge.pos,$+5e3);o(qe,ie),$=qe}}function Mt(e,t,i){for(var n,o,M=e.doc,z=i?-1:t-(e.doc.mode.innerMode?1e3:100),Z=t;Z>z;--Z){if(Z<=M.first)return M.first;var $=Rt(M,Z-1),ie=$.stateAfter;if(ie&&(!i||Z+(ie instanceof q?ie.lookAhead:0)<=M.modeFrontier))return Z;var ge=J($.text,null,e.options.tabSize);(o==null||n>ge)&&(o=Z-1,n=ge)}return o}function Bt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var o=Rt(e,n).stateAfter;if(o&&(!(o instanceof q)||n+o.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var tn=!1,nn=!1;function yn(){tn=!0}function qn(){nn=!0}function ln(e,t,i){this.marker=e,this.from=t,this.to=i}function ci(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function cr(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function gr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function _r(e,t,i){var n;if(e)for(var o=0;o<e.length;++o){var M=e[o],z=M.marker,Z=M.from==null||(z.inclusiveLeft?M.from<=t:M.from<t);if(Z||M.from==t&&z.type=="bookmark"&&(!i||!M.marker.insertLeft)){var $=M.to==null||(z.inclusiveRight?M.to>=t:M.to>t);(n||(n=[])).push(new ln(z,M.from,$?null:M.to))}}return n}function Wr(e,t,i){var n;if(e)for(var o=0;o<e.length;++o){var M=e[o],z=M.marker,Z=M.to==null||(z.inclusiveRight?M.to>=t:M.to>t);if(Z||M.from==t&&z.type=="bookmark"&&(!i||M.marker.insertLeft)){var $=M.from==null||(z.inclusiveLeft?M.from<=t:M.from<t);(n||(n=[])).push(new ln(z,$?null:M.from-t,M.to==null?null:M.to-t))}}return n}function fi(e,t){if(t.full)return null;var i=ei(e,t.from.line)&&Rt(e,t.from.line).markedSpans,n=ei(e,t.to.line)&&Rt(e,t.to.line).markedSpans;if(!i&&!n)return null;var o=t.from.ch,M=t.to.ch,z=jt(t.from,t.to)==0,Z=_r(i,o,z),$=Wr(n,M,z),ie=t.text.length==1,ge=Le(t.text).length+(ie?o:0);if(Z)for(var xe=0;xe<Z.length;++xe){var Fe=Z[xe];if(Fe.to==null){var Ne=ci($,Fe.marker);Ne?ie&&(Fe.to=Ne.to==null?null:Ne.to+ge):Fe.to=o}}if($)for(var qe=0;qe<$.length;++qe){var st=$[qe];if(st.to!=null&&(st.to+=ge),st.from==null){var _t=ci(Z,st.marker);_t||(st.from=ge,ie&&(Z||(Z=[])).push(st))}else st.from+=ge,ie&&(Z||(Z=[])).push(st)}Z&&(Z=Di(Z)),$&&$!=Z&&($=Di($));var Lt=[Z];if(!ie){var Ht=t.text.length-2,Dt;if(Ht>0&&Z)for(var Vt=0;Vt<Z.length;++Vt)Z[Vt].to==null&&(Dt||(Dt=[])).push(new ln(Z[Vt].marker,null,null));for(var dn=0;dn<Ht;++dn)Lt.push(Dt);Lt.push($)}return Lt}function Di(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function dr(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(Ne){if(Ne.markedSpans)for(var qe=0;qe<Ne.markedSpans.length;++qe){var st=Ne.markedSpans[qe].marker;st.readOnly&&(!n||oe(n,st)==-1)&&(n||(n=[])).push(st)}}),!n)return null;for(var o=[{from:t,to:i}],M=0;M<n.length;++M)for(var z=n[M],Z=z.find(0),$=0;$<o.length;++$){var ie=o[$];if(jt(ie.to,Z.from)<0||jt(ie.from,Z.to)>0)continue;var ge=[$,1],xe=jt(ie.from,Z.from),Fe=jt(ie.to,Z.to);(xe<0||!z.inclusiveLeft&&!xe)&&ge.push({from:ie.from,to:Z.from}),(Fe>0||!z.inclusiveRight&&!Fe)&&ge.push({from:Z.to,to:ie.to}),o.splice.apply(o,ge),$+=ge.length-3}return o}function Kr(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function Ar(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function ai(e){return e.inclusiveLeft?-1:0}function Pn(e){return e.inclusiveRight?1:0}function pi(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),o=t.find(),M=jt(n.from,o.from)||ai(e)-ai(t);if(M)return-M;var z=jt(n.to,o.to)||Pn(e)-Pn(t);return z||t.id-e.id}function pn(e,t){var i=nn&&e.markedSpans,n;if(i)for(var o=void 0,M=0;M<i.length;++M)o=i[M],o.marker.collapsed&&(t?o.from:o.to)==null&&(!n||pi(n,o.marker)<0)&&(n=o.marker);return n}function mi(e){return pn(e,!0)}function Yn(e){return pn(e,!1)}function nr(e,t){var i=nn&&e.markedSpans,n;if(i)for(var o=0;o<i.length;++o){var M=i[o];M.marker.collapsed&&(M.from==null||M.from<t)&&(M.to==null||M.to>t)&&(!n||pi(n,M.marker)<0)&&(n=M.marker)}return n}function Si(e,t,i,n,o){var M=Rt(e,t),z=nn&&M.markedSpans;if(z)for(var Z=0;Z<z.length;++Z){var $=z[Z];if(!$.marker.collapsed)continue;var ie=$.marker.find(0),ge=jt(ie.from,i)||ai($.marker)-ai(o),xe=jt(ie.to,n)||Pn($.marker)-Pn(o);if(ge>=0&&xe<=0||ge<=0&&xe>=0)continue;if(ge<=0&&($.marker.inclusiveRight&&o.inclusiveLeft?jt(ie.to,i)>=0:jt(ie.to,i)>0)||ge>=0&&($.marker.inclusiveRight&&o.inclusiveLeft?jt(ie.from,n)<=0:jt(ie.from,n)<0))return!0}}function Pi(e){for(var t;t=mi(e);)e=t.find(-1,!0).line;return e}function Gr(e){for(var t;t=Yn(e);)e=t.find(1,!0).line;return e}function Qi(e){for(var t,i;t=Yn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Sr(e,t){var i=Rt(e,t),n=Pi(i);return i==n?t:Qt(n)}function ir(e,t){if(t>e.lastLine())return t;var i=Rt(e,t),n;if(!Zi(e,i))return t;for(;n=Yn(i);)i=n.find(1,!0).line;return Qt(i)+1}function Zi(e,t){var i=nn&&t.markedSpans;if(i)for(var n=void 0,o=0;o<i.length;++o){if(n=i[o],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&zr(e,t,n))return!0}}function zr(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return zr(e,n.line,ci(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var o=void 0,M=0;M<t.markedSpans.length;++M)if(o=t.markedSpans[M],o.marker.collapsed&&!o.marker.widgetNode&&o.from==i.to&&(o.to==null||o.to!=i.from)&&(o.marker.inclusiveLeft||i.marker.inclusiveRight)&&zr(e,t,o))return!0}function gi(e){e=Pi(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var o=i.lines[n];if(o==e)break;t+=o.height}for(var M=i.parent;M;i=M,M=i.parent)for(var z=0;z<M.children.length;++z){var Z=M.children[z];if(Z==i)break;t+=Z.height}return t}function Kn(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=mi(n);){var o=i.find(0,!0);n=o.from.line,t+=o.from.ch-o.to.ch}for(n=e;i=Yn(n);){var M=i.find(0,!0);t-=n.text.length-M.from.ch,n=M.to.line,t+=n.text.length-M.to.ch}return t}function Ci(e){var t=e.display,i=e.doc;t.maxLine=Rt(i,i.first),t.maxLineLength=Kn(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var o=Kn(n);o>t.maxLineLength&&(t.maxLineLength=o,t.maxLine=n)})}var Ti=function(e,t,i){this.text=e,Ar(this,t),this.height=i?i(this):1};Ti.prototype.lineNo=function(){return Qt(this)},Te(Ti);function qi(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Kr(e),Ar(e,i);var o=n?n(e):1;o!=e.height&&Cn(e,o)}function kt(e){e.parent=null,Kr(e)}var rn={},Yt={};function wn(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Yt:rn;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function jn(e,t){var i=_("span",null,null,P?"padding-right: .1px":null),n={pre:_("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var M=o?t.rest[o-1]:t.line,z=void 0;n.pos=0,n.addToken=Nn,Ft(e.display.measure)&&(z=Ct(M,e.doc.direction))&&(n.addToken=rr(n.addToken,z)),n.map=[];var Z=t!=e.display.externalMeasured&&Qt(M);Or(M,n,He(e,M,Z)),M.styleClasses&&(M.styleClasses.bgClass&&(n.bgClass=V(M.styleClasses.bgClass,n.bgClass||"")),M.styleClasses.textClass&&(n.textClass=V(M.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(dt(e.display.measure))),o==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(P){var $=n.content.lastChild;(/\bcm-tab\b/.test($.className)||$.querySelector&&$.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ke(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=V(n.pre.className,n.textClass||"")),n}function ti(e){var t=l("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Nn(e,t,i,n,o,M,z){if(!t)return;var Z=e.splitSpaces?Ai(t,e.trailingSpace):t,$=e.cm.state.specialChars,ie=!1,ge;if(!$.test(t))e.col+=t.length,ge=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,ge),G&&j<9&&(ie=!0),e.pos+=t.length;else{ge=document.createDocumentFragment();for(var xe=0;;){$.lastIndex=xe;var Fe=$.exec(t),Ne=Fe?Fe.index-xe:t.length-xe;if(Ne){var qe=document.createTextNode(Z.slice(xe,xe+Ne));G&&j<9?ge.appendChild(l("span",[qe])):ge.appendChild(qe),e.map.push(e.pos,e.pos+Ne,qe),e.col+=Ne,e.pos+=Ne}if(!Fe)break;xe+=Ne+1;var st=void 0;if(Fe[0]==" "){var _t=e.cm.options.tabSize,Lt=_t-e.col%_t;st=ge.appendChild(l("span",le(Lt),"cm-tab")),st.setAttribute("role","presentation"),st.setAttribute("cm-text"," "),e.col+=Lt}else Fe[0]=="\r"||Fe[0]==`
|
|
`?(st=ge.appendChild(l("span",Fe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),st.setAttribute("cm-text",Fe[0]),e.col+=1):(st=e.cm.options.specialCharPlaceholder(Fe[0]),st.setAttribute("cm-text",Fe[0]),G&&j<9?ge.appendChild(l("span",[st])):ge.appendChild(st),e.col+=1);e.map.push(e.pos,e.pos+1,st),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,i||n||o||ie||M||z){var Ht=i||"";n&&(Ht+=n),o&&(Ht+=o);var Dt=l("span",[ge],Ht,M);if(z)for(var Vt in z)z.hasOwnProperty(Vt)&&Vt!="style"&&Vt!="class"&&Dt.setAttribute(Vt,z[Vt]);return e.content.appendChild(Dt)}e.content.appendChild(ge)}function Ai(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",o=0;o<e.length;o++){var M=e.charAt(o);M==" "&&i&&(o==e.length-1||e.charCodeAt(o+1)==32)&&(M="\xA0"),n+=M,i=M==" "}return n}function rr(e,t){return function(i,n,o,M,z,Z,$){o=o?o+" cm-force-border":"cm-force-border";for(var ie=i.pos,ge=ie+n.length;;){for(var xe=void 0,Fe=0;Fe<t.length&&!(xe=t[Fe],xe.to>ie&&xe.from<=ie);Fe++);if(xe.to>=ge)return e(i,n,o,M,z,Z,$);e(i,n.slice(0,xe.to-ie),o,M,null,Z,$),M=null,n=n.slice(xe.to-ie),ie=xe.to}}}function An(e,t,i,n){var o=!n&&i.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!n&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",i.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function Or(e,t,i){var n=e.markedSpans,o=e.text,M=0;if(!n){for(var z=1;z<i.length;z+=2)t.addToken(t,o.slice(M,M=i[z]),wn(i[z+1],t.cm.options));return}for(var Z=o.length,$=0,ie=1,ge="",xe,Fe,Ne=0,qe,st,_t,Lt,Ht;;){if(Ne==$){qe=st=_t=Fe="",Ht=null,Lt=null,Ne=Infinity;for(var Dt=[],Vt=void 0,dn=0;dn<n.length;++dn){var $t=n[dn],Sn=$t.marker;if(Sn.type=="bookmark"&&$t.from==$&&Sn.widgetNode)Dt.push(Sn);else if($t.from<=$&&($t.to==null||$t.to>$||Sn.collapsed&&$t.to==$&&$t.from==$)){if($t.to!=null&&$t.to!=$&&Ne>$t.to&&(Ne=$t.to,st=""),Sn.className&&(qe+=" "+Sn.className),Sn.css&&(Fe=(Fe?Fe+";":"")+Sn.css),Sn.startStyle&&$t.from==$&&(_t+=" "+Sn.startStyle),Sn.endStyle&&$t.to==Ne&&(Vt||(Vt=[])).push(Sn.endStyle,$t.to),Sn.title&&((Ht||(Ht={})).title=Sn.title),Sn.attributes)for(var hi in Sn.attributes)(Ht||(Ht={}))[hi]=Sn.attributes[hi];Sn.collapsed&&(!Lt||pi(Lt.marker,Sn)<0)&&(Lt=$t)}else $t.from>$&&Ne>$t.from&&(Ne=$t.from)}if(Vt)for(var zi=0;zi<Vt.length;zi+=2)Vt[zi+1]==Ne&&(st+=" "+Vt[zi]);if(!Lt||Lt.from==$)for(var wi=0;wi<Dt.length;++wi)An(t,0,Dt[wi]);if(Lt&&(Lt.from||0)==$){if(An(t,(Lt.to==null?Z+1:Lt.to)-$,Lt.marker,Lt.from==null),Lt.to==null)return;Lt.to==$&&(Lt=!1)}}if($>=Z)break;for(var yr=Math.min(Z,Ne);;){if(ge){var fr=$+ge.length;if(!Lt){var Ni=fr>yr?ge.slice(0,yr-$):ge;t.addToken(t,Ni,xe?xe+qe:qe,_t,$+Ni.length==Ne?st:"",Fe,Ht)}if(fr>=yr){ge=ge.slice(yr-$),$=yr;break}$=fr,_t=""}ge=o.slice(M,M=i[ie++]),xe=wn(i[ie++],t.cm.options)}}}function Jn(e,t,i){this.line=t,this.rest=Qi(t),this.size=this.rest?Qt(Le(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Zi(e,t)}function Xi(e,t,i){for(var n=[],o,M=t;M<i;M=o){var z=new Jn(e.doc,Rt(e.doc,M),M);o=M+z.size,n.push(z)}return n}var Gi=null;function vr(e){Gi?Gi.ops.push(e):e.ownsGroup=Gi={ops:[e],delayedCallbacks:[]}}function Fa(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var o=e.ops[n];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(i<t.length)}function Ko(e,t){var i=e.ownsGroup;if(!i)return;try{Fa(i)}finally{Gi=null,t(i)}}var $r=null;function Oi(e,t){var i=Kt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),o;Gi?o=Gi.delayedCallbacks:$r?o=$r:(o=$r=[],setTimeout(go,0));for(var M=function(Z){o.push(function(){return i[Z].apply(null,n)})},z=0;z<i.length;++z)M(z)}function go(){var e=$r;$r=null;for(var t=0;t<e.length;++t)e[t]()}function vo(e,t,i,n){for(var o=0;o<t.changes.length;o++){var M=t.changes[o];M=="text"?yo(e,t):M=="gutter"?Wa(e,t,i,n):M=="class"?Ha(e,t):M=="widget"&&zo(e,t,n)}t.changes=null}function da(e){return e.node==e.text&&(e.node=l("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&j<8&&(e.node.style.zIndex=2)),e.node}function Go(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=da(t);t.background=n.insertBefore(l("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function ja(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):jn(e,t)}function yo(e,t){var i=t.text.className,n=ja(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Ha(e,t)):i&&(t.text.className=i)}function Ha(e,t){Go(e,t),t.line.wrapClass?da(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Wa(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=da(t);t.gutterBackground=l("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var M=t.line.gutterMarkers;if(e.options.lineNumbers||M){var z=da(t),Z=t.gutter=l("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Z),z.insertBefore(Z,t.text),t.line.gutterClass&&(Z.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!M||!M["CodeMirror-linenumbers"])&&(t.lineNumber=Z.appendChild(l("div",Xn(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),M)for(var $=0;$<e.display.gutterSpecs.length;++$){var ie=e.display.gutterSpecs[$].className,ge=M.hasOwnProperty(ie)&&M[ie];ge&&Z.appendChild(l("div",[ge],"CodeMirror-gutter-elt","left: "+n.gutterLeft[ie]+"px; width: "+n.gutterWidth[ie]+"px"))}}}function zo(e,t,i){t.alignable&&(t.alignable=null);for(var n=O("CodeMirror-linewidget"),o=t.node.firstChild,M=void 0;o;o=M)M=o.nextSibling,n.test(o.className)&&t.node.removeChild(o);Ka(e,t,i)}function _o(e,t,i,n){var o=ja(e,t);return t.text=t.node=o.pre,o.bgClass&&(t.bgClass=o.bgClass),o.textClass&&(t.textClass=o.textClass),Ha(e,t),Wa(e,t,i,n),Ka(e,t,n),t.node}function Ka(e,t,i){if(bo(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)bo(e,t.rest[n],t,i,!1)}function bo(e,t,i,n,o){if(!t.widgets)return;for(var M=da(i),z=0,Z=t.widgets;z<Z.length;++z){var $=Z[z],ie=l("div",[$.node],"CodeMirror-linewidget"+($.className?" "+$.className:""));$.handleMouseEvents||ie.setAttribute("cm-ignore-events","true"),Vo($,ie,i,n),e.display.input.setUneditable(ie),o&&$.above?M.insertBefore(ie,i.gutter||i.text):M.appendChild(ie),Oi($,"redraw")}}function Vo(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var o=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(o-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=o+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function ea(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!g(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),b(t.display.measure,l("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Rr(e,t){for(var i=_e(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Ga(e){return e.lineSpace.offsetTop}function he(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function we(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=b(e.measure,l("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Ae(e){return fe-e.display.nativeBarWidth}function me(e){return e.display.scroller.clientWidth-Ae(e)-e.display.barWidth}function te(e){return e.display.scroller.clientHeight-Ae(e)-e.display.barHeight}function ce(e,t,i){var n=e.options.lineWrapping,o=n&&me(e);if(!t.measure.heights||n&&t.measure.width!=o){var M=t.measure.heights=[];if(n){t.measure.width=o;for(var z=t.text.firstChild.getClientRects(),Z=0;Z<z.length-1;Z++){var $=z[Z],ie=z[Z+1];Math.abs($.bottom-ie.bottom)>2&&M.push(($.bottom+ie.top)/2-i.top)}}M.push(i.bottom-i.top)}}function re(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var o=0;o<e.rest.length;o++)if(Qt(e.rest[o])>i)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function ve(e,t){t=Pi(t);var i=Qt(t),n=e.display.externalMeasured=new Jn(e.doc,t,i);n.lineN=i;var o=n.built=jn(e,n);return n.text=o.pre,b(e.display.lineMeasure,o.pre),n}function ye(e,t,i,n){return Ue(e,Se(e,t),i,n)}function Ie(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[di(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Se(e,t){var i=Qt(t),n=Ie(e,i);n&&!n.text?n=null:n&&n.changes&&(vo(e,n,i,bi(e)),e.curOp.forceUpdate=!0),n||(n=ve(e,t));var o=re(n,t,i);return{line:t,view:n,rect:null,map:o.map,cache:o.cache,before:o.before,hasHeights:!1}}function Ue(e,t,i,n,o){t.before&&(i=-1);var M=i+(n||""),z;return t.cache.hasOwnProperty(M)?z=t.cache[M]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ce(e,t.view,t.rect),t.hasHeights=!0),z=Ot(e,t,i,n),z.bogus||(t.cache[M]=z)),{left:z.left,right:z.right,top:o?z.rtop:z.top,bottom:o?z.rbottom:z.bottom}}var Ye={left:0,right:0,top:0,bottom:0};function pt(e,t,i){for(var n,o,M,z,Z,$,ie=0;ie<e.length;ie+=3)if(Z=e[ie],$=e[ie+1],t<Z?(o=0,M=1,z="left"):t<$?(o=t-Z,M=o+1):(ie==e.length-3||t==$&&e[ie+3]>t)&&(M=$-Z,o=M-1,t>=$&&(z="right")),o!=null){if(n=e[ie+2],Z==$&&i==(n.insertLeft?"left":"right")&&(z=i),i=="left"&&o==0)for(;ie&&e[ie-2]==e[ie-3]&&e[ie-1].insertLeft;)n=e[(ie-=3)+2],z="left";if(i=="right"&&o==$-Z)for(;ie<e.length-3&&e[ie+3]==e[ie+4]&&!e[ie+5].insertLeft;)n=e[(ie+=3)+2],z="right";break}return{node:n,start:o,end:M,collapse:z,coverStart:Z,coverEnd:$}}function ft(e,t){var i=Ye;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var o=e.length-1;o>=0&&!((i=e[o]).left!=i.right);o--);return i}function Ot(e,t,i,n){var o=pt(t.map,i,n),M=o.node,z=o.start,Z=o.end,$=o.collapse,ie;if(M.nodeType==3){for(var ge=0;ge<4;ge++){for(;z&&it(t.line.text.charAt(o.coverStart+z));)--z;for(;o.coverStart+Z<o.coverEnd&&it(t.line.text.charAt(o.coverStart+Z));)++Z;if(G&&j<9&&z==0&&Z==o.coverEnd-o.coverStart?ie=M.parentNode.getBoundingClientRect():ie=ft(h(M,z,Z).getClientRects(),n),ie.left||ie.right||z==0)break;Z=z,z=z-1,$="right"}G&&j<11&&(ie=cn(e.display.measure,ie))}else{z>0&&($=n="right");var xe;e.options.lineWrapping&&(xe=M.getClientRects()).length>1?ie=xe[n=="right"?xe.length-1:0]:ie=M.getBoundingClientRect()}if(G&&j<9&&!z&&(!ie||!ie.left&&!ie.right)){var Fe=M.parentNode.getClientRects()[0];Fe?ie={left:Fe.left,right:Fe.left+Bi(e.display),top:Fe.top,bottom:Fe.bottom}:ie=Ye}for(var Ne=ie.top-t.rect.top,qe=ie.bottom-t.rect.top,st=(Ne+qe)/2,_t=t.view.measure.heights,Lt=0;Lt<_t.length-1&&!(st<_t[Lt]);Lt++);var Ht=Lt?_t[Lt-1]:0,Dt=_t[Lt],Vt={left:($=="right"?ie.right:ie.left)-t.rect.left,right:($=="left"?ie.left:ie.right)-t.rect.left,top:Ht,bottom:Dt};return!ie.left&&!ie.right&&(Vt.bogus=!0),e.options.singleCursorHeightPerLine||(Vt.rtop=Ne,Vt.rbottom=qe),Vt}function cn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!un(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function xn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function vn(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)xn(e.display.view[t])}function _n(e){vn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Tn(){return y&&s?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function En(){return y&&s?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function bn(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=ea(e.widgets[i]));return t}function Un(e,t,i,n,o){if(!o){var M=bn(t);i.top+=M,i.bottom+=M}if(n=="line")return i;n||(n="local");var z=gi(t);if(n=="local"?z+=Ga(e.display):z-=e.display.viewOffset,n=="page"||n=="window"){var Z=e.display.lineSpace.getBoundingClientRect();z+=Z.top+(n=="window"?0:En());var $=Z.left+(n=="window"?0:Tn());i.left+=$,i.right+=$}return i.top+=z,i.bottom+=z,i}function On(e,t,i){if(i=="div")return t;var n=t.left,o=t.top;if(i=="page")n-=Tn(),o-=En();else if(i=="local"||!i){var M=e.display.sizer.getBoundingClientRect();n+=M.left,o+=M.top}var z=e.display.lineSpace.getBoundingClientRect();return{left:n-z.left,top:o-z.top}}function vi(e,t,i,n,o){return n||(n=Rt(e.doc,t.line)),Un(e,n,ye(e,n,t.ch,o),i)}function Rn(e,t,i,n,o,M){n=n||Rt(e.doc,t.line),o||(o=Se(e,n));function z(qe,st){var _t=Ue(e,o,qe,st?"right":"left",M);return st?_t.left=_t.right:_t.right=_t.left,Un(e,n,_t,i)}var Z=Ct(n,e.doc.direction),$=t.ch,ie=t.sticky;if($>=n.text.length?($=n.text.length,ie="before"):$<=0&&($=0,ie="after"),!Z)return z(ie=="before"?$-1:$,ie=="before");function ge(qe,st,_t){var Lt=Z[st],Ht=Lt.level==1;return z(_t?qe-1:qe,Ht!=_t)}var xe=Tt(Z,$,ie),Fe=wt,Ne=ge($,xe,ie=="before");return Fe!=null&&(Ne.other=ge($,Fe,ie!="before")),Ne}function an(e,t){var i=0;t=v(e.doc,t),e.options.lineWrapping||(i=Bi(e.display)*t.ch);var n=Rt(e.doc,t.line),o=gi(n)+Ga(e.display);return{left:i,right:i,top:o,bottom:o+n.height}}function qt(e,t,i,n,o){var M=et(e,t,i);return M.xRel=o,n&&(M.outside=n),M}function In(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return qt(n.first,0,null,-1,-1);var o=Gn(n,i),M=n.first+n.size-1;if(o>M)return qt(n.first+n.size-1,Rt(n,M).text.length,null,1,1);t<0&&(t=0);for(var z=Rt(n,o);;){var Z=yi(e,z,o,t,i),$=nr(z,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!$)return Z;var ie=$.find(1);if(ie.line==o)return ie;z=Rt(n,o=ie.line)}}function Bn(e,t,i,n){n-=bn(t);var o=t.text.length,M=Pt(function(z){return Ue(e,i,z-1).bottom<=n},o,0);return o=Pt(function(z){return Ue(e,i,z).top>n},M,o),{begin:M,end:o}}function Xt(e,t,i,n){i||(i=Se(e,t));var o=Un(e,t,Ue(e,i,n),"line").top;return Bn(e,t,i,o)}function Hn(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function yi(e,t,i,n,o){o-=gi(t);var M=Se(e,t),z=bn(t),Z=0,$=t.text.length,ie=!0,ge=Ct(t,e.doc.direction);if(ge){var xe=(e.options.lineWrapping?oi:zn)(e,t,i,M,ge,n,o);ie=xe.level!=1,Z=ie?xe.from:xe.to-1,$=ie?xe.to:xe.from-1}var Fe=null,Ne=null,qe=Pt(function(dn){var $t=Ue(e,M,dn);return $t.top+=z,$t.bottom+=z,Hn($t,n,o,!1)?($t.top<=o&&$t.left<=n&&(Fe=dn,Ne=$t),!0):!1},Z,$),st,_t,Lt=!1;if(Ne){var Ht=n-Ne.left<Ne.right-n,Dt=Ht==ie;qe=Fe+(Dt?0:1),_t=Dt?"after":"before",st=Ht?Ne.left:Ne.right}else{!ie&&(qe==$||qe==Z)&&qe++,_t=qe==0?"after":qe==t.text.length?"before":Ue(e,M,qe-(ie?1:0)).bottom+z<=o==ie?"after":"before";var Vt=Rn(e,et(i,qe,_t),"line",t,M);st=Vt.left,Lt=o<Vt.top?-1:o>=Vt.bottom?1:0}return qe=rt(t.text,qe,1),qt(i,qe,_t,Lt,n-st)}function zn(e,t,i,n,o,M,z){var Z=Pt(function(xe){var Fe=o[xe],Ne=Fe.level!=1;return Hn(Rn(e,et(i,Ne?Fe.to:Fe.from,Ne?"before":"after"),"line",t,n),M,z,!0)},0,o.length-1),$=o[Z];if(Z>0){var ie=$.level!=1,ge=Rn(e,et(i,ie?$.from:$.to,ie?"after":"before"),"line",t,n);Hn(ge,M,z,!0)&&ge.top>z&&($=o[Z-1])}return $}function oi(e,t,i,n,o,M,z){var Z=Bn(e,t,n,z),$=Z.begin,ie=Z.end;/\s/.test(t.text.charAt(ie-1))&&ie--;for(var ge=null,xe=null,Fe=0;Fe<o.length;Fe++){var Ne=o[Fe];if(Ne.from>=ie||Ne.to<=$)continue;var qe=Ne.level!=1,st=Ue(e,n,qe?Math.min(ie,Ne.to)-1:Math.max($,Ne.from)).right,_t=st<M?M-st+1e9:st-M;(!ge||xe>_t)&&(ge=Ne,xe=_t)}return ge||(ge=o[o.length-1]),ge.from<$&&(ge={from:$,to:ge.to,level:ge.level}),ge.to>ie&&(ge={from:ge.from,to:ie,level:ge.level}),ge}var ii;function Ri(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ii==null){ii=l("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ii.appendChild(document.createTextNode("x")),ii.appendChild(l("br"));ii.appendChild(document.createTextNode("x"))}b(e.measure,ii);var i=ii.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),E(e.measure),i||1}function Bi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=l("span","xxxxxxxxxx"),i=l("pre",[t],"CodeMirror-line-like");b(e.measure,i);var n=t.getBoundingClientRect(),o=(n.right-n.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function bi(e){for(var t=e.display,i={},n={},o=t.gutters.clientLeft,M=t.gutters.firstChild,z=0;M;M=M.nextSibling,++z){var Z=e.display.gutterSpecs[z].className;i[Z]=M.offsetLeft+M.clientLeft+o,n[Z]=M.clientWidth}return{fixedPos:$i(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function $i(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function br(e){var t=Ri(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Bi(e.display)-3);return function(o){if(Zi(e.doc,o))return 0;var M=0;if(o.widgets)for(var z=0;z<o.widgets.length;z++)o.widgets[z].height&&(M+=o.widgets[z].height);return i?M+(Math.ceil(o.text.length/n)||1)*t:M+t}}function ar(e){var t=e.doc,i=br(e);t.iter(function(n){var o=i(n);o!=n.height&&Cn(n,o)})}function Fi(e,t,i,n){var o=e.display;if(!i&&_e(t).getAttribute("cm-not-content")=="true")return null;var M,z,Z=o.lineSpace.getBoundingClientRect();try{M=t.clientX-Z.left,z=t.clientY-Z.top}catch(xe){return null}var $=In(e,M,z),ie;if(n&&$.xRel>0&&(ie=Rt(e.doc,$.line).text).length==$.ch){var ge=J(ie,ie.length,e.options.tabSize)-ie.length;$=et($.line,Math.max(0,Math.round((M-we(e.display).left)/Bi(e.display))-ge))}return $}function di(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function si(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var o=e.display;if(n&&i<o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>t)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)nn&&Sr(e.doc,t)<o.viewTo&&_i(e);else if(i<=o.viewFrom)nn&&ir(e.doc,i+n)>o.viewFrom?_i(e):(o.viewFrom+=n,o.viewTo+=n);else if(t<=o.viewFrom&&i>=o.viewTo)_i(e);else if(t<=o.viewFrom){var M=Er(e,i,i+n,1);M?(o.view=o.view.slice(M.index),o.viewFrom=M.lineN,o.viewTo+=n):_i(e)}else if(i>=o.viewTo){var z=Er(e,t,t,-1);z?(o.view=o.view.slice(0,z.index),o.viewTo=z.lineN):_i(e)}else{var Z=Er(e,t,t,-1),$=Er(e,i,i+n,1);Z&&$?(o.view=o.view.slice(0,Z.index).concat(Xi(e,Z.lineN,$.lineN)).concat(o.view.slice($.index)),o.viewTo+=n):_i(e)}var ie=o.externalMeasured;ie&&(i<ie.lineN?ie.lineN+=n:t<ie.lineN+ie.size&&(o.externalMeasured=null))}function Ei(e,t,i){e.curOp.viewChanged=!0;var n=e.display,o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var M=n.view[di(e,t)];if(M.node==null)return;var z=M.changes||(M.changes=[]);oe(z,i)==-1&&z.push(i)}function _i(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Er(e,t,i,n){var o=di(e,t),M,z=e.display.view;if(!nn||i==e.doc.first+e.doc.size)return{index:o,lineN:i};for(var Z=e.display.viewFrom,$=0;$<o;$++)Z+=z[$].size;if(Z!=t){if(n>0){if(o==z.length-1)return null;M=Z+z[o].size-t,o++}else M=Z-t;t+=M,i+=M}for(;Sr(e.doc,i)!=i;){if(o==(n<0?0:z.length-1))return null;i+=n*z[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:i}}function kr(e,t,i){var n=e.display,o=n.view;o.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Xi(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Xi(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(di(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Xi(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,di(e,i)))),n.viewTo=i}function Pr(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var o=t[n];!o.hidden&&(!o.node||o.changes)&&++i}return i}function ri(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Cr(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},o=n.cursors=document.createDocumentFragment(),M=n.selection=document.createDocumentFragment(),z=0;z<i.sel.ranges.length;z++){if(!t&&z==i.sel.primIndex)continue;var Z=i.sel.ranges[z];if(Z.from().line>=e.display.viewTo||Z.to().line<e.display.viewFrom)continue;var $=Z.empty();($||e.options.showCursorWhenSelecting)&&Nr(e,Z.head,o),$||ni(e,Z,M)}return n}function Nr(e,t,i){var n=Rn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=i.appendChild(l("div","\xA0","CodeMirror-cursor"));if(o.style.left=n.left+"px",o.style.top=n.top+"px",o.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var M=i.appendChild(l("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));M.style.display="",M.style.left=n.other.left+"px",M.style.top=n.other.top+"px",M.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function ui(e,t){return e.top-t.top||e.left-t.left}function ni(e,t,i){var n=e.display,o=e.doc,M=document.createDocumentFragment(),z=we(e.display),Z=z.left,$=Math.max(n.sizerWidth,me(e)-n.sizer.offsetLeft)-z.right,ie=o.direction=="ltr";function ge(Dt,Vt,dn,$t){Vt<0&&(Vt=0),Vt=Math.round(Vt),$t=Math.round($t),M.appendChild(l("div",null,"CodeMirror-selected","position: absolute; left: "+Dt+`px;
|
|
top: `+Vt+"px; width: "+(dn==null?$-Dt:dn)+`px;
|
|
height: `+($t-Vt)+"px"))}function xe(Dt,Vt,dn){var $t=Rt(o,Dt),Sn=$t.text.length,hi,zi;function wi(Ni,pr){return vi(e,et(Dt,Ni),"div",$t,pr)}function yr(Ni,pr,Ji){var Ki=Xt(e,$t,null,Ni),Ui=pr=="ltr"==(Ji=="after")?"left":"right",Li=Ji=="after"?Ki.begin:Ki.end-(/\s/.test($t.text.charAt(Ki.end-1))?2:1);return wi(Li,Ui)[Ui]}var fr=Ct($t,o.direction);return It(fr,Vt||0,dn==null?Sn:dn,function(Ni,pr,Ji,Ki){var Ui=Ji=="ltr",Li=wi(Ni,Ui?"left":"right"),mr=wi(pr-1,Ui?"right":"left"),Ua=Vt==null&&Ni==0,ca=dn==null&&pr==Sn,tr=Ki==0,Hr=!fr||Ki==fr.length-1;if(mr.top-Li.top<=3){var Vi=(ie?Ua:ca)&&tr,ps=(ie?ca:Ua)&&Hr,qr=Vi?Z:(Ui?Li:mr).left,va=ps?$:(Ui?mr:Li).right;ge(qr,Li.top,va-qr,Li.bottom)}else{var ya,ur,Ba,ms;Ui?(ya=ie&&Ua&&tr?Z:Li.left,ur=ie?$:yr(Ni,Ji,"before"),Ba=ie?Z:yr(pr,Ji,"after"),ms=ie&&ca&&Hr?$:mr.right):(ya=ie?yr(Ni,Ji,"before"):Z,ur=!ie&&Ua&&tr?$:Li.right,Ba=!ie&&ca&&Hr?Z:mr.left,ms=ie?yr(pr,Ji,"after"):$),ge(ya,Li.top,ur-ya,Li.bottom),Li.bottom<mr.top&&ge(Z,Li.bottom,null,mr.top),ge(Ba,mr.top,ms-Ba,mr.bottom)}(!hi||ui(Li,hi)<0)&&(hi=Li),ui(mr,hi)<0&&(hi=mr),(!zi||ui(Li,zi)<0)&&(zi=Li),ui(mr,zi)<0&&(zi=mr)}),{start:hi,end:zi}}var Fe=t.from(),Ne=t.to();if(Fe.line==Ne.line)xe(Fe.line,Fe.ch,Ne.ch);else{var qe=Rt(o,Fe.line),st=Rt(o,Ne.line),_t=Pi(qe)==Pi(st),Lt=xe(Fe.line,Fe.ch,_t?qe.text.length+1:null).end,Ht=xe(Ne.line,_t?0:null,Ne.ch).start;_t&&(Lt.top<Ht.top-2?(ge(Lt.right,Lt.top,null,Lt.bottom),ge(Z,Ht.top,Ht.left,Ht.bottom)):ge(Lt.right,Lt.top,Ht.left-Lt.right,Lt.bottom)),Lt.bottom<Ht.top&&ge(Z,Lt.bottom,null,Ht.top)}i.appendChild(M)}function ji(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||ta(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Eo(e){e.state.focused||(e.display.input.focus(),Ur(e))}function za(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,ta(e))},100)}function Ur(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ke(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),P&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ji(e)}function ta(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ke(e,"blur",e,t),e.state.focused=!1,w(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function _a(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var o=t.view[n],M=e.options.lineWrapping,z=void 0,Z=0;if(o.hidden)continue;if(G&&j<8){var $=o.node.offsetTop+o.node.offsetHeight;z=$-i,i=$}else{var ie=o.node.getBoundingClientRect();z=ie.bottom-ie.top,!M&&o.text.firstChild&&(Z=o.text.firstChild.getBoundingClientRect().right-ie.left-1)}var ge=o.line.height-z;if((ge>.005||ge<-.005)&&(Cn(o.line,z),Va(o.line),o.rest))for(var xe=0;xe<o.rest.length;xe++)Va(o.rest[xe]);if(Z>e.display.sizerWidth){var Fe=Math.ceil(Z/Bi(e.display));Fe>e.display.maxLineLength&&(e.display.maxLineLength=Fe,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}function Va(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function ba(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Ga(e));var o=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,M=Gn(t,n),z=Gn(t,o);if(i&&i.ensure){var Z=i.ensure.from.line,$=i.ensure.to.line;Z<M?(M=Z,z=Gn(t,gi(Rt(t,Z))+e.wrapper.clientHeight)):Math.min($,t.lastLine())>=z&&(M=Gn(t,gi(Rt(t,$))-e.wrapper.clientHeight),z=$)}return{from:M,to:Math.max(z,M+1)}}function Xo(e,t){if(at(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),o=null;if(t.top+n.top<0?o=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),o!=null&&!u){var M=l("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Ga(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Ae(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(M),M.scrollIntoView(o),e.display.lineSpace.removeChild(M)}}function Yo(e,t,i,n){n==null&&(n=0);var o;!e.options.lineWrapping&&t==i&&(t=t.ch?et(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?et(t.line,t.ch+1,"before"):t);for(var M=0;M<5;M++){var z=!1,Z=Rn(e,t),$=!i||i==t?Z:Rn(e,i);o={left:Math.min(Z.left,$.left),top:Math.min(Z.top,$.top)-n,right:Math.max(Z.left,$.left),bottom:Math.max(Z.bottom,$.bottom)+n};var ie=Xa(e,o),ge=e.doc.scrollTop,xe=e.doc.scrollLeft;if(ie.scrollTop!=null&&(ra(e,ie.scrollTop),Math.abs(e.doc.scrollTop-ge)>1&&(z=!0)),ie.scrollLeft!=null&&(xr(e,ie.scrollLeft),Math.abs(e.doc.scrollLeft-xe)>1&&(z=!0)),!z)break}return o}function xo(e,t){var i=Xa(e,t);i.scrollTop!=null&&ra(e,i.scrollTop),i.scrollLeft!=null&&xr(e,i.scrollLeft)}function Xa(e,t){var i=e.display,n=Ri(e.display);t.top<0&&(t.top=0);var o=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,M=te(e),z={};t.bottom-t.top>M&&(t.bottom=t.top+M);var Z=e.doc.height+he(i),$=t.top<n,ie=t.bottom>Z-n;if(t.top<o)z.scrollTop=$?0:t.top;else if(t.bottom>o+M){var ge=Math.min(t.top,(ie?Z:t.bottom)-M);ge!=o&&(z.scrollTop=ge)}var xe=e.options.fixedGutter?0:i.gutters.offsetWidth,Fe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-xe,Ne=me(e)-i.gutters.offsetWidth,qe=t.right-t.left>Ne;return qe&&(t.right=t.left+Ne),t.left<10?z.scrollLeft=0:t.left<Fe?z.scrollLeft=Math.max(0,t.left+xe-(qe?0:10)):t.right>Ne+Fe-3&&(z.scrollLeft=t.right+(qe?0:10)-Ne),z}function Ya(e,t){if(t==null)return;Ea(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function na(e){Ea(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ia(e,t,i){(t!=null||i!=null)&&Ea(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Jo(e,t){Ea(e),e.curOp.scrollToPos=t}function Ea(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=an(e,t.from),n=an(e,t.to);ha(e,i,n,t.margin)}}function ha(e,t,i,n){var o=Xa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});ia(e,o.scrollLeft,o.scrollTop)}function ra(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;k||ma(e,{top:t}),aa(e,t,!0),k&&ma(e),pa(e,100)}function aa(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function xr(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Mn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Vr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+he(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+Ae(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Br=function(e,t,i){this.cm=i;var n=this.vert=l("div",[l("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=l("div",[l("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=o.tabIndex=-1,e(n),e(o),ze(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ze(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&j<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Br.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var o=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var M=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+M)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},Br.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Br.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Br.prototype.zeroWidthHack=function(){var e=a&&!c?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ne,this.disableVert=new ne},Br.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var o=e.getBoundingClientRect(),M=i=="vert"?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1);M!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Br.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var fa=function(){};fa.prototype.update=function(){return{bottom:0,right:0}},fa.prototype.setScrollLeft=function(){},fa.prototype.setScrollTop=function(){},fa.prototype.clear=function(){};function Xr(e,t){t||(t=Vr(e));var i=e.display.barWidth,n=e.display.barHeight;xa(e,t);for(var o=0;o<4&&i!=e.display.barWidth||n!=e.display.barHeight;o++)i!=e.display.barWidth&&e.options.lineWrapping&&_a(e),xa(e,Vr(e)),i=e.display.barWidth,n=e.display.barHeight}function xa(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Ja={native:Br,null:fa};function Ta(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&w(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ja[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ze(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?xr(e,t):ra(e,t)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var Qa=0;function Fr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qa},vr(e.curOp)}function Yr(e){var t=e.curOp;t&&Ko(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;To(i)})}function To(e){for(var t=e.ops,i=0;i<t.length;i++)Qo(t[i]);for(var n=0;n<t.length;n++)Zo(t[n]);for(var o=0;o<t.length;o++)qo(t[o]);for(var M=0;M<t.length;M++)Za(t[M]);for(var z=0;z<t.length;z++)$o(t[z])}function Qo(e){var t=e.cm,i=t.display;wo(t),e.updateMaxLine&&Ci(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Tr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Zo(e){e.updatedDisplay=e.mustUpdate&&Jr(e.cm,e.update)}function qo(e){var t=e.cm,i=t.display;e.updatedDisplay&&_a(t),e.barMeasure=Vr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ye(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Ae(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-me(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Za(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&xr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==T();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Xr(t,e.barMeasure),e.updatedDisplay&&$n(t,e.barMeasure),e.selectionChanged&&ji(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Eo(e.cm)}function $o(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&wa(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&aa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&xr(t,e.scrollLeft,!0,!0),e.scrollToPos){var o=Yo(t,v(n,e.scrollToPos.from),v(n,e.scrollToPos.to),e.scrollToPos.margin);Xo(t,o)}var M=e.maybeHiddenMarkers,z=e.maybeUnhiddenMarkers;if(M)for(var Z=0;Z<M.length;++Z)M[Z].lines.length||Ke(M[Z],"hide");if(z)for(var $=0;$<z.length;++$)z[$].lines.length&&Ke(z[$],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function or(e,t){if(e.curOp)return t();Fr(e);try{return t()}finally{Yr(e)}}function Ii(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Fr(e);try{return t.apply(e,arguments)}finally{Yr(e)}}}function Yi(e){return function(){if(this.curOp)return e.apply(this,arguments);Fr(this);try{return e.apply(this,arguments)}finally{Yr(this)}}}function Mi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Fr(t);try{return e.apply(this,arguments)}finally{Yr(t)}}}function pa(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,U(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=Xe(e,t.highlightFrontier),o=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(M){if(n.line>=e.display.viewFrom){var z=M.styles,Z=M.text.length>e.options.maxHighlightLength?hn(t.mode,n.state):null,$=ue(e,M,n,!0);Z&&(n.state=Z),M.styles=$.styles;var ie=M.styleClasses,ge=$.classes;ge?M.styleClasses=ge:ie&&(M.styleClasses=null);for(var xe=!z||z.length!=M.styles.length||ie!=ge&&(!ie||!ge||ie.bgClass!=ge.bgClass||ie.textClass!=ge.textClass),Fe=0;!xe&&Fe<z.length;++Fe)xe=z[Fe]!=M.styles[Fe];xe&&o.push(n.line),M.stateAfter=n.save(),n.nextLine()}else M.text.length<=e.options.maxHighlightLength&&At(e,M.text,n),M.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return pa(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),o.length&&or(e,function(){for(var M=0;M<o.length;M++)Ei(e,o[M],"text")})}var Tr=function(e,t,i){var n=e.display;this.viewport=t,this.visible=ba(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=me(e),this.force=i,this.dims=bi(e),this.events=[]};Tr.prototype.signal=function(e,t){Ee(e,t)&&this.events.push(arguments)},Tr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ke.apply(null,this.events[e])};function wo(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ae(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ae(e)+"px",t.scrollbarsClipped=!0)}function So(e){if(e.hasFocus())return null;var t=T();if(!t||!g(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&g(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function Co(e){if(!e||!e.activeElt||e.activeElt==T())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&g(document.body,e.anchorNode)&&g(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Jr(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return _i(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Pr(e)==0)return!1;Hi(e)&&(_i(e),t.dims=bi(e));var o=n.first+n.size,M=Math.max(t.visible.from-e.options.viewportMargin,n.first),z=Math.min(o,t.visible.to+e.options.viewportMargin);i.viewFrom<M&&M-i.viewFrom<20&&(M=Math.max(n.first,i.viewFrom)),i.viewTo>z&&i.viewTo-z<20&&(z=Math.min(o,i.viewTo)),nn&&(M=Sr(e.doc,M),z=ir(e.doc,z));var Z=M!=i.viewFrom||z!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;kr(e,M,z),i.viewOffset=gi(Rt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var $=Pr(e);if(!Z&&$==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ie=So(e);return $>4&&(i.lineDiv.style.display="none"),Ao(e,i.updateLineNumbers,t.dims),$>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Co(ie),E(i.cursorDiv),E(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Z&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,pa(e,400)),i.updateLineNumbers=null,!0}function wa(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==me(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+he(e.display)-te(e),i.top)}),t.visible=ba(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=ba(e.display,e.doc,i));if(!Jr(e,t))break;_a(e);var o=Vr(e);ri(e),Xr(e,o),$n(e,o),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ma(e,t){var i=new Tr(e,t);if(Jr(e,i)){_a(e),wa(e,i);var n=Vr(e);ri(e),Xr(e,n),$n(e,n),i.finish()}}function Ao(e,t,i){var n=e.display,o=e.options.lineNumbers,M=n.lineDiv,z=M.firstChild;function Z(qe){var st=qe.nextSibling;return P&&a&&e.display.currentWheelTarget==qe?qe.style.display="none":qe.parentNode.removeChild(qe),st}for(var $=n.view,ie=n.viewFrom,ge=0;ge<$.length;ge++){var xe=$[ge];if(!xe.hidden)if(!xe.node||xe.node.parentNode!=M){var Fe=_o(e,xe,ie,i);M.insertBefore(Fe,z)}else{for(;z!=xe.node;)z=Z(z);var Ne=o&&t!=null&&t<=ie&&xe.lineNumber;xe.changes&&(oe(xe.changes,"gutter")>-1&&(Ne=!1),vo(e,xe,ie,i)),Ne&&(E(xe.lineNumber),xe.lineNumber.appendChild(document.createTextNode(Xn(e.options,ie)))),z=xe.node.nextSibling}ie+=xe.size}for(;z;)z=Z(z)}function Sa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function $n(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ae(e)+"px"}function Mn(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=$i(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,M=n+"px",z=0;z<i.length;z++)if(!i[z].hidden){e.options.fixedGutter&&(i[z].gutter&&(i[z].gutter.style.left=M),i[z].gutterBackground&&(i[z].gutterBackground.style.left=M));var Z=i[z].alignable;if(Z)for(var $=0;$<Z.length;$++)Z[$].style.left=M}e.options.fixedGutter&&(t.gutters.style.left=n+o+"px")}function Hi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Xn(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var o=n.measure.appendChild(l("div",[l("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),M=o.firstChild.offsetWidth,z=o.offsetWidth-M;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(M,n.lineGutter.offsetWidth-z)+1,n.lineNumWidth=n.lineNumInnerWidth+z,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Sa(e.display),!0}return!1}function sr(e,t){for(var i=[],n=!1,o=0;o<e.length;o++){var M=e[o],z=null;if(typeof M!="string"&&(z=M.style,M=M.className),M=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:M,style:z})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function oa(e){var t=e.gutters,i=e.gutterSpecs;E(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var o=i[n],M=o.className,z=o.style,Z=t.appendChild(l("div",null,"CodeMirror-gutter "+M));z&&(Z.style.cssText=z),M=="CodeMirror-linenumbers"&&(e.lineGutter=Z,Z.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Sa(e)}function Lr(e){oa(e.display),si(e),Mn(e)}function ga(e,t,i,n){var o=this;this.input=i,o.scrollbarFiller=l("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=l("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=_("div",null,"CodeMirror-code"),o.selectionDiv=l("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=l("div",null,"CodeMirror-cursors"),o.measure=l("div",null,"CodeMirror-measure"),o.lineMeasure=l("div",null,"CodeMirror-measure"),o.lineSpace=_("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var M=_("div",[o.lineSpace],"CodeMirror-lines");o.mover=l("div",[M],null,"position: relative"),o.sizer=l("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=l("div",null,null,"position: absolute; height: "+fe+"px; width: 1px;"),o.gutters=l("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=l("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=l("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),G&&j<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),!P&&!(k&&r)&&(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=sr(n.gutters,n.lineNumbers),oa(o),i.init(o)}var jr=0,Wi=null;G?Wi=-.53:k?Wi=15:y?Wi=-.7:p&&(Wi=-1/3);function Ca(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function qa(e){var t=Ca(e);return t.x*=Wi,t.y*=Wi,t}function $a(e,t){var i=Ca(t),n=i.x,o=i.y,M=e.display,z=M.scroller,Z=z.scrollWidth>z.clientWidth,$=z.scrollHeight>z.clientHeight;if(!(n&&Z||o&&$))return;if(o&&a&&P){e:for(var ie=t.target,ge=M.view;ie!=z;ie=ie.parentNode)for(var xe=0;xe<ge.length;xe++)if(ge[xe].node==ie){e.display.currentWheelTarget=ie;break e}}if(n&&!k&&!m&&Wi!=null){o&&$&&ra(e,Math.max(0,z.scrollTop+o*Wi)),xr(e,Math.max(0,z.scrollLeft+n*Wi)),(!o||o&&$)&&ee(t),M.wheelStartX=null;return}if(o&&Wi!=null){var Fe=o*Wi,Ne=e.doc.scrollTop,qe=Ne+M.wrapper.clientHeight;Fe<0?Ne=Math.max(0,Ne+Fe-50):qe=Math.min(e.doc.height,qe+Fe+50),ma(e,{top:Ne,bottom:qe})}jr<20&&(M.wheelStartX==null?(M.wheelStartX=z.scrollLeft,M.wheelStartY=z.scrollTop,M.wheelDX=n,M.wheelDY=o,setTimeout(function(){if(M.wheelStartX==null)return;var st=z.scrollLeft-M.wheelStartX,_t=z.scrollTop-M.wheelStartY,Lt=_t&&M.wheelDY&&_t/M.wheelDY||st&&M.wheelDX&&st/M.wheelDX;if(M.wheelStartX=M.wheelStartY=null,!Lt)return;Wi=(Wi*jr+Lt)/(jr+1),++jr},200)):(M.wheelDX+=n,M.wheelDY+=o))}var lr=function(e,t){this.ranges=e,this.primIndex=t};lr.prototype.primary=function(){return this.ranges[this.primIndex]},lr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!Wn(i.anchor,n.anchor)||!Wn(i.head,n.head))return!1}return!0},lr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Qn(mn(this.ranges[t].anchor),mn(this.ranges[t].head));return new lr(e,this.primIndex)},lr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},lr.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(jt(t,n.from())>=0&&jt(e,n.to())<=0)return i}return-1};var Qn=function(e,t){this.anchor=e,this.head=t};Qn.prototype.from=function(){return Dn(this.anchor,this.head)},Qn.prototype.to=function(){return sn(this.anchor,this.head)},Qn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function wr(e,t,i){var n=e&&e.options.selectionsMayTouch,o=t[i];t.sort(function(Fe,Ne){return jt(Fe.from(),Ne.from())}),i=oe(t,o);for(var M=1;M<t.length;M++){var z=t[M],Z=t[M-1],$=jt(Z.to(),z.from());if(n&&!z.empty()?$>0:$>=0){var ie=Dn(Z.from(),z.from()),ge=sn(Z.to(),z.to()),xe=Z.empty()?z.from()==z.head:Z.from()==Z.head;M<=i&&--i,t.splice(--M,2,new Qn(xe?ge:ie,xe?ie:ge))}}return new lr(t,i)}function Dr(e,t){return new lr([new Qn(e,t||e)],0)}function Ir(e){return e.text?et(e.from.line+e.text.length-1,Le(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function eo(e,t){if(jt(e,t.from)<0)return e;if(jt(e,t.to)<=0)return Ir(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ir(t).ch-t.to.ch),et(i,n)}function Aa(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var o=e.sel.ranges[n];i.push(new Qn(eo(o.anchor,t),eo(o.head,t)))}return wr(e.cm,i,e.sel.primIndex)}function Oo(e,t,i){return e.line==t.line?et(i.line,e.ch-t.ch+i.ch):et(i.line+(e.line-t.line),e.ch)}function Ro(e,t,i){for(var n=[],o=et(e.first,0),M=o,z=0;z<t.length;z++){var Z=t[z],$=Oo(Z.from,o,M),ie=Oo(Ir(Z),o,M);if(o=Z.to,M=ie,i=="around"){var ge=e.sel.ranges[z],xe=jt(ge.head,ge.anchor)<0;n[z]=new Qn(xe?ie:$,xe?$:ie)}else n[z]=new Qn($,$)}return new lr(n,e.sel.primIndex)}function Qr(e){e.doc.mode=xt(e.options,e.doc.modeOption),to(e)}function to(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,pa(e,100),e.state.modeGen++,e.curOp&&si(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&Le(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,i,n){function o(Ht){return i?i[Ht]:null}function M(Ht,Dt,Vt){qi(Ht,Dt,Vt,n),Oi(Ht,"change",Ht,t)}function z(Ht,Dt){for(var Vt=[],dn=Ht;dn<Dt;++dn)Vt.push(new Ti(ie[dn],o(dn),n));return Vt}var Z=t.from,$=t.to,ie=t.text,ge=Rt(e,Z.line),xe=Rt(e,$.line),Fe=Le(ie),Ne=o(ie.length-1),qe=$.line-Z.line;if(t.full)e.insert(0,z(0,ie.length)),e.remove(ie.length,e.size-ie.length);else if(gs(e,t)){var st=z(0,ie.length-1);M(xe,xe.text,Ne),qe&&e.remove(Z.line,qe),st.length&&e.insert(Z.line,st)}else if(ge==xe)if(ie.length==1)M(ge,ge.text.slice(0,Z.ch)+Fe+ge.text.slice($.ch),Ne);else{var _t=z(1,ie.length-1);_t.push(new Ti(Fe+ge.text.slice($.ch),Ne,n)),M(ge,ge.text.slice(0,Z.ch)+ie[0],o(0)),e.insert(Z.line+1,_t)}else if(ie.length==1)M(ge,ge.text.slice(0,Z.ch)+ie[0]+xe.text.slice($.ch),o(0)),e.remove(Z.line+1,qe);else{M(ge,ge.text.slice(0,Z.ch)+ie[0],o(0)),M(xe,Fe+xe.text.slice($.ch),Ne);var Lt=z(1,ie.length-1);qe>1&&e.remove(Z.line+1,qe-1),e.insert(Z.line+1,Lt)}Oi(e,"change",e,t)}function sa(e,t,i){function n(o,M,z){if(o.linked)for(var Z=0;Z<o.linked.length;++Z){var $=o.linked[Z];if($.doc==M)continue;var ie=z&&$.sharedHist;if(i&&!ie)continue;t($.doc,ie),n($.doc,o,ie)}}n(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ar(e),Qr(e),ys(e),e.options.lineWrapping||Ci(e),e.options.mode=t.modeOption,si(e)}function ys(e){(e.doc.direction=="rtl"?N:w)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){or(e,function(){ys(e),si(e)})}function Lo(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ns(e,t){var i={from:mn(t.from),to:Ir(t),text:Vn(e,t.from,t.to)};return Es(e,i,t.from.line,t.to.line+1),sa(e,function(n){return Es(n,i,t.from.line,t.to.line+1)},!0),i}function _s(e){for(;e.length;){var t=Le(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return _s(e.done),Le(e.done);if(e.done.length&&!Le(e.done).ranges)return Le(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Le(e.done)}function bs(e,t,i,n){var o=e.history;o.undone.length=0;var M=+new Date,z,Z;if((o.lastOp==n||o.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&o.lastModTime>M-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(z=pl(o,o.lastOp==n)))Z=Le(z.changes),jt(t.from,t.to)==0&&jt(t.from,Z.to)==0?Z.to=Ir(t):z.changes.push(ns(e,t));else{var $=Le(o.done);for((!$||!$.ranges)&&Do(e.sel,o.done),z={changes:[ns(e,t)],generation:o.generation},o.done.push(z);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(i),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=M,o.lastOp=o.lastSelOp=n,o.lastOrigin=o.lastSelOrigin=t.origin,Z||Ke(e,"historyAdded")}function ml(e,t,i,n){var o=t.charAt(0);return o=="*"||o=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var o=e.history,M=n&&n.origin;i==o.lastSelOp||M&&o.lastSelOrigin==M&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==M||ml(e,M,Le(o.done),t))?o.done[o.done.length-1]=t:Do(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=M,o.lastSelOp=i,n&&n.clearRedo!==!1&&_s(o.undone)}function Do(e,t){var i=Le(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Es(e,t,i,n){var o=t["spans_"+e.id],M=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(z){z.markedSpans&&((o||(o=t["spans_"+e.id]={}))[M]=z.markedSpans),++M})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],o=0;o<t.text.length;++o)n.push(vl(i[o]));return n}function xs(e,t){var i=yl(e,t),n=fi(e,t);if(!i)return n;if(!n)return i;for(var o=0;o<i.length;++o){var M=i[o],z=n[o];if(M&&z){e:for(var Z=0;Z<z.length;++Z){for(var $=z[Z],ie=0;ie<M.length;++ie)if(M[ie].marker==$.marker)continue e;M.push($)}}else z&&(i[o]=z)}return i}function Oa(e,t,i){for(var n=[],o=0;o<e.length;++o){var M=e[o];if(M.ranges){n.push(i?lr.prototype.deepCopy.call(M):M);continue}var z=M.changes,Z=[];n.push({changes:Z});for(var $=0;$<z.length;++$){var ie=z[$],ge=void 0;if(Z.push({from:ie.from,to:ie.to,text:ie.text}),t)for(var xe in ie)(ge=xe.match(/^spans_(\d+)$/))&&(oe(t,Number(ge[1]))>-1&&(Le(Z)[xe]=ie[xe],delete ie[xe]))}}return n}function is(e,t,i,n){if(n){var o=e.anchor;if(i){var M=jt(t,o)<0;M!=jt(i,o)<0?(o=t,t=i):M!=jt(t,i)<0&&(t=i)}return new Qn(o,t)}else return new Qn(i||t,t)}function Io(e,t,i,n,o){o==null&&(o=e.cm&&(e.cm.display.shift||e.extend)),er(e,new lr([is(e.sel.primary(),t,i,o)],0),n)}function Ts(e,t,i){for(var n=[],o=e.cm&&(e.cm.display.shift||e.extend),M=0;M<e.sel.ranges.length;M++)n[M]=is(e.sel.ranges[M],t[M],null,o);var z=wr(e.cm,n,e.sel.primIndex);er(e,z,i)}function rs(e,t,i,n){var o=e.sel.ranges.slice(0);o[t]=i,er(e,wr(e.cm,o,e.sel.primIndex),n)}function ws(e,t,i,n){er(e,Dr(t,i),n)}function _l(e,t,i){var n={ranges:t.ranges,update:function(o){this.ranges=[];for(var M=0;M<o.length;M++)this.ranges[M]=new Qn(v(e,o[M].anchor),v(e,o[M].head))},origin:i&&i.origin};return Ke(e,"beforeSelectionChange",e,n),e.cm&&Ke(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?wr(e.cm,n.ranges,n.ranges.length-1):t}function Ss(e,t,i){var n=e.history.done,o=Le(n);o&&o.ranges?(n[n.length-1]=t,Mo(e,t,i)):er(e,t,i)}function er(e,t,i){Mo(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Mo(e,t,i){(Ee(e,"beforeSelectionChange")||e.cm&&Ee(e.cm,"beforeSelectionChange"))&&(t=_l(e,t,i));var n=i&&i.bias||(jt(t.primary().head,e.sel.primary().head)<0?-1:1);Cs(e,Os(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&na(e.cm)}function Cs(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ce(e.cm)),Oi(e,"cursorActivity",e)}function As(e){Cs(e,Os(e,e.sel,null,!1))}function Os(e,t,i,n){for(var o,M=0;M<t.ranges.length;M++){var z=t.ranges[M],Z=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[M],$=ko(e,z.anchor,Z&&Z.anchor,i,n),ie=ko(e,z.head,Z&&Z.head,i,n);(o||$!=z.anchor||ie!=z.head)&&(o||(o=t.ranges.slice(0,M)),o[M]=new Qn($,ie))}return o?wr(e.cm,o,t.primIndex):t}function Ra(e,t,i,n,o){var M=Rt(e,t.line);if(M.markedSpans)for(var z=0;z<M.markedSpans.length;++z){var Z=M.markedSpans[z],$=Z.marker,ie="selectLeft"in $?!$.selectLeft:$.inclusiveLeft,ge="selectRight"in $?!$.selectRight:$.inclusiveRight;if((Z.from==null||(ie?Z.from<=t.ch:Z.from<t.ch))&&(Z.to==null||(ge?Z.to>=t.ch:Z.to>t.ch))){if(o&&(Ke($,"beforeCursorEnter"),$.explicitlyCleared))if(M.markedSpans){--z;continue}else break;if(!$.atomic)continue;if(i){var xe=$.find(n<0?1:-1),Fe=void 0;if((n<0?ge:ie)&&(xe=Rs(e,xe,-n,xe&&xe.line==t.line?M:null)),xe&&xe.line==t.line&&(Fe=jt(xe,i))&&(n<0?Fe<0:Fe>0))return Ra(e,xe,t,n,o)}var Ne=$.find(n<0?-1:1);return(n<0?ie:ge)&&(Ne=Rs(e,Ne,n,Ne.line==t.line?M:null)),Ne?Ra(e,Ne,t,n,o):null}}return t}function ko(e,t,i,n,o){var M=n||1,z=Ra(e,t,i,M,o)||!o&&Ra(e,t,i,M,!0)||Ra(e,t,i,-M,o)||!o&&Ra(e,t,i,-M,!0);return z||(e.cantEdit=!0,et(e.first,0))}function Rs(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?v(e,et(t.line-1)):null:i>0&&t.ch==(n||Rt(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+i)}function Ls(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),Oe)}function Ds(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(o,M,z,Z){o&&(n.from=v(e,o)),M&&(n.to=v(e,M)),z&&(n.text=z),Z!==void 0&&(n.origin=Z)}),Ke(e,"beforeChange",e,n),e.cm&&Ke(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function La(e,t,i){if(e.cm){if(!e.cm.curOp)return Ii(e.cm,La)(e,t,i);if(e.cm.state.suppressEdits)return}if((Ee(e,"beforeChange")||e.cm&&Ee(e.cm,"beforeChange"))&&(t=Ds(e,t,!0),!t))return;var n=tn&&!i&&dr(e,t.from,t.to);if(n)for(var o=n.length-1;o>=0;--o)Is(e,{from:n[o].from,to:n[o].to,text:o?[""]:t.text,origin:t.origin});else Is(e,t)}function Is(e,t){if(t.text.length==1&&t.text[0]==""&&jt(t.from,t.to)==0)return;var i=Aa(e,t);bs(e,t,i,e.cm?e.cm.curOp.id:NaN),no(e,t,i,fi(e,t));var n=[];sa(e,function(o,M){!M&&oe(n,o.history)==-1&&(Ns(o.history,t),n.push(o.history)),no(o,t,null,fi(o,t))})}function Po(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var o=e.history,M,z=e.sel,Z=t=="undo"?o.done:o.undone,$=t=="undo"?o.undone:o.done,ie=0;ie<Z.length&&!(M=Z[ie],i?M.ranges&&!M.equals(e.sel):!M.ranges);ie++);if(ie==Z.length)return;for(o.lastOrigin=o.lastSelOrigin=null;;)if(M=Z.pop(),M.ranges){if(Do(M,$),i&&!M.equals(e.sel)){er(e,M,{clearRedo:!1});return}z=M}else if(n){Z.push(M);return}else break;var ge=[];Do(z,$),$.push({changes:ge,generation:o.generation}),o.generation=M.generation||++o.maxGeneration;for(var xe=Ee(e,"beforeChange")||e.cm&&Ee(e.cm,"beforeChange"),Fe=function(st){var _t=M.changes[st];if(_t.origin=t,xe&&!Ds(e,_t,!1))return Z.length=0,{};ge.push(ns(e,_t));var Lt=st?Aa(e,_t):Le(Z);no(e,_t,Lt,xs(e,_t)),!st&&e.cm&&e.cm.scrollIntoView({from:_t.from,to:Ir(_t)});var Ht=[];sa(e,function(Dt,Vt){!Vt&&oe(Ht,Dt.history)==-1&&(Ns(Dt.history,_t),Ht.push(Dt.history)),no(Dt,_t,null,xs(Dt,_t))})},Ne=M.changes.length-1;Ne>=0;--Ne){var qe=Fe(Ne);if(qe)return qe.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new lr(tt(e.sel.ranges,function(o){return new Qn(et(o.anchor.line+t,o.anchor.ch),et(o.head.line+t,o.head.ch))}),e.sel.primIndex),e.cm){si(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Ei(e.cm,n,"gutter")}}function no(e,t,i,n){if(e.cm&&!e.cm.curOp)return Ii(e.cm,no)(e,t,i,n);if(t.to.line<e.first){Ms(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var o=t.text.length-1-(e.first-t.from.line);Ms(e,o),t={from:et(e.first,0),to:et(t.to.line+o,t.to.ch),text:[Le(t.text)],origin:t.origin}}var M=e.lastLine();t.to.line>M&&(t={from:t.from,to:et(M,Rt(e,M).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Vn(e,t.from,t.to),i||(i=Aa(e,t)),e.cm?bl(e.cm,t,n):ts(e,t,n),Mo(e,i,Oe),e.cantEdit&&ko(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,i){var n=e.doc,o=e.display,M=t.from,z=t.to,Z=!1,$=M.line;e.options.lineWrapping||($=Qt(Pi(Rt(n,M.line))),n.iter($,z.line+1,function(Ne){if(Ne==o.maxLine)return Z=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ce(e),ts(n,t,i,br(e)),e.options.lineWrapping||(n.iter($,M.line+t.text.length,function(Ne){var qe=Kn(Ne);qe>o.maxLineLength&&(o.maxLine=Ne,o.maxLineLength=qe,o.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),Bt(n,M.line),pa(e,400);var ie=t.text.length-(z.line-M.line)-1;t.full?si(e):M.line==z.line&&t.text.length==1&&!gs(e.doc,t)?Ei(e,M.line,"text"):si(e,M.line,z.line+1,ie);var ge=Ee(e,"changes"),xe=Ee(e,"change");if(xe||ge){var Fe={from:M,to:z,text:t.text,removed:t.removed,origin:t.origin};xe&&Oi(e,"change",e,Fe),ge&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Fe)}e.display.selForContextMenu=null}function Da(e,t,i,n,o){var M;n||(n=i),jt(n,i)<0&&(M=[n,i],i=M[0],n=M[1]),typeof t=="string"&&(t=e.splitLines(t)),La(e,{from:i,to:n,text:t,origin:o})}function ks(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Ps(e,t,i,n){for(var o=0;o<e.length;++o){var M=e[o],z=!0;if(M.ranges){M.copied||(M=e[o]=M.deepCopy(),M.copied=!0);for(var Z=0;Z<M.ranges.length;Z++)ks(M.ranges[Z].anchor,t,i,n),ks(M.ranges[Z].head,t,i,n);continue}for(var $=0;$<M.changes.length;++$){var ie=M.changes[$];if(i<ie.from.line)ie.from=et(ie.from.line+n,ie.from.ch),ie.to=et(ie.to.line+n,ie.to.ch);else if(t<=ie.to.line){z=!1;break}}z||(e.splice(0,o+1),o=0)}}function Ns(e,t){var i=t.from.line,n=t.to.line,o=t.text.length-(n-i)-1;Ps(e.done,i,n,o),Ps(e.undone,i,n,o)}function io(e,t,i,n){var o=t,M=t;return typeof t=="number"?M=Rt(e,K(e,t)):o=Qt(t),o==null?null:(n(M,o)&&e.cm&&Ei(e.cm,o,i),M)}function ro(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}ro.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var o=this.lines[i];this.height-=o.height,kt(o),Oi(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function ao(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var o=e[n];t+=o.chunkSize(),i+=o.height,o.parent=this}this.size=t,this.height=i,this.parent=null}ao.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(e<o){var M=Math.min(t,o-e),z=n.height;if(n.removeInner(e,M),this.height-=z-n.height,o==M&&(this.children.splice(i--,1),n.parent=null),(t-=M)==0)break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ro))){var Z=[];this.collapse(Z),this.children=[new ro(Z)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var o=this.children[n],M=o.chunkSize();if(e<=M){if(o.insertInner(e,t,i),o.lines&&o.lines.length>50){for(var z=o.lines.length%25+25,Z=z;Z<o.lines.length;){var $=new ro(o.lines.slice(Z,Z+=25));o.height-=$.height,this.children.splice(++n,0,$),$.parent=this}o.lines=o.lines.slice(0,z),this.maybeSpill()}break}e-=M}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new ao(t);if(e.parent){e.size-=i.size,e.height-=i.height;var o=oe(e.parent.children,e);e.parent.children.splice(o+1,0,i)}else{var n=new ao(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var o=this.children[n],M=o.chunkSize();if(e<M){var z=Math.min(t,M-e);if(o.iterN(e,z,i))return!0;if((t-=z)==0)break;e=0}else e-=M}}};var oo=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};oo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Qt(i);if(n==null||!t)return;for(var o=0;o<t.length;++o)t[o]==this&&t.splice(o--,1);t.length||(i.widgets=null);var M=ea(this);Cn(i,Math.max(0,i.height-M)),e&&(or(e,function(){Us(e,i,-M),Ei(e,n,"widget")}),Oi(e,"lineWidgetCleared",e,this,n))},oo.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var o=ea(this)-t;if(!o)return;Zi(this.doc,n)||Cn(n,n.height+o),i&&or(i,function(){i.curOp.forceUpdate=!0,Us(i,n,o),Oi(i,"lineWidgetChanged",i,e,Qt(n))})},Te(oo);function Us(e,t,i){gi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ya(e,i)}function El(e,t,i,n){var o=new oo(e,i,n),M=e.cm;return M&&o.noHScroll&&(M.display.alignWidgets=!0),io(e,t,"widget",function(z){var Z=z.widgets||(z.widgets=[]);if(o.insertAt==null?Z.push(o):Z.splice(Math.min(Z.length-1,Math.max(0,o.insertAt)),0,o),o.line=z,M&&!Zi(e,z)){var $=gi(z)<e.scrollTop;Cn(z,z.height+ea(o)),$&&Ya(M,o.height),M.curOp.forceUpdate=!0}return!0}),M&&Oi(M,"lineWidgetAdded",M,o,typeof t=="number"?t:Qt(t)),o}var Bs=0,la=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Bs};la.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Fr(e),Ee(this,"clear")){var i=this.find();i&&Oi(this,"clear",i.from,i.to)}for(var n=null,o=null,M=0;M<this.lines.length;++M){var z=this.lines[M],Z=ci(z.markedSpans,this);e&&!this.collapsed?Ei(e,Qt(z),"text"):e&&(Z.to!=null&&(o=Qt(z)),Z.from!=null&&(n=Qt(z))),z.markedSpans=cr(z.markedSpans,Z),Z.from==null&&this.collapsed&&!Zi(this.doc,z)&&e&&Cn(z,Ri(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var $=0;$<this.lines.length;++$){var ie=Pi(this.lines[$]),ge=Kn(ie);ge>e.display.maxLineLength&&(e.display.maxLine=ie,e.display.maxLineLength=ge,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&si(e,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&As(e.doc)),e&&Oi(e,"markerCleared",e,this,n,o),t&&Yr(e),this.parent&&this.parent.clear()},la.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,o=0;o<this.lines.length;++o){var M=this.lines[o],z=ci(M.markedSpans,this);if(z.from!=null&&(i=et(t?M:Qt(M),z.from),e==-1))return i;if(z.to!=null&&(n=et(t?M:Qt(M),z.to),e==1))return n}return i&&{from:i,to:n}},la.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;or(n,function(){var o=t.line,M=Qt(t.line),z=Ie(n,M);if(z&&(xn(z),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Zi(i.doc,o)&&i.height!=null){var Z=i.height;i.height=null;var $=ea(i)-Z;$&&Cn(o,o.height+$)}Oi(n,"markerChanged",n,e)})},la.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||oe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},la.prototype.detachLine=function(e){if(this.lines.splice(oe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Te(la);function Ia(e,t,i,n,o){if(n&&n.shared)return xl(e,t,i,n,o);if(e.cm&&!e.cm.curOp)return Ii(e.cm,Ia)(e,t,i,n,o);var M=new la(e,o),z=jt(t,i);if(n&&A(n,M,!1),z>0||z==0&&M.clearWhenEmpty!==!1)return M;if(M.replacedWith&&(M.collapsed=!0,M.widgetNode=_("span",[M.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||M.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(M.widgetNode.insertLeft=!0)),M.collapsed){if(Si(e,t.line,t,i,M)||t.line!=i.line&&Si(e,i.line,t,i,M))throw new Error("Inserting collapsed marker partially overlapping an existing one");qn()}M.addToHistory&&bs(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Z=t.line,$=e.cm,ie;if(e.iter(Z,i.line+1,function(xe){$&&M.collapsed&&!$.options.lineWrapping&&Pi(xe)==$.display.maxLine&&(ie=!0),M.collapsed&&Z!=t.line&&Cn(xe,0),gr(xe,new ln(M,Z==t.line?t.ch:null,Z==i.line?i.ch:null)),++Z}),M.collapsed&&e.iter(t.line,i.line+1,function(xe){Zi(e,xe)&&Cn(xe,0)}),M.clearOnEnter&&ze(M,"beforeCursorEnter",function(){return M.clear()}),M.readOnly&&(yn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),M.collapsed&&(M.id=++Bs,M.atomic=!0),$){if(ie&&($.curOp.updateMaxLine=!0),M.collapsed)si($,t.line,i.line+1);else if(M.className||M.startStyle||M.endStyle||M.css||M.attributes||M.title)for(var ge=t.line;ge<=i.line;ge++)Ei($,ge,"text");M.atomic&&As($.doc),Oi($,"markerAdded",$,M)}return M}var so=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};so.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Oi(this,"clear")},so.prototype.find=function(e,t){return this.primary.find(e,t)},Te(so);function xl(e,t,i,n,o){n=A(n),n.shared=!1;var M=[Ia(e,t,i,n,o)],z=M[0],Z=n.widgetNode;return sa(e,function($){Z&&(n.widgetNode=Z.cloneNode(!0)),M.push(Ia($,v($,t),v($,i),n,o));for(var ie=0;ie<$.linked.length;++ie)if($.linked[ie].isParent)return;z=Le(M)}),new so(M,z)}function Fs(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var n=t[i],o=n.find(),M=e.clipPos(o.from),z=e.clipPos(o.to);if(jt(M,z)){var Z=Ia(e,M,z,n.primary,n.primary.type);n.markers.push(Z),Z.parent=n}}}function wl(e){for(var t=function(n){var o=e[n],M=[o.primary.doc];sa(o.primary.doc,function($){return M.push($)});for(var z=0;z<o.markers.length;z++){var Z=o.markers[z];oe(M,Z.doc)==-1&&(Z.parent=null,o.markers.splice(z--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,hr=function(e,t,i,n,o){if(!(this instanceof hr))return new hr(e,t,i,n,o);i==null&&(i=0),ao.call(this,[new ro([new Ti("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var M=et(i,0);this.sel=Dr(M),this.history=new Lo(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=o=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:M,to:M,text:e}),er(this,Dr(M),Oe)};hr.prototype=Et(ao.prototype,{constructor:hr,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=kn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Mi(function(e){var t=et(this.first,0),i=this.first+this.size-1;La(this,{from:t,to:et(i,Rt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ia(this.cm,0,0),er(this,Dr(t),Oe)}),replaceRange:function(e,t,i,n){t=v(this,t),i=i?v(this,i):t,Da(this,e,t,i,n)},getRange:function(e,t,i){var n=Vn(this,v(this,e),v(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ei(this,e))return Rt(this,e)},getLineNumber:function(e){return Qt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Rt(this,e)),Pi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return v(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Mi(function(e,t,i){ws(this,v(this,typeof e=="number"?et(e,t||0):e),null,i)}),setSelection:Mi(function(e,t,i){ws(this,v(this,e),v(this,t||e),i)}),extendSelection:Mi(function(e,t,i){Io(this,v(this,e),t&&v(this,t),i)}),extendSelections:Mi(function(e,t){Ts(this,F(this,e),t)}),extendSelectionsBy:Mi(function(e,t){var i=tt(this.sel.ranges,e);Ts(this,F(this,i),t)}),setSelections:Mi(function(e,t,i){if(!e.length)return;for(var n=[],o=0;o<e.length;o++)n[o]=new Qn(v(this,e[o].anchor),v(this,e[o].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),er(this,wr(this.cm,n,t),i)}),addSelection:Mi(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Qn(v(this,e),v(this,t||e))),er(this,wr(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var o=Vn(this,t[n].from(),t[n].to());i=i?i.concat(o):o}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var o=Vn(this,i[n].from(),i[n].to());e!==!1&&(o=o.join(e||this.lineSeparator())),t[n]=o}return t},replaceSelection:function(e,t,i){for(var n=[],o=0;o<this.sel.ranges.length;o++)n[o]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:Mi(function(e,t,i){for(var n=[],o=this.sel,M=0;M<o.ranges.length;M++){var z=o.ranges[M];n[M]={from:z.from(),to:z.to(),text:this.splitLines(e[M]),origin:i}}for(var Z=t&&t!="end"&&Ro(this,n,t),$=n.length-1;$>=0;$--)La(this,n[$]);Z?Ss(this,Z):this.cm&&na(this.cm)}),undo:Mi(function(){Po(this,"undo")}),redo:Mi(function(){Po(this,"redo")}),undoSelection:Mi(function(){Po(this,"undo",!0)}),redoSelection:Mi(function(){Po(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var o=0;o<e.undone.length;o++)e.undone[o].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Lo(this.history.maxGeneration),sa(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Oa(this.history.done),undone:Oa(this.history.undone)}},setHistory:function(e){var t=this.history=new Lo(this.history.maxGeneration);t.done=Oa(e.done.slice(0),null,!0),t.undone=Oa(e.undone.slice(0),null,!0)},setGutterMarker:Mi(function(e,t,i){return io(this,e,"gutter",function(n){var o=n.gutterMarkers||(n.gutterMarkers={});return o[t]=i,!i&>(o)&&(n.gutterMarkers=null),!0})}),clearGutter:Mi(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&io(t,i,"gutter",function(){return i.gutterMarkers[e]=null,gt(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!ei(this,e))return null;if(t=e,e=Rt(this,e),!e)return null}else if(t=Qt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Mi(function(e,t,i){return io(this,e,t=="gutter"?"gutter":"class",function(n){var o=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[o])n[o]=i;else{if(O(i).test(n[o]))return!1;n[o]+=" "+i}return!0})}),removeLineClass:Mi(function(e,t,i){return io(this,e,t=="gutter"?"gutter":"class",function(n){var o=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",M=n[o];if(M)if(i==null)n[o]=null;else{var z=M.match(O(i));if(!z)return!1;var Z=z.index+z[0].length;n[o]=M.slice(0,z.index)+(!z.index||Z==M.length?"":" ")+M.slice(Z)||null}else return!1;return!0})}),addLineWidget:Mi(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ia(this,v(this,e),v(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=v(this,e),Ia(this,e,e,i,"bookmark")},findMarksAt:function(e){e=v(this,e);var t=[],i=Rt(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var o=i[n];(o.from==null||o.from<=e.ch)&&(o.to==null||o.to>=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,i){e=v(this,e),t=v(this,t);var n=[],o=e.line;return this.iter(e.line,t.line+1,function(M){var z=M.markedSpans;if(z)for(var Z=0;Z<z.length;Z++){var $=z[Z];!($.to!=null&&o==e.line&&e.ch>=$.to||$.from==null&&o!=e.line||$.from!=null&&o==t.line&&$.from>=t.ch)&&(!i||i($.marker))&&n.push($.marker.parent||$.marker)}++o}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(o){var M=o.text.length+n;if(M>e)return t=e,!0;e-=M,++i}),v(this,et(i,t))},indexFromPos:function(e){e=v(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new hr(kn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new hr(kn(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,Fs(this)),n},unlinkDoc:function(e){if(e instanceof xi&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(Fs(this));break}if(e.history==this.history){var n=[e.id];sa(e,function(o){return n.push(o.id)},!0),e.history=new Lo(null),e.history.done=Oa(this.history.done,n),e.history.undone=Oa(this.history.undone,n)}},iterLinkedDocs:function(e){sa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):vt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Mi(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),hr.prototype.eachLine=hr.prototype.iter;var js=0;function Cl(e){var t=this;if(Hs(t),at(t,e)||Rr(t.display,e))return;ee(e),G&&(js=+new Date);var i=Fi(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var o=n.length,M=Array(o),z=0,Z=function(){++z==o&&Ii(t,function(){i=v(t.doc,i);var Ne={from:i,to:i,text:t.doc.splitLines(M.filter(function(qe){return qe!=null}).join(t.doc.lineSeparator())),origin:"paste"};La(t.doc,Ne),Ss(t.doc,Dr(v(t.doc,i),v(t.doc,Ir(Ne))))})()},$=function(Ne,qe){if(t.options.allowDropFileTypes&&oe(t.options.allowDropFileTypes,Ne.type)==-1){Z();return}var st=new FileReader;st.onerror=function(){return Z()},st.onload=function(){var _t=st.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(_t)){Z();return}M[qe]=_t,Z()},st.readAsText(Ne)},ie=0;ie<n.length;ie++)$(n[ie],ie);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ge=e.dataTransfer.getData("Text");if(ge){var xe;if(t.state.draggingText&&!t.state.draggingText.copy&&(xe=t.listSelections()),Mo(t.doc,Dr(i,i)),xe)for(var Fe=0;Fe<xe.length;++Fe)Da(t.doc,"",xe[Fe].anchor,xe[Fe].head,"drag");t.replaceSelection(ge,"around","paste"),t.display.input.focus()}}catch(Ne){}}}function Al(e,t){if(G&&(!e.state.draggingText||+new Date-js<100)){pe(t);return}if(at(e,t)||Rr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var i=l("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),m&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Fi(e,t);if(!i)return;var n=document.createDocumentFragment();Nr(e,i,n),e.display.dragCursor||(e.display.dragCursor=l("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),b(e.display.dragCursor,n)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var o=t[n].CodeMirror;o&&i.push(o)}i.length&&i[0].operation(function(){for(var M=0;M<i.length;M++)e(i[M])})}var Ks=!1;function Rl(){if(Ks)return;Ll(),Ks=!0}function Ll(){var e;ze(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Dl)},100))}),ze(window,"blur",function(){return Ws(ta)})}function Dl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ua={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},lo=0;lo<10;lo++)ua[lo+48]=ua[lo+96]=String(lo);for(var No=65;No<=90;No++)ua[No]=String.fromCharCode(No);for(var uo=1;uo<=12;uo++)ua[uo+111]=ua[uo+63235]="F"+uo;var Zr={};Zr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Zr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Zr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Zr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Zr.default=a?Zr.macDefault:Zr.pcDefault;function Il(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,o,M,z=0;z<t.length-1;z++){var Z=t[z];if(/^(cmd|meta|m)$/i.test(Z))M=!0;else if(/^a(lt)?$/i.test(Z))i=!0;else if(/^(c|ctrl|control)$/i.test(Z))n=!0;else if(/^s(hift)?$/i.test(Z))o=!0;else throw new Error("Unrecognized modifier name: "+Z)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),M&&(e="Cmd-"+e),o&&(e="Shift-"+e),e}function Ml(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var o=tt(i.split(" "),Il),M=0;M<o.length;M++){var z=void 0,Z=void 0;M==o.length-1?(Z=o.join(" "),z=n):(Z=o.slice(0,M+1).join(" "),z="...");var $=t[Z];if(!$)t[Z]=z;else if($!=z)throw new Error("Inconsistent bindings for "+Z)}delete e[i]}for(var ie in t)e[ie]=t[ie];return e}function Ma(e,t,i,n){t=Uo(t);var o=t.call?t.call(e,n):t[e];if(o===!1)return"nothing";if(o==="...")return"multi";if(o!=null&&i(o))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ma(e,t.fallthrough,i,n);for(var M=0;M<t.fallthrough.length;M++){var z=Ma(e,t.fallthrough[M],i,n);if(z)return z}}}function Gs(e){var t=typeof e=="string"?e:ua[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function zs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(m&&e.keyCode==34&&e.char)return!1;var i=ua[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),zs(i,e,t))}function Uo(e){return typeof e=="string"?Zr[e]:e}function ka(e,t){for(var i=e.doc.sel.ranges,n=[],o=0;o<i.length;o++){for(var M=t(i[o]);n.length&&jt(M.from,Le(n).to)<=0;){var z=n.pop();if(jt(z.from,M.from)<0){M.from=z.from;break}}n.push(M)}or(e,function(){for(var Z=n.length-1;Z>=0;Z--)Da(e.doc,"",n[Z].from,n[Z].to,"+delete");na(e)})}function as(e,t,i){var n=rt(e.text,t+i,i);return n<0||n>e.text.length?null:n}function os(e,t,i){var n=as(e,t.ch,i);return n==null?null:new et(t.line,n,i<0?"after":"before")}function ss(e,t,i,n,o){if(e){t.doc.direction=="rtl"&&(o=-o);var M=Ct(i,t.doc.direction);if(M){var z=o<0?Le(M):M[0],Z=o<0==(z.level==1),$=Z?"after":"before",ie;if(z.level>0||t.doc.direction=="rtl"){var ge=Se(t,i);ie=o<0?i.text.length-1:0;var xe=Ue(t,ge,ie).top;ie=Pt(function(Fe){return Ue(t,ge,Fe).top==xe},o<0==(z.level==1)?z.from:z.to-1,ie),$=="before"&&(ie=as(i,ie,1))}else ie=o<0?z.to:z.from;return new et(n,ie,$)}}return new et(n,o<0?i.text.length:0,o<0?"before":"after")}function kl(e,t,i,n){var o=Ct(t,e.doc.direction);if(!o)return os(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var M=Tt(o,i.ch,i.sticky),z=o[M];if(e.doc.direction=="ltr"&&z.level%2==0&&(n>0?z.to>i.ch:z.from<i.ch))return os(t,i,n);var Z=function(Lt,Ht){return as(t,Lt instanceof et?Lt.ch:Lt,Ht)},$,ie=function(Lt){return e.options.lineWrapping?($=$||Se(e,t),Xt(e,t,$,Lt)):{begin:0,end:t.text.length}},ge=ie(i.sticky=="before"?Z(i,-1):i.ch);if(e.doc.direction=="rtl"||z.level==1){var xe=z.level==1==n<0,Fe=Z(i,xe?1:-1);if(Fe!=null&&(xe?Fe<=z.to&&Fe<=ge.end:Fe>=z.from&&Fe>=ge.begin)){var Ne=xe?"before":"after";return new et(i.line,Fe,Ne)}}var qe=function(Lt,Ht,Dt){for(var Vt=function(hi,zi){return zi?new et(i.line,Z(hi,1),"before"):new et(i.line,hi,"after")};Lt>=0&&Lt<o.length;Lt+=Ht){var dn=o[Lt],$t=Ht>0==(dn.level!=1),Sn=$t?Dt.begin:Z(Dt.end,-1);if(dn.from<=Sn&&Sn<dn.to)return Vt(Sn,$t);if(Sn=$t?dn.from:Z(dn.to,-1),Dt.begin<=Sn&&Sn<Dt.end)return Vt(Sn,$t)}},st=qe(M+n,n,ge);if(st)return st;var _t=n>0?ge.end:Z(ge.begin,-1);return _t!=null&&!(n>0&&_t==t.text.length)&&(st=qe(n>0?0:o.length-1,n,ie(_t)),st)?st:null}var co={selectAll:Ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Oe)},killLine:function(e){return ka(e,function(t){if(t.empty()){var i=Rt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ka(e,function(t){return{from:et(t.from().line,0),to:v(e.doc,et(t.to().line+1,0))}})},delLineLeft:function(e){return ka(e,function(t){return{from:et(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ka(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return ka(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Be)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Be)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?Ys(e,t.head):n},Be)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,o=0;o<i.length;o++){var M=i[o].from(),z=J(e.getLine(M.line),M.ch,n);t.push(le(n-z%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return or(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var o=t[n].head,M=Rt(e.doc,o.line).text;if(M){if(o.ch==M.length&&(o=new et(o.line,o.ch-1)),o.ch>0)o=new et(o.line,o.ch+1),e.replaceRange(M.charAt(o.ch-1)+M.charAt(o.ch-2),et(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var z=Rt(e.doc,o.line-1).text;z&&(o=new et(o.line,1),e.replaceRange(M.charAt(0)+e.doc.lineSeparator()+z.charAt(z.length-1),et(o.line-1,z.length-1),o,"+transpose"))}}i.push(new Qn(o,o))}e.setSelections(i)})},newlineAndIndent:function(e){return or(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);na(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,t){var i=Rt(e.doc,t),n=Pi(i);return n!=i&&(t=Qt(n)),ss(!0,e,n,t,1)}function Pl(e,t){var i=Rt(e.doc,t),n=Gr(i);return n!=i&&(t=Qt(n)),ss(!0,e,i,t,-1)}function Ys(e,t){var i=Xs(e,t.line),n=Rt(e.doc,i.line),o=Ct(n,e.doc.direction);if(!o||o[0].level==0){var M=Math.max(i.ch,n.text.search(/\S/)),z=t.line==i.line&&t.ch<=M&&t.ch;return et(i.line,z?0:M,i.sticky)}return i}function Bo(e,t,i){if(typeof t=="string"&&(t=co[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),o=t(e)!=ke}finally{e.display.shift=n,e.state.suppressEdits=!1}return o}function Nl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var o=Ma(t,e.state.keyMaps[n],i,e);if(o)return o}return e.options.extraKeys&&Ma(t,e.options.extraKeys,i,e)||Ma(t,e.options.keyMap,i,e)}var Ul=new ne;function ho(e,t,i,n){var o=e.state.keySeq;if(o){if(Gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==o&&(e.state.keySeq=null,e.display.input.reset())}),Js(e,o+" "+t,i,n))return!0}return Js(e,t,i,n)}function Js(e,t,i,n){var o=Nl(e,t,n);return o=="multi"&&(e.state.keySeq=t),o=="handled"&&Oi(e,"keyHandled",e,t,i),(o=="handled"||o=="multi")&&(ee(i),ji(e)),!!o}function Qs(e,t){var i=Vs(t,!0);return i?t.shiftKey&&!e.state.keySeq?ho(e,"Shift-"+i,t,function(n){return Bo(e,n,!0)})||ho(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Bo(e,n)}):ho(e,i,t,function(n){return Bo(e,n)}):!1}function Bl(e,t,i){return ho(e,"'"+i+"'",t,function(n){return Bo(e,n,!0)})}var ls=null;function Zs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=T(),at(t,e))return;G&&j<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Qs(t,e);m&&(ls=n?i:null,!n&&i==88&&!en&&(a?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),k&&!a&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;N(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(w(t,"CodeMirror-crosshair"),St(document,"keyup",i),St(document,"mouseover",i))}ze(document,"keyup",i),ze(document,"mouseover",i)}function qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),at(this,e)}function $s(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Rr(t.display,e)||at(t,e)||e.ctrlKey&&!e.altKey||a&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(m&&i==ls){ls=null,ee(e);return}if(m&&(!e.which||e.which<10)&&Qs(t,e))return;var o=String.fromCharCode(n==null?i:n);if(o=="\b")return;if(Bl(t,e,o))return;t.display.input.onKeyPress(e)}var jl=400,us=function(e,t,i){this.time=e,this.pos=t,this.button=i};us.prototype.compare=function(e,t,i){return this.time+jl>e&&jt(t,this.pos)==0&&i==this.button};var fo,po;function Hl(e,t){var i=+new Date;return po&&po.compare(i,e,t)?(fo=po=null,"triple"):fo&&fo.compare(i,e,t)?(po=new us(i,e,t),fo=null,"double"):(fo=new us(i,e,t),po=null,"single")}function el(e){var t=this,i=t.display;if(at(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Rr(i,e)){P||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(cs(t,e))return;var n=Fi(t,e),o=Re(e),M=n?Hl(n,o):"single";if(window.focus(),o==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,o,n,M,e))return;o==1?n?Gl(t,n,M,e):_e(e)==i.scroller&&ee(e):o==2?(n&&Io(t.doc,n),setTimeout(function(){return i.input.focus()},20)):o==3&&(R?t.display.input.onContextMenu(e):za(t))}function Wl(e,t,i,n,o){var M="Click";return n=="double"?M="Double"+M:n=="triple"&&(M="Triple"+M),M=(t==1?"Left":t==2?"Middle":"Right")+M,ho(e,zs(M,o),o,function(z){if(typeof z=="string"&&(z=co[z]),!z)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=z(e,i)!=ke}finally{e.state.suppressEdits=!1}return Z})}function Kl(e,t,i){var n=e.getOption("configureMouse"),o=n?n(e,t,i):{};if(o.unit==null){var M=d?i.shiftKey&&i.metaKey:i.altKey;o.unit=M?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(o.extend==null||e.doc.extend)&&(o.extend=e.doc.extend||i.shiftKey),o.addNew==null&&(o.addNew=a?i.metaKey:i.ctrlKey),o.moveOnDrag==null&&(o.moveOnDrag=!(a?i.altKey:i.ctrlKey)),o}function Gl(e,t,i,n){G?setTimeout(U(Eo,e),0):e.curOp.focus=T();var o=Kl(e,i,n),M=e.doc.sel,z;e.options.dragDrop&&De&&!e.isReadOnly()&&i=="single"&&(z=M.contains(t))>-1&&(jt((z=M.ranges[z]).from(),t)<0||t.xRel>0)&&(jt(z.to(),t)>0||t.xRel<0)?zl(e,n,t,o):Vl(e,n,t,o)}function zl(e,t,i,n){var o=e.display,M=!1,z=Ii(e,function(ie){P&&(o.scroller.draggable=!1),e.state.draggingText=!1,St(o.wrapper.ownerDocument,"mouseup",z),St(o.wrapper.ownerDocument,"mousemove",Z),St(o.scroller,"dragstart",$),St(o.scroller,"drop",z),M||(ee(ie),n.addNew||Io(e.doc,i,null,null,n.extend),P&&!p||G&&j==9?setTimeout(function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()},20):o.input.focus())}),Z=function(ie){M=M||Math.abs(t.clientX-ie.clientX)+Math.abs(t.clientY-ie.clientY)>=10},$=function(){return M=!0};P&&(o.scroller.draggable=!0),e.state.draggingText=z,z.copy=!n.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),ze(o.wrapper.ownerDocument,"mouseup",z),ze(o.wrapper.ownerDocument,"mousemove",Z),ze(o.scroller,"dragstart",$),ze(o.scroller,"drop",z),za(e),setTimeout(function(){return o.input.focus()},20)}function tl(e,t,i){if(i=="char")return new Qn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Qn(et(t.line,0),v(e.doc,et(t.line+1,0)));var n=i(e,t);return new Qn(n.from,n.to)}function Vl(e,t,i,n){var o=e.display,M=e.doc;ee(t);var z,Z,$=M.sel,ie=$.ranges;if(n.addNew&&!n.extend?(Z=M.sel.contains(i),Z>-1?z=ie[Z]:z=new Qn(i,i)):(z=M.sel.primary(),Z=M.sel.primIndex),n.unit=="rectangle")n.addNew||(z=new Qn(i,i)),i=Fi(e,t,!0,!0),Z=-1;else{var ge=tl(e,i,n.unit);n.extend?z=is(z,ge.anchor,ge.head,n.extend):z=ge}n.addNew?Z==-1?(Z=ie.length,er(M,wr(e,ie.concat([z]),Z),{scroll:!1,origin:"*mouse"})):ie.length>1&&ie[Z].empty()&&n.unit=="char"&&!n.extend?(er(M,wr(e,ie.slice(0,Z).concat(ie.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),$=M.sel):rs(M,Z,z,Me):(Z=0,er(M,new lr([z],0),Me),$=M.sel);var xe=i;function Fe(Dt){if(jt(xe,Dt)==0)return;if(xe=Dt,n.unit=="rectangle"){for(var Vt=[],dn=e.options.tabSize,$t=J(Rt(M,i.line).text,i.ch,dn),Sn=J(Rt(M,Dt.line).text,Dt.ch,dn),hi=Math.min($t,Sn),zi=Math.max($t,Sn),wi=Math.min(i.line,Dt.line),yr=Math.min(e.lastLine(),Math.max(i.line,Dt.line));wi<=yr;wi++){var fr=Rt(M,wi).text,Ni=Pe(fr,hi,dn);hi==zi?Vt.push(new Qn(et(wi,Ni),et(wi,Ni))):fr.length>Ni&&Vt.push(new Qn(et(wi,Ni),et(wi,Pe(fr,zi,dn))))}Vt.length||Vt.push(new Qn(i,i)),er(M,wr(e,$.ranges.slice(0,Z).concat(Vt),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Dt)}else{var pr=z,Ji=tl(e,Dt,n.unit),Ki=pr.anchor,Ui;jt(Ji.anchor,Ki)>0?(Ui=Ji.head,Ki=Dn(pr.from(),Ji.anchor)):(Ui=Ji.anchor,Ki=sn(pr.to(),Ji.head));var Li=$.ranges.slice(0);Li[Z]=Xl(e,new Qn(v(M,Ki),Ui)),er(M,wr(e,Li,Z),Me)}}var Ne=o.wrapper.getBoundingClientRect(),qe=0;function st(Dt){var Vt=++qe,dn=Fi(e,Dt,!0,n.unit=="rectangle");if(!dn)return;if(jt(dn,xe)!=0){e.curOp.focus=T(),Fe(dn);var $t=ba(o,M);(dn.line>=$t.to||dn.line<$t.from)&&setTimeout(Ii(e,function(){qe==Vt&&st(Dt)}),150)}else{var Sn=Dt.clientY<Ne.top?-20:Dt.clientY>Ne.bottom?20:0;Sn&&setTimeout(Ii(e,function(){if(qe!=Vt)return;o.scroller.scrollTop+=Sn,st(Dt)}),50)}}function _t(Dt){e.state.selectingText=!1,qe=Infinity,Dt&&(ee(Dt),o.input.focus()),St(o.wrapper.ownerDocument,"mousemove",Lt),St(o.wrapper.ownerDocument,"mouseup",Ht),M.history.lastSelOrigin=null}var Lt=Ii(e,function(Dt){Dt.buttons===0||!Re(Dt)?_t(Dt):st(Dt)}),Ht=Ii(e,_t);e.state.selectingText=Ht,ze(o.wrapper.ownerDocument,"mousemove",Lt),ze(o.wrapper.ownerDocument,"mouseup",Ht)}function Xl(e,t){var i=t.anchor,n=t.head,o=Rt(e.doc,i.line);if(jt(i,n)==0&&i.sticky==n.sticky)return t;var M=Ct(o);if(!M)return t;var z=Tt(M,i.ch,i.sticky),Z=M[z];if(Z.from!=i.ch&&Z.to!=i.ch)return t;var $=z+(Z.from==i.ch==(Z.level!=1)?0:1);if($==0||$==M.length)return t;var ie;if(n.line!=i.line)ie=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ge=Tt(M,n.ch,n.sticky),xe=ge-z||(n.ch-i.ch)*(Z.level==1?-1:1);ge==$-1||ge==$?ie=xe<0:ie=xe>0}var Fe=M[$+(ie?-1:0)],Ne=ie==(Fe.level==1),qe=Ne?Fe.from:Fe.to,st=Ne?"after":"before";return i.ch==qe&&i.sticky==st?t:new Qn(new et(i.line,qe,st),n)}function nl(e,t,i,n){var o,M;if(t.touches)o=t.touches[0].clientX,M=t.touches[0].clientY;else try{o=t.clientX,M=t.clientY}catch(Fe){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ee(t);var z=e.display,Z=z.lineDiv.getBoundingClientRect();if(M>Z.bottom||!Ee(e,i))return de(t);M-=Z.top-z.viewOffset;for(var $=0;$<e.display.gutterSpecs.length;++$){var ie=z.gutters.childNodes[$];if(ie&&ie.getBoundingClientRect().right>=o){var ge=Gn(e.doc,M),xe=e.display.gutterSpecs[$];return Ke(e,i,e,ge,xe.className,t),de(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){if(Rr(e.display,t)||Yl(e,t))return;if(at(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return Ee(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function rl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),_n(e)}var Pa={toString:function(){return"CodeMirror.Init"}},al={},Fo={};function Jl(e){var t=e.optionHandlers;function i(n,o,M,z){e.defaults[n]=o,M&&(t[n]=z?function(Z,$,ie){ie!=Pa&&M(Z,$,ie)}:M)}e.defineOption=i,e.Init=Pa,i("value","",function(n,o){return n.setValue(o)},!0),i("mode",null,function(n,o){n.doc.modeOption=o,Qr(n)},!0),i("indentUnit",2,Qr,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){to(n),_n(n),si(n)},!0),i("lineSeparator",null,function(n,o){if(n.doc.lineSep=o,!o)return;var M=[],z=n.doc.first;n.doc.iter(function($){for(var ie=0;;){var ge=$.text.indexOf(o,ie);if(ge==-1)break;ie=ge+o.length,M.push(et(z,ge))}z++});for(var Z=M.length-1;Z>=0;Z--)Da(n.doc,o,M[Z],et(M[Z].line,M[Z].ch+o.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,o,M){n.state.specialChars=new RegExp(o.source+(o.test(" ")?"":"| "),"g"),M!=Pa&&n.refresh()}),i("specialCharPlaceholder",ti,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",r?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,o){return n.getInputField().spellcheck=o},!0),i("autocorrect",!1,function(n,o){return n.getInputField().autocorrect=o},!0),i("autocapitalize",!1,function(n,o){return n.getInputField().autocapitalize=o},!0),i("rtlMoveVisually",!L),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){rl(n),Lr(n)},!0),i("keyMap","default",function(n,o,M){var z=Uo(o),Z=M!=Pa&&Uo(M);Z&&Z.detach&&Z.detach(n,z),z.attach&&z.attach(n,Z||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,o){n.display.gutterSpecs=sr(o,n.options.lineNumbers),Lr(n)},!0),i("fixedGutter",!0,function(n,o){n.display.gutters.style.left=o?$i(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Xr(n)},!0),i("scrollbarStyle","native",function(n){Ta(n),Xr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,o){n.display.gutterSpecs=sr(n.options.gutters,o),Lr(n)},!0),i("firstLineNumber",1,Lr,!0),i("lineNumberFormatter",function(n){return n},Lr,!0),i("showCursorWhenSelecting",!1,ri,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,o){o=="nocursor"&&(ta(n),n.display.input.blur()),n.display.input.readOnlyChanged(o)}),i("screenReaderLabel",null,function(n,o){o=o===""?null:o,n.display.input.screenReaderLabelChanged(o)}),i("disableInput",!1,function(n,o){o||n.display.input.reset()},!0),i("dragDrop",!0,Ql),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,ri,!0),i("singleCursorHeightPerLine",!0,ri,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,to,!0),i("addModeClass",!1,to,!0),i("pollInterval",100),i("undoDepth",200,function(n,o){return n.doc.history.undoDepth=o}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,to,!0),i("moveInputWithCursor",!0,function(n,o){o||n.display.input.resetPosition()}),i("tabindex",null,function(n,o){return n.display.input.getField().tabIndex=o||""}),i("autofocus",null),i("direction","ltr",function(n,o){return n.doc.setDirection(o)},!0),i("phrases",null)}function Ql(e,t,i){var n=i&&i!=Pa;if(!t!=!n){var o=e.display.dragFunctions,M=t?ze:St;M(e.display.scroller,"dragstart",o.start),M(e.display.scroller,"dragenter",o.enter),M(e.display.scroller,"dragover",o.over),M(e.display.scroller,"dragleave",o.leave),M(e.display.scroller,"drop",o.drop)}}function Zl(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(w(e.display.wrapper,"CodeMirror-wrap"),Ci(e)),ar(e),si(e),_n(e),setTimeout(function(){return Xr(e)},100)}function xi(e,t){var i=this;if(!(this instanceof xi))return new xi(e,t);this.options=t=t?A(t):{},A(al,t,!1);var n=t.value;typeof n=="string"?n=new hr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var o=new xi.inputStyles[t.inputStyle](this),M=this.display=new ga(e,n,o,t);M.wrapper.CodeMirror=this,rl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ta(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ne,keySeq:null,specialChars:null},t.autofocus&&!r&&M.input.focus(),G&&j<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Rl(),Fr(this),this.curOp.forceUpdate=!0,vs(this,n),t.autofocus&&!r||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ur(i)},20):ta(this);for(var z in Fo)Fo.hasOwnProperty(z)&&Fo[z](this,t[z],Pa);Hi(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z<ds.length;++Z)ds[Z](this);Yr(this),P&&t.lineWrapping&&getComputedStyle(M.lineDiv).textRendering=="optimizelegibility"&&(M.lineDiv.style.textRendering="auto")}xi.defaults=al,xi.optionHandlers=Fo;function ql(e){var t=e.display;ze(t.scroller,"mousedown",Ii(e,el)),G&&j<11?ze(t.scroller,"dblclick",Ii(e,function($){if(at(e,$))return;var ie=Fi(e,$);if(!ie||cs(e,$)||Rr(e.display,$))return;ee($);var ge=e.findWordAt(ie);Io(e.doc,ge.anchor,ge.head)})):ze(t.scroller,"dblclick",function($){return at(e,$)||ee($)}),ze(t.scroller,"contextmenu",function($){return il(e,$)}),ze(t.input.getField(),"contextmenu",function($){t.scroller.contains($.target)||il(e,$)});var i,n={end:0};function o(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function M($){if($.touches.length!=1)return!1;var ie=$.touches[0];return ie.radiusX<=1&&ie.radiusY<=1}function z($,ie){if(ie.left==null)return!0;var ge=ie.left-$.left,xe=ie.top-$.top;return ge*ge+xe*xe>20*20}ze(t.scroller,"touchstart",function($){if(!at(e,$)&&!M($)&&!cs(e,$)){t.input.ensurePolled(),clearTimeout(i);var ie=+new Date;t.activeTouch={start:ie,moved:!1,prev:ie-n.end<=300?n:null},$.touches.length==1&&(t.activeTouch.left=$.touches[0].pageX,t.activeTouch.top=$.touches[0].pageY)}}),ze(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ze(t.scroller,"touchend",function($){var ie=t.activeTouch;if(ie&&!Rr(t,$)&&ie.left!=null&&!ie.moved&&new Date-ie.start<300){var ge=e.coordsChar(t.activeTouch,"page"),xe;!ie.prev||z(ie,ie.prev)?xe=new Qn(ge,ge):!ie.prev.prev||z(ie,ie.prev.prev)?xe=e.findWordAt(ge):xe=new Qn(et(ge.line,0),v(e.doc,et(ge.line+1,0))),e.setSelection(xe.anchor,xe.head),e.focus(),ee($)}o()}),ze(t.scroller,"touchcancel",o),ze(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ra(e,t.scroller.scrollTop),xr(e,t.scroller.scrollLeft,!0),Ke(e,"scroll",e))}),ze(t.scroller,"mousewheel",function($){return $a(e,$)}),ze(t.scroller,"DOMMouseScroll",function($){return $a(e,$)}),ze(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function($){at(e,$)||pe($)},over:function($){at(e,$)||(Ol(e,$),pe($))},start:function($){return Al(e,$)},drop:Ii(e,Cl),leave:function($){at(e,$)||Hs(e)}};var Z=t.input.getField();ze(Z,"keyup",function($){return qs.call(e,$)}),ze(Z,"keydown",Ii(e,Zs)),ze(Z,"keypress",Ii(e,$s)),ze(Z,"focus",function($){return Ur(e,$)}),ze(Z,"blur",function($){return ta(e,$)})}var ds=[];xi.defineInitHook=function(e){return ds.push(e)};function mo(e,t,i,n){var o=e.doc,M;i==null&&(i="add"),i=="smart"&&(o.mode.indent?M=Xe(e,t).state:i="prev");var z=e.options.tabSize,Z=Rt(o,t),$=J(Z.text,null,z);Z.stateAfter&&(Z.stateAfter=null);var ie=Z.text.match(/^\s*/)[0],ge;if(!n&&!/\S/.test(Z.text))ge=0,i="not";else if(i=="smart"&&(ge=o.mode.indent(M,Z.text.slice(ie.length),Z.text),ge==ke||ge>150)){if(!n)return;i="prev"}i=="prev"?t>o.first?ge=J(Rt(o,t-1).text,null,z):ge=0:i=="add"?ge=$+e.options.indentUnit:i=="subtract"?ge=$-e.options.indentUnit:typeof i=="number"&&(ge=$+i),ge=Math.max(0,ge);var xe="",Fe=0;if(e.options.indentWithTabs)for(var Ne=Math.floor(ge/z);Ne;--Ne)Fe+=z,xe+=" ";if(Fe<ge&&(xe+=le(ge-Fe)),xe!=ie)return Da(o,xe,et(t,0),et(t,ie.length),"+input"),Z.stateAfter=null,!0;for(var qe=0;qe<o.sel.ranges.length;qe++){var st=o.sel.ranges[qe];if(st.head.line==t&&st.head.ch<ie.length){var _t=et(t,ie.length);rs(o,qe,new Qn(_t,_t));break}}}var Mr=null;function jo(e){Mr=e}function hs(e,t,i,n,o){var M=e.doc;e.display.shift=!1,n||(n=M.sel);var z=+new Date-200,Z=o=="paste"||e.state.pasteIncoming>z,$=vt(t),ie=null;if(Z&&n.ranges.length>1)if(Mr&&Mr.text.join(`
|
|
`)==t){if(n.ranges.length%Mr.text.length==0){ie=[];for(var ge=0;ge<Mr.text.length;ge++)ie.push(M.splitLines(Mr.text[ge]))}}else $.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(ie=tt($,function(Lt){return[Lt]}));for(var xe=e.curOp.updateInput,Fe=n.ranges.length-1;Fe>=0;Fe--){var Ne=n.ranges[Fe],qe=Ne.from(),st=Ne.to();Ne.empty()&&(i&&i>0?qe=et(qe.line,qe.ch-i):e.state.overwrite&&!Z?st=et(st.line,Math.min(Rt(M,st.line).text.length,st.ch+Le($).length)):Z&&Mr&&Mr.lineWise&&Mr.text.join(`
|
|
`)==$.join(`
|
|
`)&&(qe=st=et(qe.line,0)));var _t={from:qe,to:st,text:ie?ie[Fe%ie.length]:$,origin:o||(Z?"paste":e.state.cutIncoming>z?"cut":"+input")};La(e.doc,_t),Oi(e,"inputRead",e,_t)}t&&!Z&&sl(e,t),na(e),e.curOp.updateInput<2&&(e.curOp.updateInput=xe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&or(t,function(){return hs(t,i,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var o=i.ranges[n];if(o.head.ch>100||n&&i.ranges[n-1].head.line==o.head.line)continue;var M=e.getModeAt(o.head),z=!1;if(M.electricChars){for(var Z=0;Z<M.electricChars.length;Z++)if(t.indexOf(M.electricChars.charAt(Z))>-1){z=mo(e,o.head.line,"smart");break}}else M.electricInput&&(M.electricInput.test(Rt(e.doc,o.head.line).text.slice(0,o.head.ch))&&(z=mo(e,o.head.line,"smart")));z&&Oi(e,"electricInput",e,o.head.line)}}function ll(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var o=e.doc.sel.ranges[n].head.line,M={anchor:et(o,0),head:et(o+1,0)};i.push(M),t.push(e.getRange(M.anchor,M.head))}return{text:t,ranges:i}}function ul(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=l("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=l("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return P?e.style.width="1000px":e.setAttribute("wrap","off"),f&&(e.style.border="1px solid black"),ul(e),t}function $l(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,o){var M=this.options,z=M[n];if(M[n]==o&&n!="mode")return;M[n]=o,t.hasOwnProperty(n)&&Ii(this,t[n])(this,o,z),Ke(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,o){this.state.keyMaps[o?"push":"unshift"](Uo(n))},removeKeyMap:function(n){for(var o=this.state.keyMaps,M=0;M<o.length;++M)if(o[M]==n||o[M].name==n)return o.splice(M,1),!0},addOverlay:Yi(function(n,o){var M=n.token?n:e.getMode(this.options,n);if(M.startState)throw new Error("Overlays may not be stateful.");nt(this.state.overlays,{mode:M,modeSpec:n,opaque:o&&o.opaque,priority:o&&o.priority||0},function(z){return z.priority}),this.state.modeGen++,si(this)}),removeOverlay:Yi(function(n){for(var o=this.state.overlays,M=0;M<o.length;++M){var z=o[M].modeSpec;if(z==n||typeof n=="string"&&z.name==n){o.splice(M,1),this.state.modeGen++,si(this);return}}}),indentLine:Yi(function(n,o,M){typeof o!="string"&&typeof o!="number"&&(o==null?o=this.options.smartIndent?"smart":"prev":o=o?"add":"subtract"),ei(this.doc,n)&&mo(this,n,o,M)}),indentSelection:Yi(function(n){for(var o=this.doc.sel.ranges,M=-1,z=0;z<o.length;z++){var Z=o[z];if(Z.empty())Z.head.line>M&&(mo(this,Z.head.line,n,!0),M=Z.head.line,z==this.doc.sel.primIndex&&na(this));else{var $=Z.from(),ie=Z.to(),ge=Math.max(M,$.line);M=Math.min(this.lastLine(),ie.line-(ie.ch?0:1))+1;for(var xe=ge;xe<M;++xe)mo(this,xe,n);var Fe=this.doc.sel.ranges;$.ch==0&&o.length==Fe.length&&Fe[z].from().ch>0&&rs(this.doc,z,new Qn($,Fe[z].to()),Oe)}}}),getTokenAt:function(n,o){return Fn(this,n,o)},getLineTokens:function(n,o){return Fn(this,et(n),o,!0)},getTokenTypeAt:function(n){n=v(this.doc,n);var o=He(this,Rt(this.doc,n.line)),M=0,z=(o.length-1)/2,Z=n.ch,$;if(Z==0)$=o[2];else for(;;){var ie=M+z>>1;if((ie?o[ie*2-1]:0)>=Z)z=ie;else if(o[ie*2+1]<Z)M=ie+1;else{$=o[ie*2+2];break}}var ge=$?$.indexOf("overlay "):-1;return ge<0?$:ge==0?null:$.slice(0,ge-1)},getModeAt:function(n){var o=this.doc.mode;return o.innerMode?e.innerMode(o,this.getTokenAt(n).state).mode:o},getHelper:function(n,o){return this.getHelpers(n,o)[0]},getHelpers:function(n,o){var M=[];if(!i.hasOwnProperty(o))return M;var z=i[o],Z=this.getModeAt(n);if(typeof Z[o]=="string")z[Z[o]]&&M.push(z[Z[o]]);else if(Z[o])for(var $=0;$<Z[o].length;$++){var ie=z[Z[o][$]];ie&&M.push(ie)}else Z.helperType&&z[Z.helperType]?M.push(z[Z.helperType]):z[Z.name]&&M.push(z[Z.name]);for(var ge=0;ge<z._global.length;ge++){var xe=z._global[ge];xe.pred(Z,this)&&oe(M,xe.val)==-1&&M.push(xe.val)}return M},getStateAfter:function(n,o){var M=this.doc;return n=K(M,n==null?M.first+M.size-1:n),Xe(this,n+1,o).state},cursorCoords:function(n,o){var M,z=this.doc.sel.primary();return n==null?M=z.head:typeof n=="object"?M=v(this.doc,n):M=n?z.from():z.to(),Rn(this,M,o||"page")},charCoords:function(n,o){return vi(this,v(this.doc,n),o||"page")},coordsChar:function(n,o){return n=On(this,n,o||"page"),In(this,n.left,n.top)},lineAtHeight:function(n,o){return n=On(this,{top:n,left:0},o||"page").top,Gn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,o,M){var z=!1,Z;if(typeof n=="number"){var $=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>$&&(n=$,z=!0),Z=Rt(this.doc,n)}else Z=n;return Un(this,Z,{top:0,left:0},o||"page",M||z).top+(z?this.doc.height-gi(Z):0)},defaultTextHeight:function(){return Ri(this.display)},defaultCharWidth:function(){return Bi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,o,M,z,Z){var $=this.display;n=Rn(this,v(this.doc,n));var ie=n.bottom,ge=n.left;if(o.style.position="absolute",o.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(o),$.sizer.appendChild(o),z=="over")ie=n.top;else if(z=="above"||z=="near"){var xe=Math.max($.wrapper.clientHeight,this.doc.height),Fe=Math.max($.sizer.clientWidth,$.lineSpace.clientWidth);(z=="above"||n.bottom+o.offsetHeight>xe)&&n.top>o.offsetHeight?ie=n.top-o.offsetHeight:n.bottom+o.offsetHeight<=xe&&(ie=n.bottom),ge+o.offsetWidth>Fe&&(ge=Fe-o.offsetWidth)}o.style.top=ie+"px",o.style.left=o.style.right="",Z=="right"?(ge=$.sizer.clientWidth-o.offsetWidth,o.style.right="0px"):(Z=="left"?ge=0:Z=="middle"&&(ge=($.sizer.clientWidth-o.offsetWidth)/2),o.style.left=ge+"px"),M&&xo(this,{left:ge,top:ie,right:ge+o.offsetWidth,bottom:ie+o.offsetHeight})},triggerOnKeyDown:Yi(Zs),triggerOnKeyPress:Yi($s),triggerOnKeyUp:qs,triggerOnMouseDown:Yi(el),execCommand:function(n){if(co.hasOwnProperty(n))return co[n].call(null,this)},triggerElectric:Yi(function(n){sl(this,n)}),findPosH:function(n,o,M,z){var Z=1;o<0&&(Z=-1,o=-o);for(var $=v(this.doc,n),ie=0;ie<o&&!($=fs(this.doc,$,Z,M,z),$.hitSide);++ie);return $},moveH:Yi(function(n,o){var M=this;this.extendSelectionsBy(function(z){return M.display.shift||M.doc.extend||z.empty()?fs(M.doc,z.head,n,o,M.options.rtlMoveVisually):n<0?z.from():z.to()},Be)}),deleteH:Yi(function(n,o){var M=this.doc.sel,z=this.doc;M.somethingSelected()?z.replaceSelection("",null,"+delete"):ka(this,function(Z){var $=fs(z,Z.head,n,o,!1);return n<0?{from:$,to:Z.head}:{from:Z.head,to:$}})}),findPosV:function(n,o,M,z){var Z=1,$=z;o<0&&(Z=-1,o=-o);for(var ie=v(this.doc,n),ge=0;ge<o;++ge){var xe=Rn(this,ie,"div");if($==null?$=xe.left:xe.left=$,ie=dl(this,xe,Z,M),ie.hitSide)break}return ie},moveV:Yi(function(n,o){var M=this,z=this.doc,Z=[],$=!this.display.shift&&!z.extend&&z.sel.somethingSelected();if(z.extendSelectionsBy(function(ge){if($)return n<0?ge.from():ge.to();var xe=Rn(M,ge.head,"div");ge.goalColumn!=null&&(xe.left=ge.goalColumn),Z.push(xe.left);var Fe=dl(M,xe,n,o);return o=="page"&&ge==z.sel.primary()&&Ya(M,vi(M,Fe,"div").top-xe.top),Fe},Be),Z.length)for(var ie=0;ie<z.sel.ranges.length;ie++)z.sel.ranges[ie].goalColumn=Z[ie]}),findWordAt:function(n){var o=this.doc,M=Rt(o,n.line).text,z=n.ch,Z=n.ch;if(M){var $=this.getHelper(n,"wordChars");(n.sticky=="before"||Z==M.length)&&z?--z:++Z;for(var ie=M.charAt(z),ge=ut(ie,$)?function(xe){return ut(xe,$)}:/\s/.test(ie)?function(xe){return/\s/.test(xe)}:function(xe){return!/\s/.test(xe)&&!ut(xe)};z>0&&ge(M.charAt(z-1));)--z;for(;Z<M.length&&ge(M.charAt(Z));)++Z}return new Qn(et(n.line,z),et(n.line,Z))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):w(this.display.cursorDiv,"CodeMirror-overwrite"),Ke(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==T()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Yi(function(n,o){ia(this,n,o)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Ae(this)-this.display.barHeight,width:n.scrollWidth-Ae(this)-this.display.barWidth,clientHeight:te(this),clientWidth:me(this)}},scrollIntoView:Yi(function(n,o){n==null?(n={from:this.doc.sel.primary().head,to:null},o==null&&(o=this.options.cursorScrollMargin)):typeof n=="number"?n={from:et(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=o||0,n.from.line!=null?Jo(this,n):ha(this,n.from,n.to,n.margin)}),setSize:Yi(function(n,o){var M=this,z=function($){return typeof $=="number"||/^\d+$/.test(String($))?$+"px":$};n!=null&&(this.display.wrapper.style.width=z(n)),o!=null&&(this.display.wrapper.style.height=z(o)),this.options.lineWrapping&&vn(this);var Z=this.display.viewFrom;this.doc.iter(Z,this.display.viewTo,function($){if($.widgets){for(var ie=0;ie<$.widgets.length;ie++)if($.widgets[ie].noHScroll){Ei(M,Z,"widget");break}}++Z}),this.curOp.forceUpdate=!0,Ke(this,"refresh",this)}),operation:function(n){return or(this,n)},startOperation:function(){return Fr(this)},endOperation:function(){return Yr(this)},refresh:Yi(function(){var n=this.display.cachedTextHeight;si(this),this.curOp.forceUpdate=!0,_n(this),ia(this,this.doc.scrollLeft,this.doc.scrollTop),Sa(this.display),(n==null||Math.abs(n-Ri(this.display))>.5||this.options.lineWrapping)&&ar(this),Ke(this,"refresh",this)}),swapDoc:Yi(function(n){var o=this.doc;return o.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,n),_n(this),this.display.input.reset(),ia(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Oi(this,"swapDoc",this,o),o}),phrase:function(n){var o=this.options.phrases;return o&&Object.prototype.hasOwnProperty.call(o,n)?o[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Te(e),e.registerHelper=function(n,o,M){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][o]=M},e.registerGlobalHelper=function(n,o,M,z){e.registerHelper(n,o,z),i[n]._global.push({pred:M,val:z})}}function fs(e,t,i,n,o){var M=t,z=i,Z=Rt(e,t.line),$=o&&e.direction=="rtl"?-i:i;function ie(){var Ht=t.line+$;return Ht<e.first||Ht>=e.first+e.size?!1:(t=new et(Ht,t.ch,t.sticky),Z=Rt(e,Ht))}function ge(Ht){var Dt;if(n=="codepoint"){var Vt=Z.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Vt)?Dt=null:Dt=new et(t.line,Math.max(0,Math.min(Z.text.length,t.ch+i*(Vt>=55296&&Vt<56320?2:1))),-i)}else o?Dt=kl(e.cm,Z,t,i):Dt=os(Z,t,i);if(Dt==null)if(!Ht&&ie())t=ss(o,e.cm,Z,t.line,$);else return!1;else t=Dt;return!0}if(n=="char"||n=="codepoint")ge();else if(n=="column")ge(!0);else if(n=="word"||n=="group")for(var xe=null,Fe=n=="group",Ne=e.cm&&e.cm.getHelper(t,"wordChars"),qe=!0;!(i<0&&!ge(!qe));qe=!1){var st=Z.text.charAt(t.ch)||`
|
|
`,_t=ut(st,Ne)?"w":Fe&&st==`
|
|
`?"n":!Fe||/\s/.test(st)?null:"p";if(Fe&&!qe&&!_t&&(_t="s"),xe&&xe!=_t){i<0&&(i=1,ge(),t.sticky="after");break}if(_t&&(xe=_t),i>0&&!ge(!qe))break}var Lt=ko(e,t,M,z,!0);return Wn(M,Lt)&&(Lt.hitSide=!0),Lt}function dl(e,t,i,n){var o=e.doc,M=t.left,z;if(n=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),$=Math.max(Z-.5*Ri(e.display),3);z=(i>0?t.bottom:t.top)+i*$}else n=="line"&&(z=i>0?t.bottom+3:t.top-3);for(var ie;!(ie=In(e,M,z),!ie.outside);){if(i<0?z<=0:z>=o.height){ie.hitSide=!0;break}z+=i*5}return ie}var li=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ne,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};li.prototype.init=function(e){var t=this,i=this,n=i.cm,o=i.div=e.lineDiv;ul(o,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function M(Z){for(var $=Z.target;$;$=$.parentNode){if($==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test($.className))break}return!1}ze(o,"paste",function(Z){if(!M(Z)||at(n,Z)||ol(Z,n))return;j<=11&&setTimeout(Ii(n,function(){return t.updateFromDOM()}),20)}),ze(o,"compositionstart",function(Z){t.composing={data:Z.data,done:!1}}),ze(o,"compositionupdate",function(Z){t.composing||(t.composing={data:Z.data,done:!1})}),ze(o,"compositionend",function(Z){t.composing&&(Z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ze(o,"touchstart",function(){return i.forceCompositionEnd()}),ze(o,"input",function(){t.composing||t.readFromDOMSoon()});function z(Z){if(!M(Z)||at(n,Z))return;if(n.somethingSelected())jo({lineWise:!1,text:n.getSelections()}),Z.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var $=ll(n);jo({lineWise:!0,text:$.text}),Z.type=="cut"&&n.operation(function(){n.setSelections($.ranges,0,Oe),n.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var ie=Mr.text.join(`
|
|
`);if(Z.clipboardData.setData("Text",ie),Z.clipboardData.getData("Text")==ie){Z.preventDefault();return}}var ge=cl(),xe=ge.firstChild;n.display.lineSpace.insertBefore(ge,n.display.lineSpace.firstChild),xe.value=Mr.text.join(`
|
|
`);var Fe=document.activeElement;Y(xe),setTimeout(function(){n.display.lineSpace.removeChild(ge),Fe.focus(),Fe==o&&i.showPrimarySelection()},50)}ze(o,"copy",z),ze(o,"cut",z)},li.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},li.prototype.prepareSelection=function(){var e=Cr(this.cm,!1);return e.focus=document.activeElement==this.div,e},li.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},li.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},li.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom){e.removeAllRanges();return}var M=Ho(t,e.anchorNode,e.anchorOffset),z=Ho(t,e.focusNode,e.focusOffset);if(M&&!M.bad&&z&&!z.bad&&jt(Dn(M,z),n)==0&&jt(sn(M,z),o)==0)return;var Z=t.display.view,$=n.line>=t.display.viewFrom&&hl(t,n)||{node:Z[0].measure.map[2],offset:0},ie=o.line<t.display.viewTo&&hl(t,o);if(!ie){var ge=Z[Z.length-1].measure,xe=ge.maps?ge.maps[ge.maps.length-1]:ge.map;ie={node:xe[xe.length-1],offset:xe[xe.length-2]-xe[xe.length-3]}}if(!$||!ie){e.removeAllRanges();return}var Fe=e.rangeCount&&e.getRangeAt(0),Ne;try{Ne=h($.node,$.offset,ie.offset,ie.node)}catch(qe){}Ne&&(!k&&t.state.focused?(e.collapse($.node,$.offset),Ne.collapsed||(e.removeAllRanges(),e.addRange(Ne))):(e.removeAllRanges(),e.addRange(Ne)),Fe&&e.anchorNode==null?e.addRange(Fe):k&&this.startGracePeriod()),this.rememberSelection()},li.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},li.prototype.showMultipleSelections=function(e){b(this.cm.display.cursorDiv,e.cursors),b(this.cm.display.selectionDiv,e.selection)},li.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},li.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return g(this.div,t)},li.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},li.prototype.blur=function(){this.div.blur()},li.prototype.getField=function(){return this.div},li.prototype.supportsTouch=function(){return!0},li.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():or(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},li.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},li.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(s&&y&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=Ho(t,e.anchorNode,e.anchorOffset),n=Ho(t,e.focusNode,e.focusOffset);i&&n&&or(t,function(){er(t.doc,Dr(i,n),Oe),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},li.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),o=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=et(n.line-1,Rt(e.doc,n.line-1).length)),o.ch==Rt(e.doc,o.line).text.length&&o.line<e.lastLine()&&(o=et(o.line+1,0)),n.line<t.viewFrom||o.line>t.viewTo-1)return!1;var M,z,Z;n.line==t.viewFrom||(M=di(e,n.line))==0?(z=Qt(t.view[0].line),Z=t.view[0].node):(z=Qt(t.view[M].line),Z=t.view[M-1].node.nextSibling);var $=di(e,o.line),ie,ge;if($==t.view.length-1?(ie=t.viewTo-1,ge=t.lineDiv.lastChild):(ie=Qt(t.view[$+1].line)-1,ge=t.view[$+1].node.previousSibling),!Z)return!1;for(var xe=e.doc.splitLines(tu(e,Z,ge,z,ie)),Fe=Vn(e.doc,et(z,0),et(ie,Rt(e.doc,ie).text.length));xe.length>1&&Fe.length>1;)if(Le(xe)==Le(Fe))xe.pop(),Fe.pop(),ie--;else if(xe[0]==Fe[0])xe.shift(),Fe.shift(),z++;else break;for(var Ne=0,qe=0,st=xe[0],_t=Fe[0],Lt=Math.min(st.length,_t.length);Ne<Lt&&st.charCodeAt(Ne)==_t.charCodeAt(Ne);)++Ne;for(var Ht=Le(xe),Dt=Le(Fe),Vt=Math.min(Ht.length-(xe.length==1?Ne:0),Dt.length-(Fe.length==1?Ne:0));qe<Vt&&Ht.charCodeAt(Ht.length-qe-1)==Dt.charCodeAt(Dt.length-qe-1);)++qe;if(xe.length==1&&Fe.length==1&&z==n.line)for(;Ne&&Ne>n.ch&&Ht.charCodeAt(Ht.length-qe-1)==Dt.charCodeAt(Dt.length-qe-1);)Ne--,qe++;xe[xe.length-1]=Ht.slice(0,Ht.length-qe).replace(/^\u200b+/,""),xe[0]=xe[0].slice(Ne).replace(/\u200b+$/,"");var dn=et(z,Ne),$t=et(ie,Fe.length?Le(Fe).length-qe:0);if(xe.length>1||xe[0]||jt(dn,$t))return Da(e.doc,xe,dn,$t,"+input"),!0},li.prototype.ensurePolled=function(){this.forceCompositionEnd()},li.prototype.reset=function(){this.forceCompositionEnd()},li.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},li.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},li.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&or(this.cm,function(){return si(e.cm)})},li.prototype.setUneditable=function(e){e.contentEditable="false"},li.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Ii(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},li.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},li.prototype.onContextMenu=function(){},li.prototype.resetPosition=function(){},li.prototype.needsContentAttribute=!0;function hl(e,t){var i=Ie(e,t.line);if(!i||i.hidden)return null;var n=Rt(e.doc,t.line),o=re(i,n,t.line),M=Ct(n,e.doc.direction),z="left";if(M){var Z=Tt(M,t.ch);z=Z%2?"right":"left"}var $=pt(o.map,t.ch,z);return $.offset=$.collapse=="right"?$.end:$.start,$}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Na(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,o){var M="",z=!1,Z=e.doc.lineSeparator(),$=!1;function ie(Ne){return function(qe){return qe.id==Ne}}function ge(){z&&(M+=Z,$&&(M+=Z),z=$=!1)}function xe(Ne){Ne&&(ge(),M+=Ne)}function Fe(Ne){if(Ne.nodeType==1){var qe=Ne.getAttribute("cm-text");if(qe){xe(qe);return}var st=Ne.getAttribute("cm-marker"),_t;if(st){var Lt=e.findMarks(et(n,0),et(o+1,0),ie(+st));Lt.length&&(_t=Lt[0].find(0))&&xe(Vn(e.doc,_t.from,_t.to).join(Z));return}if(Ne.getAttribute("contenteditable")=="false")return;var Ht=/^(pre|div|p|li|table|br)$/i.test(Ne.nodeName);if(!/^br$/i.test(Ne.nodeName)&&Ne.textContent.length==0)return;Ht&&ge();for(var Dt=0;Dt<Ne.childNodes.length;Dt++)Fe(Ne.childNodes[Dt]);/^(pre|p)$/i.test(Ne.nodeName)&&($=!0),Ht&&(z=!0)}else Ne.nodeType==3&&xe(Ne.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Fe(t),t==i);)t=t.nextSibling,$=!1;return M}function Ho(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return Na(e.clipPos(et(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var o=0;o<e.display.view.length;o++){var M=e.display.view[o];if(M.node==n)return nu(M,t,i)}}function nu(e,t,i){var n=e.text.firstChild,o=!1;if(!t||!g(n,t))return Na(et(Qt(e.line),0),!0);if(t==n&&(o=!0,t=n.childNodes[i],i=0,!t)){var M=e.rest?Le(e.rest):e.line;return Na(et(Qt(M),M.text.length),o)}var z=t.nodeType==3?t:null,Z=t;for(!z&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(z=t.firstChild,i&&(i=z.nodeValue.length));Z.parentNode!=n;)Z=Z.parentNode;var $=e.measure,ie=$.maps;function ge(_t,Lt,Ht){for(var Dt=-1;Dt<(ie?ie.length:0);Dt++)for(var Vt=Dt<0?$.map:ie[Dt],dn=0;dn<Vt.length;dn+=3){var $t=Vt[dn+2];if($t==_t||$t==Lt){var Sn=Qt(Dt<0?e.line:e.rest[Dt]),hi=Vt[dn]+Ht;return(Ht<0||$t!=_t)&&(hi=Vt[dn+(Ht?1:0)]),et(Sn,hi)}}}var xe=ge(z,Z,i);if(xe)return Na(xe,o);for(var Fe=Z.nextSibling,Ne=z?z.nodeValue.length-i:0;Fe;Fe=Fe.nextSibling){if(xe=ge(Fe,Fe.firstChild,0),xe)return Na(et(xe.line,xe.ch-Ne),o);Ne+=Fe.textContent.length}for(var qe=Z.previousSibling,st=i;qe;qe=qe.previousSibling){if(xe=ge(qe,qe.firstChild,-1),xe)return Na(et(xe.line,xe.ch+st),o);st+=qe.textContent.length}}var ki=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ne,this.hasSelection=!1,this.composing=null};ki.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var o=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),f&&(o.style.width="0px"),ze(o,"input",function(){G&&j>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),ze(o,"paste",function(z){if(at(n,z)||ol(z,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function M(z){if(at(n,z))return;if(n.somethingSelected())jo({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Z=ll(n);jo({lineWise:!0,text:Z.text}),z.type=="cut"?n.setSelections(Z.ranges,null,Oe):(i.prevInput="",o.value=Z.text.join(`
|
|
`),Y(o))}else return;z.type=="cut"&&(n.state.cutIncoming=+new Date)}ze(o,"cut",M),ze(o,"copy",M),ze(e.scroller,"paste",function(z){if(Rr(e,z)||at(n,z))return;if(!o.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var Z=new Event("paste");Z.clipboardData=z.clipboardData,o.dispatchEvent(Z)}),ze(e.lineSpace,"selectstart",function(z){Rr(e,z)||ee(z)}),ze(o,"compositionstart",function(){var z=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:z,range:n.markText(z,n.getCursor("to"),{className:"CodeMirror-composing"})}}),ze(o,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ki.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},ki.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ki.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Cr(e);if(e.options.moveInputWithCursor){var o=Rn(e,i.sel.primary().head,"div"),M=t.wrapper.getBoundingClientRect(),z=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+z.top-M.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+z.left-M.left))}return n},ki.prototype.showSelection=function(e){var t=this.cm,i=t.display;b(i.cursorDiv,e.cursors),b(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ki.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&Y(this.textarea),G&&j>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",G&&j>=9&&(this.hasSelection=null))},ki.prototype.getField=function(){return this.textarea},ki.prototype.supportsTouch=function(){return!1},ki.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!r||T()!=this.textarea))try{this.textarea.focus()}catch(e){}},ki.prototype.blur=function(){this.textarea.blur()},ki.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ki.prototype.receivedFocus=function(){this.slowPoll()},ki.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ki.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},ki.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ge(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=i.value;if(o==n&&!t.somethingSelected())return!1;if(G&&j>=9&&this.hasSelection===o||a&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var M=o.charCodeAt(0);if(M==8203&&!n&&(n="\u200B"),M==8666)return this.reset(),this.cm.execCommand("undo")}for(var z=0,Z=Math.min(n.length,o.length);z<Z&&n.charCodeAt(z)==o.charCodeAt(z);)++z;return or(t,function(){hs(t,o.slice(z),n.length-z,null,e.composing?"*compose":null),o.length>1e3||o.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ki.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ki.prototype.onKeyPress=function(){G&&j>=9&&(this.hasSelection=null),this.fastPoll()},ki.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var M=Fi(i,e),z=n.scroller.scrollTop;if(!M||m)return;var Z=i.options.resetSelectionOnContextMenu;Z&&i.doc.sel.contains(M)==-1&&Ii(i,er)(i.doc,Dr(M),Oe);var $=o.style.cssText,ie=t.wrapper.style.cssText,ge=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",o.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-ge.top-5)+"px; left: "+(e.clientX-ge.left-5)+`px;
|
|
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var xe;P&&(xe=window.scrollY),n.input.focus(),P&&window.scrollTo(null,xe),n.input.reset(),i.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=Ne,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Fe(){if(o.selectionStart!=null){var st=i.somethingSelected(),_t="\u200B"+(st?o.value:"");o.value="\u21DA",o.value=_t,t.prevInput=st?"":"\u200B",o.selectionStart=1,o.selectionEnd=_t.length,n.selForContextMenu=i.doc.sel}}function Ne(){if(t.contextMenuPending!=Ne)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ie,o.style.cssText=$,G&&j<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=z),o.selectionStart!=null){(!G||G&&j<9)&&Fe();var st=0,_t=function(){n.selForContextMenu==i.doc.sel&&o.selectionStart==0&&o.selectionEnd>0&&t.prevInput=="\u200B"?Ii(i,Ls)(i):st++<10?n.detectingSelectAll=setTimeout(_t,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(_t,200)}}if(G&&j>=9&&Fe(),R){pe(e);var qe=function(){St(window,"mouseup",qe),setTimeout(Ne,20)};ze(window,"mouseup",qe)}else setTimeout(Ne,50)},ki.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ki.prototype.setUneditable=function(){},ki.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?A(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=T();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=Z.getValue()}var o;if(e.form&&(ze(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var M=e.form;o=M.submit;try{var z=M.submit=function(){n(),M.submit=o,M.submit(),M.submit=z}}catch($){}}t.finishInit=function($){$.save=n,$.getTextArea=function(){return e},$.toTextArea=function(){$.toTextArea=isNaN,n(),e.parentNode.removeChild($.getWrapperElement()),e.style.display="",e.form&&(St(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=o))}},e.style.display="none";var Z=xi(function($){return e.parentNode.insertBefore($,e.nextSibling)},t);return Z}function ru(e){e.off=St,e.on=ze,e.wheelEventPixels=qa,e.Doc=hr,e.splitLines=vt,e.countColumn=J,e.findColumn=Pe,e.isWordChar=Qe,e.Pass=ke,e.signal=Ke,e.Line=Ti,e.changeEnd=Ir,e.scrollbarModel=Ja,e.Pos=et,e.cmpPos=jt,e.modes=yt,e.mimeModes=Nt,e.resolveMode=Je,e.getMode=xt,e.modeExtensions=Ut,e.extendMode=zt,e.copyState=hn,e.startState=gn,e.innerMode=Ln,e.commands=co,e.keyMap=Zr,e.keyName=Vs,e.isModifierKey=Gs,e.lookupKey=Ma,e.normalizeKeyMap=Ml,e.StringStream=Jt,e.SharedTextMarker=so,e.TextMarker=la,e.LineWidget=oo,e.e_preventDefault=ee,e.e_stopPropagation=ae,e.e_stop=pe,e.addClass=N,e.contains=g,e.rmClass=w,e.keyNames=ua}Jl(xi),$l(xi);var au="iter insert remove copy getEditor constructor".split(" ");for(var Wo in hr.prototype)hr.prototype.hasOwnProperty(Wo)&&oe(au,Wo)<0&&(xi.prototype[Wo]=function(e){return function(){return e.apply(this.doc,arguments)}}(hr.prototype[Wo]));return Te(hr),xi.inputStyles={textarea:ki,contenteditable:li},xi.defineMode=function(e){!xi.defaults.mode&&e!="null"&&(xi.defaults.mode=e),Gt.apply(this,arguments)},xi.defineMIME=on,xi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xi.defineMIME("text/plain","null"),xi.defineExtension=function(e,t){xi.prototype[e]=t},xi.defineDocExtension=function(e,t){hr.prototype[e]=t},xi.fromTextArea=iu,ru(xi),xi.version="5.58.2",xi})},Y1PL:function(ct,$e,Q){"use strict";Q.r($e),Q.d($e,"ResizableTextArea",function(){return oe});var se=Q("wx14"),W=Q("1OyB"),k=Q("vuIU"),X=Q("Ji7U"),D=Q("LK+K"),B=Q("q1tI"),G=Q("VTBJ"),j=Q("rePB"),P=Q("Zm9Q"),I=Q("Kwbf"),y=Q("c+Xe"),m=Q("m+aA"),p=Q("bdgK"),c=new Map;function u(Oe){Oe.forEach(function(Me){var Be,Pe=Me.target;(Be=c.get(Pe))===null||Be===void 0||Be.forEach(function(be){return be(Pe)})})}var f=new p.default(u),s=null,r=null;function a(Oe,Me){c.has(Oe)||(c.set(Oe,new Set),f.observe(Oe)),c.get(Oe).add(Me)}function d(Oe,Me){c.has(Oe)&&(c.get(Oe).delete(Me),c.get(Oe).size||(f.unobserve(Oe),c.delete(Oe)))}var L=function(Oe){Object(X.a)(Be,Oe);var Me=Object(D.a)(Be);function Be(){return Object(W.a)(this,Be),Me.apply(this,arguments)}return Object(k.a)(Be,[{key:"render",value:function(){return this.props.children}}]),Be}(B.Component),S=B.createContext(null);function x(Oe){var Me=Oe.children,Be=Oe.onBatchResize,Pe=B.useRef(0),be=B.useRef([]),le=B.useContext(S),Le=B.useCallback(function(tt,nt,lt){Pe.current+=1;var Et=Pe.current;be.current.push({size:tt,element:nt,data:lt}),Promise.resolve().then(function(){Et===Pe.current&&(Be==null||Be(be.current),be.current=[])}),le==null||le(tt,nt,lt)},[Be,le]);return B.createElement(S.Provider,{value:Le},Me)}function R(Oe){var Me=Oe.children,Be=Oe.disabled,Pe=B.useRef(null),be=B.useRef(null),le=B.useContext(S),Le=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),tt=B.isValidElement(Me)&&Object(y.c)(Me),nt=tt?Me.ref:null,lt=B.useMemo(function(){return Object(y.a)(nt,Pe)},[nt,Pe]),Et=B.useRef(Oe);Et.current=Oe;var Ve=B.useCallback(function(Qe){var ut=Et.current,gt=ut.onResize,ot=ut.data,it=Qe.getBoundingClientRect(),rt=it.width,Pt=it.height,It=Qe.offsetWidth,wt=Qe.offsetHeight,Tt=Math.floor(rt),Wt=Math.floor(Pt);if(Le.current.width!==Tt||Le.current.height!==Wt||Le.current.offsetWidth!==It||Le.current.offsetHeight!==wt){var Ct={width:Tt,height:Wt,offsetWidth:It,offsetHeight:wt};Le.current=Ct;var bt=It===Math.round(rt)?rt:It,ze=wt===Math.round(Pt)?Pt:wt,Kt=Object(G.a)(Object(G.a)({},Ct),{},{offsetWidth:bt,offsetHeight:ze});le==null||le(Kt,Qe,ot),gt&&Promise.resolve().then(function(){gt(Kt,Qe)})}},[]);return B.useEffect(function(){var Qe=Object(m.a)(Pe.current)||Object(m.a)(be.current);return Qe&&!Be&&a(Qe,Ve),function(){return d(Qe,Ve)}},[Pe.current,Be]),B.createElement(L,{ref:be},tt?B.cloneElement(Me,{ref:lt}):Me)}var O="rc-observer-key";function w(Oe){var Me=Oe.children,Be=Object(P.a)(Me);return Be.map(function(Pe,be){var le=(Pe==null?void 0:Pe.key)||"".concat(O,"-").concat(be);return B.createElement(R,Object(se.a)({},Oe,{key:le}),Pe)})}w.Collection=x;var E=w,b=Q("bT9E"),l=Q("TSYQ"),_=Q.n(l),h=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,g=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],T={},N;function V(Oe){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Be=Oe.getAttribute("id")||Oe.getAttribute("data-reactid")||Oe.getAttribute("name");if(Me&&T[Be])return T[Be];var Pe=window.getComputedStyle(Oe),be=Pe.getPropertyValue("box-sizing")||Pe.getPropertyValue("-moz-box-sizing")||Pe.getPropertyValue("-webkit-box-sizing"),le=parseFloat(Pe.getPropertyValue("padding-bottom"))+parseFloat(Pe.getPropertyValue("padding-top")),Le=parseFloat(Pe.getPropertyValue("border-bottom-width"))+parseFloat(Pe.getPropertyValue("border-top-width")),tt=g.map(function(lt){return"".concat(lt,":").concat(Pe.getPropertyValue(lt))}).join(";"),nt={sizingStyle:tt,paddingSize:le,borderSize:Le,boxSizing:be};return Me&&Be&&(T[Be]=nt),nt}function Y(Oe){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Be=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Pe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;N||(N=document.createElement("textarea"),N.setAttribute("tab-index","-1"),N.setAttribute("aria-hidden","true"),document.body.appendChild(N)),Oe.getAttribute("wrap")?N.setAttribute("wrap",Oe.getAttribute("wrap")):N.removeAttribute("wrap");var be=V(Oe,Me),le=be.paddingSize,Le=be.borderSize,tt=be.boxSizing,nt=be.sizingStyle;N.setAttribute("style","".concat(nt,";").concat(h)),N.value=Oe.value||Oe.placeholder||"";var lt=Number.MIN_SAFE_INTEGER,Et=Number.MAX_SAFE_INTEGER,Ve=N.scrollHeight,Qe;if(tt==="border-box"?Ve+=Le:tt==="content-box"&&(Ve-=le),Be!==null||Pe!==null){N.value=" ";var ut=N.scrollHeight-le;Be!==null&&(lt=ut*Be,tt==="border-box"&&(lt=lt+le+Le),Ve=Math.max(lt,Ve)),Pe!==null&&(Et=ut*Pe,tt==="border-box"&&(Et=Et+le+Le),Qe=Ve>Et?"":"hidden",Ve=Math.min(Et,Ve))}return{height:Ve,minHeight:lt,maxHeight:Et,overflowY:Qe,resize:"none"}}var U=Q("Gytx"),A=Q.n(U),J;(function(Oe){Oe[Oe.NONE=0]="NONE",Oe[Oe.RESIZING=1]="RESIZING",Oe[Oe.RESIZED=2]="RESIZED"})(J||(J={}));var ne=function(Oe){Object(X.a)(Be,Oe);var Me=Object(D.a)(Be);function Be(Pe){var be;return Object(W.a)(this,Be),be=Me.call(this,Pe),be.nextFrameActionId=void 0,be.resizeFrameId=void 0,be.textArea=void 0,be.saveTextArea=function(le){be.textArea=le},be.handleResize=function(le){var Le=be.state.resizeStatus,tt=be.props,nt=tt.autoSize,lt=tt.onResize;if(Le!==J.NONE)return;typeof lt=="function"&<(le),nt&&be.resizeOnNextFrame()},be.resizeOnNextFrame=function(){cancelAnimationFrame(be.nextFrameActionId),be.nextFrameActionId=requestAnimationFrame(be.resizeTextarea)},be.resizeTextarea=function(){var le=be.props.autoSize;if(!le||!be.textArea)return;var Le=le.minRows,tt=le.maxRows,nt=Y(be.textArea,!1,Le,tt);be.setState({textareaStyles:nt,resizeStatus:J.RESIZING},function(){cancelAnimationFrame(be.resizeFrameId),be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:J.RESIZED},function(){be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:J.NONE}),be.fixFirefoxAutoScroll()})})})})},be.renderTextArea=function(){var le=be.props,Le=le.prefixCls,tt=Le===void 0?"rc-textarea":Le,nt=le.autoSize,lt=le.onResize,Et=le.className,Ve=le.disabled,Qe=be.state,ut=Qe.textareaStyles,gt=Qe.resizeStatus,ot=Object(b.a)(be.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),it=_()(tt,Et,Object(j.a)({},"".concat(tt,"-disabled"),Ve));"value"in ot&&(ot.value=ot.value||"");var rt=Object(G.a)(Object(G.a)(Object(G.a)({},be.props.style),ut),gt===J.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return B.createElement(E,{onResize:be.handleResize,disabled:!(nt||lt)},B.createElement("textarea",Object(se.a)({},ot,{className:it,style:rt,ref:be.saveTextArea})))},be.state={textareaStyles:{},resizeStatus:J.NONE},be}return Object(k.a)(Be,[{key:"componentDidUpdate",value:function(be){(be.value!==this.props.value||!A()(be.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var be=this.textArea.selectionStart,le=this.textArea.selectionEnd;this.textArea.setSelectionRange(be,le)}}catch(Le){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Be}(B.Component),oe=ne,fe=function(Oe){Object(X.a)(Be,Oe);var Me=Object(D.a)(Be);function Be(Pe){var be;Object(W.a)(this,Be),be=Me.call(this,Pe),be.resizableTextArea=void 0,be.focus=function(){be.resizableTextArea.textArea.focus()},be.saveTextArea=function(Le){be.resizableTextArea=Le},be.handleChange=function(Le){var tt=be.props.onChange;be.setValue(Le.target.value,function(){be.resizableTextArea.resizeTextarea()}),tt&&tt(Le)},be.handleKeyDown=function(Le){var tt=be.props,nt=tt.onPressEnter,lt=tt.onKeyDown;Le.keyCode===13&&nt&&nt(Le),lt&<(Le)};var le=typeof Pe.value=="undefined"||Pe.value===null?Pe.defaultValue:Pe.value;return be.state={value:le},be}return Object(k.a)(Be,[{key:"setValue",value:function(be,le){"value"in this.props||this.setState({value:be},le)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return B.createElement(oe,Object(se.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(be){return"value"in be?{value:be.value}:null}}]),Be}(B.Component),ke=$e.default=fe},ZJlW:function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___XZ1Hd",flex_space_between:"flex_space_between___2oG4i",flex_box_vertical_center:"flex_box_vertical_center___1UWtb",flex_box_center_end:"flex_box_center_end___1o2xT",flex_box_column:"flex_box_column___SlAE0",list:"list___1HvWe",wrap:"wrap___10sri",lockWrap:"lockWrap___2djiu",li:"li___2W_zn",cover:"cover___2FS3L",img:"img___cyxrw",sign:"sign___1cxDK",name:"name___3tYlu",e:"e___1-orw",unit:"unit___ycOgg",tags:"tags___2FRpJ",tag:"tag___1e0XO"}},ZW9T:function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return Y});var se=Q("k1fw"),W=Q("miYZ"),k=Q("tsqr"),X=Q("rAM+"),D=Q("tJVT"),B=Q("PpiC"),G=Q("q1tI"),j=Q.n(G),P=Q("bdgK"),I=Q("oBTY"),y=Q("9og8"),m=Q("WmNS"),p=Q.n(m),c={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},u={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},f={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"#include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},s={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},r=Q("5VLF"),a=Q.n(r),d={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},L=function(A,J){return J.map(function(ne){return{label:ne,kind:A.languages.CompletionItemKind.Keyword,insertText:ne}})},S=function(A){return Object.keys(d.tables).map(function(J){return{label:J,kind:A.languages.CompletionItemKind.Variable,insertText:J}})},x=function(A,J){var ne=d.tables[A];return ne?ne.map(function(oe){return{label:oe,kind:J.languages.CompletionItemKind.Field,insertText:oe}}):[]};function R(U,A,J,ne,oe){var fe=A.getWordUntilPosition(J),ke={startLineNumber:J.lineNumber,endLineNumber:J.lineNumber,startColumn:fe.startColumn,endColumn:fe.endColumn},Oe=ne.map(function(Me){return{label:Me,kind:U.languages.CompletionItemKind.Keyword,insertText:Me,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ke}});return oe.map(function(Me){Oe.push(Object(se.a)(Object(se.a)({},Me),{},{range:ke}))}),Oe}var O=function(U){d.languages.map(function(oe){return U.languages.registerDocumentFormattingEditProvider(oe,{provideDocumentFormattingEdits:function(ke,Oe,Me){return Object(y.a)(p.a.mark(function Be(){var Pe;return p.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return Pe=a()(ke.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),le.abrupt("return",[{range:ke.getFullModelRange(),text:Pe}]);case 2:case"end":return le.stop()}},Be)}))()}}),oe});var A=f.quickKey.map(function(oe){return{label:oe.label,kind:U.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),J=s.quickKey.map(function(oe){return{label:oe.label,kind:U.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ne=u.quickKey.map(function(oe){return{label:oe.label,kind:U.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}});U.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(I.a)(f.keywords),Object(I.a)(f.quickKey.map(function(oe){return oe.label}))),provideCompletionItems:function(fe,ke){var Oe=fe.getValueInRange({startLineNumber:ke.lineNumber,startColumn:1,endLineNumber:ke.lineNumber,endColumn:ke.column}),Me=Oe.match(/cu/gim);console.log("match:",Me,ke,Oe,fe);var Be=[],Pe=ke.lineNumber,be=ke.column,le=fe.getValueInRange({startLineNumber:Pe,startColumn:0,endLineNumber:Pe,endColumn:be}),Le=le.trim().split(/\s+/),tt=Le[Le.length-1];if(tt.endsWith(".")){var nt=tt.slice(0,tt.length-1);Object.keys(d.tables).includes(nt)&&(Be=Object(I.a)(x(nt,U)))}else tt==="."?Be=[]:Be=[].concat(Object(I.a)(S(U)),Object(I.a)(L(U,f.keywords)),Object(I.a)(A));return{suggestions:Be}}}),U.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(I.a)(c.keywords)),provideCompletionItems:function(fe,ke){var Oe=fe.getValueInRange({startLineNumber:ke.lineNumber,startColumn:1,endLineNumber:ke.lineNumber,endColumn:ke.column}),Me=Oe.match(/cu/gim);console.log("match:",Me,ke,Oe,fe);var Be=[],Pe=ke.lineNumber,be=ke.column,le=fe.getValueInRange({startLineNumber:Pe,startColumn:0,endLineNumber:Pe,endColumn:be}),Le=le.trim().split(/\s+/),tt=Le[Le.length-1];if(tt.endsWith(".")){var nt=tt.slice(0,tt.length-1);Object.keys(d.tables).includes(nt)&&(Be=Object(I.a)(x(nt,U)))}else tt==="."?Be=[]:Be=[].concat(Object(I.a)(S(U)),Object(I.a)(L(U,c.keywords)));return{suggestions:Be}}}),U.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(I.a)(u.keywords)),provideCompletionItems:function(fe,ke){var Oe=[],Me=ke.lineNumber,Be=ke.column,Pe=fe.getValueInRange({startLineNumber:Me,startColumn:0,endLineNumber:Me,endColumn:Be}),be=Pe.trim().split(/\s+/),le=be[be.length-1];if(le.endsWith(".")){var Le=le.slice(0,le.length-1);Object.keys(d.tables).includes(Le)&&(Oe=Object(I.a)(x(Le,U)))}else le==="."?Oe=[]:Oe=[].concat(Object(I.a)(S(U)),Object(I.a)(L(U,u.keywords)),Object(I.a)(ne));return{suggestions:Oe}}}),U.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(I.a)(s.keywords)),provideCompletionItems:function(fe,ke){var Oe=[],Me=ke.lineNumber,Be=ke.column,Pe=fe.getValueInRange({startLineNumber:Me,startColumn:0,endLineNumber:Me,endColumn:Be}),be=Pe.trim().split(/\s+/),le=be[be.length-1];if(le.endsWith(".")){var Le=le.slice(0,le.length-1);Object.keys(d.tables).includes(Le)&&(Oe=Object(I.a)(x(Le,U)))}else le==="."?Oe=[]:Oe=[].concat(Object(I.a)(S(U)),Object(I.a)(L(U,s.keywords)),Object(I.a)(J));return{suggestions:Oe}}})},w="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",E=Q("LvDl"),b=Q("+ua5");function l(U){return/^\d+$/.test(U)?"".concat(U,"px"):U}function _(){}var h=!1,g={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function T(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=U;if(Array.isArray(U)){for(var J=0;J<U.length;J++){var ne=g[U[J]];if(ne)return ne}return A[0]}return g[A]||A}var N=null,V=$e.b=function(U){var A=U.width,J=A===void 0?"100%":A,ne=U.height,oe=ne===void 0?"100%":ne,fe=U.value,ke=U.language,Oe=ke===void 0?"javascript":ke,Me=U.style,Be=Me===void 0?{}:Me,Pe=U.options,be=Pe===void 0?{}:Pe,le=U.overrideServices,Le=le===void 0?{}:le,tt=U.theme,nt=tt===void 0?"vs-dark":tt,lt=U.onEditBlur,Et=U.onSave,Ve=U.autoHeight,Qe=Ve===void 0?!1:Ve,ut=U.forbidCopy,gt=ut===void 0?!1:ut,ot=U.onChange,it=ot===void 0?_:ot,rt=U.editorDidMount,Pt=rt===void 0?_:rt,It=U.onFocus,wt=It===void 0?_:It,Tt=U.filename,Wt=Tt===void 0?"educoder.txt":Tt,Ct=U.errorLine,bt=U.errorContent,ze=bt===void 0?"":bt,Kt=Object(B.a)(U,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),St=Object(G.useRef)(),Ke=Object(G.useRef)({}),at=Object(G.useRef)(),Ce=Object(G.useRef)(!1),Ee=Object(G.useRef)(),Te=Object(G.useState)(!1),ee=Object(D.a)(Te,2),ae=ee[0],de=ee[1];function pe(){var Je;return St.current&&(Je=new P.default(function(xt){var Ut=Object(X.a)(xt),zt;try{for(Ut.s();!(zt=Ut.n()).done;){var hn=zt.value;(hn.target.offsetHeight>0||hn.target.offsetWidth>0)&&Ke.current.instance.layout()}}catch(Ln){Ut.e(Ln)}finally{Ut.f()}}),Je.observe(St.current)),Je}function _e(){k.b.warn(decodeURIComponent(w))}var Re=function(){var xt=Ke.current.instance;if(fe!=null&&xt&&ae){var Ut=xt.getModel();Ut&&fe!==Ut.getValue()&&(h=!0,Ut.setValue(fe),xt.layout(),h=!1)}};Object(G.useEffect)(function(){at.current&&clearTimeout(at.current),at.current=setTimeout(function(){Re()},500)},[fe,ae,Ke.current]),Object(G.useEffect)(function(){if(Ct&&Ke.current&&Ke.current.instance){var Je=Ke.current.instance;Je.changeViewZones(function(Ut){var zt=document.createElement("div");zt.style.padding="10px 20px",zt.style.width="calc(100% - 20px)",zt.className="my-error-line-wrp",zt.innerHTML=ze,Ut.addZone({afterLineNumber:Ct||11,heightInLines:3,domNode:zt})});var xt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Je.addOverlayWidget(xt),Je.revealPositionInCenter({lineNumber:20,column:1})}},[Ct,Ke.current,ae]);function De(){var Je=Ke.current.instance;if(Je){var xt=Je.getSelection(),Ut=Ke.current.pastePos||{},zt=new N.Range(Ut.startLineNumber||xt.endLineNumber,Ut.startColumn||xt.endColumn,Ut.endLineNumber||xt.endLineNumber,Ut.endColumn||xt.endColumn);setTimeout(function(){Je.executeEdits("",[{range:zt,text:""}])},300)}}function Ze(Je){(window.navigator.platform.match("Mac")?Je.metaKey:Je.ctrlKey)&&Je.keyCode==83&&(Je.preventDefault(),Et())}var dt=function(){if(Qe&&Ke.current.instance){var xt=Ke.current.instance.getContentHeight();Gt(xt<oe?oe:xt)}else Gt(oe)};function ht(Je){var xt=document.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Je.dispatchEvent(xt)}function Ft(Je,xt){var Ut=window.URL||window.webkitURL||window,zt=new Blob([xt]),hn=document.createElementNS("http://www.w3.org/1999/xhtml","a");hn.href=Ut.createObjectURL(zt),hn.download=Je,ht(hn)}Object(G.useEffect)(function(){dt()},[dt]),Object(G.useEffect)(function(){St.current&&!ae&&Q.e(27).then(Q.t.bind(null,"M/lh",7)).then(function(Je){try{N=Je,Ke.current.instance=N.editor.create(St.current,{value:fe,language:T(Oe),theme:nt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},Le);var xt=Ke.current.instance;if(Pt(xt,N),setTimeout(function(){dt(),Ke.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ft(Wt||"educoder.txt",xt.getValue())}})},500),Ke.current.subscription=xt.onDidChangeModelContent(function(zt){Ce.current?clearTimeout(Ee.current):(dt(),it(xt.getValue(),zt)),Ee.current=setTimeout(function(){Ce.current=!1},500)}),window.Monaco||O(N),gt&&(xt.addCommand(N.KeyMod.CtrlCmd|N.KeyMod.Shift|N.KeyCode.KEY_V,function(){return _e(),null}),xt.addCommand(N.KeyMod.CtrlCmd|N.KeyCode.KEY_C,function(){return _e(),null})),window.Monaco=N,lt&&xt.onDidBlurEditorWidget(function(){lt(xt.getValue())}),wt&&xt.onDidFocusEditorText(function(){wt(xt.getValue())}),gt){xt.addCommand(N.KeyMod.CtrlCmd|N.KeyCode.KEY_V,function(){return _e(),null}),xt.onDidPaste(function(zt){Ke.current.pastePos=zt});try{window.addEventListener("paste",De)}catch(zt){}}var Ut=pe();return de(!0),function(){var zt=Ke.current.instance;zt.dispose();var hn=zt.getModel();hn&&hn.dispose(),Ke.current.subscription&&Ke.current.subscription.dispose(),gt&&window.removeEventListener("paste",De),Ut.unobserve(St.current)}}catch(zt){}})},[]),Object(G.useEffect)(function(){var Je=Ke.current.instance;if(Je&&ae)return document.addEventListener("keydown",Ze,!1),function(){document.removeEventListener("keydown",Ze)}},[Et,ae]),Object(G.useEffect)(function(){var Je=Ke.current.instance;if(Je&&ae){var xt=T(Oe);N.editor.setModelLanguage(Je.getModel(),xt),console.log("language:",Oe,Je.getModel(),xt)}},[Oe,ae]),Object(G.useEffect)(function(){var Je=Ke.current.instance;Je&&ae&&N.editor.setTheme(nt)},[nt,ae]),Object(G.useEffect)(function(){var Je=Ke.current.instance;Je&&ae&&(Je.updateOptions(Object(se.a)({},be)),setTimeout(function(){Je.getModel().updateOptions(Object(se.a)({},be))},200))},[JSON.stringify(be),ae]),Object(G.useEffect)(function(){var Je=Ke.current.instance;Je&&ae&&Je.layout()},[J,oe,ae]);var vt=Object(G.useState)(l(J)),Ge=Object(D.a)(vt,2),en=Ge[0],je=Ge[1],un=Object(G.useState)(l(oe)),yt=Object(D.a)(un,2),Nt=yt[0],Gt=yt[1],on=Object(se.a)(Object(se.a)({},Be),{},{width:en,height:Nt});return j.a.createElement("div",{className:"my-monaco-editor",ref:St,style:on})};function Y(U){var A=U.width,J=A===void 0?"100%":A,ne=U.height,oe=ne===void 0?"100%":ne,fe=U.original,ke=U.modified,Oe=U.language,Me=U.options,Be=Me===void 0?{}:Me,Pe=Object(G.useRef)(),be=Object(G.useState)(null),le=Object(D.a)(be,2),Le=le[0],tt=le[1];function nt(Qe){var ut;return Pe.current&&(ut=new P.default(function(gt){var ot=Object(X.a)(gt),it;try{for(ot.s();!(it=ot.n()).done;){var rt=it.value;(rt.target.offsetHeight>0||rt.target.offsetWidth>0)&&Qe.layout()}}catch(Pt){ot.e(Pt)}finally{ot.f()}}),ut.observe(Pe.current)),ut}Object(G.useEffect)(function(){Pe.current&&Q.e(27).then(Q.t.bind(null,"M/lh",7)).then(function(Qe){N=Qe;var ut=N.editor.createDiffEditor(Pe.current,Object(se.a)(Object(se.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Be),{},{wordWrap:!0}));tt(ut);var gt=nt(ut);return function(){ut.dispose();var ot=ut.getModel();ot&&ot.dispose(),gt.unobserve(Pe.current)}})},[]),Object(G.useEffect)(function(){Le&&Le.setModel({original:N.editor.createModel(fe,Oe),modified:N.editor.createModel(ke,Oe)})},[fe,ke,Oe,Le]);var lt=l(J),Et=l(oe),Ve={width:lt,height:Et};return j.a.createElement("div",{className:"my-diff-editor",ref:Pe,style:Ve})}},ZpRC:function(ct,$e,Q){"use strict";function se(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function W(y,m){return(!m||y!=="hidden")&&y!=="visible"&&y!=="clip"}function k(y,m){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var p=getComputedStyle(y,null);return W(p.overflowY,m)||W(p.overflowX,m)||function(c){var u=function(f){if(!f.ownerDocument||!f.ownerDocument.defaultView)return null;try{return f.ownerDocument.defaultView.frameElement}catch(s){return null}}(c);return!!u&&(u.clientHeight<c.scrollHeight||u.clientWidth<c.scrollWidth)}(y)}return!1}function X(y,m,p,c,u,f,s,r){return f<y&&s>m||f>y&&s<m?0:f<=y&&r<=p||s>=m&&r>=p?f-y-c:s>m&&r<p||f<y&&r>p?s-m+u:0}var D=function(y,m){var p=window,c=m.scrollMode,u=m.block,f=m.inline,s=m.boundary,r=m.skipOverflowHiddenElements,a=typeof s=="function"?s:function(ut){return ut!==s};if(!se(y))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,L=[],S=y;se(S)&&a(S);){if((S=S.parentElement)===d){L.push(S);break}S!=null&&S===document.body&&k(S)&&!k(document.documentElement)||S!=null&&k(S,r)&&L.push(S)}for(var x=p.visualViewport?p.visualViewport.width:innerWidth,R=p.visualViewport?p.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,w=window.scrollY||pageYOffset,E=y.getBoundingClientRect(),b=E.height,l=E.width,_=E.top,h=E.right,g=E.bottom,T=E.left,N=u==="start"||u==="nearest"?_:u==="end"?g:_+b/2,V=f==="center"?T+l/2:f==="end"?h:T,Y=[],U=0;U<L.length;U++){var A=L[U],J=A.getBoundingClientRect(),ne=J.height,oe=J.width,fe=J.top,ke=J.right,Oe=J.bottom,Me=J.left;if(c==="if-needed"&&_>=0&&T>=0&&g<=R&&h<=x&&_>=fe&&g<=Oe&&T>=Me&&h<=ke)return Y;var Be=getComputedStyle(A),Pe=parseInt(Be.borderLeftWidth,10),be=parseInt(Be.borderTopWidth,10),le=parseInt(Be.borderRightWidth,10),Le=parseInt(Be.borderBottomWidth,10),tt=0,nt=0,lt="offsetWidth"in A?A.offsetWidth-A.clientWidth-Pe-le:0,Et="offsetHeight"in A?A.offsetHeight-A.clientHeight-be-Le:0;if(d===A)tt=u==="start"?N:u==="end"?N-R:u==="nearest"?X(w,w+R,R,be,Le,w+N,w+N+b,b):N-R/2,nt=f==="start"?V:f==="center"?V-x/2:f==="end"?V-x:X(O,O+x,x,Pe,le,O+V,O+V+l,l),tt=Math.max(0,tt+w),nt=Math.max(0,nt+O);else{tt=u==="start"?N-fe-be:u==="end"?N-Oe+Le+Et:u==="nearest"?X(fe,Oe,ne,be,Le+Et,N,N+b,b):N-(fe+ne/2)+Et/2,nt=f==="start"?V-Me-Pe:f==="center"?V-(Me+oe/2)+lt/2:f==="end"?V-ke+le+lt:X(Me,ke,oe,Pe,le+lt,V,V+l,l);var Ve=A.scrollLeft,Qe=A.scrollTop;N+=Qe-(tt=Math.max(0,Math.min(Qe+tt,A.scrollHeight-ne+Et))),V+=Ve-(nt=Math.max(0,Math.min(Ve+nt,A.scrollWidth-oe+lt)))}Y.push({el:A,top:tt,left:nt})}return Y};function B(y){return y===Object(y)&&Object.keys(y).length!==0}function G(y,m){m===void 0&&(m="auto");var p="scrollBehavior"in document.body.style;y.forEach(function(c){var u=c.el,f=c.top,s=c.left;u.scroll&&p?u.scroll({top:f,left:s,behavior:m}):(u.scrollTop=f,u.scrollLeft=s)})}function j(y){return y===!1?{block:"end",inline:"nearest"}:B(y)?y:{block:"start",inline:"nearest"}}function P(y,m){var p=!y.ownerDocument.documentElement.contains(y);if(B(m)&&typeof m.behavior=="function")return m.behavior(p?[]:D(y,m));if(p)return;var c=j(m);return G(D(y,c),c.behavior)}var I=$e.a=P},bT9E:function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return W});var se=Q("VTBJ");function W(k,X){var D=Object(se.a)({},k);return Array.isArray(X)&&X.forEach(function(B){delete D[B]}),D}},c5Ni:function(ct,$e,Q){},cFMs:function(ct,$e){ct.exports="data:image/png;base64,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"},cz0n:function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___G8W6i",flex_space_between:"flex_space_between___1p_ZB",flex_box_vertical_center:"flex_box_vertical_center___2wivF",flex_box_center_end:"flex_box_center_end___y5a20",flex_box_column:"flex_box_column___6oXp3",tabs:"tabs___sKski",active:"active___10xGM"}},dejd:function(ct,$e,Q){},dmUQ:function(ct,$e,Q){"use strict";var se=Q("Ff2n"),W=Q("rePB"),k=Q("1OyB"),X=Q("vuIU"),D=Q("Ji7U"),B=Q("md7G"),G=Q("foSv"),j=Q("q1tI"),P=Q.n(j),I=Q("TSYQ"),y=Q.n(I),m=Q("4IlW");function p(b,l){var _=Object.keys(b);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(b);l&&(h=h.filter(function(g){return Object.getOwnPropertyDescriptor(b,g).enumerable})),_.push.apply(_,h)}return _}function c(b){for(var l=1;l<arguments.length;l++){var _=arguments[l]!=null?arguments[l]:{};l%2?p(Object(_),!0).forEach(function(h){Object(W.a)(b,h,_[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(_)):p(Object(_)).forEach(function(h){Object.defineProperty(b,h,Object.getOwnPropertyDescriptor(_,h))})}return b}function u(b){var l=f();return function(){var h=Object(G.a)(b),g;if(l){var T=Object(G.a)(this).constructor;g=Reflect.construct(h,arguments,T)}else g=h.apply(this,arguments);return Object(B.a)(this,g)}}function f(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(b){return!1}}function s(){}function r(b){b.preventDefault()}var a=function(l){return l.replace(/[^\w.-]+/g,"")},d=200,L=600,S=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(l){return l!=null},R=function(l,_){return _===l||typeof _=="number"&&typeof l=="number"&&isNaN(_)&&isNaN(l)},O=function(b){Object(D.a)(_,b);var l=u(_);function _(h){var g;Object(k.a)(this,_),g=l.call(this,h),g.onKeyDown=function(V){var Y=g.props,U=Y.onKeyDown,A=Y.onPressEnter;if(V.keyCode===m.a.UP){var J=g.getRatio(V);g.up(V,J,null),g.stop()}else if(V.keyCode===m.a.DOWN){var ne=g.getRatio(V);g.down(V,ne,null),g.stop()}else V.keyCode===m.a.ENTER&&A&&A(V);if(g.recordCursorPosition(),g.lastKeyCode=V.keyCode,U){for(var oe=arguments.length,fe=new Array(oe>1?oe-1:0),ke=1;ke<oe;ke++)fe[ke-1]=arguments[ke];U.apply(void 0,[V].concat(fe))}},g.onKeyUp=function(V){var Y=g.props.onKeyUp;if(g.stop(),g.recordCursorPosition(),Y){for(var U=arguments.length,A=new Array(U>1?U-1:0),J=1;J<U;J++)A[J-1]=arguments[J];Y.apply(void 0,[V].concat(A))}},g.onChange=function(V){var Y=g.props.onChange;g.state.focused&&(g.inputting=!0),g.rawInput=g.props.parser(g.getValueFromEvent(V)),g.setState({inputValue:g.rawInput}),Y(g.toNumber(g.rawInput))},g.onMouseUp=function(){var V=g.props.onMouseUp;g.recordCursorPosition(),V&&V.apply(void 0,arguments)},g.onFocus=function(){var V;g.setState({focused:!0}),(V=g.props).onFocus.apply(V,arguments)},g.onBlur=function(){var V=g.props.onBlur;g.inputting=!1,g.setState({focused:!1});var Y=g.getCurrentValidValue(g.state.inputValue),U=g.setValue(Y,s);if(V){var A=g.input.value,J=g.getInputDisplayValue({focus:!1,value:U});g.input.value=J&&Number(J),V.apply(void 0,arguments),g.input.value=A}},g.getRatio=function(V){var Y=1;return V.metaKey||V.ctrlKey?Y=.1:V.shiftKey&&(Y=10),Y},g.getFullNum=function(V){return isNaN(V)?V:/e/i.test(String(V))?Number(V).toFixed(18).replace(/\.?0+$/,""):V},g.getPrecision=function(V){if(x(g.props.precision))return g.props.precision;var Y=String(V);if(Y.indexOf("e-")>=0)return parseInt(Y.slice(Y.indexOf("e-")+2),10);var U=0;return Y.indexOf(".")>=0&&(U=Y.length-Y.indexOf(".")-1),U},g.getInputDisplayValue=function(V){var Y=V||g.state,U=Y.focused,A=Y.inputValue,J=Y.value,ne;U?ne=A:ne=g.toPrecisionAsStep(J),ne==null&&(ne="");var oe=g.formatWrapper(ne);return x(g.props.decimalSeparator)&&(oe=oe.toString().replace(".",g.props.decimalSeparator)),oe},g.recordCursorPosition=function(){try{g.cursorStart=g.input.selectionStart,g.cursorEnd=g.input.selectionEnd,g.currentValue=g.input.value,g.cursorBefore=g.input.value.substring(0,g.cursorStart),g.cursorAfter=g.input.value.substring(g.cursorEnd)}catch(V){}},g.restoreByAfter=function(V){if(V===void 0)return!1;var Y=g.input.value,U=Y.lastIndexOf(V);if(U===-1)return!1;var A=g.cursorBefore.length;return g.lastKeyCode===m.a.DELETE&&g.cursorBefore.charAt(A-1)===V[0]?(g.fixCaret(A,A),!0):U+V.length===Y.length?(g.fixCaret(U,U),!0):!1},g.partRestoreByAfter=function(V){return V===void 0?!1:Array.prototype.some.call(V,function(Y,U){var A=V.substring(U);return g.restoreByAfter(A)})},g.isNotCompleteNumber=function(V){return isNaN(V)||V===""||V===null||V&&V.toString().indexOf(".")===V.toString().length-1},g.stop=function(){g.autoStepTimer&&clearTimeout(g.autoStepTimer)},g.down=function(V,Y,U){g.pressingUpOrDown=!0,g.step("down",V,Y,U)},g.up=function(V,Y,U){g.pressingUpOrDown=!0,g.step("up",V,Y,U)},g.saveInput=function(V){g.input=V};var T=h.value;T===void 0&&(T=h.defaultValue),g.state={focused:h.autoFocus};var N=g.getValidValue(g.toNumber(T));return g.state=c(c({},g.state),{},{inputValue:g.toPrecisionAsStep(N),value:N}),g}return Object(X.a)(_,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(g){var T=this.props,N=T.value,V=T.onChange,Y=T.max,U=T.min,A=this.state.focused;if(g){if(!R(g.value,N)||!R(g.max,Y)||!R(g.min,U)){var J=A?N:this.getValidValue(N),ne;this.pressingUpOrDown?ne=J:this.inputting?ne=this.rawInput:ne=this.toPrecisionAsStep(J),this.setState({value:J,inputValue:ne})}var oe="value"in this.props?N:this.state.value;"max"in this.props&&g.max!==Y&&typeof oe=="number"&&oe>Y&&V&&V(Y),"min"in this.props&&g.min!==U&&typeof oe=="number"&&oe<U&&V&&V(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var fe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?fe=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(fe=this.cursorStart):fe=this.input.value.length,this.fixCaret(fe,fe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ke){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(g){var T=g;return T===""?T="":this.isNotCompleteNumber(parseFloat(T))?T=this.state.value:T=this.getValidValue(T),this.toNumber(T)}},{key:"getValueFromEvent",value:function(g){var T=g.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(T=T.replace(this.props.decimalSeparator,".")),T}},{key:"getValidValue",value:function(g){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,V=parseFloat(g);return isNaN(V)?g:(V<T&&(V=T),V>N&&(V=N),V)}},{key:"setValue",value:function(g,T){var N=this.props.precision,V=this.isNotCompleteNumber(parseFloat(g))?null:parseFloat(g),Y=this.state.value,U=Y===void 0?null:Y,A=this.state.inputValue,J=A===void 0?null:A,ne=typeof V=="number"?V.toFixed(N):"".concat(V),oe=V!==U||ne!=="".concat(J);return"value"in this.props?(J=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:J},T)):this.setState({value:V,inputValue:this.toPrecisionAsStep(g)},T),oe&&this.props.onChange(V),V}},{key:"getMaxPrecision",value:function(g){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.props,V=N.precision,Y=N.step;if(x(V))return V;var U=this.getPrecision(T),A=this.getPrecision(Y),J=this.getPrecision(g);return g?Math.max(J,U+A):U+A}},{key:"getPrecisionFactor",value:function(g){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.getMaxPrecision(g,T);return Math.pow(10,N)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(g){return this.props.formatter?this.props.formatter(g):g}},{key:"toPrecisionAsStep",value:function(g){if(this.isNotCompleteNumber(g)||g==="")return g;var T=Math.abs(this.getMaxPrecision(g));return isNaN(T)?g.toString():Number(g).toFixed(T)}},{key:"toNumber",value:function(g){var T=this.props.precision,N=this.state.focused,V=g&&g.length>16&&N;return this.isNotCompleteNumber(g)||V?g:x(T)?Math.round(g*Math.pow(10,T))/Math.pow(10,T):Number(g)}},{key:"upStep",value:function(g,T){var N=this.props.step,V=this.getPrecisionFactor(g,T),Y=Math.abs(this.getMaxPrecision(g,T)),U=((V*g+V*N*T)/V).toFixed(Y);return this.toNumber(U)}},{key:"downStep",value:function(g,T){var N=this.props.step,V=this.getPrecisionFactor(g,T),Y=Math.abs(this.getMaxPrecision(g,T)),U=((V*g-V*N*T)/V).toFixed(Y);return this.toNumber(U)}},{key:"step",value:function(g,T){var N=this,V=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Y=arguments.length>3?arguments[3]:void 0;this.stop(),T&&(T.persist(),T.preventDefault());var U=this.props;if(U.disabled)return;var A=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(A))return;var J=this["".concat(g,"Step")](A,V),ne=J>U.max||J<U.min;if(J>U.max?J=U.max:J<U.min&&(J=U.min),this.setValue(J,null),this.setState({focused:!0},function(){N.pressingUpOrDown=!1}),ne)return;this.autoStepTimer=setTimeout(function(){N[g](T,V,!0)},Y?d:L)}},{key:"fixCaret",value:function(g,T){if(g===void 0||T===void 0||!this.input||!this.input.value)return;try{var N=this.input.selectionStart,V=this.input.selectionEnd;(g!==N||T!==V)&&this.input.setSelectionRange(g,T)}catch(Y){}}},{key:"render",value:function(){var g,T=this.props,N=T.prefixCls,V=T.disabled,Y=T.readOnly,U=T.useTouch,A=T.autoComplete,J=T.upHandler,ne=T.downHandler,oe=T.className,fe=T.max,ke=T.min,Oe=T.style,Me=T.title,Be=T.onMouseEnter,Pe=T.onMouseLeave,be=T.onMouseOver,le=T.onMouseOut,Le=T.required,tt=T.onClick,nt=T.tabIndex,lt=T.type,Et=T.placeholder,Ve=T.id,Qe=T.inputMode,ut=T.pattern,gt=T.step,ot=T.maxLength,it=T.autoFocus,rt=T.name,Pt=T.onPaste,It=T.onInput,wt=Object(se.a)(T,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Tt=this.state,Wt=Tt.value,Ct=Tt.focused,bt=y()(N,(g={},Object(W.a)(g,oe,!!oe),Object(W.a)(g,"".concat(N,"-disabled"),V),Object(W.a)(g,"".concat(N,"-focused"),Ct),g)),ze={};Object.keys(wt).forEach(function(pe){(pe.substr(0,5)==="data-"||pe.substr(0,5)==="aria-"||pe==="role")&&(ze[pe]=wt[pe])});var Kt=!Y&&!V,St=this.getInputDisplayValue(null),Ke=(Wt||Wt===0)&&(isNaN(Wt)||Number(Wt)>=fe),at=(Wt||Wt===0)&&(isNaN(Wt)||Number(Wt)<=ke),Ce=Ke||V||Y,Ee=at||V||Y,Te=y()("".concat(N,"-handler"),"".concat(N,"-handler-up"),Object(W.a)({},"".concat(N,"-handler-up-disabled"),Ce)),ee=y()("".concat(N,"-handler"),"".concat(N,"-handler-down"),Object(W.a)({},"".concat(N,"-handler-down-disabled"),Ee)),ae=U?{onTouchStart:Ce?s:this.up,onTouchEnd:this.stop}:{onMouseDown:Ce?s:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},de=U?{onTouchStart:Ee?s:this.down,onTouchEnd:this.stop}:{onMouseDown:Ee?s:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return P.a.createElement("div",{className:bt,style:Oe,title:Me,onMouseEnter:Be,onMouseLeave:Pe,onMouseOver:be,onMouseOut:le,onFocus:function(){return null},onBlur:function(){return null}},P.a.createElement("div",{className:"".concat(N,"-handler-wrap")},P.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":Ce,className:Te}),J||P.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-up-inner"),onClick:r})),P.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Decrease Value","aria-disabled":Ee,className:ee}),ne||P.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-down-inner"),onClick:r}))),P.a.createElement("div",{className:"".concat(N,"-input-wrap")},P.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ke,"aria-valuemax":fe,"aria-valuenow":Wt,required:Le,type:lt,placeholder:Et,onPaste:Pt,onClick:tt,onMouseUp:this.onMouseUp,className:"".concat(N,"-input"),tabIndex:nt,autoComplete:A,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Kt?this.onKeyDown:s,onKeyUp:Kt?this.onKeyUp:s,autoFocus:it,maxLength:ot,readOnly:Y,disabled:V,max:fe,min:ke,step:gt,name:rt,title:Me,id:Ve,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(St),pattern:ut,inputMode:Qe,onInput:It},ze))))}}]),_}(P.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:S,min:-S,step:1,style:{},onChange:s,onKeyDown:s,onPressEnter:s,onFocus:s,onBlur:s,parser:a,required:!1,autoComplete:"off"};var w=O,E=$e.a=w},"f0W+":function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___2AWuG",flex_space_between:"flex_space_between___4j1zo",flex_box_vertical_center:"flex_box_vertical_center___3dWcm",flex_box_center_end:"flex_box_center_end___qvHJi",flex_box_column:"flex_box_column___3Eier",tabs:"tabs___25WKT",tabsWrap:"tabsWrap___2lPJE",active:"active___gGp9s"}},f9pc:function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___fO1Sq",flex_space_between:"flex_space_between___2MANs",flex_box_vertical_center:"flex_box_vertical_center___2x-su",flex_box_center_end:"flex_box_center_end___6bZNq",flex_box_column:"flex_box_column___CGTHC",quickPager:"quickPager___2XH6F",disabled:"disabled___2gPWV"}},fJjg:function(ct,$e,Q){"use strict";var se=Q("2qtc"),W=Q("kLXV"),k=Q("7Kak"),X=Q("9yH6"),D=Q("k1fw"),B=Q("miYZ"),G=Q("tsqr"),j=Q("9og8"),P=Q("tJVT"),I=Q("PpiC"),y=Q("5NDa"),m=Q("5rEg"),p=Q("WmNS"),c=Q.n(p),u=Q("q1tI"),f=Q.n(u),s=Q("9kvl"),r=Q("Nska"),a=Q.n(r),d=Q("1vsH"),L=Q("Nf5h"),S=Q("Fhpe"),x=Q.n(S),R=m.a.Search,O=function(E){var b=E.userDetail,l=E.globalSetting,_=E.loading,h=E.dispatch,g=Object(I.a)(E,["userDetail","globalSetting","loading","dispatch"]),T=Object(u.useState)(""),N=Object(P.a)(T,2),V=N[0],Y=N[1],U=Object(u.useState)([]),A=Object(P.a)(U,2),J=A[0],ne=A[1],oe=Object(u.useState)(),fe=Object(P.a)(oe,2),ke=fe[0],Oe=fe[1],Me=Object(u.useState)(!1),Be=Object(P.a)(Me,2),Pe=Be[0],be=Be[1];Object(u.useEffect)(function(){le()},[]);var le=function(){var tt=Object(j.a)(c.a.mark(function nt(){var lt;return c.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return Ve.next=2,h({type:"userDetail/topicGetCourseList",payload:{search:V}});case 2:lt=Ve.sent,lt&&ne((lt==null?void 0:lt.courses)||[]);case 4:case"end":return Ve.stop()}},nt)}));return function(){return tt.apply(this,arguments)}}(),Le=function(){var tt=Object(j.a)(c.a.mark(function nt(){var lt,Et,Ve,Qe,ut;return c.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:if(ke){ot.next=4;break}return G.b.info("\u60A8\u9700\u8981\u521B\u5EFA\u8BFE\u5802\uFF0C\u624D\u80FD\u53D1\u9001"),be(!0),ot.abrupt("return");case 4:return ot.next=6,h({type:"userDetail/topicSendToClass",payload:Object(D.a)({course_id:ke},(lt=b.actionTabs)===null||lt===void 0?void 0:lt.params)});case 6:Et=ot.sent,h({type:"userDetail/setActionTabs",payload:{}}),Et&&Et.status===0&&(ut={normal:"common_homework",group:"group_homework",exercise:"exercise",poll:"poll"},Object(d.S)("/classrooms/".concat(ke,"/").concat(ut[(Ve=b.actionTabs)===null||Ve===void 0||((Qe=Ve.params)===null||Qe===void 0)?void 0:Qe.object_type])));case 9:case"end":return ot.stop()}},nt)}));return function(){return tt.apply(this,arguments)}}();return f.a.createElement(W.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:b.actionTabs.key==="UserDetail-SendToClass",title:"\u53D1\u9001\u81F3\u8BFE\u5802",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:_["userDetail/sendToClass"],width:600,onOk:Le,wrapClassName:x.a.CustomCss,onCancel:function(){h({type:"userDetail/setActionTabs",payload:{}})}},f.a.createElement("div",{className:a.a.wrap},f.a.createElement("div",{className:"mb10"},f.a.createElement(L.e,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:V,style:{width:500},onChange:function(nt){Y(nt),le()}})),f.a.createElement("div",{className:a.a.radioWrap},f.a.createElement(X.a.Group,{value:ke,onChange:function(nt){Oe(nt.target.value),be(!1)}},J.map(function(tt,nt){return f.a.createElement(X.a,{className:a.a.radio,value:tt.course_id,key:tt.course_id},tt.course_name)}))),f.a.createElement("div",{className:a.a.title},"\u6E29\u99A8\u63D0\u793A\uFF1A\u9009\u62E9\u7684\u9898\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802"),Pe&&f.a.createElement("div",{className:a.a.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u8BFE\u5802")))};$e.a=Object(s.a)(function(w){var E=w.userDetail,b=w.loading,l=w.globalSetting;return{userDetail:E,globalSetting:l,loading:b.effects}})(O)},"iL++":function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___2pHUo",flex_space_between:"flex_space_between___3Bfes",flex_box_vertical_center:"flex_box_vertical_center___1thiW",flex_box_center_end:"flex_box_center_end___3Zr7k",flex_box_column:"flex_box_column___3xe1a",list:"list___3rlGv",wrap:"wrap____oZzM",lockWrap:"lockWrap___24eY2",top:"top___3SCOc",sign:"sign____uZ_B",name:"name___2nHyM",img:"img___3Spn7",text:"text___1Pg2L",btns:"btns___Kr_Ti",bottom:"bottom___2_iOx"}},k3GJ:function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return _o});var se=Q("rePB"),W=Q("ODXe"),k=Q("Ff2n"),X=Q("VTBJ"),D=Q("q1tI"),B=Q("TSYQ"),G=Q.n(B),j=Q("Zm9Q"),P=Q("6cGi"),I=Q("KQm4"),y=Q("xEkU"),m=Q.n(y),p=Q("t23M");function c(he){var we=Object(D.useRef)(),Ae=Object(D.useRef)(!1);function me(){for(var te=arguments.length,ce=new Array(te),re=0;re<te;re++)ce[re]=arguments[re];Ae.current||(m.a.cancel(we.current),we.current=m()(function(){he.apply(void 0,ce)}))}return Object(D.useEffect)(function(){return function(){Ae.current=!0,m.a.cancel(we.current)}},[]),me}function u(he){var we=Object(D.useRef)([]),Ae=Object(D.useState)({}),me=Object(W.a)(Ae,2),te=me[1],ce=Object(D.useRef)(typeof he=="function"?he():he),re=c(function(){var ye=ce.current;we.current.forEach(function(Ie){ye=Ie(ye)}),we.current=[],ce.current=ye,te({})});function ve(ye){we.current.push(ye),re()}return[ce.current,ve]}var f=Q("4IlW");function s(he,we){var Ae,me=he.prefixCls,te=he.id,ce=he.active,re=he.rtl,ve=he.tab,ye=ve.key,Ie=ve.tab,Se=ve.disabled,Ue=ve.closeIcon,Ye=he.tabBarGutter,pt=he.tabPosition,ft=he.closable,Ot=he.renderWrapper,cn=he.removeAriaLabel,xn=he.editable,vn=he.onClick,_n=he.onRemove,Tn=he.onFocus,En="".concat(me,"-tab");D.useEffect(function(){return _n},[]);var bn={};pt==="top"||pt==="bottom"?bn[re?"marginLeft":"marginRight"]=Ye:bn.marginBottom=Ye;var Un=xn&&ft!==!1&&!Se;function On(an){if(Se)return;vn(an)}function vi(an){an.preventDefault(),an.stopPropagation(),xn.onEdit("remove",{key:ye,event:an})}var Rn=D.createElement("div",{key:ye,ref:we,className:G()(En,(Ae={},Object(se.a)(Ae,"".concat(En,"-with-remove"),Un),Object(se.a)(Ae,"".concat(En,"-active"),ce),Object(se.a)(Ae,"".concat(En,"-disabled"),Se),Ae)),style:bn,onClick:On},D.createElement("div",{role:"tab","aria-selected":ce,id:te&&"".concat(te,"-tab-").concat(ye),className:"".concat(En,"-btn"),"aria-controls":te&&"".concat(te,"-panel-").concat(ye),"aria-disabled":Se,tabIndex:Se?null:0,onClick:function(qt){qt.stopPropagation(),On(qt)},onKeyDown:function(qt){[f.a.SPACE,f.a.ENTER].includes(qt.which)&&(qt.preventDefault(),On(qt))},onFocus:Tn},Ie),Un&&D.createElement("button",{type:"button","aria-label":cn||"remove",tabIndex:0,className:"".concat(En,"-remove"),onClick:function(qt){qt.stopPropagation(),vi(qt)}},Ue||xn.removeIcon||"\xD7"));return Ot&&(Rn=Ot(Rn)),Rn}var r=D.forwardRef(s),a={width:0,height:0,left:0,top:0};function d(he,we,Ae){return Object(D.useMemo)(function(){for(var me,te=new Map,ce=we.get((me=he[0])===null||me===void 0?void 0:me.key)||a,re=ce.left+ce.width,ve=0;ve<he.length;ve+=1){var ye=he[ve].key,Ie=we.get(ye);if(!Ie){var Se;Ie=we.get((Se=he[ve-1])===null||Se===void 0?void 0:Se.key)||a}var Ue=te.get(ye)||Object(X.a)({},Ie);Ue.right=re-Ue.left-Ue.width,te.set(ye,Ue)}return te},[he.map(function(me){return me.key}).join("_"),we,Ae])}var L={width:0,height:0,left:0,top:0,right:0};function S(he,we,Ae,me,te){var ce=te.tabs,re=te.tabPosition,ve=te.rtl,ye,Ie,Se;["top","bottom"].includes(re)?(ye="width",Ie=ve?"right":"left",Se=Math.abs(we.left)):(ye="height",Ie="top",Se=-we.top);var Ue=we[ye],Ye=Ae[ye],pt=me[ye],ft=Ue;return Ye+pt>Ue&&(ft=Ue-pt),Object(D.useMemo)(function(){if(!ce.length)return[0,0];for(var Ot=ce.length,cn=Ot,xn=0;xn<Ot;xn+=1){var vn=he.get(ce[xn].key)||L;if(vn[Ie]+vn[ye]>Se+ft){cn=xn-1;break}}for(var _n=0,Tn=Ot-1;Tn>=0;Tn-=1){var En=he.get(ce[Tn].key)||L;if(En[Ie]<Se){_n=Tn+1;break}}return[_n,cn]},[he,Se,ft,re,ce.map(function(Ot){return Ot.key}).join("_"),ve])}var x=Q("wx14"),R=Q("1OyB"),O=Q("vuIU"),w=Q("JX7q"),E=Q("Ji7U"),b=Q("LK+K"),l=Q("I8Z2"),_=Q("bT9E"),h=Q("2GS6"),g=Q("Gytx"),T=Q.n(g),N=Q("U8pU"),V=/iPhone/i,Y=/iPod/i,U=/iPad/i,A=/\bAndroid(?:.+)Mobile\b/i,J=/Android/i,ne=/\bAndroid(?:.+)SD4930UR\b/i,oe=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,fe=/Windows Phone/i,ke=/\bWindows(?:.+)ARM\b/i,Oe=/BlackBerry/i,Me=/BB10/i,Be=/Opera Mini/i,Pe=/\b(CriOS|Chrome)(?:.+)Mobile/i,be=/Mobile(?:.+)Firefox\b/i;function le(he,we){return he.test(we)}function Le(he){var we=he||(typeof navigator!="undefined"?navigator.userAgent:""),Ae=(we||"").split("[FBAN");if(typeof Ae[1]!="undefined"){var me=Ae,te=Object(W.a)(me,1);we=te[0]}if(Ae=we.split("Twitter"),typeof Ae[1]!="undefined"){var ce=Ae,re=Object(W.a)(ce,1);we=re[0]}var ve={apple:{phone:le(V,we)&&!le(fe,we),ipod:le(Y,we),tablet:!le(V,we)&&le(U,we)&&!le(fe,we),device:(le(V,we)||le(Y,we)||le(U,we))&&!le(fe,we)},amazon:{phone:le(ne,we),tablet:!le(ne,we)&&le(oe,we),device:le(ne,we)||le(oe,we)},android:{phone:!le(fe,we)&&le(ne,we)||!le(fe,we)&&le(A,we),tablet:!le(fe,we)&&!le(ne,we)&&!le(A,we)&&(le(oe,we)||le(J,we)),device:!le(fe,we)&&(le(ne,we)||le(oe,we)||le(A,we)||le(J,we))||le(/\bokhttp\b/i,we)},windows:{phone:le(fe,we),tablet:le(ke,we),device:le(fe,we)||le(ke,we)},other:{blackberry:le(Oe,we),blackberry10:le(Me,we),opera:le(Be,we),firefox:le(be,we),chrome:le(Pe,we),device:le(Oe,we)||le(Me,we)||le(Be,we)||le(be,we)||le(Pe,we)},any:null,phone:null,tablet:null};return ve.any=ve.apple.device||ve.android.device||ve.windows.device||ve.other.device,ve.phone=ve.apple.phone||ve.android.phone||ve.windows.phone,ve.tablet=ve.apple.tablet||ve.android.tablet||ve.windows.tablet,ve}var tt=Object(X.a)(Object(X.a)({},Le()),{},{isMobile:Le}),nt=tt;function lt(){}function Et(he,we,Ae){var me=we||"";return he.key||"".concat(me,"item_").concat(Ae)}function Ve(he){return"".concat(he,"-menu-")}function Qe(he,we){var Ae=-1;D.Children.forEach(he,function(me){Ae+=1,me&&me.type&&me.type.isMenuItemGroup?D.Children.forEach(me.props.children,function(te){Ae+=1,we(te,Ae)}):we(me,Ae)})}function ut(he,we,Ae){if(!he||Ae.find)return;D.Children.forEach(he,function(me){if(me){var te=me.type;if(!te||!(te.isSubMenu||te.isMenuItem||te.isMenuItemGroup))return;we.indexOf(me.key)!==-1?Ae.find=!0:me.props.children&&ut(me.props.children,we,Ae)}})}var gt=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],ot=function(we){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,me=we&&typeof we.getBoundingClientRect=="function"&&we.getBoundingClientRect().width;if(me){if(Ae){var te=getComputedStyle(we),ce=te.marginLeft,re=te.marginRight;me+=+ce.replace("px","")+ +re.replace("px","")}me=+me.toFixed(6)}return me||0},it=function(we,Ae,me){we&&Object(N.a)(we.style)==="object"&&(we.style[Ae]=me)},rt=function(){return nt.any},Pt=Q("bdgK"),It=Q("i8i4"),wt=Q.n(It),Tt=Q("wgJM"),Wt=Q("l4aY"),Ct=Q("m+aA"),bt=Q("c+Xe"),ze=Q("zT1h"),Kt=Q("QC+M");function St(he,we,Ae){return Ae?he[0]===we[0]:he[0]===we[0]&&he[1]===we[1]}function Ke(he,we,Ae){var me=he[we]||{};return Object(X.a)(Object(X.a)({},me),Ae)}function at(he,we,Ae,me){for(var te=Ae.points,ce=Object.keys(he),re=0;re<ce.length;re+=1){var ve=ce[re];if(St(he[ve].points,te,me))return"".concat(we,"-placement-").concat(ve)}return""}var Ce=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var he=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(he)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(he==null?void 0:he.substr(0,4)))},Ee=Q("MNnm");function Te(he,we){var Ae={};return Ae[he.toLowerCase()]=we.toLowerCase(),Ae["Webkit".concat(he)]="webkit".concat(we),Ae["Moz".concat(he)]="moz".concat(we),Ae["ms".concat(he)]="MS".concat(we),Ae["O".concat(he)]="o".concat(we.toLowerCase()),Ae}function ee(he,we){var Ae={animationend:Te("Animation","AnimationEnd"),transitionend:Te("Transition","TransitionEnd")};return he&&("AnimationEvent"in we||delete Ae.animationend.animation,"TransitionEvent"in we||delete Ae.transitionend.transition),Ae}var ae=ee(Object(Ee.a)(),typeof window!="undefined"?window:{}),de={};if(Object(Ee.a)()){var pe=document.createElement("div");de=pe.style}var _e={};function Re(he){if(_e[he])return _e[he];var we=ae[he];if(we)for(var Ae=Object.keys(we),me=Ae.length,te=0;te<me;te+=1){var ce=Ae[te];if(Object.prototype.hasOwnProperty.call(we,ce)&&ce in de)return _e[he]=we[ce],_e[he]}return""}var De=Re("animationend"),Ze=Re("transitionend"),dt=!!(De&&Ze),ht=De||"animationend",Ft=Ze||"transitionend";function vt(he,we){if(!he)return null;if(Object(N.a)(he)==="object"){var Ae=we.replace(/-\w/g,function(me){return me[1].toUpperCase()});return he[Ae]}return"".concat(he,"-").concat(we)}var Ge="none",en="appear",je="enter",un="leave",yt="none",Nt="prepare",Gt="start",on="active",Je="end";function xt(he){var we=Object(D.useRef)(!1),Ae=Object(D.useState)(he),me=Object(W.a)(Ae,2),te=me[0],ce=me[1];function re(ve){we.current||ce(ve)}return Object(D.useEffect)(function(){return function(){we.current=!0}},[]),[te,re]}var Ut=Object(Ee.a)()?D.useLayoutEffect:D.useEffect,zt=Ut,hn=function(){var he=D.useRef(null);function we(){Tt.a.cancel(he.current)}function Ae(me){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;we();var ce=Object(Tt.a)(function(){te<=1?me({isCanceled:function(){return ce!==he.current}}):Ae(me,te-1)});he.current=ce}return D.useEffect(function(){return function(){we()}},[]),[Ae,we]},Ln=[Nt,Gt,on,Je],gn=!1,Jt=!0;function Rt(he){return he===on||he===Je}var Vn=function(he,we){var Ae=D.useState(yt),me=Object(W.a)(Ae,2),te=me[0],ce=me[1],re=hn(),ve=Object(W.a)(re,2),ye=ve[0],Ie=ve[1];function Se(){ce(Nt)}return zt(function(){if(te!==yt&&te!==Je){var Ue=Ln.indexOf(te),Ye=Ln[Ue+1],pt=we(te);pt===gn?ce(Ye):ye(function(ft){function Ot(){if(ft.isCanceled())return;ce(Ye)}pt===!0?Ot():Promise.resolve(pt).then(Ot)})}},[he,te]),D.useEffect(function(){return function(){Ie()}},[]),[Se,te]},kn=function(he){var we=Object(D.useRef)(),Ae=Object(D.useRef)(he);Ae.current=he;var me=D.useCallback(function(re){Ae.current(re)},[]);function te(re){re&&(re.removeEventListener(Ft,me),re.removeEventListener(ht,me))}function ce(re){we.current&&we.current!==re&&te(we.current),re&&re!==we.current&&(re.addEventListener(Ft,me),re.addEventListener(ht,me),we.current=re)}return D.useEffect(function(){return function(){te(we.current)}},[]),[ce,te]};function Cn(he,we,Ae,me){var te=me.motionEnter,ce=te===void 0?!0:te,re=me.motionAppear,ve=re===void 0?!0:re,ye=me.motionLeave,Ie=ye===void 0?!0:ye,Se=me.motionDeadline,Ue=me.motionLeaveImmediately,Ye=me.onAppearPrepare,pt=me.onEnterPrepare,ft=me.onLeavePrepare,Ot=me.onAppearStart,cn=me.onEnterStart,xn=me.onLeaveStart,vn=me.onAppearActive,_n=me.onEnterActive,Tn=me.onLeaveActive,En=me.onAppearEnd,bn=me.onEnterEnd,Un=me.onLeaveEnd,On=me.onVisibleChanged,vi=xt(),Rn=Object(W.a)(vi,2),an=Rn[0],qt=Rn[1],In=xt(Ge),Bn=Object(W.a)(In,2),Xt=Bn[0],Hn=Bn[1],yi=xt(null),zn=Object(W.a)(yi,2),oi=zn[0],ii=zn[1],Ri=Object(D.useRef)(!1),Bi=Object(D.useRef)(null),bi=Object(D.useRef)(!1),$i=Object(D.useRef)(null);function br(){var ui=Ae();return ui||$i.current}var ar=Object(D.useRef)(!1);function Fi(ui){var ni=br();if(ui&&!ui.deadline&&ui.target!==ni)return;var ji;Xt===en&&ar.current?ji=En==null?void 0:En(ni,ui):Xt===je&&ar.current?ji=bn==null?void 0:bn(ni,ui):Xt===un&&ar.current&&(ji=Un==null?void 0:Un(ni,ui)),ji!==!1&&!bi.current&&(Hn(Ge),ii(null))}var di=kn(Fi),si=Object(W.a)(di,1),Ei=si[0],_i=D.useMemo(function(){var ui,ni,ji;switch(Xt){case"appear":return ui={},Object(se.a)(ui,Nt,Ye),Object(se.a)(ui,Gt,Ot),Object(se.a)(ui,on,vn),ui;case"enter":return ni={},Object(se.a)(ni,Nt,pt),Object(se.a)(ni,Gt,cn),Object(se.a)(ni,on,_n),ni;case"leave":return ji={},Object(se.a)(ji,Nt,ft),Object(se.a)(ji,Gt,xn),Object(se.a)(ji,on,Tn),ji;default:return{}}},[Xt]),Er=Vn(Xt,function(ui){if(ui===Nt){var ni=_i[Nt];return ni?ni(br()):gn}if(ri in _i){var ji;ii(((ji=_i[ri])===null||ji===void 0?void 0:ji.call(_i,br(),null))||null)}return ri===on&&(Ei(br()),Se>0&&(clearTimeout(Bi.current),Bi.current=setTimeout(function(){Fi({deadline:!0})},Se))),Jt}),kr=Object(W.a)(Er,2),Pr=kr[0],ri=kr[1],Cr=Rt(ri);ar.current=Cr,zt(function(){qt(we);var ui=Ri.current;if(Ri.current=!0,!he)return;var ni;!ui&&we&&ve&&(ni=en),ui&&we&&ce&&(ni=je),(ui&&!we&&Ie||!ui&&Ue&&!we&&Ie)&&(ni=un),ni&&(Hn(ni),Pr())},[we]),Object(D.useEffect)(function(){(Xt===en&&!ve||Xt===je&&!ce||Xt===un&&!Ie)&&Hn(Ge)},[ve,ce,Ie]),Object(D.useEffect)(function(){return function(){clearTimeout(Bi.current),bi.current=!0}},[]),Object(D.useEffect)(function(){an!==void 0&&Xt===Ge&&(On==null||On(an))},[an,Xt]);var Nr=oi;return _i[Nt]&&ri===Gt&&(Nr=Object(X.a)({transition:"none"},Nr)),[Xt,ri,Nr,an!=null?an:we]}var Qt=function(he){Object(E.a)(Ae,he);var we=Object(b.a)(Ae);function Ae(){return Object(R.a)(this,Ae),we.apply(this,arguments)}return Object(O.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(D.Component),Gn=Qt;function ei(he){var we=he;Object(N.a)(he)==="object"&&(we=he.transitionSupport);function Ae(te){return!!(te.motionName&&we)}var me=D.forwardRef(function(te,ce){var re=te.visible,ve=re===void 0?!0:re,ye=te.removeOnLeave,Ie=ye===void 0?!0:ye,Se=te.forceRender,Ue=te.children,Ye=te.motionName,pt=te.leavedClassName,ft=te.eventProps,Ot=Ae(te),cn=Object(D.useRef)(),xn=Object(D.useRef)();function vn(){try{return Object(Ct.a)(cn.current||xn.current)}catch(Hn){return null}}var _n=Cn(Ot,ve,vn,te),Tn=Object(W.a)(_n,4),En=Tn[0],bn=Tn[1],Un=Tn[2],On=Tn[3],vi=D.useRef(On);On&&(vi.current=!0);var Rn=Object(D.useRef)(ce);Rn.current=ce;var an=D.useCallback(function(Hn){cn.current=Hn,Object(bt.b)(Rn.current,Hn)},[]),qt,In=Object(X.a)(Object(X.a)({},ft),{},{visible:ve});if(!Ue)qt=null;else if(En===Ge||!Ae(te))On?qt=Ue(Object(X.a)({},In),an):!Ie&&vi.current?qt=Ue(Object(X.a)(Object(X.a)({},In),{},{className:pt}),an):Se?qt=Ue(Object(X.a)(Object(X.a)({},In),{},{style:{display:"none"}}),an):qt=null;else{var Bn,Xt;bn===Nt?Xt="prepare":Rt(bn)?Xt="active":bn===Gt&&(Xt="start"),qt=Ue(Object(X.a)(Object(X.a)({},In),{},{className:G()(vt(Ye,En),(Bn={},Object(se.a)(Bn,vt(Ye,"".concat(En,"-").concat(Xt)),Xt),Object(se.a)(Bn,Ye,typeof Ye=="string"),Bn)),style:Un}),an)}return D.createElement(Gn,{ref:xn},qt)});return me.displayName="CSSMotion",me}var Xn=ei(dt),et="add",jt="keep",Wn="remove",mn="removed";function sn(he){var we;return he&&Object(N.a)(he)==="object"&&"key"in he?we=he:we={key:he},Object(X.a)(Object(X.a)({},we),{},{key:String(we.key)})}function Dn(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return he.map(sn)}function K(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ae=[],me=0,te=we.length,ce=Dn(he),re=Dn(we);ce.forEach(function(Ie){for(var Se=!1,Ue=me;Ue<te;Ue+=1){var Ye=re[Ue];if(Ye.key===Ie.key){me<Ue&&(Ae=Ae.concat(re.slice(me,Ue).map(function(pt){return Object(X.a)(Object(X.a)({},pt),{},{status:et})})),me=Ue),Ae.push(Object(X.a)(Object(X.a)({},Ye),{},{status:jt})),me+=1,Se=!0;break}}Se||Ae.push(Object(X.a)(Object(X.a)({},Ie),{},{status:Wn}))}),me<te&&(Ae=Ae.concat(re.slice(me).map(function(Ie){return Object(X.a)(Object(X.a)({},Ie),{},{status:et})})));var ve={};Ae.forEach(function(Ie){var Se=Ie.key;ve[Se]=(ve[Se]||0)+1});var ye=Object.keys(ve).filter(function(Ie){return ve[Ie]>1});return ye.forEach(function(Ie){Ae=Ae.filter(function(Se){var Ue=Se.key,Ye=Se.status;return Ue!==Ie||Ye!==Wn}),Ae.forEach(function(Se){Se.key===Ie&&(Se.status=jt)})}),Ae}var v=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function C(he){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xn,Ae=function(me){Object(E.a)(ce,me);var te=Object(b.a)(ce);function ce(){var re;return Object(R.a)(this,ce),re=te.apply(this,arguments),re.state={keyEntities:[]},re.removeKey=function(ve){re.setState(function(ye){var Ie=ye.keyEntities;return{keyEntities:Ie.map(function(Se){return Se.key!==ve?Se:Object(X.a)(Object(X.a)({},Se),{},{status:mn})})}})},re}return Object(O.a)(ce,[{key:"render",value:function(){var ve=this,ye=this.state.keyEntities,Ie=this.props,Se=Ie.component,Ue=Ie.children,Ye=Ie.onVisibleChanged,pt=Object(k.a)(Ie,["component","children","onVisibleChanged"]),ft=Se||D.Fragment,Ot={};return v.forEach(function(cn){Ot[cn]=pt[cn],delete pt[cn]}),delete pt.keys,D.createElement(ft,pt,ye.map(function(cn){var xn=cn.status,vn=Object(k.a)(cn,["status"]),_n=xn===et||xn===jt;return D.createElement(we,Object(x.a)({},Ot,{key:vn.key,visible:_n,eventProps:vn,onVisibleChanged:function(En){Ye==null||Ye(En,{key:vn.key}),En||ve.removeKey(vn.key)}}),Ue)}))}}],[{key:"getDerivedStateFromProps",value:function(ve,ye){var Ie=ve.keys,Se=ye.keyEntities,Ue=Dn(Ie),Ye=K(Se,Ue);return{keyEntities:Ye.filter(function(pt){var ft=Se.find(function(Ot){var cn=Ot.key;return pt.key===cn});return!(ft&&ft.status===mn&&pt.status===Wn)})}}}]),ce}(D.Component);return Ae.defaultProps={component:"div"},Ae}var F=C(dt),q=Xn;function H(he){var we=he.prefixCls,Ae=he.motion,me=he.animation,te=he.transitionName;return Ae||(me?{motionName:"".concat(we,"-").concat(me)}:te?{motionName:te}:null)}function ue(he){var we=he.prefixCls,Ae=he.visible,me=he.zIndex,te=he.mask,ce=he.maskMotion,re=he.maskAnimation,ve=he.maskTransitionName;if(!te)return null;var ye={};return(ce||ve||re)&&(ye=Object(X.a)({motionAppear:!0},H({motion:ce,prefixCls:we,transitionName:ve,animation:re}))),D.createElement(q,Object(x.a)({},ye,{visible:Ae,removeOnLeave:!0}),function(Ie){var Se=Ie.className;return D.createElement("div",{style:{zIndex:me},className:G()("".concat(we,"-mask"),Se)})})}var He=Q("9mu1"),Xe=Q("o0o1"),At=Q.n(Xe),We=Q("HaE+"),mt=["measure","align",null,"motion"],Zt=function(he,we){var Ae=Object(D.useState)(null),me=Object(W.a)(Ae,2),te=me[0],ce=me[1],re=Object(D.useRef)(),ve=Object(D.useRef)(!1);function ye(Ue){ve.current||ce(Ue)}function Ie(){Tt.a.cancel(re.current)}function Se(Ue){Ie(),re.current=Object(Tt.a)(function(){ye(function(Ye){switch(te){case"align":return"motion";case"motion":return"stable";default:}return Ye}),Ue==null||Ue()})}return Object(D.useEffect)(function(){ye("measure")},[he]),Object(D.useEffect)(function(){switch(te){case"measure":we();break;default:}te&&(re.current=Object(Tt.a)(Object(We.a)(At.a.mark(function Ue(){var Ye,pt;return At.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:Ye=mt.indexOf(te),pt=mt[Ye+1],pt&&Ye!==-1&&ye(pt);case 3:case"end":return Ot.stop()}},Ue)}))))},[te]),Object(D.useEffect)(function(){return function(){ve.current=!0,Ie()}},[]),[te,Se]},Fn=function(he){var we=D.useState({width:0,height:0}),Ae=Object(W.a)(we,2),me=Ae[0],te=Ae[1];function ce(ve){te({width:ve.offsetWidth,height:ve.offsetHeight})}var re=D.useMemo(function(){var ve={};if(he){var ye=me.width,Ie=me.height;he.indexOf("height")!==-1&&Ie?ve.height=Ie:he.indexOf("minHeight")!==-1&&Ie&&(ve.minHeight=Ie),he.indexOf("width")!==-1&&ye?ve.width=ye:he.indexOf("minWidth")!==-1&&ye&&(ve.minWidth=ye)}return ve},[he,me]);return[re,ce]},Zn=D.forwardRef(function(he,we){var Ae=he.visible,me=he.prefixCls,te=he.className,ce=he.style,re=he.children,ve=he.zIndex,ye=he.stretch,Ie=he.destroyPopupOnHide,Se=he.forceRender,Ue=he.align,Ye=he.point,pt=he.getRootDomNode,ft=he.getClassNameFromAlign,Ot=he.onAlign,cn=he.onMouseEnter,xn=he.onMouseLeave,vn=he.onMouseDown,_n=he.onTouchStart,Tn=Object(D.useRef)(),En=Object(D.useRef)(),bn=Object(D.useState)(),Un=Object(W.a)(bn,2),On=Un[0],vi=Un[1],Rn=Fn(ye),an=Object(W.a)(Rn,2),qt=an[0],In=an[1];function Bn(){ye&&In(pt())}var Xt=Zt(Ae,Bn),Hn=Object(W.a)(Xt,2),yi=Hn[0],zn=Hn[1],oi=Object(D.useRef)();function ii(){return Ye||pt}function Ri(){var di;(di=Tn.current)===null||di===void 0||di.forceAlign()}function Bi(di,si){var Ei=ft(si);On!==Ei&&vi(Ei),yi==="align"&&(On!==Ei?Promise.resolve().then(function(){Ri()}):zn(function(){var _i;(_i=oi.current)===null||_i===void 0||_i.call(oi)}),Ot==null||Ot(di,si))}var bi=Object(X.a)({},H(he));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(di){var si=bi[di];bi[di]=function(Ei,_i){return zn(),si==null?void 0:si(Ei,_i)}});function $i(){return new Promise(function(di){oi.current=di})}D.useEffect(function(){!bi.motionName&&yi==="motion"&&zn()},[bi.motionName,yi]),D.useImperativeHandle(we,function(){return{forceAlign:Ri,getElement:function(){return En.current}}});var br=Object(X.a)(Object(X.a)({},qt),{},{zIndex:ve,opacity:yi==="motion"||yi==="stable"||!Ae?void 0:0,pointerEvents:yi==="stable"?void 0:"none"},ce),ar=!0;(Ue==null?void 0:Ue.points)&&(yi==="align"||yi==="stable")&&(ar=!1);var Fi=re;return D.Children.count(re)>1&&(Fi=D.createElement("div",{className:"".concat(me,"-content")},re)),D.createElement(q,Object(x.a)({visible:Ae,ref:En,leavedClassName:"".concat(me,"-hidden")},bi,{onAppearPrepare:$i,onEnterPrepare:$i,removeOnLeave:Ie,forceRender:Se}),function(di,si){var Ei=di.className,_i=di.style,Er=G()(me,te,On,Ei);return D.createElement(He.a,{target:ii(),key:"popup",ref:Tn,monitorWindowResize:!0,disabled:ar,align:Ue,onAlign:Bi},D.createElement("div",{ref:si,className:Er,onMouseEnter:cn,onMouseLeave:xn,onMouseDownCapture:vn,onTouchStartCapture:_n,style:Object(X.a)(Object(X.a)({},_i),br)},Fi))})});Zn.displayName="PopupInner";var fn=Zn,Mt=D.forwardRef(function(he,we){var Ae=he.prefixCls,me=he.visible,te=he.zIndex,ce=he.children,re=he.mobile;re=re===void 0?{}:re;var ve=re.popupClassName,ye=re.popupStyle,Ie=re.popupMotion,Se=Ie===void 0?{}:Ie,Ue=re.popupRender,Ye=D.useRef();D.useImperativeHandle(we,function(){return{forceAlign:function(){},getElement:function(){return Ye.current}}});var pt=Object(X.a)({zIndex:te},ye),ft=ce;return D.Children.count(ce)>1&&(ft=D.createElement("div",{className:"".concat(Ae,"-content")},ce)),Ue&&(ft=Ue(ft)),D.createElement(q,Object(x.a)({visible:me,ref:Ye,removeOnLeave:!0},Se),function(Ot,cn){var xn=Ot.className,vn=Ot.style,_n=G()(Ae,ve,xn);return D.createElement("div",{ref:cn,className:_n,style:Object(X.a)(Object(X.a)({},vn),pt)},ft)})});Mt.displayName="MobilePopupInner";var Bt=Mt,tn=["visible","mobile"],nn=D.forwardRef(function(he,we){var Ae=he.visible,me=he.mobile,te=Object(k.a)(he,tn),ce=Object(D.useState)(Ae),re=Object(W.a)(ce,2),ve=re[0],ye=re[1],Ie=Object(D.useState)(!1),Se=Object(W.a)(Ie,2),Ue=Se[0],Ye=Se[1],pt=Object(X.a)(Object(X.a)({},te),{},{visible:ve});Object(D.useEffect)(function(){ye(Ae),Ae&&me&&Ye(Ce())},[Ae,me]);var ft=Ue?D.createElement(Bt,Object(x.a)({},pt,{mobile:me,ref:we})):D.createElement(fn,Object(x.a)({},pt,{ref:we}));return D.createElement("div",null,D.createElement(ue,pt),ft)});nn.displayName="Popup";var yn=nn,qn=D.createContext(null),ln=qn;function ci(){}function cr(){return""}function gr(he){return he?he.ownerDocument:window.document}var _r=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Wr(he){var we=function(Ae){Object(E.a)(te,Ae);var me=Object(b.a)(te);function te(ce){var re;Object(R.a)(this,te),re=me.call(this,ce),re.popupRef=D.createRef(),re.triggerRef=D.createRef(),re.attachId=void 0,re.clickOutsideHandler=void 0,re.touchOutsideHandler=void 0,re.contextMenuOutsideHandler1=void 0,re.contextMenuOutsideHandler2=void 0,re.mouseDownTimeout=void 0,re.focusTime=void 0,re.preClickTime=void 0,re.preTouchTime=void 0,re.delayTimer=void 0,re.hasPopupMouseDown=void 0,re.onMouseEnter=function(ye){var Ie=re.props.mouseEnterDelay;re.fireEvents("onMouseEnter",ye),re.delaySetPopupVisible(!0,Ie,Ie?null:ye)},re.onMouseMove=function(ye){re.fireEvents("onMouseMove",ye),re.setPoint(ye)},re.onMouseLeave=function(ye){re.fireEvents("onMouseLeave",ye),re.delaySetPopupVisible(!1,re.props.mouseLeaveDelay)},re.onPopupMouseEnter=function(){re.clearDelayTimer()},re.onPopupMouseLeave=function(ye){var Ie;if(ye.relatedTarget&&!ye.relatedTarget.setTimeout&&Object(Wt.a)((Ie=re.popupRef.current)===null||Ie===void 0?void 0:Ie.getElement(),ye.relatedTarget))return;re.delaySetPopupVisible(!1,re.props.mouseLeaveDelay)},re.onFocus=function(ye){re.fireEvents("onFocus",ye),re.clearDelayTimer(),re.isFocusToShow()&&(re.focusTime=Date.now(),re.delaySetPopupVisible(!0,re.props.focusDelay))},re.onMouseDown=function(ye){re.fireEvents("onMouseDown",ye),re.preClickTime=Date.now()},re.onTouchStart=function(ye){re.fireEvents("onTouchStart",ye),re.preTouchTime=Date.now()},re.onBlur=function(ye){re.fireEvents("onBlur",ye),re.clearDelayTimer(),re.isBlurToHide()&&re.delaySetPopupVisible(!1,re.props.blurDelay)},re.onContextMenu=function(ye){ye.preventDefault(),re.fireEvents("onContextMenu",ye),re.setPopupVisible(!0,ye)},re.onContextMenuClose=function(){re.isContextMenuToShow()&&re.close()},re.onClick=function(ye){if(re.fireEvents("onClick",ye),re.focusTime){var Ie;if(re.preClickTime&&re.preTouchTime?Ie=Math.min(re.preClickTime,re.preTouchTime):re.preClickTime?Ie=re.preClickTime:re.preTouchTime&&(Ie=re.preTouchTime),Math.abs(Ie-re.focusTime)<20)return;re.focusTime=0}re.preClickTime=0,re.preTouchTime=0,re.isClickToShow()&&(re.isClickToHide()||re.isBlurToHide())&&ye&&ye.preventDefault&&ye.preventDefault();var Se=!re.state.popupVisible;(re.isClickToHide()&&!Se||Se&&re.isClickToShow())&&re.setPopupVisible(!re.state.popupVisible,ye)},re.onPopupMouseDown=function(){if(re.hasPopupMouseDown=!0,clearTimeout(re.mouseDownTimeout),re.mouseDownTimeout=window.setTimeout(function(){re.hasPopupMouseDown=!1},0),re.context){var ye;(ye=re.context).onPopupMouseDown.apply(ye,arguments)}},re.onDocumentClick=function(ye){if(re.props.mask&&!re.props.maskClosable)return;var Ie=ye.target,Se=re.getRootDomNode(),Ue=re.getPopupDomNode();(!Object(Wt.a)(Se,Ie)||re.isContextMenuOnly())&&!Object(Wt.a)(Ue,Ie)&&!re.hasPopupMouseDown&&re.close()},re.getRootDomNode=function(){var ye=re.props.getTriggerDOMNode;if(ye)return ye(re.triggerRef.current);try{var Ie=Object(Ct.a)(re.triggerRef.current);if(Ie)return Ie}catch(Se){}return wt.a.findDOMNode(Object(w.a)(re))},re.getPopupClassNameFromAlign=function(ye){var Ie=[],Se=re.props,Ue=Se.popupPlacement,Ye=Se.builtinPlacements,pt=Se.prefixCls,ft=Se.alignPoint,Ot=Se.getPopupClassNameFromAlign;return Ue&&Ye&&Ie.push(at(Ye,pt,ye,ft)),Ot&&Ie.push(Ot(ye)),Ie.join(" ")},re.getComponent=function(){var ye=re.props,Ie=ye.prefixCls,Se=ye.destroyPopupOnHide,Ue=ye.popupClassName,Ye=ye.onPopupAlign,pt=ye.popupMotion,ft=ye.popupAnimation,Ot=ye.popupTransitionName,cn=ye.popupStyle,xn=ye.mask,vn=ye.maskAnimation,_n=ye.maskTransitionName,Tn=ye.maskMotion,En=ye.zIndex,bn=ye.popup,Un=ye.stretch,On=ye.alignPoint,vi=ye.mobile,Rn=ye.forceRender,an=re.state,qt=an.popupVisible,In=an.point,Bn=re.getPopupAlign(),Xt={};return re.isMouseEnterToShow()&&(Xt.onMouseEnter=re.onPopupMouseEnter),re.isMouseLeaveToHide()&&(Xt.onMouseLeave=re.onPopupMouseLeave),Xt.onMouseDown=re.onPopupMouseDown,Xt.onTouchStart=re.onPopupMouseDown,D.createElement(yn,Object(x.a)({prefixCls:Ie,destroyPopupOnHide:Se,visible:qt,point:On&&In,className:Ue,align:Bn,onAlign:Ye,animation:ft,getClassNameFromAlign:re.getPopupClassNameFromAlign},Xt,{stretch:Un,getRootDomNode:re.getRootDomNode,style:cn,mask:xn,zIndex:En,transitionName:Ot,maskAnimation:vn,maskTransitionName:_n,maskMotion:Tn,ref:re.popupRef,motion:pt,mobile:vi,forceRender:Rn}),typeof bn=="function"?bn():bn)},re.attachParent=function(ye){Tt.a.cancel(re.attachId);var Ie=re.props,Se=Ie.getPopupContainer,Ue=Ie.getDocument,Ye=re.getRootDomNode(),pt;Se?(Ye||Se.length===0)&&(pt=Se(Ye)):pt=Ue(re.getRootDomNode()).body,pt?pt.appendChild(ye):re.attachId=Object(Tt.a)(function(){re.attachParent(ye)})},re.getContainer=function(){var ye=re.props.getDocument,Ie=ye(re.getRootDomNode()).createElement("div");return Ie.style.position="absolute",Ie.style.top="0",Ie.style.left="0",Ie.style.width="100%",re.attachParent(Ie),Ie},re.setPoint=function(ye){var Ie=re.props.alignPoint;if(!Ie||!ye)return;re.setState({point:{pageX:ye.pageX,pageY:ye.pageY}})},re.handlePortalUpdate=function(){re.state.prevPopupVisible!==re.state.popupVisible&&re.props.afterPopupVisibleChange(re.state.popupVisible)},re.triggerContextValue={onPopupMouseDown:re.onPopupMouseDown};var ve;return"popupVisible"in ce?ve=!!ce.popupVisible:ve=!!ce.defaultPopupVisible,re.state={prevPopupVisible:ve,popupVisible:ve},_r.forEach(function(ye){re["fire".concat(ye)]=function(Ie){re.fireEvents(ye,Ie)}}),re}return Object(O.a)(te,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var re=this.props,ve=this.state;if(ve.popupVisible){var ye;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ye=re.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(ze.a)(ye,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ye=ye||re.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(ze.a)(ye,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ye=ye||re.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(ze.a)(ye,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(ze.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Tt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var re;return((re=this.popupRef.current)===null||re===void 0?void 0:re.getElement())||null}},{key:"getPopupAlign",value:function(){var re=this.props,ve=re.popupPlacement,ye=re.popupAlign,Ie=re.builtinPlacements;return ve&&Ie?Ke(Ie,ve,ye):ye}},{key:"setPopupVisible",value:function(re,ve){var ye=this.props.alignPoint,Ie=this.state.popupVisible;this.clearDelayTimer(),Ie!==re&&("popupVisible"in this.props||this.setState({popupVisible:re,prevPopupVisible:Ie}),this.props.onPopupVisibleChange(re)),ye&&ve&&re&&this.setPoint(ve)}},{key:"delaySetPopupVisible",value:function(re,ve,ye){var Ie=this,Se=ve*1e3;if(this.clearDelayTimer(),Se){var Ue=ye?{pageX:ye.pageX,pageY:ye.pageY}:null;this.delayTimer=window.setTimeout(function(){Ie.setPopupVisible(re,Ue),Ie.clearDelayTimer()},Se)}else this.setPopupVisible(re,ye)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(re){var ve=this.props.children.props,ye=this.props;return ve[re]&&ye[re]?this["fire".concat(re)]:ve[re]||ye[re]}},{key:"isClickToShow",value:function(){var re=this.props,ve=re.action,ye=re.showAction;return ve.indexOf("click")!==-1||ye.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var re=this.props.action;return re==="contextMenu"||re.length===1&&re[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var re=this.props,ve=re.action,ye=re.showAction;return ve.indexOf("contextMenu")!==-1||ye.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var re=this.props,ve=re.action,ye=re.hideAction;return ve.indexOf("click")!==-1||ye.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var re=this.props,ve=re.action,ye=re.showAction;return ve.indexOf("hover")!==-1||ye.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var re=this.props,ve=re.action,ye=re.hideAction;return ve.indexOf("hover")!==-1||ye.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var re=this.props,ve=re.action,ye=re.showAction;return ve.indexOf("focus")!==-1||ye.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var re=this.props,ve=re.action,ye=re.hideAction;return ve.indexOf("focus")!==-1||ye.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var re;(re=this.popupRef.current)===null||re===void 0||re.forceAlign()}}},{key:"fireEvents",value:function(re,ve){var ye=this.props.children.props[re];ye&&ye(ve);var Ie=this.props[re];Ie&&Ie(ve)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var re=this.state.popupVisible,ve=this.props,ye=ve.children,Ie=ve.forceRender,Se=ve.alignPoint,Ue=ve.className,Ye=ve.autoDestroy,pt=D.Children.only(ye),ft={key:"trigger"};this.isContextMenuToShow()?ft.onContextMenu=this.onContextMenu:ft.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(ft.onClick=this.onClick,ft.onMouseDown=this.onMouseDown,ft.onTouchStart=this.onTouchStart):(ft.onClick=this.createTwoChains("onClick"),ft.onMouseDown=this.createTwoChains("onMouseDown"),ft.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(ft.onMouseEnter=this.onMouseEnter,Se&&(ft.onMouseMove=this.onMouseMove)):ft.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?ft.onMouseLeave=this.onMouseLeave:ft.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(ft.onFocus=this.onFocus,ft.onBlur=this.onBlur):(ft.onFocus=this.createTwoChains("onFocus"),ft.onBlur=this.createTwoChains("onBlur"));var Ot=G()(pt&&pt.props&&pt.props.className,Ue);Ot&&(ft.className=Ot);var cn=Object(X.a)({},ft);Object(bt.c)(pt)&&(cn.ref=Object(bt.a)(this.triggerRef,pt.ref));var xn=D.cloneElement(pt,cn),vn;return(re||this.popupRef.current||Ie)&&(vn=D.createElement(he,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!re&&Ye&&(vn=null),D.createElement(ln.Provider,{value:this.triggerContextValue},xn,vn)}}],[{key:"getDerivedStateFromProps",value:function(re,ve){var ye=re.popupVisible,Ie={};return ye!==void 0&&ve.popupVisible!==ye&&(Ie.popupVisible=ye,Ie.prevPopupVisible=ve.popupVisible),Ie}}]),te}(D.Component);return we.contextType=ln,we.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:cr,getDocument:gr,onPopupVisibleChange:ci,afterPopupVisibleChange:ci,onPopupAlign:ci,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},we}var fi=Wr(Kt.a),Di={adjustX:1,adjustY:1},dr={topLeft:{points:["bl","tl"],overflow:Di,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Di,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Di,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Di,offset:[4,0]}},Kr={topLeft:{points:["bl","tl"],overflow:Di,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Di,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Di,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Di,offset:[4,0]}},Ar=dr,ai=0,Pn={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},pi=function(we,Ae,me){var te=Ve(Ae),ce=we.getState();we.setState({defaultActiveFirst:Object(X.a)(Object(X.a)({},ce.defaultActiveFirst),{},Object(se.a)({},te,me))})},pn=function(he){Object(E.a)(Ae,he);var we=Object(b.a)(Ae);function Ae(me){var te;Object(R.a)(this,Ae),te=we.call(this,me),te.onDestroy=function(Se){te.props.onDestroy(Se)},te.onKeyDown=function(Se){var Ue=Se.keyCode,Ye=te.menuInstance,pt=te.props.store,ft=te.getVisible();if(Ue===f.a.ENTER)return te.onTitleClick(Se),pi(pt,te.props.eventKey,!0),!0;if(Ue===f.a.RIGHT)return ft?Ye.onKeyDown(Se):(te.triggerOpenChange(!0),pi(pt,te.props.eventKey,!0)),!0;if(Ue===f.a.LEFT){var Ot;if(ft)Ot=Ye.onKeyDown(Se);else return;return Ot||(te.triggerOpenChange(!1),Ot=!0),Ot}return ft&&(Ue===f.a.UP||Ue===f.a.DOWN)?Ye.onKeyDown(Se):void 0},te.onOpenChange=function(Se){te.props.onOpenChange(Se)},te.onPopupVisibleChange=function(Se){te.triggerOpenChange(Se,Se?"mouseenter":"mouseleave")},te.onMouseEnter=function(Se){var Ue=te.props,Ye=Ue.eventKey,pt=Ue.onMouseEnter,ft=Ue.store;pi(ft,te.props.eventKey,!1),pt({key:Ye,domEvent:Se})},te.onMouseLeave=function(Se){var Ue=te.props,Ye=Ue.parentMenu,pt=Ue.eventKey,ft=Ue.onMouseLeave;Ye.subMenuInstance=Object(w.a)(te),ft({key:pt,domEvent:Se})},te.onTitleMouseEnter=function(Se){var Ue=te.props,Ye=Ue.eventKey,pt=Ue.onItemHover,ft=Ue.onTitleMouseEnter;pt({key:Ye,hover:!0}),ft({key:Ye,domEvent:Se})},te.onTitleMouseLeave=function(Se){var Ue=te.props,Ye=Ue.parentMenu,pt=Ue.eventKey,ft=Ue.onItemHover,Ot=Ue.onTitleMouseLeave;Ye.subMenuInstance=Object(w.a)(te),ft({key:pt,hover:!1}),Ot({key:pt,domEvent:Se})},te.onTitleClick=function(Se){var Ue=Object(w.a)(te),Ye=Ue.props;if(Ye.onTitleClick({key:Ye.eventKey,domEvent:Se}),Ye.triggerSubMenuAction==="hover")return;te.triggerOpenChange(!te.getVisible(),"click"),pi(Ye.store,te.props.eventKey,!1)},te.onSubMenuClick=function(Se){typeof te.props.onClick=="function"&&te.props.onClick(te.addKeyPath(Se))},te.onSelect=function(Se){te.props.onSelect(Se)},te.onDeselect=function(Se){te.props.onDeselect(Se)},te.getPrefixCls=function(){return"".concat(te.props.rootPrefixCls,"-submenu")},te.getActiveClassName=function(){return"".concat(te.getPrefixCls(),"-active")},te.getDisabledClassName=function(){return"".concat(te.getPrefixCls(),"-disabled")},te.getSelectedClassName=function(){return"".concat(te.getPrefixCls(),"-selected")},te.getOpenClassName=function(){return"".concat(te.props.rootPrefixCls,"-submenu-open")},te.getVisible=function(){return te.state.isOpen},te.getMode=function(){return te.state.mode},te.saveMenuInstance=function(Se){te.menuInstance=Se},te.addKeyPath=function(Se){return Object(X.a)(Object(X.a)({},Se),{},{keyPath:(Se.keyPath||[]).concat(te.props.eventKey)})},te.triggerOpenChange=function(Se,Ue){var Ye=te.props.eventKey,pt=function(){te.onOpenChange({key:Ye,item:Object(w.a)(te),trigger:Ue,open:Se})};Ue==="mouseenter"?te.mouseenterTimeout=setTimeout(function(){pt()},0):pt()},te.isChildrenSelected=function(){var Se={find:!1};return ut(te.props.children,te.props.selectedKeys,Se),Se.find},te.isInlineMode=function(){return te.getMode()==="inline"},te.adjustWidth=function(){if(!te.subMenuTitle||!te.menuInstance)return;var Se=It.findDOMNode(te.menuInstance);if(Se.offsetWidth>=te.subMenuTitle.offsetWidth)return;Se.style.minWidth="".concat(te.subMenuTitle.offsetWidth,"px")},te.saveSubMenuTitle=function(Se){te.subMenuTitle=Se},te.getBaseProps=function(){var Se=Object(w.a)(te),Ue=Se.props,Ye=te.getMode();return{mode:Ye==="horizontal"?"vertical":Ye,visible:te.getVisible(),level:Ue.level+1,inlineIndent:Ue.inlineIndent,focusable:!1,onClick:te.onSubMenuClick,onSelect:te.onSelect,onDeselect:te.onDeselect,onDestroy:te.onDestroy,selectedKeys:Ue.selectedKeys,eventKey:"".concat(Ue.eventKey,"-menu-"),openKeys:Ue.openKeys,motion:Ue.motion,onOpenChange:te.onOpenChange,subMenuOpenDelay:Ue.subMenuOpenDelay,parentMenu:Object(w.a)(te),subMenuCloseDelay:Ue.subMenuCloseDelay,forceSubMenuRender:Ue.forceSubMenuRender,triggerSubMenuAction:Ue.triggerSubMenuAction,builtinPlacements:Ue.builtinPlacements,defaultActiveFirst:Ue.store.getState().defaultActiveFirst[Ve(Ue.eventKey)],multiple:Ue.multiple,prefixCls:Ue.rootPrefixCls,id:te.internalMenuId,manualRef:te.saveMenuInstance,itemIcon:Ue.itemIcon,expandIcon:Ue.expandIcon,direction:Ue.direction}},te.getMotion=function(Se,Ue){var Ye=Object(w.a)(te),pt=Ye.haveRendered,ft=te.props,Ot=ft.motion,cn=ft.rootPrefixCls,xn=Object(X.a)(Object(X.a)({},Ot),{},{leavedClassName:"".concat(cn,"-hidden"),removeOnLeave:!1,motionAppear:pt||!Ue||Se!=="inline"});return xn};var ce=me.store,re=me.eventKey,ve=ce.getState(),ye=ve.defaultActiveFirst;te.isRootMenu=!1;var Ie=!1;return ye&&(Ie=ye[re]),pi(ce,re,Ie),te.state={mode:me.mode,isOpen:me.isOpen},te}return Object(O.a)(Ae,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var te=this,ce=this.props,re=ce.mode,ve=ce.parentMenu,ye=ce.manualRef,Ie=ce.isOpen,Se=function(){te.setState({mode:re,isOpen:Ie})},Ue=Ie!==this.state.isOpen,Ye=re!==this.state.mode;if((Ye||Ue)&&(Tt.a.cancel(this.updateStateRaf),Ye?this.updateStateRaf=Object(Tt.a)(Se):Se()),ye&&ye(this),re!=="horizontal"||!(ve==null?void 0:ve.isRootMenu)||!Ie)return;this.minWidthTimeout=setTimeout(function(){return te.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var te=this.props,ce=te.onDestroy,re=te.eventKey;ce&&ce(re),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Tt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(te,ce){var re=this.getBaseProps();return D.createElement(Ci,Object(x.a)({},re,{id:this.internalMenuId,className:te,style:ce}),this.props.children)}},{key:"renderChildren",value:function(){var te=this,ce=this.getBaseProps(),re=ce.mode,ve=ce.visible,ye=ce.forceSubMenuRender,Ie=ce.direction,Se=this.getMotion(re,ve);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ve||ye,!this.haveOpened)return D.createElement("div",null);var Ue=G()("".concat(ce.prefixCls,"-sub"),Object(se.a)({},"".concat(ce.prefixCls,"-rtl"),Ie==="rtl"));return this.isInlineMode()?D.createElement(q,Object(x.a)({visible:ce.visible,forceRender:ye},Se),function(Ye){var pt=Ye.className,ft=Ye.style,Ot=G()(Ue,pt);return te.renderPopupMenu(Ot,ft)}):this.renderPopupMenu(Ue)}},{key:"render",value:function(){var te,ce,re,ve=Object(X.a)({},this.props),ye=this.getVisible(),Ie=this.getPrefixCls(),Se=this.isInlineMode(),Ue=this.getMode(),Ye=G()(Ie,"".concat(Ie,"-").concat(Ue),(te={},Object(se.a)(te,ve.className,!!ve.className),Object(se.a)(te,this.getOpenClassName(),ye),Object(se.a)(te,this.getActiveClassName(),ve.active||ye&&!Se),Object(se.a)(te,this.getDisabledClassName(),ve.disabled),Object(se.a)(te,this.getSelectedClassName(),this.isChildrenSelected()),te));this.internalMenuId||(ve.eventKey?this.internalMenuId="".concat(ve.eventKey,"$Menu"):(ai+=1,this.internalMenuId="$__$".concat(ai,"$Menu")));var pt={},ft={},Ot={};ve.disabled||(pt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},ft={onClick:this.onTitleClick},Ot={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var cn={},xn=ve.direction,vn=xn==="rtl";Se&&(vn?cn.paddingRight=ve.inlineIndent*ve.level:cn.paddingLeft=ve.inlineIndent*ve.level);var _n={};this.getVisible()&&(_n={"aria-owns":this.internalMenuId});var Tn=null;Ue!=="horizontal"&&(Tn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Tn=D.createElement(this.props.expandIcon,Object(X.a)({},this.props))));var En=D.createElement("div",Object(x.a)({ref:this.saveSubMenuTitle,style:cn,className:"".concat(Ie,"-title"),role:"button"},Ot,ft,{"aria-expanded":ye},_n,{"aria-haspopup":"true",title:typeof ve.title=="string"?ve.title:void 0}),ve.title,Tn||D.createElement("i",{className:"".concat(Ie,"-arrow")})),bn=this.renderChildren(),Un=((ce=ve.parentMenu)===null||ce===void 0?void 0:ce.isRootMenu)?ve.parentMenu.props.getPopupContainer:function(ii){return ii.parentNode},On=Pn[Ue],vi=ve.popupOffset?{offset:ve.popupOffset}:{},Rn=G()((re={},Object(se.a)(re,ve.popupClassName,ve.popupClassName&&!Se),Object(se.a)(re,"".concat(Ie,"-rtl"),vn),re)),an=ve.disabled,qt=ve.triggerSubMenuAction,In=ve.subMenuOpenDelay,Bn=ve.forceSubMenuRender,Xt=ve.subMenuCloseDelay,Hn=ve.builtinPlacements;gt.forEach(function(ii){return delete ve[ii]}),delete ve.onClick;var yi=vn?Object(X.a)(Object(X.a)({},Kr),Hn):Object(X.a)(Object(X.a)({},dr),Hn);delete ve.direction;var zn=this.getBaseProps(),oi=Se?null:this.getMotion(zn.mode,zn.visible);return D.createElement("li",Object(x.a)({},ve,pt,{className:Ye,role:"menuitem"}),D.createElement(fi,{prefixCls:Ie,popupClassName:G()("".concat(Ie,"-popup"),Rn),getPopupContainer:Un,builtinPlacements:yi,popupPlacement:On,popupVisible:Se?!1:ye,popupAlign:vi,popup:Se?null:bn,action:an||Se?[]:[qt],mouseEnterDelay:In,mouseLeaveDelay:Xt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Bn,popupMotion:oi},En),Se?bn:null)}}]),Ae}(D.Component);pn.defaultProps={onMouseEnter:lt,onMouseLeave:lt,onTitleMouseEnter:lt,onTitleMouseLeave:lt,onTitleClick:lt,manualRef:lt,mode:"vertical",title:""};var mi=Object(l.b)(function(he,we){var Ae=he.openKeys,me=he.activeKey,te=he.selectedKeys,ce=we.eventKey,re=we.subMenuKey;return{isOpen:Ae.indexOf(ce)>-1,active:me[re]===ce,selectedKeys:te}})(pn);mi.isSubMenu=!0;var Yn=mi,nr="menuitem-overflowed",Si=.5,Pi=function(he){Object(E.a)(Ae,he);var we=Object(b.a)(Ae);function Ae(){var me;return Object(R.a)(this,Ae),me=we.apply(this,arguments),me.resizeObserver=null,me.mutationObserver=null,me.originalTotalWidth=0,me.overflowedItems=[],me.menuItemSizes=[],me.cancelFrameId=null,me.state={lastVisibleIndex:void 0},me.childRef=D.createRef(),me.getMenuItemNodes=function(){var te=me.props.prefixCls,ce=me.childRef.current;return ce?[].slice.call(ce.children).filter(function(re){return re.className.split(" ").indexOf("".concat(te,"-overflowed-submenu"))<0}):[]},me.getOverflowedSubMenuItem=function(te,ce,re){var ve=me.props,ye=ve.overflowedIndicator,Ie=ve.level,Se=ve.mode,Ue=ve.prefixCls,Ye=ve.theme;if(Ie!==1||Se!=="horizontal")return null;var pt=me.props.children[0],ft=pt.props,Ot=ft.children,cn=ft.title,xn=ft.style,vn=Object(k.a)(ft,["children","title","style"]),_n=Object(X.a)({},xn),Tn="".concat(te,"-overflowed-indicator"),En="".concat(te,"-overflowed-indicator");ce.length===0&&re!==!0?_n=Object(X.a)(Object(X.a)({},_n),{},{display:"none"}):re&&(_n=Object(X.a)(Object(X.a)({},_n),{},{visibility:"hidden",position:"absolute"}),Tn="".concat(Tn,"-placeholder"),En="".concat(En,"-placeholder"));var bn=Ye?"".concat(Ue,"-").concat(Ye):"",Un={};return gt.forEach(function(On){vn[On]!==void 0&&(Un[On]=vn[On])}),D.createElement(Yn,Object(x.a)({title:ye,className:"".concat(Ue,"-overflowed-submenu"),popupClassName:bn},Un,{key:Tn,eventKey:En,disabled:!1,style:_n}),ce)},me.setChildrenWidthAndResize=function(){if(me.props.mode!=="horizontal")return;var te=me.childRef.current;if(!te)return;var ce=te.children;if(!ce||ce.length===0)return;var re=te.children[ce.length-1];it(re,"display","inline-block");var ve=me.getMenuItemNodes(),ye=ve.filter(function(Ie){return Ie.className.split(" ").indexOf(nr)>=0});ye.forEach(function(Ie){it(Ie,"display","inline-block")}),me.menuItemSizes=ve.map(function(Ie){return ot(Ie,!0)}),ye.forEach(function(Ie){it(Ie,"display","none")}),me.overflowedIndicatorWidth=ot(te.children[te.children.length-1],!0),me.originalTotalWidth=me.menuItemSizes.reduce(function(Ie,Se){return Ie+Se},0),me.handleResize(),it(re,"display","none")},me.handleResize=function(){if(me.props.mode!=="horizontal")return;var te=me.childRef.current;if(!te)return;var ce=ot(te);me.overflowedItems=[];var re=0,ve;me.originalTotalWidth>ce+Si&&(ve=-1,me.menuItemSizes.forEach(function(ye){re+=ye,re+me.overflowedIndicatorWidth<=ce&&(ve+=1)})),me.setState({lastVisibleIndex:ve})},me}return Object(O.a)(Ae,[{key:"componentDidMount",value:function(){var te=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ce=this.childRef.current;if(!ce)return;this.resizeObserver=new Pt.default(function(re){re.forEach(function(){var ve=te.cancelFrameId;cancelAnimationFrame(ve),te.cancelFrameId=requestAnimationFrame(te.setChildrenWidthAndResize)})}),[].slice.call(ce.children).concat(ce).forEach(function(re){te.resizeObserver.observe(re)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){te.resizeObserver.disconnect(),[].slice.call(ce.children).concat(ce).forEach(function(re){te.resizeObserver.observe(re)}),te.setChildrenWidthAndResize()}),this.mutationObserver.observe(ce,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(te){var ce=this,re=this.state.lastVisibleIndex;return(te||[]).reduce(function(ve,ye,Ie){var Se=ye;if(ce.props.mode==="horizontal"){var Ue=ce.getOverflowedSubMenuItem(ye.props.eventKey,[]);re!==void 0&&ce.props.className.indexOf("".concat(ce.props.prefixCls,"-root"))!==-1&&(Ie>re&&(Se=D.cloneElement(ye,{style:{display:"none"},eventKey:"".concat(ye.props.eventKey,"-hidden"),className:"".concat(nr)})),Ie===re+1&&(ce.overflowedItems=te.slice(re+1).map(function(pt){return D.cloneElement(pt,{key:pt.props.eventKey,mode:"vertical-left"})}),Ue=ce.getOverflowedSubMenuItem(ye.props.eventKey,ce.overflowedItems)));var Ye=[].concat(Object(I.a)(ve),[Ue,Se]);return Ie===te.length-1&&Ye.push(ce.getOverflowedSubMenuItem(ye.props.eventKey,[],!0)),Ye}return[].concat(Object(I.a)(ve),[Se])},[])}},{key:"render",value:function(){var te=this.props,ce=te.visible,re=te.prefixCls,ve=te.overflowedIndicator,ye=te.mode,Ie=te.level,Se=te.tag,Ue=te.children,Ye=te.theme,pt=Object(k.a)(te,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),ft=Se;return D.createElement(ft,Object(x.a)({ref:this.childRef},pt),this.renderChildren(Ue))}}]),Ae}(D.Component);Pi.defaultProps={tag:"div",className:""};var Gr=Pi;function Qi(he){return he.length?he.every(function(we){return!!we.props.disabled}):!0}function Sr(he,we,Ae){var me=he.getState();he.setState({activeKey:Object(X.a)(Object(X.a)({},me.activeKey),{},Object(se.a)({},we,Ae))})}function ir(he){return he.eventKey||"0-menu-"}function Zi(he,we){var Ae=we,me=he.children,te=he.eventKey;if(Ae){var ce;if(Qe(me,function(re,ve){re&&re.props&&!re.props.disabled&&Ae===Et(re,te,ve)&&(ce=!0)}),ce)return Ae}return Ae=null,he.defaultActiveFirst&&Qe(me,function(re,ve){!Ae&&re&&!re.props.disabled&&(Ae=Et(re,te,ve))}),Ae}function zr(he){if(!he)return;var we=this.instanceArray.indexOf(he);we!==-1?this.instanceArray[we]=he:this.instanceArray.push(he)}var gi=function(he){Object(E.a)(Ae,he);var we=Object(b.a)(Ae);function Ae(me){var te;return Object(R.a)(this,Ae),te=we.call(this,me),te.onKeyDown=function(ce,re){var ve=ce.keyCode,ye;if(te.getFlatInstanceArray().forEach(function(Se){Se&&Se.props.active&&Se.onKeyDown&&(ye=Se.onKeyDown(ce))}),ye)return 1;var Ie=null;return(ve===f.a.UP||ve===f.a.DOWN)&&(Ie=te.step(ve===f.a.UP?-1:1)),Ie?(ce.preventDefault(),Sr(te.props.store,ir(te.props),Ie.props.eventKey),typeof re=="function"&&re(Ie),1):void 0},te.onItemHover=function(ce){var re=ce.key,ve=ce.hover;Sr(te.props.store,ir(te.props),ve?re:null)},te.onDeselect=function(ce){te.props.onDeselect(ce)},te.onSelect=function(ce){te.props.onSelect(ce)},te.onClick=function(ce){te.props.onClick(ce)},te.onOpenChange=function(ce){te.props.onOpenChange(ce)},te.onDestroy=function(ce){te.props.onDestroy(ce)},te.getFlatInstanceArray=function(){return te.instanceArray},te.step=function(ce){var re=te.getFlatInstanceArray(),ve=te.props.store.getState().activeKey[ir(te.props)],ye=re.length;if(!ye)return null;ce<0&&(re=re.concat().reverse());var Ie=-1;if(re.every(function(pt,ft){return pt&&pt.props.eventKey===ve?(Ie=ft,!1):!0}),!te.props.defaultActiveFirst&&Ie!==-1&&Qi(re.slice(Ie,ye-1)))return;var Se=(Ie+1)%ye,Ue=Se;do{var Ye=re[Ue];if(!Ye||Ye.props.disabled)Ue=(Ue+1)%ye;else return Ye}while(Ue!==Se);return null},te.renderCommonMenuItem=function(ce,re,ve){var ye=te.props.store.getState(),Ie=Object(w.a)(te),Se=Ie.props,Ue=Et(ce,Se.eventKey,re),Ye=ce.props;if(!Ye||typeof ce.type=="string")return ce;var pt=Ue===ye.activeKey,ft=Object(X.a)(Object(X.a)({mode:Ye.mode||Se.mode,level:Se.level,inlineIndent:Se.inlineIndent,renderMenuItem:te.renderMenuItem,rootPrefixCls:Se.prefixCls,index:re,parentMenu:Se.parentMenu,manualRef:Ye.disabled?void 0:Object(h.a)(ce.ref,zr.bind(Object(w.a)(te))),eventKey:Ue,active:!Ye.disabled&&pt,multiple:Se.multiple,onClick:function(cn){(Ye.onClick||lt)(cn),te.onClick(cn)},onItemHover:te.onItemHover,motion:Se.motion,subMenuOpenDelay:Se.subMenuOpenDelay,subMenuCloseDelay:Se.subMenuCloseDelay,forceSubMenuRender:Se.forceSubMenuRender,onOpenChange:te.onOpenChange,onDeselect:te.onDeselect,onSelect:te.onSelect,builtinPlacements:Se.builtinPlacements,itemIcon:Ye.itemIcon||te.props.itemIcon,expandIcon:Ye.expandIcon||te.props.expandIcon},ve),{},{direction:Se.direction});return(Se.mode==="inline"||rt())&&(ft.triggerSubMenuAction="click"),D.cloneElement(ce,Object(X.a)(Object(X.a)({},ft),{},{key:Ue||re}))},te.renderMenuItem=function(ce,re,ve){if(!ce)return null;var ye=te.props.store.getState(),Ie={openKeys:ye.openKeys,selectedKeys:ye.selectedKeys,triggerSubMenuAction:te.props.triggerSubMenuAction,subMenuKey:ve};return te.renderCommonMenuItem(ce,re,Ie)},me.store.setState({activeKey:Object(X.a)(Object(X.a)({},me.store.getState().activeKey),{},Object(se.a)({},me.eventKey,Zi(me,me.activeKey)))}),te.instanceArray=[],te}return Object(O.a)(Ae,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(te){return this.props.visible||te.visible||this.props.className!==te.className||!T()(this.props.style,te.style)}},{key:"componentDidUpdate",value:function(te){var ce=this.props,re="activeKey"in ce?ce.activeKey:ce.store.getState().activeKey[ir(ce)],ve=Zi(ce,re);if(ve!==re)Sr(ce.store,ir(ce),ve);else if("activeKey"in te){var ye=Zi(te,te.activeKey);ve!==ye&&Sr(ce.store,ir(ce),ve)}}},{key:"render",value:function(){var te=this,ce=Object(x.a)({},this.props);this.instanceArray=[];var re=G()(ce.prefixCls,ce.className,"".concat(ce.prefixCls,"-").concat(ce.mode)),ve={className:re,role:ce.role||"menu"};ce.id&&(ve.id=ce.id),ce.focusable&&(ve.tabIndex=0,ve.onKeyDown=this.onKeyDown);var ye=ce.prefixCls,Ie=ce.eventKey,Se=ce.visible,Ue=ce.level,Ye=ce.mode,pt=ce.overflowedIndicator,ft=ce.theme;return gt.forEach(function(Ot){return delete ce[Ot]}),delete ce.onClick,D.createElement(Gr,Object(x.a)({},ce,{prefixCls:ye,mode:Ye,tag:"ul",level:Ue,theme:ft,visible:Se,overflowedIndicator:pt},ve),Object(j.a)(ce.children).map(function(Ot,cn){return te.renderMenuItem(Ot,cn,Ie||"0-menu-")}))}}]),Ae}(D.Component);gi.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:lt};var Kn=Object(l.b)()(gi),Ci=Kn,Ti=Q("Kwbf");function qi(he,we,Ae){var me=he.prefixCls,te=he.motion,ce=he.defaultMotions,re=ce===void 0?{}:ce,ve=he.openAnimation,ye=he.openTransitionName,Ie=we.switchingModeFromInline;if(te)return te;if(Object(N.a)(ve)==="object"&&ve)Object(Ti.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ve=="string")return{motionName:"".concat(me,"-open-").concat(ve)};if(ye)return{motionName:ye};var Se=re[Ae];return Se||(Ie?null:re.other)}var kt=function(he){Object(E.a)(Ae,he);var we=Object(b.a)(Ae);function Ae(me){var te;Object(R.a)(this,Ae),te=we.call(this,me),te.onSelect=function(ve){var ye=Object(w.a)(te),Ie=ye.props;if(Ie.selectable){var Se=te.store.getState(),Ue=Se.selectedKeys,Ye=ve.key;Ie.multiple?Ue=Ue.concat([Ye]):Ue=[Ye],"selectedKeys"in Ie||te.store.setState({selectedKeys:Ue}),Ie.onSelect(Object(X.a)(Object(X.a)({},ve),{},{selectedKeys:Ue}))}},te.onClick=function(ve){var ye=te.getRealMenuMode(),Ie=Object(w.a)(te),Se=Ie.store,Ue=Ie.props.onOpenChange;ye!=="inline"&&!("openKeys"in te.props)&&(Se.setState({openKeys:[]}),Ue([])),te.props.onClick(ve)},te.onKeyDown=function(ve,ye){te.innerMenu.getWrappedInstance().onKeyDown(ve,ye)},te.onOpenChange=function(ve){var ye=Object(w.a)(te),Ie=ye.props,Se=te.store.getState().openKeys.concat(),Ue=!1,Ye=function(ft){var Ot=!1;if(ft.open)Ot=Se.indexOf(ft.key)===-1,Ot&&Se.push(ft.key);else{var cn=Se.indexOf(ft.key);Ot=cn!==-1,Ot&&Se.splice(cn,1)}Ue=Ue||Ot};Array.isArray(ve)?ve.forEach(Ye):Ye(ve),Ue&&("openKeys"in te.props||te.store.setState({openKeys:Se}),Ie.onOpenChange(Se))},te.onDeselect=function(ve){var ye=Object(w.a)(te),Ie=ye.props;if(Ie.selectable){var Se=te.store.getState().selectedKeys.concat(),Ue=ve.key,Ye=Se.indexOf(Ue);Ye!==-1&&Se.splice(Ye,1),"selectedKeys"in Ie||te.store.setState({selectedKeys:Se}),Ie.onDeselect(Object(X.a)(Object(X.a)({},ve),{},{selectedKeys:Se}))}},te.onMouseEnter=function(ve){te.restoreModeVerticalFromInline();var ye=te.props.onMouseEnter;ye&&ye(ve)},te.onTransitionEnd=function(ve){var ye=ve.propertyName==="width"&&ve.target===ve.currentTarget,Ie=ve.target.className,Se=Object.prototype.toString.call(Ie)==="[object SVGAnimatedString]"?Ie.animVal:Ie,Ue=ve.propertyName==="font-size"&&Se.indexOf("anticon")>=0;(ye||Ue)&&te.restoreModeVerticalFromInline()},te.setInnerMenu=function(ve){te.innerMenu=ve},te.isRootMenu=!0;var ce=me.defaultSelectedKeys,re=me.defaultOpenKeys;return"selectedKeys"in me&&(ce=me.selectedKeys||[]),"openKeys"in me&&(re=me.openKeys||[]),te.store=Object(l.c)({selectedKeys:ce,openKeys:re,activeKey:{"0-menu-":Zi(me,me.activeKey)}}),te.state={switchingModeFromInline:!1,prevProps:me,inlineOpenKeys:[],store:te.store},te}return Object(O.a)(Ae,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(te){var ce=this.props,re=ce.siderCollapsed,ve=ce.inlineCollapsed,ye=ce.onOpenChange;(!te.inlineCollapsed&&ve||!te.siderCollapsed&&re)&&ye([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var te=this.props.collapsedWidth,ce=this.store,re=this.prevOpenKeys,ve=this.getInlineCollapsed()&&(te===0||te==="0"||te==="0px");ve?(this.prevOpenKeys=ce.getState().openKeys.concat(),this.store.setState({openKeys:[]})):re&&(this.store.setState({openKeys:re}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var te=this.props.mode,ce=this.state.switchingModeFromInline,re=this.getInlineCollapsed();return ce&&re?"inline":re?"vertical":te}},{key:"getInlineCollapsed",value:function(){var te=this.props,ce=te.inlineCollapsed,re=te.siderCollapsed;return re!==void 0?re:ce}},{key:"restoreModeVerticalFromInline",value:function(){var te=this.state.switchingModeFromInline;te&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var te=Object(X.a)({},Object(_.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ce=this.getRealMenuMode();return te.className+=" ".concat(te.prefixCls,"-root"),te.direction==="rtl"&&(te.className+=" ".concat(te.prefixCls,"-rtl")),te=Object(X.a)(Object(X.a)({},te),{},{mode:ce,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:qi(this.props,this.state,ce)}),delete te.openAnimation,delete te.openTransitionName,D.createElement(l.a,{store:this.store},D.createElement(Ci,Object(x.a)({},te,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(te,ce){var re=ce.prevProps,ve=ce.store,ye=ve.getState(),Ie={},Se={prevProps:te};return re.mode==="inline"&&te.mode!=="inline"&&(Se.switchingModeFromInline=!0),"openKeys"in te?Ie.openKeys=te.openKeys||[]:((te.inlineCollapsed&&!re.inlineCollapsed||te.siderCollapsed&&!re.siderCollapsed)&&(Se.switchingModeFromInline=!0,Se.inlineOpenKeys=ye.openKeys,Ie.openKeys=[]),(!te.inlineCollapsed&&re.inlineCollapsed||!te.siderCollapsed&&re.siderCollapsed)&&(Ie.openKeys=ce.inlineOpenKeys,Se.inlineOpenKeys=[])),Object.keys(Ie).length&&ve.setState(Ie),Se}}]),Ae}(D.Component);kt.defaultProps={selectable:!0,onClick:lt,onSelect:lt,onOpenChange:lt,onDeselect:lt,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:D.createElement("span",null,"\xB7\xB7\xB7")};var rn=kt,Yt=function(he){Object(E.a)(Ae,he);var we=Object(b.a)(Ae);function Ae(){var me;return Object(R.a)(this,Ae),me=we.apply(this,arguments),me.onKeyDown=function(te){var ce=te.keyCode;return ce===f.a.ENTER?(me.onClick(te),!0):void 0},me.onMouseLeave=function(te){var ce=me.props,re=ce.eventKey,ve=ce.onItemHover,ye=ce.onMouseLeave;ve({key:re,hover:!1}),ye({key:re,domEvent:te})},me.onMouseEnter=function(te){var ce=me.props,re=ce.eventKey,ve=ce.onItemHover,ye=ce.onMouseEnter;ve({key:re,hover:!0}),ye({key:re,domEvent:te})},me.onClick=function(te){var ce=me.props,re=ce.eventKey,ve=ce.multiple,ye=ce.onClick,Ie=ce.onSelect,Se=ce.onDeselect,Ue=ce.isSelected,Ye={key:re,keyPath:[re],item:Object(w.a)(me),domEvent:te};ye(Ye),ve?Ue?Se(Ye):Ie(Ye):Ue||Ie(Ye)},me.saveNode=function(te){me.node=te},me}return Object(O.a)(Ae,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var te=this.props;te.onDestroy&&te.onDestroy(te.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var te,ce=Object(X.a)({},this.props),re=G()(this.getPrefixCls(),ce.className,(te={},Object(se.a)(te,this.getActiveClassName(),!ce.disabled&&ce.active),Object(se.a)(te,this.getSelectedClassName(),ce.isSelected),Object(se.a)(te,this.getDisabledClassName(),ce.disabled),te)),ve=Object(X.a)(Object(X.a)({},ce.attribute),{},{title:typeof ce.title=="string"?ce.title:void 0,className:re,role:ce.role||"menuitem","aria-disabled":ce.disabled});ce.role==="option"?ve=Object(X.a)(Object(X.a)({},ve),{},{role:"option","aria-selected":ce.isSelected}):(ce.role===null||ce.role==="none")&&(ve.role="none");var ye={onClick:ce.disabled?null:this.onClick,onMouseLeave:ce.disabled?null:this.onMouseLeave,onMouseEnter:ce.disabled?null:this.onMouseEnter},Ie=Object(X.a)({},ce.style);ce.mode==="inline"&&(ce.direction==="rtl"?Ie.paddingRight=ce.inlineIndent*ce.level:Ie.paddingLeft=ce.inlineIndent*ce.level),gt.forEach(function(Ue){return delete ce[Ue]}),delete ce.direction;var Se=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Se=D.createElement(this.props.itemIcon,this.props)),D.createElement("li",Object(x.a)({},Object(_.a)(ce,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ve,ye,{style:Ie,ref:this.saveNode}),ce.children,Se)}}]),Ae}(D.Component);Yt.isMenuItem=!0,Yt.defaultProps={onSelect:lt,onMouseEnter:lt,onMouseLeave:lt,manualRef:lt};var wn=Object(l.b)(function(he,we){var Ae=he.activeKey,me=he.selectedKeys,te=we.eventKey,ce=we.subMenuKey;return{active:Ae[ce]===te,isSelected:Array.isArray(me)?me.indexOf(te)!==-1:me===te}})(Yt),jn=wn,ti=function(he){Object(E.a)(Ae,he);var we=Object(b.a)(Ae);function Ae(){var me;return Object(R.a)(this,Ae),me=we.apply(this,arguments),me.renderInnerMenuItem=function(te){var ce=me.props,re=ce.renderMenuItem,ve=ce.index;return re(te,ve,me.props.subMenuKey)},me}return Object(O.a)(Ae,[{key:"render",value:function(){var te=Object(x.a)({},this.props),ce=te.className,re=ce===void 0?"":ce,ve=te.rootPrefixCls,ye="".concat(ve,"-item-group-title"),Ie="".concat(ve,"-item-group-list"),Se=te.title,Ue=te.children;return gt.forEach(function(Ye){return delete te[Ye]}),delete te.direction,D.createElement("li",Object(x.a)({},te,{onClick:function(pt){return pt.stopPropagation()},className:"".concat(re," ").concat(ve,"-item-group")}),D.createElement("div",{className:ye,title:typeof Se=="string"?Se:void 0},Se),D.createElement("ul",{className:Ie},D.Children.map(Ue,this.renderInnerMenuItem)))}}]),Ae}(D.Component);ti.isMenuItemGroup=!0,ti.defaultProps={disabled:!0};var Nn=ti,Ai=function(we){var Ae=we.className,me=we.rootPrefixCls,te=we.style;return D.createElement("li",{className:"".concat(Ae," ").concat(me,"-item-divider"),style:te})};Ai.defaultProps={disabled:!0,className:"",style:{}};var rr=Ai,An=rn,Or=Q("eDIo");function Jn(he,we){var Ae=he.prefixCls,me=he.editable,te=he.locale,ce=he.style;return!me||me.showAdd===!1?null:D.createElement("button",{ref:we,type:"button",className:"".concat(Ae,"-nav-add"),style:ce,"aria-label":(te==null?void 0:te.addAriaLabel)||"Add tab",onClick:function(ve){me.onEdit("add",{event:ve})}},me.addIcon||"+")}var Xi=D.forwardRef(Jn);function Gi(he,we){var Ae=he.prefixCls,me=he.id,te=he.tabs,ce=he.locale,re=he.mobile,ve=he.moreIcon,ye=ve===void 0?"More":ve,Ie=he.moreTransitionName,Se=he.style,Ue=he.className,Ye=he.editable,pt=he.tabBarGutter,ft=he.rtl,Ot=he.onTabClick,cn=Object(D.useState)(!1),xn=Object(W.a)(cn,2),vn=xn[0],_n=xn[1],Tn=Object(D.useState)(null),En=Object(W.a)(Tn,2),bn=En[0],Un=En[1],On="".concat(me,"-more-popup"),vi="".concat(Ae,"-dropdown"),Rn=bn!==null?"".concat(On,"-").concat(bn):null,an=ce==null?void 0:ce.dropdownAriaLabel,qt=D.createElement(An,{onClick:function(oi){var ii=oi.key,Ri=oi.domEvent;Ot(ii,Ri),_n(!1)},id:On,tabIndex:-1,role:"listbox","aria-activedescendant":Rn,selectedKeys:[bn],"aria-label":an!==void 0?an:"expanded dropdown"},te.map(function(zn){return D.createElement(jn,{key:zn.key,id:"".concat(On,"-").concat(zn.key),role:"option","aria-controls":me&&"".concat(me,"-panel-").concat(zn.key),disabled:zn.disabled},zn.tab)}));function In(zn){for(var oi=te.filter(function($i){return!$i.disabled}),ii=oi.findIndex(function($i){return $i.key===bn})||0,Ri=oi.length,Bi=0;Bi<Ri;Bi+=1){ii=(ii+zn+Ri)%Ri;var bi=oi[ii];if(!bi.disabled){Un(bi.key);return}}}function Bn(zn){var oi=zn.which;if(!vn){[f.a.DOWN,f.a.SPACE,f.a.ENTER].includes(oi)&&(_n(!0),zn.preventDefault());return}switch(oi){case f.a.UP:In(-1),zn.preventDefault();break;case f.a.DOWN:In(1),zn.preventDefault();break;case f.a.ESC:_n(!1);break;case f.a.SPACE:case f.a.ENTER:bn!==null&&Ot(bn,zn);break}}Object(D.useEffect)(function(){var zn=document.getElementById(Rn);zn&&zn.scrollIntoView&&zn.scrollIntoView(!1)},[bn]),Object(D.useEffect)(function(){vn||Un(null)},[vn]);var Xt=Object(se.a)({},ft?"marginLeft":"marginRight",pt);te.length||(Xt.visibility="hidden",Xt.order=1);var Hn=G()(Object(se.a)({},"".concat(vi,"-rtl"),ft)),yi=re?null:D.createElement(Or.a,{prefixCls:vi,overlay:qt,trigger:["hover"],visible:vn,transitionName:Ie,onVisibleChange:_n,overlayClassName:Hn,mouseEnterDelay:.1,mouseLeaveDelay:.1},D.createElement("button",{type:"button",className:"".concat(Ae,"-nav-more"),style:Xt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":On,id:"".concat(me,"-more"),"aria-expanded":vn,onKeyDown:Bn},ye));return D.createElement("div",{className:G()("".concat(Ae,"-nav-operations"),Ue),style:Se,ref:we},yi,D.createElement(Xi,{prefixCls:Ae,locale:ce,editable:Ye}))}var vr=D.forwardRef(Gi),Fa=Object(D.createContext)(null),Ko=.1,$r=.01,Oi=20,go=Math.pow(.995,Oi);function vo(){var he=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(he)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(he.substr(0,4)))}function da(he,we){var Ae=Object(D.useState)(),me=Object(W.a)(Ae,2),te=me[0],ce=me[1],re=Object(D.useState)(0),ve=Object(W.a)(re,2),ye=ve[0],Ie=ve[1],Se=Object(D.useState)(0),Ue=Object(W.a)(Se,2),Ye=Ue[0],pt=Ue[1],ft=Object(D.useState)(),Ot=Object(W.a)(ft,2),cn=Ot[0],xn=Ot[1],vn=Object(D.useRef)();function _n(an){var qt=an.touches[0],In=qt.screenX,Bn=qt.screenY;ce({x:In,y:Bn}),window.clearInterval(vn.current)}function Tn(an){if(!te)return;an.preventDefault();var qt=an.touches[0],In=qt.screenX,Bn=qt.screenY;ce({x:In,y:Bn});var Xt=In-te.x,Hn=Bn-te.y;we(Xt,Hn);var yi=Date.now();Ie(yi),pt(yi-ye),xn({x:Xt,y:Hn})}function En(){if(!te)return;if(ce(null),xn(null),cn){var an=cn.x/Ye,qt=cn.y/Ye,In=Math.abs(an),Bn=Math.abs(qt);if(Math.max(In,Bn)<Ko)return;var Xt=an,Hn=qt;vn.current=window.setInterval(function(){if(Math.abs(Xt)<$r&&Math.abs(Hn)<$r){window.clearInterval(vn.current);return}Xt*=go,Hn*=go,we(Xt*Oi,Hn*Oi)},Oi)}}var bn=Object(D.useRef)(0),Un=Object(D.useRef)(!1),On=Object(D.useRef)();function vi(an){var qt=an.deltaX,In=an.deltaY,Bn=0,Xt=Math.abs(qt),Hn=Math.abs(In);Xt===Hn?Bn=On.current==="x"?qt:In:Xt>Hn?(Bn=qt,On.current="x"):(Bn=In,On.current="y");var yi=Date.now();yi-bn.current>100&&(Un.current=!1),(we(-Bn,-Bn)||Un.current)&&(an.preventDefault(),Un.current=!0),bn.current=yi}var Rn=Object(D.useRef)(null);Rn.current={onTouchStart:_n,onTouchMove:Tn,onTouchEnd:En,onWheel:vi},D.useEffect(function(){function an(Xt){Rn.current.onTouchStart(Xt)}function qt(Xt){Rn.current.onTouchMove(Xt)}function In(Xt){Rn.current.onTouchEnd(Xt)}function Bn(Xt){Rn.current.onWheel(Xt)}return document.addEventListener("touchmove",qt,{passive:!1}),document.addEventListener("touchend",In,{passive:!1}),he.current.addEventListener("touchstart",an,{passive:!1}),he.current.addEventListener("wheel",Bn),function(){document.removeEventListener("touchmove",qt),document.removeEventListener("touchend",In)}},[])}function Go(){var he=Object(D.useRef)(new Map);function we(me){return he.current.has(me)||he.current.set(me,D.createRef()),he.current.get(me)}function Ae(me){he.current.delete(me)}return[we,Ae]}function ja(he,we){var Ae=D.useRef(he),me=D.useState({}),te=Object(W.a)(me,2),ce=te[1];function re(ve){var ye=typeof ve=="function"?ve(Ae.current):ve;ye!==Ae.current&&we(ye,Ae.current),Ae.current=ye,ce({})}return[Ae.current,re]}var yo=function(we){var Ae=we.position,me=we.prefixCls,te=we.extra;if(!te)return null;var ce,re=te;return Ae==="right"&&(ce=re.right||!re.left&&re||null),Ae==="left"&&(ce=re.left||null),ce?D.createElement("div",{className:"".concat(me,"-extra-content")},ce):null};function Ha(he,we){var Ae,me=D.useContext(Fa),te=me.prefixCls,ce=me.tabs,re=he.className,ve=he.style,ye=he.id,Ie=he.animated,Se=he.activeKey,Ue=he.rtl,Ye=he.extra,pt=he.editable,ft=he.locale,Ot=he.tabPosition,cn=he.tabBarGutter,xn=he.children,vn=he.onTabClick,_n=he.onTabScroll,Tn=Object(D.useRef)(),En=Object(D.useRef)(),bn=Object(D.useRef)(),Un=Object(D.useRef)(),On=Go(),vi=Object(W.a)(On,2),Rn=vi[0],an=vi[1],qt=Ot==="top"||Ot==="bottom",In=ja(0,function($n,Mn){qt&&_n&&_n({direction:$n>Mn?"left":"right"})}),Bn=Object(W.a)(In,2),Xt=Bn[0],Hn=Bn[1],yi=ja(0,function($n,Mn){!qt&&_n&&_n({direction:$n>Mn?"top":"bottom"})}),zn=Object(W.a)(yi,2),oi=zn[0],ii=zn[1],Ri=Object(D.useState)(0),Bi=Object(W.a)(Ri,2),bi=Bi[0],$i=Bi[1],br=Object(D.useState)(0),ar=Object(W.a)(br,2),Fi=ar[0],di=ar[1],si=Object(D.useState)(0),Ei=Object(W.a)(si,2),_i=Ei[0],Er=Ei[1],kr=Object(D.useState)(0),Pr=Object(W.a)(kr,2),ri=Pr[0],Cr=Pr[1],Nr=Object(D.useState)(null),ui=Object(W.a)(Nr,2),ni=ui[0],ji=ui[1],Eo=Object(D.useState)(null),za=Object(W.a)(Eo,2),Ur=za[0],ta=za[1],_a=Object(D.useState)(0),Va=Object(W.a)(_a,2),ba=Va[0],Xo=Va[1],Yo=Object(D.useState)(0),xo=Object(W.a)(Yo,2),Xa=xo[0],Ya=xo[1],na=u(new Map),ia=Object(W.a)(na,2),Jo=ia[0],Ea=ia[1],ha=d(ce,Jo,bi),ra="".concat(te,"-nav-operations-hidden"),aa=0,xr=0;qt?Ue?(aa=0,xr=Math.max(0,bi-ni)):(aa=Math.min(0,ni-bi),xr=0):(aa=Math.min(0,Ur-Fi),xr=0);function Vr($n){return $n<aa?[aa,!1]:$n>xr?[xr,!1]:[$n,!0]}var Br=Object(D.useRef)(),fa=Object(D.useState)(),Xr=Object(W.a)(fa,2),xa=Xr[0],Ja=Xr[1];function Ta(){Ja(Date.now())}function Qa(){window.clearTimeout(Br.current)}da(Tn,function($n,Mn){var Hi=!1;function sr(oa,Lr){oa(function(ga){var jr=Vr(ga+Lr),Wi=Object(W.a)(jr,2),Ca=Wi[0],qa=Wi[1];return Hi=qa,Ca})}if(qt){if(ni>=bi)return Hi;sr(Hn,$n)}else{if(Ur>=Fi)return Hi;sr(ii,Mn)}return Qa(),Ta(),Hi}),Object(D.useEffect)(function(){return Qa(),xa&&(Br.current=window.setTimeout(function(){Ja(0)},100)),Qa},[xa]);function Fr(){var $n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Se,Mn=ha.get($n);if(!Mn)return;if(qt){var Hi=Xt;Ue?Mn.right<Xt?Hi=Mn.right:Mn.right+Mn.width>Xt+ni&&(Hi=Mn.right+Mn.width-ni):Mn.left<-Xt?Hi=-Mn.left:Mn.left+Mn.width>-Xt+ni&&(Hi=-(Mn.left+Mn.width-ni)),ii(0),Hn(Vr(Hi)[0])}else{var sr=oi;Mn.top<-oi?sr=-Mn.top:Mn.top+Mn.height>-oi+Ur&&(sr=-(Mn.top+Mn.height-Ur)),Hn(0),ii(Vr(sr)[0])}}var Yr=S(ha,{width:ni,height:Ur,left:Xt,top:oi},{width:_i,height:ri},{width:ba,height:Xa},Object(X.a)(Object(X.a)({},he),{},{tabs:ce})),To=Object(W.a)(Yr,2),Qo=To[0],Zo=To[1],qo=ce.map(function($n){var Mn=$n.key;return D.createElement(r,{id:ye,prefixCls:te,key:Mn,rtl:Ue,tab:$n,closable:$n.closable,editable:pt,active:Mn===Se,tabPosition:Ot,tabBarGutter:cn,renderWrapper:xn,removeAriaLabel:ft==null?void 0:ft.removeAriaLabel,ref:Rn(Mn),onClick:function(sr){vn(Mn,sr)},onRemove:function(){an(Mn)},onFocus:function(){Fr(Mn),Ta(),Ue||(Tn.current.scrollLeft=0),Tn.current.scrollTop=0}})}),Za=c(function(){var $n,Mn,Hi,sr,oa,Lr,ga,jr,Wi,Ca=(($n=Tn.current)===null||$n===void 0?void 0:$n.offsetWidth)||0,qa=((Mn=Tn.current)===null||Mn===void 0?void 0:Mn.offsetHeight)||0,$a=((Hi=Un.current)===null||Hi===void 0?void 0:Hi.offsetWidth)||0,lr=((sr=Un.current)===null||sr===void 0?void 0:sr.offsetHeight)||0,Qn=((oa=bn.current)===null||oa===void 0?void 0:oa.offsetWidth)||0,wr=((Lr=bn.current)===null||Lr===void 0?void 0:Lr.offsetHeight)||0;ji(Ca),ta(qa),Xo($a),Ya(lr);var Dr=(((ga=En.current)===null||ga===void 0?void 0:ga.offsetWidth)||0)-$a,Ir=(((jr=En.current)===null||jr===void 0?void 0:jr.offsetHeight)||0)-lr;$i(Dr),di(Ir);var eo=(Wi=bn.current)===null||Wi===void 0?void 0:Wi.className.includes(ra);Er(Dr-(eo?0:Qn)),Cr(Ir-(eo?0:wr)),Ea(function(){var Aa=new Map;return ce.forEach(function(Oo){var Ro=Oo.key,Qr=Rn(Ro).current;Qr&&Aa.set(Ro,{width:Qr.offsetWidth,height:Qr.offsetHeight,left:Qr.offsetLeft,top:Qr.offsetTop})}),Aa})}),$o=ce.slice(0,Qo),or=ce.slice(Zo+1),Ii=[].concat(Object(I.a)($o),Object(I.a)(or)),Yi=Object(D.useState)(),Mi=Object(W.a)(Yi,2),pa=Mi[0],es=Mi[1],Tr=ha.get(Se),wo=Object(D.useRef)();function So(){m.a.cancel(wo.current)}Object(D.useEffect)(function(){var $n={};return Tr&&(qt?(Ue?$n.right=Tr.right:$n.left=Tr.left,$n.width=Tr.width):($n.top=Tr.top,$n.height=Tr.height)),So(),wo.current=m()(function(){es($n)}),So},[Tr,qt,Ue]),Object(D.useEffect)(function(){Fr()},[Se,Tr,ha,qt]),Object(D.useEffect)(function(){Za()},[Ue,cn,Se,ce.map(function($n){return $n.key}).join("_")]);var Co=!!Ii.length,Jr="".concat(te,"-nav-wrap"),wa,ma,Ao,Sa;return qt?Ue?(ma=Xt>0,wa=Xt+ni<bi):(wa=Xt<0,ma=-Xt+ni<bi):(Ao=oi<0,Sa=-oi+Ur<Fi),D.createElement("div",{ref:we,role:"tablist",className:G()("".concat(te,"-nav"),re),style:ve,onKeyDown:function(){Ta()}},D.createElement(yo,{position:"left",extra:Ye,prefixCls:te}),D.createElement(p.a,{onResize:Za},D.createElement("div",{className:G()(Jr,(Ae={},Object(se.a)(Ae,"".concat(Jr,"-ping-left"),wa),Object(se.a)(Ae,"".concat(Jr,"-ping-right"),ma),Object(se.a)(Ae,"".concat(Jr,"-ping-top"),Ao),Object(se.a)(Ae,"".concat(Jr,"-ping-bottom"),Sa),Ae)),ref:Tn},D.createElement(p.a,{onResize:Za},D.createElement("div",{ref:En,className:"".concat(te,"-nav-list"),style:{transform:"translate(".concat(Xt,"px, ").concat(oi,"px)"),transition:xa?"none":void 0}},qo,D.createElement(Xi,{ref:Un,prefixCls:te,locale:ft,editable:pt,style:{visibility:Co?"hidden":null}}),D.createElement("div",{className:G()("".concat(te,"-ink-bar"),Object(se.a)({},"".concat(te,"-ink-bar-animated"),Ie.inkBar)),style:pa}))))),D.createElement(vr,Object.assign({},he,{ref:bn,prefixCls:te,tabs:Ii,className:!Co&&ra})),D.createElement(yo,{position:"right",extra:Ye,prefixCls:te}))}var Wa=D.forwardRef(Ha);function zo(he){var we=he.id,Ae=he.activeKey,me=he.animated,te=he.tabPosition,ce=he.rtl,re=he.destroyInactiveTabPane,ve=D.useContext(Fa),ye=ve.prefixCls,Ie=ve.tabs,Se=me.tabPane,Ue=Ie.findIndex(function(Ye){return Ye.key===Ae});return D.createElement("div",{className:G()("".concat(ye,"-content-holder"))},D.createElement("div",{className:G()("".concat(ye,"-content"),"".concat(ye,"-content-").concat(te),Object(se.a)({},"".concat(ye,"-content-animated"),Se)),style:Ue&&Se?Object(se.a)({},ce?"marginRight":"marginLeft","-".concat(Ue,"00%")):null},Ie.map(function(Ye){return D.cloneElement(Ye.node,{key:Ye.key,prefixCls:ye,tabKey:Ye.key,id:we,animated:Se,active:Ye.key===Ae,destroyInactiveTabPane:re})})))}function _o(he){var we=he.prefixCls,Ae=he.forceRender,me=he.className,te=he.style,ce=he.id,re=he.active,ve=he.animated,ye=he.destroyInactiveTabPane,Ie=he.tabKey,Se=he.children,Ue=D.useState(Ae),Ye=Object(W.a)(Ue,2),pt=Ye[0],ft=Ye[1];D.useEffect(function(){re?ft(!0):ye&&ft(!1)},[re,ye]);var Ot={};return re||(ve?(Ot.visibility="hidden",Ot.height=0,Ot.overflowY="hidden"):Ot.display="none"),D.createElement("div",{id:ce&&"".concat(ce,"-panel-").concat(Ie),role:"tabpanel",tabIndex:re?0:-1,"aria-labelledby":ce&&"".concat(ce,"-tab-").concat(Ie),"aria-hidden":!re,style:Object(X.a)(Object(X.a)({},Ot),te),className:G()("".concat(we,"-tabpane"),re&&"".concat(we,"-tabpane-active"),me)},(re||pt||Ae)&&Se)}var Ka=0;function bo(he){return Object(j.a)(he).map(function(we){if(D.isValidElement(we)){var Ae=we.key!==void 0?String(we.key):void 0;return Object(X.a)(Object(X.a)({key:Ae},we.props),{},{node:we})}return null}).filter(function(we){return we})}function Vo(he,we){var Ae,me=he.id,te=he.prefixCls,ce=te===void 0?"rc-tabs":te,re=he.className,ve=he.children,ye=he.direction,Ie=he.activeKey,Se=he.defaultActiveKey,Ue=he.editable,Ye=he.animated,pt=he.tabPosition,ft=pt===void 0?"top":pt,Ot=he.tabBarGutter,cn=he.tabBarStyle,xn=he.tabBarExtraContent,vn=he.locale,_n=he.moreIcon,Tn=he.moreTransitionName,En=he.destroyInactiveTabPane,bn=he.renderTabBar,Un=he.onChange,On=he.onTabClick,vi=he.onTabScroll,Rn=Object(k.a)(he,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),an=bo(ve),qt=ye==="rtl",In;Ye===!1?In={inkBar:!1,tabPane:!1}:In=Object(X.a)({inkBar:!0,tabPane:!1},Ye!==!0?Ye:null);var Bn=Object(D.useState)(!1),Xt=Object(W.a)(Bn,2),Hn=Xt[0],yi=Xt[1];Object(D.useEffect)(function(){yi(vo())},[]);var zn=Object(P.a)(function(){var ri;return(ri=an[0])===null||ri===void 0?void 0:ri.key},{value:Ie,defaultValue:Se}),oi=Object(W.a)(zn,2),ii=oi[0],Ri=oi[1],Bi=Object(D.useState)(function(){return an.findIndex(function(ri){return ri.key===ii})}),bi=Object(W.a)(Bi,2),$i=bi[0],br=bi[1];Object(D.useEffect)(function(){var ri=an.findIndex(function(Nr){return Nr.key===ii});if(ri===-1){var Cr;ri=Math.max(0,Math.min($i,an.length-1)),Ri((Cr=an[ri])===null||Cr===void 0?void 0:Cr.key)}br(ri)},[an.map(function(ri){return ri.key}).join("_"),ii,$i]);var ar=Object(P.a)(null,{value:me}),Fi=Object(W.a)(ar,2),di=Fi[0],si=Fi[1],Ei=ft;Hn&&!["left","right"].includes(ft)&&(Ei="top"),Object(D.useEffect)(function(){me||(si("rc-tabs-".concat(Ka)),Ka+=1)},[]);function _i(ri,Cr){On==null||On(ri,Cr),Ri(ri),Un==null||Un(ri)}var Er={id:di,activeKey:ii,animated:In,tabPosition:Ei,rtl:qt,mobile:Hn},kr,Pr=Object(X.a)(Object(X.a)({},Er),{},{editable:Ue,locale:vn,moreIcon:_n,moreTransitionName:Tn,tabBarGutter:Ot,onTabClick:_i,onTabScroll:vi,extra:xn,style:cn,panes:ve});return bn?kr=bn(Pr,Wa):kr=D.createElement(Wa,Object.assign({},Pr)),D.createElement(Fa.Provider,{value:{tabs:an,prefixCls:ce}},D.createElement("div",Object.assign({ref:we,id:me,className:G()(ce,"".concat(ce,"-").concat(Ei),(Ae={},Object(se.a)(Ae,"".concat(ce,"-mobile"),Hn),Object(se.a)(Ae,"".concat(ce,"-editable"),Ue),Object(se.a)(Ae,"".concat(ce,"-rtl"),qt),Ae),re)},Rn),kr,D.createElement(zo,Object.assign({destroyInactiveTabPane:En},Er,{animated:In}))))}var ea=D.forwardRef(Vo);ea.TabPane=_o;var Rr=ea,Ga=$e.b=Rr},kSUc:function(ct,$e,Q){},kqOp:function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return I});var se=Q("0Owb"),W=Q("fWQN"),k=Q("mtLc"),X=Q("yKVA"),D=Q("879j"),B=Q("q1tI"),G=Q.n(B),j=Q("Ot1p"),P="\u2581",I=function(y){Object(X.a)(p,y);var m=Object(D.a)(p);function p(){var c;Object(W.a)(this,p);for(var u=arguments.length,f=new Array(u),s=0;s<u;s++)f[s]=arguments[s];return c=m.call.apply(m,[this].concat(f)),c.getChCountBeforeCursor=function(r,a){for(var d=a.line,L=0,S=0;S<d;S++)L+=r.getLine(S).split(P).length-1;var x=r.getLine(d).substring(0,a.ch);return L+=x.split(P).length-1,L},c.onCMBeforeChange=function(r,a){var d=r.getRange(a.from,a.to),L=0;if(a.text.forEach(function(O){L+=O.split(P).length-1}),d&&d.indexOf(P)!=-1){var S=d.split(P).length-1,x=c.getChCountBeforeCursor(r,a.from);console.log("\u5220\u9664".concat(S,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(x,"\u4E2A\uFF0C\u65B0\u589E").concat(L,"\u4E2A")),c.props.deleteEmptyDisabled?a.cancel():c.props.onPlaceholderChange&&c.props.onPlaceholderChange(x,S,L)}else if(L){var R=c.getChCountBeforeCursor(r,a.from);console.log("\u65B0\u589E".concat(L,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(R,"\u4E2A")),c.props.onPlaceholderChange&&c.props.onPlaceholderChange(R,0,L)}},c}return Object(k.a)(p,[{key:"render",value:function(){return G.a.createElement(j.a,Object(se.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),p}(B.Component)},lZu9:function(ct,$e,Q){(function(se){se(Q("VrN/"),Q("1eCo"),Q("8EBN"))})(function(se){"use strict";se.defineMode("markdown",function(W,k){var X=se.getMode(W,"text/html"),D=X.name=="null";function B(U){if(se.findModeByName){var A=se.findModeByName(U);A&&(U=A.mime||A.mimes[0])}var J=se.getMode(W,U);return J.name=="null"?null:J}k.highlightFormatting===void 0&&(k.highlightFormatting=!1),k.maxBlockquoteDepth===void 0&&(k.maxBlockquoteDepth=0),k.taskLists===void 0&&(k.taskLists=!1),k.strikethrough===void 0&&(k.strikethrough=!1),k.emoji===void 0&&(k.emoji=!1),k.fencedCodeBlockHighlighting===void 0&&(k.fencedCodeBlockHighlighting=!0),k.fencedCodeBlockDefaultMode===void 0&&(k.fencedCodeBlockDefaultMode="text/plain"),k.xml===void 0&&(k.xml=!0),k.tokenTypeOverrides===void 0&&(k.tokenTypeOverrides={});var G={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var j in G)G.hasOwnProperty(j)&&k.tokenTypeOverrides[j]&&(G[j]=k.tokenTypeOverrides[j]);var P=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,m=k.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,u=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,s=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,r=" ";function a(U,A,J){return A.f=A.inline=J,J(U,A)}function d(U,A,J){return A.f=A.block=J,J(U,A)}function L(U){return!U||!/\S/.test(U.string)}function S(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==R){var A=D;if(!A){var J=se.innerMode(X,U.htmlState);A=J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText}A&&(U.f=b,U.block=x,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function x(U,A){var J=U.column()===A.indentation,ne=L(A.prevLine.stream),oe=A.indentedCode,fe=A.prevLine.hr,ke=A.list!==!1,Oe=(A.listStack[A.listStack.length-1]||0)+3;A.indentedCode=!1;var Me=A.indentation;if(A.indentationDiff===null&&(A.indentationDiff=A.indentation,ke)){for(A.list=null;Me<A.listStack[A.listStack.length-1];)A.listStack.pop(),A.listStack.length?A.indentation=A.listStack[A.listStack.length-1]:A.list=!1;A.list!==!1&&(A.indentationDiff=Me-A.listStack[A.listStack.length-1])}var Be=!ne&&!fe&&!A.prevLine.header&&(!ke||!oe)&&!A.prevLine.fencedCodeEnd,Pe=(A.list===!1||fe||ne)&&A.indentation<=Oe&&U.match(P),be=null;if(A.indentationDiff>=4&&(oe||A.prevLine.fencedCodeEnd||A.prevLine.header||ne))return U.skipToEnd(),A.indentedCode=!0,G.code;if(U.eatSpace())return null;if(J&&A.indentation<=Oe&&(be=U.match(m))&&be[1].length<=6)return A.quote=0,A.header=be[1].length,A.thisLine.header=!0,k.highlightFormatting&&(A.formatting="header"),A.f=A.inline,w(A);if(A.indentation<=Oe&&U.eat(">"))return A.quote=J?1:A.quote+1,k.highlightFormatting&&(A.formatting="quote"),U.eatSpace(),w(A);if(!Pe&&!A.setext&&J&&A.indentation<=Oe&&(be=U.match(I))){var le=be[1]?"ol":"ul";return A.indentation=Me+U.current().length,A.list=!0,A.quote=0,A.listStack.push(A.indentation),A.em=!1,A.strong=!1,A.code=!1,A.strikethrough=!1,k.taskLists&&U.match(y,!1)&&(A.taskList=!0),A.f=A.inline,k.highlightFormatting&&(A.formatting=["list","list-"+le]),w(A)}else{if(J&&A.indentation<=Oe&&(be=U.match(u,!0)))return A.quote=0,A.fencedEndRE=new RegExp(be[1]+"+ *$"),A.localMode=k.fencedCodeBlockHighlighting&&B(be[2]||k.fencedCodeBlockDefaultMode),A.localMode&&(A.localState=se.startState(A.localMode)),A.f=A.block=O,k.highlightFormatting&&(A.formatting="code-block"),A.code=-1,w(A);if(A.setext||(!Be||!ke)&&!A.quote&&A.list===!1&&!A.code&&!Pe&&!f.test(U.string)&&(be=U.lookAhead(1))&&(be=be.match(p)))return A.setext?(A.header=A.setext,A.setext=0,U.skipToEnd(),k.highlightFormatting&&(A.formatting="header")):(A.header=be[0].charAt(0)=="="?1:2,A.setext=A.header),A.thisLine.header=!0,A.f=A.inline,w(A);if(Pe)return U.skipToEnd(),A.hr=!0,A.thisLine.hr=!0,G.hr;if(U.peek()==="[")return a(U,A,T)}return a(U,A,A.inline)}function R(U,A){var J=X.token(U,A.htmlState);if(!D){var ne=se.innerMode(X,A.htmlState);(ne.mode.name=="xml"&&ne.state.tagStart===null&&!ne.state.context&&ne.state.tokenize.isInText||A.md_inside&&U.current().indexOf(">")>-1)&&(A.f=b,A.block=x,A.htmlState=null)}return J}function O(U,A){var J=A.listStack[A.listStack.length-1]||0,ne=A.indentation<J,oe=J+3;if(A.fencedEndRE&&A.indentation<=oe&&(ne||U.match(A.fencedEndRE))){k.highlightFormatting&&(A.formatting="code-block");var fe;return ne||(fe=w(A)),A.localMode=A.localState=null,A.block=x,A.f=b,A.fencedEndRE=null,A.code=0,A.thisLine.fencedCodeEnd=!0,ne?d(U,A,A.block):fe}else return A.localMode?A.localMode.token(U,A.localState):(U.skipToEnd(),G.code)}function w(U){var A=[];if(U.formatting){A.push(G.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var J=0;J<U.formatting.length;J++)A.push(G.formatting+"-"+U.formatting[J]),U.formatting[J]==="header"&&A.push(G.formatting+"-"+U.formatting[J]+"-"+U.header),U.formatting[J]==="quote"&&(!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=U.quote?A.push(G.formatting+"-"+U.formatting[J]+"-"+U.quote):A.push("error"))}if(U.taskOpen)return A.push("meta"),A.length?A.join(" "):null;if(U.taskClosed)return A.push("property"),A.length?A.join(" "):null;if(U.linkHref?A.push(G.linkHref,"url"):(U.strong&&A.push(G.strong),U.em&&A.push(G.em),U.strikethrough&&A.push(G.strikethrough),U.emoji&&A.push(G.emoji),U.linkText&&A.push(G.linkText),U.code&&A.push(G.code),U.image&&A.push(G.image),U.imageAltText&&A.push(G.imageAltText,"link"),U.imageMarker&&A.push(G.imageMarker)),U.header&&A.push(G.header,G.header+"-"+U.header),U.quote&&(A.push(G.quote),!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=U.quote?A.push(G.quote+"-"+U.quote):A.push(G.quote+"-"+k.maxBlockquoteDepth)),U.list!==!1){var ne=(U.listStack.length-1)%3;ne?ne===1?A.push(G.list2):A.push(G.list3):A.push(G.list1)}return U.trailingSpaceNewLine?A.push("trailing-space-new-line"):U.trailingSpace&&A.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),A.length?A.join(" "):null}function E(U,A){return U.match(c,!0)?w(A):void 0}function b(U,A){var J=A.text(U,A);if(typeof J!="undefined")return J;if(A.list)return A.list=null,w(A);if(A.taskList){var ne=U.match(y,!0)[1]===" ";return ne?A.taskOpen=!0:A.taskClosed=!0,k.highlightFormatting&&(A.formatting="task"),A.taskList=!1,w(A)}if(A.taskOpen=!1,A.taskClosed=!1,A.header&&U.match(/^#+$/,!0))return k.highlightFormatting&&(A.formatting="header"),w(A);var oe=U.next();if(A.linkTitle){A.linkTitle=!1;var fe=oe;oe==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ke="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(U.match(new RegExp(ke),!0))return G.linkHref}if(oe==="`"){var Oe=A.formatting;k.highlightFormatting&&(A.formatting="code"),U.eatWhile("`");var Me=U.current().length;if(A.code==0&&(!A.quote||Me==1))return A.code=Me,w(A);if(Me==A.code){var Be=w(A);return A.code=0,Be}else return A.formatting=Oe,w(A)}else if(A.code)return w(A);if(oe==="\\"&&(U.next(),k.highlightFormatting)){var Pe=w(A),be=G.formatting+"-escape";return Pe?Pe+" "+be:be}if(oe==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return A.imageMarker=!0,A.image=!0,k.highlightFormatting&&(A.formatting="image"),w(A);if(oe==="["&&A.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return A.imageMarker=!1,A.imageAltText=!0,k.highlightFormatting&&(A.formatting="image"),w(A);if(oe==="]"&&A.imageAltText){k.highlightFormatting&&(A.formatting="image");var Pe=w(A);return A.imageAltText=!1,A.image=!1,A.inline=A.f=_,Pe}if(oe==="["&&!A.image)return A.linkText&&U.match(/^.*?\]/)||(A.linkText=!0,k.highlightFormatting&&(A.formatting="link")),w(A);if(oe==="]"&&A.linkText){k.highlightFormatting&&(A.formatting="link");var Pe=w(A);return A.linkText=!1,A.inline=A.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?_:b,Pe}if(oe==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){A.f=A.inline=l,k.highlightFormatting&&(A.formatting="link");var Pe=w(A);return Pe?Pe+=" ":Pe="",Pe+G.linkInline}if(oe==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){A.f=A.inline=l,k.highlightFormatting&&(A.formatting="link");var Pe=w(A);return Pe?Pe+=" ":Pe="",Pe+G.linkEmail}if(k.xml&&oe==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var le=U.string.indexOf(">",U.pos);if(le!=-1){var Le=U.string.substring(U.start,le);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Le)&&(A.md_inside=!0)}return U.backUp(1),A.htmlState=se.startState(X),d(U,A,R)}if(k.xml&&oe==="<"&&U.match(/^\/\w*?>/))return A.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var tt=1,nt=U.pos==1?" ":U.string.charAt(U.pos-2);tt<3&&U.eat(oe);)tt++;var lt=U.peek()||" ",Et=!/\s/.test(lt)&&(!s.test(lt)||/\s/.test(nt)||s.test(nt)),Ve=!/\s/.test(nt)&&(!s.test(nt)||/\s/.test(lt)||s.test(lt)),Qe=null,ut=null;if(tt%2&&(!A.em&&Et&&(oe==="*"||!Ve||s.test(nt))?Qe=!0:A.em==oe&&Ve&&(oe==="*"||!Et||s.test(lt))&&(Qe=!1)),tt>1&&(!A.strong&&Et&&(oe==="*"||!Ve||s.test(nt))?ut=!0:A.strong==oe&&Ve&&(oe==="*"||!Et||s.test(lt))&&(ut=!1)),ut!=null||Qe!=null){k.highlightFormatting&&(A.formatting=Qe==null?"strong":ut==null?"em":"strong em"),Qe===!0&&(A.em=oe),ut===!0&&(A.strong=oe);var Be=w(A);return Qe===!1&&(A.em=!1),ut===!1&&(A.strong=!1),Be}}else if(oe===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return w(A);U.backUp(1)}if(k.strikethrough){if(oe==="~"&&U.eatWhile(oe)){if(A.strikethrough){k.highlightFormatting&&(A.formatting="strikethrough");var Be=w(A);return A.strikethrough=!1,Be}else if(U.match(/^[^\s]/,!1))return A.strikethrough=!0,k.highlightFormatting&&(A.formatting="strikethrough"),w(A)}else if(oe===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return w(A);U.backUp(2)}}if(k.emoji&&oe===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){A.emoji=!0,k.highlightFormatting&&(A.formatting="emoji");var gt=w(A);return A.emoji=!1,gt}return oe===" "&&(U.match(/^ +$/,!1)?A.trailingSpace++:A.trailingSpace&&(A.trailingSpaceNewLine=!0)),w(A)}function l(U,A){var J=U.next();if(J===">"){A.f=A.inline=b,k.highlightFormatting&&(A.formatting="link");var ne=w(A);return ne?ne+=" ":ne="",ne+G.linkInline}return U.match(/^[^>]+/,!0),G.linkInline}function _(U,A){if(U.eatSpace())return null;var J=U.next();return J==="("||J==="["?(A.f=A.inline=g(J==="("?")":"]"),k.highlightFormatting&&(A.formatting="link-string"),A.linkHref=!0,w(A)):"error"}var h={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function g(U){return function(A,J){var ne=A.next();if(ne===U){J.f=J.inline=b,k.highlightFormatting&&(J.formatting="link-string");var oe=w(J);return J.linkHref=!1,oe}return A.match(h[U]),J.linkHref=!0,w(J)}}function T(U,A){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(A.f=N,U.next(),k.highlightFormatting&&(A.formatting="link"),A.linkText=!0,w(A)):a(U,A,b)}function N(U,A){if(U.match(/^\]:/,!0)){A.f=A.inline=V,k.highlightFormatting&&(A.formatting="link");var J=w(A);return A.linkText=!1,J}return U.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function V(U,A){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?A.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),A.f=A.inline=b,G.linkHref+" url")}var Y={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:b,text:E,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&se.copyState(X,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?se.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,A){if(A.formatting=!1,U!=A.thisLine.stream){if(A.header=0,A.hr=!1,U.match(/^\s*$/,!0))return S(A),null;if(A.prevLine=A.thisLine,A.thisLine={stream:U},A.taskList=!1,A.trailingSpace=0,A.trailingSpaceNewLine=!1,!A.localState&&(A.f=A.block,A.f!=R)){var J=U.match(/^\s*/,!0)[0].replace(/\t/g,r).length;if(A.indentation=J,A.indentationDiff=null,J>0)return null}}return A.f(U,A)},innerMode:function(U){return U.block==R?{state:U.htmlState,mode:X}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:Y}},indent:function(U,A,J){return U.block==R&&X.indent?X.indent(U.htmlState,A,J):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,A,J):se.Pass},blankLine:S,getType:w,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Y},"xml"),se.defineMIME("text/markdown","markdown"),se.defineMIME("text/x-markdown","markdown")})},osHv:function(ct,$e,Q){(function(se){se(Q("VrN/"))})(function(se){"use strict";var W=se.Pos;function k(s,r){return s.line-r.line||s.ch-r.ch}var X="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",D=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",B=new RegExp("<(/?)(["+X+"]["+D+"]*)","g");function G(s,r,a,d){this.line=r,this.ch=a,this.cm=s,this.text=s.getLine(r),this.min=d?Math.max(d.from,s.firstLine()):s.firstLine(),this.max=d?Math.min(d.to-1,s.lastLine()):s.lastLine()}function j(s,r){var a=s.cm.getTokenTypeAt(W(s.line,r));return a&&/\btag\b/.test(a)}function P(s){return s.line>=s.max?void 0:(s.ch=0,s.text=s.cm.getLine(++s.line),!0)}function I(s){return s.line<=s.min?void 0:(s.text=s.cm.getLine(--s.line),s.ch=s.text.length,!0)}function y(s){for(;;){var r=s.text.indexOf(">",s.ch);if(r==-1){if(P(s))continue;return}if(!j(s,r+1)){s.ch=r+1;continue}var a=s.text.lastIndexOf("/",r),d=a>-1&&!/\S/.test(s.text.slice(a+1,r));return s.ch=r+1,d?"selfClose":"regular"}}function m(s){for(;;){var r=s.ch?s.text.lastIndexOf("<",s.ch-1):-1;if(r==-1){if(I(s))continue;return}if(!j(s,r+1)){s.ch=r;continue}B.lastIndex=r,s.ch=r;var a=B.exec(s.text);if(a&&a.index==r)return a}}function p(s){for(;;){B.lastIndex=s.ch;var r=B.exec(s.text);if(!r){if(P(s))continue;return}if(!j(s,r.index+1)){s.ch=r.index+1;continue}return s.ch=r.index+r[0].length,r}}function c(s){for(;;){var r=s.ch?s.text.lastIndexOf(">",s.ch-1):-1;if(r==-1){if(I(s))continue;return}if(!j(s,r+1)){s.ch=r;continue}var a=s.text.lastIndexOf("/",r),d=a>-1&&!/\S/.test(s.text.slice(a+1,r));return s.ch=r+1,d?"selfClose":"regular"}}function u(s,r){for(var a=[];;){var d=p(s),L,S=s.line,x=s.ch-(d?d[0].length:0);if(!d||!(L=y(s)))return;if(L=="selfClose")continue;if(d[1]){for(var R=a.length-1;R>=0;--R)if(a[R]==d[2]){a.length=R;break}if(R<0&&(!r||r==d[2]))return{tag:d[2],from:W(S,x),to:W(s.line,s.ch)}}else a.push(d[2])}}function f(s,r){for(var a=[];;){var d=c(s);if(!d)return;if(d=="selfClose"){m(s);continue}var L=s.line,S=s.ch,x=m(s);if(!x)return;if(x[1])a.push(x[2]);else{for(var R=a.length-1;R>=0;--R)if(a[R]==x[2]){a.length=R;break}if(R<0&&(!r||r==x[2]))return{tag:x[2],from:W(s.line,s.ch),to:W(L,S)}}}}se.registerHelper("fold","xml",function(s,r){for(var a=new G(s,r.line,0);;){var d=p(a);if(!d||a.line!=r.line)return;var L=y(a);if(!L)return;if(!d[1]&&L!="selfClose"){var S=W(a.line,a.ch),x=u(a,d[2]);return x&&k(x.from,S)>0?{from:S,to:x.from}:null}}}),se.findMatchingTag=function(s,r,a){var d=new G(s,r.line,r.ch,a);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var L=y(d),S=L&&W(d.line,d.ch),x=L&&m(d);if(!L||!x||k(d,r)>0)return;var R={from:W(d.line,d.ch),to:S,tag:x[2]};return L=="selfClose"?{open:R,close:null,at:"open"}:x[1]?{open:f(d,x[2]),close:R,at:"close"}:(d=new G(s,S.line,S.ch,a),{open:R,close:u(d,x[2]),at:"open"})},se.findEnclosingTag=function(s,r,a,d){for(var L=new G(s,r.line,r.ch,a);;){var S=f(L,d);if(!S)break;var x=new G(s,r.line,r.ch,a),R=u(x,S.tag);if(R)return{open:S,close:R}}},se.scanForClosingTag=function(s,r,a,d){var L=new G(s,r.line,r.ch,d?{from:0,to:d}:null);return u(L,a)}})},p5ED:function(ct,$e,Q){"use strict";var se=Q("+L6B"),W=Q("2/Rp"),k=Q("5Dmo"),X=Q("3S7+"),D=Q("k1fw"),B=Q("tJVT"),G=Q("q1tI"),j=Q.n(G),P=Q("vHTk"),I=Q.n(P),y=Q("yEEn"),m=Q("ZW9T"),p=Q("1vsH");$e.a=function(c){var u=c.name,f=c.data,s=c.theme,r=c.type,a=c.filename,d=c.monacoEditor,L=c.className,S=c.style,x=c.close,R=c.onClose,O=c.hasMask,w=Object(G.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),E=Object(B.a)(w,2),b=E[0],l=E[1],_=Object(G.useState)(""),h=Object(B.a)(_,2),g=h[0],T=h[1],N,V=1024*1024,Y=10*V,U=Object(G.useRef)();r==="office"&&(N=Object(p.T)(f).filesize,N>Y&&(r="other")),a&&(d.filename=a),Object(G.useEffect)(function(){var ne,oe,fe=(ne=document.cookie)===null||ne===void 0||((oe=ne.replace(/\s/g,""))===null||oe===void 0)?void 0:oe.split(";");fe==null||fe.map(function(ke){var Oe=ke.split("=");Oe[0]==="_educoder_session"&&T(Oe[1])})},[]);var A=function(){if(f.startsWith("http")||f.startsWith("/")){J();return}Object(p.z)(a||"educoder",f,a)},J=function(){Object(p.x)(a||u,f)};return console.log("data:",f,"fileanme:",a," name:",u),j.a.createElement("div",{style:Object(D.a)({},S||{}),className:"".concat(O&&I.a.bgBlack," ").concat(r?I.a.wrp:"hide")},x&&j.a.createElement("div",{className:I.a.close,ref:U},j.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},j.a.createElement("span",{onClick:J},j.a.createElement("i",{className:"icon-quxiaozhiding"}))),j.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},j.a.createElement("span",{className:"",onClick:R},j.a.createElement("i",{className:"icon-guanbi1"})))),j.a.createElement("div",{className:"".concat(I.a[L]," ").concat(L," ").concat(I.a.monaco," ").concat(r==="txt"?"show":"hide")},r==="txt"&&j.a.createElement(m.b,d)),r==="audio"&&j.a.createElement("audio",{src:"".concat(f!=null&&f.startsWith("/")||(f==null?void 0:f.indexOf("https://"))>-1?f:"data:audio/mp3;base64,").concat(f),autoPlay:!0}),r==="video"&&j.a.createElement(j.a.Fragment,null,f!=null&&f.startsWith("/")?j.a.createElement("video",{controls:!0,src:"".concat(f),autoPlay:!0}):j.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(f),autoPlay:!0})),r==="html"&&j.a.createElement("iframe",{src:f+"&disposition=inline"}),r==="pdf"&&j.a.createElement("embed",{className:I.a.embed,src:f}),r==="image"&&j.a.createElement(j.a.Fragment,null,j.a.createElement("img",{src:"".concat(f!=null&&f.startsWith("/")||(f==null?void 0:f.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(f)})),r==="other"&&j.a.createElement("div",null,j.a.createElement(W.a,{type:"primary",size:"large",onClick:A},j.a.createElement(y.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(r==="download"||r==="office")&&j.a.createElement(W.a,{type:"primary",size:"large",onClick:A},j.a.createElement(y.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ct,$e,Q){},psGv:function(ct,$e,Q){var se,W;(function(){var k;(function(){"use strict";var G=[,,function(y){function m(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}m.prototype.clone_empty=function(){var u=new m(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},m.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},m.prototype.has_match=function(u){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(u))return!0;return!1},m.prototype.set_indent=function(u,f){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},m.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(u){this.__items.push(u);var f=u.lastIndexOf(`
|
|
`);f!==-1?this.__character_count=u.length-f:this.__character_count+=u.length},m.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function p(u,f){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),f=f||"",u.indent_level>0&&(f=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}p.prototype.get_indent_size=function(u,f){var s=this.__base_string_length;return f=f||0,u<0&&(s=0),s+=u*this.__indent_size,s+=f,s},p.prototype.get_indent_string=function(u,f){var s=this.__base_string;return f=f||0,u<0&&(u=0,s=""),f+=u*this.__indent_size,this.__ensure_cache(f),s+=this.__cache[f],s},p.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var u=this.__cache.length,f=0,s="";this.__indent_size&&u>=this.__indent_size&&(f=Math.floor(u/this.__indent_size),u-=f*this.__indent_size,s=new Array(f+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function c(u,f){this.__indent_cache=new p(u,f),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(u,f){return this.__indent_cache.get_indent_string(u,f)},c.prototype.get_indent_size=function(u,f){return this.__indent_cache.get_indent_size(u,f)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(u){this.trim(!0);var f=this.current_line.pop();f&&(f[f.length-1]===`
|
|
`&&(f=f.replace(/\n+$/g,"")),this.current_line.push(f)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return u!==`
|
|
`&&(s=s.replace(/[\n]/g,u)),s},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(u,f){return u=u||0,f=f||0,this.next_line.set_indent(u,f),this.__lines.length>1?(this.current_line.set_indent(u,f),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(u){for(var f=0;f<u.newlines;f++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},c.prototype.remove_indent=function(u){for(var f=this.__lines.length;u<f;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(u,f){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(u)!==0&&r.item(-1)!==f){this.__lines.splice(s+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},y.exports.Output=c},function(y){function m(p,c,u,f){this.type=p,this.text=c,this.comments_before=null,this.newlines=u||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}y.exports.Token=m},,,function(y){function m(u,f){this.raw_options=p(u,f),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(u,f){var s=this.raw_options[u],r=f||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},m.prototype._get_boolean=function(u,f){var s=this.raw_options[u],r=s===void 0?!!f:!!s;return r},m.prototype._get_characters=function(u,f){var s=this.raw_options[u],r=f||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),r},m.prototype._get_number=function(u,f){var s=this.raw_options[u];f=parseInt(f,10),isNaN(f)&&(f=0);var r=parseInt(s,10);return isNaN(r)&&(r=f),r},m.prototype._get_selection=function(u,f,s){var r=this._get_selection_list(u,f,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[u]+"'");return r[0]},m.prototype._get_selection_list=function(u,f,s){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[f[0]],!this._is_valid_selection(s,f))throw new Error("Invalid Default Value!");var r=this._get_array(u,s);if(!this._is_valid_selection(r,f))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
|
|
`+f+`
|
|
You passed in: '`+this.raw_options[u]+"'");return r},m.prototype._is_valid_selection=function(u,f){return u.length&&f.length&&!u.some(function(s){return f.indexOf(s)===-1})};function p(u,f){var s={};u=c(u);var r;for(r in u)r!==f&&(s[r]=u[r]);if(f&&u[f])for(r in u[f])s[r]=u[f][r];return s}function c(u){var f={},s;for(s in u){var r=s.replace(/-/g,"_");f[r]=u[s]}return f}y.exports.Options=m,y.exports.normalizeOpts=c,y.exports.mergeOpts=p},,function(y){var m=RegExp.prototype.hasOwnProperty("sticky");function p(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},p.prototype.peek=function(c){var u=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(u=this.__input.charAt(c)),u},p.prototype.__match=function(c,u){c.lastIndex=u;var f=c.exec(this.__input);return f&&!(m&&c.sticky)&&(f.index!==u&&(f=null)),f},p.prototype.test=function(c,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(c,u):!1},p.prototype.testChar=function(c,u){var f=this.peek(u);return c.lastIndex=0,f!==null&&c.test(f)},p.prototype.match=function(c){var u=this.__match(c,this.__position);return u?this.__position+=u[0].length:u=null,u},p.prototype.read=function(c,u,f){var s="",r;return c&&(r=this.match(c),r&&(s+=r[0])),u&&(r||!c)&&(s+=this.readUntil(u,f)),s},p.prototype.readUntil=function(c,u){var f="",s=this.__position;c.lastIndex=this.__position;var r=c.exec(this.__input);return r?(s=r.index,u&&(s+=r[0].length)):s=this.__input_length,f=this.__input.substring(this.__position,s),this.__position=s,f},p.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},p.prototype.get_regexp=function(c,u){var f=null,s="g";return u&&m&&(s="y"),typeof c=="string"&&c!==""?f=new RegExp(c,s):c&&(f=new RegExp(c.source,s)),f},p.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(c){var u=this.__position,f=this.readUntilAfter(c);return this.__position=u,f},p.prototype.lookBack=function(c){var u=this.__position-1;return u>=c.length&&this.__input.substring(u-c.length,u).toLowerCase()===c},y.exports.InputScanner=p},function(y,m,p){var c=p(8).InputScanner,u=p(3).Token,f=p(10).TokenStream,s=p(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(d,L){this._input=new c(d),this._options=L||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var d,L=new u(r.START,""),S=null,x=[],R=new f;L.type!==r.EOF;){for(d=this._get_next_token(L,S);this._is_comment(d);)R.add(d),d=this._get_next_token(L,S);R.isEmpty()||(d.comments_before=R,R=new f),d.parent=S,this._is_opening(d)?(x.push(S),S=d):S&&this._is_closing(d,S)&&(d.opened=S,S.closed=d,S=x.pop(),d.parent=S),d.previous=L,L.next=d,this.__tokens.add(d),L=d}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(d,L){this._readWhitespace();var S=this._input.read(/.+/g);return S?this._create_token(r.RAW,S):this._create_token(r.EOF,"")},a.prototype._is_comment=function(d){return!1},a.prototype._is_opening=function(d){return!1},a.prototype._is_closing=function(d,L){return!1},a.prototype._create_token=function(d,L){var S=new u(d,L,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return S},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},y.exports.Tokenizer=a,y.exports.TOKEN=r},function(y){function m(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},m.prototype.peek=function(p){var c=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(c=this.__tokens[p]),c},m.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},y.exports.TokenStream=m},function(y,m,p){var c=p(12).Pattern;function u(f,s){c.call(this,f,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new c,u.prototype.__set_whitespace_patterns=function(f,s){f+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+f+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},u.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var f=this._input.read(this._match_pattern);if(f===" ")this.whitespace_before_token=" ";else if(f){var s=this.__split(this._newline_regexp,f);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return f},u.prototype.matching=function(f,s){var r=this._create();return r.__set_whitespace_patterns(f,s),r._update(),r},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(f,s){f.lastIndex=0;for(var r=0,a=[],d=f.exec(s);d;)a.push(s.substring(r,d.index)),r=d.index+d[0].length,d=f.exec(s);return r<s.length?a.push(s.substring(r,s.length)):a.push(""),a},y.exports.WhitespacePattern=u},function(y){function m(p,c){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}m.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(p){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(p),c._update(),c},m.prototype.until=function(p){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(p),c._update(),c},m.prototype.starting_with=function(p){var c=this._create();return c._starting_pattern=this._input.get_regexp(p,!0),c._update(),c},m.prototype.matching=function(p){var c=this._create();return c._match_pattern=this._input.get_regexp(p,!0),c._update(),c},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},y.exports.Pattern=m},function(y){function m(p,c){p=typeof p=="string"?p:p.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+c,"g")}m.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(p);u;)c[u[1]]=u[2],u=this.__directive_pattern.exec(p);return c},m.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},y.exports.Directives=m},function(y,m,p){var c=p(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function f(s,r){c.call(this,s,r),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var a=new c(s);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}f.prototype=new c,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(s){var r=this._create();return r._disabled[s]=!0,r._update(),r},f.prototype.read_options=function(s){var r=this._create();for(var a in u)r._disabled[a]=s.templating.indexOf(a)===-1;return r._update(),r},f.prototype.exclude=function(s){var r=this._create();return r._excluded[s]=!0,r._update(),r},f.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),s+=r,r=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},f.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},f.prototype._read_template=function(){var s="",r=this._input.peek();if(r==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(s=s||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},y.exports.TemplatablePattern=f},,,,function(y,m,p){var c=p(19).Beautifier,u=p(20).Options;function f(s,r,a,d){var L=new c(s,r,a,d);return L.beautify()}y.exports=f,y.exports.defaultOptions=function(){return new u}},function(y,m,p){var c=p(20).Options,u=p(2).Output,f=p(21).Tokenizer,s=p(21).TOKEN,r=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,d=function(_,h){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=_.max_preserve_newlines,this.preserve_newlines=_.preserve_newlines,this._output=new u(_,h)};d.prototype.current_line_has_match=function(_){return this._output.current_line.has_match(_)},d.prototype.set_space_before_token=function(_,h){this._output.space_before_token=_,this._output.non_breaking_space=h},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(_){this._output.add_raw_token(_)},d.prototype.print_preserved_newlines=function(_){var h=0;_.type!==s.TEXT&&_.previous.type!==s.TEXT&&(h=_.newlines?1:0),this.preserve_newlines&&(h=_.newlines<this.max_preserve_newlines+1?_.newlines:this.max_preserve_newlines+1);for(var g=0;g<h;g++)this.print_newline(g>0);return h!==0},d.prototype.traverse_whitespace=function(_){return _.whitespace_before||_.newlines?(this.print_preserved_newlines(_)||(this._output.space_before_token=!0),!0):!1},d.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},d.prototype.print_newline=function(_){this._output.add_new_line(_)},d.prototype.print_token=function(_){_.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(_.text))},d.prototype.indent=function(){this.indent_level++},d.prototype.get_full_indent=function(_){return _=this.indent_level+(_||0),_<1?"":this._output.get_indent_string(_)};var L=function(_){for(var h=null,g=_.next;g.type!==s.EOF&&_.closed!==g;){if(g.type===s.ATTRIBUTE&&g.text==="type"){g.next&&g.next.type===s.EQUALS&&g.next.next&&g.next.next.type===s.VALUE&&(h=g.next.next.text);break}g=g.next}return h},S=function(_,h){var g=null,T=null;return h.closed?(_==="script"?g="text/javascript":_==="style"&&(g="text/css"),g=L(h)||g,g.search("text/css")>-1?T="css":g.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?T="javascript":g.search(/(text|application|dojo)\/(x-)?(html)/)>-1?T="html":g.search(/test\/null/)>-1&&(T="null"),T):null};function x(_,h){return h.indexOf(_)!==-1}function R(_,h,g){this.parent=_||null,this.tag=h?h.tag_name:"",this.indent_level=g||0,this.parser_token=h||null}function O(_){this._printer=_,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(_){var h=new R(this._current_frame,_,this._printer.indent_level);this._current_frame=h},O.prototype._try_pop_frame=function(_){var h=null;return _&&(h=_.parser_token,this._printer.indent_level=_.indent_level,this._current_frame=_.parent),h},O.prototype._get_frame=function(_,h){for(var g=this._current_frame;g&&!(_.indexOf(g.tag)!==-1);){if(h&&h.indexOf(g.tag)!==-1){g=null;break}g=g.parent}return g},O.prototype.try_pop=function(_,h){var g=this._get_frame([_],h);return this._try_pop_frame(g)},O.prototype.indent_to_tag=function(_){var h=this._get_frame(_);h&&(this._printer.indent_level=h.indent_level)};function w(_,h,g,T){this._source_text=_||"",h=h||{},this._js_beautify=g,this._css_beautify=T,this._tag_stack=null;var N=new c(h,"html");this._options=N,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,h=this._options.eol;this._options.eol==="auto"&&(h=`
|
|
`,_&&r.test(_)&&(h=_.match(r)[0])),_=_.replace(a,`
|
|
`);var g=_.match(/^[\t ]*/)[0],T={text:"",type:""},N=new E,V=new d(this._options,g),Y=new f(_,this._options).tokenize();this._tag_stack=new O(V);for(var U=null,A=Y.next();A.type!==s.EOF;)A.type===s.TAG_OPEN||A.type===s.COMMENT?(U=this._handle_tag_open(V,A,N,T),N=U):A.type===s.ATTRIBUTE||A.type===s.EQUALS||A.type===s.VALUE||A.type===s.TEXT&&!N.tag_complete?U=this._handle_inside_tag(V,A,N,Y):A.type===s.TAG_CLOSE?U=this._handle_tag_close(V,A,N):A.type===s.TEXT?U=this._handle_text(V,A,N):V.add_raw_token(A),T=U,A=Y.next();var J=V._output.get_code(h);return J},w.prototype._handle_tag_close=function(_,h,g){var T={text:h.text,type:h.type};return _.alignment_size=0,g.tag_complete=!0,_.set_space_before_token(h.newlines||h.whitespace_before!=="",!0),g.is_unformatted?_.add_raw_token(h):(g.tag_start_char==="<"&&(_.set_space_before_token(h.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&g.has_wrapped_attrs&&_.print_newline(!1)),_.print_token(h)),g.indent_content&&!(g.is_unformatted||g.is_content_unformatted)&&(_.indent(),g.indent_content=!1),!g.is_inline_element&&!(g.is_unformatted||g.is_content_unformatted)&&_.set_wrap_point(),T},w.prototype._handle_inside_tag=function(_,h,g,T){var N=g.has_wrapped_attrs,V={text:h.text,type:h.type};if(_.set_space_before_token(h.newlines||h.whitespace_before!=="",!0),g.is_unformatted)_.add_raw_token(h);else if(g.tag_start_char==="{"&&h.type===s.TEXT)_.print_preserved_newlines(h)?(h.newlines=0,_.add_raw_token(h)):_.print_token(h);else{if(h.type===s.ATTRIBUTE?(_.set_space_before_token(!0),g.attr_count+=1):(h.type===s.EQUALS||h.type===s.VALUE&&h.previous.type===s.EQUALS)&&_.set_space_before_token(!1),h.type===s.ATTRIBUTE&&g.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(_.traverse_whitespace(h),N=N||h.newlines!==0),this._is_wrap_attributes_force)){var Y=g.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&g.attr_count===1){var U=!0,A=0,J;do{if(J=T.peek(A),J.type===s.ATTRIBUTE){U=!1;break}A+=1}while(A<4&&J.type!==s.EOF&&J.type!==s.TAG_CLOSE);Y=!U}Y&&(_.print_newline(!1),N=!0)}_.print_token(h),N=N||_.previous_token_wrapped(),g.has_wrapped_attrs=N}return V},w.prototype._handle_text=function(_,h,g){var T={text:h.text,type:"TK_CONTENT"};return g.custom_beautifier_name?this._print_custom_beatifier_text(_,h,g):g.is_unformatted||g.is_content_unformatted?_.add_raw_token(h):(_.traverse_whitespace(h),_.print_token(h)),T},w.prototype._print_custom_beatifier_text=function(_,h,g){var T=this;if(h.text!==""){var N=h.text,V,Y=1,U="",A="";g.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?V=this._js_beautify:g.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?V=this._css_beautify:g.custom_beautifier_name==="html"&&(V=function(Oe,Me){var Be=new w(Oe,Me,T._js_beautify,T._css_beautify);return Be.beautify()}),this._options.indent_scripts==="keep"?Y=0:this._options.indent_scripts==="separate"&&(Y=-_.indent_level);var J=_.get_full_indent(Y);if(N=N.replace(/\n[ \t]*$/,""),g.custom_beautifier_name!=="html"&&N[0]==="<"&&N.match(/^(<!--|<!\[CDATA\[)/)){var ne=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(N);if(!ne){_.add_raw_token(h);return}U=J+ne[1]+`
|
|
`,N=ne[4],ne[5]&&(A=J+ne[5]),N=N.replace(/\n[ \t]*$/,""),(ne[2]||ne[3].indexOf(`
|
|
`)!==-1)&&(ne=ne[3].match(/[ \t]+$/),ne&&(h.whitespace_before=ne[0]))}if(N)if(V){var oe=function(){this.eol=`
|
|
`};oe.prototype=this._options.raw_options;var fe=new oe;N=V(J+N,fe)}else{var ke=h.whitespace_before;ke&&(N=N.replace(new RegExp(`
|
|
(`+ke+")?","g"),`
|
|
`)),N=J+N.replace(/\n/g,`
|
|
`+J)}U&&(N?N=U+N+`
|
|
`+A:N=U+A),_.print_newline(!1),N&&(h.text=N,h.whitespace_before="",h.newlines=0,_.add_raw_token(h),_.print_newline(!0))}},w.prototype._handle_tag_open=function(_,h,g,T){var N=this._get_tag_open_token(h);return(g.is_unformatted||g.is_content_unformatted)&&!g.is_empty_element&&h.type===s.TAG_OPEN&&h.text.indexOf("</")===0?(_.add_raw_token(h),N.start_tag_token=this._tag_stack.try_pop(N.tag_name)):(_.traverse_whitespace(h),this._set_tag_position(_,h,N,g,T),N.is_inline_element||_.set_wrap_point(),_.print_token(h)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(N.alignment_size=h.text.length+1),!N.tag_complete&&!N.is_unformatted&&(_.alignment_size=N.alignment_size),N};var E=function(_,h){if(this.parent=_||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!h)this.tag_complete=!0;else{var g;this.tag_start_char=h.text[0],this.text=h.text,this.tag_start_char==="<"?(g=h.text.match(/^<([^\s>]*)/),this.tag_check=g?g[1]:""):(g=h.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=g?g[1]:"",(h.text.startsWith("{{#>")||h.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&h.next!==null?this.tag_check=h.next.text.split(" ")[0]:this.tag_check=h.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),h.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||h.closed&&h.closed.text==="/>";var T=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(T=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(T)))}};w.prototype._get_tag_open_token=function(_){var h=new E(this._tag_stack.get_parser_token(),_);return h.alignment_size=this._options.wrap_attributes_indent_size,h.is_end_tag=h.is_end_tag||x(h.tag_check,this._options.void_elements),h.is_empty_element=h.tag_complete||h.is_start_tag&&h.is_end_tag,h.is_unformatted=!h.tag_complete&&x(h.tag_check,this._options.unformatted),h.is_content_unformatted=!h.is_empty_element&&x(h.tag_check,this._options.content_unformatted),h.is_inline_element=x(h.tag_name,this._options.inline)||h.tag_name.includes("-")||h.tag_start_char==="{",h},w.prototype._set_tag_position=function(_,h,g,T,N){if(g.is_empty_element||(g.is_end_tag?g.start_tag_token=this._tag_stack.try_pop(g.tag_name):(this._do_optional_end_element(g)&&(g.is_inline_element||_.print_newline(!1)),this._tag_stack.record_tag(g),(g.tag_name==="script"||g.tag_name==="style")&&!(g.is_unformatted||g.is_content_unformatted)&&(g.custom_beautifier_name=S(g.tag_check,h)))),x(g.tag_check,this._options.extra_liners)&&(_.print_newline(!1),_._output.just_added_blankline()||_.print_newline(!0)),g.is_empty_element){if(g.tag_start_char==="{"&&g.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),g.indent_content=!0;var V=_.current_line_has_match(/{{#if/);V||_.print_newline(!1)}g.tag_name==="!--"&&N.type===s.TAG_CLOSE&&T.is_end_tag&&g.text.indexOf(`
|
|
`)===-1||(g.is_inline_element||g.is_unformatted||_.print_newline(!1),this._calcluate_parent_multiline(_,g))}else if(g.is_end_tag){var Y=!1;Y=g.start_tag_token&&g.start_tag_token.multiline_content,Y=Y||!g.is_inline_element&&!(T.is_inline_element||T.is_unformatted)&&!(N.type===s.TAG_CLOSE&&g.start_tag_token===T)&&N.type!=="TK_CONTENT",(g.is_content_unformatted||g.is_unformatted)&&(Y=!1),Y&&_.print_newline(!1)}else g.indent_content=!g.custom_beautifier_name,g.tag_start_char==="<"&&(g.tag_name==="html"?g.indent_content=this._options.indent_inner_html:g.tag_name==="head"?g.indent_content=this._options.indent_head_inner_html:g.tag_name==="body"&&(g.indent_content=this._options.indent_body_inner_html)),!(g.is_inline_element||g.is_unformatted)&&(N.type!=="TK_CONTENT"||g.is_content_unformatted)&&_.print_newline(!1),this._calcluate_parent_multiline(_,g)},w.prototype._calcluate_parent_multiline=function(_,h){h.parent&&_._output.just_added_newline()&&!((h.is_inline_element||h.is_unformatted)&&h.parent.is_inline_element)&&(h.parent.multiline_content=!0)};var b=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],l=["a","audio","del","ins","map","noscript","video"];w.prototype._do_optional_end_element=function(_){var h=null;if(_.is_empty_element||!_.is_start_tag||!_.parent)return;if(_.tag_name==="body")h=h||this._tag_stack.try_pop("head");else if(_.tag_name==="li")h=h||this._tag_stack.try_pop("li",["ol","ul"]);else if(_.tag_name==="dd"||_.tag_name==="dt")h=h||this._tag_stack.try_pop("dt",["dl"]),h=h||this._tag_stack.try_pop("dd",["dl"]);else if(_.parent.tag_name==="p"&&b.indexOf(_.tag_name)!==-1){var g=_.parent.parent;(!g||l.indexOf(g.tag_name)===-1)&&(h=h||this._tag_stack.try_pop("p"))}else _.tag_name==="rp"||_.tag_name==="rt"?(h=h||this._tag_stack.try_pop("rt",["ruby","rtc"]),h=h||this._tag_stack.try_pop("rp",["ruby","rtc"])):_.tag_name==="optgroup"?h=h||this._tag_stack.try_pop("optgroup",["select"]):_.tag_name==="option"?h=h||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):_.tag_name==="colgroup"?h=h||this._tag_stack.try_pop("caption",["table"]):_.tag_name==="thead"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"])):_.tag_name==="tbody"||_.tag_name==="tfoot"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"]),h=h||this._tag_stack.try_pop("thead",["table"]),h=h||this._tag_stack.try_pop("tbody",["table"])):_.tag_name==="tr"?(h=h||this._tag_stack.try_pop("caption",["table"]),h=h||this._tag_stack.try_pop("colgroup",["table"]),h=h||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(_.tag_name==="th"||_.tag_name==="td")&&(h=h||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),h=h||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return _.parent=this._tag_stack.get_parser_token(),h},y.exports.Beautifier=w},function(y,m,p){var c=p(6).Options;function u(f){c.call(this,f,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}u.prototype=new c,y.exports.Options=u},function(y,m,p){var c=p(9).Tokenizer,u=p(9).TOKEN,f=p(13).Directives,s=p(14).TemplatablePattern,r=p(12).Pattern,a={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:u.START,RAW:u.RAW,EOF:u.EOF},d=new f(/<\!--/,/-->/),L=function(S,x){c.call(this,S,x),this._current_tag_name="";var R=new s(this._input).read_options(this._options),O=new r(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var w=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(w).until_after(w)}};L.prototype=new c,L.prototype._is_comment=function(S){return!1},L.prototype._is_opening=function(S){return S.type===a.TAG_OPEN},L.prototype._is_closing=function(S,x){return S.type===a.TAG_CLOSE&&x&&((S.text===">"||S.text==="/>")&&x.text[0]==="<"||S.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},L.prototype._reset=function(){this._current_tag_name=""},L.prototype._get_next_token=function(S,x){var R=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(a.EOF,""):(R=R||this._read_open_handlebars(O,x),R=R||this._read_attribute(O,S,x),R=R||this._read_close(O,x),R=R||this._read_raw_content(O,S,x),R=R||this._read_content_word(O),R=R||this._read_comment_or_cdata(O),R=R||this._read_processing(O),R=R||this._read_open(O,x),R=R||this._create_token(a.UNKNOWN,this._input.next()),R)},L.prototype._read_comment_or_cdata=function(S){var x=null,R=null,O=null;if(S==="<"){var w=this._input.peek(1);w==="!"&&(R=this.__patterns.comment.read(),R?(O=d.get_directives(R),O&&O.ignore==="start"&&(R+=d.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(x=this._create_token(a.COMMENT,R),x.directives=O)}return x},L.prototype._read_processing=function(S){var x=null,R=null,O=null;if(S==="<"){var w=this._input.peek(1);(w==="!"||w==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(x=this._create_token(a.COMMENT,R),x.directives=O)}return x},L.prototype._read_open=function(S,x){var R=null,O=null;return x||S==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),O=this._create_token(a.TAG_OPEN,R)),O},L.prototype._read_open_handlebars=function(S,x){var R=null,O=null;return x||this._options.indent_handlebars&&S==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),O=this._create_token(a.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),O=this._create_token(a.TAG_OPEN,R))),O},L.prototype._read_close=function(S,x){var R=null,O=null;return x&&(x.text[0]==="<"&&(S===">"||S==="/"&&this._input.peek(1)===">")?(R=this._input.next(),S==="/"&&(R+=this._input.next()),O=this._create_token(a.TAG_CLOSE,R)):x.text[0]==="{"&&S==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(a.TAG_CLOSE,"}}"))),O},L.prototype._read_attribute=function(S,x,R){var O=null,w="";if(R&&R.text[0]==="<")if(S==="=")O=this._create_token(a.EQUALS,this._input.next());else if(S==='"'||S==="'"){var E=this._input.next();S==='"'?E+=this.__patterns.double_quote.read():E+=this.__patterns.single_quote.read(),O=this._create_token(a.VALUE,E)}else w=this.__patterns.attribute.read(),w&&(x.type===a.EQUALS?O=this._create_token(a.VALUE,w):O=this._create_token(a.ATTRIBUTE,w));return O},L.prototype._is_content_unformatted=function(S){return this._options.void_elements.indexOf(S)===-1&&(this._options.content_unformatted.indexOf(S)!==-1||this._options.unformatted.indexOf(S)!==-1)},L.prototype._read_raw_content=function(S,x,R){var O="";if(R&&R.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(x.type===a.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var w=x.opened.text.substr(1).toLowerCase();if(w==="script"||w==="style"){var E=this._read_comment_or_cdata(S);if(E)return E.type=a.TEXT,E;O=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(w)&&(O=this._input.readUntil(new RegExp("</"+w+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(a.TEXT,O):null},L.prototype._read_content_word=function(S){var x="";if(this._options.unformatted_content_delimiter&&(S===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(a.TEXT,x)},y.exports.Tokenizer=L,y.exports.TOKEN=a}],j={};function P(y){var m=j[y];if(m!==void 0)return m.exports;var p=j[y]={exports:{}};return G[y](p,p.exports,P),p.exports}var I=P(18);k=I})();var X=k;if(!0)!(se=[Q,Q("6UM0"),Q("TXwP")],W=function(G){var j=Q("6UM0"),P=Q("TXwP");return{html_beautify:function(I,y){return X(I,y,j.js_beautify,P.css_beautify)}}}.apply($e,se),W!==void 0&&(ct.exports=W));else var D,B})()},"rAM+":function(ct,$e,Q){"use strict";Q.d($e,"a",function(){return W});var se=Q("Qw5x");function W(k,X){var D;if(typeof Symbol=="undefined"||k[Symbol.iterator]==null){if(Array.isArray(k)||(D=Object(se.a)(k))||X&&k&&typeof k.length=="number"){D&&(k=D);var B=0,G=function(){};return{s:G,n:function(){return B>=k.length?{done:!0}:{done:!1,value:k[B++]}},e:function(m){throw m},f:G}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var j=!0,P=!1,I;return{s:function(){D=k[Symbol.iterator]()},n:function(){var m=D.next();return j=m.done,m},e:function(m){P=!0,I=m},f:function(){try{!j&&D.return!=null&&D.return()}finally{if(P)throw I}}}}},rUJ1:function(ct,$e){const Q=/[&<>"']/,se=/[&<>"']/g,W=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},D=O=>X[O];function B(O,w){if(w){if(Q.test(O))return O.replace(se,D)}else if(W.test(O))return O.replace(k,D);return O}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function j(O){return O.replace(G,(w,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const P=/(^|[^\[])\^/g;function I(O,w){O=O.source||O,w=w||"";const E={replace:(b,l)=>(l=l.source||l,l=l.replace(P,"$1"),O=O.replace(b,l),E),getRegex:()=>new RegExp(O,w)};return E}const y=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(O,w,E){if(O){let b;try{b=decodeURIComponent(j(E)).replace(y,"").toLowerCase()}catch(l){return null}if(b.indexOf("javascript:")===0||b.indexOf("vbscript:")===0||b.indexOf("data:")===0)return null}w&&!m.test(E)&&(E=r(w,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(b){return null}return E}const c={},u=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(O,w){c[" "+O]||(u.test(O)?c[" "+O]=O+"/":c[" "+O]=S(O,"/",!0)),O=c[" "+O];const E=O.indexOf(":")===-1;return w.substring(0,2)==="//"?E?w:O.replace(f,"$1")+w:w.charAt(0)==="/"?E?w:O.replace(s,"$1")+w:O+w}const a={exec:function(){}};function d(O){let w=1,E,b;for(;w<arguments.length;w++){E=arguments[w];for(b in E)Object.prototype.hasOwnProperty.call(E,b)&&(O[b]=E[b])}return O}function L(O,w){const E=O.replace(/\|/g,(_,h,g)=>{let T=!1,N=h;for(;--N>=0&&g[N]==="\\";)T=!T;return T?"|":" |"}),b=E.split(/ \|/);let l=0;if(b.length>w)b.splice(w);else for(;b.length<w;)b.push("");for(;l<b.length;l++)b[l]=b[l].trim().replace(/\\\|/g,"|");return b}function S(O,w,E){const b=O.length;if(b===0)return"";let l=0;for(;l<b;){const _=O.charAt(b-l-1);if(_===w&&!E)l++;else if(_!==w&&E)l++;else break}return O.substr(0,b-l)}function x(O,w){if(O.indexOf(w[1])===-1)return-1;const E=O.length;let b=0,l=0;for(;l<E;l++)if(O[l]==="\\")l++;else if(O[l]===w[0])b++;else if(O[l]===w[1]&&(b--,b<0))return l;return-1}function R(O){O&&O.sanitize&&!O.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}ct.exports={escape:B,unescape:j,edit:I,cleanUrl:p,resolveUrl:r,noopTest:a,merge:d,splitCells:L,rtrim:S,findClosingBracket:x,checkSanitizeDeprecation:R}},siWv:function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___3IH6S",flex_space_between:"flex_space_between___3AU-S",flex_box_vertical_center:"flex_box_vertical_center___1ykIO",flex_box_center_end:"flex_box_center_end___1aIQB",flex_box_column:"flex_box_column___2A_ra",btn:"btn___23gjd"}},t23M:function(ct,$e,Q){"use strict";var se=Q("VTBJ"),W=Q("1OyB"),k=Q("vuIU"),X=Q("Ji7U"),D=Q("LK+K"),B=Q("q1tI"),G=Q.n(B),j=Q("m+aA"),P=Q("Zm9Q"),I=Q("Kwbf"),y=Q("c+Xe"),m=Q("bdgK"),p="rc-observer-key",c=function(u){Object(X.a)(s,u);var f=Object(D.a)(s);function s(){var r;return Object(W.a)(this,s),r=f.apply(this,arguments),r.resizeObserver=null,r.childNode=null,r.currentElement=null,r.state={width:0,height:0,offsetHeight:0,offsetWidth:0},r.onResize=function(a){var d=r.props.onResize,L=a[0].target,S=L.getBoundingClientRect(),x=S.width,R=S.height,O=L.offsetWidth,w=L.offsetHeight,E=Math.floor(x),b=Math.floor(R);if(r.state.width!==E||r.state.height!==b||r.state.offsetWidth!==O||r.state.offsetHeight!==w){var l={width:E,height:b,offsetWidth:O,offsetHeight:w};r.setState(l),d&&Promise.resolve().then(function(){d(Object(se.a)(Object(se.a)({},l),{},{offsetWidth:O,offsetHeight:w}))})}},r.setChildNode=function(a){r.childNode=a},r}return Object(k.a)(s,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var a=this.props.disabled;if(a){this.destroyObserver();return}var d=Object(j.a)(this.childNode||this),L=d!==this.currentElement;L&&(this.destroyObserver(),this.currentElement=d),!this.resizeObserver&&d&&(this.resizeObserver=new m.default(this.onResize),this.resizeObserver.observe(d))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var a=this.props.children,d=Object(P.a)(a);if(d.length>1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(d.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var L=d[0];if(B.isValidElement(L)&&Object(y.c)(L)){var S=L.ref;d[0]=B.cloneElement(L,{ref:Object(y.a)(S,this.setChildNode)})}return d.length===1?d[0]:d.map(function(x,R){return!B.isValidElement(x)||"key"in x&&x.key!==null?x:B.cloneElement(x,{key:"".concat(p,"-").concat(R)})})}}]),s}(B.Component);c.displayName="ResizeObserver",$e.a=c},ulZh:function(ct,$e,Q){typeof window!="undefined"&&function(W,k){ct.exports=k()}(this,function(){return function(se){var W={};function k(X){if(W[X])return W[X].exports;var D=W[X]={i:X,l:!1,exports:{}};return se[X].call(D.exports,D,D.exports,k),D.l=!0,D.exports}return k.m=se,k.c=W,k.d=function(X,D,B){k.o(X,D)||Object.defineProperty(X,D,{enumerable:!0,get:B})},k.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},k.t=function(X,D){if(D&1&&(X=k(X)),D&8)return X;if(D&4&&typeof X=="object"&&X&&X.__esModule)return X;var B=Object.create(null);if(k.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:X}),D&2&&typeof X!="string")for(var G in X)k.d(B,G,function(j){return X[j]}.bind(null,G));return B},k.n=function(X){var D=X&&X.__esModule?function(){return X.default}:function(){return X};return k.d(D,"a",D),D},k.o=function(X,D){return Object.prototype.hasOwnProperty.call(X,D)},k.p="/dist/",k(k.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(se,W,k){"use strict";var X=Object.prototype.hasOwnProperty,D="~";function B(){}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(D=!1));function G(y,m,p){this.fn=y,this.context=m,this.once=p||!1}function j(y,m,p,c,u){if(typeof p!="function")throw new TypeError("The listener must be a function");var f=new G(p,c||y,u),s=D?D+m:m;return y._events[s]?y._events[s].fn?y._events[s]=[y._events[s],f]:y._events[s].push(f):(y._events[s]=f,y._eventsCount++),y}function P(y,m){--y._eventsCount===0?y._events=new B:delete y._events[m]}function I(){this._events=new B,this._eventsCount=0}I.prototype.eventNames=function(){var m=[],p,c;if(this._eventsCount===0)return m;for(c in p=this._events)X.call(p,c)&&m.push(D?c.slice(1):c);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(p)):m},I.prototype.listeners=function(m){var p=D?D+m:m,c=this._events[p];if(!c)return[];if(c.fn)return[c.fn];for(var u=0,f=c.length,s=new Array(f);u<f;u++)s[u]=c[u].fn;return s},I.prototype.listenerCount=function(m){var p=D?D+m:m,c=this._events[p];return c?c.fn?1:c.length:0},I.prototype.emit=function(m,p,c,u,f,s){var r=D?D+m:m;if(!this._events[r])return!1;var a=this._events[r],d=arguments.length,L,S;if(a.fn){a.once&&this.removeListener(m,a.fn,void 0,!0);switch(d){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,p),!0;case 3:return a.fn.call(a.context,p,c),!0;case 4:return a.fn.call(a.context,p,c,u),!0;case 5:return a.fn.call(a.context,p,c,u,f),!0;case 6:return a.fn.call(a.context,p,c,u,f,s),!0}for(S=1,L=new Array(d-1);S<d;S++)L[S-1]=arguments[S];a.fn.apply(a.context,L)}else{var x=a.length,R;for(S=0;S<x;S++){a[S].once&&this.removeListener(m,a[S].fn,void 0,!0);switch(d){case 1:a[S].fn.call(a[S].context);break;case 2:a[S].fn.call(a[S].context,p);break;case 3:a[S].fn.call(a[S].context,p,c);break;case 4:a[S].fn.call(a[S].context,p,c,u);break;default:if(!L)for(R=1,L=new Array(d-1);R<d;R++)L[R-1]=arguments[R];a[S].fn.apply(a[S].context,L)}}}return!0},I.prototype.on=function(m,p,c){return j(this,m,p,c,!1)},I.prototype.once=function(m,p,c){return j(this,m,p,c,!0)},I.prototype.removeListener=function(m,p,c,u){var f=D?D+m:m;if(!this._events[f])return this;if(!p)return P(this,f),this;var s=this._events[f];if(s.fn)s.fn===p&&(!u||s.once)&&(!c||s.context===c)&&P(this,f);else{for(var r=0,a=[],d=s.length;r<d;r++)(s[r].fn!==p||u&&!s[r].once||c&&s[r].context!==c)&&a.push(s[r]);a.length?this._events[f]=a.length===1?a[0]:a:P(this,f)}return this},I.prototype.removeAllListeners=function(m){var p;return m?(p=D?D+m:m,this._events[p]&&P(this,p)):(this._events=new B,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=D,I.EventEmitter=I,se.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(se,W,k){(function(X){var D=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,B=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,j=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,P={buildAbsoluteURL:function(I,y,m){if(m=m||{},I=I.trim(),y=y.trim(),!y){if(!m.alwaysNormalize)return I;var p=P.parseURL(I);if(!p)throw new Error("Error trying to parse base URL.");return p.path=P.normalizePath(p.path),P.buildURLFromParts(p)}var c=P.parseURL(y);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return m.alwaysNormalize?(c.path=P.normalizePath(c.path),P.buildURLFromParts(c)):y;var u=P.parseURL(I);if(!u)throw new Error("Error trying to parse base URL.");if(!u.netLoc&&u.path&&u.path[0]!=="/"){var f=B.exec(u.path);u.netLoc=f[1],u.path=f[2]}u.netLoc&&!u.path&&(u.path="/");var s={scheme:u.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(s.netLoc=u.netLoc,c.path[0]!=="/"))if(!c.path)s.path=u.path,c.params||(s.params=u.params,c.query||(s.query=u.query));else{var r=u.path,a=r.substring(0,r.lastIndexOf("/")+1)+c.path;s.path=P.normalizePath(a)}return s.path===null&&(s.path=m.alwaysNormalize?P.normalizePath(c.path):c.path),P.buildURLFromParts(s)},parseURL:function(I){var y=D.exec(I);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(G,"");I.length!==(I=I.replace(j,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};se.exports=P})(this)},"./node_modules/webworkify-webpack/index.js":function(se,W,k){function X(m){var p={};function c(f){if(p[f])return p[f].exports;var s=p[f]={i:f,l:!1,exports:{}};return m[f].call(s.exports,s,s.exports,c),s.l=!0,s.exports}c.m=m,c.c=p,c.i=function(f){return f},c.d=function(f,s,r){c.o(f,s)||Object.defineProperty(f,s,{configurable:!1,enumerable:!0,get:r})},c.r=function(f){Object.defineProperty(f,"__esModule",{value:!0})},c.n=function(f){var s=f&&f.__esModule?function(){return f.default}:function(){return f};return c.d(s,"a",s),s},c.o=function(f,s){return Object.prototype.hasOwnProperty.call(f,s)},c.p="/",c.oe=function(f){throw console.error(f),f};var u=c(c.s=ENTRY_MODULE);return u.default||u}var D="[\\.|\\-|\\+|\\w|/|@]+",B="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+D+").*?\\)";function G(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function j(m){return!isNaN(1*m)}function P(m,p,c){var u={};u[c]=[];var f=p.toString(),s=f.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return u;for(var r=s[1],a=new RegExp("(\\\\n|\\W)"+G(r)+B,"g"),d;d=a.exec(f);){if(d[3]==="dll-reference")continue;u[c].push(d[3])}for(a=new RegExp("\\("+G(r)+'\\("(dll-reference\\s('+D+'))"\\)\\)'+B,"g");d=a.exec(f);)m[d[2]]||(u[c].push(d[1]),m[d[2]]=k(d[1]).m),u[d[2]]=u[d[2]]||[],u[d[2]].push(d[4]);for(var L=Object.keys(u),S=0;S<L.length;S++)for(var x=0;x<u[L[S]].length;x++)j(u[L[S]][x])&&(u[L[S]][x]=1*u[L[S]][x]);return u}function I(m){var p=Object.keys(m);return p.reduce(function(c,u){return c||m[u].length>0},!1)}function y(m,p){for(var c={main:[p]},u={main:[]},f={main:{}};I(c);)for(var s=Object.keys(c),r=0;r<s.length;r++){var a=s[r],d=c[a],L=d.pop();if(f[a]=f[a]||{},f[a][L]||!m[a][L])continue;f[a][L]=!0,u[a]=u[a]||[],u[a].push(L);for(var S=P(m,m[a][L],a),x=Object.keys(S),R=0;R<x.length;R++)c[x[R]]=c[x[R]]||[],c[x[R]]=c[x[R]].concat(S[x[R]])}return u}se.exports=function(m,p){p=p||{};var c={main:k.m},u=p.all?{main:Object.keys(c.main)}:y(c,m),f="";Object.keys(u).filter(function(L){return L!=="main"}).forEach(function(L){for(var S=0;u[L][S];)S++;u[L].push(S),c[L][S]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",f=f+"var "+L+" = ("+X.toString().replace("ENTRY_MODULE",JSON.stringify(S))+")({"+u[L].map(function(x){return""+JSON.stringify(x)+": "+c[L][x].toString()}).join(",")+`});
|
|
`}),f=f+"new (("+X.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+u.main.map(function(L){return""+JSON.stringify(L)+": "+c.main[L].toString()}).join(",")+"}))(self);";var s=new window.Blob([f],{type:"text/javascript"});if(p.bare)return s;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,a=r.createObjectURL(s),d=new window.Worker(a);return d.objectURL=a,d}},"./src/config.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"hlsDefaultConfig",function(){return R}),k.d(W,"mergeConfig",function(){return w}),k.d(W,"enableStreamingMode",function(){return E});var X=k("./src/controller/abr-controller.ts"),D=k("./src/controller/audio-stream-controller.ts"),B=k("./src/controller/audio-track-controller.ts"),G=k("./src/controller/subtitle-stream-controller.ts"),j=k("./src/controller/subtitle-track-controller.ts"),P=k("./src/controller/buffer-controller.ts"),I=k("./src/controller/timeline-controller.ts"),y=k("./src/controller/cap-level-controller.ts"),m=k("./src/controller/fps-controller.ts"),p=k("./src/controller/eme-controller.ts"),c=k("./src/controller/cmcd-controller.ts"),u=k("./src/utils/xhr-loader.ts"),f=k("./src/utils/fetch-loader.ts"),s=k("./src/utils/cues.ts"),r=k("./src/utils/mediakeys-helper.ts"),a=k("./src/utils/logger.ts");function d(){return d=Object.assign||function(b){for(var l=1;l<arguments.length;l++){var _=arguments[l];for(var h in _)Object.prototype.hasOwnProperty.call(_,h)&&(b[h]=_[h])}return b},d.apply(this,arguments)}function L(b,l){var _=Object.keys(b);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(b);l&&(h=h.filter(function(g){return Object.getOwnPropertyDescriptor(b,g).enumerable})),_.push.apply(_,h)}return _}function S(b){for(var l=1;l<arguments.length;l++){var _=arguments[l]!=null?arguments[l]:{};l%2?L(Object(_),!0).forEach(function(h){x(b,h,_[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(_)):L(Object(_)).forEach(function(h){Object.defineProperty(b,h,Object.getOwnPropertyDescriptor(_,h))})}return b}function x(b,l,_){return l in b?Object.defineProperty(b,l,{value:_,enumerable:!0,configurable:!0,writable:!0}):b[l]=_,b}var R=S(S({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:u.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:X.default,bufferController:P.default,capLevelController:y.default,fpsController:m.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:r.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:j.default,timelineController:I.TimelineController,audioStreamController:D.default,audioTrackController:B.default,emeController:p.default,cmcdController:c.default});function O(){return{cueHandler:s.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function w(b,l){if((l.liveSyncDurationCount||l.liveMaxLatencyDurationCount)&&(l.liveSyncDuration||l.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(l.liveMaxLatencyDurationCount!==void 0&&(l.liveSyncDurationCount===void 0||l.liveMaxLatencyDurationCount<=l.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(l.liveMaxLatencyDuration!==void 0&&(l.liveSyncDuration===void 0||l.liveMaxLatencyDuration<=l.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},b,l)}function E(b){var l=b.loader;if(l!==f.default&&l!==u.default)a.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),b.progressive=!1;else{var _=Object(f.fetchSupported)();_&&(b.loader=f.default,b.progressive=!0,b.enableSoftwareAES=!0,a.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/polyfills/number.ts"),D=k("./src/utils/ewma-bandwidth-estimator.ts"),B=k("./src/events.ts"),G=k("./src/utils/buffer-helper.ts"),j=k("./src/errors.ts"),P=k("./src/types/loader.ts"),I=k("./src/utils/logger.ts");function y(c,u){for(var f=0;f<u.length;f++){var s=u[f];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}function m(c,u,f){return u&&y(c.prototype,u),f&&y(c,f),c}var p=function(){function c(f){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=f;var s=f.config;this.bwEstimator=new D.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var u=c.prototype;return u.registerListeners=function(){var s=this.hls;s.on(B.Events.FRAG_LOADING,this.onFragLoading,this),s.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(B.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var s=this.hls;s.off(B.Events.FRAG_LOADING,this.onFragLoading,this),s.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(B.Events.ERROR,this.onError,this)},u.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},u.onFragLoading=function(s,r){var a=r.frag;if(a.type===P.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=a,this.partCurrent=(d=r.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},u.onLevelLoaded=function(s,r){var a=this.hls.config;r.details.live?this.bwEstimator.update(a.abrEwmaSlowLive,a.abrEwmaFastLive):this.bwEstimator.update(a.abrEwmaSlowVoD,a.abrEwmaFastVoD)},u._abandonRulesCheck=function(){var s=this.fragCurrent,r=this.partCurrent,a=this.hls,d=a.autoLevelEnabled,L=a.config,S=a.media;if(!s||!S)return;var x=r?r.stats:s.stats,R=r?r.duration:s.duration;if(x.aborted){I.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||S.paused||!S.playbackRate||!S.readyState)return;var O=performance.now()-x.loading.start,w=Math.abs(S.playbackRate);if(O<=500*R/w)return;var E=a.levels,b=a.minAutoLevel,l=E[s.level],_=x.total||Math.max(x.loaded,Math.round(R*l.maxBitrate/8)),h=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/O),g=(_-x.loaded)/h,T=S.currentTime,N=(G.BufferHelper.bufferInfo(S,T,L.maxBufferHole).end-T)/w;if(N>=2*R/w||g<=N)return;var V=Number.POSITIVE_INFINITY,Y;for(Y=s.level-1;Y>b;Y--){var U=E[Y].maxBitrate;if(V=R*U/(8*.8*h),V<N)break}if(V>=g)return;var A=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+s.sn+(r?" part "+r.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+Y+`
|
|
Current BW estimate: `+(Object(X.isFiniteNumber)(A)?(A/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+g.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+V.toFixed(3)+` s
|
|
Time to underbuffer: `+N.toFixed(3)+" s"),a.nextLoadLevel=Y,this.bwEstimator.sample(O,x.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),a.trigger(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:r,stats:x})},u.onFragLoaded=function(s,r){var a=r.frag,d=r.part;if(a.type===P.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(a.sn)){var L=d?d.stats:a.stats,S=d?d.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[a.level],R=(x.loaded?x.loaded.bytes:0)+L.loaded,O=(x.loaded?x.loaded.duration:0)+S;x.loaded={bytes:R,duration:O},x.realBitrate=Math.round(8*R/O)}if(a.bitrateTest){var w={stats:L,frag:a,part:d,id:a.type};this.onFragBuffered(B.Events.FRAG_BUFFERED,w),a.bitrateTest=!1}}},u.onFragBuffered=function(s,r){var a=r.frag,d=r.part,L=d?d.stats:a.stats;if(L.aborted)return;if(a.type!==P.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var S=L.parsing.end-L.loading.start;this.bwEstimator.sample(S,L.loaded),L.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=S/1e3:this.bitrateTestDelay=0},u.onError=function(s,r){switch(r.details){case j.ErrorDetails.FRAG_LOAD_ERROR:case j.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},u.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},u.getNextABRAutoLevel=function(){var s=this.fragCurrent,r=this.partCurrent,a=this.hls,d=a.maxAutoLevel,L=a.config,S=a.minAutoLevel,x=a.media,R=r?r.duration:s?s.duration:0,O=x?x.currentTime:0,w=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():L.abrEwmaDefaultEstimate,b=(G.BufferHelper.bufferInfo(x,O,L.maxBufferHole).end-O)/w,l=this.findBestLevel(E,S,d,b,L.abrBandWidthFactor,L.abrBandWidthUpFactor);if(l>=0)return l;I.logger.trace((b?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=R?Math.min(R,L.maxStarvationDelay):L.maxStarvationDelay,h=L.abrBandWidthFactor,g=L.abrBandWidthUpFactor;if(!b){var T=this.bitrateTestDelay;if(T){var N=R?Math.min(R,L.maxLoadingDelay):L.maxLoadingDelay;_=N-T,I.logger.trace("bitrate test took "+Math.round(1e3*T)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),h=g=1}}return l=this.findBestLevel(E,S,d,b+_,h,g),Math.max(l,0)},u.findBestLevel=function(s,r,a,d,L,S){for(var x,R=this.fragCurrent,O=this.partCurrent,w=this.lastLoadedFragLevel,E=this.hls.levels,b=E[w],l=!!(b!=null&&(x=b.details)!==null&&x!==void 0&&x.live),_=b==null?void 0:b.codecSet,h=O?O.duration:R?R.duration:0,g=a;g>=r;g--){var T=E[g];if(!T||_&&T.codecSet!==_)continue;var N=T.details,V=(O?N==null?void 0:N.partTarget:N==null?void 0:N.averagetargetduration)||h,Y=void 0;g<=w?Y=L*s:Y=S*s;var U=E[g].maxBitrate,A=U*V/Y;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+g+"/"+Math.round(Y)+"/"+U+"/"+V+"/"+d+"/"+A),Y>U&&(!A||l&&!this.bitrateTestDelay||A<d))return g}return-1},m(c,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,r=this.bwEstimator;if(s!==-1&&(!r||!r.canEstimate()))return s;var a=this.getNextABRAutoLevel();return s!==-1&&(a=Math.min(s,a)),a},set:function(s){this._nextAutoLevel=s}}]),c}();W.default=p},"./src/controller/audio-stream-controller.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/polyfills/number.ts"),D=k("./src/controller/base-stream-controller.ts"),B=k("./src/events.ts"),G=k("./src/utils/buffer-helper.ts"),j=k("./src/controller/fragment-tracker.ts"),P=k("./src/types/level.ts"),I=k("./src/types/loader.ts"),y=k("./src/loader/fragment.ts"),m=k("./src/demux/chunk-cache.ts"),p=k("./src/demux/transmuxer-interface.ts"),c=k("./src/types/transmuxer.ts"),u=k("./src/controller/fragment-finders.ts"),f=k("./src/utils/discontinuities.ts"),s=k("./src/errors.ts"),r=k("./src/utils/logger.ts");function a(){return a=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var w=arguments[O];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(R[E]=w[E])}return R},a.apply(this,arguments)}function d(R,O){R.prototype=Object.create(O.prototype),R.prototype.constructor=R,L(R,O)}function L(R,O){return L=Object.setPrototypeOf||function(E,b){return E.__proto__=b,E},L(R,O)}var S=100,x=function(R){d(O,R);function O(E,b){var l;return l=R.call(this,E,b,"[audio-stream-controller]")||this,l.videoBuffer=null,l.videoTrackCC=-1,l.waitingVideoCC=-1,l.audioSwitch=!1,l.trackId=-1,l.waitingData=null,l.mainDetails=null,l.bufferFlushed=!1,l._registerListeners(),l}var w=O.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var b=this.hls;b.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),b.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),b.on(B.Events.ERROR,this.onError,this),b.on(B.Events.BUFFER_RESET,this.onBufferReset,this),b.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),b.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w._unregisterListeners=function(){var b=this.hls;b.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(B.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),b.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(B.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),b.off(B.Events.ERROR,this.onError,this),b.off(B.Events.BUFFER_RESET,this.onBufferReset,this),b.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),b.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},w.onInitPtsFound=function(b,l){var _=l.frag,h=l.id,g=l.initPTS;if(h==="main"){var T=_.cc;this.initPTS[_.cc]=g,this.log("InitPTS for cc: "+T+" found from main: "+g),this.videoTrackCC=T,this.state===D.State.WAITING_INIT_PTS&&this.tick()}},w.startLoad=function(b){if(!this.levels){this.startPosition=b,this.state=D.State.STOPPED;return}var l=this.lastCurrentTime;this.stopLoad(),this.setInterval(S),this.fragLoadError=0,l>0&&b===-1?(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),this.state=D.State.IDLE):(this.loadedmetadata=!1,this.state=D.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()},w.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_TRACK:{var b,l=this.levels,_=this.trackId,h=l==null||((b=l[_])===null||b===void 0)?void 0:b.details;if(h){if(this.waitForCdnTuneIn(h))break;this.state=D.State.WAITING_INIT_PTS}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var g,T=performance.now(),N=this.retryDate;(!N||T>=N||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=D.State.IDLE);break}case D.State.WAITING_INIT_PTS:{var V=this.waitingData;if(V){var Y=V.frag,U=V.part,A=V.cache,J=V.complete;if(this.initPTS[Y.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.FRAG_LOADING;var ne=A.flush(),oe={frag:Y,part:U,payload:ne,networkDetails:null};this._handleFragmentLoadProgress(oe),J&&R.prototype._handleFragmentLoadComplete.call(this,oe)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+Y.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),ke=G.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Oe=Object(u.fragmentWithinToleranceTest)(ke.end,this.config.maxFragLookUpTolerance,Y);Oe<0&&(r.logger.log("Waiting fragment cc ("+Y.cc+") @ "+Y.start+" cancelled because another fragment at "+ke.end+" is needed"),this.clearWaitingFragment())}}else this.state=D.State.IDLE}}this.onTickEnd()},w.clearWaitingFragment=function(){var b=this.waitingData;b&&(this.fragmentTracker.removeFragment(b.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.IDLE)},w.onTickEnd=function(){var b=this.media;if(!b||!b.readyState)return;var l=this.mediaBuffer?this.mediaBuffer:b,_=l.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=b.currentTime},w.doTickIdle=function(){var b,l,_=this.hls,h=this.levels,g=this.media,T=this.trackId,N=_.config;if(!h||!h[T])return;if(!g&&(this.startFragRequested||!N.startFragPrefetch))return;var V=h[T],Y=V.details;if(!Y||Y.live&&this.levelLastLoaded!==T||this.waitForCdnTuneIn(Y)){this.state=D.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(U===null)return;var A=U.len,J=this.getMaxBufferLength(),ne=this.audioSwitch;if(A>=J&&!ne)return;if(!ne&&this._streamEnded(U,Y)){_.trigger(B.Events.BUFFER_EOS,{type:"audio"}),this.state=D.State.ENDED;return}var oe=Y.fragments,fe=oe[0].start,ke=U.end;if(ne){var Oe=this.getLoadPosition();ke=Oe,Y.PTSKnown&&Oe<fe&&((U.end>fe||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),g.currentTime=fe+.05))}var Me=this.getNextFragment(ke,Y);if(!Me){this.bufferFlushed=!0;return}((b=Me.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((l=Me.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(Me,Y):this.loadFragment(Me,Y,ke)},w.getMaxBufferLength=function(){var b=R.prototype.getMaxBufferLength.call(this),l=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return l===null?b:Math.max(b,l.len)},w.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},w.onAudioTracksUpdated=function(b,l){var _=l.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(h){return new P.Level(h)})},w.onAudioTrackSwitching=function(b,l){var _=!!l.url;this.trackId=l.id;var h=this.fragCurrent;h!=null&&h.loader&&h.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(S):this.resetTransmuxer(),_?(this.audioSwitch=!0,this.state=D.State.IDLE):this.state=D.State.STOPPED,this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},w.onLevelLoaded=function(b,l){this.mainDetails=l.details},w.onAudioTrackLoaded=function(b,l){var _,h=this.levels,g=l.details,T=l.id;if(!h){this.warn("Audio tracks were reset while loading level "+T);return}this.log("Track "+T+" loaded ["+g.startSN+","+g.endSN+"],duration:"+g.totalduration);var N=h[T],V=0;if(g.live||(_=N.details)!==null&&_!==void 0&&_.live){var Y=this.mainDetails;if(g.fragments[0]||(g.deltaUpdateFailed=!0),g.deltaUpdateFailed||!Y)return;!N.details&&g.hasProgramDateTime&&Y.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(g,Y),V=g.fragments[0].start):V=this.alignPlaylists(g,N.details)}N.details=g,this.levelLastLoaded=T,!this.startFragRequested&&(this.mainDetails||!g.live)&&this.setStartPosition(N.details,V),this.state===D.State.WAITING_TRACK&&!this.waitForCdnTuneIn(g)&&(this.state=D.State.IDLE),this.tick()},w._handleFragmentLoadProgress=function(b){var l,_=b.frag,h=b.part,g=b.payload,T=this.config,N=this.trackId,V=this.levels;if(!V){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var Y=V[N];console.assert(Y,"Audio track is defined on fragment load progress");var U=Y.details;console.assert(U,"Audio track details are defined on fragment load progress");var A=T.defaultAudioCodec||Y.audioCodec||"mp4a.40.2",J=this.transmuxer;J||(J=this.transmuxer=new p.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ne=this.initPTS[_.cc],oe=(l=_.initSegment)===null||l===void 0?void 0:l.data;if(ne!==void 0){var fe=!1,ke=h?h.index:-1,Oe=ke!==-1,Me=new c.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,g.byteLength,ke,Oe);J.push(g,oe,A,"",_,h,U.totalduration,fe,Me,ne)}else{r.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+N);var Be=this.waitingData=this.waitingData||{frag:_,part:h,cache:new m.default,complete:!1},Pe=Be.cache;Pe.push(new Uint8Array(g)),this.waitingVideoCC=this.videoTrackCC,this.state=D.State.WAITING_INIT_PTS}},w._handleFragmentLoadComplete=function(b){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,b)},w.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},w.onBufferCreated=function(b,l){var _=l.tracks.audio;_&&(this.mediaBuffer=_.buffer),l.tracks.video&&(this.videoBuffer=l.tracks.video.buffer)},w.onFragBuffered=function(b,l){var _=l.frag,h=l.part;if(_.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(h?" p: "+h.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}_.sn!=="initSegment"&&(this.fragPrevious=_,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,h)},w.onError=function(b,l){switch(l.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,l);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==D.State.ERROR&&this.state!==D.State.STOPPED&&(this.state=l.fatal?D.State.ERROR:D.State.IDLE,this.warn(l.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="audio"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var _=!0,h=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);h&&h.len>.5&&(_=!this.reduceMaxBufferLength(h.len)),_&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},w.onBufferFlushed=function(b,l){var _=l.type;_===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},w._handleTransmuxComplete=function(b){var l,_="audio",h=this.hls,g=b.remuxResult,T=b.chunkMeta,N=this.getCurrentContext(T);if(!N){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(T.level);return}var V=N.frag,Y=N.part,U=g.audio,A=g.text,J=g.id3,ne=g.initSegment;if(this.fragContextChanged(V))return;if(this.state=D.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),ne!=null&&ne.tracks&&(this._bufferInitSegment(ne.tracks,V,T),h.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:V,id:_,tracks:ne.tracks})),U){var oe=U.startPTS,fe=U.endPTS,ke=U.startDTS,Oe=U.endDTS;Y&&(Y.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:fe,startDTS:ke,endDTS:Oe}),V.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,oe,fe,ke,Oe),this.bufferFragmentData(U,V,Y,T)}if(J!=null&&(l=J.samples)!==null&&l!==void 0&&l.length){var Me=a({frag:V,id:_},J);h.trigger(B.Events.FRAG_PARSING_METADATA,Me)}if(A){var Be=a({frag:V,id:_},A);h.trigger(B.Events.FRAG_PARSING_USERDATA,Be)}},w._bufferInitSegment=function(b,l,_){if(this.state!==D.State.PARSING)return;b.video&&delete b.video;var h=b.audio;if(!h)return;h.levelCodec=h.codec,h.id="audio",this.log("Init audio buffer, container:"+h.container+", codecs[parsed]=["+h.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,b);var g=h.initSegment;if(g!=null&&g.byteLength){var T={type:"audio",frag:l,part:null,chunkMeta:_,parent:l.type,data:g};this.hls.trigger(B.Events.BUFFER_APPENDING,T)}this.tick()},w.loadFragment=function(b,l,_){var h=this.fragmentTracker.getState(b);this.fragCurrent=b,(this.audioSwitch||h===j.FragmentState.NOT_LOADED||h===j.FragmentState.PARTIAL)&&(b.sn==="initSegment"?this._loadInitSegment(b):l.live&&!Object(X.isFiniteNumber)(this.initPTS[b.cc])?(this.log("Waiting for video PTS in continuity counter "+b.cc+" of live stream before loading audio fragment "+b.sn+" of level "+this.trackId),this.state=D.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,b,l,_)))},w.completeAudioSwitch=function(){var b=this.hls,l=this.media,_=this.trackId;l&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,b.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:_})},O}(D.default);W.default=x},"./src/controller/audio-track-controller.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/events.ts"),D=k("./src/errors.ts"),B=k("./src/controller/base-playlist-controller.ts"),G=k("./src/types/loader.ts");function j(p,c){for(var u=0;u<c.length;u++){var f=c[u];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function P(p,c,u){return c&&j(p.prototype,c),u&&j(p,u),p}function I(p,c){p.prototype=Object.create(c.prototype),p.prototype.constructor=p,y(p,c)}function y(p,c){return y=Object.setPrototypeOf||function(f,s){return f.__proto__=s,f},y(p,c)}var m=function(p){I(c,p);function c(f){var s;return s=p.call(this,f,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var u=c.prototype;return u.registerListeners=function(){var s=this.hls;s.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(X.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var s=this.hls;s.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(X.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(X.Events.ERROR,this.onError,this)},u.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},u.onManifestParsed=function(s,r){this.tracks=r.audioTracks||[]},u.onAudioTrackLoaded=function(s,r){var a=r.id,d=r.details,L=this.tracksInGroup[a];if(!L){this.warn("Invalid audio track id "+a);return}var S=L.details;L.details=r.details,this.log("audioTrack "+a+" loaded ["+d.startSN+"-"+d.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,r,S))},u.onLevelLoading=function(s,r){this.switchLevel(r.level)},u.onLevelSwitching=function(s,r){this.switchLevel(r.level)},u.switchLevel=function(s){var r=this.hls.levels[s];if(!(r!=null&&r.audioGroupIds))return;var a=r.audioGroupIds[r.urlId];if(this.groupId!==a){this.groupId=a;var d=this.tracks.filter(function(S){return!a||S.groupId===a});this.selectDefaultTrack&&!d.some(function(S){return S.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var L={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(X.Events.AUDIO_TRACKS_UPDATED,L),this.selectInitialTrack()}},u.onError=function(s,r){if(p.prototype.onError.call(this,s,r),r.fatal||!r.context)return;r.context.type===G.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},u.setAudioTrack=function(s){var r=this.tracksInGroup;if(s<0||s>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=r[this.trackId];this.log("Now switching to audio-track index "+s);var d=r[s],L=d.id,S=d.groupId,x=S===void 0?"":S,R=d.name,O=d.type,w=d.url;if(this.trackId=s,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:L,groupId:x,name:R,type:O,url:w}),d.details&&!d.details.live)return;var E=this.switchParams(d.url,a==null?void 0:a.details);this.loadPlaylist(E)},u.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,a=this.findTrackId(r)||this.findTrackId();a!==-1?this.setAudioTrack(a):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},u.findTrackId=function(s){for(var r=this.tracksInGroup,a=0;a<r.length;a++){var d=r[a];if((!this.selectDefaultTrack||d.default)&&(!s||s===d.name))return d.id}return-1},u.loadPlaylist=function(s){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var a=r.id,d=r.groupId,L=r.url;if(s)try{L=s.addDirectives(L)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("loading audio-track playlist for id: "+a),this.clearTimer(),this.hls.trigger(X.Events.AUDIO_TRACK_LOADING,{url:L,id:a,groupId:d,deliveryDirectives:s||null})}},P(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),c}(B.default);W.default=m},"./src/controller/base-playlist-controller.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return P});var X=k("./src/polyfills/number.ts"),D=k("./src/types/level.ts"),B=k("./src/controller/level-helper.ts"),G=k("./src/utils/logger.ts"),j=k("./src/errors.ts"),P=function(){function I(m,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,p+":"),this.warn=G.logger.warn.bind(G.logger,p+":"),this.hls=m}var y=I.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(p,c){c.fatal&&c.type===j.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},y.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},y.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},y.stopLoad=function(){this.canLoad=!1,this.clearTimer()},y.switchParams=function(p,c){var u=c==null?void 0:c.renditionReports;if(u)for(var f=0;f<u.length;f++){var s=u[f],r=""+s.URI;if(r===p.substr(-r.length)){var a=parseInt(s["LAST-MSN"]),d=parseInt(s["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var L=Math.min(c.age-c.partTarget,c.targetduration);d!==void 0&&L>c.partTarget&&(d+=1)}if(Object(X.isFiniteNumber)(a))return new D.HlsUrlParameters(a,Object(X.isFiniteNumber)(d)?d:void 0,D.HlsSkip.No)}}},y.loadPlaylist=function(p){},y.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},y.playlistLoaded=function(p,c,u){var f=this,s=c.details,r=c.stats,a=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(s.advancedDateTime=Date.now()-a,s.live||u!=null&&u.live){if(s.reloaded(u),u&&this.log("live playlist "+p+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),u&&s.fragments.length>0&&Object(B.mergeDetails)(u,s),!this.canLoad||!s.live)return;var d,L=void 0,S=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var x=this.hls.config.lowLatencyMode,R=s.lastPartSn,O=s.endSN,w=s.lastPartIndex,E=w!==-1,b=R===O,l=x?0:w;E?(L=b?O+1:R,S=b?l:w+1):L=O+1;var _=s.age,h=_+s.ageHeader,g=Math.min(h-s.partTarget,s.targetduration*1.5);if(g>0){if(u&&g>u.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+u.tuneInGoal+" to: "+g+" with playlist age: "+s.age),g=0;else{var T=Math.floor(g/s.targetduration);if(L+=T,S!==void 0){var N=Math.round(g%s.targetduration/s.partTarget);S+=N}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+g+" skip sn "+T+" to part "+S)}s.tuneInGoal=g}if(d=this.getDeliveryDirectives(s,c.deliveryDirectives,L,S),x||!b){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(s,c.deliveryDirectives,L,S);var V=Object(B.computeReloadInterval)(s,r);L!==void 0&&s.canBlockReload&&(V-=s.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(V)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(d)},V)}else this.clearTimer()},y.getDeliveryDirectives=function(p,c,u,f){var s=Object(D.getSkipValue)(p,u);return c!=null&&c.skip&&p.deltaUpdateFailed&&(u=c.msn,f=c.part,s=D.HlsSkip.No),new D.HlsUrlParameters(u,f,s)},y.retryLoadingOrFail=function(p){var c=this,u=this.hls.config,f=this.retryCount<u.levelLoadingMaxRetry;if(f){var s;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(s=p.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*u.levelLoadingRetryDelay,u.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return f},I}()},"./src/controller/base-stream-controller.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"State",function(){return O}),k.d(W,"default",function(){return w});var X=k("./src/polyfills/number.ts"),D=k("./src/task-loop.ts"),B=k("./src/controller/fragment-tracker.ts"),G=k("./src/utils/buffer-helper.ts"),j=k("./src/utils/logger.ts"),P=k("./src/events.ts"),I=k("./src/errors.ts"),y=k("./src/types/transmuxer.ts"),m=k("./src/utils/mp4-tools.ts"),p=k("./src/utils/discontinuities.ts"),c=k("./src/controller/fragment-finders.ts"),u=k("./src/controller/level-helper.ts"),f=k("./src/loader/fragment-loader.ts"),s=k("./src/crypt/decrypter.ts"),r=k("./src/utils/time-ranges.ts"),a=k("./src/types/loader.ts");function d(E,b){for(var l=0;l<b.length;l++){var _=b[l];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(E,_.key,_)}}function L(E,b,l){return b&&d(E.prototype,b),l&&d(E,l),E}function S(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function x(E,b){E.prototype=Object.create(b.prototype),E.prototype.constructor=E,R(E,b)}function R(E,b){return R=Object.setPrototypeOf||function(_,h){return _.__proto__=h,_},R(E,b)}var O={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},w=function(E){x(b,E);function b(_,h,g){var T;return T=E.call(this)||this,T.hls=void 0,T.fragPrevious=null,T.fragCurrent=null,T.fragmentTracker=void 0,T.transmuxer=null,T._state=O.STOPPED,T.media=void 0,T.mediaBuffer=void 0,T.config=void 0,T.bitrateTest=!1,T.lastCurrentTime=0,T.nextLoadPosition=0,T.startPosition=0,T.loadedmetadata=!1,T.fragLoadError=0,T.retryDate=0,T.levels=null,T.fragmentLoader=void 0,T.levelLastLoaded=null,T.startFragRequested=!1,T.decrypter=void 0,T.initPTS=[],T.onvseeking=null,T.onvended=null,T.logPrefix="",T.log=void 0,T.warn=void 0,T.logPrefix=g,T.log=j.logger.log.bind(j.logger,g+":"),T.warn=j.logger.warn.bind(j.logger,g+":"),T.hls=_,T.fragmentLoader=new f.default(_.config),T.fragmentTracker=h,T.config=_.config,T.decrypter=new s.default(_,_.config),_.on(P.Events.KEY_LOADED,T.onKeyLoaded,S(T)),T}var l=b.prototype;return l.doTick=function(){this.onTickEnd()},l.onTickEnd=function(){},l.startLoad=function(h){},l.stopLoad=function(){this.fragmentLoader.abort();var h=this.fragCurrent;h&&this.fragmentTracker.removeFragment(h),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},l._streamEnded=function(h,g){var T=this.fragCurrent,N=this.fragmentTracker;if(!g.live&&T&&T.sn===g.endSN&&!h.nextStart){var V=N.getState(T);return V===B.FragmentState.PARTIAL||V===B.FragmentState.OK}return!1},l.onMediaAttached=function(h,g){var T=this.media=this.mediaBuffer=g.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),T.addEventListener("seeking",this.onvseeking),T.addEventListener("ended",this.onvended);var N=this.config;this.levels&&N.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(N.startPosition)},l.onMediaDetaching=function(){var h=this.media;h!=null&&h.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),h&&(h.removeEventListener("seeking",this.onvseeking),h.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},l.onMediaSeeking=function(){var h=this.config,g=this.fragCurrent,T=this.media,N=this.mediaBuffer,V=this.state,Y=T?T.currentTime:0,U=G.BufferHelper.bufferInfo(N||T,Y,h.maxBufferHole);if(this.log("media seeking to "+(Object(X.isFiniteNumber)(Y)?Y.toFixed(3):Y)+", state: "+V),V===O.ENDED)this.resetLoadingState();else if(g&&!U.len){var A=h.maxFragLookUpTolerance,J=g.start-A,ne=g.start+g.duration+A,oe=Y>ne;(Y<J||oe)&&(oe&&g.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),g.loader.abort()),this.resetLoadingState())}T&&(this.lastCurrentTime=Y),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=Y),this.tickImmediate()},l.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},l.onKeyLoaded=function(h,g){if(this.state!==O.KEY_LOADING||g.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var T=this.levels[g.frag.level].details;T&&this.loadFragment(g.frag,T,g.frag.start)},l.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},l.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(P.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,E.prototype.onHandlerDestroyed.call(this)},l.loadKey=function(h,g){this.log("Loading key for "+h.sn+" of ["+g.startSN+"-"+g.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level),this.state=O.KEY_LOADING,this.fragCurrent=h,this.hls.trigger(P.Events.KEY_LOADING,{frag:h})},l.loadFragment=function(h,g,T){this._loadFragForPlayback(h,g,T)},l._loadFragForPlayback=function(h,g,T){var N=this,V=function(U){if(N.fragContextChanged(h)){N.warn("Fragment "+h.sn+(U.part?" p: "+U.part.index:"")+" of level "+h.level+" was dropped during download."),N.fragmentTracker.removeFragment(h);return}h.stats.chunkCount++,N._handleFragmentLoadProgress(U)};this._doFragLoad(h,g,T,V).then(function(Y){if(!Y)return;N.fragLoadError=0;var U=N.state;if(N.fragContextChanged(h)){(U===O.FRAG_LOADING||U===O.BACKTRACKING||!N.fragCurrent&&U===O.PARSING)&&(N.fragmentTracker.removeFragment(h),N.state=O.IDLE);return}if("payload"in Y&&(N.log("Loaded fragment "+h.sn+" of level "+h.level),N.hls.trigger(P.Events.FRAG_LOADED,Y),N.state===O.BACKTRACKING)){N.fragmentTracker.backtrack(h,Y),N.resetFragmentLoading(h);return}N._handleFragmentLoadComplete(Y)}).catch(function(Y){N.warn(Y),N.resetFragmentLoading(h)})},l.flushMainBuffer=function(h,g,T){if(T===void 0&&(T=null),!(h-g))return;var N={startOffset:h,endOffset:g,type:T};this.fragLoadError=0,this.hls.trigger(P.Events.BUFFER_FLUSHING,N)},l._loadInitSegment=function(h){var g=this;this._doFragLoad(h).then(function(T){if(!T||g.fragContextChanged(h)||!g.levels)throw new Error("init load aborted");return T}).then(function(T){var N=g.hls,V=T.payload,Y=h.decryptdata;if(V&&V.byteLength>0&&Y&&Y.key&&Y.iv&&Y.method==="AES-128"){var U=self.performance.now();return g.decrypter.webCryptoDecrypt(new Uint8Array(V),Y.key.buffer,Y.iv.buffer).then(function(A){var J=self.performance.now();return N.trigger(P.Events.FRAG_DECRYPTED,{frag:h,payload:A,stats:{tstart:U,tdecrypt:J}}),T.payload=A,T})}return T}).then(function(T){var N=g.fragCurrent,V=g.hls,Y=g.levels;if(!Y)throw new Error("init load aborted, missing levels");var U=Y[h.level].details;console.assert(U,"Level details are defined when init segment is loaded");var A=h.stats;g.state=O.IDLE,g.fragLoadError=0,h.data=new Uint8Array(T.payload),A.parsing.start=A.buffering.start=self.performance.now(),A.parsing.end=A.buffering.end=self.performance.now(),T.frag===N&&V.trigger(P.Events.FRAG_BUFFERED,{stats:A,frag:N,part:null,id:h.type}),g.tick()}).catch(function(T){g.warn(T),g.resetFragmentLoading(h)})},l.fragContextChanged=function(h){var g=this.fragCurrent;return!h||!g||h.level!==g.level||h.sn!==g.sn||h.urlId!==g.urlId},l.fragBufferedComplete=function(h,g){var T=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+h.type+" sn: "+h.sn+(g?" part: "+g.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+h.level+" "+r.default.toString(G.BufferHelper.getBuffered(T))),this.state=O.IDLE,this.tick()},l._handleFragmentLoadComplete=function(h){var g=this.transmuxer;if(!g)return;var T=h.frag,N=h.part,V=h.partsLoaded,Y=!V||V.length===0||V.some(function(A){return!A}),U=new y.ChunkMetadata(T.level,T.sn,T.stats.chunkCount+1,0,N?N.index:-1,!Y);g.flush(U)},l._handleFragmentLoadProgress=function(h){},l._doFragLoad=function(h,g,T,N){var V=this;if(T===void 0&&(T=null),!this.levels)throw new Error("frag load aborted, missing levels");if(T=Math.max(h.start,T||0),this.config.lowLatencyMode&&g){var Y=g.partList;if(Y&&N){T>h.end&&g.fragmentHint&&(h=g.fragmentHint);var U=this.getNextPart(Y,h,T);if(U>-1){var A=Y[U];return this.log("Loading part sn: "+h.sn+" p: "+A.index+" cc: "+h.cc+" of playlist ["+g.startSN+"-"+g.endSN+"] parts [0-"+U+"-"+(Y.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(T.toFixed(3))),this.nextLoadPosition=A.start+A.duration,this.state=O.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:h,part:Y[U],targetBufferTime:T}),this.doFragPartsLoad(h,Y,U,N).catch(function(J){return V.handleFragLoadError(J)})}else if(!h.url||this.loadedEndOfParts(Y,T))return Promise.resolve(null)}}return this.log("Loading fragment "+h.sn+" cc: "+h.cc+" "+(g?"of ["+g.startSN+"-"+g.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+h.level+", target: "+parseFloat(T.toFixed(3))),Object(X.isFiniteNumber)(h.sn)&&!this.bitrateTest&&(this.nextLoadPosition=h.start+h.duration),this.state=O.FRAG_LOADING,this.hls.trigger(P.Events.FRAG_LOADING,{frag:h,targetBufferTime:T}),this.fragmentLoader.load(h,N).catch(function(J){return V.handleFragLoadError(J)})},l.doFragPartsLoad=function(h,g,T,N){var V=this;return new Promise(function(Y,U){var A=[],J=function ne(oe){var fe=g[oe];V.fragmentLoader.loadPart(h,fe,N).then(function(ke){A[fe.index]=ke;var Oe=ke.part;V.hls.trigger(P.Events.FRAG_LOADED,ke);var Me=g[oe+1];if(Me&&Me.fragment===h)ne(oe+1);else return Y({frag:h,part:Oe,partsLoaded:A})}).catch(U)};J(T)})},l.handleFragLoadError=function(h){var g=h.data;return g&&g.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(g.frag,g.part):this.hls.trigger(P.Events.ERROR,g),null},l._handleTransmuxerFlush=function(h){var g=this.getCurrentContext(h);if(!g||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var T=g.frag,N=g.part,V=g.level,Y=self.performance.now();T.stats.parsing.end=Y,N&&(N.stats.parsing.end=Y),this.updateLevelTiming(T,N,V,h.partial)},l.getCurrentContext=function(h){var g=this.levels,T=h.level,N=h.sn,V=h.part;if(!g||!g[T])return this.warn("Levels object was unset while buffering fragment "+N+" of level "+T+". The current chunk will not be buffered."),null;var Y=g[T],U=V>-1?Object(u.getPartWith)(Y,N,V):null,A=U?U.fragment:Object(u.getFragmentWithSN)(Y,N,this.fragCurrent);return A?{frag:A,part:U,level:Y}:null},l.bufferFragmentData=function(h,g,T,N){if(!h||this.state!==O.PARSING)return;var V=h.data1,Y=h.data2,U=V;if(V&&Y&&(U=Object(m.appendUint8Array)(V,Y)),!U||!U.length)return;var A={type:h.type,frag:g,part:T,chunkMeta:N,parent:g.type,data:U};this.hls.trigger(P.Events.BUFFER_APPENDING,A),h.dropped&&h.independent&&!T&&this.flushBufferGap(g)},l.flushBufferGap=function(h){var g=this.media;if(!g)return;if(!G.BufferHelper.isBuffered(g,g.currentTime)){this.flushMainBuffer(0,h.start);return}var T=g.currentTime,N=G.BufferHelper.bufferInfo(g,T,0),V=h.duration,Y=Math.min(this.config.maxFragLookUpTolerance*2,V*.25),U=Math.max(Math.min(h.start-Y,N.end-Y),T+Y);h.start-U>Y&&this.flushMainBuffer(U,h.start)},l.getFwdBufferInfo=function(h,g){var T=this.config,N=this.getLoadPosition();if(!Object(X.isFiniteNumber)(N))return null;var V=G.BufferHelper.bufferInfo(h,N,T.maxBufferHole);if(V.len===0&&V.nextStart!==void 0){var Y=this.fragmentTracker.getBufferedFrag(N,g);if(Y&&V.nextStart<Y.end)return G.BufferHelper.bufferInfo(h,N,Math.max(V.nextStart,T.maxBufferHole))}return V},l.getMaxBufferLength=function(h){var g=this.config,T;return h?T=Math.max(8*g.maxBufferSize/h,g.maxBufferLength):T=g.maxBufferLength,Math.min(T,g.maxMaxBufferLength)},l.reduceMaxBufferLength=function(h){var g=this.config,T=h||g.maxBufferLength;return g.maxMaxBufferLength>=T?(g.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+g.maxMaxBufferLength+"s"),!0):!1},l.getNextFragment=function(h,g){var T,N,V=g.fragments,Y=V.length;if(!Y)return null;var U=this.config,A=V[0].start,J;if(g.live){var ne=U.initialLiveManifestSize;if(Y<ne)return this.warn("Not enough fragments to start playback (have: "+Y+", need: "+ne+")"),null;!g.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(J=this.getInitialLiveFragment(g,V),this.startPosition=J?this.hls.liveSyncPosition||J.start:h)}else h<=A&&(J=V[0]);if(!J){var oe=U.lowLatencyMode?g.partEnd:g.fragmentEnd;J=this.getFragmentAtPosition(h,oe,g)}return(T=J)!==null&&T!==void 0&&T.initSegment&&!((N=J)!==null&&N!==void 0&&N.initSegment.data)&&!this.bitrateTest&&(J=J.initSegment),J},l.getNextPart=function(h,g,T){for(var N=-1,V=!1,Y=!0,U=0,A=h.length;U<A;U++){var J=h[U];if(Y=Y&&!J.independent,N>-1&&T<J.start)break;var ne=J.loaded;!ne&&(V||J.independent||Y)&&J.fragment===g&&(N=U),V=ne}return N},l.loadedEndOfParts=function(h,g){var T=h[h.length-1];return T&&g>T.start&&T.loaded},l.getInitialLiveFragment=function(h,g){var T=this.fragPrevious,N=null;if(T){if(h.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+T.programDateTime),N=Object(c.findFragmentByPDT)(g,T.endProgramDateTime,this.config.maxFragLookUpTolerance)),!N){var V=T.sn+1;if(V>=h.startSN&&V<=h.endSN){var Y=g[V-h.startSN];T.cc===Y.cc&&(N=Y,this.log("Live playlist, switching playlist, load frag with next SN: "+N.sn))}N||(N=Object(c.findFragWithCC)(g,T.cc),N&&this.log("Live playlist, switching playlist, load frag with same CC: "+N.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(N=this.getFragmentAtPosition(U,this.bitrateTest?h.fragmentEnd:h.edge,h))}return N},l.getFragmentAtPosition=function(h,g,T){var N=this.config,V=this.fragPrevious,Y=T.fragments,U=T.endSN,A=T.fragmentHint,J=N.maxFragLookUpTolerance,ne=!!(N.lowLatencyMode&&T.partList&&A);ne&&A&&!this.bitrateTest&&(Y=Y.concat(A),U=A.sn);var oe;if(h<g){var fe=h>g-J?0:J;oe=Object(c.findFragmentByPTS)(V,Y,h,fe)}else oe=Y[Y.length-1];if(oe){var ke=oe.sn-T.startSN,Oe=V&&oe.level===V.level,Me=Y[ke+1],Be=this.fragmentTracker.getState(oe);if(Be===B.FragmentState.BACKTRACKED){oe=null;for(var Pe=ke;Y[Pe]&&this.fragmentTracker.getState(Y[Pe])===B.FragmentState.BACKTRACKED;)V?oe=Y[Pe--]:oe=Y[--Pe];oe||(oe=Me)}else V&&oe.sn===V.sn&&!ne&&(Oe&&(oe.sn<U&&this.fragmentTracker.getState(Me)!==B.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+Me.sn),oe=Me):oe=null))}return oe},l.synchronizeToLiveEdge=function(h){var g=this.config,T=this.media;if(!T)return;var N=this.hls.liveSyncPosition,V=T.currentTime,Y=h.fragments[0].start,U=h.edge,A=V>=Y-g.maxFragLookUpTolerance&&V<=U;if(N!==null&&T.duration>N&&(V<N||!A)){var J=g.liveMaxLatencyDuration!==void 0?g.liveMaxLatencyDuration:g.liveMaxLatencyDurationCount*h.targetduration;(!A&&T.readyState<4||V<U-J)&&(this.loadedmetadata||(this.nextLoadPosition=N),T.readyState&&(this.warn("Playback: "+V.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+N.toFixed(3)),T.currentTime=N))}},l.alignPlaylists=function(h,g){var T=this.levels,N=this.levelLastLoaded,V=this.fragPrevious,Y=N!==null?T[N]:null,U=h.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var A=h.fragments[0].start,J=!g,ne=h.alignedSliding&&Object(X.isFiniteNumber)(A);if(J||!ne&&!A){Object(p.alignStream)(V,Y,h);var oe=h.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(g?g.startSN:"na")+"->"+h.startSN+" prev-sn: "+(V?V.sn:"na")+" fragments: "+U),oe}return A},l.waitForCdnTuneIn=function(h){var g=3;return h.live&&h.canBlockReload&&h.tuneInGoal>Math.max(h.partHoldBack,h.partTarget*g)},l.setStartPosition=function(h,g){var T=this.startPosition;if(T<g&&(T=-1),T===-1||this.lastCurrentTime===-1){var N=h.startTimeOffset;Object(X.isFiniteNumber)(N)?(T=g+N,N<0&&(T+=h.totalduration),T=Math.min(Math.max(g,T),g+h.totalduration),this.log("Start time offset "+N+" found in playlist, adjust startPosition to "+T),this.startPosition=T):h.live?T=this.hls.liveSyncPosition||g:this.startPosition=T=0,this.lastCurrentTime=T}this.nextLoadPosition=T},l.getLoadPosition=function(){var h=this.media,g=0;return this.loadedmetadata&&h?g=h.currentTime:this.nextLoadPosition&&(g=this.nextLoadPosition),g},l.handleFragLoadAborted=function(h,g){this.transmuxer&&h.sn!=="initSegment"&&h.stats.aborted&&(this.warn("Fragment "+h.sn+(g?" part"+g.index:"")+" of level "+h.level+" was aborted"),this.resetFragmentLoading(h))},l.resetFragmentLoading=function(h){(!this.fragCurrent||!this.fragContextChanged(h))&&(this.state=O.IDLE)},l.onFragmentOrKeyLoadError=function(h,g){if(g.fatal)return;var T=g.frag;if(!T||T.type!==h)return;var N=this.fragCurrent;console.assert(N&&T.sn===N.sn&&T.level===N.level&&T.urlId===N.urlId,"Frag load error must match current frag to retry");var V=this.config;if(this.fragLoadError+1<=V.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(T.level))return;var Y=Math.min(Math.pow(2,this.fragLoadError)*V.fragLoadingRetryDelay,V.fragLoadingMaxRetryTimeout);this.warn("Fragment "+T.sn+" of "+h+" "+T.level+" failed to load, retrying in "+Y+"ms"),this.retryDate=self.performance.now()+Y,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else g.levelRetry?(h===a.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(j.logger.error(g.details+" reaches max retry, redispatch as fatal ..."),g.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},l.afterBufferFlushed=function(h,g,T){if(!h)return;var N=G.BufferHelper.getBuffered(h);this.fragmentTracker.detectEvictedFragments(g,N,T),this.state===O.ENDED&&this.resetLoadingState()},l.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},l.resetLiveStartWhenNotLoaded=function(h){if(!this.loadedmetadata){this.startFragRequested=!1;var g=this.levels?this.levels[h].details:null;if(g!=null&&g.live)return this.startPosition=-1,this.setStartPosition(g,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},l.updateLevelTiming=function(h,g,T,N){var V=this,Y=T.details;console.assert(!!Y,"level.details must be defined");var U=Object.keys(h.elementaryStreams).reduce(function(A,J){var ne=h.elementaryStreams[J];if(ne){var oe=ne.endPTS-ne.startPTS;if(oe<=0)return V.warn("Could not parse fragment "+h.sn+" "+J+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),V.resetTransmuxer(),A||!1;var fe=N?0:Object(u.updateFragPTSDTS)(Y,h,ne.startPTS,ne.endPTS,ne.startDTS,ne.endDTS);return V.hls.trigger(P.Events.LEVEL_PTS_UPDATED,{details:Y,level:T,drift:fe,type:J,frag:h,start:ne.startPTS,end:ne.endPTS}),!0}return A},!1);U?(this.state=O.PARSED,this.hls.trigger(P.Events.FRAG_PARSED,{frag:h,part:g})):this.resetLoadingState()},l.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},L(b,[{key:"state",get:function(){return this._state},set:function(h){var g=this._state;g!==h&&(this._state=h,this.log(g+"->"+h))}}]),b}(D.default)},"./src/controller/buffer-controller.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return c});var X=k("./src/polyfills/number.ts"),D=k("./src/events.ts"),B=k("./src/utils/logger.ts"),G=k("./src/errors.ts"),j=k("./src/utils/buffer-helper.ts"),P=k("./src/utils/mediasource-helper.ts"),I=k("./src/loader/fragment.ts"),y=k("./src/controller/buffer-operation-queue.ts"),m=Object(P.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function u(s){var r=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var a=r.hls,d=r.media,L=r.mediaSource;B.logger.log("[buffer-controller]: Media source opened"),d&&(r.updateMediaElementDuration(),a.trigger(D.Events.MEDIA_ATTACHED,{media:d})),L&&L.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){B.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){B.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var f=u.prototype;return f.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},f.destroy=function(){this.unregisterListeners(),this.details=null},f.registerListeners=function(){var r=this.hls;r.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(D.Events.BUFFER_RESET,this.onBufferReset,this),r.on(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(D.Events.BUFFER_EOS,this.onBufferEos,this),r.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(D.Events.FRAG_PARSED,this.onFragParsed,this),r.on(D.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var r=this.hls;r.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(D.Events.BUFFER_RESET,this.onBufferReset,this),r.off(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(D.Events.BUFFER_EOS,this.onBufferEos,this),r.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(D.Events.FRAG_PARSED,this.onFragParsed,this),r.off(D.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(r,a){var d=2;(a.audio&&!a.video||!a.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,B.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(r,a){var d=this.media=a.media;if(d&&m){var L=this.mediaSource=new m;L.addEventListener("sourceopen",this._onMediaSourceOpen),L.addEventListener("sourceended",this._onMediaSourceEnded),L.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(L),this._objectUrl=d.src}},f.onMediaDetaching=function(){var r=this.media,a=this.mediaSource,d=this._objectUrl;if(a){if(B.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(L){B.logger.warn("[buffer-controller]: onMediaDetaching: "+L.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(d&&self.URL.revokeObjectURL(d),r.src===d?(r.removeAttribute("src"),r.load()):B.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(D.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(a){var d=r.sourceBuffer[a];try{d&&(r.removeBufferListeners(a),r.mediaSource&&r.mediaSource.removeSourceBuffer(d),r.sourceBuffer[a]=void 0)}catch(L){B.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",L)}}),this._initSourceBuffer()},f.onBufferCodecs=function(r,a){var d=this,L=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(S){if(L){var x=d.tracks[S];if(x&&typeof x.buffer.changeType=="function"){var R=a[S],O=R.codec,w=R.levelCodec,E=R.container,b=(x.levelCodec||x.codec).replace(p,"$1"),l=(w||O).replace(p,"$1");if(b!==l){var _=E+";codecs="+(w||O);d.appendChangeType(S,_)}}}else d.pendingTracks[S]=a[S]}),L)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(r,a){var d=this,L=this.operationQueue,S={execute:function(){var R=d.sourceBuffer[r];R&&(B.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+a),R.changeType(a)),L.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(R){B.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",R)}};L.append(S,r)},f.onBufferAppending=function(r,a){var d=this,L=this.hls,S=this.operationQueue,x=this.tracks,R=a.data,O=a.type,w=a.frag,E=a.part,b=a.chunkMeta,l=b.buffering[O],_=self.performance.now();l.start=_;var h=w.stats.buffering,g=E?E.stats.buffering:null;h.start===0&&(h.start=_),g&&g.start===0&&(g.start=_);var T=x.audio,N=O==="audio"&&b.id===1&&(T==null?void 0:T.container)==="audio/mpeg",V={execute:function(){if(l.executeStart=self.performance.now(),N){var U=d.sourceBuffer[O];if(U){var A=w.start-U.timestampOffset;Math.abs(A)>=.1&&(B.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+w.start+" (delta: "+A+") sn: "+w.sn+")"),U.timestampOffset=w.start)}}d.appendExecutor(R,O)},onStart:function(){},onComplete:function(){var U=self.performance.now();l.executeEnd=l.end=U,h.first===0&&(h.first=U),g&&g.first===0&&(g.first=U);var A=d.sourceBuffer,J={};for(var ne in A)J[ne]=j.BufferHelper.getBuffered(A[ne]);d.appendError=0,d.hls.trigger(D.Events.BUFFER_APPENDED,{type:O,frag:w,part:E,chunkMeta:b,parent:w.type,timeRanges:J})},onError:function(U){B.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",U);var A={type:G.ErrorTypes.MEDIA_ERROR,parent:w.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?A.details=G.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,A.details=G.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>L.config.appendErrorMaxRetry&&(B.logger.error("[buffer-controller]: Failed "+L.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),A.fatal=!0)),L.trigger(D.Events.ERROR,A)}};S.append(V,O)},f.onBufferFlushing=function(r,a){var d=this,L=this.operationQueue,S=function(R){return{execute:d.removeExecutor.bind(d,R,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(D.Events.BUFFER_FLUSHED,{type:R})},onError:function(w){B.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",w)}}};a.type?L.append(S(a.type),a.type):this.getSourceBufferTypes().forEach(function(x){L.append(S(x),x)})},f.onFragParsed=function(r,a){var d=this,L=a.frag,S=a.part,x=[],R=S?S.elementaryStreams:L.elementaryStreams;R[I.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(R[I.ElementaryStreamTypes.AUDIO]&&x.push("audio"),R[I.ElementaryStreamTypes.VIDEO]&&x.push("video"));var O=function(){var E=self.performance.now();L.stats.buffering.end=E,S&&(S.stats.buffering.end=E);var b=S?S.stats:L.stats;d.hls.trigger(D.Events.FRAG_BUFFERED,{frag:L,part:S,stats:b,id:L.type})};x.length===0&&B.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+L.type+" level: "+L.level+" sn: "+L.sn),this.blockBuffers(O,x)},f.onFragChanged=function(r,a){this.flushBackBuffer()},f.onBufferEos=function(r,a){var d=this,L=this.getSourceBufferTypes().reduce(function(S,x){var R=d.sourceBuffer[x];return(!a.type||a.type===x)&&(R&&!R.ended&&(R.ended=!0,B.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),S&&!!(!R||R.ended)},!0);L&&this.blockBuffers(function(){var S=d.mediaSource;if(!S||S.readyState!=="open")return;S.endOfStream()})},f.onLevelUpdated=function(r,a){var d=a.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},f.flushBackBuffer=function(){var r=this.hls,a=this.details,d=this.media,L=this.sourceBuffer;if(!d||a===null)return;var S=this.getSourceBufferTypes();if(!S.length)return;var x=a.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(X.isFiniteNumber)(x)||x<0)return;var R=d.currentTime,O=a.levelTargetDuration,w=Math.max(x,O),E=Math.floor(R/O)*O-w;S.forEach(function(b){var l=L[b];if(l){var _=j.BufferHelper.getBuffered(l);_.length>0&&E>_.start(0)&&(r.trigger(D.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),a.live&&r.trigger(D.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),r.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:b}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,a=this.hls,d=this.media,L=this.mediaSource,S=r.fragments[0].start+r.totalduration,x=d.duration,R=Object(X.isFiniteNumber)(L.duration)?L.duration:0;r.live&&a.config.liveDurationInfinity?(B.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),L.duration=Infinity,this.updateSeekableRange(r)):(S>R&&S>x||!Object(X.isFiniteNumber)(x))&&(B.logger.log("[buffer-controller]: Updating Media Source duration to "+S.toFixed(3)),L.duration=S)},f.updateSeekableRange=function(r){var a=this.mediaSource,d=r.fragments,L=d.length;if(L&&r.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var S=Math.max(0,d[0].start),x=Math.max(S,S+r.totalduration);a.setLiveSeekableRange(S,x)}},f.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,a=this.operationQueue,d=this.pendingTracks,L=Object.keys(d).length;if(L&&!r||L===2){this.createSourceBuffers(d),this.pendingTracks={};var S=this.getSourceBufferTypes();if(S.length===0){this.hls.trigger(D.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}S.forEach(function(x){a.executeNext(x)})}},f.createSourceBuffers=function(r){var a=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var L=0;for(var S in r)if(!a[S]){var x=r[S];if(!x)throw Error("source buffer exists for track "+S+", however track does not");var R=x.levelCodec||x.codec,O=x.container+";codecs="+R;B.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var w=a[S]=d.addSourceBuffer(O),E=S;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[S]={buffer:w,codec:R,container:x.container,levelCodec:x.levelCodec,id:x.id},L++}catch(b){B.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+b.message),this.hls.trigger(D.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:b,mimeType:O})}}L&&this.hls.trigger(D.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(r){var a=this.operationQueue,d=a.current(r);d.onStart()},f._onSBUpdateEnd=function(r){var a=this.operationQueue,d=a.current(r);d.onComplete(),a.shiftAndExecuteNext(r)},f._onSBUpdateError=function(r,a){B.logger.error("[buffer-controller]: "+r+" SourceBuffer error",a),this.hls.trigger(D.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(r);d&&d.onError(a)},f.removeExecutor=function(r,a,d){var L=this.media,S=this.mediaSource,x=this.operationQueue,R=this.sourceBuffer,O=R[r];if(!L||!S||!O){B.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(r);return}var w=Object(X.isFiniteNumber)(L.duration)?L.duration:Infinity,E=Object(X.isFiniteNumber)(S.duration)?S.duration:Infinity,b=Math.max(0,a),l=Math.min(d,w,E);l>b?(B.logger.log("[buffer-controller]: Removing ["+b+","+l+"] from the "+r+" SourceBuffer"),console.assert(!O.updating,r+" sourceBuffer must not be updating"),O.remove(b,l)):x.shiftAndExecuteNext(r)},f.appendExecutor=function(r,a){var d=this.operationQueue,L=this.sourceBuffer,S=L[a];if(!S){B.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(a);return}S.ended=!1,console.assert(!S.updating,a+" sourceBuffer must not be updating"),S.appendBuffer(r)},f.blockBuffers=function(r,a){var d=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){B.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var L=this.operationQueue,S=a.map(function(x){return L.appendBlocker(x)});Promise.all(S).then(function(){r(),a.forEach(function(x){var R=d.sourceBuffer[x];(!R||!R.updating)&&L.shiftAndExecuteNext(x)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(r,a,d){var L=this.sourceBuffer[r];if(!L)return;var S=d.bind(this,r);this.listeners[r].push({event:a,listener:S}),L.addEventListener(a,S)},f.removeBufferListeners=function(r){var a=this.sourceBuffer[r];if(!a)return;this.listeners[r].forEach(function(d){a.removeEventListener(d.event,d.listener)})},u}()},"./src/controller/buffer-operation-queue.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return D});var X=k("./src/utils/logger.ts"),D=function(){function B(j){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=j}var G=B.prototype;return G.append=function(P,I){var y=this.queues[I];y.push(P),y.length===1&&this.buffers[I]&&this.executeNext(I)},G.insertAbort=function(P,I){var y=this.queues[I];y.unshift(P),this.executeNext(I)},G.appendBlocker=function(P){var I,y=new Promise(function(p){I=p}),m={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,P),y},G.executeNext=function(P){var I=this.buffers,y=this.queues,m=I[P],p=y[P];if(p.length){var c=p[0];try{c.execute()}catch(u){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(u),(!m||!m.updating)&&(p.shift(),this.executeNext(P))}}},G.shiftAndExecuteNext=function(P){this.queues[P].shift(),this.executeNext(P)},G.current=function(P){return this.queues[P][0]},B}()},"./src/controller/cap-level-controller.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/events.ts");function D(j,P){for(var I=0;I<P.length;I++){var y=P[I];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(j,y.key,y)}}function B(j,P,I){return P&&D(j.prototype,P),I&&D(j,I),j}var G=function(){function j(I){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var P=j.prototype;return P.setStreamController=function(y){this.streamController=y},P.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},P.registerListeners=function(){var y=this.hls;y.on(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.unregisterListener=function(){var y=this.hls;y.off(X.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(X.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},P.onFpsDropLevelCapping=function(y,m){j.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},P.onMediaAttaching=function(y,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},P.onManifestParsed=function(y,m){var p=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},P.onBufferCodecs=function(y,m){var p=this.hls;p.config.capLevelToPlayerSize&&m.video&&this.startCapping()},P.onMediaDetaching=function(){this.stopCapping()},P.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(y.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},P.getMaxLevel=function(y){var m=this,p=this.hls.levels;if(!p.length)return-1;var c=p.filter(function(u,f){return j.isLevelAllowed(f,m.restrictedLevels)&&f<=y});return this.clientRect=null,j.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},P.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},P.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},P.getDimensions=function(){if(this.clientRect)return this.clientRect;var y=this.media,m={width:0,height:0};if(y){var p=y.getBoundingClientRect();m.width=p.width,m.height=p.height,!m.width&&!m.height&&(m.width=p.right-p.left||y.width||0,m.height=p.bottom-p.top||y.height||0)}return this.clientRect=m,m},j.isLevelAllowed=function(y,m){return m===void 0&&(m=[]),m.indexOf(y)===-1},j.getMaxLevelByMediaSize=function(y,m,p){if(!y||!y.length)return-1;for(var c=function(a,d){return d?a.width!==d.width||a.height!==d.height:!0},u=y.length-1,f=0;f<y.length;f+=1){var s=y[f];if((s.width>=m||s.height>=p)&&c(s,y[f+1])){u=f;break}}return u},B(j,[{key:"mediaWidth",get:function(){return this.getDimensions().width*j.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*j.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(m){}return y}}]),j}();W.default=G},"./src/controller/cmcd-controller.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return c});var X=k("./src/events.ts"),D=k("./src/types/cmcd.ts"),B=k("./src/utils/buffer-helper.ts"),G=k("./src/utils/logger.ts");function j(u,f){for(var s=0;s<f.length;s++){var r=f[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(u,r.key,r)}}function P(u,f,s){return f&&j(u.prototype,f),s&&j(u,s),u}function I(u,f){var s=typeof Symbol!="undefined"&&u[Symbol.iterator]||u["@@iterator"];if(s)return(s=s.call(u)).next.bind(s);if(Array.isArray(u)||(s=y(u))||f&&u&&typeof u.length=="number"){s&&(u=s);var r=0;return function(){return r>=u.length?{done:!0}:{done:!1,value:u[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(u,f){if(!u)return;if(typeof u=="string")return m(u,f);var s=Object.prototype.toString.call(u).slice(8,-1);if(s==="Object"&&u.constructor&&(s=u.constructor.name),s==="Map"||s==="Set")return Array.from(u);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return m(u,f)}function m(u,f){(f==null||f>u.length)&&(f=u.length);for(var s=0,r=new Array(f);s<f;s++)r[s]=u[s];return r}function p(){return p=Object.assign||function(u){for(var f=1;f<arguments.length;f++){var s=arguments[f];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(u[r]=s[r])}return u},p.apply(this,arguments)}var c=function(){function u(s){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(L){try{r.apply(L,{ot:D.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(S){G.logger.warn("Could not generate manifest CMCD data.",S)}},this.applyFragmentData=function(L){try{var S=L.frag,x=r.hls.levels[S.level],R=r.getObjectType(S),O={d:S.duration*1e3,ot:R};(R===D.CMCDObjectType.VIDEO||R===D.CMCDObjectType.AUDIO||R==D.CMCDObjectType.MUXED)&&(O.br=x.bitrate/1e3,O.tb=r.getTopBandwidth(R),O.bl=r.getBufferLength(R)),r.apply(L,O)}catch(w){G.logger.warn("Could not generate segment CMCD data.",w)}},this.hls=s;var a=this.config=s.config,d=a.cmcd;d!=null&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||u.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var f=u.prototype;return f.registerListeners=function(){var r=this.hls;r.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(X.Events.BUFFER_CREATED,this.onBufferCreated,this)},f.unregisterListeners=function(){var r=this.hls;r.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(X.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},f.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},f.onMediaAttached=function(r,a){this.media=a.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},f.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},f.onBufferCreated=function(r,a){var d,L;this.audioBuffer=(d=a.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(L=a.tracks.video)===null||L===void 0?void 0:L.buffer},f.createData=function(){var r;return{v:D.CMCDVersion,sf:D.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},f.apply=function(r,a){a===void 0&&(a={}),p(a,this.createData());var d=a.ot===D.CMCDObjectType.INIT||a.ot===D.CMCDObjectType.VIDEO||a.ot===D.CMCDObjectType.MUXED;if(this.starved&&d&&(a.bs=!0,a.su=!0,this.starved=!1),a.su==null&&(a.su=this.buffering),this.useHeaders){var L=u.toHeaders(a);if(!Object.keys(L).length)return;r.headers||(r.headers={}),p(r.headers,L)}else{var S=u.toQuery(a);if(!S)return;r.url=u.appendQueryToUri(r.url,S)}},f.getObjectType=function(r){var a=r.type;return a==="subtitle"?D.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?D.CMCDObjectType.INIT:a==="audio"?D.CMCDObjectType.AUDIO:a==="main"?this.hls.audioTracks.length?D.CMCDObjectType.VIDEO:D.CMCDObjectType.MUXED:void 0},f.getTopBandwidth=function(r){for(var a=0,d=r===D.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,L=I(d),S;!(S=L()).done;){var x=S.value;x.bitrate>a&&(a=x.bitrate)}return a>0?a:NaN},f.getBufferLength=function(r){var a=this.hls.media,d=r===D.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!a)return NaN;var L=B.BufferHelper.bufferInfo(d,a.currentTime,this.config.maxBufferHole);return L.len*1e3},f.createPlaylistLoader=function(){var r=this.config.pLoader,a=this.applyPlaylistData,d=r||this.config.loader;return function(){function L(x){this.loader=void 0,this.loader=new d(x)}var S=L.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(R,O,w){a(R),this.loader.load(R,O,w)},P(L,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),L}()},f.createFragmentLoader=function(){var r=this.config.fLoader,a=this.applyFragmentData,d=r||this.config.loader;return function(){function L(x){this.loader=void 0,this.loader=new d(x)}var S=L.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(R,O,w){a(R),this.loader.load(R,O,w)},P(L,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),L}()},u.uuid=function(){var r=URL.createObjectURL(new Blob),a=r.toString();return URL.revokeObjectURL(r),a.substr(a.lastIndexOf("/")+1)},u.serialize=function(r){for(var a=[],d=function(N){return!Number.isNaN(N)&&N!=null&&N!==""&&N!==!1},L=function(N){return Math.round(N)},S=function(N){return L(N/100)*100},x=function(N){return encodeURIComponent(N)},R={br:L,d:L,bl:S,dl:S,mtp:S,nor:x,rtp:S,tb:L},O=Object.keys(r||{}).sort(),w=I(O),E;!(E=w()).done;){var b=E.value,l=r[b];if(!d(l))continue;if(b==="v"&&l===1)continue;if(b=="pr"&&l===1)continue;var _=R[b];_&&(l=_(l));var h=typeof l,g=void 0;b==="ot"||b==="sf"||b==="st"?g=b+"="+l:h==="boolean"?g=b:h==="number"?g=b+"="+l:g=b+"="+JSON.stringify(l),a.push(g)}return a.join(",")},u.toHeaders=function(r){for(var a=Object.keys(r),d={},L=["Object","Request","Session","Status"],S=[{},{},{},{}],x={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},R=0,O=a;R<O.length;R++){var w=O[R],E=x[w]!=null?x[w]:1;S[E][w]=r[w]}for(var b=0;b<S.length;b++){var l=u.serialize(S[b]);l&&(d["CMCD-"+L[b]]=l)}return d},u.toQuery=function(r){return"CMCD="+encodeURIComponent(u.serialize(r))},u.appendQueryToUri=function(r,a){if(!a)return r;var d=r.includes("?")?"&":"?";return""+r+d+a},u}()},"./src/controller/eme-controller.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/events.ts"),D=k("./src/errors.ts"),B=k("./src/utils/logger.ts"),G=k("./src/utils/mediakeys-helper.ts");function j(c,u){for(var f=0;f<u.length;f++){var s=u[f];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}function P(c,u,f){return u&&j(c.prototype,u),f&&j(c,f),c}var I=3,y=function(u,f,s){var r={audioCapabilities:[],videoCapabilities:[]};return u.forEach(function(a){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+a+'"',robustness:s.audioRobustness||""})}),f.forEach(function(a){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"',robustness:s.videoRobustness||""})}),[r]},m=function(u,f,s,r){switch(u){case G.KeySystems.WIDEVINE:return y(f,s,r);default:throw new Error("Unknown key-system: "+u)}},p=function(){function c(f){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=f,this._config=f.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var u=c.prototype;return u.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},u._registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},u._unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(X.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this)},u.getLicenseServerUrl=function(s){switch(s){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},u._attemptKeySystemAccess=function(s,r,a){var d=this,L=m(s,r,a,this._drmSystemOptions);B.logger.log("Requesting encrypted media key-system access");var S=this.requestMediaKeySystemAccess(s,L);this.mediaKeysPromise=S.then(function(x){return d._onMediaKeySystemAccessObtained(s,x)}),S.catch(function(x){B.logger.error('Failed to obtain key-system "'+s+'" access:',x)})},u._onMediaKeySystemAccessObtained=function(s,r){var a=this;B.logger.log('Access for key-system "'+s+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:s};this._mediaKeysList.push(d);var L=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(S){return d.mediaKeys=S,B.logger.log('Media-keys created for key-system "'+s+'"'),a._onMediaKeysCreated(),S});return L.catch(function(S){B.logger.error("Failed to create media-keys:",S)}),L},u._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),s._onNewMediaKeySession(r.mediaKeysSession))})},u._onNewMediaKeySession=function(s){var r=this;B.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(a){r._onKeySessionMessage(s,a.message)},!1)},u._onKeySessionMessage=function(s,r){B.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(a){B.logger.log("Received license data (length: "+(a&&a.byteLength)+"), updating key-session"),s.update(a)})},u.onMediaEncrypted=function(s){var r=this;if(B.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){B.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var a=function(L){if(!r._media)return;r._attemptSetMediaKeys(L),r._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(a).catch(a)},u._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var r=this._mediaKeysList[0];if(!r||!r.mediaKeys){B.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}B.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},u._generateRequestWithPreferredKeySession=function(s,r){var a=this,d=this._mediaKeysList[0];if(!d){B.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){B.logger.warn("Key-Session already initialized but requested again");return}var L=d.mediaKeysSession;if(!L){B.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){B.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}B.logger.log('Generating key-session request for "'+s+'" init data type'),d.mediaKeysSessionInitialized=!0,L.generateRequest(s,r).then(function(){B.logger.debug("Key-session generation succeeded")}).catch(function(S){B.logger.error("Error generating key-session request:",S),a.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},u._createLicenseXhr=function(s,r,a){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,s,r,a);var L=this._licenseXhrSetup;if(L)try{L.call(this.hls,d,s),L=void 0}catch(S){B.logger.error(S)}try{d.readyState||d.open("POST",s,!0),L&&L.call(this.hls,d,s)}catch(S){throw new Error("issue setting up KeySystem license XHR "+S)}return d},u._onLicenseRequestReadyStageChange=function(s,r,a,d){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,B.logger.log("License request succeeded");var L=s.response,S=this._licenseResponseCallback;if(S)try{L=S.call(this.hls,s,r)}catch(R){B.logger.error(R)}d(L)}else{if(B.logger.error("License Request XHR failed ("+r+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=I-this._requestLicenseFailureCount+1;B.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(a,d)}break}},u._generateLicenseRequestChallenge=function(s,r){switch(s.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},u._requestLicense=function(s,r){B.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){B.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(a.mediaKeySystemDomain),L=this._createLicenseXhr(d,s,r);B.logger.log("Sending license request to URL: "+d);var S=this._generateLicenseRequestChallenge(a,s);L.send(S)}catch(x){B.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},u.onMediaAttached=function(s,r){if(!this._emeEnabled)return;var a=r.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},u.onMediaDetached=function(){var s=this._media,r=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},u.onManifestParsed=function(s,r){if(!this._emeEnabled)return;var a=r.levels.map(function(L){return L.audioCodec}).filter(function(L){return!!L}),d=r.levels.map(function(L){return L.videoCodec}).filter(function(L){return!!L});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,a,d)},P(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();W.default=p},"./src/controller/fps-controller.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/events.ts"),D=k("./src/utils/logger.ts"),B=function(){function G(P){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=P,this.registerListeners()}var j=G.prototype;return j.setStreamController=function(I){this.streamController=I},j.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},j.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},j.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},j.onMediaAttaching=function(I,y){var m=this.hls.config;if(m.capLevelOnFPSDrop){var p=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},j.checkFPS=function(I,y,m){var p=performance.now();if(y){if(this.lastTime){var c=p-this.lastTime,u=m-this.lastDroppedFrames,f=y-this.lastDecodedFrames,s=1e3*u/c,r=this.hls;if(r.trigger(X.Events.FPS_DROP,{currentDropped:u,currentDecoded:f,totalDroppedFrames:m}),s>0&&u>r.config.fpsDroppedMonitoringThreshold*f){var a=r.currentLevel;D.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=a)&&(a=a-1,r.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:r.currentLevel}),r.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=m,this.lastDecodedFrames=y}},j.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var y=I.getVideoPlaybackQuality();this.checkFPS(I,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},G}();W.default=B},"./src/controller/fragment-finders.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"findFragmentByPDT",function(){return B}),k.d(W,"findFragmentByPTS",function(){return G}),k.d(W,"fragmentWithinToleranceTest",function(){return j}),k.d(W,"pdtWithinToleranceTest",function(){return P}),k.d(W,"findFragWithCC",function(){return I});var X=k("./src/polyfills/number.ts"),D=k("./src/utils/binary-search.ts");function B(y,m,p){if(m===null||!Array.isArray(y)||!y.length||!Object(X.isFiniteNumber)(m))return null;var c=y[0].programDateTime;if(m<(c||0))return null;var u=y[y.length-1].endProgramDateTime;if(m>=(u||0))return null;p=p||0;for(var f=0;f<y.length;++f){var s=y[f];if(P(m,p,s))return s}return null}function G(y,m,p,c){p===void 0&&(p=0),c===void 0&&(c=0);var u=null;if(y?u=m[y.sn-m[0].sn+1]||null:p===0&&m[0].start===0&&(u=m[0]),u&&j(p,c,u)===0)return u;var f=D.default.search(m,j.bind(null,p,c));return f||u}function j(y,m,p){y===void 0&&(y=0),m===void 0&&(m=0);var c=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-c<=y?1:p.start-c>y&&p.start?-1:0}function P(y,m,p){var c=Math.min(m,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,u=p.endProgramDateTime||0;return u-c>y}function I(y,m){return D.default.search(y,function(p){return p.cc<m?1:p.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"FragmentState",function(){return B}),k.d(W,"FragmentTracker",function(){return G});var X=k("./src/events.ts"),D=k("./src/types/loader.ts"),B;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(B||(B={}));var G=function(){function I(m){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=m,this._registerListeners()}var y=I.prototype;return y._registerListeners=function(){var p=this.hls;p.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var p=this.hls;p.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(p,c){if(c===D.PlaylistLevelType.MAIN){var u=this.activeFragment,f=this.activeParts;if(!u)return null;if(f)for(var s=f.length;s--;){var r=f[s],a=r?r.end:u.appendedPTS;if(r.start<=p&&a!==void 0&&p<=a)return s>9&&(this.activeParts=f.slice(s-9)),r}else if(u.start<=p&&u.appendedPTS!==void 0&&p<=u.appendedPTS)return u}return this.getBufferedFrag(p,c)},y.getBufferedFrag=function(p,c){for(var u=this.fragments,f=Object.keys(u),s=f.length;s--;){var r=u[f[s]];if((r==null?void 0:r.body.type)===c&&r.buffered){var a=r.body;if(a.start<=p&&p<=a.end)return a}}return null},y.detectEvictedFragments=function(p,c,u){var f=this;Object.keys(this.fragments).forEach(function(s){var r=f.fragments[s];if(!r)return;if(!r.buffered){r.body.type===u&&f.removeFragment(r.body);return}var a=r.range[p];if(!a)return;a.time.some(function(d){var L=!f.isTimeBuffered(d.startPTS,d.endPTS,c);return L&&f.removeFragment(r.body),L})})},y.detectPartialFragments=function(p){var c=this,u=this.timeRanges,f=p.frag,s=p.part;if(!u||f.sn==="initSegment")return;var r=P(f),a=this.fragments[r];if(!a)return;Object.keys(u).forEach(function(d){var L=f.elementaryStreams[d];if(!L)return;var S=u[d],x=s!==null||L.partial===!0;a.range[d]=c.getBufferedTimes(f,s,x,S)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},y.fragBuffered=function(p){var c=P(p),u=this.fragments[c];u&&(u.backtrack=u.loaded=null,u.buffered=!0)},y.getBufferedTimes=function(p,c,u,f){for(var s={time:[],partial:u},r=c?c.start:p.start,a=c?c.end:p.end,d=p.minEndPTS||a,L=p.maxStartPTS||r,S=0;S<f.length;S++){var x=f.start(S)-this.bufferPadding,R=f.end(S)+this.bufferPadding;if(L>=x&&d<=R){s.time.push({startPTS:Math.max(r,f.start(S)),endPTS:Math.min(a,f.end(S))});break}else if(r<R&&a>x)s.partial=!0,s.time.push({startPTS:Math.max(r,f.start(S)),endPTS:Math.min(a,f.end(S))});else if(a<=x)break}return s},y.getPartialFragment=function(p){var c=null,u,f,s,r=0,a=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(L){var S=d[L];if(!S)return;j(S)&&(f=S.body.start-a,s=S.body.end+a,p>=f&&p<=s&&(u=Math.min(p-f,s-p),r<=u&&(c=S.body,r=u)))}),c},y.getState=function(p){var c=P(p),u=this.fragments[c];return u?u.buffered?j(u)?B.PARTIAL:B.OK:u.backtrack?B.BACKTRACKED:B.APPENDING:B.NOT_LOADED},y.backtrack=function(p,c){var u=P(p),f=this.fragments[u];if(!f||f.backtrack)return null;var s=f.backtrack=c||f.loaded;return f.loaded=null,s},y.getBacktrackData=function(p){var c=P(p),u=this.fragments[c];if(u){var f,s=u.backtrack;if(s!=null&&(f=s.payload)!==null&&f!==void 0&&f.byteLength)return s;this.removeFragment(p)}return null},y.isTimeBuffered=function(p,c,u){for(var f,s,r=0;r<u.length;r++){if(f=u.start(r)-this.bufferPadding,s=u.end(r)+this.bufferPadding,p>=f&&c<=s)return!0;if(c<=f)return!1}return!1},y.onFragLoaded=function(p,c){var u=c.frag,f=c.part;if(u.sn==="initSegment"||u.bitrateTest||f)return;var s=P(u);this.fragments[s]={body:u,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(p,c){var u=this,f=c.frag,s=c.part,r=c.timeRanges;if(f.type===D.PlaylistLevelType.MAIN)if(this.activeFragment=f,s){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(s)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(d){var L=r[d];if(u.detectEvictedFragments(d,L),!s)for(var S=0;S<L.length;S++)f.appendedPTS=Math.max(L.end(S),f.appendedPTS||0)})},y.onFragBuffered=function(p,c){this.detectPartialFragments(c)},y.hasFragment=function(p){var c=P(p);return!!this.fragments[c]},y.removeFragmentsInRange=function(p,c,u){var f=this;Object.keys(this.fragments).forEach(function(s){var r=f.fragments[s];if(!r)return;if(r.buffered){var a=r.body;a.type===u&&a.start<c&&a.end>p&&f.removeFragment(a)}})},y.removeFragment=function(p){var c=P(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[c]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function j(I){var y,m;return I.buffered&&(((y=I.range.video)===null||y===void 0?void 0:y.partial)||((m=I.range.audio)===null||m===void 0?void 0:m.partial))}function P(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"STALL_MINIMUM_DURATION_MS",function(){return j}),k.d(W,"MAX_START_GAP_JUMP",function(){return P}),k.d(W,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),k.d(W,"SKIP_BUFFER_RANGE_START",function(){return y}),k.d(W,"default",function(){return m});var X=k("./src/utils/buffer-helper.ts"),D=k("./src/errors.ts"),B=k("./src/events.ts"),G=k("./src/utils/logger.ts"),j=250,P=2,I=.1,y=.05,m=function(){function p(u,f,s,r){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=u,this.media=f,this.fragmentTracker=s,this.hls=r}var c=p.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(f){var s=this.config,r=this.media,a=this.stalled,d=r.currentTime,L=r.seeking,S=this.seeking&&!L,x=!this.seeking&&L;if(this.seeking=L,d!==f){if(this.moved=!0,a!==null){if(this.stallReported){var R=self.performance.now()-a;G.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||S)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!X.BufferHelper.getBuffered(r).length)return;var O=X.BufferHelper.bufferInfo(r,d,0),w=O.len>0,E=O.nextStart||0;if(!w&&!E)return;if(L){var b=O.len>P,l=!E||E-d>P&&!this.fragmentTracker.getPartialFragment(d);if(b||l)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,h=Math.max(E,O.start||0)-d,g=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,T=g==null||((_=g.details)===null||_===void 0)?void 0:_.live,N=T?g.details.targetduration*2:P;if(h>0&&h<=N){this._trySkipBufferHole(null);return}}var V=self.performance.now();if(a===null){this.stalled=V;return}var Y=V-a;!L&&Y>=j&&this._reportStall(O.len);var U=X.BufferHelper.bufferInfo(r,d,s.maxBufferHole);this._tryFixBufferStall(U,Y)},c._tryFixBufferStall=function(f,s){var r=this.config,a=this.fragmentTracker,d=this.media,L=d.currentTime,S=a.getPartialFragment(L);if(S){var x=this._trySkipBufferHole(S);if(x)return}f.len>r.maxBufferHole&&s>r.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(f){var s=this.hls,r=this.media,a=this.stallReported;a||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+f+")"),s.trigger(B.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},c._trySkipBufferHole=function(f){for(var s=this.config,r=this.hls,a=this.media,d=a.currentTime,L=0,S=X.BufferHelper.getBuffered(a),x=0;x<S.length;x++){var R=S.start(x);if(d+s.maxBufferHole>=L&&d<R){var O=Math.max(R+y,a.currentTime+I);return G.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+O),this.moved=!0,this.stalled=null,a.currentTime=O,f&&r.trigger(B.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+O,frag:f}),O}L=S.end(x)}return 0},c._tryNudgeBuffer=function(){var f=this.config,s=this.hls,r=this.media,a=r.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<f.nudgeMaxRetry){var L=a+d*f.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+a+" to "+L),r.currentTime=L,s.trigger(B.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+a+" after "+f.nudgeMaxRetry+" nudges"),s.trigger(B.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/events.ts"),D=k("./src/utils/texttrack-utils.ts"),B=k("./src/demux/id3.ts"),G=.25,j=function(){function P(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var I=P.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var m=this.hls;m.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var m=this.hls;m.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(X.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(m,p){this.media=p.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(D.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(m){if(!this.media)return;for(var p=0;p<m.length;p++){var c=m[p];if(c.kind==="metadata"&&c.label==="id3")return Object(D.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(m,p){if(!this.media)return;var c=p.frag,u=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var f=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<u.length;s++){var r=B.getID3Frames(u[s].data);if(r){var a=u[s].pts,d=s<u.length-1?u[s+1].pts:c.end,L=d-a;L<=0&&(d=a+G);for(var S=0;S<r.length;S++){var x=r[S];if(!B.isTimeStampFrame(x)){var R=new f(a,d,"");R.value=x,this.id3Track.addCue(R)}}}}},I.onBufferFlushing=function(m,p){var c=p.startOffset,u=p.endOffset,f=p.type;if(!f||f==="audio"){var s=this.id3Track;s&&Object(D.removeCuesInRange)(s,c,u)}},P}();W.default=j},"./src/controller/latency-controller.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return P});var X=k("./src/errors.ts"),D=k("./src/events.ts"),B=k("./src/utils/logger.ts");function G(I,y){for(var m=0;m<y.length;m++){var p=y[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(I,p.key,p)}}function j(I,y,m){return y&&G(I.prototype,y),m&&G(I,m),I}var P=function(){function I(m){var p=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return p.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var y=I.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.registerListeners=function(){this.hls.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(D.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(D.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(D.Events.ERROR,this.onError)},y.onMediaAttached=function(p,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},y.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},y.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},y.onLevelUpdated=function(p,c){var u=c.details;this.levelDetails=u,u.advanced&&this.timeupdate(),!u.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(p,c){if(c.details!==X.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,B.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var p=this.media,c=this.levelDetails;if(!p||!c)return;this.currentTime=p.currentTime;var u=this.computeLatency();if(u===null)return;this._latency=u;var f=this.config,s=f.lowLatencyMode,r=f.maxLiveSyncPlaybackRate;if(!s||r===1)return;var a=this.targetLatency;if(a===null)return;var d=u-a,L=Math.min(this.maxLatency,a+c.targetduration),S=d<L;if(c.live&&S&&d>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,r)),R=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;p.playbackRate=Math.min(x,Math.max(1,R))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},y.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},y.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},j(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,c=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:c?p.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var c=p.holdBack,u=p.partHoldBack,f=p.targetduration,s=this.config,r=s.liveSyncDuration,a=s.liveSyncDurationCount,d=s.lowLatencyMode,L=this.hls.userConfig,S=d&&u||c;(L.liveSyncDuration||L.liveSyncDurationCount||S===0)&&(S=r!==void 0?r:a*f);var x=f,R=1;return S+Math.min(this.stallCount*R,x)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),c=this.targetLatency,u=this.levelDetails;if(p===null||c===null||u===null)return null;var f=u.edge,s=p-c-this.edgeStalled,r=f-u.totalduration,a=f-(this.config.lowLatencyMode&&u.partTarget||u.targetduration);return Math.min(Math.max(r,s),a)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var c=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-c,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,c=this.levelDetails;if(!p||!c)return 0;var u=p.buffered.length;return u?p.buffered.end(u-1):c.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return s});var X=k("./src/types/level.ts"),D=k("./src/events.ts"),B=k("./src/errors.ts"),G=k("./src/utils/codecs.ts"),j=k("./src/controller/level-helper.ts"),P=k("./src/controller/base-playlist-controller.ts"),I=k("./src/types/loader.ts");function y(){return y=Object.assign||function(r){for(var a=1;a<arguments.length;a++){var d=arguments[a];for(var L in d)Object.prototype.hasOwnProperty.call(d,L)&&(r[L]=d[L])}return r},y.apply(this,arguments)}function m(r,a){for(var d=0;d<a.length;d++){var L=a[d];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(r,L.key,L)}}function p(r,a,d){return a&&m(r.prototype,a),d&&m(r,d),r}function c(r,a){r.prototype=Object.create(a.prototype),r.prototype.constructor=r,u(r,a)}function u(r,a){return u=Object.setPrototypeOf||function(L,S){return L.__proto__=S,L},u(r,a)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(r){c(a,r);function a(L){var S;return S=r.call(this,L,"[level-controller]")||this,S._levels=[],S._firstLevel=-1,S._startLevel=void 0,S.currentLevelIndex=-1,S.manualLevelIndex=-1,S.onParsedComplete=void 0,S._registerListeners(),S}var d=a.prototype;return d._registerListeners=function(){var S=this.hls;S.on(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),S.on(D.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var S=this.hls;S.off(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),S.off(D.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},d.startLoad=function(){var S=this._levels;S.forEach(function(x){x.loadError=0}),r.prototype.startLoad.call(this)},d.onManifestLoaded=function(S,x){var R=[],O=[],w=[],E,b={},l,_=!1,h=!1,g=!1;if(x.levels.forEach(function(Y){var U=Y.attrs;_=_||!!(Y.width&&Y.height),h=h||!!Y.videoCodec,g=g||!!Y.audioCodec,f&&Y.audioCodec&&Y.audioCodec.indexOf("mp4a.40.34")!==-1&&(Y.audioCodec=void 0);var A=Y.bitrate+"-"+Y.attrs.RESOLUTION+"-"+Y.attrs.CODECS;l=b[A],l?l.url.push(Y.url):(l=new X.Level(Y),b[A]=l,R.push(l)),U&&(U.AUDIO&&Object(j.addGroupId)(l,"audio",U.AUDIO),U.SUBTITLES&&Object(j.addGroupId)(l,"text",U.SUBTITLES))}),(_||h)&&g&&(R=R.filter(function(Y){var U=Y.videoCodec,A=Y.width,J=Y.height;return!!U||!!(A&&J)})),R=R.filter(function(Y){var U=Y.audioCodec,A=Y.videoCodec;return(!U||Object(G.isCodecSupportedInMp4)(U,"audio"))&&(!A||Object(G.isCodecSupportedInMp4)(A,"video"))}),x.audioTracks&&(O=x.audioTracks.filter(function(Y){return!Y.audioCodec||Object(G.isCodecSupportedInMp4)(Y.audioCodec,"audio")}),Object(j.assignTrackIdsByGroup)(O)),x.subtitles&&(w=x.subtitles,Object(j.assignTrackIdsByGroup)(w)),R.length>0){E=R[0].bitrate,R.sort(function(Y,U){return Y.bitrate-U.bitrate}),this._levels=R;for(var T=0;T<R.length;T++)if(R[T].bitrate===E){this._firstLevel=T,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+E);break}var N=g&&!h,V={levels:R,audioTracks:O,subtitleTracks:w,firstLevel:this._firstLevel,stats:x.stats,audio:g,video:h,altAudio:!N&&O.some(function(Y){return!!Y.url})};this.hls.trigger(D.Events.MANIFEST_PARSED,V),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(D.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(S,x){if(r.prototype.onError.call(this,S,x),x.fatal)return;var R=x.context,O=this._levels[this.currentLevelIndex];if(R&&(R.type===I.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&R.groupId===O.audioGroupIds[O.urlId]||R.type===I.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&R.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var w=!1,E=!0,b;switch(x.details){case B.ErrorDetails.FRAG_LOAD_ERROR:case B.ErrorDetails.FRAG_LOAD_TIMEOUT:case B.ErrorDetails.KEY_LOAD_ERROR:case B.ErrorDetails.KEY_LOAD_TIMEOUT:if(x.frag){var l=this._levels[x.frag.level];l?(l.fragmentError++,l.fragmentError>this.hls.config.fragLoadingMaxRetry&&(b=x.frag.level)):b=x.frag.level}break;case B.ErrorDetails.LEVEL_LOAD_ERROR:case B.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(E=!1),b=R.level),w=!0;break;case B.ErrorDetails.REMUX_ALLOC_ERROR:b=x.level,w=!0;break}b!==void 0&&this.recoverLevel(x,b,w,E)},d.recoverLevel=function(S,x,R,O){var w=S.details,E=this._levels[x];if(E.loadError++,R){var b=this.retryLoadingOrFail(S);if(b)S.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var l=E.url.length;if(l>1&&E.loadError<l)S.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var _=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==_&&this._levels[_].loadError===0&&(this.warn(w+": switch to "+_),S.levelRetry=!0,this.hls.nextAutoLevel=_)}}},d.redundantFailover=function(S){var x=this._levels[S],R=x.url.length;if(R>1){var O=(x.urlId+1)%R;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(w){w.urlId=O}),this.level=S}},d.onFragLoaded=function(S,x){var R=x.frag;if(R!==void 0&&R.type===I.PlaylistLevelType.MAIN){var O=this._levels[R.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},d.onLevelLoaded=function(S,x){var R,O=x.level,w=x.details,E=this._levels[O];if(!E){var b;this.warn("Invalid level index "+O),(b=x.deliveryDirectives)!==null&&b!==void 0&&b.skip&&(w.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(O,x,E.details)):(R=x.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(w.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(S,x){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var O=-1,w=this.hls.audioTracks[x.id].groupId,E=0;E<R.audioGroupIds.length;E++)if(R.audioGroupIds[E]===w){O=E;break}O!==R.urlId&&(R.urlId=O,this.startLoad())}},d.loadPlaylist=function(S){var x=this.currentLevelIndex,R=this._levels[x];if(this.canLoad&&R&&R.url.length>0){var O=R.urlId,w=R.url[O];if(S)try{w=S.addDirectives(w)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+x+(S?" at sn "+S.msn+" part "+S.part:"")+" with URL-id "+O+" "+w),this.clearTimer(),this.hls.trigger(D.Events.LEVEL_LOADING,{url:w,level:x,id:O,deliveryDirectives:S||null})}},d.removeLevel=function(S,x){var R=function(E,b){return b!==x},O=this._levels.filter(function(w,E){return E!==S?!0:w.url.length>1&&x!==void 0?(w.url=w.url.filter(R),w.audioGroupIds&&(w.audioGroupIds=w.audioGroupIds.filter(R)),w.textGroupIds&&(w.textGroupIds=w.textGroupIds.filter(R)),w.urlId=0,!0):!1}).map(function(w,E){var b=w.details;return b!=null&&b.fragments&&b.fragments.forEach(function(l){l.level=E}),w});this._levels=O,this.hls.trigger(D.Events.LEVELS_UPDATED,{levels:O})},p(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(S){var x,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===S&&(x=R[S])!==null&&x!==void 0&&x.details)return;if(S<0||S>=R.length){var O=S<0;if(this.hls.trigger(D.Events.ERROR,{type:B.ErrorTypes.OTHER_ERROR,details:B.ErrorDetails.LEVEL_SWITCH_ERROR,level:S,fatal:O,reason:"invalid level idx"}),O)return;S=Math.min(S,R.length-1)}this.clearTimer();var w=this.currentLevelIndex,E=R[w],b=R[S];this.log("switching to level "+S+" from "+w),this.currentLevelIndex=S;var l=y({},b,{level:S,maxBitrate:b.maxBitrate,uri:b.uri,urlId:b.urlId});delete l._urlId,this.hls.trigger(D.Events.LEVEL_SWITCHING,l);var _=b.details;if(!_||_.live){var h=this.switchParams(b.uri,E==null?void 0:E.details);this.loadPlaylist(h)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(S){this.manualLevelIndex=S,this._startLevel===void 0&&(this._startLevel=S),S!==-1&&(this.level=S)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(S){this._firstLevel=S}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var S=this.hls.config.startLevel;return S!==void 0?S:this._firstLevel}else return this._startLevel},set:function(S){this._startLevel=S}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(S){this.level=S,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=S)}}]),a}(P.default)},"./src/controller/level-helper.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"addGroupId",function(){return B}),k.d(W,"assignTrackIdsByGroup",function(){return G}),k.d(W,"updatePTS",function(){return j}),k.d(W,"updateFragPTSDTS",function(){return I}),k.d(W,"mergeDetails",function(){return y}),k.d(W,"mapPartIntersection",function(){return m}),k.d(W,"mapFragmentIntersection",function(){return p}),k.d(W,"adjustSliding",function(){return c}),k.d(W,"addSliding",function(){return u}),k.d(W,"computeReloadInterval",function(){return f}),k.d(W,"getFragmentWithSN",function(){return s}),k.d(W,"getPartWith",function(){return r});var X=k("./src/polyfills/number.ts"),D=k("./src/utils/logger.ts");function B(a,d,L){switch(d){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(L);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(L);break}}function G(a){var d={};a.forEach(function(L){var S=L.groupId||"";L.id=d[S]=d[S]||0,d[S]++})}function j(a,d,L){var S=a[d],x=a[L];P(S,x)}function P(a,d){var L=d.startPTS;if(Object(X.isFiniteNumber)(L)){var S=0,x;d.sn>a.sn?(S=L-a.start,x=a):(S=a.start-L,x=d),x.duration!==S&&(x.duration=S)}else if(d.sn>a.sn){var R=a.cc===d.cc;R&&a.minEndPTS?d.start=a.start+(a.minEndPTS-a.start):d.start=a.start+a.duration}else d.start=Math.max(a.start-d.duration,0)}function I(a,d,L,S,x,R){var O=S-L;O<=0&&(D.logger.warn("Fragment should have a positive duration",d),S=L+d.duration,R=x+d.duration);var w=L,E=S,b=d.startPTS,l=d.endPTS;if(Object(X.isFiniteNumber)(b)){var _=Math.abs(b-L);Object(X.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(_,d.deltaPTS):d.deltaPTS=_,w=Math.max(L,b),L=Math.min(L,b),x=Math.min(x,d.startDTS),E=Math.min(S,l),S=Math.max(S,l),R=Math.max(R,d.endDTS)}d.duration=S-L;var h=L-d.start;d.appendedPTS=S,d.start=d.startPTS=L,d.maxStartPTS=w,d.startDTS=x,d.endPTS=S,d.minEndPTS=E,d.endDTS=R;var g=d.sn;if(!a||g<a.startSN||g>a.endSN)return 0;var T,N=g-a.startSN,V=a.fragments;for(V[N]=d,T=N;T>0;T--)P(V[T],V[T-1]);for(T=N;T<V.length-1;T++)P(V[T],V[T+1]);return a.fragmentHint&&P(V[V.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,h}function y(a,d){for(var L=null,S=a.fragments,x=S.length-1;x>=0;x--){var R=S[x].initSegment;if(R){L=R;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var O=0,w;if(p(a,d,function(T,N){T.relurl&&(O=T.cc-N.cc),Object(X.isFiniteNumber)(T.startPTS)&&Object(X.isFiniteNumber)(T.endPTS)&&(N.start=N.startPTS=T.startPTS,N.startDTS=T.startDTS,N.appendedPTS=T.appendedPTS,N.maxStartPTS=T.maxStartPTS,N.endPTS=T.endPTS,N.endDTS=T.endDTS,N.minEndPTS=T.minEndPTS,N.duration=T.endPTS-T.startPTS,N.duration&&(w=N),d.PTSKnown=d.alignedSliding=!0),N.elementaryStreams=T.elementaryStreams,N.loader=T.loader,N.stats=T.stats,N.urlId=T.urlId,T.initSegment&&(N.initSegment=T.initSegment,L=T.initSegment)}),L){var E=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;E.forEach(function(T){var N;(!T.initSegment||T.initSegment.relurl===((N=L)===null||N===void 0?void 0:N.relurl))&&(T.initSegment=L)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(T){return!T}),d.deltaUpdateFailed)){D.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var b=d.skippedSegments;b--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var l=d.fragments;if(O){D.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<l.length;_++)l[_].cc+=O}d.skippedSegments&&(d.startCC=d.fragments[0].cc),m(a.partList,d.partList,function(T,N){N.elementaryStreams=T.elementaryStreams,N.stats=T.stats}),w?I(d,w,w.startPTS,w.endPTS,w.startDTS,w.endDTS):c(a,d),l.length&&(d.totalduration=d.edge-l[0].start),d.driftStartTime=a.driftStartTime,d.driftStart=a.driftStart;var h=d.advancedDateTime;if(d.advanced&&h){var g=d.edge;d.driftStart||(d.driftStartTime=h,d.driftStart=g),d.driftEndTime=h,d.driftEnd=g}else d.driftEndTime=a.driftEndTime,d.driftEnd=a.driftEnd,d.advancedDateTime=a.advancedDateTime}function m(a,d,L){if(a&&d)for(var S=0,x=0,R=a.length;x<=R;x++){var O=a[x],w=d[x+S];O&&w&&O.index===w.index&&O.fragment.sn===w.fragment.sn?L(O,w):S--}}function p(a,d,L){for(var S=d.skippedSegments,x=Math.max(a.startSN,d.startSN)-d.startSN,R=(a.fragmentHint?1:0)+(S?d.endSN:Math.min(a.endSN,d.endSN))-d.startSN,O=d.startSN-a.startSN,w=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,E=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,b=x;b<=R;b++){var l=E[O+b],_=w[b];S&&!_&&b<S&&(_=d.fragments[b]=l),l&&_&&L(l,_)}}function c(a,d){var L=d.startSN+d.skippedSegments-a.startSN,S=a.fragments;if(L<0||L>=S.length)return;u(d,S[L].start)}function u(a,d){if(d){for(var L=a.fragments,S=a.skippedSegments;S<L.length;S++)L[S].start+=d;a.fragmentHint&&(a.fragmentHint.start+=d)}}function f(a,d){var L=1e3*a.levelTargetDuration,S=L/2,x=a.age,R=x>0&&x<L*3,O=d.loading.end-d.loading.start,w,E=a.availabilityDelay;if(a.updated===!1)if(R){var b=333*a.misses;w=Math.max(Math.min(S,O*2),b),a.availabilityDelay=(a.availabilityDelay||0)+w}else w=S;else R?(E=Math.min(E||L/2,x),a.availabilityDelay=E,w=E+L-x):w=L-O;return Math.round(w)}function s(a,d,L){if(!a||!a.details)return null;var S=a.details,x=S.fragments[d-S.startSN];return x||(x=S.fragmentHint,x&&x.sn===d?x:d<S.startSN&&L&&L.sn===d?L:null)}function r(a,d,L){if(!a||!a.details)return null;var S=a.details.partList;if(S)for(var x=S.length;x--;){var R=S[x];if(R.index===L&&R.fragment.sn===d)return R}return null}},"./src/controller/stream-controller.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return S});var X=k("./src/polyfills/number.ts"),D=k("./src/controller/base-stream-controller.ts"),B=k("./src/is-supported.ts"),G=k("./src/events.ts"),j=k("./src/utils/buffer-helper.ts"),P=k("./src/controller/fragment-tracker.ts"),I=k("./src/types/loader.ts"),y=k("./src/loader/fragment.ts"),m=k("./src/demux/transmuxer-interface.ts"),p=k("./src/types/transmuxer.ts"),c=k("./src/controller/gap-controller.ts"),u=k("./src/errors.ts"),f=k("./src/utils/logger.ts");function s(x,R){for(var O=0;O<R.length;O++){var w=R[O];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(x,w.key,w)}}function r(x,R,O){return R&&s(x.prototype,R),O&&s(x,O),x}function a(x,R){x.prototype=Object.create(R.prototype),x.prototype.constructor=x,d(x,R)}function d(x,R){return d=Object.setPrototypeOf||function(w,E){return w.__proto__=E,w},d(x,R)}var L=100,S=function(x){a(R,x);function R(w,E){var b;return b=x.call(this,w,E,"[stream-controller]")||this,b.audioCodecSwap=!1,b.gapController=null,b.level=-1,b._forceStartLoad=!1,b.altAudio=!1,b.audioOnly=!1,b.fragPlaying=null,b.onvplaying=null,b.onvseeked=null,b.fragLastKbps=0,b.stalled=!1,b.couldBacktrack=!1,b.audioCodecSwitch=!1,b.videoBuffer=null,b._registerListeners(),b}var O=R.prototype;return O._registerListeners=function(){var E=this.hls;E.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(G.Events.ERROR,this.onError,this),E.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var E=this.hls;E.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(G.Events.ERROR,this.onError,this),E.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(E){if(this.levels){var b=this.lastCurrentTime,l=this.hls;if(this.stopLoad(),this.setInterval(L),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=l.startLevel;_===-1&&(l.config.testBandwidth?(_=0,this.bitrateTest=!0):_=l.nextAutoLevel),this.level=l.nextLoadLevel=_,this.loadedmetadata=!1}b>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+b.toFixed(3)),E=b),this.state=D.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=D.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_LEVEL:{var E,b=this.levels,l=this.level,_=b==null||((E=b[l])===null||E===void 0)?void 0:E.details;if(_&&(!_.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(_))break;this.state=D.State.IDLE;break}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var h,g=self.performance.now(),T=this.retryDate;(!T||g>=T||(h=this.media)!==null&&h!==void 0&&h.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=D.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var E,b,l=this.hls,_=this.levelLastLoaded,h=this.levels,g=this.media,T=l.config,N=l.nextLoadLevel;if(_===null||!g&&(this.startFragRequested||!T.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!h||!h[N])return;var V=h[N];this.level=l.nextLoadLevel=N;var Y=V.details;if(!Y||this.state===D.State.WAITING_LEVEL||Y.live&&this.levelLastLoaded!==N){this.state=D.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:g,I.PlaylistLevelType.MAIN);if(U===null)return;var A=U.len,J=this.getMaxBufferLength(V.maxBitrate);if(A>=J)return;if(this._streamEnded(U,Y)){var ne={};this.altAudio&&(ne.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,ne),this.state=D.State.ENDED;return}var oe=U.end,fe=this.getNextFragment(oe,Y);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var ke=fe.sn-Y.startSN;ke>1&&(fe=Y.fragments[ke-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===P.FragmentState.OK&&this.nextLoadPosition>oe){var Oe=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(g,Oe,I.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,Y)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((E=fe.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((b=fe.decryptdata)!==null&&b!==void 0&&b.key)?this.loadKey(fe,Y):this.loadFragment(fe,Y,oe)},O.loadFragment=function(E,b,l){var _,h=this.fragmentTracker.getState(E);if(this.fragCurrent=E,h===P.FragmentState.BACKTRACKED){var g=this.fragmentTracker.getBacktrackData(E);if(g){this._handleFragmentLoadProgress(g),this._handleFragmentLoadComplete(g);return}else h=P.FragmentState.NOT_LOADED}h===P.FragmentState.NOT_LOADED||h===P.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,E,b,l)):h===P.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(E){var b=this.fragmentTracker.getAppendedFrag(E,I.PlaylistLevelType.MAIN);return b&&"fragment"in b?b.fragment:b},O.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,I.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var E=this.levels,b=this.media;if(b!=null&&b.readyState){var l,_=this.getAppendedFrag(b.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!b.paused&&E){var h=this.hls.nextLoadLevel,g=E[h],T=this.fragLastKbps;T&&this.fragCurrent?l=this.fragCurrent.duration*g.maxBitrate/(1e3*T)+1:l=0}else l=0;var N=this.getBufferedFrag(b.currentTime+l);if(N){var V=this.followingBufferedFrag(N);if(V){this.abortCurrentFrag();var Y=V.maxStartPTS?V.maxStartPTS:V.start,U=V.duration,A=Math.max(N.end,Y+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(A,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===D.State.KEY_LOADING&&(this.state=D.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(E,b){x.prototype.flushMainBuffer.call(this,E,b,this.altAudio?"video":null)},O.onMediaAttached=function(E,b){x.prototype.onMediaAttached.call(this,E,b);var l=b.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),l.addEventListener("playing",this.onvplaying),l.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,l,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var E=this.media,b=E?E.currentTime:null;Object(X.isFiniteNumber)(b)&&this.log("Media seeked to "+b.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(E,b){var l=!1,_=!1,h;b.levels.forEach(function(g){h=g.audioCodec,h&&(h.indexOf("mp4a.40.2")!==-1&&(l=!0),h.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=l&&_&&!Object(B.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=b.levels,this.startFragRequested=!1},O.onLevelLoading=function(E,b){var l=this.levels;if(!l||this.state!==D.State.IDLE)return;var _=l[b.level];(!_.details||_.details.live&&this.levelLastLoaded!==b.level||this.waitForCdnTuneIn(_.details))&&(this.state=D.State.WAITING_LEVEL)},O.onLevelLoaded=function(E,b){var l,_=this.levels,h=b.level,g=b.details,T=g.totalduration;if(!_){this.warn("Levels were reset while loading level "+h);return}this.log("Level "+h+" loaded ["+g.startSN+","+g.endSN+"], cc ["+g.startCC+", "+g.endCC+"] duration:"+T);var N=this.fragCurrent;N&&(this.state===D.State.FRAG_LOADING||this.state===D.State.FRAG_LOADING_WAITING_RETRY)&&(N.level!==b.level&&N.loader&&(this.state=D.State.IDLE,N.loader.abort()));var V=_[h],Y=0;if(g.live||(l=V.details)!==null&&l!==void 0&&l.live){if(g.fragments[0]||(g.deltaUpdateFailed=!0),g.deltaUpdateFailed)return;Y=this.alignPlaylists(g,V.details)}if(V.details=g,this.levelLastLoaded=h,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:g,level:h}),this.state===D.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(g))return;this.state=D.State.IDLE}this.startFragRequested?g.live&&this.synchronizeToLiveEdge(g):this.setStartPosition(g,Y),this.tick()},O._handleFragmentLoadProgress=function(E){var b,l=E.frag,_=E.part,h=E.payload,g=this.levels;if(!g){this.warn("Levels were reset while fragment load was in progress. Fragment "+l.sn+" of level "+l.level+" will not be buffered");return}var T=g[l.level],N=T.details;if(!N){this.warn("Dropping fragment "+l.sn+" of level "+l.level+" after level details were reset");return}var V=T.videoCodec,Y=N.PTSKnown||!N.live,U=(b=l.initSegment)===null||b===void 0?void 0:b.data,A=this._getAudioCodec(T),J=this.transmuxer=this.transmuxer||new m.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ne=_?_.index:-1,oe=ne!==-1,fe=new p.ChunkMetadata(l.level,l.sn,l.stats.chunkCount,h.byteLength,ne,oe),ke=this.initPTS[l.cc];J.push(h,U,A,V,l,_,N.totalduration,Y,fe,ke)},O.onAudioTrackSwitching=function(E,b){var l=this.altAudio,_=!!b.url,h=b.id;if(!_){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var g=this.fragCurrent;g!=null&&g.loader&&(this.log("Switching to main audio track, cancel main fragment load"),g.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var T=this.hls;l&&T.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),T.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:h})}},O.onAudioTrackSwitched=function(E,b){var l=b.id,_=!!this.hls.audioTracks[l].url;if(_){var h=this.videoBuffer;h&&this.mediaBuffer!==h&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=h)}this.altAudio=_,this.tick()},O.onBufferCreated=function(E,b){var l=b.tracks,_,h,g=!1;for(var T in l){var N=l[T];if(N.id==="main"){if(h=T,_=N,T==="video"){var V=l[T];V&&(this.videoBuffer=V.buffer)}}else g=!0}g&&_?(this.log("Alternate track found, use "+h+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(E,b){var l=b.frag,_=b.part;if(l&&l.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(l)){this.warn("Fragment "+l.sn+(_?" p: "+_.index:"")+" of level "+l.level+" finished buffering, but was aborted. state: "+this.state),this.state===D.State.PARSED&&(this.state=D.State.IDLE);return}var h=_?_.stats:l.stats;this.fragLastKbps=Math.round(8*h.total/(h.buffering.end-h.loading.first)),l.sn!=="initSegment"&&(this.fragPrevious=l),this.fragBufferedComplete(l,_)},O.onError=function(E,b){switch(b.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.MAIN,b);break;case u.ErrorDetails.LEVEL_LOAD_ERROR:case u.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==D.State.ERROR&&(b.fatal?(this.warn(""+b.details),this.state=D.State.ERROR):!b.levelRetry&&this.state===D.State.WAITING_LEVEL&&(this.state=D.State.IDLE));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(b.parent==="main"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var l=!0,_=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);_&&_.len>.5&&(l=!this.reduceMaxBufferLength(_.len)),l&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var E=this.media,b=this.gapController;if(!E||!b||!E.readyState)return;var l=j.BufferHelper.getBuffered(E);!this.loadedmetadata&&l.length?(this.loadedmetadata=!0,this.seekToStartPos()):b.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=D.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(E,b){var l=b.type;if(l!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(l===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,l,I.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(E,b){this.levels=b.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var E=this.media,b=E.currentTime,l=this.startPosition;if(l>=0&&b<l){if(E.seeking){f.logger.log("could not seek to "+l+", already seeking at "+b);return}var _=j.BufferHelper.getBuffered(E),h=_.length?_.start(0):0,g=h-l;g>0&&(g<this.config.maxBufferHole||g<this.config.maxFragLookUpTolerance)&&(f.logger.log("adjusting start position by "+g+" to match buffer start"),l+=g,this.startPosition=l),this.log("seek to target start position "+l+" from current time "+b),E.currentTime=l}},O._getAudioCodec=function(E){var b=this.config.defaultAudioCodec||E.audioCodec;return this.audioCodecSwap&&b&&(this.log("Swapping audio codec"),b.indexOf("mp4a.40.5")!==-1?b="mp4a.40.2":b="mp4a.40.5"),b},O._loadBitrateTestFrag=function(E){var b=this;this._doFragLoad(E).then(function(l){var _=b.hls;if(!l||_.nextLoadLevel||b.fragContextChanged(E))return;b.fragLoadError=0,b.state=D.State.IDLE,b.startFragRequested=!1,b.bitrateTest=!1;var h=E.stats;h.parsing.start=h.parsing.end=h.buffering.start=h.buffering.end=self.performance.now(),_.trigger(G.Events.FRAG_LOADED,l)})},O._handleTransmuxComplete=function(E){var b,l="main",_=this.hls,h=E.remuxResult,g=E.chunkMeta,T=this.getCurrentContext(g);if(!T){this.warn("The loading context changed while buffering fragment "+g.sn+" of level "+g.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(g.level);return}var N=T.frag,V=T.part,Y=T.level,U=h.video,A=h.text,J=h.id3,ne=h.initSegment,oe=this.altAudio?void 0:h.audio;if(this.fragContextChanged(N))return;if(this.state=D.State.PARSING,ne){ne.tracks&&(this._bufferInitSegment(Y,ne.tracks,N,g),_.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:N,id:l,tracks:ne.tracks}));var fe=ne.initPTS,ke=ne.timescale;Object(X.isFiniteNumber)(fe)&&(this.initPTS[N.cc]=fe,_.trigger(G.Events.INIT_PTS_FOUND,{frag:N,id:l,initPTS:fe,timescale:ke}))}if(U&&h.independent!==!1){if(Y.details){var Oe=U.startPTS,Me=U.endPTS,Be=U.startDTS,Pe=U.endDTS;if(V)V.elementaryStreams[U.type]={startPTS:Oe,endPTS:Me,startDTS:Be,endDTS:Pe};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var be=this.getLoadPosition()+this.config.maxBufferHole;if(be<Oe){this.backtrack(N);return}N.setElementaryStreamInfo(U.type,N.start,Me,N.start,Pe,!0)}N.setElementaryStreamInfo(U.type,Oe,Me,Be,Pe),this.bufferFragmentData(U,N,V,g)}}else if(h.independent===!1){this.backtrack(N);return}if(oe){var le=oe.startPTS,Le=oe.endPTS,tt=oe.startDTS,nt=oe.endDTS;V&&(V.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:Le,startDTS:tt,endDTS:nt}),N.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,le,Le,tt,nt),this.bufferFragmentData(oe,N,V,g)}if(J!=null&&(b=J.samples)!==null&&b!==void 0&&b.length){var lt={frag:N,id:l,samples:J.samples};_.trigger(G.Events.FRAG_PARSING_METADATA,lt)}if(A){var Et={frag:N,id:l,samples:A.samples};_.trigger(G.Events.FRAG_PARSING_USERDATA,Et)}},O._bufferInitSegment=function(E,b,l,_){var h=this;if(this.state!==D.State.PARSING)return;this.audioOnly=!!b.audio&&!b.video,this.altAudio&&!this.audioOnly&&delete b.audio;var g=b.audio,T=b.video,N=b.audiovideo;if(g){var V=E.audioCodec,Y=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(V&&(V.indexOf("mp4a.40.5")!==-1?V="mp4a.40.2":V="mp4a.40.5"),g.metadata.channelCount!==1&&Y.indexOf("firefox")===-1&&(V="mp4a.40.5")),Y.indexOf("android")!==-1&&g.container!=="audio/mpeg"&&(V="mp4a.40.2",this.log("Android: force audio codec to "+V)),E.audioCodec&&E.audioCodec!==V&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+V+'"'),g.levelCodec=V,g.id="main",this.log("Init audio buffer, container:"+g.container+", codecs[selected/level/parsed]=["+(V||"")+"/"+(E.audioCodec||"")+"/"+g.codec+"]")}T&&(T.levelCodec=E.videoCodec,T.id="main",this.log("Init video buffer, container:"+T.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+T.codec+"]")),N&&this.log("Init audiovideo buffer, container:"+N.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+N.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,b),Object.keys(b).forEach(function(U){var A=b[U],J=A.initSegment;J!=null&&J.byteLength&&h.hls.trigger(G.Events.BUFFER_APPENDING,{type:U,data:J,frag:l,part:null,chunkMeta:_,parent:l.type})}),this.tick()},O.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var b=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,b?this.resetFragmentLoading(E):this.state=D.State.BACKTRACKING},O.checkFragmentChanged=function(){var E=this.media,b=null;if(E&&E.readyState>1&&E.seeking===!1){var l=E.currentTime;if(j.BufferHelper.isBuffered(E,l)?b=this.getAppendedFrag(l):j.BufferHelper.isBuffered(E,l+.1)&&(b=this.getAppendedFrag(l+.1)),b){var _=this.fragPlaying,h=b.level;(!_||b.sn!==_.sn||_.level!==h||b.urlId!==_.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:b}),(!_||_.level!==h)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:h}),this.fragPlaying=b)}}},r(R,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var b=this.getAppendedFrag(E.currentTime);if(b)return b.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var b=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(b)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(D.default)},"./src/controller/subtitle-stream-controller.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"SubtitleStreamController",function(){return a});var X=k("./src/events.ts"),D=k("./src/utils/logger.ts"),B=k("./src/utils/buffer-helper.ts"),G=k("./src/controller/fragment-finders.ts"),j=k("./src/utils/discontinuities.ts"),P=k("./src/controller/level-helper.ts"),I=k("./src/controller/fragment-tracker.ts"),y=k("./src/controller/base-stream-controller.ts"),m=k("./src/types/loader.ts"),p=k("./src/types/level.ts");function c(d,L){for(var S=0;S<L.length;S++){var x=L[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(d,x.key,x)}}function u(d,L,S){return L&&c(d.prototype,L),S&&c(d,S),d}function f(d,L){d.prototype=Object.create(L.prototype),d.prototype.constructor=d,s(d,L)}function s(d,L){return s=Object.setPrototypeOf||function(x,R){return x.__proto__=R,x},s(d,L)}var r=500,a=function(d){f(L,d);function L(x,R){var O;return O=d.call(this,x,R,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var S=L.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var R=this.hls;R.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(X.Events.ERROR,this.onError,this),R.on(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S._unregisterListeners=function(){var R=this.hls;R.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(X.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(X.Events.ERROR,this.onError,this),R.off(X.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(X.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(X.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(X.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(r),this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},S.onLevelLoaded=function(R,O){this.mainDetails=O.details},S.onSubtitleFragProcessed=function(R,O){var w=O.frag,E=O.success;if(this.fragPrevious=w,this.state=y.State.IDLE,!E)return;var b=this.tracksBuffered[this.currentTrackId];if(!b)return;for(var l,_=w.start,h=0;h<b.length;h++)if(_>=b[h].start&&_<=b[h].end){l=b[h];break}var g=w.start+w.duration;l?l.end=g:(l={start:_,end:g},b.push(l)),this.fragmentTracker.fragBuffered(w)},S.onBufferFlushing=function(R,O){var w=O.startOffset,E=O.endOffset;if(w===0&&E!==Number.POSITIVE_INFINITY){var b=this.currentTrackId,l=this.levels;if(!l.length||!l[b]||!l[b].details)return;var _=l[b].details,h=_.targetduration,g=E-h;if(g<=0)return;O.endOffsetSubtitles=Math.max(0,g),this.tracksBuffered.forEach(function(T){for(var N=0;N<T.length;){if(T[N].end<=g){T.shift();continue}else if(T[N].start<g)T[N].start=g;else break;N++}}),this.fragmentTracker.removeFragmentsInRange(w,g,m.PlaylistLevelType.SUBTITLE)}},S.onError=function(R,O){var w,E=O.frag;if(!E||E.type!==m.PlaylistLevelType.SUBTITLE)return;(w=this.fragCurrent)!==null&&w!==void 0&&w.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},S.onSubtitleTracksUpdated=function(R,O){var w=this,E=O.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(b){return new p.Level(b)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(b){w.tracksBuffered[b.id]=[]}),this.mediaBuffer=null},S.onSubtitleTrackSwitch=function(R,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var w=this.levels[this.currentTrackId];w!=null&&w.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,w&&this.setInterval(r)},S.onSubtitleTrackLoaded=function(R,O){var w,E=O.details,b=O.id,l=this.currentTrackId,_=this.levels;if(!_.length)return;var h=_[l];if(b>=_.length||b!==l||!h)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(w=h.details)!==null&&w!==void 0&&w.live){var g=this.mainDetails;if(E.deltaUpdateFailed||!g)return;var T=g.fragments[0];if(!h.details)E.hasProgramDateTime&&g.hasProgramDateTime?Object(j.alignMediaPlaylistByPDT)(E,g):T&&Object(P.addSliding)(E,T.start);else{var N=this.alignPlaylists(E,h.details);N===0&&T&&Object(P.addSliding)(E,T.start)}}if(h.details=E,this.levelLastLoaded=b,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var V=Object(G.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);V||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0)}},S._handleFragmentLoadComplete=function(R){var O=R.frag,w=R.payload,E=O.decryptdata,b=this.hls;if(this.fragContextChanged(O))return;if(w&&w.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var l=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(w),E.key.buffer,E.iv.buffer).then(function(_){var h=performance.now();b.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:_,stats:{tstart:l,tdecrypt:h}})})}},S.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var R,O=this.currentTrackId,w=this.levels;if(!w.length||!w[O]||!w[O].details)return;var E=w[O].details,b=E.targetduration,l=this.config,_=this.media,h=B.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-b,l.maxBufferHole),g=h.end,T=h.len,N=this.getMaxBufferLength()+b;if(T>N)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var V=E.fragments,Y=V.length,U=E.edge,A,J=this.fragPrevious;if(g<U){var ne=l.maxFragLookUpTolerance;J&&E.hasProgramDateTime&&(A=Object(G.findFragmentByPDT)(V,J.endProgramDateTime,ne)),A||(A=Object(G.findFragmentByPTS)(J,V,g,ne),!A&&J&&J.start<V[0].start&&(A=V[0]))}else A=V[Y-1];(R=A)!==null&&R!==void 0&&R.encrypted?(D.logger.log("Loading key for "+A.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(X.Events.KEY_LOADING,{frag:A})):A&&this.fragmentTracker.getState(A)===I.FragmentState.NOT_LOADED&&this.loadFragment(A,E,g)}},S.loadFragment=function(R,O,w){this.fragCurrent=R,d.prototype.loadFragment.call(this,R,O,w)},u(L,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),L}(y.default)},"./src/controller/subtitle-track-controller.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/events.ts"),D=k("./src/utils/texttrack-utils.ts"),B=k("./src/controller/base-playlist-controller.ts"),G=k("./src/types/loader.ts");function j(c,u){for(var f=0;f<u.length;f++){var s=u[f];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}function P(c,u,f){return u&&j(c.prototype,u),f&&j(c,f),c}function I(c,u){c.prototype=Object.create(u.prototype),c.prototype.constructor=c,y(c,u)}function y(c,u){return y=Object.setPrototypeOf||function(s,r){return s.__proto__=r,s},y(c,u)}var m=function(c){I(u,c);function u(s){var r;return r=c.call(this,s,"[subtitle-track-controller]")||this,r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}var f=u.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},f.registerListeners=function(){var r=this.hls;r.on(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(X.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(X.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var r=this.hls;r.off(X.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(X.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(X.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(X.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(X.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(X.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(X.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(X.Events.ERROR,this.onError,this)},f.onMediaAttached=function(r,a){if(this.media=a.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},f.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},f.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var r=p(this.media.textTracks);r.forEach(function(a){Object(D.clearCurrentCues)(a)}),this.subtitleTrack=-1,this.media=null},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(r,a){this.tracks=a.subtitleTracks},f.onSubtitleTrackLoaded=function(r,a){var d=a.id,L=a.details,S=this.trackId,x=this.tracksInGroup[S];if(!x){this.warn("Invalid subtitle track id "+d);return}var R=x.details;x.details=a.details,this.log("subtitle track "+d+" loaded ["+L.startSN+"-"+L.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,a,R))},f.onLevelLoading=function(r,a){this.switchLevel(a.level)},f.onLevelSwitching=function(r,a){this.switchLevel(a.level)},f.switchLevel=function(r){var a=this.hls.levels[r];if(!(a!=null&&a.textGroupIds))return;var d=a.textGroupIds[a.urlId];if(this.groupId!==d){var L=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,S=this.tracks.filter(function(O){return!d||O.groupId===d});this.tracksInGroup=S;var x=this.findTrackId(L==null?void 0:L.name)||this.findTrackId();this.groupId=d;var R={subtitleTracks:S};this.log("Updating subtitle tracks, "+S.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,R),x!==-1&&this.setSubtitleTrack(x,L)}},f.findTrackId=function(r){for(var a=this.tracksInGroup,d=0;d<a.length;d++){var L=a[d];if((!this.selectDefaultTrack||L.default)&&(!r||r===L.name))return L.id}return-1},f.onError=function(r,a){if(c.prototype.onError.call(this,r,a),a.fatal||!a.context)return;a.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},f.loadPlaylist=function(r){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var d=a.id,L=a.groupId,S=a.url;if(r)try{S=r.addDirectives(S)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(X.Events.SUBTITLE_TRACK_LOADING,{url:S,id:d,groupId:L,deliveryDirectives:r||null})}},f.toggleTrackModes=function(r){var a=this,d=this.media,L=this.subtitleDisplay,S=this.trackId;if(!d)return;var x=p(d.textTracks),R=x.filter(function(E){return E.groupId===a.groupId});if(r===-1)[].slice.call(x).forEach(function(E){E.mode="disabled"});else{var O=R[S];O&&(O.mode="disabled")}var w=R[r];w&&(w.mode=L?"showing":"hidden")},f.setSubtitleTrack=function(r,a){var d,L=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(d=L[r])!==null&&d!==void 0&&d.details)||r<-1||r>=L.length)return;this.clearTimer();var S=L[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,S){var x=S.id,R=S.groupId,O=R===void 0?"":R,w=S.name,E=S.type,b=S.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:O,name:w,type:E,url:b});var l=this.switchParams(S.url,a==null?void 0:a.details);this.loadPlaylist(l)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:r})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,a=p(this.media.textTracks),d=0;d<a.length;d++)if(a[d].mode==="hidden")r=d;else if(a[d].mode==="showing"){r=d;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},P(u,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,a)}}]),u}(B.default);function p(c){for(var u=[],f=0;f<c.length;f++){var s=c[f];s.kind==="subtitles"&&s.label&&u.push(c[f])}return u}W.default=m},"./src/controller/timeline-controller.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"TimelineController",function(){return p});var X=k("./src/polyfills/number.ts"),D=k("./src/events.ts"),B=k("./src/utils/cea-608-parser.ts"),G=k("./src/utils/output-filter.ts"),j=k("./src/utils/webvtt-parser.ts"),P=k("./src/utils/texttrack-utils.ts"),I=k("./src/utils/imsc1-ttml-parser.ts"),y=k("./src/types/loader.ts"),m=k("./src/utils/logger.ts"),p=function(){function s(a){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this.captionsProperties=void 0,this.hls=a,this.config=a.config,this.Cues=a.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var d=new G.default(this,"textTrack1"),L=new G.default(this,"textTrack2"),S=new G.default(this,"textTrack3"),x=new G.default(this,"textTrack4");this.cea608Parser1=new B.default(1,d,L),this.cea608Parser2=new B.default(3,S,x)}a.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.on(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.on(D.Events.FRAG_LOADING,this.onFragLoading,this),a.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(D.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.on(D.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.on(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(D.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=s.prototype;return r.destroy=function(){var d=this.hls;d.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(D.Events.FRAG_LOADING,this.onFragLoading,this),d.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(D.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(D.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(D.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(d,L,S,x,R){for(var O=!1,w=R.length;w--;){var E=R[w],b=u(E[0],E[1],L,S);if(b>=0&&(E[0]=Math.min(E[0],L),E[1]=Math.max(E[1],S),O=!0,b/(S-L)>.5))return}if(O||R.push([L,S]),this.config.renderTextTracksNatively){var l=this.captionsTracks[d];this.Cues.newCue(l,L,S,x)}else{var _=this.Cues.newCue(null,L,S,x);this.hls.trigger(D.Events.CUES_PARSED,{type:"captions",cues:_,track:d})}},r.onInitPtsFound=function(d,L){var S=this,x=L.frag,R=L.id,O=L.initPTS,w=L.timescale,E=this.unparsedVttFrags;R==="main"&&(this.initPTS[x.cc]=O,this.timescale[x.cc]=w),E.length&&(this.unparsedVttFrags=[],E.forEach(function(b){S.onFragLoaded(D.Events.FRAG_LOADED,b)}))},r.getExistingTrack=function(d){var L=this.media;if(L)for(var S=0;S<L.textTracks.length;S++){var x=L.textTracks[S];if(x[d])return x}return null},r.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},r.createNativeTrack=function(d){if(this.captionsTracks[d])return;var L=this.captionsProperties,S=this.captionsTracks,x=this.media,R=L[d],O=R.label,w=R.languageCode,E=this.getExistingTrack(d);if(E)S[d]=E,Object(P.clearCurrentCues)(S[d]),Object(P.sendAddTrackEvent)(S[d],x);else{var b=this.createTextTrack("captions",O,w);b&&(b[d]=!0,S[d]=b)}},r.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var L=this.captionsProperties[d];if(!L)return;var S=L.label,x={_id:d,label:S,kind:"captions",default:L.media?!!L.media.default:!1,closedCaptions:L.media};this.nonNativeCaptionsTracks[d]=x,this.hls.trigger(D.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},r.createTextTrack=function(d,L,S){var x=this.media;return x?x.addTextTrack(d,L,S):void 0},r.onMediaAttaching=function(d,L){this.media=L.media,this._cleanTracks()},r.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(L){Object(P.clearCurrentCues)(d[L]),delete d[L]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=f(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},r._cleanTracks=function(){var d=this.media;if(!d)return;var L=d.textTracks;if(L)for(var S=0;S<L.length;S++)Object(P.clearCurrentCues)(L[S])},r.onSubtitleTracksUpdated=function(d,L){var S=this;this.textTracks=[];var x=L.subtitleTracks||[],R=x.some(function(b){return b.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var O=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var w=this.media?this.media.textTracks:[];this.tracks.forEach(function(b,l){var _;if(l<w.length){for(var h=null,g=0;g<w.length;g++)if(c(w[g],b)){h=w[g];break}h&&(_=h)}_?Object(P.clearCurrentCues)(_):(_=S.createTextTrack("subtitles",b.name,b.lang),_&&(_.mode="disabled")),_&&(_.groupId=b.groupId,S.textTracks.push(_))})}else if(!O&&this.tracks&&this.tracks.length){var E=this.tracks.map(function(b){return{label:b.name,kind:b.type.toLowerCase(),default:b.default,subtitleTrack:b}});this.hls.trigger(D.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:E})}}},r.onManifestLoaded=function(d,L){var S=this;this.config.enableCEA708Captions&&L.captions&&L.captions.forEach(function(x){var R=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!R)return;var O="textTrack"+R[1],w=S.captionsProperties[O];if(!w)return;w.label=x.name,x.lang&&(w.languageCode=x.lang),w.media=x})},r.onFragLoading=function(d,L){var S=this.cea608Parser1,x=this.cea608Parser2,R=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(S&&x))return;if(L.frag.type===y.PlaylistLevelType.MAIN){var w,E,b=L.frag.sn,l=(w=L==null||((E=L.part)===null||E===void 0)?void 0:E.index)!=null?w:-1;b===R+1||b===R&&l===O+1||(S.reset(),x.reset()),this.lastSn=b,this.lastPartIndex=l}},r.onFragLoaded=function(d,L){var S=L.frag,x=L.payload,R=this.initPTS,O=this.unparsedVttFrags;if(S.type===y.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(X.isFiniteNumber)(R[S.cc])){O.push(L),R.length&&this.hls.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Missing initial subtitle PTS")});return}var w=S.decryptdata;if(w==null||w.key==null||w.method!=="AES-128"){var E=this.tracks[S.level],b=this.vttCCs;b[S.cc]||(b[S.cc]={start:S.start,prevCC:this.prevCC,new:!0},this.prevCC=S.cc),E&&E.textCodec===I.IMSC1_CODEC?this._parseIMSC1(S,x):this._parseVTTs(S,x,b)}}else this.hls.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(d,L){var S=this,x=this.hls;Object(I.parseIMSC1)(L,this.initPTS[d.cc],this.timescale[d.cc],function(R){S._appendCues(R,d.level),x.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(R){m.logger.log("Failed to parse IMSC1: "+R),x.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:R})})},r._parseVTTs=function(d,L,S){var x=this,R=this.hls;Object(j.parseWebVTT)(L,this.initPTS[d.cc],this.timescale[d.cc],S,d.cc,d.start,function(O){x._appendCues(O,d.level),R.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(O){x._fallbackToIMSC1(d,L),m.logger.log("Failed to parse VTT cue: "+O),R.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:O})})},r._fallbackToIMSC1=function(d,L){var S=this,x=this.tracks[d.level];x.textCodec||Object(I.parseIMSC1)(L,this.initPTS[d.cc],this.timescale[d.cc],function(){x.textCodec=I.IMSC1_CODEC,S._parseIMSC1(d,L)},function(){x.textCodec="wvtt"})},r._appendCues=function(d,L){var S=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[L];if(x.mode==="disabled")return;d.forEach(function(w){return Object(P.addCueToTrack)(x,w)})}else{var R=this.tracks[L],O=R.default?"default":"subtitles"+L;S.trigger(D.Events.CUES_PARSED,{type:"subtitles",cues:d,track:O})}},r.onFragDecrypted=function(d,L){var S=L.frag;if(S.type===y.PlaylistLevelType.SUBTITLE){if(!Object(X.isFiniteNumber)(this.initPTS[S.cc])){this.unparsedVttFrags.push(L);return}this.onFragLoaded(D.Events.FRAG_LOADED,L)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(d,L){var S=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(S&&x))return;for(var R=0;R<L.samples.length;R++){var O=L.samples[R].bytes;if(O){var w=this.extractCea608Data(O);S.addData(L.samples[R].pts,w[0]),x.addData(L.samples[R].pts,w[1])}}},r.onBufferFlushing=function(d,L){var S=L.startOffset,x=L.endOffset,R=L.endOffsetSubtitles,O=L.type,w=this.media;if(!w||w.currentTime<x)return;if(!O||O==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(l){return Object(P.removeCuesInRange)(E[l],S,x)})}if(this.config.renderTextTracksNatively&&(S===0&&R!==void 0)){var b=this.textTracks;Object.keys(b).forEach(function(l){return Object(P.removeCuesInRange)(b[l],S,R)})}},r.extractCea608Data=function(d){for(var L=d[0]&31,S=2,x=[[],[]],R=0;R<L;R++){var O=d[S++],w=127&d[S++],E=127&d[S++],b=(4&O)!==0,l=3&O;if(w===0&&E===0)continue;b&&((l===0||l===1)&&(x[l].push(w),x[l].push(E)))}return x},s}();function c(s,r){return s&&s.label===r.name&&!(s.textTrack1||s.textTrack2)}function u(s,r,a,d){return Math.min(r,d)-Math.max(s,a)}function f(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return X});var X=function(){function D(G,j){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=j}var B=D.prototype;return B.decrypt=function(j,P){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},P,j)},D}()},"./src/crypt/aes-decryptor.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"removePadding",function(){return D}),k.d(W,"default",function(){return B});var X=k("./src/utils/typed-array.ts");function D(G){var j=G.byteLength,P=j&&new DataView(G.buffer).getUint8(j-1);return P?Object(X.sliceUint8)(G,0,j-P):G}var B=function(){function G(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var j=G.prototype;return j.uint8ArrayToUint32Array_=function(I){for(var y=new DataView(I),m=new Uint32Array(4),p=0;p<4;p++)m[p]=y.getUint32(p*4);return m},j.initTable=function(){var I=this.sBox,y=this.invSBox,m=this.subMix,p=m[0],c=m[1],u=m[2],f=m[3],s=this.invSubMix,r=s[0],a=s[1],d=s[2],L=s[3],S=new Uint32Array(256),x=0,R=0,O=0;for(O=0;O<256;O++)O<128?S[O]=O<<1:S[O]=O<<1^283;for(O=0;O<256;O++){var w=R^R<<1^R<<2^R<<3^R<<4;w=w>>>8^w&255^99,I[x]=w,y[w]=x;var E=S[x],b=S[E],l=S[b],_=S[w]*257^w*16843008;p[x]=_<<24|_>>>8,c[x]=_<<16|_>>>16,u[x]=_<<8|_>>>24,f[x]=_,_=l*16843009^b*65537^E*257^x*16843008,r[w]=_<<24|_>>>8,a[w]=_<<16|_>>>16,d[w]=_<<8|_>>>24,L[w]=_,x?(x=E^S[S[S[l^E]]],R^=S[S[R]]):x=R=1}},j.expandKey=function(I){for(var y=this.uint8ArrayToUint32Array_(I),m=!0,p=0;p<y.length&&m;)m=y[p]===this.key[p],p++;if(m)return;this.key=y;var c=this.keySize=y.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var u=this.ksRows=(c+6+1)*4,f,s,r=this.keySchedule=new Uint32Array(u),a=this.invKeySchedule=new Uint32Array(u),d=this.sBox,L=this.rcon,S=this.invSubMix,x=S[0],R=S[1],O=S[2],w=S[3],E,b;for(f=0;f<u;f++){if(f<c){E=r[f]=y[f];continue}b=E,f%c===0?(b=b<<8|b>>>24,b=d[b>>>24]<<24|d[b>>>16&255]<<16|d[b>>>8&255]<<8|d[b&255],b^=L[f/c|0]<<24):c>6&&f%c===4&&(b=d[b>>>24]<<24|d[b>>>16&255]<<16|d[b>>>8&255]<<8|d[b&255]),r[f]=E=(r[f-c]^b)>>>0}for(s=0;s<u;s++)f=u-s,s&3?b=r[f]:b=r[f-4],s<4||f<=4?a[s]=b:a[s]=x[d[b>>>24]]^R[d[b>>>16&255]]^O[d[b>>>8&255]]^w[d[b&255]],a[s]=a[s]>>>0},j.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},j.decrypt=function(I,y,m){for(var p=this.keySize+6,c=this.invKeySchedule,u=this.invSBox,f=this.invSubMix,s=f[0],r=f[1],a=f[2],d=f[3],L=this.uint8ArrayToUint32Array_(m),S=L[0],x=L[1],R=L[2],O=L[3],w=new Int32Array(I),E=new Int32Array(w.length),b,l,_,h,g,T,N,V,Y,U,A,J,ne,oe,fe=this.networkToHostOrderSwap;y<w.length;){for(Y=fe(w[y]),U=fe(w[y+1]),A=fe(w[y+2]),J=fe(w[y+3]),g=Y^c[0],T=J^c[1],N=A^c[2],V=U^c[3],ne=4,oe=1;oe<p;oe++)b=s[g>>>24]^r[T>>16&255]^a[N>>8&255]^d[V&255]^c[ne],l=s[T>>>24]^r[N>>16&255]^a[V>>8&255]^d[g&255]^c[ne+1],_=s[N>>>24]^r[V>>16&255]^a[g>>8&255]^d[T&255]^c[ne+2],h=s[V>>>24]^r[g>>16&255]^a[T>>8&255]^d[N&255]^c[ne+3],g=b,T=l,N=_,V=h,ne=ne+4;b=u[g>>>24]<<24^u[T>>16&255]<<16^u[N>>8&255]<<8^u[V&255]^c[ne],l=u[T>>>24]<<24^u[N>>16&255]<<16^u[V>>8&255]<<8^u[g&255]^c[ne+1],_=u[N>>>24]<<24^u[V>>16&255]<<16^u[g>>8&255]<<8^u[T&255]^c[ne+2],h=u[V>>>24]<<24^u[g>>16&255]<<16^u[T>>8&255]<<8^u[N&255]^c[ne+3],E[y]=fe(b^S),E[y+1]=fe(h^x),E[y+2]=fe(_^R),E[y+3]=fe(l^O),S=Y,x=U,R=A,O=J,y=y+4}return E.buffer},G}()},"./src/crypt/decrypter.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return y});var X=k("./src/crypt/aes-crypto.ts"),D=k("./src/crypt/fast-aes-key.ts"),B=k("./src/crypt/aes-decryptor.ts"),G=k("./src/utils/logger.ts"),j=k("./src/utils/mp4-tools.ts"),P=k("./src/utils/typed-array.ts"),I=16,y=function(){function m(c,u,f){var s=f===void 0?{}:f,r=s.removePKCS7Padding,a=r===void 0?!0:r;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=c,this.config=u,this.removePKCS7Padding=a,a)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(L){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=m.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var u=this.currentResult;if(!u){this.reset();return}var f=new Uint8Array(u);return this.reset(),this.removePKCS7Padding?Object(B.removePadding)(f):f},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(u,f,s,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(u),f,s);var a=this.flush();a&&r(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(u),f,s).then(r)},p.softwareDecrypt=function(u,f,s){var r=this.currentIV,a=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(u=Object(j.appendUint8Array)(d,u),this.remainderData=null);var L=this.getValidChunk(u);if(!L.length)return null;r&&(s=r);var S=this.softwareDecrypter;S||(S=this.softwareDecrypter=new B.default),S.expandKey(f);var x=a;return this.currentResult=S.decrypt(L.buffer,0,s),this.currentIV=Object(P.sliceUint8)(L,-16).buffer,x||null},p.webCryptoDecrypt=function(u,f,s){var r=this,a=this.subtle;return(this.key!==f||!this.fastAesKey)&&(this.key=f,this.fastAesKey=new D.default(a,f)),this.fastAesKey.expandKey().then(function(d){if(!a)return Promise.reject(new Error("web crypto not initialized"));var L=new X.default(a,s);return L.decrypt(u.buffer,d)}).catch(function(d){return r.onWebCryptoError(d,u,f,s)})},p.onWebCryptoError=function(u,f,s,r){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",u),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(f,s,r)},p.getValidChunk=function(u){var f=u,s=u.length-u.length%I;return s!==u.length&&(f=Object(P.sliceUint8)(u,0,s),this.remainderData=Object(P.sliceUint8)(u,s)),f},p.logOnce=function(u){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+u),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return X});var X=function(){function D(G,j){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=j}var B=D.prototype;return B.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},D}()},"./src/demux/aacdemuxer.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/demux/base-audio-demuxer.ts"),D=k("./src/demux/adts.ts"),B=k("./src/utils/logger.ts"),G=k("./src/demux/id3.ts");function j(y,m){y.prototype=Object.create(m.prototype),y.prototype.constructor=y,P(y,m)}function P(y,m){return P=Object.setPrototypeOf||function(c,u){return c.__proto__=u,c},P(y,m)}var I=function(y){j(m,y);function m(c,u){var f;return f=y.call(this)||this,f.observer=void 0,f.config=void 0,f.observer=c,f.config=u,f}var p=m.prototype;return p.resetInitSegment=function(u,f,s){y.prototype.resetInitSegment.call(this,u,f,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:u,duration:s,inputTimeScale:9e4,dropped:0}},m.probe=function(u){if(!u)return!1;for(var f=G.getID3Data(u,0)||[],s=f.length,r=u.length;s<r;s++)if(D.probe(u,s))return B.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(u,f){return D.canParse(u,f)},p.appendFrame=function(u,f,s){D.initTrackConfig(u,this.observer,f,s,u.manifestCodec);var r=D.appendFrame(u,f,s,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},m}(X.default);I.minProbeByteLength=9,W.default=I},"./src/demux/adts.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"getAudioConfig",function(){return G}),k.d(W,"isHeaderPattern",function(){return j}),k.d(W,"getHeaderLength",function(){return P}),k.d(W,"getFullFrameLength",function(){return I}),k.d(W,"canGetFrameLength",function(){return y}),k.d(W,"isHeader",function(){return m}),k.d(W,"canParse",function(){return p}),k.d(W,"probe",function(){return c}),k.d(W,"initTrackConfig",function(){return u}),k.d(W,"getFrameDuration",function(){return f}),k.d(W,"parseFrameHeader",function(){return s}),k.d(W,"appendFrame",function(){return r});var X=k("./src/utils/logger.ts"),D=k("./src/errors.ts"),B=k("./src/events.ts");function G(a,d,L,S){var x,R,O,w,E=navigator.userAgent.toLowerCase(),b=S,l=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((d[L+2]&192)>>>6)+1;var _=(d[L+2]&60)>>>2;if(_>l.length-1){a.trigger(B.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return O=(d[L+2]&1)<<2,O|=(d[L+3]&192)>>>6,X.logger.log("manifest codec:"+S+", ADTS type:"+x+", samplingIndex:"+_),/firefox/i.test(E)?_>=6?(x=5,w=new Array(4),R=_-3):(x=2,w=new Array(2),R=_):E.indexOf("android")!==-1?(x=2,w=new Array(2),R=_):(x=5,w=new Array(4),S&&(S.indexOf("mp4a.40.29")!==-1||S.indexOf("mp4a.40.5")!==-1)||!S&&_>=6?R=_-3:((S&&S.indexOf("mp4a.40.2")!==-1&&(_>=6&&O===1||/vivaldi/i.test(E))||!S&&O===1)&&(x=2,w=new Array(2)),R=_)),w[0]=x<<3,w[0]|=(_&14)>>1,w[1]|=(_&1)<<7,w[1]|=O<<3,x===5&&(w[1]|=(R&14)>>1,w[2]=(R&1)<<7,w[2]|=2<<2,w[3]=0),{config:w,samplerate:l[_],channelCount:O,codec:"mp4a.40."+x,manifestCodec:b}}function j(a,d){return a[d]===255&&(a[d+1]&246)===240}function P(a,d){return a[d+1]&1?7:9}function I(a,d){return(a[d+3]&3)<<11|a[d+4]<<3|(a[d+5]&224)>>>5}function y(a,d){return d+5<a.length}function m(a,d){return d+1<a.length&&j(a,d)}function p(a,d){return y(a,d)&&j(a,d)&&I(a,d)<=a.length-d}function c(a,d){if(m(a,d)){var L=P(a,d);if(d+L>=a.length)return!1;var S=I(a,d);if(S<=L)return!1;var x=d+S;return x===a.length||m(a,x)}return!1}function u(a,d,L,S,x){if(!a.samplerate){var R=G(d,L,S,x);if(!R)return;a.config=R.config,a.samplerate=R.samplerate,a.channelCount=R.channelCount,a.codec=R.codec,a.manifestCodec=R.manifestCodec,X.logger.log("parsed codec:"+a.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function f(a){return 1024*9e4/a}function s(a,d,L,S,x){var R=P(a,d),O=I(a,d);if(O-=R,O>0){var w=L+S*x;return{headerLength:R,frameLength:O,stamp:w}}}function r(a,d,L,S,x){var R=f(a.samplerate),O=s(d,L,S,x,R);if(O){var w=O.frameLength,E=O.headerLength,b=O.stamp,l=E+w,_=Math.max(0,L+l-d.length),h;_?(h=new Uint8Array(l-E),h.set(d.subarray(L+E,d.length),0)):h=d.subarray(L+E,L+l);var g={unit:h,pts:b};return _||a.samples.push(g),{sample:g,length:l,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"initPTSFn",function(){return I});var X=k("./src/polyfills/number.ts"),D=k("./src/demux/id3.ts"),B=k("./src/demux/dummy-demuxed-track.ts"),G=k("./src/utils/mp4-tools.ts"),j=k("./src/utils/typed-array.ts"),P=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=y.prototype;return m.resetInitSegment=function(c,u,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(c,u){return!1},m.appendFrame=function(c,u,f){},m.demux=function(c,u){this.cachedData&&(c=Object(G.appendUint8Array)(this.cachedData,c),this.cachedData=null);var f=D.getID3Data(c,0),s=f?f.length:0,r,a,d=this._audioTrack,L=this._id3Track,S=f?D.getTimeStamp(f):void 0,x=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(S,u)),f&&f.length>0&&L.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),a=this.initPTS;s<x;){if(this.canParse(c,s)){var R=this.appendFrame(d,c,s);R?(this.frameIndex++,a=R.sample.pts,s+=R.length,r=s):s=x}else D.canParse(c,s)?(f=D.getID3Data(c,s),L.samples.push({pts:a,dts:a,data:f}),s+=f.length,r=s):s++;if(s===x&&r!==x){var O=Object(j.sliceUint8)(c,r);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:d,avcTrack:Object(B.dummyTrack)(),id3Track:L,textTrack:Object(B.dummyTrack)()}},m.demuxSampleAes=function(c,u,f){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(c){var u=this.cachedData;return u&&(this.cachedData=null,this.demux(u,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(B.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(B.dummyTrack)()}},m.destroy=function(){},y}(),I=function(m,p){return Object(X.isFiniteNumber)(m)?m*90:p*9e4};W.default=P},"./src/demux/chunk-cache.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return X});var X=function(){function B(){this.chunks=[],this.dataLength=0}var G=B.prototype;return G.push=function(P){this.chunks.push(P),this.dataLength+=P.length},G.flush=function(){var P=this.chunks,I=this.dataLength,y;if(P.length)P.length===1?y=P[0]:y=D(P,I);else return new Uint8Array(0);return this.reset(),y},G.reset=function(){this.chunks.length=0,this.dataLength=0},B}();function D(B,G){for(var j=new Uint8Array(G),P=0,I=0;I<B.length;I++){var y=B[I];j.set(y,P),P+=y.length}return j}},"./src/demux/dummy-demuxed-track.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"dummyTrack",function(){return X});function X(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/utils/logger.ts"),D=function(){function B(j){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=j,this.bytesAvailable=j.byteLength,this.word=0,this.bitsAvailable=0}var G=B.prototype;return G.loadWord=function(){var P=this.data,I=this.bytesAvailable,y=P.byteLength-I,m=new Uint8Array(4),p=Math.min(4,I);if(p===0)throw new Error("no bytes available");m.set(P.subarray(y,y+p)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},G.skipBits=function(P){var I;this.bitsAvailable>P?(this.word<<=P,this.bitsAvailable-=P):(P-=this.bitsAvailable,I=P>>3,P-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=P,this.bitsAvailable-=P)},G.readBits=function(P){var I=Math.min(this.bitsAvailable,P),y=this.word>>>32-I;return P>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=P-I,I>0&&this.bitsAvailable?y<<I|this.readBits(I):y},G.skipLZ=function(){var P;for(P=0;P<this.bitsAvailable;++P)if((this.word&2147483648>>>P)!==0)return this.word<<=P,this.bitsAvailable-=P,P;return this.loadWord(),P+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var P=this.skipLZ();return this.readBits(P+1)-1},G.readEG=function(){var P=this.readUEG();return 1&P?1+P>>>1:-1*(P>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(P){for(var I=8,y=8,m,p=0;p<P;p++)y!==0&&(m=this.readEG(),y=(I+m+256)%256),I=y===0?I:y},G.readSPS=function(){var P=0,I=0,y=0,m=0,p,c,u,f=this.readUByte.bind(this),s=this.readBits.bind(this),r=this.readUEG.bind(this),a=this.readBoolean.bind(this),d=this.skipBits.bind(this),L=this.skipEG.bind(this),S=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);f();var R=f();if(s(5),d(3),f(),S(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var O=r();if(O===3&&d(1),S(),S(),d(1),a())for(c=O!==3?8:12,u=0;u<c;u++)a()&&(u<6?x(16):x(64))}S();var w=r();if(w===0)r();else if(w===1)for(d(1),L(),L(),p=r(),u=0;u<p;u++)L();S(),d(1);var E=r(),b=r(),l=s(1);l===0&&d(1),d(1),a()&&(P=r(),I=r(),y=r(),m=r());var _=[1,1];if(a()&&a()){var h=f();switch(h){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[f()<<8|f(),f()<<8|f()];break}}}return{width:Math.ceil((E+1)*16-P*2-I*2),height:(2-l)*(b+1)*16-(l?2:4)*(y+m),pixelRatio:_}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},B}();W.default=D},"./src/demux/id3.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"isHeader",function(){return X}),k.d(W,"isFooter",function(){return D}),k.d(W,"getID3Data",function(){return B}),k.d(W,"canParse",function(){return j}),k.d(W,"getTimeStamp",function(){return P}),k.d(W,"isTimeStampFrame",function(){return I}),k.d(W,"getID3Frames",function(){return m}),k.d(W,"decodeFrame",function(){return p}),k.d(W,"utf8ArrayToStr",function(){return r}),k.d(W,"testables",function(){return a});var X=function(x,R){return R+10<=x.length&&(x[R]===73&&x[R+1]===68&&x[R+2]===51&&(x[R+3]<255&&x[R+4]<255&&(x[R+6]<128&&x[R+7]<128&&x[R+8]<128&&x[R+9]<128)))},D=function(x,R){return R+10<=x.length&&(x[R]===51&&x[R+1]===68&&x[R+2]===73&&(x[R+3]<255&&x[R+4]<255&&(x[R+6]<128&&x[R+7]<128&&x[R+8]<128&&x[R+9]<128)))},B=function(x,R){for(var O=R,w=0;X(x,R);){w+=10;var E=G(x,R+6);w+=E,D(x,R+10)&&(w+=10),R+=w}return w>0?x.subarray(O,O+w):void 0},G=function(x,R){var O=0;return O=(x[R]&127)<<21,O|=(x[R+1]&127)<<14,O|=(x[R+2]&127)<<7,O|=x[R+3]&127,O},j=function(x,R){return X(x,R)&&G(x,R+6)+10<=x.length-R},P=function(x){for(var R=m(x),O=0;O<R.length;O++){var w=R[O];if(I(w))return s(w)}return},I=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},y=function(x){var R=String.fromCharCode(x[0],x[1],x[2],x[3]),O=G(x,4),w=10;return{type:R,size:O,data:x.subarray(w,w+O)}},m=function(x){for(var R=0,O=[];X(x,R);){var w=G(x,R+6);R+=10;for(var E=R+w;R+8<E;){var b=y(x.subarray(R)),l=p(b);l&&O.push(l),R+=b.size+10}D(x,R)&&(R+=10)}return O},p=function(x){return x.type==="PRIV"?c(x):x.type[0]==="W"?f(x):u(x)},c=function(x){if(x.size<2)return;var R=r(x.data,!0),O=new Uint8Array(x.data.subarray(R.length+1));return{key:x.type,info:R,data:O.buffer}},u=function(x){if(x.size<2)return;if(x.type==="TXXX"){var R=1,O=r(x.data.subarray(R),!0);R+=O.length+1;var w=r(x.data.subarray(R));return{key:x.type,info:O,data:w}}var E=r(x.data.subarray(1));return{key:x.type,data:E}},f=function(x){if(x.type==="WXXX"){if(x.size<2)return;var R=1,O=r(x.data.subarray(R),!0);R+=O.length+1;var w=r(x.data.subarray(R));return{key:x.type,info:O,data:w}}var E=r(x.data);return{key:x.type,data:E}},s=function(x){if(x.data.byteLength===8){var R=new Uint8Array(x.data),O=R[3]&1,w=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return w/=45,O&&(w+=4772185884e-2),Math.round(w)}return},r=function(x,R){R===void 0&&(R=!1);var O=L();if(O){var w=O.decode(x);if(R){var E=w.indexOf("\0");return E!==-1?w.substring(0,E):w}return w.replace(/\0/g,"")}for(var b=x.length,l,_,h,g="",T=0;T<b;){if(l=x[T++],l===0&&R)return g;if(l===0||l===3)continue;switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:g+=String.fromCharCode(l);break;case 12:case 13:_=x[T++],g+=String.fromCharCode((l&31)<<6|_&63);break;case 14:_=x[T++],h=x[T++],g+=String.fromCharCode((l&15)<<12|(_&63)<<6|(h&63)<<0);break;default:}}return g},a={decodeTextFrame:u},d;function L(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/demux/base-audio-demuxer.ts"),D=k("./src/demux/id3.ts"),B=k("./src/utils/logger.ts"),G=k("./src/demux/mpegaudio.ts");function j(y,m){y.prototype=Object.create(m.prototype),y.prototype.constructor=y,P(y,m)}function P(y,m){return P=Object.setPrototypeOf||function(c,u){return c.__proto__=u,c},P(y,m)}var I=function(y){j(m,y);function m(){return y.apply(this,arguments)||this}var p=m.prototype;return p.resetInitSegment=function(u,f,s){y.prototype.resetInitSegment.call(this,u,f,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:u,duration:s,inputTimeScale:9e4,dropped:0}},m.probe=function(u){if(!u)return!1;for(var f=D.getID3Data(u,0)||[],s=f.length,r=u.length;s<r;s++)if(G.probe(u,s))return B.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(u,f){return G.canParse(u,f)},p.appendFrame=function(u,f,s){return this.initPTS===null?void 0:G.appendFrame(u,f,s,this.initPTS,this.frameIndex)},m}(X.default);I.minProbeByteLength=4,W.default=I},"./src/demux/mp4demuxer.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/utils/mp4-tools.ts"),D=k("./src/demux/dummy-demuxed-track.ts"),B=function(){function G(P,I){this.remainderData=null,this.config=void 0,this.config=I}var j=G.prototype;return j.resetTimeStamp=function(){},j.resetInitSegment=function(){},j.resetContiguity=function(){},G.probe=function(I){return Object(X.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},j.demux=function(I){var y=I,m=Object(D.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(X.appendUint8Array)(this.remainderData,I));var p=Object(X.segmentValidRange)(y);this.remainderData=p.remainder,m.samples=p.valid||new Uint8Array}else m.samples=y;return{audioTrack:Object(D.dummyTrack)(),avcTrack:m,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},j.flush=function(){var I=Object(D.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(D.dummyTrack)(),avcTrack:I,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},j.demuxSampleAes=function(I,y,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},j.destroy=function(){},G}();B.minProbeByteLength=1024,W.default=B},"./src/demux/mpegaudio.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"appendFrame",function(){return P}),k.d(W,"parseHeader",function(){return I}),k.d(W,"isHeaderPattern",function(){return y}),k.d(W,"isHeader",function(){return m}),k.d(W,"canParse",function(){return p}),k.d(W,"probe",function(){return c});var X=null,D=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],j=[0,1,1,4];function P(u,f,s,r,a){if(s+24>f.length)return;var d=I(f,s);if(d&&s+d.frameLength<=f.length){var L=d.samplesPerFrame*9e4/d.sampleRate,S=r+a*L,x={unit:f.subarray(s,s+d.frameLength),pts:S,dts:S};return u.config=[],u.channelCount=d.channelCount,u.samplerate=d.sampleRate,u.samples.push(x),{sample:x,length:d.frameLength,missing:0}}}function I(u,f){var s=u[f+1]>>3&3,r=u[f+1]>>1&3,a=u[f+2]>>4&15,d=u[f+2]>>2&3;if(s!==1&&a!==0&&a!==15&&d!==3){var L=u[f+2]>>1&1,S=u[f+3]>>6,x=s===3?3-r:r===3?3:4,R=D[x*14+a-1]*1e3,O=s===3?0:s===2?1:2,w=B[O*3+d],E=S===3?1:2,b=G[s][r],l=j[r],_=b*8*l,h=Math.floor(b*R/w+L)*l;if(X===null){var g=navigator.userAgent||"",T=g.match(/Chrome\/(\d+)/i);X=T?parseInt(T[1]):0}var N=!!X&&X<=87;return N&&r===2&&R>=224e3&&S===0&&(u[f+3]=u[f+3]|128),{sampleRate:w,channelCount:E,frameLength:h,samplesPerFrame:_}}}function y(u,f){return u[f]===255&&(u[f+1]&224)===224&&(u[f+1]&6)!==0}function m(u,f){return f+1<u.length&&y(u,f)}function p(u,f){var s=4;return y(u,f)&&s<=u.length-f}function c(u,f){if(f+1<u.length&&y(u,f)){var s=4,r=I(u,f),a=s;r!=null&&r.frameLength&&(a=r.frameLength);var d=f+a;return d===u.length||m(u,d)}return!1}},"./src/demux/sample-aes.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/crypt/decrypter.ts"),D=k("./src/demux/tsdemuxer.ts"),B=function(){function G(P,I,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new X.default(P,I,{removePKCS7Padding:!1})}var j=G.prototype;return j.decryptBuffer=function(I,y){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,y)},j.decryptAacSample=function(I,y,m,p){var c=I[y].unit,u=c.subarray(16,c.length-c.length%16),f=u.buffer.slice(u.byteOffset,u.byteOffset+u.length),s=this;this.decryptBuffer(f,function(r){var a=new Uint8Array(r);c.set(a,16),p||s.decryptAacSamples(I,y+1,m)})},j.decryptAacSamples=function(I,y,m){for(;;y++){if(y>=I.length){m();return}if(I[y].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(I,y,m,p),!p)return}},j.getAvcEncryptedData=function(I){for(var y=Math.floor((I.length-48)/160)*16+16,m=new Int8Array(y),p=0,c=32;c<=I.length-16;c+=160,p+=16)m.set(I.subarray(c,c+16),p);return m},j.getAvcDecryptedUnit=function(I,y){for(var m=new Uint8Array(y),p=0,c=32;c<=I.length-16;c+=160,p+=16)I.set(m.subarray(p,p+16),c);return I},j.decryptAvcSample=function(I,y,m,p,c,u){var f=Object(D.discardEPB)(c.data),s=this.getAvcEncryptedData(f),r=this;this.decryptBuffer(s.buffer,function(a){c.data=r.getAvcDecryptedUnit(f,a),u||r.decryptAvcSamples(I,y,m+1,p)})},j.decryptAvcSamples=function(I,y,m,p){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,m=0){if(y>=I.length){p();return}for(var c=I[y].units;!(m>=c.length);m++){var u=c[m];if(u.data.length<=48||u.type!==1&&u.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(I,y,m,p,u,f),!f)return}}},G}();W.default=B},"./src/demux/transmuxer-interface.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return c});var X=k("./node_modules/webworkify-webpack/index.js"),D=k.n(X),B=k("./src/events.ts"),G=k("./src/demux/transmuxer.ts"),j=k("./src/utils/logger.ts"),P=k("./src/errors.ts"),I=k("./src/utils/mediasource-helper.ts"),y=k("./node_modules/eventemitter3/index.js"),m=k.n(y),p=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function u(s,r,a,d){var L=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=s,this.id=r,this.onTransmuxComplete=a,this.onFlush=d;var S=s.config,x=function(b,l){l=l||{},l.frag=L.frag,l.id=L.id,s.trigger(b,l)};this.observer=new y.EventEmitter,this.observer.on(B.Events.FRAG_DECRYPTED,x),this.observer.on(B.Events.ERROR,x);var R={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(S.enableWorker&&typeof Worker!="undefined"){j.logger.log("demuxing in webworker");var w;try{w=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),w.addEventListener("message",this.onwmsg),w.onerror=function(E){s.trigger(B.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},w.postMessage({cmd:"init",typeSupported:R,vendor:O,id:r,config:JSON.stringify(S)})}catch(E){j.logger.warn("Error in worker:",E),j.logger.error("Error while initializing DemuxerWorker, fallback to inline"),w&&self.URL.revokeObjectURL(w.objectURL),this.transmuxer=new G.default(this.observer,R,S,O,r),this.worker=null}}else this.transmuxer=new G.default(this.observer,R,S,O,r)}var f=u.prototype;return f.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},f.push=function(r,a,d,L,S,x,R,O,w,E){var b=this;w.transmuxing.start=self.performance.now();var l=this.transmuxer,_=this.worker,h=x?x.start:S.start,g=S.decryptdata,T=this.frag,N=!(T&&S.cc===T.cc),V=!(T&&w.level===T.level),Y=T?w.sn-T.sn:-1,U=this.part?w.part-this.part.index:1,A=!V&&(Y===1||Y===0&&U===1),J=self.performance.now();(V||Y||S.stats.parsing.start===0)&&(S.stats.parsing.start=J),x&&(U||!A)&&(x.stats.parsing.start=J);var ne=new G.TransmuxState(N,A,O,V,h);if(!A||N){j.logger.log("[transmuxer-interface, "+S.type+"]: Starting new transmux session for sn: "+w.sn+" p: "+w.part+" level: "+w.level+" id: "+w.id+`
|
|
discontinuity: `+N+`
|
|
trackSwitch: `+V+`
|
|
contiguous: `+A+`
|
|
accurateTimeOffset: `+O+`
|
|
timeOffset: `+h);var oe=new G.TransmuxConfig(d,L,a,R,E);this.configureTransmuxer(oe)}if(this.frag=S,this.part=x,_)_.postMessage({cmd:"demux",data:r,decryptdata:g,chunkMeta:w,state:ne},r instanceof ArrayBuffer?[r]:[]);else if(l){var fe=l.push(r,g,w,ne);Object(G.isPromise)(fe)?fe.then(function(ke){b.handleTransmuxComplete(ke)}):this.handleTransmuxComplete(fe)}},f.flush=function(r){var a=this;r.transmuxing.start=self.performance.now();var d=this.transmuxer,L=this.worker;if(L)L.postMessage({cmd:"flush",chunkMeta:r});else if(d){var S=d.flush(r);Object(G.isPromise)(S)?S.then(function(x){a.handleFlushResult(x,r)}):this.handleFlushResult(S,r)}},f.handleFlushResult=function(r,a){var d=this;r.forEach(function(L){d.handleTransmuxComplete(L)}),this.onFlush(a)},f.onWorkerMessage=function(r){var a=r.data,d=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,d.trigger(a.event,a.data);break}}},f.configureTransmuxer=function(r){var a=this.worker,d=this.transmuxer;a?a.postMessage({cmd:"configure",config:r}):d&&d.configure(r)},f.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},u}()},"./src/demux/transmuxer-worker.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return P});var X=k("./src/demux/transmuxer.ts"),D=k("./src/events.ts"),B=k("./src/utils/logger.ts"),G=k("./node_modules/eventemitter3/index.js"),j=k.n(G);function P(c){var u=new G.EventEmitter,f=function(r,a){c.postMessage({event:r,data:a})};u.on(D.Events.FRAG_DECRYPTED,f),u.on(D.Events.ERROR,f),c.addEventListener("message",function(s){var r=s.data;switch(r.cmd){case"init":{var a=JSON.parse(r.config);c.transmuxer=new X.default(u,r.typeSupported,a,r.vendor,r.id),Object(B.enableLogs)(a.debug),f("init",null);break}case"configure":{c.transmuxer.configure(r.config);break}case"demux":{var d=c.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(X.isPromise)(d)?d.then(function(x){I(c,x)}):I(c,d);break}case"flush":{var L=r.chunkMeta,S=c.transmuxer.flush(L);Object(X.isPromise)(S)?S.then(function(x){m(c,x,L)}):m(c,S,L);break}default:break}})}function I(c,u){if(p(u.remuxResult))return;var f=[],s=u.remuxResult,r=s.audio,a=s.video;r&&y(f,r),a&&y(f,a),c.postMessage({event:"transmuxComplete",data:u},f)}function y(c,u){u.data1&&c.push(u.data1.buffer),u.data2&&c.push(u.data2.buffer)}function m(c,u,f){u.forEach(function(s){I(c,s)}),c.postMessage({event:"flush",data:f})}function p(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return a}),k.d(W,"isPromise",function(){return S}),k.d(W,"TransmuxConfig",function(){return x}),k.d(W,"TransmuxState",function(){return R});var X=k("./src/events.ts"),D=k("./src/errors.ts"),B=k("./src/crypt/decrypter.ts"),G=k("./src/demux/aacdemuxer.ts"),j=k("./src/demux/mp4demuxer.ts"),P=k("./src/demux/tsdemuxer.ts"),I=k("./src/demux/mp3demuxer.ts"),y=k("./src/remux/mp4-remuxer.ts"),m=k("./src/remux/passthrough-remuxer.ts"),p=k("./src/demux/chunk-cache.ts"),c=k("./src/utils/mp4-tools.ts"),u=k("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(O){u.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var s=[{demux:P.default,remux:y.default},{demux:j.default,remux:m.default},{demux:G.default,remux:y.default},{demux:I.default,remux:y.default}],r=1024;s.forEach(function(O){var w=O.demux;r=Math.max(r,w.minProbeByteLength)});var a=function(){function O(E,b,l,_,h){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new p.default,this.observer=E,this.typeSupported=b,this.config=l,this.vendor=_,this.id=h}var w=O.prototype;return w.configure=function(b){this.transmuxConfig=b,this.decrypter&&this.decrypter.reset()},w.push=function(b,l,_,h){var g=this,T=_.transmuxing;T.executeStart=f();var N=new Uint8Array(b),V=this.cache,Y=this.config,U=this.currentTransmuxState,A=this.transmuxConfig;h&&(this.currentTransmuxState=h);var J=d(N,l);if(J&&J.method==="AES-128"){var ne=this.getDecrypter();if(Y.enableSoftwareAES){var oe=ne.softwareDecrypt(N,J.key.buffer,J.iv.buffer);if(!oe)return T.executeEnd=f(),L(_);N=new Uint8Array(oe)}else return this.decryptionPromise=ne.webCryptoDecrypt(N,J.key.buffer,J.iv.buffer).then(function(Qe){var ut=g.push(Qe,null,_);return g.decryptionPromise=null,ut}),this.decryptionPromise}var fe=h||U,ke=fe.contiguous,Oe=fe.discontinuity,Me=fe.trackSwitch,Be=fe.accurateTimeOffset,Pe=fe.timeOffset,be=A.audioCodec,le=A.videoCodec,Le=A.defaultInitPts,tt=A.duration,nt=A.initSegmentData;if((Oe||Me)&&this.resetInitSegment(nt,be,le,tt),Oe&&this.resetInitialTimestamp(Le),ke||this.resetContiguity(),this.needsProbing(N,Oe,Me)){if(V.dataLength){var lt=V.flush();N=Object(c.appendUint8Array)(lt,N)}this.configureTransmuxer(N,A)}var Et=this.transmux(N,J,Pe,Be,_),Ve=this.currentTransmuxState;return Ve.contiguous=!0,Ve.discontinuity=!1,Ve.trackSwitch=!1,T.executeEnd=f(),Et},w.flush=function(b){var l=this,_=b.transmuxing;_.executeStart=f();var h=this.decrypter,g=this.cache,T=this.currentTransmuxState,N=this.decryptionPromise;if(N)return N.then(function(){return l.flush(b)});var V=[],Y=T.timeOffset;if(h){var U=h.flush();U&&V.push(this.push(U,null,b))}var A=g.dataLength;g.reset();var J=this.demuxer,ne=this.remuxer;if(!J||!ne)return A>=r&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),_.executeEnd=f(),[L(b)];var oe=J.flush(Y);return S(oe)?oe.then(function(fe){return l.flushRemux(V,fe,b),V}):(this.flushRemux(V,oe,b),V)},w.flushRemux=function(b,l,_){var h=l.audioTrack,g=l.avcTrack,T=l.id3Track,N=l.textTrack,V=this.currentTransmuxState,Y=V.accurateTimeOffset,U=V.timeOffset;u.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var A=this.remuxer.remux(h,g,T,N,U,Y,!0,this.id);b.push({remuxResult:A,chunkMeta:_}),_.transmuxing.executeEnd=f()},w.resetInitialTimestamp=function(b){var l=this.demuxer,_=this.remuxer;if(!l||!_)return;l.resetTimeStamp(b),_.resetTimeStamp(b)},w.resetContiguity=function(){var b=this.demuxer,l=this.remuxer;if(!b||!l)return;b.resetContiguity(),l.resetNextTimestamp()},w.resetInitSegment=function(b,l,_,h){var g=this.demuxer,T=this.remuxer;if(!g||!T)return;g.resetInitSegment(l,_,h),T.resetInitSegment(b,l,_)},w.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},w.transmux=function(b,l,_,h,g){var T;return l&&l.method==="SAMPLE-AES"?T=this.transmuxSampleAes(b,l,_,h,g):T=this.transmuxUnencrypted(b,_,h,g),T},w.transmuxUnencrypted=function(b,l,_,h){var g=this.demuxer.demux(b,l,!1,!this.config.progressive),T=g.audioTrack,N=g.avcTrack,V=g.id3Track,Y=g.textTrack,U=this.remuxer.remux(T,N,V,Y,l,_,!1,this.id);return{remuxResult:U,chunkMeta:h}},w.transmuxSampleAes=function(b,l,_,h,g){var T=this;return this.demuxer.demuxSampleAes(b,l,_).then(function(N){var V=T.remuxer.remux(N.audioTrack,N.avcTrack,N.id3Track,N.textTrack,_,h,!1,T.id);return{remuxResult:V,chunkMeta:g}})},w.configureTransmuxer=function(b,l){for(var _=this.config,h=this.observer,g=this.typeSupported,T=this.vendor,N=l.audioCodec,V=l.defaultInitPts,Y=l.duration,U=l.initSegmentData,A=l.videoCodec,J,ne=0,oe=s.length;ne<oe;ne++)if(s[ne].demux.probe(b)){J=s[ne];break}J||(u.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),J={demux:j.default,remux:m.default});var fe=this.demuxer,ke=this.remuxer,Oe=J.remux,Me=J.demux;(!ke||!(ke instanceof Oe))&&(this.remuxer=new Oe(h,_,g,T)),(!fe||!(fe instanceof Me))&&(this.demuxer=new Me(h,_,g),this.probe=Me.probe),this.resetInitSegment(U,N,A,Y),this.resetInitialTimestamp(V)},w.needsProbing=function(b,l,_){return!this.demuxer||!this.remuxer||l||_},w.getDecrypter=function(){var b=this.decrypter;return b||(b=this.decrypter=new B.default(this.observer,this.config)),b},O}();function d(O,w){var E=null;return O.byteLength>0&&w!=null&&w.key!=null&&w.iv!==null&&w.method!=null&&(E=w),E}var L=function(w){return{remuxResult:{},chunkMeta:w}};function S(O){return"then"in O&&O.then instanceof Function}var x=function(w,E,b,l,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=w,this.videoCodec=E,this.initSegmentData=b,this.duration=l,this.defaultInitPts=_},R=function(w,E,b,l,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=w,this.contiguous=E,this.accurateTimeOffset=b,this.trackSwitch=l,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"discardEPB",function(){return L});var X=k("./src/demux/adts.ts"),D=k("./src/demux/mpegaudio.ts"),B=k("./src/demux/exp-golomb.ts"),G=k("./src/demux/id3.ts"),j=k("./src/demux/sample-aes.ts"),P=k("./src/events.ts"),I=k("./src/utils/mp4-tools.ts"),y=k("./src/utils/logger.ts"),m=k("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},c=function(){function S(R,O,w){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=R,this.config=O,this.typeSupported=w}S.probe=function(O){var w=S.syncOffset(O);return w<0?!1:(w&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+w+", junk ahead ?"),!0)},S.syncOffset=function(O){for(var w=Math.min(1e3,O.length-3*188),E=0;E<w;){if(O[E]===71&&O[E+188]===71&&O[E+2*188]===71)return E;E++}return-1},S.createTrack=function(O,w){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:p[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?w:void 0}};var x=S.prototype;return x.resetInitSegment=function(O,w,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=S.createTrack("video",E),this._audioTrack=S.createTrack("audio",E),this._id3Track=S.createTrack("id3",E),this._txtTrack=S.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=w,this._duration=E},x.resetTimeStamp=function(){},x.resetContiguity=function(){var O=this._audioTrack,w=this._avcTrack,E=this._id3Track;O&&(O.pesData=null),w&&(w.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(O,w,E,b){E===void 0&&(E=!1),b===void 0&&(b=!1),E||(this.sampleAes=null);var l,_=this._avcTrack,h=this._audioTrack,g=this._id3Track,T=_.pid,N=_.pesData,V=h.pid,Y=g.pid,U=h.pesData,A=g.pesData,J=!1,ne=this.pmtParsed,oe=this._pmtId,fe=O.length;if(this.remainderData&&(O=Object(I.appendUint8Array)(this.remainderData,O),fe=O.length,this.remainderData=null),fe<188&&!b)return this.remainderData=O,{audioTrack:h,avcTrack:_,id3Track:g,textTrack:this._txtTrack};var ke=Math.max(0,S.syncOffset(O));fe-=(fe+ke)%188,fe<O.byteLength&&!b&&(this.remainderData=new Uint8Array(O.buffer,fe,O.buffer.byteLength-fe));for(var Oe=ke;Oe<fe;Oe+=188)if(O[Oe]===71){var Me=!!(O[Oe+1]&64),Be=((O[Oe+1]&31)<<8)+O[Oe+2],Pe=(O[Oe+3]&48)>>4,be=void 0;if(Pe>1){if(be=Oe+5+O[Oe+4],be===Oe+188)continue}else be=Oe+4;switch(Be){case T:Me&&(N&&(l=r(N))&&this.parseAVCPES(l,!1),N={data:[],size:0}),N&&(N.data.push(O.subarray(be,Oe+188)),N.size+=Oe+188-be);break;case V:Me&&(U&&(l=r(U))&&(h.isAAC?this.parseAACPES(l):this.parseMPEGPES(l)),U={data:[],size:0}),U&&(U.data.push(O.subarray(be,Oe+188)),U.size+=Oe+188-be);break;case Y:Me&&(A&&(l=r(A))&&this.parseID3PES(l),A={data:[],size:0}),A&&(A.data.push(O.subarray(be,Oe+188)),A.size+=Oe+188-be);break;case 0:Me&&(be+=O[be]+1),oe=this._pmtId=f(O,be);break;case oe:{Me&&(be+=O[be]+1);var le=s(O,be,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);T=le.avc,T>0&&(_.pid=T),V=le.audio,V>0&&(h.pid=V,h.isAAC=le.isAAC),Y=le.id3,Y>0&&(g.pid=Y),J&&!ne&&(y.logger.log("reparse from beginning"),J=!1,Oe=ke-188),ne=this.pmtParsed=!0;break}case 17:case 8191:break;default:J=!0;break}}else this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=N,h.pesData=U,g.pesData=A;var Le={audioTrack:h,avcTrack:_,id3Track:g,textTrack:this._txtTrack};return b&&this.extractRemainingSamples(Le),Le},x.flush=function(){var O=this.remainderData;this.remainderData=null;var w;return O?w=this.demux(O,-1,!1,!0):w={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(w),this.sampleAes?this.decrypt(w,this.sampleAes):w},x.extractRemainingSamples=function(O){var w=O.audioTrack,E=O.avcTrack,b=O.id3Track,l=E.pesData,_=w.pesData,h=b.pesData,g;l&&(g=r(l))?(this.parseAVCPES(g,!0),E.pesData=null):E.pesData=l,_&&(g=r(_))?(w.isAAC?this.parseAACPES(g):this.parseMPEGPES(g),w.pesData=null):(_!=null&&_.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),w.pesData=_),h&&(g=r(h))?(this.parseID3PES(g),b.pesData=null):b.pesData=h},x.demuxSampleAes=function(O,w,E){var b=this.demux(O,E,!0,!this.config.progressive),l=this.sampleAes=new j.default(this.observer,this.config,w);return this.decrypt(b,l)},x.decrypt=function(O,w){return new Promise(function(E){var b=O.audioTrack,l=O.avcTrack;b.samples&&b.isAAC?w.decryptAacSamples(b.samples,0,function(){l.samples?w.decryptAvcSamples(l.samples,0,0,function(){E(O)}):E(O)}):l.samples&&w.decryptAvcSamples(l.samples,0,0,function(){E(O)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(O,w){var E=this,b=this._avcTrack,l=this.parseAVCNALu(O.data),_=!1,h=this.avcSample,g,T=!1;O.data=null,h&&l.length&&!b.audFound&&(a(h,b),h=this.avcSample=u(!1,O.pts,O.dts,"")),l.forEach(function(N){switch(N.type){case 1:{g=!0,h||(h=E.avcSample=u(!0,O.pts,O.dts,"")),_&&(h.debug+="NDR "),h.frame=!0;var V=N.data;if(T&&V.length>4){var Y=new B.default(V).readSliceType();(Y===2||Y===4||Y===7||Y===9)&&(h.key=!0)}break}case 5:g=!0,h||(h=E.avcSample=u(!0,O.pts,O.dts,"")),_&&(h.debug+="IDR "),h.key=!0,h.frame=!0;break;case 6:{g=!0,_&&h&&(h.debug+="SEI ");var U=new B.default(L(N.data));U.readUByte();for(var A=0,J=0,ne=!1,oe=0;!ne&&U.bytesAvailable>1;){A=0;do oe=U.readUByte(),A+=oe;while(oe===255);J=0;do oe=U.readUByte(),J+=oe;while(oe===255);if(A===4&&U.bytesAvailable!==0){ne=!0;var fe=U.readUByte();if(fe===181){var ke=U.readUShort();if(ke===49){var Oe=U.readUInt();if(Oe===1195456820){var Me=U.readUByte();if(Me===3){for(var Be=U.readUByte(),Pe=U.readUByte(),be=31&Be,le=[Be,Pe],Le=0;Le<be;Le++)le.push(U.readUByte()),le.push(U.readUByte()),le.push(U.readUByte());d(E._txtTrack.samples,{type:3,pts:O.pts,bytes:le})}}}}}else if(A===5&&U.bytesAvailable!==0){if(ne=!0,J>16){for(var tt=[],nt=0;nt<16;nt++)tt.push(U.readUByte().toString(16)),(nt===3||nt===5||nt===7||nt===9)&&tt.push("-");for(var lt=J-16,Et=new Uint8Array(lt),Ve=0;Ve<lt;Ve++)Et[Ve]=U.readUByte();d(E._txtTrack.samples,{pts:O.pts,payloadType:A,uuid:tt.join(""),userData:Object(G.utf8ArrayToStr)(Et),userDataBytes:Et})}}else if(J<U.bytesAvailable)for(var Qe=0;Qe<J;Qe++)U.readUByte()}break}case 7:if(g=!0,T=!0,_&&h&&(h.debug+="SPS "),!b.sps){var ut=new B.default(N.data),gt=ut.readSPS();b.width=gt.width,b.height=gt.height,b.pixelRatio=gt.pixelRatio,b.sps=[N.data],b.duration=E._duration;for(var ot=N.data.subarray(1,4),it="avc1.",rt=0;rt<3;rt++){var Pt=ot[rt].toString(16);Pt.length<2&&(Pt="0"+Pt),it+=Pt}b.codec=it}break;case 8:g=!0,_&&h&&(h.debug+="PPS "),b.pps||(b.pps=[N.data]);break;case 9:g=!1,b.audFound=!0,h&&a(h,b),h=E.avcSample=u(!1,O.pts,O.dts,_?"AUD ":"");break;case 12:g=!1;break;default:g=!1,h&&(h.debug+="unknown NAL "+N.type+" ");break}if(h&&g){var It=h.units;It.push(N)}}),w&&h&&(a(h,b),this.avcSample=null)},x.getLastNalUnit=function(){var O,w=this.avcSample,E;if(!w||w.units.length===0){var b=this._avcTrack.samples;w=b[b.length-1]}if((O=w)!==null&&O!==void 0&&O.units){var l=w.units;E=l[l.length-1]}return E},x.parseAVCNALu=function(O){var w=O.byteLength,E=this._avcTrack,b=E.naluState||0,l=b,_=[],h=0,g,T,N,V=-1,Y=0;for(b===-1&&(V=0,Y=O[0]&31,b=0,h=1);h<w;){if(g=O[h++],!b){b=g?0:1;continue}if(b===1){b=g?0:2;continue}if(!g)b=3;else if(g===1){if(V>=0){var U={data:O.subarray(V,h-b-1),type:Y};_.push(U)}else{var A=this.getLastNalUnit();if(A&&(l&&h<=4-l&&(A.state&&(A.data=A.data.subarray(0,A.data.byteLength-l))),T=h-b-1,T>0)){var J=new Uint8Array(A.data.byteLength+T);J.set(A.data,0),J.set(O.subarray(0,T),A.data.byteLength),A.data=J,A.state=0}}h<w?(N=O[h]&31,V=h,Y=N,b=0):b=-1}else b=0}if(V>=0&&b>=0){var ne={data:O.subarray(V,w),type:Y,state:b};_.push(ne)}if(_.length===0){var oe=this.getLastNalUnit();if(oe){var fe=new Uint8Array(oe.data.byteLength+O.byteLength);fe.set(oe.data,0),fe.set(O,oe.data.byteLength),oe.data=fe}}return E.naluState=b,_},x.parseAACPES=function(O){var w=0,E=this._audioTrack,b=this.aacOverFlow,l=O.data;if(b){this.aacOverFlow=null;var _=b.sample.unit.byteLength,h=Math.min(b.missing,_),g=_-h;b.sample.unit.set(l.subarray(0,h),g),E.samples.push(b.sample),w=b.missing}var T,N;for(T=w,N=l.length;T<N-1&&!X.isHeader(l,T);T++);if(T!==w){var V,Y;if(T<N-1?(V="AAC PES did not start with ADTS header,offset:"+T,Y=!1):(V="no ADTS header found in AAC PES",Y=!0),y.logger.warn("parsing error:"+V),this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:Y,reason:V}),Y)return}X.initTrackConfig(E,this.observer,l,T,this.audioCodec);var U;if(O.pts!==void 0)U=O.pts;else if(b){var A=X.getFrameDuration(E.samplerate);U=b.sample.pts+A}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var J=0;T<N;)if(X.isHeader(l,T)){if(T+5<N){var ne=X.appendFrame(E,l,T,U,J);if(ne)if(ne.missing)this.aacOverFlow=ne;else{T+=ne.length,J++;continue}}break}else T++},x.parseMPEGPES=function(O){var w=O.data,E=w.length,b=0,l=0,_=O.pts;if(_===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;l<E;)if(D.isHeader(w,l)){var h=D.appendFrame(this._audioTrack,w,l,_,b);if(h)l+=h.length,b++;else break}else l++},x.parseID3PES=function(O){if(O.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},S}();c.minProbeByteLength=188;function u(S,x,R,O){return{key:S,frame:!1,pts:x,dts:R,units:[],debug:O,length:0}}function f(S,x){return(S[x+10]&31)<<8|S[x+11]}function s(S,x,R,O){var w={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(S[x+1]&15)<<8|S[x+2],b=x+3+E-4,l=(S[x+10]&15)<<8|S[x+11];for(x+=12+l;x<b;){var _=(S[x+1]&31)<<8|S[x+2];switch(S[x]){case 207:if(!O){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:w.audio===-1&&(w.audio=_);break;case 21:w.id3===-1&&(w.id3=_);break;case 219:if(!O){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:w.avc===-1&&(w.avc=_);break;case 3:case 4:R?w.audio===-1&&(w.audio=_,w.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((S[x+3]&15)<<8|S[x+4])+5}return w}function r(S){var x=0,R,O,w,E,b,l=S.data;if(!S||S.size===0)return null;for(;l[0].length<19&&l.length>1;){var _=new Uint8Array(l[0].length+l[1].length);_.set(l[0]),_.set(l[1],l[0].length),l[0]=_,l.splice(1,1)}R=l[0];var h=(R[0]<<16)+(R[1]<<8)+R[2];if(h===1){if(O=(R[4]<<8)+R[5],O&&O>S.size-6)return null;var g=R[7];g&192&&(E=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,g&64?(b=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,E-b>60*9e4&&(y.logger.warn(Math.round((E-b)/9e4)+"s delta between PTS and DTS, align them"),E=b)):b=E),w=R[8];var T=w+9;if(S.size<=T)return null;S.size-=T;for(var N=new Uint8Array(S.size),V=0,Y=l.length;V<Y;V++){R=l[V];var U=R.byteLength;if(T)if(T>U){T-=U;continue}else R=R.subarray(T),U-=T,T=0;N.set(R,x),x+=U}return O&&(O-=w+3),{data:N,pts:E,dts:b,len:O}}return null}function a(S,x){if(S.units.length&&S.frame){if(S.pts===void 0){var R=x.samples,O=R.length;if(O){var w=R[O-1];S.pts=w.pts,S.dts=w.dts}else{x.dropped++;return}}x.samples.push(S)}S.debug.length&&y.logger.log(S.pts+"/"+S.dts+":"+S.debug)}function d(S,x){var R=S.length;if(R>0){if(x.pts>=S[R-1].pts)S.push(x);else for(var O=R-1;O>=0;O--)if(x.pts<S[O].pts){S.splice(O,0,x);break}}else S.push(x)}function L(S){for(var x=S.byteLength,R=[],O=1;O<x-2;)S[O]===0&&S[O+1]===0&&S[O+2]===3?(R.push(O+2),O+=2):O++;if(R.length===0)return S;var w=x-R.length,E=new Uint8Array(w),b=0;for(O=0;O<w;b++,O++)b===R[0]&&(b++,R.shift()),E[O]=S[b];return E}W.default=c},"./src/errors.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"ErrorTypes",function(){return X}),k.d(W,"ErrorDetails",function(){return D});var X;(function(B){B.NETWORK_ERROR="networkError",B.MEDIA_ERROR="mediaError",B.KEY_SYSTEM_ERROR="keySystemError",B.MUX_ERROR="muxError",B.OTHER_ERROR="otherError"})(X||(X={}));var D;(function(B){B.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",B.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",B.KEY_SYSTEM_NO_SESSION="keySystemNoSession",B.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",B.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",B.MANIFEST_LOAD_ERROR="manifestLoadError",B.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",B.MANIFEST_PARSING_ERROR="manifestParsingError",B.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",B.LEVEL_EMPTY_ERROR="levelEmptyError",B.LEVEL_LOAD_ERROR="levelLoadError",B.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",B.LEVEL_SWITCH_ERROR="levelSwitchError",B.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",B.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",B.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",B.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",B.FRAG_LOAD_ERROR="fragLoadError",B.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",B.FRAG_DECRYPT_ERROR="fragDecryptError",B.FRAG_PARSING_ERROR="fragParsingError",B.REMUX_ALLOC_ERROR="remuxAllocError",B.KEY_LOAD_ERROR="keyLoadError",B.KEY_LOAD_TIMEOUT="keyLoadTimeOut",B.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",B.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",B.BUFFER_APPEND_ERROR="bufferAppendError",B.BUFFER_APPENDING_ERROR="bufferAppendingError",B.BUFFER_STALLED_ERROR="bufferStalledError",B.BUFFER_FULL_ERROR="bufferFullError",B.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",B.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",B.INTERNAL_EXCEPTION="internalException",B.INTERNAL_ABORTED="aborted",B.UNKNOWN="unknown"})(D||(D={}))},"./src/events.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"Events",function(){return X});var X;(function(D){D.MEDIA_ATTACHING="hlsMediaAttaching",D.MEDIA_ATTACHED="hlsMediaAttached",D.MEDIA_DETACHING="hlsMediaDetaching",D.MEDIA_DETACHED="hlsMediaDetached",D.BUFFER_RESET="hlsBufferReset",D.BUFFER_CODECS="hlsBufferCodecs",D.BUFFER_CREATED="hlsBufferCreated",D.BUFFER_APPENDING="hlsBufferAppending",D.BUFFER_APPENDED="hlsBufferAppended",D.BUFFER_EOS="hlsBufferEos",D.BUFFER_FLUSHING="hlsBufferFlushing",D.BUFFER_FLUSHED="hlsBufferFlushed",D.MANIFEST_LOADING="hlsManifestLoading",D.MANIFEST_LOADED="hlsManifestLoaded",D.MANIFEST_PARSED="hlsManifestParsed",D.LEVEL_SWITCHING="hlsLevelSwitching",D.LEVEL_SWITCHED="hlsLevelSwitched",D.LEVEL_LOADING="hlsLevelLoading",D.LEVEL_LOADED="hlsLevelLoaded",D.LEVEL_UPDATED="hlsLevelUpdated",D.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",D.LEVELS_UPDATED="hlsLevelsUpdated",D.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",D.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",D.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",D.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",D.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",D.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",D.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",D.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",D.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",D.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",D.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",D.CUES_PARSED="hlsCuesParsed",D.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",D.INIT_PTS_FOUND="hlsInitPtsFound",D.FRAG_LOADING="hlsFragLoading",D.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",D.FRAG_LOADED="hlsFragLoaded",D.FRAG_DECRYPTED="hlsFragDecrypted",D.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",D.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",D.FRAG_PARSING_METADATA="hlsFragParsingMetadata",D.FRAG_PARSED="hlsFragParsed",D.FRAG_BUFFERED="hlsFragBuffered",D.FRAG_CHANGED="hlsFragChanged",D.FPS_DROP="hlsFpsDrop",D.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",D.ERROR="hlsError",D.DESTROYING="hlsDestroying",D.KEY_LOADING="hlsKeyLoading",D.KEY_LOADED="hlsKeyLoaded",D.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",D.BACK_BUFFER_REACHED="hlsBackBufferReached"})(X||(X={}))},"./src/hls.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return S});var X=k("./node_modules/url-toolkit/src/url-toolkit.js"),D=k.n(X),B=k("./src/loader/playlist-loader.ts"),G=k("./src/loader/key-loader.ts"),j=k("./src/controller/id3-track-controller.ts"),P=k("./src/controller/latency-controller.ts"),I=k("./src/controller/level-controller.ts"),y=k("./src/controller/fragment-tracker.ts"),m=k("./src/controller/stream-controller.ts"),p=k("./src/is-supported.ts"),c=k("./src/utils/logger.ts"),u=k("./src/config.ts"),f=k("./node_modules/eventemitter3/index.js"),s=k.n(f),r=k("./src/events.ts"),a=k("./src/errors.ts");function d(x,R){for(var O=0;O<R.length;O++){var w=R[O];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(x,w.key,w)}}function L(x,R,O){return R&&d(x.prototype,R),O&&d(x,O),x}var S=function(){x.isSupported=function(){return Object(p.isSupported)()};function x(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new f.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var w=this.config=Object(u.mergeConfig)(x.DefaultConfig,O);this.userConfig=O,Object(c.enableLogs)(w.debug),this._autoLevelCapping=-1,w.progressive&&Object(u.enableStreamingMode)(w);var E=w.abrController,b=w.bufferController,l=w.capLevelController,_=w.fpsController,h=this.abrController=new E(this),g=this.bufferController=new b(this),T=this.capLevelController=new l(this),N=new _(this),V=new B.default(this),Y=new G.default(this),U=new j.default(this),A=this.levelController=new I.default(this),J=new y.FragmentTracker(this),ne=this.streamController=new m.default(this,J);T.setStreamController(ne),N.setStreamController(ne);var oe=[A,ne];this.networkControllers=oe;var fe=[V,Y,h,g,T,N,U,J];this.audioTrackController=this.createController(w.audioTrackController,null,oe),this.createController(w.audioStreamController,J,oe),this.subtitleTrackController=this.createController(w.subtitleTrackController,null,oe),this.createController(w.subtitleStreamController,J,oe),this.createController(w.timelineController,null,fe),this.emeController=this.createController(w.emeController,null,fe),this.cmcdController=this.createController(w.cmcdController,null,fe),this.latencyController=this.createController(P.default,null,fe),this.coreComponents=fe}var R=x.prototype;return R.createController=function(w,E,b){if(w){var l=E?new w(this,E):new w(this);return b&&b.push(l),l}return null},R.on=function(w,E,b){b===void 0&&(b=this),this._emitter.on(w,E,b)},R.once=function(w,E,b){b===void 0&&(b=this),this._emitter.once(w,E,b)},R.removeAllListeners=function(w){this._emitter.removeAllListeners(w)},R.off=function(w,E,b,l){b===void 0&&(b=this),this._emitter.off(w,E,b,l)},R.listeners=function(w){return this._emitter.listeners(w)},R.emit=function(w,E,b){return this._emitter.emit(w,E,b)},R.trigger=function(w,E){if(this.config.debug)return this.emit(w,w,E);try{return this.emit(w,w,E)}catch(b){c.logger.error("An internal error happened while handling event "+w+'. Error message: "'+b.message+'". Here is a stacktrace:',b),this.trigger(r.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:w,error:b})}return!1},R.listenerCount=function(w){return this._emitter.listenerCount(w)},R.destroy=function(){c.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(w){return w.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(w){return w.destroy()}),this.coreComponents.length=0},R.attachMedia=function(w){c.logger.log("attachMedia"),this._media=w,this.trigger(r.Events.MEDIA_ATTACHING,{media:w})},R.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(w){this.stopLoad();var E=this.media,b=this.url,l=this.url=X.buildAbsoluteURL(self.location.href,w,{alwaysNormalize:!0});c.logger.log("loadSource:"+l),E&&b&&b!==l&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(r.Events.MANIFEST_LOADING,{url:w})},R.startLoad=function(w){w===void 0&&(w=-1),c.logger.log("startLoad("+w+")"),this.networkControllers.forEach(function(E){E.startLoad(w)})},R.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(w){w.stopLoad()})},R.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){c.logger.log("recoverMediaError");var w=this._media;this.detachMedia(),w&&this.attachMedia(w)},R.removeLevel=function(w,E){E===void 0&&(E=0),this.levelController.removeLevel(w,E)},L(x,[{key:"levels",get:function(){var w=this.levelController.levels;return w||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(w){c.logger.log("set currentLevel:"+w),this.loadLevel=w,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(w){c.logger.log("set nextLevel:"+w),this.levelController.manualLevel=w,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(w){c.logger.log("set loadLevel:"+w),this.levelController.manualLevel=w}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(w){this.levelController.nextLoadLevel=w}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(w){c.logger.log("set firstLevel:"+w),this.levelController.firstLevel=w}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(w){c.logger.log("set startLevel:"+w),w!==-1&&(w=Math.max(w,this.minAutoLevel)),this.levelController.startLevel=w}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(w){var E=!!w;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(w){this._autoLevelCapping!==w&&(c.logger.log("set autoLevelCapping:"+w),this._autoLevelCapping=w)}},{key:"bandwidthEstimate",get:function(){var w=this.abrController.bwEstimator;return w?w.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var w=this.levels,E=this.config.minAutoBitrate;if(!w)return 0;for(var b=w.length,l=0;l<b;l++)if(w[l].maxBitrate>E)return l;return 0}},{key:"maxAutoLevel",get:function(){var w=this.levels,E=this.autoLevelCapping,b;return E===-1&&w&&w.length?b=w.length-1:b=E,b}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(w){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,w)}},{key:"audioTracks",get:function(){var w=this.audioTrackController;return w?w.audioTracks:[]}},{key:"audioTrack",get:function(){var w=this.audioTrackController;return w?w.audioTrack:-1},set:function(w){var E=this.audioTrackController;E&&(E.audioTrack=w)}},{key:"subtitleTracks",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var w=this.subtitleTrackController;return w?w.subtitleTrack:-1},set:function(w){var E=this.subtitleTrackController;E&&(E.subtitleTrack=w)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var w=this.subtitleTrackController;return w?w.subtitleDisplay:!1},set:function(w){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=w)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(w){this.config.lowLatencyMode=w}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return r.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:u.hlsDefaultConfig},set:function(w){x.defaultConfig=w}}]),x}();S.defaultConfig=void 0},"./src/is-supported.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"isSupported",function(){return B}),k.d(W,"changeTypeSupported",function(){return G});var X=k("./src/utils/mediasource-helper.ts");function D(){return self.SourceBuffer||self.WebKitSourceBuffer}function B(){var j=Object(X.getMediaSource)();if(!j)return!1;var P=D(),I=j&&typeof j.isTypeSupported=="function"&&j.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!P||P.prototype&&typeof P.prototype.appendBuffer=="function"&&typeof P.prototype.remove=="function";return!!I&&!!y}function G(){var j,P=D();return typeof(P==null||((j=P.prototype)===null||j===void 0)?void 0:j.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return c}),k.d(W,"LoadError",function(){return f});var X=k("./src/polyfills/number.ts"),D=k("./src/errors.ts");function B(s,r){s.prototype=Object.create(r.prototype),s.prototype.constructor=s,y(s,r)}function G(s){var r=typeof Map=="function"?new Map:void 0;return G=function(d){if(d===null||!I(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(d))return r.get(d);r.set(d,L)}function L(){return j(d,arguments,m(this).constructor)}return L.prototype=Object.create(d.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),y(L,d)},G(s)}function j(s,r,a){return P()?j=Reflect.construct:j=function(L,S,x){var R=[null];R.push.apply(R,S);var O=Function.bind.apply(L,R),w=new O;return x&&y(w,x.prototype),w},j.apply(null,arguments)}function P(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function I(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function y(s,r){return y=Object.setPrototypeOf||function(d,L){return d.__proto__=L,d},y(s,r)}function m(s){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},m(s)}var p=Math.pow(2,17),c=function(){function s(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var r=s.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(d,L){var S=this,x=d.url;if(!x)return Promise.reject(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var R=this.config,O=R.fLoader,w=R.loader;return new Promise(function(E,b){S.loader&&S.loader.destroy();var l=S.loader=d.loader=O?new O(R):new w(R),_=u(d),h={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:p};d.stats=l.stats,l.load(_,h,{onSuccess:function(T,N,V,Y){S.resetLoader(d,l),E({frag:d,part:null,payload:T.data,networkDetails:Y})},onError:function(T,N,V){S.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:T,networkDetails:V}))},onAbort:function(T,N,V){S.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:V}))},onTimeout:function(T,N,V){S.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:V}))},onProgress:function(T,N,V,Y){L&&L({frag:d,part:null,payload:V,networkDetails:Y})}})})},r.loadPart=function(d,L,S){var x=this;this.abort();var R=this.config,O=R.fLoader,w=R.loader;return new Promise(function(E,b){x.loader&&x.loader.destroy();var l=x.loader=d.loader=O?new O(R):new w(R),_=u(d,L),h={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:p};L.stats=l.stats,l.load(_,h,{onSuccess:function(T,N,V,Y){x.resetLoader(d,l),x.updateStatsFromPart(d,L);var U={frag:d,part:L,payload:T.data,networkDetails:Y};S(U),E(U)},onError:function(T,N,V){x.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:L,response:T,networkDetails:V}))},onAbort:function(T,N,V){d.stats.aborted=L.stats.aborted,x.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:L,networkDetails:V}))},onTimeout:function(T,N,V){x.resetLoader(d,l),b(new f({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:L,networkDetails:V}))}})})},r.updateStatsFromPart=function(d,L){var S=d.stats,x=L.stats,R=x.total;if(S.loaded+=x.loaded,R){var O=Math.round(d.duration/L.duration),w=Math.min(Math.round(S.loaded/R),O),E=O-w,b=E*Math.round(S.loaded/w);S.total=S.loaded+b}else S.total=Math.max(S.loaded,S.total);var l=S.loading,_=x.loading;l.start?l.first+=_.first-_.start:(l.start=_.start,l.first=_.first),l.end=_.end},r.resetLoader=function(d,L){d.loader=null,this.loader===L&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),L.destroy()},s}();function u(s,r){r===void 0&&(r=null);var a=r||s,d={frag:s,part:r,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},L=a.byteRangeStartOffset,S=a.byteRangeEndOffset;return Object(X.isFiniteNumber)(L)&&Object(X.isFiniteNumber)(S)&&(d.rangeStart=L,d.rangeEnd=S),d}var f=function(s){B(r,s);function r(a){for(var d,L=arguments.length,S=new Array(L>1?L-1:0),x=1;x<L;x++)S[x-1]=arguments[x];return d=s.call.apply(s,[this].concat(S))||this,d.data=void 0,d.data=a,d}return r}(G(Error))},"./src/loader/fragment.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"ElementaryStreamTypes",function(){return c}),k.d(W,"BaseSegment",function(){return u}),k.d(W,"Fragment",function(){return f}),k.d(W,"Part",function(){return s});var X=k("./src/polyfills/number.ts"),D=k("./node_modules/url-toolkit/src/url-toolkit.js"),B=k.n(D),G=k("./src/utils/logger.ts"),j=k("./src/loader/level-key.ts"),P=k("./src/loader/load-stats.ts");function I(r,a){r.prototype=Object.create(a.prototype),r.prototype.constructor=r,y(r,a)}function y(r,a){return y=Object.setPrototypeOf||function(L,S){return L.__proto__=S,L},y(r,a)}function m(r,a){for(var d=0;d<a.length;d++){var L=a[d];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(r,L.key,L)}}function p(r,a,d){return a&&m(r.prototype,a),d&&m(r,d),r}var c;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(c||(c={}));var u=function(){function r(d){var L;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(L={},L[c.AUDIO]=null,L[c.VIDEO]=null,L[c.AUDIOVIDEO]=null,L),this.baseurl=d}var a=r.prototype;return a.setByteRange=function(L,S){var x=L.split("@",2),R=[];x.length===1?R[0]=S?S.byteRangeEndOffset:0:R[0]=parseInt(x[1]),R[1]=parseInt(x[0])+R[0],this._byteRange=R},p(r,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(D.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(L){this._url=L}}]),r}(),f=function(r){I(a,r);function a(L,S){var x;return x=r.call(this,S)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new P.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=L,x}var d=a.prototype;return d.createInitializationVector=function(S){for(var x=new Uint8Array(16),R=12;R<16;R++)x[R]=S>>8*(15-R)&255;return x},d.setDecryptDataFromLevelKey=function(S,x){var R=S;return(S==null?void 0:S.method)==="AES-128"&&S.uri&&!S.iv&&(R=j.LevelKey.fromURI(S.uri),R.method=S.method,R.iv=this.createInitializationVector(x),R.keyFormat="identity"),R},d.setElementaryStreamInfo=function(S,x,R,O,w,E){E===void 0&&(E=!1);var b=this.elementaryStreams,l=b[S];if(!l){b[S]={startPTS:x,endPTS:R,startDTS:O,endDTS:w,partial:E};return}l.startPTS=Math.min(l.startPTS,x),l.endPTS=Math.max(l.endPTS,R),l.startDTS=Math.min(l.startDTS,O),l.endDTS=Math.max(l.endDTS,w)},d.clearElementaryStreamInfo=function(){var S=this.elementaryStreams;S[c.AUDIO]=null,S[c.VIDEO]=null,S[c.AUDIOVIDEO]=null},p(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var S=this.sn;typeof S!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&G.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),S=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,S)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var S=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+S*1e3}},{key:"encrypted",get:function(){var S;return!!((S=this.decryptdata)!==null&&S!==void 0&&S.keyFormat&&this.decryptdata.uri)}}]),a}(u),s=function(r){I(a,r);function a(d,L,S,x,R){var O;O=r.call(this,S)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new P.LoadStats,O.duration=d.decimalFloatingPoint("DURATION"),O.gap=d.bool("GAP"),O.independent=d.bool("INDEPENDENT"),O.relurl=d.enumeratedString("URI"),O.fragment=L,O.index=x;var w=d.enumeratedString("BYTERANGE");return w&&O.setByteRange(w,R),R&&(O.fragOffset=R.fragOffset+R.duration),O}return p(a,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var L=this.elementaryStreams;return!!(L.audio||L.video||L.audiovideo)}}]),a}(u)},"./src/loader/key-loader.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return G});var X=k("./src/events.ts"),D=k("./src/errors.ts"),B=k("./src/utils/logger.ts"),G=function(){function j(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var P=j.prototype;return P._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},P._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},P.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var m=this.loaders[y];m&&m.destroy()}this.loaders={}},P.onKeyLoading=function(y,m){var p=m.frag,c=p.type,u=this.loaders[c];if(!p.decryptdata){B.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=p.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(u&&(B.logger.warn("abort previous key loader for type:"+c),u.abort()),!f){B.logger.warn("key uri is falsy");return}var r=s.loader,a=p.loader=this.loaders[c]=new r(s);this.decrypturl=f,this.decryptkey=null;var d={url:f,frag:p,responseType:"arraybuffer"},L={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},S={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(d,L,S)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:p}))},P.loadsuccess=function(y,m,p){var c=p.frag;if(!c.decryptdata){B.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(y.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:c})},P.loaderror=function(y,m){var p=m.frag,c=p.loader;c&&c.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:y})},P.loadtimeout=function(y,m){var p=m.frag,c=p.loader;c&&c.abort(),delete this.loaders[p.type],this.hls.trigger(X.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},j}()},"./src/loader/level-details.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"LevelDetails",function(){return j});var X=k("./src/polyfills/number.ts");function D(P,I){for(var y=0;y<I.length;y++){var m=I[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}function B(P,I,y){return I&&D(P.prototype,I),y&&D(P,y),P}var G=10,j=function(){function P(y){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=y}var I=P.prototype;return I.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-m.lastPartSn,c=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!c||!!p,this.advanced=this.endSN>m.endSN||p>0||p===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},B(P,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var p=this.driftEnd-this.driftStart;return p*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),P}()},"./src/loader/level-key.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"LevelKey",function(){return j});var X=k("./node_modules/url-toolkit/src/url-toolkit.js"),D=k.n(X);function B(P,I){for(var y=0;y<I.length;y++){var m=I[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(P,m.key,m)}}function G(P,I,y){return I&&B(P.prototype,I),y&&B(P,y),P}var j=function(){P.fromURL=function(y,m){return new P(y,m)},P.fromURI=function(y){return new P(y)};function P(I,y){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,y?this._uri=Object(X.buildAbsoluteURL)(I,y,{alwaysNormalize:!0}):this._uri=I}return G(P,[{key:"uri",get:function(){return this._uri}}]),P}()},"./src/loader/load-stats.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"LoadStats",function(){return X});var X=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return a});var X=k("./src/polyfills/number.ts"),D=k("./node_modules/url-toolkit/src/url-toolkit.js"),B=k.n(D),G=k("./src/loader/fragment.ts"),j=k("./src/loader/level-details.ts"),P=k("./src/loader/level-key.ts"),I=k("./src/utils/attr-list.ts"),y=k("./src/utils/logger.ts"),m=k("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,c=/#EXT-X-MEDIA:(.*)/g,u=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),f=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function r(R){var O,w;return s.test((O=(w=D.parseURL(R))===null||w===void 0?void 0:w.path)!=null?O:"")}var a=function(){function R(){}return R.findGroup=function(w,E){for(var b=0;b<w.length;b++){var l=w[b];if(l.id===E)return l}},R.convertAVC1ToAVCOTI=function(w){var E=w.split(".");if(E.length>2){var b=E.shift()+".";return b+=parseInt(E.shift()).toString(16),b+=("000"+parseInt(E.shift()).toString(16)).substr(-4),b}return w},R.resolve=function(w,E){return D.buildAbsoluteURL(E,w,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(w,E){var b=[],l={},_=!1;p.lastIndex=0;for(var h;(h=p.exec(w))!=null;)if(h[1]){var g=new I.AttrList(h[1]),T={attrs:g,bitrate:g.decimalInteger("AVERAGE-BANDWIDTH")||g.decimalInteger("BANDWIDTH"),name:g.NAME,url:R.resolve(h[2],E)},N=g.decimalResolution("RESOLUTION");N&&(T.width=N.width,T.height=N.height),d((g.CODECS||"").split(/[ ,]+/).filter(function(Y){return Y}),T),T.videoCodec&&T.videoCodec.indexOf("avc1")!==-1&&(T.videoCodec=R.convertAVC1ToAVCOTI(T.videoCodec)),b.push(T)}else if(h[3]){var V=new I.AttrList(h[3]);V["DATA-ID"]&&(_=!0,l[V["DATA-ID"]]=V)}return{levels:b,sessionData:_?l:null}},R.parseMasterPlaylistMedia=function(w,E,b,l){l===void 0&&(l=[]);var _,h=[],g=0;for(c.lastIndex=0;(_=c.exec(w))!==null;){var T=new I.AttrList(_[1]);if(T.TYPE===b){var N={attrs:T,bitrate:0,id:g++,groupId:T["GROUP-ID"],instreamId:T["INSTREAM-ID"],name:T.NAME||T.LANGUAGE||"",type:b,default:T.bool("DEFAULT"),autoselect:T.bool("AUTOSELECT"),forced:T.bool("FORCED"),lang:T.LANGUAGE,url:T.URI?R.resolve(T.URI,E):""};if(l.length){var V=R.findGroup(l,N.groupId)||l[0];L(N,V,"audioCodec"),L(N,V,"textCodec")}h.push(N)}}return h},R.parseLevelPlaylist=function(w,E,b,l,_){var h=new j.LevelDetails(E),g=h.fragments,T=null,N=0,V=0,Y=0,U=0,A=null,J=new G.Fragment(l,E),ne,oe,fe,ke=-1,Oe=!1;for(u.lastIndex=0,h.m3u8=w;(ne=u.exec(w))!==null;){Oe&&(Oe=!1,J=new G.Fragment(l,E),J.start=Y,J.sn=N,J.cc=U,J.level=b,T&&(J.initSegment=T,J.rawProgramDateTime=T.rawProgramDateTime));var Me=ne[1];if(Me){J.duration=parseFloat(Me);var Be=(" "+ne[2]).slice(1);J.title=Be||null,J.tagList.push(Be?["INF",Me,Be]:["INF",Me])}else if(ne[3])Object(X.isFiniteNumber)(J.duration)&&(J.start=Y,fe&&(J.levelkey=fe),J.sn=N,J.level=b,J.cc=U,J.urlId=_,g.push(J),J.relurl=(" "+ne[3]).slice(1),x(J,A),A=J,Y+=J.duration,N++,V=0,Oe=!0);else if(ne[4]){var Pe=(" "+ne[4]).slice(1);A?J.setByteRange(Pe,A):J.setByteRange(Pe)}else if(ne[5])J.rawProgramDateTime=(" "+ne[5]).slice(1),J.tagList.push(["PROGRAM-DATE-TIME",J.rawProgramDateTime]),ke===-1&&(ke=g.length);else{if(ne=ne[0].match(f),!ne){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<ne.length&&!(typeof ne[oe]!="undefined");oe++);var be=(" "+ne[oe]).slice(1),le=(" "+ne[oe+1]).slice(1),Le=ne[oe+2]?(" "+ne[oe+2]).slice(1):"";switch(be){case"PLAYLIST-TYPE":h.type=le.toUpperCase();break;case"MEDIA-SEQUENCE":N=h.startSN=parseInt(le);break;case"SKIP":{var tt=new I.AttrList(le),nt=tt.decimalInteger("SKIPPED-SEGMENTS");if(Object(X.isFiniteNumber)(nt)){h.skippedSegments=nt;for(var lt=nt;lt--;)g.unshift(null);N+=nt}var Et=tt.enumeratedString("RECENTLY-REMOVED-DATERANGES");Et&&(h.recentlyRemovedDateranges=Et.split(" "));break}case"TARGETDURATION":h.targetduration=parseFloat(le);break;case"VERSION":h.version=parseInt(le);break;case"EXTM3U":break;case"ENDLIST":h.live=!1;break;case"#":(le||Le)&&J.tagList.push(Le?[le,Le]:[le]);break;case"DIS":U++;case"GAP":J.tagList.push([be]);break;case"BITRATE":J.tagList.push([be,le]);break;case"DISCONTINUITY-SEQ":U=parseInt(le);break;case"KEY":{var Ve,Qe=new I.AttrList(le),ut=Qe.enumeratedString("METHOD"),gt=Qe.URI,ot=Qe.hexadecimalInteger("IV"),it=Qe.enumeratedString("KEYFORMATVERSIONS"),rt=Qe.enumeratedString("KEYID"),Pt=(Ve=Qe.enumeratedString("KEYFORMAT"))!=null?Ve:"identity",It=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(It.indexOf(Pt)>-1){y.logger.warn("Keyformat "+Pt+" is not supported from the manifest");continue}else if(Pt!=="identity")continue;ut&&(fe=P.LevelKey.fromURL(E,gt),gt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ut)>=0&&(fe.method=ut,fe.keyFormat=Pt,rt&&(fe.keyID=rt),it&&(fe.keyFormatVersions=it),fe.iv=ot));break}case"START":{var wt=new I.AttrList(le),Tt=wt.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Tt)&&(h.startTimeOffset=Tt);break}case"MAP":{var Wt=new I.AttrList(le);J.relurl=Wt.URI,Wt.BYTERANGE&&J.setByteRange(Wt.BYTERANGE),J.level=b,J.sn="initSegment",fe&&(J.levelkey=fe),J.initSegment=null,T=J,Oe=!0;break}case"SERVER-CONTROL":{var Ct=new I.AttrList(le);h.canBlockReload=Ct.bool("CAN-BLOCK-RELOAD"),h.canSkipUntil=Ct.optionalFloat("CAN-SKIP-UNTIL",0),h.canSkipDateRanges=h.canSkipUntil>0&&Ct.bool("CAN-SKIP-DATERANGES"),h.partHoldBack=Ct.optionalFloat("PART-HOLD-BACK",0),h.holdBack=Ct.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var bt=new I.AttrList(le);h.partTarget=bt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ze=h.partList;ze||(ze=h.partList=[]);var Kt=V>0?ze[ze.length-1]:void 0,St=V++,Ke=new G.Part(new I.AttrList(le),J,E,St,Kt);ze.push(Ke),J.duration+=Ke.duration;break}case"PRELOAD-HINT":{var at=new I.AttrList(le);h.preloadHint=at;break}case"RENDITION-REPORT":{var Ce=new I.AttrList(le);h.renditionReports=h.renditionReports||[],h.renditionReports.push(Ce);break}default:y.logger.warn("line parsed but not handled: "+ne);break}}}A&&!A.relurl?(g.pop(),Y-=A.duration,h.partList&&(h.fragmentHint=A)):h.partList&&(x(J,A),J.cc=U,h.fragmentHint=J);var Ee=g.length,Te=g[0],ee=g[Ee-1];if(Y+=h.skippedSegments*h.targetduration,Y>0&&Ee&&ee){h.averagetargetduration=Y/Ee;var ae=ee.sn;h.endSN=ae!=="initSegment"?ae:0,Te&&(h.startCC=Te.cc,Te.initSegment||h.fragments.every(function(de){return de.relurl&&r(de.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),J=new G.Fragment(l,E),J.relurl=ee.relurl,J.level=b,J.sn="initSegment",Te.initSegment=J,h.needSidxRanges=!0))}else h.endSN=0,h.startCC=0;return h.fragmentHint&&(Y+=h.fragmentHint.duration),h.totalduration=Y,h.endCC=U,ke>0&&S(g,ke),h},R}();function d(R,O){["video","audio","text"].forEach(function(w){var E=R.filter(function(l){return Object(m.isCodecType)(l,w)});if(E.length){var b=E.filter(function(l){return l.lastIndexOf("avc1",0)===0||l.lastIndexOf("mp4a",0)===0});O[w+"Codec"]=b.length>0?b[0]:E[0],R=R.filter(function(l){return E.indexOf(l)===-1})}}),O.unknownCodecs=R}function L(R,O,w){var E=O[w];E&&(R[w]=E)}function S(R,O){for(var w=R[O],E=O;E--;){var b=R[E];if(!b)return;b.programDateTime=w.programDateTime-b.duration*1e3,w=b}}function x(R,O){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):O!=null&&O.programDateTime&&(R.programDateTime=O.endProgramDateTime),Object(X.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/polyfills/number.ts"),D=k("./src/events.ts"),B=k("./src/errors.ts"),G=k("./src/utils/logger.ts"),j=k("./src/utils/mp4-tools.ts"),P=k("./src/loader/m3u8-parser.ts"),I=k("./src/types/loader.ts"),y=k("./src/utils/attr-list.ts");function m(u){var f=u.type;switch(f){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function p(u,f){var s=u.url;return(s===void 0||s.indexOf("data:")===0)&&(s=f.url),s}var c=function(){function u(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var f=u.prototype;return f.registerListeners=function(){var r=this.hls;r.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var r=this.hls;r.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(r){var a=this.hls.config,d=a.pLoader,L=a.loader,S=d||L,x=new S(a);return r.loader=x,this.loaders[r.type]=x,x},f.getInternalLoader=function(r){return this.loaders[r.type]},f.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},f.destroyInternalLoaders=function(){for(var r in this.loaders){var a=this.loaders[r];a&&a.destroy(),this.resetInternalLoader(r)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(r,a){var d=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},f.onLevelLoading=function(r,a){var d=a.id,L=a.level,S=a.url,x=a.deliveryDirectives;this.load({id:d,groupId:null,level:L,responseType:"text",type:I.PlaylistContextType.LEVEL,url:S,deliveryDirectives:x})},f.onAudioTrackLoading=function(r,a){var d=a.id,L=a.groupId,S=a.url,x=a.deliveryDirectives;this.load({id:d,groupId:L,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:S,deliveryDirectives:x})},f.onSubtitleTrackLoading=function(r,a){var d=a.id,L=a.groupId,S=a.url,x=a.deliveryDirectives;this.load({id:d,groupId:L,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:S,deliveryDirectives:x})},f.load=function(r){var a,d=this.hls.config,L=this.getInternalLoader(r);if(L){var S=L.context;if(S&&S.url===r.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),L.abort()}var x,R,O,w;switch(r.type){case I.PlaylistContextType.MANIFEST:x=d.manifestLoadingMaxRetry,R=d.manifestLoadingTimeOut,O=d.manifestLoadingRetryDelay,w=d.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:x=0,R=d.levelLoadingTimeOut;break;default:x=d.levelLoadingMaxRetry,R=d.levelLoadingTimeOut,O=d.levelLoadingRetryDelay,w=d.levelLoadingMaxRetryTimeout;break}if(L=this.createInternalLoader(r),(a=r.deliveryDirectives)!==null&&a!==void 0&&a.part){var E;if(r.type===I.PlaylistContextType.LEVEL&&r.level!==null?E=this.hls.levels[r.level].details:r.type===I.PlaylistContextType.AUDIO_TRACK&&r.id!==null?E=this.hls.audioTracks[r.id].details:r.type===I.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(E=this.hls.subtitleTracks[r.id].details),E){var b=E.partTarget,l=E.targetduration;b&&l&&(R=Math.min(Math.max(b*3,l*.8)*1e3,R))}}var _={timeout:R,maxRetry:x,retryDelay:O,maxRetryDelay:w,highWaterMark:0},h={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};L.load(r,_,h)},f.loadsuccess=function(r,a,d,L){if(L===void 0&&(L=null),d.isSidxRequest){this.handleSidxRequest(r,d),this.handlePlaylistLoaded(r,a,d,L);return}this.resetInternalLoader(d.type);var S=r.data;if(S.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,d,"no EXTM3U delimiter",L);return}a.parsing.start=performance.now(),S.indexOf("#EXTINF:")>0||S.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,a,d,L):this.handleMasterPlaylist(r,a,d,L)},f.loaderror=function(r,a,d){d===void 0&&(d=null),this.handleNetworkError(a,d,!1,r)},f.loadtimeout=function(r,a,d){d===void 0&&(d=null),this.handleNetworkError(a,d,!0)},f.handleMasterPlaylist=function(r,a,d,L){var S=this.hls,x=r.data,R=p(r,d),O=P.default.parseMasterPlaylist(x,R),w=O.levels,E=O.sessionData;if(!w.length){this.handleManifestParsingError(r,d,"no level found in manifest",L);return}var b=w.map(function(N){return{id:N.attrs.AUDIO,audioCodec:N.audioCodec}}),l=w.map(function(N){return{id:N.attrs.SUBTITLES,textCodec:N.textCodec}}),_=P.default.parseMasterPlaylistMedia(x,R,"AUDIO",b),h=P.default.parseMasterPlaylistMedia(x,R,"SUBTITLES",l),g=P.default.parseMasterPlaylistMedia(x,R,"CLOSED-CAPTIONS");if(_.length){var T=_.some(function(N){return!N.url});!T&&w[0].audioCodec&&!w[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),_.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}S.trigger(D.Events.MANIFEST_LOADED,{levels:w,audioTracks:_,subtitles:h,captions:g,url:R,stats:a,networkDetails:L,sessionData:E})},f.handleTrackOrLevelPlaylist=function(r,a,d,L){var S=this.hls,x=d.id,R=d.level,O=d.type,w=p(r,d),E=Object(X.isFiniteNumber)(x)?x:0,b=Object(X.isFiniteNumber)(R)?R:E,l=m(d),_=P.default.parseLevelPlaylist(r.data,w,b,l,E);if(!_.fragments.length){S.trigger(D.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:w,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(O===I.PlaylistContextType.MANIFEST){var h={attrs:new y.AttrList({}),bitrate:0,details:_,name:"",url:w};S.trigger(D.Events.MANIFEST_LOADED,{levels:[h],audioTracks:[],url:w,stats:a,networkDetails:L,sessionData:null})}if(a.parsing.end=performance.now(),_.needSidxRanges){var g,T=(g=_.fragments[0].initSegment)===null||g===void 0?void 0:g.url;this.load({url:T,isSidxRequest:!0,type:O,level:R,levelDetails:_,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=_,this.handlePlaylistLoaded(r,a,d,L)},f.handleSidxRequest=function(r,a){var d=Object(j.parseSegmentIndex)(new Uint8Array(r.data));if(!d)return;var L=d.references,S=a.levelDetails;L.forEach(function(x,R){var O=x.info,w=S.fragments[R];w.byteRange.length===0&&w.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),w.initSegment&&w.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(r,a,d,L){this.hls.trigger(D.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===I.PlaylistContextType.MANIFEST,url:r.url,reason:d,response:r,context:a,networkDetails:L})},f.handleNetworkError=function(r,a,d,L){d===void 0&&(d=!1),G.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var S=B.ErrorDetails.UNKNOWN,x=!1,R=this.getInternalLoader(r);switch(r.type){case I.PlaylistContextType.MANIFEST:S=d?B.ErrorDetails.MANIFEST_LOAD_TIMEOUT:B.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case I.PlaylistContextType.LEVEL:S=d?B.ErrorDetails.LEVEL_LOAD_TIMEOUT:B.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.AUDIO_TRACK:S=d?B.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:S=d?B.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:B.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}R&&this.resetInternalLoader(r.type);var O={type:B.ErrorTypes.NETWORK_ERROR,details:S,fatal:x,url:r.url,loader:R,context:r,networkDetails:a};L&&(O.response=L),this.hls.trigger(D.Events.ERROR,O)},f.handlePlaylistLoaded=function(r,a,d,L){var S=d.type,x=d.level,R=d.id,O=d.groupId,w=d.loader,E=d.levelDetails,b=d.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(r,d,"invalid target duration",L);return}if(!w)return;E.live&&(w.getCacheAge&&(E.ageHeader=w.getCacheAge()||0),(!w.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(S){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(D.Events.LEVEL_LOADED,{details:E,level:x||0,id:R||0,stats:a,networkDetails:L,deliveryDirectives:b});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(D.Events.AUDIO_TRACK_LOADED,{details:E,id:R||0,groupId:O||"",stats:a,networkDetails:L,deliveryDirectives:b});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(D.Events.SUBTITLE_TRACK_LOADED,{details:E,id:R||0,groupId:O||"",stats:a,networkDetails:L,deliveryDirectives:b});break}},u}();W.default=c},"./src/polyfills/number.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"isFiniteNumber",function(){return X}),k.d(W,"MAX_SAFE_INTEGER",function(){return D});var X=Number.isFinite||function(B){return typeof B=="number"&&isFinite(B)},D=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(se,W,k){"use strict";k.r(W);var X=function(){function D(){}return D.getSilentFrame=function(G,j){switch(G){case"mp4a.40.2":if(j===1)return new Uint8Array([0,200,0,128,35,128]);if(j===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(j===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(j===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(j===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(j===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(j===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(j===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(j===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},D}();W.default=X},"./src/remux/mp4-generator.ts":function(se,W,k){"use strict";k.r(W);var X=Math.pow(2,32)-1,D=function(){function B(){}return B.init=function(){B.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var j;for(j in B.types)B.types.hasOwnProperty(j)&&(B.types[j]=[j.charCodeAt(0),j.charCodeAt(1),j.charCodeAt(2),j.charCodeAt(3)]);var P=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),I=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);B.HDLR_TYPES={video:P,audio:I};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);B.STTS=B.STSC=B.STCO=m,B.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),B.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),B.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),u=new Uint8Array([0,0,0,1]);B.FTYP=B.box(B.types.ftyp,p,u,p,c),B.DINF=B.box(B.types.dinf,B.box(B.types.dref,y))},B.box=function(j){for(var P=8,I=arguments.length,y=new Array(I>1?I-1:0),m=1;m<I;m++)y[m-1]=arguments[m];for(var p=y.length,c=p;p--;)P+=y[p].byteLength;var u=new Uint8Array(P);for(u[0]=P>>24&255,u[1]=P>>16&255,u[2]=P>>8&255,u[3]=P&255,u.set(j,4),p=0,P=8;p<c;p++)u.set(y[p],P),P+=y[p].byteLength;return u},B.hdlr=function(j){return B.box(B.types.hdlr,B.HDLR_TYPES[j])},B.mdat=function(j){return B.box(B.types.mdat,j)},B.mdhd=function(j,P){P*=j;var I=Math.floor(P/(X+1)),y=Math.floor(P%(X+1));return B.box(B.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,j>>24&255,j>>16&255,j>>8&255,j&255,I>>24,I>>16&255,I>>8&255,I&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},B.mdia=function(j){return B.box(B.types.mdia,B.mdhd(j.timescale,j.duration),B.hdlr(j.type),B.minf(j))},B.mfhd=function(j){return B.box(B.types.mfhd,new Uint8Array([0,0,0,0,j>>24,j>>16&255,j>>8&255,j&255]))},B.minf=function(j){return j.type==="audio"?B.box(B.types.minf,B.box(B.types.smhd,B.SMHD),B.DINF,B.stbl(j)):B.box(B.types.minf,B.box(B.types.vmhd,B.VMHD),B.DINF,B.stbl(j))},B.moof=function(j,P,I){return B.box(B.types.moof,B.mfhd(j),B.traf(I,P))},B.moov=function(j){for(var P=j.length,I=[];P--;)I[P]=B.trak(j[P]);return B.box.apply(null,[B.types.moov,B.mvhd(j[0].timescale,j[0].duration)].concat(I).concat(B.mvex(j)))},B.mvex=function(j){for(var P=j.length,I=[];P--;)I[P]=B.trex(j[P]);return B.box.apply(null,[B.types.mvex].concat(I))},B.mvhd=function(j,P){P*=j;var I=Math.floor(P/(X+1)),y=Math.floor(P%(X+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,j>>24&255,j>>16&255,j>>8&255,j&255,I>>24,I>>16&255,I>>8&255,I&255,y>>24,y>>16&255,y>>8&255,y&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return B.box(B.types.mvhd,m)},B.sdtp=function(j){var P=j.samples||[],I=new Uint8Array(4+P.length),y,m;for(y=0;y<P.length;y++)m=P[y].flags,I[y+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return B.box(B.types.sdtp,I)},B.stbl=function(j){return B.box(B.types.stbl,B.stsd(j),B.box(B.types.stts,B.STTS),B.box(B.types.stsc,B.STSC),B.box(B.types.stsz,B.STSZ),B.box(B.types.stco,B.STCO))},B.avc1=function(j){var P=[],I=[],y,m,p;for(y=0;y<j.sps.length;y++)m=j.sps[y],p=m.byteLength,P.push(p>>>8&255),P.push(p&255),P=P.concat(Array.prototype.slice.call(m));for(y=0;y<j.pps.length;y++)m=j.pps[y],p=m.byteLength,I.push(p>>>8&255),I.push(p&255),I=I.concat(Array.prototype.slice.call(m));var c=B.box(B.types.avcC,new Uint8Array([1,P[3],P[4],P[5],252|3,224|j.sps.length].concat(P).concat([j.pps.length]).concat(I))),u=j.width,f=j.height,s=j.pixelRatio[0],r=j.pixelRatio[1];return B.box(B.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,u>>8&255,u&255,f>>8&255,f&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,B.box(B.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),B.box(B.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,r>>24,r>>16&255,r>>8&255,r&255])))},B.esds=function(j){var P=j.config.length;return new Uint8Array([0,0,0,0,3,23+P,0,1,0,4,15+P,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([P]).concat(j.config).concat([6,1,2]))},B.mp4a=function(j){var P=j.samplerate;return B.box(B.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]),B.box(B.types.esds,B.esds(j)))},B.mp3=function(j){var P=j.samplerate;return B.box(B.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j.channelCount,0,16,0,0,0,0,P>>8&255,P&255,0,0]))},B.stsd=function(j){return j.type==="audio"?!j.isAAC&&j.codec==="mp3"?B.box(B.types.stsd,B.STSD,B.mp3(j)):B.box(B.types.stsd,B.STSD,B.mp4a(j)):B.box(B.types.stsd,B.STSD,B.avc1(j))},B.tkhd=function(j){var P=j.id,I=j.duration*j.timescale,y=j.width,m=j.height,p=Math.floor(I/(X+1)),c=Math.floor(I%(X+1));return B.box(B.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,P>>24&255,P>>16&255,P>>8&255,P&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,y>>8&255,y&255,0,0,m>>8&255,m&255,0,0]))},B.traf=function(j,P){var I=B.sdtp(j),y=j.id,m=Math.floor(P/(X+1)),p=Math.floor(P%(X+1));return B.box(B.types.traf,B.box(B.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),B.box(B.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,p>>24,p>>16&255,p>>8&255,p&255])),B.trun(j,I.length+16+20+8+16+8+8),I)},B.trak=function(j){return j.duration=j.duration||4294967295,B.box(B.types.trak,B.tkhd(j),B.mdia(j))},B.trex=function(j){var P=j.id;return B.box(B.types.trex,new Uint8Array([0,0,0,0,P>>24,P>>16&255,P>>8&255,P&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},B.trun=function(j,P){var I=j.samples||[],y=I.length,m=12+16*y,p=new Uint8Array(m),c,u,f,s,r,a;for(P+=8+m,p.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255],0),c=0;c<y;c++)u=I[c],f=u.duration,s=u.size,r=u.flags,a=u.cts,p.set([f>>>24&255,f>>>16&255,f>>>8&255,f&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*c);return B.box(B.types.trun,p)},B.initSegment=function(j){B.types||B.init();var P=B.moov(j),I=new Uint8Array(B.FTYP.byteLength+P.byteLength);return I.set(B.FTYP),I.set(P,B.FTYP.byteLength),I},B}();D.types=void 0,D.HDLR_TYPES=void 0,D.STTS=void 0,D.STSC=void 0,D.STCO=void 0,D.STSZ=void 0,D.VMHD=void 0,D.SMHD=void 0,D.STSD=void 0,D.FTYP=void 0,D.DINF=void 0,W.default=D},"./src/remux/mp4-remuxer.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return a}),k.d(W,"normalizePts",function(){return d});var X=k("./src/polyfills/number.ts"),D=k("./src/remux/aac-helper.ts"),B=k("./src/remux/mp4-generator.ts"),G=k("./src/events.ts"),j=k("./src/errors.ts"),P=k("./src/utils/logger.ts"),I=k("./src/types/loader.ts"),y=k("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var w=arguments[O];for(var E in w)Object.prototype.hasOwnProperty.call(w,E)&&(R[E]=w[E])}return R},m.apply(this,arguments)}var p=10*1e3,c=1024,u=1152,f=null,s=null,r=!1,a=function(){function R(w,E,b,l){if(l===void 0&&(l=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=w,this.config=E,this.typeSupported=b,this.ISGenerated=!1,f===null){var _=navigator.userAgent||"",h=_.match(/Chrome\/(\d+)/i);f=h?parseInt(h[1]):0}if(s===null){var g=navigator.userAgent.match(/Safari\/(\d+)/i);s=g?parseInt(g[1]):0}r=!!f&&f<75||!!s&&s<600}var O=R.prototype;return O.destroy=function(){},O.resetTimeStamp=function(E){P.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},O.resetNextTimestamp=function(){P.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){P.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(E){var b=!1,l=E.reduce(function(_,h){var g=h.pts-_;return g<-4294967296?(b=!0,d(_,h.pts)):g>0?_:h.pts},E[0].pts);return b&&P.logger.debug("PTS rollover detected"),l},O.remux=function(E,b,l,_,h,g,T,N){var V,Y,U,A,J,ne,oe=h,fe=h,ke=E.pid>-1,Oe=b.pid>-1,Me=b.samples.length,Be=E.samples.length>0,Pe=Me>1,be=(!ke||Be)&&(!Oe||Pe)||this.ISGenerated||T;if(be){this.ISGenerated||(U=this.generateIS(E,b,h));var le=this.isVideoContiguous,Le=-1;if(Pe&&(Le=L(b.samples),!le&&this.config.forceKeyFrameOnDiscontinuity))if(ne=!0,Le>0){P.logger.warn("[mp4-remuxer]: Dropped "+Le+" out of "+Me+" video samples due to a missing keyframe");var tt=this.getVideoStartPts(b.samples);b.samples=b.samples.slice(Le),b.dropped+=Le,fe+=(b.samples[0].pts-tt)/(b.timescale||9e4)}else Le===-1&&(P.logger.warn("[mp4-remuxer]: No keyframe found out of "+Me+" video samples"),ne=!1);if(this.ISGenerated){if(Be&&Pe){var nt=this.getVideoStartPts(b.samples),lt=d(E.samples[0].pts,nt)-nt,Et=lt/b.inputTimeScale;oe+=Math.max(0,Et),fe+=Math.max(0,-Et)}if(Be){if(E.samplerate||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(E,b,h)),Y=this.remuxAudio(E,oe,this.isAudioContiguous,g,Oe||Pe||N===I.PlaylistLevelType.AUDIO?fe:void 0),Pe){var Ve=Y?Y.endPTS-Y.startPTS:0;b.inputTimeScale||(P.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(E,b,h)),V=this.remuxVideo(b,fe,le,Ve)}}else Pe&&(V=this.remuxVideo(b,fe,le,0));V&&(V.firstKeyFrame=Le,V.independent=Le!==-1)}}return this.ISGenerated&&(l.samples.length&&(J=this.remuxID3(l,h)),_.samples.length&&(A=this.remuxText(_,h))),{audio:Y,video:V,initSegment:U,independent:ne,text:A,id3:J}},O.generateIS=function(E,b,l){var _=E.samples,h=b.samples,g=this.typeSupported,T={},N=!Object(X.isFiniteNumber)(this._initPTS),V="audio/mp4",Y,U,A;if(N&&(Y=U=Infinity),E.config&&_.length&&(E.timescale=E.samplerate,E.isAAC||(g.mpeg?(V="audio/mpeg",E.codec=""):g.mp3&&(E.codec="mp3")),T.audio={id:"audio",container:V,codec:E.codec,initSegment:!E.isAAC&&g.mpeg?new Uint8Array(0):B.default.initSegment([E]),metadata:{channelCount:E.channelCount}},N&&(A=E.inputTimeScale,Y=U=_[0].pts-Math.round(A*l))),b.sps&&b.pps&&h.length&&(b.timescale=b.inputTimeScale,T.video={id:"main",container:"video/mp4",codec:b.codec,initSegment:B.default.initSegment([b]),metadata:{width:b.width,height:b.height}},N)){A=b.inputTimeScale;var J=this.getVideoStartPts(h),ne=Math.round(A*l);U=Math.min(U,d(h[0].dts,J)-ne),Y=Math.min(Y,J-ne)}if(Object.keys(T).length)return this.ISGenerated=!0,N&&(this._initPTS=Y,this._initDTS=U),{tracks:T,initPTS:Y,timescale:A}},O.remuxVideo=function(E,b,l,_){var h=E.inputTimeScale,g=E.samples,T=[],N=g.length,V=this._initPTS,Y=this.nextAvcDts,U=8,A,J,ne,oe=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,ke=0,Oe=!1;if(!l||Y===null){var Me=b*h,Be=g[0].pts-d(g[0].dts,g[0].pts);Y=Me-Be}for(var Pe=0;Pe<N;Pe++){var be=g[Pe];if(be.pts=d(be.pts-V,Y),be.dts=d(be.dts-V,Y),be.dts>be.pts){var le=9e4*.2;ke=Math.max(Math.min(ke,be.pts-be.dts),-1*le)}be.dts<g[Pe>0?Pe-1:Pe].dts&&(Oe=!0)}Oe&&g.sort(function(Ft,vt){var Ge=Ft.dts-vt.dts,en=Ft.pts-vt.pts;return Ge||en}),J=g[0].dts,ne=g[g.length-1].dts;var Le=Math.round((ne-J)/(N-1));if(ke<0){if(ke<Le*-2){P.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-Le,!0)+" ms");for(var tt=ke,nt=0;nt<N;nt++)g[nt].dts=tt=Math.max(tt,g[nt].pts-Le),g[nt].pts=Math.max(tt,g[nt].pts)}else{P.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(ke,!0)+" ms to overcome this issue");for(var lt=0;lt<N;lt++)g[lt].dts=g[lt].dts+ke}J=g[0].dts}if(l){var Et=J-Y,Ve=Et>Le,Qe=Et<-1;if(Ve||Qe){Ve?P.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(Et,!0)+" ms ("+Et+"dts) hole between fragments detected, filling it"):P.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-Et,!0)+" ms ("+Et+"dts) overlapping between fragments detected"),J=Y;var ut=g[0].pts-Et;g[0].dts=J,g[0].pts=ut,P.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(ut,!0)+"/"+Object(y.toMsFromMpegTsClock)(J,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(Et,!0)+" ms")}}r&&(J=Math.max(0,J));for(var gt=0,ot=0,it=0;it<N;it++){for(var rt=g[it],Pt=rt.units,It=Pt.length,wt=0,Tt=0;Tt<It;Tt++)wt+=Pt[Tt].data.length;ot+=wt,gt+=It,rt.length=wt,rt.dts=Math.max(rt.dts,J),rt.pts=Math.max(rt.pts,rt.dts,0),oe=Math.min(rt.pts,oe),fe=Math.max(rt.pts,fe)}ne=g[N-1].dts;var Wt=ot+4*gt+8,Ct;try{Ct=new Uint8Array(Wt)}catch(Ft){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:j.ErrorTypes.MUX_ERROR,details:j.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Wt,reason:"fail allocating video mdat "+Wt});return}var bt=new DataView(Ct.buffer);bt.setUint32(0,Wt),Ct.set(B.default.types.mdat,4);for(var ze=0;ze<N;ze++){for(var Kt=g[ze],St=Kt.units,Ke=0,at=0,Ce=St.length;at<Ce;at++){var Ee=St[at],Te=Ee.data,ee=Ee.data.byteLength;bt.setUint32(U,ee),U+=4,Ct.set(Te,U),U+=ee,Ke+=4+ee}if(ze<N-1)A=g[ze+1].dts-Kt.dts;else{var ae=this.config,de=Kt.dts-g[ze>0?ze-1:ze].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var pe=Math.floor(ae.maxBufferHole*h),_e=(_?oe+_*h:this.nextAudioPts)-Kt.pts;_e>pe?(A=_e-de,A<0&&(A=de),P.logger.log("[mp4-remuxer]: It is approximately "+_e/90+" ms to the next segment; using duration "+A/90+" ms for the last video frame.")):A=de}else A=de}var Re=Math.round(Kt.pts-Kt.dts);T.push(new S(Kt.key,A,Ke,Re))}if(T.length&&f&&f<70){var De=T[0].flags;De.dependsOn=2,De.isNonSync=0}console.assert(A!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=Y=ne+A,this.isVideoContiguous=!0;var Ze=B.default.moof(E.sequenceNumber++,J,m({},E,{samples:T})),dt="video",ht={data1:Ze,data2:Ct,startPTS:oe/h,endPTS:(fe+A)/h,startDTS:J/h,endDTS:Y/h,type:dt,hasAudio:!1,hasVideo:!0,nb:T.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(Ct.length,"MDAT length must not be zero"),ht},O.remuxAudio=function(E,b,l,_,h){var g=E.inputTimeScale,T=E.samplerate?E.samplerate:g,N=g/T,V=E.isAAC?c:u,Y=V*N,U=this._initPTS,A=!E.isAAC&&this.typeSupported.mpeg,J=[],ne=E.samples,oe=A?0:8,fe=this.nextAudioPts||-1,ke=b*g;if(this.isAudioContiguous=l=l||ne.length&&fe>0&&(_&&Math.abs(ke-fe)<9e3||Math.abs(d(ne[0].pts-U,ke)-fe)<20*Y),ne.forEach(function(Te){Te.pts=d(Te.pts-U,ke)}),!l||fe<0){if(ne=ne.filter(function(Te){return Te.pts>=0}),!ne.length)return;h===0?fe=0:_?fe=Math.max(0,ke):fe=ne[0].pts}if(E.isAAC)for(var Oe=h!==void 0,Me=this.config.maxAudioFramesDrift,Be=0,Pe=fe;Be<ne.length;Be++){var be=ne[Be],le=be.pts,Le=le-Pe,tt=Math.abs(1e3*Le/g);if(Le<=-Me*Y&&Oe)Be===0&&(P.logger.warn("Audio frame @ "+(le/g).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Le/g)+" ms."),this.nextAudioPts=fe=Pe=le);else if(Le>=Me*Y&&tt<p&&Oe){var nt=Math.round(Le/Y);Pe=le-nt*Y,Pe<0&&(nt--,Pe+=Y),Be===0&&(this.nextAudioPts=fe=Pe),P.logger.warn("[mp4-remuxer]: Injecting "+nt+" audio frame @ "+(Pe/g).toFixed(3)+"s due to "+Math.round(1e3*Le/g)+" ms gap.");for(var lt=0;lt<nt;lt++){var Et=Math.max(Pe,0),Ve=D.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);Ve||(P.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ve=be.unit.subarray()),ne.splice(Be,0,{unit:Ve,pts:Et}),Pe+=Y,Be++}}be.pts=Pe,Pe+=Y}for(var Qe=null,ut=null,gt,ot=0,it=ne.length;it--;)ot+=ne[it].unit.byteLength;for(var rt=0,Pt=ne.length;rt<Pt;rt++){var It=ne[rt],wt=It.unit,Tt=It.pts;if(ut!==null){var Wt=J[rt-1];Wt.duration=Math.round((Tt-ut)/N)}else if(l&&E.isAAC&&(Tt=fe),Qe=Tt,ot>0){ot+=oe;try{gt=new Uint8Array(ot)}catch(Te){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:j.ErrorTypes.MUX_ERROR,details:j.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ot,reason:"fail allocating audio mdat "+ot});return}if(!A){var Ct=new DataView(gt.buffer);Ct.setUint32(0,ot),gt.set(B.default.types.mdat,4)}}else return;gt.set(wt,oe);var bt=wt.byteLength;oe+=bt,J.push(new S(!0,V,bt,0)),ut=Tt}var ze=J.length;if(!ze)return;var Kt=J[J.length-1];this.nextAudioPts=fe=ut+N*Kt.duration;var St=A?new Uint8Array(0):B.default.moof(E.sequenceNumber++,Qe/N,m({},E,{samples:J}));E.samples=[];var Ke=Qe/g,at=fe/g,Ce="audio",Ee={data1:St,data2:gt,startPTS:Ke,endPTS:at,startDTS:Ke,endDTS:at,type:Ce,hasAudio:!0,hasVideo:!1,nb:ze};return this.isAudioContiguous=!0,console.assert(gt.length,"MDAT length must not be zero"),Ee},O.remuxEmptyAudio=function(E,b,l,_){var h=E.inputTimeScale,g=E.samplerate?E.samplerate:h,T=h/g,N=this.nextAudioPts,V=(N!==null?N:_.startDTS*h)+this._initDTS,Y=_.endDTS*h+this._initDTS,U=T*c,A=Math.ceil((Y-V)/U),J=D.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(P.logger.warn("[mp4-remuxer]: remux empty Audio"),!J){P.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ne=[],oe=0;oe<A;oe++){var fe=V+oe*U;ne.push({unit:J,pts:fe,dts:fe})}return E.samples=ne,this.remuxAudio(E,b,l,!1)},O.remuxID3=function(E,b){var l=E.samples.length;if(!l)return;for(var _=E.inputTimeScale,h=this._initPTS,g=this._initDTS,T=0;T<l;T++){var N=E.samples[T];N.pts=d(N.pts-h,b*_)/_,N.dts=d(N.dts-g,b*_)/_}var V=E.samples;return E.samples=[],{samples:V}},O.remuxText=function(E,b){var l=E.samples.length;if(!l)return;for(var _=E.inputTimeScale,h=this._initPTS,g=0;g<l;g++){var T=E.samples[g];T.pts=d(T.pts-h,b*_)/_}E.samples.sort(function(V,Y){return V.pts-Y.pts});var N=E.samples;return E.samples=[],{samples:N}},R}();function d(R,O){var w;if(O===null)return R;for(O<R?w=-8589934592:w=8589934592;Math.abs(R-O)>4294967296;)R+=w;return R}function L(R){for(var O=0;O<R.length;O++)if(R[O].key)return O;return-1}var S=function(O,w,E,b){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=w,this.size=E,this.cts=b,this.flags=new x(O)},x=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/polyfills/number.ts"),D=k("./src/utils/mp4-tools.ts"),B=k("./src/loader/fragment.ts"),G=k("./src/utils/logger.ts"),j=function(){function y(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var m=y.prototype;return m.destroy=function(){},m.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(c,u,f){this.audioCodec=u,this.videoCodec=f,this.generateInitSegment(c),this.emitInitSegment=!0},m.generateInitSegment=function(c){var u=this.audioCodec,f=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(D.parseInitSegment)(c);u||(u=I(s.audio,B.ElementaryStreamTypes.AUDIO)),f||(f=I(s.video,B.ElementaryStreamTypes.VIDEO));var r={};s.audio&&s.video?r.audiovideo={container:"video/mp4",codec:u+","+f,initSegment:c,id:"main"}:s.audio?r.audio={container:"audio/mp4",codec:u,initSegment:c,id:"audio"}:s.video?r.video={container:"video/mp4",codec:f,initSegment:c,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},m.remux=function(c,u,f,s,r){var a=this.initPTS,d=this.lastEndDTS,L={audio:void 0,video:void 0,text:s,id3:f,initSegment:void 0};Object(X.isFiniteNumber)(d)||(d=this.lastEndDTS=r||0);var S=u.samples;if(!S||!S.length)return L;var x={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(S),R=this.initData),!R||!R.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),L;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(X.isFiniteNumber)(a)||(this.initPTS=x.initPTS=a=P(R,S,d));var O=Object(D.getDuration)(S,R),w=d,E=O+w;Object(D.offsetStartDTS)(R,S,a),O>0?this.lastEndDTS=E:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var b=!!R.audio,l=!!R.video,_="";b&&(_+="audio"),l&&(_+="video");var h={data1:S,startPTS:w,startDTS:w,endPTS:E,endDTS:E,type:_,hasAudio:b,hasVideo:l,nb:1,dropped:0};return L.audio=h.type==="audio"?h:void 0,L.video=h.type!=="audio"?h:void 0,L.text=s,L.id3=f,L.initSegment=x,L},y}(),P=function(m,p,c){return Object(D.getStartDTS)(m,p)-c};function I(y,m){var p=y==null?void 0:y.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||m===B.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}W.default=j},"./src/task-loop.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return X});var X=function(){function D(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var B=D.prototype;return B.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},B.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},B.onHandlerDestroyed=function(){},B.hasInterval=function(){return!!this._tickInterval},B.hasNextTick=function(){return!!this._tickTimer},B.setInterval=function(j){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,j),!0)},B.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},B.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},B.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},B.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},B.doTick=function(){},D}()},"./src/types/cmcd.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"CMCDVersion",function(){return X}),k.d(W,"CMCDObjectType",function(){return D}),k.d(W,"CMCDStreamingFormat",function(){return B}),k.d(W,"CMCDStreamType",function(){return G});var X=1,D;(function(j){j.MANIFEST="m",j.AUDIO="a",j.VIDEO="v",j.MUXED="av",j.INIT="i",j.CAPTION="c",j.TIMED_TEXT="tt",j.KEY="k",j.OTHER="o"})(D||(D={}));var B;(function(j){j.DASH="d",j.HLS="h",j.SMOOTH="s",j.OTHER="o"})(B||(B={}));var G;(function(j){j.VOD="v",j.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"HlsSkip",function(){return B}),k.d(W,"getSkipValue",function(){return G}),k.d(W,"HlsUrlParameters",function(){return j}),k.d(W,"Level",function(){return P});function X(I,y){for(var m=0;m<y.length;m++){var p=y[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(I,p.key,p)}}function D(I,y,m){return y&&X(I.prototype,y),m&&X(I,m),I}var B;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(B||(B={}));function G(I,y){var m=I.canSkipUntil,p=I.canSkipDateRanges,c=I.endSN,u=y!==void 0?y-c:0;return m&&u<m?p?B.v2:B.Yes:B.No}var j=function(){function I(m,p,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=p,this.skip=c}var y=I.prototype;return y.addDirectives=function(p){var c=new self.URL(p);return this.msn!==void 0&&c.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&c.searchParams.set("_HLS_part",this.part.toString()),this.skip&&c.searchParams.set("_HLS_skip",this.skip),c.toString()},I}(),P=function(){function I(y){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[y.url],this.attrs=y.attrs,this.bitrate=y.bitrate,y.details&&(this.details=y.details),this.id=y.id||0,this.name=y.name,this.width=y.width||0,this.height=y.height||0,this.audioCodec=y.audioCodec,this.videoCodec=y.videoCodec,this.unknownCodecs=y.unknownCodecs,this.codecSet=[y.videoCodec,y.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return D(I,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(m){var p=m%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),I}()},"./src/types/loader.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"PlaylistContextType",function(){return X}),k.d(W,"PlaylistLevelType",function(){return D});var X;(function(B){B.MANIFEST="manifest",B.LEVEL="level",B.AUDIO_TRACK="audioTrack",B.SUBTITLE_TRACK="subtitleTrack"})(X||(X={}));var D;(function(B){B.MAIN="main",B.AUDIO="audio",B.SUBTITLE="subtitle"})(D||(D={}))},"./src/types/transmuxer.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"ChunkMetadata",function(){return X});var X=function(G,j,P,I,y,m){I===void 0&&(I=0),y===void 0&&(y=-1),m===void 0&&(m=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=D(),this.buffering={audio:D(),video:D(),audiovideo:D()},this.level=G,this.sn=j,this.id=P,this.size=I,this.part=y,this.partial=m};function D(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"AttrList",function(){return B});var X=/^(\d+)x(\d+)$/,D=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,B=function(){function G(P){typeof P=="string"&&(P=G.parseAttrList(P));for(var I in P)P.hasOwnProperty(I)&&(this[I]=P[I])}var j=G.prototype;return j.decimalInteger=function(I){var y=parseInt(this[I],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},j.hexadecimalInteger=function(I){if(this[I]){var y=(this[I]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var m=new Uint8Array(y.length/2),p=0;p<y.length/2;p++)m[p]=parseInt(y.slice(p*2,p*2+2),16);return m}else return null},j.hexadecimalIntegerAsNumber=function(I){var y=parseInt(this[I],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},j.decimalFloatingPoint=function(I){return parseFloat(this[I])},j.optionalFloat=function(I,y){var m=this[I];return m?parseFloat(m):y},j.enumeratedString=function(I){return this[I]},j.bool=function(I){return this[I]==="YES"},j.decimalResolution=function(I){var y=X.exec(this[I]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},G.parseAttrList=function(I){var y,m={},p='"';for(D.lastIndex=0;(y=D.exec(I))!==null;){var c=y[2];c.indexOf(p)===0&&c.lastIndexOf(p)===c.length-1&&(c=c.slice(1,-1)),m[y[1]]=c}return m},G}()},"./src/utils/binary-search.ts":function(se,W,k){"use strict";k.r(W);var X={search:function(B,G){for(var j=0,P=B.length-1,I=null,y=null;j<=P;){I=(j+P)/2|0,y=B[I];var m=G(y);if(m>0)j=I+1;else if(m<0)P=I-1;else return y}return null}};W.default=X},"./src/utils/buffer-helper.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"BufferHelper",function(){return B});var X=k("./src/utils/logger.ts"),D={length:0,start:function(){return 0},end:function(){return 0}},B=function(){function G(){}return G.isBuffered=function(P,I){try{if(P){for(var y=G.getBuffered(P),m=0;m<y.length;m++)if(I>=y.start(m)&&I<=y.end(m))return!0}}catch(p){}return!1},G.bufferInfo=function(P,I,y){try{if(P){var m=G.getBuffered(P),p=[],c;for(c=0;c<m.length;c++)p.push({start:m.start(c),end:m.end(c)});return this.bufferedInfo(p,I,y)}}catch(u){}return{len:0,start:I,end:I,nextStart:void 0}},G.bufferedInfo=function(P,I,y){I=Math.max(0,I),P.sort(function(x,R){var O=x.start-R.start;return O||R.end-x.end});var m=[];if(y)for(var p=0;p<P.length;p++){var c=m.length;if(c){var u=m[c-1].end;P[p].start-u<y?P[p].end>u&&(m[c-1].end=P[p].end):m.push(P[p])}else m.push(P[p])}else m=P;for(var f=0,s,r=I,a=I,d=0;d<m.length;d++){var L=m[d].start,S=m[d].end;if(I+y>=L&&I<S)r=L,a=S,f=a-I;else if(I+y<L){s=L;break}}return{len:f,start:r||0,end:a||0,nextStart:s}},G.getBuffered=function(P){try{return P.buffered}catch(I){return X.logger.log("failed to get media.buffered",I),D}},G}()},"./src/utils/cea-608-parser.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"Row",function(){return a}),k.d(W,"CaptionScreen",function(){return d});var X=k("./src/utils/logger.ts"),D={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},B=function(E){var b=E;return D.hasOwnProperty(E)&&(b=D[E]),String.fromCharCode(b)},G=15,j=100,P={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(w){w[w.ERROR=0]="ERROR",w[w.TEXT=1]="TEXT",w[w.WARNING=2]="WARNING",w[w.INFO=2]="INFO",w[w.DEBUG=3]="DEBUG",w[w.DATA=3]="DATA"})(c||(c={}));var u=function(){function w(){this.time=null,this.verboseLevel=c.ERROR}var E=w.prototype;return E.log=function(l,_){this.verboseLevel>=l&&X.logger.log(this.time+" ["+l+"] "+_)},w}(),f=function(E){for(var b=[],l=0;l<E.length;l++)b.push(E[l].toString(16));return b},s=function(){function w(b,l,_,h,g){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=b||"white",this.underline=l||!1,this.italics=_||!1,this.background=h||"black",this.flash=g||!1}var E=w.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(l){for(var _=["foreground","underline","italics","background","flash"],h=0;h<_.length;h++){var g=_[h];l.hasOwnProperty(g)&&(this[g]=l[g])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(l){return this.foreground===l.foreground&&this.underline===l.underline&&this.italics===l.italics&&this.background===l.background&&this.flash===l.flash},E.copy=function(l){this.foreground=l.foreground,this.underline=l.underline,this.italics=l.italics,this.background=l.background,this.flash=l.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},w}(),r=function(){function w(b,l,_,h,g,T){this.uchar=void 0,this.penState=void 0,this.uchar=b||" ",this.penState=new s(l,_,h,g,T)}var E=w.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(l,_){this.uchar=l,this.penState.copy(_)},E.setPenState=function(l){this.penState.copy(l)},E.equals=function(l){return this.uchar===l.uchar&&this.penState.equals(l.penState)},E.copy=function(l){this.uchar=l.uchar,this.penState.copy(l.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},w}(),a=function(){function w(b){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var l=0;l<j;l++)this.chars.push(new r);this.logger=b,this.pos=0,this.currPenState=new s}var E=w.prototype;return E.equals=function(l){for(var _=!0,h=0;h<j;h++)if(!this.chars[h].equals(l.chars[h])){_=!1;break}return _},E.copy=function(l){for(var _=0;_<j;_++)this.chars[_].copy(l.chars[_])},E.isEmpty=function(){for(var l=!0,_=0;_<j;_++)if(!this.chars[_].isEmpty()){l=!1;break}return l},E.setCursor=function(l){this.pos!==l&&(this.pos=l),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>j&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=j)},E.moveCursor=function(l){var _=this.pos+l;if(l>1)for(var h=this.pos+1;h<_+1;h++)this.chars[h].setPenState(this.currPenState);this.setCursor(_)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(l){l>=144&&this.backSpace();var _=B(l);if(this.pos>=j){this.logger.log(c.ERROR,"Cannot insert "+l.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(l){var _;for(_=l;_<j;_++)this.chars[_].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var l=[],_=!0,h=0;h<j;h++){var g=this.chars[h].uchar;g!==" "&&(_=!1),l.push(g)}return _?"":l.join("")},E.setPenStyles=function(l){this.currPenState.setStyles(l);var _=this.chars[this.pos];_.setPenState(this.currPenState)},w}(),d=function(){function w(b){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var l=0;l<G;l++)this.rows.push(new a(b));this.logger=b,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=w.prototype;return E.reset=function(){for(var l=0;l<G;l++)this.rows[l].clear();this.currRow=G-1},E.equals=function(l){for(var _=!0,h=0;h<G;h++)if(!this.rows[h].equals(l.rows[h])){_=!1;break}return _},E.copy=function(l){for(var _=0;_<G;_++)this.rows[_].copy(l.rows[_])},E.isEmpty=function(){for(var l=!0,_=0;_<G;_++)if(!this.rows[_].isEmpty()){l=!1;break}return l},E.backSpace=function(){var l=this.rows[this.currRow];l.backSpace()},E.clearToEndOfRow=function(){var l=this.rows[this.currRow];l.clearToEndOfRow()},E.insertChar=function(l){var _=this.rows[this.currRow];_.insertChar(l)},E.setPen=function(l){var _=this.rows[this.currRow];_.setPenStyles(l)},E.moveCursor=function(l){var _=this.rows[this.currRow];_.moveCursor(l)},E.setCursor=function(l){this.logger.log(c.INFO,"setCursor: "+l);var _=this.rows[this.currRow];_.setCursor(l)},E.setPAC=function(l){this.logger.log(c.INFO,"pacData = "+JSON.stringify(l));var _=l.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var h=0;h<G;h++)this.rows[h].clear();var g=this.currRow+1-this.nrRollUpRows,T=this.lastOutputScreen;if(T){var N=T.rows[g].cueStartTime,V=this.logger.time;if(N&&V!==null&&N<V)for(var Y=0;Y<this.nrRollUpRows;Y++)this.rows[_-this.nrRollUpRows+Y+1].copy(T.rows[g+Y])}}this.currRow=_;var U=this.rows[this.currRow];if(l.indent!==null){var A=l.indent,J=Math.max(A-1,0);U.setCursor(l.indent),l.color=U.chars[J].penState.foreground}var ne={foreground:l.color,underline:l.underline,italics:l.italics,background:"black",flash:!1};this.setPen(ne)},E.setBkgData=function(l){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(l)),this.backSpace(),this.setPen(l),this.insertChar(32)},E.setRollUpRows=function(l){this.nrRollUpRows=l},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(c.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(c.TEXT,this.getDisplayText());var l=this.currRow+1-this.nrRollUpRows,_=this.rows.splice(l,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(c.INFO,"Rolling up")},E.getDisplayText=function(l){l=l||!1;for(var _=[],h="",g=-1,T=0;T<G;T++){var N=this.rows[T].getTextString();N&&(g=T+1,l?_.push("Row "+g+": '"+N+"'"):_.push(N.trim()))}return _.length>0&&(l?h="["+_.join(" | ")+"]":h=_.join(`
|
|
`)),h},E.getTextAndFormat=function(){return this.rows},w}(),L=function(){function w(b,l,_){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=b,this.outputFilter=l,this.mode=null,this.verbose=0,this.displayedMemory=new d(_),this.nonDisplayedMemory=new d(_),this.lastOutputScreen=new d(_),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var E=w.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(l){this.outputFilter=l},E.setPAC=function(l){this.writeScreen.setPAC(l)},E.setBkgData=function(l){this.writeScreen.setBkgData(l)},E.setMode=function(l){if(l===this.mode)return;this.mode=l,this.logger.log(c.INFO,"MODE="+l),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=l},E.insertChars=function(l){for(var _=0;_<l.length;_++)this.writeScreen.insertChar(l[_]);var h=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,h+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(c.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},E.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(l){this.logger.log(c.INFO,"RU("+l+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(l)},E.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var l=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=l,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},E.ccTO=function(l){this.logger.log(c.INFO,"TO("+l+") - Tab Offset"),this.writeScreen.moveCursor(l)},E.ccMIDROW=function(l){var _={flash:!1};if(_.underline=l%2===1,_.italics=l>=46,_.italics)_.foreground="white";else{var h=Math.floor(l/2)-16,g=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=g[h]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},E.outputDataUpdate=function(l){l===void 0&&(l=!1);var _=this.logger.time;if(_===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=_:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,_,this.lastOutputScreen),l&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(l){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,l,this.displayedMemory),this.cueStartTime=l))},w}(),S=function(){function w(b,l,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var h=new u;this.channels=[null,new L(b,l,h),new L(b+1,_,h)],this.cmdHistory=O(),this.logger=h}var E=w.prototype;return E.getHandler=function(l){return this.channels[l].getHandler()},E.setHandler=function(l,_){this.channels[l].setHandler(_)},E.addData=function(l,_){var h,g,T,N=!1;this.logger.time=l;for(var V=0;V<_.length;V+=2){if(g=_[V]&127,T=_[V+1]&127,g===0&&T===0)continue;if(this.logger.log(c.DATA,"["+f([_[V],_[V+1]])+"] -> ("+f([g,T])+")"),h=this.parseCmd(g,T),h||(h=this.parseMidrow(g,T)),h||(h=this.parsePAC(g,T)),h||(h=this.parseBackgroundAttributes(g,T)),!h&&(N=this.parseChars(g,T),N)){var Y=this.currentChannel;if(Y&&Y>0){var U=this.channels[Y];U.insertChars(N)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!h&&!N&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+f([g,T])+" orig: "+f([_[V],_[V+1]]))}},E.parseCmd=function(l,_){var h=this.cmdHistory,g=(l===20||l===28||l===21||l===29)&&_>=32&&_<=47,T=(l===23||l===31)&&_>=33&&_<=35;if(!(g||T))return!1;if(R(l,_,h))return x(null,null,h),this.logger.log(c.DEBUG,"Repeated command ("+f([l,_])+") is dropped"),!0;var N=l===20||l===21||l===23?1:2,V=this.channels[N];return l===20||l===21||l===28||l===29?_===32?V.ccRCL():_===33?V.ccBS():_===34?V.ccAOF():_===35?V.ccAON():_===36?V.ccDER():_===37?V.ccRU(2):_===38?V.ccRU(3):_===39?V.ccRU(4):_===40?V.ccFON():_===41?V.ccRDC():_===42?V.ccTR():_===43?V.ccRTD():_===44?V.ccEDM():_===45?V.ccCR():_===46?V.ccENM():_===47&&V.ccEOC():V.ccTO(_-32),x(l,_,h),this.currentChannel=N,!0},E.parseMidrow=function(l,_){var h=0;if((l===17||l===25)&&_>=32&&_<=47){if(l===17?h=1:h=2,h!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var g=this.channels[h];return g?(g.ccMIDROW(_),this.logger.log(c.DEBUG,"MIDROW ("+f([l,_])+")"),!0):!1}return!1},E.parsePAC=function(l,_){var h,g=this.cmdHistory,T=(l>=17&&l<=23||l>=25&&l<=31)&&_>=64&&_<=127,N=(l===16||l===24)&&_>=64&&_<=95;if(!(T||N))return!1;if(R(l,_,g))return x(null,null,g),!0;var V=l<=23?1:2;_>=64&&_<=95?h=V===1?P[l]:y[l]:h=V===1?I[l]:m[l];var Y=this.channels[V];return Y?(Y.setPAC(this.interpretPAC(h,_)),x(l,_,g),this.currentChannel=V,!0):!1},E.interpretPAC=function(l,_){var h,g={color:null,italics:!1,indent:null,underline:!1,row:l};return _>95?h=_-96:h=_-64,g.underline=(h&1)===1,h<=13?g.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(h/2)]:h<=15?(g.italics=!0,g.color="white"):g.indent=Math.floor((h-16)/2)*4,g},E.parseChars=function(l,_){var h,g=null,T=null;if(l>=25?(h=2,T=l-8):(h=1,T=l),T>=17&&T<=19){var N;T===17?N=_+80:T===18?N=_+112:N=_+144,this.logger.log(c.INFO,"Special char '"+B(N)+"' in channel "+h),g=[N]}else l>=32&&l<=127&&(g=_===0?[l]:[l,_]);if(g){var V=f(g);this.logger.log(c.DEBUG,"Char codes = "+V.join(",")),x(l,_,this.cmdHistory)}return g},E.parseBackgroundAttributes=function(l,_){var h=(l===16||l===24)&&_>=32&&_<=47,g=(l===23||l===31)&&_>=45&&_<=47;if(!(h||g))return!1;var T,N={};l===16||l===24?(T=Math.floor((_-32)/2),N.background=p[T],_%2===1&&(N.background=N.background+"_semi")):_===45?N.background="transparent":(N.foreground="black",_===47&&(N.underline=!0));var V=l<=23?1:2,Y=this.channels[V];return Y.setBkgData(N),x(l,_,this.cmdHistory),!0},E.reset=function(){for(var l=0;l<Object.keys(this.channels).length;l++){var _=this.channels[l];_&&_.reset()}this.cmdHistory=O()},E.cueSplitAtTime=function(l){for(var _=0;_<this.channels.length;_++){var h=this.channels[_];h&&h.cueSplitAtTime(l)}},w}();function x(w,E,b){b.a=w,b.b=E}function R(w,E,b){return b.a===w&&b.b===E}function O(){return{a:null,b:null}}W.default=S},"./src/utils/codecs.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"isCodecType",function(){return D}),k.d(W,"isCodecSupportedInMp4",function(){return B});var X={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function D(G,j){var P=X[j];return!!P&&P[G.slice(0,4)]===!0}function B(G,j){return MediaSource.isTypeSupported((j||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/utils/vttparser.ts"),D=k("./src/utils/webvtt-parser.ts"),B=k("./src/utils/texttrack-utils.ts"),G=/\s/,j={newCue:function(I,y,m,p){for(var c=[],u,f,s,r,a,d=self.VTTCue||self.TextTrackCue,L=0;L<p.rows.length;L++)if(u=p.rows[L],s=!0,r=0,a="",!u.isEmpty()){for(var S=0;S<u.chars.length;S++)G.test(u.chars[S].uchar)&&s?r++:(a+=u.chars[S].uchar,s=!1);u.cueStartTime=y,y===m&&(m+=1e-4),r>=16?r--:r++;var x=Object(X.fixLineBreaks)(a.trim()),R=Object(D.generateCueId)(y,m,x);(!I||!I.cues||!I.cues.getCueById(R))&&(f=new d(y,m,x),f.id=R,f.line=L+1,f.align="left",f.position=10+Math.min(80,Math.floor(r*8/32)*10),c.push(f))}return I&&c.length&&(c.sort(function(O,w){return O.line==="auto"||w.line==="auto"?0:O.line>8&&w.line>8?w.line-O.line:O.line-w.line}),c.forEach(function(O){return Object(B.addCueToTrack)(I,O)})),c}};W.default=j},"./src/utils/discontinuities.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"findFirstFragWithCC",function(){return G}),k.d(W,"shouldAlignOnDiscontinuities",function(){return j}),k.d(W,"findDiscontinuousReferenceFrag",function(){return P}),k.d(W,"adjustSlidingStart",function(){return y}),k.d(W,"alignStream",function(){return m}),k.d(W,"alignPDT",function(){return c}),k.d(W,"alignFragmentByPDTDelta",function(){return u}),k.d(W,"alignMediaPlaylistByPDT",function(){return f});var X=k("./src/polyfills/number.ts"),D=k("./src/utils/logger.ts"),B=k("./src/controller/level-helper.ts");function G(s,r){for(var a=null,d=0,L=s.length;d<L;d++){var S=s[d];if(S&&S.cc===r){a=S;break}}return a}function j(s,r,a){return!!(r.details&&(a.endCC>a.startCC||s&&s.cc<a.startCC))}function P(s,r){var a=s.fragments,d=r.fragments;if(!d.length||!a.length){D.logger.log("No fragments to align");return}var L=G(a,d[0].cc);if(!L||L&&!L.startPTS){D.logger.log("No frag in previous level to align on");return}return L}function I(s,r){if(s){var a=s.start+r;s.start=s.startPTS=a,s.endPTS=a+s.duration}}function y(s,r){for(var a=r.fragments,d=0,L=a.length;d<L;d++)I(a[d],s);r.fragmentHint&&I(r.fragmentHint,s),r.alignedSliding=!0}function m(s,r,a){if(!r)return;p(s,a,r),!a.alignedSliding&&r.details&&c(a,r.details),!a.alignedSliding&&r.details&&!a.skippedSegments&&Object(B.adjustSliding)(r.details,a)}function p(s,r,a){if(j(s,a,r)){var d=P(a.details,r);d&&Object(X.isFiniteNumber)(d.start)&&(D.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),y(d.start,r))}}function c(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var a=r.fragments[0].programDateTime,d=s.fragments[0].programDateTime,L=(d-a)/1e3+r.fragments[0].start;L&&Object(X.isFiniteNumber)(L)&&(D.logger.log("Adjusting PTS using programDateTime delta "+(d-a)+"ms, sliding:"+L.toFixed(3)+" "+s.url+" "),y(L,s))}function u(s,r){var a=s.programDateTime;if(!a)return;var d=(a-r)/1e3;s.start=s.startPTS=d,s.endPTS=d+s.duration}function f(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var a=r.fragments[0].programDateTime,d=r.fragments[0].start,L=a-d*1e3;s.fragments.forEach(function(S){u(S,L)}),s.fragmentHint&&u(s.fragmentHint,L),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/utils/ewma.ts"),D=function(){function B(j,P,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new X.default(j),this.fast_=new X.default(P)}var G=B.prototype;return G.update=function(P,I){var y=this.slow_,m=this.fast_;this.slow_.halfLife!==P&&(this.slow_=new X.default(P,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new X.default(I,m.getEstimate(),m.getTotalWeight()))},G.sample=function(P,I){P=Math.max(P,this.minDelayMs_);var y=8*I,m=P/1e3,p=y/m;this.fast_.sample(m,p),this.slow_.sample(m,p)},G.canEstimate=function(){var P=this.fast_;return P&&P.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},B}();W.default=D},"./src/utils/ewma.ts":function(se,W,k){"use strict";k.r(W);var X=function(){function D(G,j,P){j===void 0&&(j=0),P===void 0&&(P=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=j,this.totalWeight_=P}var B=D.prototype;return B.sample=function(j,P){var I=Math.pow(this.alpha_,j);this.estimate_=P*(1-I)+I*this.estimate_,this.totalWeight_+=j},B.getTotalWeight=function(){return this.totalWeight_},B.getEstimate=function(){if(this.alpha_){var j=1-Math.pow(this.alpha_,this.totalWeight_);if(j)return this.estimate_/j}return this.estimate_},D}();W.default=X},"./src/utils/fetch-loader.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"fetchSupported",function(){return u});var X=k("./src/polyfills/number.ts"),D=k("./src/loader/load-stats.ts"),B=k("./src/demux/chunk-cache.ts");function G(d,L){d.prototype=Object.create(L.prototype),d.prototype.constructor=d,m(d,L)}function j(d){var L=typeof Map=="function"?new Map:void 0;return j=function(x){if(x===null||!y(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof L!="undefined"){if(L.has(x))return L.get(x);L.set(x,R)}function R(){return P(x,arguments,p(this).constructor)}return R.prototype=Object.create(x.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),m(R,x)},j(d)}function P(d,L,S){return I()?P=Reflect.construct:P=function(R,O,w){var E=[null];E.push.apply(E,O);var b=Function.bind.apply(R,E),l=new b;return w&&m(l,w.prototype),l},P.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function y(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function m(d,L){return m=Object.setPrototypeOf||function(x,R){return x.__proto__=R,x},m(d,L)}function p(d){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},p(d)}function c(){return c=Object.assign||function(d){for(var L=1;L<arguments.length;L++){var S=arguments[L];for(var x in S)Object.prototype.hasOwnProperty.call(S,x)&&(d[x]=S[x])}return d},c.apply(this,arguments)}function u(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var f=function(){function d(S){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=S.fetchSetup||r,this.controller=new self.AbortController,this.stats=new D.LoadStats}var L=d.prototype;return L.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},L.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},L.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},L.load=function(x,R,O){var w=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var b=s(x,this.controller.signal),l=O.onProgress,_=x.responseType==="arraybuffer",h=_?"byteLength":"length";this.context=x,this.config=R,this.callbacks=O,this.request=this.fetchSetup(x,b),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){w.abortInternal(),O.onTimeout(E,x,w.response)},R.timeout),self.fetch(this.request).then(function(g){if(w.response=w.loader=g,!g.ok){var T=g.status,N=g.statusText;throw new a(N||"fetch, bad network response",T,g)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(g.headers.get("Content-Length")||"0"),l&&Object(X.isFiniteNumber)(R.highWaterMark)?w.loadProgressively(g,E,x,R.highWaterMark,l):_?g.arrayBuffer():g.text()}).then(function(g){var T=w.response;self.clearTimeout(w.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=g[h];var N={url:T.url,data:g};l&&!Object(X.isFiniteNumber)(R.highWaterMark)&&l(E,x,g,T),O.onSuccess(N,E,x,T)}).catch(function(g){if(self.clearTimeout(w.requestTimeout),E.aborted)return;var T=g.code||0;O.onError({code:T,text:g.message},x,g.details)})},L.getCacheAge=function(){var x=null;if(this.response){var R=this.response.headers.get("age");x=R?parseFloat(R):null}return x},L.loadProgressively=function(x,R,O,w,E){w===void 0&&(w=0);var b=new B.default,l=x.body.getReader(),_=function h(){return l.read().then(function(g){if(g.done)return b.dataLength&&E(R,O,b.flush(),x),Promise.resolve(new ArrayBuffer(0));var T=g.value,N=T.length;return R.loaded+=N,N<w||b.dataLength?(b.push(T),b.dataLength>=w&&E(R,O,b.flush(),x)):E(R,O,T,x),h()}).catch(function(){return Promise.reject()})};return _()},d}();function s(d,L){var S={method:"GET",mode:"cors",credentials:"same-origin",signal:L,headers:new self.Headers(c({},d.headers))};return d.rangeEnd&&S.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),S}function r(d,L){return new self.Request(d.url,L)}var a=function(d){G(L,d);function L(S,x,R){var O;return O=d.call(this,S)||this,O.code=void 0,O.details=void 0,O.code=x,O.details=R,O}return L}(j(Error));W.default=f},"./src/utils/imsc1-ttml-parser.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"IMSC1_CODEC",function(){return y}),k.d(W,"parseIMSC1",function(){return u});var X=k("./src/utils/mp4-tools.ts"),D=k("./src/utils/vttparser.ts"),B=k("./src/utils/vttcue.ts"),G=k("./src/demux/id3.ts"),j=k("./src/utils/timescale-conversion.ts"),P=k("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(w){for(var E=1;E<arguments.length;E++){var b=arguments[E];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(w[l]=b[l])}return w},I.apply(this,arguments)}var y="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function u(w,E,b,l,_){var h=Object(X.findBox)(new Uint8Array(w),["mdat"]);if(h.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var g=h[0],T=Object(G.utf8ArrayToStr)(new Uint8Array(w,g.start,g.end-g.start)),N=Object(j.toTimescaleFromScale)(E,1,b);try{l(f(T,N))}catch(V){_(V)}}function f(w,E){var b=new DOMParser,l=b.parseFromString(w,"text/xml"),_=l.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var h={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},g=Object.keys(h).reduce(function(U,A){return U[A]=_.getAttribute("ttp:"+A)||h[A],U},{}),T=_.getAttribute("xml:space")!=="preserve",N=r(s(_,"styling","style")),V=r(s(_,"layout","region")),Y=s(_,"body","[begin]");return[].map.call(Y,function(U){var A=a(U,T);if(!A||!U.hasAttribute("begin"))return null;var J=x(U.getAttribute("begin"),g),ne=x(U.getAttribute("dur"),g),oe=x(U.getAttribute("end"),g);if(J===null)throw S(U);if(oe===null){if(ne===null)throw S(U);oe=J+ne}var fe=new B.default(J-E,oe-E,A);fe.id=Object(P.generateCueId)(fe.startTime,fe.endTime,fe.text);var ke=V[U.getAttribute("region")],Oe=N[U.getAttribute("style")];fe.position=10,fe.size=80;var Me=d(ke,Oe),Be=Me.textAlign;if(Be){var Pe=c[Be];Pe&&(fe.lineAlign=Pe),fe.align=Be}return I(fe,Me),fe}).filter(function(U){return U!==null})}function s(w,E,b){var l=w.getElementsByTagName(E)[0];return l?[].slice.call(l.querySelectorAll(b)):[]}function r(w){return w.reduce(function(E,b){var l=b.getAttribute("xml:id");return l&&(E[l]=b),E},{})}function a(w,E){return[].slice.call(w.childNodes).reduce(function(b,l,_){var h;return l.nodeName==="br"&&_?b+`
|
|
`:(h=l.childNodes)!==null&&h!==void 0&&h.length?a(l,E):E?b+l.textContent.trim().replace(/\s+/g," "):b+l.textContent},"")}function d(w,E){var b="http://www.w3.org/ns/ttml#styling",l=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return l.reduce(function(_,h){var g=L(E,b,h)||L(w,b,h);return g&&(_[h]=g),_},{})}function L(w,E,b){return w.hasAttributeNS(E,b)?w.getAttributeNS(E,b):null}function S(w){return new Error("Could not parse ttml timestamp "+w)}function x(w,E){if(!w)return null;var b=Object(D.parseTimeStamp)(w);return b===null&&(m.test(w)?b=R(w,E):p.test(w)&&(b=O(w,E))),b}function R(w,E){var b=m.exec(w),l=(b[4]|0)+(b[5]|0)/E.subFrameRate;return(b[1]|0)*3600+(b[2]|0)*60+(b[3]|0)+l/E.frameRate}function O(w,E){var b=p.exec(w),l=Number(b[1]),_=b[2];switch(_){case"h":return l*3600;case"m":return l*60;case"ms":return l*1e3;case"f":return l/E.frameRate;case"t":return l/E.tickRate}return l}},"./src/utils/logger.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"enableLogs",function(){return P}),k.d(W,"logger",function(){return I});var X=function(){},D={trace:X,debug:X,log:X,warn:X,info:X,error:X},B=D;function G(y){var m=self.console[y];return m?m.bind(self.console,"["+y+"] >"):X}function j(y){for(var m=arguments.length,p=new Array(m>1?m-1:0),c=1;c<m;c++)p[c-1]=arguments[c];p.forEach(function(u){B[u]=y[u]?y[u].bind(y):G(u)})}function P(y){if(self.console&&y===!0||typeof y=="object"){j(y,"debug","log","info","warn","error");try{B.log()}catch(m){B=D}}else B=D}var I=B},"./src/utils/mediakeys-helper.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"KeySystems",function(){return X}),k.d(W,"requestMediaKeySystemAccess",function(){return D});var X;(function(B){B.WIDEVINE="com.widevine.alpha",B.PLAYREADY="com.microsoft.playready"})(X||(X={}));var D=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"getMediaSource",function(){return X});function X(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"bin2str",function(){return j}),k.d(W,"readUint16",function(){return P}),k.d(W,"readUint32",function(){return I}),k.d(W,"writeUint32",function(){return y}),k.d(W,"findBox",function(){return m}),k.d(W,"parseSegmentIndex",function(){return p}),k.d(W,"parseInitSegment",function(){return c}),k.d(W,"getStartDTS",function(){return u}),k.d(W,"getDuration",function(){return f}),k.d(W,"computeRawDurationFromSamples",function(){return s}),k.d(W,"offsetStartDTS",function(){return r}),k.d(W,"segmentValidRange",function(){return a}),k.d(W,"appendUint8Array",function(){return d});var X=k("./src/utils/typed-array.ts"),D=k("./src/loader/fragment.ts"),B=Math.pow(2,32)-1,G=[].push;function j(L){return String.fromCharCode.apply(null,L)}function P(L,S){"data"in L&&(S+=L.start,L=L.data);var x=L[S]<<8|L[S+1];return x<0?65536+x:x}function I(L,S){"data"in L&&(S+=L.start,L=L.data);var x=L[S]<<24|L[S+1]<<16|L[S+2]<<8|L[S+3];return x<0?4294967296+x:x}function y(L,S,x){"data"in L&&(S+=L.start,L=L.data),L[S]=x>>24,L[S+1]=x>>16&255,L[S+2]=x>>8&255,L[S+3]=x&255}function m(L,S){var x=[];if(!S.length)return x;var R,O,w;"data"in L?(R=L.data,O=L.start,w=L.end):(R=L,O=0,w=R.byteLength);for(var E=O;E<w;){var b=I(R,E),l=j(R.subarray(E+4,E+8)),_=b>1?E+b:w;if(l===S[0])if(S.length===1)x.push({data:R,start:E+8,end:_});else{var h=m({data:R,start:E+8,end:_},S.slice(1));h.length&&G.apply(x,h)}E=_}return x}function p(L){var S=m(L,["moov"]),x=S[0],R=x?x.end:null,O=m(L,["sidx"]);if(!O||!O[0])return null;var w=[],E=O[0],b=E.data[0],l=b===0?8:16,_=I(E,l);l+=4;var h=0,g=0;b===0?l+=8:l+=16,l+=2;var T=E.end+g,N=P(E,l);l+=2;for(var V=0;V<N;V++){var Y=l,U=I(E,Y);Y+=4;var A=U&2147483647,J=(U&2147483648)>>>31;if(J===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ne=I(E,Y);Y+=4,w.push({referenceSize:A,subsegmentDuration:ne,info:{duration:ne/_,start:T,end:T+A-1}}),T+=A,Y+=4,l=Y}return{earliestPresentationTime:h,timescale:_,version:b,referencesCount:N,references:w,moovEndOffset:R}}function c(L){for(var S=[],x=m(L,["moov","trak"]),R=0;R<x.length;R++){var O=x[R],w=m(O,["tkhd"])[0];if(w){var E=w.data[w.start],b=E===0?12:20,l=I(w,b),_=m(O,["mdia","mdhd"])[0];if(_){E=_.data[_.start],b=E===0?12:20;var h=I(_,b),g=m(O,["mdia","hdlr"])[0];if(g){var T=j(g.data.subarray(g.start+8,g.start+12)),N={soun:D.ElementaryStreamTypes.AUDIO,vide:D.ElementaryStreamTypes.VIDEO}[T];if(N){var V=m(O,["mdia","minf","stbl","stsd"])[0],Y=void 0;V&&(Y=j(V.data.subarray(V.start+12,V.start+16))),S[l]={timescale:h,type:N},S[N]={timescale:h,id:l,codec:Y}}}}}}var U=m(L,["moov","mvex","trex"]);return U.forEach(function(A){var J=I(A,4),ne=S[J];ne&&(ne.default={duration:I(A,12),flags:I(A,20)})}),S}function u(L,S){return m(S,["moof","traf"]).reduce(function(x,R){var O=m(R,["tfdt"])[0],w=O.data[O.start],E=m(R,["tfhd"]).reduce(function(b,l){var _=I(l,4),h=L[_];if(h){var g=I(O,4);w===1&&(g*=Math.pow(2,32),g+=I(O,8));var T=h.timescale||9e4,N=g/T;if(isFinite(N)&&(b===null||N<b))return N}return b},null);return E!==null&&isFinite(E)&&(x===null||E<x)?E:x},null)||0}function f(L,S){for(var x=0,R=0,O=0,w=m(L,["moof","traf"]),E=0;E<w.length;E++){var b=w[E],l=m(b,["tfhd"])[0],_=I(l,4),h=S[_];if(!h)continue;var g=h.default,T=I(l,0)|(g==null?void 0:g.flags),N=g==null?void 0:g.duration;T&8&&(T&2?N=I(l,12):N=I(l,8));for(var V=h.timescale||9e4,Y=m(b,["trun"]),U=0;U<Y.length;U++){if(N){var A=I(Y[U],4);x=N*A}else x=s(Y[U]);h.type===D.ElementaryStreamTypes.VIDEO?R+=x/V:h.type===D.ElementaryStreamTypes.AUDIO&&(O+=x/V)}}if(R===0&&O===0){var J=p(L);if(J!=null&&J.references)return J.references.reduce(function(ne,oe){return ne+oe.info.duration||0},0)}return R||O}function s(L){var S=I(L,0),x=8;S&1&&(x+=4),S&4&&(x+=4);for(var R=0,O=I(L,4),w=0;w<O;w++){if(S&256){var E=I(L,x);R+=E,x+=4}S&512&&(x+=4),S&1024&&(x+=4),S&2048&&(x+=4)}return R}function r(L,S,x){m(S,["moof","traf"]).forEach(function(R){m(R,["tfhd"]).forEach(function(O){var w=I(O,4),E=L[w];if(!E)return;var b=E.timescale||9e4;m(R,["tfdt"]).forEach(function(l){var _=l.data[l.start],h=I(l,4);if(_===0)y(l,4,h-x*b);else{h*=Math.pow(2,32),h+=I(l,8),h-=x*b,h=Math.max(h,0);var g=Math.floor(h/(B+1)),T=Math.floor(h%(B+1));y(l,4,g),y(l,8,T)}})})})}function a(L){var S={valid:null,remainder:null},x=m(L,["moof"]);if(x){if(x.length<2)return S.remainder=L,S}else return S;var R=x[x.length-1];return S.valid=Object(X.sliceUint8)(L,0,R.start-8),S.remainder=Object(X.sliceUint8)(L,R.start-8),S}function d(L,S){var x=new Uint8Array(L.length+S.length);return x.set(L),x.set(S,L.length),x}},"./src/utils/output-filter.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"default",function(){return X});var X=function(){function D(G,j){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=j}var B=D.prototype;return B.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},B.newCue=function(j,P,I){(this.startTime===null||this.startTime>j)&&(this.startTime=j),this.endTime=P,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},B.reset=function(){this.cueRanges=[]},D}()},"./src/utils/texttrack-utils.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"sendAddTrackEvent",function(){return D}),k.d(W,"addCueToTrack",function(){return B}),k.d(W,"clearCurrentCues",function(){return G}),k.d(W,"removeCuesInRange",function(){return j}),k.d(W,"getCuesInRange",function(){return I});var X=k("./src/utils/logger.ts");function D(y,m){var p;try{p=new Event("addtrack")}catch(c){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=y,m.dispatchEvent(p)}function B(y,m){var p=y.mode;if(p==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(m.id))try{if(y.addCue(m),!y.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(u){X.logger.debug("[texttrack-utils]: "+u);var c=new self.TextTrackCue(m.startTime,m.endTime,m.text);c.id=m.id,y.addCue(c)}p==="disabled"&&(y.mode=p)}function G(y){var m=y.mode;if(m==="disabled"&&(y.mode="hidden"),y.cues)for(var p=y.cues.length;p--;)y.removeCue(y.cues[p]);m==="disabled"&&(y.mode=m)}function j(y,m,p){var c=y.mode;if(c==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var u=I(y.cues,m,p),f=0;f<u.length;f++)y.removeCue(u[f]);c==="disabled"&&(y.mode=c)}function P(y,m){if(m<y[0].startTime)return 0;var p=y.length-1;if(m>y[p].endTime)return-1;for(var c=0,u=p;c<=u;){var f=Math.floor((u+c)/2);if(m<y[f].startTime)u=f-1;else if(m>y[f].startTime&&c<p)c=f+1;else return f}return y[c].startTime-m<m-y[u].startTime?c:u}function I(y,m,p){var c=[],u=P(y,m);if(u>-1)for(var f=u,s=y.length;f<s;f++){var r=y[f];if(r.startTime>=m&&r.endTime<=p)c.push(r);else if(r.startTime>p)return c}return c}},"./src/utils/time-ranges.ts":function(se,W,k){"use strict";k.r(W);var X={toString:function(B){for(var G="",j=B.length,P=0;P<j;P++)G+="["+B.start(P).toFixed(3)+","+B.end(P).toFixed(3)+"]";return G}};W.default=X},"./src/utils/timescale-conversion.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"toTimescaleFromBase",function(){return D}),k.d(W,"toTimescaleFromScale",function(){return B}),k.d(W,"toMsFromMpegTsClock",function(){return G}),k.d(W,"toMpegTsClockFromTimescale",function(){return j});var X=9e4;function D(P,I,y,m){y===void 0&&(y=1),m===void 0&&(m=!1);var p=P*I*y;return m?Math.round(p):p}function B(P,I,y,m){return y===void 0&&(y=1),m===void 0&&(m=!1),D(P,I,1/y,m)}function G(P,I){return I===void 0&&(I=!1),D(P,1e3,1/X,I)}function j(P,I){return I===void 0&&(I=1),D(P,X,1/I)}},"./src/utils/typed-array.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"sliceUint8",function(){return X});function X(D,B,G){return Uint8Array.prototype.slice?D.slice(B,G):new Uint8Array(Array.prototype.slice.call(D,B,G))}},"./src/utils/vttcue.ts":function(se,W,k){"use strict";k.r(W),W.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var X=["","lr","rl"],D=["start","middle","end","left","right"];function B(y,m){if(typeof m!="string")return!1;if(!Array.isArray(y))return!1;var p=m.toLowerCase();return~y.indexOf(p)?p:!1}function G(y){return B(X,y)}function j(y){return B(D,y)}function P(y){for(var m=arguments.length,p=new Array(m>1?m-1:0),c=1;c<m;c++)p[c-1]=arguments[c];for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var s in f)y[s]=f[s]}return y}function I(y,m,p){var c=this,u={enumerable:!0};c.hasBeenReset=!1;var f="",s=!1,r=y,a=m,d=p,L=null,S="",x=!0,R="auto",O="start",w=50,E="middle",b=50,l="middle";Object.defineProperty(c,"id",P({},u,{get:function(){return f},set:function(h){f=""+h}})),Object.defineProperty(c,"pauseOnExit",P({},u,{get:function(){return s},set:function(h){s=!!h}})),Object.defineProperty(c,"startTime",P({},u,{get:function(){return r},set:function(h){if(typeof h!="number")throw new TypeError("Start time must be set to a number.");r=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",P({},u,{get:function(){return a},set:function(h){if(typeof h!="number")throw new TypeError("End time must be set to a number.");a=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",P({},u,{get:function(){return d},set:function(h){d=""+h,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",P({},u,{get:function(){return L},set:function(h){L=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",P({},u,{get:function(){return S},set:function(h){var g=G(h);if(g===!1)throw new SyntaxError("An invalid or illegal string was specified.");S=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",P({},u,{get:function(){return x},set:function(h){x=!!h,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",P({},u,{get:function(){return R},set:function(h){if(typeof h!="number"&&h!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",P({},u,{get:function(){return O},set:function(h){var g=j(h);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");O=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",P({},u,{get:function(){return w},set:function(h){if(h<0||h>100)throw new Error("Position must be between 0 and 100.");w=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",P({},u,{get:function(){return E},set:function(h){var g=j(h);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");E=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",P({},u,{get:function(){return b},set:function(h){if(h<0||h>100)throw new Error("Size must be between 0 and 100.");b=h,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",P({},u,{get:function(){return l},set:function(h){var g=j(h);if(!g)throw new SyntaxError("An invalid or illegal string was specified.");l=g,this.hasBeenReset=!0}})),c.displayState=void 0}return I.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"parseTimeStamp",function(){return B}),k.d(W,"fixLineBreaks",function(){return m}),k.d(W,"VTTParser",function(){return p});var X=k("./src/utils/vttcue.ts"),D=function(){function c(){}var u=c.prototype;return u.decode=function(s,r){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},c}();function B(c){function u(s,r,a,d){return(s|0)*3600+(r|0)*60+(a|0)+parseFloat(d||0)}var f=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?u(f[2],f[3],0,f[4]):u(f[1],f[2],f[3],f[4]):null}var G=function(){function c(){this.values=Object.create(null)}var u=c.prototype;return u.set=function(s,r){!this.get(s)&&r!==""&&(this.values[s]=r)},u.get=function(s,r,a){return a?this.has(s)?this.values[s]:r[a]:this.has(s)?this.values[s]:r},u.has=function(s){return s in this.values},u.alt=function(s,r,a){for(var d=0;d<a.length;++d)if(r===a[d]){this.set(s,r);break}},u.integer=function(s,r){/^-?\d+$/.test(r)&&this.set(s,parseInt(r,10))},u.percent=function(s,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var a=parseFloat(r);if(a>=0&&a<=100)return this.set(s,a),!0}return!1},c}();function j(c,u,f,s){var r=s?c.split(s):[c];for(var a in r){if(typeof r[a]!="string")continue;var d=r[a].split(f);if(d.length!==2)continue;var L=d[0],S=d[1];u(L,S)}}var P=new X.default(0,0,""),I=P.align==="middle"?"middle":"center";function y(c,u,f){var s=c;function r(){var L=B(c);if(L===null)throw new Error("Malformed timestamp: "+s);return c=c.replace(/^[^\sa-zA-Z-]+/,""),L}function a(L,S){var x=new G;j(L,function(w,E){var b;switch(w){case"region":for(var l=f.length-1;l>=0;l--)if(f[l].id===E){x.set(w,f[l].region);break}break;case"vertical":x.alt(w,E,["rl","lr"]);break;case"line":b=E.split(","),x.integer(w,b[0]),x.percent(w,b[0])&&x.set("snapToLines",!1),x.alt(w,b[0],["auto"]),b.length===2&&x.alt("lineAlign",b[1],["start",I,"end"]);break;case"position":b=E.split(","),x.percent(w,b[0]),b.length===2&&x.alt("positionAlign",b[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":x.percent(w,E);break;case"align":x.alt(w,E,["start",I,"end","left","right"]);break}},/:/,/\s/),S.region=x.get("region",null),S.vertical=x.get("vertical","");var R=x.get("line","auto");R==="auto"&&P.line===-1&&(R=-1),S.line=R,S.lineAlign=x.get("lineAlign","start"),S.snapToLines=x.get("snapToLines",!0),S.size=x.get("size",100),S.align=x.get("align",I);var O=x.get("position","auto");O==="auto"&&P.position===50&&(O=S.align==="start"||S.align==="left"?0:S.align==="end"||S.align==="right"?100:50),S.position=O}function d(){c=c.replace(/^\s+/,"")}if(d(),u.startTime=r(),d(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);c=c.substr(3),d(),u.endTime=r(),d(),a(c,u)}function m(c){return c.replace(/<br(?: \/)?>/gi,`
|
|
`)}var p=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new D,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var u=c.prototype;return u.parse=function(s){var r=this;s&&(r.buffer+=r.decoder.decode(s,{stream:!0}));function a(){var O=r.buffer,w=0;for(O=m(O);w<O.length&&O[w]!=="\r"&&O[w]!==`
|
|
`;)++w;var E=O.substr(0,w);return O[w]==="\r"&&++w,O[w]===`
|
|
`&&++w,r.buffer=O.substr(w),E}function d(O){j(O,function(w,E){},/:/)}try{var L="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;L=a();var S=L.match(/^()?WEBVTT([ \t].*)?$/);if(!S||!S[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var x=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;x?x=!1:L=a();switch(r.state){case"HEADER":/:/.test(L)?d(L):L||(r.state="ID");continue;case"NOTE":L||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(L)){r.state="NOTE";break}if(!L)continue;if(r.cue=new X.default(0,0,""),r.state="CUE",L.indexOf("-->")===-1){r.cue.id=L;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{y(L,r.cue,r.regionList)}catch(O){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var R=L.indexOf("-->")!==-1;if(!L||R&&(x=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=`
|
|
`),r.cue.text+=L}continue;case"BADCUE":L||(r.state="ID")}}}catch(O){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},u.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=`
|
|
|
|
`,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(r){s.onparsingerror&&s.onparsingerror(r)}return s.onflush&&s.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(se,W,k){"use strict";k.r(W),k.d(W,"generateCueId",function(){return p}),k.d(W,"parseWebVTT",function(){return u});var X=k("./src/polyfills/number.ts"),D=k("./src/utils/vttparser.ts"),B=k("./src/demux/id3.ts"),G=k("./src/utils/timescale-conversion.ts"),j=k("./src/remux/mp4-remuxer.ts"),P=/\r\n|\n\r|\n|\r/g,I=function(s,r,a){return a===void 0&&(a=0),s.substr(a,r.length)===r},y=function(s){var r=parseInt(s.substr(-3)),a=parseInt(s.substr(-6,2)),d=parseInt(s.substr(-9,2)),L=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(r)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(d)||!Object(X.isFiniteNumber)(L))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return r+=1e3*a,r+=60*1e3*d,r+=60*60*1e3*L,r},m=function(s){for(var r=5381,a=s.length;a;)r=r*33^s.charCodeAt(--a);return(r>>>0).toString()};function p(f,s,r){return m(f.toString())+m(s.toString())+m(r)}var c=function(s,r,a){var d=s[r],L=s[d.prevCC];if(!L||!L.new&&d.new){s.ccOffset=s.presentationOffset=d.start,d.new=!1;return}for(;(S=L)!==null&&S!==void 0&&S.new;){var S;s.ccOffset+=d.start-L.start,d.new=!1,d=L,L=s[d.prevCC]}s.presentationOffset=a};function u(f,s,r,a,d,L,S,x){var R=new D.VTTParser,O=Object(B.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(P,`
|
|
`).split(`
|
|
`),w=[],E=Object(G.toMpegTsClockFromTimescale)(s,r),b="00:00.000",l=0,_=0,h,g=!0,T=!1;R.oncue=function(N){var V=a[d],Y=a.ccOffset,U=(l-E)/9e4;if(V!=null&&V.new&&(_!==void 0?Y=a.ccOffset=V.start:c(a,d,U)),U&&(Y=U-a.presentationOffset),T){var A=N.endTime-N.startTime,J=Object(j.normalizePts)((N.startTime+Y-_)*9e4,L*9e4)/9e4;N.startTime=J,N.endTime=J+A}var ne=N.text.trim();N.text=decodeURIComponent(encodeURIComponent(ne)),N.id||(N.id=p(N.startTime,N.endTime,ne)),N.endTime>0&&w.push(N)},R.onparsingerror=function(N){h=N},R.onflush=function(){if(h){x(h);return}S(w)},O.forEach(function(N){if(g)if(I(N,"X-TIMESTAMP-MAP=")){g=!1,T=!0,N.substr(16).split(",").forEach(function(V){I(V,"LOCAL:")?b=V.substr(6):I(V,"MPEGTS:")&&(l=parseInt(V.substr(7)))});try{_=y(b)/1e3}catch(V){T=!1,h=V}return}else N===""&&(g=!1);R.parse(N+`
|
|
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(se,W,k){"use strict";k.r(W);var X=k("./src/utils/logger.ts"),D=k("./src/loader/load-stats.ts"),B=/^age:\s*[\d.]+\s*$/m,G=function(){function j(I){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=I?I.xhrSetup:null,this.stats=new D.LoadStats,this.retryDelay=0}var P=j.prototype;return P.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},P.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},P.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},P.load=function(y,m,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=m,this.callbacks=p,this.retryDelay=m.retryDelay,this.loadInternal()},P.loadInternal=function(){var y=this.config,m=this.context;if(!y)return;var p=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var u=this.xhrSetup;try{if(u)try{u(p,m.url)}catch(r){p.open("GET",m.url,!0),u(p,m.url)}p.readyState||p.open("GET",m.url,!0);var f=this.context.headers;if(f)for(var s in f)p.setRequestHeader(s,f[s])}catch(r){this.callbacks.onError({code:p.status,text:r.message},m,p);return}m.rangeEnd&&p.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),p.send()},P.readystatechange=function(){var y=this.context,m=this.loader,p=this.stats;if(!y||!m)return;var c=m.readyState,u=this.config;if(p.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),c===4){m.onreadystatechange=null,m.onprogress=null;var f=m.status;if(f>=200&&f<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var s,r;if(y.responseType==="arraybuffer"?(s=m.response,r=s.byteLength):(s=m.responseText,r=s.length),p.loaded=p.total=r,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(p,y,s,m),!this.callbacks)return;var d={url:m.responseURL,data:s};this.callbacks.onSuccess(d,p,y,m)}else p.retry>=u.maxRetry||f>=400&&f<499?(X.logger.error(f+" while loading "+y.url),this.callbacks.onError({code:f,text:m.statusText},y,m)):(X.logger.warn(f+" while loading "+y.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,u.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),u.timeout)},P.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},P.loadprogress=function(y){var m=this.stats;m.loaded=y.loaded,y.lengthComputable&&(m.total=y.total)},P.getCacheAge=function(){var y=null;if(this.loader&&B.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");y=m?parseFloat(m):null}return y},j}();W.default=G}}).default})},vHTk:function(ct,$e,Q){ct.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},xiVL:function(ct,$e){ct.exports="data:image/png;base64,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"},xvzu:function(ct,$e,Q){ct.exports={flex_box_center:"flex_box_center___11Yx1",flex_space_between:"flex_space_between___3B8wg",flex_box_vertical_center:"flex_box_vertical_center___1cm8r",flex_box_center_end:"flex_box_center_end___2h7Wz",flex_box_column:"flex_box_column___1vJbd",wrap:"wrap___30mNN",modal:"modal___39YWi",titleWrap:"titleWrap___25lJO",required:"required___2_KP9",title:"title___dFjtB",colorGray:"colorGray___3RoHj",choiceWrap:"choiceWrap___14CFD",answer:"answer___10oFr",activeAnswer:"activeAnswer___S76uT",deleteIcon:"deleteIcon___kKaJg",addIcon:"addIcon___3w3u_",editorWrap:"editorWrap___3DrnO",htmlWrap:"htmlWrap___1tGnP",radio:"radio___24YhJ",color333:"color333___1O71o",color999:"color999___xHfER",questionType:"questionType___22Z7J",questionChoices:"questionChoices____Unas"}},ygoZ:function(ct,$e){ct.exports="data:image/png;base64,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"},z4EP:function(ct,$e){ct.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAA4CAYAAAAB3jHPAAAAAXNSR0IArs4c6QAAIABJREFUeF7dXQd4FdeV/ucJid5MMRgjRAeBBDZg0zFG9NiwMbis635O2WQ32WyS3Q1J1glxId6NU522ceLEsZMYMM1U0wWmG0RRo4MkRC+mCklv9rvn3nPLvHlPT5RsvM9F0nsz86b885///OfcOx5u8cv3/RQcX3pvtDo6zPf8HhGgh+957eH7jQE09oG0sK/0oj48AD7959Mv9Lcv3uGfPnw/av6mhcV7wWXE21H9mbuO2LbcPvwoLecuq7bn+/Cs7YvvCC7H+yW/3wfoK+X2ffkHomrf6DvlCnp/5d9R2hVP/ONX0++IelBffouvzl9/c+Ia3vTL97elVpccm+B73lOe748G0NSPyE2L/4sLxX8n+jIGmVhGnOqIvibxQCYvWHyQic8EgBRs1QX31Dp0NaPiAjPQzLYYKLTvBFb5UwPIArUEHwNW/pRYksvLRRnY7rHQGSKQiRtMgEwC7v8LyG4KYH7JhvrR6Kmv+PC/Bngt6Bx7HiIKRRpkgo3EeRT/q+EViSpUWUwmrw/xmgSUuBzMGvrimgtHF1WxoASEYilx3RRYQIzpw4/ythIzmQGZzWSGgSSQGKAMNrOv4jPNyAHG1cymcBgRgFe/S6r95L5qvuIhxybCYOWRec/5iE73/Eg7zxOXCpCk5SEaBjLeTg0gE+xCoYnDpbowElvhIKOLR9fWDZcmdAoGYiazlhPrKYDJC1odw1KGyWRYNaxkMafar8Qgk+smBBndOPLYI5oFxRqSET+Jr1oD7Nr+WeM9Dz+A52USvXsRGQYVcPjnXwdkHLI4BBnwxOoyBoQLNGIyBUy5ThQ+hc2wcGmzVOB3ZlmHyezwLZdPlsmktFChljTZJxNkSQPM933v2v7ZL8Hzvym0Av1LoKJfpH6wQOaESys86i+8ZUxmAMPiPT6TmXBpL2ODTIbfBJqMQrhkmjA2c4AdBBuH9hjBb+k0Sw5IDfrJBllSAPNPzmx09Vz0bXiYROCKSEDZIGOwJQ8yuX6ilx0u6TTrcKkuML1nZZX6AsZml+6FNwDi9wXIOGFwQKYBZWeXsUwWT/zrBESHb7MuwYfCuwGtBBQLfw8R1pp0qJ88JqsRYFcL/5wR9bwFgJ/lhMH/A5AZka80mtZk8qLoEBejyZhxrAsZZCl5tU1WSiFSAfFGQGbpsppAxuBknamFPWWUAmQWkxn1/4mQZAkBJsBVjehmwGttg4t/N0wmwqMU+LclXCqPjM8o3fUqDWBLSzKZAJnyv1QWyRdXZ6J2FqptBItVRMYb1GSOp3aLmExnupZtEZNdCiYTho1hsk9adhkXYP6emY0uoWIDPGQRaISYDwh5T6SNSn/JZf46IKP7WmfvwsxU0COQsSdlrAoDMs4E1U9lhrKJqpkkCDICosgwXSuEQnZAZ7mZpNFWTggNhEt7u2645HRa3jz6M06xPwEWRijAhKC/mP/WXACTJHBYc0mgEYwEmuhfW5MZkIVpMlJLbGHECP8kNJnFZOQUKbdf/GJAxiCIx2TxQMamqO3021aEBJiuClCmqXSheD8QRm1AJRL+8jNXlxmvTyNJak1fnG07zP/ta7JQgH28+82Xoz6+ScAiIHGGqMBmgYzyyEhEHLvOKpNmMnFqleOvuE86sglebknJFv5SMMvIGdBaivGYXVwTlpnOACycyZSXRuasSSz0sqzfFFhimYxZM+Cf6dKSsjBivD4XZL4CGZnE4qSLQ/0btjBiruaFXb8d70exWLjuDDDNRgSGeOEyEsgqJWTkuiK8ynMRUaasdvwDTEZGZJIg09LXMmODtT9bk9lmbLgmY4vCrUcaNrLd/hCQsXEbB2Qs4sPCpc1kFHaDN4oKh/J4DJOZKPm36fg7APP9mSkf513c5QOZlCkHQWYzmgIah0sOmWGaTLOgIngBssThUobShExmOf7V5HybE+yarMaMZebSmswW1VoXxTKZW/R2QcbfRYmHbXVwomCFv1B/zqqlxgeZKfZL3ElNxhaGOfS/PZA5V/H89l897/uRN0hnCaaRFr3DZAwWky0aTeaATJmwHC7lZ9L1Z1AyyLgSQN+nCuRK4CUEmQCKSOGl/y6zP2JAfffzxWBGMp0afnUV7Y9x7LneaXdhJMlkliXBpSfHmkgAsqCFcSMg0zeO1AfOOau6fg3RaDXS6jVMfC5v06caYH7JzPpnT5zd5wHtZMYoQRbGZC7IZHbpZJgWMGWYVEC1WE8CVPnUIcKfQVjTcduajLNLApnDaAJ+gnmAotyF2LNiFjr3fxB9Jz5t1S/t7DMWZGJ7BGbNOCqrDNY4o1FdFxWAF8wWFPJBJosFmQm/drg8f/wIGrVsi5SUOkpqiuUiqm7J+6/aVwCU78tDwYeLcMddnXDPmCdqOpW35XMNsNNbfjHN8/AK66abBdmxoo9wrDgvEOm4tGQzlbrnFOBijzI2u2yX2R93975PL+qCzGYyRW9W68zZsgNY8qN/Q4Omd2DytF9KFgv2lFn9XDoxUMtQWNKFdQ6Xpi2H2EQkATF+mqlFhoVoThykucvMazy58n07kZ87B42a34neox5Fg8bNFchI5RPIJJMJbUNfjurKCqyf9TNUVVZg6JQvoW7DJrcFRAmlDJHqtl+nno1WlvvwWhg2YjHPTCZDpiP8HU3m+mT5K2Ziz6o5t+WAssc9jj4TnjLb9oGj23NRceUiJ/GWT2YtpnyyncveRcWlj9Fr1KfRoMkdMa0xhv1kxpdarxEBmtlLel9cjpIemQ0a+igalQ68ZdoGGx+dTJPbixy7QxW4fR8Xzx7HrhV/wZXzZ1AnrS6yRj2GO+7qSAcXra6yeskUyNSZ2Ld1JUoKt6JT32HIyB4S93p4kZTbcq2IwU5ven2SD3+ebUkYH8uEyzBNZms0zjDFewJg+avm4O5eA5DRb4RVGFeGv+oaY2+WXHg2cvlQbYXoeTi0eRWO7tqIGIABWPjql3Cu7NBtOUlN26RjzD+9bJjOMVi56B0AmQqloV2xHMId8CntRO1DdoYq2VD8T+ipgtz5OHFwDyIpKej1wCNo1Lw1Ns5+/aaPe+RT/45IndSb3k5wA3QJT278yWzAeyToexmLQRmsJPxNkTt0eQp1EeSvnEUA6zn8Yck2QZ9MLcdajGMpg0ykDvxdpMcAbF/we+SvfC8hwDIfmIT6jZur+5dgq4+ZIocMJNork5dON5/JsKPWuXbxPIrXL0azNukY/c+vOGxELr4Ag9qWdPqTSRBUqFTtQE64pOgrQ6Q0VlnzGVNXfEfxxiUo2bMJd/fsjw7ZQ7B75UznulZWXMXVi+eRkpqKhk1aJAWaeyc8q7VdUiskuZAnrIlTm46d8X2vaVj4MyBTITAOyFxDNoICAbDVc9Fj+EPoO14AzMPl8yfVbrHwJ/WgEwQj/CV1UX5aJwUNm7emv3cseBP5K+ckBNjD015H8zs7KKCQtKdwaQt/R3RzaCLt5JaCLpw4iiU//jcC2JgvzYhx67lUJNaT0TBxw6IJq4qlCFBu35lt8saEVCsbPXW4EK06dDft2Ax0+Mhb9icIrdlzyETc1fVevns0JC5fOI2GTVsmCZGbW8w7veGn90Wj0c1R8kkD5qplUUizNHmQCaYpUADrM+5JAtF7059D5bWrtdrjuo2aYOrL7yQNsIemvY5mbTK0L6Y8fZnZWcwlk0yT4UmcuSATWZsB2PcVg8UarNqasHrJXO0lQSTHAnBTZPz+ftozShRY60kG41KVkyVbWapYr6xoG4o+XISmd96NAROeVQ0AOl9H8aZlKC3ahsxhD6Ft5+xaXYsbWdg7te5HX/WB1wR7ULtRHHM1GC6pxGMVv4PsV7BKAGweegx7CH3GP0n7tundn6G68rruA6PD9qMoK/iIPhfZYUSJTfazUhs0xJAnvkIlJc1gYx9Dn4lPO8d7YPMKXLt0AV0G5uDkwULsXPx2gnb2cENSv+v76D1qClp3zMSBbatRr2ETZNw73LIoQrpiVX+/xHCicJkcyAyTSZCdPLgbldcr0LZbX2PBKJ0nv9PH1UvnsHnOLxCtqsKASZ9DozvuDLRe+zh7bD92LP8LIil1MGDic5SV3s6XdzL3td/4nvcZZVbFZIqxwt8wWSKQEcDWzEf3YZ8CM5g4EOOhyd8F4GZ+SwLw8Rl/Rp20erI9RYFXtF4rcwPbFwoNNgfZAmCk68Ld/oObV+DDd358U+ftvkc+hy73jQ5YGMw6bmGcmdEwWe1B5pSPNFtJ5rt05jg+fPcnpPEy+g5DV7Ffss1AgR6orLiC7Yv/gItnytH1/jFI7zVQq0+3v9/Hoby1OJi3Dg0aN0P/h55Halq9mzpXiVb2Tqx9LRcehuleLsFkEVEzDLTn6JYdqY4kY0VksVpd6EjEuPqFq+dogGWP/fsQM1bqsOoqATBpOTw+409ISa0nt6vASCynQLbj/d9T4iAAlj3hKVkVCAGZcOmrBFPKKKjD5enSA9j9wbso37sTaQ0aYcCk59E+a6DVqGjCZp3UNFDqrkMa67M4o49U+NWDSLi/P0EvWVgYtctcto1Rmr8Z+bnzKHS26dIbvR+cSvpVvK5fu4zti3+Pi6ePo3nbDHQfOA4V1y6j8uolVFy9jOtXL6Py2iX6ef3qFVy/dgnXLn1M67btkoXMoQ/fPoCVr/nBIc9DhmYW1X5DnlcCTWaLf8r2eBykCrECYIVrF6D7sIkQADMGrtXmI8AsAPZtCbDHXvkTMZjETSzI8gIAo+XigIzPmB+tRlnBVuxdtwRlhTIU12/SDA99/SeoJ7JNp7BsQt/Vj8+hvDgPHe8d4QyBc115yxS1vDHdI1ZDuJS6rObefma3M6X7sWPpW6iqqCBg9Bo5lW7cPatnoXzfrqRAklKnDtLqNULdBo1w8dxJiiB9Rz+OFu06J7V+bRfyylb/12nP81qIkKRZiUjKatPhMBVo33FAZi0v3tcAGzoRWWOfoG2LE3XiwG5F7pLBhEm47q3/pv0e/pzwYtJ046IAeJtufUgviNf2hX9AgWCwMY8he6IxWoMgE6A6fXgvDu/IxaGP1pKpKjbavtcAVFy5hJMHCzD4iS+jy305kuQskFVXXkXBmgWUAVdVXEOfcU+g18hPOyA7f/worlw4ozNA7b6rjFQDh5bg/rKQ7gvFeuyT2FUD4dRz9mwz2bnyw9j2/m+Jmgd++oto0KwVyvfvREn+JqSm1Udq3fqoI37Wq6f/TqvfEKn1BagaIy1VDqwXrT6lhVtQvHkZeWn3T/psbbGT1PLesVWvVvielyYAwCDjcGmDzK41urpMOv3EOFbvmABYUe776DZ0ArJFHUzoresVmPvi80ntGC/0+Ct/Rkrd+gTQHUKDrZpLABOJgzNaPFqN4vWLiHWO79uDqgqZrTZo1gJdBo1B14Fj0LBZS1RcPI+5M75AQvhTX/8xmrS8i5a7cuEsDu1Yi8I18+n31PoNyMPrMWwiXTBmLgGGLXN+jQNbVtbqOGq7cMe+Q5E54u9Cu2gFk4n9aE5OfrxBJHYHBg8iUYyvxmdGq33s3boMGVmDULfB7SkjeWWrXq3wPC9Nax4FtNqAjDSZGASiQEYMtmauBljWmMdIL0Srq1GUO08xmNRP4r3CtfPp/GeOnEwOtZSv8nORzaWk1qWbPG/RHwhgYnsCYCRyrYbFDe/8EAe3rEbD5q2Q3mcw2mcPROtOmVJLAai4fAFbZv0Kh7evo79bpHdB5ohJOLh1NY7tzSN9I8owPYZ9CpkjJ1GJyFxAU/YRQC4r2q7MWhs6geFnRBX8ufqF2VK/bWe03JQItOncGx36DHXN3UAFQBfJ4ePyuZPYOv8NNG7ZFn3HP0OWyP6ty1G+fxc63TMCd3XvR/39+7Yux4mDBcgcMpHCIjUt3saBvV7Zyu+fhidrkAwyzWSKkWRXheWRqYtvmMyIfvLKIx6K1s6TABsygQAhVzFsx4wYrarE7O88Q59PfeltRKsrseP9P6B+42boM+FpZxAJhcjVgsEeRdb4p6TEtRoWKy9fxKVzJ3FH+y4OYQjm3LthCXZ/MJPCZXqfQbh0+jjOWqWlSJ06xGpj//kVtOrUS4FHueo1DYezRjcFx0oGS0VyHop4jn/scLiwwrgQ9dHKSqQ1aKwBeL78ELbM/w1atu+CvuOfpfcL181HWdFH6Hr/WKT3Hkgnq2DdPJTvzUP2qEfROr2bCpfOnVBbsk24vACYKOBlMIAo/SXNzu3SslM1CDIJGLelWgJIgogAtm4hug0Zj96jH7PaqRmsEpRCZL73XWEIAlO/90ek1K2Llb96AaeP7MX4f/kvNBNhQI0JyFv0FmkjAbDscU/KhkgFMu3JSSjTv0KoH9yyEoVr5uHqx+fRuFVbDJjyj2jXsx/2b1iKjX95Hc3u6oCRz38LF06UYdX/TEd61kCM+IdpAVM2fEYfUyZSbjzprWDDouyIMECxpzHgJMFql1bF7ngZpgjVBz9ajb2blqDn0IfRvvcg2vaJQ3uQt/QdtO3aB71GTqGzUJgrALYN3e4fK5eDj4J1C1C+dweycqbizvY9zcDe28RkXtnKGbm+j2G2ruJ2ZgOgcJAZXWbapT0vhUAmQqEAWNfBAmCPWjaFR+GUs0rBGgywKd97i0LU2bKD+OBn09CqYw+M/uJLmv12LHqLzNus0Y+ir9Bgql6pRb4HVF67gvLC7Ti0bQ1KC7ZS2EtJS0PvnKnonTNFF3SPbF+H3N+/SuF0ynd+R0Fi6Y++jlNHijHuy99Hq4yeFsjid8XSva9HFolLmEzR24DMLWwHRimFjMcU35X7x1dx6dwpDHzki2japgMBTAj2/NVzkJ41CN0HT6R9IgYrlABLzxpM7zGDCYC1Su+BiAWs2xEuvZIVM37jAZ9hRmKmEj9FCLJBRn31MeEykG0Sq6WgKHc+itYLgI1Dr5xH4UerZLmEO10VyKqrqrDglc8TiCZ/+zcEMCpsL3oLdRs2Rs8HJiM1NY2yy7zFfySAZY9+FNlKg3FX7Ml9O7F7xWycOLAHfrVoogaatU1Hp/seRKf+I1G/qSz6CsbcPv931HjIrydfnYk6deujrHgHVvzyBbTK6I7x//LfcmoAisECyrFTFEStwR8MNGKeuCHQbt+pub+fapzWqCPxu8giN7z7UzRo2gIjnvmGri4IvbV/ywp0HjAKnfs9KMGUO08CbOA4pCsGy8+dTwyWnfMYWqoQKQf2ss93a8OlV7rila/6Pl5zW5uVeeqAzGUxR5OpOGVrrOJ1C1C0fhG6DRqHzJyp2PTuT3F8784biu9tumbjwc+9gLxFb6NgjWCwqRQitdsPkPZa+P0vIrVeQ3TsNxwdBzyIlsLb4dZvAKV7NmP7vDdx4WQpmrXtQGAWoXjCV19DK3Wyl/z0P8jGeOAfvoH0bHnXa/BYIHOL0gwEdtYTg8yeb8xMgucW2mPny5DfsWvFTBzdvZHcelFp4H37aOHvcOpwEe4Z+yRadexFN0dh7jyUCoANEgAbTDeKYLBjxRJgrTr00K1Btwtk3tEVMwYgGt2imcoq55DwVzpHajLTRh0j/HVdUi5TvP59anURB9dr1BTs+uAvOF2yNzAdhdutqrNHhqFKJlu274b+n/4s1RdF+UkCTLQARxyQfXyiBE1btwOEb6Y2LU7cySNF1Opz4kA+gSp7/BPIHPl32Db3DRStfR9DnvpXdBrwIDUIHt+/C8te/xZEkX3MF14kKyCeGZsYZInCJWsyabKGgizQFUv9YJXX8cGv/5P8uQeem4YGTVroG2DlG98lp/6B576JuvUbSwZbO0cDrEPvwcRRBblzHYCJN48f3ImWd/dAaqroBzOZbIJibtJEQe06R5fvOxMBmjIr1RQuJdBCwqUVPovXLUTxh4vRdeBYshqoNVklC8HCuNZ/gZFKcn9MP3/ekrfJp8oaPUVWBwiALsho2yIUVlfhSN56FK9fSKareLXPuh8DpnxeG5gb//QT7N+0HMOe/Toy+j0gB434wKZZv0Dxh0uQ1qAhcj4/nUJJKMhUB4YzHC7pkUpu0dsGmZM8qOmlxMUuLdiGjxa/heZ3ZWDwo1/WicO58iPYOOtnlHmPePobWjvmrxEA24pug8ajQ5ZksHwG2OjHSYOJ0C80Xd1GTXHf5C/QlFFyzCVjKLwxIFmE0SU6suyl2R7wiBv2jBcVtCjctp3YkUdi+b3rBcCWkMHZ68Epmv3ig0xsR4w64pYgU6riLHbnknckwHKmIGvcE2aGH91TJrKpIpTs2kAOvuiuYC0mBni0zxaZlHmt/p/pKN2zFTn/9CLadr+HPqAZFv0oct/+IW1DaLOcz76A1p0zZa88xSSeooDvdgMW401Z4dJa3nblg+07cgI8q3effS81HG7T7J/j5OEiZI2aig4cvn0fm977Bc6UHkCne0eg2+CJ1Ncm/ilYMwclBVvQfdAECvcEsLVzJIONfhytO/QkBl395kto1KI1+j8k3Xyel8zu708WUMHlCEVHl780yY+qlmmn/khfJ8s82gczTYLMPGGgKf5wEfZ+uAR3du6NdpkDtNUgmc9sl7WfnoZAj1CyAqbqoi3ZuRHHirajd84jyB4rqwOyXgrsWvYu9m9eTi68eKXWq4+Me4aj88DRaJnRXZ44Sc30u2g/nv2fz6Dy6hU8/O1fomnr9vrcCJCJctOq376M0vytSElNw/gvv4o72nWSmSuBjFubDcjEAGu6tGGDSKxEIRxkbG+4WahMGoTlchbLf/UCREPBmM+/iNR6Deh7RKYsGgxFiWjEs9+g8hDvX/7q9yTABk9Ah6whtG8EsKLtGmDXK64QgzVr0wH9JjyrunnlXLGyW4Mbp26Myehsi0EfJWdOlvtAYNCHvBgc0uyBuDTCUftgseFyrwDYhqU3CvyE6wmAZY0R9U0TPvduWIytc97AnZ16ocv9OWjfd4huQzGt1z4qLl3AxTMnkL98Fkp2byax/9C0n7vfpzowRMa5/Nffobt8zD++SBaHFv1xQBbsipWVAGYzlTkG2nFiGxFtG0MCdt/GpSjMfR9tu2ZjwMOfofeEXty28E2yYjJHTEZGn6FOUpK/ejZK8regx+CJSM8eIrezeSkO561Di7s7o13P/jhzdB/KireTf5Y5fLIpiamRSvIwbxxkuqHqyJIXp/me/4rWRxpAyoFXQAsyGU0FoB1/Ey73bVhMABMXsGV6V13glqwjTrsR+CaDVTxj3FMmHOKfU4cLcKbkAHqPegRZYx/X4KeFotW4fO4UGrdsp1uw7Wk8t817g7o77Fe9xs0w9Jmv6fDofKhAVlVxBdGqaqQ1bCwni5PFI9XGQ6dfZWJWuAy0Xjsgq5WFYUxbUQY6VrgdAyZ/Bm279CEG/Wjhm2StdLp3OHoOn+yWlXwfeyyAibKTANjHp8qw6b3ADQUgK+cxtO4gNBnrfMlYwV6y2gp/DbCSDT+s71+4tC/qiYG3pizktNlwiLE+ZybjrJKHtpUWbEHZni1ol9kPHfoOs4zWYOt1rIazTV/Te+bhwNYVOLpzIzr2G4GO/R9wBvtqf419NqthUfh5ov1508yf09jARi3upG7PzvfnUF9Yopc967W8m5WdoIWwcelNC7YMobG9ZFwKisdkQZ/MDZdnSw9AjHCKCDPb9ymbPLRjDToPyNG9+ZzZip9Xzp/GtcsXUK/RHajXUDymQGatohPk1NFiGuYnmg2bt+mAJq3uNp0fiUCmxlwmG5o0wMQKh5dNfx5RvBEr9hXgLFZz5q3gSU4U8Lj1mnyqBC0+rO3kZgP1Tntd3eBoQradYZqbQDKgCzY1rQAzZy1n87EbFhVfcSavDFhT4GZXXhKcAp7FZgxQY03Yo5JU377DfvFbr1WTvtaCtl9ng4z3Rff4O6HdVCGkVrLGKDggkw+J0JqsFiBzAEaWxdJCmvzElHPkzDhuw6AKczaTsU+myjeCyWyAxQCIUCXZzA6x8daxmUwSKQPSqpPyNAWhIJPJAJ2kmwQZz4PBYtowm+v2OwNLtA4T4AsM+BBTDOi+MZ5ancNvIpCptFYlHDawbKtDVwMoG2UW5pFNPCKK54o1n9+KcOkATGywZNn08dVRLGYBLYGVHMj0TNMhmiy2ME4KncpKhslix1zGC5cuyFjPKRA5YdLMm2H3998MyGQmqbpR1Z2fEGSWN2ZKP7bJymCyJ1vhSe3EcskyGWewdnHezmrVNgl99hQFJhEJYzJmR9JkzMzWFAWJwmUMwChULv7uy/C8b0ri4hYbZXpaNoYW7IrJyO1XYVTXNKlPzM1GY0EjvS8Ou+x7hRqydrhUbd21CpdcmRCn2GIyPdC3BnGh58GgEmU8kAUnPFHhRycHdlmIM0YGnG17MDjETtXEZEHjlgf42rrO0ouqVdtuWKQbh+dac8KledwNRRInXAqMxJ/DPxRgYgrNo0u/N9cHJlGBm0f5BAaCmPKSmbcitCs2UH4KsllwzKXspHXDsgGlgIJkVLu85bj+msFiNZndgSG2ZIPM9sni4swaRCK0JrdHOwmA9rwMM2nNZFkURjcZkNEFt6fn5CeR1DCIRHkhMZmkXYGw/TcTTpnN3HpqcBI8c3zUNZi0TxYKMLGxk6t/3ujq1dMbfDEJsGoWdHRPkMnCGhbFMhFjYwSZzE4mYgb26gmGgYjV3iPXUaxq74PcSdWIa4Q+G7i28LdBdrOa7EZAFiPIVXbHvf3MKrRczJNIBBDCW4IkiO1mRsOKoUmAWIEAHAdknDWrjg5qJtW/S8e/JjM2LsDEVx5aMiPD8yo2w/day8hHDTzW4FyLIVSYDHbFUugTK1uAcUKkY4lEyKkOtmtT7cAatSSnT+dhdW4IDo5ukvtr9lM3KarJVoIP7pJLGsc/PpOZp8HdGpBZoluHL2PQUpVAhy2em8zoK2YkAzIJrhjWCjKo1QzpANsKl3rbsudZWzVieTPLYrgZmxBg4uSWL5mRcd2/voCYzC7j6N9jO1to6hs3AAAD80lEQVSDIFOWuwKZBCoXpWNtDDWbj63lFIOFgcyUi+ShCIDKIXfGX9MJgV32Un0dDLgbYzILZPTt1oO84gyH07otUE4KC5dcdiKKcZiMa6Hhrddh4dK1LkzmaIBptWvrKRVYZwYnjLFBJsxY2X8X5vjXCDAdLq+dfltoMg5RSrfHZJha3Cvd5WgyHqTrsFZ467WZxtNtyzYhT4wONnXRGEOYWC4ByJSuvPlwGQBZ3KfDBaYbkIpaMYyr1dyGRTMugPSepcnkcq7lYQOGgSZJKtYaYVEfA7KQemqsJpONmJxNq1l3Y7owkgKYEnjekSXTXxLZpQaZdQGDDYsyNJrefg6LGoBxQcYCXvwU7ddmMmKt2VSZibYZEi5Z68U+U8kue8mBvfas19I4uRGfrJYg00ZsIMOzNI/0sQLdFdasiabYLp4OZ8Zf2iExofDn0BioizJoDPhVkdtaXqJIhkvu4HVbr+UNo+VGXJ0R8oHwyaJR/MD3vEz7oQwyozNaR3tbMYNITHeGHXJlFIwdRMIDSULbfFhfaZBZExKzjop5ppKtJWWGzIC8mXBJU0Qpv8t9cJfSTsqisFuvJXOEMJn2msIGkch1zONuVLjk2Xhs9uHJUSjEGoPXMWTD+tcC88raCQIfoxb78k6wHnfDHpySDLUBFy8rHP8jHxQ/58GbLibFIe1jO+tW6Yir1WbkuCkJGd8r1iuTLj/rNTlaKbmGRTZwzTZrejrcrWIy7ooQexAOMlWj1E6+KZy7jKEyO8JSbGeFtkbs3jHNduHz97u10ZCwarOnLfxVGDQJhgK3DGuaqbhBUTcsis+jMT3KtYObKJBHL17+iudFvub7vm71CdoRXAqyB5FwyIwZRKJNWTZ4GWQiXIZPrW48MFF6d2uR8ntMW4+ueyrrRfK4ZL5guFRv6pNS6+xSXQTWIbYnpZmsxq7YZEGWYBCJGp1kP+QrmF0ym9oT4unaZByQKelkgUyFRdKhMjFIWoMlgh71k507NcGLek/7ES/HA5qyEWo3LPJFDDr0oSCzqgLGVJVD4uKGS0JwLMgkhhRz2vrNCo/2k3vt+ftjQeaOIwg7L/bD7YNM5j6JxB0O5zwWWgFPhzMKm8Exlypr1UzGIHMHDLOfJrNc9ZzyQCi1GSom49T6y2SadNx2eJVmlHwmOrn9svX6lgDMPskifJauOtTP86uHep4nRnZ29zyvPeA1RsRrDHhpklCs+fUT9fcrLSVByRMSJwKZAZIxZE1xnLNQw2TMeGpsp8p+7eySGZCPMxkms9t8SCWJefaVWtFyzOpy5a6HuM8eVywSD2QGFAZkzDBB4Z8syOJZGDo7DQMZyT0GmY//BTPiWWsfFEpDAAAAAElFTkSuQmCC"}}]);
|