From c4992c9cef364bd6cc7ef87d1f212ba0cd9d9d7a Mon Sep 17 00:00:00 2001 From: Shreyas Satish Date: Tue, 13 Sep 2016 18:23:00 +0530 Subject: [PATCH 1/9] added ability to block transfers after a certain date --- .../6a6c0be09f_add_transferrable_until.py | 23 +++++++++++++++++++ boxoffice/models/item.py | 1 + boxoffice/models/line_item.py | 4 ++++ boxoffice/views/participant.py | 2 ++ 4 files changed, 30 insertions(+) create mode 100644 alembic/versions/6a6c0be09f_add_transferrable_until.py diff --git a/alembic/versions/6a6c0be09f_add_transferrable_until.py b/alembic/versions/6a6c0be09f_add_transferrable_until.py new file mode 100644 index 00000000..aaa64418 --- /dev/null +++ b/alembic/versions/6a6c0be09f_add_transferrable_until.py @@ -0,0 +1,23 @@ +"""add_transferrable_until + +Revision ID: 6a6c0be09f +Revises: 48e571c759cb +Create Date: 2016-09-13 18:12:25.445124 + +""" + +# revision identifiers, used by Alembic. +revision = '6a6c0be09f' +down_revision = '48e571c759cb' + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + + +def upgrade(): + op.add_column('item', sa.Column('transferrable_until', sa.DateTime(), nullable=True)) + + +def downgrade(): + op.drop_column('item', 'transferrable_until') diff --git a/boxoffice/models/item.py b/boxoffice/models/item.py index f25a24e3..9bb620e5 100644 --- a/boxoffice/models/item.py +++ b/boxoffice/models/item.py @@ -36,6 +36,7 @@ class Item(BaseScopedNameMixin, db.Model): assignee_details = db.Column(JsonDict, default={}, nullable=False) cancellable_until = db.Column(db.DateTime, nullable=True) + transferrable_until = db.Column(db.DateTime, nullable=True) def current_price(self): """ diff --git a/boxoffice/models/line_item.py b/boxoffice/models/line_item.py index 0a81dfa7..684c9617 100644 --- a/boxoffice/models/line_item.py +++ b/boxoffice/models/line_item.py @@ -141,6 +141,10 @@ def is_cancellable(self): return self.is_confirmed and (datetime.datetime.now() < self.item.cancellable_until if self.item.cancellable_until else True) + def is_transferrable(self): + return self.is_confirmed and (datetime.datetime.now() < self.item.transferrable_until + if self.item.transferrable_until else True) + def get_availability(cls, item_ids): """Returns a dict -> {'item_id': ('item title', 'quantity_total', 'line_item_count')}""" diff --git a/boxoffice/views/participant.py b/boxoffice/views/participant.py index d7e922ab..0ab2255d 100644 --- a/boxoffice/views/participant.py +++ b/boxoffice/views/participant.py @@ -38,6 +38,8 @@ def assign(order): db.session.commit() else: if line_item.current_assignee: + if not line_item.is_transferrable(): + return make_response(jsonify(status='error', error='ticket_not_transferrable', error_description="Ticket cannot be transferred."), 400) # Archive current assignee line_item.current_assignee.current = None new_assignee = Assignee(current=True, email=assignee_dict.get('email'), fullname=assignee_dict.get('fullname'), From 75c4da6682ce7429a18c7ea1401f6c5f7ff0d3b9 Mon Sep 17 00:00:00 2001 From: Vidya Ramakrishnan Date: Tue, 13 Sep 2016 23:06:58 +0530 Subject: [PATCH 2/9] UI changes to block transfers after a certain date. --- boxoffice/static/css/app.css | 3 ++- boxoffice/static/js/dist/bundle.js | 2 +- boxoffice/static/js/views/order.js | 10 +++++++++- boxoffice/static/sass/_layout.sass | 3 ++- boxoffice/templates/order.html | 18 +++++++++++------- boxoffice/views/order.py | 1 + boxoffice/views/participant.py | 3 ++- 7 files changed, 28 insertions(+), 12 deletions(-) diff --git a/boxoffice/static/css/app.css b/boxoffice/static/css/app.css index 03c5f2ad..47d6e43c 100644 --- a/boxoffice/static/css/app.css +++ b/boxoffice/static/css/app.css @@ -149,7 +149,8 @@ a.boxoffice-button:focus { -webkit-transition: 0.2s ease all; } -.group-input:disabled { +.group-input:disabled, +.group-input.disabled { position: relative; background-color: transparent; color: #CCC; diff --git a/boxoffice/static/js/dist/bundle.js b/boxoffice/static/js/dist/bundle.js index d9b93756..e195975d 100644 --- a/boxoffice/static/js/dist/bundle.js +++ b/boxoffice/static/js/dist/bundle.js @@ -31782,4 +31782,4 @@ var SideBarView = { exports.SideBarView = SideBarView; },{"../models/sidebar.js":6,"../templates/sidebar.html.js":17}]},{},[1]) -//# sourceMappingURL=data:application/json;base64,eyJ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oaXMpIHtcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKGZuKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICB0YXJnZXRba2V5XSA9IGZuW2tleV0uYmluZChhcmdUaGlzKTtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMoZm5ba2V5XSkubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICBiaW5kVGhpcyhmbltrZXldLCB0YXJnZXRba2V5XSwgYXJnVGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pKGMzX2NoYXJ0X2ZuLCB0aGlzLCB0aGlzKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBDaGFydEludGVybmFsKGFwaSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICAkJC5kMyA9IHdpbmRvdy5kMyA/IHdpbmRvdy5kMyA6IHR5cGVvZiByZXF1aXJlICE9PSAndW5kZWZpbmVkJyA/IHJlcXVpcmUoXCJkM1wiKSA6IHVuZGVmaW5lZDtcbiAgICAgICAgJCQuYXBpID0gYXBpO1xuICAgICAgICAkJC5jb25maWcgPSAkJC5nZXREZWZhdWx0Q29uZmlnKCk7XG4gICAgICAgICQkLmRhdGEgPSB7fTtcbiAgICAgICAgJCQuY2FjaGUgPSB7fTtcbiAgICAgICAgJCQuYXhlcyA9IHt9O1xuICAgIH1cblxuICAgIGMzLmdlbmVyYXRlID0gZnVuY3Rpb24gKGNvbmZpZykge1xuICAgICAgICByZXR1cm4gbmV3IENoYXJ0KGNvbmZpZyk7XG4gICAgfTtcblxuICAgIGMzLmNoYXJ0ID0ge1xuICAgICAgICBmbjogQ2hhcnQucHJvdG90eXBlLFxuICAgICAgICBpbnRlcm5hbDoge1xuICAgICAgICAgICAgZm46IENoYXJ0SW50ZXJuYWwucHJvdG90eXBlLFxuICAgICAgICAgICAgYXhpczoge1xuICAgICAgICAg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gICAgICAgICQkLnkuZG9tYWluKCQkLmdldFlEb21haW4oJCQuZGF0YS50YXJnZXRzLCAneScpKTtcbiAgICAgICAgJCQueTIuZG9tYWluKCQkLmdldFlEb21haW4oJCQuZGF0YS50YXJnZXRzLCAneTInKSk7XG4gICAgICAgICQkLnN1YlguZG9tYWluKCQkLnguZG9tYWluKCkpO1xuICAgICAgICAkJC5zdWJZLmRvbWFpbigkJC55LmRvbWFpbigpKTtcbiAgICAgICAgJCQuc3ViWTIuZG9tYWluKCQkLnkyLmRvbWFpbigpKTtcblxuICAgICAgICAvLyBTYXZlIG9yaWdpbmFsIHggZG9tYWluIGZvciB6b29tIHVwZGF0ZVxuICAgICAgICAkJC5vcmdYRG9tYWluID0gJCQueC5kb21haW4oKTtcblxuICAgICAgICAvLyBTZXQgaW5pdGlhbGl6ZWQgc2NhbGVzIHRvIGJydXNoIGFuZCB6b29tXG4gICAgICAgIGlmICgkJC5icnVzaCkgeyAkJC5icnVzaC5zY2FsZSgkJC5zdWJYKTsgfVxuICAgICAgICBpZiAoY29uZmlnLnpvb21fZW5hYmxlZCkgeyAkJC56b29tLnNjYWxlKCQkLngpOyB9XG5cbiAgICAgICAgLyotLSBCYXNpYyBFbGVtZW50cyAtLSovXG5cbiAgICAgICAgLy8gRGVmaW5lIHN2Z3NcbiAgICAgICAgJCQuc3ZnID0gJCQuc2VsZWN0Q2hhcnQuYXBwZW5kKFwic3ZnXCIpXG4gICAgICAgICAgICAuc3R5bGUoXCJvdmVyZmxvd1wiLCBcImhpZGRlblwiKVxuICAgICAgICAgICAgLm9uKCdtb3VzZWVudGVyJywgZnVuY3Rpb24gKCkgeyByZXR1cm4gY29uZmlnLm9ubW91c2VvdmVyLmNhbGwoJCQpOyB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZWxlYXZlJywgZnVuY3Rpb24gKCkgeyByZXR1cm4gY29uZmlnLm9ubW91c2VvdXQuY2FsbCgkJCk7IH0pO1xuXG4gICAgICAgIGlmICgkJC5jb25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2l0aW9uOiBmYWxzZSxcbiAgICAgICAgICAgICAgICB3aXRoVHJhbnNmb3JtOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uRm9yQXhpczogZmFsc2VcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQmluZCByZXNpemUgZXZlbnRcbiAgICAgICAgJCQuYmluZFJlc2l6ZSgpO1xuXG4gICAgICAgIC8vIGV4cG9ydCBlbGVtZW50IG9mIHRoZSBjaGFydFxuICAgICAgICAkJC5hcGkuZWxlbWVudCA9ICQkLnNlbGVjdENoYXJ0Lm5vZGUoKTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uc21vb3RoTGluZXMgPSBmdW5jdGlvbiAoZWwsIHR5cGUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgaWYgKHR5cGUgPT09ICdncmlkJykge1xuICAgICAgICAgICAgZWwuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGcgPSAkJC5kMy5zZWxlY3QodGhpcyksXG4gICAgICAgICAgICAgICAgICAgIHgxID0gZy5hdHRyKCd4MScpLFxuICAgICAgICAgICAgICAgICAgICB4MiA9IGcuYXR0cigneDInKSxcbiAgICAgICAgICAgICAgICAgICAgeTEgPSBnLmF0dHIoJ3kxJyksXG4gICAgICAgICAgICAgICAgICAgIHkyID0gZy5hdHRyKCd5MicpO1xuICAgICAgICAgICAgICAgIGcuYXR0cih7XG4gICAgICAgICAgICAgICAgICAgICd4MSc6IE1hdGguY2VpbCh4MSksXG4gICAgICAgICAgICAgICAgICAgICd4Mic6IE1hdGguY2VpbCh4MiksXG4gICAgICAgICAgICAgICAgICAgICd5MSc6IE1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gIH1cblxuICAgICAgICBpZiAoY29uZmlnLnpvb21fcmVzY2FsZSAmJiAhb3B0aW9ucy5mbG93KSB7XG4gICAgICAgICAgICB4RG9tYWluRm9yWm9vbSA9ICQkLngub3JnRG9tYWluKCk7XG4gICAgICAgIH1cblxuICAgICAgICAkJC55LmRvbWFpbigkJC5nZXRZRG9tYWluKHRhcmdldHNUb1Nob3csICd5JywgeERvbWFpbkZvclpvb20pKTtcbiAgICAgICAgJCQueTIuZG9tYWluKCQkLmdldFlEb21haW4odGFyZ2V0c1RvU2hvdywgJ3kyJywgeERvbWFpbkZvclpvb20pKTtcblxuICAgICAgICBpZiAoIWNvbmZpZy5heGlzX3lfdGlja192YWx1ZXMgJiYgY29uZmlnLmF4aXNfeV90aWNrX2NvdW50KSB7XG4gICAgICAgICAgICAkJC55QXhpcy50aWNrVmFsdWVzKCQkLmF4aXMuZ2VuZXJhdGVUaWNrVmFsdWVzKCQkLnkuZG9tYWluKCksIGNvbmZpZy5heGlzX3lfdGlja19jb3VudCkpO1xuICAgICAgICB9XG4gICAgICAgIGlmICghY29uZmlnLmF4aXNfeTJfdGlja192YWx1ZXMgJiYgY29uZmlnLmF4aXNfeTJfdGlja19jb3VudCkge1xuICAgICAgICAgICAgJCQueTJBeGlzLnRpY2tWYWx1ZXMoJCQuYXhpcy5nZW5lcmF0ZVRpY2tWYWx1ZXMoJCQueTIuZG9tYWluKCksIGNvbmZpZy5heGlzX3kyX3RpY2tfY291bnQpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGF4ZXNcbiAgICAgICAgJCQuYXhpcy5yZWRyYXcodHJhbnNpdGlvbnMsIGhpZGVBeGlzKTtcblxuICAgICAgICAvLyBVcGRhdGUgYXhpcyBsYWJlbFxuICAgICAgICAkJC5heGlzLnVwZGF0ZUxhYmVscyh3aXRoVHJhbnNpdGlvbik7XG5cbiAgICAgICAgLy8gc2hvdy9oaWRlIGlmIG1hbnVhbCBjdWxsaW5nIG5lZWRlZFxuICAgICAgICBpZiAoKHdpdGhVcGRhdGVYRG9tYWluIHx8IHdpdGhVcGRhdGVYQXhpcykgJiYgdGFyZ2V0c1RvU2hvdy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmIChjb25maWcuYXhpc194X3RpY2tfY3VsbGluZyAmJiB0aWNrVmFsdWVzKSB7XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMTsgaSA8IHRpY2tWYWx1ZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRpY2tWYWx1ZXMubGVuZ3RoIC8gaSA8IGNvbmZpZy5heGlzX3hfdGlja19jdWxsaW5nX21heCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJ2YWxGb3JDdWxsaW5nID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuYXhpc1ggKyAnIC50aWNrIHRleHQnKS5lYWNoKGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IHRpY2tWYWx1ZXMuaW5kZXhPZihlKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5zdHlsZSgnZGlzcGxheScsIGluZGV4ICUgaW50ZXJ2YWxGb3JDdWxsaW5nID8gJ25vbmUnIDogJ2Jsb2NrJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5heGlzWCArICcgLnRpY2sgdGV4dCcpLnN0eWxlKCdkaXNwbGF5JywgJ2Jsb2NrJyk7XG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0aW9ucyBkZXBlbmRpbmcgb24gdXBkYXRlZCBwYXJhbXNcbiAgICAgICAgY3ggPSAoJCQuY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmNpcmNsZVkgOiAkJC5jaXJjbGVYKS5iaW5kKCQkKTtcbiAgICAgICAgY3kgPSAoJCQuY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmNpcmNsZVggOiAkJC5jaXJjbGVZKS5iaW5kKCQkKTtcblxuICAgICAgICBpZiAob3B0aW9ucy5mbG93KSB7XG4gICAgICAgICAgICBmbG93ID0gJCQuZ2VuZXJhdGVGbG93KHtcbiAgICAgICAgICAgICAgICB0YXJnZXRzOiB0YXJnZXRzVG9TaG93LFxuICAgICAgICAgICAgICAgIGZsb3c6IG9wdGlvbnMuZmxvdyxcbiAgICAgICAgICAgICAgICBkdXJhdGlvbjogb3B0aW9ucy5mbG93LmR1cmF0aW9uLFxuICAgICAgICAgICAgICAgIGRyYXdCYXI6IGRyYXdCYXIsXG4gICAgICAgICAgICAgICAgZHJhd0xpbmU6IGRyYXdMaW5lLFxuICAgICAgICAgICAgICAgIGRyYXdBcmVhOiBkcmF3QXJlYSxcbiAgICAgICAgICAgICAgICBjeDogY3gsXG4gICAgICAgICAgICAgICAgY3k6IGN5LFxuICAgICAgICAgICAgICAgIHh2OiB4dixcbiAgICAgICAgICAgICAgICB4Rm9yVGV4dDogeEZvclRleHQsXG4gICAgICAgICAgICAgICAgeUZvclRleHQ6IHlGb3JUZXh0XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgoZHVyYXRpb24gfHwgZmxvdykgJiYgJCQuaXNUYWJWaXNpYmxlKCkpIHsgLy8gT25seSB1c2UgdHJhbnNpdGlvbiBpZiB0YWIgdmlzaWJsZS4gU2VlICM5MzguXG4gICAgICAgICAgICAvLyB0cmFuc2l0aW9uIHNob3VsZCBiZSBkZXJpdmVkIGZyb20gb25lIHRyYW5zaXRpb25cbiAgICAgICAgICAgIGQzLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbikuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRyYW5zaXRpb25zVG9XYWl0ID0gW107XG5cbiAgICAgICAgICAgICAgICAvLyByZWRyYXcgYW5kIGdhdGhlciB0cmFuc2l0aW9uc1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3QmFyKGRyYXdCYXIsIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdMaW5lKGRyYXdMaW5lLCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3QXJlYShkcmF3QXJlYSwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0NpcmNsZShjeCwgY3ksIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdUZXh0KHhGb3JUZXh0LCB5Rm9yVGV4dCwgb3B0aW9ucy5mbG93LCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3UmVnaW9uKHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdHcmlkKHRydWUpLFxuICAgICAgICAgICAgICAgIF0uZm9yRWFjaChmdW5jdGlvbiAodHJhbnNpdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAodHJhbnNpdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbnNUb1dhaXQucHVzaCh0cmFuc2l0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAvLyBXYWl0IGZvciBlbmQgb2YgdHJhbnNpdGlvbnMgdG8gY2FsbCBmbG93IGFuZCBvbnJlbmRlcmVkIGNhbGxiYWNrXG4gICAgICAgICAgICAgICAgd2FpdEZvckRyYXcgPSAkJC5nZW5lcmF0ZVdhaXQoKTtcbiAgICAgICAgICAgICAgICB0cmFuc2l0aW9uc1RvV2FpdC5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgIHdhaXRGb3JEcmF3LmFkZCh0KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2FsbCh3YWl0Rm9yRHJhdywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmIChmbG93KSB7XG4gICAgICAgICAgICAgICAgICAgIGZsb3coKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5vbnJlbmRlcmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5vbnJlbmRlcmVkLmNhbGwoJCQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgJCQucmVkcmF3QmFyKGRyYXdCYXIpO1xuICAgICAgICAgICAgJCQucmVkcmF3TGluZShkcmF3TGluZSk7XG4gICAgICAgICAgICAkJC5yZWRyYXdBcmVhKGRyYXdBcmVhKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0NpcmNsZShjeCwgY3kpO1xuICAgICAgICAgICAgJCQucmVkcmF3VGV4dCh4Rm9yVGV4dCwgeUZvclRleHQsIG9wdGlvbnMuZmxvdyk7XG4gICAgICAgICAgICAkJC5yZWRyYXdSZWdpb24oKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0dyaWQoKTtcbiAgICAgICAgICAgIGlmIChjb25maWcub25yZW5kZXJlZCkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5vbnJlbmRlcmVkLmNhbGwoJCQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gdXBkYXRlIGZhZGVpbiBjb25k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CQudXBkYXRlU2NhbGVzKCk7XG4gICAgICAgICQkLnVwZGF0ZVN2Z1NpemUoKTtcbiAgICAgICAgJCQudHJhbnNmb3JtQWxsKGZhbHNlKTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ub2JzZXJ2ZUluc2VydGVkID0gZnVuY3Rpb24gKHNlbGVjdGlvbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBvYnNlcnZlcjtcbiAgICAgICAgaWYgKHR5cGVvZiBNdXRhdGlvbk9ic2VydmVyID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgd2luZG93LmNvbnNvbGUuZXJyb3IoXCJNdXRhdGlvbk9ic2VydmVyIG5vdCBkZWZpbmVkLlwiKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBvYnNlcnZlcj0gbmV3IE11dGF0aW9uT2JzZXJ2ZXIoZnVuY3Rpb24gKG11dGF0aW9ucykge1xuICAgICAgICAgICAgbXV0YXRpb25zLmZvckVhY2goZnVuY3Rpb24gKG11dGF0aW9uKSB7XG4gICAgICAgICAgICAgICAgaWYgKG11dGF0aW9uLnR5cGUgPT09ICdjaGlsZExpc3QnICYmIG11dGF0aW9uLnByZXZpb3VzU2libGluZykge1xuICAgICAgICAgICAgICAgICAgICBvYnNlcnZlci5kaXNjb25uZWN0KCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gd2FpdCBmb3IgY29tcGxldGlvbiBvZiBsb2FkIGJlY2F1c2Ugc2l6ZSBjYWxjdWxhdGlvbiByZXF1aXJlcyB0aGUgYWN0dWFsIHNpemVzIGRldGVybWluZWQgYWZ0ZXIgdGhhdCBjb21wbGV0aW9uXG4gICAgICAgICAgICAgICAgICAgICQkLmludGVydmFsRm9yT2JzZXJ2ZUluc2VydGVkID0gd2luZG93LnNldEludGVydmFsKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHBhcmVudE5vZGUgd2lsbCBOT1QgYmUgbnVsbCB3aGVuIGNvbXBsZXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGVjdGlvbi5ub2RlKCkucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jbGVhckludGVydmFsKCQkLmludGVydmFsRm9yT2JzZXJ2ZUluc2VydGVkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC51cGRhdGVEaW1lbnNpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJCQuYnJ1c2gpIHsgJCQuYnJ1c2gudXBkYXRlKCk7IH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcub25pbml0LmNhbGwoJCQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhUcmFuc2Zvcm06IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFRyYW5zaXRpb246IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVHJhbnNpdGlvbkZvclRyYW5zZm9ybTogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhMZWdlbmQ6IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb24udHJhbnNpdGlvbigpLnN0eWxlKCdvcGFjaXR5JywgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0sIDEwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIG9ic2VydmVyLm9ic2VydmUoc2VsZWN0aW9uLm5vZGUoKSwge2F0dHJpYnV0ZXM6IHRydWUsIGNoaWxkTGlzdDogdHJ1ZSwgY2hhcmFjdGVyRGF0YTogdHJ1ZX0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5iaW5kUmVzaXplID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG5cbiAgICAgICAgJCQucmVzaXplRnVuY3Rpb24gPSAkJC5nZW5lcmF0ZVJlc2l6ZSgpO1xuXG4gICAgICAgICQkLnJlc2l6ZUZ1bmN0aW9uLmFkZChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBjb25maWcub25yZXNpemUuY2FsbCgkJCk7XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoY29uZmlnLnJlc2l6ZV9hdXRvKSB7XG4gICAgICAgICAgICAkJC5yZXNpemVGdW5jdGlvbi5hZGQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICgkJC5yZXNpemVUaW1lb3V0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNsZWFyVGltZW91dCgkJC5yZXNpemVUaW1lb3V0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQucmVzaXplVGltZW91dCA9IHdpbmRvdy5zZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlICQkLnJlc2l6ZVRpbWVvdXQ7XG4gICAgICAgICAgICAgICAgICAgICQkLmFwaS5mbHVzaCgpO1xuICAgICAgICAgICAgICAgIH0sIDEwMCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgIC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AgIHJldHVybiBjYWxsUmVzaXplRnVuY3Rpb25zO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5lbmRhbGwgPSBmdW5jdGlvbiAodHJhbnNpdGlvbiwgY2FsbGJhY2spIHtcbiAgICAgICAgdmFyIG4gPSAwO1xuICAgICAgICB0cmFuc2l0aW9uXG4gICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoKSB7ICsrbjsgfSlcbiAgICAgICAgICAgIC5lYWNoKFwiZW5kXCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoIS0tbikgeyBjYWxsYmFjay5hcHBseSh0aGlzLCBhcmd1bWVudHMpOyB9XG4gICAgICAgICAgICB9KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlV2FpdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHRyYW5zaXRpb25zVG9XYWl0ID0gW10sXG4gICAgICAgICAgICBmID0gZnVuY3Rpb24gKHRyYW5zaXRpb24sIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRpbWVyID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZG9uZSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25zVG9XYWl0LmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0LmVtcHR5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lICs9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0LnRyYW5zaXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lICs9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZG9uZSA9PT0gdHJhbnNpdGlvbnNUb1dhaXQubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjaykgeyBjYWxsYmFjaygpOyB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LCAxMCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICBmLmFkZCA9IGZ1bmN0aW9uICh0cmFuc2l0aW9uKSB7XG4gICAgICAgICAgICB0cmFuc2l0aW9uc1RvV2FpdC5wdXNoKHRyYW5zaXRpb24pO1xuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gZjtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucGFyc2VEYXRlID0gZnVuY3Rpb24gKGRhdGUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgcGFyc2VkRGF0ZTtcbiAgICAgICAgaWYgKGRhdGUgaW5zdGFuY2VvZiBEYXRlKSB7XG4gICAgICAgICAgICBwYXJzZWREYXRlID0gZGF0ZTtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZGF0ZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHBhcnNlZERhdGUgPSAkJC5kYXRhVGltZUZvcm1hdCgkJC5jb25maWcuZGF0YV94Rm9ybWF0KS5wYXJzZShkYXRlKTtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZGF0ZSA9PT0gJ251bWJlcicgJiYgIWlzTmFOKGRhdGUpKSB7XG4gICAgICAgICAgICBwYXJzZWREYXRlID0gbmV3IERhdGUoK2RhdGU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4uZ2V0RGVmYXVsdENvbmZpZyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGNvbmZpZyA9IHtcbiAgICAgICAgICAgIGJpbmR0bzogJyNjaGFydCcsXG4gICAgICAgICAgICBzdmdfY2xhc3NuYW1lOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBzaXplX3dpZHRoOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBzaXplX2hlaWdodDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGFkZGluZ19sZWZ0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwYWRkaW5nX3JpZ2h0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwYWRkaW5nX3RvcDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGFkZGluZ19ib3R0b206IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHJlc2l6ZV9hdXRvOiB0cnVlLFxuICAgICAgICAgICAgem9vbV9lbmFibGVkOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb21fZXh0ZW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICB6b29tX3ByaXZpbGVnZWQ6IGZhbHNlLFxuICAgICAgICAgICAgem9vbV9yZXNjYWxlOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb21fb256b29tOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHpvb21fb256b29tc3RhcnQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgem9vbV9vbnpvb21lbmQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgem9vbV94X21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgem9vbV94X21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgaW50ZXJhY3Rpb25fYnJpZ2h0ZW46IHRydWUsXG4gICAgICAgICAgICBpbnRlcmFjdGlvbl9lbmFibGVkOiB0cnVlLFxuICAgICAgICAgICAgb25tb3VzZW92ZXI6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25tb3VzZW91dDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbnJlc2l6ZTogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbnJlc2l6ZWQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25pbml0OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9ucmVuZGVyZWQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgdHJhbnNpdGlvbl9kdXJhdGlvbjogMzUwLFxuICAgICAgICAgICAgZGF0YV94OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX3hzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfeEZvcm1hdDogJyVZLSVtLSVkJyxcbiAgICAgICAgICAgIGRhdGFfeExvY2FsdGltZTogdHJ1ZSxcbiAgICAgICAgICAgIGRhdGFfeFNvcnQ6IHRydWUsXG4gICAgICAgICAgICBkYXRhX2lkQ29udmVydGVyOiBmdW5jdGlvbiAoaWQpIHsgcmV0dXJuIGlkOyB9LFxuICAgICAgICAgICAgZGF0YV9uYW1lczoge30sXG4gICAgICAgICAgICBkYXRhX2NsYXNzZXM6IHt9LFxuICAgICAgICAgICAgZGF0YV9ncm91cHM6IFtdLFxuICAgICAgICAgICAgZGF0YV9heGVzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfdHlwZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV90eXBlczoge30sXG4gICAgICAgICAgICBkYXRhX2xhYmVsczoge30sXG4gICAgICAgICAgICBkYXRhX29yZGVyOiAnZGVzYycsXG4gICAgICAgICAgICBkYXRhX3JlZ2lvbnM6IHt9LFxuICAgICAgICAgICAgZGF0YV9jb2xvcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV9jb2xvcnM6IHt9LFxuICAgICAgICAgICAgZGF0YV9oaWRlOiBmYWxzZSxcbiAgICAgICAgICAgIGRhdGFfZmlsd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pdGVtX3RpbGVfaGVpZ2h0OiAxMCxcbiAgICAgICAgICAgIC8vIGF4aXNcbiAgICAgICAgICAgIGF4aXNfcm90YXRlZDogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3hfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90eXBlOiAnaW5kZXhlZCcsXG4gICAgICAgICAgICBheGlzX3hfbG9jYWx0aW1lOiB0cnVlLFxuICAgICAgICAgICAgYXhpc194X2NhdGVnb3JpZXM6IFtdLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfY2VudGVyZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfdGlja19jdWxsaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2N1bGxpbmdfbWF4OiAxMCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2NvdW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfdGlja19maXQ6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfdGlja192YWx1ZXM6IG51bGwsXG4gICAgICAgICAgICBheGlzX3hfdGlja19yb3RhdGU6IDAsXG4gICAgICAgICAgICBheGlzX3hfdGlja19vdXRlcjogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX211bHRpbGluZTogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX3dpZHRoOiBudWxsLFxuICAgICAgICAgICAgYXhpc194X21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X3BhZGRpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc194X2hlaWdodDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X2V4dGVudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X2xhYmVsOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeV9zaG93OiB0cnVlLFxuICAgICAgICAgICAgYXhpc195X3R5cGU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9pbnZlcnRlZDogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3lfY2VudGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfaW5uZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9sYWJlbDoge30sXG4gICAgICAgICAgICBheGlzX3lfdGlja19mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX291dGVyOiB0cnVlLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdmFsdWVzOiBudWxsLCAgICAgICAgXG4gICAgICAgICAgICBheGlzX3lfdGlja19yb3RhdGU6IDAsXG4gICAgICAgICAgICBheGlzX3lfdGlja19jb3VudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdGltZV92YWx1ZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdGltZV9pbnRlcnZhbDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3BhZGRpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc195X2RlZmF1bHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3kyX21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfaW52ZXJ0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc195Ml9jZW50ZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfaW5uZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfbGFiZWw6IHt9LFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX291dGVyOiB0cnVlLFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX3ZhbHVlczogbnVsbCxcbiAgICAgICAgICAgIGF4aXNfeTJfdGlja19jb3VudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9wYWRkaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeTJfZGVmYXVsdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gZ3JpZFxuICAgICAgICAgICAgZ3JpZF94X3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgZ3JpZF94X3R5cGU6ICd0aWNrJyxcbiAgICAgICAgICAgIGdyaWRfeF9saW5lczogW10sXG4gICAgICAgICAgICBncmlkX3lfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICAvLyBub3QgdXNlZFxuICAgICAgICAgICAgLy8gZ3JpZF95X3R5cGU6ICd0aWNrJyxcbiAgICAgICAgICAgIGdyaWRfeV9saW5lczogW10sXG4gICAgICAgICAgICBncmlkX3lfdGlja3M6IDEwLFxuICAgICAgICAgICAgZ3JpZF9mb2N1c19zaG93OiB0cnVlLFxuICAgICAgICAgICAgZ3JpZF9saW5lc19mcm9udDogdHJ1ZSxcbiAgICAgICAgICAgIC8vIHBvaW50IC0gcG9pbnQgb2YgZWFjaCBkYXRhXG4gICAgICAgICAgICBwb2ludF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgcG9pbnRfcjogMi41LFxuICAgICAgICAgICAgcG9pbnRfc2Vuc2l0aXZpdHk6IDEwLFxuICAgICAgICAgICAgcG9pbnRfZm9jdXNfZXhwYW5kX2VuYWJsZWQ6IHRydWUsXG4gICAgICAgICAgICBwb2ludF9mb2N1c19leHBhbmRfcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcG9pbnRfc2VsZWN0X3I6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vIGxpbmVcbiAgICAgICAgICAgIGxpbmVfY29ubmVjdE51bGw6IGZhbHNlLFxuICAgICAgICAgICAgbGluZV9zdGVwX3R5cGU6ICdzdGVwJyxcbiAgICAgICAgICAgIC8vIGJhclxuICAgICAgICAgICAgYmFyX3dpZHRoOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBiYXJfd2lkdGhfcmF0aW86IDAuNixcbiAgICAgICAgICAgIGJhcl93aWR0aF9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGJhcl96ZXJvYmFzZWQ6IHRydWUsXG4gICAgICAgICAgICAvLyBhcmVhXG4gICAgICAgICAgICBhcmVhX3plcm9iYXNlZDogdHJ1ZSxcbiAgICAgICAgICAgIGFyZWFfYWJvdmU6IGZhbHNlLFxuICAgICAgICAgICAgLy8gcGllXG4gICAgICAgICAgICBwaWVfbGFiZWxfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIHBpZV9sYWJlbF9mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBpZV9sYWJlbF90aHJlc2hvbGQ6IDAuMDUsXG4gICAgICAgICAgICBwaWVfbGFiZWxfcmF0aW86IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBpZV9leHBhbmQ6IHt9LFxuICAgICAgICAgICAgcGllX2V4cGFuZF9kdXJhdGlvbjogNTAsXG4gICAgICAgICAgICAvLyBnYXVnZVxuICAgICAgICAgICAgZ2F1Z2VfZnVsbENpcmNsZTogZmFsc2UsXG4gICAgICAgICAgICBnYXVnZV9sYWJlbF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgZ2F1Z2VfbGFiZWxfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBnYXVnZV9taW46IDAsXG4gICAgICAgICAgICBnYXVnZV9tYXg6IDEwMCxcbiAgICAgICAgICAgIGdhdWdlX3N0YXJ0aW5nQW5nbGU6IC0xICogTWF0aC5QSS8yLFxuICAgICAgICAgICAgZ2F1Z2VfdW5pdHM6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGdhdWdlX3dpZHRoOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBnYXVnZV9leHBhbmQ6IHt9LFxuICAgICAgICAgICAgZ2F1Z2VfZXhwYW5kX2R1cmF0aW9uOiA1MCxcbiAgICAgICAgICAgIC8vIGRvbnV0XG4gICAgICAgICAgICBkb251dF9sYWJlbF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgZG9udXRfbGFiZWxfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkb251dF9sYWJlbF90aHJlc2hvbGQ6IDAuMDUsXG4gICAgICAgICAgICBkb251dF9sYWJlbF9yYXRpbzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZG9udXRfd2lkdGg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRvbnV0X3RpdGxlOiBcIlwiLFxuICAgICAgICAgICAgZG9udXRfZXhwYW5kOiB7fSxcbiAgICAgICAgICAgIGRvbnV0X2V4cGFuZF9kdXJhdGlvbjogNTAsXG4gICAgICAgICAgICAvLyBzcGxpbmVcbiAgICAgICAgICAgIHNwbGluZV9pbnRlcnBvbGF0aW9uX3R5cGU6ICdjYXJkaW5hbCcsXG4gICAgICAgICAgICAvLyByZWdpb24gLSByZWdpb24gdG8gY2hhbmdlIHN0eWxlXG4gICAgICAgICAgICByZWdpb25zOiBbXSxcbiAgICAgICAgICAgIC8vIHRvb2x0aXAgLSBzaG93IHdoZW4gbW91c2VvdmVyIG9uIGVhY2ggZGF0YVxuICAgICAgICAgICAgdG9vbHRpcF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgdG9vbHRpcF9ncm91cGVkOiB0cnVlLFxuICAgICAgICAgICAgdG9vbHRpcF9mb3JtYXRfdGl0bGU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHRvb2x0aXBfZm9ybWF0X25hbWU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHRvb2x0aXBfZm9ybWF0X3ZhbHVlOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB0b29sdGlwX3Bvc2l0aW9uOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB0b29sdGlwX2NvbnRlbnRzOiBmdW5jdGlvbiAoZCwgZGVmYXVsdFRpdGxlRm9ybWF0LCBkZWZhdWx0VmFsdWVGb3JtYXQsIGNvbG9yKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0VG9vbHRpcENvbnRlbnQgPyB0aGlzLmdldFRvb2x0aXBDb250ZW50KGQsIGRlZmF1bHRUaXRsZUZvcm1hdCwgZGVmYXVsdFZhbHVlRm9ybWF0LCBjb2xvcikgOiAnJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB0b29sdGlwX2luaXRfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICB0b29sdGlwX2luaXRfeDogMCxcbiAgICAgICAgICAgIHRvb2x0aXBfaW5pdF9wb3NpdGlvbjoge3RvcDogJzBweCcsIGxlZnQ6ICc1MHB4J30sXG4gICAgICAgICAgICB0b29sdGlwX29uc2hvdzogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB0b29sdGlwX29uaGlkZTogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICAvLyB0aXRsZVxuICAgICAgICAgICAgdGl0bGVfdGV4dDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgdGl0bGVfcGFkZGluZzoge1xuICAgICAgICAgICAgICAgIHRvcDogMCxcbiAgICAgICAgICAgICAgICByaWdodDogMCxcbiAgICAgICAgICAgICAgICBib3R0b206IDAsXG4gICAgICAgICAgICAgICAgbGVmdDogMFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHRpdGxlX3Bvc2l0aW9uOiAndG9wLWNlbnRlcicsXG4gICAgICAgIH07XG5cbiAgICAgICAgT2JqZWN0LmtleXModGhpcy5hZGRpdGlvbmFsQ29uZmlnKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgIGNvbmZpZ1trZXldID0gdGhpcy5hZGRpdGlvbmFsQ29uZmlnW2tleV07XG4gICAgICAgIH0sIHRoaXMpO1xuXG4gICAgICAgIHJldHVybiBjb25maWc7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5hZGRpdGlvbmFsQ29uZmlnID0ge307XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5sb2FkQ29uZmlnID0gZnVuY3Rpb24gKGNvbmZpZykge1xuICAgICAgICB2YXIgdGhpc19jb25maWcgPSB0aGlzLmNvbmZpZywgdGFyZ2V0LCBrZXlzLCByZWFkO1xuICAgICAgICBmdW5jdGlvbiBmaW5kKCkge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXMuc2hpZnQoKTtcbiAgICAvLyAgICAgICAgY29uc29sZS5sb2coXCJrZXkgPT5cIiwga2V5LCBcIiwgdGFyZ2V0ID0+XCIsIHRhcmdldCk7XG4gICAgICAgICAgICBpZiAoa2V5ICYmIHRhcmdldCAmJiB0eXBlb2YgdGFyZ2V0ID09PSAnb2JqZWN0JyAmJiBrZXkgaW4gdGFyZ2V0KSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0ID0gdGFyZ2V0W2tleV07XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKCFrZXkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGFyZ2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBPYmplY3Qua2V5cyh0aGlzX2NvbmZpZykuZm9yRWFjaCh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4gICAgICAgICAgICBzY2FsZSA9IGZ1bmN0aW9uIChkLCByYXcpIHtcbiAgICAgICAgICAgICAgICB2YXIgdiA9IF9zY2FsZShkKSArIG9mZnNldChkKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmF3ID8gdiA6IE1hdGguY2VpbCh2KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzY2FsZSA9IGZ1bmN0aW9uIChkLCByYXcpIHtcbiAgICAgICAgICAgICAgICB2YXIgdiA9IF9zY2FsZShkKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmF3ID8gdiA6IE1hdGguY2VpbCh2KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgLy8gZGVmaW5lIGZ1bmN0aW9uc1xuICAgICAgICBmb3IgKGtleSBpbiBfc2NhbGUpIHtcbiAgICAgICAgICAgIHNjYWxlW2tleV0gPSBfc2NhbGVba2V5XTtcbiAgICAgICAgfVxuICAgICAgICBzY2FsZS5vcmdEb21haW4gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gX3NjYWxlLmRvbWFpbigpO1xuICAgICAgICB9O1xuICAgICAgICAvLyBkZWZpbmUgY3VzdG9tIGRvbWFpbigpIGZvciBjYXRlZ29yaXplZCBheGlzXG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIHNjYWxlLmRvbWFpbiA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgZG9tYWluID0gdGhpcy5vcmdEb21haW4oKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtkb21haW5bMF0sIGRvbWFpblsxXSArIDFdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBfc2NhbGUuZG9tYWluKGRvbWFpbik7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luZSBiYXNlSWRcbiAgICAgICAgICAgICAgICBpZHNJbkdyb3VwID0gY29uZmlnLmRhdGFfZ3JvdXBzW2pdLmZpbHRlcihmdW5jdGlvbiAoaWQpIHsgcmV0dXJuIGlkcy5pbmRleE9mKGlkKSA+PSAwOyB9KTtcbiAgICAgICAgICAgICAgICBpZiAoaWRzSW5Hcm91cC5sZW5ndGggPT09IDApIHsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICBiYXNlSWQgPSBpZHNJbkdyb3VwWzBdO1xuICAgICAgICAgICAgICAgIC8vIENvbnNpZGVyIG5lZ2F0aXZlIHZhbHVlc1xuICAgICAgICAgICAgICAgIGlmIChoYXNOZWdhdGl2ZVZhbHVlICYmIHlzW2Jhc2VJZF0pIHtcbiAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXS5mb3JFYWNoKGZ1bmN0aW9uICh2LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldID0gdiA8IDAgPyB2IDogMDtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIENvbXB1dGUgbWluXG4gICAgICAgICAgICAgICAgZm9yIChrID0gMTsgayA8IGlkc0luR3JvdXAubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBpZHNJbkdyb3VwW2tdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISB5c1tpZF0pIHsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICAgICAgeXNbaWRdLmZvckVhY2goZnVuY3Rpb24gKHYsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkJC5heGlzLmdldElkKGlkKSA9PT0gJCQuYXhpcy5nZXRJZChiYXNlSWQpICYmIHlzW2Jhc2VJZF0gJiYgIShoYXNOZWdhdGl2ZVZhbHVlICYmICt2ID4gMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB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250aW51ZTsgfVxuICAgICAgICAgICAgICAgIGJhc2VJZCA9IGlkc0luR3JvdXBbMF07XG4gICAgICAgICAgICAgICAgLy8gQ29uc2lkZXIgcG9zaXRpdmUgdmFsdWVzXG4gICAgICAgICAgICAgICAgaWYgKGhhc1Bvc2l0aXZlVmFsdWUgJiYgeXNbYmFzZUlkXSkge1xuICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdLmZvckVhY2goZnVuY3Rpb24gKHYsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF1baV0gPSB2ID4gMCA/IHYgOiAwO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gQ29tcHV0ZSBtYXhcbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDwgaWRzSW5Hcm91cC5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IGlkc0luR3JvdXBba107XG4gICAgICAgICAgICAgICAgICAgIGlmICghIHlzW2lkXSkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgICAgICB5c1tpZF0uZm9yRWFjaChmdW5jdGlvbiAodiwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmF4aXMuZ2V0SWQoaWQpID09PSAkJC5heGlzLmdldElkKGJhc2VJZCkgJiYgeXNbYmFzZUlkXSAmJiAhKGhhc1Bvc2l0aXZlVmFsdWUgJiYgK3YgPCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF1baV0gKz0gK3Y7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gJCQuZDMubWF4KE9iamVjdC5rZXlzKHlzKS5tYXAoZnVuY3Rpb24gKGtle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tcbiAgICAgICAgICAgIGlmIChpc0FsbFBvc2l0aXZlKSB7IHlEb21haW5NaW4gPSAwOyB9XG4gICAgICAgICAgICBpZiAoaXNBbGxOZWdhdGl2ZSkgeyB5RG9tYWluTWF4ID0gMDsgfVxuICAgICAgICB9XG5cbiAgICAgICAgZG9tYWluTGVuZ3RoID0gTWF0aC5hYnMoeURvbWFpbk1heCAtIHlEb21haW5NaW4pO1xuICAgICAgICBwYWRkaW5nID0gcGFkZGluZ190b3AgPSBwYWRkaW5nX2JvdHRvbSA9IGRvbWFpbkxlbmd0aCAqIDAuMTtcblxuICAgICAgICBpZiAodHlwZW9mIGNlbnRlciAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHlEb21haW5BYnMgPSBNYXRoLm1heChNYXRoLmFicyh5RG9tYWluTWluKSwgTWF0aC5hYnMoeURvbWFpbk1heCkpO1xuICAgICAgICAgICAgeURvbWFpbk1heCA9IGNlbnRlciArIHlEb21haW5BYnM7XG4gICAgICAgICAgICB5RG9tYWluTWluID0gY2VudGVyIC0geURvbWFpbkFicztcbiAgICAgICAgfVxuICAgICAgICAvLyBhZGQgcGFkZGluZyBmb3IgZGF0YSBsYWJlbFxuICAgICAgICBpZiAoc2hvd0hvcml6b250YWxEYXRhTGFiZWwpIHtcbiAgICAgICAgICAgIGxlbmd0aHMgPSAkJC5nZXREYXRhTGFiZWxMZW5ndGgoeURvbWFpbk1pbiwgeURvbWFpbk1heCwgJ3dpZHRoJyk7XG4gICAgICAgICAgICBkaWZmID0gZGlmZkRvbWFpbigkJC55LnJhbmdlKCkpO1xuICAgICAgICAgICAgcmF0aW8gPSBbbGVuZ3Roc1swXSAvIGRpZmYsIGxlbmd0aHNbMV0gLyBkaWZmXTtcbiAgICAgICAgICAgIHBhZGRpbmdfdG9wICs9IGRvbWFpbkxlbmd0aCAqIChyYXRpb1sxXSAvICgxIC0gcmF0aW9bMF0gLSByYXRpb1sxXSkpO1xuICAgICAgICAgICAgcGFkZGlu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XMsIGZ1bmN0aW9uICh2KSB7IHJldHVybiB2Lng7IH0pOyB9KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFhEb21haW5NYXggPSBmdW5jdGlvbiAodGFyZ2V0cykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIHJldHVybiBpc0RlZmluZWQoY29uZmlnLmF4aXNfeF9tYXgpID9cbiAgICAgICAgICAgICgkJC5pc1RpbWVTZXJpZXMoKSA/IHRoaXMucGFyc2VEYXRlKGNvbmZpZy5heGlzX3hfbWF4KSA6IGNvbmZpZy5heGlzX3hfbWF4KSA6XG4gICAgICAgICQkLmQzLm1heCh0YXJnZXRzLCBmdW5jdGlvbiAodCkgeyByZXR1cm4gJCQuZDMubWF4KHQudmFsdWVzLCBmdW5jdGlvbiAodikgeyByZXR1cm4gdi54OyB9KTsgfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRYRG9tYWluUGFkZGluZyA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgZGlmZiA9IGRvbWFpblsxXSAtIGRvbWFpblswXSxcbiAgICAgICAgICAgIG1heERhdGFDb3VudCwgcGFkZGluZywgcGFkZGluZ0xlZnQsIHBhZGRpbmdSaWdodDtcbiAgICAgICAgaWYgKCQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgcGFkZGluZyA9IDA7XG4gICAgICAgIH0gZWxzZSBpZiAoJCQuaGFzVHlwZSgnYmFyJykpIHtcbiAgICAgICAgICAgIG1heERhdGFDb3VudCA9ICQkLmdldE1heERhdGFDb3VudCgpO1xuICAgICAgICAgICAgcGFkZGluZyA9IG1heERhdGFDb3VudCA+IDEgPyAoZGlmZiAvIChtYXhEYXRhQ291bnQgLSAxKSkgLyAyI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tYWluWzBdLCBsYXN0WCA9IHhEb21haW5bMV0sXG4gICAgICAgICAgICBwYWRkaW5nID0gJCQuZ2V0WERvbWFpblBhZGRpbmcoeERvbWFpbiksXG4gICAgICAgICAgICBtaW4gPSAwLCBtYXggPSAwO1xuICAgICAgICAvLyBzaG93IGNlbnRlciBvZiB4IGRvbWFpbiBpZiBtaW4gYW5kIG1heCBhcmUgdGhlIHNhbWVcbiAgICAgICAgaWYgKChmaXJzdFggLSBsYXN0WCkgPT09IDAgJiYgISQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgZmlyc3RYID0gbmV3IERhdGUoZmlyc3RYLmdldFRpbWUoKSAqIDAuNSk7XG4gICAgICAgICAgICAgICAgbGFzdFggPSBuZXcgRGF0ZShsYXN0WC5nZXRUaW1lKCkgKiAxLjUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBmaXJzdFggPSBmaXJzdFggPT09IDAgPyAxIDogKGZpcnN0WCAqIDAuNSk7XG4gICAgICAgICAgICAgICAgbGFzdFggPSBsYXN0WCA9PT0gMCA/IC0xIDogKGxhc3RYICogMS41KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoZmlyc3RYIHx8IGZpcnN0WCA9PT0gMCkge1xuICAgICAgICAgICAgbWluID0gJCQuaXNUaW1lU2VyaWVzKCkgPyBuZXcgRGF0ZShmaXJzdFguZ2V0VGltZSgpIC0gcGFkZGluZy5sZWZ0KSA6IGZpcnN0WCAtIHBhZGRpbmcubGVmdDtcbiAgICAgICAgfVxuICAgICAgICBpZiAobGFzdFggfHwgbGFzdFggPT09IDApIHtcbiAgICAgICAgICAgIG1heCA9ICQkLmlzVGltZVNlcmllcygpID8gbmV3IERhdGUobGFzdFguZ2V0VGltZSgpICsgcGFkZGluZy5yaWdodCkgOiBsYXN0WCArIHBhZGRpbmcucmlnaHQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFttaW4sIG1heF07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVYRG9tYWluID0gZnVuY3Rpb24gKHRhcmdldHMsIHdpdGhVcGRhdGVYRG9tYWluLCB3aXRoVXBkYXRlT3JnWERvbWFpbiwgd2l0aFRyaW0sIGRvbWFpbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG5cbiAgICAgICAgaWYgKHdpdGhVcGRhdGVPcmdYRG9tYWluKSB7XG4gICAgICAgICAgICAkJC54LmRvbWFpbihkb21haW4gPyBkb21haW4gOiAkJC5kMy5leHRlbnQoJCQuZ2V0WERvbWFpbih0YXJnZXRzKSkpO1xuICAgICAgICAgICAgJCQub3JnWERvbWFpbiA9ICQkLnguZG9tYWluKCk7XG4gICAgICAgICAgICBpZiAoY29uZmlnLnpvb21fZW5hYmxlZCkgeyAkJC56b29tLnNjYWxlKCQkLngpLnVwZGF0ZVNjYWxlRXh0ZW50KCk7IH1cbiAgICAgICAgICAgICQkLnN1YlguZG9tYWluKCQkLnguZG9tYWluKCkpO1xuICAgICAgICAgICAgaWYgKCQkLmJydXNoKSB7ICQkLmJydXNoLnNjYWxlKCQkLnN1YlgpOyB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHdpdGhVcGRhdGVYRG9tYWluKSB7XG4gICAgICAgICAgICAkJC54LmRvbWFpbihkb21haW4gPyBkb21haW4gOiAoISQkLmJydXNoIHx8ICQkLmJydXNoLmVtcHR5KCkpID8gJCQub3JnWERvbWFpbiA6ICQkLmJydXNoLmV4dGVudCgpKTtcbiAgICAgICAgICAgIGlmIChjb25maWcuem9vbV9lbmFibGVkKSB7ICQkLnpvb20uc2NhbGUoJCQueCkudXBkYXRlU2NhbGVFeHRlbnQoKTsgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gVHJpbSBkb21haW4gd2hlbiB0b28gYmlnIGJ5IHpvb20gbW91c2Vtb3ZlIGV2ZW50XG4gICAgICAgIGlmICh3aXRoVHJpbSkgeyAkJC54LmRvbWFpbigkJC50cmltWERvbWFpbigkJC54Lm9yZ0RvbWFpbigpKSk7IH1cblxuICAgICAgICByZXR1cm4gJCQueC5kb21haW4oKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnRyaW1YRG9tYWluID0gZnVuY3Rpb24gKGRvbWFpbikge1xuICAgICAgICB2YXIgem9vbURvbWFpbiA9IHRoaXMuZ2V0Wm9vbURvbWFpbigpLFxuICAgICAgICAgICAgbWluID0gem9vbURvbWFpblswXSwgbWF4ID0gem9vbURvbWFpblsxXTtcbiAgICAgICAgaWYgKGRvbWFpblswXSA8PSBtaW4pIHtcbiAgICAgICAgICAgIGRvbWFpblsxXSA9ICtkb21haW5bMV0gKyAobWluIC0gZG9tYWluWzBdKTtcbiAgICAgICAgICAgIGRvbWFpblswXSA9IG1pbjtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWF4IDw9IGRvbWFpblsxXSkge1xuICAgICAgICAgICAgZG9tYWluWzBdID0gK2RvbWFpblswXSAtIChkb21haW5bMV0gLSBtYXgpO1xuICAgICAgICAgICAgZG9tYWluWzFdID0gbWF4O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkb21haW47XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmlzWCA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gKGNvbmZpZy5kYXRhX3ggJiYga2V5ID09PSBjb25maWcuZGF0YV94KSB8fCAobm90RW1wdHkoY29uZmlnLmRhdGFfeHMpICYmIGhhc1ZhbHVlKGNvbmZpZy5kYXRhX3hzLCBrZXkpKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLml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AgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHggPSBpbmRleDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geDtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNsb25lVGFyZ2V0ID0gZnVuY3Rpb24gKHRhcmdldCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgaWQgOiB0YXJnZXQuaWQsXG4gICAgICAgICAgICBpZF9vcmcgOiB0YXJnZXQuaWRfb3JnLFxuICAgICAgICAgICAgdmFsdWVzIDogdGFyZ2V0LnZhbHVlcy5tYXAoZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4ge3g6IGQueCwgdmFsdWU6IGQudmFsdWUsIGlkOiBkLmlkfTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVYcyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgaWYgKCQkLmRhdGEudGFyZ2V0cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICQkLnhzID0gW107XG4gICAgICAgICAgICAkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgICAgICAkJC54c1t2LmluZGV4XSA9IHYueDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRQcmV2WCA9IGZ1bmN0aW9uIChpKSB7XG4gICAgICAgIHZhciB4ID0gdGhpcy54c1tpIC0gMV07XG4gICAgICAgIHJldHVybiB0eXBlb2YgeCAhPT0gJ3VuZGVmaW5lZCcgPyB4IDogbnVsbDtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldE5leHRYID0gZnVuY3Rpb24gKGkpIHtcbiAgIC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geXMgPSB7fTtcbiAgICAgICAgdGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICB5c1t0LmlkXSA9IFtdO1xuICAgICAgICAgICAgdC52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgIHlzW3QuaWRdLnB1c2godi52YWx1ZSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB5cztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNoZWNrVmFsdWVJblRhcmdldHMgPSBmdW5jdGlvbiAodGFyZ2V0cywgY2hlY2tlcikge1xuICAgICAgICB2YXIgaWRzID0gT2JqZWN0LmtleXModGFyZ2V0cyksIGksIGosIHZhbHVlcztcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFsdWVzID0gdGFyZ2V0c1tpZHNbaV1dLnZhbHVlcztcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCB2YWx1ZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoY2hlY2tlcih2YWx1ZXNbal0udmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5oYXNOZWdhdGl2ZVZhbHVlSW5UYXJnZXRzID0gZnVuY3Rpb24gKHRhcmdldHMpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY2hlY2tWYWx1ZUluVGFyZ2V0cyh0YXJnZXRzLCBmdW5jdGlvbiAodikgeyByZXR1cm4gdiA8IDA7IH0pO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4u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7XG4gICAgICAgIHJldHVybiB0YXJnZXRzLm1hcChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBpZDogdC5pZCxcbiAgICAgICAgICAgICAgICBpZF9vcmc6IHQuaWRfb3JnLFxuICAgICAgICAgICAgICAgIHZhbHVlczogdC52YWx1ZXMuZmlsdGVyKGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB4RG9tYWluWzBdIDw9IHYueCAmJiB2LnggPD0geERvbWFpblsxXTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5oYXNEYXRhTGFiZWwgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBjb25maWcgPSB0aGlzLmNvbmZpZztcbiAgICAgICAgaWYgKHR5cGVvZiBjb25maWcuZGF0YV9sYWJlbHMgPT09ICdib29sZWFuJyAmJiBjb25maWcuZGF0YV9sYWJlbHMpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBjb25maWcuZGF0YV9sYWJlbHMgPT09ICdvYmplY3QnICYmIG5vdEVtcHR5KGNvbmZpZy5kYXRhX2xhYmVscykpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldERhdGFMYWJlbExlbmd0aCA9IGZ1bmN0aW9uIChtaW4sIG1heCwga2V5KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBsZW5ndGhzID0gWzAsIDBdLCBwYWRkaW5nQ29lZiA9IDEuMztcbiAgICAgICAgJCQuc2VsZWN0Q2hhcnQuc2VsZWN0KCdzdmcnKS5zZWxl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ICAgICAgICAgICB2YXIgZDtcbiAgICAgICAgICAgIGlmICghZGF0YSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihlcnJvci5yZXNwb25zZVVSTCArICcgJyArIGVycm9yLnN0YXR1cyArICcgKCcgKyBlcnJvci5zdGF0dXNUZXh0ICsgJyknKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0eXBlID09PSAnanNvbicpIHtcbiAgICAgICAgICAgICAgICBkID0gJCQuY29udmVydEpzb25Ub0RhdGEoSlNPTi5wYXJzZShkYXRhLnJlc3BvbnNlKSwga2V5cyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICd0c3YnKSB7XG4gICAgICAgICAgICAgICAgZCA9ICQkLmNvbnZlcnRUc3ZUb0RhdGEoZGF0YS5yZXNwb25zZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGQgPSAkJC5jb252ZXJ0Q3N2VG9EYXRhKGRhdGEucmVzcG9uc2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZG9uZS5jYWxsKCQkLCBkKTtcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0WHN2VG9EYXRhID0gZnVuY3Rpb24gKHhzdiwgcGFyc2VyKSB7XG4gICAgICAgIHZhciByb3dzID0gcGFyc2VyLnBhcnNlUm93cyh4c3YpLCBkO1xuICAgICAgICBpZiAocm93cy5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgIGQgPSBbe31dO1xuICAgICAgICAgICAgcm93c1swXS5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgICAgIGRbMF1baWRdID0gbnVsbDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZCA9IHBhcnNlci5wYXJzZSh4c3YpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydENzdlRvRGF0YSA9IGZ1bmN0aW9uIChjc3YpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY29udmVydFhzdlRvRGF0YShjc3YsIHRoaXMuZDMuY3N2KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRUc3ZUb0RhdGEgPSBmdW5jdGlvbiAodHN2KSB7XG4gICAgICAgIHJldHVybiB0aGlzLmNvbnZlcnRYc3ZUb0RhdGEodHN2LCB0aGlzLmQzLnRzdik7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0SnNvblRvRGF0YSA9IGZ1bmN0aW9uIChqc29uLCBrZXlzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBuZXdfcm93cyA9IFtdLCB0YXJnZXRLZXlzLCBkYXRhO1xuICAgICAgICBpZiAoa2V5cykgeyAvLyB3aGVuIGtleXMgc3BlY2lmaWVkLCBqc29uIHdvdWxkIGJlIGFuIGFycmF5IHRoYXQgaW5jbHVkZXMgb2JqZWN0c1xuICAgICAgICAgICAgaWYgKGtleXMueCkge1xuICAgICAgICAgICAgICAgIHRhcmdldEtleXMgPSBrZXlzLnZhbHVlLmNvbmNhdChrZXlzLngpO1xuICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX3ggPSBrZXlzLng7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRhcmdldEtleXMgPSBrZXlzLnZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmV3X3Jvd3MucHVzaCh0YXJnZXRLZXlzKTtcbiAgICAgICAgICAgIGpzb24uZm9yRWFjaChmdW5jdGlvbiAobykge1xuICAgICAgICAgICAgICAgIHZhciBuZXdfcm93ID0gW107XG4gICAgICAgICAgICAgICAgdGFyZ2V0S2V5cy5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gY29udmVydCB1bmRlZmluZWQgdG8gbnVsbCBiZWNhdXNlIHVuZGVmaW5lZCBkYXRhIHdpbGwgYmUgcmVtb3ZlZCBpbiBjb252ZXJ0RGF0YVRvVGFyZ2V0cygpXG4gICAgICAgICAgICAgICAgICAgIHZhciB2ID0gJCQuZmluZFZhbHVlSW5Kc29uKG8sIGtleSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZCh2KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdiA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbmV3X3Jvdy5wdXNoKHYpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIG5ld19yb3dzLnB1c2gobmV3X3Jvdyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGRhdGEgPSAkJC5jb252ZXJ0Um93c1RvRGF0YShuZXdfcm93cyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhqc29uKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICBuZXdfcm93cy5wdXNoKFtrZXldLmNvbmNhdChqc29uW2tleV0pKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRDb2x1bW5zVG9EYXRhKG5ld19yb3dzKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZGF0YTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmZpbmRWYWx1ZUluSnNvbiA9IGZ1bmN0aW9uIChvYmplY3QsIHBhdGgpIHtcbiAgICAgICAgcGF0aCA9IHBhdGgucmVwbGFjZSgvXFxbKFxcdyspXFxdL2csICcuJDEnKTsgLy8gY29udmVydCBpbmRleGVzIHRvIHByb3BlcnRpZXMgKHJlcGxhY2UgW10gd2l0aCAuKVxuICAgICAgICBwYXRoID0gcGF0aC5yZXBsYWNlKC9eXFwuLywgJycpOyAgICAgICAgICAgLy8gc3RyaXAgYSBsZWFkaW5nIGRvdFxuICAgICAgICB2YXIgcGF0aEFycmF5ID0gcGF0aC5zcGxpdCgnLicpO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBhdGhBcnJheS5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgdmFyIGsgPSBwYXRoQXJyYXlbaV07XG4gICAgICAgICAgICBpZiAoayBpbiBvYmplY3QpIHtcbiAgICAgICAgICAgICAgICBvYmplY3QgPSBvYmplY3Rba107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb2JqZWN0O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydFJvd3NUb0RhdGEgPSBmdW5jdGlvbiAocm93cykge1xuICAgICAgICB2YXIga2V5cyA9IHJvd3NbMF0sIG5ld19yb3cgPSB7fSwgbmV3X3Jvd3MgPSBbXSwgaSwgajtcbiAgICAgICAgZm9yIChpID0gMTsgaSA8IHJvd3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIG5ld19yb3cgPSB7fTtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCByb3dzW2ldLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHJvd3NbaV1bal0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlNvdXJjZSBkYXRhIGlzIG1pc3NpbmcgYSBjb21wb25lbnQgYXQgKFwiICsgaSArIFwiLFwiICsgaiArIFwiKSFcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5ld19yb3dba2V5c1tqXV0gPSByb3dzW2ldW2pdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmV3X3Jvd3MucHVzaChuZXdfcm93KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3X3Jvd3M7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0Q29sdW1uc1RvRGF0YSA9IGZ1bmN0aW9uIChjb2x1bW5zKSB7XG4gICAgICAgIHZhciBuZXdfcm93cyA9IFtdLCBpLCBqLCBrZXk7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb2x1bW5zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBrZXkgPSBjb2x1bW5zW2ldWzBdO1xuICAgICAgICAgICAgZm9yIChqID0gMTsgaiA8IGNvbHVtbnNbaV0ubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQobmV3X3Jvd3NbaiAtIDFdKSkge1xuICAgICAgICAgICAgICAgICAgICBuZXdfcm93c1tqIC0gMV0gPSB7fTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGNvbHVtbnNbaV1bal0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlNvdXJjZSBkYXRhIGlzIG1pc3NpbmcgYSBjb21wb25lbnQgYXQgKFwiICsgaSArIFwiLFwiICsgaiArIFwiKSFcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5ld19yb3dzW2ogLSAxXVtrZXldID0gY29sdW1uc1tpXVtqXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3X3Jvd3M7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0RGF0YVRvVGFyZ2V0cyA9IGZ1bmN0aW9uIChkYXRhLCBhcHBlbmRYcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBpZHMgPSAkJC5kMy5rZXlzKGRhdGFbMF0pLmZpbHRlcigkJC5pc05vdFgsICQkKSxcbiAgICAgICAgICAgIHhzID0gJCQuZDMua2V5cyhkYXRhWzBdKS5maWx0ZXIoJCQuaXNYLCAkJCksXG4gICAgICAgICAgICB0YXJnZXRzO1xuXG4gICAgICAgIC8vIHNhdmUgeCBmb3IgdXBkYXRlIGRhdGEgYnkgbG9hZCB3aGVuIGN1c3RvbSB4IGFuZCBjMy54IEFQSVxuICAgICAgICBpZHMuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgIHZhciB4S2V5ID0gJCQuZ2V0WEtleShpZCk7XG5cbiAgICAgICAgICAgIGlmICgkJC5pc0N1c3RvbVgoKSB8fCAkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgIC8vIGlmIGluY2x1ZGVkIGluIGlucHV0IGRhdGFcbiAgICAgICAgICAgICAgICBpZiAoeHMuaW5kZXhPZih4S2V5KSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmRhdGEueHNbaWRdID0gKGFwcGVuZFhzICYmICQkLmRhdGEueHNbaWRdID8gJCQuZGF0YS54c1tpZF0gOiBbXSkuY29uY2F0KFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGRbeEtleV07IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihpc1ZhbHVlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoZnVuY3Rpb24gKHJhd1gsIGkpIHsgcmV0dXJuICQkLmdlbmVyYXRlVGFyZ2V0WChyYXdYLCBpZCwgaSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIG5vdCBpbmNsdWRlZCBpbiBpbnB1dCBkYXRhLCBmaW5kIGZyb20gcHJlbG9hZGVkIGRhdGEgb2Ygb3RoZXIgaWQncyB4XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoY29uZmlnLmRhdGFfeCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9ICQkLmdldE90aGVyVGFyZ2V0WHMoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gaWYgbm90IGluY2x1ZGVkIGluIGlucHV0IGRhdGEsIGZpbmQgZnJvbSBwcmVsb2FkZWQgZGF0YVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKG5vdEVtcHR5KGNvbmZpZy5kYXRhX3hzKSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9ICQkLmdldFhWYWx1ZXNPZlhLZXkoeEtleSwgJCQuZGF0YS50YXJnZXRzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gTUVNTzogaWYgbm8geCBpbmNsdWRlZCwgdXNlIHNhbWUgeCBvZiBjdXJyZW50IHdpbGwgYmUgdXNlZFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9IGRhdGEubWFwKGZ1bmN0aW9uIChkLCBpKSB7IHJldHVybiBpOyB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cblxuICAgICAgICAvLyBjaGVjayB4IGlzIGRlZmluZWRcbiAgICAgICAgaWRzLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICBpZiAoISQkLmRhdGEueHNbaWRdKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd4IGlzIG5vdCBkZWZpbmVkIGZvciBpZCA9IFwiJyArIGlkICsgJ1wiLicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBjb252ZXJ0IHRvIHRhcmdldFxuICAgICAgICB0YXJnZXRzID0gaWRzLm1hcChmdW5jdGlvbiAoaWQsIGluZGV4KSB7XG4gICAgICAgICAgICB2YXIgY29udmVydGVkSWQgPSBjb25maWcuZGF0YV9pZENvbnZlcnRlcihpZCk7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIGlkOiBjb252ZXJ0ZWRJZCxcbiAgICAgICAgICAgICAgICBpZF9vcmc6IGlkLFxuICAgICAgICAgICAgICAgIHZhbHVlczogZGF0YS5tYXAoZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHhLZXkgPSAkJC5nZXRYS2V5KGlkKSwgcmF3WCA9IGRbeEtleV0sXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGRbaWRdICE9PSBudWxsICYmICFpc05hTihkW2lkXSkgPyArZFtpZF0gOiBudWxsLCB4O1xuICAgICAgICAgICAgICAgICAgICAvLyB1c2UgeCBhcyBjYXRlZ29yaWVzIGlmIGN1c3RvbSB4IGFuZCBjYXRlZ29yaXplZFxuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuaXNDdXN0b21YKCkgJiYgJCQuaXNDYXRlZ29yaXplZCgpICYmIGluZGV4ID09PSAwICYmICFpc1VuZGVmaW5lZChyYXdYKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwICYmIGkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuYXhpc194X2NhdGVnb3JpZXMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSBjb25maWcuYXhpc194X2NhdGVnb3JpZXMuaW5kZXhPZihyYXdYKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh4ID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSBjb25maWcuYXhpc194X2NhdGVnb3JpZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3hfY2F0ZWdvcmllcy5wdXNoKHJhd1gpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgeCAgPSAkJC5nZW5lcmF0ZVRhcmdldFgocmF3WCwgaWQsIGkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIG1hcmsgYXMgeCA9IHVuZGVmaW5lZCBpZiB2YWx1ZSBpcyB1bmRlZmluZWQgYW5kIGZpbHRlciB0byByZW1vdmUgYWZ0ZXIgbWFwcGVkXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChkW2lkXSkgfHwgJCQuZGF0YS54c1tpZF0ubGVuZ3RoIDw9IGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHt4OiB4LCB2YWx1ZTogdmFsdWUsIGlkOiBjb252ZXJ0ZWRJZH07XG4gICAgICAgICAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uICh2KSB7IHJldHVybiBpc0RlZmluZWQodi54KTsgfSlcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIGZpbmlzaCB0YXJnZXRzXG4gICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgdmFyIGk7XG4gICAgICAgICAgICAvLyBzb3J0IHZhbHVlcyBieSBpdHMgeFxuICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3hTb3J0KSB7XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMgPSB0LnZhbHVlcy5zb3J0KGZ1bmN0aW9uICh2MSwgdjIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHgxID0gdjEueCB8fCB2MS54ID09PSAwID8gdjEueCA6IEluZmluaXR5LFxuICAgICAgICAgICAgICAgICAgICAgICAgeDIgPSB2Mi54IHx8IHYyLnggPT09IDAgPyB2Mi54IDogSW5maW5pdHk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB4MSAtIHgyO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gaW5kZXhpbmcgZWFjaCB2YWx1ZVxuICAgICAgICAgICAgaSA9IDA7XG4gICAgICAgICAgICB0LnZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICAgICAgdi5pbmRleCA9IGkrKztcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgLy8gdGhpcyBuZWVkcyB0byBiZSBzb3J0ZWQgYmVjYXVzZSBpdHMgaW5kZXggYW5kIHZhbHVlLmluZGV4IGlzIGlkZW50aWNhbFxuICAgICAgICAgICAgJCQuZGF0YS54c1t0LmlkXS5zb3J0KGZ1bmN0aW9uICh2MSwgdjIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdjEgLSB2MjtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcblxuICAgICAgICAvLyBjYWNoZSBpbmZvcm1hdGlvbiBhYm91dCB2YWx1ZXNcbiAgICAgICAgJCQuaGFzTmVnYXRpdmVWYWx1ZSA9ICQkLmhhc05lZ2F0aXZlVmFsdWVJblRhcmdldHModGFyZ2V0cyk7XG4gICAgICAgICQkLmhhc1Bvc2l0aXZlVmFsdWUgPSAkJC5oYXNQb3NpdGl2ZVZhbHVlSW5UYXJnZXRzKHRhcmdldHMpO1xuXG4gICAgICAgIC8vIHNldCB0YXJnZXQgdHlwZXNcbiAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3R5cGUpIHtcbiAgICAgICAgICAgICQkLnNldFRhcmdldFR5cGUoJCQubWFwVG9JZHModGFyZ2V0cykuZmlsdGVyKGZ1bmN0aW9uIChpZCkgeyByZXR1cm4gISAoaWQgaW4gY29uZmlnLmRhdGFfdHlwZXMpOyB9KSwgY29uZmlnLmRhdGFfdHlwZSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBjYWNoZSBhcyBvcmlnaW5hbCBpZCBrZXllZFxuICAgICAgICB0YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICQkLmFkZENhY2hlKGQuaWRfb3JnLCBkKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIHRhcmdldHM7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmxvYWQgPSBmdW5jdGlvbiAodGFyZ2V0cywgYXJncykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICBpZiAodGFyZ2V0cykge1xuICAgICAgICAgICAgLy8gZmlsdGVyIGxvYWRpbmcgdGFyZ2V0cyBpZiBuZWVkZWRcbiAgICAgICAgICAgIGlmIChhcmdzLmZpbHRlcikge1xuICAgICAgICAgICAgICAgIHRhcmdldHMgPSB0YXJnZXRzLmZpbHRlcihhcmdzLmZpbHRlcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBzZXQgdHlwZSBpZiBhcmdzLnR5cGVzIHx8IGFyZ3MudHlwZSBzcGVjaWZpZWRcbiAgICAgICAgICAgIGlmIChhcmdzLnR5cGUgfHwgYXJncy50eXBlcykge1xuICAgICAgICAgICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdHlwZSA9IGFyZ3MudHlwZXMgJiYgYXJncy50eXBlc1t0LmlkXSA/IGFyZ3MudHlwZXNbdC5pZF0gOiBhcmdzLnR5cGU7XG4gICAgICAgICAgICAgICAgICAgICQkLnNldFRhcmdldFR5cGUodC5pZCwgdHlwZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBVcGRhdGUvQWRkIGRhdGFcbiAgICAgICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0YXJnZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChkLmlkID09PSB0YXJnZXRzW2ldLmlkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkLnZhbHVlcyA9IHRhcmdldHNbaV0udmFsdWVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0cy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgJCQuZGF0YS50YXJnZXRzID0gJCQuZGF0YS50YXJnZXRzLmNvbmNhdCh0YXJnZXRzKTsgLy8gYWRkIHJlbWFpbmVkXG4gICAgICAgIH1cblxuICAgICAgICAvLyBTZXQgdGFyZ2V0c1xuICAgICAgICAkJC51cGRhdGVUYXJnZXRzKCQkLmRhdGEudGFyZ2V0cyk7XG5cbiAgICAgICAgLy8gUmVkcmF3IHdpdGggbmV3IHRhcmdldHNcbiAgICAgICAgJCQucmVkcmF3KHt3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSwgd2l0aFVwZGF0ZVhEb21haW46IHRydWUsIHdpdGhMZWdlbmQ6IHRydWV9KTtcblxuICAgICAgICBpZiAoYXJncy5kb25lKSB7IGFyZ3MuZG9uZSgpOyB9XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5sb2FkRnJvbUFyZ3MgPSBmdW5jdGlvbiAoYXJncykge1xuICAgICAg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ZWN0IGZ1bGwgd2lkdGggKG9yIGhlaWdodClcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsICYmIG5leHRYID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmhlaWdodCA6ICQkLndpZHRoO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsKSB7IHByZXZYID0gJCQueC5kb21haW4oKVswXTsgfVxuICAgICAgICAgICAgICAgICAgICBpZiAobmV4dFggPT09IG51bGwpIHsgbmV4dFggPSAkJC54LmRvbWFpbigpWzFdOyB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE1hdGgubWF4KDAsICgkJC54KG5leHRYKSAtICQkLngocHJldlgpKSAvIDIpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcmVjdFggPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJldlggPSAkJC5nZXRQcmV2WChkLmluZGV4KSwgbmV4dFggPSAkJC5nZXROZXh0WChkLmluZGV4KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNYID0gJCQuZGF0YS54c1tkLmlkXVtkLmluZGV4XTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSB0aGlzIGlzIGEgc2luZ2xlIGRhdGEgcG9pbnQgcG9zaXRpb24gdGhlIGV2ZW50UmVjdCBhdCAwXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2WCA9PT0gbnVsbCAmJiBuZXh0WCA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAocHJldlggPT09IG51bGwpIHsgcHJldlggPSAkJC54LmRvbWFpbigpWzBdOyB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgkJC54KHRoaXNYKSArICQkLngocHJldlgpKSAvIDI7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVjdFcgPSAkJC5nZXRFdmVudFJlY3RXaWR0aCgpO1xuICAgICAgICAgICAgICAgIHJlY3RYID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLngoZC54KSAtIChyZWN0VyAvIDIpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB4ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiByZWN0WDtcbiAgICAgICAgICAgIHkgPSBjb25maWcuYXhpc19yb3RhdGVkID8gcmVjdFggOiAwO1xuICAgICAgICAgICAgdyA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC53aWR0aCA6IHJlY3RXO1xuICAgICAgICAgICAgaCA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyByZWN0VyA6ICQkLmhlaWdodDtcbiAgICAgICAgfVxuXG4gICAgICAgIGV2ZW50UmVjdFVwZGF0ZVxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJCQuY2xhc3NFdmVudC5iaW5kKCQkKSlcbiAgICAgICAgICAgIC5hdHRyKFwieFwiLCB4KVxuICAgICAgICAgICAgLmF0dHIoXCJ5XCIsIHkpXG4gICAgICAgICAgICAuYXR0cihcIndpZHRoXCIsIHcpXG4gICAgICAgICAgICAuYXR0cihcImhlaWdodFwiLCBoKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlRXZlbnRSZWN0c0ZvclNpbmdsZVggPSBmdW5jdGlvbiAoZXZlbnRSZWN0RW50ZXIpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgZDMgPSAkJC5kMywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICBldmVudFJlY3RFbnRlci5hcHBlbmQoXCJyZWN0XCIpXG4gICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsICQkLmNsYXNzRXZlbnQuYmluZCgkJCkpXG4gICAgICAgICAgICAuc3R5bGUoXCJjdXJzb3JcIiwgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2VuYWJsZWQgJiYgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgPyBcInBvaW50ZXJcIiA6IG51bGwpXG4gICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gZC5pbmRleDtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5kcmFnZ2luZyB8fCAkJC5mbG93aW5nKSB7IHJldHVybjsgfSAvLyBkbyBub3RoaW5nIHdoaWxlIGRyYWdnaW5nL2Zsb3dpbmdcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgLy8gRXhwYW5kIHNoYXBlcyBmb3Igc2VsZWN0aW9uXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZCkgeyAkJC5leHBhbmRDaXJjbGVzKGluZGV4LCBudWxsLCB0cnVlKTsgfVxuICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoaW5kZXgsIG51bGwsIHRydWUpO1xuXG4gICAgICAgICAgICAgICAgLy8gQ2FsbCBldmVudCBoYW5kbGVyXG4gICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBpbmRleCkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9vbm1vdXNlb3Zlci5jYWxsKCQkLmFwaSwgZCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gZC5pbmRleDtcbiAgICAgICAgICAgICAgICBpZiAoISQkLmNvbmZpZykgeyByZXR1cm47IH0gLy8gY2hhcnQgaXMgZGVzdHJveWVkXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICAkJC5oaWRlWEdyaWRGb2N1cygpO1xuICAgICAgICAgICAgICAgICQkLmhpZGVUb29sdGlwKCk7XG4gICAgICAgICAgICAgICAgLy8gVW5kbyBleHBhbmRlZCBzaGFwZXNcbiAgICAgICAgICAgICAgICAkJC51bmV4cGFuZENpcmNsZXMoKTtcbiAgICAgICAgICAgICAgICAkJC51bmV4cGFuZEJhcnMoKTtcbiAgICAgICAgICAgICAgICAvLyBDYWxsIGV2ZW50IGhhbmRsZXJcbiAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIGluZGV4KS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX29ubW91c2VvdXQuY2FsbCgkJC5hcGksIGQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignbW91c2Vtb3ZlJywgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWREYXRhLCBpbmRleCA9IGQuaW5kZXgsXG4gICAgICAgICAgICAgICAgICAgIGV2ZW50UmVjdCA9ICQkLnN2Zy5zZWxlY3QoJy4nICsgQ0xBU1MuZXZlbnRSZWN0ICsgJy0nICsgaW5kZXgpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCQkLmRyYWdnaW5nIHx8ICQkLmZsb3dpbmcpIHsgcmV0dXJuOyB9IC8vIGRvIG5vdGhpbmcgd2hpbGUgZHJhZ2dpbmcvZmxvd2luZ1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNTdGVwVHlwZShkKSAmJiAkJC5jb25maWcubGluZV9zdGVwX3R5cGUgPT09ICdzdGVwLWFmdGVyJyAmJiBkMy5tb3VzZSh0aGlzKVswXSA8ICQkLngoJCQuZ2V0WFZhbHVlKGQuaWQsIGluZGV4KSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5kZXggLT0gMTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBTaG93IHRvb2x0aXBcbiAgICAgICAgICAgICAgICBzZWxlY3RlZERhdGEgPSAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cykubWFwKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5hZGROYW1lKCQkLmdldFZhbHVlT25JbmRleCh0LnZhbHVlcywgaW5kZXgpKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIGlmIChjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLnNob3dUb29sdGlwKHNlbGVjdGVkRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgICQkLnNob3dYR3JpZEZvY3VzKHNlbGVjdGVkRGF0YSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy50b29sdGlwX2dyb3VwZWQgJiYgKCFjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCB8fCBjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgaW5kZXgpXG4gICAgICAgICAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKENMQVNTLkVYUEFOREVELCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50UmVjdC5zdHlsZSgnY3Vyc29yJywgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgPyAncG9pbnRlcicgOiBudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuaGlkZVRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQ2lyY2xlcyhpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQmFycyhpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQuaXNXaXRoaW5TaGFwZSh0aGlzLCBkKTtcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCAmJiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgfHwgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2lzc2VsZWN0YWJsZShkKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFJlY3Quc3R5bGUoJ2N1cnNvcicsICdwb2ludGVyJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy50b29sdGlwX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5zaG93VG9vbHRpcChbZF0sIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnNob3dYR3JpZEZvY3VzKFtkXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZCkgeyAkJC5leHBhbmRDaXJjbGVzKGluZGV4LCBkLmlkLCB0cnVlKTsgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoaW5kZXgsIGQuaWQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBkLmluZGV4O1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkgfHwgISQkLnRvZ2dsZVNoYXBlKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIGlmICgkJC5jYW5jZWxDbGljaykge1xuICAgICAgICAgICAgICAgICAgICAkJC5jYW5jZWxDbGljayA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgkJC5pc1N0ZXBUeXBlKGQpICYmIGNvbmZpZy5saW5lX3N0ZXBfdHlwZSA9PT0gJ3N0ZXAtYWZ0ZXInICYmIGQzLm1vdXNlKHRoaXMpWzBdIDwgJCQueCgkJC5nZXRYVmFsdWUoZC5pZCwgaW5kZXgpKSkge1xuICAgICAgICAgICAgICAgICAgICBpbmRleCAtPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIGluZGV4KS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCB8fCAkJC5pc1dpdGhpblNoYXBlKHRoaXMsIGQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC50b2dnbGVTaGFwZSh0aGlzLCBkLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbmNsaWNrLmNhbGwoJCQuYXBpLCBkLCB0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYWxsKFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9kcmFnZ2FibGUgJiYgJCQuZHJhZyA/IChcbiAgICAgICAgICAgICAgICAgICAgZDMuYmVoYXZpb3IuZHJhZygpLm9yaWdpbihPYmplY3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWcnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWcoZDMubW91c2UodGhpcykpOyB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnc3RhcnQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdzdGFydChkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdlbmQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdlbmQoKTsgfSlcbiAgICAgICAgICAgICAgICApIDogZnVuY3Rpb24gKCkge31cbiAgICAgICAgICAgICk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlRXZlbnRSZWN0c0Zvck11bHRpcGxlWHMgPSBmdW5jdGlvbiAoZXZlbnRSZWN0RW50ZXIpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgZDMgPSAkJC5kMywgY29uZmlnID0gJCQuY29uZmlnO1xuXG4gICAgICAgIGZ1bmN0aW9uIG1vdXNlb3V0KCkge1xuICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy5ldmVudFJlY3QpLnN0eWxlKCdjdXJzb3InLCBudWxsKTtcbiAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG4gICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgJCQudW5leHBhbmRDaXJjbGVzKCk7XG4gICAgICAgICAgICAkJC51bmV4cGFuZEJhcnMoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGV2ZW50UmVjdEVudGVyLmFwcGVuZCgncmVjdCcpXG4gICAgICAgICAgICAuYXR0cigneCcsIDApXG4gICAgICAgICAgICAuYXR0cigneScsIDApXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCAkJC53aWR0aClcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAkJC5oZWlnaHQpXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCBDTEFTUy5ldmVudFJlY3QpXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICghJCQuY29uZmlnKSB7IHJldHVybjsgfSAvLyBjaGFydCBpcyBkZXN0cm95ZWRcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIG1vdXNlb3V0KCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRhcmdldHNUb1Nob3cgPSAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cyk7XG4gICAgICAgICAgICAgICAgdmFyIG1vdXNlLCBjbG9zZXN0LCBzYW1lWERhdGEsIHNlbGVjdGVkRGF0YTtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5kcmFnZ2luZykgeyByZXR1cm47IH0gLy8gZG8gbm90aGluZyB3aGVuIGRyYWdnaW5nXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUodGFyZ2V0c1RvU2hvdykpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICAgICAgICBtb3VzZSA9IGQzLm1vdXNlKHRoaXMpO1xuICAgICAgICAgICAgICAgIGNsb3Nlc3QgPSAkJC5maW5kQ2xvc2VzdEZyb21UYXJnZXRzKHRhcmdldHNUb1Nob3csIG1vdXNlKTtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5tb3VzZW92ZXIgJiYgKCFjbG9zZXN0IHx8IGNsb3Nlc3QuaWQgIT09ICQkLm1vdXNlb3Zlci5pZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW91dC5jYWxsKCQkLmFwaSwgJCQubW91c2VvdmVyKTtcbiAgICAgICAgICAgICAgICAgICAgJCQubW91c2VvdmVyID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICghIGNsb3Nlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgbW91c2VvdXQoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICgkJC5pc1NjYXR0ZXJUeXBlKGNsb3Nlc3QpIHx8ICFjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHNhbWVYRGF0YSA9IFtjbG9zZXN0XTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzYW1lWERhdGEgPSAkJC5maWx0ZXJCeVgodGFyZ2V0c1RvU2hvdywgY2xvc2VzdC54KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBzaG93IHRvb2x0aXAgd2hlbiBjdXJzb3IgaXMgY2xvc2UgdG8gc29tZSBwb2ludFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0YSA9IHNhbWVYRGF0YS5tYXAoZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLmFkZE5hbWUoZCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoc2VsZWN0ZWREYXRhLCB0aGlzKTtcblxuICAgICAgICAgICAgICAgIC8vIGV4cGFuZCBwb2ludHNcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZENpcmNsZXMoY2xvc2VzdC5pbmRleCwgY2xvc2VzdC5pZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoY2xvc2VzdC5pbmRleCwgY2xvc2VzdC5pZCwgdHJ1ZSk7XG5cbiAgICAgICAgICAgICAgICAvLyBTaG93IHhncmlkIGZvY3VzIGxpbmVcbiAgICAgICAgICAgICAgICAkJC5zaG93WEdyaWRGb2N1cyhzZWxlY3RlZERhdGEpO1xuXG4gICAgICAgICAgICAgICAgLy8gU2hvdyBjdXJzb3IgYXMgcG9pbnRlciBpZiBwb2ludCBpcyBjbG9zZSB0byBtb3VzZSBwb3NpdGlvblxuICAgICAgICAgICAgICAgIGlmICgkJC5pc0JhclR5cGUoY2xvc2VzdC5pZCkgfHwgJCQuZGlzdChjbG9zZXN0LCBtb3VzZSkgPCBjb25maWcucG9pbnRfc2Vuc2l0aXZpdHkpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy5ldmVudFJlY3QpLnN0eWxlKCdjdXJzb3InLCAncG9pbnRlcicpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISQkLm1vdXNlb3Zlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW92ZXIuY2FsbCgkJC5hcGksIGNsb3Nlc3QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQubW91c2VvdmVyID0gY2xvc2VzdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciB0YXJnZXRzVG9TaG93ID0gJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpO1xuICAgICAgICAgICAgICAgIHZhciBtb3VzZSwgY2xvc2VzdDtcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSh0YXJnZXRzVG9TaG93KSkgeyByZXR1cm47IH1cblxuICAgICAgICAgICAgICAgIG1vdXNlID0gZDMubW91c2UodGhpcyk7XG4gICAgICAgICAgICAgICAgY2xvc2VzdCA9ICQkLmZpbmRDbG9zZXN0RnJvbVRhcmdldHModGFyZ2V0c1RvU2hvdywgbW91c2UpO1xuICAgICAgICAgICAgICAgIGlmICghIGNsb3Nlc3QpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgLy8gc2VsZWN0IGlmIHNlbGVjdGlvbiBlbmFibGVkXG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzQmFyVHlwZShjbG9zZXN0LmlkKSB8fCAkJC5kaXN0KGNsb3Nlc3QsIG1vdXNlKSA8IGNvbmZpZy5wb2ludF9zZW5zaXRpdml0eSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZXMgKyAkJC5nZXRUYXJnZXRTZWxlY3RvclN1ZmZpeChjbG9zZXN0LmlkKSkuc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgY2xvc2VzdC5pbmRleCkuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgfHwgJCQuaXNXaXRoaW5TaGFwZSh0aGlzLCBjbG9zZXN0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZVNoYXBlKHRoaXMsIGNsb3Nlc3QsIGNsb3Nlc3QuaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29uY2xpY2suY2FsbCgkJC5hcGksIGNsb3Nlc3QsIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhbGwoXG4gICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2RyYWdnYWJsZSAmJiAkJC5kcmFnID8gKFxuICAgICAgICAgICAgICAgICAgICBkMy5iZWhhdmlvci5kcmFnKCkub3JpZ2luKE9iamVjdClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZycsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZyhkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdzdGFydCcsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZ3N0YXJ0KGQzLm1vdXNlKHRoaXMpKTsgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZ2VuZCcsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZ2VuZCgpOyB9KVxuICAgICAgICAgICAgICAgICkgOiBmdW5jdGlvbiAoKSB7fVxuICAgICAgICAgICAgKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmRpc3BhdGNoRXZlbnQgPSBmdW5jdGlvbiAodHlwZSwgaW5kZXgsIG1vdXNlKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBzZWxlY3RvciA9ICcuJyArIENMQVNTLmV2ZW50UmVjdCArICghJCQuaXNNdWx0aXBsZVgoKSA/ICctJyArIGluZGV4IDogJycpLFxuICAgICAgICAgICAgZXZlbnRSZWN0ID0gJCQubWFpbi5zZWxlY3Qoc2VsZWN0b3IpLm5vZGUoKSxcbiAgICAgICAgICAgIGJveCA9IGV2ZW50UmVjdC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSxcbiAgICAgICAgICAgIHggPSBib3gubGVmdCArIChtb3VzZSA/IG1vdXNlWzBdIDogMCksXG4gICAgICAgICAgICB5ID0gYm94LnRvcCArIChtb3VzZSA/IG1vdXNlWzFdIDogMCksXG4gICAgICAgICAgICBldmVudCA9IGRvY3VtZW50LmNyZWF0ZUV2ZW50KFwiTW91c2VFdmVudHN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ICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGNlaWwxMCgkJC5nZXRBeGlzV2lkdGhCeUF4aXNJZCgneTInKSkgKyBsZWdlbmRXaWR0aE9uUmlnaHQ7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0UGFyZW50UmVjdFZhbHVlID0gZnVuY3Rpb24gKGtleSkge1xuICAgICAgICB2YXIgcGFyZW50ID0gdGhpcy5zZWxlY3RDaGFydC5ub2RlKCksIHY7XG4gICAgICAgIHdoaWxlIChwYXJlbnQgJiYgcGFyZW50LnRhZ05hbWUgIT09ICdCT0RZJykge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB2ID0gcGFyZW50LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpW2tleV07XG4gICAgICAgICAgICB9IGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgICBpZiAoa2V5ID09PSAnd2lkdGgnKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEluIElFIGluIGNlcnRhaW4gY2FzZXMgZ2V0Qm91bmRpbmdDbGllbnRSZWN0XG4gICAgICAgICAgICAgICAgICAgIC8vIHdpbGwgY2F1c2UgYW4gXCJ1bnNwZWNpZmllZCBlcnJvclwiXG4gICAgICAgICAgICAgICAgICAgIHYgPSBwYXJlbnQub2Zmc2V0V2lkdGg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmVudCA9IHBhcmVudC5wYXJlbnROb2RlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0UGFyZW50V2lkdGggPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlz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gcmV0dXJuIE1hdGgubWF4KDAsIHRoaXMueEF4aXMudGlja0ludGVydmFsKCkpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRTaGFwZUluZGljZXMgPSBmdW5jdGlvbiAodHlwZUZpbHRlcikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBpbmRpY2VzID0ge30sIGkgPSAwLCBqLCBrO1xuICAgICAgICAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cy5maWx0ZXIodHlwZUZpbHRlciwgJCQpKS5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY29uZmlnLmRhdGFfZ3JvdXBzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX2dyb3Vwc1tqXS5pbmRleE9mKGQuaWQpIDwgMCkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBjb25maWcuZGF0YV9ncm91cHNbal0ubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX2dyb3Vwc1tqXVtrXSBpbiBpbmRpY2VzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRpY2VzW2QuaWRdID0gaW5kaWNlc1tjb25maWcuZGF0YV9ncm91cHNbal1ba11dO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoaW5kaWNlc1tkLmlkXSkpIHsgaW5kaWNlc1tkLmlkXSA9IGkrKzsgfVxuICAgICAgICB9KTtcbiAgICAgICAgaW5kaWNlcy5fX21heF9fID0ga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2YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodiwgaikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2LnggPT09IGQueCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoaSBpbiB2YWx1ZXMgJiYgdmFsdWVzW2ldLnZhbHVlICogZC52YWx1ZSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgKz0gc2NhbGUodmFsdWVzW2ldLnZhbHVlKSAtIHkwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gb2Zmc2V0O1xuICAgICAgICB9O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaXNXaXRoaW5TaGFwZSA9IGZ1bmN0aW9uICh0aGF0LCBkKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBzaGFwZSA9ICQkLmQzLnNlbGVjdCh0aGF0KSwgaXNXaXRoaW47XG4gICAgICAgIGlmICghJCQuaXNUYXJnZXRUb1Nob3coZC5pZCkpIHtcbiAgICAgICAgICAgIGlzV2l0aGluID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodGhhdC5ub2RlTmFtZSA9PT0gJ2NpcmNsZScpIHtcbiAgICAgICAgICAgIGlzV2l0aGluID0gJCQuaXNTdGVwVHlwZShkKSA/ICQkLmlzV2l0aGluU3RlcCh0aGF0LCAkJC5nZXRZU2NhbGUoZC5pZCkoZC52YWx1ZSkpIDogJCQuaXNXaXRoaW5DaXJjbGUodGhhdCwgJCQucG9pbnRTZWxlY3RSKGQpICogMS41KTtcbiA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AgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWVzWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgIHgwID0geCh2YWx1ZXNbMF0ueCk7XG4gICAgICAgICAgICAgICAgICAgIHkwID0geSh2YWx1ZXNbMF0udmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwYXRoID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IFwiTSBcIiArIHkwICsgXCIgXCIgKyB4MCA6IFwiTSBcIiArIHgwICsgXCIgXCIgKyB5MDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBwYXRoID8gcGF0aCA6IFwiTSAwIDBcIjtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlR2V0TGluZVBvaW50cyA9IGZ1bmN0aW9uIChsaW5lSW5kaWNlcywgaXNTdWIpIHsgLy8gcGFydGlhbCBkdXBsaWNhdGlvbiBvZiBnZW5lcmF0ZUdldEJhclBvaW50c1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBsaW5lVGFyZ2V0c051bSA9IGxpbmVJbmRpY2VzLl9fbWF4X18gKyAxLFxuICAgICAgICAgICAgeCA9ICQkLmdldFNoYXBlWCgwLCBsaW5lVGFyZ2V0c051bSwgbGluZUluZGljZXMsICEhaXNTdWIpLFxuICAgICAgICAgICAgeSA9ICQkLmdldFNoYXBlWSghIWlzU3ViKSxcbiAgICAgICAgICAgIGxpbmVPZmZzZXQgPSAkJC5nZXRTaGFwZU9mZnNldCgkJC5pc0xpbmVUeXBlLCBsaW5lSW5kaWNlcywgISFpc1N1YiksXG4gICAgICAgICAgICB5U2NhbGUgPSBpc1N1YiA/ICQkLmdldFN1YllTY2FsZSA6ICQkLmdldFlTY2FsZTtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uI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uIChkLCB4LCB5LCBfcmVnaW9ucykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBwcmV2ID0gLTEsIGksIGosXG4gICAgICAgICAgICBzID0gXCJNXCIsIHNXaXRoUmVnaW9uLFxuICAgICAgICAgICAgeHAsIHlwLCBkeCwgZHksIGRkLCBkaWZmLCBkaWZmeDIsXG4gICAgICAgICAgICB4T2Zmc2V0ID0gJCQuaXNDYXRlZ29yaXplZCgpID8gMC41IDogMCxcbiAgICAgICAgICAgIHhWYWx1ZSwgeVZhbHVlLFxuICAgICAgICAgICAgcmVnaW9ucyA9IFtdO1xuXG4gICAgICAgIGZ1bmN0aW9uIGlzV2l0aGluUmVnaW9ucyh4LCByZWdpb25zKSB7XG4gICAgICAgICAgICB2YXIgaTtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCByZWdpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlZ2lvbnNbaV0uc3RhcnQgPCB4ICYmIHggPD0gcmVnaW9uc1tpXS5lbmQpIHsgcmV0dXJuIHRydWU7IH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENoZWNrIHN0YXJ0L2VuZCBvZiByZWdpb25zXG4gICAgICAgIGlmIChpc0RlZmluZWQoX3JlZ2lvbnMpKSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgX3JlZ2lvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICByZWdpb25zW2ldID0ge307XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKF9yZWdpb25zW2ldLnN0YXJ0KSkge1xuICAgICAgICAgICAgICAgICAgICByZWdpb25zW2ldLnN0YXJ0ID0gZFswXS54O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlZ2lvbnNbaV0uc3RhcnQgPSAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLnBhcnNlRGF0ZShfcmVnaW9uc1tpXS5zdGFydCkgOiBfcmVnaW9uc1tpXS5zdGFydDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKF9yZWdpb25zW2ldLmVuZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVnaW9uc1tpXS5lbmQgPSBkW2QubGVuZ3RoIC0gMV0ueDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZWdpb25zW2ldLmVuZCA9ICQkLmlzVGltZVNlcmllcygpID8gJCQucGFyc2VEYXRlKF9yZWdpb25zW2ldLmVuZCkgOiBfcmVnaW9uc1tpXS5lbmQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2V0IHNjYWxlc1xuICAgICAgICB4VmFsdWUgPSBjb25maWcuYXhpc19yb3RhdGVkID8gZnVuY3Rpb24gKGQpIHsgcmV0dXJuIHkoZC52YWx1ZSk7IH0gOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4geChkLngpOyB9O1xuICAgICAgICB5VmFsdWUgPSBjb25maWcuYXhpc19yb3RhdGVkID8gZnVuY3Rpb24gKGQpIHsgcmV0dXJuIHgoZC54KTsgfSA6IGZ1bmN0aW9uIChkKSB7IHJldHVybiB5KGQudmFsdWUpOyB9O1xuXG4gICAgICAgIC8vIERlZmluZSBzdmcgZ2VuZXJhdG9yIGZ1bmN0aW9uIGZvciByZWdpb25cbiAgICAgICAgZnVuY3Rpb24gZ2VuZXJhdGVNKHBvaW50cykge1xuICAgICAgICAgICAgcmV0dXJuICdNJyArIHBvaW50c1swXVswXSArICcgJyArIHBvaW50c1swXVsxXSArICcgJyArIHBvaW50c1sxXVswXSArICcgJyArIHBvaW50c1sxXVsxXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgIHNXaXRoUmVnaW9uID0gZnVuY3Rpb24gKGQwLCBkMSwgaiwgZGlmZikge1xuICAgICAgICAgICAgICAgIHZhciB4MCA9IGQwLnguZ2V0VGltZSgpLCB4X2RpZmYgPSBkMS54IC0gZDAueCxcbiAgICAgICAgICAgICAgICAgICAgeHYwID0gbmV3IERhdGUoeDAgKyB4X2RpZmYgKiBqKSxcbiAgICAgICAgICAgICAgICAgICAgeHYxID0gbmV3IERhdGUoeDAgKyB4X2RpZmYgKiAoaiArIGRpZmYpKSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzO1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeSh5cChqKSksIHgoeHYwKV0sIFt5KHlwKGogKyBkaWZmKSksIHgoeHYxKV1dO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeCh4djApLCB5KHlwKGopKV0sIFt4KHh2MSksIHkoeXAoaiArIGRpZmYpKV1dO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZ2VuZXJhdGVNKHBvaW50cyk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc1dpdGhSZWdpb24gPSBmdW5jdGlvbiAoZDAsIGQxLCBqLCBkaWZmKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBvaW50cztcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBwb2ludHMgPSBbW3koeXAoaiksIHRydWUpLCB4KHhwKGopKV0sIFt5KHlwKGogKyBkaWZmKSwgdHJ1ZSksIHgoeHAoaiArIGRpZmYpKV1dO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeCh4cChqKSwgdHJ1ZSksIHkoeXAoaikpXSwgW3goeHAoaiArIGRpZmYpLCB0cnVlKSwgeSh5cChqICsgZGlmZikpXV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBnZW5lcmF0ZU0ocG9pbnRzKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICAvLyBHZW5lcmF0ZVxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xuXG4gICAgICAgICAgICAvLyBEcmF3IGFzIG5vcm1hbFxuICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHJlZ2lvbnMpIHx8ICEgaXNXaXRoaW5SZWdpb25zKGRbaV0ueCwgcmVnaW9ucykpIHtcbiAgICAgICAgICAgICAgICBzICs9IFwiIFwiICsgeFZhbHVlKGRbaV0pICsgXCIgXCIgKyB5VmFsdWUoZFtpXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBEcmF3IHdpdGggcmVnaW9uIC8vIFRPRE86IEZpeCBmb3IgaG9yaXpvdGFsIGNoYXJ0c1xuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgeHAgPSAkJC5nZXRTY2FsZShkW2kgLSAxXS54ICsgeE9mZnNldCwgZFtpXS54ICsgeE9mZnNldCwgJCQuaXNUaW1lU2VyaWVzKCkpO1xuICAgICAgICAgICAgICAgIHlwID0gJCQuZ2V0U2NhbGUoZFtpIC0gMV0udmFsdWUsIGRbaV0udmFsdWUpO1xuXG4gICAgICAgICAgICAgICAgZHggPSB4KGRbaV0ueCkgLSB4KGRbaSAtIDFdLngpO1xuICAgICAgICAgICAgICAgIGR5ID0geShkW2ldLnZhbHVlKSAtIHkoZFtpIC0gMV0udmFsdWUpO1xuICAgICAgICAgICAgICAgIGRkID0gTWF0aC5zcXJ0KE1hdGgucG93KGR4LCAyKSArIE1hdGgucG93KGR5LCAyKSk7XG4gICAgICAgICAgICAgICAgZGlmZiA9IDIgLyBkZDtcbiAgICAgICAgICAgICAgICBkaWZmeDIgPSBkaWZmICogMjtcblxuICAgICAgICAgICAgICAgIGZvciAoaiA9IGRpZmY7IGogPD0gMTsgaiArPSBkaWZmeDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcyArPSBzV2l0aFJlZ2lvbihkW2kgLSAxXSwgZFtpXSwgaiwgZGlmZik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcHJldiA9IGRbaV0ueDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBzO1xuICAgIH07XG5cblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnVwZGF0ZUFyZWEgPSBmdW5jdGlvbiAoZHVyYXRpb25Gb3JFeGl0KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGQzID0gJCQuZDM7XG4gICAgICAgICQkLm1haW5BcmVhID0gJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuYXJlYXMpLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5hcmVhKVxuICAgICAgICAgICAgLmRhdGEoJCQubGluZURhdGEuYmluZCgkJCkpO1xuICAgICAgICAkJC5tYWluQXJlYS5lbnRlcigpLmFwcGVuZCgncGF0aCcpXG4gICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsICQkLmNsYXNzQXJlYS5iaW5kKCQkKSlcbiAgICAgICAgICAgIC5zdHlsZShcImZpbGxcIiwgJCQuY29sb3IpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIGZ1bmN0aW9uICgpIHsgJCQub3JnQXJlYU9wYWNpdHkgPSArZDMuc2VsZWN0KHRoaXMpLnN0eWxlKCdvcGFjaXR5Jyk7IHJldHVybiAwOyB9KTtcbiAgICAgICAgJCQubWFpbkFy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ldFBvaW50cyA9ICQkLmdlbmVyYXRlR2V0QmFyUG9pbnRzKGJhckluZGljZXMsIGlzU3ViKTtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICAvLyA0IHBvaW50cyB0aGF0IG1ha2UgYSBiYXJcbiAgICAgICAgICAgIHZhciBwb2ludHMgPSBnZXRQb2ludHMoZCwgaSk7XG5cbiAgICAgICAgICAgIC8vIHN3aXRjaCBwb2ludHMgaWYgYXhpcyBpcyByb3RhdGVkLCBub3QgYXBwbGljYWJsZSBmb3Igc3ViIGNoYXJ0XG4gICAgICAgICAgICB2YXIgaW5kZXhYID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDEgOiAwO1xuICAgICAgICAgICAgdmFyIGluZGV4WSA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogMTtcblxuICAgICAgICAgICAgdmFyIHBhdGggPSAnTSAnICsgcG9pbnRzWzBdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbMF1baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICdMJyArIHBvaW50c1sxXVtpbmRleFhdICsgJywnICsgcG9pbnRzWzFdW2luZGV4WV0gKyAnICcgK1xuICAgICAgICAgICAgICAgICAgICAnTCcgKyBwb2ludHNbMl1baW5kZXhYXSArICcsJyArIHBvaW50c1syXVtpbmRleFldICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgJ0wnICsgcG9pbnRzWzNdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbM11baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICd6JztcblxuICAgICAgICAgICAgcmV0dXJuIHBhdGg7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUdldEJhclBvaW50cyA9IGZ1bmN0aW9uIChiYXJJbmRpY2VzLCBpc1N1Yikge1xuICAgICAgICB2YXIgJCQgPSB0a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yZGxlc3Mgb2YgdGhlIGRvbWFpbiBpZiB2YWx1ZSBpcyBudWxsXG4gICAgICAgIGlmIChkLnZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICBpZiAoeFBvcyA+ICQkLndpZHRoKSB7XG4gICAgICAgICAgICAgICAgeFBvcyA9ICQkLndpZHRoIC0gYm94LndpZHRoO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh4UG9zIDwgMCkge1xuICAgICAgICAgICAgICAgIHhQb3MgPSA0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB4UG9zO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WUZvclRleHQgPSBmdW5jdGlvbiAocG9pbnRzLCBkLCB0ZXh0RWxlbWVudCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgYm94ID0gdGV4dEVsZW1lbnQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksXG4gICAgICAgICAgICB5UG9zO1xuICAgICAgICBpZiAoJCQuY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgeVBvcyA9IChwb2ludHNbMF1bMF0gKyBwb2ludHNbMl1bMF0gKyBib3guaGVpZ2h0ICogMC42KSAvIDI7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB5UG9zID0gcG9pbnRzWzJdWzFdO1xuICAgICAgICAgICAgaWYgKGQudmFsdWUgPCAwICB8fCAoZC52YWx1ZSA9PT0gMCAmJiAhJCQuaGFzUG9zaXRpdmVWYWx1ZSkpIHtcbiAgICAgICAgICAgICAgICB5UG9zICs9IGJveC5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzQmFyVHlwZShkKSAmJiAkJC5pc1NhZmFyaSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHlQb3MgLT0gMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB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jdEFsbChbXSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVYR3JpZCA9IGZ1bmN0aW9uICh3aXRob3V0VXBkYXRlKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMyxcbiAgICAgICAgICAgIHhncmlkRGF0YSA9ICQkLmdlbmVyYXRlR3JpZERhdGEoY29uZmlnLmdyaWRfeF90eXBlLCAkJC54KSxcbiAgICAgICAgICAgIHRpY2tPZmZzZXQgPSAkJC5pc0NhdGVnb3JpemVkKCkgPyAkJC54QXhpcy50aWNrT2Zmc2V0KCkgOiAwO1xuXG4gICAgICAgICQkLnhncmlkQXR0ciA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB7XG4gICAgICAgICAgICAneDEnOiAwLFxuICAgICAgICAgICAgJ3gyJzogJCQud2lkdGgsXG4gICAgICAgICAgICAneTEnOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4gJCQueChkKSAtIHRpY2tPZmZzZXQ7IH0sXG4gICAgICAgICAgICAneTInOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4gJCQueChkKSAtIHRpY2tPZmZzZXQ7IH1cbiAgICAgICAgfSA6IHtcbiAgICAgICAgICAgICd4MSc6IGZ1bmN0aW9uIChkKSB7IHJldHVybiAkJC54KGQpICsgdGlja09mZnNldDsgfSxcbiAgICAgICAgICAgICd4Mic6IGZ1bmN0aW9uIChkKSB7IHJldHVybiAkJC54KGQpICsgdGlja09mZnNldDsgfSxcbiAgICAgICAgICAgICd5MSc6IDAsXG4gICAgICAgICAgICAneTInOiAkJC5oZWlnaHRcbiAgICAgICAgfTtcblxuICAgICAgICAkJC54Z3JpZCA9ICQkLm1haW4uc2VsZWN0KCcuJyArIENMQVNTLnhncmlkcykuc2VsZWN0QWxsKCcuJyArIENMQVNTLnhncmlkKVxuICAgICAgICAgICAgLmRhdGEoeGdyaWREYXRhKTtcb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nVuY3Rpb24gKGQpIHsgcmV0dXJuIENMQVNTLnlncmlkTGluZSArIChkWydjbGFzcyddID8gJyAnICsgZFsnY2xhc3MnXSA6ICcnKTsgfSk7XG4gICAgICAgIHlncmlkTGluZS5hcHBlbmQoJ2xpbmUnKVxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAwKTtcbiAgICAgICAgeWdyaWRMaW5lLmFwcGVuZCgndGV4dCcpXG4gICAgICAgICAgICAuYXR0cihcInRleHQtYW5jaG9yXCIsICQkLmdyaWRUZXh0QW5jaG9yKVxuICAgICAgICAgICAgLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IFwicm90YXRlKC05MClcIiA6IFwiXCIpXG4gICAgICAgICAgICAuYXR0cignZHgnLCAkJC5ncmlkVGV4dER4KVxuICAgICAgICAgICAgLmF0dHIoJ2R5JywgLTUpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDApO1xuICAgICAgICAvLyB1cGRhdGVcbiAgICAgICAgeXYgPSAkJC55di5iaW5kKCQkKTtcbiAgICAgICAgJCQueWdyaWRMaW5lcy5zZWxlY3QoJ2xpbmUnKVxuICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pXG4gICAgICAgICAgICAuYXR0cihcIngxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB5diA6IDApXG4gICAgICAgICAgICAuYXR0cihcIngyXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB5diA6ICQkLndpZHRoKVxuICAgICAgICAgICAgLmF0dHIoXCJ5MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IHl2KVxuICAgICAgICAgICAgLmF0dHIoXCJ5MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQuaGVpZ2h0IDogeXYpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDEpO1xuICAgICAg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0aCA6IC0xMClcbiAgICAgICAgICAgIC5hdHRyKFwieTFcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IC0xMCA6IDApXG4gICAgICAgICAgICAuYXR0cihcInkyXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAtMTAgOiAkJC5oZWlnaHQpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2VuZXJhdGVHcmlkRGF0YSA9IGZ1bmN0aW9uICh0eXBlLCBzY2FsZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgZ3JpZERhdGEgPSBbXSwgeERvbWFpbiwgZmlyc3RZZWFyLCBsYXN0WWVhciwgaSxcbiAgICAgICAgICAgIHRpY2tOdW0gPSAkJC5tYWluLnNlbGVjdChcIi5cIiArIENMQVNTLmF4aXNYKS5zZWxlY3RBbGwoJy50aWNrJykuc2l6ZSgpO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ3llYXInKSB7XG4gICAgICAgICAgICB4RG9tYWluID0gJCQuZ2V0WERvbWFpbigpO1xuICAgICAgICAgICAgZmlyc3RZZWFyID0geERvbWFpblswXS5nZXRGdWxsWWVhcigpO1xuICAgICAgICAgICAgbGFzdFllYXIgPSB4RG9tYWluWzFdLmdldEZ1bGxZZWFyKCk7XG4gICAgICAgICAgICBmb3IgKGkgPSBmaXJzdFllYXI7IGkgPD0gbGFzdFllYXI7IGkrKykge1xuICAgICAgICAgICAgICAgIGdyaWREYXRhLnB1c2gobmV3IERhdGUoaSArICctMDEtMDEgMDA6MDA6MDAnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBncmlkRGF0YSA9IHNjYWxlLnRpY2tzKDEwKTtcbiAgICAgICAgICAgIGlmIChncmlkRGF0YS5sZW5ndGggPiB0aWNrTnVtKSB7IC8vIHVzZSBvbmx5IGludFxuICAgICAgICAgICAgICAgIGdyaWREYXRhID0gZ3JpZERhdG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wiLCBcImFic29sdXRlXCIpXG4gICAgICAgICAgICAuc3R5bGUoXCJwb2ludGVyLWV2ZW50c1wiLCBcIm5vbmVcIilcbiAgICAgICAgICAgIC5zdHlsZShcImRpc3BsYXlcIiwgXCJub25lXCIpO1xuICAgICAgICAvLyBTaG93IHRvb2x0aXAgaWYgbmVlZGVkXG4gICAgICAgIGlmIChjb25maWcudG9vbHRpcF9pbml0X3Nob3cpIHtcbiAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSAmJiBpc1N0cmluZyhjb25maWcudG9vbHRpcF9pbml0X3gpKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLnRvb2x0aXBfaW5pdF94ID0gJCQucGFyc2VEYXRlKGNvbmZpZy50b29sdGlwX2luaXRfeCk7XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8ICQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzW2ldLnggLSBjb25maWcudG9vbHRpcF9pbml0X3gpID09PSAwKSB7IGJyZWFrOyB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbmZpZy50b29sdGlwX2luaXRfeCA9IGk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkJC50b29sdGlwLmh0bWwoY29uZmlnLnRvb2x0aXBfY29udGVudHMuY2FsbCgkJCwgJCQuZGF0YS50YXJnZXRzLm1hcChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAkJC5hZGROYW1lKGQudmFsdWVzW2NvbmZpZy50b29sdGlwX2luaXRfeF0pO1xuICAgICAgICAgICAgfSksICQkLmF4aXMuZ2V0WEF4aXNUaWNrRm9ybWF0KCksICQkLmdldFlGb3JtYXQoJCQuaGFzQXJjVHlwZSgpKSwgJCQuY29sb3IpKTtcbiAgICAgICAgICAgICQk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sdWUgOiBudWxsO1xuICAgICAgICAgICAgICAgIHJldHVybiBvcmRlckFzYyA/IHYxIC0gdjIgOiB2MiAtIHYxO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB2YXIgaWRzID0gJCQub3JkZXJUYXJnZXRzKCQkLmRhdGEudGFyZ2V0cykubWFwKGZ1bmN0aW9uIChpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGkuaWQ7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGQuc29ydChmdW5jdGlvbihhLCBiKSB7XG4gICAgICAgICAgICAgICAgdmFyIHYxID0gYSA/IGEudmFsdWUgOiBudWxsLCB2MiA9IGIgPyBiLnZhbHVlIDogbnVsbDtcbiAgICAgICAgICAgICAgICBpZiAodjEgPiAwICYmIHYyID4gMCkge1xuICAgICAgICAgICAgICAgICAgICB2MSA9IGEgPyBpZHMuaW5kZXhPZihhLmlkKSA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIHYyID0gYiA/IGlkcy5pbmRleE9mKGIuaWQpIDogbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9yZGVyQXNjID8gdjEgLSB2MiA6IHYyIC0gdjE7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBkLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoISAoZFtpXSAmJiAoZFtpXS52YWx1ZSB8fCBkW2ldLnZhbHVlID09PSAwKSkpIHsgY29udGludWU7IH1cblxuICAgICAgICAgICAgaWYgKCEgdGV4dCkge1xuICAgICAgICAgICAgICAgIHRpdGxlID0gc2FuaXRpc2UodGl0bGVGb3JtYXQgPyB0aXRsZUZvcm1hdChkW2ldLngpIDogZFtpXS54KTtcbiAgICAgICAgICAgICAgICB0ZXh0ID0gXCI8dGFibGUgY2xhc3M9J1wiICsgJCQuQ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ICAgIH1cbiAgICAgICAgICAgICAgICBzdGVwc1tpZF0gPSBzdGVwO1xuICAgICAgICAgICAgICAgIG1hcmdpbnNbc3RlcF0gPSAkJC5pc0xlZ2VuZEluc2V0ID8gMTAgOiBtYXJnaW47XG4gICAgICAgICAgICAgICAgb2Zmc2V0c1tpZF0gPSB0b3RhbExlbmd0aDtcbiAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCArPSBpdGVtTGVuZ3RoO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAocmVzZXQpIHtcbiAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCA9IDA7XG4gICAgICAgICAgICAgICAgc3RlcCA9IDA7XG4gICAgICAgICAgICAgICAgbWF4V2lkdGggPSAwO1xuICAgICAgICAgICAgICAgIG1heEhlaWdodCA9IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChjb25maWcubGVnZW5kX3Nob3cgJiYgISQkLmlzTGVnZW5kVG9TaG93KGlkKSkge1xuICAgICAgICAgICAgICAgIHdpZHRoc1tpZF0gPSBoZWlnaHRzW2lkXSA9IHN0ZXBzW2lkXSA9IG9mZnNldHNbaWRdID0gMDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHdpZHRoc1tpZF0gPSBpdGVtV2lkdGg7XG4gICAgICAgICAgICBoZWlnaHRzW2lkXSA9IGl0ZW1IZWlnaHQ7XG5cbiAgICAgICAgICAgIGlmICghbWF4V2lkdGggfHwgaXRlbVdpZHRoID49IG1heFdpZHRoKSB7IG1heFdpZHRoID0gaXRlbVdpZHRoOyB9XG4gICAgICAgICAgICBpZiAoIW1heEhlaWdodCB8fCBpdGVtSGVpZ2h0ID49IG1heEhlaWdodCkgeyBtYXhIZWlnaHQgPSBpdGVtSGVpZ2h0OyB9XG4gICAgICAgICAgICBtYXhMZW5ndGggPSAkJC5pc0xlZ2VuZFJpZ2h0IHx8ICQkLmlzTGVnZW5kSW5zZXQgPyBtYXhIZWlnaHQgOiBtYXhXaWR0aDtcblxuICAgICAgICAgICAgaWYgKGNvbmZpZy5sZWdlbmRfZXF1YWxseSkge1xuICAgICAgICAgICAgICAgIE9iamVjdC5rZXlzKHdpZHRocykuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHsgd2lkdGhzW2lkXSA9IG1heFdpZHRoOyB9KTtcbiAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyhoZWlnaHRzKS5mb3JFYWNoKGZ1bmN0aW9uIChpZCkgeyBoZWlnaHRzW2lkXSA9IG1heEhlaWdodDsgfSk7XG4gICAgICAgICAgICAgICAgbWFyZ2luID0gKGFyZWFMZW5ndGggLSBtYXhMZW5ndGggKiB0YXJnZXRJZHMubGVuZ3RoKSAvIDI7XG4gICAgICAgICAgICAgICAgaWYgKG1hcmdpbiA8IHBvc01pbikge1xuICAgICAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHN0ZXAgPSAwO1xuICAgICAgICAgICAgICAgICAgICB0YXJnZXRJZHMuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHsgdXBkYXRlVmFsdWVzKGlkKTsgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB1cGRhdGVWYWx1ZXMoaWQsIHRydWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdXBkYXRlVmFsdWVzKGlkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgkJC5pc0xlZ2VuZEluc2V0KSB7XG4gICAgICAgICAgICBzdGVwID0gY29uZmlnLmxlZ2VuZF9pbnNldF9zdGVwID8gY29uZmlnLmxlZ2VuZF9pbnNldF9zdGVwIDogdGFyZ2V0SWRzLmxlbmd0aDtcbiAgICAgICAgICAgICQkLnVwZ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vcicsICdwb2ludGVyJylcbiAgICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmxlZ2VuZF9pdGVtX29uY2xpY2spIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmxlZ2VuZF9pdGVtX29uY2xpY2suY2FsbCgkJCwgaWQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC5kMy5ldmVudC5hbHRLZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmFwaS5oaWRlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5hcGkuc2hvdyhpZCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5hcGkudG9nZ2xlKGlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmlzVGFyZ2V0VG9TaG93KGlkKSA/ICQkLmFwaS5mb2N1cyhpZCkgOiAkJC5hcGkucmV2ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmxlZ2VuZF9pdGVtX29ubW91c2VvdmVyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5sZWdlbmRfaXRlbV9vbm1vdXNlb3Zlci5jYWxsKCQkLCBpZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAkJC5kMy5zZWxlY3QodGhpcykuY2xhc3NlZChDTEFTUy5sZWdlbmRJdGVtRm9jdXNlZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghJCQudHJhbnNpdGluZyAmJiAkJC5pc1RhcmdldFRvU2hvdyhpZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmFwaS5mb2N1cyhpZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcubGVnZW5kX2l0ZW1fb25tb3VzZW91dCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcubGVnZW5kX2l0ZW1fb25tb3VzZW91dC5jYWxsKCQkLCBpZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAkJC5kMy5zZWxlY3QodGhpcykuY2xhc3NlZChDTEFTUy5sZWdlbmRJdGVtRm9jdXNlZCwgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICAkJC5hcGkucmV2ZXJ0KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIGwuYXBwZW5kKCd0ZXh0JylcbiAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uIChpZCkgeyByZXR1cm4gaXNEZWZpbmVkKGNvbmZpZy5kYXRhX25hbWVzW2lkXSkgPyBjb25maWcuZGF0YV9uYW1lc1tpZF0gOiBpZDsgfSlcbiAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uIChpZCwgaSkgeyB1cGRhdGVQb3NpdGlvbnModGhpcywgaWQsIGkpOyB9KVxuICAgICAgICAgICAgLnN0eWxlKFwicG9pbnRlci1ldmVudHNcIiwgXCJub25lXCIpXG4gICAgICAgICAgICAuYXR0cigneCcsICQkLmlzTGVnZW5kUmlnaHQgfHwgJCQuaXNMZWdlbmRJbnNldCA/IHhGb3JMZWdlbmRUZXh0IDogLTIwMClcbiAgICAgICAgICAgIC5hdHRyKCd5JywgJCQu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ICAgICAgICAgJCQuc3ViWEF4aXMudGlja1ZhbHVlcyh0aWNrVmFsdWVzKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGlja1ZhbHVlcztcbiAgICB9O1xuICAgIEF4aXMucHJvdG90eXBlLmdldFlBeGlzID0gZnVuY3Rpb24gZ2V0WUF4aXMoc2NhbGUsIG9yaWVudCwgdGlja0Zvcm1hdCwgdGlja1ZhbHVlcywgd2l0aE91dGVyVGljaywgd2l0aG91dFRyYW5zaXRpb24sIHdpdGhvdXRSb3RhdGVUaWNrVGV4dCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLm93bmVyLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBheGlzUGFyYW1zID0ge1xuICAgICAgICAgICAgICAgIHdpdGhPdXRlclRpY2s6IHdpdGhPdXRlclRpY2ssXG4gICAgICAgICAgICAgICAgd2l0aG91dFRyYW5zaXRpb246IHdpdGhvdXRUcmFuc2l0aW9uLFxuICAgICAgICAgICAgICAgIHRpY2tUZXh0Um90YXRlOiB3aXRob3V0Um90YXRlVGlja1RleHQgPyAwIDogY29uZmlnLmF4aXNfeV90aWNrX3JvdGF0ZVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGF4aXMgPSBjM19heGlzKCQkLmQzLCBheGlzUGFyYW1zKS5zY2FsZShzY2FsZSkub3JpZW50KG9yaWVudCkudGlja0Zvcm1hdCh0aWNrRm9ybWF0KTtcbiAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllc1koKSkge1xuICAgICAgICAgICAgYXhpcy50aWNrcygkJC5kMy50aW1lW2NvbmZpZy5heGlzX3lfdGlja190aW1lX3ZhbHVlXSwgY29uZmlnLmF4aXNfeV90aWNrX3RpbWVfaW50ZXJ2YWwpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYXhpcy50aWNrVmFsdWVzKHRpY2tWYWx1ZXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBheGlzO1xu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gICAgICAgICAgICBjb3VudCA9IHRhcmdldENvdW50IC0gMjtcbiAgICAgICAgICAgICAgICBzdGFydCA9IHZhbHVlc1swXTtcbiAgICAgICAgICAgICAgICBlbmQgPSB2YWx1ZXNbdmFsdWVzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgICAgIGludGVydmFsID0gKGVuZCAtIHN0YXJ0KSAvIChjb3VudCArIDEpO1xuICAgICAgICAgICAgICAgIC8vIHJlLWNvbnN0cnVjdCB1bmlxdWUgdmFsdWVzXG4gICAgICAgICAgICAgICAgdGlja1ZhbHVlcyA9IFtzdGFydF07XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja1ZhbHVlID0gK3N0YXJ0ICsgaW50ZXJ2YWwgKiAoaSArIDEpO1xuICAgICAgICAgICAgICAgICAgICB0aWNrVmFsdWVzLnB1c2goZm9yVGltZVNlcmllcyA/IG5ldyBEYXRlKHRpY2tWYWx1ZSkgOiB0aWNrVmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aWNrVmFsdWVzLnB1c2goZW5kKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoIWZvclRpbWVTZXJpZXMpIHsgdGlja1ZhbHVlcyA9IHRpY2tWYWx1ZXMuc29ydChmdW5jdGlvbiAoYSwgYikgeyByZXR1cm4gYSAtIGI7IH0pOyB9XG4gICAgICAgIHJldHVybiB0aWNrVmFsdWVzO1xuICAgIH07XG4gICAgQXhpcy5wcm90b3R5cGUuZ2VuZXJhdGVUcmFuc2l0aW9ucyA9IGZ1bmN0aW9uIGdlbmVyYXRlVHJhbnNpdGlvbnMoZHVyYXRpb24pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5vd25lciwgYXhlcyA9ICQkLmF4ZXM7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBheGlzWDogZHVyYX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gICAgIGlmICgkJC50cmFuc2l0aW5nKSB7XG4gICAgICAgICAgICBpbnRlcnZhbCA9IHdpbmRvdy5zZXRJbnRlcnZhbChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEkJC50cmFuc2l0aW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jbGVhckludGVydmFsKGludGVydmFsKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmxlZ2VuZC5zZWxlY3RBbGwoJy5jMy1sZWdlbmQtaXRlbS1mb2N1c2VkJykuc2l6ZSgpID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuZXhwYW5kQXJjKHRhcmdldElkcyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCAxMCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB0YXJnZXRJZHMgPSAkJC5tYXBUb1RhcmdldElkcyh0YXJnZXRJZHMpO1xuXG4gICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJCQuc2VsZWN0b3JUYXJnZXRzKHRhcmdldElkcywgJy4nICsgQ0xBU1MuY2hhcnRBcmMpKS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICBpZiAoISAkJC5zaG91bGRFeHBhbmQoZC5kYXRhLmlkKSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICQkLmQzLnNlbGVjdCh0aGlzKS5zZWxlY3RBbGwoJ3BhdGgnKVxuICAgICAgICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oJCQuZXhwYW5kRHVyYXRpb24oZC5kYXRhLmlkKSlcbiAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgJCQuc3ZnQXJjRXhwYW5kZWQpXG4gICAgICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbigkJC5leHBhbmREdXJhdGlvbihkLmRhdGEu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KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcblxuICAgICAgICBpZiAoJCQuaXNEb251dFR5cGUoaWQpKSB7XG4gICAgICAgICAgICByZXR1cm4gY29uZmlnLmRvbnV0X2V4cGFuZF9kdXJhdGlvbjtcbiAgICAgICAgfSBlbHNlIGlmICgkJC5pc0dhdWdlVHlwZShpZCkpIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuZ2F1Z2VfZXhwYW5kX2R1cmF0aW9uO1xuICAgICAgICB9IGVsc2UgaWYgKCQkLmlzUGllVHlwZShpZCkpIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcucGllX2V4cGFuZF9kdXJhdGlvbjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiA1MDtcbiAgICAgICAgfVxuXG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnNob3VsZEV4cGFuZCA9IGZ1bmN0aW9uIChpZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIHJldHVybiAoJCQuaXNEb251dFR5cGUoaWQpICYmIGNvbmZpZy5kb251dF9leHBhbmQpIHx8XG4gICAgICAgICAgICAgICAoJCQuaXNHYXVnZVR5cGUoaWQpICYmIGNvbmZpZy5nYXVnZV9leHBhbmQpIHx8XG4gICAgICAgICAgICAgICAoJCQuaXNQaWVUeXBlKGlkKSAmJiBjb25maWcucGllX2V4cGFuZCk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnNob3VsZFNob3dBcmNMYWJlbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCBzaG91bGRTaG93ID0gdHJ1ZTtcbiAgICAgICAgaWYgKCQkLmhhc1R5cGUoJ2RvbnV0JykpIHtcbiAgICAgICAgICAg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ZV9zdGFydGluZ0FuZ2xlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50ID0gZDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICBtYWluQXJjXG4gICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCBmdW5jdGlvbiAoZCkgeyByZXR1cm4gISQkLmlzR2F1Z2VUeXBlKGQuZGF0YSkgJiYgd2l0aFRyYW5zZm9ybSA/IFwic2NhbGUoMClcIiA6IFwiXCI7IH0pXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIGZ1bmN0aW9uIChkKSB7IHJldHVybiBkID09PSB0aGlzLl9jdXJyZW50ID8gMCA6IDE7IH0pXG4gICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCwgYXJjRGF0YTtcbiAgICAgICAgICAgICAgICBpZiAoJCQudHJhbnNpdGluZykgeyAvLyBza2lwIHdoaWxlIHRyYW5zaXRpbmdcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCk7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIHRyYW5zaXRpb25zXG4gICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZEFyYyh1cGRhdGVkLmRhdGEuaWQpO1xuICAgICAgICAgICAgICAgICAgICAkJC5hcGkuZm9jdXModXBkYXRlZC5kYXRhLmlkKTtcbiAgICAgICAgICAgICAgICAgICAgJCQudG9nZ2xlRm9jdXNMZWdlbmQodXBkYXRlZC5kYXRhLmlkLCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25tb3VzZW92ZXIoYXJjRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSA6IG51bGwpXG4gICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpLCBhcmNEYXRhLCBzZWxlY3RlZERhdGE7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCksXG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0YSA9IFthcmNEYXRhXTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoc2VsZWN0ZWREYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IDogbnVsbClcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCA/IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQsIGFyY0RhdGE7XG4gICAgICAgICAgICAgICAgaWYgKCQkLnRyYW5zaXRpbmcpIHsgLy8gc2tpcCB3aGlsZSB0cmFuc2l0aW5nXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgICAgICAvLyB0cmFuc2l0aW9uc1xuICAgICAgICAgICAgICAgICAgICAkJC51bmV4cGFuZEFyYyh1cGRhdGVkLmRhdGEuaWQpO1xuICAgICAgICAgICAgICAgICAgICAkJC5hcGkucmV2ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnJldmVydExlZ2VuZCgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbm1vdXNlb3V0KGFyY0RhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLm9uKCdjbGljaycsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpLCBhcmNEYXRhO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQudG9nZ2xlU2hhcGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZVNoYXBlKHRoaXMsIGFyY0RhdGEsIGkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29uY2xpY2suY2FsbCgkJC5hcGksIGFyY0RhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKCkgeyAkJC50cmFuc2l0aW5nID0gdHJ1ZTsgfSlcbiAgICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pXG4gICAgICAgICAgICAuYXR0clR3ZWVuKFwiZFwiLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCksIGludGVycG9sYXRlO1xuICAgICAgICAgICAgICAgIGlmICghIHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHsgcmV0dXJuIFwiTSAwIDBcIjsgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnQgPT09IGQpIHtcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudCA9IHtcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0QW5nbGU6IE1hdGguUEkqMixcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIGVuZEFuZ2xlOiBNYXRoLlBJKjIsXG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc05hTih0aGlzLl9jdXJyZW50LnN0YXJ0QW5nbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQuc3RhcnRBbmdsZSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc05hTih0aGlzLl9jdXJyZW50LmVuZEFuZ2xlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50LmVuZEFuZ2xlID0gdGhpcy5fY3VycmVudC5zdGFydEFuZ2xlO1xuICAgICAgICAgICAgICAgIH1cbiAgICA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IFwicHhcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImR5XCIsIFwiMS4yZW1cIilcbiAgICAgICAgICAgICAgICAudGV4dChjb25maWcuZ2F1Z2VfbGFiZWxfc2hvdyA/IGNvbmZpZy5nYXVnZV9taW4gOiAnJyk7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NHYXVnZU1heClcbiAgICAgICAgICAgICAgICAuYXR0cihcImR4XCIsICQkLmlubmVyUmFkaXVzICsgKCgkJC5yYWRpdXMgLSAkJC5pbm5lclJhZGl1cykgLyAoY29uZmlnLmdhdWdlX2Z1bGxDaXJjbGUgPyAxIDogMikpICsgXCJweFwiKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiZHlcIiwgXCIxLjJlbVwiKVxuICAgICAgICAgICAgICAgIC50ZXh0KGNvbmZpZy5nYXVnZV9sYWJlbF9zaG93ID8gY29uZmlnLmdhdWdlX21heCA6ICcnKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaW5pdEdhdWdlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgYXJjcyA9IHRoaXMuYXJjcztcbiAgICAgICAgaWYgKHRoaXMuaGFzVHlwZSgnZ2F1Z2UnKSkge1xuICAgICAgICAgICAgYXJjcy5hcHBlbmQoJ3BhdGgnKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgQ0xBU1MuY2hhcnRBcmNzQmFja2dyb3VuZCk7XG4gICAgICAgICAgICBhcmNzLmFwcGVuZChcInRleHRcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIENMQVNTLmNoYXJ0QXJjc0dhdWdlVW5pdClcbiAgICAgICAgICAgICAgICAuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcIm1pZGRsZVwiKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcInBvaW50ZXItZXZlbnRz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mFuc2ZlcnJlZCB0byByZWN0IChjaGlsZCBub2RlKSBhdXRvbWF0aWNhbGx5LFxuICAgICAgICAgICAgICAgIC8vIHRoZW4gZGF0YSBvZiBlYWNoIHJlY3QgaGFzIHRvIGJlIHVwZGF0ZWQgbWFudWFsbHkuXG4gICAgICAgICAgICAgICAgLy8gVE9ETzogdGhlcmUgc2hvdWxkIGJlIG1vcmUgZWZmaWNpZW50IHdheSB0byBzb2x2ZSB0aGlzP1xuICAgICAgICAgICAgICAgIHZhciBwYXJlbnREYXRhID0gJCQuZDMuc2VsZWN0KHRoaXMucGFyZW50Tm9kZSkuZGF0dW0oKTtcbiAgICAgICAgICAgICAgICAkJC5kMy5zZWxlY3QodGhpcykuZGF0dW0ocGFyZW50RGF0YSk7XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIHggPSAkJC5yZWdpb25YLmJpbmQoJCQpLFxuICAgICAgICAgICAgeSA9ICQkLnJlZ2lvblkuYmluZCgkJCksXG4gICAgICAgICAgICB3ID0gJCQucmVnaW9uV2lkdGguYmluZCgkJCksXG4gICAgICAgICAgICBoID0gJCQucmVnaW9uSGVpZ2h0LmJpbmQoJCQpO1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgKHdpdGhUcmFuc2l0aW9uID8gcmVnaW9ucy50cmFuc2l0aW9uKCkgOiByZWdpb25zKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieFwiLCB4KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieVwiLCB5KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgdylcbiAgICAgICAgICAgICAgICAuYXR0cihcImhlaWdodFwiLCBoKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcImZpbGwtb3BhY2l0eVwiLCBmdW5jdGlvbiAoZCkgeyByZXR1cm4gaXNWYWx1ZShkLm9wYWNpdHkpID8gZC5vcGFjaXR5IDogMC4xOyB9KVxuICAgICAgICBdO1xuICAgIH07XG4gICAgYzNfY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wZXMpLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSlcbiAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9pc3NlbGVjdGFibGUoZCk7IH0pXG4gICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoZCwgaSkge1xuICAgICAgICAgICAgICAgIHZhciBzaGFwZSA9IGQzLnNlbGVjdCh0aGlzKSxcbiAgICAgICAgICAgICAgICAgICAgaXNTZWxlY3RlZCA9IHNoYXBlLmNsYXNzZWQoQ0xBU1MuU0VMRUNURUQpLFxuICAgICAgICAgICAgICAgICAgICBpc0luY2x1ZGVkID0gc2hhcGUuY2xhc3NlZChDTEFTUy5JTkNMVURFRCksXG4gICAgICAgICAgICAgICAgICAgIF94LCBfeSwgX3csIF9oLCB0b2dnbGUsIGlzV2l0aGluID0gZmFsc2UsIGJveDtcbiAgICAgICAgICAgICAgICBpZiAoc2hhcGUuY2xhc3NlZChDTEFTUy5jaXJjbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIF94ID0gc2hhcGUuYXR0cihcImN4XCIpICogMTtcbiAgICAgICAgICAgICAgICAgICAgX3kgPSBzaGFwZS5hdHRyKFwiY3lcIikgKiAxO1xuICAgICAgICAgICAgICAgICAgICB0b2dnbGUgPSAkJC50b2dnbGVQb2ludDtcbiAgICAgICAgICAgICAgICAgICAgaXNXaXRoaW4gPSBtaW5YIDwgX3ggJiYgX3ggPCBtYXhYICYmIG1pblkgPCBfeSAmJiBfeSA8IG1heFk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNoYXBlLmNsYXNzZWQoQ0xBU1MuYmFyKSkge1xuICAgICAgICAgICAgICAgICAgICBib3ggPSBnZXRQYXRoQm94KHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICBfeCA9IGJveC54O1xuICAgICAgICAgICAgICAgICAgICBfeSA9IGJveC55O1xuICAgICAgICAgICAgICAgICAgICBfdyA9IGJveC53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgX2ggPSBib3guaGVpZ2h0O1xuICAgICAgICAgICAgICAgICAgICB0b2dnbGUgPSAkJC50b2dnbGVQYXRoO1xuICAgICAgICAgICAgICAgICAgICBpc1dpdGhpbiA9ICEobWF4WCA8IF94IHx8IF94ICsgX3cgPCBtaW5YKSAmJiAhKG1heFkgPCBfeSB8fCBfeSArIF9oIDwgbWluWSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gbGluZS9hcmVhIHNlbGVjdGlvbiBub3Qgc3VwcG9ydGVkIHlldFxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc1dpdGhpbiBeIGlzSW5jbHVkZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgc2hhcGUuY2xhc3NlZChDTEFTUy5JTkNMVURFRCwgIWlzSW5jbHVkZWQpO1xuICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiBpbmNsdWRlZC91bmluY2x1ZGVkIGNhbGxiYWNrIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgc2hhcGUuY2xhc3NlZChDTEFTUy5TRUxFQ1RFRCwgIWlzU2VsZWN0ZWQpO1xuICAgICAgICAgICAgICAgICAgICB0b2dnbGUuY2FsbCgkJCwgIWlzU2VsZWN0ZWQsIHNoYXBlLCBkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZHJhZ3N0YXJ0ID0gZnVuY3Rpb24gKG1vdXNlKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cbiAgIC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4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgY2xhc3NDaGFydEJhcik7XG4gICAgICAgICAgICAvLyBCYXJzIGZvciBlYWNoIGRhdGFcbiAgICAgICAgICAgIGNvbnRleHRCYXJFbnRlci5hcHBlbmQoJ2cnKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgY2xhc3NCYXJzKTtcblxuICAgICAgICAgICAgLy8tLSBMaW5lIC0tLy9cbiAgICAgICAgICAgIGNvbnRleHRMaW5lVXBkYXRlID0gY29udGV4dC5zZWxlY3QoJy4nICsgQ0xBU1MuY2hhcnRMaW5lcykuc2VsZWN0QWxsKCcuJyArIENMQVNTLmNoYXJ0TGluZSlcbiAgICAgICAgICAgICAgICAuZGF0YSh0YXJnZXRzKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGNsYXNzQ2hhcnRMaW5lKTtcbiAgICAgICAgICAgIGNvbnRleHRMaW5lRW50ZXIgPSBjb250ZXh0TGluZVVwZGF0ZS5lbnRlcigpLmFwcGVuZCgnZycpXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMClcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCBjbGFzc0NoYXJ0TGluZSk7XG4gICAgICAgICAgICAvLyBMaW5lcyBmb3IgZWFjaCBkYXRhXG4gICAgICAgICAgICBjb250ZXh0TGluZUVudGVyLmFwcGVuZChcImdcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIGNsYXNzTGluZXMpO1xuICAgICAgICAgICAgLy8gQXJlYVxuICAgICAgICAgICAgY29udGV4dExpbmVFbnRlci5hcHBlbmQoXCJnXCIpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJjbGFzc1wiLCBjbGFzc0FyZWFzKTtcblxuICAgICAgICAgICAgLy8tLSBCcnVzaCAtLS8vXG4gICAgICAgICAgICBjb250ZXh0LnNlbGVjdEFsbCgnLicgKyBDTEFTUy5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hd0xpbmVPblN1YjtcblxuICAgICAgICAkJC5jb250ZXh0LnN0eWxlKCd2aXNpYmlsaXR5JywgY29uZmlnLnN1YmNoYXJ0X3Nob3cgPyAndmlzaWJsZScgOiAnaGlkZGVuJyk7XG5cbiAgICAgICAgLy8gc3ViY2hhcnRcbiAgICAgICAgaWYgKGNvbmZpZy5zdWJjaGFydF9zaG93KSB7XG4gICAgICAgICAgICAvLyByZWZsZWN0IG1haW4gY2hhcnQgdG8gZXh0ZW50IG9uIHN1YmNoYXJ0IGlmIHpvb21lZFxuICAgICAgICAgICAgaWYgKGQzLmV2ZW50ICYmIGQzLmV2ZW50LnR5cGUgPT09ICd6b29tJykge1xuICAgICAgICAgICAgICAgICQkLmJydXNoLmV4dGVudCgkJC54Lm9yZ0RvbWFpbigpKS51cGRhdGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIHVwZGF0ZSBzdWJjaGFydCBlbGVtZW50cyBpZiBuZWVkZWRcbiAgICAgICAgICAgIGlmICh3aXRoU3ViY2hhcnQpIHtcblxuICAgICAgICAgICAgICAgIC8vIGV4dGVudCByZWN0XG4gICAgICAgICAgICAgICAgaWYgKCEkJC5icnVzaC5lbXB0eSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmJydXNoLmV4dGVudCgkJC54Lm9yZ0RvbWFpbigpKS51cGRhdGUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gc2V0dXAgZHJhd2VyIC0gTUVNTzogdGhpcyBtdXN0IGJlIGNhbGxlZCBhZnRlciBheGlzIHVwZGF0ZWRcbiAgICAgICAgICAgICAgICBkcmF3QXJlYU9uU3ViID0gJCQuZ2VuZXJhdGVEcmF3QXJlYShhcmVhSW5kaWNlcywgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgZHJhd0Jhck9uU3ViID0gJCQuZ2VuZXJhdGVEcmF3QmFyKGJhckluZGljZXMsIHRydWUpO1xuICAgICAgICAgICAgICAgIGR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AgICAgICAgICAgICAgICBpZiAoZXZlbnQgJiYgc3RhcnRFdmVudC5jbGllbnRYID09PSBldmVudC5jbGllbnRYICYmIHN0YXJ0RXZlbnQuY2xpZW50WSA9PT0gZXZlbnQuY2xpZW50WSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLnJlZHJhd0V2ZW50UmVjdCgpO1xuICAgICAgICAgICAgICAgICQkLnVwZGF0ZVpvb20oKTtcbiAgICAgICAgICAgICAgICBjb25maWcuem9vbV9vbnpvb21lbmQuY2FsbCgkJC5hcGksICQkLngub3JnRG9tYWluKCkpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICQkLnpvb20uc2NhbGUgPSBmdW5jdGlvbiAoc2NhbGUpIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuYXhpc19yb3RhdGVkID8gdGhpcy55KHNjYWxlKSA6IHRoaXMueChzY2FsZSk7XG4gICAgICAgIH07XG4gICAgICAgICQkLnpvb20ub3JnU2NhbGVFeHRlbnQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgZXh0ZW50ID0gY29uZmlnLnpvb21fZXh0ZW50ID8gY29uZmlnLnpvb21fZXh0ZW50IDogWzEsIDEwXTtcbiAgICAgICAgICAgIHJldHVybiBbZXh0ZW50WzBdLCBNYXRoLm1heCgkJC5nZXRNYXhEYXRhQ291bnQoKSAvIGV4dGVudFsxXSwgZXh0ZW50WzFdKV07XG4gICAgICAgIH07XG4gICAgICAgICQkLnpvb20udXBkYXRlU2NhbGVFeHRlbnQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgcmF0aW8gPSBkaWZmRG9tYWluKCQkLngub3JnRG9tYWluKCkpIC8gZGlmZkRvbWFpbigkJC5nZXRab29tRG9tYWluKCkpLFxuICAgICAgICAgICAgICAgIGV4dGVudCA9IHRoaXMub3JnU2NhbGVFeHRlbnQoKTtcbiAgIC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ICAgICBpZiAoIWNvbmZpZy56b29tX2VuYWJsZWQpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChkMy5ldmVudC5zb3VyY2VFdmVudC50eXBlID09PSAnbW91c2Vtb3ZlJyAmJiB6b29tLmFsdERvbWFpbikge1xuICAgICAgICAgICAgeC5kb21haW4oem9vbS5hbHREb21haW4pO1xuICAgICAgICAgICAgem9vbS5zY2FsZSh4KS51cGRhdGVTY2FsZUV4dGVudCgpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkgJiYgeC5vcmdEb21haW4oKVswXSA9PT0gJCQub3JnWERvbWFpblswXSkge1xuICAgICAgICAgICAgeC5kb21haW4oWyQkLm9yZ1hEb21haW5bMF0gLSAxZS0xMCwgeC5vcmdEb21haW4oKVsxXV0pO1xuICAgICAgICB9XG4gICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogZmFsc2UsXG4gICAgICAgICAgICB3aXRoWTogY29uZmlnLnpvb21fcmVzY2FsZSxcbiAgICAgICAgICAgIHdpdGhTdWJjaGFydDogZmFsc2UsXG4gICAgICAgICAgICB3aXRoRXZlbnRSZWN0OiBmYWxzZSxcbiAgICAgICAgICAgIHdpdGhEaW1lbnNpb246IGZhbHNlXG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoZDMuZXZlbnQuc291cmNlRXZlbnQudHlwZSA9PT0gJ21vdXNlbW92ZScpIHtcbiAgICAgICAgICAgICQkLmNhbmNlbENsaWNrID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBjb25maWcuem9vbV9vbnpvb20uY2FsbCgkJC5hcGksIHgub3JnRG9tYWluKCkpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUNvbG9yID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDMsXG4gICAgICAgICAgICBjb2xvcnMgPSBjb25maWcuZGF0YV9jb2xvcnMsXG4gICAgICAgICAgICBwYXR0ZXJuID0gbm90RW1wdHkoY29uZmlnLmNvbG9yX3BhdHRlcm4pID8gY29uZmlnLmNvbG9yX3BhdHRlcm4gOiBkMy5zY2FsZS5jYXRlZ29yeTEwKCkucmFuZ2UoKSxcbiAgICAgICAgICAgIGNhbGxiYWNrID0gY29uZmlnLmRhdGFfY29sb3IsXG4gICAgICAgICAgICBpZHMgPSBbXTtcblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIHZhciBpZCA9IGQuaWQgfHwgKGQuZGF0YSAmJiBkLmRhdGEuaWQpIHx8IGQsIGNvbG9yO1xuXG4gICAgICAgICAgICAvLyBpZiBjYWxsYmFjayBmdW5jdGlvbiBpcyBwcm92aWRlZFxuICAgICAgICAgICAgaWYgKGNvbG9yc1tpZF0gaW5zdGFuY2VvZiBGdW5jdGlvbikge1xuICAgICAgICAgICAgICAgIGNvbG9yID0gY29sb3JzW2lkXShkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGlmIHNwZWNpZmllZCwgY2hvb3NlIHRoYXQgY29sb3JcbiAgICAgICAgICAgIGVsc2UgaWYgKGNvbG9yc1tpZF0pIHtcbiAgICAgICAgICAgICAgICBjb2xvciA9IGNvbG9yc1tpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBpZiBub3Qgc3BlY2lmaWVkLCBjaG9vc2UgZnJvbSBwYXR0ZXJuXG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAg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JZCwgb3B0aW9ucyk7XG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi56b29tID0gZnVuY3Rpb24gKGRvbWFpbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsO1xuICAgICAgICBpZiAoZG9tYWluKSB7XG4gICAgICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICBkb21haW4gPSBkb21haW4ubWFwKGZ1bmN0aW9uICh4KSB7IHJldHVybiAkJC5wYXJzZURhdGUoeCk7IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgJCQuYnJ1c2guZXh0ZW50KGRvbWFpbik7XG4gICAgICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVYRG9tYWluOiB0cnVlLCB3aXRoWTogJCQuY29uZmlnLnpvb21fcmVzY2FsZX0pO1xuICAgICAgICAgICAgJCQuY29uZmlnLnpvb21fb256b29tLmNhbGwodGhpcywgJCQueC5vcmdEb21haW4oKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICQkLmJydXNoLmV4dGVudCgpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uem9vbS5lbmFibGUgPSBmdW5jdGlvbiAoZW5hYmxlZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsO1xuICAgICAgICAkJC5jb25maWcuem9vbV9lbmFibGVkID0gZW5hYmxlZDtcbiAgICAgICAgJCQudXBkYXRlQW5kUmVkcmF3KCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi51bnpvb20gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWw7XG4gICAgICAgICQkLmJydXNoLmNsZWFyKCkudXBkYXRlKCk7XG4gICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZVhEb21haW46IHRydWV9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uem9vbS5tYXggPSBmdW5jdGlvbiAobWF4KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMztcbiAgICAgICAgaWYgKG1heCA9PT0gMCB8fCBtYXgpIHtcbiAgICAgICAgICAgIGNvbmZpZy56b29tX3hfbWF4ID0gZDMubWF4KFskJC5vcmdYRG9tYWluWzFdLCBtYXhdKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuem9vbV94X21heDtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi56b29tLm1pbiA9IGZ1bmN0aW9uIChtaW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnLCBkMyA9ICQkLmQzO1xuICAgICAgICBpZiAobWluID09PSAwIHx8IG1pbikge1xuICAgICAgICAgICAgY29uZmlnLnpvb21feF9taW4gPSBkMy5taW4oWyQkLm9yZ1hEb21haW5bMF0sIG1pbl0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGNvbmZpZy56b29tX3hfbWluO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLnpvb20ucmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHtcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQocmFuZ2UubWF4KSkgeyB0aGlzLmRvbWFpbi5tYXgocmFuZ2UubWF4KTsgfVxuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyYW5nZS5taW4pKSB7IHRoaXMuZG9tYWluLm1pbihyYW5nZS5taW4pOyB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAg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AgICAgICAgICBkYXRhQ291bnQsIGRvbWFpbiwgYmFzZVRhcmdldCwgYmFzZVZhbHVlLCBsZW5ndGggPSAwLCB0YWlsID0gMCwgZGlmZiwgdG87XG5cbiAgICAgICAgaWYgKGFyZ3MuanNvbikge1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRKc29uVG9EYXRhKGFyZ3MuanNvbiwgYXJncy5rZXlzKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChhcmdzLnJvd3MpIHtcbiAgICAgICAgICAgIGRhdGEgPSAkJC5jb252ZXJ0Um93c1RvRGF0YShhcmdzLnJvd3MpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGFyZ3MuY29sdW1ucykge1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRDb2x1bW5zVG9EYXRhKGFyZ3MuY29sdW1ucyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGFyZ2V0cyA9ICQkLmNvbnZlcnREYXRhVG9UYXJnZXRzKGRhdGEsIHRydWUpO1xuXG4gICAgICAgIC8vIFVwZGF0ZS9BZGQgZGF0YVxuICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgdmFyIGZvdW5kID0gZmFsc2UsIGksIGo7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdGFyZ2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSB0YXJnZXRzW2ldLmlkKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodC52YWx1ZXNbdC52YWx1ZXMubGVuZ3RoIC0gMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhaWwgPSB0LnZhbHVlc1t0LnZhbHVlcy5sZW5ndGggLSAxXS5pbmRleCArIDE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gdGFyZ2V0c1tpXS52YWx1ZXMubGVuZ3RoO1xuXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBsZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0c1tpXS52YWx1ZXNbal0uaW5kZXggPSB0YWlsICsgajtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRzW2ldLnZhbHVlc1tqXS54ID0gdGFpbCArIGo7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdC52YWx1ZXMgPSB0LnZhbHVlcy5jb25jYXQodGFyZ2V0c1tpXS52YWx1ZXMpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWZvdW5kKSB7IG5vdGZvdW5kSWRzLnB1c2godC5pZCk7IH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gQXBwZW5kIG51bGwgZm9yIG5vdCBmb3VuZCB0YXJnZXRzXG4gICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICB2YXIgaSwgajtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBub3Rmb3VuZElkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSBub3Rmb3VuZElkc1tpXSkge1xuICAgICAgICAgICAgICAgICAgICB0YWlsID0gdC52YWx1ZXNbdC52YWx1ZXMubGVuZ3RoIC0gMV0uaW5kZXggKyAxO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgbGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHQudmFsdWVzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0LmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiB0YWlsICsgaixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB4OiAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLmdldE90aGVyVGFyZ2V0WCh0YWlsICsgaikgOiB0YWlsICsgaixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogbnVsbFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIEdlbmVyYXRlIG51bGwgdmFsdWVzIGZvciBuZXcgdGFyZ2V0XG4gICAgICAgIGlmICgkJC5kYXRhLnRhcmdldHMubGVuZ3RoKSB7XG4gICAgICAgICAgICB0YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaSwgbWlzc2luZyA9IFtdO1xuICAgICAgICAgICAgICAgIGZvciAoaSA9ICQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXNbMF0uaW5kZXg7IGkgPCB0YWlsOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbWlzc2luZy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0LmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksXG4gICAgICAgICAgICAgICAgICAgICAgICB4OiAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLmdldE90aGVyVGFyZ2V0WChpKSA6IGksXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogbnVsbFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgICAgICB2LmluZGV4ICs9IHRhaWw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHYueCArPSB0YWlsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMgPSBtaXNzaW5nLmNvbmNhdCh0LnZhbHVlcyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAkJC5kYXRhLnRhcmdldHMgPSAkJC5kYXRhLnRhcmdldHMuY29uY2F0KHRhcmdldHMpOyAvLyBhZGQgcmVtYWluZWRcblxuICAgICAgICAvLyBjaGVjayBkYXRhIGNvdW50IGJlY2F1c2UgYmVoYXZpb3IgbmVlZHMgdG8gY2hhbmdlIHdoZW4gaXQncyBvbmx5IG9uZVxuICAgICAgICBkYXRhQ291bnQgPSAkJC5nZXRNYXhEYXRhQ291bnQoKTtcbiAgICAgICAgYmFzZVRhcmdldCA9ICQkLmRhdGEudGFyZ2V0c1swXTtcbiAgICAgICAgYmFzZVZhbHVlID0gYmFzZVRhcmdldC52YWx1ZXNbMF07XG5cbiAgICAgICAgLy8gVXBkYXRlIGxlbmd0aCB0byBmbG93IGlmIG5lZWRlZFxuICAgICAgICBpZiAoaXNEZWZpbmVkKGFyZ3MudG8pKSB7XG4gICAgICAgICAgICBsZW5ndGggPSAwO1xuICAgICAgICAgICAgdG8gPSAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLnBhcnNlRGF0ZShhcmdzLnRvKSA6IGFyZ3MudG87XG4gICAgICAgICAgICBiYXNlVGFyZ2V0LnZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICAgICAgaWYgKHYueCA8IHRvKSB7IGxlbmd0aCsrOyB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIGlmIChpc0RlZmluZWQoYXJncy5sZW5ndGgpKSB7XG4gICAgICAgICAgICBsZW5ndGggPSBhcmdzLmxlbmd0aDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIElmIG9ubHkgb25lIGRhdGEsIHVwZGF0ZSB0aGUgZG9tYWluIHRvIGZsb3cgZnJvbSBsZWZ0IGVkZ2Ugb2YgdGhlIGNoYXJ0XG4gICAgICAgIGlmICghb3JnRGF0YUNvdW50KSB7XG4gICAgICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoYmFzZVRhcmdldC52YWx1ZXMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgICAgICBkaWZmID0gYmFzZVRhcmdldC52YWx1ZXNbYmFzZVRhcmdldC52YWx1ZXMubGVuZ3RoIC0gMV0ueCAtIGJhc2VWYWx1ZS54O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGRpZmYgPSBiYXNlVmFsdWUueCAtICQkLmdldFhEb21haW4oJCQuZGF0YS50YXJnZXRzKVswXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGRpZmYgPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZG9tYWluID0gW2Jhc2VWYWx1ZS54IC0gZGlmZiwgYmFzZVZhbHVlLnhdO1xuICAgICAgICAgICAgJCQudXBkYXRlWERvbWFpbihudWxsLCB0cnVlLCB0cnVlLCBmYWxzZSwgZG9tYWluKTtcbiAgICAgICAgfSBlbHNlIGlmIChvcmdEYXRhQ291bnQgPT09IDEpIHtcbiAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgIGRpZmYgPSAoYmFzZVRhcmdldC52YWx1ZXNbYmFzZVRhcmdldC52YWx1ZXMubGVuZ3RoIC0gMV0ueCAtIGJhc2VWYWx1ZS54KSAvIDI7XG4gICAgICAgICAgICAgICAgZG9tYWluID0gW25ldyBEYXRlKCtiYXNlVmFsdWUueCAtIGRpZmYpLCBuZXcgRGF0ZSgrYmFzZVZhbHVlLnggKyBkaWZmKV07XG4gICAgICAgICAgICAgICAgJCQudXBkYXRlWERvbWFpbihudWxsLCB0cnVlLCB0cnVlLCBmYWxzZSwgZG9tYWluKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFNldCB0YXJnZXRzXG4gICAgICAgICQkLnVwZGF0ZVRhcmdldHMoJCQuZGF0YS50YXJnZXRzKTtcblxuICAgICAgICAvLyBSZWRyYXcgd2l0aCBuZXcgdGFyZ2V0c1xuICAgICAgICAkJC5yZWRyYXcoe1xuICAgICAgICAgICAgZmxvdzoge1xuICAgICAgICAgICAgICAgIGluZGV4OiBiYXNlVmFsdWUuaW5kZXgsXG4gICAgICAgICAgICAgICAgbGVuZ3RoOiBsZW5ndGgsXG4gICAgICAgICAgICAgICAgZHVyYXRpb246IGlzVmFsdWUoYXJncy5kdXJhdGlvbikgPyBhcmdzLmR1cmF0aW9uIDogJCQuY29uZmlnLnRyYW5zaXRpb25fZHVyYXRpb24sXG4gICAgICAgICAgICAgICAgZG9uZTogYXJncy5kb25lLFxuICAgICAgICAgICAgICAgIG9yZ0RhdGFDb3VudDogb3JnRGF0YUNvdW50LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHdpdGhMZWdlbmQ6IHRydWUsXG4gICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogb3JnRGF0YUNvdW50ID4gMSxcbiAgICAgICAgICAgIHdpdGhUcmltWERvbWFpbjogZmFsc2UsXG4gICAgICAgICAgICB3aXRoVXBkYXRlWEF4aXM6IHRydWUsXG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUZsb3cgPSBmdW5jdGlvbiAoYXJncykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDM7XG5cbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB0YXJnZXRzID0gYXJncy50YXJnZXRzLFxuICAgICAgICAgICAgICAgIGZsb3cgPSBhcmdzLmZsb3csXG4gICAgICAgICAgICAgICAgZHJhd0JhciA9IGFyZ3MuZHJhd0JhcixcbiAgICAgICAgICAgICAgICBkcmF3TGluZSA9IGFyZ3MuZHJhd0xpbmUsXG4gICAgICAgICAgICAgICAgZHJhd0FyZWEgPSBhcmdzLmRyYXdBcmVhLFxuICAgICAgICAgICAgICAgIGN4ID0gYXJncy5jeCxcbiAgICAgICAgICAgICAgICBjeSA9IGFyZ3MuY3ksXG4gICAgICAgICAgICAgICAgeHYgPSBhcmdzLnh2LFxuICAgICAgICAgICAgICAgIHhGb3JUZXh0ID0gYXJncy54Rm9yVGV4dCxcbiAgICAgICAgICAgICAgICB5Rm9yVGV4dCA9IGFyZ3MueUZvclRleHQsXG4gICAgICAgICAgICAgICAgZHVyYXRpb24gPSBhcmdzLmR1cmF0aW9uO1xuXG4gICAgICAgICAgICB2YXIgdHJhbnNsYXRlWCwgc2NhbGVYID0gMSwgdHJhbnNmb3JtLFxuICAgICAgICAgICAgICAgIGZsb3dJbmRleCA9IGZsb3cuaW5kZXgsXG4gICAgICAgICAgICAgICAgZmxvd0xlbmd0aCA9IGZsb3cubGVuZ3RoLFxuICAgICAgICAgICAgICAgIGZsb3dTdGFydCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCBmbG93SW5kZXgpLFxuICAgICAgICAgICAgICAgIGZsb3dFbmQgPSAkJC5nZXRWYWx1ZU9uSW5kZXgoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcywgZmxvd0luZGV4ICsgZmxvd0xlbmd0aCksXG4gICAgICAgICAgICAgICAgb3JnRG9tYWluID0gJCQueC5kb21haW4oKSwgZG9tYWluLFxuICAgICAgICAgICAgICAgIGR1cmF0aW9uRm9yRmxvdyA9IGZsb3cuZHVyYXRpb24gfHwgZHVyYXRpb24sXG4gICAgICAgICAgICAgICAgZG9uZSA9IGZsb3cuZG9uZSB8fCBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgICAgICB3YWl0ID0gJCQuZ2VuZXJhdGVXYWl0KCk7XG5cbiAgICAgICAgICAgIHZhciB4Z3JpZCA9ICQkLnhncmlkIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lcyA9ICQkLnhncmlkTGluZXMgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uID0gJCQubWFpblJlZ2lvbiB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5UZXh0ID0gJCQubWFpblRleHQgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluQmFyID0gJCQubWFpbkJhciB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5MaW5lID0gJCQubWFpbkxpbmUgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluQXJlYSA9ICQkLm1haW5BcmVhIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpbkNpcmNsZSA9ICQkLm1haW5DaXJjbGUgfHwgZDMuc2VsZWN0QWxsKFtdKTtcblxuICAgICAgICAgICAgLy8gc2V0IGZsYWdcbiAgICAgICAgICAgICQkLmZsb3dpbmcgPSB0cnVlO1xuXG4gICAgICAgICAgICAvLyByZW1vdmUgaGVhZCBkYXRhIGFmdGVyIHJlbmRlcmVkXG4gICAgICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIGQudmFsdWVzLnNwbGljZSgwLCBmbG93TGVuZ3RoKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAvLyB1cGRhdGUgeCBkb21haW4gdG8gZ2VuZXJhdGUgYXhpcyBlbGVtZW50cyBmb3IgZmxvd1xuICAgICAgICAgICAgZG9tYWluID0gJCQudXBkYXRlWERvbWFpbih0YXJnZXRzLCB0cnVlLCB0cnVlKTtcbiAgICAgICAgICAgIC8vIHVwZGF0ZSBlbGVtZW50cyByZWxhdGVkIHRvIHggc2NhbGVcbiAgICAgICAgICAgIGlmICgkJC51cGRhdGVYR3JpZCkgeyAkJC51cGRhdGVYR3JpZCh0cnVlKTsgfVxuXG4gICAgICAgICAgICAvLyBnZW5lcmF0ZSB0cmFuc2Zvcm0gdG8gZmxvd1xuICAgICAgICAgICAgaWYgKCFmbG93Lm9yZ0RhdGFDb3VudCkgeyAvLyBpZiBlbXB0eVxuICAgICAgICAgICAgICAgIGlmICgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmxlbmd0aCAhPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gJCQueChvcmdEb21haW5bMF0pIC0gJCQueChkb21haW5bMF0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmxvd1N0YXJ0ID0gJCQuZ2V0VmFsdWVPbkluZGV4KCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmxvd0VuZCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCAkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICQkLngoZmxvd1N0YXJ0LngpIC0gJCQueChmbG93RW5kLngpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9IGRpZmZEb21haW4oZG9tYWluKSAvIDI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGZsb3cub3JnRGF0YUNvdW50ID09PSAxIHx8IChmbG93U3RhcnQgJiYgZmxvd1N0YXJ0LngpID09PSAoZmxvd0VuZCAmJiBmbG93RW5kLngpKSB7XG4gICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICQkLngob3JnRG9tYWluWzBdKSAtICQkLngoZG9tYWluWzBdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAoJCQueChvcmdEb21haW5bMF0pIC0gJCQueChkb21haW5bMF0pKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gKCQkLngoZmxvd1N0YXJ0LngpIC0gJCQueChmbG93RW5kLngpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzY2FsZVggPSAoZGlmZkRvbWFpbihvcmdEb21haW4pIC8gZGlmZkRvbWFpbihkb21haW4pKTtcbiAgICAgICAgICAgIHRyYW5zZm9ybSA9ICd0cmFuc2xhdGUoJyArIHRyYW5zbGF0ZVggKyAnLDApIHNjYWxlKCcgKyBzY2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kuYXR0cigndHJhbnNmb3JtJywgdHJhbnNmb3JtKSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhbGwod2FpdCwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBpLCBzaGFwZXMgPSBbXSwgdGV4dHMgPSBbXSwgZXZlbnRSZWN0cyA9IFtdO1xuXG4gICAgICAgICAgICAgICAgLy8gcmVtb3ZlIGZsb3dlZCBlbGVtZW50c1xuICAgICAgICAgICAgICAgIGlmIChmbG93TGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBmbG93TGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNoYXBlcy5wdXNoKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgKGZsb3dJbmRleCArIGkpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRzLnB1c2goJy4nICsgQ0xBU1MudGV4dCArICctJyArIChmbG93SW5kZXggKyBpKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudFJlY3RzLnB1c2goJy4nICsgQ0xBU1MuZXZlbnRSZWN0ICsgJy0nICsgKGZsb3dJbmRleCArIGkpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlcykuc2VsZWN0QWxsKHNoYXBlcykucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MudGV4dHMpLnNlbGVjdEFsbCh0ZXh0cykucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuZXZlbnRSZWN0cykuc2VsZWN0QWxsKGV2ZW50UmVjdHMpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0KCcuJyArIENMQVNTLnhncmlkKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBkcmF3IGFnYWluIGZvciByZW1vdmluZyBmbG93ZWQgZWxlbWVudHMgYW5kIHJldmVydGluZyBhdHRyXG4gICAgICAgICAgICAgICAgeGdyaWRcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCQkLnhncmlkQXR0cik7XG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lc1xuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbCk7XG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lcy5zZWxlY3QoJ2xpbmUnKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcIngxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogeHYpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieDJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoIDogeHYpO1xuICAgICAgICAgICAgICAgIHhncmlkTGluZXMuc2VsZWN0KCd0ZXh0JylcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4XCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC53aWR0aCA6IDApXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieVwiLCB4dik7XG4gICAgICAgICAgICAgICAgbWFpbkJhclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsIGRyYXdCYXIpO1xuICAgICAgICAgICAgICAgIG1haW5MaW5lXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZHJhd0xpbmUpO1xuICAgICAgICAgICAgICAgIG1haW5BcmVhXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZHJhd0FyZWEpO1xuICAgICAgICAgICAgICAgIG1haW5DaXJjbGVcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiY3hcIiwgY3gpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiY3lcIiwgY3kpO1xuICAgICAgICAgICAgICAgIG1haW5UZXh0XG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIHhGb3JUZXh0KVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIHlGb3JUZXh0KVxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwtb3BhY2l0eScsICQkLm9wYWNpdHlGb3JUZXh0LmJpbmQoJCQpKTtcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKTtcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uLnNlbGVjdCgncmVjdCcpLmZpbHRlcigkJC5pc1JlZ2lvbk9uWClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4XCIsICQkLnJlZ2lvblguYmluZCgkJCkpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgJCQucmVnaW9uV2lkdGguYmluZCgkJCkpO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0V2ZW50UmVjdCgpO1xuICAgICAgICAgICAg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fVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc195X21heCA9IGNvbmZpZy5heGlzX3kyX21heCA9IG1heDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHg6IGNvbmZpZy5heGlzX3hfbWF4LFxuICAgICAgICAgICAgICAgIHk6IGNvbmZpZy5heGlzX3lfbWF4LFxuICAgICAgICAgICAgICAgIHkyOiBjb25maWcuYXhpc195Ml9tYXhcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuLmF4aXMubWluID0gZnVuY3Rpb24gKG1pbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIG1pbiA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtaW4ueCkpIHsgY29uZmlnLmF4aXNfeF9taW4gPSBtaW4ueDsgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1pbi55KSkgeyBjb25maWcuYXhpc195X21pbiA9IG1pbi55OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWluLnkyKSkgeyBjb25maWcuYXhpc195Ml9taW4gPSBtaW4ueTI7IH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeV9taW4gPSBjb25maWcuYXhpc195Ml9taW4gPSBtaW47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLCB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZX0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB4OiBjb25maWcuYXhpc194X21pbixcbiAgICAgICAgICAgICAgICB5OiBjb25maWcuYXhpc195X21pbixcbiAgICAgICAgICAgICAgICB5MjogY29uZmlnLmF4aXNfeTJfbWluXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi5heGlzLnJhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoaXNEZWZpbmVkKHJhbmdlLm1heCkpIHsgdGhpcy5heGlzLm1heChyYW5nZS5tYXgpOyB9XG4gICAgICAgICAgICBpZiAoaXNEZWZpbmVkKHJhbmdlLm1pbikpIHsgdGhpcy5heGlzLm1pbihyYW5nZS5taW4pOyB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIG1heDogdGhpcy5heGlzLm1heCgpLFxuICAgICAgICAgICAgICAgIG1pbjogdGhpcy5heGlzLm1pbigpXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLmxlZ2VuZCA9IGZ1bmN0aW9uICgpIHt9O1xuICAgIGMzX2NoYXJ0X2ZuLmxlZ2VuZC5zaG93ID0gZnVuY3Rpb24gKHRhcmdldElkcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsO1xuICAgICAgICAkJC5zaG93TGVnZW5kKCQkLm1hcFRvVGFyZ2V0SWRzKHRhcmdldElkcykpO1xuICAgICAgICAkJC51cGRhdGVBbmRSZWRyYXcoe3dpdGhMZWdlbmQ6IHRydWV9K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5bZG9tYWluLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgcmV0dXJuIHN0YXJ0IDwgc3RvcCA/IFsgc3RhcnQsIHN0b3AgXSA6IFsgc3RvcCwgc3RhcnQgXTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBnZW5lcmF0ZVRpY2tzKHNjYWxlKSB7XG4gICAgICAgICAgICB2YXIgaSwgZG9tYWluLCB0aWNrcyA9IFtdO1xuICAgICAgICAgICAgaWYgKHNjYWxlLnRpY2tzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNjYWxlLnRpY2tzLmFwcGx5KHNjYWxlLCB0aWNrQXJndW1lbnRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRvbWFpbiA9IHNjYWxlLmRvbWFpbigpO1xuICAgICAgICAgICAgZm9yIChpID0gTWF0aC5jZWlsKGRvbWFpblswXSk7IGkgPCBkb21haW5bMV07IGkrKykge1xuICAgICAgICAgICAgICAgIHRpY2tzLnB1c2goaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGlja3MubGVuZ3RoID4gMCAmJiB0aWNrc1swXSA+IDApIHtcbiAgICAgICAgICAgICAgICB0aWNrcy51bnNoaWZ0KHRpY2tzWzBdIC0gKHRpY2tzWzFdIC0gdGlja3NbMF0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aWNrcztcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBjb3B5U2NhbGUoKSB7XG4gICAgICAgICAgICB2YXIgbmV3U2NhbGUgPSBzY2FsZS5jb3B5KCksIGRvbWFpbjtcbiAgICAgICAgICAgIGlmIChwYXJhbXMuaXNDYXRlZ29yeSkge1xuICAgICAgICAgICAgICAgIGRvbWFpbiA9IHNjYWxlLmRvbWFpbigpO1xuICAgICAgICAgICAgICAgIG5ld1NjYWxlLmRvbWFpbihbZG9tYWluWzBdLCBkb21haW5bMV0gLSAxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbmV3U2NhbGU7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdGV4dEZvcm1hdHRlZCh2KSB7XG4gICAgICAgICAgICB2YXIgZm9ybWF0dGVkID0gdGlja0Zvcm1hdCA/IHRpY2tGb3JtYXQodikgOiB2O1xuICAgICAgICAgICAgcmV0dXJuIHR5cGVvZiBmb3JtYXR0ZWQgIT09ICd1bmRlZmluZWQnID8gZm9ybWF0dGVkIDogJyc7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gZ2V0U2l6ZUZvcjFDaGFyKHRpY2spIHtcbiAgICAgICAgICAgIGlmICh0aWNrVGV4dENoYXJTaXplKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRpY2tUZXh0Q2hhclNpemU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgc2l6ZSA9IHtcbiAgICAgICAgICAgICAgICBoOiAxMS41LFxuICAgICAgICAgICAgICAgIHc6IDUuNVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHRpY2suc2VsZWN0KCd0ZXh0JykudGV4dCh0ZXh0Rm9ybWF0dGVkKS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGJveCA9IHRoaXMuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksXG4gICAgICAgICAgICAgICAgICAgIHRleHQgPSB0ZXh0Rm9ybWF0dGVkKGQpLFxuICAgICAgICAgICAgICAgICAgICBoID0gYm94LmhlaWdodCxcbiAgICAgICAgICAgICAgICAgICAgdyA9IHRleHQgPyAoYm94LndpZHRoIC8gdGV4dC5sZW5ndGgpIDogdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmIChoICYmIHcpIHtcbiAgICAgICAgICAgICAgICAgICAgc2l6ZS5oID0gaDtcbiAgICAgICAgICAgICAgICAgICAgc2l6ZS53ID0gdztcbiAgICAgICAgICAgICAgICB9XG4gIC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F0aW9uIGJlY2F1c2Ugb2xkIHRpY2sgd2lsbCBiZSBpbmNsdWRlZCBpbiB0aGUgdGlja3MuXG4gICAgICAgICAgICAgICAgICAgIHRpY2tFeGl0ID0gdGljay5leGl0KCkucmVtb3ZlKCksXG4gICAgICAgICAgICAgICAgICAgIHRpY2tVcGRhdGUgPSB0cmFuc2l0aW9uaXNlKHRpY2spLnN0eWxlKFwib3BhY2l0eVwiLCAxKSxcbiAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSwgdGlja1gsIHRpY2tZO1xuXG4gICAgICAgICAgICAgICAgdmFyIHJhbmdlID0gc2NhbGUucmFuZ2VFeHRlbnQgPyBzY2FsZS5yYW5nZUV4dGVudCgpIDogc2NhbGVFeHRlbnQoc2NhbGUucmFuZ2UoKSksXG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSBnLnNlbGVjdEFsbChcIi5kb21haW5cIikuZGF0YShbIDAgXSksXG4gICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUgPSAocGF0aC5lbnRlcigpLmFwcGVuZChcInBhdGhcIikuYXR0cihcImNsYXNzXCIsIFwiZG9tYWluXCIpLCB0cmFuc2l0aW9uaXNlKHBhdGgpKTtcbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuYXBwZW5kKFwibGluZVwiKTtcbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuYXBwZW5kKFwidGV4dFwiKTtcblxuICAgICAgICAgICAgICAgIHZhciBsaW5lRW50ZXIgPSB0aWNrRW50ZXIuc2VsZWN0KFwibGluZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZSA9IHRpY2tVcGRhdGUuc2VsZWN0KFwibGluZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyID0gdGlja0VudGVyLnNlbGVjdChcInRleHRcIiksXG4gICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUgPSB0aWNrVXBkYXRlLnNlbGVjdChcInRleHRcIik7XG5cbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmlzQ2F0ZWdvcnkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja09mZnNldCA9IE1hdGguY2VpbCgoc2NhbGUxKDEpIC0gc2NhbGUxKDApKSAvIDIpO1xuICAgICAgICAgICAgICAgICAgICB0aWNrWCA9IHRpY2tDZW50ZXJlZCA/IDAgOiB0aWNrT2Zmc2V0O1xuICAgICAgICAgICAgICAgICAgICB0aWNrWSA9IHRpY2tDZW50ZXJlZCA/IHRpY2tPZmZzZXQgOiAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tPZmZzZXQgPSB0aWNrWCA9IDA7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIHRleHQsIHRzcGFuLCBzaXplRm9yMUNoYXIgPSBnZXRTaXplRm9yMUNoYXIoZy5zZWxlY3QoJy50aWNrJykpLCBjb3VudHMgPSBbXTtcbiAgICAgICAgICAgICAgICB2YXIgdGlja0xlbmd0aCA9IE1hdGgubWF4KGlubmVyVGlja1NpemUsIDApICsgdGlja1BhZGRpbmcsXG4gICAgICAgICAgICAgICAgICAgIGlzVmVydGljYWwgPSBvcmllbnQgPT09ICdsZWZ0JyB8fCBvcmllbnQgPT09ICdyaWdodCc7XG5cbiAgICAgICAgICAgICAgICAvLyB0aGlzIHNob3VsZCBiZSBjYWxsZWQgb25seSB3aGVuIGNhdGVnb3J5IGF4aXNcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzcGxpdFRpY2tUZXh0KGQsIG1heFdpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0aWNrVGV4dCA9IHRleHRGb3JtYXR0ZWQoZCksXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJ0ZXh0LCBzcGFjZUluZGV4LCB0ZXh0V2lkdGgsIHNwbGl0dGVkID0gW107XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh0aWNrVGV4dCkgPT09IFwiW29iamVjdCBBcnJheV1cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRpY2tUZXh0O1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFtYXhXaWR0aCB8fCBtYXhXaWR0aCA8PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXhXaWR0aCA9IGlzVmVydGljYWwgPyA5NSA6IHBhcmFtcy5pc0NhdGVnb3J5ID8gKE1hdGguY2VpbChzY2FsZTEodGlja3NbMV0pIC0gc2NhbGUxKHRpY2tzWzBdKSkgLSAxMikgOiAxMTA7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBzcGxpdChzcGxpdHRlZCwgdGV4dCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3BhY2VJbmRleCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgdGV4dC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJBdChpKSA9PT0gJyAnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlSW5kZXggPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0ZXh0ID0gdGV4dC5zdWJzdHIoMCwgaSArIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRXaWR0aCA9IHNpemVGb3IxQ2hhci53ICogc3VidGV4dC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGV4dCB3aWR0aCBnZXRzIG92ZXIgdGljayB3aWR0aCwgc3BsaXQgYnkgc3BhY2UgaW5kZXggb3IgY3JyZW50IGluZGV4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1heFdpZHRoIDwgdGV4dFdpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwbGl0dGVkLmNvbmNhdCh0ZXh0LnN1YnN0cigwLCBzcGFjZUluZGV4ID8gc3BhY2VJbmRleCA6IGkpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc2xpY2Uoc3BhY2VJbmRleCA/IHNwYWNlSW5kZXggKyAxIDogaSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXR0ZWQuY29uY2F0KHRleHQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwbGl0KHNwbGl0dGVkLCB0aWNrVGV4dCArIFwiXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRzcGFuRHkoZCwgaSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZHkgPSBzaXplRm9yMUNoYXIuaDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcmllbnQgPT09ICdsZWZ0JyB8fCBvcmllbnQgPT09ICdyaWdodCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkeSA9IC0oKGNvdW50c1tkLmluZGV4XSAtIDEpICogKHNpemVGb3IxQ2hhci5oIC8gMikgLSAzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZHkgPSBcIi43MWVtXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGR5O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRpY2tTaXplKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpY2tQb3NpdGlvbiA9IHNjYWxlKGQpICsgKHRpY2tDZW50ZXJlZCA/IDAgOiB0aWNrT2Zmc2V0KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJhbmdlWzBdIDwgdGlja1Bvc2l0aW9uICYmIHRpY2tQb3NpdGlvbiA8IHJhbmdlWzFdID8gaW5uZXJUaWNrU2l6ZSA6IDA7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdGV4dCA9IHRpY2suc2VsZWN0KFwidGV4dFwiKTtcbiAgICAgICAgICAgICAgICB0c3BhbiA9IHRleHQuc2VsZWN0QWxsKCd0c3BhbicpXG4gICAgICAgICAgICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3BsaXR0ZWQgPSBwYXJhbXMudGlja011bHRpbGluZSA/IHNwbGl0VGlja1RleHQoZCwgcGFyYW1zLnRpY2tXaWR0aCkgOiBbXS5jb25jYXQodGV4dEZvcm1hdHRlZChkKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb3VudHNbaV0gPSBzcGxpdHRlZC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXR0ZWQubWFwKGZ1bmN0aW9uIChzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgaW5kZXg6IGksIHNwbGl0dGVkOiBzIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdHNwYW4uZW50ZXIoKS5hcHBlbmQoJ3RzcGFuJyk7XG4gICAgICAgICAgICAgICAgdHNwYW4uZXhpdCgpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIHRzcGFuLnRleHQoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGQuc3BsaXR0ZWQ7IH0pO1xuXG4gICAgICAgICAgICAgICAgdmFyIHJvdGF0ZSA9IHBhcmFtcy50aWNrVGV4dFJvdGF0ZTtcblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRleHRBbmNob3JGb3JUZXh0KHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdtaWRkbGUnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGUgPiAwID8gXCJzdGFydFwiIDogXCJlbmRcIjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdGV4dFRyYW5zZm9ybShyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJyb3RhdGUoXCIgKyByb3RhdGUgKyBcIilcIjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gZHhGb3JUZXh0KHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDggKiBNYXRoLnNpbihNYXRoLlBJICogKHJvdGF0ZSAvIDE4MCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB5Rm9yVGV4dChyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWNrTGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxMS41IC0gMi41ICogKHJvdGF0ZSAvIDE1KSAqIChyb3RhdGUgPiAwID8gMSA6IC0xKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBzd2l0Y2ggKG9yaWVudCkge1xuICAgICAgICAgICAgICAgIGNhc2UgXCJib3R0b21cIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNYO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ5MlwiLCBpbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieVwiLCB0aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngxXCIsIHRpY2tYKS5hdHRyKFwieDJcIiwgdGlja1gpLmF0dHIoXCJ5MlwiLCB0aWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIDApLmF0dHIoXCJ5XCIsIHlGb3JUZXh0KHJvdGF0ZSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKFwidGV4dC1hbmNob3JcIiwgdGV4dEFuY2hvckZvclRleHQocm90YXRlKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCB0ZXh0VHJhbnNmb3JtKHJvdGF0ZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHNwYW4uYXR0cigneCcsIDApLmF0dHIoXCJkeVwiLCB0c3BhbkR5KS5hdHRyKCdkeCcsIGR4Rm9yVGV4dChyb3RhdGUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cihcImRcIiwgXCJNXCIgKyByYW5nZVswXSArIFwiLFwiICsgb3V0ZXJUaWNrU2l6ZSArIFwiVjBIXCIgKyByYW5nZVsxXSArIFwiVlwiICsgb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhc2UgXCJ0b3BcIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogcm90YXRlZCB0aWNrIHRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieTJcIiwgLWlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ5XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIDApLmF0dHIoXCJ5MlwiLCAtaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIDApLmF0dHIoXCJ5XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcIm1pZGRsZVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCAwKS5hdHRyKFwiZHlcIiwgXCIwZW1cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgcmFuZ2VbMF0gKyBcIixcIiArIC1vdXRlclRpY2tTaXplICsgXCJWMEhcIiArIHJhbmdlWzFdICsgXCJWXCIgKyAtb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhc2UgXCJsZWZ0XCI6XG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieDJcIiwgLWlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ4XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIC1pbm5lclRpY2tTaXplKS5hdHRyKFwieTFcIiwgdGlja1kpLmF0dHIoXCJ5MlwiLCB0aWNrWSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIC10aWNrTGVuZ3RoKS5hdHRyKFwieVwiLCB0aWNrT2Zmc2V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcImVuZFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCAtdGlja0xlbmd0aCkuYXR0cihcImR5XCIsIHRzcGFuRHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKFwiZFwiLCBcIk1cIiArIC1vdXRlclRpY2tTaXplICsgXCIsXCIgKyByYW5nZVswXSArIFwiSDBWXCIgKyByYW5nZVsxXSArIFwiSFwiICsgLW91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXNlIFwicmlnaHRcIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNZO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ4MlwiLCBpbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieFwiLCB0aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIGlubmVyVGlja1NpemUpLmF0dHIoXCJ5MlwiLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cihcInhcIiwgdGlja0xlbmd0aCkuYXR0cihcInlcIiwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LnN0eWxlKFwidGV4dC1hbmNob3JcIiwgXCJzdGFydFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCB0aWNrTGVuZ3RoKS5hdHRyKFwiZHlcIiwgdHNwYW5EeSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgb3V0ZXJUaWNrU2l6ZSArIFwiLFwiICsgcmFuZ2VbMF0gKyBcIkgwVlwiICsgcmFuZ2VbMV0gKyBcIkhcIiArIG91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHNjYWxlMS5yYW5nZUJhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHggPSBzY2FsZTEsIGR4ID0geC5yYW5nZUJhbmQoKSAvIDI7XG4gICAgICAgICAgICAgICAgICAgIHNjYWxlMCA9IHNjYWxlMSA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geChkKSArIGR4O1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2NhbGUwLnJhbmdlQmFuZCkge1xuICAgICAgICAgICAgICAgICAgICBzY2FsZTAgPSBzY2FsZTE7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja0V4aXQuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTApO1xuICAgICAgICAgICAgICAgIHRpY2tVcGRhdGUuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTEpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgYXhpcy5zY2FsZSA9IGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHNjYWxlOyB9XG4gICAgICAgICAgICBzY2FsZSA9IHg7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy5vcmllbnQgPSBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiBvcmllbnQ7IH1cbiAgICAgICAgICAgIG9yaWVudCA9IHggaW4ge3RvcDogMSwgcmlnaHQ6IDEsIGJvdHRvbTogMSwgbGVmdDogMX0gPyB4ICsgXCJcIiA6IFwiYm90dG9tXCI7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrRm9ybWF0ID0gZnVuY3Rpb24gKGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrRm9ybWF0OyB9XG4gICAgICAgICAgICB0aWNrRm9ybWF0ID0gZm9ybWF0O1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0NlbnRlcmVkID0gZnVuY3Rpb24gKGlzQ2VudGVyZWQpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja0NlbnRlcmVkOyB9XG4gICAgICAgICAgICB0aWNrQ2VudGVyZWQgPSBpc0NlbnRlcmVkO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja09mZnNldCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aWNrT2Zmc2V0O1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tJbnRlcnZhbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBpbnRlcnZhbCwgbGVuZ3RoO1xuICAgICAgICAgICAgaWYgKHBhcmFtcy5pc0NhdGVnb3J5KSB7XG4gICAgICAgICAgICAgICAgaW50ZXJ2YWwgPSB0aWNrT2Zmc2V0ICogMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGxlbmd0aCA9IGF4aXMuZy5zZWxlY3QoJ3BhdGguZG9tYWluJykubm9kZSgpLmdldFRvdGFsTGVuZ3RoKCkgLSBvdXRlclRpY2tTaXplICogMjtcbiAgICAgICAgICAgICAgICBpbnRlcnZhbCA9IGxlbmd0aCAvIGF4aXMuZy5zZWxlY3RBbGwoJ2xpbmUnKS5zaXplKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gaW50ZXJ2YWwgPT09IEluZmluaXR5ID8gMCA6IGludGVydmFsO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrQXJndW1lbnRzOyB9XG4gICAgICAgICAgICB0aWNrQXJndW1lbnRzID0gYXJndW1lbnRzO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0N1bGxpbmcgPSBmdW5jdGlvbiAoY3VsbGluZykge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrQ3VsbGluZzsgfVxuICAgICAgICAgICAgdGlja0N1bGxpbmcgPSBjdWxsaW5nO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja1ZhbHVlcyA9IGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHggPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICB0aWNrVmFsdWVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geChzY2FsZS5kb21haW4oKSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja1ZhbHVlczsgfVxuICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMgPSB4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBheGlzO1xuICAgIH1cblxuIC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UoKTtcbiAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgdGhpcy5fY2hlY2tWYWxpZEluZGV4KGluZGV4KTtcbiAgICAgICAgICAgICB0aGlzLl9saXN0W2luZGV4XSA9IG5ld0l0ZW07XG4gICAgICAgICAgICAgbmV3SXRlbS5fb3duaW5nUGF0aFNlZ0xpc3QgPSB0aGlzO1xuICAgICAgICAgICAgIHRoaXMuX3dyaXRlTGlzdFRvUGF0aCgpO1xuICAgICAgICAgICAgIHJldHVybiBuZXdJdGVtO1xuICAgICAgICAgfVxuXG4gICAgICAgICBTVkdQYXRoU2VnTGlzdC5wcm90b3R5cGUucmVtb3ZlSXRlbSA9IGZ1bmN0aW9uKGluZGV4KSB7XG4gICAgICAgICAgICAgdGhpcy5fY2hlY2tQYXRoU3luY2hyb25pemVkVG9MaXN0KCk7XG5cbiAgICAgICAgICAgICB0aGlzLl9jaGVja1ZhbGlkSW5kZXgoaW5kZXgpO1xuICAgICAgICAgICAgIHZhciBpdGVtID0gdGhpcy5fbGlzdFtpbmRleF07XG4gICAgICAgICAgICAgdGhpcy5fbGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xuICAgICAgICAgICAgIHRoaXMuX3dyaXRlTGlzdFRvUGF0aCgpO1xuICAgICAgICAgICAgIHJldHVybiBpdGVtO1xuICAgICAgICAgfVxuXG4gICAgICAgICBTVkdQYXRoU2VnTGlzdC5wcm90b3R5cGUuYXBwZW5kSXRlbSA9IGZ1bmN0aW9uKG5ld0l0ZW0pIHtcbiAgICAgICAgICAgICB0aGlzLl9jaGVja1BhdGhTeW5jaHJvbml6ZWRUb0xpc3QoKTtcblxuICAgICAgICAgICAgIGlmIChuZXdJdGVtLl9vd25pbmdQYXRoU2VnTGlzdCkge1xuICAgICAgICAgICAgICAgICAvLyBTVkcyIHNwZWMgc2F5cyB0byBtYWtlIGEgY29weS5cbiAgICAgICAgICAgICAgICAgbmV3SXRlbSA9IG5ld0l0ZW0uY2xvbmUoKTtcbiAgICAgICAgIC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LmNwcC5cbiAgICAgICAgIFNWR1BhdGhTZWdMaXN0LnByb3RvdHlwZS5fcGFyc2VQYXRoID0gZnVuY3Rpb24oc3RyaW5nKSB7XG4gICAgICAgICAgICAgaWYgKCFzdHJpbmcgfHwgc3RyaW5nLmxlbmd0aCA9PSAwKVxuICAgICAgICAgICAgICAgICByZXR1cm4gW107XG5cbiAgICAgICAgICAgICB2YXIgb3duaW5nUGF0aFNlZ0xpc3QgPSB0aGlzO1xuXG4gICAgICAgICAgICAgdmFyIEJ1aWxkZXIgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdGhpcy5wYXRoU2VnTGlzdCA9IFtdO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIEJ1aWxkZXIucHJvdG90eXBlLmFwcGVuZFNlZ21lbnQgPSBmdW5jdGlvbihwYXRoU2VnKSB7XG4gICAgICAgICAgICAgICAgIHRoaXMucGF0aFNlZ0xpc3QucHVzaChwYXRoU2VnKTtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICB2YXIgU291cmNlID0gZnVuY3Rpb24oc3RyaW5nKSB7XG4gICAgICAgICAgICAgICAgIHRoaXMuX3N0cmluZyA9IHN0cmluZztcbiAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4ID0gMDtcbiAgICAgICAgICAgICAgICAgdGhpcy5fZW5kSW5kZXggPSB0aGlzLl9zdHJpbmcubGVuZ3RoO1xuICAgICAgICAgICAgICAgICB0aGlzLl9wcmV2aW91c0NvbW1hbmQgPSBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTjtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKTtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9pc0N1cnJlbnRTcGFjZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB2YXIgY2hhcmFjdGVyID0gd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ggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCIsXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXg7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5oYXNNb3JlRGF0YSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXg7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5wZWVrU2VnbWVudFR5cGUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdmFyIGxvb2thaGVhZCA9IHRoaXMuX3N0cmluZ1t0aGlzLl9jdXJyZW50SW5kZXhdO1xuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fcGF0aFNlZ1R5cGVGcm9tQ2hhcihsb29rYWhlYWQpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3BhdGhTZWdUeXBlRnJvbUNoYXIgPSBmdW5jdGlvbihsb29rYWhlYWQpIHtcbiAgICAgICAgICAgICAgICAgc3dpdGNoIChsb29rYWhlYWQpIHtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlpcIjpcbiAgICAgICAgICAgICAgICAgY2FzZSBcInpcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ0xPU0VQQVRIO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiTVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwibVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiTFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwibFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiQ1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcImNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJRXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInFcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19RVUFEUkFUSUNfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiQVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19BUkNfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiYVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19BUkNfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiSFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fSE9SSVpPTlRBTF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJoXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19IT1JJWk9OVEFMX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlZcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1ZFUlRJQ0FMX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInZcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1ZFUlRJQ0FMX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19TTU9PVEhfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwic1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX1NNT09USF9SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJUXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX1NNT09USF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJ0XCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX1NNT09USF9SRUw7XG4gICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV047XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9uZXh0Q29tbWFuZEhlbHBlciA9IGZ1bmN0aW9uKGxvb2thaGVhZCwgcHJldmlvdXNDb21tYW5kKSB7XG4gICAgICAgICAgICAgICAgIC8vIENoZWNrIGZvciByZW1haW5pbmcgY29vcmRpbmF0ZXMgaW4gdGhlIGN1cnJlbnQgY29tbWFuZC5cbiAgICAgICAgICAgICAgICAgaWYgKChsb29rYWhlYWQgPT0gXCIrXCIgfHwgbG9va2FoZWFkID09IFwiLVwiIHx8IGxvb2thaGVhZCA9PSBcIi5cIiB8fCAobG9va2FoZWFkID49IFwiMFwiICYmIGxvb2thaGVhZCA8PSBcIjlcIikpICYmIHByZXZpb3VzQ29tbWFuZCAhPSBTVkdQYXRoU2VnLlBBVEhTRUdfQ0xPU0VQQVRIKSB7XG4gICAgICAgICAgICAgICAgICAgICBpZiAocHJldmlvdXNDb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX0FCUztcbiAgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2aW91c0NvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUwpXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fUkVMO1xuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByZXZpb3VzQ29tbWFuZDtcbiAgICAg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gICAgICAgICAgICAgICB2YXIgZXhwb25lbnQgPSAwO1xuICAgICAgICAgICAgICAgICB2YXIgaW50ZWdlciA9IDA7XG4gICAgICAgICAgICAgICAgIHZhciBmcmFjID0gMTtcbiAgICAgICAgICAgICAgICAgdmFyIGRlY2ltYWwgPSAwO1xuICAgICAgICAgICAgICAgICB2YXIgc2lnbiA9IDE7XG4gICAgICAgICAgICAgICAgIHZhciBleHBzaWduID0gMTtcblxuICAgICAgICAgICAgICAgICB2YXIgc3RhcnRJbmRleCA9IHRoaXMuX2N1cnJlbnRJbmRleDtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKTtcblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBzaWduLlxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiK1wiKVxuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIi1cIikge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICBzaWduID0gLTE7XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID09IHRoaXMuX2VuZEluZGV4IHx8ICgodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDwgXCIwXCIgfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID4gXCI5XCIpICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSAhPSBcIi5cIikpXG4gICAgICAgICAgICAgICAgICAgICAvLyBUaGUgZmlyc3QgY2hhcmFjdGVyIG9mIGEgbnVtYmVyIG11c3QgYmUgb25lIG9mIFswLTkrLS5dLlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBpbnRlZ2VyIHBhcnQsIGJ1aWxkIHJpZ2h0LXRvLWxlZnQuXG4gICAgICAgICAgICAgICAgIHZhciBzdGFydEludFBhcnRJbmRleCA9IHRoaXMuX2N1cnJlbnRJbmRleDtcbiAgICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+PSBcIjBcIiAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPD0gXCI5XCIpXG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKzsgLy8gQWR2YW5jZSB0byBmaXJzdCBub24tZGlnaXQuXG5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCAhPSBzdGFydEludFBhcnRJbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgdmFyIHNjYW5JbnRQYXJ0SW5kZXggPSB0aGlzLl9jdXJyZW50SW5kZXggLSAxO1xuICAgICAgICAgICAgICAgICAgICAgdmFyIG11bHRpcGxpZXIgPSAxO1xuICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHNjYW5JbnRQYXJ0SW5kZXggPj0gc3RhcnRJbnRQYXJ0SW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlZ2VyICs9IG11bHRpcGxpZXIgKiAodGhpcy5fc3RyaW5nLmNoYXJBdChzY2FuSW50UGFydEluZGV4LS0pIC0gXCIwXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRpcGxpZXIgKj0gMTA7XG4gICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBkZWNpbWFscy5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIi5cIikge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIG11c3QgYmUgYSBsZWFzdCBvbmUgZGlnaXQgZm9sbG93aW5nIHRoZSAuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4IHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8IFwiMFwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+IFwiOVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgICB3aGlsZSAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID49IFwiMFwiICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8PSBcIjlcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICBkZWNpbWFsICs9ICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCsrKSAtIFwiMFwiKSAqIChmcmFjICo9IDAuMSk7XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBleHBvbmVudCBwYXJ0LlxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ICE9IHN0YXJ0SW5kZXggJiYgdGhpcy5fY3VycmVudEluZGV4ICsgMSA8IHRoaXMuX2VuZEluZGV4ICYmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCJlXCIgfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiRVwiKSAmJiAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXggKyAxKSAhPSBcInhcIiAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCArIDEpICE9IFwibVwiKSkge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFJlYWQgdGhlIHNpZ24gb2YgdGhlIGV4cG9uZW50LlxuICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIitcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCItXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHBzaWduID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIG11c3QgYmUgYW4gZXhwb25lbnQuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4IHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8IFwiMFwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+IFwiOVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgICAgIHdoaWxlICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPj0gXCIwXCIgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDw9IFwiOVwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXhwb25lbnQgKj0gMTA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXhwb25lbnQgKz0gKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSAtIFwiMFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIHZhciBudW1iZXIgPSBpbnRlZ2VyICsgZGVjaW1hbDtcbiAgICAgICAgICAgICAgICAgbnVtYmVyICo9IHNpZ247XG5cbiAgICAgICAgICAgICAgICAgaWYgKGV4cG9uZW50KVxuICAgICAgICAgICAgICAgICAgICAgbnVtYmVyICo9IE1hdGgucG93KDEwLCBleHBzaWduICogZXhwb25lbnQpO1xuXG4gICAgICAgICAgICAgICAgIGlmIChzdGFydEluZGV4ID09IHRoaXMuX2N1cnJlbnRJbmRleClcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzT3JEZWxpbWl0ZXIoKTtcblxuICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3BhcnNlQXJjRmxhZyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4KVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgdmFyIGZsYWcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgdmFyIGZsYWdDaGFyID0gdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgrKyk7XG4gICAgICAgICAgICAgICAgIGlmIChmbGFnQ2hhciA9PSBcIjBcIilcbiAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZmxhZ0NoYXIgPT0gXCIxXCIpXG4gICAgICAgICAgICAgICAgICAgICBmbGFnID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXNPckRlbGltaXRlcigpO1xuICAgICAgICAgICAgICAgICByZXR1cm4gZmxhZztcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLnBhcnNlU2VnbWVudCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB2YXIgbG9va2FoZWFkID0gdGhpcy5fc3RyaW5nW3RoaXMuX2N1cnJlbnRJbmRleF07XG4gICAgICAgICAgICAgICAgIHZhciBjb21tYW5kID0gdGhpcy5fcGF0aFNlZ1R5cGVGcm9tQ2hhcihsb29rYWhlYWQpO1xuICAgICAgICAgICAgICAgICBpZiAoY29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTikge1xuICAgICAgICAgICAgICAgICAgICAgLy8gUG9zc2libHkgYW4gaW1wbGljaXQgY29tbWFuZC4gTm90IGFsbG93ZWQgaWYgdGhpcyBpcyB0aGUgZmlyc3QgY29tbWFuZC5cbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9wcmV2aW91c0NvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV04pXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgICBjb21tYW5kID0gdGhpcy5fbmV4dENvbW1hbmRIZWxwZXIobG9va2FoZWFkLCB0aGlzLl9wcmV2aW91c0NvbW1hbmQpO1xuICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV04pXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3ByZXZpb3VzQ29tbWFuZCA9IGNvbW1hbmQ7XG5cbiAgICAgICAgICAgICAgICAgc3dpdGNoIChjb21tYW5kKSB7XG4gICAgICAgICAgICAgICAgIGNhc2UgU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUw6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNWR1BhdGhTZWdNb3ZldG9SZWwob3duaW5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gPSBuZXcgU291cmNlKHN0cmluZyk7XG5cbiAgICAgICAgICAgICBpZiAoIXNvdXJjZS5pbml0aWFsQ29tbWFuZElzTW92ZVRvKCkpXG4gICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgICB3aGlsZSAoc291cmNlLmhhc01vcmVEYXRhKCkpIHtcbiAgICAgICAgICAgICAgICAgdmFyIHBhdGhTZWcgPSBzb3VyY2UucGFyc2VTZWdtZW50KCk7XG4gICAgICAgICAgICAgICAgIGlmICghcGF0aFNlZylcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmRTZWdtZW50KHBhdGhTZWcpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIHJldHVybiBidWlsZGVyLnBhdGhTZWdMaXN0O1xuICAgICAgICAgfVxuICAgICB9XG4gICAgfSgpKTtcblxuICAgIC8qIGpzaGludCBpZ25vcmU6ZW5kICovXG5cbiAgICBpZiAodHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kKSB7XG4gICAgICAgIGRlZmluZShcImMzXCIsIFtcImQzXCJdLCBmdW5jdGlvbiAoKSB7IHJldHVybiBjMzsgfSk7XG4gICAgfSBlbHNlIGlmICgndW5kZWZpbmVkJyAhPT0gdHlwZW9mIGV4cG9ydHMgJiYgJ3VuZGVmaW5lZCcgIT09IHR5cGVvZiBtb2R1bGUpIHtcbiAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSBjMztcbiAgICB9IGVsc2Uge1xuICAgICAgICB3aW5kb3cuYzMgPSBjMztcbiAgICB9XG5cbn0pKHdpbmRvdyk7XG4iLCIhZnVuY3Rpb24oKSB7XG4gIHZhciBkMyA9IHtcbiAgICB2ZXJzaW9uOiBcIjMuNS4xN1wiXG4gIH07XG4gIHZhciBkM19hcnJheVNsaWNlID0gW10uc2xpY2UsIGQzX2FycmF5ID0gZnVu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EgPSB2aWV3O1xuICAgICAgICBpZiAoZDNfdHJhbnNpdGlvbkluaGVyaXRJZCkge1xuICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS50cmFuc2l0aW9uKCkuZWFjaChcInN0YXJ0Lnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2aWV3ID0gdGhpcy5fX2NoYXJ0X18gfHwge1xuICAgICAgICAgICAgICB4OiAwLFxuICAgICAgICAgICAgICB5OiAwLFxuICAgICAgICAgICAgICBrOiAxXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgem9vbXN0YXJ0ZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pLnR3ZWVuKFwiem9vbTp6b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIGR4ID0gc2l6ZVswXSwgZHkgPSBzaXplWzFdLCBjeCA9IGNlbnRlcjAgPyBjZW50ZXIwWzBdIDogZHggLyAyLCBjeSA9IGNlbnRlcjAgPyBjZW50ZXIwWzFdIDogZHkgLyAyLCBpID0gZDMuaW50ZXJwb2xhdGVab29tKFsgKGN4IC0gdmlldy54KSAvIHZpZXcuaywgKGN5IC0gdmlldy55KSAvIHZpZXcuaywgZHggLyB2aWV3LmsgXSwgWyAoY3ggLSB2aWV3MS54KSAvIHZpZXcxLmssIChjeSAtIHZpZXcxLnkpIC8gdmlldzEuaywgZHggLyB2aWV3MS5rIF0pO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgICAgdmFyIGwgPSBpKHQpLCBrID0gZHggLyBsWzJdO1xuICAgICAgICAgICAgICB0aGlzLl9fY2hhcnRfXyA9IHZpZXcgPSB7XG4gICAgICAgICAgICAgICAgeDogY3ggLSBsWzBdICogayxcbiAgICAgICAgICAgICAgICB5OiBjeSAtIGxbMV0gKiBrLFxuICAgICAgICAgICAgICAgIGs6IGtcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgem9vbWVkKGRpc3BhdGNoKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSkuZWFjaChcImludGVycnVwdC56b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgem9vbWVuZGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB9KS5lYWNoKFwiZW5kLnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRoaXMuX19jaGFydF9fID0gdmlldztcbiAgICAgICAgICB6b29tc3RhcnRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgem9vbWVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuICAgIHpvb20udHJhbnNsYXRlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gWyB2aWV3LngsIHZpZXcueSBdO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogK19bMF0sXG4gICAgICAgIHk6ICtfWzFdLFxuICAgICAgICBrOiB2aWV3LmtcbiAgICAgIH07XG4gICAgICByZXNjYWxlKCk7XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2NhbGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB2aWV3Lms7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiB2aWV3LngsXG4gICAgICAgIHk6IHZpZXcueSxcbiAgICAgICAgazogbnVsbFxuICAgICAgfTtcbiAgICAgIHNjYWxlVG8oK18pO1xuICAgICAgcmVzY2FsZSgpO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNjYWxlRXh0ZW50ID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2NhbGVFeHRlbnQ7XG4gICAgICBzY2FsZUV4dGVudCA9IF8gPT0gbnVsbCA/IGQzX2JlaGF2aW9yX3pvb21JbmZpbml0eSA6IFsgK19bMF0sICtfWzFdIF07XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uY2VudGVyID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY2VudGVyO1xuICAgICAgY2VudGVyID0gXyAmJiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNpemUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaXplO1xuICAgICAgc2l6ZSA9IF8gJiYgWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5kdXJhdGlvbiA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGR1cmF0aW9uO1xuICAgICAgZHVyYXRpb24gPSArXztcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS54ID0gZnVuY3Rpb24oeikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDE7XG4gICAgICB4MSA9IHo7XG4gICAgICB4MCA9IHouY29weSgpO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogMCxcbiAgICAgICAgeTogMCxcbiAgICAgICAgazogMVxuICAgICAgfTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS55ID0gZnVuY3Rpb24oeikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTE7XG4gIC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j0gTikgcmV0dXJuIEVPRjtcbiAgICAgICAgaWYgKGVvbCkgcmV0dXJuIGVvbCA9IGZhbHNlLCBFT0w7XG4gICAgICAgIHZhciBqID0gSTtcbiAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChqKSA9PT0gMzQpIHtcbiAgICAgICAgICB2YXIgaSA9IGo7XG4gICAgICAgICAgd2hpbGUgKGkrKyA8IE4pIHtcbiAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaSkgPT09IDM0KSB7XG4gICAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaSArIDEpICE9PSAzNCkgYnJlYWs7XG4gICAgICAgICAgICAgICsraTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgSSA9IGkgKyAyO1xuICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KGkgKyAxKTtcbiAgICAgICAgICBpZiAoYyA9PT0gMTMpIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGkgKyAyKSA9PT0gMTApICsrSTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGMgPT09IDEwKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqICsgMSwgaSkucmVwbGFjZSgvXCJcIi9nLCAnXCInKTtcbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAoSSA8IE4pIHtcbiAgICAgICAgICB2YXIgYyA9IHRleHQuY2hhckNvZGVBdChJKyspLCBrID0gMTtcbiAgICAgICAgICBpZiAoYyA9PT0gMTApIGVvbCA9IHRydWU7IGVsc2UgaWYgKGMgPT09IDEzKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChJKSA9PT0gMTApICsrSSwgKytrO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYyAhPT0gZGVsaW1pdGVyQ29kZSkgY29udGludWU7XG4gICAgICAgICAgcmV0dXJuIHRleHQuc2xpY2UoaiwgSSAtIGspO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGopO1xuICAgICAgfVxuICAgICAgd2hpbGUgKCh0ID0gdG9rZW4oKSkgIT09IEVPRikge1xuICAgICAgICB2YXIgYSA9IFtdO1xuICAgICAgICB3aGlsZSAodCAhPT0gRU9MICYmIHQgIT09IEVPRikge1xuICAgICAgICAgIGEucHVzaCh0KTtcbiAgICAgICAgICB0ID0gdG9rZW4oKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZiAmJiAoYSA9IGYoYSwgbisrKSkgPT0gbnVsbCkgY29udGludWU7XG4gICAgICAgIHJvd3MucHVzaChhKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiByb3dzO1xuICAgIH07XG4gICAgZHN2LmZvcm1hdCA9IGZ1bmN0aW9uKHJvd3MpIHtcbiAgICAgIGlmIChBcnJheS5pc0FycmF5KHJvd3NbMF0pKSByZXR1cm4gZHN2LmZvcm1hdFJvd3Mocm93cyk7XG4gICAgICB2YXIgZmllbGRTZXQgPSBuZXcgZDNfU2V0KCksIGZpZWxkcyA9IFtdO1xuICAgICAgcm93cy5mb3JFYWNoKGZ1bmN0aW9uKHJvdykge1xuICAgICAgICBmb3IgKHZhciBmaWVsZCBpbiByb3cpIHtcbiAgICAgICAgICBpZiAoIWZpZWxkU2V0LmhhcyhmaWVsZCkpIHtcbiAgICAgICAgICAgIGZpZWxkcy5wdXNoKGZpZWxkU2V0LmFkZChmaWVsZCkpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICByZXR1cm4gWyBmaWVsZHMubWFwKGZvcm1hdFZhbHVlKS5qb2luKGRlbGltaXRlcikgXS5jb25jYXQocm93cy5tYXAoZnVuY3Rpb24ocm93KSB7XG4gICAgICAgIHJ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ICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICjOuzEgPj0gzrswKSB7XG4gICAgICAgICAgICBpZiAozrsgPCDOuzApIM67MCA9IM67O1xuICAgICAgICAgICAgaWYgKM67ID4gzrsxKSDOuzEgPSDOuztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKM67ID4gzrtfKSB7XG4gICAgICAgICAgICAgIGlmIChhbmdsZSjOuzAsIM67KSA+IGFuZ2xlKM67MCwgzrsxKSkgzrsxID0gzrs7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYW5nbGUozrssIM67MSkgPiBhbmdsZSjOuzAsIM67MSkpIM67MCA9IM67O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcG9pbnQozrssIM+GKTtcbiAgICAgIH1cbiAgICAgIHAwID0gcCwgzrtfID0gzrs7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGxpbmVTdGFydCgpIHtcbiAgICAgIGJvdW5kLnBvaW50ID0gbGluZVBvaW50O1xuICAgIH1cbiAgICBmdW5jdGlvbiBsaW5lRW5kKCkge1xuICAgICAgcmFuZ2VbMF0gPSDOuzAsIHJhbmdlWzFdID0gzrsxO1xuICAgICAgYm91bmQucG9pbnQgPSBwb2ludDtcbiAgICAgIHAwID0gbnVsbDtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmluZ1BvaW50KM67LCDPhikge1xuICAgICAgaWYgKHAwKSB7XG4gICAgICAgIHZhciBkzrsgPSDOuyAtIM67XztcbiAgICAgICAgZM67U3VtICs9IGFicyhkzrspID4gMTgwID8gZM67ICsgKGTOuyA+IDAgPyAzNjAgOiAtMzYwKSA6IGTOuztcbiAgICAgIH0gZWxzZSDOu19fID0gzrssIM+GX18gPSDPhjtcbiAgICAgIGQzX2dlb19hcmVhLnBvaW50KM67LCDPhik7XG4gICAgICB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0gc3RhcnQpIHJldHVybjtcbiAgICAgIHBvaW50cyA9IGN1cnJlbnQuejtcbiAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgZG8ge1xuICAgICAgICBjdXJyZW50LnYgPSBjdXJyZW50Lm8udiA9IHRydWU7XG4gICAgICAgIGlmIChjdXJyZW50LmUpIHtcbiAgICAgICAgICBpZiAoaXNTdWJqZWN0KSB7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbiA9IHBvaW50cy5sZW5ndGg7IGkgPCBuOyArK2kpIGxpc3RlbmVyLnBvaW50KChwb2ludCA9IHBvaW50c1tpXSlbMF0sIHBvaW50WzFdKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW50ZXJwb2xhdGUoY3VycmVudC54LCBjdXJyZW50Lm4ueCwgMSwgbGlzdGVuZXIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC5uO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChpc1N1YmplY3QpIHtcbiAgICAgICAgICAgIHBvaW50cyA9IGN1cnJlbnQucC56O1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IHBvaW50cy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gcG9pbnRzW2ldKVswXSwgcG9pbnRbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpbnRlcnBvbGF0ZShjdXJyZW50LngsIGN1cnJlbnQucC54LCAtMSwgbGlzdGVuZXIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC5wO1xuICAgICAgICB9XG4gICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm87XG4gICAgICAgIHBvaW50cyA9IGN1cnJlbnQuejtcbiAgICAgICAgaXNTdWJqZWN0ID0gIWlzU3ViamVjdDtcbiAgICAgIH0gd2hpbGUgK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ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgIGludGVycG9sYXRlKG51bGwsIG51bGwsIDEsIGxpc3RlbmVyKTtcbiAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHBvbHlnb25TdGFydGVkKSBsaXN0ZW5lci5wb2x5Z29uRW5kKCksIHBvbHlnb25TdGFydGVkID0gZmFsc2U7XG4gICAgICAgICAgc2VnbWVudHMgPSBwb2x5Z29uID0gbnVsbDtcbiAgICAgICAgfSxcbiAgICAgICAgc3BoZXJlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBsaXN0ZW5lci5wb2x5Z29uU3RhcnQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBpbnRlcnBvbGF0ZShudWxsLCBudWxsLCAxLCBsaXN0ZW5lcik7XG4gICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25FbmQoKTtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIGZ1bmN0aW9uIHBvaW50KM67LCDPhikge1xuICAgICAgICB2YXIgcG9pbnQgPSByb3RhdGUozrssIM+GKTtcbiAgICAgICAgaWYgKHBvaW50VmlzaWJsZSjOuyA9IHBvaW50WzBdLCDPhiA9IHBvaW50WzFdKSkgbGlzdGVuZXIucG9pbnQozrssIM+GKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHBvaW50TGluZSjOuywgz4YpIHtcbiAgICAgICAgdmFyIHBvaW50ID0gcm90YXRlKM67LCDPhik7XG4gICAgICAgIGxpbmUucG9pbnQocG9pbnRbMF0sIHBvaW50WzFdKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGxpbmVTdGFydCgpIHtcbiAgICAgICAgY2xpcC5wb2ludCA9IHBvaW50TGluZTtcbiAgICAgICAgbGluZS5saW5lU3RhcnQoKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGxpbmVFbmQoKSB7XG4gICAgICAgIGNsaXAucG9pbnQgPSBwb2ludDtcbiAgICAgICAgbGluZS5saW5lRW5kKCk7XG4gICAgICB9XG4gICAgICB2YXIgc2VnbWVudHM7XG4gICAgICB2YXIgYnVmZmVyID0gZDNfZ2VvX2NsaXBCdWZmZXJMaXN0ZW5lcigpLCByaW5nTGlzdGVuZXIgPSBjbGlwTGluZShidWZmZXIpLCBwb2x5Z29uU3RhcnRlZCA9IGZhbHNlLCBwb2x5Z29uLCByaW5nO1xuICAgICAgZnVuY3Rpb24gcG9pbnRSaW5nKM67LCDPhikge1xuICAgICAgICByaW5nLnB1c2goWyDOuywgz4YgXSk7XG4gICAgICAgIHZhciBwb2ludCA9IHJvdGF0ZSjOuywgz4YpO1xuICAgICAgICByaW5nTGlzdGVuZXIucG9pbnQocG9pbnRbMF0sIHBvaW50WzFdKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHJpbmdTdGFydCgpIHtcbiAgICAgICAgcmluZ0xpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICByaW5nID0gW107XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiByaW5nRW5kKCkge1xuICAgICAgICBwb2ludFJpbmcocmluZ1swXVswXSwgcmluZ1swXVsxXSk7XG4gICAgICAgIHJpbmdMaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgIHZhciBjbGVhbiA9IHJpbmdMaXN0ZW5lci5jbGVhbigpLCByaW5nU2VnbWVudHMgPSBidWZmZXIuYnVmZmVyKCksIHNlZ21lbnQsIG4gPSByaW5nU2VnbWVudHMubGVuZ3RoO1xuICAgICAgICByaW5nLnBvcCgpO1xuICAgICAgICBwb2x5Z29uLnB1c2gocmluZyk7XG4gICAgICAgIHJpbmcgPSBudWxsO1xuICAgICAgICBpZiAoIW4pIHJldHVybjtcbiAgICAgICAgaWYgKGNsZWFuICYgMSkge1xuICAgICAgIC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G4gICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICBjbGVhbiA9IDE7XG4gICAgICB9LFxuICAgICAgcG9pbnQ6IGZ1bmN0aW9uKM67MSwgz4YxKSB7XG4gICAgICAgIHZhciBzzrsxID0gzrsxID4gMCA/IM+AIDogLc+ALCBkzrsgPSBhYnMozrsxIC0gzrswKTtcbiAgICAgICAgaWYgKGFicyhkzrsgLSDPgCkgPCDOtSkge1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KM67MCwgz4YwID0gKM+GMCArIM+GMSkgLyAyID4gMCA/IGhhbGbPgCA6IC1oYWxmz4ApO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzAsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzEsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQozrsxLCDPhjApO1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgfSBlbHNlIGlmIChzzrswICE9PSBzzrsxICYmIGTOuyA+PSDPgCkge1xuICAgICAgICAgIGlmIChhYnMozrswIC0gc867MCkgPCDOtSkgzrswIC09IHPOuzAgKiDOtTtcbiAgICAgICAgICBpZiAoYWJzKM67MSAtIHPOuzEpIDwgzrUpIM67MSAtPSBzzrsxICogzrU7XG4gICAgICAgICAgz4YwID0gZDNfZ2VvX2NsaXBBbnRpbWVyaWRpYW5JbnRlcnNlY3QozrswLCDPhjAsIM67MSwgz4YxKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrswLCDPhjApO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrsxLCDPhjApO1xuICAgICAgIC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bMV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgICAgIGlmICh2KSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDApO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBvaW50MCA9IHBvaW50MjtcbiAgICAgICAgICB9IGVsc2UgaWYgKG5vdEhlbWlzcGhlcmUgJiYgcG9pbnQwICYmIHNtYWxsUmFkaXVzIF4gdikge1xuICAgICAgICAgICAgdmFyIHQ7XG4gICAgICAgICAgICBpZiAoIShjICYgYzApICYmICh0ID0gaW50ZXJzZWN0KHBvaW50MSwgcG9pbnQwLCB0cnVlKSkpIHtcbiAgICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgICBpZiAoc21hbGxSYWRpdXMpIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzBdWzBdLCB0WzBdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh2ICYmICghcG9pbnQwIHx8ICFkM19nZW9fc3BoZXJpY2FsRXF1YWwocG9pbnQwLCBwb2ludDEpKSkge1xuICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQocG9pbnQxWzBdLCBwb2ludDFbMV0pO1xuICAgICAgICAgIH1cbiAgICAgICAgICBwb2ludDAgPSBwb2ludDEsIHYwID0gdiwgYzAgPSBjO1xuICAgICAgICB9LFxuICAgICAgICBsaW5lRW5kOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBpZiAodjApIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICBwb2ludDAgPSBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBjbGVhbjogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIGNsZWFuIHwgKHYwMCAmJiB2MCkgPDwgMTtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICB9XG4gICAgZnVuY3Rpb24gaW50ZXJzZWN0KGEsIGIsIHR3bykge1xuICAgICAgdmFyIHBhID0gZDNfZ2VvX2NhcnRlc2lhbihhKSwgcGIgPSBkM19nZW9fY2FydGVzaWFuKGIpO1xuICAgICAgdmFyIG4xID0gWyAxLCAwLCAwIF0sIG4yID0gZDNfZ2VvX2NhcnRlc2lhbkNyb3NzKHBhLCBwYiksIG4ybjIgPSBkM19nZW9fY2FydGVzaWFuRG90KG4yLCBuMiksIG4xbjIgPSBuMlswXSwgZGV0Z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LSBheSwgcjtcbiAgICAgIHIgPSB4MCAtIGF4O1xuICAgICAgaWYgKCFkeCAmJiByID4gMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeDtcbiAgICAgIGlmIChkeCA8IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR4ID4gMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH1cbiAgICAgIHIgPSB4MSAtIGF4O1xuICAgICAgaWYgKCFkeCAmJiByIDwgMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeDtcbiAgICAgIGlmIChkeCA8IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR4ID4gMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH1cbiAgICAgIHIgPSB5MCAtIGF5O1xuICAgICAgaWYgKCFkeSAmJiByID4gMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeTtcbiAgICAgIGlmIChkeSA8IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR5ID4gMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH1cbiAgICAgIHIgPSB5MSAtIGF5O1xuICAgICAgaWYgKCFkeSAmJiByIDwgMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeTtcbiAgICAgIGlmIChkeSA8IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJ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sZWFuICYmIGNsaXBTdGFydEluc2lkZSwgdmlzaWJsZSA9IHNlZ21lbnRzLmxlbmd0aDtcbiAgICAgICAgICBpZiAoaW5zaWRlIHx8IHZpc2libGUpIHtcbiAgICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25TdGFydCgpO1xuICAgICAgICAgICAgaWYgKGluc2lkZSkge1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgaW50ZXJwb2xhdGUobnVsbCwgbnVsbCwgMSwgbGlzdGVuZXIpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodmlzaWJsZSkge1xuICAgICAgICAgICAgICBkM19nZW9fY2xpcFBvbHlnb24oc2VnbWVudHMsIGNvbXBhcmUsIGNsaXBTdGFydEluc2lkZSwgaW50ZXJwb2xhdGUsIGxpc3RlbmVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25FbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgc2VnbWVudHMgPSBwb2x5Z29uID0gcmluZyA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBpbnNpZGVQb2x5Z29uKHApIHtcbiAgICAgICAgdmFyIHduID0gMCwgbiA9IHBvbHlnb24ubGVuZ3RoLCB5ID0gcFsxXTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICBmb3IgKHZhciBqID0gMSwgdiA9IHBvbHlnb25baV0sIG0gPSB2Lmxlbmd0aCwgYSA9IHZbMF0sIGI7IGogPCBtOyArK2opIHtcbiAgICAgICAgICAgIGIgPSB2W2pdO1xuICAgICAgICAgICAgaWYgKGFbMV0gPD0geSkge1xuICAgICAgICAgICAgICBpZiAoYlsxXSA+IHkgJiYgZDNfY3Jvc3MyZChhLCBiLCBwKSA+IDApICsrd247XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYlsxXSA8PSB5ICYmIGQzX2Nyb3NzMmQoYSwgYiwgcCkgPCAwKSAtLXduO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB3biAhPT0gMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGludGVycG9sYXRlKGZyb20sIHRvLCBkaXJlY3Rpb24sIGxpc3RlbmVyKSB7XG4gICAgICAgIHZhciBhID0gMCwgYTEgPSAwO1xuICAgICAgICBpZiAoZnJvbSA9PSBudWxsIHx8IChhID0gY29ybmVyKGZyb20sIGRpcmVjdGlvbikpICE9PSAoYTEgPSBjb3JuZXIodG8sIGRpcmVjdGlvbikpIHx8IGNvbXBhcmVQb2ludHMoZnJvbSwgdG8pIDwgMCBeIGRpcmVjdGlvbiA+IDApIHtcbiAgICAgICAgICBkbyB7XG4gICAgICAgICAgICBsaXN0ZW5lci5wb2ludChhID09PSAwIHx8IGEgPT09IDMgPyB4MCA6IHgxLCBhID4gMSA/IHkxIDogeTApO1xuICAgICAgICAgIH0gd2hpbGUgKChhID0gKGEgKyBkaXJlY3Rpb24gKyA0KSAlIDQpICE9PSBhMSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQodG9bMF0sIHRvWzFdKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcG9pbnRWaXNpYmxlKHgsIHkpIHtcbiAgICAgICAgcmV0dXJuIHgwIDw9IHggJiYgeCA8PSB4MSAmJiB5MCA8PSB5ICYmIHkgPD0geTE7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBwb2ludCh4LCB5KSB7XG4gICAgICAgIGlmIChwb2ludFZpc2libGUoeCwgeSkpIGxpc3RlbmVyLnBvaW50KHgsIHkpO1x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yA9IHksIHZfXyA9IHY7XG4gICAgICAgICAgZmlyc3QgPSBmYWxzZTtcbiAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh4LCB5KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKHYgJiYgdl8pIGxpc3RlbmVyLnBvaW50KHgsIHkpOyBlbHNlIHtcbiAgICAgICAgICAgIHZhciBsID0ge1xuICAgICAgICAgICAgICBhOiB7XG4gICAgICAgICAgICAgICAgeDogeF8sXG4gICAgICAgICAgICAgICAgeTogeV9cbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgYjoge1xuICAgICAgICAgICAgICAgIHg6IHgsXG4gICAgICAgICAgICAgICAgeTogeVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGNsaXBMaW5lKGwpKSB7XG4gICAgICAgICAgICAgIGlmICghdl8pIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChsLmEueCwgbC5hLnkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KGwuYi54LCBsLmIueSk7XG4gICAgICAgICAgICAgIGlmICghdikgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh2KSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh4LCB5KTtcbiAgICAgICAgICAgICAgY2xlYW4gPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgeF8gPSB4L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ICAgICBrID0gK187XG4gICAgICByZXR1cm4gcmVzZXQoKTtcbiAgICB9O1xuICAgIHByb2plY3Rpb24udHJhbnNsYXRlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gWyB4LCB5IF07XG4gICAgICB4ID0gK19bMF07XG4gICAgICB5ID0gK19bMV07XG4gICAgICByZXR1cm4gcmVzZXQoKTtcbiAgICB9O1xuICAgIHByb2plY3Rpb24uY2VudGVyID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gWyDOuyAqIGQzX2RlZ3JlZXMsIM+GICogZDNfZGVncmVlcyBdO1xuICAgICAgzrsgPSBfWzBdICUgMzYwICogZDNfcmFkaWFucztcbiAgICAgIM+GID0gX1sxXSAlIDM2MCAqIGQzX3JhZGlhbnM7XG4gICAgICByZXR1cm4gcmVzZXQoKTtcbiAgICB9O1xuICAgIHByb2plY3Rpb24ucm90YXRlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gWyDOtM67ICogZDNfZGVncmVlcywgzrTPhiAqIGQzX2RlZ3JlZXMsIM60zrMgKiBkM19kZWdyZWVzIF07XG4gICAgICDOtM67ID0gX1swXSAlIDM2MCAqIGQzX3JhZGlhbnM7XG4gICAgICDOtM+GID0gX1sxXSAlIDM2MCAqIGQzX3JhZGlhbnM7XG4gICAgICDOtM6zID0gXy5sZW5ndGggPiAyID8gX1syXSAlIDM2MCAqIGQzX3JhZGlhbnMgOiAwO1xuICAgICAgcmV0dXJuIHJlc2V0KCk7XG4gICAgfTtcbiAgICBkMy5yZWJpbmQocHJvamVjdGlvbiwgcHJvamVjdFJlc2FtcGxlLCBcInByZWNpc2lvblwiKTtcbiAgICBmdW5jdGlvbiByZXNldCgpIHtcbiAgICAgIHByb2plY3RSb3RhdGUgPSBkM19nZW9fY29tcG9zZShyb3Rh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CF2YSkgdmEgPSB7XG4gICAgICAgICAgeDogZngsXG4gICAgICAgICAgeTogeTFcbiAgICAgICAgfTsgZWxzZSBpZiAodmEueSA8IHkwKSByZXR1cm47XG4gICAgICAgIHZiID0ge1xuICAgICAgICAgIHg6IGZ4LFxuICAgICAgICAgIHk6IHkwXG4gICAgICAgIH07XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGZtID0gKGx4IC0gcngpIC8gKHJ5IC0gbHkpO1xuICAgICAgZmIgPSBmeSAtIGZtICogZng7XG4gICAgICBpZiAoZm0gPCAtMSB8fCBmbSA+IDEpIHtcbiAgICAgICAgaWYgKGx4ID4gcngpIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6ICh5MCAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTBcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS55ID49IHkxKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiAoeTEgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkxXG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6ICh5MSAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTFcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS55IDwgeTApIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6ICh5MCAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTBcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAobHkgPCByeSkge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogeDAsXG4gICAgICAgICAgICB5OiBmbSAqIHgwICsgZmJcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS54ID49IHg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W5jbGUgJiYgdW5jbGUuQykge1xuICAgICAgICAgICAgcGFyZW50LkMgPSB1bmNsZS5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgYWZ0ZXIgPSBncmFuZHBhO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoYWZ0ZXIgPT09IHBhcmVudC5SKSB7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgICBhZnRlciA9IHBhcmVudDtcbiAgICAgICAgICAgICAgcGFyZW50ID0gYWZ0ZXIuVTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmVudC5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBncmFuZHBhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdW5jbGUgPSBncmFuZHBhLkw7XG4gICAgICAgICAgaWYgKHVuY2xlICYmIHVuY2xlLkMpIHtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdW5jbGUuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZ3JhbmRwYS5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGFmdGVyID0gZ3JhbmRwYTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGFmdGVyID09PSBwYXJlbnQuTCkge1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICAgIGFmdGVyID0gcGFyZW50O1xuICAgICAgICAgICAgICBwYXJlbnQgPSBhZnRlci5VO1xuICAgICAgICAgICAgfVxuIC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h0KSB7XG4gICAgICAgICAgcGFyZW50ID0gbmV4dC5VO1xuICAgICAgICAgIG5leHQuVSA9IG5vZGUuVTtcbiAgICAgICAgICBub2RlID0gbmV4dC5SO1xuICAgICAgICAgIHBhcmVudC5MID0gbm9kZTtcbiAgICAgICAgICBuZXh0LlIgPSByaWdodDtcbiAgICAgICAgICByaWdodC5VID0gbmV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBuZXh0LlUgPSBwYXJlbnQ7XG4gICAgICAgICAgcGFyZW50ID0gbmV4dDtcbiAgICAgICAgICBub2RlID0gbmV4dC5SO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZWQgPSBub2RlLkM7XG4gICAgICAgIG5vZGUgPSBuZXh0O1xuICAgICAgfVxuICAgICAgaWYgKG5vZGUpIG5vZGUuVSA9IHBhcmVudDtcbiAgICAgIGlmIChyZWQpIHJldHVybjtcbiAgICAgIGlmIChub2RlICYmIG5vZGUuQykge1xuICAgICAgICBub2RlLkMgPSBmYWxzZTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgZG8ge1xuICAgICAgICBpZiAobm9kZSA9PT0gdGhpcy5fKSBicmVhaztcbiAgICAgICAgaWYgKG5vZGUgPT09IHBhcmVudC5MKSB7XG4gICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgIGlmIChzaWJsaW5nLkMpIHtcbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IGZhbHNlO1xuICAgICAgICAgICAgcGFyZW50LkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzaWJsaW5nLkwgJiYgc2libGluZy5MLkMgfHwgc2libGluZy5SICYmIHNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICBpZiAoIXNpYmxpbmcuUiB8fCAhc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgICAgc2libGluZy5MLkMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBzaWJsaW5nKTtcbiAgICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2libGluZy5DID0gcGFyZW50LkM7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHNpYmxpbmcuUi5DID0gZmFsc2U7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIG5vZGUgPSB0aGlzLl87XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgIGlmIChzaWJsaW5nLkMpIHtcbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IGZhbHNlO1xuICAgICAgICAgICAgcGFyZW50LkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc2libGluZy5MICYmIHNpYmxpbmcuTC5DIHx8IHNpYmxpbmcuUiAmJiBzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgaWYgKCFzaWJsaW5nLkwgfHwgIXNpYmxpbmcuTC5DKSB7XG4gICAgICAgICAgICAgIHNpYmxpbmcuUi5DID0gZmFsc2U7XG4gICAgICAgICAgICAgIHNpYmxpbmcuQ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ICAgICBpZiAoeV8gPCB5MV8pIHkxXyA9IHlfO1xuICAgICAgICAgIGlmICh4XyA+IHgyXykgeDJfID0geF87XG4gICAgICAgICAgaWYgKHlfID4geTJfKSB5Ml8gPSB5XztcbiAgICAgICAgICB4cy5wdXNoKHhfKTtcbiAgICAgICAgICB5cy5wdXNoKHlfKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIGR4ID0geDJfIC0geDFfLCBkeSA9IHkyXyAtIHkxXztcbiAgICAgIGlmIChkeCA+IGR5KSB5Ml8gPSB5MV8gKyBkeDsgZWxzZSB4Ml8gPSB4MV8gKyBkeTtcbiAgICAgIGZ1bmN0aW9uIGluc2VydChuLCBkLCB4LCB5LCB4MSwgeTEsIHgyLCB5Mikge1xuICAgICAgICBpZiAoaXNOYU4oeCkgfHwgaXNOYU4oeSkpIHJldHVybjtcbiAgICAgICAgaWYgKG4ubGVhZikge1xuICAgICAgICAgIHZhciBueCA9IG4ueCwgbnkgPSBuLnk7XG4gICAgICAgICAgaWYgKG54ICE9IG51bGwpIHtcbiAgICAgICAgICAgIGlmIChhYnMobnggLSB4KSArIGFicyhueSAtIHkpIDwgLjAxKSB7XG4gICAgICAgICAgICAgIGluc2VydENoaWxkKG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHZhciBuUG9pbnQgPSBuLnBvaW50O1xuICAgICAgICAgICAgICBuLnggPSBuLnkgPSBuLnBvaW50ID0gbnVsbDtcbiAgICAgICAgICAgICAgaW5zZXJ0Q2hpbGQobiwgblBvaW50LCBueCwgbnksIHgxLCB5MSwgeDIsIHkyKTtcbiAgICAgICAgICAgICAgaW5zZXJ0Q2hpbGQobiwgZCwgeCwgeSwgeDEsIHkxLCB4MiwgeTIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBuLnggPSB4LCBuLnkgPSB5LCBuLnBv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4pKTtcbiAgICAgICAgayArPSB4O1xuICAgICAgfVxuICAgICAgaWYgKHNvcnRHcm91cHMpIHtcbiAgICAgICAgZ3JvdXBJbmRleC5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcbiAgICAgICAgICByZXR1cm4gc29ydEdyb3Vwcyhncm91cFN1bXNbYV0sIGdyb3VwU3Vtc1tiXSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgaWYgKHNvcnRTdWJncm91cHMpIHtcbiAgICAgICAgc3ViZ3JvdXBJbmRleC5mb3JFYWNoKGZ1bmN0aW9uKGQsIGkpIHtcbiAgICAgICAgICBkLnNvcnQoZnVuY3Rpb24oYSwgYikge1xuICAgICAgICAgICAgcmV0dXJuIHNvcnRTdWJncm91cHMobWF0cml4W2ldW2FdLCBtYXRyaXhbaV1bYl0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGsgPSAoz4QgLSBwYWRkaW5nICogbikgLyBrO1xuICAgICAgeCA9IDAsIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIHgwID0geCwgaiA9IC0xO1xuICAgICAgICB3aGlsZSAoKytqIDwgbikge1xuICAgICAgICAgIHZhciBkaSA9IGdyb3VwSW5kZXhbaV0sIGRqID0gc3ViZ3JvdXBJbmRleFtkaV1bal0sIHYgPSBtYXRyaXhbZGldW2RqXSwgYTAgPSB4LCBhMSA9IHggKz0gdiAqIGs7XG4gICAgICAgICAgc3ViZ3JvdXBzW2RpICsgXCItXCIgKyBkal0gPSB7XG4gICAgICAgICAgICBpbmRleDogZGksXG4gICAgICAgICAgICBzdWJpbmRleDogZGosXG4gICAgICAgICAgICBzdGFydEFuZ2xlOiBhMCxcbiAgICAgICAgICAgIGVuZEFuZ2xlOiBhMSxcbiAgICAgICAgICAgIHZhbHVlOiB2XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBncm91cHNbZGldID0ge1xuICAgICAgICAgIGluZGV4OiBkaSxcbiAgICAgICAgICBzdGFydEFuZ2xlOiB4MCxcbiAgICAgICAgICBlbmRBbmdsZTogeCxcbiAgICAgICAgICB2YWx1ZTogZ3JvdXBTdW1zW2RpXVxuICAgICAgICB9O1xuICAgICAgICB4ICs9IHBhZGRpbmc7XG4gICAgICB9XG4gICAgICBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBqID0gaSAtIDE7XG4gICAgICAgIHdoaWxlICgrK2ogPCBuKSB7XG4gICAgICAgICAgdmFyIHNvdXJjZSA9IHN1Ymdyb3Vwc1tpICsgXCItXCIgKyBqXSwgdGFyZ2V0ID0gc3ViZ3JvdXBzW2ogKyBcIi1cIiArIGldO1xuICAgICAgICAgIGlmIChzb3VyY2UudmFsdWUgfHwgdGFyZ2V0LnZhbHVlKSB7XG4gICAgICAgICAgICBjaG9yZHMucHVzaChzb3VyY2UudmFsdWUgPCB0YXJnZXQudmFsdWUgPyB7XG4gICAgICAgICAgICAgIHNvdXJjZTogdGFyZ2V0LFxuICAgICAgICAgICAgICB0YXJnZXQ6IHNvdXJjZVxuICAgICAgICAgICAgfSA6IHtcbiAgICAgICAgICAgICAgc291cmNlOiBzb3VyY2UsXG4gICAgICAgICAgICAgIHRhcmdldDogdGFyZ2V0XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChzb3J0Q2hvcmRzKSByZXNvcnQoKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmVzb3J0KCkge1xuICAgICAgY2hvcmRzLnNvcnQoZnVuY3Rpb24oYSwgYikge1xuICAgICAgICByZXR1cm4gc29ydENob3JkcygoYS5zb3VyY2UudmFsdWUgKyBhLnRhcmdldC52YWx1ZSkgLyAyLCAoYi5zb3VyY2UudmFsdWUgKyBiLnRhcmdldC52YWx1ZSkgLyAyKTtcbiAgICAgIH0pO1xuICAgIH1cbiAgICBjaG9y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keTtcbiAgICAgICAgICBpZiAoZHcgKiBkdyAvIHRoZXRhMiA8IGRuKSB7XG4gICAgICAgICAgICBpZiAoZG4gPCBjaGFyZ2VEaXN0YW5jZTIpIHtcbiAgICAgICAgICAgICAgdmFyIGsgPSBxdWFkLmNoYXJnZSAvIGRuO1xuICAgICAgICAgICAgICBub2RlLnB4IC09IGR4ICogaztcbiAgICAgICAgICAgICAgbm9kZS5weSAtPSBkeSAqIGs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHF1YWQucG9pbnQgJiYgZG4gJiYgZG4gPCBjaGFyZ2VEaXN0YW5jZTIpIHtcbiAgICAgICAgICAgIHZhciBrID0gcXVhZC5wb2ludENoYXJnZSAvIGRuO1xuICAgICAgICAgICAgbm9kZS5weCAtPSBkeCAqIGs7XG4gICAgICAgICAgICBub2RlLnB5IC09IGR5ICogaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICFxdWFkLmNoYXJnZTtcbiAgICAgIH07XG4gICAgfVxuICAgIGZvcmNlLnRpY2sgPSBmdW5jdGlvbigpIHtcbiAgICAgIGlmICgoYWxwaGEgKj0gLjk5KSA8IC4wMDUpIHtcbiAgICAgICAgdGltZXIgPSBudWxsO1xuICAgICAgICBldmVudC5lbmQoe1xuICAgICAgICAgIHR5cGU6IFwiZW5kXCIsXG4gICAgICAgICAgYWxwaGE6IGFscGhhID0gMFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9XG4gICAgICB2YXIgbiA9IG5vZGVzLmxlbmd0aCwgbSA9IGxpbmtzLmxlbmd0aCwgcSwgaSwgbywgcywgdCwgbCwgaywgeCwgeTtcbiAgICAgIGZvciAoaSA9IDA7IGkgPCBtOyArK2kpIHtcbiAgICAgICAgbyA9IGxpbmtzW2ldO1xuICAgICAgICBzID0gby5zb3VyY2U7XG4gICAgICAgIHQgPSBvLnRhcmdldDtcbiAgICAgICAgeCA9IHQueCAtIHMueDtcbiAgICAgICAgeSA9IHQueSAtIHMueTtcbiAgICAgICAgaWYgKGwgPSB4ICogeCArIHkgKiB5KSB7XG4gICAgICAgICAgbCA9IGFscGhhICogc3RyZW5ndGhzW2ldICogKChsID0gTWF0aC5zcXJ0KGwpKSAtIGRpc3RhbmNlc1tpXSkgLyBsO1xuICAgICAgICAgIHggKj0gbDtcbiAgICAgICAgICB5ICo9IGw7XG4gICAgICAgICAgdC54IC09IHggKiAoayA9IHMud2VpZ2h0ICsgdC53ZWlnaHQgPyBzLndlaWdodCAvIChzLndlaWdodCArIHQud2VpZ2h0KSA6IC41KTtcbiAgICAgICAgICB0LnkgLT0geSAqIGs7XG4gICAgICAgICAgcy54ICs9IHggKiAoayA9IDEgLSBrKTtcbiAgICAgICAgICBzLnkgKz0geSAqIGs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChrID0gYWxwaGEgKiBncmF2aXR5KSB7XG4gICAgICAgIHggPSBzaXplWzBdIC8gMjtcbiAgICAgICAgeSA9IHNpemVbMV0gLyAyO1xuICAgICAgICBpID0gLTE7XG4gICAgICAgIGlmIChrKSB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSBub2Rlc1tpXTtcbiAgICAgICAgICBvLnggKz0gKHggLSBvLngpICogaztcbiAgICAgICAgICBvLnkgKz0gKHkgLSBvLnkpICogaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGNoYXJnZSkge1xuICAgICAgICBkM19sYXlvdXRfZm9yY2VBY2N1bXVsYXRlKHEgPSBkMy5nZW9tLnF1YWR0cmVlKG5vZGVzKSwgYWxwaGEsIGNoYXJnZXMpO1xuICAgICAgICBpID0gLTE7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgaWYgKCEobyA9IG5vZGVzW2ldKS5maXhlZCkge1xuICAgICAgICAgICAgcS52aXNpdChyZXB1bHNlKG8pKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIG8gPSBub2Rlc1tpXTtcbiAgICAgICAgaWYgKG8uZml4ZWQpIHtcbiAgICAgICAgICBvLnggPSBvLnB4O1xuICAgICAgICAgIG8ueSA9IG8ucHk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgby54IC09IChvLnB4IC0gKG8ucHggPSBvLngpKSAqIGZyaWN0aW9uO1xuICAgICAgICAgIG8ueSAtPSAoby5weSAtIChvLnB5ID0gby55KSkgKiBmcmljdGlvbjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZXZlbnQudGljayh7XG4gICAgICAgIHR5cGU6IFwidGlja1wiLFxuICAgICAgICBhbHBoYTogYWxwaGFcbiAgICAgIH0pO1xuICAgIH07XG4gICAgZm9yY2Uubm9kZXMgPSBmdW5jdGlvbih4KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBub2RlcztcbiAgICAgIG5vZGVzID0geDtcbiAgICAgIHJldHVybiBmb3JjZTtcbiAgICB9O1xuICAgIGZvcmNlLmxpbmtzID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbGlua3M7XG4gICAgICBsaW5rcyA9IHg7XG4gICAgICByZXR1cm4gZm9yY2U7XG4gICAgfTtcbiAgICBmb3JjZS5zaXplID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2l6ZTtcbiAgICAgIHNpemUgPSB4O1xuICAgICAgcmV0dXJuIGZvcmNlO1xuICAgIH07XG4gICAgZm9yY2UubGlua0Rpc3RhbmNlID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1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0gbGlua3MubGVuZ3RoLCB3ID0gc2l6ZVswXSwgaCA9IHNpemVbMV0sIG5laWdoYm9ycywgbztcbiAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgKG8gPSBub2Rlc1tpXSkuaW5kZXggPSBpO1xuICAgICAgICBvLndlaWdodCA9IDA7XG4gICAgICB9XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbTsgKytpKSB7XG4gICAgICAgIG8gPSBsaW5rc1tpXTtcbiAgICAgICAgaWYgKHR5cGVvZiBvLnNvdXJjZSA9PSBcIm51bWJlclwiKSBvLnNvdXJjZSA9IG5vZGVzW28uc291cmNlXTtcbiAgICAgICAgaWYgKHR5cGVvZiBvLnRhcmdldCA9PSBcIm51bWJlclwiKSBvLnRhcmdldCA9IG5vZGVzW28udGFyZ2V0XTtcbiAgICAgICAgKytvLnNvdXJjZS53ZWlnaHQ7XG4gICAgICAgICsrby50YXJnZXQud2VpZ2h0O1xuICAgICAgfVxuICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICBvID0gbm9kZXNbaV07XG4gICAgICAgIGlmIChpc05hTihvLngpKSBvLnggPSBwb3NpdGlvbihcInhcIiwgdyk7XG4gICAgICAgIGlmIChpc05hTihvLnkpKSBvLnkgPSBwb3NpdGlvbihcInlcIiwgaCk7XG4gICAgICAgIGlmIChpc05hTihvLnB4KSkgby5weCA9IG8ueDtcbiAgICAgICAgaWYgKGlzTmFOKG8ucHkpKSBvLnB5ID0gby55O1xuICAgICAgfVxuICAgICAgZGlzdGFuY2VzID0gW107XG4gICAgICBpZiAodHlwZW9mIGxpbmtEaXN0YW5jZSA9PT0gXCJmdW5jdGlvblwiKSBmb3IgKGkgPSAwOyBpIDwgbTsgKytpKSBkaXN0YW5jZXNbaV0gPSArbGlua0Rpc3RhbmNlLmNhbGwodGhpcywgbGlua3NbaV0sIGkpOyBlbHNlIGZvciAoaSA9IDA7IGkgPCBtOyArK2kpIGRpc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Ck7XG4gICAgfVxuICAgIG5vZGVzLmZvckVhY2goZDNfbGF5b3V0X3BhY2tMaW5rKTtcbiAgICBhID0gbm9kZXNbMF07XG4gICAgYS54ID0gLWEucjtcbiAgICBhLnkgPSAwO1xuICAgIGJvdW5kKGEpO1xuICAgIGlmIChuID4gMSkge1xuICAgICAgYiA9IG5vZGVzWzFdO1xuICAgICAgYi54ID0gYi5yO1xuICAgICAgYi55ID0gMDtcbiAgICAgIGJvdW5kKGIpO1xuICAgICAgaWYgKG4gPiAyKSB7XG4gICAgICAgIGMgPSBub2Rlc1syXTtcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tQbGFjZShhLCBiLCBjKTtcbiAgICAgICAgYm91bmQoYyk7XG4gICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGEsIGMpO1xuICAgICAgICBhLl9wYWNrX3ByZXYgPSBjO1xuICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChjLCBiKTtcbiAgICAgICAgYiA9IGEuX3BhY2tfbmV4dDtcbiAgICAgICAgZm9yIChpID0gMzsgaSA8IG47IGkrKykge1xuICAgICAgICAgIGQzX2xheW91dF9wYWNrUGxhY2UoYSwgYiwgYyA9IG5vZGVzW2ldKTtcbiAgICAgICAgICB2YXIgaXNlY3QgPSAwLCBzMSA9IDEsIHMyID0gMTtcbiAgICAgICAgICBmb3IgKGogPSBiLl9wYWNrX25leHQ7IGogIT09IGI7IGogPSBqLl9wYWNrX25leHQsIHMxKyspIHtcbiAgICAgICAgICAgIGlmIChkM19sYXlvdXRfcGFja0ludGVyc2VjdHMoaiwgYykpIHtcbiAgICAgICAgICAgICAgaXNlY3QgPSAxO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzZWN0ID09IDEpIHtcbiAgICAgICAgICAgIGZvciAoayA9IGEuX3BhY2tfcHJldjsgayAhPT0gai5fcGFja19wcmV2OyBrID0gay5fcGFja19wcmV2LCBzMisrKSB7XG4gICAgICAgICAgICAgIGlmIChkM19sYXlvdXRfcGFja0ludGVyc2VjdHMoaywgYykpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNlY3QpIHtcbiAgICAgICAgICAgIGlmIChzMSA8IHMyIHx8IHMxID09IHMyICYmIGIuciA8IGEucikgZDNfbGF5b3V0X3BhY2tTcGxpY2UoYSwgYiA9IGopOyBlbHNlIGQzX2xheW91dF9wYWNrU3BsaWNlKGEgPSBrLCBiKTtcbiAgICAgICAgICAgIGktLTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYSwgYyk7XG4gICAgICAgICAgICBiID0gYztcbiAgICAgICAgICAgIGJvdW5kKGMpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICB2YXIgY3ggPSAoeE1pbiArIHhNYXgpIC8gMiwgY3kgPSAoeU1pbiArIHlNYXgpIC8gMiwgY3IgPSAwO1xuICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspIHtcbiAgICAgIGMgPSBub2Rlc1tpXTtcbiAgICAgIGMueCAtPSBjeDtcbiAgICAgIGMueSAtPSBjeTtcbiAgICAgIGNyID0gTWF0aC5tYXgoY3IsIGMuciArIE1hdGguc3FydChjLnggKiBjLnggKyBjLnkgKiBjLnkpKTtcbiAgICB9XG4gICAgbm9kZS5yID0gY3I7XG4gICAgbm9kZXMuZm9yRWFjaChkM19sYXlvdXRfcGFja1VubGluayk7XG4gIH1cbiAgZnVuY3Rpb24gZDNfbGF5b3V0X3BhY2tMaW5rKG5vZGUpIHtcbiAgICBub2RlLl9wYWNrX25leHQgPSBub2RlLl9wYWNrX3ByZXYgPSBub2RlO1xuICB9XG4gIGZ1bmN0aW9uIGQzX2xheW91dF9wYWNrVW5saW5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iBudWxsLFxuICAgICAgICAgICAgejogMCxcbiAgICAgICAgICAgIG06IDAsXG4gICAgICAgICAgICBjOiAwLFxuICAgICAgICAgICAgczogMCxcbiAgICAgICAgICAgIHQ6IG51bGwsXG4gICAgICAgICAgICBpOiBpXG4gICAgICAgICAgfSkuYSA9IGNoaWxkKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHJvb3QxLmNoaWxkcmVuWzBdO1xuICAgIH1cbiAgICBmdW5jdGlvbiBmaXJzdFdhbGsodikge1xuICAgICAgdmFyIGNoaWxkcmVuID0gdi5jaGlsZHJlbiwgc2libGluZ3MgPSB2LnBhcmVudC5jaGlsZHJlbiwgdyA9IHYuaSA/IHNpYmxpbmdzW3YuaSAtIDFdIDogbnVsbDtcbiAgICAgIGlmIChjaGlsZHJlbi5sZW5ndGgpIHtcbiAgICAgICAgZDNfbGF5b3V0X3RyZWVTaGlmdCh2KTtcbiAgICAgICAgdmFyIG1pZHBvaW50ID0gKGNoaWxkcmVuWzBdLnogKyBjaGlsZHJlbltjaGlsZHJlbi5sZW5ndGggLSAxXS56KSAvIDI7XG4gICAgICAgIGlmICh3KSB7XG4gICAgICAgICAgdi56ID0gdy56ICsgc2VwYXJhdGlvbih2Ll8sIHcuXyk7XG4gICAgICAgICAgdi5tID0gdi56IC0gbWlkcG9pbnQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdi56ID0gbWlkcG9pbnQ7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAodykge1xuICAgICAgICB2LnogPSB3LnogKyBzZXBhcmF0aW9uKHYuXywgdy5fKTtcbiAgICAgIH1cbiAgICAgIHYucGFyZW50LkEgPSBhcHBvcnRpb24odiwgdywgdi5wYXJlbnQuQSB8fCBzaWJsaW5nc1swXSk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNlY29uZFdhbGsodikge1xuICAgICAgdi5fLnggPSB2LnogKyB2LnBhcmVudC5tO1xuICAgICAgdi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ljZVwiID8gcmVjdC5keCA6IG1vZGUgPT09IFwiZGljZVwiID8gcmVjdC5keSA6IG1vZGUgPT09IFwic2xpY2UtZGljZVwiID8gbm9kZS5kZXB0aCAmIDEgPyByZWN0LmR5IDogcmVjdC5keCA6IE1hdGgubWluKHJlY3QuZHgsIHJlY3QuZHkpLCBuO1xuICAgICAgICBzY2FsZShyZW1haW5pbmcsIHJlY3QuZHggKiByZWN0LmR5IC8gbm9kZS52YWx1ZSk7XG4gICAgICAgIHJvdy5hcmVhID0gMDtcbiAgICAgICAgd2hpbGUgKChuID0gcmVtYWluaW5nLmxlbmd0aCkgPiAwKSB7XG4gICAgICAgICAgcm93LnB1c2goY2hpbGQgPSByZW1haW5pbmdbbiAtIDFdKTtcbiAgICAgICAgICByb3cuYXJlYSArPSBjaGlsZC5hcmVhO1xuICAgICAgICAgIGlmIChtb2RlICE9PSBcInNxdWFyaWZ5XCIgfHwgKHNjb3JlID0gd29yc3Qocm93LCB1KSkgPD0gYmVzdCkge1xuICAgICAgICAgICAgcmVtYWluaW5nLnBvcCgpO1xuICAgICAgICAgICAgYmVzdCA9IHNjb3JlO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByb3cuYXJlYSAtPSByb3cucG9wKCkuYXJlYTtcbiAgICAgICAgICAgIHBvc2l0aW9uKHJvdywgdSwgcmVjdCwgZmFsc2UpO1xuICAgICAgICAgICAgdSA9IE1hdGgubWluKHJlY3QuZHgsIHJlY3QuZHkpO1xuICAgICAgICAgICAgcm93Lmxlbmd0aCA9IHJvdy5hcmVhID0gMDtcbiAgICAgICAgICAgIGJlc3QgPSBJbmZpbml0eTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJvdy5sZW5ndGgpIHtcbiAgICAgICAgICBwb3NpdGlvbihyb3csIHUsIHJlY3QsIHRydWUpO1xuICAgICAgICAgIHJvdy5sZW5ndGggPSByb3cuYXJlYSA9IDA7XG4gICAgICAgIH1cbiAgICAgIC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ICBpZiAociA8IHJtaW4pIHJtaW4gPSByO1xuICAgICAgICBpZiAociA+IHJtYXgpIHJtYXggPSByO1xuICAgICAgfVxuICAgICAgcyAqPSBzO1xuICAgICAgdSAqPSB1O1xuICAgICAgcmV0dXJuIHMgPyBNYXRoLm1heCh1ICogcm1heCAqIHJhdGlvIC8gcywgcyAvICh1ICogcm1pbiAqIHJhdGlvKSkgOiBJbmZpbml0eTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcG9zaXRpb24ocm93LCB1LCByZWN0LCBmbHVzaCkge1xuICAgICAgdmFyIGkgPSAtMSwgbiA9IHJvdy5sZW5ndGgsIHggPSByZWN0LngsIHkgPSByZWN0LnksIHYgPSB1ID8gcm91bmQocm93LmFyZWEgLyB1KSA6IDAsIG87XG4gICAgICBpZiAodSA9PSByZWN0LmR4KSB7XG4gICAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keSkgdiA9IHJlY3QuZHk7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IHJvd1tpXTtcbiAgICAgICAgICBvLnggPSB4O1xuICAgICAgICAgIG8ueSA9IHk7XG4gICAgICAgICAgby5keSA9IHY7XG4gICAgICAgICAgeCArPSBvLmR4ID0gTWF0aC5taW4ocmVjdC54ICsgcmVjdC5keCAtIHgsIHYgPyByb3VuZChvLmFyZWEgLyB2KSA6IDApO1xuICAgICAgICB9XG4gICAgICAgIG8ueiA9IHRydWU7XG4gICAgICAgIG8uZHggKz0gcmVjdC54ICsgcmVjdC5keCAtIHg7XG4gICAgICAgIHJlY3QueSArPSB2O1xuICAgICAgICByZWN0LmR5IC09IHY7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoZmx1c2ggfHwgdiA+IHJlY3QuZHgpIHYgPSByZWN0LmR4O1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSByb3dbaV07XG4gICAgICAgICAgby54ID0geDtcbiAgICAgICAgICBvLnkgPSB5O1xuICAgICAgICAgIG8uZHggPSB2O1xuICAgICAgICAgIHkgKz0gby5keSA9IE1hdGgubWluKHJlY3QueSArIHJlY3QuZHkgLSB5LCB2ID8gcm91bmQoby5hcmVhIC8gdikgOiAwKTtcbiAgICAgICAgfVxuICAgICAgICBvLnogPSBmYWxzZTtcbiAgICAgICAgby5keSArPSByZWN0LnkgKyByZWN0LmR5IC0geTtcbiAgICAgICAgcmVjdC54ICs9IHY7XG4gICAgICAgIHJlY3QuZHggLT0gdjtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gdHJlZW1hcChkKSB7XG4gICAgICB2YXIgbm9kZXMgPSBzdGlja2llcyB8fCBoaWVyYXJjaHkoZCksIHJvb3QgPSBub2Rlc1swXTtcbiAgICAgIHJvb3QueCA9IHJvb3QueSA9IDA7XG4gICAgICBpZiAocm9vdC52YWx1ZSkgcm9vdC5keCA9IHNpemVbMF0sIHJvb3QuZHkgPSBzaXplWzFdOyBlbHNlIHJvb3QuZHggPSByb290LmR5ID0gMDtcbiAgICAgIGlmIChzdGlja2llcykgaGllcmFyY2h5LnJldmFsdWUocm9vdCk7XG4gICAgICBzY2FsZShbIHJvb3QgXSwgcm9vdC5keCAqIHJvb3QuZHkgLyByb290LnZhbHVlKTtcbiAgICAgIChzdGlja2llcyA/IHN0aWNraWZ5IDogc3F1YXJpZnkpKHJvb3QpO1xuICAgICAgaWYgKHN0aWNreSkgc3RpY2tpZXMgPSBub2RlcztcbiAgICAgIHJldHVybiBub2RlcztcbiAgICB9XG4gICAgdHJlZW1hcC5zaXplID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2l6ZTtcbiAgICAgIHNpemUgPSB4O1xuICAgICAgcmV0dXJuIHRyZWVtYXA7XG4gICAgfTtcbiAgICB0cmVlbWFwLnBhZGRpbmcgPSBmdW5jdGlvbih4KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5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gICAgIGR5ID0gMDtcbiAgICB9XG4gICAgcmV0dXJuIHtcbiAgICAgIHg6IHgsXG4gICAgICB5OiB5LFxuICAgICAgZHg6IGR4LFxuICAgICAgZHk6IGR5XG4gICAgfTtcbiAgfVxuICBkMy5yYW5kb20gPSB7XG4gICAgbm9ybWFsOiBmdW5jdGlvbijCtSwgz4MpIHtcbiAgICAgIHZhciBuID0gYXJndW1lbnRzLmxlbmd0aDtcbiAgICAgIGlmIChuIDwgMikgz4MgPSAxO1xuICAgICAgaWYgKG4gPCAxKSDCtSA9IDA7XG4gICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciB4LCB5LCByO1xuICAgICAgICBkbyB7XG4gICAgICAgICAgeCA9IE1hdGgucmFuZG9tKCkgKiAyIC0gMTtcbiAgICAgICAgICB5ID0gTWF0aC5yYW5kb20oKSAqIDIgLSAxO1xuICAgICAgICAgIHIgPSB4ICogeCArIHkgKiB5O1xuICAgICAgICB9IHdoaWxlICghciB8fCByID4gMSk7XG4gICAgICAgIHJldHVybiDCtSArIM+DICogeCAqIE1hdGguc3FydCgtMiAqIE1hdGgubG9nKHIpIC8gcik7XG4gICAgICB9O1xuICAgIH0sXG4gICAgbG9nTm9ybWFsOiBmdW5jdGlvbigpIHtcbiAgICAgIHZhciByYW5kb20gPSBkMy5yYW5kb20ubm9ybWFsLmFwcGx5KGQzLCBhcmd1bWVudHMpO1xuICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gTWF0aC5leHAocmFuZG9tKCkpO1xuICAgICAgfTtcbiAgICB9LFxuICAgIGJhdGVzOiBmdW5jdGlvbihtKSB7XG4gICAgICB2YXIgcmFuZG9tID0gZDMucmFuZG9tLmlyd2luSGFsbChtKTtcbiAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIHJhbmRvbSgpIC8gbTtcbiAgICAgIH07XG4gICAgfSxcbiAgICBpcndpbkhhbGw6IG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gYTAgLSAyICogcDEpIDw9IM+AID8gMCA6IDE7XG4gICAgICAgIGlmIChwMSAmJiBkM19zdmdfYXJjU3dlZXAoeDAsIHkwLCB4MSwgeTEpID09PSBjdyBeIGwxKSB7XG4gICAgICAgICAgdmFyIGgxID0gKGEwICsgYTEpIC8gMjtcbiAgICAgICAgICB4MCA9IHIxICogTWF0aC5jb3MoaDEpO1xuICAgICAgICAgIHkwID0gcjEgKiBNYXRoLnNpbihoMSk7XG4gICAgICAgICAgeDEgPSB5MSA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHgwID0geTAgPSAwO1xuICAgICAgfVxuICAgICAgaWYgKHIwKSB7XG4gICAgICAgIHgyID0gcjAgKiBNYXRoLmNvcyhhMSAtIHAwKTtcbiAgICAgICAgeTIgPSByMCAqIE1hdGguc2luKGExIC0gcDApO1xuICAgICAgICB4MyA9IHIwICogTWF0aC5jb3MoYTAgKyBwMCk7XG4gICAgICAgIHkzID0gcjAgKiBNYXRoLnNpbihhMCArIHAwKTtcbiAgICAgICAgdmFyIGwwID0gTWF0aC5hYnMoYTAgLSBhMSArIDIgKiBwMCkgPD0gz4AgPyAwIDogMTtcbiAgICAgICAgaWYgKHAwICYmIGQzX3N2Z19hcmNTd2VlcCh4MiwgeTIsIHgzLCB5MykgPT09IDEgLSBjdyBeIGwwKSB7XG4gICAgICAgICAgdmFyIGgwID0gKGEwICsgYTEpIC8gMjtcbiAgICAgICAgICB4MiA9IHIwICogTWF0aC5jb3MoaDApO1xuICAgICAgICAgIHkyID0gcjAgKiBNYXRoLnNpbihoMCk7XG4gICAgICAgICAgeDMgPSB5MyA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHgyID0geTIgPSAwO1xuICAgICAgfVxuICAgICAgaWYgKGRhID4gzrUgJiYgKHJjID0gTWF0aC5taW4oTWF0aC5hYnMocjEgLSByMCkgLyAyLCArY29ybmVyUmFkaXVzLm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IGcuZWFjaChmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIGV2ZW50XyA9IGV2ZW50Lm9mKHRoaXMsIGFyZ3VtZW50cyksIGV4dGVudDEgPSB7XG4gICAgICAgICAgeDogeEV4dGVudCxcbiAgICAgICAgICB5OiB5RXh0ZW50LFxuICAgICAgICAgIGk6IHhFeHRlbnREb21haW4sXG4gICAgICAgICAgajogeUV4dGVudERvbWFpblxuICAgICAgICB9LCBleHRlbnQwID0gdGhpcy5fX2NoYXJ0X18gfHwgZXh0ZW50MTtcbiAgICAgICAgdGhpcy5fX2NoYXJ0X18gPSBleHRlbnQxO1xuICAgICAgICBpZiAoZDNfdHJhbnNpdGlvbkluaGVyaXRJZCkge1xuICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS50cmFuc2l0aW9uKCkuZWFjaChcInN0YXJ0LmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IGV4dGVudDAuaTtcbiAgICAgICAgICAgIHlFeHRlbnREb21haW4gPSBleHRlbnQwLmo7XG4gICAgICAgICAgICB4RXh0ZW50ID0gZXh0ZW50MC54O1xuICAgICAgICAgICAgeUV4dGVudCA9IGV4dGVudDAueTtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hzdGFydFwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KS50d2VlbihcImJydXNoOmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIHhpID0gZDNfaW50ZXJwb2xhdGVBcnJheSh4RXh0ZW50LCBleHRlbnQxLngpLCB5aSA9IGQzX2ludGVycG9sYXRlQXJyYXkoeUV4dGVudCwgZXh0ZW50MS55KTtcbiAgICAgICAgICAgIHhFeHRlbnREb21haW4gPSB5RXh0ZW50RG9tYWluID0gbnVsbDtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbih0KSB7XG4gICAgICAgICAgICAgIHhFeHRlbnQgPSBleHRlbnQxLnggPSB4aSh0KTtcbiAgICAgICAgICAgICAgeUV4dGVudCA9IGV4dGVudDEueSA9IHlpKHQpO1xuICAgICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hcIixcbiAgICAgICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KS5lYWNoKFwiZW5kLmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IGV4dGVudDEuaTtcbiAgICAgICAgICAgIHlFeHRlbnREb21haW4gPSBleHRlbnQxLmo7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICAgIG1vZGU6IFwicmVzaXplXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaGVuZFwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaHN0YXJ0XCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgIH0pO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoZW5kXCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfTtcbiAgICBmdW5jdGlvbiByZWRyYXcoZykge1xuICAgICAgZy5zZWxlY3RBbGwoXCIucmVzaXplXCIpLmF0dHIoXCJ0cmFuc2Zvcm1c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XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIG1vdmUxKHBvaW50LCBzY2FsZSwgaSkge1xuICAgICAgICB2YXIgcmFuZ2UgPSBkM19zY2FsZVJhbmdlKHNjYWxlKSwgcjAgPSByYW5nZVswXSwgcjEgPSByYW5nZVsxXSwgcG9zaXRpb24gPSBvcmlnaW5baV0sIGV4dGVudCA9IGkgPyB5RXh0ZW50IDogeEV4dGVudCwgc2l6ZSA9IGV4dGVudFsxXSAtIGV4dGVudFswXSwgbWluLCBtYXg7XG4gICAgICAgIGlmIChkcmFnZ2luZykge1xuICAgICAgICAgIHIwIC09IHBvc2l0aW9uO1xuICAgICAgICAgIHIxIC09IHNpemUgKyBwb3NpdGlvbjtcbiAgICAgICAgfVxuICAgICAgICBtaW4gPSAoaSA/IHlDbGFtcCA6IHhDbGFtcCkgPyBNYXRoLm1heChyMCwgTWF0aC5taW4ocjEsIHBvaW50W2ldKSkgOiBwb2ludFtpXTtcbiAgICAgICAgaWYgKGRyYWdnaW5nKSB7XG4gICAgICAgICAgbWF4ID0gKG1pbiArPSBwb3NpdGlvbikgKyBzaXplO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChjZW50ZXIpIHBvc2l0aW9uID0gTWF0aC5tYXgocjAsIE1hdGgubWluKHIxLCAyICogY2VudGVyW2ldIC0gbWluKSk7XG4gICAgICAgICAgaWYgKHBvc2l0aW9uIDwgbWluKSB7XG4gICAgICAgICAgICBtYXggPSBtaW47XG4gICAgICAgICAgICBtaW4gPSBwb3NpdGlvbjtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbWF4ID0gcG9zaXRpb247XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChleHRlbnRbMF0gIT0gbWluIHx8IGV4dGVudFsxXSAhPSBtYXgpIHtcbiAgICAgICAgICBpZiAoaSkgeUV4dGVudERvbWFpbiA9IG51bGw7IG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gKHlFeHRlbnREb21haW4pIHtcbiAgICAgICAgICAgIHkwID0geUV4dGVudERvbWFpblswXSwgeTEgPSB5RXh0ZW50RG9tYWluWzFdO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB5MCA9IHlFeHRlbnRbMF0sIHkxID0geUV4dGVudFsxXTtcbiAgICAgICAgICAgIGlmICh5LmludmVydCkgeTAgPSB5LmludmVydCh5MCksIHkxID0geS5pbnZlcnQoeTEpO1xuICAgICAgICAgICAgaWYgKHkxIDwgeTApIHQgPSB5MCwgeTAgPSB5MSwgeTEgPSB0O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geCAmJiB5ID8gWyBbIHgwLCB5MCBdLCBbIHgxLCB5MSBdIF0gOiB4ID8gWyB4MCwgeDEgXSA6IHkgJiYgWyB5MCwgeTEgXTtcbiAgICAgIH1cbiAgICAgIGlmICh4KSB7XG4gICAgICAgIHgwID0gelswXSwgeDEgPSB6WzFdO1xuICAgICAgICBpZiAoeSkgeDAgPSB4MFswXSwgeDEgPSB4MVswXTtcbiAgICAgICAgeEV4dGVudERvbWFpbiA9IFsgeDAsIHgxIF07XG4gICAgICAgIGlmICh4LmludmVydCkgeDAgPSB4KHgwKSwgeDEgPSB4KHgxKTtcbiAgICAgICAgaWYgKHgxIDwgeDApIHQgPSB4MCwgeDAgPSB4MSwgeDEgPSB0O1xuICAgICAgICBpZiAoeDAgIT0geEV4dGVudFswXSB8fCB4MSAhPSB4RXh0ZW50WzFdKSB4RXh0ZW50ID0gWyB4MCwgeDEgXTtcbiAgICAgIH1cbiAgICAgIGlmICh5KSB7XG4gICAgICAgIHkwID0gelswXSwgeTEgPSB6WzFdO1xuICAgICAgICBpZiAoeCkgeTAgPSB5MFsxXSwgeTEgPSB5MVsxXTtcbiAgICAgICAgeUV4dGVudERvbWFpbiA9IFsgeTAsIHkxIF07XG4gICAgICAgIGlmICh5LmludmVydCkgeTAgPSB5KHkwKSwgeTEgPSB5K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QpIGludGVydmFsID0gbWV0aG9kWzBdLCBza2lwID0gbWV0aG9kWzFdO1xuICAgICAgZnVuY3Rpb24gc2tpcHBlZChkYXRlKSB7XG4gICAgICAgIHJldHVybiAhaXNOYU4oZGF0ZSkgJiYgIWludGVydmFsLnJhbmdlKGRhdGUsIGQzX3RpbWVfc2NhbGVEYXRlKCtkYXRlICsgMSksIHNraXApLmxlbmd0aDtcbiAgICAgIH1cbiAgICAgIHJldHVybiBzY2FsZS5kb21haW4oZDNfc2NhbGVfbmljZShkb21haW4sIHNraXAgPiAxID8ge1xuICAgICAgICBmbG9vcjogZnVuY3Rpb24oZGF0ZSkge1xuICAgICAgICAgIHdoaWxlIChza2lwcGVkKGRhdGUgPSBpbnRlcnZhbC5mbG9vcihkYXRlKSkpIGRhdGUgPSBkM190aW1lX3NjYWxlRGF0ZShkYXRlIC0gMSk7XG4gICAgICAgICAgcmV0dXJuIGRhdGU7XG4gICAgICAgIH0sXG4gICAgICAgIGNlaWw6IGZ1bmN0aW9uKGRhdGUpIHtcbiAgICAgICAgICB3aGlsZSAoc2tpcHBlZChkYXRlID0gaW50ZXJ2YWwuY2VpbChkYXRlKSkpIGRhdGUgPSBkM190aW1lX3NjYWxlRGF0ZSgrZGF0ZSArIDEpO1xuICAgICAgICAgIHJldHVybiBkYXRlO1xuICAgICAgICB9XG4gICAgICB9IDogaW50ZXJ2YWwpKTtcbiAgICB9O1xuICAgIHNjYWxlLnRpY2tzID0gZnVuY3Rpb24oaW50ZXJ2YWwsIHNraXApIHtcbiAgICAgIHZhciBleHRlbnQgPSBkM19zY2FsZUV4dGVudChzY2FsZS5kb21haW4oKSksIG1ldGhvZCA9IGludGVydmFsID09IG51bGwgPyB0aWNrTWV0aG9kKGV4dGVudCwgMTApIDogdHlwZW9mIGludGVydmFsID09PSBcIm51bWJlclwiID8gdGlja01ldGhvZChleHRlbnQsIGludGVydmFsKSA6ICFpbnRlcnZhbC5yYW5nZSAmJiBbIHtcbiAgICAgICAgcmFuZ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rdG9wLCBsYXJnZXNjcmVlblwiIGRhdGEtc29ydC1pZ25vcmU9XCJ0cnVlXCI+RGV0YWlsczwvdGg+XG4gICAgICAgICAgICA8L3RyPlxuICAgICAgICAgIDwvdGhlYWQ+XG4gICAgICAgICAgPHRib2R5PlxuICAgICAgICAgIHt7I29yZGVyczpvcmRlcn19XG4gICAgICAgICAgICA8dHIgaWQ9XCJvcmRlci17eyBpZCB9fVwiPlxuICAgICAgICAgICAgICA8dGQ+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IGludm9pY2Vfbm8gfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IGJ1eWVyX2Z1bGxuYW1lIH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57eyBidXllcl9lbWFpbCB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgYnV5ZXJfcGhvbmUgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7Y3VycmVuY3l9fXt7IGFtb3VudCB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgb3JkZXJfZGF0ZSB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgaWQgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPlxuICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPlxuICAgICAgICAgICAgICAgICAge3sjaWYgYW1vdW50ID09PSAwfX1cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4+RnJlZSBvcmRlcjwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgIHt7ZWxzZX19XG4gICAgICAgICAgICAgICAgICAgIDxzcGFuPlBhaWQgb3JkZXI8L3NwYW4+XG4gICAgICAgICAgICAgICAgICB7ey9pZn19XG4gICAgICAgICAgICAgICAgPC9wPlxuICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+PGEgY2xhc3M9XCJib3hvZmZpY2UtYnV0dG9uIGJveG9mZmljZS1idXR0b24taW5mb1wiIGhyZWY9XCJqYXZhc2NyaXB0OnZvaWQoMClcIiBvbi1jbGljaz1cInNob3dPcmRlclwiPkxpbmUgSXRlbXM8L2E+PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD5cbiAgICAgICAgICAgICAgICA8cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj5cbiAgICAgICAgICAgICAgICAgIDxhIGNsYXNzPVwiYm94b2ZmaWNlLWJ1dHRvbiBib3hvZmZpY2UtYnV0dG9uLXNtYWxsIGJveG9mZmljZS1idXR0b24taW5mbyBvcmRlcnMtYnRuXCIgaHJlZj17eyByZWNlaXB0IH19IHRhcmdldD1cIl9ibGFua1wiID5WaWV3IFJlY2VpcHQ8L2E+XG4gICAgICAgICAgICAgICAgICA8YSBjbGFzcz1cImJveG9mZmljZS1idXR0b24gYm94b2ZmaWNlLWJ1dHRvbi1zbWFsbCBib3hvZmZpY2UtYnV0dG9uLWluZm8gcmlnaHQtYnV0dG9uIG9yZGVycy1idG5cIiBocmVmPXt7IGFzc2lnbmVlIH19IHRhcmdldD1cIl9ibGFua1wiID5WaWV3IEFzc2lnbmVlIGRldGFpbHM8L2E+XG4gICAgICAgICAgICAgICAgPC9wPlxuICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgIHt7I3Nob3dfb3JkZXJ9fVxuICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwib3JkZXItc2xpZGVyXCIgaW50cm8tb3V0cm89J2ZseTp7eDoyMDAseTowLGR1cmF0aW9uOjIwMH0nPlxuICAgICAgICAgICAgICAgIDxidXR0b24gb24tY2xpY2s9XCJoaWRlT3JkZXJcIiBjbGFzcz1cImNsb3NlLWJ1dHRvblwiPjxpIGNsYXNzPVwiZmEgZmEtY2xvc2VcIj48L2k+PC9idXR0b24+XG4gICAgICAgICAgICAgICAgPHAgY2xhc3M9XCJvcmRlci10aXRsZVwiPk9yZGVyIEludm9pY2UgTm86IHt7aW52b2ljZV9ub319PC9wPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJsaW5lLWl0ZW1zLXdyYXBwZXJcIj5cbiAgICAgICAgICAgICAgICAgIHt7I2xpbmVfaXRlbXM6bGluZV9pdGVtfX1cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRpY2tldCBjb2wtc20tNiBjb2wteHMtMTJcIiBpZD1cIml0ZW0te3sgQGluZGV4IH19XCI+XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImhlYWRpbmdcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0aWNrZXQtdHlwZVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD57eyB0aXRsZSB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250ZW50XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGVudC1ib3hcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5pZDo8L3NwYW4+IHt7IGlkIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAg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gICAgICAgICAgICAgIHt7I2Fzc2lnbmVlX2RldGFpbHN9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+RnVsbG5hbWU6PC9zcGFuPiB7eyBmdWxsbmFtZSB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPkVtYWlsOjwvc3Bhbj4ge3sgZW1haWwgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5QaG9uZTo8L3NwYW4+IHt7IHBob25lIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7I2RldGFpbHM6a2V5IH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPnt7IGtleSB9fTo8L3NwYW4+IHt7IC4gfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3tlbHNlfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48Yj5Ob3QgYXNzaWduZWQ8L2I+PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgICB7eyNjYW5jZWxfdGlja2V0X3VybCAmJiAhY2FuY2VsbGVkX2F0fX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJib3hvZmZpY2UtYnV0dG9uIGJveG9mZmljZS1idXR0b24tc21hbGwgYm94b2ZmaWNlLWJ1dHRvbi1pbmZvXCIgaHJlZj1cImphdmFzY3JpcHQ6dm9pZCgwKVwiIG9uLWNsaWNrPVwiY2FuY2VsVGlja2V0XCIge3sjY2FuY2VsbGluZ319ZGlzYWJsZWR7ey99fT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FuY2VsIHt7I2NhbmNlbGxpbmd9fTxpIGNsYXNzPVwiZmEgZmEtc3Bpbm5lciBmYS1zcGluXCI+PC9pPnt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHAgY2xhc3M9XCJlcnJvci1tc2cgbGVmdC1hbGlnbmVkXCI+e3tjYW5jZWxfZXJyb3J9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgIHt7L319XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAge3svc2hvd19vcmRlcn19XG4gICAgICAgICAge3svb3JkZXJzfX1cbiAgICAgICAgICA8L3Rib2R5PlxuICAgICAgICAgIDx0Zm9vdD5cbiAgICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgICAgPHRkIGNvbHNwYW49XCIxMFwiPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYWdpbmF0aW9uIHBhZ2luYXRpb24tY2VudGVyZWRcIj48L2Rpdj5cbiAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgIDwvdHI+XG4gICAgICAgICAgPC90Zm9vdD5cbiAgICAgICAgPC90YWJsZT5cbiAgICAgIDwvZGl2PlxuICAgIHt7ZWxzZX19XG4gICAgICA8cCBjbGFzcz1cInRleHQtY2VudGVyXCI+Q3VycmVudGx5IG5vIG9yZGVycy48L3A+XG4gICAge3svaWZ9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hYmxlLWJvcmRlcmVkIHRhYmxlLWhvdmVyIHN0YXRzLXRhYmxlXCI+XG4gICAgICAgIDx0aGVhZD5cbiAgICAgICAgICA8dHIgY2xhc3M9XCJpbmZvXCI+XG4gICAgICAgICAgICA8dGg+IzwvdGg+XG4gICAgICAgICAgICA8dGg+SXRlbTwvdGg+XG4gICAgICAgICAgICA8dGg+QXZhaWxhYmxlPC90aD5cbiAgICAgICAgICAgIDx0aD5Tb2xkPC90aD5cbiAgICAgICAgICAgIDx0aD5GcmVlPC90aD5cbiAgICAgICAgICAgIDx0aD5DYW5jZWxsZWQ8L3RoPlxuICAgICAgICAgICAgPHRoPkN1cnJlbnQgUHJpY2U8L3RoPlxuICAgICAgICAgICAgPHRoPk5ldCBTYWxlczwvdGg+XG4gICAgICAgICAgPC90cj5cbiAgICAgICAgPC90aGVhZD5cbiAgICAgICAgPHRib2R5PlxuICAgICAgICAgIHt7I2l0ZW1zfX1cbiAgICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgICAgPHRkPnt7IEBpbmRleCArIDEgfX08L3RkPlxuICAgICAgICAgICAgICA8dGQ+e3sgdGl0bGUgfX08L3RkPlxuICAgICAgICAgICAgICA8dGQ+e3sgYXZhaWxhYmxlIH19PC90ZD5cbiAgICAgICAgICAgICAgPHRkPnt7IHNvbGQgfX08L3RkPlxuICAgICAgICAgICAgICA8dGQ+e3sgZnJlZSB9fTwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD57eyBjYW5jZWxsZWQgfX08L3RkPlxuICAgICAgICAgICAgICA8dGQ+e3sgY3VycmVudF9wcmljZSB9fTwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD57eyBuZXRfc2FsZXMgfX08L3RkPlxuICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICB7ey99fVxuICAgICAgICA8L3Rib2R5PlxuICAgICAgPC90YWJsZT5cbiAgICA8L2Rpdj5cbiAgPC9kaXY+XG5gXG5cbmV4cG9ydCBjb25zdCBBZ2dDaGFydFR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leHBvcnQgY29uc3QgT3JkZXJWaWV3ID0ge1xuICByZW5kZXI6IGZ1bmN0aW9uKGNvbmZpZykge1xuXG4gICAgT3JkZXJNb2RlbC5mZXRjaCh7XG4gICAgICB1cmw6IE9yZGVyTW9kZWwudXJsRm9yKCdpbmRleCcsIHtpY19pZDogY29uZmlnLmlkfSlbJ3BhdGgnXVxuICAgIH0pLmRvbmUoKHJlbW90ZURhdGEpID0+IHtcbiAgICAgIC8vIEluaXRpYWwgcmVuZGVyXG4gICAgICBsZXQgbWFpbl9yYWN0aXZlID0gbmV3IFJhY3RpdmUoe1xuICAgICAgICBlbDogJyNtYWluLWNvbnRlbnQtYXJlYScsXG4gICAgICAgIHRlbXBsYXRlOiBPcmRlclRlbXBsYXRlLFxuICAgICAgICBkYXRhOiAge1xuICAgICAgICAgIHRpdGxlOiByZW1vdGVEYXRhLnRpdGxlLFxuICAgICAgICAgIG9yZGVyczogcmVtb3RlRGF0YS5vcmRlcnNcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIFNpZGVCYXJWaWV3LnJlbmRlcignb3JkZXJzJywgeydvcmdfbmFtZSc6IHJlbW90ZURhdGEub3JnX25hbWUsICdpY19pZCc6IGNvbmZpZy5pZH0pO1xuXG4gICAgICBOUHJvZ3Jlc3MuZG9uZSgpO1xuXG4gICAgICAkKCcjb3JkZXJzLXRhYmxlJykuZm9vdGFibGUoe1xuICAgICAgICBicmVha3BvaW50czoge1xuICAgICAgICAgIHBob25lOiA2MDAsXG4gICAgICAgICAgdGFibGV0OiA3NjgsXG4gICAgICAgICAgZGVza3RvcDogMTIwMCxcbiAgICAgICAgICBsYXJnZXNjcmVlbjogMTkwMFxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgJCgnI29yZGVycy10YWJsZScpLm9uKCdmb290YWJsZV9maWx0ZXJpbmcnLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICBsZXQgc2VsZWN0ZWQgPSAkKCcjZmlsdGVyLXN0YXR1cyc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mtleXBhdGggKyAnLmNhbmNlbGxpbmcnLCBmYWxzZSk7XG4gICAgICAgICAgfSkuZmFpbChmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGVycm9yX3RleHQ7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2UucmVhZHlTdGF0ZSA9PT0gNCkge1xuICAgICAgICAgICAgICBpZiAocmVzcG9uc2Uuc3RhdHVzID09PSA1MDApIHtcbiAgICAgICAgICAgICAgICBlcnJvcl90ZXh0ID0gXCJTZXJ2ZXIgRXJyb3JcIjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBlcnJvcl90ZXh0ID0gSlNPTi5wYXJzZShyZXNwb25zZS5yZXNwb25zZVRleHQpLmVycm9yX2Rlc2NyaXB0aW9uO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgZXJyb3JfdGV4dCA9IFwiVW5hYmxlIHRvIGNvbm5lY3QuIFBsZWFzZSB0cnkgYWdhaW4gbGF0ZXIuXCI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBtYWluX3JhY3RpdmUuc2V0KGV2ZW50LmtleXBhdGggKyAnLmNhbmNlbF9lcnJvcicsIGVycm9yX3RleHQpO1xuICAgICAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5jYW5jZWxsaW5nJywgZmFsc2UpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ3BvcHN0YXRlJywgKGV2ZW50KSA9PiB7XG4gICAgICAgIE5Qcm9ncmVzcy5jb25maWd1cmUoeyBzaG93U3Bpbm5lcjogZmFsc2V9KS5zdGFydCgpO1xuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cbn07XG4iLCJcbmltcG9ydCB7S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XG4gICAgbGV0IGNvbHVtbnMgPSB0aGlzLmZvcm1hdF9jb2x1bW5zKCk7XG4gICAgbGV0IGJhcl9ncmFwaF9oZWFkZXJzID0gXy53aXRob3V0KF8ubWFwKGNvbHVtbnMsIF8uZmlyc3QpLCAneCcsICdzYWxlcycpXG5cbiAgICB0aGlzLmNoYXJ0ID0gYzMuZ2VuZXJhdGUoe1xuICAgICAgZGF0YToge1xuICAgICAgICB4OiAneCcsXG4gICAgICAgIGNvbHVtbnM6IHRoaXMuZm9ybWF0X2NvbHVtbnMoKSxcbiAgICAgICAgdHlwZTogJ2JhcicsXG4gICAgICAgIHR5cGVzOiB7XG4gICAgICAgICAgc2FsZXM6ICdsaW5lJ1xuICAgICAgICB9LFxuICAgICAgICBncm91cHM6IFtcbiAgICAgICAgICBiYXJfZ3JhcGhfaGVhZGVyc1xuICAgICAgICBdLFxuICAgICAgICBheGVzOiB7XG4gICAgICAgICAgc2FsZXM6ICd5MidcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGJhcjoge1xuICAgICAgICB3aWR0aDoge1xuICAgICAgICAgIHJhdGlvOiAwLjUgLy8gdGhpcyBtYWtlcyBiYXIgd2lkdGggNTAlIG9mIGxlbmd0aCBiZXR3ZWVuIHRpY2tzXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBheGlzOiB7XG4gICAgICAgIHg6IHtcbiAgICAgICAgICB0eXBlOiAndGltZXNlcmllcycsXG4gICAgICAgICAgdGljazoge1xuICAgICAgICAgICAgZm9ybWF0OiAnJWQtJW0nXG4gICAgICAgICAgfSxcbiAgICAgICAgICBsYWJlbDogJ0RhdGUnXG4gICAgICAgIH0sXG4gICAgICAgIHk6IHtcbiAgICAgICAgICBsYWJlbDogJ05vLiBvZiB0aWNrZXRzJ1xuICAgICAgICB9LFxuICAgICAgICB5Mjoge1xuICAgICAgICAgIHNob3c6IHRydWUsXG4gICAgICAgICAgbGFiZWw6ICdTYWxlcydcbiAgICAgICAgfVxuICAgICA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9ncmVzcy5jb25maWd1cmUoeyBzaG93U3Bpbm5lcjogZmFsc2V9KS5zdGFydCgpO1xuICAgICAgICAgIGV2ZW50QnVzLnRyaWdnZXIoJ25hdmlnYXRlJywgZXZlbnQuY29udGV4dC51cmwpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG4gIH0sXG4gIHJlbmRlcjogZnVuY3Rpb24odmlldywgaWNfY29uZmlnKSB7XG4gICAgaWYgKHRoaXMub24pIHtcbiAgICAgIHRoaXMucmFjdGl2ZS5zZXQoe1xuICAgICAgICAnc2lkZWJhckl0ZW1zJzogU2lkZUJhck1vZGVsLmdldEl0ZW1zKGljX2NvbmZpZyksXG4gICAgICAgICdhY3RpdmVJdGVtJzogdmlldyxcbiAgICAgICAgJ3NpZGViYXJIaWRlJzogZmFsc2UsXG4gICAgICAgICdzaWRlYmFyTW9iaWxlT24nOiBmYWxzZVxuICAgICAgfSk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgdGhpcy5pbml0KHZpZXcsIGljX2NvbmZpZyk7XG4gICAgfVxuICB9LFxuICBoaWRlOiBmdW5jdGlvbigpIHtcbiAgICBpZiAodGhpcy5vbikge1xuICAgICAgdGhpcy5yYWN0aXZlLnNldCgnc2lkZWJhckhpZGUnLCB0cnVlKTtcbiAgICB9XG4gIH1cbn07XG4iXX0= +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCIvVXNlcnMvdmlkeWEvRG9jdW1lbnRzL0hhc0dlZWsvYm94b2ZmaWNlL2JveG9mZmljZS9zdGF0aWMvanMvdmlld3MvbWFpbi5qcyIsIi9Vc2Vycy92aWR5YS9Eb2N1bWVudHMvSGFzR2Vlay9ib3hvZmZpY2UvYm94b2ZmaWNlL3N0YXRpYy9qcy9tb2RlbHMvYWRtaW5f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m5hbF9heGlzX2ZuO1xuXG4gICAgZnVuY3Rpb24gQVBJKG93bmVyKSB7XG4gICAgICAgIHRoaXMub3duZXIgPSBvd25lcjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpbmhlcml0KGJhc2UsIGRlcml2ZWQpIHtcblxuICAgICAgICBpZiAoT2JqZWN0LmNyZWF0ZSkge1xuICAgICAgICAgICAgZGVyaXZlZC5wcm90b3R5cGUgPSBPYmplY3QuY3JlYXRlKGJhc2UucHJvdG90eXBlKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBmID0gZnVuY3Rpb24gZigpIHt9O1xuICAgICAgICAgICAgZi5wcm90b3R5cGUgPSBiYXNlLnByb3RvdHlwZTtcbiAgICAgICAgICAgIGRlcml2ZWQucHJvdG90eXBlID0gbmV3IGYoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGRlcml2ZWQucHJvdG90eXBlLmNvbnN0cnVjdG9yID0gZGVyaXZlZDtcblxuICAgICAgICByZXR1cm4gZGVyaXZlZDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBDaGFydChjb25maWcpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCA9IG5ldyBDaGFydEludGVybmFsKHRoaXMpO1xuICAgICAgICAkJC5sb2FkQ29uZmlnKGNvbmZpZyk7XG5cbiAgICAgICAgJCQuYmVmb3JlSW5pdChjb25maWcpO1xuICAgICAgICAkJC5pbml0KCk7XG4gICAgICAgICQkLmFmdGVySW5pdChjb25maWcpO1xuXG4gICAgICAgIC8vIGJpbmQgXCJ0aGlzXCIgdG8gbmVzdGVkIEFQSVxuICAgICAgICAoZnVuY3Rpb24gYmluZFRoaXMoZm4sIHRhcmdldCwgYXJnVGhpcykge1xuICAgICAgICAgICAgT2JqZWN0LmtleXMoZm4pLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgICAgIHRhcmdldFtrZXldID0gZm5ba2V5XS5iaW5kKGFyZ1RoaXMpO1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyhmbltrZXldKS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGJpbmRUaGlzKGZuW2tleV0sIHRhcmdldFtrZXldLCBhcmdUaGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSkoYzNfY2hhcnRfZm4sIHRoaXMsIHRoaXMpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIENoYXJ0SW50ZXJuYWwoYXBpKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXM7XG4gICAgICAgICQkLmQzID0gd2luZG93LmQzID8gd2luZG93LmQzIDogdHlwZW9mIHJlcXVpcmUgIT09ICd1bmRlZmluZWQnID8gcmVxdWlyZShcImQzXCIpIDogdW5kZWZpbmVkO1xuICAgICAgICAkJC5hcGkgPSBhcGk7XG4gICAgICAgICQkLmNvbmZpZyA9ICQkLmdldERlZmF1bHRDb25maWcoKTtcbiAgICAgICAgJCQuZGF0YSA9IHt9O1xuICAgICAgICAkJC5jYWNoZSA9IHt9O1xuICAgICAgICAkJC5heGVzID0ge307XG4gICAgfVxuXG4gICAgYzMuZ2VuZXJhdGUgPSBmdW5jdGlvbiAoY29uZmlnKSB7XG4gICAgICAgIHJldHVybiBuZXcgQ2hhcnQoY29uZmlnKTtcbiAgICB9O1xuXG4gICAgYzMuY2hhcnQgPSB7XG4gICAgICAgIGZuOiBDaGFydC5wcm90b3R5cGUsXG4gICAgICAgIGludGVybmFsOiB7XG4gICAgICAgICAgICBmbjogQ2hhcnRJbnRlcm5hbC5wcm90b3R5cGUsXG4gICAgICAgICAgICBheGlzOiB7XG4gICAgICAgICAgICAgICAgZm46IEF4aXMucHJvdG90eXBlXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuID0gYzMuY2hhcnQuZm47XG4gICAgYzNfY2hhcnRfaW50Z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C55Mi5kb21haW4oJCQuZ2V0WURvbWFpbigkJC5kYXRhLnRhcmdldHMsICd5MicpKTtcbiAgICAgICAgJCQuc3ViWC5kb21haW4oJCQueC5kb21haW4oKSk7XG4gICAgICAgICQkLnN1YlkuZG9tYWluKCQkLnkuZG9tYWluKCkpO1xuICAgICAgICAkJC5zdWJZMi5kb21haW4oJCQueTIuZG9tYWluKCkpO1xuXG4gICAgICAgIC8vIFNhdmUgb3JpZ2luYWwgeCBkb21haW4gZm9yIHpvb20gdXBkYXRlXG4gICAgICAgICQkLm9yZ1hEb21haW4gPSAkJC54LmRvbWFpbigpO1xuXG4gICAgICAgIC8vIFNldCBpbml0aWFsaXplZCBzY2FsZXMgdG8gYnJ1c2ggYW5kIHpvb21cbiAgICAgICAgaWYgKCQkLmJydXNoKSB7ICQkLmJydXNoLnNjYWxlKCQkLnN1YlgpOyB9XG4gICAgICAgIGlmIChjb25maWcuem9vbV9lbmFibGVkKSB7ICQkLnpvb20uc2NhbGUoJCQueCk7IH1cblxuICAgICAgICAvKi0tIEJhc2ljIEVsZW1lbnRzIC0tKi9cblxuICAgICAgICAvLyBEZWZpbmUgc3Znc1xuICAgICAgICAkJC5zdmcgPSAkJC5zZWxlY3RDaGFydC5hcHBlbmQoXCJzdmdcIilcbiAgICAgICAgICAgIC5zdHlsZShcIm92ZXJmbG93XCIsIFwiaGlkZGVuXCIpXG4gICAgICAgICAgICAub24oJ21vdXNlZW50ZXInLCBmdW5jdGlvbiAoKSB7IHJldHVybiBjb25maWcub25tb3VzZW92ZXIuY2FsbCgkJCk7IH0pXG4gICAgICAgICAgICAub24oJ21vdXNlbGVhdmUnLCBmdW5jdGlvbiAoKSB7IHJldHVybiBjb25maWcub25tb3VzZW91dC5jYWxsKCQkKTsgfSk7XG5cbiAgICAgICAgaWYgKCQkLmNvbmZpZy5zdmdfY2xhc3NuYW1lKSB7XG4gICAgICAgICAgICAkJC5zdmcuYXR0cignY2xhc3MnLCAkJC5jb25maWcuc3ZnX2Ns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QsIGluc2VydCByZWN0IHRvIGZvcmVmcm9udFxuICAgICAgICAvLyBUT0RPOiBpcyB0aGlzIG5lZWRlZD9cbiAgICAgICAgbWFpbi5pbnNlcnQoJ3JlY3QnLCBjb25maWcuem9vbV9wcml2aWxlZ2VkID8gbnVsbCA6ICdnLicgKyBDTEFTUy5yZWdpb25zKVxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgQ0xBU1Muem9vbVJlY3QpXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCAkJC53aWR0aClcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAkJC5oZWlnaHQpXG4gICAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAwKVxuICAgICAgICAgICAgLm9uKFwiZGJsY2xpY2suem9vbVwiLCBudWxsKTtcblxuICAgICAgICAvLyBTZXQgZGVmYXVsdCBleHRlbnQgaWYgZGVmaW5lZFxuICAgICAgICBpZiAoY29uZmlnLmF4aXNfeF9leHRlbnQpIHsgJCQuYnJ1c2guZXh0ZW50KCQkLmdldERlZmF1bHRFeHRlbnQoKSk7IH1cblxuICAgICAgICAvLyBBZGQgQXhpc1xuICAgICAgICAkJC5heGlzLmluaXQoKTtcblxuICAgICAgICAvLyBTZXQgdGFyZ2V0c1xuICAgICAgICAkJC51cGRhdGVUYXJnZXRzKCQkLmRhdGEudGFyZ2V0cyk7XG5cbiAgICAgICAgLy8gRHJhdyB3aXRoIHRhcmdldHNcbiAgICAgICAgaWYgKGJpbmRpbmcpIHtcbiAgICAgICAgICAgICQkLnVwZGF0ZURpbWVuc2lvbigpO1xuICAgICAgICAgICAgJCQuY29uZmlnLm9uaW5pdC5jYWxsKCQkKTtcbiAgICAgICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICAgICAgd2l0aFRyYW5zaXRpb246IGZhbHNlLFxuICAgICAgICAgICAgICAgIHdpdGhUcmFuc2Zvcm06IHRydWUsXG4gICAgICAgICAgICAgICAgd2l0aFVwZGF0ZVhEb21haW46IHRydWUsXG4gICAgICAgICAgICAgICAgd2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsXG4gICAgICAgICAgICAgICAgd2l0aFRyYW5zaXRpb25Gb3JBeGlzOiBmYWxzZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBCaW5kIHJlc2l6ZSBldmVudFxuICAgICAgICAkJC5iaW5kUmVzaXplKCk7XG5cbiAgICAgICAgLy8gZXhwb3J0IGVsZW1lbnQgb2YgdGhlIGNoYXJ0XG4gICAgICAgICQkLmFwaS5lbGVtZW50ID0gJCQuc2VsZWN0Q2hhcnQubm9kZSgpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5zbW9vdGhMaW5lcyA9IGZ1bmN0aW9uIChlbCwgdHlwZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ2dyaWQnKSB7XG4gICAgICAgICAgICBlbC5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgZyA9ICQkLmQzLnNlbGVjdCh0aGlzKSxcbiAgICAgICAgICAgICAgICAgICAgeDEgPSBnLmF0dHIoJ3gxJyksXG4gICAgICAgICAgICAgICAgICAgIHgyID0gZy5hdHRyKCd4MicpLFxuICAgICAgICAgICAgICAgICAgICB5MSA9IGcuYXR0cigneTEnKSxcbiAgICAgICAgICAgICAgICAgICAgeTIgPSBnLmF0dHIoJ3kyJyk7XG4gICAgICAgICAgICAgICAgZy5hdHRyKHtcbiAgICAgICAgICAgICAgICAgICAgJ3gxJzogTWF0aC5jZWlsKHgxKSxcbiAgICAgICAgICAgICAgICAgICAgJ3gyJzogTWF0aC5jZWlsKHgyKSxcbiAgICAgICAgICAgICAgICAgICAgJ3kxJzogTWF0aC5jZWlsKHkxKSxcbiAgICAgICAgICAgICAgICAgICAgJ3kyJzogTWF0aC5jZWlsKHkyKVxuICAgICAgICAgICAgIC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AmJiB0YXJnZXRzVG9TaG93Lmxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKGNvbmZpZy5heGlzX3hfdGlja19jdWxsaW5nICYmIHRpY2tWYWx1ZXMpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDwgdGlja1ZhbHVlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGlja1ZhbHVlcy5sZW5ndGggLyBpIDwgY29uZmlnLmF4aXNfeF90aWNrX2N1bGxpbmdfbWF4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnZhbEZvckN1bGxpbmcgPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5heGlzWCArICcgLnRpY2sgdGV4dCcpLmVhY2goZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gdGlja1ZhbHVlcy5pbmRleE9mKGUpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnN0eWxlKCdkaXNwbGF5JywgaW5kZXggJSBpbnRlcnZhbEZvckN1bGxpbmcgPyAnbm9uZScgOiAnYmxvY2snKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLmF4aXNYICsgJyAudGljayB0ZXh0Jykuc3R5bGUoJ2Rpc3BsYXknLCAnYmxvY2snKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHNldHVwIGRyYXdlciAtIE1FT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uYXhpc19yb3RhdGVkID8gJCQuY2lyY2xlWSA6ICQkLmNpcmNsZVgpLmJpbmQoJCQpO1xuICAgICAgICBjeSA9ICgkJC5jb25maWcuYXhpc19yb3RhdGVkID8gJCQuY2lyY2xlWCA6ICQkLmNpcmNsZVkpLmJpbmQoJCQpO1xuXG4gICAgICAgIGlmIChvcHRpb25zLmZsb3cpIHtcbiAgICAgICAgICAgIGZsb3cgPSAkJC5nZW5lcmF0ZUZsb3coe1xuICAgICAgICAgICAgICAgIHRhcmdldHM6IHRhcmdldHNUb1Nob3csXG4gICAgICAgICAgICAgICAgZmxvdzogb3B0aW9ucy5mbG93LFxuICAgICAgICAgICAgICAgIGR1cmF0aW9uOiBvcHRpb25zLmZsb3cuZHVyYXRpb24sXG4gICAgICAgICAgICAgICAgZHJhd0JhcjogZHJhd0JhcixcbiAgICAgICAgICAgICAgICBkcmF3TGluZTogZHJhd0xpbmUsXG4gICAgICAgICAgICAgICAgZHJhd0FyZWE6IGRyYXdBcmVhLFxuICAgICAgICAgICAgICAgIGN4OiBjeCxcbiAgICAgICAgICAgICAgICBjeTogY3ksXG4gICAgICAgICAgICAgICAgeHY6IHh2LFxuICAgICAgICAgICAgICAgIHhGb3JUZXh0OiB4Rm9yVGV4dCxcbiAgICAgICAgICAgICAgICB5Rm9yVGV4dDogeUZvclRleHRcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKChkdXJhdGlvbiB8fCBmbG93KSAmJiAkJC5pc1RhYlZpc2libGUoKSkgeyAvLyBPbmx5IHVzZSB0cmFuc2l0aW9uIGlmIHRhYiB2aXNpYmxlLiBTZWUgIzkzOC5cbiAgICAgICAgICAgIC8vIHRyYW5zaXRpb24gc2hvdWxkIGJlIGRlcml2ZWQgZnJvbSBvbmUgdHJhbnNpdGlvblxuICAgICAgICAgICAgZDMudHJhbnNpdGlvbigpLmR1cmF0aW9uKGR1cmF0aW9uKS5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgdHJhbnNpdGlvbnNUb1dhaXQgPSBbXTtcblxuICAgICAgICAgICAgICAgIC8vIHJlZHJhdyBhbmQgZ2F0aGVyIHRyYW5zaXRpb25zXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdCYXIoZHJhd0JhciwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0xpbmUoZHJhd0xpbmUsIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdBcmVhKGRyYXdBcmVhLCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3Q2lyY2xlKGN4LCBjeSwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd1RleHQoeEZvclRleHQsIHlGb3JUZXh0LCBvcHRpb25zLmZsb3csIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdSZWdpb24odHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0dyaWQodHJ1ZSksXG4gICAgICAgICAgICAgICAgXS5mb3JFYWNoKGZ1bmN0aW9uICh0cmFuc2l0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9ucy5mb3JFYWNoKGZ1bmN0aW9uICh0cmFuc2l0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uc1RvV2FpdC5wdXNoKHRyYW5zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIC8vIFdhaXQgZm9yIGVuZCBvZiB0cmFuc2l0aW9ucyB0byBjYWxsIGZsb3cgYW5kIG9ucmVuZGVyZWQgY2FsbGJhY2tcbiAgICAgICAgICAgICAgICB3YWl0Rm9yRHJhdyA9ICQkLmdlbmVyYXRlV2FpdCgpO1xuICAgICAgICAgICAgICAgIHRyYW5zaXRpb25zVG9XYWl0LmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgd2FpdEZvckRyYXcuYWRkKHQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYWxsKHdhaXRGb3JEcmF3LCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKGZsb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgZmxvdygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLm9ucmVuZGVyZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLm9ucmVuZGVyZWQuY2FsbCgkJCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAkJC5yZWRyYXdCYXIoZHJhd0Jhcik7XG4gICAgICAgICAgICAkJC5yZWRyYXdMaW5lKGRyYXdMaW5lKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0FyZWEoZHJhd0FyZWEpO1xuICAgICAgICAgICAgJCQucmVkcmF3Q2lyY2xlKGN4LCBjeSk7XG4gICAgICAgICAgICAkJC5yZWRyYXdUZXh0KHhGb3JUZXh0LCB5Rm9yVGV4dCwgb3B0aW9ucy5mbG93KTtcbiAgICAgICAgICAgICQkLnJlZHJhd1JlZ2lvbigpO1xuICAgICAgICAgICAgJCQucmVkcmF3R3JpZCgpO1xuICAgICAgICAgICAgaWYgKGNvbmZpZy5vbnJlbmRlcmVkKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLm9ucmVuZGVyZWQuY2FsbCgkJCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyB1cGRhdGUgZmFkZWluIGNvbmRpdGlvblxuICAgICAgICAkJC5tYXBUb0lkcygkJC5kYXRhLnRhcmdldHMpLmZvck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iAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBicnVzaC5zaXplKCkgPyBicnVzaC5hdHRyKCdoZWlnaHQnKSA6IDApO1xuICAgICAgICAkJC5zdmcuc2VsZWN0KCcuJyArIENMQVNTLnpvb21SZWN0KVxuICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgJCQud2lkdGgpXG4gICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgJCQuaGVpZ2h0KTtcbiAgICAgICAgLy8gTUVNTzogcGFyZW50IGRpdidzIGhlaWdodCB3aWxsIGJlIGJpZ2dlciB0aGFuIHN2ZyB3aGVuIDwhRE9DVFlQRSBodG1sPlxuICAgICAgICAkJC5zZWxlY3RDaGFydC5zdHlsZSgnbWF4LWhlaWdodCcsICQkLmN1cnJlbnRIZWlnaHQgKyBcInB4XCIpO1xuICAgIH07XG5cblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnVwZGF0ZURpbWVuc2lvbiA9IGZ1bmN0aW9uICh3aXRob3V0QXhpcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICBpZiAoIXdpdGhvdXRBeGlzKSB7XG4gICAgICAgICAgICBpZiAoJCQuY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgICAgICQkLmF4ZXMueC5jYWxsKCQkLnhBeGlzKTtcbiAgICAgICAgICAgICAgICAkJC5heGVzLnN1YnguY2FsbCgkJC5zdWJYQXhpcyk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICQkLmF4ZXMueS5jYWxsKCQkLnlBeGlzKTtcbiAgICAgICAgICAgICAgICAkJC5heGVzLnkyLmNhbGwoJCQueTJBeGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAkJC51cGRhdGVTaXplcygpO1xuICAgICAgICAkJC51cGRhdGVTY2FsZXMoKTtcbiAgICAgICAgJCQudXBkYXRlU3ZnU2l6ZSgpO1xuICAgICAgIC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Y29tcGxldGVkXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZWN0aW9uLm5vZGUoKS5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmNsZWFySW50ZXJ2YWwoJCQuaW50ZXJ2YWxGb3JPYnNlcnZlSW5zZXJ0ZWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnVwZGF0ZURpbWVuc2lvbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkJC5icnVzaCkgeyAkJC5icnVzaC51cGRhdGUoKTsgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5vbmluaXQuY2FsbCgkJCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFRyYW5zZm9ybTogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFVwZGF0ZVhEb21haW46IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uRm9yVHJhbnNmb3JtOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aExlZ2VuZDogdHJ1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbi50cmFuc2l0aW9uKCkuc3R5bGUoJ29wYWNpdHknLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSwgMTApO1xuICAgICAgICAgICAgICAgIH1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tcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmVuZGFsbCA9IGZ1bmN0aW9uICh0cmFuc2l0aW9uLCBjYWxsYmFjaykge1xuICAgICAgICB2YXIgbiA9IDA7XG4gICAgICAgIHRyYW5zaXRpb25cbiAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uICgpIHsgKytuOyB9KVxuICAgICAgICAgICAgLmVhY2goXCJlbmRcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICghLS1uKSB7IGNhbGxiYWNrLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7IH1cbiAgICAgICAgICAgIH0pO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2VuZXJhdGVXYWl0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgdHJhbnNpdGlvbnNUb1dhaXQgPSBbXSxcbiAgICAgICAgICAgIGYgPSBmdW5jdGlvbiAodHJhbnNpdGlvbiwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICB2YXIgdGltZXIgPSBzZXRJbnRlcnZhbChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkb25lID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbnNUb1dhaXQuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQuZW1wdHkoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQudHJhbnNpdGlvbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChkb25lID09PSB0cmFuc2l0aW9uc1RvV2FpdC5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrKSB7IGNhbGxiYWNrKCk7IH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sIDEwKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIGYuYWRkID0gZnVuY3Rpb24gKHRyYW5zaXRpb24pIHtcbiAgICAgICAgICAgIHRyYW5zaXRpb25zVG9XYWl0LnB1c2godHJhbnNpdGlvbik7XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBmO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5wYXJzZURhdGUgPSBmdW5jdGlvbiAoZGF0ZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBwYXJzZWREYXRlO1xuICAgICAgICBpZiAoZGF0ZSBpbnN0YW5jZW9mIERhdGUpIHtcbiAgICAgICAgICAgIHBhcnNlZERhdGUgPSBkYXRlO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBkYXRlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgcGFyc2VkRGF0ZSA9ICQkLmRhdGFUaW1lRm9ybWF0KCQkLmNvbmZpZy5kYXRhX3hGb3JtYXQpLnBhcnNlKGRhdGUpO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBkYXRlID09PSAnbnVtYmVyJyAmJiAhaXNOYU4oZGF0ZSkpIHtcbiAgICAgICAgICAgIHBhcnNlZERhdGUgPSBuZXcgRGF0ZSgrZGF0ZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFwYXJzZWREYXRlIH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gY29uZmlnID0ge1xuICAgICAgICAgICAgYmluZHRvOiAnI2NoYXJ0JyxcbiAgICAgICAgICAgIHN2Z19jbGFzc25hbWU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHNpemVfd2lkdGg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHNpemVfaGVpZ2h0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwYWRkaW5nX2xlZnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBhZGRpbmdfcmlnaHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBhZGRpbmdfdG9wOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwYWRkaW5nX2JvdHRvbTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcmVzaXplX2F1dG86IHRydWUsXG4gICAgICAgICAgICB6b29tX2VuYWJsZWQ6IGZhbHNlLFxuICAgICAgICAgICAgem9vbV9leHRlbnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHpvb21fcHJpdmlsZWdlZDogZmFsc2UsXG4gICAgICAgICAgICB6b29tX3Jlc2NhbGU6IGZhbHNlLFxuICAgICAgICAgICAgem9vbV9vbnpvb206IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgem9vbV9vbnpvb21zdGFydDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB6b29tX29uem9vbWVuZDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB6b29tX3hfbWluOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB6b29tX3hfbWF4OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBpbnRlcmFjdGlvbl9icmlnaHRlbjogdHJ1ZSxcbiAgICAgICAgICAgIGludGVyYWN0aW9uX2VuYWJsZWQ6IHRydWUsXG4gICAgICAgICAgICBvbm1vdXNlb3ZlcjogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbm1vdXNlb3V0OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9ucmVzaXplOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9ucmVzaXplZDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbmluaXQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25yZW5kZXJlZDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB0cmFuc2l0aW9uX2R1cmF0aW9uOiAzNTAsXG4gICAgICAgICAgICBkYXRhX3g6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRhdGFfeHM6IHt9LFxuICAgICAgICAgICAgZGF0YV94Rm9ybWF0OiAnJVktJW0tJWQnLFxuICAgICAgICAgICAgZGF0YV94TG9jYWx0aW1lOiB0cnVlLFxuICAgICAgICAgICAgZGF0YV94U29ydDogdHJ1ZSxcbiAgICAgICAgICAgIGRhdGFfaWRDb252ZXJ0ZXI6IGZ1bmN0aW9uIChpZCkgeyByZXR1cm4gaWQ7IH0sXG4gICAgICAgICAgICBkYXRhX25hbWVzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfY2xhc3Nlczoge30sXG4gICAgICAgICAgICBkYXRhX2dyb3VwczogW10sXG4gICAgICAgICAgICBkYXRhX2F4ZXM6IHt9LFxuICAgICAgICAgICAgZGF0YV90eXBlOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX3R5cGVzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfbGFiZWxzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfb3JkZXI6ICdkZXNjJyxcbiAgICAgICAgICAgIGRhdGFfcmVnaW9uczoge30sXG4gICAgICAgICAgICBkYXRhX2NvbG9yOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX2NvbG9yczoge30sXG4gICAgICAgICAgICBkYXRhX2hpZGU6IGZhbHNlLFxuICAgICAgICAgICAgZGF0YV9maWx0ZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRhdGFfc2VsZWN0aW9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GFydFxuICAgICAgICAgICAgc3ViY2hhcnRfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICBzdWJjaGFydF9zaXplX2hlaWdodDogNjAsXG4gICAgICAgICAgICBzdWJjaGFydF9heGlzX3hfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIHN1YmNoYXJ0X29uYnJ1c2g6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgLy8gY29sb3JcbiAgICAgICAgICAgIGNvbG9yX3BhdHRlcm46IFtdLFxuICAgICAgICAgICAgY29sb3JfdGhyZXNob2xkOiB7fSxcbiAgICAgICAgICAgIC8vIGxlZ2VuZFxuICAgICAgICAgICAgbGVnZW5kX3Nob3c6IHRydWUsXG4gICAgICAgICAgICBsZWdlbmRfaGlkZTogZmFsc2UsXG4gICAgICAgICAgICBsZWdlbmRfcG9zaXRpb246ICdib3R0b20nLFxuICAgICAgICAgICAgbGVnZW5kX2luc2V0X2FuY2hvcjogJ3RvcC1sZWZ0JyxcbiAgICAgICAgICAgIGxlZ2VuZF9pbnNldF94OiAxMCxcbiAgICAgICAgICAgIGxlZ2VuZF9pbnNldF95OiAwLFxuICAgICAgICAgICAgbGVnZW5kX2luc2V0X3N0ZXA6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGxlZ2VuZF9pdGVtX29uY2xpY2s6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGxlZ2VuZF9pdGVtX29ubW91c2VvdmVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBsZWdlbmRfaXRlbV9vbm1vdXNlb3V0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBsZWdlbmRfZXF1YWxseTogZmFsc2UsXG4gICAgICAgICAgICBsZWdlbmRfcGFkZGluZzogMCxcbiAgICAgICAgICAgIGxlZ2VuZF9pdGVtX3RpbGVfd2lkdGg6IDEwLFxuICAgICAgICAgICAgbGVnZW5kX2l0ZW1fdGlsZV9oZWlnaHQ6IDEwLFxuICAgICAgICAgICAgLy8gYXhpc1xuICAgICAgICAgICAgYXhpc19yb3RhdGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGF4aXNfeF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgYXhpc194X3R5cGU6ICdpbmRleGVkJyxcbiAgICAgICAgICAgIGF4aXNfeF9sb2NhbHRpbWU6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfY2F0ZWdvcmllczogW10sXG4gICAgICAgICAgICBheGlzX3hfdGlja19jZW50ZXJlZDogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3hfdGlja19mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2N1bGxpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc194X3RpY2tfY3VsbGluZ19tYXg6IDEwLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfY291bnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2ZpdDogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX3ZhbHVlczogbnVsbCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX3JvdGF0ZTogMCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX291dGVyOiB0cnVlLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfbXVsdGlsaW5lOiB0cnVlLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfd2lkdGg6IG51bGwsXG4gICAgICAgICAgICBheGlzX3hfbWF4OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfbWluOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfcGFkZGluZzoge30sXG4gICAgICAgICAgICBheGlzX3hfaGVpZ2h0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfZXh0ZW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfbGFiZWw6IHt9LFxuICAgICAgICAgICAgYXhpc195X3Nob3c6IHRydWUsXG4gICAgICAgICAgICBheGlzX3lfdHlwZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X2ludmVydGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGF4aXNfeV9jZW50ZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9pbm5lcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X2xhYmVsOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfb3V0ZXI6IHRydWUsXG4gICAgICAgICAgICBheGlzX3lfdGlja192YWx1ZXM6IG51bGwsICAgICAgICBcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX3JvdGF0ZTogMCxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX2NvdW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfdGlja190aW1lX3ZhbHVlOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfdGlja190aW1lX2ludGVydmFsOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfcGFkZGluZzoge30sXG4gICAgICAgICAgICBheGlzX3lfZGVmYXVsdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9zaG93OiBmYWxzZSxcbiAgICAgICAgICAgIGF4aXNfeTJfbWF4OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9pbnZlcnRlZDogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3kyX2NlbnRlcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9pbm5lcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9sYWJlbDoge30sXG4gICAgICAgICAgICBheGlzX3kyX3RpY2tfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX3RpY2tfb3V0ZXI6IHRydWUsXG4gICAgICAgICAgICBheGlzX3kyX3RpY2tfdmFsdWVzOiBudWxsLFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX2NvdW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX3BhZGRpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc195Ml9kZWZhdWx0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyBncmlkXG4gICAgICAgICAgICBncmlkX3hfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICBncmlkX3hfdHlwZTogJ3RpY2snLFxuICAgICAgICAgICAgZ3JpZF94X2xpbmVzOiBbXSxcbiAgICAgICAgICAgIGdyaWRfeV9zaG93OiBmYWxzZSxcbiAgICAgICAgICAgIC8vIG5vdCB1c2VkXG4gICAgICAgICAgICAvLyBncmlkX3lfdHlwZTogJ3RpY2snLFxuICAgICAgICAgICAgZ3JpZF95X2xpbmVzOiBbXSxcbiAgICAgICAgICAgIGdyaWRfeV90aWNrczogMTAsXG4gICAgICAgICAgICBncmlkX2ZvY3VzX3Nob3c6IHRydWUsXG4gICAgICAgICAgICBncmlkX2xpbmVzX2Zyb250OiB0cnVlLFxuICAgICAgICAgICAgLy8gcG9pbnQgLSBwb2ludCBvZiBlYWNoIGRhdGFcbiAgICAgICAgICAgIHBvaW50X3Nob3c6IHRydWUsXG4gICAgICAgICAgICBwb2ludF9yOiAyLjUsXG4gICAgICAgICAgICBwb2ludF9zZW5zaXRpdml0eTogMTAsXG4gICAgICAgICAgICBwb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZDogdHJ1ZSxcbiAgICAgICAgICAgIHBvaW50X2ZvY3VzX2V4cGFuZF9yOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwb2ludF9zZWxlY3RfcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gbGluZVxuICAgICAgICAgICAgbGluZV9jb25uZWN0TnVsbDogZmFsc2UsXG4gICAgICAgICAgICBsaW5lX3N0ZXBfdHlwZTogJ3N0ZXAnLFxuICAgICAgICAgICAgLy8gYmFyXG4gICAgICAgICAgICBiYXJfd2lkdGg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGJhcl93aWR0aF9yYXRpbzogMC42LFxuICAgICAgICAgICAgYmFyX3dpZHRoX21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYmFyX3plcm9iYXNlZDogdHJ1ZSxcbiAgICAgICAgICAgIC8vIGFyZWFcbiAgICAgICAgICAgIGFyZWFfemVyb2Jhc2VkOiB0cnVlLFxuICAgICAgICAgICAgYXJlYV9hYm92ZTogZmFsc2UsXG4gICAgICAgICAgICAvLyBwaWVcbiAgICAgICAgICAgIHBpZV9sYWJlbF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgcGllX2xhYmVsX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGllX2xhYmVsX3RocmVzaG9sZDogMC4wNSxcbiAgICAgICAgICAgIHBpZV9sYWJlbF9yYXRpbzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGllX2V4cGFuZDoge30sXG4gICAgICAgICAgICBwaWVfZXhwYW5kX2R1cmF0aW9uOiA1MCxcbiAgICAgICAgICAgIC8vIGdhdWdlXG4gICAgICAgICAgICBnYXVnZV9mdWxsQ2lyY2xlOiBmYWxzZSxcbiAgICAgICAgICAgIGdhdWdlX2xhYmVsX3Nob3c6IHRydWUsXG4gICAgICAgICAgICBnYXVnZV9sYWJlbF9mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGdhdWdlX21pbjogMCxcbiAgICAgICAgICAgIGdhdWdlX21heDogMTAwLFxuICAgICAgICAgICAgZ2F1Z2Vfc3RhcnRpbmdBbmdsZTogLTEgKiBNYXRoLlBJLzIsXG4gICAgICAgICAgICBnYXVnZV91bml0czogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZ2F1Z2Vfd2lkdGg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGdhdWdlX2V4cGFuZDoge30sXG4gICAgICAgICAgICBnYXVnZV9leHBhbmRfZHVyYXRpb246IDUwLFxuICAgICAgICAgICAgLy8gZG9udXRcbiAgICAgICAgICAgIGRvbnV0X2xhYmVsX3Nob3c6IHRydWUsXG4gICAgICAgICAgICBkb251dF9sYWJlbF9mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRvbnV0X2xhYmVsX3RocmVzaG9sZDogMC4wNSxcbiAgICAgICAgICAgIGRvbnV0X2xhYmVsX3JhdGlvOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkb251dF93aWR0aDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZG9udXRfdGl0bGU6IFwiXCIsXG4gICAgICAgICAgICBkb251dF9leHBhbmQ6IHt9LFxuICAgICAgICAgICAgZG9udXRfZXhwYW5kX2R1cmF0aW9uOiA1MCxcbiAgICAgICAgICAgIC8vIHNwbGluZVxuICAgICAgICAgICAgc3BsaW5lX2ludGVycG9sYXRpb25fdHlwZTogJ2NhcmRpbmFsJyxcbiAgICAgICAgICAgIC8vIHJlZ2lvbiAtIHJlZ2lvbiB0byBjaGFuZ2Ugc3R5bGVcbiAgICAgICAgICAgIHJlZ2lvbnM6IFtdLFxuICAgICAgICAgICAgLy8gdG9vbHRpcCAtIHNob3cgd2hlbiBtb3VzZW92ZXIgb24gZWFjaCBkYXRhXG4gICAgICAgICAgICB0b29sdGlwX3Nob3c6IHRydWUsXG4gICAgICAgICAgICB0b29sdGlwX2dyb3VwZWQ6IHRydWUsXG4gICAgICAgICAgICB0b29sdGlwX2Zvcm1hdF90aXRsZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgdG9vbHRpcF9mb3JtYXRfbmFtZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgdG9vbHRpcF9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VhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgY29uZmlnW2tleV0gPSB0aGlzLmFkZGl0aW9uYWxDb25maWdba2V5XTtcbiAgICAgICAgfSwgdGhpcyk7XG5cbiAgICAgICAgcmV0dXJuIGNvbmZpZztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmFkZGl0aW9uYWxDb25maWcgPSB7fTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmxvYWRDb25maWcgPSBmdW5jdGlvbiAoY29uZmlnKSB7XG4gICAgICAgIHZhciB0aGlzX2NvbmZpZyA9IHRoaXMuY29uZmlnLCB0YXJnZXQsIGtleXMsIHJlYWQ7XG4gICAgICAgIGZ1bmN0aW9uIGZpbmQoKSB7XG4gICAgICAgICAgICB2YXIga2V5ID0ga2V5cy5zaGlmdCgpO1xuICAgIC8vICAgICAgICBjb25zb2xlLmxvZyhcImtleSA9PlwiLCBrZXksIFwiLCB0YXJnZXQgPT5cIiwgdGFyZ2V0KTtcbiAgICAgICAgICAgIGlmIChrZXkgJiYgdGFyZ2V0ICYmIHR5cGVvZiB0YXJnZXQgPT09ICdvYmplY3QnICYmIGtleSBpbiB0YXJnZXQpIHtcbiAgICAgICAgICAgICAgICB0YXJnZXQgPSB0YXJnZXRba2V5XTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmluZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoIWtleSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0YXJnZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIE9iamVjdC5rZXlzKHRoaXNfY29uZmlnKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgIHRhcmdldCA9IGNvbmZpZztcbiA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AgICAgIHZhciB2ID0gX3NjYWxlKGQpICsgb2Zmc2V0KGQpO1xuICAgICAgICAgICAgICAgIHJldHVybiByYXcgPyB2IDogTWF0aC5jZWlsKHYpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNjYWxlID0gZnVuY3Rpb24gKGQsIHJhdykge1xuICAgICAgICAgICAgICAgIHZhciB2ID0gX3NjYWxlKGQpO1xuICAgICAgICAgICAgICAgIHJldHVybiByYXcgPyB2IDogTWF0aC5jZWlsKHYpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICAvLyBkZWZpbmUgZnVuY3Rpb25zXG4gICAgICAgIGZvciAoa2V5IGluIF9zY2FsZSkge1xuICAgICAgICAgICAgc2NhbGVba2V5XSA9IF9zY2FsZVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIHNjYWxlLm9yZ0RvbWFpbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiBfc2NhbGUuZG9tYWluKCk7XG4gICAgICAgIH07XG4gICAgICAgIC8vIGRlZmluZSBjdXN0b20gZG9tYWluKCkgZm9yIGNhdGVnb3JpemVkIGF4aXNcbiAgICAgICAgaWYgKCQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgc2NhbGUuZG9tYWluID0gZnVuY3Rpb24gKGRvbWFpbikge1xuICAgICAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBkb21haW4gPSB0aGlzLm9yZ0RvbWFpbigpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gW2RvbWFpblswXSwgZG9tYWluWzFdICsgMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF9zY2FsZS5kb21haW4oZG9tYWluKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gc2NhbGU7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gIC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0uZmlsdGVyKGZ1bmN0aW9uIChpZCkgeyByZXR1cm4gaWRzLmluZGV4T2YoaWQpID49IDA7IH0pO1xuICAgICAgICAgICAgICAgIGlmIChpZHNJbkdyb3VwLmxlbmd0aCA9PT0gMCkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgIGJhc2VJZCA9IGlkc0luR3JvdXBbMF07XG4gICAgICAgICAgICAgICAgLy8gQ29uc2lkZXIgbmVnYXRpdmUgdmFsdWVzXG4gICAgICAgICAgICAgICAgaWYgKGhhc05lZ2F0aXZlVmFsdWUgJiYgeXNbYmFzZUlkXSkge1xuICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdLmZvckVhY2goZnVuY3Rpb24gKHYsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF1baV0gPSB2IDwgMCA/IHYgOiAwO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gQ29tcHV0ZSBtaW5cbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDwgaWRzSW5Hcm91cC5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IGlkc0luR3JvdXBba107XG4gICAgICAgICAgICAgICAgICAgIGlmICghIHlzW2lkXSkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgICAgICB5c1tpZF0uZm9yRWFjaChmdW5jdGlvbiAodiwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmF4aXMuZ2V0SWQoaWQpID09PSAkJC5heGlzLmdldElkKGJhc2VJZCkgJiYgeXNbYmFzZUlkXSAmJiAhKGhhc05lZ2F0aXZlVmFsdWUgJiYgK3YgPiAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF1baV0gKz0gK3Y7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAg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gICAgICAvLyBDb25zaWRlciBwb3NpdGl2ZSB2YWx1ZXNcbiAgICAgICAgICAgICAgICBpZiAoaGFzUG9zaXRpdmVWYWx1ZSAmJiB5c1tiYXNlSWRdKSB7XG4gICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF0uZm9yRWFjaChmdW5jdGlvbiAodiwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXVtpXSA9IHYgPiAwID8gdiA6IDA7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG1heFxuICAgICAgICAgICAgICAgIGZvciAoayA9IDE7IGsgPCBpZHNJbkdyb3VwLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlkID0gaWRzSW5Hcm91cFtrXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEgeXNbaWRdKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICAgICAgICAgIHlzW2lkXS5mb3JFYWNoKGZ1bmN0aW9uICh2LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJCQuYXhpcy5nZXRJZChpZCkgPT09ICQkLmF4aXMuZ2V0SWQoYmFzZUlkKSAmJiB5c1tiYXNlSWRdICYmICEoaGFzUG9zaXRpdmVWYWx1ZSAmJiArdiA8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXVtpXSArPSArdjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiAkJC5kMy5tYXgoT2JqZWN0LmtleXMoeXMpLm1hcChmdW5jdGlvbiAoa2V5KSB7IHJldHVybiAkJC5kMy5tYXgoeXNba2V5XSk7IH0pKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFlEb21haW4gPSBmdW5jdGlvbiAodGFyZ2V0cywgYXhpc0lkLCB4RG9tYWluKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIHRhcmdldHNCeUF4aXNJZCA9IHRhcmdldHMuZmlsdGVyKGZ1bmN0aW9uICh0KSB7IHJldHVybiAkJC5heGlzLmdldElkKHQuaWQpID09PSBheGlzSWQ7IH0pLFxuICAgICAgICAgICAgeVRhcmdldHMgPSB4RG9tYWluID8gJCQuZmlsdGVyQnlYRG9tYWluKHRhcmdldHNCeUF4aXNJZCwgeERvbWFpbikgOiB0YXJnZXRzQnlBeGlzSWQsXG4gICAgICAgICAgICB5TWluID0gYXhpc0lkID09PSAneTInID8gY29uZmlnLmF4aXNfeTJfbWluIDogY29uZmlnLmF4aXNfeV9taW4sXG4gICAgICAgICAgICB5TWF4ID0gYXhpc0lkID09PSAneTInID8gY29uZmlnLmF4aXNfeTJfbWF4IDogY29uZmlnLmF4aXNfeV9tYXgsXG4gICAgICAgICAgICB5RG9tYWluTWluID0gJCQuZ2V0WURvbWFpbk1pbih5VGFyZ2V0cyksXG4gICAgICAgICAgICB5RG9tYWluTWF4ID0gJCQuZ2V0WURvbWFpbk1heCh5VGFyZ2V0cyksXG4gICAgICAgICAgICBkb21haW4sIGRvbWFpbkxlbmd0aCwgcGFkZGluZywgcGFkZGluZ190b3AsIHBhZGRpbmdfYm90dG9tLFxuICAgICAgICAgICAgY2VudGVyID0gYXhpc0lkID09PSAneTInID8gY29uZmlnLmF4aXNfeTJfY2VudGVyIDogY29uZmlnLmF4aXNfeV9jZW50ZXIsXG4gICAgICAgICAgICB5RG9tYWluQWJzLCBsZW5ndGhzLCBkaWZmLCByYXRpbywgaXNBbGxQb3NpdGl2ZSwgaXNBbGxOZWdhdGl2ZSxcbiAgICAgICAgICAgIGlzWmVyb0Jhc2VkID0gKCQkLmhhc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AgICAgICAgfVxuICAgICAgICBpZiAoaXNOYU4oeURvbWFpbk1pbikpIHsgLy8gc2V0IG1pbmltdW0gdG8gemVybyB3aGVuIG5vdCBudW1iZXJcbiAgICAgICAgICAgIHlEb21haW5NaW4gPSAwO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc05hTih5RG9tYWluTWF4KSkgeyAvLyBzZXQgbWF4aW11bSB0byBoYXZlIHNhbWUgdmFsdWUgYXMgeURvbWFpbk1pblxuICAgICAgICAgICAgeURvbWFpbk1heCA9IHlEb21haW5NaW47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHlEb21haW5NaW4gPT09IHlEb21haW5NYXgpIHtcbiAgICAgICAgICAgIHlEb21haW5NaW4gPCAwID8geURvbWFpbk1heCA9IDAgOiB5RG9tYWluTWluID0gMDtcbiAgICAgICAgfVxuICAgICAgICBpc0FsbFBvc2l0aXZlID0geURvbWFpbk1pbiA+PSAwICYmIHlEb21haW5NYXggPj0gMDtcbiAgICAgICAgaXNBbGxOZWdhdGl2ZSA9IHlEb21haW5NaW4gPD0gMCAmJiB5RG9tYWluTWF4IDw9IDA7XG5cbiAgICAgICAgLy8gQ2FuY2VsIHplcm9iYXNlZCBpZiBheGlzXypfbWluIC8gYXhpc18qX21heCBzcGVjaWZpZWRcbiAgICAgICAgaWYgKChpc1ZhbHVlKHlNaW4pICYmIGlzQWxsUG9zaXRpdmUpIHx8IChpc1ZhbHVlKHlNYXgpICYmIGlzQWxsTmVnYXRpdmUpKSB7XG4gICAgICAgICAgICBpc1plcm9CYXNlZCA9IGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQmFyL0FyZWEgY2hhcnQgc2hvdWxkIGJlIDAtYmFzZWQgaWYgYWxsIHBvc2l0aXZlfG5lZ2F0aXZlXG4gICAgICAgIGlmIChpc1plcm9CYXNlZCkge1xuICAgICAgICAgICAgaWYgKGlzQWxsUG9zaXRpdmUpIHsgeURvbWFpbk1pbiA9IDA7IH1cbiAgICAgICAgICAgIGlmIChpc0FsbE5lZ2F0aXZlKSB7IHlEb21haW5NYXggPSAwOyB9XG4gICAgICAgIH1cblxuICAgICAgICBkb21haW5MZW5ndGggPSBNYXRoLmFicyh5RG9tYWluTWF4IC0geURvbWFpbk1pbik7XG4gICAgICAgIHBhZGRpbmcgPSBwYWRkaW5nX3RvcCA9IHBhZGRpbmdfYm90dG9tID0gZG9tYWluTGVuZ3RoICogMC4xO1xuXG4gICAgICAgIGlmICh0eXBlb2YgY2VudGVyICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgeURvbWFpbkFicyA9IE1hdGgubWF4KE1hdGguYWJzKHlEb21haW5NaW4pLCBNYXRoLmFicyh5RG9tYWluTWF4KSk7XG4gICAgICAgICAgICB5RG9tYWluTWF4ID0gY2VudGVyICsgeURvbWFpbkFicztcbiAgICAgICAgICAgIHlEb21haW5NaW4gPSBjZW50ZXIgLSB5RG9tYWluQWJzO1xuICAgICAgICB9XG4gICAgICAgIC8vIGFkZCBwYWRkaW5nIGZvciBkYXRhIGxhYmVsXG4gICAgICAgIGlmIChzaG93SG9yaXpvbnRhbERhdGFMYWJlbCkge1xuICAgICAgICAgICAgbGVuZ3RocyA9ICQkLmdldERhdGFMYWJlbExlbmd0aCh5RG9tYWluTWluLCB5RG9tYWluTWF4LCAnd2lkdGgnKTtcbiAgICAgICAgICAgIGRpZmYgPSBkaWZmRG9tYWluKCQkLnkucmFuZ2UoKSk7XG4gICAgICAgICAgICByYXRpbyA9IFtsZW5ndGhzWzBdIC8gZGlmZiwgbGVuZ3Roc1sxXSAvIGRpZmZdO1xuICAgICAgICAgICAgcGFkZGluZ190b3AgKz0gZG9tYWluTGVuZ3RoICogKHJhdGlvWzFdIC8gKDEgLSByYXRpb1swXSAtIHJhdGlvWzFdKSk7XG4gICAgICAgICAgICBwYWRkaW5nX2JvdHRvbSArPSBkb21haW5MZW5ndGggKiAocmF0aW9bMF0gLyAoMSAtIHJhdGlvWzBdIC0gcmF0aW9bMV0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gICAgaWYgKHdpdGhUcmltKSB7ICQkLnguZG9tYWluKCQkLnRyaW1YRG9tYWluKCQkLngub3JnRG9tYWluKCkpKTsgfVxuXG4gICAgICAgIHJldHVybiAkJC54LmRvbWFpbigpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udHJpbVhEb21haW4gPSBmdW5jdGlvbiAoZG9tYWluKSB7XG4gICAgICAgIHZhciB6b29tRG9tYWluID0gdGhpcy5nZXRab29tRG9tYWluKCksXG4gICAgICAgICAgICBtaW4gPSB6b29tRG9tYWluWzBdLCBtYXggPSB6b29tRG9tYWluWzFdO1xuICAgICAgICBpZiAoZG9tYWluWzBdIDw9IG1pbikge1xuICAgICAgICAgICAgZG9tYWluWzFdID0gK2RvbWFpblsxXSArIChtaW4gLSBkb21haW5bMF0pO1xuICAgICAgICAgICAgZG9tYWluWzBdID0gbWluO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXggPD0gZG9tYWluWzFdKSB7XG4gICAgICAgICAgICBkb21haW5bMF0gPSArZG9tYWluWzBdIC0gKGRvbWFpblsxXSAtIG1heCk7XG4gICAgICAgICAgICBkb21haW5bMV0gPSBtYXg7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGRvbWFpbjtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaXNYID0gZnVuY3Rpb24gKGtleSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIHJldHVybiAoY29uZmlnLmRhdGFfeCAmJiBrZXkgPT09IGNvbmZpZy5kYXRhX3gpIHx8IChub3RFbXB0eShjb25maWcuZGF0YV94cykgJiYgaGFzVmFsdWUoY29uZmlnLmRhdGFfeHMsIGtleSkpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaXNOb3RYID0gZnVuY3Rpb24gKGtleSkge1xuICAgICAgICByZXR1cm4gIXRoaXMu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AgICAgICB9XG4gICAgICAgIHJldHVybiB4O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY2xvbmVUYXJnZXQgPSBmdW5jdGlvbiAodGFyZ2V0KSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBpZCA6IHRhcmdldC5pZCxcbiAgICAgICAgICAgIGlkX29yZyA6IHRhcmdldC5pZF9vcmcsXG4gICAgICAgICAgICB2YWx1ZXMgOiB0YXJnZXQudmFsdWVzLm1hcChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB7eDogZC54LCB2YWx1ZTogZC52YWx1ZSwgaWQ6IGQuaWR9O1xuICAgICAgICAgICAgfSlcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnVwZGF0ZVhzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICBpZiAoJCQuZGF0YS50YXJnZXRzLmxlbmd0aCkge1xuICAgICAgICAgICAgJCQueHMgPSBbXTtcbiAgICAgICAgICAgICQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgICQkLnhzW3YuaW5kZXhdID0gdi54O1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFByZXZYID0gZnVuY3Rpb24gKGkpIHtcbiAgICAgICAgdmFyIHggPSB0aGlzLnhzW2kgLSAxXTtcbiAgICAgICAgcmV0dXJuIHR5cGVvZiB4ICE9PSAndW5kZWZpbmVkJyA/IHggOiBudWxsO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0TmV4dFggPSBmdW5jdGlvbiAoaSkge1xuICAgICAgICB2YXIgeCA9IHRoaXMueHNbaSArIDFdO1xuICAgICAgICByZXR1cm4gdHlwZW9mIHggIT09ICd1bmRlZmluZWQnID8geCA6IG51bGw7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRNYXhEYXRhQ291bnQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXM7XG4gICAgICAgIHJldHVybiAkJC5kMy5tYXgoJCQuZGF0YS50YXJnZXRzLCBmdW5jdGlvbiAodCkgeyByZXR1cm4gdC52YWx1ZXMubGVuZ3RoOyB9KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldE1heERhdGFDb3VudFRhcmdldCA9IGZ1bmN0aW9uICh0YXJnZXRzKSB7XG4gICAgICAgIHZhciBsZW5ndGggPSB0YXJnZXRzLmxlbmd0aCwgbWF4ID0gMCwgbWF4VGFyZ2V0O1xuICAgICAgICBpZiAobGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgdGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgaWYgKHQudmFsdWVzLmxlbmd0aCA+IG1heCkge1xuICAgICAgICAgICAgICAgICAgICBtYXhUYXJnZXQgPSB0O1xuICAgICAgICAgICAgICAgICAgICBtYXggPSB0LnZhbHVlcy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtYXhUYXJnZXQgPSBsZW5ndGggPyB0YXJnZXRzWzBdIDogbnVsbDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbWF4VGFyZ2V0O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0RWRnZVggPSBmdW5jdGlvbiAodGFyZ2V0cykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICByZXR1cm4gIXRhcmdldHMubGVuZ3RoID8gWzAsIDBdIDogW1xuICAgICAgICAgICAgJ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YmICQkLmlzQmFyVHlwZSh2LmlkKTsgfSkuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdmFyIHNoYXBlID0gJCQubWFpbi5zZWxlY3QoJy4nICsgQ0xBU1MuYmFycyArICQkLmdldFRhcmdldFNlbGVjdG9yU3VmZml4KHYuaWQpICsgJyAuJyArIENMQVNTLmJhciArICctJyArIHYuaW5kZXgpLm5vZGUoKTtcbiAgICAgICAgICAgIGlmICghY2xvc2VzdCAmJiAkJC5pc1dpdGhpbkJhcihzaGFwZSkpIHtcbiAgICAgICAgICAgICAgICBjbG9zZXN0ID0gdjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gZmluZCBjbG9zZXN0IHBvaW50IGZyb20gbm9uLWJhclxuICAgICAgICB2YWx1ZXMuZmlsdGVyKGZ1bmN0aW9uICh2KSB7IHJldHVybiB2ICYmICEkJC5pc0JhclR5cGUodi5pZCk7IH0pLmZvckVhY2goZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHZhciBkID0gJCQuZGlzdCh2LCBwb3MpO1xuICAgICAgICAgICAgaWYgKGQgPCBtaW5EaXN0KSB7XG4gICAgICAgICAgICAgICAgbWluRGlzdCA9IGQ7XG4gICAgICAgICAgICAgICAgY2xvc2VzdCA9IHY7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBjbG9zZXN0O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZGlzdCA9IGZ1bmN0aW9uIChkYXRhLCBwb3MpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgeEluZGV4ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDEgOiAwLFxuICAgICAgICAgICAgeUluZGV4ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiAxLFxuICAgICAgICAgICAgeSA9ICQk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KCFkYXRhKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGVycm9yLnJlc3BvbnNlVVJMICsgJyAnICsgZXJyb3Iuc3RhdHVzICsgJyAoJyArIGVycm9yLnN0YXR1c1RleHQgKyAnKScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGUgPT09ICdqc29uJykge1xuICAgICAgICAgICAgICAgIGQgPSAkJC5jb252ZXJ0SnNvblRvRGF0YShKU09OLnBhcnNlKGRhdGEucmVzcG9uc2UpLCBrZXlzKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ3RzdicpIHtcbiAgICAgICAgICAgICAgICBkID0gJCQuY29udmVydFRzdlRvRGF0YShkYXRhLnJlc3BvbnNlKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZCA9ICQkLmNvbnZlcnRDc3ZUb0RhdGEoZGF0YS5yZXNwb25zZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkb25lLmNhbGwoJCQsIGQpO1xuICAgICAgICB9KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRYc3ZUb0RhdGEgPSBmdW5jdGlvbiAoeHN2LCBwYXJzZXIpIHtcbiAgICAgICAgdmFyIHJvd3MgPSBwYXJzZXIucGFyc2VSb3dzKHhzdiksIGQ7XG4gICAgICAgIGlmIChyb3dzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgZCA9IFt7fV07XG4gICAgICAgICAgICByb3dzWzBdLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAgICAgZFswXVtpZF0gPSBudWxsO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkID0gcGFyc2VyLnBhcnNlKHhzdik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGQ7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0Q3N2VG9EYXRhID0gZnVuY3Rpb24gKGNzdikge1xuICAgICAgICByZXR1cm4gdGhpcy5jb252ZXJ0WHN2VG9EYXRhKGNzdiwgdGhpcy5kMy5jc3YpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydFRzdlRvRGF0YSA9IGZ1bmN0aW9uICh0c3YpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY29udmVydFhzdlRvRGF0YSh0c3YsIHRoaXMuZDMudHN2KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRKc29uVG9EYXRhID0gZnVuY3Rpb24gKGpzb24sIGtleXMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIG5ld19yb3dzID0gW10sIHRhcmdldEtleXMsIGRhdGE7XG4gICAgICAgIGlmIChrZXlzKSB7IC8vIHdoZW4ga2V5cyBzcGVjaWZpZWQsIGpzb24gd291bGQgYmUgYW4gYXJyYXkgdGhhdCBpbmNsdWRlcyBvYmplY3RzXG4gICAgICAgICAgICBpZiAoa2V5cy54KSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0S2V5cyA9IGtleXMudmFsdWUuY29uY2F0KGtleXMueCk7XG4gICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfeCA9IGtleXMueDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0S2V5cyA9IGtleXMudmFsdWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBuZXdfcm93cy5wdXNoKHRhcmdldEtleXMpO1xuICAgICAgICAgICAganNvbi5mb3JFYWNoKGZ1bmN0aW9uIChvKSB7XG4gICAgICAgICAgICAgICAgdmFyIG5ld19yb3cgPSBbXTtcbiAgICAgICAgICAgICAgICB0YXJnZXRLZXlzLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBjb252ZXJ0IHVuZGVmaW5lZCB0byBudWxsIGJlY2F1c2UgdW5kZWZpbmVkIGRhdGEgd2lsbCBiZSByZW1vdmVkIGluIGNvbnZlcnREYXRhVG9UYXJnZXRzKClcbiAgICAgICAgICAgICAgICAgICAgdmFyIHYgPSAkJC5maW5kVmFsdWVJbkpzb24obywga2V5KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHYpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2ID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuZXdfcm93LnB1c2godik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgbmV3X3Jvd3MucHVzaChuZXdfcm93KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRSb3dzVG9EYXRhKG5ld19yb3dzKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKGpzb24pLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgICAgIG5ld19yb3dzLnB1c2goW2tleV0uY29uY2F0KGpzb25ba2V5XSkpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBkYXRhID0gJCQuY29udmVydENvbHVtbnNUb0RhdGEobmV3X3Jvd3MpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkYXRhO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZmluZFZhbHVlSW5Kc29uID0gZnVuY3Rpb24gKG9iamVjdCwgcGF0aCkge1xuICAgICAgICBwYXRoID0gcGF0aC5yZXBsYWNlKC9cXFsoXFx3KylcXF0vZywgJy4kMScpOyAvLyBjb252ZXJ0IGluZGV4ZXMgdG8gcHJvcGVydGllcyAocmVwbGFjZSBbXSB3aXRoIC4pXG4gICAgICAgIHBhdGggPSBwYXRoLnJlcGxhY2UoL15cXC4vLCAnJyk7ICAgICAgICAgICAvLyBzdHJpcCBhIGxlYWRpbmcgZG90XG4gICAgICAgIHZhciBwYXRoQXJyYXkgPSBwYXRoLnNwbGl0KCcuJyk7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcGF0aEFycmF5Lmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICB2YXIgayA9IHBhdGhBcnJheVtpXTtcbiAgICAgICAgICAgIGlmIChrIGluIG9iamVjdCkge1xuICAgICAgICAgICAgICAgIG9iamVjdCA9IG9iamVjdFtrXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0Um93c1RvRGF0YSA9IGZ1bmN0aW9uIChyb3dzKSB7XG4gICAgICAgIHZhciBrZXlzID0gcm93c1swXSwgbmV3X3JvdyA9IHt9LCBuZXdfcm93cyA9IFtdLCBpLCBqO1xuICAgICAgICBmb3IgKGkgPSAxOyBpIDwgcm93cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbmV3X3JvdyA9IHt9O1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IHJvd3NbaV0ubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQocm93c1tpXVtqXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiU291cmNlIGRhdGEgaXMgbWlzc2luZyBhIGNvbXBvbmVudCBhdCAoXCIgKyBpICsgXCIsXCIgKyBqICsgXCIpIVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbmV3X3Jvd1trZXlzW2pdXSA9IHJvd3NbaV1bal07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBuZXdfcm93cy5wdXNoKG5ld19yb3cpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXdfcm93cztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRDb2x1bW5zVG9EYXRhID0gZnVuY3Rpb24gKGNvbHVtbnMpIHtcbiAgICAgICAgdmFyIG5ld19yb3dzID0gW10sIGksIGosIGtleTtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvbHVtbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGtleSA9IGNvbHVtbnNbaV1bMF07XG4gICAgICAgICAgICBmb3IgKGogPSAxOyBqIDwgY29sdW1uc1tpXS5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChuZXdfcm93c1tqIC0gMV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIG5ld19yb3dzW2ogLSAxXSA9IHt9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoY29sdW1uc1tpXVtqXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiU291cmNlIGRhdGEgaXMgbWlzc2luZyBhIGNvbXBvbmVudCBhdCAoXCIgKyBpICsgXCIsXCIgKyBqICsgXCIpIVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbmV3X3Jvd3NbaiAtIDFdW2tleV0gPSBjb2x1bW5zW2ldW2pdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXdfcm93cztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnREYXRhVG9UYXJnZXRzID0gZnVuY3Rpb24gKGRhdGEsIGFwcGVuZFhzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIGlkcyA9ICQkLmQzLmtleXMoZGF0YVswXSkuZmlsdGVyKCQkLmlzTm90WCwgJCQpLFxuICAgICAgICAgICAgeHMgPSAkJC5kMy5rZXlzKGRhdGFbMF0pLmZpbHRlcigkJC5pc1gsICQkKSxcbiAgICAgICAgICAgIHRhcmdldHM7XG5cbiAgICAgICAgLy8gc2F2ZSB4IGZvciB1cGRhdGUgZGF0YSBieSBsb2FkIHdoZW4gY3VzdG9tIHggYW5kIGMzLnggQVBJXG4gICAgICAgIGlkcy5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgdmFyIHhLZXkgPSAkJC5nZXRYS2V5KGlkKTtcblxuICAgICAgICAgICAgaWYgKCQkLmlzQ3VzdG9tWCgpIHx8ICQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgLy8gaWYgaW5jbHVkZWQgaW4gaW5wdXQgZGF0YVxuICAgICAgICAgICAgICAgIGlmICh4cy5pbmRleE9mKHhLZXkpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZGF0YS54c1tpZF0gPSAoYXBwZW5kWHMgJiYgJCQuZGF0YS54c1tpZF0gPyAkJC5kYXRhLnhzW2lkXSA6IFtdKS5jb25jYXQoXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLm1hcChmdW5jdGlvbiAoZCkgeyByZXR1cm4gZFt4S2V5XTsgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGlzVmFsdWUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAocmF3WCwgaSkgeyByZXR1cm4gJCQuZ2VuZXJhdGVUYXJnZXRYKHJhd1gsIGlkLCBpKTsgfSlcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gaWYgbm90IGluY2x1ZGVkIGluIGlucHV0IGRhdGEsIGZpbmQgZnJvbSBwcmVsb2FkZWQgZGF0YSBvZiBvdGhlciBpZCdzIHhcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChjb25maWcuZGF0YV94KSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmRhdGEueHNbaWRdID0gJCQuZ2V0T3RoZXJUYXJnZXRYcygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBpZiBub3QgaW5jbHVkZWQgaW4gaW5wdXQgZGF0YSwgZmluZCBmcm9tIHByZWxvYWRlZCBkYXRhXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAobm90RW1wdHkoY29uZmlnLmRhdGFfeHMpKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmRhdGEueHNbaWRdID0gJCQuZ2V0WFZhbHVlc09mWEtleSh4S2V5LCAkJC5kYXRhLnRhcmdldHMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBNRU1POiBpZiBubyB4IGluY2x1ZGVkLCB1c2Ugc2FtZSB4IG9mIGN1cnJlbnQgd2lsbCBiZSB1c2VkXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICQkLmRhdGEueHNbaWRdID0gZGF0YS5tYXAoZnVuY3Rpb24gKGQsIGkpIHsgcmV0dXJuIGk7IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuXG4gICAgICAgIC8vIGNoZWNrIHggaXMgZGVmaW5lZFxuICAgICAgICBpZHMuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgIGlmICghJCQuZGF0YS54c1tpZF0pIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ3ggaXMgbm90IGRlZmluZWQgZm9yIGlkID0gXCInICsgaWQgKyAnXCIuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIGNvbnZlcnQgdG8gdGFyZ2V0XG4gICAgICAgIHRhcmdldHMgPSBpZHMubWFwKGZ1bmN0aW9uIChpZCwgaW5kZXgpIHtcbiAgICAgICAgICAgIHZhciBjb252ZXJ0ZWRJZCA9IGNvbmZpZy5kYXRhX2lkQ29udmVydGVyKGlkKTtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgaWQ6IGNvbnZlcnRlZElkLFxuICAgICAgICAgICAgICAgIGlkX29yZzogaWQsXG4gICAgICAgICAgICAgICAgdmFsdWVzOiBkYXRhLm1hcChmdW5jdGlvbiAoZCwgaSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgeEtleSA9ICQkLmdldFhLZXkoaWQpLCByYXdYID0gZFt4S2V5XSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gZFtpZF0gIT09IG51bGwgJiYgIWlzTmFOKGRbaWRdKSA/ICtkW2lkXSA6IG51bGwsIHg7XG4gICAgICAgICAgICAgICAgICAgIC8vIHVzZSB4IGFzIGNhdGVnb3JpZXMgaWYgY3VzdG9tIHggYW5kIGNhdGVnb3JpemVkXG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC5pc0N1c3RvbVgoKSAmJiAkJC5pc0NhdGVnb3JpemVkKCkgJiYgaW5kZXggPT09IDAgJiYgIWlzVW5kZWZpbmVkKHJhd1gpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPT09IDAgJiYgaSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3hfY2F0ZWdvcmllcyA9IFtdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGNvbmZpZy5heGlzX3hfY2F0ZWdvcmllcy5pbmRleE9mKHJhd1gpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHggPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGNvbmZpZy5heGlzX3hfY2F0ZWdvcmllcy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeF9jYXRlZ29yaWVzLnB1c2gocmF3WCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB4ICA9ICQkLmdlbmVyYXRlVGFyZ2V0WChyYXdYLCBpZCwgaSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gbWFyayBhcyB4ID0gdW5kZWZpbmVkIGlmIHZhbHVlIGlzIHVuZGVmaW5lZCBhbmQgZmlsdGVyIHRvIHJlbW92ZSBhZnRlciBtYXBwZWRcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGRbaWRdKSB8fCAkJC5kYXRhLnhzW2lkXS5sZW5ndGggPD0gaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge3g6IHgsIHZhbHVlOiB2YWx1ZSwgaWQ6IGNvbnZlcnRlZElkfTtcbiAgICAgICAgICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24gKHYpIHsgcmV0dXJuIGlzRGVmaW5lZCh2LngpOyB9KVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gZmluaXNoIHRhcmdldHNcbiAgICAgICAgdGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICB2YXIgaTtcbiAgICAgICAgICAgIC8vIHNvcnQgdmFsdWVzIGJ5IGl0cyB4XG4gICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfeFNvcnQpIHtcbiAgICAgICAgICAgICAgICB0LnZhbHVlcyA9IHQudmFsdWVzLnNvcnQoZnVuY3Rpb24gKHYxLCB2Mikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgeDEgPSB2MS54IHx8IHYxLnggPT09IDAgPyB2MS54IDogSW5maW5pdHksXG4gICAgICAgICAgICAgICAgICAgICAgICB4MiA9IHYyLnggfHwgdjIueCA9PT0gMCA/IHYyLnggOiBJbmZpbml0eTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHgxIC0geDI7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBpbmRleGluZyBlYWNoIHZhbHVlXG4gICAgICAgICAgICBpID0gMDtcbiAgICAgICAgICAgIHQudmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgICAgICB2LmluZGV4ID0gaSsrO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAvLyB0aGlzIG5lZWRzIHRvIGJlIHNvcnRlZCBiZWNhdXNlIGl0cyBpbmRleCBhbmQgdmFsdWUuaW5kZXggaXMgaWRlbnRpY2FsXG4gICAgICAgICAgICAkJC5kYXRhLnhzW3QuaWRdLnNvcnQoZnVuY3Rpb24gKHYxLCB2Mikge1xuICAgICAgICAgICAgICAgIHJldHVybiB2MSAtIHYyO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIGNhY2hlIGluZm9ybWF0aW9uIGFib3V0IHZhbHVlc1xuICAgICAgICAkJC5oYXNOZWdhdGl2ZVZhbHVlID0gJCQuaGFzTmVnYXRpdmVWYWx1ZUluVGFyZ2V0cyh0YXJnZXRzKTtcbiAgICAgICAgJCQuaGFzUG9zaXRpdmVWYWx1ZSA9ICQkLmhhc1Bvc2l0aXZlVmFsdWVJblRhcmdldHModGFyZ2V0cyk7XG5cbiAgICAgICAgLy8gc2V0IHRhcmdldCB0eXBlc1xuICAgICAgICBpZiAoY29uZmlnLmRhdGFfdHlwZSkge1xuICAgICAgICAgICAgJCQuc2V0VGFy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2V0VHlwZSh0LmlkLCB0eXBlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFVwZGF0ZS9BZGQgZGF0YVxuICAgICAgICAgICAgJCQuZGF0YS50YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRhcmdldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGQuaWQgPT09IHRhcmdldHNbaV0uaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQudmFsdWVzID0gdGFyZ2V0c1tpXS52YWx1ZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAkJC5kYXRhLnRhcmdldHMgPSAkJC5kYXRhLnRhcmdldHMuY29uY2F0KHRhcmdldHMpOyAvLyBhZGQgcmVtYWluZWRcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFNldCB0YXJnZXRzXG4gICAgICAgICQkLnVwZGF0ZVRhcmdldHMoJCQuZGF0YS50YXJnZXRzKTtcblxuICAgICAgICAvLyBSZWRyYXcgd2l0aCBuZXcgdGFyZ2V0c1xuICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLCB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZSwgd2l0aExlZ2VuZDogdHJ1ZX0pO1xuXG4gICAgICAgIGlmIChhcmdzLmRvbmUpIHsgYXJncy5kb25lKCk7IH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmxvYWRGcm9tQXJncyA9IGZ1bmN0aW9uIChhcmdzKSB7XG4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2h0KVxuICAgICAgICAgICAgICAgICAgICBpZiAocHJldlggPT09IG51bGwgJiYgbmV4dFggPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb25maWcuYXhpc19yb3RhdGVkID8gJCQuaGVpZ2h0IDogJCQud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAocHJldlggPT09IG51bGwpIHsgcHJldlggPSAkJC54LmRvbWFpbigpWzBdOyB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChuZXh0WCA9PT0gbnVsbCkgeyBuZXh0WCA9ICQkLnguZG9tYWluKClbMV07IH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gTWF0aC5tYXgoMCwgKCQkLngobmV4dFgpIC0gJCQueChwcmV2WCkpIC8gMik7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICByZWN0WCA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcmV2WCA9ICQkLmdldFByZXZYKGQuaW5kZXgpLCBuZXh0WCA9ICQkLmdldE5leHRYKGQuaW5kZXgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1ggPSAkJC5kYXRhLnhzW2QuaWRdW2QuaW5kZXhdO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZXJlIHRoaXMgaXMgYSBzaW5nbGUgZGF0YSBwb2ludCBwb3NpdGlvbiB0aGUgZXZlbnRSZWN0IGF0IDBcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsICYmIG5leHRYID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2WCA9PT0gbnVsbCkgeyBwcmV2WCA9ICQkLnguZG9tYWluKClbMF07IH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCQkLngodGhpc1gpICsgJCQueChwcmV2WCkpIC8gMjtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZWN0VyA9ICQkLmdldEV2ZW50UmVjdFdpZHRoKCk7XG4gICAgICAgICAgICAgICAgcmVjdFggPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQueChkLngpIC0gKHJlY3RXIC8gMik7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHggPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IHJlY3RYO1xuICAgICAgICAgICAgeSA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyByZWN0WCA6IDA7XG4gICAgICAgICAgICB3ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoIDogcmVjdFc7XG4gICAgICAgICAgICBoID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IHJlY3RXIDogJCQuaGVpZ2h0O1xuICAgICAgICB9XG5cbiAgICAgICAgZXZlbnRSZWN0VXBkYXRlXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAkJC5jbGFzc0V2ZW50LmJpbmQoJCQpKVxuICAgICAgICAgICAgLmF0dHIoXCJ4XCIsIHgpXG4gICAgICAgICAgICAuYXR0cihcInlcIiwgeSlcbiAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgdylcbiAgICAgICAgICAgIC5hdHRyKFwiaGVpZ2h0XCIsIGgpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2VuZXJhdGVFdmVudFJlY3RzRm9yU2luZ2xlWCA9IGZ1bmN0aW9uIChldmVudFJlY3RFbnRlcikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBkMyA9ICQkLmQzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGV2ZW50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biAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBkLmluZGV4O1xuICAgICAgICAgICAgICAgIGlmICghJCQuY29uZmlnKSB7IHJldHVybjsgfSAvLyBjaGFydCBpcyBkZXN0cm95ZWRcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG4gICAgICAgICAgICAgICAgJCQuaGlkZVRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAvLyBVbmRvIGV4cGFuZGVkIHNoYXBlc1xuICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQ2lyY2xlcygpO1xuICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQmFycygpO1xuICAgICAgICAgICAgICAgIC8vIENhbGwgZXZlbnQgaGFuZGxlclxuICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgaW5kZXgpLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW91dC5jYWxsKCQkLmFwaSwgZCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZERhdGEsIGluZGV4ID0gZC5pbmRleCxcbiAgICAgICAgICAgICAgICAgICAgZXZlbnRSZWN0ID0gJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy5ldmVudFJlY3QgKyAnLScgKyBpbmRleCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQuZHJhZ2dpbmcgfHwgJCQuZmxvd2luZykgeyByZXR1cm47IH0gLy8gZG8gbm90aGluZyB3aGlsZSBkcmFnZ2luZy9mbG93aW5nXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cblxuICAgICAgICAgICAgICAgIGlmICgkJC5pc1N0ZXBUeXBlKGQpICYmICQkLmNvbmZpZy5saW5lX3N0ZXBfdHlwZSA9PT0gJ3N0ZXAtYWZ0ZXInICYmIGQzLm1vdXNlKHRoaXMpWzBdIDwgJCQueCgkJC5nZXRYVmFsdWUoZC5pZCwgaW5kZXgpKSkge1xuICAgICAgICAgICAgICAgICAgICBpbmRleCAtPSAxO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIFNob3cgdG9vbHRpcFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0YSA9ICQkLmZpbHRlclRhcmdldHNUb1Nob3coJCQuZGF0YS50YXJnZXRzKS5tYXAoZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLmFkZE5hbWUoJCQuZ2V0VmFsdWVPbkluZGV4KHQudmFsdWVzLCBpbmRleCkpO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy50b29sdGlwX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoc2VsZWN0ZWREYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1hHcmlkRm9jdXMoc2VsZWN0ZWREYXRhKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCAmJiAoIWNvbmZpZy5kYXRhX3NlbGVjdGlvbl9lbmFibGVkIHx8IGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBpbmRleClcbiAgICAgICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLmNsYXNzZWQoQ0xBU1MuRVhQQU5ERUQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRSZWN0LnN0eWxlKCdjdXJzb3InLCBjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCA/ICdwb2ludGVyJyA6IG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuaGlkZVhHcmlkRm9jdXMoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQudW5leHBhbmRDaXJjbGVzKGluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQudW5leHBhbmRCYXJzKGluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5pc1dpdGhpblNoYXBlKHRoaXMsIGQpO1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9lbmFibGVkICYmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCB8fCBjb25maWcuZGF0YV9zZWxlY3Rpb25faXNzZWxlY3RhYmxlKGQpKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50UmVjdC5zdHlsZSgnY3Vyc29yJywgJ3BvaW50ZXInKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnNob3dUb29sdGlwKFtkXSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1hHcmlkRm9jdXMoW2RdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkKSB7ICQkLmV4cGFuZENpcmNsZXMoaW5kZXgsIGQuaWQsIHRydWUpOyB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuZXhwYW5kQmFycyhpbmRleCwgZC5pZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IGQuaW5kZXg7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSB8fCAhJCQudG9nZ2xlU2hhcGUpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgaWYgKCQkLmNhbmNlbENsaWNrKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmNhbmNlbENsaWNrID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzU3RlcFR5cGUoZCkgJiYgY29uZmlnLmxpbmVfc3RlcF90eXBlID09PSAnc3RlcC1hZnRlcicgJiYgZDMubW91c2UodGhpcylbMF0gPCAkJC54KCQkLmdldFhWYWx1ZShkLmlkLCBpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIGluZGV4IC09IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgaW5kZXgpLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkIHx8ICQkLmlzV2l0aGluU2hhcGUodGhpcywgZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZVNoYXBlKHRoaXMsIGQsIGluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29uY2xpY2suY2FsbCgkJC5hcGksIGQsIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhbGwoXG4gICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2RyYWdnYWJsZSAmJiAkJC5kcmFnID8gKFxuICAgICAgICAgICAgICAgICAgICBkMy5iZWhhdmlvci5kcmFnKCkub3JpZ2luKE9iamVjdClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZycsIGZ1bmN0aW9uICgpIHsgJCQuZHJ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mV2ZW50UmVjdClcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEkJC5jb25maWcpIHsgcmV0dXJuOyB9IC8vIGNoYXJ0IGlzIGRlc3Ryb3llZFxuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgbW91c2VvdXQoKTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgdGFyZ2V0c1RvU2hvdyA9ICQkLmZpbHRlclRhcmdldHNUb1Nob3coJCQuZGF0YS50YXJnZXRzKTtcbiAgICAgICAgICAgICAgICB2YXIgbW91c2UsIGNsb3Nlc3QsIHNhbWVYRGF0YSwgc2VsZWN0ZWREYXRhO1xuXG4gICAgICAgICAgICAgICAgaWYgKCQkLmRyYWdnaW5nKSB7IHJldHVybjsgfSAvLyBkbyBub3RoaW5nIHdoZW4gZHJhZ2dpbmdcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSh0YXJnZXRzVG9TaG93KSkgeyByZXR1cm47IH1cblxuICAgICAgICAgICAgICAgIG1vdXNlID0gZDMubW91c2UodGhpcyk7XG4gICAgICAgICAgICAgICAgY2xvc2VzdCA9ICQkLmZpbmRDbG9zZXN0RnJvbVRhcmdldHModGFyZ2V0c1RvU2hvdywgbW91c2UpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCQkLm1vdXNlb3ZlciAmJiAoIWNsb3Nlc3QgfHwgY2xvc2VzdC5pZCAhPT0gJCQubW91c2VvdmVyLmlkKSkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9vbm1vdXNlb3V0LmNhbGwoJCQuYXBpLCAkJC5tb3VzZW92ZXIpO1xuICAgICAgICAgICAgICAgICAgICAkJC5tb3VzZW92ZXIgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKCEgY2xvc2VzdCkge1xuICAgICAgICAgICAgICAgICAgICBtb3VzZW91dCgpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzU2NhdHRlclR5cGUoY2xvc2VzdCkgfHwgIWNvbmZpZy50b29sdGlwX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgc2FtZVhEYXRhID0gW2Nsb3Nlc3RdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHNhbWVYRGF0YSA9ICQkLmZpbHRlckJ5WCh0YXJnZXRzVG9TaG93LCBjbG9zZXN0LngpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIHNob3cgdG9vbHRpcCB3aGVuIGN1cnNvciBpcyBjbG9zZSB0byBzb21lIHBvaW50XG4gICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRhID0gc2FtZVhEYXRhLm1hcChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQuYWRkTmFtZShkKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAkJC5zaG93VG9vbHRpcChzZWxlY3RlZERhdGEsIHRoaXMpO1xuXG4gICAgICAgICAgICAgICAgLy8gZXhwYW5kIHBvaW50c1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcucG9pbnRfZm9jdXNfZXhwYW5kX2VuYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZXhwYW5kQ2lyY2xlcyhjbG9zZXN0LmluZGV4LCBjbG9zZXN0LmlkLCB0cnVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQuZXhwYW5kQmFycyhjbG9zZXN0LmluZGV4LCBjbG9zZXN0LmlkLCB0cnVlKTtcblxuICAgICAgICAgICAgICAgIC8vIFNob3cgeGdyaWQgZm9jdXMgbGluZVxuICAgICAgICAgICAgICAgICQkLnNob3dYR3JpZEZvY3VzKHNlbGVjdGVkRGF0YSk7XG5cbiAgICAgICAgICAgICAgICAvLyBTaG93IGN1cnNvciBhcyBwb2ludGVyIGlmIHBvaW50IGlzIGNsb3NlIHRvIG1vdXNlIHBvc2l0aW9uXG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzQmFyVHlwZShjbG9zZXN0LmlkKSB8fCAkJC5kaXN0KGNsb3Nlc3QsIG1vdXNlKSA8IGNvbmZpZy5wb2ludF9zZW5zaXRpdml0eSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0KCcuJyArIENMQVNTLmV2ZW50UmVjdCkuc3R5bGUoJ2N1cnNvcicsICdwb2ludGVyJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghJCQubW91c2VvdmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9vbm1vdXNlb3Zlci5jYWxsKCQkLmFwaSwgY2xvc2VzdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5tb3VzZW92ZXIgPSBjbG9zZXN0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRhcmdldHNUb1Nob3cgPSAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cyk7XG4gICAgICAgICAgICAgICAgdmFyIG1vdXNlLCBjbG9zZXN0O1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKHRhcmdldHNUb1Nob3cpKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgbW91c2UgPSBkMy5tb3VzZSh0aGlzKTtcbiAgICAgICAgICAgICAgICBjbG9zZXN0ID0gJCQuZmluZENsb3Nlc3RGcm9tVGFyZ2V0cyh0YXJnZXRzVG9TaG93LCBtb3VzZSk7XG4gICAgICAgICAgICAgICAgaWYgKCEgY2xvc2VzdCkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICAvLyBzZWxlY3QgaWYgc2VsZWN0aW9uIGVuYWJsZWRcbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNCYXJUeXBlKGNsb3Nlc3QuaWQpIHx8ICQkLmRpc3QoY2xvc2VzdCwgbW91c2UpIDwgY29uZmlnLnBvaW50X3NlbnNpdGl2aXR5KSB7XG4gICAgICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlcyArICQkLmdldFRhcmdldFNlbGVjdG9yU3VmZml4KGNsb3Nlc3QuaWQpKS5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBjbG9zZXN0LmluZGV4KS5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCB8fCAkJC5pc1dpdGhpblNoYXBlKHRoaXMsIGNsb3Nlc3QpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQudG9nZ2xlU2hhcGUodGhpcywgY2xvc2VzdCwgY2xvc2VzdC5pbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25jbGljay5jYWxsKCQkLmFwaSwgY2xvc2VzdCwgdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2FsbChcbiAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9zZWxlY3Rpb25fZ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R1cm4gY2VpbDEwKCQkLmdldEF4aXNXaWR0aEJ5QXhpc0lkKCd5MicpKSArIGxlZ2VuZFdpZHRoT25SaWdodDtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRQYXJlbnRSZWN0VmFsdWUgPSBmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgIHZhciBwYXJlbnQgPSB0aGlzLnNlbGVjdENoYXJ0Lm5vZGUoKSwgdjtcbiAgICAgICAgd2hpbGUgKHBhcmVudCAmJiBwYXJlbnQudGFnTmFtZSAhPT0gJ0JPRFknKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHYgPSBwYXJlbnQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KClba2V5XTtcbiAgICAgICAgICAgIH0gY2F0Y2goZSkge1xuICAgICAgICAgICAgICAgIGlmIChrZXkgPT09ICd3aWR0aCcpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gSW4gSUUgaW4gY2VydGFpbiBjYXNlcyBnZXRCb3VuZGluZ0NsaWVudFJlY3RcbiAgICAgICAgICAgICAgICAgICAgLy8gd2lsbCBjYXVzZSBhbiBcInVuc3BlY2lmaWVkIGVycm9yXCJcbiAgICAgICAgICAgICAgICAgICAgdiA9IHBhcmVudC5vZmZzZXRXaWR0aDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGFyZW50ID0gcGFyZW50LnBhcmVudE5vZGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHY7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRQYXJlbnRXaWR0aCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0UGFyZW50UmVjdFZhbHVlKCd3aW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AoYXhpc0lkID09PSAneTInICYmICFjb25maWcuYXhpc195Ml9zaG93KSB7IHJldHVybiAkJC5yb3RhdGVkX3BhZGRpbmdfdG9wOyB9XG4gICAgICAgIC8vIENhbGN1bGF0ZSB4IGF4aXMgaGVpZ2h0IHdoZW4gdGljayByb3RhdGVkXG4gICAgICAgIGlmIChheGlzSWQgPT09ICd4JyAmJiAhY29uZmlnLmF4aXNfcm90YXRlZCAmJiBjb25maWcuYXhpc194X3RpY2tfcm90YXRlKSB7XG4gICAgICAgICAgICBoID0gMzAgKyAkJC5heGlzLmdldE1heFRpY2tXaWR0aChheGlzSWQpICogTWF0aC5jb3MoTWF0aC5QSSAqICg5MCAtIGNvbmZpZy5heGlzX3hfdGlja19yb3RhdGUpIC8gMTgwKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBDYWxjdWxhdGUgeSBheGlzIGhlaWdodCB3aGVuIHRpY2sgcm90YXRlZFxuICAgICAgICBpZiAoYXhpc0lkID09PSAneScgJiYgY29uZmlnLmF4aXNfcm90YXRlZCAmJiBjb25maWcuYXhpc195X3RpY2tfcm90YXRlKSB7XG4gICAgICAgICAgICBoID0gMzAgKyAkJC5heGlzLmdldE1heFRpY2tXaWR0aChheGlzSWQpICogTWF0aC5jb3MoTWF0aC5QSSAqICg5MCAtIGNvbmZpZy5heGlzX3lfdGlja19yb3RhdGUpIC8gMTgwKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaCArICgkJC5heGlzLmdldExhYmVsUG9zaXRpb25CeUlkKGF4aXNJZCkuaXNJbm5lciA/IDAgOiAxMCkgKyAoYXhpc0lkID09PSAneTInID8gLTEwIDogMCk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldEV2ZW50UmVjdFdpZHRoID0gZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gTWF0aC5tYXgoMCwgdGhpcy54QXhpcy50aWNrSW50ZXJ2YWwoKSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFNoYXBlSW5kaWNlcyA9IGZ1bmN0aW9uICh0eXBlRmlsdGVyKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIGluZGljZXMgPSB7fSwgaSA9IDAsIGosIGs7XG4gICAgICAgICQkLmZpbHRlclRhcmdldHNUb1Nob3coJCQuZGF0YS50YXJnZXRzLmZpbHRlcih0eXBlRmlsdGVyLCAkJCkpLmZvckVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBjb25maWcuZGF0YV9ncm91cHMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfZ3JvdXBzW2pdLmluZGV4T2YoZC5pZCkgPCAwKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IGNvbmZpZy5kYXRhX2dyb3Vwc1tqXS5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfZ3JvdXBzW2pdW2tdIGluIGluZGljZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGljZXNbZC5pZF0gPSBpbmRpY2VzW2NvbmZpZy5kYXRhX2dyb3Vwc1tqXVtrXV07XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChpbmRpY2VzW2QuaWRdKSkgeyBpbmRpY2VzW2QuaWRdID0gaSsrOyB9XG4gICAgICAgIH0pO1xuICAgICAgICBpbmRpY2VzLl9fbWF4X18gPSBpIC0gMTtcbiAgICAgICAgcmV0dXJuIGluZGljZXM7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRl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YueCA9PT0gZC54KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChpIGluIHZhbHVlcyAmJiB2YWx1ZXNbaV0udmFsdWUgKiBkLnZhbHVlID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCArPSBzY2FsZSh2YWx1ZXNbaV0udmFsdWUpIC0geTA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiBvZmZzZXQ7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pc1dpdGhpblNoYXBlID0gZnVuY3Rpb24gKHRoYXQsIGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIHNoYXBlID0gJCQuZDMuc2VsZWN0KHRoYXQpLCBpc1dpdGhpbjtcbiAgICAgICAgaWYgKCEkJC5pc1RhcmdldFRvU2hvdyhkLmlkKSkge1xuICAgICAgICAgICAgaXNXaXRoaW4gPSBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0aGF0Lm5vZGVOYW1lID09PSAnY2lyY2xlJykge1xuICAgICAgICAgICAgaXNXaXRoaW4gPSAkJC5pc1N0ZXBUeXBlKGQpID8gJCQuaXNXaXRoaW5TdGVwKHRoYXQsICQkLmdldFlTY2FsZShkLmlkKShkLnZhbHVlKSkgOiAkJC5pc1dpdGhpbkNpcmNsZSh0aGF0LCAkJC5wb2ludFNlbGVjdFIoZCkgKiAxLjUpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHRoYXQubm9kZU5hbWUgPT09ICdwYXRoJykge1xuICAgICAgICAg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cbiAgICAgICAgICAgIHByZXYgPSAtMSwgaSwgaixcbiAgICAgICAgICAgIHMgPSBcIk1cIiwgc1dpdGhSZWdpb24sXG4gICAgICAgICAgICB4cCwgeXAsIGR4LCBkeSwgZGQsIGRpZmYsIGRpZmZ4MixcbiAgICAgICAgICAgIHhPZmZzZXQgPSAkJC5pc0NhdGVnb3JpemVkKCkgPyAwLjUgOiAwLFxuICAgICAgICAgICAgeFZhbHVlLCB5VmFsdWUsXG4gICAgICAgICAgICByZWdpb25zID0gW107XG5cbiAgICAgICAgZnVuY3Rpb24gaXNXaXRoaW5SZWdpb25zKHgsIHJlZ2lvbnMpIHtcbiAgICAgICAgICAgIHZhciBpO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJlZ2lvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAocmVnaW9uc1tpXS5zdGFydCA8IHggJiYgeCA8PSByZWdpb25zW2ldLmVuZCkgeyByZXR1cm4gdHJ1ZTsgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQ2hlY2sgc3RhcnQvZW5kIG9mIHJlZ2lvbnNcbiAgICAgICAgaWYgKGlzRGVmaW5lZChfcmVnaW9ucykpIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBfcmVnaW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHJlZ2lvbnNbaV0gPSB7fTtcbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoX3JlZ2lvbnNbaV0uc3RhcnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlZ2lvbnNbaV0uc3RhcnQgPSBkWzBdLng7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVnaW9uc1tpXS5zdGFydCA9ICQkLmlzVGltZVNlcmllcygpID8gJCQucGFyc2VEYXR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KSkge1xuICAgICAgICAgICAgc1dpdGhSZWdpb24gPSBmdW5jdGlvbiAoZDAsIGQxLCBqLCBkaWZmKSB7XG4gICAgICAgICAgICAgICAgdmFyIHgwID0gZDAueC5nZXRUaW1lKCksIHhfZGlmZiA9IGQxLnggLSBkMC54LFxuICAgICAgICAgICAgICAgICAgICB4djAgPSBuZXcgRGF0ZSh4MCArIHhfZGlmZiAqIGopLFxuICAgICAgICAgICAgICAgICAgICB4djEgPSBuZXcgRGF0ZSh4MCArIHhfZGlmZiAqIChqICsgZGlmZikpLFxuICAgICAgICAgICAgICAgICAgICBwb2ludHM7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5heGlzX3JvdGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzID0gW1t5KHlwKGopKSwgeCh4djApXSwgW3koeXAoaiArIGRpZmYpKSwgeCh4djEpXV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzID0gW1t4KHh2MCksIHkoeXAoaikpXSwgW3goeHYxKSwgeSh5cChqICsgZGlmZikpXV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBnZW5lcmF0ZU0ocG9pbnRzKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzV2l0aFJlZ2lvbiA9IGZ1bmN0aW9uIChkMCwgZDEsIGosIGRpZmYpIHtcbiAgICAgICAgICAgICAgICB2YXIgcG9pbnRzO1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeSh5cChqKSwgdHJ1ZSksIHgoeHAoaikpXSwgW3koeXAoaiArIGRpZmYpLCB0cnVlKSwgeCh4cChqICsgZGlmZikpXV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzID0gW1t4KHhwKGopLCB0cnVlKSwgeSh5cChqKSldLCBbeCh4cChqICsgZGlmZiksIHRydWUpLCB5KHlwKGogKyBkaWZmKSldXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdlbmVyYXRlTShwb2ludHMpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEdlbmVyYXRlXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBkLmxlbmd0aDsgaSsrKSB7XG5cbiAgICAgICAgICAgIC8vIERyYXcgYXMgbm9ybWFsXG4gICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQocmVnaW9ucykgfHwgISBpc1dpdGhpblJlZ2lvbnMoZFtpXS54LCByZWdpb25zKSkge1xuICAgICAgICAgICAgICAgIHMgKz0gXCIgXCIgKyB4VmFsdWUoZFtpXSkgKyBcIiBcIiArIHlWYWx1ZShkW2ldKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIERyYXcgd2l0aCByZWdpb24gLy8gVE9ETzogRml4IGZvciBob3Jpem90YWwgY2hhcnRzXG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB4cCA9ICQkLmdldFNjYWxlKGRbaSAtIDFdLnggKyB4T2Zmc2V0LCBkW2ldLnggKyB4T2Zmc2V0LCAkJC5pc1RpbWVTZXJpZXMoKSk7XG4gICAgICAgICAgICAgICAgeXAgPSAkJC5nZXRTY2FsZShkW2kgLSAxXS52YWx1ZSwgZFtpXS52YWx1ZSk7XG5cbiAgICAgICAgICAgICAgICBkeCA9IHgoZFtpXS54KSAtIHgoZFtpIC0gMV0ueCk7XG4gICAgICAgICAgICAgICAgZHkgPSB5KGRbaV0udmFsdWUpIC0geShkW2kgLSAxXS52YWx1ZSk7XG4gICAgICAgICAgICAgICAgZGQgPSBNYXRoLnNxcnQoTWF0aC5wb3coZHgsIDIpICsgTWF0aC5wb3coZHksIDIpKTtcbi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XR1cm4gZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgIC8vIDQgcG9pbnRzIHRoYXQgbWFrZSBhIGJhclxuICAgICAgICAgICAgdmFyIHBvaW50cyA9IGdldFBvaW50cyhkLCBpKTtcblxuICAgICAgICAgICAgLy8gc3dpdGNoIHBvaW50cyBpZiBheGlzIGlzIHJvdGF0ZWQsIG5vdCBhcHBsaWNhYmxlIGZvciBzdWIgY2hhcnRcbiAgICAgICAgICAgIHZhciBpbmRleFggPSBjb25maWcuYXhpc19yb3RhdGVkID8gMSA6IDA7XG4gICAgICAgICAgICB2YXIgaW5kZXhZID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiAxO1xuXG4gICAgICAgICAgICB2YXIgcGF0aCA9ICdNICcgKyBwb2ludHNbMF1baW5kZXhYXSArICcsJyArIHBvaW50c1swXVtpbmRleFldICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgJ0wnICsgcG9pbnRzWzFdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbMV1baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICdMJyArIHBvaW50c1syXVtpbmRleFhdICsgJywnICsgcG9pbnRzWzJdW2luZGV4WV0gKyAnICcgK1xuICAgICAgICAgICAgICAgICAgICAnTCcgKyBwb2ludHNbM11baW5kZXhYXSArICcsJyArIHBvaW50c1szXVtpbmRleFldICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgJ3onO1xuXG4gICAgICAgICAgICByZXR1cm4gcGF0aDtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlR2V0QmFyUG9pbnRzID0gZnVuY3Rpb24gKGJhckluZGljZXMsIGlzU3ViKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBheGlzID0gaXNTdWIgPyAkJC5zdWJYQXhpcyA6ICQkLnhBeGlzLFxuICAgICAgICAgICAgYmF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AgaWYgKGQudmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgIGlmICh4UG9zID4gJCQud2lkdGgpIHtcbiAgICAgICAgICAgICAgICB4UG9zID0gJCQud2lkdGggLSBib3gud2lkdGg7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHhQb3MgPCAwKSB7XG4gICAgICAgICAgICAgICAgeFBvcyA9IDQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHhQb3M7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRZRm9yVGV4dCA9IGZ1bmN0aW9uIChwb2ludHMsIGQsIHRleHRFbGVtZW50KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBib3ggPSB0ZXh0RWxlbWVudC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSxcbiAgICAgICAgICAgIHlQb3M7XG4gICAgICAgIGlmICgkJC5jb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICB5UG9zID0gKHBvaW50c1swXVswXSArIHBvaW50c1syXVswXSArIGJveC5oZWlnaHQgKiAwLjYpIC8gMjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHlQb3MgPSBwb2ludHNbMl1bMV07XG4gICAgICAgICAgICBpZiAoZC52YWx1ZSA8IDAgIHx8IChkLnZhbHVlID09PSAwICYmICEkJC5oYXNQb3NpdGl2ZVZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHlQb3MgKz0gYm94LmhlaWdodDtcbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNCYXJUeXBlKGQpICYmICQkLmlzU2FmYXJpKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgeVBvcyAtPSAzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmICghJCQuaXNCYXJUeXBlKGQpICYmICQkLmlzQ2hyb21lKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgeVBvcyArPSAzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgeVBvcyArPSAkJC5pc0JhclR5cGUoZCkgPyAtMyA6IC02O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIHNob3cgbGFiZWxzIHJlZ2FyZGxlc3Mgb2YgdGhlIGRvbWFpbiBpZiB2YWx1ZSBpcyBudWxsXG4gICAgICAgIGlmIChkLnZhbHVlID09PSBudWxsICYmICEkJC5jb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICBpZiAoeVBvcyA8IGJveC5oZWlnaHQpIHtcbiAgICAgICAgICAgICAgICB5UG9zID0gYm94LmhlaWdodDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoeVBvcyA+IHRoaXMuaGVpZ2h0KSB7XG4gICAgICAgICAgICAgICAgeVBvcyA9IHRoaXMuaGVpZ2h0IC0gNDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geVBvcztcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uc2V0VGFyZ2V0VHlwZSA9IGZ1bmN0aW9uICh0YXJnZXRJZHMsIHR5cGUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICAkJC5tYXBUb1RhcmdldElkcyh0YXJnZXRJZHMpLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAkJC53aXRob3V0RmFkZUluW2lkXSA9ICh0eXBlID09PSBjb25maWcuZGF0YV90eXBlc1tpZF0pO1xuICAgICAgICAgICAgY29uZmlnLmRhdGFfdHlwZXNbaWRdID0gdHlwZTtcbiAgICAgICAgfSk7XG4gICAgICAgIGlmICghdGFyZ2V0SWRzKSB7XG4gICAgICAgICAgICBjb25maWcuZGF0YV90eXBlID0gdHlwZTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaGFzVHlwZSA9IGZ1bmN0aW9uICh0eXBlLCB0YXJnZXRzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIHR5cGVzID0gJCQuY29uZmlnLmRhdGFfdHlwZXMsIGhhcyA9IGZhbHNlO1xuICAgICAgICB0YXJnZXRzID0gdGFyZ2V0cyB8fCAkJC5kYXRhLnRhcmdldHM7XG4gICAgICAgIGlmICh0YXJnZXRzICYmIHRhcmdldHMubGVuZ3RoKSB7XG4gICAgICAgICAgICB0YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHRhcmdldCkge1xuICAgICAgICAgICAgICAgIHZhciB0ID0gdHlwZXNbdGFyZ2V0LmlkXTtcbiAgICAgICAgICAgICAgICBpZiAoKHQgJiYgdC5pbmRleE9mKHR5cGUpID49IDApIHx8ICghdCAmJiB0eXBlID09PSAnbGluZScpKSB7XG4gICAgICAgICAgICAgICAgICAgIGhhcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSBpZiAoT2JqZWN0LmtleXModHlwZXMpLmxlbmd0aCkge1xuICAgICAgICAgICAgT2JqZWN0LmtleXModHlwZXMpLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVzW2lkXSA9PT0gdHlwZSkgeyBoYXMgPSB0cnVlOyB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGhhcyA9ICQkLmNvbmZpZy5kYXRhX3R5cGUgPT09IHR5cGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGhhcztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmhhc0FyY1R5cGUgPSBmdW5jdGlvbiAodGFyZ2V0cykge1xuICAgICAgICByZXR1cm4gdGhpcy5oYXNUeX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1cm4gQ0xBU1MueWdyaWRMaW5lICsgKGRbJ2NsYXNzJ10gPyAnICcgKyBkWydjbGFzcyddIDogJycpOyB9KTtcbiAgICAgICAgeWdyaWRMaW5lLmFwcGVuZCgnbGluZScpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDApO1xuICAgICAgICB5Z3JpZExpbmUuYXBwZW5kKCd0ZXh0JylcbiAgICAgICAgICAgIC5hdHRyKFwidGV4dC1hbmNob3JcIiwgJCQuZ3JpZFRleHRBbmNob3IpXG4gICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gXCJyb3RhdGUoLTkwKVwiIDogXCJcIilcbiAgICAgICAgICAgIC5hdHRyKCdkeCcsICQkLmdyaWRUZXh0RHgpXG4gICAgICAgICAgICAuYXR0cignZHknLCAtNSlcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMCk7XG4gICAgICAgIC8vIHVwZGF0ZVxuICAgICAgICB5diA9ICQkLnl2LmJpbmQoJCQpO1xuICAgICAgICAkJC55Z3JpZExpbmVzLnNlbGVjdCgnbGluZScpXG4gICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5hdHRyKFwieDFcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IHl2IDogMClcbiAgICAgICAgICAgIC5hdHRyKFwieDJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IHl2IDogJCQud2lkdGgpXG4gICAgICAgICAgICAuYXR0cihcInkxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogeXYpXG4gICAgICAgICAgICAuYXR0cihcInkyXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC5oZWlnaHQgOiB5dilcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMSk7XG4gICAgICAgICQkLnlncmlkTGluZXMuc2VsZWN0KCd0ZXh0JylcbiAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKGR1cmF0aW9uKVxuICAgICAgICAgICAgLmF0dHIoXCJ4XCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC54R3JpZFRleHRYLmJpbmQoJCQpIDogJCQueUdyaWRUZXh0WC5iaW5kKCQkKSlcbiAgICAgICAgICAgIC5hdHRyKFwieVwiLCB5dilcbiAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uIChkKSB7IHJldHVybiBkLnRleHQ7IH0pXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDEpO1xuICAgICAgICAvLyBleGl0XG4gICAgICAgICQkLnlncmlkTGluZXMuZXhpdCgpLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMClcbiAgICAgICAgICAgIC5yZW1vdmUoKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnJlZHJhd0dyaWQgPSBmdW5jdGlvbiAod2l0aFRyYW5zaXRpb24pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCB4diA9ICQkLnh2LmJpbmQoJCQpLFxuICAgICAgICAgICAgbGluZXMgPSAkJC54Z3JpZExpbmVzLnNlbGVjdCgnbGluZScpLFxuICAgICAgICAgICAgdGV4dHMgPSAkJC54Z3JpZExpbmVzLnNlbGVjdCgndGV4dCcpO1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgKHdpdGhUcmFuc2l0aW9uID8gbGluZXMudHJhbnNpdGlvbigpIDogbGluZXMpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ4MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IHh2KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieDJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoIDogeHYpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ5MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8geHYgOiAwKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieTJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IHh2IDogJCQuaGVpZ2h0KVxuICAgICAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMSksXG4gICAgICAgICAgICAod2l0aFRyYW5zaXRpb24gPyB0ZXh0cy50cmFuc2l0aW9uKCkgOiB0ZXh0cylcbiAgICAgICAgICAgICAgICAuYXR0cihcInhcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLnlHcmlkVGV4dFguYmluZCgkJCkgOiAkJC54R3JpZFRleHRYLmJpbmQoJCQpKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieVwiLCB4dilcbiAgICAgICAgICAgICAgICAudGV4dChmdW5jdGlvbiAoZCkgeyByZXR1cm4gZC50ZXh0OyB9KVxuICAgICAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMSlcbiAgICAgICAgXTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnNob3dYR3JpZEZvY3VzID0gZnVuY3Rpb24gKHNlbGVjdGVkRGF0YSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBkYXRhVG9TaG93ID0gc2VsZWN0ZWREYXRhLmZpbHRlcihmdW5jdGlvbiAoZCkgeyByZXR1cm4gZCAmJiBpc1ZhbHVlKGQudmFsdWUpOyB9KSxcbiAgICAgICAgICAgIGZvY3VzRWwgPSAkJC5tYWluLnNlbGVjdEFsbCgnbGluZS4nICsgQ0xBU1MueGdyaWRGb2N1cyksXG4gICAgICAgICAgICB4eCA9ICQkLnh4LmJpbmQoJCQpO1xuICAgICAgICBpZiAoISBjb25maWcudG9vbHRpcF9zaG93KSB7IHJldHV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VwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gLTEwIDogMClcbiAgICAgICAgICAgIC5hdHRyKFwieTJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IC0xMCA6ICQkLmhlaWdodCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUdyaWREYXRhID0gZnVuY3Rpb24gKHR5cGUsIHNjYWxlKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBncmlkRGF0YSA9IFtdLCB4RG9tYWluLCBmaXJzdFllYXIsIGxhc3RZZWFyLCBpLFxuICAgICAgICAgICAgdGlja051bSA9ICQkLm1haW4uc2VsZWN0KFwiLlwiICsgQ0xBU1MuYXhpc1gpLnNlbGVjdEFsbCgnLnRpY2snKS5zaXplKCk7XG4gICAgICAgIGlmICh0eXBlID09PSAneWVhcicpIHtcbiAgICAgICAgICAgIHhEb21haW4gPSAkJC5nZXRYRG9tYWluKCk7XG4gICAgICAgICAgICBmaXJzdFllYXIgPSB4RG9tYWluWzBdLmdldEZ1bGxZZWFyKCk7XG4gICAgICAgICAgICBsYXN0WWVhciA9IHhEb21haW5bMV0uZ2V0RnVsbFllYXIoKTtcbiAgICAgICAgICAgIGZvciAoaSA9IGZpcnN0WWVhcjsgaSA8PSBsYXN0WWVhcjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgZ3JpZERhdGEucHVzaChuZXcgRGF0ZShpICsgJy0wMS0wMSAwMDowMDowMCcpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGdyaWREYXRhID0gc2NhbGUudGlja3MoMTApO1xuICAgICAgICAgICAgaWYgKGdyaWREYXRhLmxlbmd0aCA+IHRpY2tOdW0pIHsgLy8gdXNlIG9ubHkgaW50XG4gICAgICAgICAgICAgICAgZ3JpZERhdGEgPSBncmlkRGF0YS5maWx0ZXIoZnVuY3Rpb24gKGQpIHsgcmV0dXJu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ICAgIC5zdHlsZShcInBvaW50ZXItZXZlbnRzXCIsIFwibm9uZVwiKVxuICAgICAgICAgICAgLnN0eWxlKFwiZGlzcGxheVwiLCBcIm5vbmVcIik7XG4gICAgICAgIC8vIFNob3cgdG9vbHRpcCBpZiBuZWVkZWRcbiAgICAgICAgaWYgKGNvbmZpZy50b29sdGlwX2luaXRfc2hvdykge1xuICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpICYmIGlzU3RyaW5nKGNvbmZpZy50b29sdGlwX2luaXRfeCkpIHtcbiAgICAgICAgICAgICAgICBjb25maWcudG9vbHRpcF9pbml0X3ggPSAkJC5wYXJzZURhdGUoY29uZmlnLnRvb2x0aXBfaW5pdF94KTtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXNbaV0ueCAtIGNvbmZpZy50b29sdGlwX2luaXRfeCkgPT09IDApIHsgYnJlYWs7IH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29uZmlnLnRvb2x0aXBfaW5pdF94ID0gaTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICQkLnRvb2x0aXAuaHRtbChjb25maWcudG9vbHRpcF9jb250ZW50cy5jYWxsKCQkLCAkJC5kYXRhLnRhcmdldHMubWFwKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICQkLmFkZE5hbWUoZC52YWx1ZXNbY29uZmlnLnRvb2x0aXBfaW5pdF94XSk7XG4gICAgICAgICAgICB9KSwgJCQuYXhpcy5nZXRYQXhpc1RpY2tGb3JtYXQoKSwgJCQuZ2V0WUZvcm1hdCgkJC5oYXNBcmNUeXBlKCkpLCAkJC5jb2xvcikpO1xuICAgICAgICAgICAgJCQudG9vbHRpcC5zdHlsZ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XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9yZGVyQXNjID8gdjEgLSB2MiA6IHYyIC0gdjE7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBpZHMgPSAkJC5vcmRlclRhcmdldHMoJCQuZGF0YS50YXJnZXRzKS5tYXAoZnVuY3Rpb24gKGkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaS5pZDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZC5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcbiAgICAgICAgICAgICAgICB2YXIgdjEgPSBhID8gYS52YWx1ZSA6IG51bGwsIHYyID0gYiA/IGIudmFsdWUgOiBudWxsO1xuICAgICAgICAgICAgICAgIGlmICh2MSA+IDAgJiYgdjIgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHYxID0gYSA/IGlkcy5pbmRleE9mKGEuaWQpIDogbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgdjIgPSBiID8gaWRzLmluZGV4T2YoYi5pZCkgOiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gb3JkZXJBc2MgPyB2MSAtIHYyIDogdjIgLSB2MTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGQubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmICghIChkW2ldICYmIChkW2ldLnZhbHVlIHx8IGRbaV0udmFsdWUgPT09IDApKSkgeyBjb250aW51ZTsgfVxuXG4gICAgICAgICAgICBpZiAoISB0ZXh0KSB7XG4gICAgICAgICAgICAgICAgdGl0bGUgPSBzYW5pdGlzZSh0aXRsZUZvcm1hdCA/IHRpdGxlRm9ybWF0KGRbaV0ueCkgOiBkW2ldLngpO1xuICAgICAgICAgICAgICAgIHRleHQgPSBcIjx0YWJsZSBjbGFzcz0nXCIgKyAkJC5DTEFTU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HQgfHwgJCQuaXNMZWdlbmRJbnNldCA/IG1heEhlaWdodCA6IG1heFdpZHRoO1xuXG4gICAgICAgICAgICBpZiAoY29uZmlnLmxlZ2VuZF9lcXVhbGx5KSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXMod2lkdGhzKS5mb3JFYWNoKGZ1bmN0aW9uIChpZCkgeyB3aWR0aHNbaWRdID0gbWF4V2lkdGg7IH0pO1xuICAgICAgICAgICAgICAgIE9iamVjdC5rZXlzKGhlaWdodHMpLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7IGhlaWdodHNbaWRdID0gbWF4SGVpZ2h0OyB9KTtcbiAgICAgICAgICAgICAgICBtYXJnaW4gPSAoYXJlYUxlbmd0aCAtIG1heExlbmd0aCAqIHRhcmdldElkcy5sZW5ndGgpIC8gMjtcbiAgICAgICAgICAgICAgICBpZiAobWFyZ2luIDwgcG9zTWluKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvdGFsTGVuZ3RoID0gMDtcbiAgICAgICAgICAgICAgICAgICAgc3RlcCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHRhcmdldElkcy5mb3JFYWNoKGZ1bmN0aW9uIChpZCkgeyB1cGRhdGVWYWx1ZXMoaWQpOyB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZVZhbHVlcyhpZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB1cGRhdGVWYWx1ZXMoaWQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCQkLmlzTGVnZW5kSW5zZXQpIHtcbiAgICAgICAgICAgIHN0ZXAgPSBjb25maWcubGVnZW5kX2luc2V0X3N0ZXAgPyBjb25maWcubGVnZW5kX2luc2V0X3N0ZXAgOiB0YXJnZXRJZHMubGVuZ3RoO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IC5zdHlsZSgnY3Vyc29yJywgJ3BvaW50ZXInKVxuICAgICAgICAgICAgLm9uKCdjbGljaycsIGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcubGVnZW5kX2l0ZW1fb25jbGljaykge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcubGVnZW5kX2l0ZW1fb25jbGljay5jYWxsKCQkLCBpZCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmQzLmV2ZW50LmFsdEtleSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuYXBpLmhpZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmFwaS5zaG93KGlkKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmFwaS50b2dnbGUoaWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuaXNUYXJnZXRUb1Nob3coaWQpID8gJCQuYXBpLmZvY3VzKGlkKSA6ICQkLmFwaS5yZXZlcnQoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcubGVnZW5kX2l0ZW1fb25tb3VzZW92ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmxlZ2VuZF9pdGVtX29ubW91c2VvdmVyLmNhbGwoJCQsIGlkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKENMQVNTLmxlZ2VuZEl0ZW1Gb2N1c2VkLCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEkJC50cmFuc2l0aW5nICYmICQkLmlzVGFyZ2V0VG9TaG93KGlkKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuYXBpLmZvY3VzKGlkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5sZWdlbmRfaXRlbV9vbm1vdXNlb3V0KSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5sZWdlbmRfaXRlbV9vbm1vdXNlb3V0LmNhbGwoJCQsIGlkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKENMQVNTLmxlZ2VuZEl0ZW1Gb2N1c2VkLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgICQkLmFwaS5yZXZlcnQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgbC5hcHBlbmQoJ3RleHQnKVxuICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24gKGlkKSB7IHJldHVybiBpc0RlZmluZWQoY29uZmlnLmRhdGFfbmFtZXNbaWRdKSA/IGNvbmZpZy5kYXRhX25hbWVzW2lkXSA6IGlkOyB9KVxuICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKGlkLCBpKSB7IHVwZGF0ZVBvc2l0aW9ucyh0aGlzLCBpZCwgaSk7IH0pXG4gICAgICAgICAgICAuc3R5bGUoXCJwb2ludGVyLWV2ZW50c1wiLCBcIm5vbmVcIilcbiAgICAgICAgICAgIC5hdHRyKCd4JywgJCQuaXNMZWdlbmRSaWdodCB8fCAkJC5pc0xlZ2VuZEluc2V0ID8geEZvckxlZ2VuZFRleHQgOiAtMjAwKVxuICAgICAg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0aGlzLm93bmVyLCBjb25maWcgPSAkJC5jb25maWcsIG1haW4gPSAkJC5tYWluO1xuICAgICAgICAkJC5heGVzLnggPSBtYWluLmFwcGVuZChcImdcIilcbiAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgQ0xBU1MuYXhpcyArICcgJyArIENMQVNTLmF4aXNYKVxuICAgICAgICAgICAgLmF0dHIoXCJjbGlwLXBhdGhcIiwgJCQuY2xpcFBhdGhGb3JYQXhpcylcbiAgICAgICAgICAgIC5hdHRyKFwidHJhbnNmb3JtXCIsICQkLmdldFRyYW5zbGF0ZSgneCcpKVxuICAgICAgICAgICAgLnN0eWxlKFwidmlzaWJpbGl0eVwiLCBjb25maWcuYXhpc194X3Nob3cgPyAndmlzaWJsZScgOiAnaGlkZGVuJyk7XG4gICAgICAgICQkLmF4ZXMueC5hcHBlbmQoXCJ0ZXh0XCIpXG4gICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIENMQVNTLmF4aXNYTGFiZWwpXG4gICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gXCJyb3RhdGUoLTkwKVwiIDogXCJcIilcbiAgICAgICAgICAgIC5zdHlsZShcInRleHQtYW5jaG9yXCIsIHRoaXMudGV4dEFuY2hvckZvclhBeGlzTGFiZWwuYmluZCh0aGlzKSk7XG4gICAgICAgICQkLmF4ZXMueSA9IG1haW4uYXBwZW5kKFwiZ1wiKVxuICAgICAgICAgICAgLmF0dHIoXCJjbGFzc1wiLCBDTEFTUy5heGlzICsgJyAnICsgQ0xBU1MuYXhpc1kpXG4gICAgICAgICAgICAuYXR0cihcImNsaXAtcGF0aFwiLCBjb25maWcuYXhpc195X2lubmVyID8gXCJcIiA6ICQkLmNsaXBQYXRoRm9yWUF4aXMpXG4gICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCAkJC5nZXRUcmFuc2xhdGUoJ3knKSlcbiAgICAgICAgICAgIC5zdHlsZShc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AgICAgICBpZiAoaXNTdHJpbmcob3B0aW9uKSkge1xuICAgICAgICAgICAgaWYgKGF4aXNJZCA9PT0gJ3knKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeV9sYWJlbCA9IHRleHQ7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGF4aXNJZCA9PT0gJ3kyJykge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3kyX2xhYmVsID0gdGV4dDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYXhpc0lkID09PSAneCcpIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc194X2xhYmVsID0gdGV4dDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChvcHRpb24pIHtcbiAgICAgICAgICAgIG9wdGlvbi50ZXh0ID0gdGV4dDtcbiAgICAgICAgfVxuICAgIH07XG4gICAgQXhpcy5wcm90b3R5cGUuZ2V0TGFiZWxQb3NpdGlvbiA9IGZ1bmN0aW9uIGdldExhYmVsUG9zaXRpb24oYXhpc0lkLCBkZWZhdWx0UG9zaXRpb24pIHtcbiAgICAgICAgdmFyIG9wdGlvbiA9IHRoaXMuZ2V0TGFiZWxPcHRpb25CeUF4aXNJZChheGlzSWQpLFxuICAgICAgICAgICAgcG9zaXRpb24gPSAob3B0aW9uICYmIHR5cGVvZiBvcHRpb24gPT09ICdvYmplY3QnICYmIG9wdGlvbi5wb3NpdGlvbikgPyBvcHRpb24ucG9zaXRpb24gOiBkZWZhdWx0UG9zaXRpb247XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBpc0lubmVyOiBwb3NpdGlvbi5pbmRleE9mKCdpbm5lcicpID49IDAsXG4gICAgICAgICAgICBpc091dGVyOiBwb3NpdGlvbi5pbmRleE9mKCdvdXRlcicpID49IDAsXG4gICAgICAgICAgICBpc0xlZnQ6IHBvc2l0aW9uLmluZGV4T2YoJ2xlZnQnKSA+PSAwLFxuICAgICAgICAgICAgaXNDZW50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gMikge1xuICAgICAgICAgICAgICAgIGNvdW50ID0gdGFyZ2V0Q291bnQgLSAyO1xuICAgICAgICAgICAgICAgIHN0YXJ0ID0gdmFsdWVzWzBdO1xuICAgICAgICAgICAgICAgIGVuZCA9IHZhbHVlc1t2YWx1ZXMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICAgICAgaW50ZXJ2YWwgPSAoZW5kIC0gc3RhcnQpIC8gKGNvdW50ICsgMSk7XG4gICAgICAgICAgICAgICAgLy8gcmUtY29uc3RydWN0IHVuaXF1ZSB2YWx1ZXNcbiAgICAgICAgICAgICAgICB0aWNrVmFsdWVzID0gW3N0YXJ0XTtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY291bnQ7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB0aWNrVmFsdWUgPSArc3RhcnQgKyBpbnRlcnZhbCAqIChpICsgMSk7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMucHVzaChmb3JUaW1lU2VyaWVzID8gbmV3IERhdGUodGlja1ZhbHVlKSA6IHRpY2tWYWx1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMucHVzaChlbmQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghZm9yVGltZVNlcmllcykgeyB0aWNrVmFsdWVzID0gdGlja1ZhbHVlcy5zb3J0KGZ1bmN0aW9uIChhLCBiKSB7IHJldHVybiBhIC0gYjsgfSk7IH1cbiAgICAgICAgcmV0dXJuIHRpY2tWYWx1ZXM7XG4gICAgfTtcbiAgICBBeGlzLnByb3RvdHlwZS5nZW5lcmF0ZVRyYW5zaXRpb25zID0gZnVuY3Rpb24gZ2VuZXJhdGVUcmFuc2l0aW9ucyhkdXJhdGlvbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLm93bmVyLCBheGVzID0gJCQuYXhlcztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICA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Xhpc19yb3RhdGVkKSArICgkJC5jb25maWcuYXhpc195X2lubmVyID8gMjAgOiAwKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFlBeGlzQ2xpcEhlaWdodCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgcmV0dXJuICQkLmdldEF4aXNDbGlwSGVpZ2h0KCQkLmNvbmZpZy5heGlzX3JvdGF0ZWQpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pbml0UGllID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBkMyA9ICQkLmQzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgICQkLnBpZSA9IGQzLmxheW91dC5waWUoKS52YWx1ZShmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgcmV0dXJuIGQudmFsdWVzLnJlZHVjZShmdW5jdGlvbiAoYSwgYikgeyByZXR1cm4gYSArIGIudmFsdWU7IH0sIDApO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKCFjb25maWcuZGF0YV9vcmRlcikge1xuICAgICAgICAgICAgJCQucGllLnNvcnQobnVsbCk7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlUmFkaXVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICB3ID0gY29uZmlnLmdhdWdlX3dpZHRoIHx8IGNvbmZpZy5kb251dF93aWR0aDtcbiAgICAgICAgJCQucmFkaXVzRXhwYW5kZWQgPSBNYXRoLm1pbigkJC5hcmNXaWR0aCwgJCQuYXJjSGVpZ2h0KSAvIDI7XG4gICAgICAgICQkLnJhZGl1cyA9ICQkLnJhZGl1c0V4cGFuZGVkICogMC45NTtcbiAgICAgICAgJCQua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b25cbiAgICAgICAgaWYgKCQkLnRyYW5zaXRpbmcpIHtcbiAgICAgICAgICAgIGludGVydmFsID0gd2luZG93LnNldEludGVydmFsKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoISQkLnRyYW5zaXRpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNsZWFySW50ZXJ2YWwoaW50ZXJ2YWwpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQubGVnZW5kLnNlbGVjdEFsbCgnLmMzLWxlZ2VuZC1pdGVtLWZvY3VzZWQnKS5zaXplKCkgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5leHBhbmRBcmModGFyZ2V0SWRzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sIDEwKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRhcmdldElkcyA9ICQkLm1hcFRvVGFyZ2V0SWRzKHRhcmdldElkcyk7XG5cbiAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgkJC5zZWxlY3RvclRhcmdldHModGFyZ2V0SWRzLCAnLicgKyBDTEFTUy5jaGFydEFyYykpLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIGlmICghICQkLnNob3VsZEV4cGFuZChkLmRhdGEuaWQpKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgJCQuZDMuc2VsZWN0KHRoaXMpLnNlbGVjdEFsbCgncGF0aCcpXG4gICAgICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbigkJC5leHBhbmREdXJhdGlvbihkLmRhdGEuaWQpKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCAkJC5zdmdBcmNFeHBhbmRlZClcbiAgICAgICAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKCQkLmV4cGFuZER1cmF0aW9uKGQuZGF0YS5pZCkgKiAyKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCAkJC5zdmdBcmNFeHBhbmRlZFN1YilcbiAgICAgICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuaXNEb251dFR5cGUoZC5kYXRhKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2FsbGJhY2sgaGVyZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51bmV4cGFuZEFyYyA9IGZ1bmN0aW9uICh0YXJnZXRJZHMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcblxuICAgICAgICBpZiAoJCQudHJhbnNpdGluZykgeyByZXR1cm47IH1cblxuICAgICAgICB0YXJnZXRJZHMgPSAkJC5tYXBUb1RhcmdldElkcyh0YXJnZXRJZHMpO1xuXG4gICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJCQuc2VsZWN0b3JUYXJnZXRzKHRhcmdldElkcywgJy4nICsgQ0xBU1MuY2hhcnRBcmMpKS5zZWxlY3RBbGwoJ3BhdGgnKVxuICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihmdW5jdGlvbihkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICQkLmV4cGFuZER1cmF0aW9uKGQuZGF0YS5pZCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmF0dHIoXCJkXCIsICQkLnN2Z0FyYyk7XG4gICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuYXJjKVxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAxKTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZXhwYW5kRHVyYXRpb24gPSBmdW5jdGlvbiAoaWQpIHt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mlnLmdhdWdlX3N0YXJ0aW5nQW5nbGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQgPSBkO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIG1haW5BcmNcbiAgICAgICAgICAgIC5hdHRyKFwidHJhbnNmb3JtXCIsIGZ1bmN0aW9uIChkKSB7IHJldHVybiAhJCQuaXNHYXVnZVR5cGUoZC5kYXRhKSAmJiB3aXRoVHJhbnNmb3JtID8gXCJzY2FsZSgwKVwiIDogXCJcIjsgfSlcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGQgPT09IHRoaXMuX2N1cnJlbnQgPyAwIDogMTsgfSlcbiAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgY29uZmlnLmludGVyYWN0aW9uX2VuYWJsZWQgPyBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkLCBhcmNEYXRhO1xuICAgICAgICAgICAgICAgIGlmICgkJC50cmFuc2l0aW5nKSB7IC8vIHNraXAgd2hpbGUgdHJhbnNpdGluZ1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKTtcbiAgICAgICAgICAgICAgICBpZiAodXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBhcmNEYXRhID0gJCQuY29udmVydFRvQXJjRGF0YSh1cGRhdGVkKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gdHJhbnNpdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgJCQuZXhwYW5kQXJjKHVwZGF0ZWQuZGF0YS5pZCk7XG4gICAgICAgICAgICAgICAgICAgICQkLmFwaS5mb2N1cyh1cGRhdGVkLmRhdGEuaWQpO1xuICAgICAgICAgICAgICAgICAgICAkJC50b2dnbGVGb2N1c0xlZ2VuZCh1cGRhdGVkLmRhdGEuaWQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbm1vdXNlb3ZlcihhcmNEYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IDogbnVsbClcbiAgICAgICAgICAgIC5vbignbW91c2Vtb3ZlJywgY29uZmlnLmludGVyYWN0aW9uX2VuYWJsZWQgPyBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCksIGFyY0RhdGEsIHNlbGVjdGVkRGF0YTtcbiAgICAgICAgICAgICAgICBpZiAodXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBhcmNEYXRhID0gJCQuY29udmVydFRvQXJjRGF0YSh1cGRhdGVkKSxcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRhID0gW2FyY0RhdGFdO1xuICAgICAgICAgICAgICAgICAgICAkJC5zaG93VG9vbHRpcChzZWxlY3RlZERhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCwgYXJjRGF0YTtcbiAgICAgICAgICAgICAgICBpZiAoJCQudHJhbnNpdGluZykgeyAvLyBza2lwIHdoaWxlIHRyYW5zaXRpbmdcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCk7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIHRyYW5zaXRpb25zXG4gICAgICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQXJjKHVwZGF0ZWQuZGF0YS5pZCk7XG4gICAgICAgICAgICAgICAgICAgICQkLmFwaS5yZXZlcnQoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQucmV2ZXJ0TGVnZW5kKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLmhpZGVUb29sdGlwKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29ubW91c2VvdXQoYXJjRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSA6IG51bGwpXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgY29uZmlnLmludGVyYWN0aW9uX2VuYWJsZWQgPyBmdW5jdGlvbiAoZCwgaSkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCksIGFyY0RhdGE7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC50b2dnbGVTaGFwZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQudG9nZ2xlU2hhcGUodGhpcywgYXJjRGF0YSwgaSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25jbGljay5jYWxsKCQkLmFwaSwgYXJjRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSA6IG51bGwpXG4gICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoKSB7ICQkLnRyYW5zaXRpbmcgPSB0cnVlOyB9KVxuICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5hdHRyVHdlZW4oXCJkXCIsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKSwgaW50ZXJwb2xhdGU7XG4gICAgICAgICAgICAgICAgaWYgKCEgdXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkgeyByZXR1cm4gXCJNIDAgMFwiOyB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudCA9PT0gZCkge1xuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50ID0ge1xuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRBbmdsZTogTWF0aC5QSSoyLFxuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgZW5kQW5nbGU6IE1hdGguUEkqMixcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKHRoaXMuX2N1cnJlbnQuc3RhcnRBbmdsZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudC5zdGFydEFuZ2xlID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKHRoaXMuX2N1cnJlbnQuZW5kQW5nbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQuZW5kQW5nbGUgPSB0aGlzLl9jdXJyZW50LnN0YXJ0QW5nbGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGludGVycG9sYXRlID0gZDMuaW50ZXJwb2xhdGUodGhpcy5fY3VycmVudCwgdXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudCA9IGludGVycG9sYXRlKDApO1xuICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgaW50ZXJwb2xhdGVkID0gaW50ZXJwb2xhdGUodCk7XG4gICAgICAgICAgICAgICAgICAgIGludGVycG9sYXRlZC5kYXRhID0gZC5kYXRhOyAvLyBkYXRhLmlkIHdpbGwgYmUgdXBkYXRlZCBieSBpbnRlcnBvcmF0b3JcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLmdldEFyYyhpbnRlcnBvbGF0ZWQsIHRydWUpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgd2l0aFRyYW5zZm9ybSA/IFwic2NhbGUoMSlcIiA6IFwiXCIpXG4gICAgICAgICAgICAuc3R5bGUoXCJmaWxsXCIsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICQkLmxldmVsQ29sb3IgPyAkJC5sZXZlbENvbG9yKGQuZGF0YS52YWx1ZXNbMF0udmFsdWUpIDogJCQuY29sb3IoZC5kYXRhLmlkKTtcbiAgICAgICAgICAgIH0pIC8vIFdoZXJlIGdhdWdlIHJlYWRpbmcgY29sb3Igd291bGQgcmVjZWl2ZSBjdXN0b21pemF0aW9uLlxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAxKVxuICAgICAgICAgICAgLmNhbGwoJCQuZW5kYWxsLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgJCQudHJhbnNpdGluZyA9IGZhbHNlO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIG1haW5BcmMuZXhpdCgpLnRyYW5zaXRpb24oKS5kdXJhdGlvbihk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AgICBpZiAoJCQuaGFzVHlwZSgnZ2F1Z2UnKSkge1xuICAgICAgICAgICAgJCQuYXJjcy5zZWxlY3QoJy4nICsgQ0xBU1MuY2hhcnRBcmNzQmFja2dyb3VuZClcbiAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IFt7dmFsdWU6IGNvbmZpZy5nYXVnZV9tYXh9XSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0QW5nbGU6IGNvbmZpZy5nYXVnZV9zdGFydGluZ0FuZ2xlLFxuICAgICAgICAgICAgICAgICAgICAgICAgZW5kQW5nbGU6IC0xICogY29uZmlnLmdhdWdlX3N0YXJ0aW5nQW5nbGVcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLmdldEFyYyhkLCB0cnVlLCB0cnVlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICQkLmFyY3Muc2VsZWN0KCcuJyArIENMQVNTLmNoYXJ0QXJjc0dhdWdlVW5pdClcbiAgICAgICAgICAgICAgICAuYXR0cihcImR5XCIsIFwiLjc1ZW1cIilcbiAgICAgICAgICAgICAgICAudGV4dChjb25maWcuZ2F1Z2VfbGFiZWxfc2hvdyA/IGNvbmZpZy5nYXVnZV91bml0cyA6ICcnKTtcbiAgICAgICAgICAgICQkLmFyY3Muc2VsZWN0KCcuJyArIENMQVNTLmNoYXJ0QXJjc0dhdWdlTWluKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiZHhcIiwgLTEgKiAoJCQuaW5uZXJSYWRpdXMgKyAoKCQkLnJhZGl1cyAtICQkLmlubmVyUmFkaXVzKSAvIChjb25maWcuZ2F1Z2VfZnVsbENpcmNsZSA/IDEgOiAyKSkpICsgXCJweFwiKVxuICAgICAgICAgICAgICAgIC5hdHRyK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m5hbF9mbi5yZWdpb25YID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgeFBvcywgeVNjYWxlID0gZC5heGlzID09PSAneScgPyAkJC55IDogJCQueTI7XG4gICAgICAgIGlmIChkLmF4aXMgPT09ICd5JyB8fCBkLmF4aXMgPT09ICd5MicpIHtcbiAgICAgICAgICAgIHhQb3MgPSBjb25maWcuYXhpc19yb3RhdGVkID8gKCdzdGFydCcgaW4gZCA/IHlTY2FsZShkLnN0YXJ0KSA6IDApIDogMDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHhQb3MgPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6ICgnc3RhcnQnIGluIGQgPyAkJC54KCQkLmlzVGltZVNlcmllcygpID8gJCQucGFyc2VEYXRlKGQuc3RhcnQpIDogZC5zdGFydCkgOiAwKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geFBvcztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnJlZ2lvblkgPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICB5UG9zLCB5U2NhbGUgPSBkLmF4aXMgPT09ICd5JyA/ICQkLnkgOiAkJC55MjtcbiAgICAgICAgaWYgKGQuYXhpcyA9PT0gJ3knIHx8IGQuYXhpcyA9PT0gJ3kyJykge1xuICAgICAgICAgICAgeVBvcyA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogKCdlbmQnIGluIGQgPyB5U2NhbGUoZC5lbmQpIDogMCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB5UG9zID0gY29uZmlnLmF4aXNfcm90YXRlZCA/ICgnc3RhcnQnIGluIGQgPyAkJC54KCQkLmlzVGltZVNlcmllcygpID8gJCQucGFyc2VEY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AgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoZCkgeyByZXR1cm4gY29uZmlnLmRhdGFfc2VsZWN0aW9uX2lzc2VsZWN0YWJsZShkKTsgfSlcbiAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNoYXBlID0gZDMuc2VsZWN0KHRoaXMpLFxuICAgICAgICAgICAgICAgICAgICBpc1NlbGVjdGVkID0gc2hhcGUuY2xhc3NlZChDTEFTUy5TRUxFQ1RFRCksXG4gICAgICAgICAgICAgICAgICAgIGlzSW5jbHVkZWQgPSBzaGFwZS5jbGFzc2VkKENMQVNTLklOQ0xVREVEKSxcbiAgICAgICAgICAgICAgICAgICAgX3gsIF95LCBfdywgX2gsIHRvZ2dsZSwgaXNXaXRoaW4gPSBmYWxzZSwgYm94O1xuICAgICAgICAgICAgICAgIGlmIChzaGFwZS5jbGFzc2VkKENMQVNTLmNpcmNsZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgX3ggPSBzaGFwZS5hdHRyKFwiY3hcIikgKiAxO1xuICAgICAgICAgICAgICAgICAgICBfeSA9IHNoYXBlLmF0dHIoXCJjeVwiKSAqIDE7XG4gICAgICAgICAgICAgICAgICAgIHRvZ2dsZSA9ICQkLnRvZ2dsZVBvaW50O1xuICAgICAgICAgICAgICAgICAgICBpc1dpdGhpbiA9IG1pblggPCBfeCAmJiBfeCA8IG1heFggJiYgbWluWSA8IF95ICYmIF95IDwgbWF4WTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hhcGUuY2xhc3NlZChDTEFTUy5iYXIpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJveCA9IGdldFBhdGhCb3godGhpcyk7XG4gICAgICAgICAgICAgICAgICAgIF94ID0gYm94Lng7XG4gICAgICAgICAgICAgICAgICAgIF95ID0gYm94Lnk7XG4gICAgICAgICAgICAgICAgICAgIF93ID0gYm94LndpZHRoO1xuICAgICAgICAgICAgICAgICAgICBfaCA9IGJveC5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgICAgIHRvZ2dsZSA9ICQkLnRvZ2dsZVBhdGg7XG4gICAgICAgICAgICAgICAgICAgIGlzV2l0aGluID0gIShtYXhYIDwgX3ggfHwgX3ggKyBfdyA8IG1pblgpICYmICEobWF4WSA8IF95IHx8IF95ICsgX2ggPCBtaW5ZKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBsaW5lL2FyZWEgc2VsZWN0aW9uIG5vdCBzdXBwb3J0ZWQgeWV0XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzV2l0aGluIF4gaXNJbmNsdWRlZCkge1xuICAgICAgICAgICAgICAgICAgICBzaGFwZS5jbGFzc2VkKENMQVNTLklOQ0xVREVELCAhaXNJbmNsdWRlZCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IGluY2x1ZGVkL3VuaW5jbHVkZWQgY2FsbGJhY2sgaGVyZVxuICAgICAgICAgICAgICAgICAgICBzaGFwZS5jbGFzc2VkKENMQVNTLlNFTEVDVEVELCAhaXNTZWxlY3RlZCk7XG4gICAgICAgICAgICAgICAgICAgIHRvZ2dsZS5jYWxsKCQkLCAhaXNTZWxlY3RlZCwgc2hhcGUsIGQsIGkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5kcmFnc3RhcnQgPSBmdW5jdGlvbiAobW91c2UpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuICAgICAgICBpZiAoISBjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCkgeyByZ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mdldHNGb3JTdWJjaGFydCA9IGZ1bmN0aW9uICh0YXJnZXRzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbnRleHQgPSAkJC5jb250ZXh0LCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBjb250ZXh0TGluZUVudGVyLCBjb250ZXh0TGluZVVwZGF0ZSwgY29udGV4dEJhckVudGVyLCBjb250ZXh0QmFyVXBkYXRlLFxuICAgICAgICAgICAgY2xhc3NDaGFydEJhciA9ICQkLmNsYXNzQ2hhcnRCYXIuYmluZCgkJCksXG4gICAgICAgICAgICBjbGFzc0JhcnMgPSAkJC5jbGFzc0JhcnMuYmluZCgkJCksXG4gICAgICAgICAgICBjbGFzc0NoYXJ0TGluZSA9ICQkLmNsYXNzQ2hhcnRMaW5lLmJpbmQoJCQpLFxuICAgICAgICAgICAgY2xhc3NMaW5lcyA9ICQkLmNsYXNzTGluZXMuYmluZCgkJCksXG4gICAgICAgICAgICBjbGFzc0FyZWFzID0gJCQuY2xhc3NBcmVhcy5iaW5kKCQkKTtcblxuICAgICAgICBpZiAoY29uZmlnLnN1YmNoYXJ0X3Nob3cpIHtcbiAgICAgICAgICAgIC8vLS0gQmFyIC0tLy9cbiAgICAgICAgICAgIGNvbnRleHRCYXJVcGRhdGUgPSBjb250ZXh0LnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEJhcnMpLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5jaGFydEJhcilcbiAgICAgICAgICAgICAgICAuZGF0YSh0YXJnZXRzKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGNsYXNzQ2hhcnRCYXIpO1xuICAgICAgICAgICAgY29udGV4dEJhckVudGVyID0gY29udGV4dEJhclVwZGF0ZS5lbnRlcigpLmFwcGVuZCgnZycpXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMClcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCBjbGFzc0NoYXJ0QmFyKTtcbiAgICAgICAgICAgIC8vIEJhcnMgZm9yIGVhY2ggZGF0YVxuICAgICAgICAgICAgY29udGV4dEJhckVudGVyLmFwcGVuZCgnZycpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJjbGFzc1wiLCBjbGFzc0JhcnMpO1xuXG4gICAgICAgICAgICAvLy0tIExpbmUgLS0vL1xuICAgICAgICAgICAgY29udGV4dExpbmVVcGRhdGUgPSBjb250ZXh0LnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydExpbmVzKS5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuY2hhcnRMaW5lKVxuICAgICAgICAgICAgICAgIC5kYXRhKHRhcmdldHMpXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgY2xhc3NDaGFydExpbmUpO1xuICAgICAgICAgICAgY29udGV4dExpbmVFbnRlciA9IGNvbnRleHRMaW5lVXBkYXRlLmVudGVyKCkuYXBwZW5kKCdnJylcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAwKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGNsYXNzQ2hhcnRMaW5lKTtcbiAgICAgICAgICAgIC8vIExpbmVzIGZvciBlYWNoIGRhdGFcbiAgICAgICAgICAgIGNvbnRleHRMaW5lRW50ZXIuYXBwZW5kKFwiZ1wiKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgY2xhc3NMaW5lcyk7XG4gICAgICAgICAgICAvLyBBcmVhXG4gICAgICAgICAgICBjb250ZXh0TGluZUVudGVyLmFwcGVuZChcImdcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIGNsYXNzQXJlYXMpO1xuXG4gICAgICAgICAgICAvLy0tIEJydXNoIC0tLy9cbiAgICAgICAgICAgIGNvbnRleHQuc2VsZWN0QWxsKCcuJyArIENMQVNTLmJydXNoICsgJyByZWN0JylcbiAgICAgICAgICAgICAgICAuYXR0cihjb25maWc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AgICAgfVxuICAgICAgICByZXR1cm4gZXh0ZW50O1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pbml0Wm9vbSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgZDMgPSAkJC5kMywgY29uZmlnID0gJCQuY29uZmlnLCBzdGFydEV2ZW50O1xuXG4gICAgICAgICQkLnpvb20gPSBkMy5iZWhhdmlvci56b29tKClcbiAgICAgICAgICAgIC5vbihcInpvb21zdGFydFwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3RhcnRFdmVudCA9IGQzLmV2ZW50LnNvdXJjZUV2ZW50O1xuICAgICAgICAgICAgICAgICQkLnpvb20uYWx0RG9tYWluID0gZDMuZXZlbnQuc291cmNlRXZlbnQuYWx0S2V5ID8gJCQueC5vcmdEb21haW4oKSA6IG51bGw7XG4gICAgICAgICAgICAgICAgY29uZmlnLnpvb21fb256b29tc3RhcnQuY2FsbCgkJC5hcGksIGQzLmV2ZW50LnNvdXJjZUV2ZW50KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oXCJ6b29tXCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAkJC5yZWRyYXdGb3Jab29tLmNhbGwoJCQpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignem9vbWVuZCcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgZXZlbnQgPSBkMy5ldmVudC5zb3VyY2VFdmVudDtcbiAgICAgICAgICAgICAgICAvLyBpZiBjbGljaywgZG8gbm90aGluZy4gb3RoZXJ3aXNlLCBjbGljayBpbnRlcmFjdGlvbiB3aWxsIGJlIGNhbmNlbGVkLlxuICAgICAgICAgICAgICAgIGlmIChldmVudCAmJiBzdGFydEV2ZW50LmNsaWVudFggPT09IGV2ZW50LmNsaWVudFggJiYgc3RhcnRFdmVudC5jbGllbnRZID09PSBldmVudC5jbGllbnRZKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQucmVkcmF3RXZlbnRSZWN0KCk7XG4gICAgICAgICAgICAgICAgJCQudXBkYXRlWm9vbSgpO1xuICAgICAgICAgICAgICAgIGNvbmZpZy56b29tX29uem9vbWVuZC5jYWxsKCQkLmFwaSwgJCQueC5vcmdEb21haW4oKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgJCQuem9vbS5zY2FsZSA9IGZ1bmN0aW9uIChzY2FsZSkge1xuICAgICAgICAgICAgcmV0dXJuIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB0aGlzLnkoc2NhbGUpIDogdGhpcy54KHNjYWxlKTtcbiAgICAgICAgfTtcbiAgICAgICAgJCQuem9vbS5vcmdTY2FsZUV4dGVudCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBleHRlbnQgPSBjb25maWcuem9vbV9leHRlbnQgPyBjb25maWcuem9vbV9leHRlbnQgOiBbMSwgMTBdO1xuICAgICAgICAgICAgcmV0dXJuIFtleHRlbnRbMF0sIE1hdGgubWF4KCQkLmdldE1heERhdGFDb3VudCgpIC8gZXh0ZW50WzFdLCBleHRlbnRbMV0pXTtcbiAgICAgICAgfTtcbiAgICAgICAgJCQuem9vbS51cGRhdGVTY2FsZUV4dGVudCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciByYXRpbyA9IGRpZmZEb21haW4oJCQueC5vcmdEb21haW4oKSkgLyBkaWZmRG9tYWluKCQkLmdldFpvb21Eb21haW4oKSksXG4gICAgICAgICAgICAgICAgZXh0ZW50ID0gdGhpcy5vcmdTY2FsZUV4dGVudCgpO1xuICAgICAgICAgICAgdGhpcy5zY2FsZUV4dGVudChbZXh0ZW50WzBdICogcmF0aW8sIGV4dGVudFsxXSAqIHJhdGlvXSk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFpvb21Eb21haW4gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMyxcbiAgICAgICAgICAgIG1pbiA9IGQzLm1pbihbJCQub3JnWERvbWFpblswXSwgY29uZmlnLnpvb21feF9taW5dKSxcbiAgICAgICAgICAgIG1heCA9IGQzLm1heChbJCQub3JnWERvbWFpblsxXSwgY29uZmlnLnpvb21feF9tYXhdKTtcbiAgICAgICAgcmV0dXJuIFttaW4sIG1heF07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVab29tID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCB6ID0gJCQuY29uZmlnLnpvb21fZW5hYmxlZCA/ICQkLnpvb20gOiBmdW5jdGlvbiAoKSB7fTtcbiAgICAgICAgJCQubWFpbi5zZWxlY3QoJy4nICsgQ0xBU1Muem9vbVJlY3QpLmNhbGwoeikub24oXCJkYmxjbGljay56b29tXCIsIG51bGwpO1xuICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5ldmVudFJlY3QpLmNhbGwoeikub24oXCJkYmxjbGljay56b29tXCIsIG51bGwpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucmVkcmF3Rm9yWm9vbSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgZDMgPSAkJC5kMywgY29uZmlnID0gJCQuY29uZmlnLCB6b29tID0gJCQuem9vbSwgeCA9ICQkLng7XG4gICAgICAgIGlmICghY29uZmlnLnpvb21fZW5hYmxlZCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICgkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLm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jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMyxcbiAgICAgICAgICAgIGNvbG9ycyA9IGNvbmZpZy5kYXRhX2NvbG9ycyxcbiAgICAgICAgICAgIHBhdHRlcm4gPSBub3RFbXB0eShjb25maWcuY29sb3JfcGF0dGVybikgPyBjb25maWcuY29sb3JfcGF0dGVybiA6IGQzLnNjYWxlLmNhdGVnb3J5MTAoKS5yYW5nZSgpLFxuICAgICAgICAgICAgY2FsbGJhY2sgPSBjb25maWcuZGF0YV9jb2xvcixcbiAgICAgICAgICAgIGlkcyA9IFtdO1xuXG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgdmFyIGlkID0gZC5pZCB8fCAoZC5kYXRhICYmIGQuZGF0YS5pZCkgfHwgZCwgY29sb3I7XG5cbiAgICAgICAgICAgIC8vIGlmIGNhbGxiYWNrIGZ1bmN0aW9uIGlzIHByb3ZpZGVkXG4gICAgICAgICAgICBpZiAoY29sb3JzW2lkXSBpbnN0YW5jZW9mIEZ1bmN0aW9uKSB7XG4gICAgICAgICAgICAgICAgY29sb3IgPSBjb2xvcnNbaWRdKGQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gaWYgc3BlY2lmaWVkLCBjaG9vc2UgdGhhdCBjb2xvclxuICAgICAgICAgICAgZWxzZSBpZiAoY29sb3JzW2lkXSkge1xuICAgICAgICAgICAgICAgIGNvbG9yID0gY29sb3JzW2lkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGlmIG5vdCBzcGVjaWZpZWQsIGNob29zZSBmcm9tIHBhdHRlcm5cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChpZHMuaW5kZXhPZihpZCkgPCAwKSB7IGlkcy5wdXNoKGlkKTsgfVxuICAgICAgICAgICAgICAgIGNvbG9yID0gcGF0dGVybltpZH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MyA9ICQkLmQzO1xuICAgICAgICBpZiAobWF4ID09PSAwIHx8IG1heCkge1xuICAgICAgICAgICAgY29uZmlnLnpvb21feF9tYXggPSBkMy5tYXgoWyQkLm9yZ1hEb21haW5bMV0sIG1heF0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGNvbmZpZy56b29tX3hfbWF4O1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLnpvb20ubWluID0gZnVuY3Rpb24gKG1pbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDM7XG4gICAgICAgIGlmIChtaW4gPT09IDAgfHwgbWluKSB7XG4gICAgICAgICAgICBjb25maWcuem9vbV94X21pbiA9IGQzLm1pbihbJCQub3JnWERvbWFpblswXSwgbWluXSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gY29uZmlnLnpvb21feF9taW47XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uem9vbS5yYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkge1xuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyYW5nZS5tYXgpKSB7IHRoaXMuZG9tYWluLm1heChyYW5nZS5tYXgpOyB9XG4gICAgICAgICAgICBpZiAoaXNEZWZpbmVkKHJhbmdlLm1pbikpIHsgdGhpcy5kb21haW4ubWluKHJhbmdlLm1pbik7IH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgbWF4OiB0aGlzLmRvbWFpbi5tYXgoKSxcbiAgICAgICAgICAgICAgICBtaW46IHRoaXMuZG9tYWluLm1pbigpXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfT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ztcblxuICAgICAgICBpZiAoYXJncy5qc29uKSB7XG4gICAgICAgICAgICBkYXRhID0gJCQuY29udmVydEpzb25Ub0RhdGEoYXJncy5qc29uLCBhcmdzLmtleXMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGFyZ3Mucm93cykge1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRSb3dzVG9EYXRhKGFyZ3Mucm93cyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoYXJncy5jb2x1bW5zKSB7XG4gICAgICAgICAgICBkYXRhID0gJCQuY29udmVydENvbHVtbnNUb0RhdGEoYXJncy5jb2x1bW5zKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB0YXJnZXRzID0gJCQuY29udmVydERhdGFUb1RhcmdldHMoZGF0YSwgdHJ1ZSk7XG5cbiAgICAgICAgLy8gVXBkYXRlL0FkZCBkYXRhXG4gICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICB2YXIgZm91bmQgPSBmYWxzZSwgaSwgajtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0YXJnZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHQuaWQgPT09IHRhcmdldHNbaV0uaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgZm91bmQgPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0LnZhbHVlc1t0LnZhbHVlcy5sZW5ndGggLSAxXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGFpbCA9IHQudmFsdWVzW3QudmFsdWVzLmxlbmd0aCAtIDFdLmluZGV4ICsgMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSB0YXJnZXRzW2ldLnZhbHVlcy5sZW5ndGg7XG5cbiAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRzW2ldLnZhbHVlc1tqXS5pbmRleCA9IHRhaWwgKyBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldHNbaV0udmFsdWVzW2pdLnggPSB0YWlsICsgajtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0LnZhbHVlcyA9IHQudmFsdWVzLmNvbmNhdCh0YXJnZXRzW2ldLnZhbHVlcyk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0cy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghZm91bmQpIHsgbm90Zm91bmRJZHMucHVzaCh0LmlkKTsgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBBcHBlbmQgbnVsbCBmb3Igbm90IGZvdW5kIHRhcmdldHNcbiAgICAgICAgJCQuZGF0YS50YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgIHZhciBpLCBqO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG5vdGZvdW5kSWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHQuaWQgPT09IG5vdGZvdW5kSWRzW2ldKSB7XG4gICAgICAgICAgICAgICAgICAgIHRhaWwgPSB0LnZhbHVlc1t0LnZhbHVlcy5sZW5ndGggLSAxXS5pbmRleCArIDE7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBsZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdC52YWx1ZXMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQuaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IHRhaWwgKyBqLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHg6ICQkLmlzVGltZVNlcmllcygpID8gJCQuZ2V0T3RoZXJUYXJnZXRYKHRhaWwgKyBqKSA6IHRhaWwgKyBqLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBudWxsXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gR2VuZXJhdGUgbnVsbCB2YWx1ZXMgZm9yIG5ldyB0YXJnZXRcbiAgICAgICAgaWYgKCQkLmRhdGEudGFyZ2V0cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgIHZhciBpLCBtaXNzaW5nID0gW107XG4gICAgICAgICAgICAgICAgZm9yIChpID0gJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlc1swXS5pbmRleDsgaSA8IHRhaWw7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBtaXNzaW5nLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQuaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHg6ICQkLmlzVGltZVNlcmllcygpID8gJCQuZ2V0T3RoZXJUYXJnZXRYKGkpIDogaSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBudWxsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0LnZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICAgICAgICAgIHYuaW5kZXggKz0gdGFpbDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdi54ICs9IHRhaWw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB0LnZhbHVlcyA9IG1pc3NpbmcuY29uY2F0KHQudmFsdWVzKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgICQkLmRhdGEudGFyZ2V0cyA9ICQkLmRhdGEudGFyZ2V0cy5jb25jYXQodGFyZ2V0cyk7IC8vIGFkZCByZW1haW5lZFxuXG4gICAgICAgIC8vIGNoZWNrIGRhdGEgY291bnQgYmVjYXVzZSBiZWhhdmlvciBuZWVkcyB0byBjaGFuZ2Ugd2hlbiBpdCdzIG9ubHkgb25lXG4gICAgICAgIGRhdGFDb3VudCA9ICQkLmdldE1heERhdGFDb3VudCgpO1xuICAgICAgICBiYXNlVGFyZ2V0ID0gJCQuZGF0YS50YXJnZXRzWzBdO1xuICAgICAgICBiYXNlVmFsdWUgPSBiYXNlVGFyZ2V0LnZhbHVlc1swXTtcblxuICAgICAgICAvLyBVcGRhdGUgbGVuZ3RoIHRvIGZsb3cgaWYgbmVlZGVkXG4gICAgICAgIGlmIChpc0RlZmluZWQoYXJncy50bykpIHtcbiAgICAgICAgICAgIGxlbmd0aCA9IDA7XG4gICAgICAgICAgICB0byA9ICQkLmlzVGltZVNlcmllcygpID8gJCQucGFyc2VEYXRlKGFyZ3MudG8pIDogYXJncy50bztcbiAgICAgICAgICAgIGJhc2VUYXJnZXQudmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgICAgICBpZiAodi54IDwgdG8pIHsgbGVuZ3RoKys7IH1cbiAgICAgIC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bHVlcy5sZW5ndGggLSAxXS54IC0gYmFzZVZhbHVlLngpIC8gMjtcbiAgICAgICAgICAgICAgICBkb21haW4gPSBbbmV3IERhdGUoK2Jhc2VWYWx1ZS54IC0gZGlmZiksIG5ldyBEYXRlKCtiYXNlVmFsdWUueCArIGRpZmYpXTtcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVYRG9tYWluKG51bGwsIHRydWUsIHRydWUsIGZhbHNlLCBkb21haW4pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2V0IHRhcmdldHNcbiAgICAgICAgJCQudXBkYXRlVGFyZ2V0cygkJC5kYXRhLnRhcmdldHMpO1xuXG4gICAgICAgIC8vIFJlZHJhdyB3aXRoIG5ldyB0YXJnZXRzXG4gICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICBmbG93OiB7XG4gICAgICAgICAgICAgICAgaW5kZXg6IGJhc2VWYWx1ZS5pbmRleCxcbiAgICAgICAgICAgICAgICBsZW5ndGg6IGxlbmd0aCxcbiAgICAgICAgICAgICAgICBkdXJhdGlvbjogaXNWYWx1ZShhcmdzLmR1cmF0aW9uKSA/IGFyZ3MuZHVyYXRpb24gOiAkJC5jb25maWcudHJhbnNpdGlvbl9kdXJhdGlvbixcbiAgICAgICAgICAgICAgICBkb25lOiBhcmdzLmRvbmUsXG4gICAgICAgICAgICAgICAgb3JnRGF0YUNvdW50OiBvcmdEYXRhQ291bnQsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgd2l0aExlZ2VuZDogdHJ1ZSxcbiAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uOiBvcmdEYXRhQ291bnQgPiAxLFxuICAgICAgICAgICAgd2l0aFRyaW1YRG9tYWluOiBmYWxzZSxcbiAgICAgICAgICAgIHdpdGhVcGRhdGVYQXhpczogdHJ1ZSxcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlRmxvdyA9IGZ1bmN0aW9uIChhcmdzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMztcblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHRhcmdldHMgPSBhcmdzLnRhcmdldHMsXG4gICAgICAgICAgICAgICAgZmxvdyA9IGFyZ3MuZmxvdyxcbiAgICAgICAgICAgICAgICBkcmF3QmFyID0gYXJncy5kcmF3QmFyLFxuICAgICAgICAgICAgICAgIGRyYXdMaW5lID0gYXJncy5kcmF3TGluZSxcbiAgICAgICAgICAgICAgICBkcmF3QXJlYSA9IGFyZ3MuZHJhd0FyZWEsXG4gICAgICAgICAgICAgICAgY3ggPSBhcmdzLmN4LFxuICAgICAgICAgICAgICAgIGN5ID0gYXJncy5jeSxcbiAgICAgICAgICAgICAgICB4diA9IGFyZ3MueHYsXG4gICAgICAgICAgICAgICAgeEZvclRleHQgPSBhcmdzLnhGb3JUZXh0LFxuICAgICAgICAgICAgICAgIHlGb3JUZXh0ID0gYXJncy55Rm9yVGV4dCxcbiAgICAgICAgICAgICAgICBkdXJhdGlvbiA9IGFyZ3MuZHVyYXRpb247XG5cbiAgICAgICAgICAgIHZhciB0cmFuc2xhdGVYLCBzY2FsZVggPSAxLCB0cmFuc2Zvcm0sXG4gICAgICAgICAgICAgICAgZmxvd0luZGV4ID0gZmxvdy5pbmRleCxcbiAgICAgICAgICAgICAgICBmbG93TGVuZ3RoID0gZmxvdy5sZW5ndGgsXG4gICAgICAgICAgICAgICAgZmxvd1N0YXJ0ID0gJCQuZ2V0VmFsdWVPbkluZGV4KCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMsIGZsb3dJbmRleCksXG4gICAgICAgICAgICAgICAgZmxvd0VuZCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCBmbG93SW5kZXggKyBmbG93TGVuZ3RoKSxcbiAgICAgICAgICAgICAgICBvcmdEb21haW4gPSAkJC54LmRvbWFpbigpLCBkb21haW4sXG4gICAgICAgICAgICAgICAgZHVyYXRpb25Gb3JGbG93ID0gZmxvdy5kdXJhdGlvbiB8fCBkdXJhdGlvbixcbiAgICAgICAgICAgICAgICBkb25lID0gZmxvdy5kb25lIHx8IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgICAgIHdhaXQgPSAkJC5nZW5lcmF0ZVdhaXQoKTtcblxuICAgICAgICAgICAgdmFyIHhncmlkID0gJCQueGdyaWQgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICB4Z3JpZExpbmVzID0gJCQueGdyaWRMaW5lcyB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5SZWdpb24gPSAkJC5tYWluUmVnaW9uIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpblRleHQgPSAkJC5tYWluVGV4dCB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5CYXIgPSAkJC5tYWluQmFyIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpbkxpbmUgPSAkJC5tYWluTGluZSB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5BcmVhID0gJCQubWFpbkFyZWEgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluQ2lyY2xlID0gJCQubWFpbkNpcmNsZSB8fCBkMy5zZWxlY3RBbGwoW10pO1xuXG4gICAgICAgICAgICAvLyBzZXQgZmxhZ1xuICAgICAgICAgICAgJCQuZmxvd2luZyA9IHRydWU7XG5cbiAgICAgICAgICAgIC8vIHJlbW92ZSBoZWFkIGRhdGEgYWZ0ZXIgcmVuZGVyZWRcbiAgICAgICAgICAgICQkLmRhdGEudGFyZ2V0cy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ICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gJCQueChmbG93U3RhcnQueCkgLSAkJC54KGZsb3dFbmQueCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gZGlmZkRvbWFpbihkb21haW4pIC8gMjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxvdy5vcmdEYXRhQ291bnQgPT09IDEgfHwgKGZsb3dTdGFydCAmJiBmbG93U3RhcnQueCkgPT09IChmbG93RW5kICYmIGZsb3dFbmQueCkpIHtcbiAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gJCQueChvcmdEb21haW5bMF0pIC0gJCQueChkb21haW5bMF0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICgkJC54KG9yZ0RvbWFpblswXSkgLSAkJC54KGRvbWFpblswXSkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAoJCQueChmbG93U3RhcnQueCkgLSAkJC54KGZsb3dFbmQueCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNjYWxlWCA9IChkaWZmRG9tYWluKG9yZ0RvbWFpbikgLyBkaWZmRG9tYWluKGRvbWFpbikpO1xuICAgICAgICAgICAgdHJhbnNmb3JtID0gJ3RyYW5zbGF0ZSgnICsgdHJhbnNsYXRlWCArICcsMCkgc2NhbGUoJyArIHNjYWxlWCArICcsMSknO1xuXG4gICAgICAgICAgICAkJC5oaWRlWEdyaWRGb2N1cygpO1xuXG4gICAgICAgICAgICBkMy50cmFuc2l0aW9uKCkuZWF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GlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGksIHNoYXBlcyA9IFtdLCB0ZXh0cyA9IFtdLCBldmVudFJlY3RzID0gW107XG5cbiAgICAgICAgICAgICAgICAvLyByZW1vdmUgZmxvd2VkIGVsZW1lbnRzXG4gICAgICAgICAgICAgICAgaWYgKGZsb3dMZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGZsb3dMZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2hhcGVzLnB1c2goJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyAoZmxvd0luZGV4ICsgaSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHMucHVzaCgnLicgKyBDTEFTUy50ZXh0ICsgJy0nICsgKGZsb3dJbmRleCArIGkpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50UmVjdHMucHVzaCgnLicgKyBDTEFTUy5ldmVudFJlY3QgKyAnLScgKyAoZmxvd0luZGV4ICsgaSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGVzKS5zZWxlY3RBbGwoc2hhcGVzKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy50ZXh0cykuc2VsZWN0QWxsKHRleHRzKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5ldmVudFJlY3RzKS5zZWxlY3RBbGwoZXZlbnRSZWN0cykucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3QoJy4nICsgQ0xBU1MueGdyaWQpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIGRyYXcgYWdhaW4gZm9yIHJlbW92aW5nIGZsb3dlZCBlbGVtZW50cyBhbmQgcmV2ZXJ0aW5nIGF0dHJcbiAgICAgICAgICAgICAgICB4Z3JpZFxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJCQueGdyaWRBdHRyKTtcbiAgICAgICAgICAgICAgICB4Z3JpZExpbmVzXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKTtcbiAgICAgICAgICAgICAgICB4Z3JpZExpbmVzLnNlbGVjdCgnbGluZScpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieDFcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiB4dilcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiB4dik7XG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lcy5zZWxlY3QoJ3RleHQnKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcInhcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoIDogMClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ5XCIsIHh2KTtcbiAgICAgICAgICAgICAgICBtYWluQmFyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZHJhd0Jhcik7XG4gICAgICAgICAgICAgICAgbWFpbkxpbmVcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCBkcmF3TGluZSk7XG4gICAgICAgICAgICAgICAgbWFpbkFyZWFcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCBkcmF3QXJlYSk7XG4gICAgICAgICAgICAgICAgbWFpbkNpcmNsZVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJjeFwiLCBjeClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJjeVwiLCBjeSk7XG4gICAgICAgICAgICAgICAgbWFpblRleHRcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgeEZvclRleHQpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgeUZvclRleHQpXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbC1vcGFjaXR5JywgJCQub3BhY2l0eUZvclRleHQuYmluZCgkJCkpO1xuICAgICAgICAgICAgICAgIG1haW5SZWdpb25cbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpO1xuICAgICAgICAgICAgICAgIG1haW5SZWdpb24uc2VsZWN0KCdyZWN0JykuZmlsdGVyKCQkLmlzUmVnaW9uT25YKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcInhcIiwgJCQucmVnaW9uWC5iaW5kKCQkKSlcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ3aWR0aFwiLCAkJC5yZWdpb25XaWR0aC5iaW5kKCQkKSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmludGVyYWN0aW9uX2VuYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3RXZlbnRSZWN0KCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gY2FsbGJhY2sgZm9yIGVuZCBvZiBmbG93XG4gICAgICAgICAgICAgICAgZG9uZ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S54cztcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uYXhpcyA9IGZ1bmN0aW9uICgpIHt9O1xuICAgIGMzX2NoYXJ0X2ZuLmF4aXMubGFiZWxzID0gZnVuY3Rpb24gKGxhYmVscykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsO1xuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgT2JqZWN0LmtleXMobGFiZWxzKS5mb3JFYWNoKGZ1bmN0aW9uIChheGlzSWQpIHtcbiAgICAgICAgICAgICAgICAkJC5heGlzLnNldExhYmVsVGV4dChheGlzSWQsIGxhYmVsc1theGlzSWRdKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgJCQuYXhpcy51cGRhdGVMYWJlbHMoKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBUT0RPOiByZXR1cm4gc29tZSB2YWx1ZXM/XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi5heGlzLm1heCA9IGZ1bmN0aW9uIChtYXgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtYXggPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWF4LngpKSB7IGNvbmZpZy5heGlzX3hfbWF4ID0gbWF4Lng7IH1cbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtYXgueSkpIHsgY29uZmlnLmF4aXNfeV9tYXggPSBtYXgueTsgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1heC55MikpIHsgY29uZmlnLmF4aXNfeTJfbWF4ID0gbWF4LnkyOyB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3lfbWF4ID0gY29uZmlnLmF4aXNfeTJfbWF4ID0gbWF4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgJCQucmVkcmF3KHt3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSwgd2l0aFVwZGF0ZVhEb21haW46IHRydWV9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgeDogY29uZmlnLmF4aXNfeF9tYXgsXG4gICAgICAgICAgICAgICAgeTogY29uZmlnLmF4aXNfeV9tYXgsXG4gICAgICAgICAgICAgICAgeTI6IGNvbmZpZy5heGlzX3kyX21heFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uYXhpcy5taW4gPSBmdW5jdGlvbiAobWluKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWluID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1pbi54KSkgeyBjb25maWcuYXhpc194X21pbiA9IG1pbi54OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWluLnkpKSB7IGNvbmZpZy5heGlzX3lfbWluID0gbWluLnk7IH1cbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtaW4ueTIpKSB7IGNvbmZpZy5heGlzX3kyX21pbiA9IG1pbi55MjsgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc195X21pbiA9IGNvbmZpZy5heGlzX3kyX21pbiA9IG1pbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHg6IGNvbmZpZy5heGlzX3hfbWluLFxuICAgICAgICAgICAgICAgIHk6IGNvbmZpZy5heGlzX3lfbWluLFxuICAgICAgICAgICAgICAgIHkyOiBjb25maWcuYXhpc195Ml9taW5cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuLmF4aXMucmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHtcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQocmFuZ2UubWF4KSkgeyB0aGlzLmF4aXMubWF4KHJhbmdlLm1heCk7IH1cbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQocmFuZ2UubWluKSkgeyB0aGlzLmF4aXMubWluKHJhbmdlLm1pbik7IH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgbWF4OiB0aGlzLmF4aXMubWF4KCksXG4gICAgICAgICAgICAgICAgbWluOiB0aGlzLmF4aXMubWluKClcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4ubGVnZW5kID0gZnVuY3Rpb24gKCkge307XG4gICAgYzNfY2hhcnRfZm4ubGVnZW5kLnNob3cgPSBmdW5jdGlvbiAodGFyZ2V0SWRzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWw7XG4gICAgICAgICQkLnNob3dMZWdlbmQoJCQubWFwVG9UYXJnZXRJZHModGFyZ2V0SWRzKSk7XG4gICAgICAgICQkLnVwZGF0ZUFuZFJlZHJhdyh7d2l0aExlZ2VuZDogdHJ1ZX0pO1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4ubGVnZW5kLmhpZGUgPSBmd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JCQucmVzaXplVGltZW91dCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAod2luZG93LmRldGFjaEV2ZW50KSB7XG4gICAgICAgICAgICB3aW5kb3cuZGV0YWNoRXZlbnQoJ29ucmVzaXplJywgJCQucmVzaXplRnVuY3Rpb24pO1xuICAgICAgICB9IGVsc2UgaWYgKHdpbmRvdy5yZW1vdmVFdmVudExpc3RlbmVyKSB7XG4gICAgICAgICAgICB3aW5kb3cucmVtb3ZlRXZlbnRMaXN0ZW5lcigncmVzaXplJywgJCQucmVzaXplRnVuY3Rpb24pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIHdyYXBwZXIgPSB3aW5kb3cub25yZXNpemU7XG4gICAgICAgICAgICAvLyBjaGVjayBpZiBubyBvbmUgZWxzZSByZW1vdmVkIG91ciB3cmFwcGVyIGFuZCByZW1vdmUgb3VyIHJlc2l6ZUZ1bmN0aW9uIGZyb20gaXRcbiAgICAgICAgICAgIGlmICh3cmFwcGVyICYmIHdyYXBwZXIuYWRkICYmIHdyYXBwZXIucmVtb3ZlKSB7XG4gICAgICAgICAgICAgICAgd3JhcHBlci5yZW1vdmUoJCQucmVzaXplRnVuY3Rpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgJCQuc2VsZWN0Q2hhcnQuY2xhc3NlZCgnYzMnLCBmYWxzZSkuaHRtbChcIlwiKTtcblxuICAgICAgICAvLyBNRU1POiB0aGlzIGlzIG5lZWRlZCBiZWNhdXNlIHRoZSByZWZlcmVuY2Ugb2Ygc29tZSBlbGVtZW50cyB3aWxsIG5vdCBiZSByZWxlYXNlZCwgdGhlbiBtZW1vcnkgbGVhayB3aWxsIGhhcHBlbi5cbiAgICAgICAgT2JqZWN0LmtleXMoJCQpLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgJCRba2V5XSA9IG51bGw7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBudWxsO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WyBzdGFydCwgc3RvcCBdIDogWyBzdG9wLCBzdGFydCBdO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGdlbmVyYXRlVGlja3Moc2NhbGUpIHtcbiAgICAgICAgICAgIHZhciBpLCBkb21haW4sIHRpY2tzID0gW107XG4gICAgICAgICAgICBpZiAoc2NhbGUudGlja3MpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gc2NhbGUudGlja3MuYXBwbHkoc2NhbGUsIHRpY2tBcmd1bWVudHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZG9tYWluID0gc2NhbGUuZG9tYWluKCk7XG4gICAgICAgICAgICBmb3IgKGkgPSBNYXRoLmNlaWwoZG9tYWluWzBdKTsgaSA8IGRvbWFpblsxXTsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdGlja3MucHVzaChpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aWNrcy5sZW5ndGggPiAwICYmIHRpY2tzWzBdID4gMCkge1xuICAgICAgICAgICAgICAgIHRpY2tzLnVuc2hpZnQodGlja3NbMF0gLSAodGlja3NbMV0gLSB0aWNrc1swXSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRpY2tzO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGNvcHlTY2FsZSgpIHtcbiAgICAgICAgICAgIHZhciBuZXdTY2FsZSA9IHNjYWxlLmNvcHkoKSwgZG9tYWluO1xuICAgICAgICAgICAgaWYgKHBhcmFtcy5pc0NhdGVnb3J5KSB7XG4gICAgICAgICAgICAgICAgZG9tYWluID0gc2NhbGUuZG9tYWluKCk7XG4gICAgICAgICAgICAgICAgbmV3U2NhbGUuZG9tYWluKFtkb21haW5bMF0sIGRvbWFpblsxXSAtIDFdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBuZXdTY2FsZTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiB0ZXh0Rm9ybWF0dGVkKHYpIHtcbiAgICAgICAgICAgIHZhciBmb3JtYXR0ZWQgPSB0aWNrRm9ybWF0ID8gdGlja0Zvcm1hdCh2KSA6IHY7XG4gICAgICAgICAgICByZXR1cm4gdHlwZW9mIGZvcm1hdHRlZCAhPT0gJ3VuZGVmaW5lZCcgPyBmb3JtYXR0ZWQgOiAnJztcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBnZXRTaXplRm9yMUNoYXIodGljaykge1xuICAgICAgICAgICAgaWYgKHRpY2tUZXh0Q2hhclNpemUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGlja1RleHRDaGFyU2l6ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBzaXplID0ge1xuICAgICAgICAgICAgICAgIGg6IDExLjUsXG4gICAgICAgICAgICAgICAgdzogNS41XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgdGljay5zZWxlY3QoJ3RleHQnKS50ZXh0KHRleHRGb3JtYXR0ZWQpLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgYm94ID0gdGhpcy5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSxcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHRleHRGb3JtYXR0ZWQoZCksXG4gICAgICAgICAgICAgICAgICAgIGggPSBib3guaGVpZ2h0LFxuICAgICAgICAgICAgICAgICAgICB3ID0gdGV4dCA/IChib3gud2lkdGggLyB0ZXh0Lmxlbmd0aCkgOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKGggJiYgdykge1xuICAgICAgICAgICAgICAgICAgICBzaXplLmggPSBoO1xuICAgICAgICAgICAgICAgICAgICBzaXplLncgPSB3O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLnRleHQoJycpO1xuICAgICAgICAgICAgdGlja1RleHRDaGFyU2l6ZSA9IHNpemU7XG4gICAgICAgICAgICByZXR1cm4gc2l6ZTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiB0cmFuc2l0aW9uaXNlKHNlbGVjdGlvbikge1xuICAgICAgICAgICAgcmV0dXJuIHBhcmFtcy53aXRob3V0VHJhbnNpdGlvbiA/IHNlbGVjdGlvbiA6IGQzLnRyYW5zaXRpb24oc2VsZWN0aW9uKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBheGlzKGcpIHtcbiAgICAgICAgICAgIGcuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGcgPSBheGlzLmcgPSBkMy5zZWxlY3QodGhpcyk7XG5cbiAgICAgICAgICAgICAgICB2YXIgc2NhbGUwID0gdGhpcy5fX2NoYXJ0X18gfHwgc2NhbGUsIHNjYWxlMSA9IHRoaXMuX19jaGFydF9fID0gY29weVNjYWxlKCk7XG5cbiAgICAgICAgICAgICAgICB2YXIgdGlja3MgPSB0aWNrVmFsdWVzID8gdGlja1ZhbHVlcyA6IGdlbmVyYXRlVGlja3Moc2NhbGUxKSxcbiAgICAgICAgICAgICAgICAgICAgdGljayA9IGcuc2VsZWN0QWxsKFwiLnRpY2tcIikuZGF0YSh0aWNrcywgc2NhbGUxKSxcbiAgICAgICAgICAgICAgICAgICAgdGlja0VudGVyID0gdGljay5lbnRlcigpLmluc2VydChcImdcIiwgXCIuZG9tYWluXCIpLmF0dHIoXCJjbGFzc1wiLCBcInRpY2tcIikuc3R5bGUoXCJvcGFjaXR5XCIsIDFlLTYpLFxuICAgICAgICAgICAgICAgICAgICAvLyBNRU1POiBObyBleGl0IHRyYW5zaXRpb24uIFRoZSByZWFzb24gaXMgdGhpcyB0cmFuc2l0aW9uIGFmZmVjdHMgbWF4IHRpY2sgd2lkdGggY2FsY3VsYXRpb24gYmVjYXVzZSBvbGQgdGljayB3aWxsIGJlIGluY2x1ZGVkIGluIHRoZSB0aWNrcy5cbiAgICAgICAgICAgICAgICAgICAgdGlja0V4aXQgPSB0aWNrLmV4aX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G4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGlja1RleHQ7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAoIW1heFdpZHRoIHx8IG1heFdpZHRoIDw9IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heFdpZHRoID0gaXNWZXJ0aWNhbCA/IDk1IDogcGFyYW1zLmlzQ2F0ZWdvcnkgPyAoTWF0aC5jZWlsKHNjYWxlMSh0aWNrc1sxXSkgLSBzY2FsZTEodGlja3NbMF0pKSAtIDEyKSA6IDExMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNwbGl0KHNwbGl0dGVkLCB0ZXh0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzcGFjZUluZGV4ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDE7IGkgPCB0ZXh0Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRleHQuY2hhckF0KGkpID09PSAnICcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BhY2VJbmRleCA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YnRleHQgPSB0ZXh0LnN1YnN0cigwLCBpICsgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFdpZHRoID0gc2l6ZUZvcjFDaGFyLncgKiBzdWJ0ZXh0Lmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB0ZXh0IHdpZHRoIGdldHMgb3ZlciB0aWNrIHdpZHRoLCBzcGxpdCBieSBzcGFjZSBpbmRleCBvciBjcnJlbnQgaW5kZXhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF4V2lkdGggPCB0ZXh0V2lkdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwbGl0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BsaXR0ZWQuY29uY2F0KHRleHQuc3Vic3RyKDAsIHNwYWNlSW5kZXggPyBzcGFjZUluZGV4IDogaSkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC5zbGljZShzcGFjZUluZGV4ID8gc3BhY2VJbmRleCArIDEgOiBpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdHRlZC5jb25jYXQodGV4dCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXQoc3BsaXR0ZWQsIHRpY2tUZXh0ICsgXCJcIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdHNwYW5EeShkLCBpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkeSA9IHNpemVGb3IxQ2hhci5oO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9yaWVudCA9PT0gJ2xlZnQnIHx8IG9yaWVudCA9PT0gJ3JpZ2h0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR5ID0gLSgoY291bnRzW2QuaW5kZXhdIC0gMSkgKiAoc2l6ZUZvcjFDaGFyLmggLyAyKSAtIDMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkeSA9IFwiLjcxZW1cIjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZHk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdGlja1NpemUoZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdGlja1Bvc2l0aW9uID0gc2NhbGUoZCkgKyAodGlja0NlbnRlcmVkID8gMCA6IHRpY2tPZmZzZXQpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmFuZ2VbMF0gPCB0aWNrUG9zaXRpb24gJiYgdGlja1Bvc2l0aW9uIDwgcmFuZ2VbMV0gPyBpbm5lclRpY2tTaXplIDogMDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0ZXh0ID0gdGljay5zZWxlY3QoXCJ0ZXh0XCIpO1xuICAgICAgICAgICAgICAgIHRzcGFuID0gdGV4dC5zZWxlY3RBbGwoJ3RzcGFuJylcbiAgICAgICAgICAgICAgICAgICAgLmRhdGEoZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzcGxpdHRlZCA9IHBhcmFtcy50aWNrTXVsdGlsaW5lID8gc3BsaXRUaWNrVGV4dChkLCBwYXJhbXMudGlja1dpZHRoKSA6IFtdLmNvbmNhdCh0ZXh0Rm9ybWF0dGVkKGQpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50c1tpXSA9IHNwbGl0dGVkLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdHRlZC5tYXAoZnVuY3Rpb24gKHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyBpbmRleDogaSwgc3BsaXR0ZWQ6IHMgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB0c3Bhbi5lbnRlcigpLmFwcGVuZCgndHNwYW4nKTtcbiAgICAgICAgICAgICAgICB0c3Bhbi5leGl0KCkucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgdHNwYW4udGV4dChmdW5jdGlvbiAoZCkgeyByZXR1cm4gZC5zcGxpdHRlZDsgfSk7XG5cbiAgICAgICAgICAgICAgICB2YXIgcm90YXRlID0gcGFyYW1zLnRpY2tUZXh0Um90YXRlO1xuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdGV4dEFuY2hvckZvclRleHQocm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ21pZGRsZSc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZSA+IDAgPyBcInN0YXJ0XCIgOiBcImVuZFwiO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB0ZXh0VHJhbnNmb3JtKHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcInJvdGF0ZShcIiArIHJvdGF0ZSArIFwiKVwiO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBkeEZvclRleHQocm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gOCAqIE1hdGguc2luKE1hdGguUEkgKiAocm90YXRlIC8gMTgwKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHlGb3JUZXh0KHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRpY2tMZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDExLjUgLSAyLjUgKiAocm90YXRlIC8gMTUpICogKHJvdGF0ZSA+IDAgPyAxIDogLTEpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHN3aXRjaCAob3JpZW50KSB7XG4gICAgICAgICAgICAgICAgY2FzZSBcImJvdHRvbVwiOlxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aWNrVHJhbnNmb3JtID0gYXhpc1g7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lRW50ZXIuYXR0cihcInkyXCIsIGlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ5XCIsIHRpY2tMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZS5hdHRyKFwieDFcIiwgdGlja1gpLmF0dHIoXCJ4MlwiLCB0aWNrWCkuYXR0cihcInkyXCIsIHRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cihcInhcIiwgMCkuYXR0cihcInlcIiwgeUZvclRleHQocm90YXRlKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCB0ZXh0QW5jaG9yRm9yVGV4dChyb3RhdGUpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKFwidHJhbnNmb3JtXCIsIHRleHRUcmFuc2Zvcm0ocm90YXRlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0c3Bhbi5hdHRyKCd4JywgMCkuYXR0cihcImR5XCIsIHRzcGFuRHkpLmF0dHIoJ2R4JywgZHhGb3JUZXh0KHJvdGF0ZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKFwiZFwiLCBcIk1cIiArIHJhbmdlWzBdICsgXCIsXCIgKyBvdXRlclRpY2tTaXplICsgXCJWMEhcIiArIHJhbmdlWzFdICsgXCJWXCIgKyBvdXRlclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2FzZSBcInRvcFwiOlxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiByb3RhdGVkIHRpY2sgdGV4dFxuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNYO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ5MlwiLCAtaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RW50ZXIuYXR0cihcInlcIiwgLXRpY2tMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZS5hdHRyKFwieDJcIiwgMCkuYXR0cihcInkyXCIsIC1pbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cihcInhcIiwgMCkuYXR0cihcInlcIiwgLXRpY2tMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC5zdHlsZShcInRleHQtYW5jaG9yXCIsIFwibWlkZGxlXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHNwYW4uYXR0cigneCcsIDApLmF0dHIoXCJkeVwiLCBcIjBlbVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cihcImRcIiwgXCJNXCIgKyByYW5nZVswXSArIFwiLFwiICsgLW91dGVyVGlja1NpemUgKyBcIlYwSFwiICsgcmFuZ2VbMV0gKyBcIlZcIiArIC1vdXRlclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2FzZSBcImxlZnRcIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNZO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ4MlwiLCAtaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RW50ZXIuYXR0cihcInhcIiwgLXRpY2tMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZS5hdHRyKFwieDJcIiwgLWlubmVyVGlja1NpemUpLmF0dHIoXCJ5MVwiLCB0aWNrWSkuYXR0cihcInkyXCIsIHRpY2tZKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cihcInhcIiwgLXRpY2tMZW5ndGgpLmF0dHIoXCJ5XCIsIHRpY2tPZmZzZXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC5zdHlsZShcInRleHQtYW5jaG9yXCIsIFwiZW5kXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHNwYW4uYXR0cigneCcsIC10aWNrTGVuZ3RoKS5hdHRyKFwiZHlcIiwgdHNwYW5EeSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgLW91dGVyVGlja1NpemUgKyBcIixcIiArIHJhbmdlWzBdICsgXCJIMFZcIiArIHJhbmdlWzFdICsgXCJIXCIgKyAtb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhc2UgXCJyaWdodFwiOlxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aWNrVHJhbnNmb3JtID0gYXhpc1k7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lRW50ZXIuYXR0cihcIngyXCIsIGlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ4XCIsIHRpY2tMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZS5hdHRyKFwieDJcIiwgaW5uZXJUaWNrU2l6ZSkuYXR0cihcInkyXCIsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFVwZGF0ZS5hdHRyKFwieFwiLCB0aWNrTGVuZ3RoKS5hdHRyKFwieVwiLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcInN0YXJ0XCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHNwYW4uYXR0cigneCcsIHRpY2tMZW5ndGgpLmF0dHIoXCJkeVwiLCB0c3BhbkR5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cihcImRcIiwgXCJNXCIgKyBvdXRlclRpY2tTaXplICsgXCIsXCIgKyByYW5nZVswXSArIFwiSDBWXCIgKyByYW5nZVsxXSArIFwiSFwiICsgb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc2NhbGUxLnJhbmdlQmFuZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgeCA9IHNjYWxlMSwgZHggPSB4LnJhbmdlQmFuZCgpIC8gMjtcbiAgICAgICAgICAgICAgICAgICAgc2NhbGUwID0gc2NhbGUxID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4KGQpICsgZHg7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzY2FsZTAucmFuZ2VCYW5kKSB7XG4gICAgICAgICAgICAgICAgICAgIHNjYWxlMCA9IHNjYWxlMTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aWNrRXhpdC5jYWxsKHRpY2tUcmFuc2Zvcm0sIHNjYWxlMSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRpY2tFbnRlci5jYWxsKHRpY2tUcmFuc2Zvcm0sIHNjYWxlMCk7XG4gICAgICAgICAgICAgICAgdGlja1VwZGF0ZS5jYWxsKHRpY2tUcmFuc2Zvcm0sIHNjYWxlMSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBheGlzLnNjYWxlID0gZnVuY3Rpb24gKHgpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gc2NhbGU7IH1cbiAgICAgICAgICAgIHNjYWxlID0geDtcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLm9yaWVudCA9IGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIG9yaWVudDsgfVxuICAgICAgICAgICAgb3JpZW50ID0geCBpbiB7dG9wOiAxLCByaWdodDogMSwgYm90dG9tOiAxLCBsZWZ0OiAxfSA/IHggKyBcIlwiIDogXCJib3R0b21cIjtcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tGb3JtYXQgPSBmdW5jdGlvbiAoZm9ybWF0KSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHRpY2tGb3JtYXQ7IH1cbiAgICAgICAgICAgIHRpY2tGb3JtYXQgPSBmb3JtYXQ7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrQ2VudGVyZWQgPSBmdW5jdGlvbiAoaXNDZW50ZXJlZCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrQ2VudGVyZWQ7IH1cbiAgICAgICAgICAgIHRpY2tDZW50ZXJlZCA9IGlzQ2VudGVyZWQ7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrT2Zmc2V0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRpY2tPZmZzZXQ7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0ludGVydmFsID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGludGVydmFsLCBsZW5ndGg7XG4gICAgICAgICAgICBpZiAocGFyYW1zLmlzQ2F0ZWdvcnkpIHtcbiAgICAgICAgICAgICAgICBpbnRlcnZhbCA9IHRpY2tPZmZzZXQgKiAyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbGVuZ3RoID0gYXhpcy5nLnNlbGVjdCgncGF0aC5kb21haW4nKS5ub2RlKCkuZ2V0VG90YWxMZW5ndGgoKSAtIG91dGVyVGlja1NpemUgKiAyO1xuICAgICAgICAgICAgICAgIGludGVydmFsID0gbGVuZ3RoIC8gYXhpcy5nLnNlbGVjdEFsbCgnbGluZScpLnNpemUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBpbnRlcnZhbCA9PT0gSW5maW5pdHkgPyAwIDogaW50ZXJ2YWw7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja3MgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHRpY2tBcmd1bWVudHM7IH1cbiAgICAgICAgICAgIHRpY2tBcmd1bWVudHMgPSBhcmd1bWVudHM7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrQ3VsbGluZyA9IGZ1bmN0aW9uIChjdWxsaW5nKSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHRpY2tDdWxsaW5nOyB9XG4gICAgICAgICAgICB0aWNrQ3VsbGluZyA9IGN1bGxpbmc7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrVmFsdWVzID0gZnVuY3Rpb24gKHgpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgeCA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB4KHNjYWxlLmRvbWFpbigpKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrVmFsdWVzOyB9XG4gICAgICAgICAgICAgICAgdGlja1ZhbHVlcyA9IHg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgfVxuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaXNTYWZhcmkgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciB1YSA9IHdpbmRvdy5uYXZpZ2F0b3IudX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gICAgICAgaW5kZXggPSB0aGlzLm51bWJlck9mSXRlbXM7XG4gICAgICAgICAgICAgaWYgKG5ld0l0ZW0uX293bmluZ1BhdGhTZWdMaXN0KSB7XG4gICAgICAgICAgICAgICAgIC8vIFNWRzIgc3BlYyBzYXlzIHRvIG1ha2UgYSBjb3B5LlxuICAgICAgICAgICAgICAgICBuZXdJdGVtID0gbmV3SXRlbS5jbG9uZSgpO1xuICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICB0aGlzLl9saXN0LnNwbGljZShpbmRleCwgMCwgbmV3SXRlbSk7XG4gICAgICAgICAgICAgbmV3SXRlbS5fb3duaW5nUGF0aFNlZ0xpc3QgPSB0aGlzO1xuICAgICAgICAgICAgIHRoaXMuX3dyaXRlTGlzdFRvUGF0aCgpO1xuICAgICAgICAgICAgIHJldHVybiBuZXdJdGVtO1xuICAgICAgICAgfVxuXG4gICAgICAgICBTVkdQYXRoU2VnTGlzdC5wcm90b3R5cGUucmVwbGFjZUl0ZW0gPSBmdW5jdGlvbihuZXdJdGVtLCBpbmRleCkge1xuICAgICAgICAgICAgIHRoaXMuX2NoZWNrUGF0aFN5bmNocm9uaXplZFRvTGlzdCgpO1xuXG4gICAgICAgICAgICAgaWYgKG5ld0l0ZW0uX293bmluZ1BhdGhTZWdMaXN0KSB7XG4gICAgICAgICAgICAgICAgIC8vIFNWRzIgc3BlYyBzYXlzIHRvIG1ha2UgYSBjb3B5LlxuICAgICAgICAgICAgICAgICBuZXdJdGVtID0gbmV3SXRlbS5jbG9uZSgpO1xuICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICB0aGlzLl9jaGVja1ZhbGlkSW5kZXgoaW5kZXgpO1xuICAgICAgICAgICAgIHRoaXMuX2xpc3RbaW5kZXhdID0gbmV3SXRlbTtcbiAgICAgICAgICAgICBuZXdJdGVtLl9vd25pbmdQYXRoU2VnTGlzdCA9IHRoaXM7XG4gICAgICAgICAgICAgdGhpcy5fd3JpdGVMaXN0VG9QYXRoKCk7XG4gICAgICAgICAgICAgcmV0dXJuIG5ld0l0ZW07XG4gICAgICAgICB9XG5cbiAgICAgICAgIFNWR1BhdGhTZWdMaXN0LnByb3RvdHlwZS5yZW1vdmVJdGVtID0gZnVuY3Rpb24oaW5kZXgpIHtcbiAgICAgICAgICAgICB0aGlzLl9jaGVja1BhdGhTeW5jaHJvbml6ZWRUb0xpc3QoKTtcblxuICAgICAgICAgICAgIHRoaXMuX2NoZWNrVmFsaWRJbmRleChpbmRleCk7XG4gICAgICAgICAgICAgdmFyIGl0ZW0gPSB0aGlzLl9saXN0W2luZGV4XTtcbiAgICAgICAgICAgICB0aGlzLl9saXN0LnNwbGljZShpbmRleCwgMSk7XG4gICAgICAgICAgICAgdGhpcy5fd3JpdGVMaXN0VG9QYXRoKCk7XG4gICAgICAgICAgICAgcmV0dXJuIGl0ZW07XG4gICAgICAgICB9XG5cbiAgICAgICAgIFNWR1BhdGhTZWdMaXN0LnByb3RvdHlwZS5hcHBlbmRJdGVtID0gZnVuY3Rpb24obmV3SXRlbSkge1xuICAgICAgICAgICAgIHRoaXMuX2NoZWNrUGF0aFN5bmNocm9uaXplZFRvTGlzdCgpO1xuXG4gICAgICAgICAgICAgaWYgKG5ld0l0ZW0uX293bmluZ1BhdGhTZWdMaXN0KSB7XG4gICAgICAgICAgICAgICAgIC8vIFNWRzIgc3BlYyBzYXlzIHRvIG1ha2UgYSBjb3B5LlxuICAgICAgICAgICAgICAgICBuZXdJdGVtID0gbmV3SXRlbS5jbG9uZSgpO1xuICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICB0aGlzLl9saXN0LnB1c2gobmV3SXRlbSk7XG4gICAgICAgICAgICAgbmV3SXRlbS5fb3duaW5nUGF0aFNlZ0xpc3QgPSB0aGlzO1xuICAgICAgICAgICAgIC8vIFRPRE86IE9wdGltaXplIHRoaXMgdG8ganVzdCBhcHBlbmQgdG8gdGhlIGV4aXN0aW5nIGF0dHJpYnV0ZS5cbiAgICAgICAgICAgICB0aGlzLl93cml0ZUxpc3RUb1BhdGgoKTtcbiAgICAgICAgICAgICByZXR1cm4gbmV3SXRlbTtcbiAgICAgICAgIH1cblxuICAgICAgICAgU1ZHUGF0aFNlZ0xpc3QuX3BhdGhTZWdBcnJheUFzU3RyaW5nID0gZnVuY3Rpb24ocGF0aFNlZ0FycmF5KSB7XG4gICAgICAgICAgICAgdmFyIHN0cmluZyA9IFwiXCI7XG4gICAgICAgICAgICAgdmFyIGZpcnN0ID0gdHJ1ZTtcbiAgICAgICAgICAgICBwYXRoU2VnQXJyYXkuZm9yRWFjaChmdW5jdGlvbihwYXRoU2VnKSB7XG4gICAgICAgICAgICAgICAgIGlmIChmaXJzdCkge1xuICAgICAgICAgICAgICAgICAgICAgZmlyc3QgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBwYXRoU2VnLl9hc1BhdGhTdHJpbmcoKTtcbiAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBcIiBcIiArIHBhdGhTZWcuX2FzUGF0aFN0cmluZygpO1xuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgcmV0dXJuIHN0cmluZztcbiAgICAgICAgIH1cblxuICAgICAgICAgLy8gVGhpcyBjbG9zZWx5IGZvbGxvd3MgU1ZHUGF0aFBhcnNlcjo6cGFyc2VQYXRoIGZyb20gU291cmNlL2NvcmUvc3ZnL1NWR1BhdGhQYXJzZXIuY3BwLlxuICAgICAgICAgU1ZHUGF0aFNlZ0xpc3QucHJvdG90eXBlLl9wYXJzZVBhdGggPSBmdW5jdGlvbihzdHJpbmcpIHtcbiAgICAgICAgICAgICBpZiAoIXN0cmluZyB8fCBzdHJpbmcubGVuZ3RoID09IDApXG4gICAgICAgICAgICAgICAgIHJldHVybiBbXTtcblxuICAgICAgICAgICAgIHZhciBvd25pbmdQYXRoU2VnTGlzdCA9IHRoaXM7XG5cbiAgICAgICAgICAgICB2YXIgQnVpbGRlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB0aGlzLnBhdGhTZWdMaXN0ID0gW107XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgQnVpbGRlci5wcm90b3R5cGUuYXBwZW5kU2VnbWVudCA9IGZ1bmN0aW9uKHBhdGhTZWcpIHtcbiAgICAgICAgICAgICAgICAgdGhpcy5wYXRoU2VnTGlzdC5wdXNoKHBhdGhTZWcpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIHZhciBTb3VyY2UgPSBmdW5jdGlvbihzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICAgdGhpcy5fc3RyaW5nID0gc3RyaW5nO1xuICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXggPSAwO1xuICAgICAgICAgICAgICAgICB0aGlzLl9lbmRJbmRleCA9IHRoaXMuX3N0cmluZy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgIHRoaXMuX3ByZXZpb3VzQ29tbWFuZCA9IFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOO1xuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3NraXBPcHRpb25hbFNwYWNlcygpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX2lzQ3VycmVudFNwYWNlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHZhciBjaGFyYWN0ZXIgPSB0aGlzLl9zdHJpbmdbdGhpcy5fY3VycmVudEluZGV4XTtcbiAgICAgICAgICAgICAgICAgcmV0dXJuIGNoYXJhY3RlciA8PSBcIiBcIiAmJiAoY2hhcmFjdGVyID09IFwiIFwiIHx8IGNoYXJhY3RlciA9PSBcIlxcblwiIHx8IGNoYXJhY3RlciA9PSBcIlxcdFwiIHx8IGNoYXJhY3RlciA9PSBcIlxcclwiIHx8IGNoYXJhY3RlciA9PSBcIlxcZlwiKTtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9za2lwT3B0aW9uYWxTcGFjZXMgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX2lzQ3VycmVudFNwYWNlKCkpXG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4O1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3NraXBPcHRpb25hbFNwYWNlc09yRGVsaW1pdGVyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiAhdGhpcy5faXNDdXJyZW50U3BhY2UoKSAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgIT0gXCIsXCIpXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIixcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3NraXBPcHRpb25hbFNwYWNlcygpO1xuICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleDtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLmhhc01vcmVEYXRhID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleDtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLnBlZWtTZWdtZW50VHlwZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB2YXIgbG9va2FoZWFkID0gdGhpcy5fc3RyaW5nW3RoaXMuX2N1cnJlbnRJbmRleF07XG4gICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9wYXRoU2VnVHlwZUZyb21DaGFyKGxvb2thaGVhZCk7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5fcGF0aFNlZ1R5cGVGcm9tQ2hhciA9IGZ1bmN0aW9uKGxvb2thaGVhZCkge1xuICAgICAgICAgICAgICAgICBzd2l0Y2ggKGxvb2thaGVhZCkge1xuICAgICAgICAgICAgICAgICBjYXNlIFwiWlwiOlxuICAgICAgICAgICAgICAgICBjYXNlIFwielwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DTE9TRVBBVEg7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJNXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJtXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJMXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJsXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJDXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fQ1VCSUNfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiY1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlFcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19RVUFEUkFUSUNfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwicVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX1FVQURSQVRJQ19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJBXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0FSQ19BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJhXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0FSQ19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJIXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19IT1JJWk9OVEFMX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcImhcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX0hPUklaT05UQUxfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiVlwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fVkVSVElDQUxfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwidlwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fVkVSVElDQUxfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiU1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX1NNT09USF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJzXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fQ1VCSUNfU01PT1RIX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlRcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19RVUFEUkFUSUNfU01PT1RIX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInRcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19RVUFEUkFUSUNfU01PT1RIX1JFTDtcbiAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTjtcbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX25leHRDb21tYW5kSGVscGVyID0gZnVuY3Rpb24obG9va2FoZWFkLCBwcmV2aW91c0NvbW1hbmQpIHtcbiAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgZm9yIHJlbWFpbmluZyBjb29yZGluYXRlcyBpbiB0aGUgY3VycmVudCBjb21tYW5kLlxuICAgICAgICAgICAgICAgICBpZiAoKGxvb2thaGVhZCA9PSBcIitcIiB8fCBsb29rYWhlYWQgPT0gXCItXCIgfHwgbG9va2FoZWFkID09IFwiLlwiIHx8IChsb29rYWhlYWQgPj0gXCIwXCIgJiYgbG9va2FoZWFkIDw9IFwiOVwiKSkgJiYgcHJldmlvdXNDb21tYW5kICE9IFNWR1BhdGhTZWcuUEFUSFNFR19DTE9TRVBBVEgpIHtcbiAgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2aW91c0NvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19BQlMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fQUJTO1xuICAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZpb3VzQ29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX1JFTClcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19SRUw7XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJldmlvdXNDb21tYW5kO1xuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTjtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLmluaXRpYWxDb21tYW5kSXNNb3ZlVG8gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHBhdGggaXMgZW1wdHkgaXQgaXMgc3RpbGwgdmFsaWQsIHNvIHJldHVybiB0cnVlLlxuICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuaGFzTW9yZURhdGEoKSlcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgICB2YXIgY29tbWFuZCA9IHRoaXMucGVla1NlZ21lbnRUeXBlKCk7XG4gICAgICAgICAgICAgICAgIC8vIFBhdGggbXVzdCBzdGFydCB3aXRoIG1vdmVUby5cbiAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19BQlMgfHwgY29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX1JFTDtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAvLyBQYXJzZSBhIG51bWJlciBmcm9tIGFuIFNWRyBwYXRoLiBUaGlzIHZlcnkgY2xvc2VseSBmb2xsb3dzIGdlbmVyaWNQYXJzZU51bWJlciguLi4pIGZyb20gU291cmNlL2NvcmUvc3ZnL1NWR1BhcnNlclV0aWxpdGllcy5jcHAuXG4gICAgICAgICAgICAgLy8gU3BlYzogaHR0cDovL3d3dy53My5vcmcvVFIvU1ZHMTEvc2luZ2xlLXBhZ2UuaHRtbCNwYXRocy1QYXRoRGF0YUJORlxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3BhcnNlTnVtYmVyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHZhciBleHBvbmVudCA9IDA7XG4gICAgICAgICAgICAgICAgIHZhciBpbnRlZ2VyID0gMDtcbiAgICAgICAgICAgICAgICAgdmFyIGZyYWMgPSAxO1xuICAgICAgICAgICAgICAgICB2YXIgZGVjaW1hbCA9IDA7XG4gICAgICAgICAgICAgICAgIHZhciBzaWduID0gMTtcbiAgICAgICAgICAgICAgICAgdmFyIGV4cHNpZ24gPSAxO1xuXG4gICAgICAgICAgICAgICAgIHZhciBzdGFydEluZGV4ID0gdGhpcy5fY3VycmVudEluZGV4O1xuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3NraXBPcHRpb25hbFNwYWNlcygpO1xuXG4gICAgICAgICAgICAgICAgIC8vIFJlYWQgdGhlIHNpZ24uXG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCIrXCIpXG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiLVwiKSB7XG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgIHNpZ24gPSAtMTtcbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPT0gdGhpcy5fZW5kSW5kZXggfHwgKCh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPCBcIjBcIiB8fCB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPiBcIjlcIikgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpICE9IFwiLlwiKSlcbiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBmaXJzdCBjaGFyYWN0ZXIgb2YgYSBudW1iZXIgbXVzdCBiZSBvbmUgb2YgWzAtOSstLl0uXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuXG4gICAgICAgICAgICAgICAgIC8vIFJlYWQgdGhlIGludGVnZXIgcGFydCwgYnVpbGQgcmlnaHQtdG8tbGVmdC5cbiAgICAgICAgICAgICAgICAgdmFyIHN0YXJ0SW50UGFydEluZGV4ID0gdGhpcy5fY3VycmVudEluZGV4O1xuICAgICAgICAgICAgICAgICB3aGlsZSAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID49IFwiMFwiICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8PSBcIjlcIilcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrOyAvLyBBZHZhbmNlIHRvIGZpcnN0IG5vbi1kaWdpdC5cblxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ICE9IHN0YXJ0SW50UGFydEluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgICB2YXIgc2NhbkludFBhcnRJbmRleCA9IHRoaXMuX2N1cnJlbnRJbmRleCAtIDE7XG4gICAgICAgICAgICAgICAgICAgICB2YXIgbXVsdGlwbGllciA9IDE7XG4gICAgICAgICAgICAgICAgICAgICB3aGlsZSAoc2NhbkludFBhcnRJbmRleCA+PSBzdGFydEludFBhcnRJbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgIGludGVnZXIgKz0gbXVsdGlwbGllciAqICh0aGlzLl9zdHJpbmcuY2hhckF0KHNjYW5JbnRQYXJ0SW5kZXgtLSkgLSBcIjBcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgbXVsdGlwbGllciAqPSAxMDtcbiAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIC8vIFJlYWQgdGhlIGRlY2ltYWxzLlxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhp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FyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcImVcIiB8fCB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCJFXCIpICYmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCArIDEpICE9IFwieFwiICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4ICsgMSkgIT0gXCJtXCIpKSB7XG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcblxuICAgICAgICAgICAgICAgICAgICAgLy8gUmVhZCB0aGUgc2lnbiBvZiB0aGUgZXhwb25lbnQuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiK1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIi1cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgIGV4cHNpZ24gPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgLy8gVGhlcmUgbXVzdCBiZSBhbiBleHBvbmVudC5cbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPj0gdGhpcy5fZW5kSW5kZXggfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDwgXCIwXCIgfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID4gXCI5XCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+PSBcIjBcIiAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPD0gXCI5XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHBvbmVudCAqPSAxMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHBvbmVudCArPSAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIC0gXCIwXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgdmFyIG51bWJlciA9IGludGVnZXIgKyBkZWNpbWFsO1xuICAgICAgICAgICAgICAgICBudW1iZXIgKj0gc2lnbjtcblxuICAgICAgICAgICAgICAgICBpZiAoZXhwb25lbnQpXG4gICAgICAgICAgICAgICAgICAgICBudW1iZXIgKj0gTWF0aC5wb3coMTAsIGV4cHNpZ24gKiBleHBvbmVudCk7XG5cbiAgICAgICAgICAgICAgICAgaWYgKHN0YXJ0SW5kZXggPT0gdGhpcy5fY3VycmVudEluZGV4KVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXNPckRlbGltaXRlcigpO1xuXG4gICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5fcGFyc2VBcmNGbGFnID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPj0gdGhpcy5fZW5kSW5kZXgpXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICB2YXIgZmxhZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICB2YXIgZmxhZ0NoYXIgPSB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCsrKTtcbiAgICAgICAgICAgICAgICAgaWYgKGZsYWdDaGFyID09IFwiMFwiKVxuICAgICAgICAgICAgICAgICAgICAgZmxhZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICBlbHNlIGlmIChmbGFnQ2hhciA9PSBcIjFcIilcbiAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSB0cnVlO1xuICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3NraXBPcHRpb25hbFNwYWNlc09yRGVsaW1pdGVyKCk7XG4gICAgICAgICAgICAgICAgIHJldHVybiBmbGFnO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUucGFyc2VTZWdtZW50ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHZhciBsb29rYWhlYWQgPSB0aGlzLl9zdHJpbmdbdGhpcy5fY3VycmVudEluZGV4XTtcbiAgICAgICAgICAgICAgICAgdmFyIGNvbW1hbmQgPSB0aGlzLl9wYXRoU2VnVHlwZUZyb21DaGFyKGxvb2thaGVhZCk7XG4gICAgICAgICAgICAgICAgIGlmIChjb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOKSB7XG4gICAgICAgICAgICAgICAgICAgICAvLyBQb3NzaWJseSBhbiBpbXBsaWNpdCBjb21tYW5kLiBOb3QgYWxsb3dlZCBpZiB0aGlzIGlzIHRoZSBmaXJzdCBjb21tYW5kLlxuICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3ByZXZpb3VzQ29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTilcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQgPSB0aGlzLl9uZXh0Q29tbWFuZEhlbHBlcihsb29rYWhlYWQsIHRoaXMuX3ByZXZpb3VzQ29tbWFuZCk7XG4gICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTilcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fcHJldmlvdXNDb21tYW5kID0gY29tbWFuZDtcblxuICAgICAgICAgICAgICAgICBzd2l0Y2ggKGNvbW1hbmQpIHtcbiAgICAgICAgICAgICAgICAgY2FzZSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX1JFTDpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU1ZHUGF0aFNlZ01vdmV0b1JlbChvd25pbmdQYXRoU2VnTGlzdCwgdGhpcy5fcGFyc2VOdW1iZXIoKSwgdGhpcy5fcGFyc2VOdW1iZXIoKSk7XG4gICAgICAgICAgICAgICAgIGNhc2UgU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19BQlM6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNWR1BhdGhTZWdNb3ZldG9BYnMob3duaW5nUGF0aFNlZ0xpc3QsIHRoaXMuX3BhcnNlTnVtYmVyKCksIHR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Ll9fY2hhcnRfXyB8fCB7XG4gICAgICAgICAgICAgIHg6IDAsXG4gICAgICAgICAgICAgIHk6IDAsXG4gICAgICAgICAgICAgIGs6IDFcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB6b29tc3RhcnRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSkudHdlZW4oXCJ6b29tOnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgZHggPSBzaXplWzBdLCBkeSA9IHNpemVbMV0sIGN4ID0gY2VudGVyMCA/IGNlbnRlcjBbMF0gOiBkeCAvIDIsIGN5ID0gY2VudGVyMCA/IGNlbnRlcjBbMV0gOiBkeSAvIDIsIGkgPSBkMy5pbnRlcnBvbGF0ZVpvb20oWyAoY3ggLSB2aWV3LngpIC8gdmlldy5rLCAoY3kgLSB2aWV3LnkpIC8gdmlldy5rLCBkeCAvIHZpZXcuayBdLCBbIChjeCAtIHZpZXcxLngpIC8gdmlldzEuaywgKGN5IC0gdmlldzEueSkgLyB2aWV3MS5rLCBkeCAvIHZpZXcxLmsgXSk7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odCkge1xuICAgICAgICAgICAgICB2YXIgbCA9IGkodCksIGsgPSBkeCAvIGxbMl07XG4gICAgICAgICAgICAgIHRoaXMuX19jaGFydF9fID0gdmlldyA9IHtcbiAgICAgICAgICAgICAgICB4OiBjeCAtIGxbMF0gKiBrLFxuICAgICAgICAgICAgICAgIHk6IGN5IC0gbFsxXSAqIGssXG4gICAgICAgICAgICAgICAgazoga1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB6b29tZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KS5lYWNoKFwiaW50ZXJydXB0Lnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pLmVhY2goXCJlbmQuem9vbVwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGhpcy5fX2NoYXJ0X18gPSB2aWV3O1xuICAgICAgICAgIHpvb21zdGFydGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB6b29tZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgIH07XG4gICAgem9vbS50cmFuc2xhdGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIHZpZXcueCwgdmlldy55IF07XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiArX1swXSxcbiAgICAgICAgeTogK19bMV0sXG4gICAgICAgIGs6IHZpZXcua1xuICAgICAgfTtcbiAgICAgIHJlc2NhbGUoKTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5zY2FsZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHZpZXcuaztcbiAgICAgIHZpZXcgPSB7XG4gICAgICAgIHg6IHZpZXcueCxcbiAgICAgICAgeTogdmlldy55LFxuICAgICAgICBrOiBudWxsXG4gICAgICB9O1xuICAgICAgc2NhbGVUbygrXyk7XG4gICAgICByZXNjYWxlKCk7XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2NhbGVFeHRlbnQgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzY2FsZUV4dGVudDtcbiAgICAgIHNjYWxlRXh0ZW50ID0gXyA9PSBudWxsID8gZDNfYmVoYXZpb3Jfem9vbUluZmluaXR5IDogWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5jZW50ZXIgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjZW50ZXI7XG4gICAgICBjZW50ZXIgPSBfICYmIFsgK19bMF0sICtfWzFdIF07XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2l6ZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNpemU7XG4gICAgICBzaXplID0gXyAmJiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLmR1cmF0aW9uID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZHVyYXRpb247XG4gICAgICBkdXJhdGlvbiA9ICtfO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnggPSBmdW5jdGlvbih6KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4MTtcbiAgICAgIHgxID0gejtcbiAgICAgIHgwID0gei5jb3B5KCk7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiAwLFxuICAgICAgICB5OiAwLFxuICAgICAgICBrOiAxXG4gICAgICB9O1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnkgPSBmdW5jdGlvbih6KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5MTtcbiAgICAgIHkxID0gejtcbiAgICAgIHkwID0gei5jb3B5KCk7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiAwLFxuICAgICAgICB5OiAwLFxuICAgICAgICBrOiAxXG4gICAgICB9O1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICBmdW5jdGlv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HZhciBpID0gajtcbiAgICAgICAgICB3aGlsZSAoaSsrIDwgTikge1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpKSA9PT0gMzQpIHtcbiAgICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpICsgMSkgIT09IDM0KSBicmVhaztcbiAgICAgICAgICAgICAgKytpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBJID0gaSArIDI7XG4gICAgICAgICAgdmFyIGMgPSB0ZXh0LmNoYXJDb2RlQXQoaSArIDEpO1xuICAgICAgICAgIGlmIChjID09PSAxMykge1xuICAgICAgICAgICAgZW9sID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaSArIDIpID09PSAxMCkgKytJO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYyA9PT0gMTApIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGogKyAxLCBpKS5yZXBsYWNlKC9cIlwiL2csICdcIicpO1xuICAgICAgICB9XG4gICAgICAgIHdoaWxlIChJIDwgTikge1xuICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KEkrKyksIGsgPSAxO1xuICAgICAgICAgIGlmIChjID09PSAxMCkgZW9sID0gdHJ1ZTsgZWxzZSBpZiAoYyA9PT0gMTMpIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KEkpID09PSAxMCkgKytJLCArK2s7XG4gICAgICAgICAgfSBlbHNlIGlmIChjICE9PSBkZWxpbWl0ZXJDb2RlKSBjb250aW51ZTtcbiAgICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqLCBJIC0gayk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRleHQuc2xpY2Uoaik7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKHQgPSB0b2tlbigpKSAhPT0gRU9GKSB7XG4gICAgICAgIHZhciBhID0gW107XG4gICAgICAgIHdoaWxlICh0ICE9PSBFT0wgJiYgdCAhPT0gRU9GKSB7XG4gICAgICAgICAgYS5wdXNoKHQpO1xuICAgICAgICAgIHQgPSB0b2tlbigpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmICYmIChhID0gZihhLCBuKyspKSA9PSBudWxsKSBjb250aW51ZTtcbiAgICAgICAgcm93cy5wdXNoKGEpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHJvd3M7XG4gICAgfTtcbiAgICBkc3YuZm9ybWF0ID0gZnVuY3Rpb24ocm93cykge1xuICAgICAgaWYgKEFycmF5LmlzQXJyYXkocm93c1swXSkpIHJldHVybiBkc3YuZm9ybWF0Um93cyhyb3dzKTtcbiAgICAgIHZhciBmaWVsZFNldCA9IG5ldyBkM19TZXQoKSwgZmllbGRzID0gW107XG4gICAgICByb3dzLmZvckVhY2goZnVuY3Rpb24ocm93KSB7XG4gICAgICAgIGZvciAodmFyIGZpZWxkIGluIHJvdykge1xuICAgICAgICAgIGlmICghZmllbGRTZXQuaGFzKGZpZWxkKSkge1xuICAgICAgICAgICAgZmllbGRzLnB1c2goZmllbGRTZXQuYWRkKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIHJldHVybiBbIGZpZWxkcy5tYXAoZm9ybWF0VmFsdWUpLmpvaW4oZGVsaW1pdGVyKSBdLmNvbmNhdChyb3dzLm1hcChmdW5jdGlvbihyb3cpIHtcbiAgICAgICAgcmV0dXJuIGZpZWxkcy5tYXAoZnVuY3Rpb24oZmllbGQpIHtcbiAgICAgICAgICByZXR1cm4gZm9ybWF0VmFsdWUocm93W2ZpZWxkXSk7XG4gICAgICAgIH0pLmpvaW4oZGVsaW1pdGVyKTtcbiAgICAgIH0pKS5qb2luKFwiXFxuXCIpO1xuICAgIH07XG4gICAgZHN2LmZvcm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W5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldERhdGUoKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgZTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXREYXRlKCksIHAsIDIpO1xuICAgICAgfSxcbiAgICAgIEg6IGZ1bmN0aW9uKGQsIHApIHtcbiAgICAgICAgcmV0dXJuIGQzX3RpbWVfZm9ybWF0UGFkKGQuZ2V0SG91cnMoKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgSTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRIb3VycygpICUgMTIgfHwgMTIsIHAsIDIpO1xuICAgICAgfSxcbiAgICAgIGo6IGZ1bmN0aW9uKGQsIHApIHtcbiAgICAgICAgcmV0dXJuIGQzX3RpbWVfZm9ybWF0UGFkKDEgKyBkM190aW1lLmRheU9mWWVhcihkKSwgcCwgMyk7XG4gICAgICB9LFxuICAgICAgTDogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRNaWxsaXNlY29uZHMoKSwgcCwgMyk7XG4gICAgICB9LFxuICAgICAgbTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRNb250aCgpICsgMSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgTTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRNaW51dGVzKCksIHAsIDIpO1xuICAgICAgfSxcbiAgICAgIHA6IGZ1bmN0aW9uKGQpIHtcbiAgICAgICAgcmV0dXJuIGxvY2FsZV9wZXJpb2RzWysoZC5nZXRIb3VycygpID49IDEyKV07XG4gICAgICB9L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PiAwID8gMSA6IC0xLCDOu2kgPSBpbmZsZWN0aW9uWzBdICogZDNfZGVncmVlcyAqIHMsIGFudGltZXJpZGlhbiA9IGFicyhkzrspID4gMTgwO1xuICAgICAgICBpZiAoYW50aW1lcmlkaWFuIF4gKHMgKiDOu18gPCDOu2kgJiYgzrtpIDwgcyAqIM67KSkge1xuICAgICAgICAgIHZhciDPhmkgPSBpbmZsZWN0aW9uWzFdICogZDNfZGVncmVlcztcbiAgICAgICAgICBpZiAoz4ZpID4gz4YxKSDPhjEgPSDPhmk7XG4gICAgICAgIH0gZWxzZSBpZiAozrtpID0gKM67aSArIDM2MCkgJSAzNjAgLSAxODAsIGFudGltZXJpZGlhbiBeIChzICogzrtfIDwgzrtpICYmIM67aSA8IHMgKiDOuykpIHtcbiAgICAgICAgICB2YXIgz4ZpID0gLWluZmxlY3Rpb25bMV0gKiBkM19kZWdyZWVzO1xuICAgICAgICAgIGlmICjPhmkgPCDPhjApIM+GMCA9IM+GaTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoz4YgPCDPhjApIM+GMCA9IM+GO1xuICAgICAgICAgIGlmICjPhiA+IM+GMSkgz4YxID0gz4Y7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFudGltZXJpZGlhbikge1xuICAgICAgICAgIGlmICjOuyA8IM67Xykge1xuICAgICAgICAgICAgaWYgKGFuZ2xlKM67MCwgzrspID4gYW5nbGUozrswLCDOuzEpKSDOuzEgPSDOuztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGFuZ2xlKM67LCDOuzEpID4gYW5nbGUozrswLCDOuzEpKSDOuzAgPSDOuztcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKM67MSA+PSDOuzApIHtcbiAgICAgICAgICAgIGlmICjOuyA8IM67MCkgzrswID0gzrs7XG4gICAgICAgICAgICBpZiAozrsgPiDOuzEpIM67MSA9IM67O1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAozrsgPiDOu18pIHtcbiAgICAgICAgICAgICAgaWYgKGFuZ2xlKM67MCwgzrspID4gYW5nbGUozrswLCDOuzEpKSDOuzEgPSDOuztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChhbmdsZSjOuywgzrsxKSA+IGFuZ2xlKM67MCwgzrsxKSkgzrswID0gzrs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBwb2ludCjOuywgz4YpO1xuICAgICAgfVxuICAgICAgcDAgPSBwLCDOu18gPSDOuztcbiAgICB9XG4gICAgZnVuY3Rpb24gbGluZVN0YXJ0KCkge1xuICAgICAgYm91bmQucG9pbnQgPSBsaW5lUG9pbnQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGxpbmVFbmQoKSB7XG4gICAgICByYW5nZVswXSA9IM67MCwgcmFuZ2VbMV0gPSDOuzE7XG4gICAgICBib3VuZC5wb2ludCA9IHBvaW50O1xuICAgICAgcDAgPSBudWxsO1xuICAgIH1cbiAgICBmdW5jdGlvbiByaW5nUG9pbnQozrssIM+GKSB7XG4gICAgICBpZiAocDApIHtcbiAgICAgICAgdmFyIGTOuyA9IM67IC0gzrtfO1xuICAgICAgICBkzrtTdW0gKz0gYWJzKGTOuykgPiAxODAgPyBkzrsgKyAoZM67ID4gMCA/IDM2MCA6IC0zNjApIDogZM67O1xuICAgICAgfSBlbHNlIM67X18gPSDOuywgz4ZfXyA9IM+GO1xuICAgICAgZDNfZ2VvX2FyZWEucG9pbnQozrssIM+GKTtcbiAgICAgIGxpbmVQb2ludCjOuywgz4YpO1xuICAgIH1cbiAgICBmdW5jdGlvbiByaW5nU3RhcnQoKSB7XG4gICAgICBkM19nZW9fYXJlYS5saW5lU3RhcnQoKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmluZ0VuZCgpIHtcbiAgICAgIHJpb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1xuICAgICAgICAgIGlmIChpc1N1YmplY3QpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBuID0gcG9pbnRzLmxlbmd0aDsgaSA8IG47ICsraSkgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gcG9pbnRzW2ldKVswXSwgcG9pbnRbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpbnRlcnBvbGF0ZShjdXJyZW50LngsIGN1cnJlbnQubi54LCAxLCBsaXN0ZW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm47XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGlzU3ViamVjdCkge1xuICAgICAgICAgICAgcG9pbnRzID0gY3VycmVudC5wLno7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gcG9pbnRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSBsaXN0ZW5lci5wb2ludCgocG9pbnQgPSBwb2ludHNbaV0pWzBdLCBwb2ludFsxXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGludGVycG9sYXRlKGN1cnJlbnQueCwgY3VycmVudC5wLngsIC0xLCBsaXN0ZW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50LnA7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubztcbiAgICAgICAgcG9pbnRzID0gY3VycmVudC56O1xuICAgICAgICBpc1N1YmplY3QgPSAhaXNTdWJqZWN0O1xuICAgICAgfSB3aGlsZSAoIWN1cnJlbnQudik7XG4gICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19jbGlwUG9seWdvbkxpbmtDaXJjdWxhcihhcnJheSkge1xuICAgIGlmICghKG4gPSBhcnJheS5sZW5ndGgpKSByZXR1cm47XG4gICAgdmFyIG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3RlbmVyLnBvbHlnb25FbmQoKSwgcG9seWdvblN0YXJ0ZWQgPSBmYWxzZTtcbiAgICAgICAgICBzZWdtZW50cyA9IHBvbHlnb24gPSBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBzcGhlcmU6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25TdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGludGVycG9sYXRlKG51bGwsIG51bGwsIDEsIGxpc3RlbmVyKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9seWdvbkVuZCgpO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24gcG9pbnQozrssIM+GKSB7XG4gICAgICAgIHZhciBwb2ludCA9IHJvdGF0ZSjOuywgz4YpO1xuICAgICAgICBpZiAocG9pbnRWaXNpYmxlKM67ID0gcG9pbnRbMF0sIM+GID0gcG9pbnRbMV0pKSBsaXN0ZW5lci5wb2ludCjOuywgz4YpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcG9pbnRMaW5lKM67LCDPhikge1xuICAgICAgICB2YXIgcG9pbnQgPSByb3RhdGUozrssIM+GKTtcbiAgICAgICAgbGluZS5wb2ludChwb2ludFswXSwgcG9pbnRbMV0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZVN0YXJ0KCkge1xuICAgICAgICBjbGlwLnBvaW50ID0gcG9pbnRMaW5lO1xuICAgICAgICBsaW5lLmxpbmVTdGFydCgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZUVuZCgpIHtcbiAgICAgICAgY2xpcC5wb2ludCA9IHBvaW50O1xuICAgICAgICBsaW5lLmxpbmVFbmQoKTtcbiAgICAgIH1cbiAgICAgIHZhciBzZWdtZW50cztcbiAgICAgIHZhciBidWZmZXIgPSBkM19nZW9fY2xpcEJ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yjOuzEgLSDOuzApO1xuICAgICAgICBpZiAoYWJzKGTOuyAtIM+AKSA8IM61KSB7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQozrswLCDPhjAgPSAoz4YwICsgz4YxKSAvIDIgPiAwID8gaGFsZs+AIDogLWhhbGbPgCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MCwgz4YwKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MSwgz4YwKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludCjOuzEsIM+GMCk7XG4gICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICB9IGVsc2UgaWYgKHPOuzAgIT09IHPOuzEgJiYgZM67ID49IM+AKSB7XG4gICAgICAgICAgaWYgKGFicyjOuzAgLSBzzrswKSA8IM61KSDOuzAgLT0gc867MCAqIM61O1xuICAgICAgICAgIGlmIChhYnMozrsxIC0gc867MSkgPCDOtSkgzrsxIC09IHPOuzEgKiDOtTtcbiAgICAgICAgICDPhjAgPSBkM19nZW9fY2xpcEFudGltZXJpZGlhbkludGVyc2VjdCjOuzAsIM+GMCwgzrsxLCDPhjEpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzAsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzEsIM+GMCk7XG4gICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICB9XG4gICAgICAgIGxpc3RlbmVyLnBvaW50KM67MCA9IM67MSwgz4YwID0gz4YxKTtcbiAgICAgICAgc867MCA9IHPOuzE7XG4gICAgICB9LFxuICAgICAgbGluZUVuZDogZnVuY3Rpb24oKSB7XG4gICAgICAgIGxpc3Rlbm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jdGlvbiBjbGlwTGluZShsaXN0ZW5lcikge1xuICAgICAgdmFyIHBvaW50MCwgYzAsIHYwLCB2MDAsIGNsZWFuO1xuICAgICAgcmV0dXJuIHtcbiAgICAgICAgbGluZVN0YXJ0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICB2MDAgPSB2MCA9IGZhbHNlO1xuICAgICAgICAgIGNsZWFuID0gMTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9pbnQ6IGZ1bmN0aW9uKM67LCDPhikge1xuICAgICAgICAgIHZhciBwb2ludDEgPSBbIM67LCDPhiBdLCBwb2ludDIsIHYgPSB2aXNpYmxlKM67LCDPhiksIGMgPSBzbWFsbFJhZGl1cyA/IHYgPyAwIDogY29kZSjOuywgz4YpIDogdiA/IGNvZGUozrsgKyAozrsgPCAwID8gz4AgOiAtz4ApLCDPhikgOiAwO1xuICAgICAgICAgIGlmICghcG9pbnQwICYmICh2MDAgPSB2MCA9IHYpKSBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICBpZiAoZDNfZ2VvX3NwaGVyaWNhbEVxdWFsKHBvaW50MCwgcG9pbnQyKSB8fCBkM19nZW9fc3BoZXJpY2FsRXF1YWwocG9pbnQxLCBwb2ludDIpKSB7XG4gICAgICAgICAgICAgIHBvaW50MVswXSArPSDOtTtcbiAgICAgICAgICAgICAgcG9pbnQxWzFdICs9IM61O1xuICAgICAgICAgICAgICB2ID0gdmlzaWJsZShwb2ludDFbMF0sIHBvaW50MVsxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcG9pbnQwID0gcG9pbnQyO1xuICAgICAgICAgIH0gZWxzZSBpZiAobm90SGVtaXNwaGVyZSAmJiBwb2ludDAgJiYgc21hbGxSYWRpdXMgXiB2KSB7XG4gICAgICAgICAgICB2YXIgdDtcbiAgICAgICAgICAgIGlmICghKGMgJiBjMCkgJiYgKHQgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDAsIHRydWUpKSkge1xuICAgICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICAgIGlmIChzbWFsbFJhZGl1cykge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMV1bMF0sIHRbMV1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgIC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biAgICAgIH0gZWxzZSBpZiAoZHggPiAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfVxuICAgICAgciA9IHgxIC0gYXg7XG4gICAgICBpZiAoIWR4ICYmIHIgPCAwKSByZXR1cm47XG4gICAgICByIC89IGR4O1xuICAgICAgaWYgKGR4IDwgMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHggPiAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfVxuICAgICAgciA9IHkwIC0gYXk7XG4gICAgICBpZiAoIWR5ICYmIHIgPiAwKSByZXR1cm47XG4gICAgICByIC89IGR5O1xuICAgICAgaWYgKGR5IDwgMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHkgPiAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfVxuICAgICAgciA9IHkxIC0gYXk7XG4gICAgICBpZiAoIWR5ICYmIHIgPCAwKSByZXR1cm47XG4gICAgICByIC89IGR5O1xuICAgICAgaWYgKGR5IDwgMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHkgPiAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfVxuICAgICAgaWYgKHQwID4gMCkgbGluZS5hID0ge1xuICAgICAgICB4OiBheCArIHQ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RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBpbnRlcnBvbGF0ZShudWxsLCBudWxsLCAxLCBsaXN0ZW5lcik7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh2aXNpYmxlKSB7XG4gICAgICAgICAgICAgIGQzX2dlb19jbGlwUG9seWdvbihzZWdtZW50cywgY29tcGFyZSwgY2xpcFN0YXJ0SW5zaWRlLCBpbnRlcnBvbGF0ZSwgbGlzdGVuZXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGlzdGVuZXIucG9seWdvbkVuZCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBzZWdtZW50cyA9IHBvbHlnb24gPSByaW5nID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIGZ1bmN0aW9uIGluc2lkZVBvbHlnb24ocCkge1xuICAgICAgICB2YXIgd24gPSAwLCBuID0gcG9seWdvbi5sZW5ndGgsIHkgPSBwWzFdO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIGZvciAodmFyIGogPSAxLCB2ID0gcG9seWdvbltpXSwgbSA9IHYubGVuZ3RoLCBhID0gdlswXSwgYjsgaiA8IG07ICsraikge1xuICAgICAgICAgICAgYiA9IHZbal07XG4gICAgICAgICAgICBpZiAoYVsxXSA8PSB5KSB7XG4gICAgICAgICAgICAgIGlmIChiWzFdID4geSAmJiBkM19jcm9zczJkKGEsIGIsIHApID4gMCkgKyt3bjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChiWzFdIDw9IHkgJiYgZDNfY3Jvc3MyZChhLCBiLCBwKSA8IDApIC0td247XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHduICE9PSAwO1x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mJiB2XykgbGlzdGVuZXIucG9pbnQoeCwgeSk7IGVsc2Uge1xuICAgICAgICAgICAgdmFyIGwgPSB7XG4gICAgICAgICAgICAgIGE6IHtcbiAgICAgICAgICAgICAgICB4OiB4XyxcbiAgICAgICAgICAgICAgICB5OiB5X1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBiOiB7XG4gICAgICAgICAgICAgICAgeDogeCxcbiAgICAgICAgICAgICAgICB5OiB5XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoY2xpcExpbmUobCkpIHtcbiAgICAgICAgICAgICAgaWYgKCF2Xykge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KGwuYS54LCBsLmEueSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQobC5iLngsIGwuYi55KTtcbiAgICAgICAgICAgICAgaWYgKCF2KSBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHgsIHkpO1xuICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB4XyA9IHgsIHlfID0geSwgdl8gPSB2O1xuICAgICAgfVxuICAgICAgcmV0dXJuIGNsaXA7XG4gICAgfTtcbiAgICBmdW5jdGlvbiBjb3JuZXIocCwgZGlyZWN0aW9uKSB7XG4gICAgICByZXR1cm4gYWJzKHBbMF0gLSB4MCkgPCDOtSA/IGRpcmVjdGlvbiA+IDAgPyAwIDogMyA6IGFicyhwWzBdIC0geDEpI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TtcbiAgICAgIHggPSArX1swXTtcbiAgICAgIHkgPSArX1sxXTtcbiAgICAgIHJldHVybiByZXNldCgpO1xuICAgIH07XG4gICAgcHJvamVjdGlvbi5jZW50ZXIgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIM67ICogZDNfZGVncmVlcywgz4YgKiBkM19kZWdyZWVzIF07XG4gICAgICDOuyA9IF9bMF0gJSAzNjAgKiBkM19yYWRpYW5zO1xuICAgICAgz4YgPSBfWzFdICUgMzYwICogZDNfcmFkaWFucztcbiAgICAgIHJldHVybiByZXNldCgpO1xuICAgIH07XG4gICAgcHJvamVjdGlvbi5yb3RhdGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIM60zrsgKiBkM19kZWdyZWVzLCDOtM+GICogZDNfZGVncmVlcywgzrTOsyAqIGQzX2RlZ3JlZXMgXTtcbiAgICAgIM60zrsgPSBfWzBdICUgMzYwICogZDNfcmFkaWFucztcbiAgICAgIM60z4YgPSBfWzFdICUgMzYwICogZDNfcmFkaWFucztcbiAgICAgIM60zrMgPSBfLmxlbmd0aCA+IDIgPyBfWzJdICUgMzYwICogZDNfcmFkaWFucyA6IDA7XG4gICAgICByZXR1cm4gcmVzZXQoKTtcbiAgICB9O1xuICAgIGQzLnJlYmluZChwcm9qZWN0aW9uLCBwcm9qZWN0UmVzYW1wbGUsIFwicHJlY2lzaW9uXCIpO1xuICAgIGZ1bmN0aW9uIHJlc2V0KCkge1xuICAgICAgcHJvamVjdFJvdGF0ZSA9IGQzX2dlb19jb21wb3NlKHJvdGF0ZSA9IGQzX2dlb19yb3RhdGlvbijOtM67LCDOtM+GLCDOtM6zKSwgcHJvamVjdCk7XG4gICAgICB2YXIgY2VudGVyID0gcHJvamVjdCjOuywgz4YpO1xuICAgICAgzrR4ID0geCAtIGNlbnRlclswXSAqIGs7XG4gICAgICDOt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ijPhiAqPSBkM19yYWRpYW5zKSwgY29zz4YgPSBNYXRoLmNvcyjPhiksIHQgPSBhYnMoKM67ICo9IGQzX3JhZGlhbnMpIC0gzrswKSwgY29zzpTOuyA9IE1hdGguY29zKHQpO1xuICAgICAgZDNfZ2VvX2xlbmd0aFN1bSArPSBNYXRoLmF0YW4yKE1hdGguc3FydCgodCA9IGNvc8+GICogTWF0aC5zaW4odCkpICogdCArICh0ID0gY29zz4YwICogc2luz4YgLSBzaW7PhjAgKiBjb3PPhiAqIGNvc86UzrspICogdCksIHNpbs+GMCAqIHNpbs+GICsgY29zz4YwICogY29zz4YgKiBjb3POlM67KTtcbiAgICAgIM67MCA9IM67LCBzaW7PhjAgPSBzaW7PhiwgY29zz4YwID0gY29zz4Y7XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19hemltdXRoYWwoc2NhbGUsIGFuZ2xlKSB7XG4gICAgZnVuY3Rpb24gYXppbXV0aGFsKM67LCDPhikge1xuICAgICAgdmFyIGNvc867ID0gTWF0aC5jb3MozrspLCBjb3PPhiA9IE1hdGguY29zKM+GKSwgayA9IHNjYWxlKGNvc867ICogY29zz4YpO1xuICAgICAgcmV0dXJuIFsgayAqIGNvc8+GICogTWF0aC5zaW4ozrspLCBrICogTWF0aC5zaW4oz4YpIF07XG4gICAgfVxuICAgIGF6aW11dGhhbC5pbnZlcnQgPSBmdW5jdGlvbih4LCB5KSB7XG4gICAgICB2YXIgz4EgPSBNYXRoLnNxcnQoeCAqIHggKyB5ICogeSksIGMgPSBhbmdsZSjPgSksIHNpbmMgPSBNYXRoLnNpbihjKSwgY29zYyA9IE1hdGguY29zKGMpO1xuICAgICAgcmV0dXJuIFsgTWF0aC5hdGFuMih4ICogc2luYywgz4EgKiBjb3NjKSwgTWF0aC5hc2luKM+BICYmIHkgKiBzaW5jIC8gz4EpIF07XG4gICAgfTtcbiAgICByZXR1cm4gYXppbXV0aGFsO1xuICB9XG4gIHZhciBkM19nZW9fYXppbXV0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ICAgICB9XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb21fdm9yb25vaUNvbm5lY3RFZGdlKGVkZ2UsIGV4dGVudCkge1xuICAgIHZhciB2YiA9IGVkZ2UuYjtcbiAgICBpZiAodmIpIHJldHVybiB0cnVlO1xuICAgIHZhciB2YSA9IGVkZ2UuYSwgeDAgPSBleHRlbnRbMF1bMF0sIHgxID0gZXh0ZW50WzFdWzBdLCB5MCA9IGV4dGVudFswXVsxXSwgeTEgPSBleHRlbnRbMV1bMV0sIGxTaXRlID0gZWRnZS5sLCByU2l0ZSA9IGVkZ2UuciwgbHggPSBsU2l0ZS54LCBseSA9IGxTaXRlLnksIHJ4ID0gclNpdGUueCwgcnkgPSByU2l0ZS55LCBmeCA9IChseCArIHJ4KSAvIDIsIGZ5ID0gKGx5ICsgcnkpIC8gMiwgZm0sIGZiO1xuICAgIGlmIChyeSA9PT0gbHkpIHtcbiAgICAgIGlmIChmeCA8IHgwIHx8IGZ4ID49IHgxKSByZXR1cm47XG4gICAgICBpZiAobHggPiByeCkge1xuICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICB4OiBmeCxcbiAgICAgICAgICB5OiB5MFxuICAgICAgICB9OyBlbHNlIGlmICh2YS55ID49IHkxKSByZXR1cm47XG4gICAgICAgIHZiID0ge1xuICAgICAgICAgIHg6IGZ4LFxuICAgICAgICAgIHk6IHkxXG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICB4OiBmeCxcbiAgICAgICAgICB5OiB5MVxuICAgICAgICB9OyBlbHNlIGlmICh2YS55IDwgeTApIHJldHVybjtcbiAgICAgICAgdmIgPSB7XG4gICAgICAgICAgeDogZngsXG4gICAgICAgICAgeTogeTBcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZm0gPSAobHggLSByeCkgLyAocnkgLSBseSk7XG4gICAgICBmYiA9IGZ5IC0gZm0gKiBmeDtcbiAgICAgIGlmIChmbSA8IC0xIHx8IGZtID4gMSkge1xuICAgICAgICBpZiAobHggPiByeCkge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogKHkwIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MFxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPj0geTEpIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6ICh5MSAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTFcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogKHkxIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MVxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPCB5MCkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogKHkwIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MFxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChseSA8IHJ5KSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiB4MCxcbiAgICAgICAgICAgIHk6IGZtICogeDAgKyBmYlxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnggPj0geDEpIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6IHgxLFxuICAgICAgICAgICAgeTogZm0gKiB4MSArIGZiXG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6IHgxLFxuICAgICAgICAgICAgeTogZm0gKiB4MSArIGZiXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueCA8IHgw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vbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICAgIGFmdGVyID0gcGFyZW50O1xuICAgICAgICAgICAgICBwYXJlbnQgPSBhZnRlci5VO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGFyZW50LkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIGdyYW5kcGEpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB1bmNsZSA9IGdyYW5kcGEuTDtcbiAgICAgICAgICBpZiAodW5jbGUgJiYgdW5jbGUuQykge1xuICAgICAgICAgICAgcGFyZW50LkMgPSB1bmNsZS5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgYWZ0ZXIgPSBncmFuZHBhO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoYWZ0ZXIgPT09IHBhcmVudC5MKSB7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgICAgYWZ0ZXIgPSBwYXJlbnQ7XG4gICAgICAgICAgICAgIHBhcmVudCA9IGFmdGVyLlU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwYXJlbnQuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZ3JhbmRwYS5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBncmFuZHBhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcGFyZW50ID0gYWZ0ZXIuVTtcbiAgICAgIH1cbiAgICAgIHRoaXMuXy5DID0g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IG5leHQuVSA9IHBhcmVudDtcbiAgICAgICAgICBwYXJlbnQgPSBuZXh0O1xuICAgICAgICAgIG5vZGUgPSBuZXh0LlI7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJlZCA9IG5vZGUuQztcbiAgICAgICAgbm9kZSA9IG5leHQ7XG4gICAgICB9XG4gICAgICBpZiAobm9kZSkgbm9kZS5VID0gcGFyZW50O1xuICAgICAgaWYgKHJlZCkgcmV0dXJuO1xuICAgICAgaWYgKG5vZGUgJiYgbm9kZS5DKSB7XG4gICAgICAgIG5vZGUuQyA9IGZhbHNlO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBkbyB7XG4gICAgICAgIGlmIChub2RlID09PSB0aGlzLl8pIGJyZWFrO1xuICAgICAgICBpZiAobm9kZSA9PT0gcGFyZW50LkwpIHtcbiAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgaWYgKHNpYmxpbmcuQykge1xuICAgICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNpYmxpbmcuTCAmJiBzaWJsaW5nLkwuQyB8fCBzaWJsaW5nLlIgJiYgc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgIGlmICghc2libGluZy5SIHx8ICFzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgICBzaWJsaW5nLkwuQyA9IGZhbHNlO1xuICAgICAgICAgICAgICBzaWJsaW5nLkMgPSB0cnVlO1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHNpYmxpbmcpO1xuICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBwYXJlbnQuQztcbiAgICAgICAgICAgIHBhcmVudC5DID0gc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgbm9kZSA9IHRoaXMuXztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgaWYgKHNpYmxpbmcuQykge1xuICAgICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzaWJsaW5nLkwgJiYgc2libGluZy5MLkMgfHwgc2libGluZy5SICYmIHNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICBpZiAoIXNpYmxpbmcuTCB8fCAhc2libGluZy5MLkMpIHtcbiAgICAgICAgICAgICAgc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHNpYmxpbmcpO1xuICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBwYXJlbnQuQztcbiAgICAgICAgICAgIHBhcmVudC5DID0gc2libGlu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Rvcih5KSwgeHMsIHlzLCBpLCBuLCB4MV8sIHkxXywgeDJfLCB5Ml87XG4gICAgICBpZiAoeDEgIT0gbnVsbCkge1xuICAgICAgICB4MV8gPSB4MSwgeTFfID0geTEsIHgyXyA9IHgyLCB5Ml8gPSB5MjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHgyXyA9IHkyXyA9IC0oeDFfID0geTFfID0gSW5maW5pdHkpO1xuICAgICAgICB4cyA9IFtdLCB5cyA9IFtdO1xuICAgICAgICBuID0gZGF0YS5sZW5ndGg7XG4gICAgICAgIGlmIChjb21wYXQpIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICBkID0gZGF0YVtpXTtcbiAgICAgICAgICBpZiAoZC54IDwgeDFfKSB4MV8gPSBkLng7XG4gICAgICAgICAgaWYgKGQueSA8IHkxXykgeTFfID0gZC55O1xuICAgICAgICAgIGlmIChkLnggPiB4Ml8pIHgyXyA9IGQueDtcbiAgICAgICAgICBpZiAoZC55ID4geTJfKSB5Ml8gPSBkLnk7XG4gICAgICAgICAgeHMucHVzaChkLngpO1xuICAgICAgICAgIHlzLnB1c2goZC55KTtcbiAgICAgICAgfSBlbHNlIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICB2YXIgeF8gPSArZngoZCA9IGRhdGFbaV0sIGkpLCB5XyA9ICtmeShkLCBpKTtcbiAgICAgICAgICBpZiAoeF8gPCB4MV8pIHgxXyA9IHhfO1xuICAgICAgICAgIGlmICh5XyA8IHkxXykgeTFfID0geV87XG4gICAgICAgICAgaWYgKHhfID4geDJfKSB4Ml8gPSB4XztcbiAgICAgICAgICBpZiAoeV8gPiB5Ml8pIHkyXyA9IHlfO1xuICAgICAgICAgIHhzLnB1c2goeF8pO1xuICAgICAgICAgIHlzLnB1c2goeV8pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB2YXIgZHggPSB4Ml8gLSB4MV8sIGR5ID0geTJfIC0geTFfO1x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XJwb2xhdGVfbnVtYmVyQi5leGVjKGIpKSkge1xuICAgICAgaWYgKChicyA9IGJtLmluZGV4KSA+IGJpKSB7XG4gICAgICAgIGJzID0gYi5zbGljZShiaSwgYnMpO1xuICAgICAgICBpZiAoc1tpXSkgc1tpXSArPSBiczsgZWxzZSBzWysraV0gPSBicztcbiAgICAgIH1cbiAgICAgIGlmICgoYW0gPSBhbVswXSkgPT09IChibSA9IGJtWzBdKSkge1xuICAgICAgICBpZiAoc1tpXSkgc1tpXSArPSBibTsgZWxzZSBzWysraV0gPSBibTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHNbKytpXSA9IG51bGw7XG4gICAgICAgIHEucHVzaCh7XG4gICAgICAgICAgaTogaSxcbiAgICAgICAgICB4OiBkM19pbnRlcnBvbGF0ZU51bWJlcihhbSwgYm0pXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgYmkgPSBkM19pbnRlcnBvbGF0ZV9udW1iZXJCLmxhc3RJbmRleDtcbiAgICB9XG4gICAgaWYgKGJpIDwgYi5sZW5ndGgpIHtcbiAgICAgIGJzID0gYi5zbGljZShiaSk7XG4gICAgICBpZiAoc1tpXSkgc1tpXSArPSBiczsgZWxzZSBzWysraV0gPSBicztcbiAgICB9XG4gICAgcmV0dXJuIHMubGVuZ3RoIDwgMiA/IHFbMF0gPyAoYiA9IHFbMF0ueCwgZnVuY3Rpb24odCkge1xuICAgICAgcmV0dXJuIGIodCkgKyBcIlwiO1xuICAgIH0pIDogZnVuY3Rpb24oKSB7XG4gICAgICByZXR1cm4gYjtcbiAgICB9IDogKGIgPSBxLmxlbmd0aCwgZnVuY3Rpb24odCkge1xuICAgICAgZm9yICh2YXIgaSA9IDAsIG87IGkgPCBiOyArK2kpIHNbKG8gPSBxW2ldKS5pXSA9IG8ueCh0KTtcbiAgICAgIHJldHVybiBzLmpvaW4oXCJcIik7XG4gICAgfSk7XG4gIH1cbiAgdmFyIGQzX2ludGVycG9sYXRlX251bWJlckEgPSAv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VhY2goZnVuY3Rpb24oZCwgaSkge1xuICAgICAgICAgIGQuc29ydChmdW5jdGlvbihhLCBiKSB7XG4gICAgICAgICAgICByZXR1cm4gc29ydFN1Ymdyb3VwcyhtYXRyaXhbaV1bYV0sIG1hdHJpeFtpXVtiXSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgayA9ICjPhCAtIHBhZGRpbmcgKiBuKSAvIGs7XG4gICAgICB4ID0gMCwgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgeDAgPSB4LCBqID0gLTE7XG4gICAgICAgIHdoaWxlICgrK2ogPCBuKSB7XG4gICAgICAgICAgdmFyIGRpID0gZ3JvdXBJbmRleFtpXSwgZGogPSBzdWJncm91cEluZGV4W2RpXVtqXSwgdiA9IG1hdHJpeFtkaV1bZGpdLCBhMCA9IHgsIGExID0geCArPSB2ICogaztcbiAgICAgICAgICBzdWJncm91cHNbZGkgKyBcIi1cIiArIGRqXSA9IHtcbiAgICAgICAgICAgIGluZGV4OiBkaSxcbiAgICAgICAgICAgIHN1YmluZGV4OiBkaixcbiAgICAgICAgICAgIHN0YXJ0QW5nbGU6IGEwLFxuICAgICAgICAgICAgZW5kQW5nbGU6IGExLFxuICAgICAgICAgICAgdmFsdWU6IHZcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGdyb3Vwc1tkaV0gPSB7XG4gICAgICAgICAgaW5kZXg6IGRpLFxuICAgICAgICAgIHN0YXJ0QW5nbGU6IHgwLFxuICAgICAgICAgIGVuZEFuZ2xlOiB4LFxuICAgICAgICAgIHZhbHVlOiBncm91cFN1bXNbZGldXG4gICAgICAgIH07XG4gICAgICAgIHggKz0gcGFkZGluZztcbiAgICAgIH1cbiAgICAgIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGogPSBpIC0gMTtcbiAgICAgICAgd2hpbGUgKCsraiA8IG4pIH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AgICAgIH1cbiAgICAgICAgICBpZiAocXVhZC5wb2ludCAmJiBkbiAmJiBkbiA8IGNoYXJnZURpc3RhbmNlMikge1xuICAgICAgICAgICAgdmFyIGsgPSBxdWFkLnBvaW50Q2hhcmdlIC8gZG47XG4gICAgICAgICAgICBub2RlLnB4IC09IGR4ICogaztcbiAgICAgICAgICAgIG5vZGUucHkgLT0gZHkgKiBrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gIXF1YWQuY2hhcmdlO1xuICAgICAgfTtcbiAgICB9XG4gICAgZm9yY2UudGljayA9IGZ1bmN0aW9uKCkge1xuICAgICAgaWYgKChhbHBoYSAqPSAuOTkpIDwgLjAwNSkge1xuICAgICAgICB0aW1lciA9IG51bGw7XG4gICAgICAgIGV2ZW50LmVuZCh7XG4gICAgICAgICAgdHlwZTogXCJlbmRcIixcbiAgICAgICAgICBhbHBoYTogYWxwaGEgPSAwXG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIHZhciBuID0gbm9kZXMubGVuZ3RoLCBtID0gbGlua3MubGVuZ3RoLCBxLCBpLCBvLCBzLCB0LCBsLCBrLCB4LCB5O1xuICAgICAgZm9yIChpID0gMDsgaSA8IG07ICsraSkge1xuICAgICAgICBvID0gbGlua3NbaV07XG4gICAgICAgIHMgPSBvLnNvdXJjZTtcbiAgICAgICAgdCA9IG8udGFyZ2V0O1xuICAgICAgICB4ID0gdC54IC0gcy54O1xuICAgICAgICB5ID0gdC55IC0gcy55O1xuICAgICAgICBpZiAobCA9IHggKiB4ICsgeSAqIHkpIHtcbiAgICAgICAgICBsID0gYWxwaGEgKiBzdHJlbmd0aHNbaV0gKiAoKGwgPSBNYXRoLnNxcnQobCkpIC0gZGlzdGFuY2VzW2ldKSAvIGw7XG4gICAgICAgICAgeCAqPSBsO1xuICAgICAgICAgIHkgKj0gbDtcbiAgICAgICAgICB0LnggLT0geCAqIChrID0gcy53ZWlnaHQgKyB0LndlaWdodCA/IHMud2VpZ2h0IC8gKHMud2VpZ2h0ICsgdC53ZWlnaHQpIDogLjUpO1xuICAgICAgICAgIHQueSAtPSB5ICogaztcbiAgICAgICAgICBzLnggKz0geCAqIChrID0gMSAtIGspO1xuICAgICAgICAgIHMueSArPSB5ICogaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGsgPSBhbHBoYSAqIGdyYXZpdHkpIHtcbiAgICAgICAgeCA9IHNpemVbMF0gLyAyO1xuICAgICAgICB5ID0gc2l6ZVsxXSAvIDI7XG4gICAgICAgIGkgPSAtMTtcbiAgICAgICAgaWYgKGspIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IG5vZGVzW2ldO1xuICAgICAgICAgIG8ueCArPSAoeCAtIG8ueCkgKiBrO1xuICAgICAgICAgIG8ueSArPSAoeSAtIG8ueSkgKiBrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoY2hhcmdlKSB7XG4gICAgICAgIGQzX2xheW91dF9mb3JjZUFjY3VtdWxhdGUocSA9IGQzLmdlb20ucXVhZHRyZWUobm9kZXMpLCBhbHBoYSwgY2hhcmdlcyk7XG4gICAgICAgIGkgPSAtMTtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBpZiAoIShvID0gbm9kZXNbaV0pLmZpeGVkKSB7XG4gICAgICAgICAgICBxLnZpc2l0KHJlcHVsc2UobykpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgbyA9IG5vZGVzW2ldO1xuICAgICAgICBpZiAoby5maXhlZCkge1xuICAgICAgICAgIG8ueCA9IG8ucHg7XG4gICAgICAgICAgby55ID0gby5weTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBvLnggLT0gKG8ucHggLSAoby5weCA9IG8ueCkpICogZnJ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AgZm9yY2UuYWxwaGEgPSBmdW5jdGlvbih4KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBhbHBoYTtcbiAgICAgIHggPSAreDtcbiAgICAgIGlmIChhbHBoYSkge1xuICAgICAgICBpZiAoeCA+IDApIHtcbiAgICAgICAgICBhbHBoYSA9IHg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGltZXIuYyA9IG51bGwsIHRpbWVyLnQgPSBOYU4sIHRpbWVyID0gbnVsbDtcbiAgICAgICAgICBldmVudC5lbmQoe1xuICAgICAgICAgICAgdHlwZTogXCJlbmRcIixcbiAgICAgICAgICAgIGFscGhhOiBhbHBoYSA9IDBcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIGlmICh4ID4gMCkge1xuICAgICAgICBldmVudC5zdGFydCh7XG4gICAgICAgICAgdHlwZTogXCJzdGFydFwiLFxuICAgICAgICAgIGFscGhhOiBhbHBoYSA9IHhcbiAgICAgICAgfSk7XG4gICAgICAgIHRpbWVyID0gZDNfdGltZXIoZm9yY2UudGljayk7XG4gICAgICB9XG4gICAgICByZXR1cm4gZm9yY2U7XG4gICAgfTtcbiAgICBmb3JjZS5zdGFydCA9IGZ1bmN0aW9uKCkge1xuICAgICAgdmFyIGksIG4gPSBub2Rlcy5sZW5ndGgsIG0gPSBsaW5rcy5sZW5ndGgsIHcgPSBzaXplWzBdLCBoID0gc2l6ZVsxXSwgbmVpZ2hib3JzLCBvO1xuICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAobyA9IG5vZGVzW2ldKS5pbmRleCA9IGk7XG4gICAgICAgIG8ud2VpZ2h0ID0gMDtcbiAgICAgIH1cbiAgICAgIGZvciAoaSA9IDA7IGkgPCBtOyArK2kpIHtcbiAgICAgICAgbyA9IGxpbmtzW2ldO1xuICAgICAgICBpZiAodHlwZW9mIG8uc291cmNlID09IFwibnVtYmVyXCIpIG8u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ICAgICAgfSk7XG4gICAgICBpbmRleC5mb3JFYWNoKGZ1bmN0aW9uKGkpIHtcbiAgICAgICAgYXJjc1tpXSA9IHtcbiAgICAgICAgICBkYXRhOiBkYXRhW2ldLFxuICAgICAgICAgIHZhbHVlOiB2ID0gdmFsdWVzW2ldLFxuICAgICAgICAgIHN0YXJ0QW5nbGU6IGEsXG4gICAgICAgICAgZW5kQW5nbGU6IGEgKz0gdiAqIGsgKyBwYSxcbiAgICAgICAgICBwYWRBbmdsZTogcFxuICAgICAgICB9O1xuICAgICAgfSk7XG4gICAgICByZXR1cm4gYXJjcztcbiAgICB9XG4gICAgcGllLnZhbHVlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdmFsdWU7XG4gICAgICB2YWx1ZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLnNvcnQgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzb3J0O1xuICAgICAgc29ydCA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLnN0YXJ0QW5nbGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzdGFydEFuZ2xlO1xuICAgICAgc3RhcnRBbmdsZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLmVuZEFuZ2xlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZW5kQW5nbGU7XG4gICAgICBlbmRBbmdsZSA9IF87XG4gICAgICByZXR1cm4gcGllO1xuICAgIH07XG4gICAgcGllLnBhZEFuZ2xlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcGFkQW5nbGU7XG4gIC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G1heCA9IG87XG4gICAgICAgIHN1bXMucHVzaChvKTtcbiAgICAgIH1cbiAgICAgIGZvciAoaiA9IDA7IGogPCBtOyArK2opIHtcbiAgICAgICAgeTBbal0gPSAobWF4IC0gc3Vtc1tqXSkgLyAyO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHkwO1xuICAgIH0sXG4gICAgd2lnZ2xlOiBmdW5jdGlvbihkYXRhKSB7XG4gICAgICB2YXIgbiA9IGRhdGEubGVuZ3RoLCB4ID0gZGF0YVswXSwgbSA9IHgubGVuZ3RoLCBpLCBqLCBrLCBzMSwgczIsIHMzLCBkeCwgbywgbzAsIHkwID0gW107XG4gICAgICB5MFswXSA9IG8gPSBvMCA9IDA7XG4gICAgICBmb3IgKGogPSAxOyBqIDwgbTsgKytqKSB7XG4gICAgICAgIGZvciAoaSA9IDAsIHMxID0gMDsgaSA8IG47ICsraSkgczEgKz0gZGF0YVtpXVtqXVsxXTtcbiAgICAgICAgZm9yIChpID0gMCwgczIgPSAwLCBkeCA9IHhbal1bMF0gLSB4W2ogLSAxXVswXTsgaSA8IG47ICsraSkge1xuICAgICAgICAgIGZvciAoayA9IDAsIHMzID0gKGRhdGFbaV1bal1bMV0gLSBkYXRhW2ldW2ogLSAxXVsxXSkgLyAoMiAqIGR4KTsgayA8IGk7ICsraykge1xuICAgICAgICAgICAgczMgKz0gKGRhdGFba11bal1bMV0gLSBkYXRhW2tdW2ogLSAxXVsxXSkgLyBkeDtcbiAgICAgICAgICB9XG4gICAgICAgICAgczIgKz0gczMgKiBkYXRhW2ldW2pdWzFdO1xuICAgICAgICB9XG4gICAgICAgIHkwW2pdID0gbyAtPSBzMSA/IHMyIC8gczEgKiBkeCA6IDA7XG4gICAgICAgIGlmIChvIDwgbzApIG8wID0gbztcbiAgICAgIH1cbiAgICAgIGZvciAoaiA9IDA7IGogPCBtOyArK2opIHkwW2pdIC09IG8wO1xuICAgICAgcmV0dXJuIHkwO1xuICAgIH0sXG4gICAgZXhwYW5kOiBmd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YyA9IG5vZGVzWzJdO1xuICAgICAgICBkM19sYXlvdXRfcGFja1BsYWNlKGEsIGIsIGMpO1xuICAgICAgICBib3VuZChjKTtcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYSwgYyk7XG4gICAgICAgIGEuX3BhY2tfcHJldiA9IGM7XG4gICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGMsIGIpO1xuICAgICAgICBiID0gYS5fcGFja19uZXh0O1xuICAgICAgICBmb3IgKGkgPSAzOyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgZDNfbGF5b3V0X3BhY2tQbGFjZShhLCBiLCBjID0gbm9kZXNbaV0pO1xuICAgICAgICAgIHZhciBpc2VjdCA9IDAsIHMxID0gMSwgczIgPSAxO1xuICAgICAgICAgIGZvciAoaiA9IGIuX3BhY2tfbmV4dDsgaiAhPT0gYjsgaiA9IGouX3BhY2tfbmV4dCwgczErKykge1xuICAgICAgICAgICAgaWYgKGQzX2xheW91dF9wYWNrSW50ZXJzZWN0cyhqLCBjKSkge1xuICAgICAgICAgICAgICBpc2VjdCA9IDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNlY3QgPT0gMSkge1xuICAgICAgICAgICAgZm9yIChrID0gYS5fcGFja19wcmV2OyBrICE9PSBqLl9wYWNrX3ByZXY7IGsgPSBrLl9wYWNrX3ByZXYsIHMyKyspIHtcbiAgICAgICAgICAgICAgaWYgKGQzX2xheW91dF9wYWNrSW50ZXJzZWN0cyhrLCBjKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc2VjdCkge1xuICAgICAgICAgICAgaWYgKHMxIDwgczIgfHwgczEgPT0gczIgJiYgYi5yIDwgYS5yKSBkM19sYXlvdXRfcGFja1NwbGljZShhLCBiID0gaik7IGVsc2UgZDNfbGF5b3V0X3BhY2tTcGxpY2UoYSA9IGssIGIpO1xuICAgICAgICAgICAgaS0tO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChhLCBjKTtcbiAgICAgICAgICAgIGIgPSBjO1xuICAgICAgICAgICAgYm91bmQoYyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHZhciBjeCA9ICh4TWluICsgeE1heCkgLyAyLCBjeSA9ICh5TWluICsgeU1heCkgLyAyLCBjciA9IDA7XG4gICAgZm9yIChpID0gMDsgaSA8IG47IGkrKykge1xuICAgICAgYyA9IG5vZGVzW2ldO1xuICAgICAgYy54IC09IGN4O1xuICAgICAgYy55IC09IGN5O1xuICAgICAgY3IgPSBNYXRoLm1heChjciwgYy5yICsgTWF0aC5zcXJ0KGMueCAqIGMueCArIGMueSAqIGMueSkpO1xuICAgIH1cbiAgICBub2RlLnIgPSBjcjtcbiAgICBub2Rlcy5mb3JFYWNoKGQzX2xheW91dF9wYWNrVW5saW5rKTtcbiAgfVxuICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja0xpbmsobm9kZSkge1xuICAgIG5vZGUuX3BhY2tfbmV4dCA9IG5vZGUuX3BhY2tfcHJldiA9IG5vZGU7XG4gIH1cbiAgZnVuY3Rpb24gZDNfbGF5b3V0X3BhY2tVbmxpbmsobm9kZSkge1xuICAgIGRlbGV0ZSBub2RlLl9wYWNrX25leHQ7XG4gICAgZGVsZXRlIG5vZGUuX3BhY2tfcHJldjtcbiAgfVxuICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja1RyYW5zZm9ybShub2RlLCB4LCB5LCBrKSB7XG4gICAgdmFyIGNoaWxkcmVuID0gbm9kZS5jaGlsZHJlbjtcbiAgICBub2RlLnggPSB4ICs9IGsgKiBub2RlLng7XG4gICAgbm9kZS55ID0geSArPSBrICogbm9kZS55O1xuICAgIG5vZGUuciAq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R4KSAqIGt4O1xuICAgICAgICAgIG5vZGUueSA9IG5vZGUuZGVwdGggKiBreTtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICByZXR1cm4gbm9kZXM7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHdyYXBUcmVlKHJvb3QwKSB7XG4gICAgICB2YXIgcm9vdDEgPSB7XG4gICAgICAgIEE6IG51bGwsXG4gICAgICAgIGNoaWxkcmVuOiBbIHJvb3QwIF1cbiAgICAgIH0sIHF1ZXVlID0gWyByb290MSBdLCBub2RlMTtcbiAgICAgIHdoaWxlICgobm9kZTEgPSBxdWV1ZS5wb3AoKSkgIT0gbnVsbCkge1xuICAgICAgICBmb3IgKHZhciBjaGlsZHJlbiA9IG5vZGUxLmNoaWxkcmVuLCBjaGlsZCwgaSA9IDAsIG4gPSBjaGlsZHJlbi5sZW5ndGg7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICBxdWV1ZS5wdXNoKChjaGlsZHJlbltpXSA9IGNoaWxkID0ge1xuICAgICAgICAgICAgXzogY2hpbGRyZW5baV0sXG4gICAgICAgICAgICBwYXJlbnQ6IG5vZGUxLFxuICAgICAgICAgICAgY2hpbGRyZW46IChjaGlsZCA9IGNoaWxkcmVuW2ldLmNoaWxkcmVuKSAmJiBjaGlsZC5zbGljZSgpIHx8IFtdLFxuICAgICAgICAgICAgQTogbnVsbCxcbiAgICAgICAgICAgIGE6IG51bGwsXG4gICAgICAgICAgICB6OiAwLFxuICAgICAgICAgICAgbTogMCxcbiAgICAgICAgICAgIGM6IDAsXG4gICAgICAgICAgICBzOiAwLFxuICAgICAgICAgICAgdDogbnVsbCxcbiAgICAgICAgICAgIGk6IGlcbiAgICAgICAgICB9KS5hID0gY2hpbGQpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gcm9vdDEuY2hpbGRyZW5bMF07XG4gICAgfVxuICAgIGZ1bmN0aW9uIGZpcnN0V2Fsayh2KSB7XG4gICAgICB2YXIgY2hpbG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F5b3V0X3RyZWVSaWdodCh2aW0pLCB2aXAgPSBkM19sYXlvdXRfdHJlZUxlZnQodmlwKSwgdmltICYmIHZpcCkge1xuICAgICAgICAgIHZvbSA9IGQzX2xheW91dF90cmVlTGVmdCh2b20pO1xuICAgICAgICAgIHZvcCA9IGQzX2xheW91dF90cmVlUmlnaHQodm9wKTtcbiAgICAgICAgICB2b3AuYSA9IHY7XG4gICAgICAgICAgc2hpZnQgPSB2aW0ueiArIHNpbSAtIHZpcC56IC0gc2lwICsgc2VwYXJhdGlvbih2aW0uXywgdmlwLl8pO1xuICAgICAgICAgIGlmIChzaGlmdCA+IDApIHtcbiAgICAgICAgICAgIGQzX2xheW91dF90cmVlTW92ZShkM19sYXlvdXRfdHJlZUFuY2VzdG9yKHZpbSwgdiwgYW5jZXN0b3IpLCB2LCBzaGlmdCk7XG4gICAgICAgICAgICBzaXAgKz0gc2hpZnQ7XG4gICAgICAgICAgICBzb3AgKz0gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNpbSArPSB2aW0ubTtcbiAgICAgICAgICBzaXAgKz0gdmlwLm07XG4gICAgICAgICAgc29tICs9IHZvbS5tO1xuICAgICAgICAgIHNvcCArPSB2b3AubTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmltICYmICFkM19sYXlvdXRfdHJlZVJpZ2h0KHZvcCkpIHtcbiAgICAgICAgICB2b3AudCA9IHZpbTtcbiAgICAgICAgICB2b3AubSArPSBzaW0gLSBzb3A7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZpcCAmJiAhZDNfbGF5b3V0X3RyZWVMZWZ0KHZvbSkpIHtcbiAgICAgICAgICB2b20udCA9IHZpcDtcbiAgICAgICAgICB2b20ubSArPSBzaXAgLSBzb207XG4gICAgICAgICAgYW5jZXN0b3IgPSB2O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gYW5jZXN0b3I7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNpemVOb2RlKG5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AgICAgc2NhbGUocmVtYWluaW5nLCByZWN0LmR4ICogcmVjdC5keSAvIG5vZGUudmFsdWUpO1xuICAgICAgICByb3cuYXJlYSA9IDA7XG4gICAgICAgIHdoaWxlIChjaGlsZCA9IHJlbWFpbmluZy5wb3AoKSkge1xuICAgICAgICAgIHJvdy5wdXNoKGNoaWxkKTtcbiAgICAgICAgICByb3cuYXJlYSArPSBjaGlsZC5hcmVhO1xuICAgICAgICAgIGlmIChjaGlsZC56ICE9IG51bGwpIHtcbiAgICAgICAgICAgIHBvc2l0aW9uKHJvdywgY2hpbGQueiA/IHJlY3QuZHggOiByZWN0LmR5LCByZWN0LCAhcmVtYWluaW5nLmxlbmd0aCk7XG4gICAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjaGlsZHJlbi5mb3JFYWNoKHN0aWNraWZ5KTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gd29yc3Qocm93LCB1KSB7XG4gICAgICB2YXIgcyA9IHJvdy5hcmVhLCByLCBybWF4ID0gMCwgcm1pbiA9IEluZmluaXR5LCBpID0gLTEsIG4gPSByb3cubGVuZ3RoO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgaWYgKCEociA9IHJvd1tpXS5hcmVhKSkgY29udGludWU7XG4gICAgICAgIGlmIChyIDwgcm1pbikgcm1pbiA9IHI7XG4gICAgICAgIGlmIChyID4gcm1heCkgcm1heCA9IHI7XG4gICAgICB9XG4gICAgICBzICo9IHM7XG4gICAgICB1ICo9IHU7XG4gICAgICByZXR1cm4gcyA/IE1hdGgubWF4KHUgKiBybWF4ICogcmF0aW8gLyBzLCBzIC8gKHUgKiBybWluICogcmF0aW8pKSA6IEluZmluaXR5O1xuICAgIH1cbiAgICBmdW5jdGlvbiBwb3NpdGlvbihyb3csIHUsIHJlY3QsIGZsdXNoKSB7XG4gICAgICB2YXIgaSA9IC0xLCBuID0gcm93Lmxlbmd0aCwgeCA9IHJlY3QueCwgeSA9IHJlY3QueSwgdiA9IHUgPyByb3VuZChyb3cuYXJlYSAvIHUpIDogMCwgbztcbiAgICAgIGlmICh1ID09IHJlY3QuZHgpIHtcbiAgICAgICAgaWYgKGZsdXNoIHx8IHYgPiByZWN0LmR5KSB2ID0gcmVjdC5keTtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gcm93W2ldO1xuICAgICAgICAgIG8ueCA9IHg7XG4gICAgICAgICAgby55ID0geTtcbiAgICAgICAgICBvLmR5ID0gdjtcbiAgICAgICAgICB4ICs9IG8uZHggPSBNYXRoLm1pbihyZWN0LnggKyByZWN0LmR4IC0geCwgdiA/IHJvdW5kKG8uYXJlYSAvIHYpIDogMCk7XG4gICAgICAgIH1cbiAgICAgICAgby56ID0gdHJ1ZTtcbiAgICAgICAgby5keCArPSByZWN0LnggKyByZWN0LmR4IC0geDtcbiAgICAgICAgcmVjdC55ICs9IHY7XG4gICAgICAgIHJlY3QuZHkgLT0gdjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keCkgdiA9IHJlY3QuZHg7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IHJvd1tpXTtcbiAgICAgICAgICBvLnggPSB4O1xuICAgICAgICAgIG8ueSA9IHk7XG4gICAgICAgICAgby5keCA9IHY7XG4gICAgICAgICAgeSArPSBvLmR5ID0gTWF0aC5taW4ocmVjdC55ICsgcmVjdC5keSAtIHksIHYgPyByb3VuZChvLmFyZWEgLyB2KSA6IDApO1xuICAgICAgICB9XG4gICAgICAgIG8ueiA9IGZhbHNlO1xuICAgICAgICBvLmR5ICs9IHJlY3QueSArIHJlY3QuZHkgLSB5O1xuICAgICAgICByZWN0LnggKz0gdjtcbiAgICAgICAgcmVjdC5keCAtPSB2O1xuICAgICAgfVxuICAgIH1cbiA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zLl9fY2hhcnRfXyA9IGV4dGVudDE7XG4gICAgICAgIGlmIChkM190cmFuc2l0aW9uSW5oZXJpdElkKSB7XG4gICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnRyYW5zaXRpb24oKS5lYWNoKFwic3RhcnQuYnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0gZXh0ZW50MC5pO1xuICAgICAgICAgICAgeUV4dGVudERvbWFpbiA9IGV4dGVudDAuajtcbiAgICAgICAgICAgIHhFeHRlbnQgPSBleHRlbnQwLng7XG4gICAgICAgICAgICB5RXh0ZW50ID0gZXh0ZW50MC55O1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaHN0YXJ0XCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLnR3ZWVuKFwiYnJ1c2g6YnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgeGkgPSBkM19pbnRlcnBvbGF0ZUFycmF5KHhFeHRlbnQsIGV4dGVudDEueCksIHlpID0gZDNfaW50ZXJwb2xhdGVBcnJheSh5RXh0ZW50LCBleHRlbnQxLnkpO1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IHlFeHRlbnREb21haW4gPSBudWxsO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgICAgeEV4dGVudCA9IGV4dGVudDEueCA9IHhpKHQpO1xuICAgICAgICAgICAgICB5RXh0ZW50ID0gZXh0ZW50MS55ID0geWkodCk7XG4gICAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgICAgIG1vZGU6IFwicmVzaXplXCJcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pLmVhY2goXCJlbmQuYnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0gZXh0ZW50MS5pO1xuICAgICAgICAgICAgeUV4dGVudERvbWFpbiA9IGV4dGVudDEuajtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hcIixcbiAgICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoZW5kXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoc3RhcnRcIlxuICAgICAgICAgIH0pO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hlbmRcIlxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuICAgIGZ1bmN0aW9uIHJlZHJhdyhnKSB7XG4gICAgICBnLnNlbGVjdEFsbChcIi5yZXNpemVcIikuYXR0cihcInRyYW5zZm9ybVwiLCBmdW5jdGlvbihkKSB7XG4gICAgICAgIHJldHVybiBcInRyYW5zbGF0ZShcIiArIHhFeHRlbnRbKy9lJC8udGVzdChkKV0gKyBcIixcIiArIHlFeHRlbnRbKy9ecy8udGVzdChkKV0gKyBcIilcIjtcbiAgICAgIH0pO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWRyYXdYKGcpIHtcbiAgICAgIGcuc2VsZWN0KFwiLmV4dGVudFwiKS5hdHRyKFwieFwiLCB4RXh0ZW50WzBdKTtcbiAgICAgIG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F8oe1xuICAgICAgICB0eXBlOiBcImJydXNoc3RhcnRcIlxuICAgICAgfSk7XG4gICAgICBicnVzaG1vdmUoKTtcbiAgICAgIGZ1bmN0aW9uIGtleWRvd24oKSB7XG4gICAgICAgIGlmIChkMy5ldmVudC5rZXlDb2RlID09IDMyKSB7XG4gICAgICAgICAgaWYgKCFkcmFnZ2luZykge1xuICAgICAgICAgICAgY2VudGVyID0gbnVsbDtcbiAgICAgICAgICAgIG9yaWdpblswXSAtPSB4RXh0ZW50WzFdO1xuICAgICAgICAgICAgb3JpZ2luWzFdIC09IHlFeHRlbnRbMV07XG4gICAgICAgICAgICBkcmFnZ2luZyA9IDI7XG4gICAgICAgICAgfVxuICAgICAgICAgIGQzX2V2ZW50UHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24ga2V5dXAoKSB7XG4gICAgICAgIGlmIChkMy5ldmVudC5rZXlDb2RlID09IDMyICYmIGRyYWdnaW5nID09IDIpIHtcbiAgICAgICAgICBvcmlnaW5bMF0gKz0geEV4dGVudFsxXTtcbiAgICAgICAgICBvcmlnaW5bMV0gKz0geUV4dGVudFsxXTtcbiAgICAgICAgICBkcmFnZ2luZyA9IDA7XG4gICAgICAgICAgZDNfZXZlbnRQcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBicnVzaG1vdmUoKSB7XG4gICAgICAgIHZhciBwb2ludCA9IGQzLm1vdXNlKHRhcmdldCksIG1vdmVkID0gZmFsc2U7XG4gICAgICAgIGlmIChvZmZzZXQpIHtcbiAgICAgICAgICBwb2ludFswXSArPSBvZmZzZXRbMF07XG4gICAgICAgICAgcG9pbnRbMV0gKz0gb2Zmc2V0WzFdO1xuICAgICAgICB9XG4gICAgICAgIGlmICghZHJhZ2dpbmcpIHtcbiAgICAgICAgICBpZiAoZDMuZXZlbnQuYWx0S2V5KSB7XG4gICAgICAgICAgICBpZiAoI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heDtcbiAgICAgICAgaWYgKGRyYWdnaW5nKSB7XG4gICAgICAgICAgcjAgLT0gcG9zaXRpb247XG4gICAgICAgICAgcjEgLT0gc2l6ZSArIHBvc2l0aW9uO1xuICAgICAgICB9XG4gICAgICAgIG1pbiA9IChpID8geUNsYW1wIDogeENsYW1wKSA/IE1hdGgubWF4KHIwLCBNYXRoLm1pbihyMSwgcG9pbnRbaV0pKSA6IHBvaW50W2ldO1xuICAgICAgICBpZiAoZHJhZ2dpbmcpIHtcbiAgICAgICAgICBtYXggPSAobWluICs9IHBvc2l0aW9uKSArIHNpemU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGNlbnRlcikgcG9zaXRpb24gPSBNYXRoLm1heChyMCwgTWF0aC5taW4ocjEsIDIgKiBjZW50ZXJbaV0gLSBtaW4pKTtcbiAgICAgICAgICBpZiAocG9zaXRpb24gPCBtaW4pIHtcbiAgICAgICAgICAgIG1heCA9IG1pbjtcbiAgICAgICAgICAgIG1pbiA9IHBvc2l0aW9uO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtYXggPSBwb3NpdGlvbjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGV4dGVudFswXSAhPSBtaW4gfHwgZXh0ZW50WzFdICE9IG1heCkge1xuICAgICAgICAgIGlmIChpKSB5RXh0ZW50RG9tYWluID0gbnVsbDsgZWxzZSB4RXh0ZW50RG9tYWluID0gbnVsbDtcbiAgICAgICAgICBleHRlbnRbMF0gPSBtaW47XG4gICAgICAgICAgZXh0ZW50WzFdID0gbWF4O1xuICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBicnVzaGVuZCgpIHtcbiAgICAgICAgYnJ1c2htb3ZlKCk7XG4gICAgICAgIGcuc3R5bGUoXCJwb2ludGVyLWV2ZW50c1wiLCBcImFsbFwiKS5zZWxlY3RBbGwoXCIucmVzaXplX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AgOiB5ID8geUNsYW1wIDogbnVsbDtcbiAgICAgIGlmICh4ICYmIHkpIHhDbGFtcCA9ICEhelswXSwgeUNsYW1wID0gISF6WzFdOyBlbHNlIGlmICh4KSB4Q2xhbXAgPSAhIXo7IGVsc2UgaWYgKHkpIHlDbGFtcCA9ICEhejtcbiAgICAgIHJldHVybiBicnVzaDtcbiAgICB9O1xuICAgIGJydXNoLmV4dGVudCA9IGZ1bmN0aW9uKHopIHtcbiAgICAgIHZhciB4MCwgeDEsIHkwLCB5MSwgdDtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICBpZiAoeCkge1xuICAgICAgICAgIGlmICh4RXh0ZW50RG9tYWluKSB7XG4gICAgICAgICAgICB4MCA9IHhFeHRlbnREb21haW5bMF0sIHgxID0geEV4dGVudERvbWFpblsxXTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeDAgPSB4RXh0ZW50WzBdLCB4MSA9IHhFeHRlbnRbMV07XG4gICAgICAgICAgICBpZiAoeC5pbnZlcnQpIHgwID0geC5pbnZlcnQoeDApLCB4MSA9IHguaW52ZXJ0KHgxKTtcbiAgICAgICAgICAgIGlmICh4MSA8IHgwKSB0ID0geDAsIHgwID0geDEsIHgxID0gdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHkpIHtcbiAgICAgICAgICBpZiAoeUV4dGVudERvbWFpbikge1xuICAgICAgICAgICAgeTAgPSB5RXh0ZW50RG9tYWluWzBdLCB5MSA9IHlFeHRlbnREb21haW5bMV07XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHkwID0geUV4dGVudFswXSwgeTEgPSB5RXh0ZW50WzFdO1xuICAgICAgICAgICAgaWYgKHkuaW52ZXJ0KSB5MCA9IHkuaW52ZXJ0KHkwKSwgeTEgPSB5LmludmVydCh5MSk7XG4gICAgICAgICAgICBpZiAoeTEgPCB5MCkgdCA9IHkwLCB5MCA9IHkx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uICAgICAgICAgICAgICAgICAge3tlbHNlfX1cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4+UGFpZCBvcmRlcjwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgIHt7L2lmfX1cbiAgICAgICAgICAgICAgICA8L3A+XG4gICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj48YSBjbGFzcz1cImJveG9mZmljZS1idXR0b24gYm94b2ZmaWNlLWJ1dHRvbi1pbmZvXCIgaHJlZj1cImphdmFzY3JpcHQ6dm9pZCgwKVwiIG9uLWNsaWNrPVwic2hvd09yZGVyXCI+TGluZSBJdGVtczwvYT48L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPlxuICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPlxuICAgICAgICAgICAgICAgICAgPGEgY2xhc3M9XCJib3hvZmZpY2UtYnV0dG9uIGJveG9mZmljZS1idXR0b24tc21hbGwgYm94b2ZmaWNlLWJ1dHRvbi1pbmZvIG9yZGVycy1idG5cIiBocmVmPXt7IHJlY2VpcHQgfX0gdGFyZ2V0PVwiX2JsYW5rXCIgPlZpZXcgUmVjZWlwdDwvYT5cbiAgICAgICAgICAgICAgICAgIDxhIGNsYXNzPVwiYm94b2ZmaWNlLWJ1dHRvbiBib3hvZmZpY2UtYnV0dG9uLXNtYWxsIGJveG9mZmljZS1idXR0b24taW5mbyByaWdodC1idXR0b24gb3JkZXJzLWJ0blwiIGhyZWY9e3sgYXNzaWduZWUgfX0gdGFyZ2V0PVwiX2JsYW5rXCIgPlZpZXcgQXNzaWduZWUgZGV0YWlsczwvYT5cbiAgICAgICAgICAgICAgICA8L3A+XG4gICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICA8L3RyPlxuICAgICAgICAgICAge3sjc2hvd19vcmRlcn19XG4gICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJvcmRlci1zbGlkZXJcIiBpbnRyby1vdXRybz0nZmx5Ont4OjIwMCx5OjAsZHVyYXRpb246MjAwfSc+XG4gICAgICAgICAgICAgICAgPGJ1dHRvbiBvbi1jbGljaz1cImhpZGVPcmRlclwiIGNsYXNzPVwiY2xvc2UtYnV0dG9uXCI+PGkgY2xhc3M9XCJmYSBmYS1jbG9zZVwiPjwvaT48L2J1dHRvbj5cbiAgICAgICAgICAgICAgICA8cCBjbGFzcz1cIm9yZGVyLXRpdGxlXCI+T3JkZXIgSW52b2ljZSBObzoge3tpbnZvaWNlX25vfX08L3A+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImxpbmUtaXRlbXMtd3JhcHBlclwiPlxuICAgICAgICAgICAgICAgICAge3sjbGluZV9pdGVtczpsaW5lX2l0ZW19fVxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGlja2V0IGNvbC1zbS02IGNvbC14cy0xMlwiIGlkPVwiaXRlbS17eyBAaW5kZXggfX1cIj5cbiAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiaGVhZGluZ1wiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRpY2tldC10eXBlXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxwPnt7IHRpdGxlIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbnRlbnRcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250ZW50LWJveFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPmlkOjwvc3Bhbj4ge3sgaWQgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRh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fZGV0YWlsc319XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5GdWxsbmFtZTo8L3NwYW4+IHt7IGZ1bGxuYW1lIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+RW1haWw6PC9zcGFuPiB7eyBlbWFpbCB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPlBob25lOjwvc3Bhbj4ge3sgcGhvbmUgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3sjZGV0YWlsczprZXkgfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+e3sga2V5IH19Ojwvc3Bhbj4ge3sgLiB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgICB7e2Vsc2V9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxiPk5vdCBhc3NpZ25lZDwvYj48L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHt7I2NhbmNlbF90aWNrZXRfdXJsICYmICFjYW5jZWxsZWRfYXR9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJveG9mZmljZS1idXR0b24gYm94b2ZmaWNlLWJ1dHRvbi1zbWFsbCBib3hvZmZpY2UtYnV0dG9uLWluZm9cIiBocmVmPVwiamF2YXNjcmlwdDp2b2lkKDApXCIgb24tY2xpY2s9XCJjYW5jZWxUaWNrZXRcIiB7eyNjYW5jZWxsaW5nfX1kaXNhYmxlZHt7L319PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW5jZWwge3sjY2FuY2VsbGluZ319PGkgY2xhc3M9XCJmYSBmYS1zcGlubmVyIGZhLXNwaW5cIj48L2k+e3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cCBjbGFzcz1cImVycm9yLW1zZyBsZWZ0LWFsaWduZWRcIj57e2NhbmNlbF9lcnJvcn19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICB7ey9zaG93X29yZGVyfX1cbiAgICAgICAgICB7ey9vcmRlcnN9fVxuICAgICAgICAgIDwvdGJvZHk+XG4gICAgICAgICAgPHRmb290PlxuICAgICAgICAgICAgPHRyPlxuICAgICAgICAgICAgICA8dGQgY29sc3Bhbj1cIjEwXCI+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhZ2luYXRpb24gcGFnaW5hdGlvbi1jZW50ZXJlZFwiPjwvZGl2PlxuICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICA8L3Rmb290PlxuICAgICAgICA8L3RhYmxlPlxuICAgICAgPC9kaXY+XG4gICAge3tlbHNlfX1cbiAgICAgIDxwIGNsYXNzPVwidGV4dC1jZW50ZXJcIj5DdXJyZW50bHkgbm8gb3JkZXJzLjwvcD5cbiAgICB7ey9pZn19XG4gIDwvZGl2PlxuYFxuIiwiZXhwb3J0IG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MtdGFibGVcIj5cbiAgICAgICAgPHRoZWFkPlxuICAgICAgICAgIDx0ciBjbGFzcz1cImluZm9cIj5cbiAgICAgICAgICAgIDx0aD4jPC90aD5cbiAgICAgICAgICAgIDx0aD5JdGVtPC90aD5cbiAgICAgICAgICAgIDx0aD5BdmFpbGFibGU8L3RoPlxuICAgICAgICAgICAgPHRoPlNvbGQ8L3RoPlxuICAgICAgICAgICAgPHRoPkZyZWU8L3RoPlxuICAgICAgICAgICAgPHRoPkNhbmNlbGxlZDwvdGg+XG4gICAgICAgICAgICA8dGg+Q3VycmVudCBQcmljZTwvdGg+XG4gICAgICAgICAgICA8dGg+TmV0IFNhbGVzPC90aD5cbiAgICAgICAgICA8L3RyPlxuICAgICAgICA8L3RoZWFkPlxuICAgICAgICA8dGJvZHk+XG4gICAgICAgICAge3sjaXRlbXN9fVxuICAgICAgICAgICAgPHRyPlxuICAgICAgICAgICAgICA8dGQ+e3sgQGluZGV4ICsgMSB9fTwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD57eyB0aXRsZSB9fTwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD57eyBhdmFpbGFibGUgfX08L3RkPlxuICAgICAgICAgICAgICA8dGQ+e3sgc29sZCB9fTwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD57eyBmcmVlIH19PC90ZD5cbiAgICAgICAgICAgICAgPHRkPnt7IGNhbmNlbGxlZCB9fTwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD57eyBjdXJyZW50X3ByaWNlIH19PC90ZD5cbiAgICAgICAgICAgICAgPHRkPnt7IG5ldF9zYWxlcyB9fTwvdGQ+XG4gICAgICAgICAgICA8L3RyPlxuICAgICAgICAgIHt7L319XG4gICAgICAgIDwvdGJvZHk+XG4gICAgICA8L3RhYmxlPlxuICAgIDwvZGl2PlxuICA8L2Rpdj5cbmBcblxuZXhwb3J0IGNvbnN0IEFnZ0NoYXJ0VGVtcGxhdGUgPSBgXG4gIDxkaXYgY2xhc3M9XCJj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EYXRhLmxpbmVfaXRlbXMpO1xuICAgICAgICAgIG1haW5fcmFjdGl2ZS5zZXQoZXZlbnQua2V5cGF0aCArICcuc2hvd19vcmRlcicsIHRydWUpO1xuICAgICAgICB9KTtcbiAgICAgIH0pO1xuXG4gICAgICBtYWluX3JhY3RpdmUub24oJ2hpZGVPcmRlcicsIGZ1bmN0aW9uKGV2ZW50KXtcbiAgICAgICAgLy9TaG93IGluZGl2aWR1YWwgb3JkZXJcbiAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5zaG93X29yZGVyJywgZmFsc2UpO1xuICAgICAgfSk7XG5cbiAgICAgIG1haW5fcmFjdGl2ZS5vbignY2FuY2VsVGlja2V0JywgZnVuY3Rpb24oZXZlbnQsIG1ldGhvZCkge1xuICAgICAgICBpZiAod2luZG93LmNvbmZpcm0oXCJBcmUgeW91IHN1cmUgeW91IHdhbnQgdG8gY2FuY2VsIHRoaXMgdGlja2V0P1wiKSkge1xuICAgICAgICAgIG1haW5fcmFjdGl2ZS5zZXQoZXZlbnQua2V5cGF0aCArICcuY2FuY2VsX2Vycm9yJywgXCJcIik7XG4gICAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5jYW5jZWxsaW5nJywgdHJ1ZSk7XG5cbiAgICAgICAgICBPcmRlck1vZGVsLnBvc3Qoe1xuICAgICAgICAgICAgdXJsOiBldmVudC5jb250ZXh0LmNhbmNlbF90aWNrZXRfdXJsXG4gICAgICAgICAgfSkuZG9uZShmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5jYW5jZWxsZWRfYXQnLCByZXNwb25zZS5yZXN1bHQuY2FuY2VsbGVkX2F0KTtcbiAgICAgICAgICAgIG1haW5fcmFjdGl2ZS5zZXQoZXZlbnQua2V5cGF0aCArICcuY2FuY2VsbGluZycsIGZhbHNlKTtcbiAgICAgIC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WF0X2NvbHVtbnMoKTtcbiAgICBsZXQgYmFyX2dyYXBoX2hlYWRlcnMgPSBfLndpdGhvdXQoXy5tYXAoY29sdW1ucywgXy5maXJzdCksICd4JywgJ3NhbGVzJylcblxuICAgIHRoaXMuY2hhcnQgPSBjMy5nZW5lcmF0ZSh7XG4gICAgICBkYXRhOiB7XG4gICAgICAgIHg6ICd4JyxcbiAgICAgICAgY29sdW1uczogdGhpcy5mb3JtYXRfY29sdW1ucygpLFxuICAgICAgICB0eXBlOiAnYmFyJyxcbiAgICAgICAgdHlwZXM6IHtcbiAgICAgICAgICBzYWxlczogJ2xpbmUnXG4gICAgICAgIH0sXG4gICAgICAgIGdyb3VwczogW1xuICAgICAgICAgIGJhcl9ncmFwaF9oZWFkZXJzXG4gICAgICAgIF0sXG4gICAgICAgIGF4ZXM6IHtcbiAgICAgICAgICBzYWxlczogJ3kyJ1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgYmFyOiB7XG4gICAgICAgIHdpZHRoOiB7XG4gICAgICAgICAgcmF0aW86IDAuNSAvLyB0aGlzIG1ha2VzIGJhciB3aWR0aCA1MCUgb2YgbGVuZ3RoIGJldHdlZW4gdGlja3NcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGF4aXM6IHtcbiAgICAgICAgeDoge1xuICAgICAgICAgIHR5cGU6ICd0aW1lc2VyaWVzJyxcbiAgICAgICAgICB0aWNrOiB7XG4gICAgICAgICAgICBmb3JtYXQ6ICclZC0lbSdcbiAgICAgICAgICB9LFxuICAgICAgICAgIGxhYmVsOiAnRGF0ZSdcbiAgICAgICAgfSxcbiAgICAgICAgeToge1xuICAgICAgICAgIGxhYmVsOiAnTm8uIG9mIHRpY2tldHMnXG4gICAgICAgIH0sXG4gICAgICAgIHkyOiB7XG4gICAgICAgICAgc2hvdzogdHJ1ZSxcbiAgICAgICAgICBsYWJlbDogJ1NhbGVzJ1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICB0aGlz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IHNob3dTcGlubmVyOiBmYWxzZX0pLnN0YXJ0KCk7XG4gICAgICAgICAgZXZlbnRCdXMudHJpZ2dlcignbmF2aWdhdGUnLCBldmVudC5jb250ZXh0LnVybCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcbiAgfSxcbiAgcmVuZGVyOiBmdW5jdGlvbih2aWV3LCBpY19jb25maWcpIHtcbiAgICBpZiAodGhpcy5vbikge1xuICAgICAgdGhpcy5yYWN0aXZlLnNldCh7XG4gICAgICAgICdzaWRlYmFySXRlbXMnOiBTaWRlQmFyTW9kZWwuZ2V0SXRlbXMoaWNfY29uZmlnKSxcbiAgICAgICAgJ2FjdGl2ZUl0ZW0nOiB2aWV3LFxuICAgICAgICAnc2lkZWJhckhpZGUnOiBmYWxzZSxcbiAgICAgICAgJ3NpZGViYXJNb2JpbGVPbic6IGZhbHNlXG4gICAgICB9KTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICB0aGlzLmluaXQodmlldywgaWNfY29uZmlnKTtcbiAgICB9XG4gIH0sXG4gIGhpZGU6IGZ1bmN0aW9uKCkge1xuICAgIGlmICh0aGlzLm9uKSB7XG4gICAgICB0aGlzLnJhY3RpdmUuc2V0KCdzaWRlYmFySGlkZScsIHRydWUpO1xuICAgIH1cbiAgfVxufTtcbiJdfQ== diff --git a/boxoffice/static/js/views/order.js b/boxoffice/static/js/views/order.js index 93298caa..e05400ae 100644 --- a/boxoffice/static/js/views/order.js +++ b/boxoffice/static/js/views/order.js @@ -186,12 +186,20 @@ window.Boxoffice.Order = { order.ractive.set(line_item + '.toAssign', false); order.ractive.set(line_item + '.isTicketAssigned', true); order.ractive.scrollTop(line_item_seq); + order.ractive.set(line_item + '.assignee', data.result.assignee); }, error: function(response) { var ajaxLoad = this; ajaxLoad.retries -= 1; if (response.readyState === 4) { - order.ractive.set(line_item + '.errorMsg', 'Server error'); + var error_text; + if (response.status === 500) { + error_text = "Server Error"; + } + else { + error_text = JSON.parse(response.responseText).error_description; + } + order.ractive.set(line_item + '.errorMsg', error_text); order.ractive.set(line_item + '.assigningTicket', false); } else if (response.readyState === 0) { if (ajaxLoad.retries < 0) { diff --git a/boxoffice/static/sass/_layout.sass b/boxoffice/static/sass/_layout.sass index 708a587b..f6d229f2 100644 --- a/boxoffice/static/sass/_layout.sass +++ b/boxoffice/static/sass/_layout.sass @@ -123,7 +123,8 @@ a.boxoffice-button:focus -moz-transition: 0.2s ease all -webkit-transition: 0.2s ease all -.group-input:disabled +.group-input:disabled, +.group-input.disabled position: relative background-color: transparent color: $color-form-disabled-label diff --git a/boxoffice/templates/order.html b/boxoffice/templates/order.html index 2eaea2cd..bf21bdf4 100644 --- a/boxoffice/templates/order.html +++ b/boxoffice/templates/order.html @@ -53,7 +53,11 @@

{{order.item_collection.title}} Ticket Assignment

{{#if assignee.id || isTicketAssigned}}
- + {{#is_transferrable}} + + {{else}} + + {{/}}
{{else}}

Assign this ticket

@@ -79,21 +83,21 @@

{{order.item_collection.title}} Ticket Assignment

Please fill the attendee details

- + {{#assignee.errormsg.fullname}}

{{ assignee.errormsg.fullname }}

{{/}}
- + {{#assignee.errormsg.email}}

{{ assignee.errormsg.email }}

{{/}}
- + {{#assignee.errormsg.phone}}

{{ assignee.errormsg.phone }}

{{/}} @@ -102,14 +106,14 @@

Please fill the attendee details

- +
{{elseif field_type === 'select'}}

{{label}}

- {{#options: option}} {{/options}} @@ -118,7 +122,7 @@

Please fill the attendee details

- +
{{/if}} {{/}} diff --git a/boxoffice/views/order.py b/boxoffice/views/order.py index 26630b24..af553667 100644 --- a/boxoffice/views/order.py +++ b/boxoffice/views/order.py @@ -66,6 +66,7 @@ def jsonify_order(data): 'assignee': jsonify_assignee(line_item.current_assignee), 'is_confirmed': line_item.is_confirmed, 'is_cancelled': line_item.is_cancelled, + 'is_transferrable': line_item.is_transferrable(), 'cancelled_at': date_format(line_item.cancelled_at) if line_item.cancelled_at else "", }) return jsonify(order_id=order.id, access_token=order.access_token, diff --git a/boxoffice/views/participant.py b/boxoffice/views/participant.py index 0ab2255d..59de3358 100644 --- a/boxoffice/views/participant.py +++ b/boxoffice/views/participant.py @@ -6,6 +6,7 @@ from ..models import LineItem, Assignee from ..models import Order from coaster.views import load_models +from order import jsonify_assignee from boxoffice.mailclient import send_ticket_assignment_mail from utils import xhr_only @@ -47,4 +48,4 @@ def assign(order): db.session.add(new_assignee) db.session.commit() send_ticket_assignment_mail.delay(line_item.id) - return make_response(jsonify(status='ok', result={'message': 'Ticket assigned'}), 201) + return make_response(jsonify(status='ok', result={'message': 'Ticket assigned', 'assignee': jsonify_assignee(line_item.current_assignee)}), 201) From 3a59dcae76e74abc8a5c1df7a6a6d0f980851116 Mon Sep 17 00:00:00 2001 From: Vidya Ramakrishnan Date: Wed, 21 Sep 2016 12:57:03 +0530 Subject: [PATCH 3/9] Change variable names to assignee. And follow underscore convention for variables. CC previous assignee incase of ticket transfer. --- boxoffice/mailclient.py | 8 ++++-- boxoffice/static/css/app.css | 2 +- boxoffice/static/js/views/order.js | 45 +++++++++++++++--------------- boxoffice/static/sass/_order.sass | 2 +- boxoffice/templates/order.html | 10 +++---- boxoffice/views/participant.py | 7 +++-- 6 files changed, 41 insertions(+), 33 deletions(-) diff --git a/boxoffice/mailclient.py b/boxoffice/mailclient.py index 72814c6a..306db7fb 100644 --- a/boxoffice/mailclient.py +++ b/boxoffice/mailclient.py @@ -55,7 +55,7 @@ def send_line_item_cancellation_mail(line_item_id, subject="Ticket Cancellation" @job('boxoffice') -def send_ticket_assignment_mail(line_item_id): +def send_ticket_assignment_mail(line_item_id, past_assignee): """ Sends a confirmation email once details are filled and ticket has been assigned. """ @@ -63,7 +63,11 @@ def send_ticket_assignment_mail(line_item_id): line_item = LineItem.query.get(line_item_id) order = line_item.order subject = order.item_collection.title + ": Here's your ticket" - msg = Message(subject=subject, recipients=[line_item.current_assignee.email], bcc=[order.buyer_email]) + if past_assignee: + recipient_list = [order.buyer_email, past_assignee] + else: + recipient_list = [order.buyer_email] + msg = Message(subject=subject, recipients=[line_item.current_assignee.email], cc=recipient_list) html = email_transform(render_template('ticket_assignment_mail.html', order=order, org=order.organization, line_item=line_item, base_url=app.config['BASE_URL'])) msg.html = html msg.body = html2text(html) diff --git a/boxoffice/static/css/app.css b/boxoffice/static/css/app.css index 47d6e43c..d8e03a89 100644 --- a/boxoffice/static/css/app.css +++ b/boxoffice/static/css/app.css @@ -508,7 +508,7 @@ a.boxoffice-button:focus { text-align: center; } -.attendee-form-title { +.assignee-form-title { font-size: 18px; font-weight: bold; padding: 15px 0; diff --git a/boxoffice/static/js/views/order.js b/boxoffice/static/js/views/order.js index e05400ae..2c41311d 100644 --- a/boxoffice/static/js/views/order.js +++ b/boxoffice/static/js/views/order.js @@ -57,7 +57,6 @@ window.Boxoffice.Order = { data: { order_id: data.order_id, access_token: data.access_token, - eventName: data.item_collection_name, line_items: data.line_items, buyer_name: data.buyer_name, buyer_email: data.buyer_email, @@ -65,8 +64,8 @@ window.Boxoffice.Order = { }, scrollTop: function(line_item_seq){ //Scroll to the corresponding line_item. - var domElem = order.ractive.nodes[ 'item-' + line_item_seq ]; - $('html,body').animate({ scrollTop: $(domElem).offset().top }, '300'); + var dom_elem = order.ractive.nodes[ 'item-' + line_item_seq ]; + $('html,body').animate({ scrollTop: $(dom_elem).offset().top }, '300'); }, viewTicket: function(event, line_item, line_item_seq) { event.original.preventDefault(); @@ -102,9 +101,9 @@ window.Boxoffice.Order = { } order.ractive.set(line_item + '.toAssign', true); }, - addAttendeeDetails: function(event, line_item, line_item_seq, line_item_id) { + addAssigneeDetails: function(event, line_item, line_item_seq, line_item_id) { - var validationConfig = [{ + var validation_config = [{ name: 'fullname', rules: 'required' }, @@ -118,25 +117,26 @@ window.Boxoffice.Order = { } ]; - var attendeeForm = 'attendee-form-' + line_item_seq; + var assignee_form = 'assignee-form-' + line_item_seq; - var formValidator = new FormValidator(attendeeForm, validationConfig, function(errors, event) { + var form_validator = new FormValidator(assignee_form, validation_config, function(errors, event) { event.preventDefault(); order.ractive.set(line_item + '.assignee.errormsg', ''); + order.ractive.set(line_item + '.errorMsg', ''); if (errors.length > 0) { order.ractive.set(line_item + '.assignee.errormsg.'+ errors[0].name, errors[0].message); order.ractive.scrollTop(line_item_seq); } else { order.ractive.set(line_item + '.assigningTicket', true); - order.ractive.sendAttendeeDetails(line_item, line_item_seq, line_item_id); + order.ractive.sendAssigneeDetails(line_item, line_item_seq, line_item_id); } }); - formValidator.setMessage('required', 'Please fill out the %s field'); - formValidator.setMessage('valid_email', 'Please enter a valid email'); + form_validator.setMessage('required', 'Please fill out the %s field'); + form_validator.setMessage('valid_email', 'Please enter a valid email'); - formValidator.registerCallback('validate_phone', function(phone) { + form_validator.registerCallback('validate_phone', function(phone) { //Remove all punctations (except +) and letters phone = phone.replace(/[^0-9+]/g,''); order.ractive.set(line_item + '.assignee.phone', phone); @@ -144,29 +144,30 @@ window.Boxoffice.Order = { var validPhone = /^\+[0-9]+$/; if (phone.length > 16) { - formValidator.setMessage('validate_phone', 'Please enter a valid mobile number'); + form_validator.setMessage('validate_phone', 'Please enter a valid mobile number'); return false; } else if (phone.match(validPhone)) { //Indian number starting with '+91' if (phone.indexOf('+91') === 0 && phone.length != 13) { - formValidator.setMessage('validate_phone', 'Please enter a valid Indian mobile number'); + form_validator.setMessage('validate_phone', 'Please enter a valid Indian mobile number'); return false; } } else { - formValidator.setMessage('validate_phone', "Please prefix your phone number with '+' and country code."); + form_validator.setMessage('validate_phone', "Please prefix your phone number with '+' and country code."); return false; } }); }, - sendAttendeeDetails: function(line_item, line_item_seq, line_item_id) { - var attendeeForm = 'attendee-details-' + line_item_seq; - var formElements = $('#'+ attendeeForm).serializeArray(); - var attendeeDetails ={}; - for (var formIndex=0; formIndex < formElements.length; formIndex++) { - if (formElements[formIndex].value) { - attendeeDetails[formElements[formIndex].name] = formElements[formIndex].value; + sendAssigneeDetails: function(line_item, line_item_seq, line_item_id) { + var assignee_form = 'assignee-details-' + line_item_seq; + var form_elements = $('#'+ assignee_form).serializeArray(); + var assignee_details ={}; + + for (var form_index=0; form_index < form_elements.length; form_index++) { + if (form_elements[form_index].value) { + assignee_details[form_elements[form_index].name] = form_elements[form_index].value; } } @@ -175,7 +176,7 @@ window.Boxoffice.Order = { type: Boxoffice.Order.config.assign.method, contentType: 'application/json', data: JSON.stringify({ - attendee: attendeeDetails, + assignee: assignee_details, line_item_id: line_item_id }), timeout: 30000, diff --git a/boxoffice/static/sass/_order.sass b/boxoffice/static/sass/_order.sass index 1a1718ca..63f32767 100644 --- a/boxoffice/static/sass/_order.sass +++ b/boxoffice/static/sass/_order.sass @@ -71,7 +71,7 @@ margin: 0 0 5px text-align: center -.attendee-form-title +.assignee-form-title font-size: 18px font-weight: bold padding: 15px 0 diff --git a/boxoffice/templates/order.html b/boxoffice/templates/order.html index bf21bdf4..b848f7b4 100644 --- a/boxoffice/templates/order.html +++ b/boxoffice/templates/order.html @@ -22,7 +22,7 @@

{{order.item_collection.title}} Ticket Assignment

-

Loading. If this takes too long, please mail {{order.item_collection.organization.contact_email}} with your receipt number.

+

Loading. If you are behind a firewall or using any script blocking extension, please ensure your browser can load static.hasgeek.co.in
For further queries, please write to us at {{order.item_collection.organization.contact_email}} with your receipt number.

{%- raw %}