<!DOCTYPE html>
    <html lang="en">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <!-- Meta, title, CSS, favicons, etc. -->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
    
        <title>QORA | Web Wallet</title>
    
        <!-- build:inlinecss -->
        <link href="bootstrap.min.css" rel="stylesheet">
        <link href="font-awesome.min.css" rel="stylesheet">
        <link href="nprogress.css" rel="stylesheet">
        <link href="animate.min.css" rel="stylesheet">
        <link href="custom.min.css" rel="stylesheet">
        <!-- endbuild -->
      </head>
    
      <body class="login">
    
        <div id="loginScreen">
            <div class="login_wrapper">
              <img src="../build/images/logo.svg" alt="">
              <div class="animate form login_form shown">
                <section id="login" class="login_content">
                  <form>
                    <h1>Login</h1>
                    <div>
                        <label for="passphrase">Enter your passphrase to access your wallet:</label>
                        <input id="passphrase" type="text" class="form-control" placeholder="Passphrase" autocomplete="off" />
                    </div>
                    <div>
                      <a id="loginBtn" class="btn btn-default submit" href="#">Log in</a>
                    </div>
    
                    <div class="clearfix"></div>
    
                    <div class="separator" style="font-weight: bold; text-transform: uppercase;">
                      <p class="change_link">
                          <a href="#" id="createWalletBtn" class="to_register"> New to Qora? CLICK HERE TO CREATE A WALLET </a>
                      </p>
    
                      <div class="clearfix"></div>
                      <br />
                    </div>
                  </form>
                </section>
                <section id="register" class="login_content" style="display: none;">
                  <form>
                    <h1>Create Wallet</h1>
                    <div id="generator">
                      <label for="wallet-seed">Your passphrase is:</label>
                      <textarea type="text" id="generatedPhrase" class="form-control" style="resize: none; height: 80px;" /></textarea>
                      <p>The PassPhrase is the only and unique way to access your Qora Wallet, we recommend it to have 15 words or more.</p>
                      <a id="manualPassphrase" href="#" class="btn btn-default">Manual Passphrase</a>
                      <a id="autoPassphrase" href="#" class="btn btn-default">Generate Passphrase</a>
    
                      <p style="margin-top: 25px;">Please WRITE DOWN these words on paper(!) or memorize it (their order and capitalization matters - always lowercase).</p>
                      <p class="alert-danger" style="text-shadow: none; color: white;">Attention: Don't ever disclose your passphrase. If you lose it you lose access to your account!</p>
                    </div>
                    <div id="after_generator" style="display: none;">
                        <div>
                            <label for="phraseConfirmation">Please confirm your passphrase:</label>
                          <input id="phraseConfirmation" type="text" class="form-control" autocomplete="off" />
                          <p>Your passphrase is very important! In order to be sure that you have saved it, please write your passphrase.</p>
                        </div>
                    </div>
    
                    <div>
                        <a class="btn btn-default submit register-previous-step" href="#">Go Back</a>
                        <a class="btn btn-default submit register-next-step" href="#">Continue</a>
                    </div>
    
                    <div class="clearfix"></div>
    
                    <div class="separator">
                      <div class="clearfix"></div>
                      <br />
                    </div>
                  </form>
                </section>
                <div class="login-footer">
                    <a href="http://www.qora.org/"><img src="../build/images/logo.svg" alt="" width="150"></a>
                  <p>©2016 All rights reserved. Copyright <a href="http://www.qora.org/">Qora</a><br>Programmed By Zeus.</p>
                </div>
              </div>
            </div>
        </div>
    
        <div id="panelScreen" class="light-mode" style="display: none;">
            <div class="container body">
              <div class="main_container">
                <div class="col-md-3 left_col">
                  <div class="left_col scroll-view">
                    <!-- sidebar menu -->
                    <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
                      <div class="menu_section" style="margin-top: 35px;">
                        <h3>Wallet</h3>
                        <ul class="nav side-menu">
                            <li><a href="#"><i class="fa fa-home"></i> Dashboard </a></li>
                            <li><a href="#"><i class="fa fa-book"></i> Asset Exchange</a></li>
                            <li class="only-advanced"><a href="#"><i class="fa fa-barcode"></i> Smart Contracts (AT's)</a></li>
                            <li class="only-advanced"><a href="#"><i class="fa fa-users"></i> Crowdfund</a></li>
                            <li class="only-advanced"><a href="#"><i></i> ACCT (what's that???)</a></li>
                            <li class="only-advanced"><a href="#"><i class="fa fa-diamond"></i> Lotteries</a></li>
                            <li class="only-advanced"><a href="#"><i class="fa fa-pie-chart"></i> Polling</a></li>
                        </ul>
                      </div>
                      <div class="menu_section only-advanced">
                        <h3>Web Hosting Features</h3>
                        <ul class="nav side-menu">
                            <li><a href="#"><i class="fa fa-cloud"></i> Register Qora Domain</a></li>
                            <li><a href="#"><i class="fa fa-cubes"></i> Qora Web Listing</a></li>
                            <li><a href="#"><i class="fa fa-server"></i> Start Qora Website</a></li>
                            <li><a href="#"><i class="fa fa-rocket"></i> Qora Blogs</a></li>
                            <li><a href="#"><i class="fa fa-rss"></i> Start Qora Blog</a></li>
                        </ul>
                      </div>
                      <div class="menu_section only-advanced">
                          <h3>Communications</h3>
                          <ul class="nav side-menu">
                              <li><a href="#"><i class="fa fa-comments-o"></i> Quoth Chat</a></li>
                          </ul>
                      </div>
    
                    </div>
                    <!-- /sidebar menu -->
    
                    <!-- /menu footer buttons -->
                    <div class="sidebar-footer hidden-small" style="display: none;">
                      <a data-toggle="tooltip" data-placement="top" title="Settings">
                        <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
                      </a>
                      <a data-toggle="tooltip" data-placement="top" title="FullScreen">
                        <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
                      </a>
                      <a data-toggle="tooltip" data-placement="top" title="Lock">
                        <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
                      </a>
                      <a data-toggle="tooltip" data-placement="top" title="Logout" href="javascript:window.location.reload();">
                        <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
                      </a>
                    </div>
                    <!-- /menu footer buttons -->
                  </div>
                </div>
    
                <!-- top navigation -->
                <div class="top_nav">
                  <div class="nav_menu">
                    <nav>
                      <div class="nav toggle">
                        <a id="menu_toggle"><i class="fa fa-bars"></i></a>
                      </div>
    
                      <div class="nav logo">
                          <img src="../build/images/logo.svg" alt="">
                      </div>
    
                      <ul class="nav navbar-nav navbar-right">
                        <li>
                          <a href="javascript:window.location.reload();" class="dropdown-toggle info-number" data-toggle="dropdown" aria-expanded="false" title="Logout">
                            <i class="glyphicon glyphicon-off"></i>
                          </a>
                        </li>
                        <li>
                            <a data-toggle="tooltip" data-placement="top" title="Change Mode">
                              <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
                            </a>
                        </li>
                        <li>
                            <a href="#" class="btn btn-default" data-toggle="modal" data-target=".send-money-modal">Send Qora</a>
                        </li>
                      </ul>
                    </nav>
                  </div>
                </div>
                <!-- /top navigation -->
    
                <!-- page content -->
                <div class="right_col" role="main">
                  <div class="">
    
                    <div class="row">
                        <div class="col-md-4 col-sm-12">
                            <div class="x_panel">
                                <div class="x_content">
                                    <span class="panel_sm_title">Confirmed Balance</span>
                                    <span class="totalBalance"></span>
                                </div>
                            </div>
    
                        </div>
                        <div class="col-md-4 col-sm-12 center-align">
                            <h3 class="vtitle">Dashboard</h3>
                        </div>
                        <div class="col-md-4 col-sm-12">
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <div class="x_panel">
                                    <div class="x_content">
                                        <span class="panel_sm_title"># Of Connections</span>
                                        <span class="nbConnections">0</span> Peers
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <div class="x_panel">
                                    <div class="x_content">
                                        <span class="panel_sm_title">Wallet Status</span>
                                        <span class="syncStatus">Out Of Sync</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
    
                    <div class="clearfix"></div>
    
                    <!-- Wallet Addresses -->
                    <div class="row">
                      <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                          <div class="x_title">
                            <h2>Wallet Addresses</h2>
                            <div class="clearfix"></div>
                          </div>
                          <div class="x_content">
                              <table id="addressesList" class="table table-striped">
                                  <thead>
                                      <tr>
                                          <th>Address</th>
                                          <th>Balance</th>
                                          <th>Confirmed Balance</th>
                                          <th>Generating Balance</th>
                                      </tr>
                                  </thead>
                                  <tbody></tbody>
                              </table>
                          </div>
                        </div>
                      </div>
                    </div>
                    <!-- END Wallet Addresses -->
    
                    <div class="clearfix"></div>
    
                    <!-- <div class="row">
                        <div class="col-md-6 col-sm-12 col-xs-12">
                            <div class="x_panel">
                                <div class="x_title">
                                    <h2>Recent Transactions</h2>
                                    <div class="clearfix"></div>
                                </div>
                                <div class="x_content">
                                    <table id="transactionsList" class="table table-striped">
                                        <thead>
                                            <tr>
                                                <th>Date</th>
                                                <th>Amount + Fee</th>
                                                <th>Account</th>
                                                <th>Confirmations</th>
                                            </tr>
                                        </thead>
                                        <tbody></tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6 col-sm-12 col-xs-12">
                            <div class="x_panel">
                                <div class="x_title">
                                    <h2>Recent Blocks</h2>
                                    <div class="clearfix"></div>
                                </div>
                                <div class="x_content">
                                    <table id="blocksList" class="table table-striped">
                                        <thead>
                                            <tr>
                                                <th>Height</th>
                                                <th>Date</th>
                                                <th>Amount + Fee</th>
                                            </tr>
                                        </thead>
                                        <tbody></tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div> -->
    
                  </div>
                </div>
                <!-- /page content -->
    
                <!-- footer content -->
                <footer>
                  <div class="pull-right">
                    &copy; 2016 Copyright. All Rights Reserved Qora.net. Wallet built by Zeus.
                  </div>
                  <div class="clearfix"></div>
                </footer>
                <!-- /footer content -->
              </div>
            </div>
        </div>
    
        <div class="modal fade send-money-modal" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
                        <h4 class="modal-title" id="myModalLabel">Send Qora</h4>
                    </div>
                    <div class="modal-body">
                        <div class="row">
                            <p class="col-md-12 col-sm-12 col-xs-12">
                                <label for="sendFrom" class="col-md-6 col-sm-6 col-xs-12">From:</label>
                                <select id="sendFrom" class="col-md-6 col-sm-6 col-xs-12"></select>
                            </p>
                            <p class="col-md-12 col-sm-12 col-xs-12">
                                <label for="sendTo" class="col-md-6 col-sm-6 col-xs-12">To: (address)</label>
                                <input type="text" id="sendTo" class="col-md-6 col-sm-6 col-xs-12">
                            </p>
                            <p class="col-md-12 col-sm-12 col-xs-12">
                                <label for="sendAmount" class="col-md-6 col-sm-6 col-xs-12">Amount:</label>
                                <input type="text" id="sendAmount" class="col-md-6 col-sm-6 col-xs-12">
                            </p>
                            <p class="col-md-12 col-sm-12 col-xs-12">
                                <label for="sendFee" class="col-md-6 col-sm-6 col-xs-12">Fee:</label>
                                <input type="text" id="sendFee" value="1" class="col-md-6 col-sm-6 col-xs-12">
                            </p>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                        <button id="sendQoraBtn" type="button" class="btn btn-primary">Send Qora</button>
                    </div>
                </div>
            </div>
        </div>
    
        <!-- build:inlinejs -->
        <script src="jquery.min.js"></script>
        <script src="bootstrap.min.js"></script>
        <script src="fastclick.js"></script>
        <script src="nprogress.js"></script>
        <script src="bootstrap-progressbar.min.js"></script>
        <script src="icheck.min.js"></script>
        <script src="pnotify.js"></script>
        <script src="pnotify.buttons.js"></script>
        <script src="pnotify.nonblock.js"></script>
        <script src="es6-promise.min.js"></script>
        <script src="sha256.js"></script>
        <script src="Base58.js"></script>
        <script src="nacl-fast.js"></script>
        <script src="ripemd160.js"></script>
        <script src="custom.js"></script>
        <script src="bundle.js"></script>
        <!-- endbuild -->
      </body>
    </html>
    
    data:application/javascript;base64, Ly8gR2VuZXJhdGVkIGJ5IENvZmZlZVNjcmlwdCAxLjguMAooZnVuY3Rpb24oKSB7CiAgdmFyIEFMUEhBQkVULCBBTFBIQUJFVF9NQVAsIEJhc2U1OCwgaTsKCiAgQmFzZTU4ID0gKHR5cGVvZiBtb2R1bGUgIT09ICJ1bmRlZmluZWQiICYmIG1vZHVsZSAhPT0gbnVsbCA/IG1vZHVsZS5leHBvcnRzIDogdm9pZCAwKSB8fCAod2luZG93LkJhc2U1OCA9IHt9KTsKCiAgQUxQSEFCRVQgPSAiMTIzNDU2Nzg5QUJDREVGR0hKS0xNTlBRUlNUVVZXWFlaYWJjZGVmZ2hpamttbm9wcXJzdHV2d3h5eiI7CgogIEFMUEhBQkVUX01BUCA9IHt9Owo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z0gaDIgKiAoNSAqIHI5KTsKICAgIGQxICs9IGgzICogKDUgKiByOCk7CiAgICBkMSArPSBoNCAqICg1ICogcjcpOwogICAgYyA9IChkMSA+Pj4gMTMpOyBkMSAmPSAweDFmZmY7CiAgICBkMSArPSBoNSAqICg1ICogcjYpOwogICAgZDEgKz0gaDYgKiAoNSAqIHI1KTsKICAgIGQxICs9IGg3ICogKDUgKiByNCk7CiAgICBkMSArPSBoOCAqICg1ICogcjMpOwogICAgZDEgKz0gaDkgKiAoNSAqIHIyKTsKICAgIGMgKz0gKGQxID4+PiAxMyk7IGQxICY9IDB4MWZmZjsKCiAgICBkMiA9IGM7CiAgICBkMiArPSBoMCAqIHIyOwogICAgZDIgKz0gaDEgKiByMTsKICAgIGQyICs9IGgyICogcjA7CiAgICBkMiArPSBoMyAqICg1ICogcjkpOwogICAgZDIgKz0gaDQgKiAoNSAqIHI4KTsKICAgIGMgPSAoZDIgPj4+IDEzKTsgZDIgJj0gMHgxZmZmOwogICAgZDIgKz0gaDUgKiAoNSAqIHI3KTsKICAgIGQyICs9IGg2ICogKDUgKiByNik7CiAgICBkMiArPSBoNyAqICg1ICogcjUpOwogICAgZDIgKz0gaDggKiAoNSAqIHI0KTsKICAgIGQyICs9IGg5ICogKDUgKiByMyk7CiAgICBjICs9IChkMiA+Pj4gMTMpOyBkMiAmPSAweDFmZmY7CgogICAgZDMgPSBjOwogICAgZDMgKz0gaDAgKiByMzsKICAgIGQzICs9IGgxICogcjI7CiAgICBkMyArPSBoMiAqIHIxOwogICAgZDMgKz0gaDMgKiByMDsKICAgIGQzICs9IGg0ICogKDUgKiByOSk7CiAgICBjID0gKGQzID4+PiAxMyk7IGQzICY9IDB4MWZmZjsKICAgIGQzICs9IGg1ICogKDUgKiByOCk7CiAgICBkMyArPSBoNiAqICg1ICogcjcpOwogICAgZDMgKz0gaDcgKiAoNSAqIHI2KTsKICAgIGQzICs9IGg4ICogKDUgKiByNSk7CiAgICBkMyArPSBoOSAqICg1ICogcj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ICAgYWwxID0gaGxbMV0sCiAgICAgIGFsMiA9IGhsWzJdLAogICAgICBhbDMgPSBobFszXSwKICAgICAgYWw0ID0gaGxbNF0sCiAgICAgIGFsNSA9IGhsWzVdLAogICAgICBhbDYgPSBobFs2XSwKICAgICAgYWw3ID0gaGxbN107CgogIHZhciBwb3MgPSAwOwogIHdoaWxlIChuID49IDEyOCkgewogICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspIHsKICAgICAgaiA9IDggKiBpICsgcG9zOwogICAgICB3aFtpXSA9IChtW2orMF0gPDwgMjQpIHwgKG1baisxXSA8PCAxNikgfCAobVtqKzJdIDw8IDgpIHwgbVtqKzNdOwogICAgICB3bFtpXSA9IChtW2orNF0gPDwgMjQpIHwgKG1bais1XSA8PCAxNikgfCAobVtqKzZdIDw8IDgpIHwgbVtqKzddOwogICAgfQogICAgZm9yIChpID0gMDsgaSA8IDgwOyBpKyspIHsKICAgICAgYmgwID0gYWgwOwogICAgICBiaDEgPSBhaDE7CiAgICAgIGJoMiA9IGFoMjsKICAgICAgYmgzID0gYWgzOwogICAgICBiaDQgPSBhaDQ7CiAgICAgIGJoNSA9IGFoNTsKICAgICAgYmg2ID0gYWg2OwogICAgICBiaDcgPSBhaDc7CgogICAgICBibDAgPSBhbDA7CiAgICAgIGJsMSA9IGFsMTsKICAgICAgYmwyID0gYWwyOwogICAgICBibDMgPSBhbDM7CiAgICAgIGJsNCA9IGFsNDsKICAgICAgYmw1ID0gYWw1OwogICAgICBibDYgPSBhbDY7CiAgICAgIGJsNyA9IGFsNzsKCiAgICAgIC8vIGFkZAogICAgICBoID0gYWg3OwogICAgICBsID0gYWw3OwoKICAgICAgYSA9IGwgJiAweGZmZmY7IGIgPSBsID4+PiAxNjsKICAgICAgYyA9IGggJiAweGZmZmY7IGQgPSBoID4+PiAxNjsKCiAgICAgIC8vIFNpZ21hMQogICAgICBoID0gKChhaDQgPj4+IDE0KSB8IChhbDQgPDwgKDMyLTE0KSkpIF4gKChhaDQgP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8gYWRkCiAgICAgIGggPSBiaDM7CiAgICAgIGwgPSBibDM7CgogICAgICBhID0gbCAmIDB4ZmZmZjsgYiA9IGwgPj4+IDE2OwogICAgICBjID0gaCAmIDB4ZmZmZjsgZCA9IGggPj4+IDE2OwoKICAgICAgaCA9IHRoOwogICAgICBsID0gdGw7CgogICAgICBhICs9IGwgJiAweGZmZmY7IGIgKz0gbCA+Pj4gMTY7CiAgICAgIGMgKz0gaCAmIDB4ZmZmZjsgZCArPSBoID4+PiAxNjsKCiAgICAgIGIgKz0gYSA+Pj4gMTY7CiAgICAgIGMgKz0gYiA+Pj4gMTY7CiAgICAgIGQgKz0gYyA+Pj4gMTY7CgogICAgICBiaDMgPSAoYyAmIDB4ZmZmZikgfCAoZCA8PCAxNik7CiAgICAgIGJsMyA9IChhICYgMHhmZmZmKSB8IChiIDw8IDE2KTsKCiAgICAgIGFoMSA9IGJoMDsKICAgICAgYWgyID0gYmgxOwogICAgICBhaDMgPSBiaDI7CiAgICAgIGFoNCA9IGJoMzsKICAgICAgYWg1ID0gYmg0OwogICAgICBhaDYgPSBiaDU7CiAgICAgIGFoNyA9IGJoNjsKICAgICAgYWgwID0gYmg3OwoKICAgICAgYWwxID0gYmwwOwogICAgICBhbDIgPSBibDE7CiAgICAgIGFsMyA9IGJsMjsKICAgICAgYWw0ID0gYmwzOwogICAgICBhbDUgPSBibDQ7CiAgICAgIGFsNiA9IGJsNTsKICAgICAgYWw3ID0gYmw2OwogICAgICBhbDAgPSBibDc7CgogICAgICBpZiAoaSUxNiA9PT0gMTUpIHsKICAgICAgICBmb3IgKGogPSAwOyBqIDwgMTY7IGorKykgewogICAgICAgICAgLy8gYWRkCiAgICAgICAgICBoID0gd2hbal07CiAgICAgICAgICBsID0gd2xbal07CgogICAgICAgICAgYSA9IGwgJiAweGZmZmY7IGIgPSBsID4+PiAxNjsKICAgICAgICAgIGMgPSBoICYgMHhmZmZmOyBkID0gaCA+Pj4gMTY7CgogICAgICAgICAgaCA9IHdoWyhqKzkpJTE2XTsKICAgICAgICAgIGwgPSB3bFsoais5KSUxNl07CgogICAgICAgICAgYSArPSBsICYgMHhmZmZmOyBiICs9IGwgPj4+IDE2OwogICAgICAgICAgYyArPSBoICYgMHhmZmZmOyBkICs9IGggPj4+IDE2OwoKICAgICAgICAgIC8vIHNpZ21hMAogICAgICAgICAgdGggPSB3aFsoaisxKSUxNl07CiAgICAgICAgICB0bCA9IHdsWyhqKzEpJTE2XTsKICAgICAgICAgIGggPSAoKHRoID4+PiAxKSB8ICh0bCA8PCAoMzItMSkpKSBeICgodGggPj4+IDgpIHwgKHRsIDw8ICgzMi04KSkpIF4gKHRoID4+PiA3KTsKICAgICAgICAgIGwgPSAoKHRsID4+PiAxKSB8ICh0aCA8PCAoMzItMSkpKSBeICgodGwgPj4+IDgpIHwgKHRoIDw8ICgzMi04KSkpIF4gKCh0bCA+Pj4gNykgfCAodGggPDwgKDMyLTcpKSk7CgogICAgICAgICAgYSArPSBsICYgMHhmZmZmOyBiICs9IGwgPj4+IDE2OwogICAgICAgICAgYyArPSBoICYgMHhmZmZmOyBkICs9IGggPj4+IDE2OwoKICAgICAgICAgIC8vIHNpZ21hMQogICAgICAgICAgdGggPSB3aFsoaisxNCklMTZdOwogICAgICAgICAgdGwgPSB3bFsoaisxNCklMTZdOwogICAgICAgICAgaCA9ICgodGggPj4+IDE5KSB8ICh0bCA8PCAoMzItMTkpKSkgXiAoKHRsID4+PiAoNjEtMzIpKSB8ICh0aCA8PCAoMzItKDYxLTMyKSkpKSBeICh0aCA+Pj4gNik7CiAgICAgICAgICBsID0gKCh0bCA+Pj4gMTkpIHwgKHRoIDw8ICgzMi0xOSkpKSBeICgodGggPj4+ICg2MS0zMikpIHwgKHRsIDw8ICgzMi0oNjEtMzIpKSkpIF4gKCh0bCA+Pj4gNikgfCAodGggPDwgKDMyLTYpKSk7CgogICAgICAgICAgYSArPSBsICYgMHhmZmZmOyBiICs9IGwgPj4+IDE2OwogICAgICAgICAgYyArPSBoICYg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KGNyeXB0bykgewogICAgICBuYWNsLnNldFBSTkcoZnVuY3Rpb24oeCwgbikgewogICAgICAgIHZhciBpLCB2ID0gbmV3IFVpbnQ4QXJyYXkobik7CiAgICAgICAgY3J5cHRvLmdldFJhbmRvbVZhbHVlcyh2KTsKICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKSB4W2ldID0gdltpXTsKICAgICAgICBjbGVhbnVwKHYpOwogICAgICB9KTsKICAgIH0KICB9IGVsc2UgaWYgKHR5cGVvZiByZXF1aXJlICE9PSAndW5kZWZpbmVkJykgewogICAgLy8gTm9kZS5qcy4KICAgIGNyeXB0byA9IHJlcXVpcmUoJ2NyeXB0bycpOwogICAgaWYgKGNyeXB0bykgewogICAgICBuYWNsLnNldFBSTkcoZnVuY3Rpb24oeCwgbikgewogICAgICAgIHZhciBpLCB2ID0gY3J5cHRvLnJhbmRvbUJ5dGVzKG4pOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspIHhbaV0gPSB2W2ldOwogICAgICAgIGNsZWFudXAodik7CiAgICAgIH0pOwogICAgfQogIH0KfSkoKTsKCn0pKHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnICYmIG1vZHVsZS5leHBvcnRzID8gbW9kdWxlLmV4cG9ydHMgOiAod2luZG93Lm5hY2wgPSB3aW5kb3cubmFjbCB8fCB7fSkpOw==
    data:application/javascript;base64, IkdlbmVyYXRlZCBmcm9tIEphdmEgd2l0aCBKU3dlZXQgMS4wLjAgLSBodHRwOi8vd3d3Lmpzd2VldC5vcmciOwp2YXIgUklQRU1EMTYwID0gKGZ1bmN0aW9uICgpIHsKICAgIGZ1bmN0aW9uIFJJUEVNRDE2MCgpIHsKICAgICAgICB0aGlzLk1EYnVmID0gW107CiAgICAgICAgdGhpcy5NRGJ1ZlswXSA9IDE3MzI1ODQxOTM7CiAgICAgICAgdGhpcy5NRGJ1ZlsxXSA9IC0yNzE3MzM4Nzk7CiAgICAgICAgdGhpcy5NRGJ1ZlsyXSA9IC0xNzMyNTg0MTk0OwogICAgICAgIHRoaXMuTURidWZbM10gPSAyNzE3MzM4Nzg7CiAgICAgICAgdGhpcy5NRGJ1Zls0XSA9IC0xMDA5NTg5Nzc2OwoJCXRoaXMud29ya2luZyA9IG5ldyBJbnQzMkFycmF5KDE2KTsKCQkKICAgICAgICB0aGlzLndvcmtpbmdfcHRyID0gMDsKICAgICAgICB0aGlzLm1zZ2xlbiA9IDA7CiAgICB9CiAgICBSSVBFTUQxNjAucHJvdG90eXBlLnJlc2V0ID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuTURidWYgPSBbXTsKICAgICAgICB0aGlzLk1EYnVmWzBdID0gMTczMjU4NDE5MzsKICAgICAgICB0aGlzLk1EYnVmWzFdID0gLTI3MTczMzg3OTsKICAgICAgICB0aGlzLk1EYnVmWzJdID0gLTE3MzI1ODQxOTQ7CiAgICAgICAgdGhpcy5NRGJ1ZlszXSA9IDI3MTczMzg3ODsKICAgICAgICB0aGlzLk1EYnVmWzRdID0gLTEwMDk1ODk3NzY7CiAgICAgICAgdGhpcy53b3JraW5nID0gbmV3IEludDMyQXJyYXkoMTYpOwogICAgICAgIHRoaXMud29ya2luZ19wdHIgPSAwOwogICAgICAgIHRoaXMubXNnbGVuID0gMDsKICAgIH07CiAgICBSSVBFTUQxNjAucHJvdG90eXBlLmNvbXByZXNzID0gZnVuY3Rpb24gKFgpIHsKICAgICAgICB2YXIgaW5kZXggPSAwOwogICAgICAgIHZhciBhOwogICAgICAgIHZhciBiOwogICAgICAgIHZhciBjOwogICAgICAgIHZhciBkOwogICAgICAgIHZhciBlOwogICAgICAgIHZhciBBOwogICAgICAgIHZhciBCOwogICAgICAgIHZhciBDOwogICAgICAgIHZhciBEOwogICAgICAgIHZhciBFOwogICAgICAgIHZhciB0ZW1wOwogICAgICAgIHZhciBzOwogICAgICAgIEEgPSBhID0gdGhpcy5NRGJ1ZlswXTsKICAgICAgICBCID0gYiA9IHRoaXMuTURidWZbMV07CiAgICAgICAgQyA9IGMgPSB0aGlzLk1EYnVmWzJdOwogICAgICAgIEQgPSBkID0gdGhpcy5NRGJ1ZlszXTsKICAgICAgICBFID0gZSA9IHRoaXMuTURidWZbNF07CiAgICAgICAgZm9yICg7IGluZGV4IDwgMTY7IGluZGV4KyspIHsKICAgICAgICAgICAgdGVtcCA9IGEgKyAoYiBeIGMgXiBkKSArIFhbUklQRU1EMTYwLkluZGV4QXJyYXlbMF1baW5kZXhdXTsKICAgICAgICAgICAgYSA9IGU7CiAgICAgICAgICAgIGUgPSBkOwogICAgICAgICAgICBkID0gKGMgPDwgMTApIHwgKGMgPj4+IDIyKTsKICAgICAgICAgICAgYyA9IGI7CiAgICAgICAgICAgIHMgPSBSSVBFTUQxNjAuQXJnQXJyYXlbMF1baW5kZXhdOwogICAgICAgICAgICBiID0gKCh0ZW1wIDw8IHMpIHwgKHRlbXAgPj4+ICgzMiAtIHMpKSkgKyBhOwogICAgICAgICAgICB0ZW1wID0gQSArIChCIF4gKEMgfCB+RCkpICsgWFtSSVBFTUQxNjAuSW5kZXhBcnJheVsxXVtpbmRleF1dICsgMTM1MjgyOTkyNjsKICAgICAgICAgICAgQSA9IEU7CiAgICAgICAgICAgIEUgPSBEOwogICAgICAgICAgICBEID0gKEMgPDwgMTApIHwgKEMgPj4+IDIyKTsKICAgICAgICAgICAgQyA9IEI7CiAgICAgICAgICAgIHMgPSBSSVBFTUQxNjAuQXJnQXJyYXlbMV1baW5kZXhdOwogICAgICAgICAgICBCID0gKCh0ZW1wIDw8IHMpIHwgKHRlbXAgPj4+ICgzMiAtIHMpKSkgKyBBOwogICAgICAgIH0KICAgICAgICBmb3IgKDsgaW5kZXggPCAzMjsgaW5kZXgrKykgewogICAgICAgICAgICB0ZW1wID0gYSArICgoYiAmIGMpIHwgKH5iICYgZCkpICsgWFtSSVBFTUQxNjAuSW5kZXhBcnJheVswXVtpbmRleF1dICsgMTUxODUwMDI0OTsKICAgICAgICAgICAgYSA9IGU7CiAgICAgICAgICAgIGUgPSBkOwogICAgICAgICAgICBkID0gKGMgPDwgMTApIHwgKGMgPj4+IDIyKTsKICAgICAgICAgICAgYyA9IGI7CiAgICAgICAgICAgIHMgPSBSSVBFTUQxNjAuQXJnQXJyYXlbMF1baW5kZXhdOwogICAgICAgICAgICBiID0gKCh0ZW1wIDw8IHMpIHwgKHRlbXAgPj4+ICgzMiAtIHMpKSkgKyBhOwogICAgICAgICAgICB0ZW1wID0gQSArICgoQiAmIEQpIHwgKEMgJiB+RCkpICsgWFtSSVBFTUQxNjAuSW5kZXhBcnJheVsxXVtpbmRleF1dICsgMTU0ODYwMzY4NDsKICAgICAgICAgICAgQSA9IEU7CiAgICAgICAgICAgIEUgPSBEOwogICAgICAgICAgICBEID0gKEMgPDwgMTApIHwgKEMgPj4+IDIyKTsKICAgICAgICAgICAgQyA9IEI7CiAgICAgICAgICAgIHMgPSBSSVBFTUQxNjAuQXJnQXJyYXlbMV1baW5kZXhdOwogICAgICAgICAgICBCID0gKCh0ZW1wIDw8IHMpIHwgKHRlbXAgPj4+ICgzMiAtIHMpKSkgKyBBOwogICAgICAgIH0KICAgICAgICBmb3IgKDsgaW5kZXggPCA0ODsgaW5kZXgrKykgewogICAgICAgICAgICB0ZW1wID0gYSArICgoYiB8IH5jKSBeIGQpICsgWFtSSVBFTUQxNjAuSW5kZXhBcnJheVswXVtpbmRleF1dICsgMTg1OTc3NTM5MzsKICAgICAgICAgICAgYSA9IGU7CiAgICAgICAgICAgIGUgPSBkOwogICAgICAgICAgICBkID0gKGMgPDwgMTApIHwgKGMgPj4+IDIyKTsKICAgICAgICAgICAgYyA9IGI7CiAgICAgICAgICAgIHMgPSBSSVBFTUQxNjAuQXJnQXJyYXlbMF1baW5kZXhdOwogICAgICAgICAgICBiID0gKCh0ZW1wIDw8IHMpIHwgKHRlbXAgPj4+ICgzMiAtIHMpKSkgKyBhOwogICAgICAgICAgICB0ZW1wID0gQSArICgoQiB8IH5DKSBeIEQpICsgWFtSSVBFTUQxNjAuSW5kZXhBcnJheVsxXVtpbmRleF1dICsgMTgzNjA3MjY5MTsKICAgICAgICAgICAgQSA9IEU7CiAgICAgICAgICAgIEUgPSBEOwogICAgICAgICAgICBEID0gKEMgPDwgMTApIHwgKEMgPj4+IDIyKTsKICAgICAgICAgICAgQyA9IEI7CiAgICAgICAgICAgIHMgPSBSSVBFTUQxNjAuQXJnQXJyYXlbMV1baW5kZXhdOwogICAgICAgICAgICBCID0gKCh0ZW1wIDw8IHMpIHwgKHRlbXAgPj4+ICgzMiAtIHMpKSkgKyBBOwogICAgICAgIH0KICAgICAgICBmb3IgKDsgaW5kZXggPCA2NDsgaW5kZXgrKykgewogICAgICAgICAgICB0ZW1wID0gYSArICgoYiAmIGQpIHwgKGMgJiB+ZCkpICsgWFtSSVBFTUQxNjAuSW5kZXhBcnJheVswXVtpbmRleF1dICsgLTE4OTQwMDc1ODg7CiAgICAgICAgICAgIGEgPSBlOwogICAgICAgICAgICBlID0gZDsKICAgICAgICAgICAgZCA9IChjIDw8IDEwKSB8IChjID4+PiAyMik7CiAgICAgICAgICAgIGMgPSBiOwogICAgICAgICAgICBzID0gUklQRU1EMTYwLkFyZ0FycmF5WzBdW2luZGV4XTsKICAgICAgICAgICAgYiA9ICgodGVtcCA8PCBzKSB8ICh0ZW1wID4+PiAoMzIgLSBzKSkpICsgYTsKICAgICAgICAgICAgdGVtcCA9IEEgKyAoKEIgJiBDKSB8ICh+QiAmIEQpKSArIFhbUklQRU1EMTYwLkluZGV4QXJyYXlbMV1baW5kZXhdXSArIDIwNTM5OTQyMTc7CiAgICAgICAgICAgIEEgPSBFOwogICAgICAgICAgICBFID0gRDsKICAgICAgICAgICAgRCA9IChDIDw8IDEwKSB8IChDID4+PiAyMik7CiAgICAgICAgICAgIEMgPSBCOwogICAgICAgICAgICBzID0gUklQRU1EMTYwLkFyZ0FycmF5WzFdW2luZGV4XTsKICAgICAgICAgICAgQiA9ICgodGVtcCA8PCBzKSB8ICh0ZW1wID4+PiAoMzIgLSBzKSkpICsgQTsKICAgICAgICB9CiAgICAgICAgZm9yICg7IGluZGV4IDwgODA7IGluZGV4KyspIHsKICAgICAgICAgICAgdGVtcCA9IGEgKyAoYiBeIChjIHwgfmQpKSArIFhbUklQRU1EMTYwLkluZGV4QXJyYXlbMF1baW5kZXhdXSArIC0xNDU0MTEzNDU4OwogICAgICAgICAgICBhID0gZTsKICAgICAgICAgICAgZSA9IGQ7CiAgICAgICAgICAgIGQgPSAoYyA8PCAxMCkgfCAoYyA+Pj4gMjIpOwogICAgICAgICAgICBjID0gYjsKICAgICAgICAgICAgcyA9IFJJUEVNRDE2MC5BcmdBcnJheVswXVtpbmRleF07CiAgICAgICAgICAgIGIgPSAoKHRlbXAgPDwgcykgfCAodGVtcCA+Pj4gKDMyIC0gcykpKSArIGE7CiAgICAgICAgICAgIHRlbXAgPSBBICsgKEIgXiBDIF4gRCkgKyBYW1JJUEVNRDE2MC5JbmRleEFycmF5WzFdW2luZGV4XV07CiAgICAgICAgICAgIEEgPSBFOwogICAgICAgICAgICBFID0gRDsKICAgICAgICAgICAgRCA9IChDIDw8IDEwKSB8IChDID4+PiAyMik7CiAgICAgICAgICAgIEMgPSBCOwogICAgICAgICAgICBzID0gUklQRU1EMTYwLkFyZ0FycmF5WzFdW2luZGV4XTsKICAgICAgICAgICAgQiA9ICgodGVtcCA8PCBzKSB8ICh0ZW1wID4+PiAoMzIgLSBzKSkpICsgQTsKICAgICAgICB9CiAgICAgICAgRCArPSBjICsgdGhpcy5NRGJ1ZlsxXTsKICAgICAgICB0aGlzLk1EYnVmWzFdID0gdGhpcy5NRGJ1ZlsyXSArIGQgKyBFOwogICAgICAgIHRoaXMuTURidWZbMl0gPSB0aGlzLk1EYnVmWzNdICsgZSArIEE7CiAgICAgICAgdGhpcy5NRGJ1ZlszXSA9IHRoaXMuTURidWZbNF0gKyBhICsgQjsKICAgICAgICB0aGlzLk1EYnVmWzRdID0gdGhpcy5NRGJ1ZlswXSArIGIgKyBDOwogICAgICAgIHRoaXMuTURidWZbMF0gPSBEOwogICAgfTsKICAgIFJJUEVNRDE2MC5wcm90b3R5cGUuTURmaW5pc2ggPSBmdW5jdGlvbiAoYXJyYXksIGxzd2xlbiwgbXN3bGVuKSB7CiAgICAgICAgdmFyIFggPSBhcnJheTsKICAgICAgICBYWyhsc3dsZW4gPj4gMikgJiAxNV0gXj0gMSA8PCAoKChsc3dsZW4gJiAzKSA8PCAzKSArIDcpOwogICAgICAgIGlmICgoKGxzd2xlbiAmIDYzKSA+IDU1KSkgewogICAgICAgICAgICB0aGlzLmNvbXByZXNzKFgpOwogICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDE0OyBpKyspIHsKICAgICAgICAgICAgICAgIFhbaV0gPSAwOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIFhbMTRdID0gbHN3bGVuIDw8IDM7CiAgICAgICAgWFsxNV0gPSAobHN3bGVuID4+IDI5KSB8IChtc3dsZW4gPDwgMyk7CiAgICAgICAgdGhpcy5jb21wcmVzcyhYKTsKICAgIH07CiAgICBSSVBFTUQxNjAucHJvdG90eXBlLnVwZGF0ZSA9IGZ1bmN0aW9uIChpbnB1dCkgewogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgaW5wdXQubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgdGhpcy53b3JraW5nW3RoaXMud29ya2luZ19wdHIgPj4gMl0gXj0gaW5wdXRbaV0gPDwgKCh0aGlzLndvcmtpbmdfcHRyICYgMykgPDwgMyk7CiAgICAgICAgICAgIHRoaXMud29ya2luZ19wdHIrKzsKICAgICAgICAgICAgaWYgKCh0aGlzLndvcmtpbmdfcHRyID09IDY0KSkgewogICAgICAgICAgICAgICAgdGhpcy5jb21wcmVzcyh0aGlzLndvcmtpbmcpOwogICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCAxNjsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy53b3JraW5nW2pd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ytdIDw8IDg7DQogICAgICAgIHdvcmQgfD0gbVtieXRlSW5kZXgrK107DQogICAgICAgIHdvcmRzW2ldID0gd29yZDsNCiAgICB9DQogICAgdmFyIHcgPSBuZXcgSW50MzJBcnJheSg2NCk7DQogICAgZm9yICh2YXIgaiA9IDA7IGogPCB3b3JkTGVuZ3RoOyBqICs9IDE2KSB7DQogICAgICAgIGZvciAoaSA9IDA7IGkgPCAxNjsgaSsrKSB7DQogICAgICAgICAgICB3W2ldID0gd29yZHNbaiArIGldOw0KICAgICAgICB9DQogICAgICAgIGZvciAoaSA9IDE2OyBpIDwgNjQ7IGkrKykgew0KICAgICAgICAgICAgdmFyIHYgPSB3W2kgLSAxNV07DQogICAgICAgICAgICB2YXIgczAgPSAodiA+Pj4gNykgfCAodiA8PCAyNSk7DQogICAgICAgICAgICBzMCBePSAodiA+Pj4gMTgpIHwgKHYgPDwgMTQpOw0KICAgICAgICAgICAgczAgXj0gKHYgPj4+IDMpOw0KICAgICAgICAgICAgdiA9IHdbaSAtIDJdOw0KICAgICAgICAgICAgdmFyIHMxID0gKHYgPj4+IDE3KSB8ICh2IDw8IDE1KTsNCiAgICAgICAgICAgIHMxIF49ICh2ID4+PiAxOSkgfCAodiA8PCAxMyk7DQogICAgICAgICAgICBzMSBePSAodiA+Pj4gMTApOw0KICAgICAgICAgICAgd1tpXSA9ICh3W2kgLSAxNl0gKyBzMCArIHdbaSAtIDddICsgczEpICYgMHhmZmZmZmZmZjsNCiAgICAgICAgfQ0KICAgICAgICB2YXIgYSA9IGgwOw0KICAgICAgICB2YXIgYiA9IGgxOw0KICAgICAgICB2YXIgYyA9IGgyOw0KICAgICAgICB2YXIgZCA9IGgzOw0KICAgICAgICB2YXIgZSA9IGg0Ow0KICAgICAgICB2YXIgZiA9IGg1Ow0KICAgICAgICB2YXIgZyA9IGg2Ow0KICAgICAgICB2YXIgaCA9IGg3Ow0KICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjQ7IGkrKykgew0KICAgICAgICAgICAgczEgPSAoZSA+Pj4gNikgfCAoZSA8PCAyNik7DQogICAgICAgICAgICBzMSBePSAoZSA+Pj4gMTEpIHwgKGUgPDwgMjEpOw0KICAgICAgICAgICAgczEgXj0gKGUgPj4+IDI1KSB8IChlIDw8IDcpOw0KICAgICAgICAgICAgdmFyIGNoID0gKGUgJiBmKSBeICh+ZSAmIGcpOw0KICAgICAgICAgICAgdmFyIHRlbXAxID0gKGggKyBzMSArIGNoICsgS1tpXSArIHdbaV0pICYgMHhmZmZmZmZmZjsNCiAgICAgICAgICAgIHMwID0gKGEgPj4+IDIpIHwgKGEgPDwgMzApOw0KICAgICAgICAgICAgczAgXj0gKGEgPj4+IDEzKSB8IChhIDw8IDE5KTsNCiAgICAgICAgICAgIHMwIF49IChhID4+PiAyMikgfCAoYSA8PCAxMCk7DQogICAgICAgICAgICB2YXIgbWFqID0gKGEgJiBiKSBeIChhICYgYykgXiAoYiAmIGMpOw0KICAgICAgICAgICAgdmFyIHRlbXAyID0gKHMwICsgbWFqKSAmIDB4ZmZmZmZmZmY7DQogICAgICAgICAgICBoID0gZw0KICAgICAgICAgICAgZyA9IGYNCiAgICAgICAgICAgIGYgPSBlDQogICAgICAgICAgICBlID0gKGQgKyB0ZW1wMSkgJiAweGZmZmZmZmZmOw0KICAgICAgICAgICAgZCA9IGM7DQogICAgICAgICAgICBjID0gYjsNCiAgICAgICAgICAgIGIgPSBhOw0KICAgICAgICAgICAgYSA9ICh0ZW1wMSArIHRlbXAyKSAmIDB4ZmZmZmZmZmY7DQogICAgICAgIH0NCiAgICAgICAgaDAgPSAoaDAgKyBhKSAmIDB4ZmZmZmZmZmY7DQogICAgICAgIGgxID0gKGgxICsgYikgJiAweGZmZmZmZmZmOw0KICAgICAgICBoMiA9IChoMiArIGMpICYgMHhmZmZmZmZmZjsNCiAgICAgICAgaDMgPSAoaDMgKyBkKSAmIDB4ZmZmZmZmZmY7DQogICAgICAgIGg0ID0gKGg0ICsgZSkgJiAweGZmZmZmZmZ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JCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgJCgnI3JlZ2lzdGVyJykuc2xpZGVVcCgpOwoJCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgJCgnI2xvZ2luJykuc2xpZGVEb3duKCk7CgkJCQkJCQkJICAgICAgICAgICAgICAgICAgICB0aGlzLmZvcm1TaG93biA9ICdsb2dpbic7CgkJCQkJCQkJICAgICAgICAgICAgICAgICAgICBicmVhazsKCQkJCQkJCQkgICAgICAgICAgICAgICAgY2FzZSAxOgoJCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgJCgnI2FmdGVyX2dlbmVyYXRvcicpLnNsaWRlVXAoKTsKCQkJCQkJCQkgICAgICAgICAgICAgICAgICAgICQoJyNnZW5lcmF0b3InKS5zbGlkZURvd24oKTsKCQkJCQkJCQkgICAgICAgICAgICAgICAgICAgIGJyZWFrOwoJCQkJCQkJCSAgICAgICAgICAgICAgICBjYXNlIDI6CgkJCQkJCQkJICAgICAgICAgICAgICAgICAgICAkKCcjZ2VuZXJhdG9yJykuc2xpZGVVcCgpOwoJCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgJCgnI2FmdGVyX2dlbmVyYXRvcicpLnNsaWRlRG93bigpOwoJCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgYnJlYWs7CgkJCQkJCQkJICAgICAgICAgICAgICAgIGNhc2UgMzoKCQkJCQkJCQkgICAgICAgICAgICAgICAgICAgIHZhciBwaHJhc2UgPSAkLnRyaW0oJCgnI2dlbmVyYXRlZFBocmFzZScpLnZhbCgpKTsKCQkJCQkJCQkgICAgICAgICAgICAgICAgICAgIHZhciBwaHJhc2VDb25maXJtID0gJC50cmltKCQoJyNwaHJhc2VDb25maXJtYXRpb24nKS52YWwoKSk7CgkJCQkJCQkJICAgICAgICAgICAgICAgICAgICBpZiAocGhyYXNlID09PSBwaHJhc2VDb25maXJtKSB7CgkJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5lbnRlcihwaHJhc2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AocGFyYW1zID09PSB2b2lkIDApIHsgcGFyYW1zID0ge307IH0KCQkJCQkJCSAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHsKCQkJCQkJCSAgICAgICAgICAgICQucG9zdChfdGhpcy5sb2NhbEFQSUxpbmssIHsKCQkJCQkJCSAgICAgICAgICAgICAgICB0eXBlOiB0eXBlLAoJCQkJCQkJICAgICAgICAgICAgICAgIGFwaXVybDogcGF0aCwKCQkJCQkJCSAgICAgICAgICAgICAgICBqc29uOiBKU09OLnN0cmluZ2lmeShwYXJhbXMpCgkJCQkJCQkgICAgICAgICAgICB9KS5kb25lKGZ1bmN0aW9uIChkYXRhKSB7CgkJCQkJCQkgICAgICAgICAgICAgICAgaWYgKGRhdGEudHlwZSA9PT0gJ3N1Y2Nlc3MnKSB7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBkYXRhLnJlc3VsdDsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgdHJ5IHsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgIHJlcyA9IEpTT04ucGFyc2UoZGF0YS5yZXN1bHQpOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICB9CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhlKTsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgfQoJCQkJCQkJICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlcyk7CgkJCQkJCQkgICAgICAgICAgICAgICAgfQoJCQkJCQkJICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRhdGEudHlwZSA9PT0gJ2Vycm9yJykgewoJCQkJCQkJICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhkYXRhKTsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGRhd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ICAgICAgICAgICAgICAgICAgYXBpdXJsOiAnL3RyYW5zYWN0aW9ucy9wcm9jZXNzJywKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAganNvbjogdHhSYXcKCQkJCQkJCSAgICAgICAgICAgICAgICB9LAoJCQkJCQkJICAgICAgICAgICAgICAgIHN1Y2Nlc3M6IGZ1bmN0aW9uIChkYXRhKSB7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgIGlmIChkYXRhLnR5cGUgPT09ICdhcGljYWxsZXJyb3InKSB7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KGRhdGEuZXJyb3JkZXRhaWwpOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICB9CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgIGlmIChkYXRhLnR5cGUgPT09ICdzdWNjZXNzJykgewoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzTmFOKGRhdGEucmVzdWx0KSkgewoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoZGF0YS5yZXN1bHQpOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgfQoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChkYXRhLnJlc3VsdCkgewoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICIxIjoKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoJ1ZBTElEQVRFX09LJyk7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAiMiI6CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCdJTlZBTElEX0FERFJFU1MnKTsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICIzIjoKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoJ05FR0FUSVZFX0FNT1VOVCcpOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgIjQiOgoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSgnTkVHQVRJVkVfRkVFJyk7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAiNSI6CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCdOT19CQUxBTkNFJyk7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAiNiI6CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCdJTlZBTElEX1JFRkVSRU5DRScpOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgIjciOgoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSgnSU5WQUxJRF9OQU1FX0xFTkdUSCcpOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgIjgiOgoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSgnSU5WQUxJRF9WQUxVRV9MRU5HVEgnKTsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICI5IjoKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoJ05BTUVfQUxSRUFEWV9SRUdJU1RSRUQnKTsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICIxNSI6CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCdJTlZBTElEX0FNT1VOVCcpOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgIjE3IjoKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoJ05BTUVfTk9UX0xPV0VSX0NBU0UnKTsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICIyNyI6CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCdJTlZBTElEX0RBVEFfTEVOR1RIJyk7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAiMzQiOgoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSgnSU5WQUxJRF9QQVlNRU5UU19MRU5HVEgnKTsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICI0MCI6CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCdGRUVfTEVTU19SRVFVSVJFRCcpOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgIjQxIjoKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoJ0lOVkFMSURfUkFXX0RBVEEnKTsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICIxMDAwIjoKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoJ05PVF9ZRVRfUkVMRUFTRUQnKTsKCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwoJCQkJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgIH0KCQkJCQkJCSAgICAgICAgICAgICAgICAgICAgfQoJCQkJCQkJICAgICAgICAgICAgICAgIH0sIGZhaWw6IGZ1bmN0aW9uICh4aHIsIHRleHRTdGF0dXMsIGVycm9yVGhyb3duKSB7CgkJCQkJCQkgICAgICAgICAgICAgICAgICAgIHJlamVjdCh4aHIucmVzcG9uc2VUZXh0KTsKCQkJCQk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RlbnRIZWlnaHQgLT0gJE5BVl9NRU5VLmhlaWdodCgpICsgZm9vdGVySGVpZ2h0OwoKICAgICAgICAkUklHSFRfQ09MLmNzcygnbWluLWhlaWdodCcsIGNvbnRlbnRIZWlnaHQpOwogICAgfTsKCiAgICAkU0lERUJBUl9NRU5VLmZpbmQoJ2EnKS5vbignY2xpY2snLCBmdW5jdGlvbihldikgewogICAgICAgIHZhciAkbGkgPSAkKHRoaXMpLnBhcmVudCgpOwoKICAgICAgICBpZiAoJGxpLmlzKCcuYWN0aXZlJykpIHsKICAgICAgICAgICAgJGxpLnJlbW92ZUNsYXNzKCdhY3RpdmUgYWN0aXZlLXNtJyk7CiAgICAgICAgICAgICQoJ3VsOmZpcnN0JywgJGxpKS5zbGlkZVVwKGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgc2V0Q29udGVudEhlaWdodCgpOwogICAgICAgICAgICB9KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAvLyBwcmV2ZW50IGNsb3NpbmcgbWVudSBpZiB3ZSBhcmUgb24gY2hpbGQgbWVudQogICAgICAgICAgICBpZiAoISRsaS5wYXJlbnQoKS5pcygnLmNoaWxkX21lbnUnKSkgewogICAgICAgICAgICAgICAgJFNJREVCQVJfTUVOVS5maW5kKCdsaScpLnJlbW92ZUNsYXNzKCdhY3RpdmUgYWN0aXZlLXNtJyk7CiAgICAgICAgICAgICAgICAkU0lERUJBUl9NRU5VLmZpbmQoJ2xpIHVsJykuc2xpZGVVcCgpOwogICAgICAgICAgICB9CgogICAgICAgICAgICAkbGkuYWRkQ2xhc3MoJ2FjdGl2ZScpOwoKICAgICAgICAgICAgJCgndWw6Zmlyc3QnLCAkbGkpLnNsaWRlRG93bihmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIHNldENvbnRlbnRIZWlnaHQoKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfSk7CgogICAgLy8gdG9nZ2xlIHNtYWxsIG9yIGxhcmdlIG1lbn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lX3JlY29yZHMnXTpjaGVja2VkIikubGVuZ3RoOwoKICAgIGlmIChjaGVja0NvdW50KSB7CiAgICAgICAgJCgnLmNvbHVtbi10aXRsZScpLmhpZGUoKTsKICAgICAgICAkKCcuYnVsay1hY3Rpb25zJykuc2hvdygpOwogICAgICAgICQoJy5hY3Rpb24tY250JykuaHRtbChjaGVja0NvdW50ICsgJyBSZWNvcmRzIFNlbGVjdGVkJyk7CiAgICB9IGVsc2UgewogICAgICAgICQoJy5jb2x1bW4tdGl0bGUnKS5zaG93KCk7CiAgICAgICAgJCgnLmJ1bGstYWN0aW9ucycpLmhpZGUoKTsKICAgIH0KfQoKLy8gQWNjb3JkaW9uCiQoZG9jdW1lbnQpLnJlYWR5KGZ1bmN0aW9uKCkgewogICAgJCgiLmV4cGFuZCIpLm9uKCJjbGljayIsIGZ1bmN0aW9uICgpIHsKICAgICAgICAkKHRoaXMpLm5leHQoKS5zbGlkZVRvZ2dsZSgyMDApOwogICAgICAgICRleHBhbmQgPSAkKHRoaXMpLmZpbmQoIj46Zmlyc3QtY2hpbGQiKTsKCiAgICAgICAgaWYgKCRleHBhbmQudGV4dCgpID09ICIrIikgewogICAgICAgICAgICAkZXhwYW5kLnRleHQoIi0iKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAkZXhwYW5kLnRleHQoIisiKTsKICAgICAgICB9CiAgICB9KTsKfSk7CgovLyBOUHJvZ3Jlc3MKaWYgKHR5cGVvZiBOUHJvZ3Jlc3MgIT0gJ3VuZGVmaW5lZCcpIHsKICAgICQoZG9jdW1lbnQpLnJlYWR5KGZ1bmN0aW9uICgpIHsKICAgICAgICBOUHJvZ3Jlc3Muc3RhcnQoKTsKICAgIH0pOwoKICAgICQod2luZG93KS5sb2FkKGZ1bmN0aW9uICgpIHsKICAgICAgICBOUHJvZ3Jlc3MuZG9uZSgpOwogICAgfSk7Cn0K
    data:application/javascript;base64, LyohIGpRdWVyeSB2Mi4yLjQgfCAoYykgalF1ZXJ5IEZvd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