From 33a5867fa3f84fa9a1a377a2d262e42dab1d0820 Mon Sep 17 00:00:00 2001 From: Vidya Ramakrishnan Date: Mon, 12 Sep 2016 10:34:35 +0530 Subject: [PATCH 01/41] Initial version of admin page for reports. --- boxoffice/static/js/dist/bundle.js | 154 +++++++++++++++--- boxoffice/static/js/models/admin_report.js | 21 +++ boxoffice/static/js/models/sidebar.js | 7 + .../static/js/templates/admin_report.html.js | 27 +++ boxoffice/static/js/views/admin_report.js | 38 +++++ boxoffice/static/js/views/router.js | 7 +- boxoffice/views/__init__.py | 2 +- boxoffice/views/admin_report.py | 102 ++++++++++++ 8 files changed, 331 insertions(+), 27 deletions(-) create mode 100644 boxoffice/static/js/models/admin_report.js create mode 100644 boxoffice/static/js/templates/admin_report.html.js create mode 100644 boxoffice/static/js/views/admin_report.js create mode 100644 boxoffice/views/admin_report.py diff --git a/boxoffice/static/js/dist/bundle.js b/boxoffice/static/js/dist/bundle.js index d9b93756..6ead9b69 100644 --- a/boxoffice/static/js/dist/bundle.js +++ b/boxoffice/static/js/dist/bundle.js @@ -17,7 +17,7 @@ $(function () { }); }); -},{"./router":22,"backbone":8,"c3":9,"d3":10,"underscore":12}],2:[function(require,module,exports){ +},{"./router":25,"backbone":9,"c3":10,"d3":11,"underscore":13}],2:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -51,7 +51,41 @@ var OrderModel = { }; exports.OrderModel = OrderModel; -},{"./index.js":3,"./util.js":7}],3:[function(require,module,exports){ +},{"./index.js":4,"./util.js":8}],3:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _utilJs = require("./util.js"); + +var fetch = _utilJs.fetch; +var post = _utilJs.post; + +var IndexModel = require("./index.js").IndexModel; + +var ReportModel = { + fetch: fetch, + post: post, + urlFor: function urlFor(action, config) { + var urls = { + index: { + path: IndexModel.urlFor("index").path + "ic/" + config.ic_id + "/reports", + relative_path: "ic/" + config.ic_id + "/reports", + method: "GET" + }, + orders: { + path: IndexModel.urlFor("index").path + "ic/" + config.ic_id + "/reports/order", + method: "GET" + } + }; + return urls[action]; + } +}; +exports.ReportModel = ReportModel; + +},{"./index.js":4,"./util.js":8}],4:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -75,7 +109,7 @@ var IndexModel = { }; exports.IndexModel = IndexModel; -},{"./util.js":7}],4:[function(require,module,exports){ +},{"./util.js":8}],5:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -122,7 +156,7 @@ var ItemCollectionModel = { }; exports.ItemCollectionModel = ItemCollectionModel; -},{"./index.js":3,"./util.js":7}],5:[function(require,module,exports){ +},{"./index.js":4,"./util.js":8}],6:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -148,7 +182,7 @@ var OrgModel = { }; exports.OrgModel = OrgModel; -},{"./index.js":3,"./util.js":7}],6:[function(require,module,exports){ +},{"./index.js":4,"./util.js":8}],7:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -163,6 +197,8 @@ var ItemCollectionModel = require("./item_collection.js").ItemCollectionModel; var OrderModel = require("./admin_order.js").OrderModel; +var ReportModel = require("./admin_report.js").ReportModel; + var SideBarModel = { getItems: function getItems(config) { var sidebar_items = []; @@ -187,6 +223,11 @@ var SideBarModel = { title: "Orders", icon: "fa-shopping-cart", view: "orders" + }, { + url: ReportModel.urlFor("index", { ic_id: config.ic_id }).relative_path, + title: "Reports", + icon: "fa-file-excel-o", + view: "reports" }]; } return sidebar_items; @@ -194,7 +235,7 @@ var SideBarModel = { }; exports.SideBarModel = SideBarModel; -},{"./admin_order.js":2,"./index.js":3,"./item_collection.js":4,"./org.js":5}],7:[function(require,module,exports){ +},{"./admin_order.js":2,"./admin_report.js":3,"./index.js":4,"./item_collection.js":5,"./org.js":6}],8:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -239,7 +280,7 @@ var post = function post(config) { }; exports.post = post; -},{}],8:[function(require,module,exports){ +},{}],9:[function(require,module,exports){ (function (global){ // Backbone.js 1.3.3 @@ -2164,7 +2205,7 @@ exports.post = post; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) //# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9iYWNrYm9uZS9iYWNrYm9uZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO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3RvdHlwZTtcblxuICAgIHJldHVybiBjaGlsZDtcbiAgfTtcblxuICAvLyBTZXQgdXAgaW5oZXJpdGFuY2UgZm9yIHRoZSBtb2RlbCwgY29sbGVjdGlvbiwgcm91dGVyLCB2aWV3IGFuZCBoaXN0b3J5LlxuICBNb2RlbC5leHRlbmQgPSBDb2xsZWN0aW9uLmV4dGVuZCA9IFJvdXRlci5leHRlbmQgPSBWaWV3LmV4dGVuZCA9IEhpc3RvcnkuZXh0ZW5kID0gZXh0ZW5kO1xuXG4gIC8vIFRocm93IGFuIGVycm9yIHdoZW4gYSBVUkwgaXMgbmVlZGVkLCBhbmQgbm9uZSBpcyBzdXBwbGllZC5cbiAgdmFyIHVybEVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdBIFwidXJsXCIgcHJvcGVydHkgb3IgZnVuY3Rpb24gbXVzdCBiZSBzcGVjaWZpZWQnKTtcbiAgfTtcblxuICAvLyBXcmFwIGFuIG9wdGlvbmFsIGVycm9yIGNhbGxiYWNrIHdpdGggYSBmYWxsYmFjayBlcnJvciBldmVudC5cbiAgdmFyIHdyYXBFcnJvciA9IGZ1bmN0aW9uKG1vZGVsLCBvcHRpb25zKSB7XG4gICAgdmFyIGVycm9yID0gb3B0aW9ucy5lcnJvcjtcbiAgICBvcHRpb25zLmVycm9yID0gZnVuY3Rpb24ocmVzcCkge1xuICAgICAgaWYgKGVycm9yKSBlcnJvci5jYWxsKG9wdGlvbnMuY29udGV4dCwgbW9kZWwsIHJlc3AsIG9wdGlvbnMpO1xuICAgICAgbW9kZWwudHJpZ2dlcignZXJyb3InLCBtb2RlbCwgcmVzcCwgb3B0aW9ucyk7XG4gICAgfTtcbiAgfTtcblxuICByZXR1cm4gQmFja2JvbmU7XG59KTtcbiJdfQ== -},{"jquery":11,"underscore":12}],9:[function(require,module,exports){ +},{"jquery":12,"underscore":13}],10:[function(require,module,exports){ (function (window) { 'use strict'; @@ -10368,7 +10409,7 @@ exports.post = post; })(window); -},{"d3":10}],10:[function(require,module,exports){ +},{"d3":11}],11:[function(require,module,exports){ !function() { var d3 = { version: "3.5.17" @@ -19923,7 +19964,7 @@ exports.post = post; }); if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3; }(); -},{}],11:[function(require,module,exports){ +},{}],12:[function(require,module,exports){ /*! * jQuery JavaScript Library v2.2.4 * http://jquery.com/ @@ -29739,7 +29780,7 @@ if ( !noGlobal ) { return jQuery; })); -},{}],12:[function(require,module,exports){ +},{}],13:[function(require,module,exports){ // Underscore.js 1.8.3 // http://underscorejs.org // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors @@ -31289,7 +31330,7 @@ return jQuery; } }.call(this)); -},{}],13:[function(require,module,exports){ +},{}],14:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31298,7 +31339,16 @@ Object.defineProperty(exports, "__esModule", { var OrderTemplate = "\n
\n

{{ title }}

\n {{#if orders}}\n
\n \n
\n
\n \n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#orders:order}}\n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#show_order}}\n
\n \n

Order Invoice No: {{invoice_no}}

\n
\n {{#line_items:line_item}}\n
\n
\n
\n

{{ title }}

\n
\n
\n
\n
\n

id: {{ id }}

\n

Base amount: {{ currency }}{{ base_amount }}

\n

Discounted amount: {{ currency }}{{ discounted_amount }}

\n

Final amount: {{ currency }}{{ final_amount }}

\n {{#discount_policy}}

Discount policy: {{ discount_policy }}{{/}}\n {{#discount_coupon}}

Discount coupon: {{ discount_coupon }}{{/}}\n {{#cancelled_at}}

Cancelled at: {{ cancelled_at }}

{{/}}\n {{#assignee_details}}\n

Fullname: {{ fullname }}

\n

Email: {{ email }}

\n

Phone: {{ phone }}

\n {{#details:key }}\n

{{ key }}: {{ . }}

\n {{/}}\n {{else}}\n

Not assigned

\n {{/}}\n {{#cancel_ticket_url && !cancelled_at}}\n

\n \n

\n

{{cancel_error}}

\n {{/}}\n
\n
\n
\n {{/}}\n
\n
\n {{/show_order}}\n {{/orders}}\n \n \n \n \n \n \n
#Receipt No.Buyer nameBuyer emailBuyer phoneAmountDateOrder idTransaction statusViewDetails

{{ invoice_no }}

{{ buyer_fullname }}

{{ buyer_email }}

{{ buyer_phone }}

{{currency}}{{ amount }}

{{ order_date }}

{{ id }}

\n

\n {{#if amount === 0}}\n Free order\n {{else}}\n Paid order\n {{/if}}\n

\n

Line Items

\n

\n View Receipt\n View Assignee details\n

\n
\n
\n
\n
\n {{else}}\n

Currently no orders.

\n {{/if}}\n
\n"; exports.OrderTemplate = OrderTemplate; -},{}],14:[function(require,module,exports){ +},{}],15:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var ReportTemplate = "\n
\n

{{ title }}

\n
\n
\n

Download reports

\n
\n
\n
\n
\n
\n

Report type

\n \n
\n
\n Download\n
\n

{{download_report_error}}

\n
\n
\n
\n
\n
\n"; +exports.ReportTemplate = ReportTemplate; + +},{}],16:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31307,7 +31357,7 @@ Object.defineProperty(exports, "__esModule", { var IndexTemplate = "\n
\n
\n

Organizations

\n {{#orgs:org}}\n
\n
\n {{#title}}\n

{{ title }}

\n {{/title}}\n
\n
\n
\n
\n

Organization id

\n

{{id}}

\n {{#details:k,v}}\n {{#if k !== 'logo'}}\n

{{k}}

\n
{{{details[k]}}}
\n {{/if}}\n {{/details}}\n

Contact email

\n
{{contact_email}}
\n \n {{#infoMsg}}\n

{{ infoMsg }}

\n {{/}}\n
\n
\n {{/orgs}}\n
\n
\n"; exports.IndexTemplate = IndexTemplate; -},{}],15:[function(require,module,exports){ +},{}],17:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31322,7 +31372,7 @@ exports.AggChartTemplate = AggChartTemplate; var ItemCollectionTemplate = "\n
\n

{{ title }}

\n
\n
\n
\n
\n

\n
\n
\n

Net sales

\n

{{net_sales}}

\n
\n
\n
\n
\n
\n
\n

\n
\n
\n

Today's sales

\n

{{today_sales}}

\n
\n
\n
\n
\n
\n
\n {{#if sales_delta > 0 }}\n

\n {{elseif sales_delta < 0 }}\n

\n {{else}}\n

\n {{/if}}\n
\n
\n

Sales since yesterday

\n

{{sales_delta}}%

\n
\n
\n
\n
\n \n \n
\n"; exports.ItemCollectionTemplate = ItemCollectionTemplate; -},{}],16:[function(require,module,exports){ +},{}],18:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31331,7 +31381,7 @@ Object.defineProperty(exports, "__esModule", { var orgTemplate = "\n
\n
\n

{{ title }}

\n {{#item_collections:item_collection}}\n
\n
\n {{#title}}\n

{{ title }}

\n {{/title}}\n
\n
\n
\n

Item collection id

\n

{{id}}

\n

Item collection description

\n
{{{description_html}}}
\n \n {{#infoMsg}}\n

{{ infoMsg }}

\n {{/}}\n
\n
\n {{/item_collections}}\n
\n
\n"; exports.orgTemplate = orgTemplate; -},{}],17:[function(require,module,exports){ +},{}],19:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31340,7 +31390,7 @@ Object.defineProperty(exports, "__esModule", { var SideBarTemplate = "\n {{^sidebarHide}}\n \n
\n
\n {{#sidebarItems}}\n {{ title }}\n {{/sidebarItems}}\n
\n
\n {{/}}\n"; exports.SideBarTemplate = SideBarTemplate; -},{}],18:[function(require,module,exports){ +},{}],20:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31452,7 +31502,55 @@ var OrderView = { }; exports.OrderView = OrderView; -},{"../models/admin_order.js":2,"../templates/admin_order.html.js":13,"./sidebar.js":23}],19:[function(require,module,exports){ +},{"../models/admin_order.js":2,"../templates/admin_order.html.js":14,"./sidebar.js":26}],21:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var ReportModel = require("../models/admin_report.js").ReportModel; + +var ReportTemplate = require("../templates/admin_report.html.js").ReportTemplate; + +var SideBarView = require("./sidebar.js").SideBarView; + +var ReportView = { + render: function render(config) { + + ReportModel.fetch({ + url: ReportModel.urlFor("index", { ic_id: config.id }).path + }).done(function (remoteData) { + // Initial render + var main_ractive = new Ractive({ + el: "#main-content-area", + template: ReportTemplate, + data: { + title: remoteData.title, + reports_url: function reports_url() { + var report_type = this.get("report_type"); + return ReportModel.urlFor(report_type, { ic_id: config.id }).path; + }, + reports_filename: function reports_filename() { + var filename = this.get("title").replace(/ /g, "_"); + return filename + "_" + this.get("report_type") + ".csv"; + } + } + }); + + SideBarView.render("reports", { org_name: remoteData.org_name, ic_id: config.id }); + + NProgress.done(); + + window.addEventListener("popstate", function (event) { + NProgress.configure({ showSpinner: false }).start(); + }); + }); + } +}; +exports.ReportView = ReportView; + +},{"../models/admin_report.js":3,"../templates/admin_report.html.js":15,"./sidebar.js":26}],22:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31496,7 +31594,7 @@ var IndexView = { }; exports.IndexView = IndexView; -},{"../models/index.js":3,"../templates/index.html.js":14,"./sidebar.js":23}],20:[function(require,module,exports){ +},{"../models/index.js":4,"../templates/index.html.js":16,"./sidebar.js":26}],23:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31632,7 +31730,7 @@ var ItemCollectionView = { }; exports.ItemCollectionView = ItemCollectionView; -},{"../models/item_collection.js":4,"../templates/item_collection.html.js":15,"./sidebar.js":23}],21:[function(require,module,exports){ +},{"../models/item_collection.js":5,"../templates/item_collection.html.js":17,"./sidebar.js":26}],24:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31677,7 +31775,7 @@ var OrgView = { }; exports.OrgView = OrgView; -},{"../models/org.js":5,"../templates/org.html.js":16,"./sidebar.js":23}],22:[function(require,module,exports){ +},{"../models/org.js":6,"../templates/org.html.js":18,"./sidebar.js":26}],25:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31692,13 +31790,16 @@ var ItemCollectionView = require("./item_collection.js").ItemCollectionView; var OrderView = require("./admin_order.js").OrderView; +var ReportView = require("./admin_report.js").ReportView; + var Router = Backbone.Router.extend({ url_root: "/admin/", routes: { "": "index", "o/:org": "org", "ic/:icId": "item_collection", - "ic/:icId/orders": "order" + "ic/:icId/orders": "order", + "ic/:icId/reports": "report" }, index: function index() { IndexView.render(); @@ -31721,11 +31822,14 @@ var Router = Backbone.Router.extend({ }, order: function order(icId) { OrderView.render({ id: icId }); + }, + report: function report(icId) { + ReportView.render({ id: icId }); } }); exports.Router = Router; -},{"./admin_order.js":18,"./index.js":19,"./item_collection.js":20,"./org.js":21}],23:[function(require,module,exports){ +},{"./admin_order.js":20,"./admin_report.js":21,"./index.js":22,"./item_collection.js":23,"./org.js":24}],26:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -31781,5 +31885,5 @@ var SideBarView = { }; exports.SideBarView = SideBarView; -},{"../models/sidebar.js":6,"../templates/sidebar.html.js":17}]},{},[1]) -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCIvVXNlcnMvdmlkeWEvRG9jdW1lbnRzL0hhc0dlZWsvYm94b2ZmaWNlL2JveG9mZmljZS9zdGF0aWMvanMvdmlld3MvbWFpbi5qcyIsIi9Vc2Vycy92aWR5YS9Eb2N1bWVudHMvSGFzR2Vlay9ib3hvZmZpY2UvYm94b2ZmaWNlL3N0YXRpYy9qcy9tb2RlbHMvYWRtaW5fb3JkZXIuanMiLCIvVXNlcnMvdmlkeWEvRG9jdW1lbnRzL0hhc0dlZWsvYm94b2ZmaWNlL2JveG9mZmljZS9zdGF0aWMvanMvbW9kZWxzL2luZGV4Lmpz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9XG4gICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgdmFyIG5hbWVzID0gbmFtZSA/IFtuYW1lXSA6IF8ua2V5cyhldmVudHMpO1xuICAgIGZvciAoOyBpIDwgbmFtZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgIG5hbWUgPSBuYW1lc1tpXTtcbiAgICAgIHZhciBoYW5kbGVycyA9IGV2ZW50c1tuYW1lXTtcblxuICAgICAgLy8gQmFpbCBvdXQgaWYgdGhlcmUgYXJlIG5vIGV2ZW50cyBzdG9yZWQuXG4gICAgICBpZiAoIWhhbmRsZXJzKSBicmVhaztcblxuICAgICAgLy8gUmVwbGFjZSBldmVudHMgaWYgdGhlcmUgYXJlIGFueSByZW1haW5pbmcuICBPdGhlcndpc2UsIGNsZWFuIHVwLlxuICAgICAgdmFyIHJlbWFpbmluZyA9IFtdO1xuICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBoYW5kbGVycy5sZW5ndGg7IGorKykge1xuICAgICAgICB2YXIgaGFuZGxlciA9IGhhbmRsZXJzW2pdO1xuICAgICAgICBpZiAoXG4gICAgICAgICAgY2FsbGJhY2sgJiYgY2FsbGJhY2sgIT09IGhhbmRsZXIuY2FsbGJhY2sgJiZcbiAgICAgICAgICAgIGNhbGxiYWNrICE9PSBoYW5kbGVyLmNhbGxiYWNrLl9jYWxsYmFjayB8fFxuICAgICAgICAgICAgICBjb250ZXh0ICYmIGNvbnRleHQgIT09IGhhbmRsZXIuY29udGV4dFxuICAgICAgICApIHtcbiAgICAgICAgICByZW1haW5pbmcucHVzaChoYW5kbGVyKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBsaXN0ZW5pbmcgPSBoYW5kbGVyLmxpc3RlbmluZztcbiAgICAgICAgICBpZiAobGlzdGVuaW5nICYmIC0tbGlzdGVuaW5nLmNvdW50ID09PSAwKSB7XG4gICAgICAgICAgICBkZWxldGUgbGlzdGVuZXJzW2xpc3RlbmluZy5pZF07XG4gICAgICAgICAgICBk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oKSB7XG4gICAgICAgIC8vIGNhbiBkbyBzb21ldGhpbmdcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmluaXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcblxuICAgICAgICAkJC5pbml0UGFyYW1zKCk7XG5cbiAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3VybCkge1xuICAgICAgICAgICAgJCQuY29udmVydFVybFRvRGF0YShjb25maWcuZGF0YV91cmwsIGNvbmZpZy5kYXRhX21pbWVUeXBlLCBjb25maWcuZGF0YV9oZWFkZXJzLCBjb25maWcuZGF0YV9rZXlzLCAkJC5pbml0V2l0aERhdGEpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGNvbmZpZy5kYXRhX2pzb24pIHtcbiAgICAgICAgICAgICQkLmluaXRXaXRoRGF0YSgkJC5jb252ZXJ0SnNvblRvRGF0YShjb25maWcuZGF0YV9qc29uLCBjb25maWcuZGF0YV9rZXlzKSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoY29uZmlnLmRhdGFfcm93cykge1xuICAgICAgICAgICAgJCQuaW5pdFdpdGhEYXRhKCQkLmNvbnZlcnRSb3dzVG9EYXRhKGNvbmZpZy5kYXRhX3Jvd3MpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChjb25maWcuZGF0YV9jb2x1bW5zKSB7XG4gICAgICAgICAgICAkJC5pbml0V2l0aERhdGEoJCQuY29udmVydENvbHVtbnNUb0RhdGEoY29uZmlnLmRhdGFfY29sdW1ucykpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgRXJyb3IoJ3VybCBvciBqc29uIG9yIHJvd3Mgb3IgY29sdW1ucyBpcyByZXF1aXJlZC4nKTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm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AgaWYgKGNvbmZpZy5sZWdlbmRfaGlkZSkge1xuICAgICAgICAgICAgJCQuYWRkSGlkZGVuTGVnZW5kSWRzKGNvbmZpZy5sZWdlbmRfaGlkZSA9PT0gdHJ1ZSA/ICQkLm1hcFRvSWRzKCQkLmRhdGEudGFyZ2V0cykgOiBjb25maWcubGVnZW5kX2hpZGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gd2hlbiBnYXVnZSwgaGlkZSBsZWdlbmQgLy8gVE9ETzogZml4XG4gICAgICAgIGlmICgkJC5oYXNUeXBlKCdnYXVnZScpKSB7XG4gICAgICAgICAgICBjb25maWcubGVnZW5kX3Nob3cgPSBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEluaXQgc2l6ZXMgYW5kIHNjYWxlc1xuICAgICAgICAkJC51cGRhdGVTaXplcygpO1xuICAgICAgICAkJC51cGRhdGVTY2FsZXMoKTtcblxuICAgICAgICAvLyBTZXQgZG9tYWlucyBmb3IgZWFjaCBzY2FsZVxuICAgICAgICAkJC54LmRvbWFpbihkMy5leHRlbnQoJCQuZ2V0WERvbWFpbigkJC5kYXRhLnRhcmdldHMpKSk7XG4gICAgICAgICQkLnkuZG9tYWluKCQkLmdldFlEb21haW4oJCQuZGF0YS50YXJnZXRzLCAneScpKTtcbiAgICAgICAgJCQueTIuZG9tYWluKCQkLmdldFlEb21haW4oJCQuZGF0YS50YXJnZXRzLCAneTInKSk7XG4gICAgICAgICQkLnN1YlguZG9tYWluKCQkLnguZG9tYWluKCkpO1xuICAgICAgICAkJC5zdWJZLmRvbWFpbigkJC55LmRvbWFpbigpKTtcbiAgICAgICAgJCQuc3ViWTIuZG9tYWluKCQkLnkyLmRvbWFpbigpKTtcblxuICAgICAgICAvLyBTYXZlIG9yaWdpbmFsIHggZG9tYWluIGZvciB6b29tIHVwZGF0ZVxuICAgICAgICAkJC5vcmdYRG9tYWluID0gJCQueC5kb21haW4oKTtcblxuICAgICAgICAvLyBTZXQgaW5pdG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ICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMClcbiAgICAgICAgICAgIC5vbihcImRibGNsaWNrLnpvb21cIiwgbnVsbCk7XG5cbiAgICAgICAgLy8gU2V0IGRlZmF1bHQgZXh0ZW50IGlmIGRlZmluZWRcbiAgICAgICAgaWYgKGNvbmZpZy5heGlzX3hfZXh0ZW50KSB7ICQkLmJydXNoLmV4dGVudCgkJC5nZXREZWZhdWx0RXh0ZW50KCkpOyB9XG5cbiAgICAgICAgLy8gQWRkIEF4aXNcbiAgICAgICAgJCQuYXhpcy5pbml0KCk7XG5cbiAgICAgICAgLy8gU2V0IHRhcmdldHNcbiAgICAgICAgJCQudXBkYXRlVGFyZ2V0cygkJC5kYXRhLnRhcmdldHMpO1xuXG4gICAgICAgIC8vIERyYXcgd2l0aCB0YXJnZXRzXG4gICAgICAgIGlmIChiaW5kaW5nKSB7XG4gICAgICAgICAgICAkJC51cGRhdGVEaW1lbnNpb24oKTtcbiAgICAgICAgICAgICQkLmNvbmZpZy5vbmluaXQuY2FsbCgkJCk7XG4gICAgICAgICAgICAkJC5yZWRyYXcoe1xuICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uOiBmYWxzZSxcbiAgICAgICAgICAgICAgICB3aXRoVHJhbnNmb3JtOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uRm9yQXhpczogZmFsc2VcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQmluZCByZXNpemUgZXZlbnRcbiAgICAgICAgJCQuYmluZFJlc2l6ZSgpO1xuXG4gICAgICAgIC8vIGV4cG9ydCBlbGVtZW50IG9mIHRoZSBjaGFydFxuICAgICAgICAkJC5hcGkuZWxlbWVudCA9ICQkLnNlbGVjdENoYXJ0Lm5vZGUoKTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uc21vb3RoTGluZXMgPSBmdW5jdGlvbiAoZWwsIHR5cGUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgaWYgKHR5cGUgPT09ICdncmlkJykge1xuICAgICAgICAgICAgZWwuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGcgPSAkJC5kMy5zZWxlY3QodGhpcyksXG4gICAgICAgICAgICAgICAgICAgIHgxID0gZy5hdHRyKCd4MScpLFxuICAgICAgICAgICAgICAgICAgICB4MiA9IGcuYXR0cigneDInKSxcbiAgICAgICAgICAgICAgICAgICAgeTEgPSBnLmF0dHIoJ3kxJyksXG4gICAgICAgICAgICAgICAgICAgIHkyID0gZy5hdHRyKCd5MicpO1xuICAgICAgICAgICAgICAgIGcuYXR0cih7XG4gICAgICAgICAgICAgICAgICAgICd4MSc6IE1hdGguY2VpbCh4MSksXG4gICAgICAgICAgICAgICAgICAgICd4Mic6IE1hdGguY2VpbCh4MiksXG4gICAgICAgICAgICAgICAgICAgICd5MSc6IE1hdGguY2VpbCh5MSksXG4gICAgICAgICAgICAgICAgICAgICd5Mic6IE1hdGguY2VpbCh5MilcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlU2l6ZXMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgdmFyIGxlZ2VuZEhlaWdodCA9ICQkLmxlZ2VuZCA/ICQkLmdldExlZ2VuZEhlaWdodCgpIDogMCxcbiAgICAgICAgICAgIGxlZ2VuZFdpZHRoID0gJCQubGVnZW5kID8gJCQuZ2V0TGVnZW5kV2lkdGgoKSA6IDA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CkgJiYgdGFyZ2V0c1RvU2hvdy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICQkLnguZG9tYWluKFswLCAkJC5heGVzLnguc2VsZWN0QWxsKCcudGljaycpLnNpemUoKV0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRhcmdldHNUb1Nob3cubGVuZ3RoKSB7XG4gICAgICAgICAgICAkJC51cGRhdGVYRG9tYWluKHRhcmdldHNUb1Nob3csIHdpdGhVcGRhdGVYRG9tYWluLCB3aXRoVXBkYXRlT3JnWERvbWFpbiwgd2l0aFRyaW1YRG9tYWluKTtcbiAgICAgICAgICAgIGlmICghY29uZmlnLmF4aXNfeF90aWNrX3ZhbHVlcykge1xuICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMgPSAkJC5heGlzLnVwZGF0ZVhBeGlzVGlja1ZhbHVlcyh0YXJnZXRzVG9TaG93KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICQkLnhBeGlzLnRpY2tWYWx1ZXMoW10pO1xuICAgICAgICAgICAgJCQuc3ViWEF4aXMudGlja1ZhbHVlcyhbXSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY29uZmlnLnpvb21fcmVzY2FsZSAmJiAhb3B0aW9ucy5mbG93KSB7XG4gICAgICAgICAgICB4RG9tYWluRm9yWm9vbSA9ICQkLngub3JnRG9tYWluKCk7XG4gICAgICAgIH1cblxuICAgICAgICAkJC55LmRvbWFpbigkJC5nZXRZRG9tYWluKHRhcmdldHNUb1Nob3csICd5JywgeERvbWFpbkZvclpvb20pKTtcbiAgICAgICAgJCQueTIuZG9tYWluKCQkLmdldFlEb21haW4odGFyZ2V0c1RvU2hvdywgJ3kyJywgeERvbWFpbkZvclpvb20pKTtcblxuICAgICAgICBpZiAoIWNvbmZpZy5heGlzX3lfdGlja192YWx1ZXMgJiYgY29uZmlnLmF4aXNfeV90aWNrX2NvdW50KSB7XG4gICAgICAgICAgICAkJC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ICAgICAgICBkdXJhdGlvbjogb3B0aW9ucy5mbG93LmR1cmF0aW9uLFxuICAgICAgICAgICAgICAgIGRyYXdCYXI6IGRyYXdCYXIsXG4gICAgICAgICAgICAgICAgZHJhd0xpbmU6IGRyYXdMaW5lLFxuICAgICAgICAgICAgICAgIGRyYXdBcmVhOiBkcmF3QXJlYSxcbiAgICAgICAgICAgICAgICBjeDogY3gsXG4gICAgICAgICAgICAgICAgY3k6IGN5LFxuICAgICAgICAgICAgICAgIHh2OiB4dixcbiAgICAgICAgICAgICAgICB4Rm9yVGV4dDogeEZvclRleHQsXG4gICAgICAgICAgICAgICAgeUZvclRleHQ6IHlGb3JUZXh0XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgoZHVyYXRpb24gfHwgZmxvdykgJiYgJCQuaXNUYWJWaXNpYmxlKCkpIHsgLy8gT25seSB1c2UgdHJhbnNpdGlvbiBpZiB0YWIgdmlzaWJsZS4gU2VlICM5MzguXG4gICAgICAgICAgICAvLyB0cmFuc2l0aW9uIHNob3VsZCBiZSBkZXJpdmVkIGZyb20gb25lIHRyYW5zaXRpb25cbiAgICAgICAgICAgIGQzLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbikuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRyYW5zaXRpb25zVG9XYWl0ID0gW107XG5cbiAgICAgICAgICAgICAgICAvLyByZWRyYXcgYW5kIGdhdGhlciB0cmFuc2l0aW9uc1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3QmFyKGRyYXdCYXIsIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdMaW5lKGRyYXdMaW5lLCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3QXJlYShkcmF3QXJlYSwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0NpcmNsZShjeCwgY3ksIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdUZXh0KHhGb3JUZXh0LCB5Rm9yVGV4dCwgb3B0aW9ucy5mbG93LCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3UmVnaW9uKHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdHcmlkKHRydWUpLFxuICAgICAgICAgICAgICAgIF0uZm9yRWFjaChmdW5jdGlvbiAodHJhbnNpdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAodHJhbnNpdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbnNUb1dhaXQucHVzaCh0cmFuc2l0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAvLyBXYWl0IGZvciBlbmQgb2YgdHJhbnNpdGlvbnMgdG8gY2FsbCBmbG93IGFuZCBvbnJlbmRlcmVkIGNhbGxiYWNrXG4gICAgICAgICAgICAgICAgd2FpdEZvckRyYXcgPSAkJC5nZW5lcmF0ZVdhaXQoKTtcbiAgICAgICAgICAgICAgICB0cmFuc2l0aW9uc1RvV2FpdC5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgIHdhaXRGb3JEcmF3LmFkZCh0KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2FsbCh3YWl0Rm9yRHJhdywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmIChmbG93KSB7XG4gICAgICAgICAgICAgICAgICAgIGZsb3coKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5vbnJlbmRlcmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5vbnJlbmRlcmVkLmNhbGwoJCQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgJCQucmVkcmF3QmFyKGRyYXdCYXIpO1xuICAgICAgICAgICAgJCQucmVkcmF3TGluZShkcmF3TGluZSk7XG4gICAgICAgICAgICAkJC5yZWRyYXdBcmVhKGRyYXdBcmVhKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0NpcmNsZShjeCwgY3kpO1xuICAgICAgICAgICAgJCQucmVkcmF3VGV4dCh4Rm9yVGV4dCwgeUZvclRleHQsIG9wdGlvbnMuZmxvdyk7XG4gICAgICAgICAgICAkJC5yZWRyYXdSZWdpb24oKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0dyaWQoKTtcbiAgICAgICAgICAgIGlmIChjb25maWcub25yZW5kZXJlZCkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5vbnJlbmRlcmVkLmNhbGwoJCQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gdXBkYXRlIGZhZGVpbiBjb25kaXRpb25cbiAgICAgICAgJCQubWFwVG9JZHMoJCQuZGF0YS50YXJnZXRzKS5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgJCQud2l0aG91dEZhZGVJbltpZF0gPSB0cnVlO1xuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlQW5kUmVkcmF3ID0gZnVuY3Rpb24gKG9wdGlvbnMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCB0cmFuc2l0aW9ucztcbiAgICAgICAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge307XG4gICAgICAgIC8vIHNhbWUgd2l0aCByZWRyYXdcbiAgICAgICAgb3B0aW9ucy53aXRoVHJhbn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AgICAgICAgfVxuICAgICAgICBvYnNlcnZlcj0gbmV3IE11dGF0aW9uT2JzZXJ2ZXIoZnVuY3Rpb24gKG11dGF0aW9ucykge1xuICAgICAgICAgICAgbXV0YXRpb25zLmZvckVhY2goZnVuY3Rpb24gKG11dGF0aW9uKSB7XG4gICAgICAgICAgICAgICAgaWYgKG11dGF0aW9uLnR5cGUgPT09ICdjaGlsZExpc3QnICYmIG11dGF0aW9uLnByZXZpb3VzU2libGluZykge1xuICAgICAgICAgICAgICAgICAgICBvYnNlcnZlci5kaXNjb25uZWN0KCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gd2FpdCBmb3IgY29tcGxldGlvbiBvZiBsb2FkIGJlY2F1c2Ugc2l6ZSBjYWxjdWxhdGlvbiByZXF1aXJlcyB0aGUgYWN0dWFsIHNpemVzIGRldGVybWluZWQgYWZ0ZXIgdGhhdCBjb21wbGV0aW9uXG4gICAgICAgICAgICAgICAgICAgICQkLmludGVydmFsRm9yT2JzZXJ2ZUluc2VydGVkID0gd2luZG93LnNldEludGVydmFsKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHBhcmVudE5vZGUgd2lsbCBOT1QgYmUgbnVsbCB3aGVuIGNvbXBsZXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGVjdGlvbi5ub2RlKCkucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jbGVhckludGVydmFsKCQkLmludGVydmFsRm9yT2JzZXJ2ZUluc2VydGVkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC51cGRhdGVEaW1lbnNpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJCQuYnJ1c2gpIHsgJCQuYnJ1c2gudXBkYXRlKCk7IH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcub25pbml0LmNhbGwoJCQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhUcmFuc2Zvcm06IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFRyYW5zaXRpb246IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVHJhbnNpdGlvbkZvclRyYW5zZm9ybTogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhMZWdlbmQ6IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb24udHJhbnNpdGlvbigpLnN0eWxlKCdvcGFjaXR5JywgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0sIDEwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIG9ic2VydmVyLm9ic2VydmUoc2VsZWN0aW9uLm5vZGUoKSwge2F0dHJpYnV0ZXM6IHRydWUsIGNoaWxkTGlzdDogdHJ1ZSwgY2hhcmFjdGVyRGF0YTogdHJ1ZX0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5iaW5kUmVzaXplID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG5cbiAgICAgICAgJCQucmVzaXplRnVuY3Rpb24gPSAkJC5nZW5lcmF0ZVJlc2l6ZSgpO1xuXG4gICAgICAgICQkLnJlc2l6ZUZ1bmN0aW9uLmFkZChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBjb25maWcub25yZXNpemUuY2FsbCgkJCk7XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoY29uZmlnLnJlc2l6ZV9hdXRvKSB7XG4gICAgICAgICAgICAkJC5yZXNpemVGdW5jdGlvbi5hZGQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICgkJC5yZXNpemVUaW1lb3V0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNsZWFyVGltZW91dCgkJC5yZXNpemVUaW1lb3V0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQucmVzaXplVGltZW91dCA9IHdpbmRvdy5zZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlICQkLnJlc2l6ZVRpbWVvdXQ7XG4gICAgICAgICAgICAgICAgICAgICQkLmFwaS5mbHVzaCgpO1xuICAgICAgICAgICAgICAgIH0sIDEwMCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAkJC5yZXNpemVGdW5jdGlvbi5hZGQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgY29uZmlnLm9ucmVzaXplZC5jYWxsKCQkKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKHdpbmRvdy5hdHRhY2hFdmVudCkge1xuICAgICAgICAgICAgd2luZG93LmF0dGFjaEV2ZW50KCdvbnJlc2l6ZScsICQkLnJlc2l6ZUZ1bmN0aW9uKTtcbiAgICAgICAgfSBlbHNlIGlmICh3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcikge1xuICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ3Jlc2l6ZScsICQkLnJlc2l6ZUZ1bmN0aW9uLCBmYWxzZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICA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0aW9ucygpIHtcbiAgICAgICAgICAgIHJlc2l6ZUZ1bmN0aW9ucy5mb3JFYWNoKGZ1bmN0aW9uIChmKSB7XG4gICAgICAgICAgICAgICAgZigpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgY2FsbFJlc2l6ZUZ1bmN0aW9ucy5hZGQgPSBmdW5jdGlvbiAoZikge1xuICAgICAgICAgICAgcmVzaXplRnVuY3Rpb25zLnB1c2goZik7XG4gICAgICAgIH07XG4gICAgICAgIGNhbGxSZXNpemVGdW5jdGlvbnMucmVtb3ZlID0gZnVuY3Rpb24gKGYpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcmVzaXplRnVuY3Rpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlc2l6ZUZ1bmN0aW9uc1tpXSA9PT0gZikge1xuICAgICAgICAgICAgICAgICAgICByZXNpemVGdW5jdGlvbnMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBjYWxsUmVzaXplRnVuY3Rpb25zO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5lbmRhbGwgPSBmdW5jdGlvbiAodHJhbnNpdGlvbiwgY2FsbGJhY2spIHtcbiAgICAgICAgdmFyIG4gPSAwO1xuICAgICAgICB0cmFuc2l0aW9uXG4gICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoKSB7ICsrbjsgfSlcbiAgICAgICAgICAgIC5lYWNoKFwiZW5kXCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoIS0tbikgeyBjYWxsYmFjay5hcHBseSh0aGlzLCBhcmd1bWVudHMpOyB9XG4gICAgICAgICAgICB9KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlV2FpdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHRyYW5zaXRpb25zVG9XYWl0ID0gW10sXG4gICAgICAgICAgICBmID0gZnVuY3Rpb24gKHRyYW5zaXRpb24sIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRpbWVyID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZG9uZSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25zVG9XYWl0LmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0LmVtcHR5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lICs9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0LnRyYW5zaXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lICs9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZG9uZSA9PT0gdHJhbnNpdGlvbnNUb1dhaXQubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjaykgeyBjYWxsYmFjaygpOyB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LCAxMCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICBmLmFkZCA9IGZ1bmN0aW9uICh0cmFuc2l0aW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maW5lZCxcbiAgICAgICAgICAgIHJlc2l6ZV9hdXRvOiB0cnVlLFxuICAgICAgICAgICAgem9vbV9lbmFibGVkOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb21fZXh0ZW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICB6b29tX3ByaXZpbGVnZWQ6IGZhbHNlLFxuICAgICAgICAgICAgem9vbV9yZXNjYWxlOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb21fb256b29tOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHpvb21fb256b29tc3RhcnQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgem9vbV9vbnpvb21lbmQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgem9vbV94X21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgem9vbV94X21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgaW50ZXJhY3Rpb25fYnJpZ2h0ZW46IHRydWUsXG4gICAgICAgICAgICBpbnRlcmFjdGlvbl9lbmFibGVkOiB0cnVlLFxuICAgICAgICAgICAgb25tb3VzZW92ZXI6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25tb3VzZW91dDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbnJlc2l6ZTogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbnJlc2l6ZWQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25pbml0OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9ucmVuZGVyZWQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgdHJhbnNpdGlvbl9kdXJhdGlvbjogMzUwLFxuICAgICAgICAgICAgZGF0YV94OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX3hzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfeEZvcm1hdDogJyVZLSVtLSVkJyxcbiAgICAgICAgICAgIGRhdGFfeExvY2FsdGltZTogdHJ1ZSxcbiAgICAgICAgICAgIGRhdGFfeFNvcnQ6IHRydWUsXG4gICAgICAgICAgICBkYXRhX2lkQ29udmVydGVyOiBmdW5jdGlvbiAoaWQpIHsgcmV0dXJuIGlkOyB9LFxuICAgICAgICAgICAgZGF0YV9uYW1lczoge30sXG4gICAgICAgICAgICBkYXRhX2NsYXNzZXM6IHt9LFxuICAgICAgICAgICAgZGF0YV9ncm91cHM6IFtdLFxuICAgICAgICAgICAgZGF0YV9heGVzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfdHlwZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV90eXBlczoge30sXG4gICAgICAgICAgICBkYXRhX2xhYmVsczoge30sXG4gICAgICAgICAgICBkYXRhX29yZGVyOiAnZGVzYycsXG4gICAgICAgICAgICBkYXRhX3JlZ2lvbnM6IHt9LFxuICAgICAgICAgICAgZGF0YV9jb2xvcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV9jb2xvcnM6IHt9LFxuICAgICAgICAgICAgZGF0YV9oaWRlOiBmYWxzZSxcbiAgICAgICAgICAgIGRhdGFfZmlsdGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX3NlbGVjdGlvbl9lbmFibGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGRhdGFfc2VsZWN0aW9uX2dyb3VwZWQ6IGZhbHNlLFxuICAgICAgICAgICAgZGF0YV9zZWxlY3Rpb25faXNzZWxlY3RhYmxlOiBmdW5jdGlvbiAoKSB7IHJldHVybiB0cnVlOyB9LFxuICAgICAgICAgICAgZGF0YV9zZWxlY3Rpb25fbXVsdGlwbGU6IHRydWUsXG4gICAgICAgICAgICBkYXRhX3NlbGVjdGlvbl9kcmFnZ2FibGU6IGZhbHNlLFxuICAgICAgICAgICAgZGF0YV9vbmNsaWNrOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIGRhdGFfb25tb3VzZW92ZXI6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgZGF0YV9vbm1vdXNlb3V0OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIGRhdGFfb25zZWxlY3RlZDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBkYXRhX29udW5zZWxlY3RlZDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBkYXRhX3VybDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV9oZWFkZXJzOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX2pzb246IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRhdGFfcm93czogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV9jb2x1bW5zOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX21pbWVUeXBlOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX2tleXM6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vIGNvbmZpZ3VyYXRpb24gZm9yIG5vIHBsb3QtYWJsZSBkYXRhIHN1cHBsaWVkLlxuICAgICAgICAgICAgZGF0YV9lbXB0eV9sYWJlbF90ZXh0OiBcIlwiLFxuICAgICAgICAgICAgLy8gc3ViY2hhcnRcbiAgICAgICAgICAgIHN1YmNoYXJ0X3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgc3ViY2hhcnRfc2l6ZV9oZWlnaHQ6IDYwLFxuICAgICAgICAgICAgc3ViY2hhcnRfYXhpc194X3Nob3c6IHRydWUsXG4gICAgICAgICAgICBzdWJjaGFydF9vbmJydXNoOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIC8vIGNvbG9yXG4gICAgICAgICAgICBjb2xvcl9wYXR0ZXJuOiBbXSxcbiAgICAgICAgICAgIGNvbG9yX3RocmVzaG9sZDoge30sXG4gICAgICAgICAgICAvLyBsZWdlbmRcbiAgICAgICAgICAgIGxlZ2VuZF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgbGVnZW5kX2hpZGU6IGZhbHNlLFxuICAgICAgICAgICAgbGVnZW5kX3Bvc2l0aW9uOiAnYm90dG9tJyxcbiAgICAgICAgICAgIGxlZ2VuZF9pbnNldF9hbmNob3I6ICd0b3AtbGVmdCcsXG4gICAgICAgICAgICBsZWdlbmRfaW5zZXRfeDogMTAsXG4gICAgICAgICAgICBsZWdlbmRfaW5zZXRfeTogMCxcbiAgICAgICAgICAgIGxlZ2VuZF9pbnNldF9zdGVwOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBsZWdlbmRfaXRlbV9vbmNsaWNrOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBsZWdlbmRfaXRlbV9vbm1vdXNlb3ZlcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgbGVnZW5kX2l0ZW1fb25tb3VzZW91dDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgbGVnZW5kX2VxdWFsbHk6IGZhbHNlLFxuICAgICAgICAgICAgbGVnZW5kX3BhZGRpbmc6IDAsXG4gICAgICAgICAgICBsZWdlbmRfaXRlbV90aWxlX3dpZHRoOiAxMCxcbiAgICAgICAgICAgIGxlZ2VuZF9pdGVtX3RpbGVfaGVpZ2h0OiAxMCxcbiAgICAgICAgICAgIC8vIGF4aXNcbiAgICAgICAgICAgIGF4aXNfcm90YXRlZDogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3hfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90eXBlOiAnaW5kZXhlZCcsXG4gICAgICAgICAgICBheGlzX3hfbG9jYWx0aW1lOiB0cnVlLFxuICAgICAgICAgICAgYXhpc194X2NhdGVnb3JpZXM6IFtdLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfY2VudGVyZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfdGlja19jdWxsaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2N1bGxpbmdfbWF4OiAxMCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2NvdW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfdGlja19maXQ6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfdGlja192YWx1ZXM6IG51bGwsXG4gICAgICAgICAgICBheGlzX3hfdGlja19yb3RhdGU6IDAsXG4gICAgICAgICAgICBheGlzX3hfdGlja19vdXRlcjogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX211bHRpbGluZTogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX3dpZHRoOiBudWxsLFxuICAgICAgICAgICAgYXhpc194X21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X3BhZGRpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc194X2hlaWdodDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X2V4dGVudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X2xhYmVsOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeV9zaG93OiB0cnVlLFxuICAgICAgICAgICAgYXhpc195X3R5cGU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9pbnZlcnRlZDogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3lfY2VudGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfaW5uZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9sYWJlbDoge30sXG4gICAgICAgICAgICBheGlzX3lfdGlja19mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX291dGVyOiB0cnVlLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdmFsdWVzOiBudWxsLCAgICAgICAgXG4gICAgICAgICAgICBheGlzX3lfdGlja19yb3RhdGU6IDAsXG4gICAgICAgICAgICBheGlzX3lfdGlja19jb3VudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdGltZV92YWx1ZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdGltZV9pbnRlcnZhbDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3BhZGRpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc195X2RlZmF1bHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3kyX21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfaW52ZXJ0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc195Ml9jZW50ZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfaW5uZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfbGFiZWw6IHt9LFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX291dGVyOiB0cnVlLFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX3ZhbHVlczogbnVsbCxcbiAgICAgICAgICAgIGF4aXNfeTJfdGlja19jb3VudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9wYWRkaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeTJfZGVmYXVsdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gZ3JpZFxuICAgICAgICAgICAgZ3JpZF94X3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgZ3JpZF94X3R5cGU6ICd0aWNrJyxcbiAgICAgICAgICAgIGdyaWRfeF9saW5lczogW10sXG4gICAgICAgICAgICBncmlkX3lfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICAvLyBub3QgdXNlZFxuICAgICAgICAgICAgLy8gZ3JpZF95X3R5cGU6ICd0aWNrJyxcbiAgICAgICAgICAgIGdyaWRfeV9saW5lczogW10sXG4gICAgICAgICAgICBncmlkX3lfdGlja3M6IDEwLFxuICAgICAgICAgICAgZ3JpZF9mb2N1c19zaG93OiB0cnVlLFxuICAgICAgICAgICAgZ3JpZF9saW5lc19mcm9udDogdHJ1ZSxcbiAgICAgICAgICAgIC8vIHBvaW50IC0gcG9pbnQgb2YgZWFjaCBkYXRhXG4gICAgICAgICAgICBwb2ludF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgcG9pbnRfcjogMi41LFxuICAgICAgICAgICAgcG9pbnRfc2Vuc2l0aXZpdHk6IDEwLFxuICAgICAgICAgICAgcG9pbnRfZm9jdXNfZXhwYW5kX2VuYWJsZWQ6IHRydWUsXG4gICAgICAgICAgICBwb2ludF9mb2N1c19leHBhbmRfcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcG9pbnRfc2VsZWN0X3I6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vIGxpbmVcbiAgICAgICAgICAgIGxpbmVfY29ubmVjdE51bGw6IGZhbHNlLFxuICAgICAgICAgICAgbGluZV9zdGVwX3R5cGU6ICdzdGVwJyxcbiAgICAgICAgICAgIC8vIGJhclxuICAgICAgICAgICAgYmFyX3dpZHRoOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBiYXJfd2lkdGhfcmF0aW86IDAuNixcbiAgICAgICAgICAgIGJhcl93aWR0aF9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGJhcl96ZXJvYmFzZWQ6IHRydWUsXG4gICAgICAgICAgICAvLyBhcmVhXG4gICAgICAgICAgICBhcmV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ybWF0LCBjb2xvcikgOiAnJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB0b29sdGlwX2luaXRfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICB0b29sdGlwX2luaXRfeDogMCxcbiAgICAgICAgICAgIHRvb2x0aXBfaW5pdF9wb3NpdGlvbjoge3RvcDogJzBweCcsIGxlZnQ6ICc1MHB4J30sXG4gICAgICAgICAgICB0b29sdGlwX29uc2hvdzogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB0b29sdGlwX29uaGlkZTogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICAvLyB0aXRsZVxuICAgICAgICAgICAgdGl0bGVfdGV4dDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgdGl0bGVfcGFkZGluZzoge1xuICAgICAgICAgICAgICAgIHRvcDogMCxcbiAgICAgICAgICAgICAgICByaWdodDogMCxcbiAgICAgICAgICAgICAgICBib3R0b206IDAsXG4gICAgICAgICAgICAgICAgbGVmdDogMFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHRpdGxlX3Bvc2l0aW9uOiAndG9wLWNlbnRlcicsXG4gICAgICAgIH07XG5cbiAgICAgICAgT2JqZWN0LmtleXModGhpcy5hZGRpdGlvbmFsQ29uZmlnKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgIGNvbmZpZ1trZXldID0gdGhpcy5hZGRpdGlvbmFsQ29uZmlnW2tleV07XG4gICAgICAgIH0sIHRoaXMpO1xuXG4gICAgICAgIHJldHVybiBjb25maWc7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5hZGRpdGlvbmFsQ29uZmlnID0ge307XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5sb2FkQ29uZmlnID0gZnVuY3Rpb24gKGNvbmZpZykge1xuICAgICAgICB2YXIgdGhpc19jb25maWcgPSB0aGlzLmNvbmZpZywgdGFyZ2V0LCBrZXlzLCByZWFkO1xuICAgICAgICBmdW5jdGlvbiBmaW5kKCkge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXMuc2hpZnQoKTtcbiAgICAvLyAgICAgICAgY29uc29sZS5sb2coXCJrZXkgPT5cIiwga2V5LCBcIiwgdGFyZ2V0ID0+XCIsIHRhcmdldCk7XG4gICAgICAgICAgICBpZiAoa2V5ICYmIHRhcmdldCAmJiB0eXBlb2YgdGFyZ2V0ID09PSAnb2JqZWN0JyAmJiBrZXkgaW4gdGFyZ2V0KSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0ID0gdGFyZ2V0W2tleV07XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKCFrZXkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGFyZ2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBPYmplY3Qua2V5cyh0aGlzX2NvbmZpZykuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICB0YXJnZXQgPSBjb25maWc7XG4gICAgICAgICAgICBrZXlzID0ga2V5LnNwbGl0KCdfJyk7XG4gICAgICAgICAgICByZWFkID0gZmluZCgpO1xuICAgIC8vICAgICAgICBjb25zb2xlLmxvZyhcIkNPTkZJRyA6IFwiLCBrZXksIHJlYWQpO1xuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyZWFkKSkge1xuICAgICAgICAgICAgICAgIHRoaXNfY29uZmlnW2tleV0gPSByZWFkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0U2NhbGUgPSBmdW5jdGlvbiAobWluLCBtYXgsIGZvclRpbWVzZXJpZXM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AgICAgICBmb3IgKGtleSBpbiBfc2NhbGUpIHtcbiAgICAgICAgICAgIHNjYWxlW2tleV0gPSBfc2NhbGVba2V5XTtcbiAgICAgICAgfVxuICAgICAgICBzY2FsZS5vcmdEb21haW4gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gX3NjYWxlLmRvbWFpbigpO1xuICAgICAgICB9O1xuICAgICAgICAvLyBkZWZpbmUgY3VzdG9tIGRvbWFpbigpIGZvciBjYXRlZ29yaXplZCBheGlzXG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIHNjYWxlLmRvbWFpbiA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgZG9tYWluID0gdGhpcy5vcmdEb21haW4oKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtkb21haW5bMF0sIGRvbWFpblsxXSArIDFdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBfc2NhbGUuZG9tYWluKGRvbWFpbik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNjYWxlO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc2NhbGU7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRZID0gZnVuY3Rpb24gKG1pbiwgbWF4LCBkb21haW4pIHtcbiAgICAgICAgdmFyIHNjYWxlID0gdGhpcy5nZXRTY2FsZShtaW4sIG1heCwgdGhpcy5pc1RpbWVTZXJpZXNZKCkpO1xuICAgICAgICBpZiAoZG9tYWluKSB7IHNjYWxlLmRvbWFpbihkb21haW4pOyB9XG4gICAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFlTY2FsZSA9IGZ1bmN0aW9uIChpZCkge1xuICAgICAgICByZXR1cm4gdGhpcy5heGlzLmdldElkKGlkKSA9PT0gJ3kyJyA/IHRoaXMueTIgOiB0aGlzLnk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRTdWJZU2NhbGUgPSBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYXhpcy5nZXRJZChpZCkgPT09ICd5MicgPyB0aGlzLnN1YlkyIDogdGhpcy5zdWJZO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlU2NhbGVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBmb3JJbml0ID0gISQkLng7XG4gICAgICAgIC8vIHVwZGF0ZSBlZGdlc1xuICAgICAgICAkJC54TWluID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDEgOiAwO1xuICAgICAgICAkJC54TWF4ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmhlaWdodCA6ICQkLndpZHRoO1xuICAgICAgICAkJC55TWluID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiAkJC5oZWlnaHQ7XG4gICAgICAgICQkLnlNYXggPSBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiAxO1xuICAgICAgICAkJC5zdWJYTWluID0gJCQueE1pbjtcbiAgICAgICAgJCQuc3ViWE1heCA9ICQkLnhNYXg7XG4gICAgICAgICQkLnN1YllNaW4gPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6ICQkLmhlaWdodDI7XG4gICAgICAgICQkLnN1YllNYXggPSBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGgyIDogMTtcbiAgICAgICAgLy8gdXBkYXRlIHNjYWxlc1xuICAgICAgICAkJC54ID0gJCQuZ2V0WCgkJC54TWluLCAkJC54TWF4LCBmb3JJbml0ID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zZUlkXS5mb3JFYWNoKGZ1bmN0aW9uICh2LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldID0gdiA8IDAgPyB2IDogMDtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIENvbXB1dGUgbWluXG4gICAgICAgICAgICAgICAgZm9yIChrID0gMTsgayA8IGlkc0luR3JvdXAubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBpZHNJbkdyb3VwW2tdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISB5c1tpZF0pIHsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICAgICAgeXNbaWRdLmZvckVhY2goZnVuY3Rpb24gKHYsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkJC5heGlzLmdldElkKGlkKSA9PT0gJCQuYXhpcy5nZXRJZChiYXNlSWQpICYmIHlzW2Jhc2VJZF0gJiYgIShoYXNOZWdhdGl2ZVZhbHVlICYmICt2ID4gMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldICs9ICt2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICQkLmQzLm1pbihPYmplY3Qua2V5cyh5cykubWFwKGZ1bmN0aW9uIChrZXkpIHsgcmV0dXJuICQkLmQzLm1pbih5c1trZXldKTsgfSkpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WURvbWFpbk1heCA9IGZ1bmN0aW9uICh0YXJnZXRzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIGlkcyA9ICQkLm1hcFRvSWRzKHRhcmdldHMpLCB5cyA9ICQkLmdldFZhbHVlc0FzSWRLZXllZCh0YXJnZXRzKSxcbiAgICAgICAgICAgIGosIGssIGJhc2VJZCwgaWRzSW5Hcm91cCwgaWQsIGhhc1Bvc2l0aXZlVmFsdWU7XG4gICAgICAgIGlmIChjb25maWcuZGF0YV9ncm91cHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgaGFzUG9zaXRpdmVWYWx1ZSA9ICQkLmhhc1Bvc2l0aXZlVmFsdWVJblRhcmdldHModGFyZ2V0cyk7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY29uZmlnLmRhdGFfZ3JvdXBzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgLy8gRGV0ZXJtaW5lIGJhc2VJZFxuICAgICAgICAgICAgICAgIGlkc0luR3JvdXAgPSBjb25maWcuZGF0YV9ncm91cHNbal0uZmlsdGVyKGZ1bmN0aW9uIChpZCkgeyByZXR1cm4gaWRzLmluZGV4T2YoaWQpID49IDA7IH0pO1xuICAgICAgICAgICAgICAgIGlmIChpZHNJbkdyb3VwLmxlbmd0aCA9PT0gMCkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgIGJhc2VJZCA9IGlkc0luR3JvdXBbMF07XG4gICAgICAgICAgICAgICAgLy8gQ29uc2lkZXIgcG9zaXRpdmUgdmFsdWVzXG4gICAgICAgICAgICAgICAgaWYgKGhhc1Bvc2l0aXZlVmFsdWUgJiYgeXNbYmFzZUlkXSkge1xuICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdLmZvckVhY2goZnVuY3Rpb24gKHYsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF1baV0gPSB2ID4gMCA/IHYgOiAwO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gQ29tcHV0ZSBtYXhcbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDwgaWRzSW5Hcm91cC5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IGlkc0luR3JvdXBba107XG4gICAgICAgICAgICAgICAgICAgIGlmICghIHlzW2lkXSkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgICAgICB5c1tpZF0uZm9yRWFjaChmdW5jdGlvbiAodiwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmF4aXMuZ2V0SWQoaWQpID09PSAkJC5heGlzLmdldElkKGJhc2VJZCkgJiYgeXNbYmFzZUlkXSAmJiAhKGhhc1Bvc2l0aXZlVmFsdWUgJiYgK3YgPCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF1baV0gKz0gK3Y7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gJCQuZDMubWF4KE9iamVjdC5rZXlzKHlzKS5tYXAoZnVuY3Rpb24gKGtleSkgeyByZXR1cm4gJCQuZDMubWF4KHlzW2tleV0pOyB9KSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRZRG9tYWluID0gZnVuY3Rpb24gKHRhcmdldHMsIGF4aXNJZCwgeERvbWFpbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICB0YXJnZXRzQnlBeGlzSWQgPSB0YXJnZXRzLmZpbHRlcihmdW5jdGlvbiAodCkgeyByZXR1cm4gJCQuYXhpcy5nZXRJZCh0LmlkKSA9PT0gYXhpc0lkOyB9KSxcbiAgICAgICAgICAgIHlUYXJnZXRzID0geERvbWFpbiA/ICQkLmZpbHRlckJ5WERvbWFpbih0YXJnZXRzQnlBeGlzSWQsIHh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LFxuICAgICAgICAgICAgc2hvd1ZlcnRpY2FsRGF0YUxhYmVsID0gJCQuaGFzRGF0YUxhYmVsKCkgJiYgIWNvbmZpZy5heGlzX3JvdGF0ZWQ7XG5cbiAgICAgICAgLy8gTUVNTzogYXZvaWQgaW52ZXJ0aW5nIGRvbWFpbiB1bmV4cGVjdGVkbHlcbiAgICAgICAgeURvbWFpbk1pbiA9IGlzVmFsdWUoeU1pbikgPyB5TWluIDogaXNWYWx1ZSh5TWF4KSA/ICh5RG9tYWluTWluIDwgeU1heCA/IHlEb21haW5NaW4gOiB5TWF4IC0gMTApIDogeURvbWFpbk1pbjtcbiAgICAgICAgeURvbWFpbk1heCA9IGlzVmFsdWUoeU1heCkgPyB5TWF4IDogaXNWYWx1ZSh5TWluKSA/ICh5TWluIDwgeURvbWFpbk1heCA/IHlEb21haW5NYXggOiB5TWluICsgMTApIDogeURvbWFpbk1heDtcblxuICAgICAgICBpZiAoeVRhcmdldHMubGVuZ3RoID09PSAwKSB7IC8vIHVzZSBjdXJyZW50IGRvbWFpbiBpZiB0YXJnZXQgb2YgYXhpc0lkIGlzIG5vbmVcbiAgICAgICAgICAgIHJldHVybiBheGlzSWQgPT09ICd5MicgPyAkJC55Mi5kb21haW4oKSA6ICQkLnkuZG9tYWluKCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzTmFOKHlEb21haW5NaW4pKSB7IC8vIHNldCBtaW5pbXVtIHRvIHplcm8gd2hlbiBub3QgbnVtYmVyXG4gICAgICAgICAgICB5RG9tYWluTWluID0gMDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNOYU4oeURvbWFpbk1heCkpIHsgLy8gc2V0IG1heGltdW0gdG8gaGF2ZSBzYW1lIHZhbHVlIGFzIHlEb21haW5NaW5cbiAgICAgICAgICAgIHlEb21haW5NYXggPSB5RG9tYWluTWluO1xuICAgICAgICB9XG4gICAgICAgIGlmICh5RG9tYWluTWluID09PSB5RG9tYWluTWF4KSB7XG4gICAgICAgICA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CQuZDMubWF4KHQudmFsdWVzLCBmdW5jdGlvbiAodikgeyByZXR1cm4gdi54OyB9KTsgfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRYRG9tYWluUGFkZGluZyA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgZGlmZiA9IGRvbWFpblsxXSAtIGRvbWFpblswXSxcbiAgICAgICAgICAgIG1heERhdGFDb3VudCwgcGFkZGluZywgcGFkZGluZ0xlZnQsIHBhZGRpbmdSaWdodDtcbiAgICAgICAgaWYgKCQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgcGFkZGluZyA9IDA7XG4gICAgICAgIH0gZWxzZSBpZiAoJCQuaGFzVHlwZSgnYmFyJykpIHtcbiAgICAgICAgICAgIG1heERhdGFDb3VudCA9ICQkLmdldE1heERhdGFDb3VudCgpO1xuICAgICAgICAgICAgcGFkZGluZyA9IG1heERhdGFDb3VudCA+IDEgPyAoZGlmZiAvIChtYXhEYXRhQ291bnQgLSAxKSkgLyAyIDogMC41O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcGFkZGluZyA9IGRpZmYgKiAwLjAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgY29uZmlnLmF4aXNfeF9wYWRkaW5nID09PSAnb2JqZWN0JyAmJiBub3RFbXB0eShjb25maWcuYXhpc194X3BhZGRpbmcpKSB7XG4gICAgICAgICAgICBwYWRkaW5nTGVmdCA9IGlzVmFsdWUoY29uZmlnLmF4aXNfeF9wYWRkaW5nLmxlZnQpID8gY29uZmlnLmF4aXNfeF9wYWRkaW5nLmxlZnQgOiBwYWRkaW5nO1xuICAgICAgICAgICAgcGFkZGluZ1JpZ2h0ID0gaXNWYWx1ZShjb25maWcuYXhpc194X3BhZGRpbmcucmlnaHQpID8gY29uZmlnLmF4aX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gICAgICAgbGFzdFggPSBuZXcgRGF0ZShsYXN0WC5nZXRUaW1lKCkgKiAxLjUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBmaXJzdFggPSBmaXJzdFggPT09IDAgPyAxIDogKGZpcnN0WCAqIDAuNSk7XG4gICAgICAgICAgICAgICAgbGFzdFggPSBsYXN0WCA9PT0gMCA/IC0xIDogKGxhc3RYICogMS41KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoZmlyc3RYIHx8IGZpcnN0WCA9PT0gMCkge1xuICAgICAgICAgICAgbWluID0gJCQuaXNUaW1lU2VyaWVzKCkgPyBuZXcgRGF0ZShmaXJzdFguZ2V0VGltZSgpIC0gcGFkZGluZy5sZWZ0KSA6IGZpcnN0WCAtIHBhZGRpbmcubGVmdDtcbiAgICAgICAgfVxuICAgICAgICBpZiAobGFzdFggfHwgbGFzdFggPT09IDApIHtcbiAgICAgICAgICAgIG1heCA9ICQkLmlzVGltZVNlcmllcygpID8gbmV3IERhdGUobGFzdFguZ2V0VGltZSgpICsgcGFkZGluZy5yaWdodCkgOiBsYXN0WCArIHBhZGRpbmcucmlnaHQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFttaW4sIG1heF07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVYRG9tYWluID0gZnVuY3Rpb24gKHRhcmdldHMsIHdpdGhVcGRhdGVYRG9tYWluLCB3aXRoVXBkYXRlT3JnWERvbWFpbiwgd2l0aFRyaW0sIGRvbWFpbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG5cbiAgICAgICAgaWYgKHdpdGhVcGRhdGVPcmdYRG9tYWluKSB7XG4gICAgICAgICAgICAkJC54LmRvbWFpbihkb21haW4gPyBkb21haW4gOiAkJC5kMy5leHRlbnQoJCQuZ2V0WERvbWFpbih0YXJnZXRzKSkpO1xuICAgICAgICAgICAgJCQub3JnWERvbWFpbiA9ICQkLnguZG9tYWluKCk7XG4gICAgICAgICAgICBpZiAoY29uZmlnLnpvb21fZW5hYmxlZCkgeyAkJC56b29tLnNjYWxlKCQkLngpLnVwZGF0ZVNjYWxlRXh0ZW50KCk7IH1cbiAgICAgICAgICAgICQkLnN1YlguZG9tYWluKCQkLnguZG9tYWluKCkpO1xuICAgICAgICAgICAgaWYgKCQkLmJydXNoKSB7ICQkLmJydXNoLnNjYWxlKCQkLnN1YlgpOyB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHdpdGhVcGRhdGVYRG9tYWluKSB7XG4gICAgICAgICAgICAkJC54LmRvbWFpbihkb21haW4gPyBkb21haW4gOiAoISQkLmJydXNoIHx8ICQkLmJydXNoLmVtcHR5KCkpID8gJCQub3JnWERvbWFpbiA6ICQkLmJydXNoLmV4dGVudCgpKTtcbiAgICAgICAgICAgIGlmIChjb25maWcuem9vbV9lbmFibGVkKSB7ICQkLnpvb20uc2NhbGUoJCQueCkudXBkYXRlU2NhbGVFeHRlbnQoKTsgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gVHJpbSBkb21haW4gd2hlbiB0b28gYmlnIGJ5IHpvb20gbW91c2Vtb3ZlIGV2ZW50XG4gICAgICAgIGlmICh3aXRoVHJpbSkgeyAkJC54LmRvbWFpbigkJC50cmltWERvbWFpbigkJC54Lm9yZ0RvbWFpbigpKSk7IH1cblxuICAgICAgICByZXR1cm4gJCQueC5kb21haW4oKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnRyaW1YRG9tYWluID0gZnVuY3Rpb24gKGRvbWFpbikge1xuICAgICAgICB2YXIgem9vbURvbWFpbiA9IHRoaXMuZ2V0Wm9vbURvbWFpbigpLFxuICAgICAgICAgICAgbWluID0gem9vbURvbWFpblswXSwgbWF4ID0gem9vbURvbWFpblsxXTtcbiAgICAgICAgaWYgKGRvbWFpblswXSA8PSBtaW4pIHtcbiAg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biAoKSB7XG4gICAgICAgIHZhciBjb25maWcgPSB0aGlzLmNvbmZpZztcbiAgICAgICAgaWYgKHR5cGVvZiBjb25maWcuZGF0YV9sYWJlbHMgPT09ICdib29sZWFuJyAmJiBjb25maWcuZGF0YV9sYWJlbHMpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBjb25maWcuZGF0YV9sYWJlbHMgPT09ICdvYmplY3QnICYmIG5vdEVtcHR5KGNvbmZpZy5kYXRhX2xhYmVscykpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldERhdGFMYWJlbExlbmd0aCA9IGZ1bmN0aW9uIChtaW4sIG1heCwga2V5KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBsZW5ndGhzID0gWzAsIDBdLCBwYWRkaW5nQ29lZiA9IDEuMztcbiAgICAgICAgJCQuc2VsZWN0Q2hhcnQuc2VsZWN0KCdzdmcnKS5zZWxlY3RBbGwoJy5kdW1teScpXG4gICAgICAgICAgICAuZGF0YShbbWluLCBtYXhdKVxuICAgICAgICAgICAgLmVudGVyKCkuYXBwZW5kKCd0ZXh0JylcbiAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uIChkKSB7IHJldHVybiAkJC5kYXRhTGFiZWxGb3JtYXQoZC5pZCkoZCk7IH0pXG4gICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoZCwgaSkge1xuICAgICAgICAgICAgICAgIGxlbmd0aHNbaV0gPSB0aGlzLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpW2tleV0gKiBwYWRkaW5nQ29lZjtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAucmVtb3ZlKCk7XG4gICAgICAgIHJldHVybiBsZW5ndGhzO1xuICAgIH07XG4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pZF07XG4gICAgICAgIH0pO1xuICAgICAgICAkJC5yZWRyYXcoe3dpdGhMZWdlbmQ6IHRydWV9KTtcbiAgICAgICAgcmV0dXJuIGN1cnJlbnQ7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRVcmxUb0RhdGEgPSBmdW5jdGlvbiAodXJsLCBtaW1lVHlwZSwgaGVhZGVycywga2V5cywgZG9uZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCB0eXBlID0gbWltZVR5cGUgPyBtaW1lVHlwZSA6ICdjc3YnO1xuICAgICAgICB2YXIgcmVxID0gJCQuZDMueGhyKHVybCk7XG4gICAgICAgIGlmIChoZWFkZXJzKSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhoZWFkZXJzKS5mb3JFYWNoKGZ1bmN0aW9uIChoZWFkZXIpIHtcbiAgICAgICAgICAgICAgICByZXEuaGVhZGVyKGhlYWRlciwgaGVhZGVyc1toZWFkZXJdKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJlcS5nZXQoZnVuY3Rpb24gKGVycm9yLCBkYXRhKSB7XG4gICAgICAgICAgICB2YXIgZDtcbiAgICAgICAgICAgIGlmICghZGF0YSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihlcnJvci5yZXNwb25zZVVSTCArICcgJyArIGVycm9yLnN0YXR1cyArICcgKCcgKyBlcnJvci5zdGF0dXNUZXh0ICsgJyknKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0eXBlID09PSAnanNvbicpIHtcbiAgICAgICAgICAgICAgICBkID0gJCQuY29udmVydEpzb25Ub0RhdGEoSlNPTi5wYXJzZShkYXRhLnJlc3BvbnNlKSwga2V5cyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICd0c3YnKSB7XG4gICAgICAgICAgICAgICAgZCA9ICQkLmNvbnZlcnRUc3ZUb0RhdG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lzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBuZXdfcm93cyA9IFtdLCB0YXJnZXRLZXlzLCBkYXRhO1xuICAgICAgICBpZiAoa2V5cykgeyAvLyB3aGVuIGtleXMgc3BlY2lmaWVkLCBqc29uIHdvdWxkIGJlIGFuIGFycmF5IHRoYXQgaW5jbHVkZXMgb2JqZWN0c1xuICAgICAgICAgICAgaWYgKGtleXMueCkge1xuICAgICAgICAgICAgICAgIHRhcmdldEtleXMgPSBrZXlzLnZhbHVlLmNvbmNhdChrZXlzLngpO1xuICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX3ggPSBrZXlzLng7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRhcmdldEtleXMgPSBrZXlzLnZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmV3X3Jvd3MucHVzaCh0YXJnZXRLZXlzKTtcbiAgICAgICAgICAgIGpzb24uZm9yRWFjaChmdW5jdGlvbiAobykge1xuICAgICAgICAgICAgICAgIHZhciBuZXdfcm93ID0gW107XG4gICAgICAgICAgICAgICAgdGFyZ2V0S2V5cy5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gY29udmVydCB1bmRlZmluZWQgdG8gbnVsbCBiZWNhdXNlIHVuZGVmaW5lZCBkYXRhIHdpbGwgYmUgcmVtb3ZlZCBpbiBjb252ZXJ0RGF0YVRvVGFyZ2V0cygpXG4gICAgICAgICAgICAgICAgICAgIHZhciB2ID0gJCQuZmluZFZhbHVlSW5Kc29uKG8sIGtleSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZCh2KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdiA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbmV3X3Jvdy5wdXNoKHYpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIG5ld19yb3dzLnB1c2gobmV3X3Jvdyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGRhdGEgPSAkJC5jb252ZXJ0Um93c1RvRGF0YShuZXdfcm93cyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhqc29uKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICBuZXdfcm93cy5wdXNoKFtrZXldLmNvbmNhdChqc29uW2tleV0pKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRDb2x1bW5zVG9EYXRhKG5ld19yb3dzKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZGF0YTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmZpbmRWYWx1ZUluSnNvbiA9IGZ1bmN0aW9uIChvYmplY3QsIHBhdGgpIHtcbiAgICAgICAgcGF0aCA9IHBhdGgucmVwbGFjZSgvXFxbKFxcdyspXFxdL2csICcuJDEnKTsgLy8gY29udmVydCBpbmRleGVzIHRvIHByb3BlcnRpZXMgKHJlcGxhY2UgW10gd2l0aCAuKVxuICAgICAgICBwYXRoID0gcGF0aC5yZXBsYWNlKC9eXFwuLywgJycpOyAgICAgICAgICAgLy8gc3RyaXAgYSBsZWFkaW5nIGRvdFxuICAgICAgICB2YXIgcGF0aEFycmF5ID0gcGF0aC5zcGxpdCgnLicpO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBhdGhBcnJheS5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgdmFyIGsgPSBwYXRoQXJyYXlbaV07XG4gICAgICAgICAgICBpZiAoayBpbiBvYmplY3QpIHtcbiAgICAgICAgICAgICAgICBvYmplY3QgPSBvYmplY3Rba107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb2JqZWN0O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydFJvd3NUb0RhdGEgPSBmdW5jdGlvbiAocm93cykge1xuICAgICAgICB2YXIga2V5cyA9IHJvd3NbMF0sIG5ld19yb3cgPSB7fSwgbmV3X3Jvd3MgPSBbXSwgaSwgajtcbiAgICAgICAgZm9yIChpID0gMTsgaSA8IHJvd3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIG5ld19yb3cgPSB7fTtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCByb3dzW2ldLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHJvd3NbaV1bal0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlNvdXJjZSBkYXRhIGlzIG1pc3NpbmcgYSBjb21wb25lbnQgYXQgKFwiICsgaSArIFwiLFwiICsgaiArIFwiKSFcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5ld19yb3dba2V5c1tqXV0gPSByb3dzW2ldW2pdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmV3X3Jvd3MucHVzaChuZXdfcm93KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3X3Jvd3M7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0Q29sdW1uc1RvRGF0YSA9IGZ1bmN0aW9uIChjb2x1bW5zKSB7XG4gICAgICAgIHZhciBuZXdfcm93cyA9IFtdLCBpLCBqLCBrZXk7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb2x1bW5zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBrZXkgPSBjb2x1bW5zW2ldWzBdO1xuICAgICAgICAgICAgZm9yIChqID0gMTsgaiA8IGNvbHVtbnNbaV0ubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQobmV3X3Jvd3NbaiAtIDFdKSkge1xuICAgICAgICAgICAgICAgICAgICBuZXdfcm93c1tqIC0gMV0gPSB7fTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGNvbHVtbnNbaV1bal0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlNvdXJjZSBkYXRhIGlzIG1pc3NpbmcgYSBjb21wb25lbnQgYXQgKFwiICsgaSArIFwiLFwiICsgaiArIFwiKSFcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5ld19yb3dzW2ogLSAxXVtrZXldID0gY29sdW1uc1tpXVtqXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3X3Jvd3M7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0RGF0YVRvVGFyZ2V0cyA9IGZ1bmN0aW9uIChkYXRhLCBhcHBlbmRYcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBpZHMgPSAkJC5kMy5rZXlzKGRhdGFbMF0pLmZpbHRlcigkJC5pc05vdFgsICQkKSxcbiAgICAgICAgICAgIHhzID0gJCQuZDMua2V5cyhkYXRhWzBdKS5maWx0ZXIoJCQuaXNYLCAkJCksXG4gICAgICAgICAgICB0YXJnZXRzO1xuXG4gICAgICAgIC8vIHNhdmUgeCBmb3IgdXBkYXRlIGRhdGEgYnkgbG9hZCB3aGVuIGN1c3RvbSB4IGFuZCBjMy54IEFQSVxuICAgICAgICBpZHMuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgIHZhciB4S2V5ID0gJCQuZ2V0WEtleShpZCk7XG5cbiAgICAgICAgICAgIGlmICgkJC5pc0N1c3RvbVgoKSB8fCAkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgIC8vIGlmIGluY2x1ZGVkIGluIGlucHV0IGRhdGFcbiAgICAgICAgICAgICAgICBpZiAoeHMuaW5kZXhPZih4S2V5KSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmRhdGEueHNbaWRdID0gKGFwcGVuZFhzICYmICQkLmRhdGEueHNbaWRdID8gJCQuZGF0YS54c1tpZF0gOiBbXSkuY29uY2F0KFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGRbeEtleV07IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihpc1ZhbHVlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoZnVuY3Rpb24gKHJhd1gsIGkpIHsgcmV0dXJuICQkLmdlbmVyYXRlVGFyZ2V0WChyYXdYLCBpZCwgaSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIG5vdCBpbmNsdWRlZCBpbiBpbnB1dCBkYXRhLCBmaW5kIGZyb20gcHJlbG9hZGVkIGRhdGEgb2Ygb3RoZXIgaWQncyB4XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoY29uZmlnLmRhdGFfeCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9ICQkLmdldE90aGVyVGFyZ2V0WHMoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gaWYgbm90IGluY2x1ZGVkIGluIGlucHV0IGRhdGEsIGZpbmQgZnJvbSBwcmVsb2FkZWQgZGF0YVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKG5vdEVtcHR5KGNvbmZpZy5kYXRhX3hzKSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9ICQkLmdldFhWYWx1ZXNPZlhLZXkoeEtleSwgJCQuZGF0YS50YXJnZXRzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gTUVNTzogaWYgbm8geCBpbmNsdWRlZCwgdXNlIHNhbWUgeCBvZiBjdXJyZW50IHdpbGwgYmUgdXNlZFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9IGRhdGEubWFwKGZ1bmN0aW9uIChkLCBpKSB7IHJldHVybiBpOyB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cblxuICAgICAgICAvLyBjaGVjayB4IGlzIGRlZmluZWRcbiAgICAgICAgaWRzLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICBpZiAoISQkLmRhdGEueHNbaWRdKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd4IGlzIG5vdCBkZWZpbmVkIGZvciBpZCA9IFwiJyArIGlkICsgJ1wiLicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBjb252ZXJ0IHRvIHRhcmdldFxuICAgICAgICB0YXJnZXRzID0gaWRzLm1hcChmdW5jdGlvbiAoaWQsIGluZGV4KSB7XG4gICAgICAgICAgICB2YXIgY29udmVydGVkSWQgPSBjb25maWcuZGF0YV9pZENvbnZlcnRlcihpZCk7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIGlkOiBjb252ZXJ0ZWRJZCxcbiAgICAgICAgICAgICAgICBpZF9vcmc6IGlkLFxuICAgICAgICAgICAgICAgIHZhbHVlczogZGF0YS5tYXAoZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHhLZXkgPSAkJC5nZXRYS2V5KGlkKSwgcmF3WCA9IGRbeEtleV0sXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGRbaWRdICE9PSBudWxsICYmICFpc05hTihkW2lkXSkgPyArZFtpZF0gOiBudWxsLCB4O1xuICAgICAgICAgICAgICAgICAgICAvLyB1c2UgeCBhcyBjYXRlZ29yaWVzIGlmIGN1c3RvbSB4IGFuZCBjYXRlZ29yaXplZFxuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuaXNDdXN0b21YKCkgJiYgJCQuaXNDYXRlZ29yaXplZCgpICYmIGluZGV4ID09PSAwICYmICFpc1VuZGVmaW5lZChyYXdYKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwICYmIGkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuYXhpc194X2NhdGVnb3JpZXMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSBjb25maWcuYXhpc194X2NhdGVnb3JpZXMuaW5kZXhPZihyYXdYKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh4ID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSBjb25maWcuYXhpc194X2NhdGVnb3JpZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3hfY2F0ZWdvcmllcy5wdXNoKHJhd1gpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgeCAgPSAkJC5nZW5lcmF0ZVRhcmdldFgocmF3WCwgaWQsIGkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIG1hcmsgYXMgeCA9IHVuZGVmaW5lZCBpZiB2YWx1ZSBpcyB1bmRlZmluZWQgYW5kIGZpbHRlciB0byByZW1vdmUgYWZ0ZXIgbWFwcGVkXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChkW2lkXSkgfHwgJCQuZGF0YS54c1tpZF0ubGVuZ3RoIDw9IGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHt4OiB4LCB2YWx1ZTogdmFsdWUsIGlkOiBjb252ZXJ0ZWRJZH07XG4gICAgICAgICAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uICh2KSB7IHJldHVybiBpc0RlZmluZWQodi54KTsgfSlcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIGZpbmlzaCB0YXJnZXRzXG4gICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgdmFyIGk7XG4gICAgICAgICAgICAvLyBzb3J0IHZhbHVlcyBieSBpdHMgeFxuICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3hTb3J0KSB7XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMgPSB0LnZhbHVlcy5zb3J0KGZ1bmN0aW9uICh2MSwgdjIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHgxID0gdjEueCB8fCB2MS54ID09PSAwID8gdjEueCA6IEluZmluaXR5LFxuICAgICAgICAgICAgICAgICAgICAgICAgeDIgPSB2Mi54IHx8IHYyLnggPT09IDAgPyB2Mi54IDogSW5maW5pdHk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB4MSAtIHgyO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gaW5kZXhpbmcgZWFjaCB2YWx1ZVxuICAgICAgICAgICAgaSA9IDA7XG4gICAgICAgICAgICB0LnZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICAgICAgdi5p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BmdW5jdGlvbiAodGFyZ2V0cywgYXJncykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICBpZiAodGFyZ2V0cykge1xuICAgICAgICAgICAgLy8gZmlsdGVyIGxvYWRpbmcgdGFyZ2V0cyBpZiBuZWVkZWRcbiAgICAgICAgICAgIGlmIChhcmdzLmZpbHRlcikge1xuICAgICAgICAgICAgICAgIHRhcmdldHMgPSB0YXJnZXRzLmZpbHRlcihhcmdzLmZpbHRlcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBzZXQgdHlwZSBpZiBhcmdzLnR5cGVzIHx8IGFyZ3MudHlwZSBzcGVjaWZpZWRcbiAgICAgICAgICAgIGlmIChhcmdzLnR5cGUgfHwgYXJncy50eXBlcykge1xuICAgICAgICAgICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdHlwZSA9IGFyZ3MudHlwZXMgJiYgYXJncy50eXBlc1t0LmlkXSA/IGFyZ3MudHlwZXNbdC5pZF0gOiBhcmdzLnR5cGU7XG4gICAgICAgICAgICAgICAgICAgICQkLnNldFRhcmdldFR5cGUodC5pZCwgdHlwZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBVcGRhdGUvQWRkIGRhdGFcbiAgICAgICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0YXJnZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChkLmlkID09PSB0YXJnZXRzW2ldLmlkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkLnZhbHVlcyA9IHRhcmdldHNbaV0udmFsdWVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0cy5zcGxpY2UoaSwgMSk7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gICAgIHggPSAwO1xuICAgICAgICAgICAgeSA9IDA7XG4gICAgICAgICAgICB3ID0gJCQud2lkdGg7XG4gICAgICAgICAgICBoID0gJCQuaGVpZ2h0O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKCgkJC5pc0N1c3RvbVgoKSB8fCAkJC5pc1RpbWVTZXJpZXMoKSkgJiYgISQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuXG4gICAgICAgICAgICAgICAgLy8gdXBkYXRlIGluZGV4IGZvciB4IHRoYXQgaXMgdXNlZCBieSBwcmV2WCBhbmQgbmV4dFhcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVYcygpO1xuXG4gICAgICAgICAgICAgICAgcmVjdFcgPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJldlggPSAkJC5nZXRQcmV2WChkLmluZGV4KSwgbmV4dFggPSAkJC5nZXROZXh0WChkLmluZGV4KTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSB0aGlzIGlzIGEgc2luZ2xlIGRhdGEgcG9pbnQgbWFrZSB0aGUgZXZlbnRSZWN0IGZ1bGwgd2lkdGggKG9yIGhlaWdodClcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsICYmIG5leHRYID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmhlaWdodCA6ICQkLndpZHRoO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsKSB7IHByZXZYID0gJCQueC5kb21haW4oKVswXTsgfVxuICAgICAgICAgICAgICAgICAgICBpZiAobmV4dFggPT09IG51bGwpIHsgbmV4dFggPSAkJC54LmRvbWFpbigpWzFdOyB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE1hdGgubWF4KDAsICgkJC54KG5leHRYKSAtICQkLngocHJldlgpKSAvIDIpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcmVjdFggPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJldlggPSAkJC5nZXRQcmV2WChkLmluZGV4KSwgbmV4dFggPSAkJC5nZXROZXh0WChkLmluZGV4KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNYID0gJCQuZGF0YS54c1tkLmlkXVtkLmluZGV4XTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSB0aGlzIGlzIGEgc2luZ2xlIGRhdGEgcG9pbnQgcG9zaXRpb24gdGhlIGV2ZW50UmVjdCBhdCAwXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2WCA9PT0gbnVsbCAmJiBuZXh0WCA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAocHJldlggPT09IG51bGwpIHsgcHJldlggPSAkJC54LmRvbWFpbigpWzBdOyB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgkJC54KHRoaXNYKSArICQkLngocHJldlgpKSAvIDI7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVjdFcgPSAkJC5nZXRFdmVudFJlY3RXaWR0aCgpO1xuICAgICAgICAgICAgICAgIHJlY3RYID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLngoZC54KSAtIChyZWN0VyAvIDIpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB4ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiByZWN0WDtcbiAgICAgICAgICAgIHkgPSBjb25maWcuYXhpc19y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aW5nKSB7IHJldHVybjsgfSAvLyBkbyBub3RoaW5nIHdoaWxlIGRyYWdnaW5nL2Zsb3dpbmdcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgLy8gRXhwYW5kIHNoYXBlcyBmb3Igc2VsZWN0aW9uXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZCkgeyAkJC5leHBhbmRDaXJjbGVzKGluZGV4LCBudWxsLCB0cnVlKTsgfVxuICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoaW5kZXgsIG51bGwsIHRydWUpO1xuXG4gICAgICAgICAgICAgICAgLy8gQ2FsbCBldmVudCBoYW5kbGVyXG4gICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBpbmRleCkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9vbm1vdXNlb3Zlci5jYWxsKCQkLmFwaSwgZCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gZC5pbmRleDtcbiAgICAgICAgICAgICAgICBpZiAoISQkLmNvbmZpZykgeyByZXR1cm47IH0gLy8gY2hhcnQgaXMgZGVzdHJveWVkXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICAkJC5oaWRlWEdyaWRGb2N1cygpO1xuICAgICAgICAgICAgICAgICQkLmhpZGVUb29sdGlwKCk7XG4gICAgICAgICAgICAgICAgLy8gVW5kbyBleHBhbmRlZCBzaGFwZXNcbiAgICAgICAgICAgICA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XBcbiAgICAgICAgICAgICAgICBzZWxlY3RlZERhdGEgPSAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cykubWFwKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5hZGROYW1lKCQkLmdldFZhbHVlT25JbmRleCh0LnZhbHVlcywgaW5kZXgpKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIGlmIChjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLnNob3dUb29sdGlwKHNlbGVjdGVkRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgICQkLnNob3dYR3JpZEZvY3VzKHNlbGVjdGVkRGF0YSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy50b29sdGlwX2dyb3VwZWQgJiYgKCFjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCB8fCBjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgaW5kZXgpXG4gICAgICAgICAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKENMQVNTLkVYUEFOREVELCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50UmVjdC5zdHlsZSgnY3Vyc29yJywgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgPyAncG9pbnRlcicgOiBudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuaGlkZVRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQ2lyY2xlcyhpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQmFycyhpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQuaXNXaXRoaW5TaGFwZSh0aGlzLCBkKTtcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCAmJiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgfHwgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2lzc2VsZWN0YWJsZShkKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFJlY3Quc3R5bGUoJ2N1cnNvcicsICdwb2ludGVyJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy50b29sdGlwX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5zaG93VG9vbHRpcChbZF0sIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnNob3dYR3JpZEZvY3VzKFtkXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZCkgeyAkJC5leHBhbmRDaXJjbGVzKGluZGV4LCBkLmlkLCB0cnVlKTsgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoaW5kZXgsIGQuaWQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBkLmluZGV4O1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkgfHwgISQkLnRvZ2dsZVNoYXBlKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIGlmICgkJC5jYW5jZWxDbGljaykge1xuICAgICAgICAgICAgICAgICAgICAkJC5jYW5jZWxDbGljayA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgkJC5pc1N0ZXBUeXBlKGQpICYmIGNvbmZpZy5saW5lX3N0ZXBfdHlwZSA9PT0gJ3N0ZXAtYWZ0ZXInICYmIGQzLm1vdXNlKHRoaXMpWzBdIDwgJCQueCgkJC5nZXRYVmFsdWUoZC5pZCwgaW5kZXgpKSkge1xuICAgICAgICAgICAgICAgICAgICBpbmRleCAtPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIGluZGV4KS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCB8fCAkJC5pc1dpdGhpblNoYXBlKHRoaXMsIGQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC50b2dnbGVTaGFwZSh0aGlzLCBkLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbmNsaWNrLmNhbGwoJCQuYXBpLCBkLCB0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYWxsKFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9kcmFnZ2FibGUgJiYgJCQuZHJhZyA/IChcbiAgICAgICAgICAgICAgICAgICAgZDMuYmVoYXZpb3IuZHJhZygpLm9yaWdpbihPYmplY3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWcnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWcoZDMubW91c2UodGhpcykpOyB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnc3RhcnQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdzdGFydChkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdlbmQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdlbmQoKTsgfSlcbiAgICAgICAgICAgICAgICApIDogZnVuY3Rpb24gKCkge31cbiAgICAgICAgICAgICk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlRXZlbnRSZWN0c0Zvck11bHRpcGxlWHMgPSBmdW5jdGlvbiAoZXZlbnRSZWN0RW50ZXIpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgZDMgPSAkJC5kMywgY29uZmlnID0gJCQuY29uZmlnO1xuXG4gICAgICAgIGZ1bmN0aW9uIG1vdXNlb3V0KCkge1xuICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy5ldmVudFJlY3QpLnN0eWxlKCdjdXJzb3InLCBudWxsKTtcbiAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG4gICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgJCQudW5leHBhbmRDaXJjbGVzKCk7XG4gICAgICAgICAgICAkJC51bmV4cGFuZEJhcnMoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGV2ZW50UmVjdEVudGVyLmFwcGVuZCgncmVjdCcpXG4gICAgICAgICAgICAuYXR0cigneCcsIDApXG4gICAgICAgICAgICAuYXR0cigneScsIDApXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCAkJC53aWR0aClcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAkJC5oZWlnaHQpXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCBDTEFTUy5ldmVudFJlY3QpXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICghJCQuY29uZmlnKSB7IHJldHVybjsgfSAvLyBjaGFydCBpcyBkZXN0cm95ZWRcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIG1vdXNlb3V0KCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRhcmdldHNUb1Nob3cgPSAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cyk7XG4gICAgICAgICAgICAgICAgdmFyIG1vdXNlLCBjbG9zZXN0LCBzYW1lWERhdGEsIHNlbGVjdGVkRGF0YTtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5kcmFnZ2luZykgeyByZXR1cm47IH0gLy8gZG8gbm90aGluZyB3aGVuIGRyYWdnaW5nXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUodGFyZ2V0c1RvU2hvdykpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICAgICAgICBtb3VzZSA9IGQzLm1vdXNlKHRoaXMpO1xuICAgICAgICAgICAgICAgIGNsb3Nlc3QgPSAkJC5maW5kQ2xvc2VzdEZyb21UYXJnZXRzKHRhcmdldHNUb1Nob3csIG1vdXNlKTtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5tb3VzZW92ZXIgJiYgKCFjbG9zZXN0IHx8IGNsb3Nlc3QuaWQgIT09ICQkLm1vdXNlb3Zlci5pZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW91dC5jYWxsKCQkLmFwaSwgJCQubW91c2VvdmVyKTtcbiAgICAgICAgICAgICAgICAgICAgJCQubW91c2VvdmVyID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICghIGNsb3Nlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgbW91c2VvdXQoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICgkJC5pc1NjYXR0ZXJUeXBlKGNsb3Nlc3QpIHx8ICFjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHNhbWVYRGF0YSA9IFtjbG9zZXN0XTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzYW1lWERhdGEgPSAkJC5maWx0ZXJCeVgodGFyZ2V0c1RvU2hvdywgY2xvc2VzdC54KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBzaG93IHRvb2x0aXAgd2hlbiBjdXJzb3IgaXMgY2xvc2UgdG8gc29tZSBwb2ludFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0YSA9IHNhbWVYRGF0YS5tYXAoZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLmFkZE5hbWUoZCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoc2VsZWN0ZWREYXRhLCB0aGlzKTtcblxuICAgICAgICAgICAgICAgIC8vIGV4cGFuZCBwb2ludHNcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZENpcmNsZXMoY2xvc2VzdC5pbmRleCwgY2xvc2VzdC5pZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoY2xvc2VzdC5pbmRleCwgY2xvc2VzdC5pZCwgdHJ1ZSk7XG5cbiAgICAgICAgICAgICAgICAvLyBTaG93IHhncmlkIGZvY3VzIGxpbmVcbiAgICAgICAgICAgICAgICAkJC5zaG93WEdyaWRGb2N1cyhzZWxlY3RlZERhdGEpO1xuXG4gICAgICAgICAgICAgICAgLy8gU2hvdyBjdXJzb3IgYXMgcG9pbnRlciBpZiBwb2ludCBpcyBjbG9zZSB0byBtb3VzZSBwb3NpdGlvblxuICAgICAgICAgICAgICAgIGlmICgkJC5pc0JhclR5cGUoY2xvc2VzdC5pZCkgfHwgJCQuZGlzdChjbG9zZXN0LCBtb3VzZSkgPCBjb25maWcucG9pbnRfc2Vuc2l0aXZpdHkpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy5ldmVudFJlY3QpLnN0eWxlKCdjdXJzb3InLCAncG9pbnRlcicpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISQkLm1vdXNlb3Zlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW92ZXIuY2FsbCgkJC5hcGksIGNsb3Nlc3QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQubW91c2VvdmVyID0gY2xvc2VzdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciB0YXJnZXRzVG9TaG93ID0gJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpO1xuICAgICAgICAgICAgICAgIHZhciBtb3VzZSwgY2xvc2VzdDtcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSh0YXJnZXRzVG9TaG93KSkgeyByZXR1cm47IH1cblxuICAgICAgICAgICAgICAgIG1vdXNlID0gZDMubW91c2UodGhpcyk7XG4gICAgICAgICAgICAgICAgY2xvc2VzdCA9ICQkLmZpbmRDbG9zZXN0RnJvbVRhcmdldHModGFyZ2V0c1RvU2hvdywgbW91c2UpO1xuICAgICAgICAgICAgICAgIGlmICghIGNsb3Nlc3QpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgLy8gc2VsZWN0IGlmIHNlbGVjdGlvbiBlbmFibGVkXG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzQmFyVHlwZShjbG9zZXN0LmlkKSB8fCAkJC5kaXN0KGNsb3Nlc3QsIG1vdXNlKSA8IGNvbmZpZy5wb2ludF9zZW5zaXRpdml0eSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZXMgKyAkJC5nZXRUYXJnZXRTZWxlY3RvclN1ZmZpeChjbG9zZXN0LmlkKSkuc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgY2xvc2VzdC5pbmRleCkuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgfHwgJCQuaXNXaXRoaW5TaGFwZSh0aGlzLCBjbG9zZXN0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZVNoYXBlKHRoaXMsIGNsb3Nlc3QsIGNsb3Nlc3QuaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29uY2xpY2suY2FsbCgkJC5hcGksIGNsb3Nlc3QsIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhbGwoXG4gICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2RyYWdnYWJsZSAmJiAkJC5kcmFnID8gKFxuICAgICAgICAgICAgICAgICAgICBkMy5iZWhhdmlvci5kcmFnKCkub3JpZ2luKE9iamVjdClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZycsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZyhkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdzdGFydCcsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZ3N0YXJ0KGQzLm1vdXNlKHRoaXMpKTsgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZ2VuZCcsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZ2VuZCgpOyB9KVxuICAgICAgICAgICAgICAg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fZ3JvdXBzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX2dyb3Vwc1tqXS5pbmRleE9mKGQuaWQpIDwgMCkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBjb25maWcuZGF0YV9ncm91cHNbal0ubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX2dyb3Vwc1tqXVtrXSBpbiBpbmRpY2VzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRpY2VzW2QuaWRdID0gaW5kaWNlc1tjb25maWcuZGF0YV9ncm91cHNbal1ba11dO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoaW5kaWNlc1tkLmlkXSkpIHsgaW5kaWNlc1tkLmlkXSA9IGkrKzsgfVxuICAgICAgICB9KTtcbiAgICAgICAgaW5kaWNlcy5fX21heF9fID0gaSAtIDE7XG4gICAgICAgIHJldHVybiBpbmRpY2VzO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0U2hhcGVYID0gZnVuY3Rpb24gKG9mZnNldCwgdGFyZ2V0c051bSwgaW5kaWNlcywgaXNTdWIpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgc2NhbGUgPSBpc1N1YiA/ICQkLnN1YlggOiAkJC54O1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIHZhciBpbmRleCA9IGQuaWQgaW4gaW5kaWNlcyA/IGluZGljZXNbZC5pZF0gOiAwO1xuICAgICAgICAgICAgcmV0dXJuIGQueCB8fCBkLnggPT09IDAgPyBzY2FsZShkLngpIC0gb2Zmc2V0ICogKHRhcmdldH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5jb252ZXJ0VmFsdWVzVG9TdGVwKHQudmFsdWVzKSA6IHQudmFsdWVzO1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSBkLmlkIHx8IGluZGljZXNbdC5pZF0gIT09IGluZGljZXNbZC5pZF0pIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgaWYgKHRhcmdldElkcy5pbmRleE9mKHQuaWQpIDwgdGFyZ2V0SWRzLmluZGV4T2YoZC5pZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgdGhlIHggdmFsdWVzIGxpbmUgdXBcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZXNbaV0gPT09ICd1bmRlZmluZWQnIHx8ICt2YWx1ZXNbaV0ueCAhPT0gK2QueCkgeyAgLy8gXCIrXCIgZm9yIHRpbWVzZXJpZXNcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIG5vdCwgdHJ5IHRvIGZpbmQgdGhlIHZhbHVlIHRoYXQgZG9lcyBsaW5lIHVwXG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodiwgaikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2LnggPT09IGQueCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoaSBpbiB2YWx1ZXMgJiYgdmFsdWVzW2ldLnZhbHVlICogZC52YWx1ZSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQgKz0gc2NhbGUodmFsdWVzW2ldLnZhbHVlKSAtIHkwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgIC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nZhbHVlcyxcbiAgICAgICAgICAgICAgICB4ID0gaXNTdWIgPyAkJC54IDogJCQuc3ViWCwgeSA9IHlTY2FsZUdldHRlci5jYWxsKCQkLCBkLmlkKSwgeDAgPSAwLCB5MCA9IDAsIHBhdGg7XG4gICAgICAgICAgICBpZiAoJCQuaXNMaW5lVHlwZShkKSkge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9yZWdpb25zW2QuaWRdKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSAkJC5saW5lV2l0aFJlZ2lvbnModmFsdWVzLCB4LCB5LCBjb25maWcuZGF0YV9yZWdpb25zW2QuaWRdKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuaXNTdGVwVHlwZShkKSkgeyB2YWx1ZXMgPSAkJC5jb252ZXJ0VmFsdWVzVG9TdGVwKHZhbHVlcyk7IH1cbiAgICAgICAgICAgICAgICAgICAgcGF0aCA9IGxpbmUuaW50ZXJwb2xhdGUoJCQuZ2V0SW50ZXJwb2xhdGUoZCkpKHZhbHVlcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWVzWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgIHgwID0geCh2YWx1ZXNbMF0ueCk7XG4gICAgICAgICAgICAgICAgICAgIHkwID0geSh2YWx1ZXNbMF0udmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwYXRoID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IFwiTSBcIiArIHkwICsgXCIgXCIgKyB4MCA6IFwiTSBcIiArIHgwICsgXCIgXCIgKyB5MDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBwYXRoID8gcGF0aCA6IFwiTSAwIDBcIjtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludG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gICAgICB2YXIgaTtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCByZWdpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlZ2lvbnNbaV0uc3RhcnQgPCB4ICYmIHggPD0gcmVnaW9uc1tpXS5lbmQpIHsgcmV0dXJuIHRydWU7IH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENoZWNrIHN0YXJ0L2VuZCBvZiByZWdpb25zXG4gICAgICAgIGlmIChpc0RlZmluZWQoX3JlZ2lvbnMpKSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgX3JlZ2lvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICByZWdpb25zW2ldID0ge307XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKF9yZWdpb25zW2ldLnN0YXJ0KSkge1xuICAgICAgICAgICAgICAgICAgICByZWdpb25zW2ldLnN0YXJ0ID0gZFswXS54O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlZ2lvbnNbaV0uc3RhcnQgPSAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLnBhcnNlRGF0ZShfcmVnaW9uc1tpXS5zdGFydCkgOiBfcmVnaW9uc1tpXS5zdGFydDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKF9yZWdpb25zW2ldLmVuZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVnaW9uc1tpXS5lbmQgPSBkW2QubGVuZ3RoIC0gMV0ueDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZWdpb25zW2ldLmVuZCA9ICQkLmlzVGltZVNlcmllcygpID8gJCQucGFyc2VEYXRlKF9yZWdpb25zW2ldLmVuZCkgOiBfcmVnaW9uc1tpXS5lbmQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2V0IHNjYWxlc1xuICAgICAgICB4VmFsdWUgPSBjb25maWcuYXhpc19yb3RhdGVkID8gZnVuY3Rpb24gKGQpIHsgcmV0dXJuIHkoZC52YWx1ZSk7IH0gOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4geChkLngpOyB9O1xuICAgICAgICB5VmFsdWUgPSBjb25maWcuYXhpc19yb3RhdGVkID8gZnVuY3Rpb24gKGQpIHsgcmV0dXJuIHgoZC54KTsgfSA6IGZ1bmN0aW9uIChkKSB7IHJldHVybiB5KGQudmFsdWUpOyB9O1xuXG4gICAgICAgIC8vIERlZmluZSBzdmcgZ2VuZXJhdG9yIGZ1bmN0aW9uIGZvciByZWdpb25cbiAgICAgICAgZnVuY3Rpb24gZ2VuZXJhdGVNKHBvaW50cykge1xuICAgICAgICAgICAgcmV0dXJuICdNJyArIHBvaW50c1swXVswXSArICcgJyArIHBvaW50c1swXVsxXSArICcgJyArIHBvaW50c1sxXVswXSArICcgJyArIHBvaW50c1sxXVsxXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgIHNXaXRoUmVnaW9uID0gZnVuY3Rpb24gKGQwLCBkMSwgaiwgZGlmZikge1xuICAgICAgICAgICAgICAgIHZhciB4MCA9IGQwLnguZ2V0VGltZSgpLCB4X2RpZmYgPSBkMS54IC0gZDAueCxcbiAgICAgICAgICAgICAgICAgICAgeHYwID0gbmV3IERhdGUoeDAgKyB4X2RpZmYgKiBqKSxcbiAgICAgICAgICAgICAgICAgICAgeHYxID0gbmV3IERhdGUoeDAgKyB4X2RpZmYgKiAoaiArIGRpZmYpKSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzO1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeSh5cChqKSksIHgoeHYwKV0sIFt5KHlwKGogKyBkaWZmKSksIHgoeHYxKV1dO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeCh4djApLCB5KHlwKGopKV0sIFt4KHh2MSksIHkoeXAoaiArIGRpZmYpKV1dO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZ2VuZXJhdGVNKHBvaW50cyk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc1dpdGhSZWdpb24gPSBmdW5jdGlvbiAoZDAsIGQxLCBqLCBkaWZmKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBvaW50cztcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBwb2ludHMgPSBbW3koeXAoaiksIHRydWUpLCB4KHhwKGopKV0sIFt5KHlwKGogKyBkaWZmKSwgdHJ1ZSksIHgoeHAoaiArIGRpZmYpKV1dO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeCh4cChqKSwgdHJ1ZSksIHkoeXAoaikpXSwgW3goeHAoaiArIGRpZmYpLCB0cnVlKSwgeSh5cChqICsgZGlmZikpXV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBnZW5lcmF0ZU0ocG9pbnRzKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICAvLyBHZW5lcmF0ZVxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xuXG4gICAgICAgICAgICAvLyBEcmF3IGFzIG5vcm1hbFxuICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHJlZ2lvbnMpIHx8ICEgaXNXaXRoaW5SZWdpb25zKGRbaV0ueCwgcmVnaW9ucykpIHtcbiAgICAgICAgICAgICAgICBzICs9IFwiIFwiICsgeFZhbHVlKGRbaV0pICsgXCIgXCIgKyB5VmFsdWUoZFtpXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBEcmF3IHdpdGggcmVnaW9uIC8vIFRPRE86IEZpeCBmb3IgaG9yaXpvdGFsIGNoYXJ0c1xuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgeHAgPSAkJC5nZXRTY2FsZShkW2kgLSAxXS54ICsgeE9mZnNldCwgZFtpXS54ICsgeE9mZnNldCwgJCQuaXNUaW1lU2VyaWVzKCkpO1xuICAgICAgICAgICAgICAgIHlwID0gJCQuZ2V0U2NhbGUoZFtpIC0gMV0udmFsdWUsIGRbaV0udmFsdWUpO1xuXG4gICAgICAgICAgICAgICAgZHggPSB4KGRbaV0ueCkgLSB4KGRbaSAtIDFdLngpO1xuICAgICAgICAgICAgICAgIGR5ID0geShkW2ldLnZhbHVlKSAtIHkoZFtpIC0gMV0udmFsdWUpO1xuICAgICAgICAgICAgICAgIGRkID0gTWF0aC5zcXJ0KE1hdGgucG93KGR4LCAyKSArIE1hdGgucG93KGR5LCAyKSk7XG4gICAgICAgICAgICAgICAgZGlmZiA9IDIgLyBkZDtcbiAgICAgICAgICAgICAgICBkaWZmeDIgPSBkaWZmICogMjtcblxuICAgICAgICAgICAgICAgIGZvciAoaiA9IGRpZmY7IGogPD0gMTsgaiArPSBkaWZmeDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcyArPSBzV2l0aFJlZ2lvbihkW2kgLSAxXSwgZFtpXSwgaiwgZGlmZik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcHJldiA9IGRbaV0ueDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBzO1xuICAgIH07XG5cblxuICAgIGMzX2NoYXJ0X2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cbiAgICAgICAgICAgICAgICAuc3R5bGUoXCJmaWxsXCIsIHRoaXMuY29sb3IpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJjeFwiLCBjeClcbiAgICAgICAgICAgICAgICAuYXR0cihcImN5XCIsIGN5KSxcbiAgICAgICAgICAgICh3aXRoVHJhbnNpdGlvbiA/IHNlbGVjdGVkQ2lyY2xlcy50cmFuc2l0aW9uKE1hdGgucmFuZG9tKCkudG9TdHJpbmcoKSkgOiBzZWxlY3RlZENpcmNsZXMpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJjeFwiLCBjeClcbiAgICAgICAgICAgICAgICAuYXR0cihcImN5XCIsIGN5KVxuICAgICAgICBdO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY2lyY2xlWCA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgIHJldHVybiBkLnggfHwgZC54ID09PSAwID8gdGhpcy54KGQueCkgOiBudWxsO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlQ2lyY2xlWSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgbGluZUluZGljZXMsIGdldFBvaW50cztcbiAgICAgICAgaWYgKCQkLmNvbmZpZy5kYXRhX2dyb3Vwcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsaW5lSW5kaWNlcyA9ICQkLmdldFNoYXBlSW5kaWNlcygkJC5pc0xpbmVUeXBlKSxcbiAgICAgICAgICAgIGdldFBvaW50cyA9ICQkLmdlbmVyYXRlR2V0TGluZVBvaW50cyhsaW5lSW5kaWNlcyk7XG4gICAgICAgICAgICAkJC5jaXJjbGVZID0gZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZ2V0UG9pbnRzKGQsIGkpWzBdWzFdO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICQkLmNp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mdW5jdGlvbiAoKSB7IHJldHVybiAkJC5kMy5zZWxlY3QodGhpcykuY2xhc3NlZChDTEFTUy5FWFBBTkRFRCk7IH0pXG4gICAgICAgICAgICAuY2xhc3NlZChDTEFTUy5FWFBBTkRFRCwgZmFsc2UpXG4gICAgICAgICAgICAuYXR0cigncicsIHIpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucG9pbnRSID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gJCQuaXNTdGVwVHlwZShkKSA/IDAgOiAoaXNGdW5jdGlvbihjb25maWcucG9pbnRfcikgPyBjb25maWcucG9pbnRfcihkKSA6IGNvbmZpZy5wb2ludF9yKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnBvaW50RXhwYW5kZWRSID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gY29uZmlnLnBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkID8gKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfciA/IGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfciA6ICQkLnBvaW50UihkKSAqIDEuNzUpIDogJCQucG9pbnRSKGQpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucG9pbnRTZWxlY3RSID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gaXNGdW5jdGlvbihjb25maWcucG9pbnRfc2VsZWN0X3IpID8gY29uZmlnLnBvaW50X3NlbGVjdF9yKGQpIDogKChjb25maWcucG9pbnRfc2VsZWN0X3IpID8gY29uZmlnLnBvaW50X3NlbGVjdF9yIDogJC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5heGlzX3JvdGF0ZWQgPyAwIDogMTtcblxuICAgICAgICAgICAgdmFyIHBhdGggPSAnTSAnICsgcG9pbnRzWzBdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbMF1baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICdMJyArIHBvaW50c1sxXVtpbmRleFhdICsgJywnICsgcG9pbnRzWzFdW2luZGV4WV0gKyAnICcgK1xuICAgICAgICAgICAgICAgICAgICAnTCcgKyBwb2ludHNbMl1baW5kZXhYXSArICcsJyArIHBvaW50c1syXVtpbmRleFldICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgJ0wnICsgcG9pbnRzWzNdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbM11baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICd6JztcblxuICAgICAgICAgICAgcmV0dXJuIHBhdGg7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUdldEJhclBvaW50cyA9IGZ1bmN0aW9uIChiYXJJbmRpY2VzLCBpc1N1Yikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgYXhpcyA9IGlzU3ViID8gJCQuc3ViWEF4aXMgOiAkJC54QXhpcyxcbiAgICAgICAgICAgIGJhclRhcmdldHNOdW0gPSBiYXJJbmRpY2VzLl9fbWF4X18gKyAxLFxuICAgICAgICAgICAgYmFyVyA9ICQkLmdldEJhclcoYXhpcywgYmFyVGFyZ2V0c051bSksXG4gICAgICAgICAgICBiYXJYID0gJCQuZ2V0U2hhcGVYKGJhclcsIGJhclRhcmdldHNOdW0sIGJhckluZGljZXMsICEhaXNTdWIpLFxuICAgICAgICAgICAgYmFyWSA9ICQkLmdldFNoYXBlWSghIWlzU3ViKSxcbiAgICAgICAgICAgIGJhck9mZnNldCA9ICQkLmdldFNoYXBlT2Zmc2V0KCQkLmlzQmFyVHlwZSwgYmFySW5kaWNl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KTtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFhGb3JUZXh0ID0gZnVuY3Rpb24gKHBvaW50cywgZCwgdGV4dEVsZW1lbnQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIGJveCA9IHRleHRFbGVtZW50LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLCB4UG9zLCBwYWRkaW5nO1xuICAgICAgICBpZiAoJCQuY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgcGFkZGluZyA9ICQkLmlzQmFyVHlwZShkKSA/IDQgOiA2O1xuICAgICAgICAgICAgeFBvcyA9IHBvaW50c1syXVsxXSArIHBhZGRpbmcgKiAoZC52YWx1ZSA8IDAgPyAtMSA6IDEpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeFBvcyA9ICQkLmhhc1R5cGUoJ2JhcicpID8gKHBvaW50c1syXVswXSArIHBvaW50c1swXVswXSkgLyAyIDogcG9pbnRzWzBdWzBdO1xuICAgICAgICB9XG4gICAgICAgIC8vIHNob3cgbGFiZWxzIHJlZ2FyZGxlc3Mgb2YgdGhlIGRvbWFpbiBpZiB2YWx1ZSBpcyBudWxsXG4gICAgICAgIGlmIChkLnZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICBpZiAoeFBvcyA+ICQkLndpZHRoKSB7XG4gICAgICAgICAgICAgICAgeFBvcyA9ICQkLndpZHRoIC0gYm94LndpZHRoO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh4UG9zIDwgMCkge1xuICAgICAgICAgICAgICAgIHhQb3MgPSA0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB4UG9zO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WUZvclRleHQgPSBmdW5jdGlvbiAocG9pbnRzLCBkLCB0ZXh0RWxlbWVudCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgYm94ID0gdGV4dEVsZW1lbnQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksXG4gICAgICAgICAgICB5UG9zO1xuICAgICAgICBpZiAoJCQuY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgeVBvcyA9IChwb2ludHNbMF1bMF0gKyBwb2ludHNbMl1bMF0gKyBib3guaGVpZ2h0ICogMC42KSAvIDI7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB5UG9zID0gcG9pbnRzWzJdWzFdO1xuICAgICAgICAgICAgaWYgKGQudmFsdWUgPCAwICB8fCAoZC52YWx1ZSA9PT0gMCAmJiAhJCQuaGFzUG9zaXRpdmVWYWx1ZSkpIHtcbiAgICAgICAgICAgICAgICB5UG9zICs9IGJveC5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzQmFyVHlwZShkKSAmJiAkJC5pc1NhZmFyaSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHlQb3MgLT0gMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoISQkLmlzQmFyVHlwZShkKSAmJiAkJC5pc0Nocm9tZSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHlQb3MgKz0gMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHlQb3MgKz0gJCQuaXNCYXJUeXBlKGQpID8gLTMgOiAtNjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBzaG93IGxhYmVscyByZWdhcmRsZXNzIG9mIHRoZSBkb21haW4gaWYgdmFsdWUgaXMgbnVsbFxuICAgICAgICBpZiAoZC52YWx1ZSA9PT0gbnVsbCAmJiAhJCQuY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgaWYgKHlQb3MgPCBib3guaGVpZ2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B7XG4gICAgICAgICAgICAneDEnOiAwLFxuICAgICAgICAgICAgJ3gyJzogJCQud2lkdGgsXG4gICAgICAgICAgICAneTEnOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4gJCQueChkKSAtIHRpY2tPZmZzZXQ7IH0sXG4gICAgICAgICAgICAneTInOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4gJCQueChkKSAtIHRpY2tPZmZzZXQ7IH1cbiAgICAgICAgfSA6IHtcbiAgICAgICAgICAgICd4MSc6IGZ1bmN0aW9uIChkKSB7IHJldHVybiAkJC54KGQpICsgdGlja09mZnNldDsgfSxcbiAgICAgICAgICAgICd4Mic6IGZ1bmN0aW9uIChkKSB7IHJldHVybiAkJC54KGQpICsgdGlja09mZnNldDsgfSxcbiAgICAgICAgICAgICd5MSc6IDAsXG4gICAgICAgICAgICAneTInOiAkJC5oZWlnaHRcbiAgICAgICAgfTtcblxuICAgICAgICAkJC54Z3JpZCA9ICQkLm1haW4uc2VsZWN0KCcuJyArIENMQVNTLnhncmlkcykuc2VsZWN0QWxsKCcuJyArIENMQVNTLnhncmlkKVxuICAgICAgICAgICAgLmRhdGEoeGdyaWREYXRhKTtcbiAgICAgICAgJCQueGdyaWQuZW50ZXIoKS5hcHBlbmQoJ2xpbmUnKS5hdHRyKFwiY2xhc3NcIiwgQ0xBU1MueGdyaWQpO1xuICAgICAgICBpZiAoIXdpdGhvdXRVcGRhdGUpIHtcbiAgICAgICAgICAgICQkLnhncmlkLmF0dHIoJCQueGdyaWRBdHRyKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgZnVuY3Rpb24gKCkgeyByZXR1cm4gK2QzLnNlbGVjdCh0aGlzKS5hdHRyKGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAneTEnIDogJ3gxJykgPT09IChjb25maWcuYXhpc19yb3RhdGVkID8gJCQuaGVpZ2h0IDogMCkgPyAwIDogMTsgfSk7XG4gICAgICAgIH1cbiAgICAgICAgJCQueGdy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IHRoZSBlbmQgb2YgdGhpcyBmdW5jdGlvblxuICAgICAgICAvLyBleGl0XG4gICAgICAgICQkLnhncmlkTGluZXMuZXhpdCgpLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMClcbiAgICAgICAgICAgIC5yZW1vdmUoKTtcblxuICAgICAgICAvLyBZLUdyaWRcbiAgICAgICAgaWYgKGNvbmZpZy5ncmlkX3lfc2hvdykge1xuICAgICAgICAgICAgJCQudXBkYXRlWUdyaWQoKTtcbiAgICAgICAgfVxuICAgICAgICAkJC55Z3JpZExpbmVzID0gbWFpbi5zZWxlY3QoJy4nICsgQ0xBU1MueWdyaWRMaW5lcykuc2VsZWN0QWxsKCcuJyArIENMQVNTLnlncmlkTGluZSlcbiAgICAgICAgICAgIC5kYXRhKGNvbmZpZy5ncmlkX3lfbGluZXMpO1xuICAgICAgICAvLyBlbnRlclxuICAgICAgICB5Z3JpZExpbmUgPSAkJC55Z3JpZExpbmVzLmVudGVyKCkuYXBwZW5kKCdnJylcbiAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgZnVuY3Rpb24gKGQpIHsgcmV0dXJuIENMQVNTLnlncmlkTGluZSArIChkWydjbGFzcyddID8gJyAnICsgZFsnY2xhc3MnXSA6ICcnKTsgfSk7XG4gICAgICAgIHlncmlkTGluZS5hcHBlbmQoJ2xpbmUnKVxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAwKTtcbiAgICAgICAgeWdyaWRMaW5lLmFwcGVuZCgndGV4dCcpXG4gICAgICAgICAgICAuYXR0cihcInRleHQtYW5jaG9yXCIsICQkLmdyaWRUZXh0QW5jaG9yKVxuICAgICAgICAgICAgLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IFwicm90YXRlKC05MClcIiA6IFwiXCIpXG4gICAgICAgICAgICAuYXR0cignZHgnLCAkJC5ncmlkVGV4dER4KVxuICAgICAgICAgICAgLmF0dHIoJ2R5JywgLTUpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDApO1xuICAgICAgICAvLyB1cGRhdGVcbiAgICAgICAgeXYgPSAkJC55di5iaW5kKCQkKTtcbiAgICAgICAgJCQueWdyaWRMaW5lcy5zZWxlY3QoJ2xpbmUnKVxuICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pXG4gICAgICAgICAgICAuYXR0cihcIngxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB5diA6IDApXG4gICAgICAgICAgICAuYXR0cihcIngyXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB5diA6ICQkLndpZHRoKVxuICAgICAgICAgICAgLmF0dHIoXCJ5MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IHl2KVxuICAgICAgICAgICAgLmF0dHIoXCJ5MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQuaGVpZ2h0IDogeXYpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDEpO1xuICAgICAgICAkJC55Z3JpZExpbmVzLnNlbGVjdCgndGV4dCcpXG4gICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5hdHRyKFwieFwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQueEdyaWRUZXh0WC5iaW5kKCQkKSA6ICQkLnlHcmlkVGV4dFguYmluZCgkJCkpXG4gICAgICAgICAgICAuYXR0cihcInlcIiwgeXYpXG4gICAgICAgICAgICAudGV4dChmdW5jdGlvbiAoZCkgeyByZXR1cm4gZC50ZXh0OyB9KVxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAxKTtcbiAgICAgICAgLy8gZXhpdFxuICAgICAgICAkJC55Z3JpZExpbmVzLmV4aXQoKS50cmFuc2l0aW9u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i5cIiArIENMQVNTLmF4aXNYKS5zZWxlY3RBbGwoJy50aWNrJykuc2l6ZSgpO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ3llYXInKSB7XG4gICAgICAgICAgICB4RG9tYWluID0gJCQuZ2V0WERvbWFpbigpO1xuICAgICAgICAgICAgZmlyc3RZZWFyID0geERvbWFpblswXS5nZXRGdWxsWWVhcigpO1xuICAgICAgICAgICAgbGFzdFllYXIgPSB4RG9tYWluWzFdLmdldEZ1bGxZZWFyKCk7XG4gICAgICAgICAgICBmb3IgKGkgPSBmaXJzdFllYXI7IGkgPD0gbGFzdFllYXI7IGkrKykge1xuICAgICAgICAgICAgICAgIGdyaWREYXRhLnB1c2gobmV3IERhdGUoaSArICctMDEtMDEgMDA6MDA6MDAnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBncmlkRGF0YSA9IHNjYWxlLnRpY2tzKDEwKTtcbiAgICAgICAgICAgIGlmIChncmlkRGF0YS5sZW5ndGggPiB0aWNrTnVtKSB7IC8vIHVzZSBvbmx5IGludFxuICAgICAgICAgICAgICAgIGdyaWREYXRhID0gZ3JpZERhdGEuZmlsdGVyKGZ1bmN0aW9uIChkKSB7IHJldHVybiAoXCJcIiArIGQpLmluZGV4T2YoJy4nKSA8IDA7IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBncmlkRGF0YTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldEdyaWRGaWx0ZXJUb1JlbW92ZSA9IGZ1bmN0aW9uIChwYXJhbXMpIHtcbiAgICAgICAgcmV0dXJuIHBhcmFtcyA/IGZ1bmN0aW9uIChsaW5lKSB7XG4gICAgICAgICAgICB2YXIgZm91bmQgPSBmYWxzZTtcbiAgICAgICAgICAgIFtdLmNvbmNhdChwYXJhbXMpLmZvckVhY2goZnVuY3Rpb24gKHBhcmFtKSB7XG4gICAgICAgICAgICAg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lKCk7XG4gICAgICAgIGlmIChmb3JYKSB7XG4gICAgICAgICAgICBjb25maWcuZ3JpZF94X2xpbmVzID0gY29uZmlnLmdyaWRfeF9saW5lcy5maWx0ZXIodG9TaG93KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbmZpZy5ncmlkX3lfbGluZXMgPSBjb25maWcuZ3JpZF95X2xpbmVzLmZpbHRlcih0b1Nob3cpO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmluaXRUb29sdGlwID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGk7XG4gICAgICAgICQkLnRvb2x0aXAgPSAkJC5zZWxlY3RDaGFydFxuICAgICAgICAgICAgLnN0eWxlKFwicG9zaXRpb25cIiwgXCJyZWxhdGl2ZVwiKVxuICAgICAgICAgIC5hcHBlbmQoXCJkaXZcIilcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIENMQVNTLnRvb2x0aXBDb250YWluZXIpXG4gICAgICAgICAgICAuc3R5bGUoXCJwb3NpdGlvblwiLCBcImFic29sdXRlXCIpXG4gICAgICAgICAgICAuc3R5bGUoXCJwb2ludGVyLWV2ZW50c1wiLCBcIm5vbmVcIilcbiAgICAgICAgICAgIC5zdHlsZShcImRpc3BsYXlcIiwgXCJub25lXCIpO1xuICAgICAgICAvLyBTaG93IHRvb2x0aXAgaWYgbmVlZGVkXG4gICAgICAgIGlmIChjb25maWcudG9vbHRpcF9pbml0X3Nob3cpIHtcbiAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSAmJiBpc1N0cmluZyhjb25maWcudG9vbHRpcF9pbml0X3gpKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLnRvb2x0aXBfaW5pdF94ID0gJCQucGFyc2VEYXRlKGNvbmZpZy50b29sdGlwX2luaXRfeCk7XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8ICQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzW2ldLnggLSBjb25maWcudG9vbHRpcF9pbml0X3gpID09PSAwKSB7IGJyZWFrOyB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbmZpZy50b29sdGlwX2luaXRfeCA9IGk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkJC50b29sdGlwLmh0bWwoY29uZmlnLnRvb2x0aXBfY29udGVudHMuY2FsbCgkJCwgJCQuZGF0YS50YXJnZXRzLm1hcChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAkJC5hZGROYW1lKGQudmFsdWVzW2NvbmZpZy50b29sdGlwX2luaXRfeF0pO1xuICAgICAgICAgICAgfSksICQkLmF4aXMuZ2V0WEF4aXNUaWNrRm9ybWF0KCksICQkLmdldFlGb3JtYXQoJCQuaGFzQXJjVHlwZSgpKSwgJCQuY29sb3IpKTtcbiAgICAgICAgICAgICQkLnRvb2x0aXAuc3R5bGUoXCJ0b3BcIiwgY29uZmlnLnRvb2x0aXBfaW5pdF9wb3NpdGlvbi50b3ApXG4gICAgICAgICAgICAgICAgLnN0eWxlKFwibGVmdFwiLCBjb25maWcudG9vbHRpcF9pbml0X3Bvc2l0aW9uLmxlZnQpXG4gICAgICAgICAgICAgICAgLnN0eWxlKFwiZGlzcGxheVwiLCBcImJsb2NrXCIpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRUb29sdGlwQ29udGVudCA9IGZ1bmN0aW9uIChkLCBkZWZhdWx0VGl0bGVGb3JtYXQsIGRlZmF1bHRWYWx1ZUZvcm1hdCwgY29sb3IpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY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EgPiAwICYmIHYyID4gMCkge1xuICAgICAgICAgICAgICAgICAgICB2MSA9IGEgPyBpZHMuaW5kZXhPZihhLmlkKSA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIHYyID0gYiA/IGlkcy5pbmRleE9mKGIuaWQpIDogbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9yZGVyQXNjID8gdjEgLSB2MiA6IHYyIC0gdjE7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBkLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoISAoZFtpXSAmJiAoZFtpXS52YWx1ZSB8fCBkW2ldLnZhbHVlID09PSAwKSkpIHsgY29udGludWU7IH1cblxuICAgICAgICAgICAgaWYgKCEgdGV4dCkge1xuICAgICAgICAgICAgICAgIHRpdGxlID0gc2FuaXRpc2UodGl0bGVGb3JtYXQgPyB0aXRsZUZvcm1hdChkW2ldLngpIDogZFtpXS54KTtcbiAgICAgICAgICAgICAgICB0ZXh0ID0gXCI8dGFibGUgY2xhc3M9J1wiICsgJCQuQ0xBU1MudG9vbHRpcCArIFwiJz5cIiArICh0aXRsZSB8fCB0aXRsZSA9PT0gMCA/IFwiPHRyPjx0aCBjb2xzcGFuPScyJz5cIiArIHRpdGxlICsgXCI8L3RoPjwvdHI+XCIgOiBcIlwiKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFsdWUgPSBzYW5pdGlzZSh2YWx1ZUZvcm1hdChkW2ldLnZhbHVlLCBkW2ldLnJhdGlvLCBkW2ldLmlkLCBkW2ldLmluZGV4LCBkKSk7XG4gICAgICAgICAgICBpZiAodmFsdWUgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIC8vIFNraXAgZWxlbWVudHMgd2hlbiB0aGVpciBuYW1lIGlzIHNldCB0byBudWxsXG4gICAgICAgICAgICAgICAgaWYgKGR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ExlZ2VuZFdpZHRoKCksXG4gICAgICAgICAgICAgICAgbWFyZ2luLCBtYXhMZW5ndGg7XG5cbiAgICAgICAgICAgIC8vIE1FTU86IGNhcmUgYWJvdXQgY29uZGlmaW9uIG9mIHN0ZXAsIHRvdGFsTGVuZ3RoXG4gICAgICAgICAgICBmdW5jdGlvbiB1cGRhdGVWYWx1ZXMoaWQsIHdpdGhvdXRTdGVwKSB7XG4gICAgICAgICAgICAgICAgaWYgKCF3aXRob3V0U3RlcCkge1xuICAgICAgICAgICAgICAgICAgICBtYXJnaW4gPSAoYXJlYUxlbmd0aCAtIHRvdGFsTGVuZ3RoIC0gaXRlbUxlbmd0aCkgLyAyO1xuICAgICAgICAgICAgICAgICAgICBpZiAobWFyZ2luIDwgcG9zTWluKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW4gPSAoYXJlYUxlbmd0aCAtIGl0ZW1MZW5ndGgpIC8gMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsTGVuZ3RoID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ZXArKztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzdGVwc1tpZF0gPSBzdGVwO1xuICAgICAgICAgICAgICAgIG1hcmdpbnNbc3RlcF0gPSAkJC5pc0xlZ2VuZEluc2V0ID8gMTAgOiBtYXJnaW47XG4gICAgICAgICAgICAgICAgb2Zmc2V0c1tpZF0gPSB0b3RhbExlbmd0aDtcbiAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCArPSBpdGVtTGVuZ3RoO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAocmVzZXQpIHtcbiAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCA9IDA7XG4gICAgICAgICAgICAgICAgc3RlcCA9IDA7XG4gICAgICAgICAgICAgICAgbWF4V2lkdGggPSAwO1xuICAgICAgICAgICAgICAgIG1heEhlaWdodCA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gICAgICAgICAgICAgICAgICAgICAkJC5hcGkudG9nZ2xlKGlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmlzVGFyZ2V0VG9TaG93KGlkKSA/ICQkLmFwaS5mb2N1cyhpZCkgOiAkJC5hcGkucmV2ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmxlZ2VuZF9pdGVtX29ubW91c2VvdmVyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5sZWdlbmRfaXRlbV9vbm1vdXNlb3Zlci5jYWxsKCQkLCBpZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAkJC5kMy5zZWxlY3QodGhpcykuY2xhc3NlZChDTEFTUy5sZWdlbmRJdGVtRm9jdXNlZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghJCQudHJhbnNpdGluZyAmJiAkJC5pc1RhcmdldFRvU2hvdyhpZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmFwaS5mb2N1cyhpZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcubGVnZW5kX2l0ZW1fb25tb3VzZW91dCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcubGVnZW5kX2l0ZW1fb25tb3VzZW91dC5jYWxsKCQkLCBpZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAkJC5kMy5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Xhpc194X3RpY2tfbXVsdGlsaW5lLFxuICAgICAgICAgICAgICAgIHRpY2tXaWR0aDogY29uZmlnLmF4aXNfeF90aWNrX3dpZHRoLFxuICAgICAgICAgICAgICAgIHRpY2tUZXh0Um90YXRlOiB3aXRob3V0Um90YXRlVGlja1RleHQgPyAwIDogY29uZmlnLmF4aXNfeF90aWNrX3JvdGF0ZSxcbiAgICAgICAgICAgICAgICB3aXRob3V0VHJhbnNpdGlvbjogd2l0aG91dFRyYW5zaXRpb24sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYXhpcyA9IGMzX2F4aXMoJCQuZDMsIGF4aXNQYXJhbXMpLnNjYWxlKHNjYWxlKS5vcmllbnQob3JpZW50KTtcblxuICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkgJiYgdGlja1ZhbHVlcyAmJiB0eXBlb2YgdGlja1ZhbHVlcyAhPT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICB0aWNrVmFsdWVzID0gdGlja1ZhbHVlcy5tYXAoZnVuY3Rpb24gKHYpIHsgcmV0dXJuICQkLnBhcnNlRGF0ZSh2KTsgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTZXQgdGlja1xuICAgICAgICBheGlzLnRpY2tGb3JtYXQodGlja0Zvcm1hdCkudGlja1ZhbHVlcyh0aWNrVmFsdWVzKTtcbiAgICAgICAgaWYgKCQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgYXhpcy50aWNrQ2VudGVyZWQoY29uZmlnLmF4aXNfeF90aWNrX2NlbnRlcmVkKTtcbiAgICAgICAgICAgIGlmIChpc0VtcHR5KGNvbmZpZy5heGlzX3hfdGlja19jdWxsaW5nKSkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3hfdGlja19jdWxsaW5nID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gYXhpcztcbiAgICB9O1xuICAgI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6IHdpdGhPdXRlclRpY2ssXG4gICAgICAgICAgICAgICAgd2l0aG91dFRyYW5zaXRpb246IHdpdGhvdXRUcmFuc2l0aW9uLFxuICAgICAgICAgICAgICAgIHRpY2tUZXh0Um90YXRlOiB3aXRob3V0Um90YXRlVGlja1RleHQgPyAwIDogY29uZmlnLmF4aXNfeV90aWNrX3JvdGF0ZVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGF4aXMgPSBjM19heGlzKCQkLmQzLCBheGlzUGFyYW1zKS5zY2FsZShzY2FsZSkub3JpZW50KG9yaWVudCkudGlja0Zvcm1hdCh0aWNrRm9ybWF0KTtcbiAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllc1koKSkge1xuICAgICAgICAgICAgYXhpcy50aWNrcygkJC5kMy50aW1lW2NvbmZpZy5heGlzX3lfdGlja190aW1lX3ZhbHVlXSwgY29uZmlnLmF4aXNfeV90aWNrX3RpbWVfaW50ZXJ2YWwpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYXhpcy50aWNrVmFsdWVzKHRpY2tWYWx1ZXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBheGlzO1xuICAgIH07XG4gICAgQXhpcy5wcm90b3R5cGUuZ2V0SWQgPSBmdW5jdGlvbiBnZXRJZChpZCkge1xuICAgICAgICB2YXIgY29uZmlnID0gdGhpcy5vd25lci5jb25maWc7XG4gICAgICAgIHJldHVybiBpZCBpbiBjb25maWcuZGF0YV9heGVzID8gY29uZmlnLmRhdGFfYXhlc1tpZF0gOiAneSc7XG4gICAgfTtcbiAgICBBeGlzLnByb3RvdHlwZS5nZXRYQXhpc1RpY2tGb3JtYXQgPSBmdW5jdGlvbiBnZXRYQXhpc1RpY2tGb3JtYXQoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMub3duZXIsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIGZvcm1hdCA9ICQkLmlzVGltZVNlcmllcygpID8gJCQuZG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ZVNlcmllcykge1xuICAgICAgICB2YXIgdGlja1ZhbHVlcyA9IHZhbHVlcywgdGFyZ2V0Q291bnQsIHN0YXJ0LCBlbmQsIGNvdW50LCBpbnRlcnZhbCwgaSwgdGlja1ZhbHVlO1xuICAgICAgICBpZiAodGlja0NvdW50KSB7XG4gICAgICAgICAgICB0YXJnZXRDb3VudCA9IGlzRnVuY3Rpb24odGlja0NvdW50KSA/IHRpY2tDb3VudCgpIDogdGlja0NvdW50O1xuICAgICAgICAgICAgLy8gY29tcHV0ZSB0aWNrcyBhY2NvcmRpbmcgdG8gdGlja0NvdW50XG4gICAgICAgICAgICBpZiAodGFyZ2V0Q291bnQgPT09IDEpIHtcbiAgICAgICAgICAgICAgICB0aWNrVmFsdWVzID0gW3ZhbHVlc1swXV07XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRhcmdldENvdW50ID09PSAyKSB7XG4gICAgICAgICAgICAgICAgdGlja1ZhbHVlcyA9IFt2YWx1ZXNbMF0sIHZhbHVlc1t2YWx1ZXMubGVuZ3RoIC0gMV1dO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0YXJnZXRDb3VudCA+IDIpIHtcbiAgICAgICAgICAgICAgICBjb3VudCA9IHRhcmdldENvdW50IC0gMjtcbiAgICAgICAgICAgICAgICBzdGFydCA9IHZhbHVlc1swXTtcbiAgICAgICAgICAgICAgICBlbmQgPSB2YWx1ZXNbdmFsdWVzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgICAgIGludGVydmFsID0gKGVuZCAtIHN0YXJ0KSAvIChjb3VudCArIDEpO1xuICAgICAgICAgICAgICAgIC8vIHJlLWNvbnN0cnVjdCB1bmlxdWUgdmFsdWVzXG4gICAgICAgICAgICAgICAgdGlja1ZhbHVlcyA9IFtzdGFydF07XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvdW50OyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja1ZhbHVlID0gK3N0YXJ0ICsgaW50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AgICAgICAgICB9LCAxMCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB0YXJnZXRJZHMgPSAkJC5tYXBUb1RhcmdldElkcyh0YXJnZXRJZHMpO1xuXG4gICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJCQuc2VsZWN0b3JUYXJnZXRzKHRhcmdldElkcywgJy4nICsgQ0xBU1MuY2hhcnRBcmMpKS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICBpZiAoISAkJC5zaG91bGRFeHBhbmQoZC5kYXRhLmlkKSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICQkLmQzLnNlbGVjdCh0aGlzKS5zZWxlY3RBbGwoJ3BhdGgnKVxuICAgICAgICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oJCQuZXhwYW5kRHVyYXRpb24oZC5kYXRhLmlkKSlcbiAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgJCQuc3ZnQXJjRXhwYW5kZWQpXG4gICAgICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbigkJC5leHBhbmREdXJhdGlvbihkLmRhdGEuaWQpICogMilcbiAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgJCQuc3ZnQXJjRXhwYW5kZWRTdWIpXG4gICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmlzRG9udXRUeXBlKGQuZGF0YSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbGxiYWNrIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udW5leHBhbmRBcmMgPSBmdW5jdGlvbiAodGFyZ2V0SWRzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXM7XG5cbiAgIC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GNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCwgYXJjRGF0YTtcbiAgICAgICAgICAgICAgICBpZiAoJCQudHJhbnNpdGluZykgeyAvLyBza2lwIHdoaWxlIHRyYW5zaXRpbmdcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCk7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIHRyYW5zaXRpb25zXG4gICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZEFyYyh1cGRhdGVkLmRhdGEuaWQpO1xuICAgICAgICAgICAgICAgICAgICAkJC5hcGkuZm9jdXModXBkYXRlZC5kYXRhLmlkKTtcbiAgICAgICAgICAgICAgICAgICAgJCQudG9nZ2xlRm9jdXNMZWdlbmQodXBkYXRlZC5kYXRhLmlkLCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25tb3VzZW92ZXIoYXJjRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSA6IG51bGwpXG4gICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpLCBhcmNEYXRhLCBzZWxlY3RlZERhdGE7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCksXG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0YSA9IFthcmNEYXRhXTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoc2VsZWN0ZWREYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IDogbnVsbClcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCA/IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQsIGFyY0RhdGE7XG4gICAgICAgICAgICAgICAgaWYgKCQkLnRyYW5zaXRpbmcpIHsgLy8gc2tpcCB3aGlsZSB0cmFuc2l0aW5nXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgICAgICAvLyB0cmFuc2l0aW9uc1xuICAgICAgICAgICAgICAgICAgICAkJC51bmV4cGFuZEFyYyh1cGRhdGVkLmRhdGEuaWQpO1xuICAgICAgICAgICAgICAgICAgICAkJC5hcGkucmV2ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnJldmVydExlZ2VuZCgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbm1vdXNlb3V0KGFyY0RhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLm9uKCdjbGljaycsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpLCBhcmNEYXRhO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQudG9nZ2xlU2hhcGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZVNoYXBlKHRoaXMsIGFyY0RhdGEsIGkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29uY2xpY2suY2FsbCgkJC5hcGksIGFyY0RhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKCkgeyAkJC50cmFuc2l0aW5nID0gdHJ1ZTsgfSlcbiAgICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pXG4gICAgICAgICAgICAuYXR0clR3ZWVuKFwiZFwiLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCksIGludGVycG9sYXRlO1xuICAgICAgICAgICAgICAgIGlmICghIHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHsgcmV0dXJuIFwiTSAwIDBcIjsgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnQgPT09IGQpIHtcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudCA9IHtcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0QW5nbGU6IE1hdGguUEkqMixcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIGVuZEFuZ2xlOiBNYXRoLlBJKjIsXG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc05hTih0aGlzLl9jdXJyZW50LnN0YXJ0QW5nbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQuc3RhcnRBbmdsZSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc05hTih0aGlzLl9jdXJyZW50LmVuZEFuZ2xlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50LmVuZEFuZ2xlID0gdGhpcy5fY3VycmVudC5zdGFydEFuZ2xlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpbnRlcnBvbGF0ZSA9IGQzLmludGVycG9sYXRlKHRoaXMuX2N1cnJlbnQsIHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQgPSBpbnRlcnBvbGF0ZSgwKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGludGVycG9sYXRlZCA9IGludGVycG9sYXRlKHQpO1xuICAgICAgICAgICAgICAgICAgICBpbnRlcnBvbGF0ZWQuZGF0YSA9IGQuZGF0YTsgLy8gZGF0YS5pZCB3aWxsIGJlIHVwZGF0ZWQgYnkgaW50ZXJwb3JhdG9yXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5nZXRBcmMoaW50ZX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FuZ2xlOiAtMSAqIGNvbmZpZy5nYXVnZV9zdGFydGluZ0FuZ2xlXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5nZXRBcmMoZCwgdHJ1ZSwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NHYXVnZVVuaXQpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJkeVwiLCBcIi43NWVtXCIpXG4gICAgICAgICAgICAgICAgLnRleHQoY29uZmlnLmdhdWdlX2xhYmVsX3Nob3cgPyBjb25maWcuZ2F1Z2VfdW5pdHMgOiAnJyk7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NHYXVnZU1pbilcbiAgICAgICAgICAgICAgICAuYXR0cihcImR4XCIsIC0xICogKCQkLmlubmVyUmFkaXVzICsgKCgkJC5yYWRpdXMgLSAkJC5pbm5lclJhZGl1cykgLyAoY29uZmlnLmdhdWdlX2Z1bGxDaXJjbGUgPyAxIDogMikpKSArIFwicHhcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImR5XCIsIFwiMS4yZW1cIilcbiAgICAgICAgICAgICAgICAudGV4dChjb25maWcuZ2F1Z2VfbGFiZWxfc2hvdyA/IGNvbmZpZy5nYXVnZV9taW4gOiAnJyk7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NHYXVnZU1heClcbiAgICAgICAgICAgICAgICAuYXR0cihcImR4XCIsICQkLmlubmVyUmFkaXVzICsgKCgkJC5yYWRpdXMgLSAkJC5pbm5lclJhZGl1cykgLyAoY29uZmlnLmdhdWdlX2Z1bGxDaXJjbGUgPyAxIDogMikpICsgXCJweFwiKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiZHlcIiwgXCIxLjJlbVwiKVxuICAgICAgICAgICAgICAgIC50ZXh0KGNvbmZpZy5nYXVnZV9sYWJlbF9zaG93ID8gY29uZmlnLmdhdWdlX21heCA6ICcnKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaW5pdEdhdWdlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgYXJjcyA9IHRoaXMuYXJjcztcbiAgICAgICAgaWYgKHRoaXMuaGFzVHlwZSgnZ2F1Z2UnKSkge1xuICAgICAgICAgICAgYXJjcy5hcHBlbmQoJ3BhdGgnKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgQ0xBU1MuY2hhcnRBcmNzQmFja2dyb3VuZCk7XG4gICAgICAgICAgICBhcmNzLmFwcGVuZChcInRleHRcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIENMQVNTLmNoYXJ0QXJjc0dhdWdlVW5pdClcbiAgICAgICAgICAgICAgICAuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcIm1pZGRsZVwiKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcInBvaW50ZXItZXZlbnRzXCIsIFwibm9uZVwiKTtcbiAgICAgICAgICAgIGFyY3MuYXBwZW5kKFwidGV4dFwiKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgQ0xBU1MuY2hhcnRBcmNzR2F1Z2VNaW4pXG4gICAgICAgICAgICAgICAgLnN0eWxlKFwidGV4dC1hbmNob3JcIiwgXCJtaWRkbGVcIilcbiAgICAgICAgICAgICAgICAuc3R5bGUoXCJwb2ludGVyLWV2ZW50c1wiLCBcIm5vbmVcIik7XG4gICAgICAgICAgICBhcmNzLmFwcGVuZChcInRleHRcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIENMQVNTLmNoYXJ0QXJjc0dhdWdlTWF4KVxuICAgICAgICAgICAgICAgIC5zdHlsZShcInRleHQtYW5jaG9yX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AgICAgICAgIHggPSAkJC5yZWdpb25YLmJpbmQoJCQpLFxuICAgICAgICAgICAgeSA9ICQkLnJlZ2lvblkuYmluZCgkJCksXG4gICAgICAgICAgICB3ID0gJCQucmVnaW9uV2lkdGguYmluZCgkJCksXG4gICAgICAgICAgICBoID0gJCQucmVnaW9uSGVpZ2h0LmJpbmQoJCQpO1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgKHdpdGhUcmFuc2l0aW9uID8gcmVnaW9ucy50cmFuc2l0aW9uKCkgOiByZWdpb25zKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieFwiLCB4KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieVwiLCB5KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgdylcbiAgICAgICAgICAgICAgICAuYXR0cihcImhlaWdodFwiLCBoKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcImZpbGwtb3BhY2l0eVwiLCBmdW5jdGlvbiAoZCkgeyByZXR1cm4gaXNWYWx1ZShkLm9wYWNpdHkpID8gZC5vcGFjaXR5IDogMC4xOyB9KVxuICAgICAgICBdO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucmVnaW9uWCA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIHhQb3MsIHlTY2FsZSA9IGQuYXhpcyA9PT0gJ3knID8gJCQueSA6ICQkLnkyO1xuICAgICAgICBpZiAoZC5heGlzID09PSAneScgfHwgZC5heGlzID09PSAneTInKSB7XG4gICAgICAgICAgICB4UG9zID0gY29uZmlnLmF4aXNfcm90YXRlZCA/ICgnc3RhcnQnIGluIGQgPyB5U2NhbGUoZC5zdGFydCkgOiAwKSA6IDA7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB4UG9zID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiA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gICAgICAgICAgIF94LCBfeSwgX3csIF9oLCB0b2dnbGUsIGlzV2l0aGluID0gZmFsc2UsIGJveDtcbiAgICAgICAgICAgICAgICBpZiAoc2hhcGUuY2xhc3NlZChDTEFTUy5jaXJjbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIF94ID0gc2hhcGUuYXR0cihcImN4XCIpICogMTtcbiAgICAgICAgICAgICAgICAgICAgX3kgPSBzaGFwZS5hdHRyKFwiY3lcIikgKiAxO1xuICAgICAgICAgICAgICAgICAgICB0b2dnbGUgPSAkJC50b2dnbGVQb2ludDtcbiAgICAgICAgICAgICAgICAgICAgaXNXaXRoaW4gPSBtaW5YIDwgX3ggJiYgX3ggPCBtYXhYICYmIG1pblkgPCBfeSAmJiBfeSA8IG1heFk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNoYXBlLmNsYXNzZWQoQ0xBU1MuYmFyKSkge1xuICAgICAgICAgICAgICAgICAgICBib3ggPSBnZXRQYXRoQm94KHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICBfeCA9IGJveC54O1xuICAgICAgICAgICAgICAgICAgICBfeSA9IGJveC55O1xuICAgICAgICAgICAgICAgICAgICBfdyA9IGJveC53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgX2ggPSBib3guaGVpZ2h0O1xuICAgICAgICAgICAgICAgICAgICB0b2dnbGUgPSAkJC50b2dnbGVQYXRoO1xuICAgICAgICAgICAgICAgICAgICBpc1dpdGhpbiA9ICEobWF4WCA8IF94IHx8IF94ICsgX3cgPCBtaW5YKSAmJiAhKG1heFkgPCBfeSB8fCBfeSArIF9oIDwgbWluWSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gbGluZS9hcmVhIHNlbGVjdGlvbiBub3Qgc3VwcG9ydGVkIHlldFxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAg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KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIHVwZGF0ZSBzdWJjaGFydCBlbGVtZW50cyBpZiBuZWVkZWRcbiAgICAgICAgICAgIGlmICh3aXRoU3ViY2hhcnQpIHtcblxuICAgICAgICAgICAgICAgIC8vIGV4dGVudCByZWN0XG4gICAgICAgICAgICAgICAgaWYgKCEkJC5icnVzaC5lbXB0eSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmJydXNoLmV4dGVudCgkJC54Lm9yZ0RvbWFpbigpKS51cGRhdGUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gc2V0dXAgZHJhd2VyIC0gTUVNTzogdGhpcyBtdXN0IGJlIGNhbGxlZCBhZnRlciBheGlzIHVwZGF0ZWRcbiAgICAgICAgICAgICAgICBkcmF3QXJlYU9uU3ViID0gJCQuZ2VuZXJhdGVEcmF3QXJlYShhcmVhSW5kaWNlcywgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgZHJhd0Jhck9uU3ViID0gJCQuZ2VuZXJhdGVEcmF3QmFyKGJhckluZGljZXMsIHRydWUpO1xuICAgICAgICAgICAgICAgIGRyYXdMaW5lT25TdWIgPSAkJC5nZW5lcmF0ZURyYXdMaW5lKGxpbmVJbmRpY2VzLCB0cnVlKTtcblxuICAgICAgICAgICAgICAgICQkLnVwZGF0ZUJhckZvclN1YmNoYXJ0KGR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVMaW5lRm9yU3ViY2hhcnQoZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICQkLnVwZGF0ZUFyZWFGb3JTdWJjaGFydChkdXJhdGlvbik7XG5cbiAgICAgICAgICAgICAgICAkJC5yZWRyYXdCYXJGb3JTdWJjaGFydChkcmF3QmFyT25TdWIsIGR1cmF0aW9uLCBkdXJhdGlvbik7XG4gICAgICAgICAgICAgICAgJCQucmVkcmF3TGluZUZvclN1YmNoYXJ0KGRyYXdMaW5lT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XZlbnQgPSBkMy5ldmVudC5zb3VyY2VFdmVudDtcbiAgICAgICAgICAgICAgICAkJC56b29tLmFsdERvbWFpbiA9IGQzLmV2ZW50LnNvdXJjZUV2ZW50LmFsdEtleSA/ICQkLngub3JnRG9tYWluKCkgOiBudWxsO1xuICAgICAgICAgICAgICAgIGNvbmZpZy56b29tX29uem9vbXN0YXJ0LmNhbGwoJCQuYXBpLCBkMy5ldmVudC5zb3VyY2VFdmVudCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKFwiem9vbVwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgJCQucmVkcmF3Rm9yWm9vbS5jYWxsKCQkKTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ3pvb21lbmQnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGV2ZW50ID0gZDMuZXZlbnQuc291cmNlRXZlbnQ7XG4gICAgICAgICAgICAgICAgLy8gaWYgY2xpY2ssIGRvIG5vdGhpbmcuIG90aGVyd2lzZSwgY2xpY2sgaW50ZXJhY3Rpb24gd2lsbCBiZSBjYW5jZWxlZC5cbiAgICAgICAgICAgICAgICBpZiAoZXZlbnQgJiYgc3RhcnRFdmVudC5jbGllbnRYID09PSBldmVudC5jbGllbnRYICYmIHN0YXJ0RXZlbnQuY2xpZW50WSA9PT0gZXZlbnQuY2xpZW50WSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLnJlZHJhd0V2ZW50UmVjdCgpO1xuICAgICAgICAgICAgICAgICQkLnVwZGF0ZVpvb20oKTtcbiAgICAgICAgICAgICAgICBjb25maWcuem9vbV9vbnpvb21lbmQuY2FsbCgkJC5hcGksICQkLngub3JnRG9tYWluKCkpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICQkLnpvb20uc2NhbGUgPSBmdW5jdGlvbiAoc2NhbGUpIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuYXhpc19yb3RhdGVkID8gdGhpcy55KHNjYWxlKSA6IHRoaXMueChzY2FsZSk7XG4gICAgICAgIH07XG4gICAgICAgICQkLnpvb20ub3JnU2NhbGVFeHRlbnQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgZXh0ZW50ID0gY29uZmlnLnpvb21fZXh0ZW50ID8gY29uZmlnLnpvb21fZXh0ZW50IDogWzEsIDEwXTtcbiAgICAgICAgICAgIHJldHVybiBbZXh0ZW50WzBdLCBNYXRoLm1heCgkJC5nZXRNYXhEYXRhQ291bnQoKSAvIGV4dGVudFsxXSwgZXh0ZW50WzFdKV07XG4gICAgICAgIH07XG4gICAgICAgICQkLnpvb20udXBkYXRlU2NhbGVFeHRlbnQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgcmF0aW8gPSBkaWZmRG9tYWluKCQkLngub3JnRG9tYWluKCkpIC8gZGlmZkRvbWFpbigkJC5nZXRab29tRG9tYWluKCkpLFxuICAgICAgICAgICAgICAgIGV4dGVudCA9IHRoaXMub3JnU2NhbGVFeHRlbnQoKTtcbiAgICAgICAgICAgIHRoaXMuc2NhbGVFeHRlbnQoW2V4dGVudFswXSAqIHJhdGlvLCBleHRlbnRbMV0gKiByYXRpb10pO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRab29tRG9tYWluID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDMsXG4gICAgICAgICAgICBtaW4gPSBkMy5taW4oWyQkLm9yZ1hEb21haW5bMF0sIGNvbmZpZy56b29tX3hfbWluXSksXG4gICAgICAgICAgICBtYXggPSBkMy5tYXgoWyQkLm9yZ1hEb21haW5bMV0sIGNvbmZpZy56b29tX3hfbWF4XSk7XG4gICAgICAgIHJldHVybiBbbWluLCBtYXhdO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlWm9vbSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgeiA9ICQkLmNvbmZpZy56b29tX2VuYWJsZWQgPyAkJC56b29tIDogZnVuY3Rpb24gKCkge307XG4gICAgICAgICQkLm1haW4uc2VsZWN0KCcuJyArIENMQVNTLnpvb21SZWN0KS5jYWxsKHopLm9uKFwiZGJsY2xpY2suem9vbVwiLCBudWxsKTtcbiAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuZXZlbnRSZWN0KS5jYWxsKHopLm9uKFwiZGJsY2xpY2suem9vbVwiLCBudWxsKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnJlZHJhd0Zvclpvb20gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGQzID0gJCQuZDMsIGNvbmZpZyA9ICQkLmNvbmZpZywgem9vbSA9ICQkLnpvb20sIHggPSAkJC54O1xuICAgICAgICBpZiAoIWNvbmZpZy56b29tX2VuYWJsZWQpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChkMy5ldmVudC5zb3VyY2VFdmVudC50eXBlID09PSAnbW91c2Vtb3ZlJyAmJiB6b29tLmFsdERvbWFpbikge1xuICAgICAgICAgICAgeC5kb21haW4oem9vbS5hbHREb21haW4pO1xuICAgICAgICAgICAgem9vbS5zY2FsZSh4KS51cGRhdGVTY2FsZUV4dGVudCgpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkgJiYgeC5vcmdEb21haW4oKVswXSA9PT0gJCQub3JnWERvbWFpblswXSkge1xuICAgICAgICAgICAgeC5kb21haW4oWyQkLm9yZ1hEb21haW5bMF0gLSAxZS0xMCwgeC5vcmdEb21haW4oKVsxXV0pO1xuICAgICAgICB9XG4gICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogZmFsc2UsXG4gICAgICAgICAgICB3aXRoWTogY29uZmlnLnpvb21fcmVzY2FsZSxcbiAgICAgICAgICAgIHdpdGhTdWJjaGFydDogZmFsc2UsXG4gICAgICAgICAgICB3aXRoRXZlbnRSZWN0OiBmYWxzZSxcbiAgICAgICAgICAgIHdpdGhEaW1lbnNpb246IGZhbHNlXG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoZDMuZXZlbnQuc291cmNlRXZlbnQudHlwZSA9PT0gJ21vdXNlbW92ZScpIHtcbiAgICAgICAgICAgICQkLmNhbmNlbENsaWNrID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBjb25maWcuem9vbV9vbnpvb20uY2FsbCgkJC5hcGksIHgub3JnRG9tYWluKCkpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUNvbG9yID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDMsXG4gICAgICAgICAgICBjb2xvcnMgPSBjb25maWcuZGF0YV9jb2xvcnMsXG4gICAgICAgICAgICBwYXR0ZXJuID0gbm90RW1wdHkoY29uZmlnLmNvbG9yX3BhdHRlcm4pID8gY29uZmlnLmNvbG9yX3BhdHRlcm4gOiBkMy5zY2FsZS5jYXRlZ29yeTEwKCkucmFuZ2UoKSxcbiAgICAgICAgICAgIGNhbGxiYWNrID0gY29uZmlnLmRhdGFfY29sb3IsXG4gICAgICAgICAgICBpZHMgPSBbXTtcblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIHZhciBpZCA9IGQuaWQgfHwgKGQuZGF0YSAmJiBkLmRhdGEuaWQpIHx8IGQsIGNvbG9yO1xuXG4gICAgICAgICAgICAvLyBpZiBjYWxsYmFjayBmdW5jdGlvbiBpcyBwcm92aWRlZFxuICAgICAgICAgICAgaWYgKGNvbG9yc1tpZF0gaW5zdGFuY2VvZiBGdW5jdGlvbikge1xuICAgICAgICAgICAgICAgIGNvbG9yID0gY29sb3JzW2lkXShkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGlmIHNwZWNpZmllZCwgY2hvb3NlIHRoYXQgY29sb3JcbiAgICAgICAgICAgIGVsc2UgaWYgKGNvbG9yc1tpZF0pIHtcbiAgICAgICAgICAgICAgICBjb2xvciA9IGNvbG9yc1tpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBpZiBub3Qgc3BlY2lmaWVkLCBjaG9vc2UgZnJvbSBwYXR0ZXJuXG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoaWRzLmluZGV4T2YoaWQpIDwgMCkgeyBpZHMucHVzaChpZCk7IH1cbiAgICAgICAgICAgICAgICBjb2xvciA9IHBhdHRlcm5baWRzLmluZGV4T2YoaWQpICUgcGF0dGVybi5sZW5ndGhdO1xuICAgICAgICAgICAgICAgIGNvbG9yc1tpZF0gPSBjb2xvcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayBpbnN0YW5jZW9mIEZ1bmN0aW9uID8gY2FsbGJhY2soY29sb3IsIGQpIDogY29sb3I7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUxldmVsQ29sb3IgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIGNvbG9ycyA9IGNvbmZpZy5jb2xvcl9wYXR0ZXJuLFxuICAgICAgICAgICAgdGhyZXNob2xkID0gY29uZmlnLmNvbG9yX3RocmVzaG9sZCxcbiAgICAgICAgICAgIGFzVmFsdWUgPSB0aHJlc2hvbGQudW5pdCA9PT0gJ3ZhbHVlJyxcbiAgICAgICAgICAgIHZhbHVlcyA9IHRocmVzaG9sZC52YWx1ZXMgJiYgdGhyZXNob2xkLnZhbHVlcy5sZW5ndGggPyB0aHJlc2hvbGQudmFsdWVzIDogW10sXG4gICAgICAgICAgICBtYXggPSB0aHJlc2hvbGQubWF4IHx8IDEwMDtcbiAgICAgICAgcmV0dXJuIG5vdEVtcHR5KGNvbmZpZy5jb2xvcl90aHJlc2hvbGQpID8gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB2YXIgaSwgdiwgY29sb3IgPSBjb2xvcnNbY29sb3JzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHZhbHVlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHYgPSBhc1ZhbHVlID8gdmFsdWUgOiAodmFsdWUgKiAxMDAgLyBtYXgpO1xuICAgICAgICAgICAgICAgIGlmICh2IDwgdmFsdWVzW2ldKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbG9yID0gY29sb3JzW2ldO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gY29sb3I7XG4gICAgICAgIH0gOiBudWxsO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRZRm9ybWF0ID0gZnVuY3Rpb24gKGZvckFyYykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgZm9ybWF0Rm9yWSA9IGZvckFy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VlLCB3aXRoWTogJCQuY29uZmlnLnpvb21fcmVzY2FsZX0pO1xuICAgICAgICAgICAgJCQuY29uZmlnLnpvb21fb256b29tLmNhbGwodGhpcywgJCQueC5vcmdEb21haW4oKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICQkLmJydXNoLmV4dGVudCgpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uem9vbS5lbmFibGUgPSBmdW5jdGlvbiAoZW5hYmxlZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsO1xuICAgICAgICAkJC5jb25maWcuem9vbV9lbmFibGVkID0gZW5hYmxlZDtcbiAgICAgICAgJCQudXBkYXRlQW5kUmVkcmF3KCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi51bnpvb20gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWw7XG4gICAgICAgICQkLmJydXNoLmNsZWFyKCkudXBkYXRlKCk7XG4gICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZVhEb21haW46IHRydWV9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uem9vbS5tYXggPSBmdW5jdGlvbiAobWF4KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMztcbiAgICAgICAgaWYgKG1heCA9PT0gMCB8fCBtYXgpIHtcbiAgICAgICAgICAgIGNvbmZpZy56b29tX3hfbWF4ID0gZDMubWF4KFskJC5vcmdYRG9tYWluWzFdLCBtYXhdKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuem9vbV94X21heDtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi56b29tLm1pbiA9IGZ1bmN0aW9uIChtaW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnLCBkMyA9ICQkLmQzO1xuICAgICAgICBpZiAobWluID09PSAwIHx8IG1pbikge1xuICAgICAgICAgICAgY29uZmlnLnpvb21feF9taW4gPSBkMy5taW4oWyQkLm9yZ1hEb21haW5bMF0sIG1pbl0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGNvbmZpZy56b29tX3hfbWluO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLnpvb20ucmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHtcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQocmFuZ2UubWF4KSkgeyB0aGlzLmRvbWFpbi5tYXgocmFuZ2UubWF4KTsgfVxuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyYW5nZS5taW4pKSB7IHRoaXMuZG9tYWluLm1pbihyYW5nZS5taW4pOyB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIG1heDogdGhpcy5kb21haW4ubWF4KCksXG4gICAgICAgICAgICAgICAgbWluOiB0aGlzLmRvbWFpbi5taW4oKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi5sb2FkID0gZnVuY3Rpb24gKGFyZ3MpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICAvLyB1cGRhdGUgeHMgaWYgc3BlY2lmaWVkXG4gICAgICAgIGlmIChhcmdzLnhzKSB7XG4gICAgICAgICAgICAkJC5hZGRYcyhhcmdzLnhzKTtcbiAgICAgICAgfVxuICAgICAgICAvLyB1cGRhdGUgbmFtZXMgaWYgZXhpc3RzXG4gICAgICAgIGlmICgnbmF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nRDb2x1bW5zVG9EYXRhKGFyZ3MuY29sdW1ucyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGFyZ2V0cyA9ICQkLmNvbnZlcnREYXRhVG9UYXJnZXRzKGRhdGEsIHRydWUpO1xuXG4gICAgICAgIC8vIFVwZGF0ZS9BZGQgZGF0YVxuICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgdmFyIGZvdW5kID0gZmFsc2UsIGksIGo7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdGFyZ2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSB0YXJnZXRzW2ldLmlkKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodC52YWx1ZXNbdC52YWx1ZXMubGVuZ3RoIC0gMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhaWwgPSB0LnZhbHVlc1t0LnZhbHVlcy5sZW5ndGggLSAxXS5pbmRleCArIDE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gdGFyZ2V0c1tpXS52YWx1ZXMubGVuZ3RoO1xuXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBsZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0c1tpXS52YWx1ZXNbal0uaW5kZXggPSB0YWlsICsgajtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRzW2ldLnZhbHVlc1tqXS54ID0gdGFpbCArIGo7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdC52YWx1ZXMgPSB0LnZhbHVlcy5jb25jYXQodGFyZ2V0c1tpXS52YWx1ZXMpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWZvdW5kKSB7IG5vdGZvdW5kSWRzLnB1c2godC5pZCk7IH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gQXBwZW5kIG51bGwgZm9yIG5vdCBmb3VuZCB0YXJnZXRzXG4gICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICB2YXIgaSwgajtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBub3Rmb3VuZElkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSBub3Rmb3VuZElkc1tpXSkge1xuICAgICAgICAgICAgICAgICAgICB0YWlsID0gdC52YWx1ZXNbdC52YWx1ZXMubGVuZ3RoIC0gMV0uaW5kZXggKyAxO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgbGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHQudmFsdWVzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0LmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiB0YWlsICsgaixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB4OiAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLmdldE90aGVyVGFyZ2V0WCh0YWlsICsgaikgOiB0YWlsICsgaixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogbnVsbFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIEdlbmVyYXRlIG51bGwgdmFsdWVzIGZvciBuZXcgdGFyZ2V0XG4gICAgICAgIGlmICgkJC5kYXRhLnRhcmdldHMubGVuZ3RoKSB7XG4gICAgICAgICAgICB0YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaSwgbWlzc2luZyA9IFtdO1xuICAgICAgICAgICAgICAgIGZvciAoaSA9ICQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXNbMF0uaW5kZXg7IGkgPCB0YWlsOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbWlzc2luZy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0LmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksXG4gICAgICAgICAgICAgICAgICAgICAgICB4OiAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLmdldE90aGVyVGFyZ2V0WChpKSA6IGksXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogbnVsbFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgICAgICB2LmluZGV4ICs9IHRhaWw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHYueCArPSB0YWlsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMgPSBtaXNzaW5nLmNvbmNhdCh0LnZhbHVlcyk7XG4gICAgICAgICAgIC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U2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoYmFzZVRhcmdldC52YWx1ZXMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgICAgICBkaWZmID0gYmFzZVRhcmdldC52YWx1ZXNbYmFzZVRhcmdldC52YWx1ZXMubGVuZ3RoIC0gMV0ueCAtIGJhc2VWYWx1ZS54O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGRpZmYgPSBiYXNlVmFsdWUueCAtICQkLmdldFhEb21haW4oJCQuZGF0YS50YXJnZXRzKVswXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGRpZmYgPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZG9tYWluID0gW2Jhc2VWYWx1ZS54IC0gZGlmZiwgYmFzZVZhbHVlLnhdO1xuICAgICAgICAgICAgJCQudXBkYXRlWERvbWFpbihudWxsLCB0cnVlLCB0cnVlLCBmYWxzZSwgZG9tYWluKTtcbiAgICAgICAgfSBlbHNlIGlmIChvcmdEYXRhQ291bnQgPT09IDEpIHtcbiAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgIGRpZmYgPSAoYmFzZVRhcmdldC52YWx1ZXNbYmFzZVRhcmdldC52YWx1ZXMubGVuZ3RoIC0gMV0ueCAtIGJhc2VWYWx1ZS54KSAvIDI7XG4gICAgICAgICAgICAgICAgZG9tYWluID0gW25ldyBEYXRlKCtiYXNlVmFsdWUueCAtIGRpZmYpLCBuZXcgRGF0ZSgrYmFzZVZhbHVlLnggKyBkaWZmKV07XG4gICAgICAgICAgICAgICAgJCQudXBkYXRlWERvbWFpbihudWxsLCB0cnVlLCB0cnVlLCBmYWxzZSwgZG9tYWluKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFNldCB0YXJnZXRzXG4gICAgICAgICQkLnVwZGF0ZVRhcmdldHMoJCQuZGF0YS50YXJnZXRzKTtcblxuICAgICAgICAvLyBSZWRyYXcgd2l0aCBuZXcgdGFyZ2V0c1xuICAgICAgICAkJC5yZWRyYXcoe1xuICAgICAgICAgICAgZmxvdzoge1xuICAgICAgICAgICAgICAgIGluZGV4OiBiYXNlVmFsdWUuaW5kZXgsXG4gICAgICAgICAgICAgICAgbGVuZ3RoOiBsZW5ndGgsXG4gICAgICAgICAgICAgICAgZHVyYXRpb246IGlzVmFsdWUoYXJncy5kdXJhdGlvbikgPyBhcmdzLmR1cmF0aW9uIDogJCQuY29uZmlnLnRyYW5zaXRpb25fZHVyYXRpb24sXG4gICAgICAgICAgICAgICAgZG9uZTogYXJncy5kb25lLFxuICAgICAgICAgICAgICAgIG9yZ0RhdGFDb3VudDogb3JnRGF0YUNvdW50LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHdpdGhMZWdlbmQ6IHRydWUsXG4gICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogb3JnRGF0YUNvdW50ID4gMSxcbiAgICAgICAgICAgIHdpdGhUcmltWERvbWFpbjogZmFsc2UsXG4gICAgICAgICAgICB3aXRoVXBkYXRlWEF4aXM6IHRydWUsXG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUZsb3cgPSBmdW5jdGlvbiAoYXJncykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDM7XG5cbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB0YXJnZXRzID0gYXJncy50YXJnZXRzLFxuICAgICAgICAgICAgICAgIGZsb3cgPSBhcmdzLmZsb3csXG4gICAgICAgICAgICAgICAgZHJhd0JhciA9IGFyZ3MuZHJhd0JhcixcbiAgICAgICAgICAgICAgICBkcmF3TGluZSA9IGFyZ3MuZHJhd0xpbmUsXG4gICAgICAgICAgICAgICAgZHJhd0FyZWEgPSBhcmdzLmRyYXdBcmVhLFxuICAgICAgICAgICAgICAgIGN4ID0gYXJncy5jeCxcbiAgICAgICAgICAgICAgICBjeSA9IGFyZ3MuY3ksXG4gICAgICAgICAgICAgICAgeHYgPSBhcmdzLnh2LFxuICAgICAgICAgICAgICAgIHhGb3JUZXh0ID0gYXJncy54Rm9yVGV4dCxcbiAgICAgICAgICAgICAgICB5Rm9yVGV4dCA9IGFyZ3MueUZvclRleHQsXG4gICAgICAgICAgICAgICAgZHVyYXRpb24gPSBhcmdzLmR1cmF0aW9uO1xuXG4gICAgICAgICAgICB2YXIgdHJhbnNsYXRlWCwgc2NhbGVYID0gMSwgdHJhbnNmb3JtLFxuICAgICAgICAgICAgICAgIGZsb3dJbmRleCA9IGZsb3cuaW5kZXgsXG4gICAgICAgICAgICAgICAgZmxvd0xlbmd0aCA9IGZsb3cubGVuZ3RoLFxuICAgICAgICAgICAgICAgIGZsb3dTdGFydCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCBmbG93SW5kZXgpLFxuICAgICAgICAgICAgICAgIGZsb3dFbmQgPSAkJC5nZXRWYWx1ZU9uSW5kZXgoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcywgZmxvd0luZGV4ICsgZmxvd0xlbmd0aCksXG4gICAgICAgICAgICAgICAgb3JnRG9tYWluID0gJCQueC5kb21haW4oKSwgZG9tYWluLFxuICAgICAgICAgICAgICAgIGR1cmF0aW9uRm9yRmxvdyA9IGZsb3cuZHVyYXRpb24gfHwgZHVyYXRpb24sXG4gICAgICAgICAgICAgICAgZG9uZSA9IGZsb3cuZG9uZSB8fCBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgICAgICB3YWl0ID0gJCQuZ2VuZXJhdGVXYWl0KCk7XG5cbiAgICAgICAgICAgIHZhciB4Z3JpZCA9ICQkLnhncmlkIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lcyA9ICQkLnhncmlkTGluZXMgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uID0gJCQubWFpblJlZ2lvbiB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5UZXh0ID0gJCQubWFpblRleHQgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluQmFyID0gJCQubWFpbkJhciB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5MaW5lID0gJCQubWFpbkxpbmUgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluQXJlYSA9ICQkLm1haW5BcmVhIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpbkNpcmNsZSA9ICQkLm1haW5DaXJjbGUgfHwgZDMuc2VsZWN0QWxsKFtdKTtcblxuICAgICAgICAgICAgLy8gc2V0IGZsYWdcbiAgICAgICAgICAgICQkLmZsb3dpbmcgPSB0cnVlO1xuXG4gICAgICAgICAgICAvLyByZW1vdmUgaGVhZCBkYXRhIGFmdGVyIHJlbmRlcmVkXG4gICAgICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIGQudmFsdWVzLnNwbGljZSgwLCBmbG93TGVuZ3RoKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAvLyB1cGRhdGUgeCBkb21haW4gdG8gZ2VuZXJhdGUgYXhpcyBlbGVtZW50cyBmb3IgZmxvd1xuICAgICAgICAgICAgZG9tYWluID0gJCQudXBkYXRlWERvbWFpbih0YXJnZXRzLCB0cnVlLCB0cnVlKTtcbiAgICAgICAgICAgIC8vIHVwZGF0ZSBlbGVtZW50cyByZWxhdGVkIHRvIHggc2NhbGVcbiAgICAgICAgICAgIGlmICgkJC51cGRhdGVYR3JpZCkgeyAkJC51cGRhdGVYR3JpZCh0cnVlKTsgfVxuXG4gICAgICAgICAgICAvLyBnZW5lcmF0ZSB0cmFuc2Zvcm0gdG8gZmxvd1xuICAgICAgICAgICAgaWYgKCFmbG93Lm9yZ0RhdGFDb3VudCkgeyAvLyBpZiBlbXB0eVxuICAgICAgICAgICAgICAgIGlmICgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmxlbmd0aCAhPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gJCQueChvcmdEb21haW5bMF0pIC0gJCQueChkb21haW5bMF0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmxvd1N0YXJ0ID0gJCQuZ2V0VmFsdWVPbkluZGV4KCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmxvd0VuZCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCAkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICQkLngoZmxvd1N0YXJ0LngpIC0gJCQueChmbG93RW5kLngpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9IGRpZmZEb21haW4oZG9tYWluKSAvIDI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGZsb3cub3JnRGF0YUNvdW50ID09PSAxIHx8IChmbG93U3RhcnQgJiYgZmxvd1N0YXJ0LngpID09PSAoZmxvd0VuZCAmJiBmbG93RW5kLngpKSB7XG4gICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICQkLngob3JnRG9tYWluWzBdKSAtICQkLngoZG9tYWluWzBdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAoJCQueChvcmdEb21haW5bMF0pIC0gJCQueChkb21haW5bMF0pKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gKCQkLngoZmxvd1N0YXJ0LngpIC0gJCQueChmbG93RW5kLngpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzY2FsZVggPSAoZGlmZkRvbWFpbihvcmdEb21haW4pIC8gZGlmZkRvbWFpbihkb21haW4pKTtcbiAgICAgICAgICAgIHRyYW5zZm9ybSA9ICd0cmFuc2xhdGUoJyArIHRyYW5zbGF0ZVggKyAnLDApIHNjYWxlKCcgKyBzY2FsZVggKyAnLDEpJztcblxuICAgICAgICAgICAgJCQuaGlkZVhHcmlkRm9jdXMoKTtcblxuICAgICAgICAgICAgZDMudHJhbnNpdGlvbigpLmVhc2UoJ2xpbmVhcicpLmR1cmF0aW9uKGR1cmF0aW9uRm9yRmxvdykuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgd2FpdC5hZGQoJCQuYXhlcy54LnRyYW5zaXRpb24oKS5jYWxsKCQkLnhBeGlzKSk7XG4gICAgICAgICAgICAgICAgd2FpdC5hZGQobWFpbkJhci50cmFuc2l0aW9uKCkuYXR0cigndHJhbnNmb3JtJywgdHJhbnNmb3JtKSk7XG4gICAgICAgICAgICAgICAgd2FpdC5hZGQobWFpbkxpbmUudHJhbnNpdGlvbigpLmF0dHIoJ3RyYW5zZm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sgKGZsb3dJbmRleCArIGkpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRzLnB1c2goJy4nICsgQ0xBU1MudGV4dCArICctJyArIChmbG93SW5kZXggKyBpKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudFJlY3RzLnB1c2goJy4nICsgQ0xBU1MuZXZlbnRSZWN0ICsgJy0nICsgKGZsb3dJbmRleCArIGkpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlcykuc2VsZWN0QWxsKHNoYXBlcykucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MudGV4dHMpLnNlbGVjdEFsbCh0ZXh0cykucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuZXZlbnRSZWN0cykuc2VsZWN0QWxsKGV2ZW50UmVjdHMpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0KCcuJyArIENMQVNTLnhncmlkKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBkcmF3IGFnYWluIGZvciByZW1vdmluZyBmbG93ZWQgZWxlbWVudHMgYW5kIHJldmVydGluZyBhdHRyXG4gICAgICAgICAgICAgICAgeGdyaWRcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCQkLnhncmlkQXR0cik7XG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lc1xuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbCk7XG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lcy5zZWxlY3QoJ2xpbmUnKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcIngxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogeHYpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieDJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoIDogeHYpO1xuICAgICAgICAgICAgICAgIHhncmlkTGluZXMuc2VsZWN0KCd0ZXh0JylcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4XCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC53aWR0aCA6IDApXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieVwiLCB4dik7XG4gICAgICAgICAgICAgICAgbWFpbkJhclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsIGRyYXdCYXIpO1xuICAgICAgICAgICAgICAgIG1haW5MaW5lXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZHJhd0xpbmUpO1xuICAgICAgICAgICAgICAgIG1haW5BcmVhXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZHJhd0FyZWEpO1xuICAgICAgICAgICAgICAgIG1haW5DaXJjbGVcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiY3hcIiwgY3gpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiY3lcIiwgY3kpO1xuICAgICAgICAgICAgICAgIG1haW5UZXh0XG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIHhGb3JUZXh0KVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIHlGb3JUZXh0KVxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwtb3BhY2l0eScsICQkLm9wYWNpdHlGb3JUZXh0LmJpbmQoJCQpKTtcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKTtcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uLnNlbGVjdCgncmVjdCcpLmZpbHRlcigkJC5pc1JlZ2lvbk9uWClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4XCIsICQkLnJlZ2lvblguYmluZCgkJCkpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgJCQucmVnaW9uV2lkdGguYmluZCgkJCkpO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0V2ZW50UmVjdCgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIGNhbGxiYWNrIGZvciBlbmQgb2YgZmxvd1xuICAgICAgICAgICAgICAgIGRvbmUoKTtcblxuICAgICAgICAgICAgICAgICQkLmZsb3dpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi5zZWxlY3RlZCA9IGZ1bmN0aW9uICh0YXJnZXRJZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBkMyA9ICQkLmQzO1xuICAgICAgICByZXR1cm4gZDMubWVyZ2UoXG4gICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZXMgKyAkJC5nZXRUYXJnZXRTZWxlY3RvclN1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C5jb25maWc7XG4gICAgICAgIGlmICghcmVnaW9ucykgeyByZXR1cm4gY29uZmlnLnJlZ2lvbnM7IH1cbiAgICAgICAgY29uZmlnLnJlZ2lvbnMgPSByZWdpb25zO1xuICAgICAgICAkJC5yZWRyYXdXaXRob3V0UmVzY2FsZSgpO1xuICAgICAgICByZXR1cm4gY29uZmlnLnJlZ2lvbnM7XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi5yZWdpb25zLmFkZCA9IGZ1bmN0aW9uIChyZWdpb25zKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgaWYgKCFyZWdpb25zKSB7IHJldHVybiBjb25maWcucmVnaW9uczsgfVxuICAgICAgICBjb25maWcucmVnaW9ucyA9IGNvbmZpZy5yZWdpb25zLmNvbmNhdChyZWdpb25zKTtcbiAgICAgICAgJCQucmVkcmF3V2l0aG91dFJlc2NhbGUoKTtcbiAgICAgICAgcmV0dXJuIGNvbmZpZy5yZWdpb25zO1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4ucmVnaW9ucy5yZW1vdmUgPSBmdW5jdGlvbiAob3B0aW9ucykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBkdXJhdGlvbiwgY2xhc3NlcywgcmVnaW9ucztcblxuICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fTtcbiAgICAgICAgZHVyYXRpb24gPSAkJC5nZXRPcHRpb24ob3B0aW9ucywgXCJkdXJhdGlvblwiLCBjb25maWcudHJhbnNpdGlvbl9kdXJhdGlvbik7XG4gICAgICAgIGNsYXNzZXMgPSAkJC5nZXRPcHRpb24ob3B0aW9ucywgXCJjbGFzc2VzXCIsIFtDTEFTUy5yZWdpb25dKTtcblxuICAgICAgICByZWdpb25zID0gJCQubWFpbi5zZWxlY3QoJy4nICsgQ0xBU1M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YXhpc0lkXSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICQkLmF4aXMudXBkYXRlTGFiZWxzKCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETzogcmV0dXJuIHNvbWUgdmFsdWVzP1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uYXhpcy5tYXggPSBmdW5jdGlvbiAobWF4KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWF4ID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1heC54KSkgeyBjb25maWcuYXhpc194X21heCA9IG1heC54OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWF4LnkpKSB7IGNvbmZpZy5heGlzX3lfbWF4ID0gbWF4Lnk7IH1cbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtYXgueTIpKSB7IGNvbmZpZy5heGlzX3kyX21heCA9IG1heC55MjsgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc195X21heCA9IGNvbmZpZy5heGlzX3kyX21heCA9IG1heDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHg6IGNvbmZpZy5heGlzX3hfbWF4LFxuICAgICAgICAgICAgICAgIHk6IGNvbmZpZy5heGlzX3lfbWF4LFxuICAgICAgICAgICAgICAgIHkyOiBjb25maWcuYXhpc195Ml9tYXhcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuLmF4aXMubWluID0gZnVuY3Rpb24gKG1pbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIG1pbiA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtaW4ueCkpIHsgY29uZmlnLmF4aXNfeF9taW4gPSBtaW4ueDsgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1pbi55KSkgeyBjb25maWcuYXhpc195X21pbiA9IG1pbi55OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWluLnkyKSkgeyBjb25maWcuYXhpc195Ml9taW4gPSBtaW4ueTI7IH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeV9taW4gPSBjb25maWcuYXhpc195Ml9taW4gPSBtaW47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLCB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZX0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB4OiBjb25maWcuYXhpc194X21pbixcbiAgICAgICAgICAgICAgICB5OiBjb25maWcuYXhpc195X21pbixcbiAgICAgICAgICAgICAgICB5MjogY29uZmlnLmF4aXNfeTJfbWluXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi5heGlzLnJhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoaXNEZW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ICAgICAgICAgZm9yIChpID0gTWF0aC5jZWlsKGRvbWFpblswXSk7IGkgPCBkb21haW5bMV07IGkrKykge1xuICAgICAgICAgICAgICAgIHRpY2tzLnB1c2goaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGlja3MubGVuZ3RoID4gMCAmJiB0aWNrc1swXSA+IDApIHtcbiAgICAgICAgICAgICAgICB0aWNrcy51bnNoaWZ0KHRpY2tzWzBdIC0gKHRpY2tzWzFdIC0gdGlja3NbMF0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aWNrcztcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBjb3B5U2NhbGUoKSB7XG4gICAgICAgICAgICB2YXIgbmV3U2NhbGUgPSBzY2FsZS5jb3B5KCksIGRvbWFpbjtcbiAgICAgICAgICAgIGlmIChwYXJhbXMuaXNDYXRlZ29yeSkge1xuICAgICAgICAgICAgICAgIGRvbWFpbiA9IHNjYWxlLmRvbWFpbigpO1xuICAgICAgICAgICAgICAgIG5ld1NjYWxlLmRvbWFpbihbZG9tYWluWzBdLCBkb21haW5bMV0gLSAxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbmV3U2NhbGU7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdGV4dEZvcm1hdHRlZCh2KSB7XG4gICAgICAgICAgICB2YXIgZm9ybWF0dGVkID0gdGlja0Zvcm1hdCA/IHRpY2tGb3JtYXQodikgOiB2O1xuICAgICAgICAgICAgcmV0dXJuIHR5cGVvZiBmb3JtYXR0ZWQgIT09ICd1bmRlZmluZWQnID8gZm9ybWF0dGVkIDogJyc7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gZ2V0U2l6ZUZvcjFDaGFyKHRpY2spIHtcbiAgICAgICAgICAgIGlmICh0aWNrVGV4dENoYXJTaXplKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRpY2tUZXh0Q2hhclNpemU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgc2l6ZSA9IHtcbiAgICAgICAgICAgICAgICBoOiAxMS41LFxuICAgICAgICAgICAgICAgIHc6IDUuNVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHRpY2suc2VsZWN0KCd0ZXh0JykudGV4dCh0ZXh0Rm9ybWF0dGVkKS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGJveCA9IHRoaXMuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksXG4gICAgICAgICAgICAgICAgICAgIHRleHQgPSB0ZXh0Rm9ybWF0dGVkKGQpLFxuICAgICAgICAgICAgICAgICAgICBoID0gYm94LmhlaWdodCxcbiAgICAgICAgICAgICAgICAgICAgdyA9IHRleHQgPyAoYm94LndpZHRoIC8gdGV4dC5sZW5ndGgpIDogdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmIChoICYmIHcpIHtcbiAgICAgICAgICAgICAgICAgICAgc2l6ZS5oID0gaDtcbiAgICAgICAgICAgICAgICAgICAgc2l6ZS53ID0gdztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS50ZXh0KCcnKTtcbiAgICAgICAgICAgIHRpY2tUZXh0Q2hhclNpemUgPSBzaXplO1xuICAgICAgICAgICAgcmV0dXJuIHNpemU7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdHJhbnNpdGlvbmlzZShzZWxlY3Rpb24pIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJhbXMud2l0aG91dFRyYW5zaXRpb24gPyBzZWxlY3Rpb24gOiBkMy50cmFuc2l0aW9uKHNlbGVjdGlvbik7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gYXhpcyhnKSB7XG4gICAgICAgICAgICBnLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBnID0gYXhpcy5nID0gZDMuc2VsZWN0KHRoaXM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AgICAgICAgICAgICAgIHBhdGggPSBnLnNlbGVjdEFsbChcIi5kb21haW5cIikuZGF0YShbIDAgXSksXG4gICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUgPSAocGF0aC5lbnRlcigpLmFwcGVuZChcInBhdGhcIikuYXR0cihcImNsYXNzXCIsIFwiZG9tYWluXCIpLCB0cmFuc2l0aW9uaXNlKHBhdGgpKTtcbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuYXBwZW5kKFwibGluZVwiKTtcbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuYXBwZW5kKFwidGV4dFwiKTtcblxuICAgICAgICAgICAgICAgIHZhciBsaW5lRW50ZXIgPSB0aWNrRW50ZXIuc2VsZWN0KFwibGluZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZSA9IHRpY2tVcGRhdGUuc2VsZWN0KFwibGluZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyID0gdGlja0VudGVyLnNlbGVjdChcInRleHRcIiksXG4gICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUgPSB0aWNrVXBkYXRlLnNlbGVjdChcInRleHRcIik7XG5cbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmlzQ2F0ZWdvcnkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja09mZnNldCA9IE1hdGguY2VpbCgoc2NhbGUxKDEpIC0gc2NhbGUxKDApKSAvIDIpO1xuICAgICAgICAgICAgICAgICAgICB0aWNrWCA9IHRpY2tDZW50ZXJlZCA/IDAgOiB0aWNrT2Zmc2V0O1xuICAgICAgICAgICAgICAgICAgICB0aWNrWSA9IHRpY2tDZW50ZXJlZCA/IHRpY2tPZmZzZXQgOiAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tPZmZzZXQgPSB0aWNrWCA9IDA7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIHRleHQsIHRzcGFuLCBzaXplRm9yMUNoYXIgPSBnZXRTaXplRm9yMUNoYXIoZy5zZWxlY3QoJy50aWNrJykpLCBjb3VudHMgPSBbXTtcbiAgICAgICAgICAgICAgICB2YXIgdGlja0xlbmd0aCA9IE1hdGgubWF4KGlubmVyVGlja1NpemUsIDApICsgdGlja1BhZGRpbmcsXG4gICAgICAgICAgICAgICAgICAgIGlzVmVydGljYWwgPSBvcmllbnQgPT09ICdsZWZ0JyB8fCBvcmllbnQgPT09ICdyaWdodCc7XG5cbiAgICAgICAgICAgICAgICAvLyB0aGlzIHNob3VsZCBiZSBjYWxsZWQgb25seSB3aGVuIGNhdGVnb3J5IGF4aXNcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzcGxpdFRpY2tUZXh0KGQsIG1heFdpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0aWNrVGV4dCA9IHRleHRGb3JtYXR0ZWQoZCksXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJ0ZXh0LCBzcGFjZUluZGV4LCB0ZXh0V2lkdGgsIHNwbGl0dGVkID0gW107XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh0aWNrVGV4dCkgPT09IFwiW29iamVjdCBBcnJheV1cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRpY2tUZXh0O1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFtYXhXaWR0aCB8fCBtYXhXaWR0aCA8PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXhXaWR0aCA9IGlzVmVydGljYWwgPyA5NSA6IHBhcmFtcy5pc0NhdGVnb3J5ID8gKE1hdGguY2VpbChzY2FsZTEodGlja3NbMV0pIC0gc2NhbGUxKHRpY2tzWzBdKSkgLSAxMikgOiAxMTA7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBzcGxpdChzcGxpdHRlZCwgdGV4dCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3BhY2VJbmRleCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgdGV4dC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJBdChpKSA9PT0gJyAnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlSW5kZXggPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0ZXh0ID0gdGV4dC5zdWJzdHIoMCwgaSArIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRXaWR0aCA9IHNpemVGb3IxQ2hhci53ICogc3VidGV4dC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGV4dCB3aWR0aCBnZXRzIG92ZXIgdGljayB3aWR0aCwgc3BsaXQgYnkgc3BhY2UgaW5kZXggb3IgY3JyZW50IGluZGV4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1heFdpZHRoIDwgdGV4dFdpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwbGl0dGVkLmNvbmNhdCh0ZXh0LnN1YnN0cigwLCBzcGFjZUluZGV4ID8gc3BhY2VJbmRleCA6IGkpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc2xpY2Uoc3BhY2VJbmRleCA/IHNwYWNlSW5kZXggKyAxIDogaSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXR0ZWQuY29uY2F0KHRleHQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwbGl0KHNwbGl0dGVkLCB0aWNrVGV4dCArIFwiXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRzcGFuRHkoZCwgaSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZHkgPSBzaXplRm9yMUNoYXIuaDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcmllbnQgPT09ICdsZWZ0JyB8fCBvcmllbnQgPT09ICdyaWdodCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkeSA9IC0oKGNvdW50c1tkLmluZGV4XSAtIDEpICogKHNpemVGb3IxQ2hhci5oIC8gMikgLSAzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZHkgPSBcIi43MWVtXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGR5O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRpY2tTaXplKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpY2tQb3NpdGlvbiA9IHNjYWxlKGQpICsgKHRpY2tDZW50ZXJlZCA/IDAgOiB0aWNrT2Zmc2V0KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJhbmdlWzBdIDwgdGlja1Bvc2l0aW9uICYmIHRpY2tQb3NpdGlvbiA8IHJhbmdlWzFdID8gaW5uZXJUaWNrU2l6ZSA6IDA7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdGV4dCA9IHRpY2suc2VsZWN0KFwidGV4dFwiKTtcbiAgICAgICAgICAgICAgICB0c3BhbiA9IHRleHQuc2VsZWN0QWxsKCd0c3BhbicpXG4gICAgICAgICAgICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3BsaXR0ZWQgPSBwYXJhbXMudGlja011bHRpbGluZSA/IHNwbGl0VGlja1RleHQoZCwgcGFyYW1zLnRpY2tXaWR0aCkgOiBbXS5jb25jYXQodGV4dEZvcm1hdHRlZChkKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb3VudHNbaV0gPSBzcGxpdHRlZC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXR0ZWQubWFwKGZ1bmN0aW9uIChzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgaW5kZXg6IGksIHNwbGl0dGVkOiBzIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdHNwYW4uZW50ZXIoKS5hcHBlbmQoJ3RzcGFuJyk7XG4gICAgICAgICAgICAgICAgdHNwYW4uZXhpdCgpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIHRzcGFuLnRleHQoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGQuc3BsaXR0ZWQ7IH0pO1xuXG4gICAgICAgICAgICAgICAgdmFyIHJvdGF0ZSA9IHBhcmFtcy50aWNrVGV4dFJvdGF0ZTtcblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRleHRBbmNob3JGb3JUZXh0KHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdtaWRkbGUnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGUgPiAwID8gXCJzdGFydFwiIDogXCJlbmRcIjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdGV4dFRyYW5zZm9ybShyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJyb3RhdGUoXCIgKyByb3RhdGUgKyBcIilcIjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gZHhGb3JUZXh0KHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDggKiBNYXRoLnNpbihNYXRoLlBJICogKHJvdGF0ZSAvIDE4MCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB5Rm9yVGV4dChyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWNrTGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxMS41IC0gMi41ICogKHJvdGF0ZSAvIDE1KSAqIChyb3RhdGUgPiAwID8gMSA6IC0xKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBzd2l0Y2ggKG9yaWVudCkge1xuICAgICAgICAgICAgICAgIGNhc2UgXCJib3R0b21cIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNYO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ5MlwiLCBpbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieVwiLCB0aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngxXCIsIHRpY2tYKS5hdHRyKFwieDJcIiwgdGlja1gpLmF0dHIoXCJ5MlwiLCB0aWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIDApLmF0dHIoXCJ5XCIsIHlGb3JUZXh0KHJvdGF0ZSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKFwidGV4dC1hbmNob3JcIiwgdGV4dEFuY2hvckZvclRleHQocm90YXRlKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCB0ZXh0VHJhbnNmb3JtKHJvdGF0ZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHNwYW4uYXR0cigneCcsIDApLmF0dHIoXCJkeVwiLCB0c3BhbkR5KS5hdHRyKCdkeCcsIGR4Rm9yVGV4dChyb3RhdGUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cihcImRcIiwgXCJNXCIgKyByYW5nZVswXSArIFwiLFwiICsgb3V0ZXJUaWNrU2l6ZSArIFwiVjBIXCIgKyByYW5nZVsxXSArIFwiVlwiICsgb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhc2UgXCJ0b3BcIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogcm90YXRlZCB0aWNrIHRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieTJcIiwgLWlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ5XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIDApLmF0dHIoXCJ5MlwiLCAtaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIDApLmF0dHIoXCJ5XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcIm1pZGRsZVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCAwKS5hdHRyKFwiZHlcIiwgXCIwZW1cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgcmFuZ2VbMF0gKyBcIixcIiArIC1vdXRlclRpY2tTaXplICsgXCJWMEhcIiArIHJhbmdlWzFdICsgXCJWXCIgKyAtb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhc2UgXCJsZWZ0XCI6XG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieDJcIiwgLWlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ4XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIC1pbm5lclRpY2tTaXplKS5hdHRyKFwieTFcIiwgdGlja1kpLmF0dHIoXCJ5MlwiLCB0aWNrWSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIC10aWNrTGVuZ3RoKS5hdHRyKFwieVwiLCB0aWNrT2Zmc2V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcImVuZFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCAtdGlja0xlbmd0aCkuYXR0cihcImR5XCIsIHRzcGFuRHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKFwiZFwiLCBcIk1cIiArIC1vdXRlclRpY2tTaXplICsgXCIsXCIgKyByYW5nZVswXSArIFwiSDBWXCIgKyByYW5nZVsxXSArIFwiSFwiICsgLW91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXNlIFwicmlnaHRcIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNZO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ4MlwiLCBpbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieFwiLCB0aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIGlubmVyVGlja1NpemUpLmF0dHIoXCJ5MlwiLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cihcInhcIiwgdGlja0xlbmd0aCkuYXR0cihcInlcIiwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LnN0eWxlKFwidGV4dC1hbmNob3JcIiwgXCJzdGFydFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCB0aWNrTGVuZ3RoKS5hdHRyKFwiZHlcIiwgdHNwYW5EeSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgb3V0ZXJUaWNrU2l6ZSArIFwiLFwiICsgcmFuZ2VbMF0gKyBcIkgwVlwiICsgcmFuZ2VbMV0gKyBcIkhcIiArIG91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHNjYWxlMS5yYW5nZUJhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHggPSBzY2FsZTEsIGR4ID0geC5yYW5nZUJhbmQoKSAvIDI7XG4gICAgICAgICAgICAgICAgICAgIHNjYWxlMCA9IHNjYWxlMSA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geChkKSArIGR4O1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2NhbGUwLnJhbmdlQmFuZCkge1xuICAgICAgICAgICAgICAgICAgICBzY2FsZTAgPSBzY2FsZTE7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja0V4aXQuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTApO1xuICAgICAgICAgICAgICAgIHRpY2tVcGRhdGUuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTEpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgYXhpcy5zY2FsZSA9IGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHNjYWxlOyB9XG4gICAgICAgICAgICBzY2FsZSA9IHg7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy5vcmllbnQgPSBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiBvcmllbnQ7IH1cbiAgICAgICAgICAgIG9yaWVudCA9IHggaW4ge3RvcDogMSwgcmlnaHQ6IDEsIGJvdHRvbTogMSwgbGVmdDogMX0gPyB4ICsgXCJcIiA6IFwiYm90dG9tXCI7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrRm9ybWF0ID0gZnVuY3Rpb24gKGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrRm9ybWF0OyB9XG4gICAgICAgICAgICB0aWNrRm9ybWF0ID0gZm9ybWF0O1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0NlbnRlcmVkID0gZnVuY3Rpb24gKGlzQ2VudGVyZWQpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja0NlbnRlcmVkOyB9XG4gICAgICAgICAgICB0aWNrQ2VudGVyZWQgPSBpc0NlbnRlcmVkO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja09mZnNldCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aWNrT2Zmc2V0O1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tJbnRlcnZhbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBpbnRlcnZhbCwgbGVuZ3RoO1xuICAgICAgICAgICAgaWYgKHBhcmFtcy5pc0NhdGVnb3J5KSB7XG4gICAgICAgICAgICAgICAgaW50ZXJ2YWwgPSB0aWNrT2Zmc2V0ICogMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGxlbmd0aCA9IGF4aXMuZy5zZWxlY3QoJ3BhdGguZG9tYWluJykubm9kZSgpLmdldFRvdGFsTGVuZ3RoKCkgLSBvdXRlclRpY2tTaXplICogMjtcbiAgICAgICAgICAgICAgICBpbnRlcnZhbCA9IGxlbmd0aCAvIGF4aXMuZy5zZWxlY3RBbGwoJ2xpbmUnKS5zaXplKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gaW50ZXJ2YWwgPT09IEluZmluaXR5ID8gMCA6IGludGVydmFsO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrQXJndW1lbnRzOyB9XG4gICAgICAgICAgICB0aWNrQXJndW1lbnRzID0gYXJndW1lbnRzO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0N1bGxpbmcgPSBmdW5jdGlvbiAoY3VsbGluZykge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrQ3VsbGluZzsgfVxuICAgICAgICAgICAgdGlja0N1bGxpbmcgPSBjdWxsaW5nO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja1ZhbHVlcyA9IGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHggPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICB0aWNrVmFsdWVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geChzY2FsZS5kb21haW4oKSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja1ZhbHVlczsgfVxuICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMgPSB4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBheGlzO1xuICAgIH1cblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmlzU2FmYXJpID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgdWEgPSB3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudDtcbiAgICAgICAgcmV0dXJuIHVhLmluZGV4T2YoJ1NhZmFyaScpID49IDAgJiYgdWEuaW5kZXhPZignQ2hyb21lJykgPCAwO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaXNDaHJvbWUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciB1YSA9IHdpbmRvdy5uYXZpZ2F0b3IudXNlckFnZW50O1xuICAgICAgICByZXR1cm4gdWEuaW5kZXhPZignQ2hyb21lJykgPj0gMDtcbiAgICB9O1xuXG4gICAgLyoganNoaW50IGl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gICAgICAgIHZhciBzdHJpbmcgPSBcIlwiO1xuICAgICAgICAgICAgIHZhciBmaXJzdCA9IHRydWU7XG4gICAgICAgICAgICAgcGF0aFNlZ0FycmF5LmZvckVhY2goZnVuY3Rpb24ocGF0aFNlZykge1xuICAgICAgICAgICAgICAgICBpZiAoZmlyc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gcGF0aFNlZy5fYXNQYXRoU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gXCIgXCIgKyBwYXRoU2VnLl9hc1BhdGhTdHJpbmcoKTtcbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgIHJldHVybiBzdHJpbmc7XG4gICAgICAgICB9XG5cbiAgICAgICAgIC8vIFRoaXMgY2xvc2VseSBmb2xsb3dzIFNWR1BhdGhQYXJzZXI6OnBhcnNlUGF0aCBmcm9tIFNvdXJjZS9jb3JlL3N2Zy9TVkdQYXRoUGFyc2VyLmNwcC5cbiAgICAgICAgIFNWR1BhdGhTZWdMaXN0LnByb3RvdHlwZS5fcGFyc2VQYXRoID0gZnVuY3Rpb24oc3RyaW5nKSB7XG4gICAgICAgICAgICAgaWYgKCFzdHJpbmcgfHwgc3RyaW5nLmxlbmd0aCA9PSAwKVxuICAgICAgICAgICAgICAgICByZXR1cm4gW107XG5cbiAgICAgICAgICAgICB2YXIgb3duaW5nUGF0aFNlZ0xpc3QgPSB0aGlzO1xuXG4gICAgICAgICAgICAgdmFyIEJ1aWxkZXIgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdGhpcy5wYXRoU2VnTGlzdCA9IFtdO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIEJ1aWxkZXIucHJvdG90eXBlLmFwcGVuZFNlZ21lbnQ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9lbmRJbmRleCAmJiB0aGlzLl9pc0N1cnJlbnRTcGFjZSgpKVxuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleDtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9za2lwT3B0aW9uYWxTcGFjZXNPckRlbGltaXRlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgIXRoaXMuX2lzQ3VycmVudFNwYWNlKCkgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpICE9IFwiLFwiKVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCIsXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXg7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5oYXNNb3JlRGF0YSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXg7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5wZWVrU2VnbWVudFR5cGUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdmFyIGxvb2thaGVhZCA9IHRoaXMuX3N0cmluZ1t0aGlzLl9jdXJyZW50SW5kZXhdO1xuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fcGF0aFNlZ1R5cGVGcm9tQ2hhcihsb29rYWhlYWQpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3BhdGhTZWdUeXBlRnJvbUNoYXIgPSBmdW5jdGlvbihsb29rYWhlYWQpIHtcbiAgICAgICAgICAgICAgICAgc3dpdGNoIChsb29rYWhlYWQpIHtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlpcIjpcbiAgICAgICAgICAgICAgICAgY2FzZSBcInpcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ0xPU0VQQVRIO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiTVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwibVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiTFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwibFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiQ1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcImNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJRXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInFcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19RVUFEUkFUSUNfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiQVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19BUkNfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiYVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19BUkNfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiSFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fSE9SSVpPTlRBTF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJoXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19IT1JJWk9OVEFMX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlZcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1ZFUlRJQ0FMX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInZcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1ZFUlRJQ0FMX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19TTU9PVEhfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwic1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX1NNT09USF9SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJUXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX1NNT09USF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJ0XCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX1NNT09USF9SRUw7XG4gICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV047XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9uZXh0Q29tbWFuZEhlbHBlciA9IGZ1bmN0aW9uKGxvb2thaGVhZCwgcHJldmlvdXNDb21tYW5kKSB7XG4gICAgICAgICAgICAgICAgIC8vIENoZWNrIGZvciByZW1haW5pbmcgY29vcmRpbmF0ZXMgaW4gdGhlIGN1cnJlbnQgY29tbWFuZC5cbiAgICAgICAgICAgICAgICAgaWYgKChsb29rYWhlYWQgPT0gXCIrXCIgfHwgbG9va2FoZWFkID09IFwiLVwiIHx8IGxvb2thaGVhZCA9PSBcIi5cIiB8fCAobG9va2FoZWFkID49IFwiMFwiICYmIGxvb2thaGVhZCA8PSBcIjlcIikpICYmIHByZXZpb3VzQ29tbWFuZCAhPSBTVkdQYXRoU2VnLlBBVEhTRUdfQ0xPU0VQQVRIKSB7XG4gICAgICAgICAgICAgICAgICAgICBpZiAocHJldmlvdXNDb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX0FCUztcbiAgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2aW91c0NvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUwpXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fUkVMO1xuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByZXZpb3VzQ29tbWFuZDtcbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV047XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5pbml0aWFsQ29tbWFuZElzTW92ZVRvID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIC8vIElmIHRoZSBwYXRoIGlzIGVtcHR5IGl0IGlzIHN0aWxsIHZhbGlkLCBzbyByZXR1cm4gdHJ1ZS5cbiAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmhhc01vcmVEYXRhKCkpXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgdmFyIGNvbW1hbmQgPSB0aGlzLnBlZWtTZWdtZW50VHlwZSgpO1xuICAgICAgICAgICAgICAgICAvLyBQYXRoIG11c3Qgc3RhcnQgd2l0aCBtb3ZlVG8uXG4gICAgICAgICAgICAgICAgIHJldHVybiBjb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTIHx8IGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUw7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgLy8gUGFyc2UgYSBudW1iZXIgZnJvbSBhbiBTVkcgcGF0aC4gVGhpcyB2ZXJ5IGNsb3NlbHkgZm9sbG93cyBnZW5lcmljUGFyc2VOdW1iZXIoLi4uKSBmcm9tIFNvdXJjZS9jb3JlL3N2Zy9TVkdQYXJzZXJVdGlsaXRpZXMuY3BwLlxuICAgICAgICAgICAgIC8vIFNwZWM6IGh0dHA6Ly93d3cudzMub3JnL1RSL1NWRzExL3NpbmdsZS1wYWdlLmh0bWwjcGF0aHMtUGF0aERhdGFCTkZcbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9wYXJzZU51bWJlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB2YXIgZXhwb25lbnQgPSAwO1xuICAgICAgICAgICAgICAgICB2YXIgaW50ZWdlciA9IDA7XG4gICAgICAgICAgICAgICAgIHZhciBmcmFjID0gMTtcbiAgICAgICAgICAgICAgICAgdmFyIGRlY2ltYWwgPSAwO1xuICAgICAgICAgICAgICAgICB2YXIgc2lnbiA9IDE7XG4gICAgICAgICAgICAgICAgIHZhciBleHBzaWduID0gMTtcblxuICAgICAgICAgICAgICAgICB2YXIgc3RhcnRJbmRleCA9IHRoaXMuX2N1cnJlbnRJbmRleDtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKTtcblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBzaWduLlxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiK1wiKVxuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIi1cIikge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICBzaWduID0gLTE7XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID09IHRoaXMuX2VuZEluZGV4IHx8ICgodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDwgXCIwXCIgfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID4gXCI5XCIpICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSAhPSBcIi5cIikpXG4gICAgICAgICAgICAgICAgICAgICAvLyBUaGUgZmlyc3QgY2hhcmFjdGVyIG9mIGEgbnVtYmVyIG11c3QgYmUgb25lIG9mIFswLTkrLS5dLlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBpbnRlZ2VyIHBhcnQsIGJ1aWxkIHJpZ2h0LXRvLWxlZnQuXG4gICAgICAgICAgICAgICAgIHZhciBzdGFydEludFBhcnRJbmRleCA9IHRoaXMuX2N1cnJlbnRJbmRleDtcbiAgICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+PSBcIjBcIiAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPD0gXCI5XCIpXG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKzsgLy8gQWR2YW5jZSB0byBmaXJzdCBub24tZGlnaXQuXG5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCAhPSBzdGFydEludFBhcnRJbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgdmFyIHNjYW5JbnRQYXJ0SW5kZXggPSB0aGlzLl9jdXJyZW50SW5kZXggLSAxO1xuICAgICAgICAgICAgICAgICAgICAgdmFyIG11bHRpcGxpZXIgPSAxO1xuICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHNjYW5JbnRQYXJ0SW5kZXggPj0gc3RhcnRJbnRQYXJ0SW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlZ2VyICs9IG11bHRpcGxpZXIgKiAodGhpcy5fc3RyaW5nLmNoYXJBdChzY2FuSW50UGFydEluZGV4LS0pIC0gXCIwXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRpcGxpZXIgKj0gMTA7XG4gICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBkZWNpbWFscy5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIi5cIikge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIG11c3QgYmUgYSBsZWFzdCBvbmUgZGlnaXQgZm9sbG93aW5nIHRoZSAuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4IHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8IFwiMFwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+IFwiOVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgICB3aGlsZSAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID49IFwiMFwiICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8PSBcIjlcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICBkZWNpbWFsICs9ICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCsrKSAtIFwiMFwiKSAqIChmcmFjICo9IDAuMSk7XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBleHBvbmVudCBwYXJ0LlxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ICE9IHN0YXJ0SW5kZXggJiYgdGhpcy5fY3VycmVudEluZGV4ICsgMSA8IHRoaXMuX2VuZEluZGV4ICYmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCJlXCIgfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiRVwiKSAmJiAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXggKyAxKSAhPSBcInhcIiAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCArIDEpICE9IFwibVwiKSkge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFJlYWQgdGhlIHNpZ24gb2YgdGhlIGV4cG9uZW50LlxuICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIitcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCItXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHBzaWduID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIG11c3QgYmUgYW4gZXhwb25lbnQuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4IHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8IFwiMFwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+IFwiOVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgICAgIHdoaWxlICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPj0gXCIwXCIgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDw9IFwiOVwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXhwb25lbnQgKj0gMTA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXhwb25lbnQgKz0gKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSAtIFwiMFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIHZhciBudW1iZXIgPSBpbnRlZ2VyICsgZGVjaW1hbDtcbiAgICAgICAgICAgICAgICAgbnVtYmVyICo9IHNpZ247XG5cbiAgICAgICAgICAgICAgICAgaWYgKGV4cG9uZW50KVxuICAgICAgICAgICAgICAgICAgICAgbnVtYmVyICo9IE1hdGgucG93KDEwLCBleHBzaWduICogZXhwb25lbnQpO1xuXG4gICAgICAgICAgICAgICAgIGlmIChzdGFydEluZGV4ID09IHRoaXMuX2N1cnJlbnRJbmRleClcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzT3JEZWxpbWl0ZXIoKTtcblxuICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3BhcnNlQXJjRmxhZyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4KVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgdmFyIGZsYWcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgdmFyIGZsYWdDaGFyID0gdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgrKyk7XG4gICAgICAgICAgICAgICAgIGlmIChmbGFnQ2hhciA9PSBcIjBcIilcbiAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZmxhZ0NoYXIgPT0gXCIxXCIpXG4gICAgICAgICAgICAgICAgICAgICBmbGFnID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXNPckRlbGltaXRlcigpO1xuICAgICAgICAgICAgICAgICByZXR1cm4gZmxhZztcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLnBhcnNlU2VnbWVudCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB2YXIgbG9va2FoZWFkID0gdGhpcy5fc3RyaW5nW3RoaXMuX2N1cnJlbnRJbmRleF07XG4gICAgICAgICAgICAgICAgIHZhciBjb21tYW5kID0gdGhpcy5fcGF0aFNlZ1R5cGVGcm9tQ2hhcihsb29rYWhlYWQpO1xuICAgICAgICAgICAgICAgICBpZiAoY29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTikge1xuICAgICAgICAgICAgICAgICAgICAgLy8gUG9zc2libHkgYW4gaW1wbGljaXQgY29tbWFuZC4gTm90IGFsbG93ZWQgaWYgdGhpcyBpcyB0aGUgZmlyc3QgY29tbWFuZC5cbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9wcmV2aW91c0NvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV04pXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgICBjb21tYW5kID0gdGhpcy5fbmV4dENvbW1hbmRIZWxwZXIobG9va2FoZWFkLCB0aGlzLl9wcmV2aW91c0NvbW1hbmQpO1xuICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV04pXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3ByZXZpb3VzQ29tbWFuZCA9IGNvbW1hbmQ7XG5cbiAgICAgICAgICAgICAgICAgc3dpdGNoIChjb21tYW5kKSB7XG4gICAgICAgICAgICAgICAgIGNhc2UgU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUw6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNWR1BhdGhTZWdNb3ZldG9SZWwob3duaW5nUGF0aFNlZ0xpc3QsIHRoaXMuX3BhcnNlTnVtYmVyKCksIHRoaXMuX3BhcnNlTnVtYmVyKCkpO1xuICAgICAgICAgICAgICAgICBjYXNlIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTVkdQYXRoU2VnTW92ZXRvQWJzKG93bmluZ1BhdGhTZWdMaXN0LCB0aGlzLl9wYXJzZU51bWJlcigpLCB0aGlzLl9wYXJzZU51bWJlcigpKTtcbiAgICAgICAgICAgICAgICAgY2FzZSBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1JFTDpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU1ZHUGF0aFNlZ0xpbmV0b1JlbChvd25pbmd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JjQW5nbGU6IHRoaXMuX3BhcnNlTnVtYmVyKCksIGFyY0xhcmdlOiB0aGlzLl9wYXJzZUFyY0ZsYWcoKSwgYXJjU3dlZXA6IHRoaXMuX3BhcnNlQXJjRmxhZygpLCB4OiB0aGlzLl9wYXJzZU51bWJlcigpLCB5OiB0aGlzLl9wYXJzZU51bWJlcigpfTtcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU1ZHUGF0aFNlZ0FyY0Ficyhvd25pbmdQYXRoU2VnTGlzdCwgcG9pbnRzLngsIHBvaW50cy55LCBwb2ludHMueDEsIHBvaW50cy55MSwgcG9pbnRzLmFyY0FuZ2xlLCBwb2ludHMuYXJjTGFyZ2UsIHBvaW50cy5hcmNTd2VlcCk7XG4gICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICB0aHJvdyBcIlVua25vd24gcGF0aCBzZWcgdHlwZS5cIlxuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgdmFyIGJ1aWxkZXIgPSBuZXcgQnVpbGRlcigpO1xuICAgICAgICAgICAgIHZhciBzb3VyY2UgPSBuZXcgU291cmNlKHN0cmluZyk7XG5cbiAgICAgICAgICAgICBpZiAoIXNvdXJjZS5pbml0aWFsQ29tbWFuZElzTW92ZVRvKCkpXG4gICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgICB3aGlsZSAoc291cmNlLmhhc01vcmVEYXRhKCkpIHtcbiAgICAgICAgICAgICAgICAgdmFyIHBhdGhTZWcgPSBzb3VyY2UucGFyc2VTZWdtZW50KCk7XG4gICAgICAgICAgICAgICAgIGlmICghcGF0aFNlZylcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgICAgICAgYnVpbGRlci5hcHBlbmRTZWdtZW50KHBhdGhTZWcpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIHJldHVybiBidWl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ICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGFycmF5W2ldKSAhPSBudWxsICYmIGIgPj0gYikge1xuICAgICAgICBhID0gYjtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gYXJyYXlbaV0pICE9IG51bGwgJiYgYSA+IGIpIGEgPSBiO1xuICAgIH0gZWxzZSB7XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gZi5jYWxsKGFycmF5LCBhcnJheVtpXSwgaSkpICE9IG51bGwgJiYgYiA+PSBiKSB7XG4gICAgICAgIGEgPSBiO1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICAgIHdoaWxlICgrK2kgPCBuKSBpZiAoKGIgPSBmLmNhbGwoYXJyYXksIGFycmF5W2ldLCBpKSkgIT0gbnVsbCAmJiBhID4gYikgYSA9IGI7XG4gICAgfVxuICAgIHJldHVybiBhO1xuICB9O1xuICBkMy5tYXggPSBmdW5jdGlvbihhcnJheSwgZikge1xuICAgIHZhciBpID0gLTEsIG4gPSBhcnJheS5sZW5ndGgsIGEsIGI7XG4gICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDEpIHtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSBpZiAoKGIgPSBhcnJheVtpXSkgIT0gbnVsbCAmJiBiID49IGIpIHtcbiAgICAgICAgYSA9IGI7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGFycmF5W2ldKSAhPSBudWxsICYmIGIgPiBhKSBhID0gYjtcbiAgICB9IGVsc2Uge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSAhPSBudWxsICYmIGIgPj0gYikge1xuICAgICAgICBhID0gYjtcbiAgIC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iAgICAgICAgICB9IGVsc2UgaWYgKG5vZGUgIT09IHRydWUpIHtcbiAgICAgICAgICAgIHVwZGF0ZU5vZGVzW2ldID0gbm9kZTtcbiAgICAgICAgICAgIG5vZGUuX19kYXRhX18gPSBub2RlRGF0YTtcbiAgICAgICAgICB9XG4gICAgICAgICAgbm9kZUJ5S2V5VmFsdWUuc2V0KGtleVZhbHVlLCB0cnVlKTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKGkgPSAtMTsgKytpIDwgbjsgKSB7XG4gICAgICAgICAgaWYgKGkgaW4ga2V5VmFsdWVzICYmIG5vZGVCeUtleVZhbHVlLmdldChrZXlWYWx1ZXNbaV0pICE9PSB0cnVlKSB7XG4gICAgICAgICAgICBleGl0Tm9kZXNbaV0gPSBncm91cFtpXTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGZvciAoaSA9IC0xOyArK2kgPCBuMDsgKSB7XG4gICAgICAgICAgbm9kZSA9IGdyb3VwW2ldO1xuICAgICAgICAgIG5vZGVEYXRhID0gZ3JvdXBEYXRhW2ldO1xuICAgICAgICAgIGlmIChub2RlKSB7XG4gICAgICAgICAgICBub2RlLl9fZGF0YV9fID0gbm9kZURhdGE7XG4gICAgICAgICAgICB1cGRhdGVOb2Rlc1tpXSA9IG5vZGU7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGVudGVyTm9kZXNbaV0gPSBkM19zZWxlY3Rpb25fZGF0YU5vZGUobm9kZURhdGEpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBmb3IgKDtpIDwgbTsgKytpKSB7XG4gICAgICAgICAgZW50ZXJOb2Rlc1tpXSA9IGQzX3NlbGVjdGlvbl9kYXRhTm9kZShncm91cERhdGFbaV0pO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoO2kgPCBuOyArK2kpIHtcbiAgICAgICAgICBleGl0Tm9kZXNbaV0gPSBncm91cFtpXTtc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2l6ZVswXSwgZHkgPSBzaXplWzFdLCBjeCA9IGNlbnRlcjAgPyBjZW50ZXIwWzBdIDogZHggLyAyLCBjeSA9IGNlbnRlcjAgPyBjZW50ZXIwWzFdIDogZHkgLyAyLCBpID0gZDMuaW50ZXJwb2xhdGVab29tKFsgKGN4IC0gdmlldy54KSAvIHZpZXcuaywgKGN5IC0gdmlldy55KSAvIHZpZXcuaywgZHggLyB2aWV3LmsgXSwgWyAoY3ggLSB2aWV3MS54KSAvIHZpZXcxLmssIChjeSAtIHZpZXcxLnkpIC8gdmlldzEuaywgZHggLyB2aWV3MS5rIF0pO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgICAgdmFyIGwgPSBpKHQpLCBrID0gZHggLyBsWzJdO1xuICAgICAgICAgICAgICB0aGlzLl9fY2hhcnRfXyA9IHZpZXcgPSB7XG4gICAgICAgICAgICAgICAgeDogY3ggLSBsWzBdICogayxcbiAgICAgICAgICAgICAgICB5OiBjeSAtIGxbMV0gKiBrLFxuICAgICAgICAgICAgICAgIGs6IGtcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgem9vbWVkKGRpc3BhdGNoKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSkuZWFjaChcImludGVycnVwdC56b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgem9vbWVuZGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB9KS5lYWNoKFwiZW5kLnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRoaXMuX19jaGFydF9fID0gdmlldztcbiAgICAgICAgICB6b29tc3RhcnRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgem9vbWVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuICAgIHpvb20udHJhbnNsYXRlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gWyB2aWV3LngsIHZpZXcueSBdO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogK19bMF0sXG4gICAgICAgIHk6ICtfWzFdLFxuICAgICAgICBrOiB2aWV3LmtcbiAgICAgIH07XG4gICAgICByZXNjYWxlKCk7XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2NhbGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB2aWV3Lms7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiB2aWV3LngsXG4gICAgICAgIHk6IHZpZXcueSxcbiAgICAgICAgazogbnVsbFxuICAgICAgfTtcbiAgICAgIHNjYWxlVG8oK18pO1xuICAgICAgcmVzY2FsZSgpO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNjYWxlRXh0ZW50ID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2NhbGVFeHRlbnQ7XG4gICAgICBzY2FsZUV4dGVudCA9IF8gPT0gbnVsbCA/IGQzX2JlaGF2aW9yX3pvb21JbmZpbml0eSA6IFsgK19bMF0sICtfWzFdIF07XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uY2VudGVyID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY2VudGVyO1xuICAgICAgY2VudGVyID0gXyAmJiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNpemUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaXplO1xuICAgICAgc2l6ZSA9IF8gJiYgWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5kdXJhdGlvbiA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGR1cmF0aW9uO1xuICAgICAgZHVyYXRpb24gPSArXztcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS54ID0gZnVuY3Rpb24oeikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDE7XG4gICAgICB4MSA9IHo7XG4gICAgICB4MCA9IHouY29weSgpO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogMCxcbiAgICAgICAgeTogMCxcbiAgICAgICAgazogMVxuICAgICAgfTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS55ID0gZnVuY3Rpb24oeikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTE7XG4gICAgICB5MSA9IHo7XG4gICAgICB5MCA9IHouY29weSgpO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogMCxcbiAgICAgICAgeTogMCxcbiAgICAgICAgazogMVxuICAgICAgfTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgZnVuY3Rpb24gbG9jYXRpb24ocCkge1xuICAgICAgcmV0dXJuIFsgKHBbMF0gLSB2aWV3LngpIC8gdmlldy5rLCAocFsxXSAtIHZpZXcueSkgLyB2aWV3LmsgXTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcG9pbnQobCkge1xuICAgICAgcmV0dXJuIFsgbFswXSAqIHZpZXcuayArIHZpZXcueCwgbFsxXSAqIHZpZXcuayArIHZpZXcueSBdO1xuICAgIH1cbiAgICBmdW5jdGlvbiBzY2Fs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uICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KGkgKyAxKTtcbiAgICAgICAgICBpZiAoYyA9PT0gMTMpIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGkgKyAyKSA9PT0gMTApICsrSTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGMgPT09IDEwKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqICsgMSwgaSkucmVwbGFjZSgvXCJcIi9nLCAnXCInKTtcbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAoSSA8IE4pIHtcbiAgICAgICAgICB2YXIgYyA9IHRleHQuY2hhckNvZGVBdChJKyspLCBrID0gMTtcbiAgICAgICAgICBpZiAoYyA9PT0gMTApIGVvbCA9IHRydWU7IGVsc2UgaWYgKGMgPT09IDEzKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChJKSA9PT0gMTApICsrSSwgKytrO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYyAhPT0gZGVsaW1pdGVyQ29kZSkgY29udGludWU7XG4gICAgICAgICAgcmV0dXJuIHRleHQuc2xpY2UoaiwgSSAtIGspO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGopO1xuICAgICAgfVxuICAgICAgd2hpbGUgKCh0ID0gdG9rZW4oKSkgIT09IEVPRikge1xuICAgICAgICB2YXIgYSA9IFtdO1xuICAgICAgICB3aGlsZSAodCAhPT0gRU9MICYmIHQgIT09IEVPRikge1xuICAgICAgICAgIGEucHVzaCh0KTtcbiAgICAgICAgICB0ID0gdG9rZW4oKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZiAmJiAoYSA9IGYoYSwgbisrKSkgPT0gbnVsbCkgY29udGludWU7XG4gIC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gdGVtcGxhdGUubGVuZ3RoO1xuICAgICAgZnVuY3Rpb24gZm9ybWF0KGRhdGUpIHtcbiAgICAgICAgdmFyIHN0cmluZyA9IFtdLCBpID0gLTEsIGogPSAwLCBjLCBwLCBmO1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIGlmICh0ZW1wbGF0ZS5jaGFyQ29kZUF0KGkpID09PSAzNykge1xuICAgICAgICAgICAgc3RyaW5nLnB1c2godGVtcGxhdGUuc2xpY2UoaiwgaSkpO1xuICAgICAgICAgICAgaWYgKChwID0gZDNfdGltZV9mb3JtYXRQYWRzW2MgPSB0ZW1wbGF0ZS5jaGFyQXQoKytpKV0pICE9IG51bGwpIGMgPSB0ZW1wbGF0ZS5jaGFyQXQoKytpKTtcbiAgICAgICAgICAgIGlmIChmID0gZDNfdGltZV9mb3JtYXRzW2NdKSBjID0gZihkYXRlLCBwID09IG51bGwgPyBjID09PSBcImVcIiA/IFwiIFwiIDogXCIwXCIgOiBwKTtcbiAgICAgICAgICAgIHN0cmluZy5wdXNoKGMpO1xuICAgICAgICAgICAgaiA9IGkgKyAxO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdHJpbmcucHVzaCh0ZW1wbGF0ZS5zbGljZShqLCBpKSk7XG4gICAgICAgIHJldHVybiBzdHJpbmcuam9pbihcIlwiKTtcbiAgICAgIH1cbiAgICAgIGZvcm1hdC5wYXJzZSA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICB2YXIgZCA9IHtcbiAgICAgICAgICB5OiAxOTAwLFxuICAgICAgICAgIG06IDAsXG4gICAgICAgICAgZDogMSxcbiAgICAgICAgICBIOiAwLFxuICAgICAgICAgIE06IDAsXG4gICAgICAgICAgUzogMCxcbiAgICAgICAgICBMOiAwLFxuICAgICAgICAgIFo6IG51bGxcbiAgICAgICAgfSwgaSA9IGQzX3RpbWVfcGFyc2UoZCwgdGVtcGxhdGUsIHN0cmluZywgMCk7XG4gICAgICA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xID0gz4ZpO1xuICAgICAgICB9IGVsc2UgaWYgKM67aSA9ICjOu2kgKyAzNjApICUgMzYwIC0gMTgwLCBhbnRpbWVyaWRpYW4gXiAocyAqIM67XyA8IM67aSAmJiDOu2kgPCBzICogzrspKSB7XG4gICAgICAgICAgdmFyIM+GaSA9IC1pbmZsZWN0aW9uWzFdICogZDNfZGVncmVlcztcbiAgICAgICAgICBpZiAoz4ZpIDwgz4YwKSDPhjAgPSDPhmk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKM+GIDwgz4YwKSDPhjAgPSDPhjtcbiAgICAgICAgICBpZiAoz4YgPiDPhjEpIM+GMSA9IM+GO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhbnRpbWVyaWRpYW4pIHtcbiAgICAgICAgICBpZiAozrsgPCDOu18pIHtcbiAgICAgICAgICAgIGlmIChhbmdsZSjOuzAsIM67KSA+IGFuZ2xlKM67MCwgzrsxKSkgzrsxID0gzrs7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChhbmdsZSjOuywgzrsxKSA+IGFuZ2xlKM67MCwgzrsxKSkgzrswID0gzrs7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICjOuzEgPj0gzrswKSB7XG4gICAgICAgICAgICBpZiAozrsgPCDOuzApIM67MCA9IM67O1xuICAgICAgICAgICAgaWYgKM67ID4gzrsxKSDOuzEgPSDOuztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKM67ID4gzrtfKSB7XG4gICAgICAgICAgICAgIGlmIChhbmdsZSjOuzAsIM67KSA+IGFuZ2xlKM67MCwgzrsxKSkgzrsxID0gzrs7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYW5nbGUozrssIM67MSkgPiBhbmdsZSjOuzAsIM67MSkpIM67MCA9IM67O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgIC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iAgICAgIHZhciBjb3PPhiA9IE1hdGguY29zKM+GICo9IGQzX3JhZGlhbnMpO1xuICAgICAgeDAgPSBjb3PPhiAqIE1hdGguY29zKM67KTtcbiAgICAgIHkwID0gY29zz4YgKiBNYXRoLnNpbijOuyk7XG4gICAgICB6MCA9IE1hdGguc2luKM+GKTtcbiAgICAgIGQzX2dlb19jZW50cm9pZC5wb2ludCA9IG5leHRQb2ludDtcbiAgICAgIGQzX2dlb19jZW50cm9pZFBvaW50WFlaKHgwLCB5MCwgejApO1xuICAgIH07XG4gICAgZnVuY3Rpb24gbmV4dFBvaW50KM67LCDPhikge1xuICAgICAgzrsgKj0gZDNfcmFkaWFucztcbiAgICAgIHZhciBjb3PPhiA9IE1hdGguY29zKM+GICo9IGQzX3JhZGlhbnMpLCB4ID0gY29zz4YgKiBNYXRoLmNvcyjOuyksIHkgPSBjb3PPhiAqIE1hdGguc2luKM67KSwgeiA9IE1hdGguc2luKM+GKSwgdyA9IE1hdGguYXRhbjIoTWF0aC5zcXJ0KCh3ID0geTAgKiB6IC0gejAgKiB5KSAqIHcgKyAodyA9IHowICogeCAtIHgwICogeikgKiB3ICsgKHcgPSB4MCAqIHkgLSB5MCAqIHgpICogdyksIHgwICogeCArIHkwICogeSArIHowICogeik7XG4gICAgICBkM19nZW9fY2VudHJvaWRXMSArPSB3O1xuICAgICAgZDNfZ2VvX2NlbnRyb2lkWDEgKz0gdyAqICh4MCArICh4MCA9IHgpKTtcbiAgICAgIGQzX2dlb19jZW50cm9pZFkxICs9IHcgKiAoeTAgKyAoeTAgPSB5KSk7XG4gICAgICBkM19nZW9fY2VudHJvaWRaMSArPSB3ICogKHowICsgKHowID0geikpO1xuICAgICAgZDNfZ2VvX2NlbnRyb2lkUG9pbnRYWVooeDAsIHkwLCB6MCk7XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19jZW50cm9pZExpbmVFbmQoKSB7XG4gICAgZDNfZ2VvX2NlbnRyb2lkLnBvaW50ID0g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JyZW50Lm4ueCwgMSwgbGlzdGVuZXIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC5uO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChpc1N1YmplY3QpIHtcbiAgICAgICAgICAgIHBvaW50cyA9IGN1cnJlbnQucC56O1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IHBvaW50cy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gcG9pbnRzW2ldKVswXSwgcG9pbnRbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpbnRlcnBvbGF0ZShjdXJyZW50LngsIGN1cnJlbnQucC54LCAtMSwgbGlzdGVuZXIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC5wO1xuICAgICAgICB9XG4gICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm87XG4gICAgICAgIHBvaW50cyA9IGN1cnJlbnQuejtcbiAgICAgICAgaXNTdWJqZWN0ID0gIWlzU3ViamVjdDtcbiAgICAgIH0gd2hpbGUgKCFjdXJyZW50LnYpO1xuICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgIH1cbiAgfVxuICBmdW5jdGlvbiBkM19nZW9fY2xpcFBvbHlnb25MaW5rQ2lyY3VsYXIoYXJyYXkpIHtcbiAgICBpZiAoIShuID0gYXJyYXkubGVuZ3RoKSkgcmV0dXJuO1xuICAgIHZhciBuLCBpID0gMCwgYSA9IGFycmF5WzBdLCBiO1xuICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICBhLm4gPSBiID0gYXJyYXlbaV07XG4gICAgICBiLnAgPSBhO1xuICAgICAgYSA9IGI7XG4gICAgfVxuICAgIGEubiA9IGIgPSBhcnJheVswXTtcbiAgICBiLnAgPSBhO1xuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19jbGlwUG9seWdvb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jOuywgz4YpO1xuICAgICAgICByaW5nTGlzdGVuZXIucG9pbnQocG9pbnRbMF0sIHBvaW50WzFdKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHJpbmdTdGFydCgpIHtcbiAgICAgICAgcmluZ0xpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICByaW5nID0gW107XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiByaW5nRW5kKCkge1xuICAgICAgICBwb2ludFJpbmcocmluZ1swXVswXSwgcmluZ1swXVsxXSk7XG4gICAgICAgIHJpbmdMaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgIHZhciBjbGVhbiA9IHJpbmdMaXN0ZW5lci5jbGVhbigpLCByaW5nU2VnbWVudHMgPSBidWZmZXIuYnVmZmVyKCksIHNlZ21lbnQsIG4gPSByaW5nU2VnbWVudHMubGVuZ3RoO1xuICAgICAgICByaW5nLnBvcCgpO1xuICAgICAgICBwb2x5Z29uLnB1c2gocmluZyk7XG4gICAgICAgIHJpbmcgPSBudWxsO1xuICAgICAgICBpZiAoIW4pIHJldHVybjtcbiAgICAgICAgaWYgKGNsZWFuICYgMSkge1xuICAgICAgICAgIHNlZ21lbnQgPSByaW5nU2VnbWVudHNbMF07XG4gICAgICAgICAgdmFyIG4gPSBzZWdtZW50Lmxlbmd0aCAtIDEsIGkgPSAtMSwgcG9pbnQ7XG4gICAgICAgICAgaWYgKG4gPiAwKSB7XG4gICAgICAgICAgICBpZiAoIXBvbHlnb25TdGFydGVkKSBsaXN0ZW5lci5wb2x5Z29uU3RhcnQoKSwgcG9seWdvblN0YXJ0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICB3aGlsZSAoKytpIDwgbikgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gc2VnbWVudFtpXSlbMF0sIHBvaW50WzFdKTtcbiAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcb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gICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzEsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQozrsxLCDPhjApO1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgfSBlbHNlIGlmIChzzrswICE9PSBzzrsxICYmIGTOuyA+PSDPgCkge1xuICAgICAgICAgIGlmIChhYnMozrswIC0gc867MCkgPCDOtSkgzrswIC09IHPOuzAgKiDOtTtcbiAgICAgICAgICBpZiAoYWJzKM67MSAtIHPOuzEpIDwgzrUpIM67MSAtPSBzzrsxICogzrU7XG4gICAgICAgICAgz4YwID0gZDNfZ2VvX2NsaXBBbnRpbWVyaWRpYW5JbnRlcnNlY3QozrswLCDPhjAsIM67MSwgz4YxKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrswLCDPhjApO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrsxLCDPhjApO1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgfVxuICAgICAgICBsaXN0ZW5lci5wb2ludCjOuzAgPSDOuzEsIM+GMCA9IM+GMSk7XG4gICAgICAgIHPOuzAgPSBzzrsxO1xuICAgICAgfSxcbiAgICAgIGxpbmVFbmQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgIM67MCA9IM+GMCA9IE5hTjtcbiAgICAgIH0sXG4gICAgICBjbGVhbjogZnVuY3Rpb24oKSB7XG4gICAgICAgIHJldHVybiAyIC0gY2xlYW47XG4gICAgICB9XG4gICAgfTtcbiAgfVxuICBmdW5jdGlvbiBkM19nZW9fY2xpcEFudGltZXJpZGlhbkludGVyc2VjdCjOuzAsIM+GMCwgzrsxLCDPhjEpIHtcb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pIHtcbiAgICAgICAgICB2YXIgcG9pbnQxID0gWyDOuywgz4YgXSwgcG9pbnQyLCB2ID0gdmlzaWJsZSjOuywgz4YpLCBjID0gc21hbGxSYWRpdXMgPyB2ID8gMCA6IGNvZGUozrssIM+GKSA6IHYgPyBjb2RlKM67ICsgKM67IDwgMCA/IM+AIDogLc+AKSwgz4YpIDogMDtcbiAgICAgICAgICBpZiAoIXBvaW50MCAmJiAodjAwID0gdjAgPSB2KSkgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgaWYgKHYgIT09IHYwKSB7XG4gICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgICAgaWYgKGQzX2dlb19zcGhlcmljYWxFcXVhbChwb2ludDAsIHBvaW50MikgfHwgZDNfZ2VvX3NwaGVyaWNhbEVxdWFsKHBvaW50MSwgcG9pbnQyKSkge1xuICAgICAgICAgICAgICBwb2ludDFbMF0gKz0gzrU7XG4gICAgICAgICAgICAgIHBvaW50MVsxXSArPSDOtTtcbiAgICAgICAgICAgICAgdiA9IHZpc2libGUocG9pbnQxWzBdLCBwb2ludDFbMV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgICAgIGlmICh2KSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDApO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBvaW50MCA9IHBvaW50MjtcbiAgICAgICAgICB9IGVsc2UgaWYgKG5vdEhlbWlzcGhlcmUgJiYgcG9pbnQwICYmIHNtYWxsUmFkaXVzIF4gdikge1xuICAgICAgICAgICAgdmFyIHQ7XG4gICAgICAgICAgICBpZiAoIShjICYgYzApICYmICh0ID0gaW50ZXJzZWN0KHBvaW50MSwgcG9pbnQwLCB0cnVlKSkpIHtcbiAgICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgICBpZiAoc21hbGxSYWRpdXMpIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzBdWzBdLCB0WzBdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh2ICYmICghcG9pbnQwIHx8ICFkM19nZW9fc3BoZXJpY2FsRXF1YWwocG9pbnQwLCBwb2ludDEpKSkge1xuICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQocG9pbnQxWzBdLCBwb2ludDFbMV0pO1x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gaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR4ID4gMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH1cbiAgICAgIHIgPSB5MCAtIGF5O1xuICAgICAgaWYgKCFkeSAmJiByID4gMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeTtcbiAgICAgIGlmIChkeSA8IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR5ID4gMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH1cbiAgICAgIHIgPSB5MSAtIGF5O1xuICAgICAgaWYgKCFkeSAmJiByIDwgMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeTtcbiAgICAgIGlmIChkeSA8IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR5ID4gMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH1cbiAgICAgIGlmICh0MCA+IDApIGxpbmUuYSA9IHtcbiAgICAgICAgeDogYXggKyB0MCAqIGR4LFxuICAgICAgICB5OiBheSArIHQwICogZHlcbiAgICAgIH07XG4gICAgICBpZiAodDEgPCAxKSBsaW5lLmIgPSB7XG4gICAgICAgIHg6IGF4ICsgdDEgKiBkeCxcbiAgICAgICAgeTogYXkgKyB0MSAqIGR5XG4gICAgICB9O1xuICAgICAgcmV0dXJuIGxpbmU7XG4gICAgfTtcbiAgfVxuICB2YXIgZDNf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9tX2NsaXBMaW5lKHgwLCB5MCwgeDEsIHkxKSwgc2VnbWVudHMsIHBvbHlnb24sIHJpbmc7XG4gICAgICB2YXIgY2xpcCA9IHtcbiAgICAgICAgcG9pbnQ6IHBvaW50LFxuICAgICAgICBsaW5lU3RhcnQ6IGxpbmVTdGFydCxcbiAgICAgICAgbGluZUVuZDogbGluZUVuZCxcbiAgICAgICAgcG9seWdvblN0YXJ0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBsaXN0ZW5lciA9IGJ1ZmZlckxpc3RlbmVyO1xuICAgICAgICAgIHNlZ21lbnRzID0gW107XG4gICAgICAgICAgcG9seWdvbiA9IFtdO1xuICAgICAgICAgIGNsZWFuID0gdHJ1ZTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9seWdvbkVuZDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgbGlzdGVuZXIgPSBsaXN0ZW5lcl87XG4gICAgICAgICAgc2VnbWVudHMgPSBkMy5tZXJnZShzZWdtZW50cyk7XG4gICAgICAgICAgdmFyIGNsaXBTdGFydEluc2lkZSA9IGluc2lkZVBvbHlnb24oWyB4MCwgeTEgXSksIGluc2lkZSA9IGNsZWFuICYmIGNsaXBTdGFydEluc2lkZSwgdmlzaWJsZSA9IHNlZ21lbnRzLmxlbmd0aDtcbiAgICAgICAgICBpZiAoaW5zaWRlIHx8IHZpc2libGUpIHtcbiAgICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25TdGFydCgpO1xuICAgICAgICAgICAgaWYgKGluc2lkZSkge1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgaW50ZXJwb2xhdGUobnVsbCwgbnVsbCwgMSwgbGlzdGVuZXIpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodmlzaWJsZSkge1xuICAgICAgICAgICAgICBkM19nZW9fY2xpcFBvbHlnb24oc2VnbWVudHMsIGNvbXBhcmUsIGNsaXBTdGFydEluc2lkZSwgaW50ZXJwb2xhdGUsIGxpc3RlbmVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25FbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgc2VnbWVudHMgPSBwb2x5Z29uID0gcmluZyA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBpbnNpZGVQb2x5Z29uKHApIHtcbiAgICAgICAgdmFyIHduID0gMCwgbiA9IHBvbHlnb24ubGVuZ3RoLCB5ID0gcFsxXTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICBmb3IgKHZhciBqID0gMSwgdiA9IHBvbHlnb25baV0sIG0gPSB2Lmxlbmd0aCwgYSA9IHZbMF0sIGI7IGogPCBtOyArK2opIHtcbiAgICAgICAgICAgIGIgPSB2W2pdO1xuICAgICAgICAgICAgaWYgKGFbMV0gPD0geSkge1xuICAgICAgICAgICAgICBpZiAoYlsxXSA+IHkgJiYgZDNfY3Jvc3MyZChhLCBiLCBwKSA+IDApICsrd247XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYlsxXSA8PSB5ICYmIGQzX2Nyb3NzMmQoYSwgYiwgcCkgPCAwKSAtLXduO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB3biAhPT0gMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGludGVycG9sYXRlKGZyb20sIHRvLCBkaXJlY3Rpb24sIGxpc3RlbmVyKSB7XG4gICAgICAgIHZhciBhID0gMCwgYTEgPSAwO1xuICAgICAgICBpZiAoZnJvbSA9PSBudWxsIHx8IChhID0gY29ybmVyKGZyb20sIGRpcmVjdGlvbikpICE9PSAoYTEg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18gJiYgdl8pIGJ1ZmZlckxpc3RlbmVyLnJlam9pbigpO1xuICAgICAgICAgIHNlZ21lbnRzLnB1c2goYnVmZmVyTGlzdGVuZXIuYnVmZmVyKCkpO1xuICAgICAgICB9XG4gICAgICAgIGNsaXAucG9pbnQgPSBwb2ludDtcbiAgICAgICAgaWYgKHZfKSBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBsaW5lUG9pbnQoeCwgeSkge1xuICAgICAgICB4ID0gTWF0aC5tYXgoLWQzX2dlb19jbGlwRXh0ZW50TUFYLCBNYXRoLm1pbihkM19nZW9fY2xpcEV4dGVudE1BWCwgeCkpO1xuICAgICAgICB5ID0gTWF0aC5tYXgoLWQzX2dlb19jbGlwRXh0ZW50TUFYLCBNYXRoLm1pbihkM19nZW9fY2xpcEV4dGVudE1BWCwgeSkpO1xuICAgICAgICB2YXIgdiA9IHBvaW50VmlzaWJsZSh4LCB5KTtcbiAgICAgICAgaWYgKHBvbHlnb24pIHJpbmcucHVzaChbIHgsIHkgXSk7XG4gICAgICAgIGlmIChmaXJzdCkge1xuICAgICAgICAgIHhfXyA9IHgsIHlfXyA9IHksIHZfXyA9IHY7XG4gICAgICAgICAgZmlyc3QgPSBmYWxzZTtcbiAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh4LCB5KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKHYgJiYgdl8pIGxpc3RlbmVyLnBvaW50KHgsIHkpOyBlbHNlIHtcbiAgICAgICAgICAgIHZhciBsID0ge1xuICAgICAgICAgICAgICBhOiB7XG4gICAgICAgICAgICAgICAgeDogeF8sXG4gICAgICAgICAgICAgICAgeTogeV9cbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgYjoge1xuICAgICAgICAgICAgICAgIHg6IHgsXG4gICAgICAgICAgICAgICAgeTogeVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGNsaXBMaW5lKGwpKSB7XG4gICAgICAgICAgICAgIGlmICghdl8pIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChsLmEueCwgbC5hLnkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KGwuYi54LCBsLmIueSk7XG4gICAgICAgICAgICAgIGlmICghdikgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh2KSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh4LCB5KTtcbiAgICAgICAgICAgICAgY2xlYW4gPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgeF8gPSB4LCB5XyA9IHksIHZfID0gdjtcbiAgICAgIH1cbiAgICAgIHJldHVybiBjbGlwO1xuICAgIH07XG4gICAgZnVuY3Rpb24gY29ybmVyKHAsIGRpcmVjdGlvbikge1xuICAgICAgcmV0dXJuIGFicyhwWzBdIC0geDApIDwgzrUgPyBkaXJlY3Rpb24gPiAwID8gMCA6IDMgOiBhYnMocFswXSAtIHgxKSA8IM61ID8gZGlyZWN0aW9uID4gMCA/IDIgOiAxIDogYWJzKHBbMV0gLSB5MCkgPCDOtSA/IGRpcmVjdGlvbiA+IDAgPyAxIDogMCA6IGRpcmVjdGlvbiA+IDAgPyAzIDogMjtcbiAgICB9XG4gICAgZnVuY3Rpb24gY29tcGFyZShhLCBiKSB7XG4gICAgICByZXR1cm4gY29tcGFyZVBvaW50cyhhLngsIGIueCk7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uICAgICAgICAgICAgeTogeTBcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS55ID49IHkxKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiAoeTEgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkxXG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6ICh5MSAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTFcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS55IDwgeTApIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6ICh5MCAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTBcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAobHkgPCByeSkge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogeDAsXG4gICAgICAgICAgICB5OiBmbSAqIHgwICsgZmJcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS54ID49IHgxKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiB4MSxcbiAgICAgICAgICAgIHk6IGZtICogeDEgKyBmYlxuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiB4MSxcbiAgICAgICAgICAgIHk6IGZtICogeDEgKyBmYlxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnggPCB4MCkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogeDAsXG4gICAgICAgICAgICB5OiBmbSAqIHgwICsgZmJcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGVkZ2UuYSA9IHZhO1xuICAgIGV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2VvbV92b3Jvbm9pUmVkQmxhY2tGaXJzdCh0aGlzLl8pO1xuICAgICAgICBub2RlLlAgPSBudWxsO1xuICAgICAgICBub2RlLk4gPSBhZnRlcjtcbiAgICAgICAgYWZ0ZXIuUCA9IGFmdGVyLkwgPSBub2RlO1xuICAgICAgICBwYXJlbnQgPSBhZnRlcjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIG5vZGUuUCA9IG5vZGUuTiA9IG51bGw7XG4gICAgICAgIHRoaXMuXyA9IG5vZGU7XG4gICAgICAgIHBhcmVudCA9IG51bGw7XG4gICAgICB9XG4gICAgICBub2RlLkwgPSBub2RlLlIgPSBudWxsO1xuICAgICAgbm9kZS5VID0gcGFyZW50O1xuICAgICAgbm9kZS5DID0gdHJ1ZTtcbiAgICAgIGFmdGVyID0gbm9kZTtcbiAgICAgIHdoaWxlIChwYXJlbnQgJiYgcGFyZW50LkMpIHtcbiAgICAgICAgZ3JhbmRwYSA9IHBhcmVudC5VO1xuICAgICAgICBpZiAocGFyZW50ID09PSBncmFuZHBhLkwpIHtcbiAgICAgICAgICB1bmNsZSA9IGdyYW5kcGEuUjtcbiAgICAgICAgICBpZiAodW5jbGUgJiYgdW5jbGUuQykge1xuICAgICAgICAgICAgcGFyZW50LkMgPSB1bmNsZS5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgYWZ0ZXIgPSBncmFuZHBhO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoYWZ0ZXIgPT09IHBhcmVudC5SKSB7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgICBhZnRlciA9IHBhcmVudDtcbiAgICAgICAgICAgICAgcGFyZW50ID0gYWZ0ZXIuVTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmVudC5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBncmFuZHBhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdW5jbGUgPSBncmFuZHBhLkw7XG4gICAgICAgICAgaWYgKHVuY2xlICYmIHVuY2xlLkMpIHtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdW5jbGUuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZ3JhbmRwYS5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGFmdGVyID0gZ3JhbmRwYTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGFmdGVyID09PSBwYXJlbnQuTCkge1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICAgIGFmdGVyID0gcGFyZW50O1xuICAgICAgICAgICAgICBwYXJlbnQgPSBhZnRlci5VO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGFyZW50LkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgZ3JhbmRwYSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHBhcmVudCA9IGFmdGVyLlU7XG4gICAgICB9XG4gICAgICB0aGlzLl8uQyA9IGZhbHNlO1xuICAgIH0sXG4gICAgcmVtb3ZlOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICBpZiAobm9kZS5OKSBub2RlLk4uUCA9IG5vZGUuUDtcbiAgICAgIGlmIChub2RlLlApIG5vZGUuUC5OID0gbm9kZS5OO1xuICAgICAgbm9kZS5OID0gbm9kZS5QID0gbnVsbDtcbiAgICAgIHZhciBwYXJlbnQgPSBub2RlLlUsIHNpYmxpbmcsIGxlZnQgPSBub2RlLkwsIHJpZ2h0ID0gbm9kZS5SLCBuZXh0LCByZWQ7XG4gICAgICBpZiAoIWxlZnQpIG5leHQgPSByaWdodDsgZWxzZSBpZiAoIXJpZ2h0KSBuZXh0ID0gbGVmdDsgZWxzZSBuZXh0ID0gZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tGaXJzdChyaWdodCk7XG4gICAgICBpZiAocGFyZW50KSB7XG4gICAgICAgIGlmIChwYXJlbnQuTCA9PT0gbm9kZSkgcGFyZW50LkwgPSBuZXh0OyBlbHNlIHBhcmVudC5SID0gbmV4dDtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHRoaXMuXyA9IG5leHQ7XG4gICAgICB9XG4gICAgICBpZiAobGVmdCAmJiByaWdodCkge1xuICAgICAgICByZWQgPSBuZXh0LkM7XG4gICAgICAgIG5leHQuQyA9IG5vZGUuQztcbiAgICAgICAgbmV4dC5MID0gbGVmdDtcbiAgICAgICAgbGVmdC5VID0gbmV4dDtcbiAgICAgICAgaWYgKG5leHQgIT09IHJpZ2h0KSB7XG4gICAgICAgICAgcGFyZW50ID0gbmV4dC5VO1xuICAgICAgICAgIG5leHQuVSA9IG5vZGUuVTtcbiAgICAgICAgICBub2RlID0gbmV4dC5SO1xuICAgICAgICAgIHBhcmVudC5MID0gbm9kZTtcbiAgICAgICAgICBuZXh0LlIgPSByaWdodDtcbiAgICAgICAgICByaWdodC5VID0gbmV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBuZXh0LlUgPSBwYXJlbnQ7XG4gICAgICAgICAgcGFyZW50ID0gbmV4dDtcbiAgICAgICAgICBub2RlID0gbmV4dC5SO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZWQgPSBub2RlLkM7XG4gICAgICAgIG5vZGUgPSBuZXh0O1xuICAgICAgfVxuICAgICAgaWYgKG5vZGUpIG5vZGUuVSA9IHBhcmVudDtcbiAgICAgIGlmIChyZWQpIHJldHVybjtcbiAgICAgIGlmIChub2RlICYmIG5vZGUuQykge1xuICAgICAgICBub2RlLkMgPSBmYWxzZTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgZG8ge1xuICAgICAgICBpZiAobm9kZSA9PT0gdGhpcy5fKSBicmVhaztcbiAgICAgICAgaWYgKG5vZGUgPT09IHBhcmVudC5MKSB7XG4gICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgIGlmIChzaWJsaW5nLkMpIHtcbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IGZhbHNlO1xuICAgICAgICAgICAgcGFyZW50LkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzaWJsaW5nLkwgJiYgc2libGluZy5MLkMgfHwgc2libGluZy5SICYmIHNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICBpZiAoIXNpYmxpbmcuUiB8fCAhc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgICAgc2libGluZy5MLkMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBzaWJsaW5nKTtcbiAgICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2libGluZy5DID0gcGFyZW50LkM7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHNpYmxpbmcuUi5DID0gZmFsc2U7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIG5vZGUgPSB0aGlzLl87XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgIGlmIChzaWJsaW5nLkMpIHtcbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IGZhbHNlO1xuICAgICAgICAgICAgcGFyZW50LkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc2libGluZy5MICYmIHNpYmxpbmcuTC5DIHx8IHNpYmxpbmcuUiAmJiBzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgaWYgKCFzaWJsaW5nLkwgfHwgIXNpYmxpbmcuTC5DKSB7XG4gICAgICAgICAgICAgIHNpYmxpbmcuUi5DID0gZmFsc2U7XG4gICAgICAgICAgICAgIHNpYmxpbmcuQyA9IHRydWU7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBzaWJsaW5nKTtcbiAgICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2libGluZy5DID0gcGFyZW50LkM7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHNpYmxpbmcuTC5DID0gZmFsc2U7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBub2RlID0gdGhpcy5fO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHNpYmxpbmcu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hbaV1bYl0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGsgPSAoz4QgLSBwYWRkaW5nICogbikgLyBrO1xuICAgICAgeCA9IDAsIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIHgwID0geCwgaiA9IC0xO1xuICAgICAgICB3aGlsZSAoKytqIDwgbikge1xuICAgICAgICAgIHZhciBkaSA9IGdyb3VwSW5kZXhbaV0sIGRqID0gc3ViZ3JvdXBJbmRleFtkaV1bal0sIHYgPSBtYXRyaXhbZGldW2RqXSwgYTAgPSB4LCBhMSA9IHggKz0gdiAqIGs7XG4gICAgICAgICAgc3ViZ3JvdXBzW2RpICsgXCItXCIgKyBkal0gPSB7XG4gICAgICAgICAgICBpbmRleDogZGksXG4gICAgICAgICAgICBzdWJpbmRleDogZGosXG4gICAgICAgICAgICBzdGFydEFuZ2xlOiBhMCxcbiAgICAgICAgICAgIGVuZEFuZ2xlOiBhMSxcbiAgICAgICAgICAgIHZhbHVlOiB2XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBncm91cHNbZGldID0ge1xuICAgICAgICAgIGluZGV4OiBkaSxcbiAgICAgICAgICBzdGFydEFuZ2xlOiB4MCxcbiAgICAgICAgICBlbmRBbmdsZTogeCxcbiAgICAgICAgICB2YWx1ZTogZ3JvdXBTdW1zW2RpXVxuICAgICAgICB9O1xuICAgICAgICB4ICs9IHBhZGRpbmc7XG4gICAgICB9XG4gICAgICBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBqID0gaSAtIDE7XG4gICAgICAgIHdoaWxlICgrK2ogPCBuKSB7XG4gICAgICAgICAgdmFyIHNvdXJjZSA9IHN1Ymdyb3Vwc1tpICsgXCItXCIgKyBqXSwgdGFyZ2V0ID0gc3ViZ3JvdXBzW2ogKyBcIi1cIiArIGldO1xuICAgICAgICAgIGlmIChzb3VyY2UudmFsdWU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RuO1xuICAgICAgICAgICAgbm9kZS5weCAtPSBkeCAqIGs7XG4gICAgICAgICAgICBub2RlLnB5IC09IGR5ICogaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICFxdWFkLmNoYXJnZTtcbiAgICAgIH07XG4gICAgfVxuICAgIGZvcmNlLnRpY2sgPSBmdW5jdGlvbigpIHtcbiAgICAgIGlmICgoYWxwaGEgKj0gLjk5KSA8IC4wMDUpIHtcbiAgICAgICAgdGltZXIgPSBudWxsO1xuICAgICAgICBldmVudC5lbmQoe1xuICAgICAgICAgIHR5cGU6IFwiZW5kXCIsXG4gICAgICAgICAgYWxwaGE6IGFscGhhID0gMFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9XG4gICAgICB2YXIgbiA9IG5vZGVzLmxlbmd0aCwgbSA9IGxpbmtzLmxlbmd0aCwgcSwgaSwgbywgcywgdCwgbCwgaywgeCwgeTtcbiAgICAgIGZvciAoaSA9IDA7IGkgPCBtOyArK2kpIHtcbiAgICAgICAgbyA9IGxpbmtzW2ldO1xuICAgICAgICBzID0gby5zb3VyY2U7XG4gICAgICAgIHQgPSBvLnRhcmdldDtcbiAgICAgICAgeCA9IHQueCAtIHMueDtcbiAgICAgICAgeSA9IHQueSAtIHMueTtcbiAgICAgICAgaWYgKGwgPSB4ICogeCArIHkgKiB5KSB7XG4gICAgICAgICAgbCA9IGFscGhhICogc3RyZW5ndGhzW2ldICogKChsID0gTWF0aC5zcXJ0KGwpKSAtIGRpc3RhbmNlc1tpXSkgLyBsO1xuICAgICAgICAgIHggKj0gbDtcbiAgICAgICAgICB5ICo9IGw7XG4gICAgICAgICAgdC54IC09IHggKiAoayA9IHMud2VpZ2h0ICsgdC53ZWlnaHQgPyBzLndlaWdodCAvIChzLndlaWdodCArIHQud2VpZ2h0KSA6IC41KTtcbiAgICAgICAgICB0LnkgLT0geSAqIGs7XG4gICAgICAgICAgcy54ICs9IHggKiAoayA9IDEgLSBrKTtcbiAgICAgICAgICBzLnkgKz0geSAqIGs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChrID0gYWxwaGEgKiBncmF2aXR5KSB7XG4gICAgICAgIHggPSBzaXplWzBdIC8gMjtcbiAgICAgICAgeSA9IHNpemVbMV0gLyAyO1xuICAgICAgICBpID0gLTE7XG4gICAgICAgIGlmIChrKSB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSBub2Rlc1tpXTtcbiAgICAgICAgICBvLnggKz0gKHggLSBvLngpICogaztcbiAgICAgICAgICBvLnkgKz0gKHkgLSBvLnkpICogaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGNoYXJnZSkge1xuICAgICAgICBkM19sYXlvdXRfZm9yY2VBY2N1bXVsYXRlKHEgPSBkMy5nZW9tLnF1YWR0cmVlKG5vZGVzKSwgYWxwaGEsIGNoYXJnZXMpO1xuICAgICAgICBpID0gLTE7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgaWYgKCEobyA9IG5vZGVzW2ldKS5maXhlZCkge1xuICAgICAgICAgICAgcS52aXNpdChyZXB1bHNlKG8pKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIG8gPSBub2Rlc1tpXTtcbiAgICAgICAgaWYgKG8uZml4ZWQpIHtcbiAgICAgICAgICBvLnggPSBvLnB4O1xuICAgICAgICAgIG8ueSA9IG8ucHk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgby54IC09IChvLnB4IC0gKG8ucHggPSBvLngpKSAqIGZyaWN0aW9uO1xuICAgICAgICAgIG8ueSAtPSAoby5weSAtIChvLnB5ID0gby55KSkgKiBmcmljdGlvbjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZXZlbnQudGljayh7XG4gICAgICAgIHR5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LSBhLnksIGRyID0gYS5yICsgYi5yO1xuICAgIHJldHVybiAuOTk5ICogZHIgKiBkciA+IGR4ICogZHggKyBkeSAqIGR5O1xuICB9XG4gIGZ1bmN0aW9uIGQzX2xheW91dF9wYWNrU2libGluZ3Mobm9kZSkge1xuICAgIGlmICghKG5vZGVzID0gbm9kZS5jaGlsZHJlbikgfHwgIShuID0gbm9kZXMubGVuZ3RoKSkgcmV0dXJuO1xuICAgIHZhciBub2RlcywgeE1pbiA9IEluZmluaXR5LCB4TWF4ID0gLUluZmluaXR5LCB5TWluID0gSW5maW5pdHksIHlNYXggPSAtSW5maW5pdHksIGEsIGIsIGMsIGksIGosIGssIG47XG4gICAgZnVuY3Rpb24gYm91bmQobm9kZSkge1xuICAgICAgeE1pbiA9IE1hdGgubWluKG5vZGUueCAtIG5vZGUuciwgeE1pbik7XG4gICAgICB4TWF4ID0gTWF0aC5tYXgobm9kZS54ICsgbm9kZS5yLCB4TWF4KTtcbiAgICAgIHlNaW4gPSBNYXRoLm1pbihub2RlLnkgLSBub2RlLnIsIHlNaW4pO1xuICAgICAgeU1heCA9IE1hdGgubWF4KG5vZGUueSArIG5vZGUuciwgeU1heCk7XG4gICAgfVxuICAgIG5vZGVzLmZvckVhY2goZDNfbGF5b3V0X3BhY2tMaW5rKTtcbiAgICBhID0gbm9kZXNbMF07XG4gICAgYS54ID0gLWEucjtcbiAgICBhLnkgPSAwO1xuICAgIGJvdW5kKGEpO1xuICAgIGlmIChuID4gMSkge1xuICAgICAgYiA9IG5vZGVzWzFdO1xuICAgICAgYi54ID0gYi5yO1xuICAgICAgYi55ID0gMDtcbiAgICAgIGJvdW5kKGIpO1xuICAgICAgaWYgKG4gPiAyKSB7XG4gICAgICAgIGMgPSBub2Rlc1syXTtcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tQbGFjZShhLCBiLCBjKTtcbiAgICAgICAgYm91bmQoYyk7XG4gICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGEsIGMpO1xuICAgICAgICBhLl9wYWNrX3ByZXYgPSBjO1xuICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChjLCBiKTtcbiAgICAgICAgYiA9IGEuX3BhY2tfbmV4dDtcbiAgICAgICAgZm9yIChpID0gMzsgaSA8IG47IGkrKykge1xuICAgICAgICAgIGQzX2xheW91dF9wYWNrUGxhY2UoYSwgYiwgYyA9IG5vZGVzW2ldKTtcbiAgICAgICAgICB2YXIgaXNlY3QgPSAwLCBzMSA9IDEsIHMyID0gMTtcbiAgICAgICAgICBmb3IgKGogPSBiLl9wYWNrX25leHQ7IGogIT09IGI7IGogPSBqLl9wYWNrX25leHQsIHMxKyspIHtcbiAgICAgICAgICAgIGlmIChkM19sYXlvdXRfcGFja0ludGVyc2VjdHMoaiwgYykpIHtcbiAgICAgICAgICAgICAgaXNlY3QgPSAxO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzZWN0ID09IDEpIHtcbiAgICAgICAgICAgIGZvciAoayA9IGEuX3BhY2tfcHJldjsgayAhPT0gai5fcGFja19wcmV2OyBrID0gay5fcGFja19wcmV2LCBzMisrKSB7XG4gICAgICAgICAgICAgIGlmIChkM19sYXlvdXRfcGFja0ludGVyc2VjdHMoaywgYykpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNlY3QpIHtcbiAgICAgICAgICAgIGlmIChzMSA8IHMyIHx8IHMxID09IHMyICYmIGIuciA8IGEucikgZDNfbGF5b3V0X3BhY2tTcGxpY2UoYSwgYiA9IGopOyBlbHNlIGQzX2xheW91dF9wYWNrU3BsaWNlKGEgPSBrLCBiKTtcbiAgICAgICAgICAgIGktLTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYSwgYyk7XG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gIH1cbiAgICBmdW5jdGlvbiB3cmFwVHJlZShyb290MCkge1xuICAgICAgdmFyIHJvb3QxID0ge1xuICAgICAgICBBOiBudWxsLFxuICAgICAgICBjaGlsZHJlbjogWyByb290MCBdXG4gICAgICB9LCBxdWV1ZSA9IFsgcm9vdDEgXSwgbm9kZTE7XG4gICAgICB3aGlsZSAoKG5vZGUxID0gcXVldWUucG9wKCkpICE9IG51bGwpIHtcbiAgICAgICAgZm9yICh2YXIgY2hpbGRyZW4gPSBub2RlMS5jaGlsZHJlbiwgY2hpbGQsIGkgPSAwLCBuID0gY2hpbGRyZW4ubGVuZ3RoOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgcXVldWUucHVzaCgoY2hpbGRyZW5baV0gPSBjaGlsZCA9IHtcbiAgICAgICAgICAgIF86IGNoaWxkcmVuW2ldLFxuICAgICAgICAgICAgcGFyZW50OiBub2RlMSxcbiAgICAgICAgICAgIGNoaWxkcmVuOiAoY2hpbGQgPSBjaGlsZHJlbltpXS5jaGlsZHJlbikgJiYgY2hpbGQuc2xpY2UoKSB8fCBbXSxcbiAgICAgICAgICAgIEE6IG51bGwsXG4gICAgICAgICAgICBhOiBudWxsLFxuICAgICAgICAgICAgejogMCxcbiAgICAgICAgICAgIG06IDAsXG4gICAgICAgICAgICBjOiAwLFxuICAgICAgICAgICAgczogMCxcbiAgICAgICAgICAgIHQ6IG51bGwsXG4gICAgICAgICAgICBpOiBpXG4gICAgICAgICAgfSkuYSA9IGNoaWxkKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHJvb3QxLmNoaWxkcmVuWzBdO1xuICAgIH1cbiAgICBmdW5jdGlvbiBmaXJzdFdhbGsodikge1xuICAgICAgdmFyIGNoaWxkcmVuID0gdi5jaGlsZHJlbiwgc2libGluZ3MgPSB2LnBhcmVudC5jaGlsZHJlbiwgdyA9IHYuaSA/IHNpYmxpbmdzW3YuaSAtIDFdIDogbnVsbDtcbiAgICAgIGlmIChjaGl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ZUxlZnQodm9tKTtcbiAgICAgICAgICB2b3AgPSBkM19sYXlvdXRfdHJlZVJpZ2h0KHZvcCk7XG4gICAgICAgICAgdm9wLmEgPSB2O1xuICAgICAgICAgIHNoaWZ0ID0gdmltLnogKyBzaW0gLSB2aXAueiAtIHNpcCArIHNlcGFyYXRpb24odmltLl8sIHZpcC5fKTtcbiAgICAgICAgICBpZiAoc2hpZnQgPiAwKSB7XG4gICAgICAgICAgICBkM19sYXlvdXRfdHJlZU1vdmUoZDNfbGF5b3V0X3RyZWVBbmNlc3Rvcih2aW0sIHYsIGFuY2VzdG9yKSwgdiwgc2hpZnQpO1xuICAgICAgICAgICAgc2lwICs9IHNoaWZ0O1xuICAgICAgICAgICAgc29wICs9IHNoaWZ0O1xuICAgICAgICAgIH1cbiAgICAgICAgICBzaW0gKz0gdmltLm07XG4gICAgICAgICAgc2lwICs9IHZpcC5tO1xuICAgICAgICAgIHNvbSArPSB2b20ubTtcbiAgICAgICAgICBzb3AgKz0gdm9wLm07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZpbSAmJiAhZDNfbGF5b3V0X3RyZWVSaWdodCh2b3ApKSB7XG4gICAgICAgICAgdm9wLnQgPSB2aW07XG4gICAgICAgICAgdm9wLm0gKz0gc2ltIC0gc29wO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2aXAgJiYgIWQzX2xheW91dF90cmVlTGVmdCh2b20pKSB7XG4gICAgICAgICAgdm9tLnQgPSB2aXA7XG4gICAgICAgICAgdm9tLm0gKz0gc2lwIC0gc29tO1xuICAgICAgICAgIGFuY2VzdG9yID0gdjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIGFuY2VzdG9yO1xuICAgIH1cbiAgICBmdW5jdGlvbiBzaXplTm9kZShub2RlKSB7XG4gICAgICBub2RlLnggKj0gc2l6ZVswXTtcbiAgICAgIG5vZGUueSA9IG5vZGUuZGVwdGggKiBzaXplWzFdO1xuICAgIH1cbiAgICB0cmVlLnNlc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gPSByZW1haW5pbmcucG9wKCkpIHtcbiAgICAgICAgICByb3cucHVzaChjaGlsZCk7XG4gICAgICAgICAgcm93LmFyZWEgKz0gY2hpbGQuYXJlYTtcbiAgICAgICAgICBpZiAoY2hpbGQueiAhPSBudWxsKSB7XG4gICAgICAgICAgICBwb3NpdGlvbihyb3csIGNoaWxkLnogPyByZWN0LmR4IDogcmVjdC5keSwgcmVjdCwgIXJlbWFpbmluZy5sZW5ndGgpO1xuICAgICAgICAgICAgcm93Lmxlbmd0aCA9IHJvdy5hcmVhID0gMDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY2hpbGRyZW4uZm9yRWFjaChzdGlja2lmeSk7XG4gICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIHdvcnN0KHJvdywgdSkge1xuICAgICAgdmFyIHMgPSByb3cuYXJlYSwgciwgcm1heCA9IDAsIHJtaW4gPSBJbmZpbml0eSwgaSA9IC0xLCBuID0gcm93Lmxlbmd0aDtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGlmICghKHIgPSByb3dbaV0uYXJlYSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAociA8IHJtaW4pIHJtaW4gPSByO1xuICAgICAgICBpZiAociA+IHJtYXgpIHJtYXggPSByO1xuICAgICAgfVxuICAgICAgcyAqPSBzO1xuICAgICAgdSAqPSB1O1xuICAgICAgcmV0dXJuIHMgPyBNYXRoLm1heCh1ICogcm1heCAqIHJhdGlvIC8gcywgcyAvICh1ICogcm1pbiAqIHJhdGlvKSkgOiBJbmZpbml0eTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcG9zaXRpb24ocm93LCB1LCByZWN0LCBmbHVzaCkge1xuICAgICAgdmFyIGkgPSAtMSwgbiA9IHJvdy5sZW5ndGgsIHggPSByZWN0LngsIHkgPSByZWN0LnksIHYgPSB1ID8gcm91bmQocm93LmFyZWEgLyB1KSA6IDAsIG87XG4gICAgICBpZiAodSA9PSByZWN0LmR4KSB7XG4gICAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keSkgdiA9IHJlY3QuZHk7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IHJvd1tpXTtcbiAgICAgICAgICBvLnggPSB4O1xuICAgICAgICAgIG8ueSA9IHk7XG4gICAgICAgICAgby5keSA9IHY7XG4gICAgICAgICAgeCArPSBvLmR4ID0gTWF0aC5taW4ocmVjdC54ICsgcmVjdC5keCAtIHgsIHYgPyByb3VuZChvLmFyZWEgLyB2KSA6IDApO1xuICAgICAgICB9XG4gICAgICAgIG8ueiA9IHRydWU7XG4gICAgICAgIG8uZHggKz0gcmVjdC54ICsgcmVjdC5keCAtIHg7XG4gICAgICAgIHJlY3QueSArPSB2O1xuICAgICAgICByZWN0LmR5IC09IHY7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoZmx1c2ggfHwgdiA+IHJlY3QuZHgpIHYgPSByZWN0LmR4O1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSByb3dbaV07XG4gICAgICAgICAgby54ID0geDtcbiAgICAgICAgICBvLnkgPSB5O1xuICAgICAgICAgIG8uZHggPSB2O1xuICAgICAgICAgIHkgKz0gby5keSA9IE1hdGgubWluKHJlY3QueSArIHJlY3QuZHkgLSB5LCB2ID8gcm91bmQoby5hcmVhIC8gdikgOiAwKTtcbiAgICAgICAgfVxuICAgICAgICBvLnogPSBmYWxzZTtcbiAgICAgICAgby5keSArPSByZWN0LnkgKyByZWN0LmR5IC0geTtcbiAgICAgICAgcmVjdC54ICs9IHY7XG4gICAgICAgIHJlY3QuZHggLT0gdjtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gdHJlZW1hcChkKSB7XG4gICAgICB2YXIgbm9kZXMgPSBzdGlja2llcyB8fCBoaWVyYXJjaHkoZCksIHJvb3QgPSBub2Rlc1swXTtcbiAgICAgIHJvb3QueCA9IHJv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QW5nbGUuYXBwbHkodGhpcywgYXJndW1lbnRzKSB8fCAwKSAvIDIpIHtcbiAgICAgICAgcnAgPSBwYWRSYWRpdXMgPT09IGQzX3N2Z19hcmNBdXRvID8gTWF0aC5zcXJ0KHIwICogcjAgKyByMSAqIHIxKSA6ICtwYWRSYWRpdXMuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgaWYgKCFjdykgcDEgKj0gLTE7XG4gICAgICAgIGlmIChyMSkgcDEgPSBkM19hc2luKHJwIC8gcjEgKiBNYXRoLnNpbihhcCkpO1xuICAgICAgICBpZiAocjApIHAwID0gZDNfYXNpbihycCAvIHIwICogTWF0aC5zaW4oYXApKTtcbiAgICAgIH1cbiAgICAgIGlmIChyMSkge1xuICAgICAgICB4MCA9IHIxICogTWF0aC5jb3MoYTAgKyBwMSk7XG4gICAgICAgIHkwID0gcjEgKiBNYXRoLnNpbihhMCArIHAxKTtcbiAgICAgICAgeDEgPSByMSAqIE1hdGguY29zKGExIC0gcDEpO1xuICAgICAgICB5MSA9IHIxICogTWF0aC5zaW4oYTEgLSBwMSk7XG4gICAgICAgIHZhciBsMSA9IE1hdGguYWJzKGExIC0gYTAgLSAyICogcDEpIDw9IM+AID8gMCA6IDE7XG4gICAgICAgIGlmIChwMSAmJiBkM19zdmdfYXJjU3dlZXAoeDAsIHkwLCB4MSwgeTEpID09PSBjdyBeIGwxKSB7XG4gICAgICAgICAgdmFyIGgxID0gKGEwICsgYTEpIC8gMjtcbiAgICAgICAgICB4MCA9IHIxICogTWF0aC5jb3MoaDEpO1xuICAgICAgICAgIHkwID0gcjEgKiBNYXRoLnNpbihoMSk7XG4gICAgICAgICAgeDEgPSB5MSA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHgwID0geTAgPSAwO1xuICAgICAgfVxuICAgICAgaWYgKHIwKSB7XG4gICAgICAgIHgyID0gcjAgKiBNYXRoLmNvcyhhMSAtIHAwKTtcbiAgICAgIC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C0gMTtcbiAgICB3aGlsZSAoKytpIDwgaikge1xuICAgICAgZCA9IGQzX3N2Z19saW5lU2xvcGUocG9pbnRzW2ldLCBwb2ludHNbaSArIDFdKTtcbiAgICAgIGlmIChhYnMoZCkgPCDOtSkge1xuICAgICAgICBtW2ldID0gbVtpICsgMV0gPSAwO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYSA9IG1baV0gLyBkO1xuICAgICAgICBiID0gbVtpICsgMV0gLyBkO1xuICAgICAgICBzID0gYSAqIGEgKyBiICogYjtcbiAgICAgICAgaWYgKHMgPiA5KSB7XG4gICAgICAgICAgcyA9IGQgKiAzIC8gTWF0aC5zcXJ0KHMpO1xuICAgICAgICAgIG1baV0gPSBzICogYTtcbiAgICAgICAgICBtW2kgKyAxXSA9IHMgKiBiO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGkgPSAtMTtcbiAgICB3aGlsZSAoKytpIDw9IGopIHtcbiAgICAgIHMgPSAocG9pbnRzW01hdGgubWluKGosIGkgKyAxKV1bMF0gLSBwb2ludHNbTWF0aC5tYXgoMCwgaSAtIDEpXVswXSkgLyAoNiAqICgxICsgbVtpXSAqIG1baV0pKTtcbiAgICAgIHRhbmdlbnRzLnB1c2goWyBzIHx8IDAsIG1baV0gKiBzIHx8IDAgXSk7XG4gICAgfVxuICAgIHJldHVybiB0YW5nZW50cztcbiAgfVxuICBmdW5jdGlvbiBkM19zdmdfbGluZU1vbm90b25lKHBvaW50cykge1xuICAgIHJldHVybiBwb2ludHMubGVuZ3RoIDwgMyA/IGQzX3N2Z19saW5lTGluZWFyKHBvaW50cykgOiBwb2ludHNbMF0gKyBkM19zdmdfbGluZUhlcm1pdGUocG9pbnRzLCBkM19zdmdfbGluZU1vbm90b25lVGFuZ2VudHMocG9pbnRzKSk7XG4gIH1cbiAgZDMuc3ZnLmxpbmUucmFkaWFsID0gZnVuY3Rpb24oKSB7XG4gICAgdmFyIGxpbmUgPSBkM19zdmdfbGluZShkM19zd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uZWFjaChcInN0YXJ0LmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IGV4dGVudDAuaTtcbiAgICAgICAgICAgIHlFeHRlbnREb21haW4gPSBleHRlbnQwLmo7XG4gICAgICAgICAgICB4RXh0ZW50ID0gZXh0ZW50MC54O1xuICAgICAgICAgICAgeUV4dGVudCA9IGV4dGVudDAueTtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hzdGFydFwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KS50d2VlbihcImJydXNoOmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIHhpID0gZDNfaW50ZXJwb2xhdGVBcnJheSh4RXh0ZW50LCBleHRlbnQxLngpLCB5aSA9IGQzX2ludGVycG9sYXRlQXJyYXkoeUV4dGVudCwgZXh0ZW50MS55KTtcbiAgICAgICAgICAgIHhFeHRlbnREb21haW4gPSB5RXh0ZW50RG9tYWluID0gbnVsbDtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbih0KSB7XG4gICAgICAgICAgICAgIHhFeHRlbnQgPSBleHRlbnQxLnggPSB4aSh0KTtcbiAgICAgICAgICAgICAgeUV4dGVudCA9IGV4dGVudDEueSA9IHlpKHQpO1xuICAgICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hcIixcbiAgICAgICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KS5lYWNoKFwiZW5kLmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IGV4dGVudDEuaTtcbiAgICAgICAgICAgIHlFeHRlbnREb21haW4gPSBleHRlbnQxLmo7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICAgIG1vZGU6IFwicmVzaXplXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaGVuZFwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaHN0YXJ0XCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgIH0pO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoZW5kXCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfTtcbiAgICBmdW5jdGlvbiByZWRyYXcoZykge1xuICAgICAgZy5zZWxlY3RBbGwoXCIucmVzaXplXCIpLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gXCJ0cmFuc2xhdGUoXCIgKyB4RXh0ZW50WysvZSQvLnRlc3QoZCldICsgXCIsXCIgKyB5RXh0ZW50WysvXnMvLnRlc3QoZCldICsgXCIpXCI7XG4gICAgICB9KTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmVkcmF3WChnKSB7XG4gICAgICBnLnNlbGVjdChcIi5leHRlbnRcIikuYXR0cihcInhcIiwgeEV4dGVudFswXSk7XG4gICAgICBnLnNlbGVjdEFsbChcIi5leHRlbnQsLm4+cmVjdCwucz5yZWN0XCIpLmF0dHIoXCJ3aWR0aFwiLCB4RXh0ZW50WzFdIC0geEV4dGVudFswXSk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlZHJhd1koZykge1xuICA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SA9PSAzMikge1xuICAgICAgICAgIGlmICghZHJhZ2dpbmcpIHtcbiAgICAgICAgICAgIGNlbnRlciA9IG51bGw7XG4gICAgICAgICAgICBvcmlnaW5bMF0gLT0geEV4dGVudFsxXTtcbiAgICAgICAgICAgIG9yaWdpblsxXSAtPSB5RXh0ZW50WzFdO1xuICAgICAgICAgICAgZHJhZ2dpbmcgPSAyO1xuICAgICAgICAgIH1cbiAgICAgICAgICBkM19ldmVudFByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGtleXVwKCkge1xuICAgICAgICBpZiAoZDMuZXZlbnQua2V5Q29kZSA9PSAzMiAmJiBkcmFnZ2luZyA9PSAyKSB7XG4gICAgICAgICAgb3JpZ2luWzBdICs9IHhFeHRlbnRbMV07XG4gICAgICAgICAgb3JpZ2luWzFdICs9IHlFeHRlbnRbMV07XG4gICAgICAgICAgZHJhZ2dpbmcgPSAwO1xuICAgICAgICAgIGQzX2V2ZW50UHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gYnJ1c2htb3ZlKCkge1xuICAgICAgICB2YXIgcG9pbnQgPSBkMy5tb3VzZSh0YXJnZXQpLCBtb3ZlZCA9IGZhbHNlO1xuICAgICAgICBpZiAob2Zmc2V0KSB7XG4gICAgICAgICAgcG9pbnRbMF0gKz0gb2Zmc2V0WzBdO1xuICAgICAgICAgIHBvaW50WzFdICs9IG9mZnNldFsxXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWRyYWdnaW5nKSB7XG4gICAgICAgICAgaWYgKGQzLmV2ZW50LmFsdEtleSkge1xuICAgICAgICAgICAgaWYgKCFjZW50ZXIpIGNlbnRlciA9IFsgKHhFeHRlbnRbMF0gKyB4RXh0ZW50WzFdKSAvIDIsICh5RXh0ZW50WzBdICsgeUV4dGVudFsxXSkgLyAyIF07XG4gICAgICAgICAgICBvcmlnaW5bMF0g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AgICAgICBtaW4gPSAoaSA/IHlDbGFtcCA6IHhDbGFtcCkgPyBNYXRoLm1heChyMCwgTWF0aC5taW4ocjEsIHBvaW50W2ldKSkgOiBwb2ludFtpXTtcbiAgICAgICAgaWYgKGRyYWdnaW5nKSB7XG4gICAgICAgICAgbWF4ID0gKG1pbiArPSBwb3NpdGlvbikgKyBzaXplO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChjZW50ZXIpIHBvc2l0aW9uID0gTWF0aC5tYXgocjAsIE1hdGgubWluKHIxLCAyICogY2VudGVyW2ldIC0gbWluKSk7XG4gICAgICAgICAgaWYgKHBvc2l0aW9uIDwgbWluKSB7XG4gICAgICAgICAgICBtYXggPSBtaW47XG4gICAgICAgICAgICBtaW4gPSBwb3NpdGlvbjtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbWF4ID0gcG9zaXRpb247XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChleHRlbnRbMF0gIT0gbWluIHx8IGV4dGVudFsxXSAhPSBtYXgpIHtcbiAgICAgICAgICBpZiAoaSkgeUV4dGVudERvbWFpbiA9IG51bGw7IGVsc2UgeEV4dGVudERvbWFpbiA9IG51bGw7XG4gICAgICAgICAgZXh0ZW50WzBdID0gbWluO1xuICAgICAgICAgIGV4dGVudFsxXSA9IG1heDtcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gYnJ1c2hlbmQoKSB7XG4gICAgICAgIGJydXNobW92ZSgpO1xuICAgICAgICBnLnN0eWxlKFwicG9pbnRlci1ldmVudHNcIiwgXCJhbGxcIikuc2VsZWN0QWxsKFwiLnJlc2l6ZVwiKS5zdHlsZShcImRpc3BsYXlcIiwgYnJ1c2guZW1wdHkoKSA/IFwibm9uZVwiIDogbnVsbCk7XG4gICAgICAgIGQzLnNlbGVjdChcImJvZHlcIikuc3R5bGUoXCJjdXJzb3Jc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BlbHNlIGlmICh5KSB5Q2xhbXAgPSAhIXo7XG4gICAgICByZXR1cm4gYnJ1c2g7XG4gICAgfTtcbiAgICBicnVzaC5leHRlbnQgPSBmdW5jdGlvbih6KSB7XG4gICAgICB2YXIgeDAsIHgxLCB5MCwgeTEsIHQ7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgaWYgKHgpIHtcbiAgICAgICAgICBpZiAoeEV4dGVudERvbWFpbikge1xuICAgICAgICAgICAgeDAgPSB4RXh0ZW50RG9tYWluWzBdLCB4MSA9IHhFeHRlbnREb21haW5bMV07XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHgwID0geEV4dGVudFswXSwgeDEgPSB4RXh0ZW50WzFdO1xuICAgICAgICAgICAgaWYgKHguaW52ZXJ0KSB4MCA9IHguaW52ZXJ0KHgwKSwgeDEgPSB4LmludmVydCh4MSk7XG4gICAgICAgICAgICBpZiAoeDEgPCB4MCkgdCA9IHgwLCB4MCA9IHgxLCB4MSA9IHQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh5KSB7XG4gICAgICAgICAgaWYgKHlFeHRlbnREb21haW4pIHtcbiAgICAgICAgICAgIHkwID0geUV4dGVudERvbWFpblswXSwgeTEgPSB5RXh0ZW50RG9tYWluWzFdO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB5MCA9IHlFeHRlbnRbMF0sIHkxID0geUV4dGVudFsxXTtcbiAgICAgICAgICAgIGlmICh5LmludmVydCkgeTAgPSB5LmludmVydCh5MCksIHkxID0geS5pbnZlcnQoeTEpO1xuICAgICAgICAgICAgaWYgKHkxIDwgeTApIHQgPSB5MCwgeTAgPSB5MSwgeTEgPSB0O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geCAmJiB5ID8gWyBbIHgwLCB5MCBdLCBbIHgxLCB5MSBdIF0gOiB4ID8gWyB4MCwgeDEgX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PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57eyBidXllcl9lbWFpbCB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgYnV5ZXJfcGhvbmUgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7Y3VycmVuY3l9fXt7IGFtb3VudCB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgb3JkZXJfZGF0ZSB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgaWQgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPlxuICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPlxuICAgICAgICAgICAgICAgICAge3sjaWYgYW1vdW50ID09PSAwfX1cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4+RnJlZSBvcmRlcjwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgIHt7ZWxzZX19XG4gICAgICAgICAgICAgICAgICAgIDxzcGFuPlBhaWQgb3JkZXI8L3NwYW4+XG4gICAgICAgICAgICAgICAgICB7ey9pZn19XG4gICAgICAgICAgICAgICAgPC9wPlxuICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+PGEgY2xhc3M9XCJib3hvZmZpY2UtYnV0dG9uIGJveG9mZmljZS1idXR0b24taW5mb1wiIGhyZWY9XCJqYXZhc2NyaXB0OnZvaWQoMClcIiBvbi1jbGljaz1cInNob3dPcmRlclwiPkxpbmUgSXRlbXM8L2E+PC9wPjwvdGQ+XG4gICAgICAgICAgIC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lbXM6bGluZV9pdGVtfX1cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRpY2tldCBjb2wtc20tNiBjb2wteHMtMTJcIiBpZD1cIml0ZW0te3sgQGluZGV4IH19XCI+XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImhlYWRpbmdcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0aWNrZXQtdHlwZVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD57eyB0aXRsZSB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250ZW50XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGVudC1ib3hcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5pZDo8L3NwYW4+IHt7IGlkIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPkJhc2UgYW1vdW50Ojwvc3Bhbj4ge3sgY3VycmVuY3kgfX17eyBiYXNlX2Ftb3VudCB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5EaXNjb3VudGVkIGFtb3VudDo8L3NwYW4+IHt7IGN1cnJlbmN5IH19e3sgZGlzY291bnRlZF9hbW91bnQgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+RmluYWwgYW1vdW50Ojwvc3Bhbj4ge3sgY3VycmVuY3kgfX17eyBmaW5hbF9hbW91bnQgfX08L3A+XG4gICAgIC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pbHM6a2V5IH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPnt7IGtleSB9fTo8L3NwYW4+IHt7IC4gfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3tlbHNlfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48Yj5Ob3QgYXNzaWduZWQ8L2I+PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgICB7eyNjYW5jZWxfdGlja2V0X3VybCAmJiAhY2FuY2VsbGVkX2F0fX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJib3hvZmZpY2UtYnV0dG9uIGJveG9mZmljZS1idXR0b24tc21hbGwgYm94b2ZmaWNlLWJ1dHRvbi1pbmZvXCIgaHJlZj1cImphdmFzY3JpcHQ6dm9pZCgwKVwiIG9uLWNsaWNrPVwiY2FuY2VsVGlja2V0XCIge3sjY2FuY2VsbGluZ319ZGlzYWJsZWR7ey99fT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FuY2VsIHt7I2NhbmNlbGxpbmd9fTxpIGNsYXNzPVwiZmEgZmEtc3Bpbm5lciBmYS1zcGluXCI+PC9pPnt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHAgY2xhc3M9XCJlcnJvci1tc2cgbGVmdC1hbGlnbmVkXCI+e3tjYW5jZWxfZXJyb3J9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgIHt7L319XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAge3svc2hvd19vcmRlcn19XG4gICAgICAgICAge3svb3JkZXJzfX1cbiAgICAgICAgICA8L3Rib2R5PlxuICAgICAgICAgIDx0Zm9vdD5cbiAgICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgICAgPHRkIGNvbHNwYW49XCIxMFwiPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYWdpbmF0aW9uIHBhZ2luYXRpb24tY2VudGVyZWRcIj48L2Rpdj5cbiAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgIDwvdHI+XG4gICAgICAgICAgPC90Zm9vdD5cbiAgICAgICAgPC90YWJsZT5cbiAgICAgIDwvZGl2PlxuICAgIHt7ZWxzZX19XG4gICAgICA8cCBjbGFzcz1cInRleHQtY2VudGVyXCI+Q3VycmVudGx5IG5vIG9yZGVycy48L3A+XG4gICAge3svaWZ9fVxuICA8L2Rpdj5cbmBcbiIsImV4cG9ydCBjb25zdCBJbmRleFRlbXBsYXRlID0gYFxuICA8ZGl2IGNsYXNzPVwiY29udGFpbmVyXCI+XG4gICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgPGgxIGNsYXNzPVwiaGVhZGVyXCI+T3JnYW5pemF0aW9uczwvaDE+XG4gICAgICB7eyNvcmdzOm9yZ319XG4gICAgICAgIDxkaXYgY2xhc3M9XCJib3ggY29sLXNtLTYgY29sLXhzLTEyXCIgaWQ9XCJvcmcte3sgQGluZGV4IH19XCI+XG4gICAgICAgICAgPGRpdiBjbGFzcz1cImhlYWRpbmdcIj5cbiAgICAgICAgICAgIHt7I3RpdGxlfX1cbiAgICAgICAgICAgICAgPHAgY2xhc3M9XCJoZWFkaW5nLXRpdGxlXCI+e3sgdGl0bGUgfX08L3A+XG4gICAgICAgICAgICB7ey90aXRsZX19XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgPGRpdiBjbGFzcz1cImNvbnRlbnRcIj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250ZW50LWJveCBjbGVhcmZpeFwiIGludHJvPSdmbHk6e1wieFwiOjIwLFwieVwiOlwiMFwifSc+XG4gICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJvcmctbG9nb1wiPjxpbWcgc3JjPVwie3tkZXRhaWxzWydsb2dvJ119fVwiLz48L2Rpdj5cbiAgICAgICAgICAgICAgPHAgY2xhc3M9XCJzZWN0aW9uLXRpdGxlXCI+T3JnYW5pemF0aW9uIGlkPC9wPlxuICAgICAgICAgICAgICA8cCBjbGFzcz1cInNlY3Rpb24tY29udGVudFwiPnt7aWR9fTwvcD5cbiAgICAgICAgICAgICAge3sjZGV0YWlsczprLHZ9fVxuICAgICAgICAgICAgICAgIHt7I2lmIGsgIT09ICdsb2dvJ319XG4gICAgICAgICAgICAgICAgICA8cCBjbGFzcz1cInNlY3Rpb24tdGl0bGVcIj57e2t9fTwvcD5cbiAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJzZWN0aW9uLWNvbnRlbnRcIj57e3tkZXRhaWxzW2tdfX19PC9kaXY+XG4gICAgICAgICAgICAgICAge3svaWZ9fVxuICAgICAgICAgICAgICB7ey9kZXRhaWxzfX1cbiAgICAgICAgICAgICAgPHAgY2xhc3M9XCJzZWN0aW9uLXRpdGxlXCI+Q29udGFjdCBlbWFpbDwvcD5cbiAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNlY3Rpb24tY29udGVudFwiPnt7Y29udGFjdF9lbWFpbH19PC9kaXY+XG4gICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJidG4td3JhcHBlclwiPlxuICAgICAgICAgICAgICAgIDxhIGNsYXNzPVwiYm94b2ZmaWNlLWJ1dHRvbiBib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3JhcGhfaGVhZGVyc1xuICAgICAgICBdLFxuICAgICAgICBheGVzOiB7XG4gICAgICAgICAgc2FsZXM6ICd5MidcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGJhcjoge1xuICAgICAgICB3aWR0aDoge1xuICAgICAgICAgIHJhdGlvOiAwLjUgLy8gdGhpcyBtYWtlcyBiYXIgd2lkdGggNTAlIG9mIGxlbmd0aCBiZXR3ZWVuIHRpY2tzXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBheGlzOiB7XG4gICAgICAgIHg6IHtcbiAgICAgICAgICB0eXBlOiAndGltZXNlcmllcycsXG4gICAgICAgICAgdGljazoge1xuICAgICAgICAgICAgZm9ybWF0OiAnJWQtJW0nXG4gICAgICAgICAgfSxcbiAgICAgICAgICBsYWJlbDogJ0RhdGUnXG4gICAgICAgIH0sXG4gICAgICAgIHk6IHtcbiAgICAgICAgICBsYWJlbDogJ05vLiBvZiB0aWNrZXRzJ1xuICAgICAgICB9LFxuICAgICAgICB5Mjoge1xuICAgICAgICAgIHNob3c6IHRydWUsXG4gICAgICAgICAgbGFiZWw6ICdTYWxlcydcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgdGhpcy5wYXJlbnQub24oJ2RhdGFfdXBkYXRlJywgKCkgPT4ge1xuICAgICAgdGhpcy5jaGFydC5sb2FkKHtcbiAgICAgICAgY29sdW1uczogdGhpcy5mb3JtYXRfY29sdW1ucygpXG4gICAgICB9KTtcbiAgICB9KTtcblxuICB9XG59KVxuXG5leHBvcnQgY29uc3QgSXRlbUNvbGxlY3Rpb25WaWV3ID0ge1xuICByZW5kZXI6IGZ1bmN0aW9uKGNvbmZpZykge1xuXG4gICAgSXRlbUNvbGxlY3Rpb25Nb2RlbC5mZXRjaCh7XG4gICAgICB1cmw6IEl0ZW1Db2xsZWN0aW9uTW9kZWwudXJsRm9yKCdpbmRleCcsIHtpY19pZDogY29uZmlnLmlkfSlbJ3BhdGgnXVxuICAgI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UsXG4gICAgICAgICdzaWRlYmFyTW9iaWxlT24nOiBmYWxzZVxuICAgICAgfSk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgdGhpcy5pbml0KHZpZXcsIGljX2NvbmZpZyk7XG4gICAgfVxuICB9LFxuICBoaWRlOiBmdW5jdGlvbigpIHtcbiAgICBpZiAodGhpcy5vbikge1xuICAgICAgdGhpcy5yYWN0aXZlLnNldCgnc2lkZWJhckhpZGUnLCB0cnVlKTtcbiAgICB9XG4gIH1cbn07XG4iXX0= +},{"../models/sidebar.js":7,"../templates/sidebar.html.js":19}]},{},[1]) +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCIvVXNlcnMvdmlkeWEvRG9jdW1lbnRzL0hhc0dlZWsvYm94b2ZmaWNlL2JveG9mZmljZS9zdGF0aWMvanMvdmlld3MvbWFpbi5qcyIsIi9Vc2Vycy92aWR5YS9Eb2N1bWVudHMvSGFzR2Vlay9ib3hvZmZpY2UvYm94b2ZmaWNlL3N0YXRpYy9qcy9tb2RlbHMvYWRtaW5fb3JkZXIuanMiLCIvVXNlcnMvdmlkeWEvRG9jdW1lbnRzL0hhc0dlZWsvYm94b2ZmaWNlL2JveG9mZmljZS9zdGF0aWMvanMvbW9kZWxzL2FkbWluX3JlcG9ydC5qcyIsIi9Vc2Vycy92aWR5YS9Eb2N1bWVudHMvSGFzR2Vlay9ib3hvZmZpY2UvYm94b2ZmaWNlL3N0YXRpYy9qcy9tb2RlbHMvaW5kZXguanMiLCIvVXNlcnMvdmlkeWEvRG9jdW1lbnRzL0hhc0dlZWsvYm94b2ZmaWNlL2JveG9mZmljZS9zdGF0aWMvanMvbW9kZWxzL2l0ZW1fY29sbGVjdGlvbi5qcyIsIi9Vc2Vycy92aWR5YS9Eb2N1bWVudHMvSGFzR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BBUEkob3duZXIpIHtcbiAgICAgICAgdGhpcy5vd25lciA9IG93bmVyO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGluaGVyaXQoYmFzZSwgZGVyaXZlZCkge1xuXG4gICAgICAgIGlmIChPYmplY3QuY3JlYXRlKSB7XG4gICAgICAgICAgICBkZXJpdmVkLnByb3RvdHlwZSA9IE9iamVjdC5jcmVhdGUoYmFzZS5wcm90b3R5cGUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIGYgPSBmdW5jdGlvbiBmKCkge307XG4gICAgICAgICAgICBmLnByb3RvdHlwZSA9IGJhc2UucHJvdG90eXBlO1xuICAgICAgICAgICAgZGVyaXZlZC5wcm90b3R5cGUgPSBuZXcgZigpO1xuICAgICAgICB9XG5cbiAgICAgICAgZGVyaXZlZC5wcm90b3R5cGUuY29uc3RydWN0b3IgPSBkZXJpdmVkO1xuXG4gICAgICAgIHJldHVybiBkZXJpdmVkO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIENoYXJ0KGNvbmZpZykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsID0gbmV3IENoYXJ0SW50ZXJuYWwodGhpcyk7XG4gICAgICAgICQkLmxvYWRDb25maWcoY29uZmlnKTtcblxuICAgICAgICAkJC5iZWZvcmVJbml0KGNvbmZpZyk7XG4gICAgICAgICQkLmluaXQoKTtcbiAgICAgICAgJCQuYWZ0ZXJJbml0KGNvbmZpZyk7XG5cbiAgICAgICAgLy8gYmluZCBcInRoaXNcIiB0byBuZXN0ZWQgQVBJXG4gICAgICAgIChmdW5jdGlvbiBiaW5kVGhpcyhmbiwgdGFyZ2V0LCBhcmdUaGlzKSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhmbikuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0W2tleV0gPSBmbltrZXldLmJpbmQoYXJnVGhpcyk7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzKGZuW2tleV0pLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgYmluZFRoaXMoZm5ba2V5XSwgdGFyZ2V0W2tleV0sIGFyZ1RoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KShjM19jaGFydF9mbiwgdGhpcywgdGhpcyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gQ2hhcnRJbnRlcm5hbChhcGkpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgJCQuZDMgPSB3aW5kb3cuZDMgPyB3aW5kb3cuZDMgOiB0eXBlb2YgcmVxdWlyZSAhPT0gJ3VuZGVmaW5lZCcgPyByZXF1aXJlKFwiZDNcIikgOiB1bmRlZmluZWQ7XG4gICAgICAgICQkLmFwaSA9IGFwaTtcbiAgICAgICAgJCQuY29uZmlnID0gJCQuZ2V0RGVmYXVsdENvbmZpZygpO1xuICAgICAgICAkJC5kYXRhID0ge307XG4gICAgICAgICQkLmNhY2hlID0ge307XG4gICAgICAgICQkLmF4ZXMgPSB7fTtcbiAgICB9XG5cbiAgICBjMy5nZW5lcmF0ZSA9IGZ1bmN0aW9uIChjb25maWcpIHtcbiAgICAgICAgcmV0dXJuIG5ldyBDaGFydChjb25maWcpO1xuICAgIH07XG5cbiAgICBjMy5jaGFydCA9IHtcbiAgICAgICAgZm46IENoYXJ0LnByb3RvdHlwZSxcbiAgICAgICAgaW50ZXJuYWw6IHtcbiAgICAgICAgICAgIGZuOiBDaGFydEludGVybmFsLnByb3RvdHlwZSxcbiAgICAgICAgICAgIGF4aXM6IHtcbiAgICAgICAgICAgICAgICBmbjogQXhpcy5wcm90b3R5cGVcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfZm4gPSBjMy5jaGFydC5mbjtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbiA9IGMzLmNoYXJ0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XJ0IHJlY3QgdG8gZm9yZWZyb250XG4gICAgICAgIC8vIFRPRE86IGlzIHRoaXMgbmVlZGVkP1xuICAgICAgICBtYWluLmluc2VydCgncmVjdCcsIGNvbmZpZy56b29tX3ByaXZpbGVnZWQgPyBudWxsIDogJ2cuJyArIENMQVNTLnJlZ2lvbnMpXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCBDTEFTUy56b29tUmVjdClcbiAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsICQkLndpZHRoKVxuICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsICQkLmhlaWdodClcbiAgICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDApXG4gICAgICAgICAgICAub24oXCJkYmxjbGljay56b29tXCIsIG51bGwpO1xuXG4gICAgICAgIC8vIFNldCBkZWZhdWx0IGV4dGVudCBpZiBkZWZpbmVkXG4gICAgICAgIGlmIChjb25maWcuYXhpc194X2V4dGVudCkgeyAkJC5icnVzaC5leHRlbnQoJCQuZ2V0RGVmYXVsdEV4dGVudCgpKTsgfVxuXG4gICAgICAgIC8vIEFkZCBBeGlzXG4gICAgICAgICQkLmF4aXMuaW5pdCgpO1xuXG4gICAgICAgIC8vIFNldCB0YXJnZXRzXG4gICAgICAgICQkLnVwZGF0ZVRhcmdldHMoJCQuZGF0YS50YXJnZXRzKTtcblxuICAgICAgICAvLyBEcmF3IHdpdGggdGFyZ2V0c1xuICAgICAgICBpZiAoYmluZGluZykge1xuICAgICAgICAgICAgJCQudXBkYXRlRGltZW5zaW9uKCk7XG4gICAgICAgICAgICAkJC5jb25maWcub25pbml0LmNhbGwoJCQpO1xuICAgICAgICAgICAgJCQucmVkcmF3KHtcbiAgICAgICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogZmFsc2UsXG4gICAgICAgICAgICAgICAgd2l0aFRyYW5zZm9ybTogdHJ1ZSxcbiAgICAgICAgICAgICAgICB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgICAgICB3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgICAgICB3aXRoVHJhbnNpdGlvbkZvckF4aXM6IGZhbHNlXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEJpbmQgcmVzaXplIGV2ZW50XG4gICAgICAgICQkLmJpbmRSZXNpemUoKTtcblxuICAgICAgICAvLyBleHBvcnQgZWxlbWVudCBvZiB0aGUgY2hhcnRcbiAgICAgICAgJCQuYXBpLmVsZW1lbnQgPSAkJC5zZWxlY3RDaGFydC5ub2RlKCk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnNtb290aExpbmVzID0gZnVuY3Rpb24gKGVsLCB0eXBlKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXM7XG4gICAgICAgIGlmICh0eXBlID09PSAnZ3JpZCcpIHtcbiAgICAgICAgICAgIGVsLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBnID0gJCQuZDMuc2VsZWN0KHRoaXMpLFxuICAgICAgICAgICAgICAgICAgICB4MSA9IGcuYXR0cigneDEnKSxcbiAgICAgICAgICAgICAgICAgICAgeDIgPSBnLmF0dHIoJ3gyJyksXG4gICAgICAgICAgICAgICAgICAgIHkxID0gZy5hdHRyKCd5MScpLFxuICAgICAgICAgICAgICAgICAgICB5MiA9IGcuYXR0cigneTInKTtcbiAgICAgICAgICAgICAgICBnLmF0dHIoe1xuICAgICAgICAgICAgICAgICAgICAneDEnOiBNYXRoLmNlaWwoeDEpLFxuICAgICAgICAgICAgICAgICAgICAneDInOiBNYXRoLmNlaWwoeDIpLFxuICAgICAgICAgICAgICAgICAgICAneTEnOiBNYXRoLmNlaWwoeTEpLFxuICAgICAgICAgICAgICAgICAgICAneTInOiBNYXRoLmNlaWwoeTIpXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAg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gICAgICAgeERvbWFpbkZvclpvb20gPSAkJC54Lm9yZ0RvbWFpbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgJCQueS5kb21haW4oJCQuZ2V0WURvbWFpbih0YXJnZXRzVG9TaG93LCAneScsIHhEb21haW5Gb3Jab29tKSk7XG4gICAgICAgICQkLnkyLmRvbWFpbigkJC5nZXRZRG9tYWluKHRhcmdldHNUb1Nob3csICd5MicsIHhEb21haW5Gb3Jab29tKSk7XG5cbiAgICAgICAgaWYgKCFjb25maWcuYXhpc195X3RpY2tfdmFsdWVzICYmIGNvbmZpZy5heGlzX3lfdGlja19jb3VudCkge1xuICAgICAgICAgICAgJCQueUF4aXMudGlja1ZhbHVlcygkJC5heGlzLmdlbmVyYXRlVGlja1ZhbHVlcygkJC55LmRvbWFpbigpLCBjb25maWcuYXhpc195X3RpY2tfY291bnQpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWNvbmZpZy5heGlzX3kyX3RpY2tfdmFsdWVzICYmIGNvbmZpZy5heGlzX3kyX3RpY2tfY291bnQpIHtcbiAgICAgICAgICAgICQkLnkyQXhpcy50aWNrVmFsdWVzKCQkLmF4aXMuZ2VuZXJhdGVUaWNrVmFsdWVzKCQkLnkyLmRvbWFpbigpLCBjb25maWcuYXhpc195Ml90aWNrX2NvdW50KSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBheGVzXG4gICAgICAgICQkLmF4aXMucmVkcmF3KHRyYW5zaXRpb25zLCBoaWRlQXhpcyk7XG5cbiAgICAgICAgLy8gVXBkYXRlIGF4aXMgbGFiZWxcbiAgICAgICAgJCQuYXhpcy51cGRhdGVMYWJlbHMod2l0aFRyYW5zaXRpb24pO1xuXG4gICAgICAgIC8vIHNob3cvaGlkZSBpZiBtYW51YWwgY3VsbGluZyBuZWVkZWRcbiAgICAgICAgaWYgKCh3aXRoVXBkYXRlWERvbWFpbiB8fCB3aXRoVXBkYXRlWEF4aXMpICYmIHRhcmdldHNUb1Nob3cubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoY29uZmlnLmF4aXNfeF90aWNrX2N1bGxpbmcgJiYgdGlja1ZhbHVlcykge1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPCB0aWNrVmFsdWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aWNrVmFsdWVzLmxlbmd0aCAvIGkgPCBjb25maWcuYXhpc194X3RpY2tfY3VsbGluZ19tYXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGludGVydmFsRm9yQ3VsbGluZyA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLmF4aXNYICsgJyAudGljayB0ZXh0JykuZWFjaChmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSB0aWNrVmFsdWVzLmluZGV4T2YoZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuc3R5bGUoJ2Rpc3BsYXknLCBpbmRleCAlIGludGVydmFsRm9yQ3VsbGluZyA/ICdub25lJyA6ICdibG9jaycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuYXhpc1ggKyAnIC50aWNrIHRleHQnKS5zdHlsZSgnZGlzcGxheScsICdibG9jaycpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gc2V0dXAgZHJhd2VyIC0gTUVNTzogdGhlc2UgbXVzdCBiZSBjYWxsZWQgYWZ0ZXIgYXh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ogJCQuY2lyY2xlWCkuYmluZCgkJCk7XG4gICAgICAgIGN5ID0gKCQkLmNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC5jaXJjbGVYIDogJCQuY2lyY2xlWSkuYmluZCgkJCk7XG5cbiAgICAgICAgaWYgKG9wdGlvbnMuZmxvdykge1xuICAgICAgICAgICAgZmxvdyA9ICQkLmdlbmVyYXRlRmxvdyh7XG4gICAgICAgICAgICAgICAgdGFyZ2V0czogdGFyZ2V0c1RvU2hvdyxcbiAgICAgICAgICAgICAgICBmbG93OiBvcHRpb25zLmZsb3csXG4gICAgICAgICAgICAgICAgZHVyYXRpb246IG9wdGlvbnMuZmxvdy5kdXJhdGlvbixcbiAgICAgICAgICAgICAgICBkcmF3QmFyOiBkcmF3QmFyLFxuICAgICAgICAgICAgICAgIGRyYXdMaW5lOiBkcmF3TGluZSxcbiAgICAgICAgICAgICAgICBkcmF3QXJlYTogZHJhd0FyZWEsXG4gICAgICAgICAgICAgICAgY3g6IGN4LFxuICAgICAgICAgICAgICAgIGN5OiBjeSxcbiAgICAgICAgICAgICAgICB4djogeHYsXG4gICAgICAgICAgICAgICAgeEZvclRleHQ6IHhGb3JUZXh0LFxuICAgICAgICAgICAgICAgIHlGb3JUZXh0OiB5Rm9yVGV4dFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoKGR1cmF0aW9uIHx8IGZsb3cpICYmICQkLmlzVGFiVmlzaWJsZSgpKSB7IC8vIE9ubHkgdXNlIHRyYW5zaXRpb24gaWYgdGFiIHZpc2libGUuIFNlZSAjOTM4LlxuICAgICAgICAgICAgLy8gdHJhbnNpdGlvbiBzaG91bGQgYmUgZGVyaXZlZCBmcm9tIG9uZSB0cmFuc2l0aW9uXG4gICAgICAgICAgICBkMy50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciB0cmFuc2l0aW9uc1RvV2FpdCA9IFtdO1xuXG4gICAgICAgICAgICAgICAgLy8gcmVkcmF3IGFuZCBnYXRoZXIgdHJhbnNpdGlvbnNcbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0JhcihkcmF3QmFyLCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3TGluZShkcmF3TGluZSwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0FyZWEoZHJhd0FyZWEsIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdDaXJjbGUoY3gsIGN5LCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3VGV4dCh4Rm9yVGV4dCwgeUZvclRleHQsIG9wdGlvbnMuZmxvdywgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd1JlZ2lvbih0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3R3JpZCh0cnVlKSxcbiAgICAgICAgICAgICAgICBdLmZvckVhY2goZnVuY3Rpb24gKHRyYW5zaXRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25zLmZvckVhY2goZnVuY3Rpb24gKHRyYW5zaXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25zVG9XYWl0LnB1c2godHJhbnNpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgLy8gV2FpdCBmb3IgZW5kIG9mIHRyYW5zaXRpb25zIHRvIGNhbGwgZmxvdyBhbmQgb25yZW5kZXJlZCBjYWxsYmFja1xuICAgICAgICAgICAgICAgIHdhaXRGb3JEcmF3ID0gJCQuZ2VuZXJhdGVXYWl0KCk7XG4gICAgICAgICAgICAgICAgdHJhbnNpdGlvbnNUb1dhaXQuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICB3YWl0Rm9yRHJhdy5hZGQodCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhbGwod2FpdEZvckRyYXcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoZmxvdykge1xuICAgICAgICAgICAgICAgICAgICBmbG93KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjb25maWcub25yZW5kZXJlZCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcub25yZW5kZXJlZC5jYWxsKCQkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICQkLnJlZHJhd0JhcihkcmF3QmFyKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0xpbmUoZHJhd0xpbmUpO1xuICAgICAgICAgICAgJCQucmVkcmF3QXJlYShkcmF3QXJlYSk7XG4gICAgICAgICAgICAkJC5yZWRyYXdDaXJjbGUoY3gsIGN5KTtcbiAgICAgICAgICAgICQkLnJlZHJhd1RleHQoeEZvclRleHQsIHlGb3JUZXh0LCBvcHRpb25zLmZsb3cpO1xuICAgICAgICAgICAgJCQucmVkcmF3UmVnaW9uKCk7XG4gICAgICAgICAgICAkJC5yZWRyYXdHcmlkKCk7XG4gICAgICAgICAgICBpZiAoY29uZmlnLm9ucmVuZGVyZWQpIHtcbiAgICAgICAgICAgICAgICBjb25maWcub25yZW5kZXJlZC5jYWxsKCQkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHVwZGF0ZSBmYWRlaW4gY29uZGl0aW9uXG4gICAgICAgICQkLm1hcFRvSWRzKCQkLmRhdGEudGFyZ2V0cykuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICQkLndpdGhvdXRGYWRlSW5baW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SA/IGJydXNoLmF0dHIoJ2hlaWdodCcpIDogMCk7XG4gICAgICAgICQkLnN2Zy5zZWxlY3QoJy4nICsgQ0xBU1Muem9vbVJlY3QpXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCAkJC53aWR0aClcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAkJC5oZWlnaHQpO1xuICAgICAgICAvLyBNRU1POiBwYXJlbnQgZGl2J3MgaGVpZ2h0IHdpbGwgYmUgYmlnZ2VyIHRoYW4gc3ZnIHdoZW4gPCFET0NUWVBFIGh0bWw+XG4gICAgICAgICQkLnNlbGVjdENoYXJ0LnN0eWxlKCdtYXgtaGVpZ2h0JywgJCQuY3VycmVudEhlaWdodCArIFwicHhcIik7XG4gICAgfTtcblxuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlRGltZW5zaW9uID0gZnVuY3Rpb24gKHdpdGhvdXRBeGlzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXM7XG4gICAgICAgIGlmICghd2l0aG91dEF4aXMpIHtcbiAgICAgICAgICAgIGlmICgkJC5jb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICAgICAgJCQuYXhlcy54LmNhbGwoJCQueEF4aXMpO1xuICAgICAgICAgICAgICAgICQkLmF4ZXMuc3VieC5jYWxsKCQkLnN1YlhBeGlzKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgJCQuYXhlcy55LmNhbGwoJCQueUF4aXMpO1xuICAgICAgICAgICAgICAgICQkLmF4ZXMueTIuY2FsbCgkJC55MkF4aXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgICQkLnVwZGF0ZVNpemVzKCk7XG4gICAgICAgICQkLnVwZGF0ZVNjYWxlcygpO1xuICAgICAgICAkJC51cGRhdGVTdmdTaXplKCk7XG4gICAgICAgICQkLnRyYW5zZm9ybUFsbChmYWxzZSk7XG4gICAgfTtcblxuICAg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b24ubm9kZSgpLnBhcmVudE5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2xlYXJJbnRlcnZhbCgkJC5pbnRlcnZhbEZvck9ic2VydmVJbnNlcnRlZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQudXBkYXRlRGltZW5zaW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmJydXNoKSB7ICQkLmJydXNoLnVwZGF0ZSgpOyB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLm9uaW5pdC5jYWxsKCQkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXcoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVHJhbnNmb3JtOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFRyYW5zaXRpb25Gb3JUcmFuc2Zvcm06IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoTGVnZW5kOiB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uLnRyYW5zaXRpb24oKS5zdHlsZSgnb3BhY2l0eScsIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LCAxMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgICBvYnNlcnZlci5vYnNlcnZlKHNlbGVjdGlvbi5ub2RlKCksIHthdHRyaWJ1dGVzOiB0cnVlLCBjaGlsZExpc3Q6IHRydWUsIGNoYXJhY3RlckRhdGE6IHRydWV9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uYmluZFJlc2l6ZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuXG4gICAgICAgICQkLnJlc2l6ZUZ1bmN0aW9uID0gJCQuZ2VuZXJhdGVSZXNpemUoKTtcblxuICAgICAgICAkJC5yZXNpemVGdW5jdGlvbi5hZGQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgY29uZmlnLm9ucmVzaXplLmNhbGwoJCQpO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKGNvbmZpZy5yZXNpemVfYXV0bykge1xuICAgICAgICAgICAgJCQucmVzaXplRnVuY3Rpb24uYWRkKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoJCQucmVzaXplVGltZW91dCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jbGVhclRpbWVvdXQoJCQucmVzaXplVGltZW91dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLnJlc2l6ZVRpbWVvdXQgPSB3aW5kb3cuc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSAkJC5yZXNpemVUaW1lb3V0O1xuICAgICAgICAgICAgICAgICAgICAkJC5hcGkuZmx1c2goKTtcbiAgICAgICAgICAgICAgICB9LCAxMDApO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgJCQucmVzaXplRnVuY3Rpb24uYWRkKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNvbmZpZy5vbnJlc2l6ZWQuY2FsbCg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jYWxscyBkZXN0cm95XG4gICAgICAgICAgICB3cmFwcGVyLmFkZCgkJC5yZXNpemVGdW5jdGlvbik7XG4gICAgICAgICAgICB3aW5kb3cub25yZXNpemUgPSB3cmFwcGVyO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlUmVzaXplID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgcmVzaXplRnVuY3Rpb25zID0gW107XG4gICAgICAgIGZ1bmN0aW9uIGNhbGxSZXNpemVGdW5jdGlvbnMoKSB7XG4gICAgICAgICAgICByZXNpemVGdW5jdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAoZikge1xuICAgICAgICAgICAgICAgIGYoKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGNhbGxSZXNpemVGdW5jdGlvbnMuYWRkID0gZnVuY3Rpb24gKGYpIHtcbiAgICAgICAgICAgIHJlc2l6ZUZ1bmN0aW9ucy5wdXNoKGYpO1xuICAgICAgICB9O1xuICAgICAgICBjYWxsUmVzaXplRnVuY3Rpb25zLnJlbW92ZSA9IGZ1bmN0aW9uIChmKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHJlc2l6ZUZ1bmN0aW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChyZXNpemVGdW5jdGlvbnNbaV0gPT09IGYpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzaXplRnVuY3Rpb25zLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gY2FsbFJlc2l6ZUZ1bmN0aW9ucztcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZW5kYWxsID0gZnVuY3Rpb24gKHRyYW5zaXRpb24sIGNhbGxiYWNrKSB7XG4gICAgICAgIHZhciBuID0gMDtcbiAgICAgICAgdHJhbnNpdGlvblxuICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKCkgeyArK247IH0pXG4gICAgICAgICAgICAuZWFjaChcImVuZFwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEtLW4pIHsgY2FsbGJhY2suYXBwbHkodGhpcywgYXJndW1lbnRzKTsgfVxuICAgICAgICAgICAgfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZVdhaXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciB0cmFuc2l0aW9uc1RvV2FpdCA9IFtdLFxuICAgICAgICAgICAgZiA9IGZ1bmN0aW9uICh0cmFuc2l0aW9uLCBjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIHZhciB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRvbmUgPSAwO1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uc1RvV2FpdC5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodC5lbXB0eSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSArPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC50cmFuc2l0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSArPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRvbmUgPT09IHRyYW5zaXRpb25zVG9XYWl0Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2spIHsgY2FsbGJhY2soKTsgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSwgMTApO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgZi5hZGQgPSBmdW5jdGlvbiAodHJhbnNpdGlvbikge1xuICAgICAgICAgICAgdHJhbnNpdGlvbnNUb1dhaXQucHVzaCh0cmFuc2l0aW9uKTtcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGY7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnBhcnNlRGF0ZSA9IGZ1bmN0aW9uIChkYXRlKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIHBhcnNlZERhdGU7XG4gICAgICAgIGlmIChkYXRlIGluc3RhbmNlb2YgRGF0ZSkge1xuICAgICAgICAgICAgcGFyc2VkRGF0ZSA9IGRhdGU7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGRhdGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBwYXJzZWREYXRlID0gJCQuZGF0YVRpbWVGb3JtYXQoJCQuY29uZmlnLmRhdGFfeEZvcm1hdCkucGFyc2UoZGF0ZSk7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGRhdGUgPT09ICdudW1iZXInICYmICFpc05hTihkYXRlKSkge1xuICAgICAgICAgICAgcGFyc2VkRGF0ZSA9IG5ldyBEYXRlKCtkYXRlKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXBhcnNlZERhdGUgfHwgaXNOYU4oK3BhcnNlZERhdGUpKSB7XG4gICAgICAgICAgICB3aW5kb3cuY29uc29sZS5lcnJvcihcIkZhaWxlZCB0byBwYXJzZ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ZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgc2l6ZV93aWR0aDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgc2l6ZV9oZWlnaHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBhZGRpbmdfbGVmdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGFkZGluZ19yaWdodDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGFkZGluZ190b3A6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBhZGRpbmdfYm90dG9tOiB1bmRlZmluZWQsXG4gICAgICAgICAgICByZXNpemVfYXV0bzogdHJ1ZSxcbiAgICAgICAgICAgIHpvb21fZW5hYmxlZDogZmFsc2UsXG4gICAgICAgICAgICB6b29tX2V4dGVudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgem9vbV9wcml2aWxlZ2VkOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb21fcmVzY2FsZTogZmFsc2UsXG4gICAgICAgICAgICB6b29tX29uem9vbTogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB6b29tX29uem9vbXN0YXJ0OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHpvb21fb256b29tZW5kOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHpvb21feF9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHpvb21feF9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGludGVyYWN0aW9uX2JyaWdodGVuOiB0cnVlLFxuICAgICAgICAgICAgaW50ZXJhY3Rpb25fZW5hYmxlZDogdHJ1ZSxcbiAgICAgICAgICAgIG9ubW91c2VvdmVyOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9ubW91c2VvdXQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25yZXNpemU6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25yZXNpemVkOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9uaW5pdDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbnJlbmRlcmVkOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHRyYW5zaXRpb25fZHVyYXRpb246IDM1MCxcbiAgICAgICAgICAgIGRhdGFfeDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV94czoge30sXG4gICAgICAgICAgICBkYXRhX3hGb3JtYXQ6ICclWS0lbS0lZCcsXG4gICAgICAgICAgICBkYXRhX3hMb2NhbHRpbWU6IHRydWUsXG4gICAgICAgICAgICBkYXRhX3hTb3J0OiB0cnVlLFxuICAgICAgICAgICAgZGF0YV9pZENvbnZlcnRlcjogZnVuY3Rpb24gKGlkKSB7IHJldHVybiBpZDsgfSxcbiAgICAgICAgICAgIGRhdGFfbmFtZXM6IHt9LFxuICAgICAgICAgICAgZGF0YV9jbGFzc2VzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfZ3JvdXBzOiBbXSxcbiAgICAgICAgICAgIGRhdGFfYXhlczoge30sXG4gICAgICAgICAgICBkYXRhX3R5cGU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRhdGFfdHlwZXM6IHt9LFxuICAgICAgICAgICAgZGF0YV9sYWJlbHM6IHt9LFxuICAgICAgICAgICAgZGF0YV9vcmRlcjogJ2Rlc2MnLFxuICAgICAgICAgICAgZGF0YV9yZWdpb25zOiB7fSxcbiAgICAgICAgICAgIGRhdGFfY29sb3I6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRhdGFfY29sb3JzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfaGlkZTogZmFsc2UsXG4gICAgICAgICAgICBkYXRhX2ZpbHRlcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV9zZWxlY3Rpb25fZW5hYmxlZDogZmFsc2UsXG4gICAgICAgICAgICBkYXRhX3NlbGVjdGlvbl9ncm91cGVkOiBmYWxzZSxcbiAgIC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xcbiAgICAgICAgICAgIHN1YmNoYXJ0X2F4aXNfeF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgc3ViY2hhcnRfb25icnVzaDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICAvLyBjb2xvclxuICAgICAgICAgICAgY29sb3JfcGF0dGVybjogW10sXG4gICAgICAgICAgICBjb2xvcl90aHJlc2hvbGQ6IHt9LFxuICAgICAgICAgICAgLy8gbGVnZW5kXG4gICAgICAgICAgICBsZWdlbmRfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGxlZ2VuZF9oaWRlOiBmYWxzZSxcbiAgICAgICAgICAgIGxlZ2VuZF9wb3NpdGlvbjogJ2JvdHRvbScsXG4gICAgICAgICAgICBsZWdlbmRfaW5zZXRfYW5jaG9yOiAndG9wLWxlZnQnLFxuICAgICAgICAgICAgbGVnZW5kX2luc2V0X3g6IDEwLFxuICAgICAgICAgICAgbGVnZW5kX2luc2V0X3k6IDAsXG4gICAgICAgICAgICBsZWdlbmRfaW5zZXRfc3RlcDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgbGVnZW5kX2l0ZW1fb25jbGljazogdW5kZWZpbmVkLFxuICAgICAgICAgICAgbGVnZW5kX2l0ZW1fb25tb3VzZW92ZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGxlZ2VuZF9pdGVtX29ubW91c2VvdXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGxlZ2VuZF9lcXVhbGx5OiBmYWxzZSxcbiAgICAgICAgICAgIGxlZ2VuZF9wYWRkaW5nOiAwLFxuICAgICAgICAgICAgbGVnZW5kX2l0ZW1fdGlsZV93aWR0aDogMTAsXG4gICAgICAgICAgICBsZWdlbmRfaXRlbV90aWxlX2hlaWdodDogMTAsXG4gICAgICAgICAgICAvLyBheGlzXG4gICAgICAgICAgICBheGlzX3JvdGF0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc194X3Nob3c6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfdHlwZTogJ2luZGV4ZWQnLFxuICAgICAgICAgICAgYXhpc194X2xvY2FsdGltZTogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF9jYXRlZ29yaWVzOiBbXSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2NlbnRlcmVkOiBmYWxzZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfY3VsbGluZzoge30sXG4gICAgICAgICAgICBheGlzX3hfdGlja19jdWxsaW5nX21heDogMTAsXG4gICAgICAgICAgICBheGlzX3hfdGlja19jb3VudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfZml0OiB0cnVlLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfdmFsdWVzOiBudWxsLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfcm90YXRlOiAwLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfb3V0ZXI6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfdGlja19tdWx0aWxpbmU6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfdGlja193aWR0aDogbnVsbCxcbiAgICAgICAgICAgIGF4aXNfeF9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF9wYWRkaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeF9oZWlnaHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF9leHRlbnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF9sYWJlbDoge30sXG4gICAgICAgICAgICBheGlzX3lfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeV90eXBlOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfbWF4OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfbWluOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfaW52ZXJ0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc195X2NlbnRlcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X2lubmVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfbGFiZWw6IHt9LFxuICAgICAgICAgICAgYXhpc195X3RpY2tfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfdGlja19vdXRlcjogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX3ZhbHVlczogbnVsbCwgICAgICAgIFxuICAgICAgICAgICAgYXhpc195X3RpY2tfcm90YXRlOiAwLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfY291bnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX3RpbWVfdmFsdWU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX3RpbWVfaW50ZXJ2YWw6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9wYWRkaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeV9kZWZhdWx0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc195Ml9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfbWluOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX2ludmVydGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGF4aXNfeTJfY2VudGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX2lubmVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX2xhYmVsOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeTJfdGlja19mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfdGlja19vdXRlcjogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeTJfdGlja192YWx1ZXM6IG51bGwsXG4gICAgICAgICAgICBheGlzX3kyX3RpY2tfY291bnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfcGFkZGluZzoge30sXG4gICAgICAgICAgICBheGlzX3kyX2RlZmF1bHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vIGdyaWRcbiAgICAgICAgICAgIGdyaWRfeF9zaG93OiBmYWxzZSxcbiAgICAgICAgICAgIGdyaWRfeF90eXBlOiAndGljaycsXG4gICAgICAgICAgICBncmlkX3hfbGluZXM6IFtdLFxuICAgICAgICAgICAgZ3JpZF95X3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgLy8gbm90IHVzZWRcbiAgICAgICAgICAgIC8vIGdyaWRfeV90eXBlOiAndGljaycsXG4gICAgICAgICAgICBncmlkX3lfbGluZXM6IFtdLFxuICAgICAgICAgICAgZ3JpZF95X3RpY2tzOiAxMCxcbiAgICAgICAgICAgIGdyaWRfZm9jdXNfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGdyaWRfbGluZXNfZnJvbnQ6IHRydWUsXG4gICAgICAgICAgICAvLyBwb2ludCAtIHBvaW50IG9mIGVhY2ggZGF0YVxuICAgICAgICAgICAgcG9pbnRfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIHBvaW50X3I6IDIuNSxcbiAgICAgICAgICAgIHBvaW50X3NlbnNpdGl2aXR5OiAxMCxcbiAgICAgICAgICAgIHBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkOiB0cnVlLFxuICAgICAgICAgICAgcG9pbnRfZm9jdXNfZXhwYW5kX3I6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBvaW50X3NlbGVjdF9yOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyBsaW5lXG4gICAgICAgICAgICBsaW5lX2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ICAgICAgICAgICBnYXVnZV93aWR0aDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZ2F1Z2VfZXhwYW5kOiB7fSxcbiAgICAgICAgICAgIGdhdWdlX2V4cGFuZF9kdXJhdGlvbjogNTAsXG4gICAgICAgICAgICAvLyBkb251dFxuICAgICAgICAgICAgZG9udXRfbGFiZWxfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGRvbnV0X2xhYmVsX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZG9udXRfbGFiZWxfdGhyZXNob2xkOiAwLjA1LFxuICAgICAgICAgICAgZG9udXRfbGFiZWxfcmF0aW86IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRvbnV0X3dpZHRoOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkb251dF90aXRsZTogXCJcIixcbiAgICAgICAgICAgIGRvbnV0X2V4cGFuZDoge30sXG4gICAgICAgICAgICBkb251dF9leHBhbmRfZHVyYXRpb246IDUwLFxuICAgICAgICAgICAgLy8gc3BsaW5lXG4gICAgICAgICAgICBzcGxpbmVfaW50ZXJwb2xhdGlvbl90eXBlOiAnY2FyZGluYWwnLFxuICAgICAgICAgICAgLy8gcmVnaW9uIC0gcmVnaW9uIHRvIGNoYW5nZSBzdHlsZVxuICAgICAgICAgICAgcmVnaW9uczogW10sXG4gICAgICAgICAgICAvLyB0b29sdGlwIC0gc2hvdyB3aGVuIG1vdXNlb3ZlciBvbiBlYWNoIGRhdGFcbiAgICAgICAgICAgIHRvb2x0aXBfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIHRvb2x0aXBfZ3JvdXBlZDogdHJ1ZSxcbiAgICAgICAgICAgIHRvb2x0aXBfZm9ybWF0X3RpdGxlOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB0b29sdGlwX2Zvcm1hdF9uYW1lOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB0b29sdGlwX2Zvcm1hdF92YWx1ZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgdG9vbHRpcF9wb3NpdGlvbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgdG9vbHRpcF9jb250ZW50czogZnVuY3Rpb24gKGQsIGRlZmF1bHRUaXRsZUZvcm1hdCwgZGVmYXVsdFZhbHVlRm9ybWF0LCBjb2xvcikge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmdldFRvb2x0aXBDb250ZW50ID8gdGhpcy5nZXRUb29sdGlwQ29udGVudChkLCBkZWZhdWx0VGl0bGVGb3JtYXQsIGRlZmF1bHRWYWx1ZUZvcm1hdCwgY29sb3IpIDogJyc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdG9vbHRpcF9pbml0X3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgdG9vbHRpcF9pbml0X3g6IDAsXG4gICAgICAgICAgICB0b29sdGlwX2luaXRfcG9zaXRpb246IHt0b3A6ICcwcHgnLCBsZWZ0OiAnNTBweCd9LFxuICAgICAgICAgICAgdG9vbHRpcF9vbnNob3c6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgdG9vbHRpcF9vbmhpZGU6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgLy8gdGl0bGVcbiAgICAgICAgICAgIHRpdGxlX3RleHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHRpdGxlX3BhZGRpbmc6IHtcbiAgICAgICAgICAgICAgICB0b3A6IDAsXG4gICAgICAgICAgICAgICAgcmlnaHQ6IDAsXG4gICAgICAgICAgICAgICAgYm90dG9tOiAwLFxuICAgICAgICAgICAgICAgIGxlZnQ6IDBcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB0aXRsZV9wb3NpdGlvbjogJ3RvcC1jZW50ZXInLFxuICAgICAgICB9O1xuXG4gICAgICAgIE9iamVjdC5rZXlzKHRoaXMuYWRkaXRpb25hbENvbmZpZykuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICBjb25maWdba2V5XSA9IHRoaXMuYWRkaXRpb25hbENvbmZpZ1trZXldO1xuICAgICAgICB9LCB0aGlzKTtcblxuICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uYWRkaXRpb25hbENvbmZpZyA9IHt9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ubG9hZENvbmZpZyA9IGZ1bmN0aW9uIChjb25maWcpIHtcbiAgICAgICAgdmFyIHRoaXNfY29uZmlnID0gdGhpcy5jb25maWcsIHRhcmdldCwga2V5cywgcmVhZDtcbiAgICAgICAgZnVuY3Rpb24gZmluZCgpIHtcbiAgICAgICAgICAgIHZhciBrZXkgPSBrZXlzLnNoaWZ0KCk7XG4gICAgLy8gICAgICAgIGNvbnNvbGUubG9nKFwia2V5ID0+XCIsIGtleSwgXCIsIHRhcmdldCA9PlwiLCB0YXJnZXQpO1xuICAgICAgICAgICAgaWYgKGtleSAmJiB0YXJnZXQgJiYgdHlwZW9mIHRhcmdldCA9PT0gJ29iamVjdCcgJiYga2V5IGluIHRhcmdldCkge1xuICAgICAgICAgICAgICAgIHRhcmdldCA9IHRhcmdldFtrZXldO1xuICAgICAgICAgICAgICAgIHJldHVybiBmaW5kKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICgha2V5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRhcmdldDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgT2JqZWN0LmtleXModGhpc19jb25maWcpLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgdGFyZ2V0ID0gY29uZmlnO1xuICAgICAgICAgICAga2V5cyA9IGtleS5zcGxpdCgnXycpO1xuICAgICAgICAgICAgcmVhZCA9IGZpbmQoKTtcbiAgICAvLyAgICAgICAgY29uc29sZS5sb2coXCJDT05GSUcgOiBcIiwga2V5LCByZWFkKTtcbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQocmVhZCkpIHtcbiAgICAgICAgICAgICAgICB0aGlzX2NvbmZpZ1trZXldID0gcmVhZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFNjYWxlID0gZnVuY3Rpb24gKG1pbiwgbWF4LCBmb3JUaW1lc2VyaWVzKSB7XG4gICAgICAgIHJldHVybiAoZm9yVGltZXNlcmllcyA/IHRoaXMuZDMudGltZS5zY2FsZSgpIDogdGhpcy5kMy5zY2FsZS5saW5lYXIoKSkucmFuZ2UoW21pbiwgbWF4XSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRYID0gZnVuY3Rpb24gKG1pbiwgbWF4LCBkb21haW4sIG9mZnNldCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgc2NhbGUgPSAkJC5nZXRTY2FsZShtaW4sIG1heCwgJCQuaXNUaW1lU2VyaWVzKCkpLFxuICAgICAgICAgICAgX3NjYWxlID0gZG9tYWluID8gc2NhbGUuZG9tYWluKGRvbWFpbikgOiBzY2FsZSwga2V5O1xuICAgICAgICAvLyBEZWZpbmUgY3VzdG9taXplZCBzY2FsZSBpZiBjYXRlZ29yaXplZCBheGlzXG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIG9mZnNldCA9IG9mZnNldCB8fCBmdW5jdGlvbiAoKSB7IHJldHVybiAwOyB9O1xuICAgICAgICAgICAgc2NhbGUgPSBmdW5jdGlvbiAoZCwgcmF3KSB7XG4gICAgICAgICAgICAgICAgdmFyIHYgPSBfc2NhbGUoZCkgKyBvZmZzZXQoZCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJhdyA/IHYgOiBNYXRoLmNlaWwodik7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc2NhbGUgPSBmdW5jdGlvbiAoZCwgcmF3KSB7XG4gICAgICAgICAgICAgICAgdmFyIHYgPSBfc2NhbGUoZCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJhdyA/IHYgOiBNYXRoLmNlaWwodik7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIC8vIGRlZmluZSBmdW5jdGlvbnNcbiAgICAgICAgZm9yIChrZXkgaW4gX3NjYWxlKSB7XG4gICAgICAgICAgICBzY2FsZVtrZXldID0gX3NjYWxlW2tleV07XG4gICAgICAgIH1cbiAgICAgICAgc2NhbGUub3JnRG9tYWluID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIF9zY2FsZS5kb21haW4oKTtcbiAgICAgICAgfTtcbiAgICAgICAgLy8gZGVmaW5lIGN1c3RvbSBkb21haW4oKSBmb3IgY2F0ZWdvcml6ZWQgYXhpc1xuICAgICAgICBpZiAoJCQuaXNDYXRlZ29yaXplZCgpKSB7XG4gICAgICAgICAgICBzY2FsZS5kb21haW4gPSBmdW5jdGlvbiAoZG9tYWluKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGRvbWFpbiA9IHRoaXMub3JnRG9tYWluKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbZG9tYWluWzBdLCBkb21haW5bMV0gKyAxXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgX3NjYWxlLmRvbWFpbihkb21haW4pO1xuICAgICAgICAgICAgICAgIHJldHVybiBzY2FsZTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNjYWxlO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxf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HMuaW5kZXhPZihpZCkgPj0gMDsgfSk7XG4gICAgICAgICAgICAgICAgaWYgKGlkc0luR3JvdXAubGVuZ3RoID09PSAwKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICAgICAgYmFzZUlkID0gaWRzSW5Hcm91cFswXTtcbiAgICAgICAgICAgICAgICAvLyBDb25zaWRlciBuZWdhdGl2ZSB2YWx1ZXNcbiAgICAgICAgICAgICAgICBpZiAoaGFzTmVnYXRpdmVWYWx1ZSAmJiB5c1tiYXNlSWRdKSB7XG4gICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF0uZm9yRWFjaChmdW5jdGlvbiAodiwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXVtpXSA9IHYgPCAwID8gdiA6IDA7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG1pblxuICAgICAgICAgICAgICAgIGZvciAoayA9IDE7IGsgPCBpZHNJbkdyb3VwLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlkID0gaWRzSW5Hcm91cFtrXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEgeXNbaWRdKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICAgICAgICAgIHlzW2lkXS5mb3JFYWNoKGZ1bmN0aW9uICh2LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJCQuYXhpcy5nZXRJZChpZCkgPT09ICQkLmF4aXMuZ2V0SWQoYmFzZUlkKSAmJiB5c1tiYXNlSWRdICYmICEoaGFzTmVnYXRpdmVWYWx1ZSAmJiArdiA+IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXVtpXSArPSArdjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuIC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hbHVlc1xuICAgICAgICAgICAgICAgIGlmIChoYXNQb3NpdGl2ZVZhbHVlICYmIHlzW2Jhc2VJZF0pIHtcbiAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXS5mb3JFYWNoKGZ1bmN0aW9uICh2LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldID0gdiA+IDAgPyB2IDogMDtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIENvbXB1dGUgbWF4XG4gICAgICAgICAgICAgICAgZm9yIChrID0gMTsgayA8IGlkc0luR3JvdXAubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBpZHNJbkdyb3VwW2tdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISB5c1tpZF0pIHsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICAgICAgeXNbaWRdLmZvckVhY2goZnVuY3Rpb24gKHYsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkJC5heGlzLmdldElkKGlkKSA9PT0gJCQuYXhpcy5nZXRJZChiYXNlSWQpICYmIHlzW2Jhc2VJZF0gJiYgIShoYXNQb3NpdGl2ZVZhbHVlICYmICt2IDwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldICs9ICt2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICQkLmQzLm1heChPYmplY3Qua2V5cyh5cykubWFwKGZ1bmN0aW9uIChrZXkpIHsgcmV0dXJuICQkLmQzLm1heCh5c1trZXldKTsgfSkpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WURvbWFpbiA9IGZ1bmN0aW9uICh0YXJnZXRzLCBheGlzSWQsIHhEb21haW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgdGFyZ2V0c0J5QXhpc0lkID0gdGFyZ2V0cy5maWx0ZXIoZnVuY3Rpb24gKHQpIHsgcmV0dXJuICQkLmF4aXMuZ2V0SWQodC5pZCkgPT09IGF4aXNJZDsgfSksXG4gICAgICAgICAgICB5VGFyZ2V0cyA9IHhEb21haW4gPyAkJC5maWx0ZXJCeVhEb21haW4odGFyZ2V0c0J5QXhpc0lkLCB4RG9tYWluKSA6IHRhcmdldHNCeUF4aXNJZCxcbiAgICAgICAgICAgIHlNaW4gPSBheGlzSWQgPT09ICd5MicgPyBjb25maWcuYXhpc195Ml9taW4gOiBjb25maWcuYXhpc195X21pbixcbiAgICAgICAgICAgIHlNYXggPSBheGlzSWQgPT09ICd5MicgPyBjb25maWcuYXhpc195Ml9tYXggOiBjb25maWcuYXhpc195X21heCxcbiAgICAgICAgICAgIHlEb21haW5NaW4gPSAkJC5nZXRZRG9tYWluTWluKHlUYXJnZXRzKSxcbiAgICAgICAgICAgIHlEb21haW5NYXggPSAkJC5nZXRZRG9tYWluTWF4KHlUYXJnZXRzKSxcbiAgICAgICAgICAgIGRvbWFpbiwgZG9tYWluTGVuZ3RoLCBwYWRkaW5nLCBwYWRkaW5nX3RvcCwgcGFkZGluZ19ib3R0b20sXG4gICAgICAgICAgICBjZW50ZXIgPSBheGlzSWQgPT09ICd5MicgPyBjb25maWcuYXhpc195Ml9jZW50ZXIgOiBjb25maWcuYXhpc195X2NlbnRlcixcbiAgICAgICAgICAgIHlEb21haW5BYnMsIGxlbmd0aHMsIGRpZmYsIHJhdGlvLCBpc0FsbFBvc2l0aXZlLCBpc0FsbE5lZ2F0aXZlLFxuICAgICAgICAgICAgaXNaZXJvQmFzZWQgPSAoJCQuaGFzVHlwZSgnYmFyJywgeVRhcmdldHMpICYmIGNvbmZpZy5iYX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gMCwgbWF4ID0gMDtcbiAgICAgICAgLy8gc2hvdyBjZW50ZXIgb2YgeCBkb21haW4gaWYgbWluIGFuZCBtYXggYXJlIHRoZSBzYW1lXG4gICAgICAgIGlmICgoZmlyc3RYIC0gbGFzdFgpID09PSAwICYmICEkJC5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgIGZpcnN0WCA9IG5ldyBEYXRlKGZpcnN0WC5nZXRUaW1lKCkgKiAwLjUpO1xuICAgICAgICAgICAgICAgIGxhc3RYID0gbmV3IERhdGUobGFzdFguZ2V0VGltZSgpICogMS41KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZmlyc3RYID0gZmlyc3RYID09PSAwID8gMSA6IChmaXJzdFggKiAwLjUpO1xuICAgICAgICAgICAgICAgIGxhc3RYID0gbGFzdFggPT09IDAgPyAtMSA6IChsYXN0WCAqIDEuNSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGZpcnN0WCB8fCBmaXJzdFggPT09IDApIHtcbiAgICAgICAgICAgIG1pbiA9ICQkLmlzVGltZVNlcmllcygpID8gbmV3IERhdGUoZmlyc3RYLmdldFRpbWUoKSAtIHBhZGRpbmcubGVmdCkgOiBmaXJzdFggLSBwYWRkaW5nLmxlZnQ7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGxhc3RYIHx8IGxhc3RYID09PSAwKSB7XG4gICAgICAgICAgICBtYXggPSAkJC5pc1RpbWVTZXJpZXMoKSA/IG5ldyBEYXRlKGxhc3RYLmdldFRpbWUoKSArIHBhZGRpbmcucmlnaHQpIDogbGFzdFggKyBwYWRkaW5nLnJpZ2h0O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBbbWluLCBtYXhdO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlWERvbWFpbiA9IGZ1bmN0aW9uICh0YXJnZXRzLCB3aXRoVXBkYXRlWERvbWFpbiwgd2l0aFVwZGF0ZU9yZ1hEb21haW4sIHdpdGhUcmltLCBkb21haW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuXG4gICAgICAgIGlmICh3aXRoVXBkYXRlT3JnWERvbWFpbikge1xuICAgICAgICAgICAgJCQueC5kb21haW4oZG9tYWluID8gZG9tYWluIDogJCQuZDMuZXh0ZW50KCQkLmdldFhEb21haW4odGFyZ2V0cykpKTtcbiAgICAgICAgICAgICQkLm9yZ1hEb21haW4gPSAkJC54LmRvbWFpbigpO1xuICAgICAgICAgICAgaWYgKGNvbmZpZy56b29tX2VuYWJsZWQpIHsgJCQuem9vbS5zY2FsZSgkJC54KS51cGRhdGVTY2FsZUV4dGVudCgpOyB9XG4gICAgICAgICAgICAkJC5zdWJYLmRvbWFpbigkJC54LmRvbWFpbigpKTtcbiAgICAgICAgICAgIGlmICgkJC5icnVzaCkgeyAkJC5icnVzaC5zY2FsZSgkJC5zdWJYKTsgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh3aXRoVXBkYXRlWERvbWFpbikge1xuICAgICAgICAgICAgJCQueC5kb21haW4oZG9tYWluID8gZG9tYWluIDogKCEkJC5icnVzaCB8fCAkJC5icnVzaC5lbXB0eSgpKSA/ICQkLm9yZ1hEb21haW4gOiAkJC5icnVzaC5leHRlbnQoKSk7XG4gICAgICAgICAgICBpZiAoY29uZmlnLnpvb21fZW5hYmxlZCkgeyAkJC56b29tLnNjYWxlKCQkLngpLnVwZGF0ZVNjYWxlRXh0ZW50KCk7IH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFRyaW0gZG9tYWluIHdoZW4gdG9vIGJpZyBieSB6b29tIG1vdXNlbW92ZSBldmVudFxuICAgICAgICBpZiAod2l0aFRyaW0pIHsgJCQueC5kb21haW4oJCQudHJpbVhEb21haW4oJCQueC5vcmdEb21haW4oKSkpOyB9XG5cbiAgICAgICAgcmV0dXJuICQkLnguZG9tYWluKCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi50cmltWERvbWFpbiA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgdmFyIHpvb21Eb21haW4gPSB0aGlzLmdldFpvb21Eb21haW4oKSxcbiAgICAgICAgICAgIG1pbiA9IHpvb21Eb21haW5bMF0sIG1heCA9IHpvb21Eb21haW5bMV07XG4gICAgICAgIGlmIChkb21haW5bMF0gPD0gbWluKSB7XG4gICAgICAgICAgICBkb21haW5bMV0gPSArZG9tYWluWzFdICsgKG1pbiAtIGRvbWFpblswXSk7XG4gICAgICAgICAgICBkb21haW5bMF0gPSBtaW47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1heCA8PSBkb21haW5bMV0pIHtcbiAgICAgICAgICAgIGRvbWFpblswXSA9ICtkb21haW5bMF0gLSAoZG9tYWluWzFdIC0gbWF4KTtcbiAgICAgICAgICAgIGRvbWFpblsxXSA9IG1heDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZG9tYWluO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pc1ggPSBmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgcmV0dXJuIChjb25maWcuZGF0YV94ICYmIGtleSA9PT0gY29uZmlnLmRhdGFfeCkgfHwgKG5vdEVtcHR5KGNvbmZpZy5kYXRhX3hzKSAmJiBoYXNWYWx1ZShjb25maWcuZGF0YV94cywga2V5KSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pc05vdFggPSBmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgIHJldHVybiAhdGhpcy5pc1goa2V5KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFhLZXkgPS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AgICAgICAgICAgaWRfb3JnOiB0LmlkX29yZyxcbiAgICAgICAgICAgICAgICB2YWx1ZXM6IHQudmFsdWVzLmZpbHRlcihmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geERvbWFpblswXSA8PSB2LnggJiYgdi54IDw9IHhEb21haW5bMV07XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaGFzRGF0YUxhYmVsID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgY29uZmlnID0gdGhpcy5jb25maWc7XG4gICAgICAgIGlmICh0eXBlb2YgY29uZmlnLmRhdGFfbGFiZWxzID09PSAnYm9vbGVhbicgJiYgY29uZmlnLmRhdGFfbGFiZWxzKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgY29uZmlnLmRhdGFfbGFiZWxzID09PSAnb2JqZWN0JyAmJiBub3RFbXB0eShjb25maWcuZGF0YV9sYWJlbHMpKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXREYXRhTGFiZWxMZW5ndGggPSBmdW5jdGlvbiAobWluLCBtYXgsIGtleSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgbGVuZ3RocyA9IFswLCAwXSwgcGFkZGluZ0NvZWYgPSAxLjM7XG4gICAgICAgICQkLnNlbGVjdENoYXJ0LnNlbGVjdCgnc3ZnJykuc2VsZWN0QWxsKCcuZHVtbXknKVxuICAgICAgICAgICAgLmRhdGEoW21pbiwgbWF4XSlcbiAgICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgndGV4dCcpXG4gICAgICAgICAgICAudGV4dCh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PSAkJC5tYWluLnNlbGVjdCgnLicgKyBDTEFTUy5iYXJzICsgJCQuZ2V0VGFyZ2V0U2VsZWN0b3JTdWZmaXgodi5pZCkgKyAnIC4nICsgQ0xBU1MuYmFyICsgJy0nICsgdi5pbmRleCkubm9kZSgpO1xuICAgICAgICAgICAgaWYgKCFjbG9zZXN0ICYmICQkLmlzV2l0aGluQmFyKHNoYXBlKSkge1xuICAgICAgICAgICAgICAgIGNsb3Nlc3QgPSB2O1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBmaW5kIGNsb3Nlc3QgcG9pbnQgZnJvbSBub24tYmFyXG4gICAgICAgIHZhbHVlcy5maWx0ZXIoZnVuY3Rpb24gKHYpIHsgcmV0dXJuIHYgJiYgISQkLmlzQmFyVHlwZSh2LmlkKTsgfSkuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgdmFyIGQgPSAkJC5kaXN0KHYsIHBvcyk7XG4gICAgICAgICAgICBpZiAoZCA8IG1pbkRpc3QpIHtcbiAgICAgICAgICAgICAgICBtaW5EaXN0ID0gZDtcbiAgICAgICAgICAgICAgICBjbG9zZXN0ID0gdjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIGNsb3Nlc3Q7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5kaXN0ID0gZnVuY3Rpb24gKGRhdGEsIHBvcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICB4SW5kZXggPSBjb25maWcuYXhpc19yb3RhdGVkID8gMSA6IDAsXG4gICAgICAgICAgICB5SW5kZXggPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IDEsXG4gICAgICAgICAgICB5ID0gJCQuY2lyY2xlWShkYXRhLCBkYXRhLmluZGV4KSxcbiAgICAgICAgICAgIHggPSAkJC54KGRhdGEueCk7XG4gICA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9uIChuYW1lLCBhdHRycykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGN1cnJlbnQgPSBjb25maWdbJ2RhdGFfJyArIG5hbWVdO1xuICAgICAgICBpZiAodHlwZW9mIGF0dHJzID09PSAndW5kZWZpbmVkJykgeyByZXR1cm4gY3VycmVudDsgfVxuICAgICAgICBPYmplY3Qua2V5cyhhdHRycykuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgIGN1cnJlbnRbaWRdID0gYXR0cnNbaWRdO1xuICAgICAgICB9KTtcbiAgICAgICAgJCQucmVkcmF3KHt3aXRoTGVnZW5kOiB0cnVlfSk7XG4gICAgICAgIHJldHVybiBjdXJyZW50O1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0VXJsVG9EYXRhID0gZnVuY3Rpb24gKHVybCwgbWltZVR5cGUsIGhlYWRlcnMsIGtleXMsIGRvbmUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgdHlwZSA9IG1pbWVUeXBlID8gbWltZVR5cGUgOiAnY3N2JztcbiAgICAgICAgdmFyIHJlcSA9ICQkLmQzLnhocih1cmwpO1xuICAgICAgICBpZiAoaGVhZGVycykge1xuICAgICAgICAgICAgT2JqZWN0LmtleXMoaGVhZGVycykuZm9yRWFjaChmdW5jdGlvbiAoaGVhZGVyKSB7XG4gICAgICAgICAgICAgICAgcmVxLmhlYWRlcihoZWFkZXIsIGhlYWRlcnNbaGVhZGVyXSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXEuZ2V0KGZ1bmN0aW9uIChlcnJvciwgZGF0YSkge1xuICAgICAgICAgICAgdmFyIGQ7XG4gICAgICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoZXJyb3IucmVzcG9uc2VVUkwgKyAnICcgKyBlcnJvci5zdGF0dXMgKyAnICgnICsgZXJyb3Iuc3RhdHVzVGV4dCArICcpJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZSA9PT0gJ2pzb24nKSB7XG4gICAgICAgICAgICAgICAgZCA9ICQkLmNvbnZlcnRKc29uVG9EYXRhKEpTT04ucGFyc2UoZGF0YS5yZXNwb25zZSksIGtleXMpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSAndHN2Jykge1xuICAgICAgICAgICAgICAgIGQgPSAkJC5jb252ZXJ0VHN2VG9EYXRhKGRhdGEucmVzcG9uc2UpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBkID0gJCQuY29udmVydENzdlRvRGF0YShkYXRhLnJlc3BvbnNlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRvbmUuY2FsbCgkJCwgZCk7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydFhzdlRvRGF0YSA9IGZ1bmN0aW9uICh4c3YsIHBhcnNlcikge1xuICAgICAgICB2YXIgcm93cyA9IHBhcnNlci5wYXJzZVJvd3MoeHN2KSwgZDtcbiAgICAgICAgaWYgKHJvd3MubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICBkID0gW3t9XTtcbiAgICAgICAgICAgIHJvd3NbMF0uZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICAgICBkWzBdW2lkXSA9IG51bGw7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGQgPSBwYXJzZXIucGFyc2UoeHN2KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZDtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRDc3ZUb0RhdGEgPSBmdW5jdGlvbiAoY3N2KSB7XG4gICAgICAgIHJldHVybiB0aGlzLmNvbnZlcnRYc3ZUb0RhdGEoY3N2LCB0aGlzLmQzLmNzdik7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0VHN2VG9EYXRhID0gZnVuY3Rpb24gKHRzdikge1xuICAgICAgICByZXR1cm4gdGhpcy5jb252ZXJ0WHN2VG9EYXRhKHRzdiwgdGhpcy5kMy50c3YpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydEpzb25Ub0RhdGEgPSBmdW5jdGlvbiAoanNvbiwga2V5cykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgbmV3X3Jvd3MgPSBbXSwgdGFyZ2V0S2V5cywgZGF0YTtcbiAgICAgICAgaWYgKGtleXMpIHsgLy8gd2hlbiBrZXlzIHNwZWNpZmllZCwganNvbiB3b3VsZCBiZSBhbiBhcnJheSB0aGF0IGluY2x1ZGVzIG9iamVjdHNcbiAgICAgICAgICAgIGlmIChrZXlzLngpIHtcbiAgICAgICAgICAgICAgICB0YXJnZXRLZXlzID0ga2V5cy52YWx1ZS5jb25jYXQoa2V5cy54KTtcbiAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV94ID0ga2V5cy54O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0YXJnZXRLZXlzID0ga2V5cy52YWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG5ld19yb3dzLnB1c2godGFyZ2V0S2V5cyk7XG4gICAgICAgICAgICBqc29uLmZvckVhY2goZnVuY3Rpb24gKG8pIHtcbiAgICAgICAgICAgICAgICB2YXIgbmV3X3JvdyA9IFtdO1xuICAgICAgICAgICAgICAgIHRhcmdldEtleXMuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgdW5kZWZpbmVkIHRvIG51bGwgYmVjYXVzZSB1bmRlZmluZWQgZGF0YSB3aWxsIGJlIHJlbW92ZWQgaW4gY29udmVydERhdGFUb1RhcmdldHMoKVxuICAgICAgICAgICAgICAgICAgICB2YXIgdiA9ICQkLmZpbmRWYWx1ZUluSnNvbihvLCBrZXkpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQodikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHYgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG5ld19yb3cucHVzaCh2KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBuZXdfcm93cy5wdXNoKG5ld19yb3cpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBkYXRhID0gJCQuY29udmVydFJvd3NUb0RhdGEobmV3X3Jvd3MpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgT2JqZWN0LmtleXMoanNvbikuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAgICAgbmV3X3Jvd3MucHVzaChba2V5XS5jb25jYXQoanNvbltrZXldKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGRhdGEgPSAkJC5jb252ZXJ0Q29sdW1uc1RvRGF0YShuZXdfcm93cyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGRhdGE7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5maW5kVmFsdWVJbkpzb24gPSBmdW5jdGlvbiAob2JqZWN0LCBwYXRoKSB7XG4gICAgICAgIHBhdGggPSBwYXRoLnJlcGxhY2UoL1xcWyhcXHcrKVxcXS9nLCAnLiQxJyk7IC8vIGNvbnZlcnQgaW5kZXhlcyB0byBwcm9wZXJ0aWVzIChyZXBsYWNlIFtdIHdpdGggLilcbiAgICAgICAgcGF0aCA9IHBhdGgucmVwbGFjZSgvXlxcLi8sICcnKTsgICAgICAgICAgIC8vIHN0cmlwIGEgbGVhZGluZyBkb3RcbiAgICAgICAgdmFyIHBhdGhBcnJheSA9IHBhdGguc3BsaXQoJy4nKTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwYXRoQXJyYXkubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgIHZhciBrID0gcGF0aEFycmF5W2ldO1xuICAgICAgICAgICAgaWYgKGsgaW4gb2JqZWN0KSB7XG4gICAgICAgICAgICAgICAgb2JqZWN0ID0gb2JqZWN0W2tdO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG9iamVjdDtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRSb3dzVG9EYXRhID0gZnVuY3Rpb24gKHJvd3MpIHtcbiAgICAgICAgdmFyIGtleXMgPSByb3dzWzBdLCBuZXdfcm93ID0ge30sIG5ld19yb3dzID0gW10sIGksIGo7XG4gICAgICAgIGZvciAoaSA9IDE7IGkgPCByb3dzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBuZXdfcm93ID0ge307XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgcm93c1tpXS5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChyb3dzW2ldW2pdKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJTb3VyY2UgZGF0YSBpcyBtaXNzaW5nIGEgY29tcG9uZW50IGF0IChcIiArIGkgKyBcIixcIiArIGogKyBcIikhXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBuZXdfcm93W2tleXNbal1dID0gcm93c1tpXVtqXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG5ld19yb3dzLnB1c2gobmV3X3Jvdyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ld19yb3dzO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydENvbHVtbnNUb0RhdGEgPSBmdW5jdGlvbiAoY29sdW1ucykge1xuICAgICAgICB2YXIgbmV3X3Jvd3MgPSBbXSwgaSwgaiwga2V5O1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29sdW1ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAga2V5ID0gY29sdW1uc1tpXVswXTtcbiAgICAgICAgICAgIGZvciAoaiA9IDE7IGogPCBjb2x1bW5zW2ldLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKG5ld19yb3dzW2ogLSAxXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgbmV3X3Jvd3NbaiAtIDFdID0ge307XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChjb2x1bW5zW2ldW2pdKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJTb3VyY2UgZGF0YSBpcyBtaXNzaW5nIGEgY29tcG9uZW50IGF0IChcIiArIGkgKyBcIixcIiArIGogKyBcIikhXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBuZXdfcm93c1tqIC0gMV1ba2V5XSA9IGNvbHVtbnNbaV1bal07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ld19yb3dzO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydERhdGFUb1RhcmdldHMgPSBmdW5jdGlvbiAoZGF0YSwgYXBwZW5kWHMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgaWRzID0gJCQuZDMua2V5cyhkYXRhWzBdKS5maWx0ZXIoJCQuaXNOb3RYLCAkJCksXG4gICAgICAgICAgICB4cyA9ICQkLmQzLmtleXMoZGF0YVswXSkuZmlsdGVyKCQkLmlzWCwgJCQpLFxuICAgICAgICAgICAgdGFyZ2V0cztcblxuICAgICAgICAvLyBzYXZlIHggZm9yIHVwZGF0ZSBkYXRhIGJ5IGxvYWQgd2hlbiBjdXN0b20geCBhbmQgYzMueCBBUElcbiAgICAgICAgaWRzLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICB2YXIgeEtleSA9ICQkLmdldFhLZXkoaWQpO1xuXG4gICAgICAgICAgICBpZiAoJCQuaXNDdXN0b21YKCkgfHwgJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAvLyBpZiBpbmNsdWRlZCBpbiBpbnB1dCBkYXRhXG4gICAgICAgICAgICAgICAgaWYgKHhzLmluZGV4T2YoeEtleSkgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9IChhcHBlbmRYcyAmJiAkJC5kYXRhLnhzW2lkXSA/ICQkLmRhdGEueHNbaWRdIDogW10pLmNvbmNhdChcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEubWFwKGZ1bmN0aW9uIChkKSB7IHJldHVybiBkW3hLZXldOyB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoaXNWYWx1ZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKGZ1bmN0aW9uIChyYXdYLCBpKSB7IHJldHVybiAkJC5nZW5lcmF0ZVRhcmdldFgocmF3WCwgaWQsIGkpOyB9KVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBpZiBub3QgaW5jbHVkZWQgaW4gaW5wdXQgZGF0YSwgZmluZCBmcm9tIHByZWxvYWRlZCBkYXRhIG9mIG90aGVyIGlkJ3MgeFxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNvbmZpZy5kYXRhX3gpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZGF0YS54c1tpZF0gPSAkJC5nZXRPdGhlclRhcmdldFhzKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIG5vdCBpbmNsdWRlZCBpbiBpbnB1dCBkYXRhLCBmaW5kIGZyb20gcHJlbG9hZGVkIGRhdGFcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChub3RFbXB0eShjb25maWcuZGF0YV94cykpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZGF0YS54c1tpZF0gPSAkJC5nZXRYVmFsdWVzT2ZYS2V5KHhLZXksICQkLmRhdGEudGFyZ2V0cyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIE1FTU86IGlmIG5vIHggaW5jbHVkZWQsIHVzZSBzYW1lIHggb2YgY3VycmVudCB3aWxsIGJlIHVzZWRcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgJCQuZGF0YS54c1tpZF0gPSBkYXRhLm1hcChmdW5jdGlvbiAoZCwgaSkgeyByZXR1cm4gaTsgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG5cbiAgICAgICAgLy8gY2hlY2sgeCBpcyBkZWZpbmVkXG4gICAgICAgIGlkcy5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgaWYgKCEkJC5kYXRhLnhzW2lkXSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcigneCBpcyBub3QgZGVmaW5lZCBmb3IgaWQgPSBcIicgKyBpZCArICdcIi4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gY29udmVydCB0byB0YXJnZXRcbiAgICAgICAgdGFyZ2V0cyA9IGlkcy5tYXAoZnVuY3Rpb24gKGlkLCBpbmRleCkge1xuICAgICAgICAgICAgdmFyIGNvbnZlcnRlZElkID0gY29uZmlnLmRhdGFfaWRDb252ZXJ0ZXIoaWQpO1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBpZDogY29udmVydGVkSWQsXG4gICAgICAgICAgICAgICAgaWRfb3JnOiBpZCxcbiAgICAgICAgICAgICAgICB2YWx1ZXM6IGRhdGEubWFwKGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4S2V5ID0gJCQuZ2V0WEtleShpZCksIHJhd1ggPSBkW3hLZXldLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBkW2lkXSAhPT0gbnVsbCAmJiAhaXNOYU4oZFtpZF0pID8gK2RbaWRdIDogbnVsbCwgeDtcbiAgICAgICAgICAgICAgICAgICAgLy8gdXNlIHggYXMgY2F0ZWdvcmllcyBpZiBjdXN0b20geCBhbmQgY2F0ZWdvcml6ZWRcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmlzQ3VzdG9tWCgpICYmICQkLmlzQ2F0ZWdvcml6ZWQoKSAmJiBpbmRleCA9PT0gMCAmJiAhaXNVbmRlZmluZWQocmF3WCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA9PT0gMCAmJiBpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeF9jYXRlZ29yaWVzID0gW107XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB4ID0gY29uZmlnLmF4aXNfeF9jYXRlZ29yaWVzLmluZGV4T2YocmF3WCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoeCA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gY29uZmlnLmF4aXNfeF9jYXRlZ29yaWVzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuYXhpc194X2NhdGVnb3JpZXMucHVzaChyYXdYKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHggID0gJCQuZ2VuZXJhdGVUYXJnZXRYKHJhd1gsIGlkLCBpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBtYXJrIGFzIHggPSB1bmRlZmluZWQgaWYgdmFsdWUgaXMgdW5kZWZpbmVkIGFuZCBmaWx0ZXIgdG8gcmVtb3ZlIGFmdGVyIG1hcHBlZFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoZFtpZF0pIHx8ICQkLmRhdGEueHNbaWRdLmxlbmd0aCA8PSBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB4ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7eDogeCwgdmFsdWU6IHZhbHVlLCBpZDogY29udmVydGVkSWR9O1xuICAgICAgICAgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbiAodikgeyByZXR1cm4gaXNEZWZpbmVkKHYueCk7IH0pXG4gICAgICAgICAgICB9O1xuICAgICAgICB9KTtcblxuICAgICAgICAvLyBmaW5pc2ggdGFyZ2V0c1xuICAgICAgICB0YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgIHZhciBpO1xuICAgICAgICAgICAgLy8gc29ydCB2YWx1ZXMgYnkgaXRzIHhcbiAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV94U29ydCkge1xuICAgICAgICAgICAgICAgIHQudmFsdWVzID0gdC52YWx1ZXMuc29ydChmdW5jdGlvbiAodjEsIHYyKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4MSA9IHYxLnggfHwgdjEueCA9PT0gMCA/IHYxLnggOiBJbmZpbml0eSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHgyID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5cGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gY2FjaGUgYXMgb3JpZ2luYWwgaWQga2V5ZWRcbiAgICAgICAgdGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAkJC5hZGRDYWNoZShkLmlkX29yZywgZCk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiB0YXJnZXRzO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5sb2FkID0gZnVuY3Rpb24gKHRhcmdldHMsIGFyZ3MpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgaWYgKHRhcmdldHMpIHtcbiAgICAgICAgICAgIC8vIGZpbHRlciBsb2FkaW5nIHRhcmdldHMgaWYgbmVlZGVkXG4gICAgICAgICAgICBpZiAoYXJncy5maWx0ZXIpIHtcbiAgICAgICAgICAgICAgICB0YXJnZXRzID0gdGFyZ2V0cy5maWx0ZXIoYXJncy5maWx0ZXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gc2V0IHR5cGUgaWYgYXJncy50eXBlcyB8fCBhcmdzLnR5cGUgc3BlY2lmaWVkXG4gICAgICAgICAgICBpZiAoYXJncy50eXBlIHx8IGFyZ3MudHlwZXMpIHtcbiAgICAgICAgICAgICAgICB0YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHR5cGUgPSBhcmdzLnR5cGVzICYmIGFyZ3MudHlwZXNbdC5pZF0gPyBhcmdzLnR5cGVzW3QuaWRdIDogYXJncy50eXBlO1xuICAgICAgICAgICAgICAgICAgICAkJC5zZXRUYXJnZXRUeXBlKHQuaWQsIHR5cGUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVXBkYXRlL0FkZCBkYXRhXG4gICAgICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRW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AgICAgfVxuICAgICAgICBlbHNlIGlmIChhcmdzLnVybCkge1xuICAgICAgICAgICAgJCQuY29udmVydFVybFRvRGF0YShhcmdzLnVybCwgYXJncy5taW1lVHlwZSwgYXJncy5oZWFkZXJzLCBhcmdzLmtleXMsIGZ1bmN0aW9uIChkYXRhKSB7XG4gICAgICAgICAgICAgICAgJCQubG9hZCgkJC5jb252ZXJ0RGF0YVRvVGFyZ2V0cyhkYXRhKSwgYXJncyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChhcmdzLmpzb24pIHtcbiAgICAgICAgICAgICQkLmxvYWQoJCQuY29udmVydERhdGFUb1RhcmdldHMoJCQuY29udmVydEpzb25Ub0RhdGEoYXJncy5qc29uLCBhcmdzLmtleXMpKSwgYXJncyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoYXJncy5yb3dzKSB7XG4gICAgICAgICAgICAkJC5sb2FkKCQkLmNvbnZlcnREYXRhVG9UYXJnZXRzKCQkLmNvbnZlcnRSb3dzVG9EYXRhKGFyZ3Mucm93cykpLCBhcmdzKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChhcmdzLmNvbHVtbnMpIHtcbiAgICAgICAgICAgICQkLmxvYWQoJCQuY29udmVydERhdGFUb1RhcmdldHMoJCQuY29udmVydENvbHVtbnNUb0RhdGEoYXJncy5jb2x1bW5zKSksIGFyZ3MpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgJCQubG9hZChudWxsLCBhcmdzKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udW5sb2FkID0gZnVuY3Rpb24gKHRhcmdldElkcywgZG9uZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICBpZiAoIWRvbmUpIHtcbiAgICAgICAgICAgIGRvbmUgPSBmdW5jdGlvbiAoKSB7fTtcbiAgICAgICAgf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HVwZGF0ZSBzZWxlY3Rpb24gaWYgbnVsbFxuICAgICAgICBldmVudFJlY3RVcGRhdGUgPSBldmVudFJlY3RVcGRhdGUgfHwgJCQuZXZlbnRSZWN0LmRhdGEoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGQ7IH0pO1xuXG4gICAgICAgIGlmICgkJC5pc011bHRpcGxlWCgpKSB7XG4gICAgICAgICAgICAvLyBUT0RPOiByb3RhdGVkIG5vdCBzdXBwb3J0ZWQgeWV0XG4gICAgICAgICAgICB4ID0gMDtcbiAgICAgICAgICAgIHkgPSAwO1xuICAgICAgICAgICAgdyA9ICQkLndpZHRoO1xuICAgICAgICAgICAgaCA9ICQkLmhlaWdodDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmICgoJCQuaXNDdXN0b21YKCkgfHwgJCQuaXNUaW1lU2VyaWVzKCkpICYmICEkJC5pc0NhdGVnb3JpemVkKCkpIHtcblxuICAgICAgICAgICAgICAgIC8vIHVwZGF0ZSBpbmRleCBmb3IgeCB0aGF0IGlzIHVzZWQgYnkgcHJldlggYW5kIG5leHRYXG4gICAgICAgICAgICAgICAgJCQudXBkYXRlWHMoKTtcblxuICAgICAgICAgICAgICAgIHJlY3RXID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByZXZYID0gJCQuZ2V0UHJldlgoZC5pbmRleCksIG5leHRYID0gJCQuZ2V0TmV4dFgoZC5pbmRleCk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlcmUgdGhpcyBpcyBhIHNpbmdsZSBkYXRhIHBvaW50IG1ha2UgdGhlIGV2ZW50UmVjdCBmdWxsIHdpZHRoIChvciBoZWlnaHQpXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2WCA9PT0gbnVsbCAmJiBuZXh0WCA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC5oZWlnaHQgOiAkJC53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2WCA9PT0gbnVsbCkgeyBwcmV2WCA9ICQkLnguZG9tYWluKClbMF07IH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRYID09PSBudWxsKSB7IG5leHRYID0gJCQueC5kb21haW4oKVsxXTsgfVxuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBNYXRoLm1heCgwLCAoJCQueChuZXh0WCkgLSAkJC54KHByZXZYKSkgLyAyKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHJlY3RYID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByZXZYID0gJCQuZ2V0UHJldlgoZC5pbmRleCksIG5leHRYID0gJCQuZ2V0TmV4dFgoZC5pbmRleCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzWCA9ICQkLmRhdGEueHNbZC5pZF1bZC5pbmRleF07XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlcmUgdGhpcyBpcyBhIHNpbmdsZSBkYXRhIHBvaW50IHBvc2l0aW9uIHRoZSBldmVudFJlY3QgYXQgMFxuICAgICAgICAgICAgICAgICAgICBpZiAocHJldlggPT09IG51bGwgJiYgbmV4dFggPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsKSB7IHByZXZYID0gJCQueC5kb21haW4oKVswXTsgfVxuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoJCQueCh0aGlzWCkgKyAkJC54KHByZXZYKSkgLyAyO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlY3RXID0gJCQuZ2V0RXZlbnRSZWN0V2lkdGgoKTtcbiAgICAgICAgICAgICAgICByZWN0WCA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC54KGQueCkgLSAocmVjdFcgLyAyKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgeCA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogcmVjdFg7XG4gICAgICAgICAgICB5ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IHJlY3RYIDogMDtcbiAgICAgICAgICAgIHcgPSBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiByZWN0VztcbiAgICAgICAgICAgIGggPSBjb25maWcuYXhpc19yb3RhdGVkID8gcmVjdFcgOiAkJC5oZWlnaHQ7XG4gICAgICAgIH1cblxuICAgICAgICBldmVudFJlY3RVcGRhdGVcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICQkLmNsYXNzRXZlbnQuYmluZCgkJCkpXG4gICAgICAgICAgICAuYXR0cihcInhcIiwgeClcbiAgICAgICAgICAgIC5hdHRyKFwieVwiLCB5KVxuICAgICAgICAgICAgLmF0dHIoXCJ3aWR0aFwiLCB3KVxuICAgICAgICAgICAgLmF0dHIoXCJoZWlnaHRcIiwgaCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUV2ZW50UmVjdHNGb3JTaW5nbGVYID0gZnVuY3Rpb24gKGV2ZW50UmVjdEVudGVyKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGQzID0gJCQuZDMsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgZXZlbnRSZWN0RW50ZXIuYXBwZW5kKFwicmVjdFwiKVxuICAgICAgICAgICAgLmF0dHIoXCJjbGFzc1wiLCAkJC5jbGFzc0V2ZW50LmJpbmQoJCQpKVxuICAgICAgICAgICAgLnN0eWxlKFwiY3Vyc29yXCIsIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9lbmFibGVkICYmIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkID8gXCJwb2ludGVyXCIgOiBudWxsKVxuICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IGQuaW5kZXg7XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQuZHJhZ2dpbmcgfHwgJCQuZmxvd2luZykgeyByZXR1cm47IH0gLy8gZG8gbm90aGluZyB3aGlsZSBkcmFnZ2luZy9mbG93aW5nXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cblxuICAgICAgICAgICAgICAgIC8vIEV4cGFuZCBzaGFwZXMgZm9yIHNlbGVjdGlvblxuICAgICAgICAgICAgICAgIGlmIChjb25maWcucG9pbnRfZm9jdXNfZXhwYW5kX2VuYWJsZWQpIHsgJCQuZXhwYW5kQ2lyY2xlcyhpbmRleCwgbnVsbCwgdHJ1ZSk7IH1cbiAgICAgICAgICAgICAgICAkJC5leHBhbmRCYXJzKGluZGV4LCBudWxsLCB0cnVlKTtcblxuICAgICAgICAgICAgICAgIC8vIENhbGwgZXZlbnQgaGFuZGxlclxuICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgaW5kZXgpLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW92ZXIuY2FsbCgkJC5hcGksIGQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IGQuaW5kZXg7XG4gICAgICAgICAgICAgICAgaWYgKCEkJC5jb25maWcpIHsgcmV0dXJuOyB9IC8vIGNoYXJ0IGlzIGRlc3Ryb3llZFxuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgJCQuaGlkZVhHcmlkRm9jdXMoKTtcbiAgICAgICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgIC8vIFVuZG8gZXhwYW5kZWQgc2hhcGVzXG4gICAgICAgICAgICAgICAgJCQudW5leHBhbmRDaXJjbGVzKCk7XG4gICAgICAgICAgICAgICAgJCQudW5leHBhbmRCYXJzKCk7XG4gICAgICAgICAgICAgICAgLy8gQ2FsbCBldmVudCBoYW5kbGVyXG4gICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBpbmRleCkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9vbm1vdXNlb3V0LmNhbGwoJCQuYXBpLCBkKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNlbGVjdGVkRGF0YSwgaW5kZXggPSBkLmluZGV4LFxuICAgICAgICAgICAgICAgICAgICBldmVudFJlY3QgPSAkJC5zdmcuc2VsZWN0KCcuJyArIENMQVNTLmV2ZW50UmVjdCArICctJyArIGluZGV4KTtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5kcmFnZ2luZyB8fCAkJC5mbG93aW5nKSB7IHJldHVybjsgfSAvLyBkbyBub3RoaW5nIHdoaWxlIGRyYWdnaW5nL2Zsb3dpbmdcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzU3RlcFR5cGUoZCkgJiYgJCQuY29uZmlnLmxpbmVfc3RlcF90eXBlID09PSAnc3RlcC1hZnRlcicgJiYgZDMubW91c2UodGhpcylbMF0gPCAkJC54KCQkLmdldFhWYWx1ZShkLmlkLCBpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIGluZGV4IC09IDE7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gU2hvdyB0b29sdGlwXG4gICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRhID0gJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpLm1hcChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQuYWRkTmFtZSgkJC5nZXRWYWx1ZU9uSW5kZXgodC52YWx1ZXMsIGluZGV4KSk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5zaG93VG9vbHRpcChzZWxlY3RlZERhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAkJC5zaG93WEdyaWRGb2N1cyhzZWxlY3RlZERhdGEpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChjb25maWcudG9vbHRpcF9ncm91cGVkICYmICghY29uZmlnLmRhdGFfc2VsZWN0aW9uX2VuYWJsZWQgfHwgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIGluZGV4KVxuICAgICAgICAgICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZChDTEFTUy5FWFBBTkRFRCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2VuYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFJlY3Quc3R5bGUoJ2N1cnNvcicsIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkID8gJ3BvaW50ZXInIDogbnVsbCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy50b29sdGlwX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5oaWRlWEdyaWRGb2N1cygpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmhpZGVUb29sdGlwKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC51bmV4cGFuZENpcmNsZXMoaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC51bmV4cGFuZEJhcnMoaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLmlzV2l0aGluU2hhcGUodGhpcywgZCk7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2VuYWJsZWQgJiYgKGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkIHx8IGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9pc3NlbGVjdGFibGUoZCkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRSZWN0LnN0eWxlKCdjdXJzb3InLCAncG9pbnRlcicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoW2RdLCB0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5zaG93WEdyaWRGb2N1cyhbZF0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcucG9pbnRfZm9jdXNfZXhwYW5kX2VuYWJsZWQpIHsgJCQuZXhwYW5kQ2lyY2xlcyhpbmRleCwgZC5pZCwgdHJ1ZSk7IH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5leHBhbmRCYXJzKGluZGV4LCBkLmlkLCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdjbGljaycsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gZC5pbmRleDtcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpIHx8ICEkJC50b2dnbGVTaGFwZSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICBpZiAoJCQuY2FuY2VsQ2xpY2spIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuY2FuY2VsQ2xpY2sgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNTdGVwVHlwZShkKSAmJiBjb25maWcubGluZV9zdGVwX3R5cGUgPT09ICdzdGVwLWFmdGVyJyAmJiBkMy5tb3VzZSh0aGlzKVswXSA8ICQkLngoJCQuZ2V0WFZhbHVlKGQuaWQsIGluZGV4KSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5kZXggLT0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBpbmRleCkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgfHwgJCQuaXNXaXRoaW5TaGFwZSh0aGlzLCBkKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQudG9nZ2xlU2hhcGUodGhpcywgZCwgaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25jbGljay5jYWxsKCQkLmFwaSwgZCwgdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2FsbChcbiAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9zZWxlY3Rpb25fZHJhZ2dhYmxlICYmICQkLmRyYWcgPyAoXG4gICAgICAgICAgICAgICAgICAgIGQzLmJlaGF2aW9yLmRyYWcoKS5vcmlnaW4oT2JqZWN0KVxuICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnJywgZnVuY3Rpb24gKCkgeyAkJC5kcmFnKGQzLm1vdXNlKHRoaXMpKTsgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZ3N0YXJ0JywgZnVuY3Rpb24gKCkgeyAkJC5kcmFnc3RhcnQoZDMubW91c2UodGhpcykpOy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QgaXMgZGVzdHJveWVkXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICBtb3VzZW91dCgpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignbW91c2Vtb3ZlJywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciB0YXJnZXRzVG9TaG93ID0gJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpO1xuICAgICAgICAgICAgICAgIHZhciBtb3VzZSwgY2xvc2VzdCwgc2FtZVhEYXRhLCBzZWxlY3RlZERhdGE7XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQuZHJhZ2dpbmcpIHsgcmV0dXJuOyB9IC8vIGRvIG5vdGhpbmcgd2hlbiBkcmFnZ2luZ1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKHRhcmdldHNUb1Nob3cpKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgbW91c2UgPSBkMy5tb3VzZSh0aGlzKTtcbiAgICAgICAgICAgICAgICBjbG9zZXN0ID0gJCQuZmluZENsb3Nlc3RGcm9tVGFyZ2V0cyh0YXJnZXRzVG9TaG93LCBtb3VzZSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQubW91c2VvdmVyICYmICghY2xvc2VzdCB8fCBjbG9zZXN0LmlkICE9PSAkJC5tb3VzZW92ZXIuaWQpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX29ubW91c2VvdXQuY2FsbCgkJC5hcGksICQkLm1vdXNlb3Zlcik7XG4gICAgICAgICAgICAgICAgICAgICQkLm1vdXNlb3ZlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoISBjbG9zZXN0KSB7XG4gICAgICAgICAgICAgICAgICAgIG1vdXNlb3V0KCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNTY2F0dGVyVHlwZShjbG9zZXN0KSB8fCAhY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICBzYW1lWERhdGEgPSBbY2xvc2VzdF07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgc2FtZVhEYXRhID0gJCQuZmlsdGVyQnlYKHRhcmdldHNUb1Nob3csIGNsb3Nlc3QueCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gc2hvdyB0b29sdGlwIHdoZW4gY3Vyc29yIGlzIGNsb3NlIHRvIHNvbWUgcG9pbnRcbiAgICAgICAgICAgICAgICBzZWxlY3RlZERhdGEgPSBzYW1lWERhdGEubWFwKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5hZGROYW1lKGQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICQkLnNob3dUb29sdGlwKHNlbGVjdGVkRGF0YSwgdGhpcyk7XG5cbiAgICAgICAgICAgICAgICAvLyBleHBhbmQgcG9pbnRzXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5leHBhbmRDaXJjbGVzKGNsb3Nlc3QuaW5kZXgsIGNsb3Nlc3QuaWQsIHRydWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAkJC5leHBhbmRCYXJzKGNsb3Nlc3QuaW5kZXgsIGNsb3Nlc3QuaWQsIHRydWUpO1xuXG4gICAgICAgICAgICAgICAgLy8gU2hvdyB4Z3JpZCBmb2N1cyBsaW5lXG4gICAgICAgICAgICAgICAgJCQuc2hvd1hHcmlkRm9jdXM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NlKTtcbiAgICAgICAgICAgICAgICBpZiAoISBjbG9zZXN0KSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIC8vIHNlbGVjdCBpZiBzZWxlY3Rpb24gZW5hYmxlZFxuICAgICAgICAgICAgICAgIGlmICgkJC5pc0JhclR5cGUoY2xvc2VzdC5pZCkgfHwgJCQuZGlzdChjbG9zZXN0LCBtb3VzZSkgPCBjb25maWcucG9pbnRfc2Vuc2l0aXZpdHkpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGVzICsgJCQuZ2V0VGFyZ2V0U2VsZWN0b3JTdWZmaXgoY2xvc2VzdC5pZCkpLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIGNsb3Nlc3QuaW5kZXgpLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkIHx8ICQkLmlzV2l0aGluU2hhcGUodGhpcywgY2xvc2VzdCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC50b2dnbGVTaGFwZSh0aGlzLCBjbG9zZXN0LCBjbG9zZXN0LmluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbmNsaWNrLmNhbGwoJCQuYXBpLCBjbG9zZXN0LCB0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYWxsKFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9kcmFnZ2FibGUgJiYgJCQuZHJhZyA/IChcbiAgICAgICAgICAgICAgICAgICAgZDMuYmVoYXZpb3IuZHJhZygpLm9yaWdpbihPYmplY3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWcnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWcoZDMubW91c2UodGhpcykpOyB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnc3RhcnQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdzdGFydChkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdlbmQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdlbmQoKTsgfSlcbiAgICAgICAgICAgICAgICApIDogZnVuY3Rpb24gKCkge31cbiAgICAgICAgICAgICk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKHR5cGUsIGluZGV4LCBtb3VzZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgc2VsZWN0b3IgPSAnLicgKyBDTEFTUy5ldmVudFJlY3QgKyAoISQkLmlzTXVsdGlwbGVYKCkgPyAnLScgKyBpbmRleCA6ICcnKSxcbiAgICAgICAgICAgIGV2ZW50UmVjdCA9ICQkLm1haW4uc2VsZWN0KHNlbGVjdG9yKS5ub2RlKCksXG4gICAgICAgICAgICBib3ggPSBldmVudFJlY3QuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksXG4gICAgICAgICAgICB4ID0gYm94LmxlZnQgKyAobW91c2UgPyBtb3VzZVswXSA6IDApLFxuICAgICAgICAgICAgeSA9IGJveC50b3AgKyAobW91c2UgPyBtb3VzZVsxXSA6IDApLFxuICAgICAgICAgICAgZXZlbnQgPSBkb2N1bWVudC5jcmVhdGVFdmVudChcIk1vdXNlRXZlbnRzXCIpO1xuXG4gICAgICAgIGV2ZW50LmluaXRNb3VzZUV2ZW50KHR5cGUsIHRydWUsIHRydWUsIHdpbmRvdywgMCwgeCwgeSwgeCwgeSxcbiAgICAgICAgICAgICAgICAgICAg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ZuLmdldFBhcmVudFJlY3RWYWx1ZSA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgdmFyIHBhcmVudCA9IHRoaXMuc2VsZWN0Q2hhcnQubm9kZSgpLCB2O1xuICAgICAgICB3aGlsZSAocGFyZW50ICYmIHBhcmVudC50YWdOYW1lICE9PSAnQk9EWScpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdiA9IHBhcmVudC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKVtrZXldO1xuICAgICAgICAgICAgfSBjYXRjaChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGtleSA9PT0gJ3dpZHRoJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBJbiBJRSBpbiBjZXJ0YWluIGNhc2VzIGdldEJvdW5kaW5nQ2xpZW50UmVjdFxuICAgICAgICAgICAgICAgICAgICAvLyB3aWxsIGNhdXNlIGFuIFwidW5zcGVjaWZpZWQgZXJyb3JcIlxuICAgICAgICAgICAgICAgICAgICB2ID0gcGFyZW50Lm9mZnNldFdpZHRoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh2KSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwYXJlbnQgPSBwYXJlbnQucGFyZW50Tm9kZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdjtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFBhcmVudFdpZHRoID0gZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5nZXRQYXJlbnRSZWN0VmFsdWUoJ3dpZHRoJyk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRQYXJlbnRIZWlnaHQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBoID0gdGhpcy5zZWxlY3RDaGFydC5zdHlsZSg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hpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgaW5kaWNlcyA9IHt9LCBpID0gMCwgaiwgaztcbiAgICAgICAgJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMuZmlsdGVyKHR5cGVGaWx0ZXIsICQkKSkuZm9yRWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGNvbmZpZy5kYXRhX2dyb3Vwcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9ncm91cHNbal0uaW5kZXhPZihkLmlkKSA8IDApIHsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgY29uZmlnLmRhdGFfZ3JvdXBzW2pdLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9ncm91cHNbal1ba10gaW4gaW5kaWNlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5kaWNlc1tkLmlkXSA9IGluZGljZXNbY29uZmlnLmRhdGFfZ3JvdXBzW2pdW2tdXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGluZGljZXNbZC5pZF0pKSB7IGluZGljZXNbZC5pZF0gPSBpKys7IH1cbiAgICAgICAgfSk7XG4gICAgICAgIGluZGljZXMuX19tYXhfXyA9IGkgLSAxO1xuICAgICAgICByZXR1cm4gaW5kaWNlcztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFNoYXBlWCA9IGZ1bmN0aW9uIChvZmZzZXQsIHRhcmdldHNOdW0sIGluZGljZXMsIGlzU3ViKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIHNj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Y2FsZShkLmlkKSA6ICQkLmdldFlTY2FsZShkLmlkKSxcbiAgICAgICAgICAgICAgICB5MCA9IHNjYWxlKDApLCBvZmZzZXQgPSB5MDtcbiAgICAgICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgIHZhciB2YWx1ZXMgPSAkJC5pc1N0ZXBUeXBlKGQpID8gJCQuY29udmVydFZhbHVlc1RvU3RlcCh0LnZhbHVlcykgOiB0LnZhbHVlcztcbiAgICAgICAgICAgICAgICBpZiAodC5pZCA9PT0gZC5pZCB8fCBpbmRpY2VzW3QuaWRdICE9PSBpbmRpY2VzW2QuaWRdKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIGlmICh0YXJnZXRJZHMuaW5kZXhPZih0LmlkKSA8IHRhcmdldElkcy5pbmRleE9mKGQuaWQpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSB4IHZhbHVlcyBsaW5lIHVwXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWVzW2ldID09PSAndW5kZWZpbmVkJyB8fCArdmFsdWVzW2ldLnggIT09ICtkLngpIHsgIC8vIFwiK1wiIGZvciB0aW1lc2VyaWVzXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiBub3QsIHRyeSB0byBmaW5kIHRoZSB2YWx1ZSB0aGF0IGRvZXMgbGluZSB1cFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHYsIGopIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodi54ID09PSBkLngpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgI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oZCkgeyByZXR1cm4gZC52YWx1ZSAhPSBudWxsOyB9KTsgfVxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIHZhciB2YWx1ZXMgPSBjb25maWcubGluZV9jb25uZWN0TnVsbCA/ICQkLmZpbHRlclJlbW92ZU51bGwoZC52YWx1ZXMpIDogZC52YWx1ZXMsXG4gICAgICAgICAgICAgICAgeCA9IGlzU3ViID8gJCQueCA6ICQkLnN1YlgsIHkgPSB5U2NhbGVHZXR0ZXIuY2FsbCgkJCwgZC5pZCksIHgwID0gMCwgeTAgPSAwLCBwYXRoO1xuICAgICAgICAgICAgaWYgKCQkLmlzTGluZVR5cGUoZCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfcmVnaW9uc1tkLmlkXSkge1xuICAgICAgICAgICAgICAgICAgICBwYXRoID0gJCQubGluZVdpdGhSZWdpb25zKHZhbHVlcywgeCwgeSwgY29uZmlnLmRhdGFfcmVnaW9uc1tkLmlkXSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmlzU3RlcFR5cGUoZCkpIHsgdmFsdWVzID0gJCQuY29udmVydFZhbHVlc1RvU3RlcCh2YWx1ZXMpOyB9XG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSBsaW5lLmludGVycG9sYXRlKCQkLmdldEludGVycG9sYXRlKGQpKSh2YWx1ZXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlc1swXSkge1xuICAgICAgICAgICAgICAgICAgICB4MCA9IHgodmFsdWVzWzBdLngpO1xuICAgICAgICAgICAgICAgICAgICB5MCA9IHkodmFsdWVzWzBdLnZhbHVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcGF0aCA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyBcIk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ICQkLmlzQ2F0ZWdvcml6ZWQoKSA/IDAuNSA6IDAsXG4gICAgICAgICAgICB4VmFsdWUsIHlWYWx1ZSxcbiAgICAgICAgICAgIHJlZ2lvbnMgPSBbXTtcblxuICAgICAgICBmdW5jdGlvbiBpc1dpdGhpblJlZ2lvbnMoeCwgcmVnaW9ucykge1xuICAgICAgICAgICAgdmFyIGk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcmVnaW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChyZWdpb25zW2ldLnN0YXJ0IDwgeCAmJiB4IDw9IHJlZ2lvbnNbaV0uZW5kKSB7IHJldHVybiB0cnVlOyB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBDaGVjayBzdGFydC9lbmQgb2YgcmVnaW9uc1xuICAgICAgICBpZiAoaXNEZWZpbmVkKF9yZWdpb25zKSkge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IF9yZWdpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgcmVnaW9uc1tpXSA9IHt9O1xuICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChfcmVnaW9uc1tpXS5zdGFydCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVnaW9uc1tpXS5zdGFydCA9IGRbMF0ueDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZWdpb25zW2ldLnN0YXJ0ID0gJCQuaXNUaW1lU2VyaWVzKCkgPyAkJC5wYXJzZURhdGUoX3JlZ2lvbnNbaV0uc3RhcnQpIDogX3JlZ2lvbnNbaV0uc3RhcnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChfcmVnaW9uc1tpXS5lbmQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlZ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gIHh2MCA9IG5ldyBEYXRlKHgwICsgeF9kaWZmICogaiksXG4gICAgICAgICAgICAgICAgICAgIHh2MSA9IG5ldyBEYXRlKHgwICsgeF9kaWZmICogKGogKyBkaWZmKSksXG4gICAgICAgICAgICAgICAgICAgIHBvaW50cztcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBwb2ludHMgPSBbW3koeXAoaikpLCB4KHh2MCldLCBbeSh5cChqICsgZGlmZikpLCB4KHh2MSldXTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwb2ludHMgPSBbW3goeHYwKSwgeSh5cChqKSldLCBbeCh4djEpLCB5KHlwKGogKyBkaWZmKSldXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdlbmVyYXRlTShwb2ludHMpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNXaXRoUmVnaW9uID0gZnVuY3Rpb24gKGQwLCBkMSwgaiwgZGlmZikge1xuICAgICAgICAgICAgICAgIHZhciBwb2ludHM7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5heGlzX3JvdGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzID0gW1t5KHlwKGopLCB0cnVlKSwgeCh4cChqKSldLCBbeSh5cChqICsgZGlmZiksIHRydWUpLCB4KHhwKGogKyBkaWZmKSldXTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwb2ludHMgPSBbW3goeHAoaiksIHRydWUpLCB5KHlwKGopKV0sIFt4KHhwKGogKyBkaWZmKSwgdHJ1ZSksIHkoeXAoaiArIGRpZmYpKV1dO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZ2VuZXJhdGVNKHBvaW50cyk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gR2VuZXJhdGVcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGQubGVuZ3RoOyBpKyspIHtcblxuICAgICAgICAgICAgLy8gRHJhdyBhcyBub3JtYWxcbiAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChyZWdpb25zKSB8fCAhIGlzV2l0aGluUmVnaW9ucyhkW2ldLngsIHJlZ2lvbnMpKSB7XG4gICAgICAgICAgICAgICAgcyArPSBcIiBcIiArIHhWYWx1ZShkW2ldKSArIFwiIFwiICsgeVZhbHVlKGRbaV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gRHJhdyB3aXRoIHJlZ2lvbiAvLyBUT0RPOiBGaXggZm9yIGhvcml6b3RhbCBjaGFydHNcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHhwID0gJCQuZ2V0U2NhbGUoZFtpIC0gMV0ueCArIHhPZmZzZXQsIGRbaV0ueCArIHhPZmZzZXQsICQkLmlzVGltZVNlcmllcygpKTtcbiAgICAgICAgICAgICAgICB5cCA9ICQkLmdldFNjYWxlKGRbaSAtIDFdLnZhbHVlLCBkW2ldLnZhbHVlKTtcblxuICAgICAgICAgICAgICAgIGR4ID0geChkW2ldLngpIC0geChkW2kgLSAxXS54KTtcbiAgICAgICAgICAgICAgICBkeSA9IHkoZFtpXS52YWx1ZSkgLSB5KGRbaSAtIDFdLnZhbHVlKTtcbiAgICAgICAgICAgICAgICBkZCA9IE1hdGguc3FydChNYXRoLnBvdyhkeCwgMikgKyBNYXRoLnBvdyhkeSwgMikpO1xuICAgICAgICAgICAgICAgIGRpZmYgPSAyIC8gZGQ7XG4gICAgICAgICAgICAgICAgZGlmZngyID0gZGlmZiAqIDI7XG5cbiAgICAgICAgICAgICAgICBmb3IgKGogPSBkaWZmOyBqIDw9IDE7IGogKz0gZGlmZngyKSB7XG4gICAgICAgICAgICAgICAgICAgIHMgKz0gc1dpdGh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XG4gICAgICAgICAgICAvLyBzd2l0Y2ggcG9pbnRzIGlmIGF4aXMgaXMgcm90YXRlZCwgbm90IGFwcGxpY2FibGUgZm9yIHN1YiBjaGFydFxuICAgICAgICAgICAgdmFyIGluZGV4WCA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAxIDogMDtcbiAgICAgICAgICAgIHZhciBpbmRleFkgPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IDE7XG5cbiAgICAgICAgICAgIHZhciBwYXRoID0gJ00gJyArIHBvaW50c1swXVtpbmRleFhdICsgJywnICsgcG9pbnRzWzBdW2luZGV4WV0gKyAnICcgK1xuICAgICAgICAgICAgICAgICAgICAnTCcgKyBwb2ludHNbMV1baW5kZXhYXSArICcsJyArIHBvaW50c1sxXVtpbmRleFldICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgJ0wnICsgcG9pbnRzWzJdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbMl1baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICdMJyArIHBvaW50c1szXVtpbmRleFhdICsgJywnICsgcG9pbnRzWzNdW2luZGV4WV0gKyAnICcgK1xuICAgICAgICAgICAgICAgICAgICAneic7XG5cbiAgICAgICAgICAgIHJldHVybiBwYXRoO1xuICAgICAgICB9O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2VuZXJhdGVHZXRCYXJQb2ludHMgPSBmdW5jdGlvbiAoYmFySW5kaWNlcywgaXNTdWIpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIGF4aXMgPSBpc1N1YiA/ICQkLnN1YlhBeGlzIDogJCQueEF4aXMsXG4gICAgICAgICAgICBiYXJUYXJnZXRzTnVtID0gYmFySW5kaWNlcy5fX21heF9fICsgMSxcbiAgICAgICAgICAgIGJhclcgPSAkJC5nZXRCYXJXKGF4aXMsIGJhclRhcmdldHNOdW0pLFxuICAgICAgICAgICAgYmFyWCA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gICAgICB4UG9zID0gNDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geFBvcztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFlGb3JUZXh0ID0gZnVuY3Rpb24gKHBvaW50cywgZCwgdGV4dEVsZW1lbnQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIGJveCA9IHRleHRFbGVtZW50LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLFxuICAgICAgICAgICAgeVBvcztcbiAgICAgICAgaWYgKCQkLmNvbmZpZy5heGlzX3JvdGF0ZWQpIHtcbiAgICAgICAgICAgIHlQb3MgPSAocG9pbnRzWzBdWzBdICsgcG9pbnRzWzJdWzBdICsgYm94LmhlaWdodCAqIDAuNikgLyAyO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeVBvcyA9IHBvaW50c1syXVsxXTtcbiAgICAgICAgICAgIGlmIChkLnZhbHVlIDwgMCAgfHwgKGQudmFsdWUgPT09IDAgJiYgISQkLmhhc1Bvc2l0aXZlVmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgeVBvcyArPSBib3guaGVpZ2h0O1xuICAgICAgICAgICAgICAgIGlmICgkJC5pc0JhclR5cGUoZCkgJiYgJCQuaXNTYWZhcmkoKSkge1xuICAgICAgICAgICAgICAgICAgICB5UG9zIC09IDM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKCEkJC5pc0JhclR5cGUoZCkgJiYgJCQuaXNDaHJvbWUoKSkge1xuICAgICAgICAgICAgICAgICAgICB5UG9zICs9IDM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB5UG9zICs9ICQkLmlzQmFyVHlwZShkKSA/IC0zIDogLTY7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gc2hvdyBsYWJlbHMgcmVnYXJkbGVzcyBvZiB0aGUgZG9tYWluIGlmIHZhbHVlIGlzIG51bGxcbiAgICAgICAgaWYgKGQudmFsdWUgPT09IG51bGwgJiYgISQkLmNvbmZpZy5heGlzX3JvdGF0ZWQpIHtcbiAgICAgICAgICAgIGlmICh5UG9zIDwgYm94LmhlaWdodCkge1xuICAgICAgICAgICAgICAgIHlQb3MgPSBib3guaGVpZ2h0O1xuICAgICAgICAgICAgfSBlbHNlIGlmICh5UG9zID4gdGhpcy5oZWlnaHQpIHtcbiAgICAgICAgICAgICAgICB5UG9zID0gdGhpcy5oZWlnaHQgLSA0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB5UG9zO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5zZXRUYXJnZXRUeXBlID0gZnVuY3Rpb24gKHRhcmdldElkcywgdHlwZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgICQkLm1hcFRvVGFyZ2V0SWRzKHRhcmdldElkcykuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICQkLndpdGhvdXRGYWRlSW5baWRdID0gKHR5cGUgPT09IGNvbmZpZy5kYXRhX3R5cGVzW2lkXSk7XG4gICAgICAgICAgICBjb25maWcuZGF0YV90eXBlc1tpZF0gPSB0eXBlO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKCF0YXJnZXRJZHMpIHtcbiAgICAgICAgICAgIGNvbmZpZy5kYXRhX3R5cGUgPSB0eXBlO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5oYXNUeXBlID0gZnVuY3Rpb24gKHR5cGUsIHRhcmdldHMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgdHlwZXMgPSAkJC5jb25maWcuZGF0YV90eXBlcywgaGFzID0gZmFsc2U7XG4gICAgICA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lkX3hfdHlwZSwgJCQueCksXG4gICAgICAgICAgICB0aWNrT2Zmc2V0ID0gJCQuaXNDYXRlZ29yaXplZCgpID8gJCQueEF4aXMudGlja09mZnNldCgpIDogMDtcblxuICAgICAgICAkJC54Z3JpZEF0dHIgPSBjb25maWcuYXhpc19yb3RhdGVkID8ge1xuICAgICAgICAgICAgJ3gxJzogMCxcbiAgICAgICAgICAgICd4Mic6ICQkLndpZHRoLFxuICAgICAgICAgICAgJ3kxJzogZnVuY3Rpb24gKGQpIHsgcmV0dXJuICQkLngoZCkgLSB0aWNrT2Zmc2V0OyB9LFxuICAgICAgICAgICAgJ3kyJzogZnVuY3Rpb24gKGQpIHsgcmV0dXJuICQkLngoZCkgLSB0aWNrT2Zmc2V0OyB9XG4gICAgICAgIH0gOiB7XG4gICAgICAgICAgICAneDEnOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4gJCQueChkKSArIHRpY2tPZmZzZXQ7IH0sXG4gICAgICAgICAgICAneDInOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4gJCQueChkKSArIHRpY2tPZmZzZXQ7IH0sXG4gICAgICAgICAgICAneTEnOiAwLFxuICAgICAgICAgICAgJ3kyJzogJCQuaGVpZ2h0XG4gICAgICAgIH07XG5cbiAgICAgICAgJCQueGdyaWQgPSAkJC5tYWluLnNlbGVjdCgnLicgKyBDTEFTUy54Z3JpZHMpLnNlbGVjdEFsbCgnLicgKyBDTEFTUy54Z3JpZClcbiAgICAgICAgICAgIC5kYXRhKHhncmlkRGF0YSk7XG4gICAgICAgICQkLnhncmlkLmVudGVyKCkuYXBwZW5kKCdsaW5lJykuYXR0cihcImNsYXNzXCIsIENMQVNTLnhncmlkKTtcbiAgICAgICAgaWYgKCF3aXRob3V0VXBkYXRlKSB7XG4gICAgICAgICAgICAkJC54Z3JpZC5hdHRyKCQkLnhncmlkQXR0cilcbiAgICAgICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIGZ1bmN0aW9uICgpIHsgcmV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ZXh0LWFuY2hvclwiLCAkJC5ncmlkVGV4dEFuY2hvcilcbiAgICAgICAgICAgIC5hdHRyKFwidHJhbnNmb3JtXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyBcInJvdGF0ZSgtOTApXCIgOiBcIlwiKVxuICAgICAgICAgICAgLmF0dHIoJ2R4JywgJCQuZ3JpZFRleHREeClcbiAgICAgICAgICAgIC5hdHRyKCdkeScsIC01KVxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAwKTtcbiAgICAgICAgLy8gdXBkYXRlXG4gICAgICAgIHl2ID0gJCQueXYuYmluZCgkJCk7XG4gICAgICAgICQkLnlncmlkTGluZXMuc2VsZWN0KCdsaW5lJylcbiAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKGR1cmF0aW9uKVxuICAgICAgICAgICAgLmF0dHIoXCJ4MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8geXYgOiAwKVxuICAgICAgICAgICAgLmF0dHIoXCJ4MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8geXYgOiAkJC53aWR0aClcbiAgICAgICAgICAgIC5hdHRyKFwieTFcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiB5dilcbiAgICAgICAgICAgIC5hdHRyKFwieTJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmhlaWdodCA6IHl2KVxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAxKTtcbiAgICAgICAgJCQueWdyaWRMaW5lcy5zZWxlY3QoJ3RleHQnKVxuICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pXG4gICAgICAgICAgICAuYXR0cihcInhcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLnhHcmlkVGV4dFguYmluZCgkJCkgOiAkJC55R3JpZFRleHRYLmJpbmQoJCQpKVxuICAgICAgICAgICAgLmF0dHIoXCJ5XCIsIHl2KVxuICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGQudGV4dDsgfSlcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMSk7XG4gICAgICAgIC8vIGV4aXRcbiAgICAgICAgJCQueWdyaWRMaW5lcy5leGl0KCkudHJhbnNpdGlvbigpLmR1cmF0aW9uKGR1cmF0aW9uKVxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAwKVxuICAgICAgICAgICAgLnJlbW92ZSgpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucmVkcmF3R3JpZCA9IGZ1bmN0aW9uICh3aXRoVHJhbnNpdGlvbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIHh2ID0gJCQueHYuYmluZCgkJCksXG4gICAgICAgICAgICBsaW5lcyA9ICQkLnhncmlkTGluZXMuc2VsZWN0KCdsaW5lJyksXG4gICAgICAgICAgICB0ZXh0cyA9ICQkLnhncmlkTGluZXMuc2VsZWN0KCd0ZXh0Jyk7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAod2l0aFRyYW5zaXRpb24gPyBsaW5lcy50cmFuc2l0aW9uKCkgOiBsaW5lcylcbiAgICAgICAgICAgICAgICAuYXR0cihcIngxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogeHYpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ4MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiB4dilcbiAgICAgICAgICAgICAgICAuYXR0cihcInkxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB4diA6IDApXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ5MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8geHYgOiAkJC5oZWlnaHQpXG4gICAgICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAxKSxcbiAgICAgIC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lvbiAodHlwZSwgc2NhbGUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIGdyaWREYXRhID0gW10sIHhEb21haW4sIGZpcnN0WWVhciwgbGFzdFllYXIsIGksXG4gICAgICAgICAgICB0aWNrTnVtID0gJCQubWFpbi5zZWxlY3QoXCIuXCIgKyBDTEFTUy5heGlzWCkuc2VsZWN0QWxsKCcudGljaycpLnNpemUoKTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICd5ZWFyJykge1xuICAgICAgICAgICAgeERvbWFpbiA9ICQkLmdldFhEb21haW4oKTtcbiAgICAgICAgICAgIGZpcnN0WWVhciA9IHhEb21haW5bMF0uZ2V0RnVsbFllYXIoKTtcbiAgICAgICAgICAgIGxhc3RZZWFyID0geERvbWFpblsxXS5nZXRGdWxsWWVhcigpO1xuICAgICAgICAgICAgZm9yIChpID0gZmlyc3RZZWFyOyBpIDw9IGxhc3RZZWFyOyBpKyspIHtcbiAgICAgICAgICAgICAgICBncmlkRGF0YS5wdXNoKG5ldyBEYXRlKGkgKyAnLTAxLTAxIDAwOjAwOjAwJykpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZ3JpZERhdGEgPSBzY2FsZS50aWNrcygxMCk7XG4gICAgICAgICAgICBpZiAoZ3JpZERhdGEubGVuZ3RoID4gdGlja051bSkgeyAvLyB1c2Ugb25seSBpbnRcbiAgICAgICAgICAgICAgICBncmlkRGF0YSA9IGdyaWREYXRhLmZpbHRlcihmdW5jdGlvbiAoZCkgeyByZXR1cm4gKFwiXCIgKyBkKS5pbmRleE9mKCcuJykgPCAwOyB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZ3JpZERhdGE7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRHcmlkRmlsdGVyVG9SZW1vdmUgPSBmdW5jdGlvbiAocGFyYW1zKSB7XG4gICAgIC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NsYXNzTGluZSkuZmlsdGVyKHRvUmVtb3ZlKVxuICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihjb25maWcudHJhbnNpdGlvbl9kdXJhdGlvbilcbiAgICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDApLnJlbW92ZSgpO1xuICAgICAgICBpZiAoZm9yWCkge1xuICAgICAgICAgICAgY29uZmlnLmdyaWRfeF9saW5lcyA9IGNvbmZpZy5ncmlkX3hfbGluZXMuZmlsdGVyKHRvU2hvdyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb25maWcuZ3JpZF95X2xpbmVzID0gY29uZmlnLmdyaWRfeV9saW5lcy5maWx0ZXIodG9TaG93KTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pbml0VG9vbHRpcCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCBpO1xuICAgICAgICAkJC50b29sdGlwID0gJCQuc2VsZWN0Q2hhcnRcbiAgICAgICAgICAgIC5zdHlsZShcInBvc2l0aW9uXCIsIFwicmVsYXRpdmVcIilcbiAgICAgICAgICAuYXBwZW5kKFwiZGl2XCIpXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCBDTEFTUy50b29sdGlwQ29udGFpbmVyKVxuICAgICAgICAgICAgLnN0eWxlKFwicG9zaXRpb25cIiwgXCJhYnNvbHV0ZVwiKVxuICAgICAgICAgICAgLnN0eWxlKFwicG9pbnRlci1ldmVudHNcIiwgXCJub25lXCIpXG4gICAgICAgICAgICAuc3R5bGUoXCJkaXNwbGF5XCIsIFwibm9uZVwiKTtcbiAgICAgICAgLy8gU2hvdyB0b29sdGlwIGlmIG5lZWRlZFxuICAgICAgICBpZiAoY29uZmlnLnRvb2x0aXBfaW5pdF9zaG93KSB7XG4gICAgICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkgJiYgaXNTdHJpbmcoY29uZmlnLnRvb2x0aXBfaW5pdF94KSkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy50b29sdGlwX2luaXRfeCA9ICQkLnBhcnNlRGF0ZShjb25maWcudG9vbHRpcF9pbml0X3gpO1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlc1tpXS54IC0gY29uZmlnLnRvb2x0aXBfaW5pdF94KSA9PT0gMCkgeyBicmVhazsgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25maWcudG9vbHRpcF9pbml0X3ggPSBpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgJCQudG9vbHRpcC5odG1sKGNvbmZpZy50b29sdGlwX2NvbnRlbnRzLmNhbGwoJCQsICQkLmRhdGEudGFyZ2V0cy5tYXAoZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJCQuYWRkTmFtZShkLnZhbHVlc1tjb25maWcudG9vbHRpcF9pbml0X3hdKTtcbiAgICAgICAgICAgIH0pLCAkJC5heGlzLmdldFhBeGlzVGlja0Zvcm1hdCgpLCAkJC5nZXRZRm9ybWF0KCQkLmhhc0FyY1R5cGUoKSksICQkLmNvbG9yKSk7XG4gICAgICAgICAgICAkJC50b29sdGlwLnN0eWxlKFwidG9wXCIsIGNvbmZpZy50b29sdGlwX2luaXRfcG9zaXRpb24udG9wKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcImxlZnRcIiwgY29uZmlnLnRvb2x0aXBfaW5pdF9wb3NpdGlvbi5sZWZ0KVxuICAgICAgICAgICAgICAgIC5zdHlsZShcImRpc3BsYXlcIiwgXCJibG9ja1wiKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhc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lkO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBkLnNvcnQoZnVuY3Rpb24oYSwgYikge1xuICAgICAgICAgICAgICAgIHZhciB2MSA9IGEgPyBhLnZhbHVlIDogbnVsbCwgdjIgPSBiID8gYi52YWx1ZSA6IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKHYxID4gMCAmJiB2MiA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdjEgPSBhID8gaWRzLmluZGV4T2YoYS5pZCkgOiBudWxsO1xuICAgICAgICAgICAgICAgICAgICB2MiA9IGIgPyBpZHMuaW5kZXhPZihiLmlkKSA6IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBvcmRlckFzYyA/IHYxIC0gdjIgOiB2MiAtIHYxO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKCEgKGRbaV0gJiYgKGRbaV0udmFsdWUgfHwgZFtpXS52YWx1ZSA9PT0gMCkpKSB7IGNvbnRpbnVlOyB9XG5cbiAgICAgICAgICAgIGlmICghIHRleHQpIHtcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHNhbml0aXNlKHRpdGxlRm9ybWF0ID8gdGl0bGVGb3JtYXQoZFtpXS54KSA6IGRbaV0ueCk7XG4gICAgICAgICAgICAgICAgdGV4dCA9IFwiPHRhYmxlIGNsYXNzPSdcIiArICQkLkNMQVNTLnRvb2x0aXAgKyBcIic+XCIgKyAodGl0bGUgfHwgdGl0bGUgPT09IDAgPyBcIjx0cj48dGggY29sc3Bhbj0nMic+XCIgKyB0aXRsZSArIFwiPC90aD48L3RyPlwiIDogXCJcIik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhbHVlID0gc2FuaXRpc2UodmFsdWVGb3JtYXQoZFtpXS52YWx1ZSwgZFtpXS5yYXRpbywgZFtpX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bUhlaWdodCA6IGl0ZW1XaWR0aCxcbiAgICAgICAgICAgICAgICBhcmVhTGVuZ3RoID0gJCQuaXNMZWdlbmRSaWdodCB8fCAkJC5pc0xlZ2VuZEluc2V0ID8gJCQuZ2V0TGVnZW5kSGVpZ2h0KCkgOiAkJC5nZXRMZWdlbmRXaWR0aCgpLFxuICAgICAgICAgICAgICAgIG1hcmdpbiwgbWF4TGVuZ3RoO1xuXG4gICAgICAgICAgICAvLyBNRU1POiBjYXJlIGFib3V0IGNvbmRpZmlvbiBvZiBzdGVwLCB0b3RhbExlbmd0aFxuICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlVmFsdWVzKGlkLCB3aXRob3V0U3RlcCkge1xuICAgICAgICAgICAgICAgIGlmICghd2l0aG91dFN0ZXApIHtcbiAgICAgICAgICAgICAgICAgICAgbWFyZ2luID0gKGFyZWFMZW5ndGggLSB0b3RhbExlbmd0aCAtIGl0ZW1MZW5ndGgpIC8gMjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcmdpbiA8IHBvc01pbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luID0gKGFyZWFMZW5ndGggLSBpdGVtTGVuZ3RoKSAvIDI7XG4gICAgICAgICAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdGVwKys7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3RlcHNbaWRdID0gc3RlcDtcbiAgICAgICAgICAgICAgICBtYXJnaW5zW3N0ZXBdID0gJCQuaXNMZWdlbmRJbnNldCA/IDEwIDogbWFyZ2luO1xuICAgICAgICAgICAgICAgIG9mZnNldHNbaWRdID0gdG90YWxMZW5ndGg7XG4gICAgICAgICAgICAgICAgdG90YWxMZW5ndGggKz0gaXRlbUxlbmd0aDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHJlc2V0KSB7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uYWx0S2V5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5hcGkuaGlkZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuYXBpLnNob3coaWQpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuYXBpLnRvZ2dsZShpZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5pc1RhcmdldFRvU2hvdyhpZCkgPyAkJC5hcGkuZm9jdXMoaWQpIDogJCQuYXBpLnJldmVydCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5sZWdlbmRfaXRlbV9vbm1vdXNlb3Zlcikge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcubGVnZW5kX2l0ZW1fb25tb3VzZW92ZXIuY2FsbCgkJCwgaWQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZDMuc2VsZWN0KHRoaXMpLmNsYXNzZWQoQ0xBU1MubGVnZW5kSXRlbUZvY3VzZWQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISQkLnRyYW5zaXRpbmcgJiYgJCQuaXNUYXJnZXRUb1Nob3coaWQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5hcGkuZm9jdXMoaWQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmxlZ2VuZF9pdGVtX29ubW91c2VvdXQpIHtcbiAgICAgICAgICAgIC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AgICAgaXNDYXRlZ29yeTogJCQuaXNDYXRlZ29yaXplZCgpLFxuICAgICAgICAgICAgICAgIHdpdGhPdXRlclRpY2s6IHdpdGhPdXRlclRpY2ssXG4gICAgICAgICAgICAgICAgdGlja011bHRpbGluZTogY29uZmlnLmF4aXNfeF90aWNrX211bHRpbGluZSxcbiAgICAgICAgICAgICAgICB0aWNrV2lkdGg6IGNvbmZpZy5heGlzX3hfdGlja193aWR0aCxcbiAgICAgICAgICAgICAgICB0aWNrVGV4dFJvdGF0ZTogd2l0aG91dFJvdGF0ZVRpY2tUZXh0ID8gMCA6IGNvbmZpZy5heGlzX3hfdGlja19yb3RhdGUsXG4gICAgICAgICAgICAgICAgd2l0aG91dFRyYW5zaXRpb246IHdpdGhvdXRUcmFuc2l0aW9uLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGF4aXMgPSBjM19heGlzKCQkLmQzLCBheGlzUGFyYW1zKS5zY2FsZShzY2FsZSkub3JpZW50KG9yaWVudCk7XG5cbiAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpICYmIHRpY2tWYWx1ZXMgJiYgdHlwZW9mIHRpY2tWYWx1ZXMgIT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgdGlja1ZhbHVlcyA9IHRpY2tWYWx1ZXMubWFwKGZ1bmN0aW9uICh2KSB7IHJldHVybiAkJC5wYXJzZURhdGUodik7IH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2V0IHRpY2tcbiAgICAgICAgYXhpcy50aWNrRm9ybWF0KHRpY2tGb3JtYXQpLnRpY2tWYWx1ZXModGlja1ZhbHVlcyk7XG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIGF4aXMudGlja0NlbnRlcmVkKGNvbmZpZy5heGlzX3hfdGlja19jZW50ZXJlZCk7XG4gICAgICAgICAgICBpZiAoaXNFbXB0eShjb25maWcuYXhpc194X3RpY2tfY3VsbGluZykpIH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1xuICAgICAgICAgICAgb3B0aW9uID0gY29uZmlnLmF4aXNfeTJfbGFiZWw7XG4gICAgICAgIH0gZWxzZSBpZiAoYXhpc0lkID09PSAneCcpIHtcbiAgICAgICAgICAgIG9wdGlvbiA9IGNvbmZpZy5heGlzX3hfbGFiZWw7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG9wdGlvbjtcbiAgICB9O1xuICAgIEF4aXMucHJvdG90eXBlLmdldExhYmVsVGV4dCA9IGZ1bmN0aW9uIGdldExhYmVsVGV4dChheGlzSWQpIHtcbiAgICAgICAgdmFyIG9wdGlvbiA9IHRoaXMuZ2V0TGFiZWxPcHRpb25CeUF4aXNJZChheGlzSWQpO1xuICAgICAgICByZXR1cm4gaXNTdHJpbmcob3B0aW9uKSA/IG9wdGlvbiA6IG9wdGlvbiA/IG9wdGlvbi50ZXh0IDogbnVsbDtcbiAgICB9O1xuICAgIEF4aXMucHJvdG90eXBlLnNldExhYmVsVGV4dCA9IGZ1bmN0aW9uIHNldExhYmVsVGV4dChheGlzSWQsIHRleHQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5vd25lciwgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgb3B0aW9uID0gdGhpcy5nZXRMYWJlbE9wdGlvbkJ5QXhpc0lkKGF4aXNJZCk7XG4gICAgICAgIGlmIChpc1N0cmluZyhvcHRpb24pKSB7XG4gICAgICAgICAgICBpZiAoYXhpc0lkID09PSAneScpIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc195X2xhYmVsID0gdGV4dDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYXhpc0lkID09PSAneTInKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeTJfbGFiZWwgPSB0ZXh0O1xuICAgICAgICAgICAgfSBlbHNlIGlmIChheGlzSWQgPT09ICd4Jykge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3hfbGFiZWwgPSB0ZXh0O1xuICA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N0aW9uIChkKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKSwgYywgeCwgeSwgaCwgcmF0aW8sIHRyYW5zbGF0ZSA9IFwiXCI7XG4gICAgICAgIGlmICh1cGRhdGVkICYmICEkJC5oYXNUeXBlKCdnYXVnZScpKSB7XG4gICAgICAgICAgICBjID0gdGhpcy5zdmdBcmMuY2VudHJvaWQodXBkYXRlZCk7XG4gICAgICAgICAgICB4ID0gaXNOYU4oY1swXSkgPyAwIDogY1swXTtcbiAgICAgICAgICAgIHkgPSBpc05hTihjWzFdKSA/IDAgOiBjWzFdO1xuICAgICAgICAgICAgaCA9IE1hdGguc3FydCh4ICogeCArIHkgKiB5KTtcbiAgICAgICAgICAgIGlmICgkJC5oYXNUeXBlKCdkb251dCcpICYmIGNvbmZpZy5kb251dF9sYWJlbF9yYXRpbykge1xuICAgICAgICAgICAgICAgIHJhdGlvID0gaXNGdW5jdGlvbihjb25maWcuZG9udXRfbGFiZWxfcmF0aW8pID8gY29uZmlnLmRvbnV0X2xhYmVsX3JhdGlvKGQsICQkLnJhZGl1cywgaCkgOiBjb25maWcuZG9udXRfbGFiZWxfcmF0aW87XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQkLmhhc1R5cGUoJ3BpZScpICYmIGNvbmZpZy5waWVfbGFiZWxfcmF0aW8pIHtcbiAgICAgICAgICAgICAgICByYXRpbyA9IGlzRnVuY3Rpb24oY29uZmlnLnBpZV9sYWJlbF9yYXRpbykgPyBjb25maWcucGllX2xhYmVsX3JhdGlvKGQsICQkLnJhZGl1cywgaCkgOiBjb25maWcucGllX2xhYmVsX3JhdGlvO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByYXRpbyA9ICQkLnJhZGl1cyAmJiBoID8gKDM2IC8gJCQucmFkaXVzID4gMC4zNzUgPyAxL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0tZm9jdXNlZCcpLnNpemUoKSA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZEFyYyh0YXJnZXRJZHMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgMTApO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdGFyZ2V0SWRzID0gJCQubWFwVG9UYXJnZXRJZHModGFyZ2V0SWRzKTtcblxuICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCQkLnNlbGVjdG9yVGFyZ2V0cyh0YXJnZXRJZHMsICcuJyArIENMQVNTLmNoYXJ0QXJjKSkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgaWYgKCEgJCQuc2hvdWxkRXhwYW5kKGQuZGF0YS5pZCkpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAkJC5kMy5zZWxlY3QodGhpcykuc2VsZWN0QWxsKCdwYXRoJylcbiAgICAgICAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKCQkLmV4cGFuZER1cmF0aW9uKGQuZGF0YS5pZCkpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsICQkLnN2Z0FyY0V4cGFuZGVkKVxuICAgICAgICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oJCQuZXhwYW5kRHVyYXRpb24oZC5kYXRhLmlkKSAqIDIpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsICQkLnN2Z0FyY0V4cGFuZGVkU3ViKVxuICAgICAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC5pc0RvbnV0VHlwZShkLmRhdGEpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBjYWxsYmFjayBoZXJlXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcb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ICAgfSBlbHNlIGlmICgkJC5pc1BpZVR5cGUoaWQpKSB7XG4gICAgICAgICAgICByZXR1cm4gY29uZmlnLnBpZV9leHBhbmRfZHVyYXRpb247XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gNTA7XG4gICAgICAgIH1cblxuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5zaG91bGRFeHBhbmQgPSBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gKCQkLmlzRG9udXRUeXBlKGlkKSAmJiBjb25maWcuZG9udXRfZXhwYW5kKSB8fFxuICAgICAgICAgICAgICAgKCQkLmlzR2F1Z2VUeXBlKGlkKSAmJiBjb25maWcuZ2F1Z2VfZXhwYW5kKSB8fFxuICAgICAgICAgICAgICAgKCQkLmlzUGllVHlwZShpZCkgJiYgY29uZmlnLnBpZV9leHBhbmQpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5zaG91bGRTaG93QXJjTGFiZWwgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZywgc2hvdWxkU2hvdyA9IHRydWU7XG4gICAgICAgIGlmICgkJC5oYXNUeXBlKCdkb251dCcpKSB7XG4gICAgICAgICAgICBzaG91bGRTaG93ID0gY29uZmlnLmRvbnV0X2xhYmVsX3Nob3c7XG4gICAgICAgIH0gZWxzZSBpZiAoJCQuaGFzVHlwZSgncGllJykpIHtcbiAgICAgICAgICAgIHNob3VsZFNob3cgPSBjb25maWcucGllX2xhYmVsX3Nob3c7XG4gICAgICAgIH1cbiAgICAgICAgLy8gd2hlbiBnYXVnZSwgYWx3YXlzIHRydWVcbiAgICAgICAgcmV0dXJuIHNob3VsZFNob3c7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmF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ICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCBmdW5jdGlvbiAoZCkgeyByZXR1cm4gZCA9PT0gdGhpcy5fY3VycmVudCA/IDAgOiAxOyB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCA/IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQsIGFyY0RhdGE7XG4gICAgICAgICAgICAgICAgaWYgKCQkLnRyYW5zaXRpbmcpIHsgLy8gc2tpcCB3aGlsZSB0cmFuc2l0aW5nXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgICAgICAvLyB0cmFuc2l0aW9uc1xuICAgICAgICAgICAgICAgICAgICAkJC5leHBhbmRBcmModXBkYXRlZC5kYXRhLmlkKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuYXBpLmZvY3VzKHVwZGF0ZWQuZGF0YS5pZCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZUZvY3VzTGVnZW5kKHVwZGF0ZWQuZGF0YS5pZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29ubW91c2VvdmVyKGFyY0RhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCA/IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKSwgYXJjRGF0YSwgc2VsZWN0ZWREYXRhO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpLFxuICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZERhdGEgPSBbYXJjRGF0YV07XG4gICAgICAgICAgICAgICAgICAgICQkLnNob3dUb29sdGlwKHNlbGVjdGVkRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSA6IG51bGwpXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgY29uZmlnLmludGVyYWN0aW9uX2VuYWJsZWQgPyBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkLCBhcmNEYXRhO1xuICAgICAgICAgICAgICAgIGlmICgkJC50cmFuc2l0aW5nKSB7IC8vIHNraXAgd2hpbGUgdHJhbnNpdGluZ1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKTtcbiAgICAgICAgICAgICAgICBpZiAodXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBhcmNEYXRhID0gJCQuY29udmVydFRvQXJjRGF0YSh1cGRhdGVkKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gdHJhbnNpdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgJCQudW5leHBhbmRBcmModXBkYXRlZC5kYXRhLmlkKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuYXBpLnJldmVydCgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5yZXZlcnRMZWdlbmQoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuaGlkZVRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25tb3VzZW91dChhcmNEYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IDogbnVsbClcbiAgICAgICAgICAgIC5vbignY2xpY2snLCBjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCA/IGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKSwgYXJjRGF0YTtcbiAgICAgICAgICAgICAgICBpZiAodXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBhcmNEYXRhID0gJCQuY29udmVydFRvQXJjRGF0YSh1cGRhdGVkKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLnRvZ2dsZVNoYXBlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC50b2dnbGVTaGFwZSh0aGlzLCBhcmNEYXRhLCBpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbmNsaWNrLmNhbGwoJCQuYXBpLCBhcmNEYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IDogbnVsbClcbiAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uICgpIHsgJCQudHJhbnNpdGluZyA9IHRydWU7IH0pXG4gICAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKGR1cmF0aW9uKVxuICAgICAgICAgICAgLmF0dHJUd2VlbihcImRcIiwgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpLCBpbnRlcnBvbGF0ZTtcbiAgICAgICAgICAgICAgICBpZiAoISB1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7IHJldHVybiBcIk0gMCAwXCI7IH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50ID09PSBkKSB7XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQgPSB7XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICBzdGFydEFuZ2xlOiBNYXRoLlBJKjIsXG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICBlbmRBbmdsZTogTWF0aC5QSSoyLFxuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNOYU4odGhpcy5fY3VycmVudC5zdGFydEFuZ2xlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50LnN0YXJ0QW5nbGUgPSAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNOYU4odGhpcy5fY3VycmVudC5lbmRBbmdsZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudC5lbmRBbmdsZSA9IHRoaXMuX2N1cnJlbnQuc3RhcnRBbmdsZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaW50ZXJwb2xhdGUgPSBkMy5pbnRlcnBvbGF0ZSh0aGlzLl9jdXJyZW50LCB1cGRhdGVkKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50ID0gaW50ZXJwb2xhdGUoMCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbnRlcnBvbGF0ZWQgPSBpbnRlcnBvbGF0ZSh0KTtcbiAgICAgICAgICAgICAgICAgICAgaW50ZXJwb2xhdGVkLm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aGFwZS5jbGFzc2VkKENMQVNTLlNFTEVDVEVEKSxcbiAgICAgICAgICAgICAgICAgICAgaXNJbmNsdWRlZCA9IHNoYXBlLmNsYXNzZWQoQ0xBU1MuSU5DTFVERUQpLFxuICAgICAgICAgICAgICAgICAgICBfeCwgX3ksIF93LCBfaCwgdG9nZ2xlLCBpc1dpdGhpbiA9IGZhbHNlLCBib3g7XG4gICAgICAgICAgICAgICAgaWYgKHNoYXBlLmNsYXNzZWQoQ0xBU1MuY2lyY2xlKSkge1xuICAgICAgICAgICAgICAgICAgICBfeCA9IHNoYXBlLmF0dHIoXCJjeFwiKSAqIDE7XG4gICAgICAgICAgICAgICAgICAgIF95ID0gc2hhcGUuYXR0cihcImN5XCIpICogMTtcbiAgICAgICAgICAgICAgICAgICAgdG9nZ2xlID0gJCQudG9nZ2xlUG9pbnQ7XG4gICAgICAgICAgICAgICAgICAgIGlzV2l0aGluID0gbWluWCA8IF94ICYmIF94IDwgbWF4WCAmJiBtaW5ZIDwgX3kgJiYgX3kgPCBtYXhZO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFwZS5jbGFzc2VkKENMQVNTLmJhcikpIHtcbiAgICAgICAgICAgICAgICAgICAgYm94ID0gZ2V0UGF0aEJveCh0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgX3ggPSBib3gueDtcbiAgICAgICAgICAgICAgICAgICAgX3kgPSBib3gueTtcbiAgICAgICAgICAgICAgICAgICAgX3cgPSBib3gud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIF9oID0gYm94LmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgdG9nZ2xlID0gJCQudG9nZ2xlUGF0aDtcbiAgICAgICAgICAgICAgICAgICAgaXNXaXRoaW4gPSAhKG1heFggPCBfeCB8fCBfeCArIF93IDwgbWluWCkgJiYgIShtYXhZIDwgX3kgfHwgX3kgKyBfaCA8IG1pblkpO1xuICAgICAgICAgICAgICAgIH0gZW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FyID0gJCQuY2xhc3NDaGFydEJhci5iaW5kKCQkKSxcbiAgICAgICAgICAgIGNsYXNzQmFycyA9ICQkLmNsYXNzQmFycy5iaW5kKCQkKSxcbiAgICAgICAgICAgIGNsYXNzQ2hhcnRMaW5lID0gJCQuY2xhc3NDaGFydExpbmUuYmluZCgkJCksXG4gICAgICAgICAgICBjbGFzc0xpbmVzID0gJCQuY2xhc3NMaW5lcy5iaW5kKCQkKSxcbiAgICAgICAgICAgIGNsYXNzQXJlYXMgPSAkJC5jbGFzc0FyZWFzLmJpbmQoJCQpO1xuXG4gICAgICAgIGlmIChjb25maWcuc3ViY2hhcnRfc2hvdykge1xuICAgICAgICAgICAgLy8tLSBCYXIgLS0vL1xuICAgICAgICAgICAgY29udGV4dEJhclVwZGF0ZSA9IGNvbnRleHQuc2VsZWN0KCcuJyArIENMQVNTLmNoYXJ0QmFycykuc2VsZWN0QWxsKCcuJyArIENMQVNTLmNoYXJ0QmFyKVxuICAgICAgICAgICAgICAgIC5kYXRhKHRhcmdldHMpXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgY2xhc3NDaGFydEJhcik7XG4gICAgICAgICAgICBjb250ZXh0QmFyRW50ZXIgPSBjb250ZXh0QmFyVXBkYXRlLmVudGVyKCkuYXBwZW5kKCdnJylcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAwKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGNsYXNzQ2hhcnRCYXIpO1xuICAgICAgICAgICAgLy8gQmFycyBmb3IgZWFjaCBkYXRhXG4gICAgICAgICAgICBjb250ZXh0QmFyRW50ZXIuYXBwZW5kKCdnJylcbiAgICAgICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIGNsYXNzQmFycyk7XG5cbiAgICAgICAgICAgIC8vLS0gTGluZSAtLS8vXG4gICAgICAgICAgICBjb250ZXh0TGluZVVwZGF0ZSA9IGNvbnRleHQuc2VsZWN0KCcuJyArIENMQV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y5ldmVudCAmJiBkMy5ldmVudC50eXBlID09PSAnem9vbScpIHtcbiAgICAgICAgICAgICAgICAkJC5icnVzaC5leHRlbnQoJCQueC5vcmdEb21haW4oKSkudXBkYXRlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyB1cGRhdGUgc3ViY2hhcnQgZWxlbWVudHMgaWYgbmVlZGVkXG4gICAgICAgICAgICBpZiAod2l0aFN1YmNoYXJ0KSB7XG5cbiAgICAgICAgICAgICAgICAvLyBleHRlbnQgcmVjdFxuICAgICAgICAgICAgICAgIGlmICghJCQuYnJ1c2guZW1wdHkoKSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5icnVzaC5leHRlbnQoJCQueC5vcmdEb21haW4oKSkudXBkYXRlKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHNldHVwIGRyYXdlciAtIE1FTU86IHRoaXMgbXVzdCBiZSBjYWxsZWQgYWZ0ZXIgYXhpcyB1cGRhdGVkXG4gICAgICAgICAgICAgICAgZHJhd0FyZWFPblN1YiA9ICQkLmdlbmVyYXRlRHJhd0FyZWEoYXJlYUluZGljZXMsIHRydWUpO1xuICAgICAgICAgICAgICAgIGRyYXdCYXJPblN1YiA9ICQkLmdlbmVyYXRlRHJhd0JhcihiYXJJbmRpY2VzLCB0cnVlKTtcbiAgICAgICAgICAgICAgICBkcmF3TGluZU9uU3ViID0gJCQuZ2VuZXJhdGVEcmF3TGluZShsaW5lSW5kaWNlcywgdHJ1ZSk7XG5cbiAgICAgICAgICAgICAgICAkJC51cGRhdGVCYXJGb3JTdWJjaGFydChkdXJhdGlvbik7XG4gICAgICAgICAgICAgICAgJCQudXBkYXRlTGluZUZvclN1YmNoYXJ0KGR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVBcmVhRm9yU3ViY2hhcnQoZHVyYXRpb24pO1xuXG4gICAgICAgICAgICAgICAgJCQucmVkcmF3QmFyRm9yU3ViY2hhcnQoZH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pvb20oKVxuICAgICAgICAgICAgLm9uKFwiem9vbXN0YXJ0XCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzdGFydEV2ZW50ID0gZDMuZXZlbnQuc291cmNlRXZlbnQ7XG4gICAgICAgICAgICAgICAgJCQuem9vbS5hbHREb21haW4gPSBkMy5ldmVudC5zb3VyY2VFdmVudC5hbHRLZXkgPyAkJC54Lm9yZ0RvbWFpbigpIDogbnVsbDtcbiAgICAgICAgICAgICAgICBjb25maWcuem9vbV9vbnpvb21zdGFydC5jYWxsKCQkLmFwaSwgZDMuZXZlbnQuc291cmNlRXZlbnQpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbihcInpvb21cIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICQkLnJlZHJhd0Zvclpvb20uY2FsbCgkJCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCd6b29tZW5kJywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBldmVudCA9IGQzLmV2ZW50LnNvdXJjZUV2ZW50O1xuICAgICAgICAgICAgICAgIC8vIGlmIGNsaWNrLCBkbyBub3RoaW5nLiBvdGhlcndpc2UsIGNsaWNrIGludGVyYWN0aW9uIHdpbGwgYmUgY2FuY2VsZWQuXG4gICAgICAgICAgICAgICAgaWYgKGV2ZW50ICYmIHN0YXJ0RXZlbnQuY2xpZW50WCA9PT0gZXZlbnQuY2xpZW50WCAmJiBzdGFydEV2ZW50LmNsaWVudFkgPT09IGV2ZW50LmNsaWVudFkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAkJC5yZWRyYXdFdmVudFJlY3QoKTtcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVab29tKCk7XG4gICAgICAgICAgICAgICAgY29uZmlnLnpvb21fb256b29tZW5kLmNhbGwoJCQuYXBpLCAkJC54Lm9yZ0RvbWFpbigpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAkJC56b29tLnNjYWxlID0gZnVuY3Rpb24gKHNjYWxlKSB7XG4gICAgICAgICAgICByZXR1cm4gY29uZmlnLmF4aXNfcm90YXRlZCA/IHRoaXMueShzY2FsZSkgOiB0aGlzLngoc2NhbGUpO1xuICAgICAgICB9O1xuICAgICAgICAkJC56b29tLm9yZ1NjYWxlRXh0ZW50ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGV4dGVudCA9IGNvbmZpZy56b29tX2V4dGVudCA/IGNvbmZpZy56b29tX2V4dGVudCA6IFsxLCAxMF07XG4gICAgICAgICAgICByZXR1cm4gW2V4dGVudFswXSwgTWF0aC5tYXgoJCQuZ2V0TWF4RGF0YUNvdW50KCkgLyBleHRlbnRbMV0sIGV4dGVudFsxXSldO1xuICAgICAgICB9O1xuICAgICAgICAkJC56b29tLnVwZGF0ZVNjYWxlRXh0ZW50ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHJhdGlvID0gZGlmZkRvbWFpbigkJC54Lm9yZ0RvbWFpbigpKSAvIGRpZmZEb21haW4oJCQuZ2V0Wm9vbURvbWFpbigpKSxcbiAgICAgICAgICAgICAgICBleHRlbnQgPSB0aGlzLm9yZ1NjYWxlRXh0ZW50KCk7XG4gICAgICAgICAgICB0aGlzLnNjYWxlRXh0ZW50KFtleHRlbnRbMF0gKiByYXRpbywgZXh0ZW50WzFdICogcmF0aW9dKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0Wm9vbURvbWFpbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCBkMyA9ICQkLmQzLFxuICAgICAgICAgICAgbWluID0gZDMubWluKFskJC5vcmdYRG9tYWluWzBdLCBjb25maWcuem9vbV94X21pbl0pLFxuICAgICAgICAgICAgbWF4ID0gZDMubWF4KFskJC5vcmdYRG9tYWluWzFdLCBjb25maWcuem9vbV94X21heF0pO1xuICAgICAgICByZXR1cm4gW21pbiwgbWF4XTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnVwZGF0ZVpvb20gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIHogPSAkJC5jb25maWcuem9vbV9lbmFibGVkID8gJCQuem9vbSA6IGZ1bmN0aW9uICgpIHt9O1xuICAgICAgICAkJC5tYWluLnNlbGVjdCgnLicgKyBDTEFTUy56b29tUmVjdCkuY2FsbCh6KS5vbihcImRibGNsaWNrLnpvb21cIiwgbnVsbCk7XG4gICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLmV2ZW50UmVjdCkuY2FsbCh6KS5vbihcImRibGNsaWNrLnpvb21cIiwgbnVsbCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5yZWRyYXdGb3Jab29tID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBkMyA9ICQkLmQzLCBjb25maWcgPSAkJC5jb25maWcsIHpvb20gPSAkJC56b29tLCB4ID0gJCQueDtcbiAgICAgICAgaWYgKCFjb25maWcuem9vbV9lbmFibGVkKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCQkLmZpbHRlclRhcmdldHNUb1Nob3coJCQuZGF0YS50YXJnZXRzKS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZDMuZXZlbnQuc291cmNlRXZlbnQudHlwZSA9PT0gJ21vdXNlbW92ZScgJiYgem9vbS5hbHREb21haW4pIHtcbiAgICAgICAgICAgIHguZG9tYWluKHpvb20uYWx0RG9tYWluKTtcbiAgICAgICAg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DogZDMuc2NhbGUuY2F0ZWdvcnkxMCgpLnJhbmdlKCksXG4gICAgICAgICAgICBjYWxsYmFjayA9IGNvbmZpZy5kYXRhX2NvbG9yLFxuICAgICAgICAgICAgaWRzID0gW107XG5cbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICB2YXIgaWQgPSBkLmlkIHx8IChkLmRhdGEgJiYgZC5kYXRhLmlkKSB8fCBkLCBjb2xvcjtcblxuICAgICAgICAgICAgLy8gaWYgY2FsbGJhY2sgZnVuY3Rpb24gaXMgcHJvdmlkZWRcbiAgICAgICAgICAgIGlmIChjb2xvcnNbaWRdIGluc3RhbmNlb2YgRnVuY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBjb2xvciA9IGNvbG9yc1tpZF0oZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBpZiBzcGVjaWZpZWQsIGNob29zZSB0aGF0IGNvbG9yXG4gICAgICAgICAgICBlbHNlIGlmIChjb2xvcnNbaWRdKSB7XG4gICAgICAgICAgICAgICAgY29sb3IgPSBjb2xvcnNbaWRdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gaWYgbm90IHNwZWNpZmllZCwgY2hvb3NlIGZyb20gcGF0dGVyblxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGlkcy5pbmRleE9mKGlkKSA8IDApIHsgaWRzLnB1c2goaWQpOyB9XG4gICAgICAgICAgICAgICAgY29sb3IgPSBwYXR0ZXJuW2lkcy5pbmRleE9mKGlkKSAlIHBhdHRlcm4ubGVuZ3RoXTtcbiAgICAgICAgICAgICAgICBjb2xvcnNbaWRdID0gY29sb3I7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gY2FsbGJhY2sgaW5zdGFuY2VvZiBGdW5jdGlvbiA/IGNhbGxiYWNrKGNvbG9yLCBkKSA6IGNvbG9yO1xuICAgICAgICB9O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2VuZXJhdGVMZXZlbENvbG9yID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBjb2xvcnMgPSBjb25maWcuY29sb3JfcGF0dGVybixcbiAgICAgICAgICAgIHRocmVzaG9sZCA9IGNvbmZpZy5jb2xvcl90aHJlc2hvbGQsXG4gICAgICAgICAgICBhc1ZhbHVlID0gdGhyZXNob2xkLnVuaXQgPT09ICd2YWx1ZScsXG4gICAgICAgICAgICB2YWx1ZXMgPSB0aHJlc2hvbGQudmFsdWVzICYmIHRocmVzaG9sZC52YWx1ZXMubGVuZ3RoID8gdGhyZXNob2xkLnZhbHVlcyA6IFtdLFxuICAgICAgICAgICAgbWF4ID0gdGhyZXNob2xkLm1heCB8fCAxMDA7XG4gICAgICAgIHJldHVybiBub3RFbXB0eShjb25maWcuY29sb3JfdGhyZXNob2xkKSA/IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgdmFyIGksIHYsIGNvbG9yID0gY29sb3JzW2NvbG9ycy5sZW5ndGggLSAxXTtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB2YWx1ZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2ID0gYXNWYWx1ZSA/IHZhbHVlIDogKHZhbHVlICogMTAwIC8gbWF4KTtcbiAgICAgICAgICAgICAgICBpZiAodiA8IHZhbHVlc1tpXSkge1xuICAgICAgICAgICAgICAgICAgICBjb2xvciA9IGNvbG9yc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGNvbG9yO1xuICAgICAgICB9IDogbnVsbDtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WUZvcm1hdCA9IGZ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IH1cbiAgICAgICAgICAgICQkLmJydXNoLmV4dGVudChkb21haW4pO1xuICAgICAgICAgICAgJCQucmVkcmF3KHt3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZSwgd2l0aFk6ICQkLmNvbmZpZy56b29tX3Jlc2NhbGV9KTtcbiAgICAgICAgICAgICQkLmNvbmZpZy56b29tX29uem9vbS5jYWxsKHRoaXMsICQkLngub3JnRG9tYWluKCkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAkJC5icnVzaC5leHRlbnQoKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuLnpvb20uZW5hYmxlID0gZnVuY3Rpb24gKGVuYWJsZWQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbDtcbiAgICAgICAgJCQuY29uZmlnLnpvb21fZW5hYmxlZCA9IGVuYWJsZWQ7XG4gICAgICAgICQkLnVwZGF0ZUFuZFJlZHJhdygpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4udW56b29tID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsO1xuICAgICAgICAkJC5icnVzaC5jbGVhcigpLnVwZGF0ZSgpO1xuICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVYRG9tYWluOiB0cnVlfSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLnpvb20ubWF4ID0gZnVuY3Rpb24gKG1heCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDM7XG4gICAgICAgIGlmIChtYXggPT09IDAgfHwgbWF4KSB7XG4gICAgICAgICAgICBjb25maWcuem9vbV94X21heCA9IGQzLm1heChbJCQub3JnWERvbWFpblsxXSwgbWF4XSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gY29uZmlnLnpvb21feF9tYXg7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uem9vbS5taW4gPSBmdW5jdGlvbiAobWluKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMztcbiAgICAgICAgaWYgKG1pbiA9PT0gMCB8fCBtaW4pIHtcbiAgICAgICAgICAgIGNvbmZpZy56b29tX3hfbWluID0gZDMubWluKFskJC5vcmdYRG9tYWluWzBdLCBtaW5dKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuem9vbV94X21pbjtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi56b29tLnJhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoaXNEZWZpbmVkKHJhbmdlLm1heCkpIHsgdGhpcy5kb21haW4ubWF4KHJhbmdlLm1heCk7IH1cbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQocmFuZ2UubWluKSkgeyB0aGlzLmRvbWFpbi5taW4ocmFuZ2UubWluKTsgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBtYXg6IHRoaXMuZG9tYWluLm1heCgpLFxuICAgICAgICAgICAgICAgIG1pbjogdGhpcy5kb21haW4ubWluKClcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4ubG9hZCA9IGZ1bmN0aW9uIChhcmdzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgLy8gdXBkYXRlIHhzIGlmIHNwZWNpZmllZFxuICAgICAgICBpZiAoYXJncy54cykge1xuICAgICAgICAgICA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ICAgfVxuICAgICAgICBlbHNlIGlmIChhcmdzLmNvbHVtbnMpIHtcbiAgICAgICAgICAgIGRhdGEgPSAkJC5jb252ZXJ0Q29sdW1uc1RvRGF0YShhcmdzLmNvbHVtbnMpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHRhcmdldHMgPSAkJC5jb252ZXJ0RGF0YVRvVGFyZ2V0cyhkYXRhLCB0cnVlKTtcblxuICAgICAgICAvLyBVcGRhdGUvQWRkIGRhdGFcbiAgICAgICAgJCQuZGF0YS50YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgIHZhciBmb3VuZCA9IGZhbHNlLCBpLCBqO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHRhcmdldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodC5pZCA9PT0gdGFyZ2V0c1tpXS5pZCkge1xuICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHQudmFsdWVzW3QudmFsdWVzLmxlbmd0aCAtIDFdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0YWlsID0gdC52YWx1ZXNbdC52YWx1ZXMubGVuZ3RoIC0gMV0uaW5kZXggKyAxO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IHRhcmdldHNbaV0udmFsdWVzLmxlbmd0aDtcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgbGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldHNbaV0udmFsdWVzW2pdLmluZGV4ID0gdGFpbCArIGo7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoISQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0c1tpXS52YWx1ZXNbal0ueCA9IHRhaWwgKyBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHQudmFsdWVzID0gdC52YWx1ZXMuY29uY2F0KHRhcmdldHNbaV0udmFsdWVzKTtcblxuICAgICAgICAgICAgICAgICAgICB0YXJnZXRzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFmb3VuZCkgeyBub3Rmb3VuZElkcy5wdXNoKHQuaWQpOyB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIEFwcGVuZCBudWxsIGZvciBub3QgZm91bmQgdGFyZ2V0c1xuICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgdmFyIGksIGo7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbm90Zm91bmRJZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodC5pZCA9PT0gbm90Zm91bmRJZHNbaV0pIHtcbiAgICAgICAgICAgICAgICAgICAgdGFpbCA9IHQudmFsdWVzW3QudmFsdWVzLmxlbmd0aCAtIDFdLmluZGV4ICsgMTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0LnZhbHVlcy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogdC5pZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogdGFpbCArIGosXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeDogJCQuaXNUaW1lU2VyaWVzKCkgPyAkJC5nZXRPdGhlclRhcmdldFgodGFpbCArIGopIDogdGFpbCArIGosXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IG51bGxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBHZW5lcmF0ZSBudWxsIHZhbHVlcyBmb3IgbmV3IHRhcmdldFxuICAgICAgICBpZiAoJCQuZGF0YS50YXJnZXRzLmxlbmd0aCkge1xuICAgICAgICAgICAgdGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgdmFyIGksIG1pc3NpbmcgPSBbXTtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzWzBdLmluZGV4OyBpIDwgdGFpbDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIG1pc3NpbmcucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogdC5pZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpLFxuICAgICAgICAgICAgICAgICAgICAgICAgeDogJCQuaXNUaW1lU2VyaWVzKCkgPyAkJC5nZXRPdGhlclRhcmdldFgoaSkgOiBpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IG51bGxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHQudmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgICAgICAgICAgdi5pbmRleCArPSB0YWlsO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2LnggKz0gdGFpbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgI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FxuICAgICAgICAgICAgICAgIGRyYXdCYXIgPSBhcmdzLmRyYXdCYXIsXG4gICAgICAgICAgICAgICAgZHJhd0xpbmUgPSBhcmdzLmRyYXdMaW5lLFxuICAgICAgICAgICAgICAgIGRyYXdBcmVhID0gYXJncy5kcmF3QXJlYSxcbiAgICAgICAgICAgICAgICBjeCA9IGFyZ3MuY3gsXG4gICAgICAgICAgICAgICAgY3kgPSBhcmdzLmN5LFxuICAgICAgICAgICAgICAgIHh2ID0gYXJncy54dixcbiAgICAgICAgICAgICAgICB4Rm9yVGV4dCA9IGFyZ3MueEZvclRleHQsXG4gICAgICAgICAgICAgICAgeUZvclRleHQgPSBhcmdzLnlGb3JUZXh0LFxuICAgICAgICAgICAgICAgIGR1cmF0aW9uID0gYXJncy5kdXJhdGlvbjtcblxuICAgICAgICAgICAgdmFyIHRyYW5zbGF0ZVgsIHNjYWxlWCA9IDEsIHRyYW5zZm9ybSxcbiAgICAgICAgICAgICAgICBmbG93SW5kZXggPSBmbG93LmluZGV4LFxuICAgICAgICAgICAgICAgIGZsb3dMZW5ndGggPSBmbG93Lmxlbmd0aCxcbiAgICAgICAgICAgICAgICBmbG93U3RhcnQgPSAkJC5nZXRWYWx1ZU9uSW5kZXgoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcywgZmxvd0luZGV4KSxcbiAgICAgICAgICAgICAgICBmbG93RW5kID0gJCQuZ2V0VmFsdWVPbkluZGV4KCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMsIGZsb3dJbmRleCArIGZsb3dMZW5ndGgpLFxuICAgICAgICAgICAgICAgIG9yZ0RvbWFpbiA9ICQkLnguZG9tYWluKCksIGRvbWFpbixcbiAgICAgICAgICAgICAgICBkdXJhdGlvbkZvckZsb3cgPSBmbG93LmR1cmF0aW9uIHx8IGR1cmF0aW9uLFxuICAgICAgICAgICAgICAgIGRvbmUgPSBmbG93LmRvbmUgfHwgZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICAgICAgd2FpdCA9ICQkLmdlbmVyYXRlV2FpdCgpO1xuXG4gICAgICAgICAgICB2YXIgeGdyaWQgPSAkJC54Z3JpZCB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIHhncmlkTGluZXMgPSAkJC54Z3JpZExpbmVzIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpblJlZ2lvbiA9ICQkLm1haW5SZWdpb24gfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluVGV4dCA9ICQkLm1haW5UZXh0IHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpbkJhciA9ICQkLm1haW5CYXIgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluTGluZSA9ICQkLm1haW5MaW5lIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpbkFyZWEgPSAkJC5tYWluQXJlYSB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5DaXJjbGUgPSAkJC5tYWluQ2lyY2xlIHx8IGQzLnNlbGVjdEFsbChbXSk7XG5cbiAgICAgICAgICAgIC8vIHNldCBmbGFnXG4gICAgICAgICAgICAkJC5mbG93aW5nID0gdHJ1ZTtcblxuICAgICAgICAgICAgLy8gcmVtb3ZlIGhlYWQgZGF0YSBhZnRlciByZW5kZXJlZFxuICAgICAgICAgICAgJCQuZGF0YS50YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICBkLnZhbHVlcy5zcGxpY2UoMCwgZmxvd0xlbmd0aCk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgLy8gdXBkYXRlIHggZG9tYWluIHRvIGdlbmVyYXRlIGF4aXMgZWxlbWVudHMgZm9yIGZsb3dcbiAgICAgICAgICAgIGRvbWFpbiA9ICQkLnVwZGF0ZVhEb21haW4odGFyZ2V0cywgdHJ1ZSwgdHJ1ZSk7XG4gICAgICAgICAgICAvLyB1cGRhdGUgZWxlbWVudHMgcmVsYXRlZCB0byB4IHNjYWxlXG4gICAgICAgICAgICBpZiAoJCQudXBkYXRlWEdyaWQpIHsgJCQudXBkYXRlWEdyaWQodHJ1ZSk7IH1cblxuICAgICAgICAgICAgLy8gZ2VuZXJhdGUgdHJhbnNmb3JtIHRvIGZsb3dcbiAgICAgICAgICAgIGlmICghZmxvdy5vcmdEYXRhQ291bnQpIHsgLy8gaWYgZW1wdHlcbiAgICAgICAgICAgICAgICBpZiAoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcy5sZW5ndGggIT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICQkLngob3JnRG9tYWluWzBdKSAtICQkLngoZG9tYWluWzBdKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZsb3dTdGFydCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZsb3dFbmQgPSAkJC5nZXRWYWx1ZU9uSW5kZXgoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcywgJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcy5sZW5ndGggLSAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAkJC54KGZsb3dTdGFydC54KSAtICQkLngoZmxvd0VuZC54KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSBkaWZmRG9tYWluKGRvbWFpbikgLyAyO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChmbG93Lm9yZ0RhdGFDb3VudCA9PT0gMSB8fCAoZmxvd1N0YXJ0ICYmIGZsb3dTdGFydC54KSA9PT0gKGZsb3dFbmQgJiYgZmxvd0VuZC54KSkge1xuICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAkJC54KG9yZ0RvbWFpblswXSkgLSAkJC54KGRvbWFpblswXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gKCQkLngob3JnRG9tYWluWzBdKSAtICQkLngoZG9tYWluWzBdKSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICgkJC54KGZsb3dTdGFydC54KSAtICQkLngoZmxvd0VuZC54KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2NhbGVYID0gKGRpZmZEb21haW4ob3JnRG9tYWluKSAvIGRpZmZEb21haW4oZG9tYWluKSk7XG4gICAgICAgICAgICB0cmFuc2Zvcm0gPSAndHJhbnNsYXRlKCcgKyB0cmFuc2xhdGVYICsgJywwKSBzY2FsZSgnICsgc2NhbGVYICsgJywxKSc7XG5cbiAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG5cbiAgICAgICAgICAgIGQzLnRyYW5zaXRpb24oKS5lYXNlKCdsaW5lYXInKS5kdXJhdGlvbihkdXJhdGlvbkZvckZsb3cpLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHdhaXQuYWRkKCQkLmF4ZXMueC50cmFuc2l0aW9uKCkuY2FsbCgkJC54QXhpcykpO1xuICAgICAgICAgICAgICAgIHdhaXQuYWRkKG1haW5CYXIudHJhbnNpdGlvbigpLmF0dHIoJ3RyYW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bmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzaGFwZXMucHVzaCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIChmbG93SW5kZXggKyBpKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0cy5wdXNoKCcuJyArIENMQVNTLnRleHQgKyAnLScgKyAoZmxvd0luZGV4ICsgaSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRSZWN0cy5wdXNoKCcuJyArIENMQVNTLmV2ZW50UmVjdCArICctJyArIChmbG93SW5kZXggKyBpKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZXMpLnNlbGVjdEFsbChzaGFwZXMpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLnRleHRzKS5zZWxlY3RBbGwodGV4dHMpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLmV2ZW50UmVjdHMpLnNlbGVjdEFsbChldmVudFJlY3RzKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy54Z3JpZCkucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gZHJhdyBhZ2FpbiBmb3IgcmVtb3ZpbmcgZmxvd2VkIGVsZW1lbnRzIGFuZCByZXZlcnRpbmcgYXR0clxuICAgICAgICAgICAgICAgIHhncmlkXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigkJC54Z3JpZEF0dHIpO1xuICAgICAgICAgICAgICAgIHhncmlkTGluZXNcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpO1xuICAgICAgICAgICAgICAgIHhncmlkTGluZXMuc2VsZWN0KCdsaW5lJylcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IHh2KVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcIngyXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC53aWR0aCA6IHh2KTtcbiAgICAgICAgICAgICAgICB4Z3JpZExpbmVzLnNlbGVjdCgndGV4dCcpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieFwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiAwKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcInlcIiwgeHYpO1xuICAgICAgICAgICAgICAgIG1haW5CYXJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCBkcmF3QmFyKTtcbiAgICAgICAgICAgICAgICBtYWluTGluZVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsIGRyYXdMaW5lKTtcbiAgICAgICAgICAgICAgICBtYWluQXJlYVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsIGRyYXdBcmVhKTtcbiAgICAgICAgICAgICAgICBtYWluQ2lyY2xlXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImN4XCIsIGN4KVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImN5XCIsIGN5KTtcbiAgICAgICAgICAgICAgICBtYWluVGV4dFxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCB4Rm9yVGV4dClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5Rm9yVGV4dClcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsLW9wYWNpdHknLCAkJC5vcGFjaXR5Rm9yVGV4dC5iaW5kKCQkKSk7XG4gICAgICAgICAgICAgICAgbWFpblJlZ2lvblxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbCk7XG4gICAgICAgICAgICAgICAgbWFpblJlZ2lvbi5zZWxlY3QoJ3JlY3QnKS5maWx0ZXIoJCQuaXNSZWdpb25PblgpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieFwiLCAkJC5yZWdpb25YLmJpbmQoJCQpKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcIndpZHRoXCIsICQkLnJlZ2lvbldpZHRoLmJpbmQoJCQpKTtcblxuICAgICAgICAgICAgICAgIGlmIChjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdFdmVudFJlY3QoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBjYWxsYmFjayBmb3IgZW5kIG9mIGZsb3dcbiAgICAgICAgICAgICAgICBkb25lKCk7XG5cbiAgICAgICAgICAgICAgICAkJC5mbG93aW5nID0gZmFsc2U7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uc2VsZWN0ZWQgPSBmdW5jdGlvbiAodGFyZ2V0SWQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgZDMgPSAkJC5kMztcbiAgICAgICAgcmV0dXJuIGQzLm1lcmdlKFxuICAgIC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ICAgICQkLmF4aXMuc2V0TGFiZWxUZXh0KGF4aXNJZCwgbGFiZWxzW2F4aXNJZF0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAkJC5heGlzLnVwZGF0ZUxhYmVscygpO1xuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE86IHJldHVybiBzb21lIHZhbHVlcz9cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuLmF4aXMubWF4ID0gZnVuY3Rpb24gKG1heCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIG1heCA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtYXgueCkpIHsgY29uZmlnLmF4aXNfeF9tYXggPSBtYXgueDsgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1heC55KSkgeyBjb25maWcuYXhpc195X21heCA9IG1heC55OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWF4LnkyKSkgeyBjb25maWcuYXhpc195Ml9tYXggPSBtYXgueTI7IH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeV9tYXggPSBjb25maWcuYXhpc195Ml9tYXggPSBtYXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLCB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZX0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB4OiBjb25maWcuYXhpc194X21heCxcbiAgICAgICAgICAgICAgICB5OiBjb25maWcuYXhpc195X21heCxcbiAgICAgICAgICAgICAgICB5MjogY29uZmlnLmF4aXNfeTJfbWF4XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi5heGlzLm1pbiA9IGZ1bmN0aW9uIChtaW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW4gPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWluLngpKSB7IGNvbmZpZy5heGlzX3hfbWluID0gbWluLng7IH1cbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtaW4ueSkpIHsgY29uZmlnLmF4aXNfeV9taW4gPSBtaW4ueTsgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1pbi55MikpIHsgY29uZmlnLmF4aXNfeTJfbWluID0gbWluLnkyOyB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3lfbWluID0gY29uZmlnLmF4aXNfeTJfbWluID0gbWluO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgJCQucmVkcmF3KHt3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSwgd2l0aFVwZGF0ZVhEb21haW46IHRydWV9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgeDogY29uZmlnLmF4aXNfeF9taW4sXG4gICAgICAgICAgICAgICAgeTogY29uZmlnLmF4aXNfeV9taW4sXG4gICAgICAgICAgICAgICAgeTI6IGNvbmZpZy5heGlzX3kyX21pblxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uYXhpcy5yYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkge1xuICAgICAgICBpZiAoYXJndW1lbnRzL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UgPSBhcmdzLm1vdXNlO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gZGV0ZXJtaW5lIGZvY3VzIGRhdGFcbiAgICAgICAgaWYgKGFyZ3MuZGF0YSkge1xuICAgICAgICAgICAgaWYgKCQkLmlzTXVsdGlwbGVYKCkpIHtcbiAgICAgICAgICAgICAgICAvLyBpZiBtdWx0aXBsZSB4cywgdGFyZ2V0IHBvaW50IHdpbGwgYmUgZGV0ZXJtaW5lZCBieSBtb3VzZVxuICAgICAgICAgICAgICAgIG1vdXNlID0gWyQkLngoYXJncy5kYXRhLngpLCAkJC5nZXRZU2NhbGUoYXJncy5kYXRhLmlkKShhcmdzLmRhdGEudmFsdWUpXTtcbiAgICAgICAgICAgICAgICBpbmRleCA9IG51bGw7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIFRPRE86IHdoZW4gdG9vbHRpcF9ncm91cGVkID0gZmFsc2VcbiAgICAgICAgICAgICAgICBpbmRleCA9IGlzVmFsdWUoYXJncy5kYXRhLmluZGV4KSA/IGFyZ3MuZGF0YS5pbmRleCA6ICQkLmdldEluZGV4QnlYKGFyZ3MuZGF0YS54KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgYXJncy54ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaW5kZXggPSAkJC5nZXRJbmRleEJ5WChhcmdzLngpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHR5cGVvZiBhcmdzLmluZGV4ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaW5kZXggPSBhcmdzLmluZGV4O1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gZW11bGF0ZSBtb3VzZSBldmVudHMgdG8gc2hvd1xuICAgICAgICAkJC5kaXNwYXRjaEV2ZW50KCdtb3VzZW92ZXInLCBpbmRleCwgbW91c2UpO1xuICAgICAgICAkJC5kaXNwYXRjaEV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BzY2FsZS5kb21haW4oKTtcbiAgICAgICAgICAgIGZvciAoaSA9IE1hdGguY2VpbChkb21haW5bMF0pOyBpIDwgZG9tYWluWzFdOyBpKyspIHtcbiAgICAgICAgICAgICAgICB0aWNrcy5wdXNoKGkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRpY2tzLmxlbmd0aCA+IDAgJiYgdGlja3NbMF0gPiAwKSB7XG4gICAgICAgICAgICAgICAgdGlja3MudW5zaGlmdCh0aWNrc1swXSAtICh0aWNrc1sxXSAtIHRpY2tzWzBdKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGlja3M7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gY29weVNjYWxlKCkge1xuICAgICAgICAgICAgdmFyIG5ld1NjYWxlID0gc2NhbGUuY29weSgpLCBkb21haW47XG4gICAgICAgICAgICBpZiAocGFyYW1zLmlzQ2F0ZWdvcnkpIHtcbiAgICAgICAgICAgICAgICBkb21haW4gPSBzY2FsZS5kb21haW4oKTtcbiAgICAgICAgICAgICAgICBuZXdTY2FsZS5kb21haW4oW2RvbWFpblswXSwgZG9tYWluWzFdIC0gMV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIG5ld1NjYWxlO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHRleHRGb3JtYXR0ZWQodikge1xuICAgICAgICAgICAgdmFyIGZvcm1hdHRlZCA9IHRpY2tGb3JtYXQgPyB0aWNrRm9ybWF0KHYpIDogdjtcbiAgICAgICAgICAgIHJldHVybiB0eXBlb2YgZm9ybWF0dGVkICE9PSAndW5kZWZpbmVkJyA/IGZvcm1hdHRlZCA6ICcnO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGdldFNpemVGb3IxQ2hhcih0aWNrKSB7XG4gICAgICAgICAgICBpZiAodGlja1RleHRDaGFyU2l6ZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aWNrVGV4dENoYXJTaXplO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHNpemUgPSB7XG4gICAgICAgICAgICAgICAgaDogMTEuNSxcbiAgICAgICAgICAgICAgICB3OiA1LjVcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB0aWNrLnNlbGVjdCgndGV4dCcpLnRleHQodGV4dEZvcm1hdHRlZCkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciBib3ggPSB0aGlzLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLFxuICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gdGV4dEZvcm1hdHRlZChkKSxcbiAgICAgICAgICAgICAgICAgICAgaCA9IGJveC5oZWlnaHQsXG4gICAgICAgICAgICAgICAgICAgIHcgPSB0ZXh0ID8gKGJveC53aWR0aCAvIHRleHQubGVuZ3RoKSA6IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBpZiAoaCAmJiB3KSB7XG4gICAgICAgICAgICAgICAgICAgIHNpemUuaCA9IGg7XG4gICAgICAgICAgICAgICAgICAgIHNpemUudyA9IHc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSkudGV4dCgnJyk7XG4gICAgICAgICAgICB0aWNrVGV4dENoYXJTaXplID0gc2l6ZTtcbiAgICAgICAgICAgIHJldHVybiBzaXplO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHRyYW5zaXRpb25pc2Uoc2VsZWN0aW9uKSB7XG4gICAgICAgICAgICByZXR1cm4gcGFyYW1zLndpdGhvdXRUcmFuc2l0aW9uID8gc2VsZWN0aW9uIDogZDMudHJhbnNpdGlvbihzZWxlY3Rpb24pO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGF4aXMoZykge1xuICAgICAgICAgICAgZy5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgZyA9IGF4aXMuZyA9IGQzLnNlbGVjd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gICAgICAgICAgICAgICAgICBwYXRoID0gZy5zZWxlY3RBbGwoXCIuZG9tYWluXCIpLmRhdGEoWyAwIF0pLFxuICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlID0gKHBhdGguZW50ZXIoKS5hcHBlbmQoXCJwYXRoXCIpLmF0dHIoXCJjbGFzc1wiLCBcImRvbWFpblwiKSwgdHJhbnNpdGlvbmlzZShwYXRoKSk7XG4gICAgICAgICAgICAgICAgdGlja0VudGVyLmFwcGVuZChcImxpbmVcIik7XG4gICAgICAgICAgICAgICAgdGlja0VudGVyLmFwcGVuZChcInRleHRcIik7XG5cbiAgICAgICAgICAgICAgICB2YXIgbGluZUVudGVyID0gdGlja0VudGVyLnNlbGVjdChcImxpbmVcIiksXG4gICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUgPSB0aWNrVXBkYXRlLnNlbGVjdChcImxpbmVcIiksXG4gICAgICAgICAgICAgICAgICAgIHRleHRFbnRlciA9IHRpY2tFbnRlci5zZWxlY3QoXCJ0ZXh0XCIpLFxuICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlID0gdGlja1VwZGF0ZS5zZWxlY3QoXCJ0ZXh0XCIpO1xuXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5pc0NhdGVnb3J5KSB7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tPZmZzZXQgPSBNYXRoLmNlaWwoKHNjYWxlMSgxKSAtIHNjYWxlMSgwKSkgLyAyKTtcbiAgICAgICAgICAgICAgICAgICAgdGlja1ggPSB0aWNrQ2VudGVyZWQgPyAwIDogdGlja09mZnNldDtcbiAgICAgICAgICAgICAgICAgICAgdGlja1kgPSB0aWNrQ2VudGVyZWQgPyB0aWNrT2Zmc2V0IDogMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aWNrT2Zmc2V0ID0gdGlja1ggPSAwO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciB0ZXh0LCB0c3Bhbiwgc2l6ZUZvcjFDaGFyID0gZ2V0U2l6ZUZvcjFDaGFyKGcuc2VsZWN0KCcudGljaycpKSwgY291bnRzID0gW107XG4gICAgICAgICAgICAgICAgdmFyIHRpY2tMZW5ndGggPSBNYXRoLm1heChpbm5lclRpY2tTaXplLCAwKSArIHRpY2tQYWRkaW5nLFxuICAgICAgICAgICAgICAgICAgICBpc1ZlcnRpY2FsID0gb3JpZW50ID09PSAnbGVmdCcgfHwgb3JpZW50ID09PSAncmlnaHQnO1xuXG4gICAgICAgICAgICAgICAgLy8gdGhpcyBzaG91bGQgYmUgY2FsbGVkIG9ubHkgd2hlbiBjYXRlZ29yeSBheGlzXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc3BsaXRUaWNrVGV4dChkLCBtYXhXaWR0aCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdGlja1RleHQgPSB0ZXh0Rm9ybWF0dGVkKGQpLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VidGV4dCwgc3BhY2VJbmRleCwgdGV4dFdpZHRoLCBzcGxpdHRlZCA9IFtdO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwodGlja1RleHQpID09PSBcIltvYmplY3QgQXJyYXldXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWNrVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICghbWF4V2lkdGggfHwgbWF4V2lkdGggPD0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF4V2lkdGggPSBpc1ZlcnRpY2FsID8gOTUgOiBwYXJhbXMuaXNDYXRlZ29yeSA/IChNYXRoLmNlaWwoc2NhbGUxKHRpY2tzWzFdKSAtIHNjYWxlMSh0aWNrc1swXSkpIC0gMTIpIDogMTEwO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc3BsaXQoc3BsaXR0ZWQsIHRleHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlSW5kZXggPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IHRleHQubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGV4dC5jaGFyQXQoaSkgPT09ICcgJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFjZUluZGV4ID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidGV4dCA9IHRleHQuc3Vic3RyKDAsIGkgKyAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0V2lkdGggPSBzaXplRm9yMUNoYXIudyAqIHN1YnRleHQubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIHRleHQgd2lkdGggZ2V0cyBvdmVyIHRpY2sgd2lkdGgsIHNwbGl0IGJ5IHNwYWNlIGluZGV4IG9yIGNycmVudCBpbmRleFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXhXaWR0aCA8IHRleHRXaWR0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGxpdHRlZC5jb25jYXQodGV4dC5zdWJzdHIoMCwgc3BhY2VJbmRleCA/IHNwYWNlSW5kZXggOiBpKSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LnNsaWNlKHNwYWNlSW5kZXggPyBzcGFjZUluZGV4ICsgMSA6IGkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwbGl0dGVkLmNvbmNhdCh0ZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdChzcGxpdHRlZCwgdGlja1RleHQgKyBcIlwiKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB0c3BhbkR5KGQsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGR5ID0gc2l6ZUZvcjFDaGFyLmg7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3JpZW50ID09PSAnbGVmdCcgfHwgb3JpZW50ID09PSAncmlnaHQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZHkgPSAtKChjb3VudHNbZC5pbmRleF0gLSAxKSAqIChzaXplRm9yMUNoYXIuaCAvIDIpIC0gMyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR5ID0gXCIuNzFlbVwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkeTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB0aWNrU2l6ZShkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0aWNrUG9zaXRpb24gPSBzY2FsZShkKSArICh0aWNrQ2VudGVyZWQgPyAwIDogdGlja09mZnNldCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByYW5nZVswXSA8IHRpY2tQb3NpdGlvbiAmJiB0aWNrUG9zaXRpb24gPCByYW5nZVsxXSA/IGlubmVyVGlja1NpemUgOiAwO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRleHQgPSB0aWNrLnNlbGVjdChcInRleHRcIik7XG4gICAgICAgICAgICAgICAgdHNwYW4gPSB0ZXh0LnNlbGVjdEFsbCgndHNwYW4nKVxuICAgICAgICAgICAgICAgICAgICAuZGF0YShmdW5jdGlvbiAoZCwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNwbGl0dGVkID0gcGFyYW1zLnRpY2tNdWx0aWxpbmUgPyBzcGxpdFRpY2tUZXh0KGQsIHBhcmFtcy50aWNrV2lkdGgpIDogW10uY29uY2F0KHRleHRGb3JtYXR0ZWQoZCkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY291bnRzW2ldID0gc3BsaXR0ZWQubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwbGl0dGVkLm1hcChmdW5jdGlvbiAocykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7IGluZGV4OiBpLCBzcGxpdHRlZDogcyB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHRzcGFuLmVudGVyKCkuYXBwZW5kKCd0c3BhbicpO1xuICAgICAgICAgICAgICAgIHRzcGFuLmV4aXQoKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICB0c3Bhbi50ZXh0KGZ1bmN0aW9uIChkKSB7IHJldHVybiBkLnNwbGl0dGVkOyB9KTtcblxuICAgICAgICAgICAgICAgIHZhciByb3RhdGUgPSBwYXJhbXMudGlja1RleHRSb3RhdGU7XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB0ZXh0QW5jaG9yRm9yVGV4dChyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnbWlkZGxlJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm90YXRlID4gMCA/IFwic3RhcnRcIiA6IFwiZW5kXCI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRleHRUcmFuc2Zvcm0ocm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwicm90YXRlKFwiICsgcm90YXRlICsgXCIpXCI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGR4Rm9yVGV4dChyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA4ICogTWF0aC5zaW4oTWF0aC5QSSAqIChyb3RhdGUgLyAxODApKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24geUZvclRleHQocm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGlja0xlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTEuNSAtIDIuNSAqIChyb3RhdGUgLyAxNSkgKiAocm90YXRlID4gMCA/IDEgOiAtMSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgc3dpdGNoIChvcmllbnQpIHtcbiAgICAgICAgICAgICAgICBjYXNlIFwiYm90dG9tXCI6XG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieTJcIiwgaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RW50ZXIuYXR0cihcInlcIiwgdGlja0xlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVXBkYXRlLmF0dHIoXCJ4MVwiLCB0aWNrWCkuYXR0cihcIngyXCIsIHRpY2tYKS5hdHRyKFwieTJcIiwgdGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFVwZGF0ZS5hdHRyKFwieFwiLCAwKS5hdHRyKFwieVwiLCB5Rm9yVGV4dChyb3RhdGUpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZShcInRleHQtYW5jaG9yXCIsIHRleHRBbmNob3JGb3JUZXh0KHJvdGF0ZSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgdGV4dFRyYW5zZm9ybShyb3RhdGUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCAwKS5hdHRyKFwiZHlcIiwgdHNwYW5EeSkuYXR0cignZHgnLCBkeEZvclRleHQocm90YXRlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgcmFuZ2VbMF0gKyBcIixcIiArIG91dGVyVGlja1NpemUgKyBcIlYwSFwiICsgcmFuZ2VbMV0gKyBcIlZcIiArIG91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXNlIFwidG9wXCI6XG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IHJvdGF0ZWQgdGljayB0ZXh0XG4gICAgICAgICAgICAgICAgICAgICAgICB0aWNrVHJhbnNmb3JtID0gYXhpc1g7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lRW50ZXIuYXR0cihcInkyXCIsIC1pbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieVwiLCAtdGlja0xlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVXBkYXRlLmF0dHIoXCJ4MlwiLCAwKS5hdHRyKFwieTJcIiwgLWlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFVwZGF0ZS5hdHRyKFwieFwiLCAwKS5hdHRyKFwieVwiLCAtdGlja0xlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LnN0eWxlKFwidGV4dC1hbmNob3JcIiwgXCJtaWRkbGVcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICB0c3Bhbi5hdHRyKCd4JywgMCkuYXR0cihcImR5XCIsIFwiMGVtXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKFwiZFwiLCBcIk1cIiArIHJhbmdlWzBdICsgXCIsXCIgKyAtb3V0ZXJUaWNrU2l6ZSArIFwiVjBIXCIgKyByYW5nZVsxXSArIFwiVlwiICsgLW91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXNlIFwibGVmdFwiOlxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aWNrVHJhbnNmb3JtID0gYXhpc1k7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lRW50ZXIuYXR0cihcIngyXCIsIC1pbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieFwiLCAtdGlja0xlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVXBkYXRlLmF0dHIoXCJ4MlwiLCAtaW5uZXJUaWNrU2l6ZSkuYXR0cihcInkxXCIsIHRpY2tZKS5hdHRyKFwieTJcIiwgdGlja1kpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFVwZGF0ZS5hdHRyKFwieFwiLCAtdGlja0xlbmd0aCkuYXR0cihcInlcIiwgdGlja09mZnNldCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LnN0eWxlKFwidGV4dC1hbmNob3JcIiwgXCJlbmRcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICB0c3Bhbi5hdHRyKCd4JywgLXRpY2tMZW5ndGgpLmF0dHIoXCJkeVwiLCB0c3BhbkR5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cihcImRcIiwgXCJNXCIgKyAtb3V0ZXJUaWNrU2l6ZSArIFwiLFwiICsgcmFuZ2VbMF0gKyBcIkgwVlwiICsgcmFuZ2VbMV0gKyBcIkhcIiArIC1vdXRlclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2FzZSBcInJpZ2h0XCI6XG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieDJcIiwgaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RW50ZXIuYXR0cihcInhcIiwgdGlja0xlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVXBkYXRlLmF0dHIoXCJ4MlwiLCBpbm5lclRpY2tTaXplKS5hdHRyKFwieTJcIiwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIHRpY2tMZW5ndGgpLmF0dHIoXCJ5XCIsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC5zdHlsZShcInRleHQtYW5jaG9yXCIsIFwic3RhcnRcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICB0c3Bhbi5hdHRyKCd4JywgdGlja0xlbmd0aCkuYXR0cihcImR5XCIsIHRzcGFuRHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKFwiZFwiLCBcIk1cIiArIG91dGVyVGlja1NpemUgKyBcIixcIiArIHJhbmdlWzBdICsgXCJIMFZcIiArIHJhbmdlWzFdICsgXCJIXCIgKyBvdXRlclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChzY2FsZTEucmFuZ2VCYW5kKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4ID0gc2NhbGUxLCBkeCA9IHgucmFuZ2VCYW5kKCkgLyAyO1xuICAgICAgICAgICAgICAgICAgICBzY2FsZTAgPSBzY2FsZTEgPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHgoZCkgKyBkeDtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNjYWxlMC5yYW5nZUJhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgc2NhbGUwID0gc2NhbGUxO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tFeGl0LmNhbGwodGlja1RyYW5zZm9ybSwgc2NhbGUxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGlja0VudGVyLmNhbGwodGlja1RyYW5zZm9ybSwgc2NhbGUwKTtcbiAgICAgICAgICAgICAgICB0aWNrVXBkYXRlLmNhbGwodGlja1RyYW5zZm9ybSwgc2NhbGUxKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGF4aXMuc2NhbGUgPSBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiBzY2FsZTsgfVxuICAgICAgICAgICAgc2NhbGUgPSB4O1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMub3JpZW50ID0gZnVuY3Rpb24gKHgpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gb3JpZW50OyB9XG4gICAgICAgICAgICBvcmllbnQgPSB4IGluIHt0b3A6IDEsIHJpZ2h0OiAxLCBib3R0b206IDEsIGxlZnQ6IDF9ID8geCArIFwiXCIgOiBcImJvdHRvbVwiO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0Zvcm1hdCA9IGZ1bmN0aW9uIChmb3JtYXQpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja0Zvcm1hdDsgfVxuICAgICAgICAgICAgdGlja0Zvcm1hdCA9IGZvcm1hdDtcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tDZW50ZXJlZCA9IGZ1bmN0aW9uIChpc0NlbnRlcmVkKSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHRpY2tDZW50ZXJlZDsgfVxuICAgICAgICAgICAgdGlja0NlbnRlcmVkID0gaXNDZW50ZXJlZDtcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tPZmZzZXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGlja09mZnNldDtcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrSW50ZXJ2YWwgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgaW50ZXJ2YWwsIGxlbmd0aDtcbiAgICAgICAgICAgIGlmIChwYXJhbXMuaXNDYXRlZ29yeSkge1xuICAgICAgICAgICAgICAgIGludGVydmFsID0gdGlja09mZnNldCAqIDI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZW5ndGggPSBheGlzLmcuc2VsZWN0KCdwYXRoLmRvbWFpbicpLm5vZGUoKS5nZXRUb3RhbExlbmd0aCgpIC0gb3V0ZXJUaWNrU2l6ZSAqIDI7XG4gICAgICAgICAgICAgICAgaW50ZXJ2YWwgPSBsZW5ndGggLyBheGlzLmcuc2VsZWN0QWxsKCdsaW5lJykuc2l6ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGludGVydmFsID09PSBJbmZpbml0eSA/IDAgOiBpbnRlcnZhbDtcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrcyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja0FyZ3VtZW50czsgfVxuICAgICAgICAgICAgdGlja0FyZ3VtZW50cyA9IGFyZ3VtZW50cztcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tDdWxsaW5nID0gZnVuY3Rpb24gKGN1bGxpbmcpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja0N1bGxpbmc7IH1cbiAgICAgICAgICAgIHRpY2tDdWxsaW5nID0gY3VsbGluZztcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tWYWx1ZXMgPSBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB4ID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgdGlja1ZhbHVlcyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHgoc2NhbGUuZG9tYWluKCkpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHRpY2tWYWx1ZXM7IH1cbiAgICAgICAgICAgICAgICB0aWNrVmFsdWVzID0geDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gYXhpcztcbiAgICB9XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pc1NhZmFyaSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHVhID0gd2luZG93Lm5hdmlnYXRvci51c2VyQWdlbnQ7XG4gICAgICAgIHJldHVybiB1YS5pbmRleE9mKCdTYWZhcmknKSA+PSAwICYmIHVhLmluZGV4T2YoJ0Nocm9tZScpIDwgMDtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmlzQ2hyb21lID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgdWEgPSB3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudDtcbiAgICAgICAgcmV0dXJuIHVhLmluZGV4T2YoJ0Nocm9tZScpID49IDA7XG4gICAgfTtcblxuICAgIC8qIGpzaGludCBpZ25vcmU6c3RhcnQgKi9cblxuICAgIC8vIFBoYW50b21KUyBkb2Vzbid0IGhhdmUgc3VwcG9ydCBmb3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cnJheS5mb3JFYWNoKGZ1bmN0aW9uKHBhdGhTZWcpIHtcbiAgICAgICAgICAgICAgICAgaWYgKGZpcnN0KSB7XG4gICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IHBhdGhTZWcuX2FzUGF0aFN0cmluZygpO1xuICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IFwiIFwiICsgcGF0aFNlZy5fYXNQYXRoU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICByZXR1cm4gc3RyaW5nO1xuICAgICAgICAgfVxuXG4gICAgICAgICAvLyBUaGlzIGNsb3NlbHkgZm9sbG93cyBTVkdQYXRoUGFyc2VyOjpwYXJzZVBhdGggZnJvbSBTb3VyY2UvY29yZS9zdmcvU1ZHUGF0aFBhcnNlci5jcHAuXG4gICAgICAgICBTVkdQYXRoU2VnTGlzdC5wcm90b3R5cGUuX3BhcnNlUGF0aCA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICAgICAgIGlmICghc3RyaW5nIHx8IHN0cmluZy5sZW5ndGggPT0gMClcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuXG4gICAgICAgICAgICAgdmFyIG93bmluZ1BhdGhTZWdMaXN0ID0gdGhpcztcblxuICAgICAgICAgICAgIHZhciBCdWlsZGVyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHRoaXMucGF0aFNlZ0xpc3QgPSBbXTtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBCdWlsZGVyLnByb3RvdHlwZS5hcHBlbmRTZWdtZW50ID0gZnVuY3Rpb24ocGF0aFNlZykge1xuICAgICAgICAgICAgICAgICB0aGlzLnBhdGhTZWdMaXN0LnB1c2gocGF0aFNlZyk7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgdmFyIFNvdXJjZSA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICAgICAgICAgICB0aGlzLl9zdHJpbmcgPSBzdHJpbmc7XG4gICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCA9IDA7XG4gICAgICAgICAgICAgICAgIHRoaXMuX2VuZEluZGV4ID0gdGhpcy5fc3RyaW5nLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgdGhpcy5fcHJldmlvdXNDb21tYW5kID0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV047XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzKCk7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5faXNDdXJyZW50U3BhY2UgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdmFyIGNoYXJhY3RlciA9IHRoaXMuX3N0cmluZ1t0aGlzLl9jdXJyZW50SW5kZXhdO1xuICAgICAgICAgICAgICAgICByZXR1cm4gY2hhcmFjdGVyIDw9IFwiIFwiICYmIChjaGFyYWN0ZXIgPT0gXCIgXCIgfHwgY2hhcmFjdGVyID09IFwiXFxuXCIgfHwgY2hhcmFjdGVyID09IFwiXFx0XCIgfHwgY2hhcmFjdGVyID09IFwiXFxyXCIgfHwgY2hhcmFjdGVyID09IFwiXFxmXCIpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3NraXBPcHRpb25hbFNwYWNlcyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB3aGlsZSAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5faXNDdXJyZW50U3BhY2UoKSlcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXg7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5fc2tpcE9wdGlvbmFsU3BhY2VzT3JEZWxpbWl0ZXIgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmICF0aGlzLl9pc0N1cnJlbnRTcGFjZSgpICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSAhPSBcIixcIilcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3NraXBPcHRpb25hbFNwYWNlcygpKSB7XG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiLFwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzKCk7XG4gICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4O1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuaGFzTW9yZURhdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4O1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUucGVla1NlZ21lbnRUeXBlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHZhciBsb29rYWhlYWQgPSB0aGlzLl9zdHJpbmdbdGhpcy5fY3VycmVudEluZGV4XTtcbiAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3BhdGhTZWdUeXBlRnJvbUNoYXIobG9va2FoZWFkKTtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9wYXRoU2VnVHlwZUZyb21DaGFyID0gZnVuY3Rpb24obG9va2FoZWFkKSB7XG4gICAgICAgICAgICAgICAgIHN3aXRjaCAobG9va2FoZWFkKSB7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJaXCI6XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJ6XCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NMT1NFUEFUSDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIk1cIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcIm1cIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIkxcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcImxcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIkNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJjXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fQ1VCSUNfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiUVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX1FVQURSQVRJQ19BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJxXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIkFcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQVJDX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcImFcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQVJDX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIkhcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX0hPUklaT05UQUxfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiaFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fSE9SSVpPTlRBTF9SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJWXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19WRVJUSUNBTF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJ2XCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19WRVJUSUNBTF9SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJTXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fQ1VCSUNfU01PT1RIX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19TTU9PVEhfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiVFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX1FVQURSQVRJQ19TTU9PVEhfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwidFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX1FVQURSQVRJQ19TTU9PVEhfUkVMO1xuICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOO1xuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5fbmV4dENvbW1hbmRIZWxwZXIgPSBmdW5jdGlvbihsb29rYWhlYWQsIHByZXZpb3VzQ29tbWFuZCkge1xuICAgICAgICAgICAgICAgICAvLyBDaGVjayBmb3IgcmVtYWluaW5nIGNvb3JkaW5hdGVzIGluIHRoZSBjdXJyZW50IGNvbW1hbmQuXG4gICAgICAgICAgICAgICAgIGlmICgobG9va2FoZWFkID09IFwiK1wiIHx8IGxvb2thaGVhZCA9PSBcIi1cIiB8fCBsb29rYWhlYWQgPT0gXCIuXCIgfHwgKGxvb2thaGVhZCA+PSBcIjBcIiAmJiBsb29rYWhlYWQgPD0gXCI5XCIpKSAmJiBwcmV2aW91c0NvbW1hbmQgIT0gU1ZHUGF0aFNlZy5QQVRIU0VHX0NMT1NFUEFUSCkge1xuICAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZpb3VzQ29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX0FCUylcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19BQlM7XG4gICAgICAgICAgICAgICAgICAgICBpZiAocHJldmlvdXNDb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fUkVMKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1JFTDtcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwcmV2aW91c0NvbW1hbmQ7XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuaW5pdGlhbENvbW1hbmRJc01vdmVUbyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgcGF0aCBpcyBlbXB0eSBpdCBpcyBzdGlsbCB2YWxpZCwgc28gcmV0dXJuIHRydWUuXG4gICAgICAgICAgICAgICAgIGlmICghdGhpcy5oYXNNb3JlRGF0YSgpKVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgIHZhciBjb21tYW5kID0gdGhpcy5wZWVrU2VnbWVudFR5cGUoKTtcbiAgICAgICAgICAgICAgICAgLy8gUGF0aCBtdXN0IHN0YXJ0IHdpdGggbW92ZVRvLlxuICAgICAgICAgICAgICAgICByZXR1cm4gY29tbWFuZCA9PSBTVkd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AgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICBlbHNlIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCItXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgc2lnbiA9IC0xO1xuICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA9PSB0aGlzLl9lbmRJbmRleCB8fCAoKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8IFwiMFwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+IFwiOVwiKSAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgIT0gXCIuXCIpKVxuICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIGZpcnN0IGNoYXJhY3RlciBvZiBhIG51bWJlciBtdXN0IGJlIG9uZSBvZiBbMC05Ky0uXS5cbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgLy8gUmVhZCB0aGUgaW50ZWdlciBwYXJ0LCBidWlsZCByaWdodC10by1sZWZ0LlxuICAgICAgICAgICAgICAgICB2YXIgc3RhcnRJbnRQYXJ0SW5kZXggPSB0aGlzLl9jdXJyZW50SW5kZXg7XG4gICAgICAgICAgICAgICAgIHdoaWxlICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPj0gXCIwXCIgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDw9IFwiOVwiKVxuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7IC8vIEFkdmFuY2UgdG8gZmlyc3Qgbm9uLWRpZ2l0LlxuXG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggIT0gc3RhcnRJbnRQYXJ0SW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgIHZhciBzY2FuSW50UGFydEluZGV4ID0gdGhpcy5fY3VycmVudEluZGV4IC0gMTtcbiAgICAgICAgICAgICAgICAgICAgIHZhciBtdWx0aXBsaWVyID0gMTtcbiAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChzY2FuSW50UGFydEluZGV4ID49IHN0YXJ0SW50UGFydEluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgaW50ZWdlciArPSBtdWx0aXBsaWVyICogKHRoaXMuX3N0cmluZy5jaGFyQXQoc2NhbkludFBhcnRJbmRleC0tKSAtIFwiMFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICBtdWx0aXBsaWVyICo9IDEwO1xuICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgLy8gUmVhZCB0aGUgZGVjaW1hbHMuXG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCIuXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuXG4gICAgICAgICAgICAgICAgICAgICAvLyBUaGVyZSBtdXN0IGJlIGEgbGVhc3Qgb25lIGRpZ2l0IGZvbGxvd2luZyB0aGUgLlxuICAgICAgICAgICAgICAgICAgICAgaWYgKHR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KSAhPSBcIm1cIikpIHtcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuXG4gICAgICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBzaWduIG9mIHRoZSBleHBvbmVudC5cbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCIrXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiLVwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXhwc2lnbiA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAvLyBUaGVyZSBtdXN0IGJlIGFuIGV4cG9uZW50LlxuICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA+PSB0aGlzLl9lbmRJbmRleCB8fCB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPCBcIjBcIiB8fCB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPiBcIjlcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuXG4gICAgICAgICAgICAgICAgICAgICB3aGlsZSAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID49IFwiMFwiICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8PSBcIjlcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgIGV4cG9uZW50ICo9IDEwO1xuICAgICAgICAgICAgICAgICAgICAgICAgIGV4cG9uZW50ICs9ICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgLSBcIjBcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICB2YXIgbnVtYmVyID0gaW50ZWdlciArIGRlY2ltYWw7XG4gICAgICAgICAgICAgICAgIG51bWJlciAqPSBzaWduO1xuXG4gICAgICAgICAgICAgICAgIGlmIChleHBvbmVudClcbiAgICAgICAgICAgICAgICAgICAgIG51bWJlciAqPSBNYXRoLnBvdygxMCwgZXhwc2lnbiAqIGV4cG9uZW50KTtcblxuICAgICAgICAgICAgICAgICBpZiAoc3RhcnRJbmRleCA9PSB0aGlzLl9jdXJyZW50SW5kZXgpXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3NraXBPcHRpb25hbFNwYWNlc09yRGVsaW1pdGVyKCk7XG5cbiAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9wYXJzZUFyY0ZsYWcgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA+PSB0aGlzLl9lbmRJbmRleClcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgIHZhciBmbGFnID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgIHZhciBmbGFnQ2hhciA9IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KyspO1xuICAgICAgICAgICAgICAgICBpZiAoZmxhZ0NoYXIgPT0gXCIwXCIpXG4gICAgICAgICAgICAgICAgICAgICBmbGFnID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZsYWdDaGFyID09IFwiMVwiKVxuICAgICAgICAgICAgICAgICAgICAgZmxhZyA9IHRydWU7XG4gICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzT3JEZWxpbWl0ZXIoKTtcbiAgICAgICAgICAgICAgICAgcmV0dXJuIGZsYWc7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5wYXJzZVNlZ21lbnQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdmFyIGxvb2thaGVhZCA9IHRoaXMuX3N0cmluZ1t0aGlzLl9jdXJyZW50SW5kZXhdO1xuICAgICAgICAgICAgICAgICB2YXIgY29tbWFuZCA9IHRoaXMuX3BhdGhTZWdUeXBlRnJvbUNoYXIobG9va2FoZWFkKTtcbiAgICAgICAgICAgICAgICAgaWYgKGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV04pIHtcbiAgICAgICAgICAgICAgICAgICAgIC8vIFBvc3NpYmx5IGFuIGltcGxpY2l0IGNvbW1hbmQuIE5vdCBhbGxvd2VkIGlmIHRoaXMgaXMgdGhlIGZpcnN0IGNvbW1hbmQuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fcHJldmlvdXNDb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgY29tbWFuZCA9IHRoaXMuX25leHRDb21tYW5kSGVscGVyKGxvb2thaGVhZCwgdGhpcy5fcHJldmlvdXNDb21tYW5kKTtcbiAgICAgICAgICAgICAgICAgICAgIGlmIChjb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICB0aGlzLl9wcmV2aW91c0NvbW1hbmQgPSBjb21tYW5kO1xuXG4gICAgICAgICAgICAgICAgIHN3aXRjaCAoY29tbWFuZCkge1xuICAgICAgICAgICAgICAgICBjYXNlIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fUkVMOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTVkdQYXRoU2VnTW92ZXRvUmVsKG93bmluZ1BhdGhTZWdMaXN0LCB0aGlzLl9wYXJzZU51bWJlcigpLCB0aGlzLl9wYXJzZU51bWJlcigpKTtcbiAgICAgICAgICAgICAgICAgY2FzZSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX0FCUzpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU1ZHUGF0aFNlZ01vdmV0b0Ficyhvd25pbmdQYXRoU2VnTGlzdCwgdGhpcy5fcGFyc2VOdW1iZXIoKSwgdGhpcy5fcGFyc2VOdW1iZXIoKSk7XG4gICAgICAgICAgICAgICAgIGNhc2UgU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19SRUw6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNWR1BhdGhTZWdMaW5ldG9SZWwob3duaW5nUGF0aFNlZ0xpc3QsIHRoaXMuX3BhcnNlTnVtYmVyKCksIHRoaXMuX3BhcnNlTnVtYmVyKCkpO1xuICAgICA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aGlzLl9wYXJzZUFyY0ZsYWcoKSwgeDogdGhpcy5fcGFyc2VOdW1iZXIoKSwgeTogdGhpcy5fcGFyc2VOdW1iZXIoKX07XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNWR1BhdGhTZWdBcmNBYnMob3duaW5nUGF0aFNlZ0xpc3QsIHBvaW50cy54LCBwb2ludHMueSwgcG9pbnRzLngxLCBwb2ludHMueTEsIHBvaW50cy5hcmNBbmdsZSwgcG9pbnRzLmFyY0xhcmdlLCBwb2ludHMuYXJjU3dlZXApO1xuICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgdGhyb3cgXCJVbmtub3duIHBhdGggc2VnIHR5cGUuXCJcbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIHZhciBidWlsZGVyID0gbmV3IEJ1aWxkZXIoKTtcbiAgICAgICAgICAgICB2YXIgc291cmNlID0gbmV3IFNvdXJjZShzdHJpbmcpO1xuXG4gICAgICAgICAgICAgaWYgKCFzb3VyY2UuaW5pdGlhbENvbW1hbmRJc01vdmVUbygpKVxuICAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICAgd2hpbGUgKHNvdXJjZS5oYXNNb3JlRGF0YSgpKSB7XG4gICAgICAgICAgICAgICAgIHZhciBwYXRoU2VnID0gc291cmNlLnBhcnNlU2VnbWVudCgpO1xuICAgICAgICAgICAgICAgICBpZiAoIXBhdGhTZWcpXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICAgICAgIGJ1aWxkZXIuYXBwZW5kU2VnbWVudChwYXRoU2VnKTtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICByZXR1cm4gYnVpbGRlci5wYXRoU2VnTGlzdDtcbiAgICAgICAgIH1cbiAgICAgfVxuICAgIH0oKSk7XG5cbiAgICAvKiBqc2hpbnQgaWdub3JlOmVuZCAqL1xuX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wgZikge1xuICAgIHZhciBudW1iZXJzID0gW10sIG4gPSBhcnJheS5sZW5ndGgsIGEsIGkgPSAtMTtcbiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmIChkM19udW1lcmljKGEgPSBkM19udW1iZXIoYXJyYXlbaV0pKSkgbnVtYmVycy5wdXNoKGEpO1xuICAgIH0gZWxzZSB7XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKGQzX251bWVyaWMoYSA9IGQzX251bWJlcihmLmNhbGwoYXJyYXksIGFycmF5W2ldLCBpKSkpKSBudW1iZXJzLnB1c2goYSk7XG4gICAgfVxuICAgIGlmIChudW1iZXJzLmxlbmd0aCkgcmV0dXJuIGQzLnF1YW50aWxlKG51bWJlcnMuc29ydChkM19hc2NlbmRpbmcpLCAuNSk7XG4gIH07XG4gIGQzLnZhcmlhbmNlID0gZnVuY3Rpb24oYXJyYXksIGYpIHtcbiAgICB2YXIgbiA9IGFycmF5Lmxlbmd0aCwgbSA9IDAsIGEsIGQsIHMgPSAwLCBpID0gLTEsIGogPSAwO1xuICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxKSB7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBpZiAoZDNfbnVtZXJpYyhhID0gZDNfbnVtYmVyKGFycmF5W2ldKSkpIHtcbiAgICAgICAgICBkID0gYSAtIG07XG4gICAgICAgICAgbSArPSBkIC8gKytqO1xuICAgICAgICAgIHMgKz0gZCAqIChhIC0gbSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgaWYgKGQzX251bWVyaWMoYSA9IGQzX251bWJlcihmLmNhbGwoYXJyYXksIGFycmF5W2ldLCBpKSkpKSB7XG4gICAgICAgICAgZCA9IGEgLSBtO1xuICAgICAgICAgIG0gKz0gZCAvICsrajtcbiAgIC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G4gICAgICAgICAgfSBlbHNlIGlmIChub2RlICE9PSB0cnVlKSB7XG4gICAgICAgICAgICB1cGRhdGVOb2Rlc1tpXSA9IG5vZGU7XG4gICAgICAgICAgICBub2RlLl9fZGF0YV9fID0gbm9kZURhdGE7XG4gICAgICAgICAgfVxuICAgICAgICAgIG5vZGVCeUtleVZhbHVlLnNldChrZXlWYWx1ZSwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChpID0gLTE7ICsraSA8IG47ICkge1xuICAgICAgICAgIGlmIChpIGluIGtleVZhbHVlcyAmJiBub2RlQnlLZXlWYWx1ZS5nZXQoa2V5VmFsdWVzW2ldKSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgZXhpdE5vZGVzW2ldID0gZ3JvdXBbaV07XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBmb3IgKGkgPSAtMTsgKytpIDwgbjA7ICkge1xuICAgICAgICAgIG5vZGUgPSBncm91cFtpXTtcbiAgICAgICAgICBub2RlRGF0YSA9IGdyb3VwRGF0YVtpXTtcbiAgICAgICAgICBpZiAobm9kZSkge1xuICAgICAgICAgICAgbm9kZS5fX2RhdGFfXyA9IG5vZGVEYXRhO1xuICAgICAgICAgICAgdXBkYXRlTm9kZXNbaV0gPSBub2RlO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBlbnRlck5vZGVzW2ldID0gZDNfc2VsZWN0aW9uX2RhdGFOb2RlKG5vZGVEYXRhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZm9yICg7aSA8IG07ICsraSkge1xuICAgICAgICAgIGVudGVyTm9kZXNbaV0gPSBkM19zZWxlY3Rpb25fZGF0YU5vZGUoZ3JvdXBEYXRhW2ldKTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKDtpIDwgbjsgKytpKSB7XG4gICAgICAgICAgZXhpdE5vZGVzW2ldID0gZ3JvdXBbaV07XG4g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V3aGVlbFwiKSA6IChkM19iZWhhdmlvcl96b29tRGVsdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIC1kMy5ldmVudC5kZXRhaWw7XG4gICAgICB9LCBcIk1vek1vdXNlUGl4ZWxTY3JvbGxcIik7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHpvb20oZykge1xuICAgICAgZy5vbihtb3VzZWRvd24sIG1vdXNlZG93bmVkKS5vbihkM19iZWhhdmlvcl96b29tV2hlZWwgKyBcIi56b29tXCIsIG1vdXNld2hlZWxlZCkub24oXCJkYmxjbGljay56b29tXCIsIGRibGNsaWNrZWQpLm9uKHRvdWNoc3RhcnQsIHRvdWNoc3RhcnRlZCk7XG4gICAgfVxuICAgIHpvb20uZXZlbnQgPSBmdW5jdGlvbihnKSB7XG4gICAgICBnLmVhY2goZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciBkaXNwYXRjaCA9IGV2ZW50Lm9mKHRoaXMsIGFyZ3VtZW50cyksIHZpZXcxID0gdmlldztcbiAgICAgICAgaWYgKGQzX3RyYW5zaXRpb25Jbmhlcml0SWQpIHtcbiAgICAgICAgICBkMy5zZWxlY3QodGhpcykudHJhbnNpdGlvbigpLmVhY2goXCJzdGFydC56b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmlldyA9IHRoaXMuX19jaGFydF9fIHx8IHtcbiAgICAgICAgICAgICAgeDogMCxcbiAgICAgICAgICAgICAgeTogMCxcbiAgICAgICAgICAgICAgazogMVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHpvb21zdGFydGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB9KS50d2VlbihcInpvb206em9vbVwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBkeCA9IHNpemVbMF0sIGR5ID0gc2l6ZVsxXSwgY3ggPSBjZW50ZXIwID8gY2VudGVyMFswXSA6IGR4IC8gMiwgY3kgPSBjZW50ZXIwID8gY2VudGVyMFsxXSA6IGR5IC8gMiwgaSA9IGQzLmludGVycG9sYXRlWm9vbShbIChjeCAtIHZpZXcueCkgLyB2aWV3LmssIChjeSAtIHZpZXcueSkgLyB2aWV3LmssIGR4IC8gdmlldy5rIF0sIFsgKGN4IC0gdmlldzEueCkgLyB2aWV3MS5rLCAoY3kgLSB2aWV3MS55KSAvIHZpZXcxLmssIGR4IC8gdmlldzEuayBdKTtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbih0KSB7XG4gICAgICAgICAgICAgIHZhciBsID0gaSh0KSwgayA9IGR4IC8gbFsyXTtcbiAgICAgICAgICAgICAgdGhpcy5fX2NoYXJ0X18gPSB2aWV3ID0ge1xuICAgICAgICAgICAgICAgIHg6IGN4IC0gbFswXSAqIGssXG4gICAgICAgICAgICAgICAgeTogY3kgLSBsWzFdICogayxcbiAgICAgICAgICAgICAgICBrOiBrXG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIHpvb21lZChkaXNwYXRjaCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pLmVhY2goXCJpbnRlcnJ1cHQuem9vbVwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSkuZWFjaChcImVuZC56b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgem9vbWVuZGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aGlzLl9fY2hhcnRfXyA9IHZpZXc7XG4gICAgICAgICAgem9vbXN0YXJ0ZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIHpvb21lZChkaXNwYXRjaCk7XG4gICAgICAgICAgem9vbWVuZGVkKGRpc3BhdGNoKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfTtcbiAgICB6b29tLnRyYW5zbGF0ZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIFsgdmlldy54LCB2aWV3LnkgXTtcbiAgICAgIHZpZXcgPSB7XG4gICAgICAgIHg6ICtfWzBdLFxuICAgICAgICB5OiArX1sxXSxcbiAgICAgICAgazogdmlldy5rXG4gICAgICB9O1xuICAgICAgcmVzY2FsZSgpO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNjYWxlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdmlldy5rO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogdmlldy54LFxuICAgICAgICB5OiB2aWV3LnksXG4gICAgICAgIGs6IG51bGxcbiAgICAgIH07XG4gICAgICBzY2FsZVRvKCtfKTtcbiAgICAgIHJlc2NhbGUoKTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5zY2FsZUV4dGVudCA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNjYWxlRXh0ZW50O1xuICAgICAgc2NhbGVFeHRlbnQgPSBfID09IG51bGwgPyBkM19iZWhhdmlvcl96b29tSW5maW5pdHkgOiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLmNlbnRlciA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNlbnRlcjtcbiAgICAgIGNlbnRlciA9IF8gJiYgWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5zaXplID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2l6ZTtcbiAgICAgIHNpemUgPSBfICYmIFsgK19bMF0sICtfWzFdIF07XG4gICA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uYW1lLCBpKSB7XG4gICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KG5hbWUpICsgXCI6IGRbXCIgKyBpICsgXCJdXCI7XG4gICAgICAgIH0pLmpvaW4oXCIsXCIpICsgXCJ9XCIpO1xuICAgICAgICBvID0gZiA/IGZ1bmN0aW9uKHJvdywgaSkge1xuICAgICAgICAgIHJldHVybiBmKGEocm93KSwgaSk7XG4gICAgICAgIH0gOiBhO1xuICAgICAgfSk7XG4gICAgfTtcbiAgICBkc3YucGFyc2VSb3dzID0gZnVuY3Rpb24odGV4dCwgZikge1xuICAgICAgdmFyIEVPTCA9IHt9LCBFT0YgPSB7fSwgcm93cyA9IFtdLCBOID0gdGV4dC5sZW5ndGgsIEkgPSAwLCBuID0gMCwgdCwgZW9sO1xuICAgICAgZnVuY3Rpb24gdG9rZW4oKSB7XG4gICAgICAgIGlmIChJID49IE4pIHJldHVybiBFT0Y7XG4gICAgICAgIGlmIChlb2wpIHJldHVybiBlb2wgPSBmYWxzZSwgRU9MO1xuICAgICAgICB2YXIgaiA9IEk7XG4gICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaikgPT09IDM0KSB7XG4gICAgICAgICAgdmFyIGkgPSBqO1xuICAgICAgICAgIHdoaWxlIChpKysgPCBOKSB7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGkpID09PSAzNCkge1xuICAgICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGkgKyAxKSAhPT0gMzQpIGJyZWFrO1xuICAgICAgICAgICAgICArK2k7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIEkgPSBpICsgMjtcbiAgICAgICAgICB2YXIgYyA9IHRleHQuY2hhckNvZGVBdChpICsgMSk7XG4gICAgICAgICAgaWYgKGMgPT09IDEzKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpICsgMikgPT09IDEwKSArK0k7XG4gICAgICAgICAgfSBlbHNlIGlmIChjID09PSAxMCkge1xuICAgICAgICAgICAgZW9sID0gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHRleHQuc2xpY2UoaiArIDEsIGkpLnJlcGxhY2UoL1wiXCIvZywgJ1wiJyk7XG4gICAgICAgIH1cbiAgICAgICAgd2hpbGUgKEkgPCBOKSB7XG4gICAgICAgICAgdmFyIGMgPSB0ZXh0LmNoYXJDb2RlQXQoSSsrKSwgayA9IDE7XG4gICAgICAgICAgaWYgKGMgPT09IDEwKSBlb2wgPSB0cnVlOyBlbHNlIGlmIChjID09PSAxMykge1xuICAgICAgICAgICAgZW9sID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoSSkgPT09IDEwKSArK0ksICsraztcbiAgICAgICAgICB9IGVsc2UgaWYgKGMgIT09IGRlbGltaXRlckNvZGUpIGNvbnRpbnVlO1xuICAgICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGosIEkgLSBrKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqKTtcbiAgICAgIH1cbiAgICAgIHdoaWxlICgodCA9IHRva2VuKCkpICE9PSBFT0YpIHtcbiAgICAgICAgdmFyIGEgPSBbXTtcbiAgICAgICAgd2hpbGUgKHQgIT09IEVPTCAmJiB0ICE9PSBFT0YpIHtcbiAgICAgICAgICBhLnB1c2godCk7XG4gICAgICAgICAgdCA9IHRva2VuKCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGYgJiYgKGEgPSBmKGEsIG4rKykpID09IG51bGwpIGNvbnRpbnVlO1xuICAgICAgICByb3dzLnB1c2goYSk7XG4gICAgICB9XG4gICAgICByZXR1cm4gcm93cztcbiAgICB9O1xuICAgIGRzdi5mb3JtYXQgPSBmdW5jdGlvbihyb3dzKSB7XG4gICAgICBpZiAoQXJyYXkuaXNBcnJheShyb3dzWzBdKSk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CwgZjtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBpZiAodGVtcGxhdGUuY2hhckNvZGVBdChpKSA9PT0gMzcpIHtcbiAgICAgICAgICAgIHN0cmluZy5wdXNoKHRlbXBsYXRlLnNsaWNlKGosIGkpKTtcbiAgICAgICAgICAgIGlmICgocCA9IGQzX3RpbWVfZm9ybWF0UGFkc1tjID0gdGVtcGxhdGUuY2hhckF0KCsraSldKSAhPSBudWxsKSBjID0gdGVtcGxhdGUuY2hhckF0KCsraSk7XG4gICAgICAgICAgICBpZiAoZiA9IGQzX3RpbWVfZm9ybWF0c1tjXSkgYyA9IGYoZGF0ZSwgcCA9PSBudWxsID8gYyA9PT0gXCJlXCIgPyBcIiBcIiA6IFwiMFwiIDogcCk7XG4gICAgICAgICAgICBzdHJpbmcucHVzaChjKTtcbiAgICAgICAgICAgIGogPSBpICsgMTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgc3RyaW5nLnB1c2godGVtcGxhdGUuc2xpY2UoaiwgaSkpO1xuICAgICAgICByZXR1cm4gc3RyaW5nLmpvaW4oXCJcIik7XG4gICAgICB9XG4gICAgICBmb3JtYXQucGFyc2UgPSBmdW5jdGlvbihzdHJpbmcpIHtcbiAgICAgICAgdmFyIGQgPSB7XG4gICAgICAgICAgeTogMTkwMCxcbiAgICAgICAgICBtOiAwLFxuICAgICAgICAgIGQ6IDEsXG4gICAgICAgICAgSDogMCxcbiAgICAgICAgICBNOiAwLFxuICAgICAgICAgIFM6IDAsXG4gICAgICAgICAgTDogMCxcbiAgICAgICAgICBaOiBudWxsXG4gICAgICAgIH0sIGkgPSBkM190aW1lX3BhcnNlKGQsIHRlbXBsYXRlLCBzdHJpbmcsIDApO1xuICAgICAgICBpZiAoaSAhPSBzdHJpbmcubGVuZ3RoKSByZXR1cm4gbnVsbDtcbiAgICAgICAgaWYgKFwicFwiIGluIGQpIGQuSCA9IGQuSCAlIDEyICsgZC5wICogMTI7XG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gPSAtaW5mbGVjdGlvblsxXSAqIGQzX2RlZ3JlZXM7XG4gICAgICAgICAgaWYgKM+GaSA8IM+GMCkgz4YwID0gz4ZpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICjPhiA8IM+GMCkgz4YwID0gz4Y7XG4gICAgICAgICAgaWYgKM+GID4gz4YxKSDPhjEgPSDPhjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYW50aW1lcmlkaWFuKSB7XG4gICAgICAgICAgaWYgKM67IDwgzrtfKSB7XG4gICAgICAgICAgICBpZiAoYW5nbGUozrswLCDOuykgPiBhbmdsZSjOuzAsIM67MSkpIM67MSA9IM67O1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoYW5nbGUozrssIM67MSkgPiBhbmdsZSjOuzAsIM67MSkpIM67MCA9IM67O1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAozrsxID49IM67MCkge1xuICAgICAgICAgICAgaWYgKM67IDwgzrswKSDOuzAgPSDOuztcbiAgICAgICAgICAgIGlmICjOuyA+IM67MSkgzrsxID0gzrs7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICjOuyA+IM67Xykge1xuICAgICAgICAgICAgICBpZiAoYW5nbGUozrswLCDOuykgPiBhbmdsZSjOuzAsIM67MSkpIM67MSA9IM67O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKGFuZ2xlKM67LCDOuzEpID4gYW5nbGUozrswLCDOuzEpKSDOuzAgPSDOuztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHBvaW50KM67LCDPhik7XG4gICAgICB9XG4gICAgICBwMCA9IHAsIM67XyA9IM67O1xuICAgIH1cbiAgICBmdW5jdGlvbiBsaW5lU3RhcnQoKSB7XG4gICAgICBib3VuZC5wb2ludCA9IG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mluZyA9IFtdO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcmluZ0VuZCgpIHtcbiAgICAgICAgcG9pbnRSaW5nKHJpbmdbMF1bMF0sIHJpbmdbMF1bMV0pO1xuICAgICAgICByaW5nTGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICB2YXIgY2xlYW4gPSByaW5nTGlzdGVuZXIuY2xlYW4oKSwgcmluZ1NlZ21lbnRzID0gYnVmZmVyLmJ1ZmZlcigpLCBzZWdtZW50LCBuID0gcmluZ1NlZ21lbnRzLmxlbmd0aDtcbiAgICAgICAgcmluZy5wb3AoKTtcbiAgICAgICAgcG9seWdvbi5wdXNoKHJpbmcpO1xuICAgICAgICByaW5nID0gbnVsbDtcbiAgICAgICAgaWYgKCFuKSByZXR1cm47XG4gICAgICAgIGlmIChjbGVhbiAmIDEpIHtcbiAgICAgICAgICBzZWdtZW50ID0gcmluZ1NlZ21lbnRzWzBdO1xuICAgICAgICAgIHZhciBuID0gc2VnbWVudC5sZW5ndGggLSAxLCBpID0gLTEsIHBvaW50O1xuICAgICAgICAgIGlmIChuID4gMCkge1xuICAgICAgICAgICAgaWYgKCFwb2x5Z29uU3RhcnRlZCkgbGlzdGVuZXIucG9seWdvblN0YXJ0KCksIHBvbHlnb25TdGFydGVkID0gdHJ1ZTtcbiAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgd2hpbGUgKCsraSA8IG4pIGxpc3RlbmVyLnBvaW50KChwb2ludCA9IHNlZ21lbnRbaV0pWzBdLCBwb2ludFsxXSk7XG4gICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAobiA+IDEgJiYgY2xlYW4gJiAyKSByaW5nU2VnbWVudHMucHVzaChyaW5nU2VnbWVudHMucG9wKCkuY29uY2F0KHJpbmdTZWdtZW50cy5zaGlmdCgpKSk7X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CA6IC3PgCksIM+GKSA6IDA7XG4gICAgICAgICAgaWYgKCFwb2ludDAgJiYgKHYwMCA9IHYwID0gdikpIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MCwgcG9pbnQxKTtcbiAgICAgICAgICAgIGlmIChkM19nZW9fc3BoZXJpY2FsRXF1YWwocG9pbnQwLCBwb2ludDIpIHx8IGQzX2dlb19zcGhlcmljYWxFcXVhbChwb2ludDEsIHBvaW50MikpIHtcbiAgICAgICAgICAgICAgcG9pbnQxWzBdICs9IM61O1xuICAgICAgICAgICAgICBwb2ludDFbMV0gKz0gzrU7XG4gICAgICAgICAgICAgIHYgPSB2aXNpYmxlKHBvaW50MVswXSwgcG9pbnQxWzFdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHYgIT09IHYwKSB7XG4gICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MSwgcG9pbnQwKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MCwgcG9pbnQxKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0pO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwb2ludDAgPSBwb2ludDI7XG4gICAgICAgICAgfSBlbHNlIGlmIChub3RIZW1pc3BoZXJlICYmIHBvaW50MCAmJiBzbWFsbFJhZGl1cyBeIHYpIHtcbiAgICAgICAgICAgIHZhciB0O1xuICAgICAgICAgICAgaWYgKCEoYyAmIGMwKSAmJiAodCA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCwgdHJ1ZSkpKSB7XG4gICAgICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgICAgICAgaWYgKHNtYWxsUmFkaXVzKSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFswXVswXSwgdFswXVsxXSk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMV1bMF0sIHRbMV1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzBdWzBdLCB0WzBdWzFdKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodiAmJiAoIXBvaW50MCB8fCAhZDNfZ2VvX3NwaGVyaWNhbEVxdWFsKHBvaW50MCwgcG9pbnQxKSkpIHtcbiAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MVswXSwgcG9pbnQxWzFdKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcG9pbnQwID0gcG9pbnQxLCB2MCA9IHYsIGMwID0gYztcbiAgICAgICAgfSxcbiAgICAgICAgbGluZUVuZDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgaWYgKHYwKSBsaXN0ZW5lci5saW5lRW5k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OiDPgCAtIHJhZGl1cywgY29kZSA9IDA7XG4gICAgICBpZiAozrsgPCAtcikgY29kZSB8PSAxOyBlbHNlIGlmICjOuyA+IHIpIGNvZGUgfD0gMjtcbiAgICAgIGlmICjPhiA8IC1yKSBjb2RlIHw9IDQ7IGVsc2UgaWYgKM+GID4gcikgY29kZSB8PSA4O1xuICAgICAgcmV0dXJuIGNvZGU7XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb21fY2xpcExpbmUoeDAsIHkwLCB4MSwgeTEpIHtcbiAgICByZXR1cm4gZnVuY3Rpb24obGluZSkge1xuICAgICAgdmFyIGEgPSBsaW5lLmEsIGIgPSBsaW5lLmIsIGF4ID0gYS54LCBheSA9IGEueSwgYnggPSBiLngsIGJ5ID0gYi55LCB0MCA9IDAsIHQxID0gMSwgZHggPSBieCAtIGF4LCBkeSA9IGJ5IC0gYXksIHI7XG4gICAgICByID0geDAgLSBheDtcbiAgICAgIGlmICghZHggJiYgciA+IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHg7XG4gICAgICBpZiAoZHggPCAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeCA+IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9XG4gICAgICByID0geDEgLSBheDtcbiAgICAgIGlmICghZHggJiYgciA8IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHg7XG4gICAgICBpZiAoZHggPCAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeCA+IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9XG4gICAgICByID0geTAgLSBheTtcbiAgICAgIGlmICghZHkgJiYgciA+IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHk7XG4gICAgICBpZiAoZHkgPCAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeSA+IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9XG4gICAgICByID0geTEgLSBheTtcbiAgICAgIGlmICghZHkgJiYgciA8IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHk7XG4gICAgICBpZiAoZHkgPCAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeSA+IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9XG4gICAgICBpZiAodDAgPiAwKSBsaW5lLmEgPSB7XG4gICAgICAgIHg6IGF4ICsgdDAgKiBkeCxcbiAgICAgICAgeTogYXkgKyB0MCAqIGR5XG4gICAgICB9O1xuICAgICAgaWYgKHQxIDwgMSkgbGluZS5iID0ge1xuICAgICAgICB4OiBheCArIHQxICogZHgsXG4gICAgICAgIHk6IGF5ICsgdDEgKiBkeVxuICAgICAgfTtcbiAgICAgIHJldHVybiBsaW5lO1xuICAgIH07XG4gIH1cbiAgdmFyIGQzX2dlb19jbGlwRXh0ZW50TUFYID0gMWU5O1xuICBkMy5nZW8uY2xpcEV4dGVudCA9IGZ1bmN0aW9uKCkge1xuICAgIHZhciB4MCwgeTAsIHgxLCB5MSwgc3RyZWFtLCBjbGlwLCBjbGlwRXh0ZW50ID0ge1xuICAgICAgc3RyZWFtOiBmdW5jdG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KCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNlZ21lbnRzID0gcG9seWdvbiA9IHJpbmcgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24gaW5zaWRlUG9seWdvbihwKSB7XG4gICAgICAgIHZhciB3biA9IDAsIG4gPSBwb2x5Z29uLmxlbmd0aCwgeSA9IHBbMV07XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgZm9yICh2YXIgaiA9IDEsIHYgPSBwb2x5Z29uW2ldLCBtID0gdi5sZW5ndGgsIGEgPSB2WzBdLCBiOyBqIDwgbTsgKytqKSB7XG4gICAgICAgICAgICBiID0gdltqXTtcbiAgICAgICAgICAgIGlmIChhWzFdIDw9IHkpIHtcbiAgICAgICAgICAgICAgaWYgKGJbMV0gPiB5ICYmIGQzX2Nyb3NzMmQoYSwgYiwgcCkgPiAwKSArK3duO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKGJbMV0gPD0geSAmJiBkM19jcm9zczJkKGEsIGIsIHApIDwgMCkgLS13bjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gd24gIT09IDA7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBpbnRlcnBvbGF0ZShmcm9tLCB0bywgZGlyZWN0aW9uLCBsaXN0ZW5lcikge1xuICAgICAgICB2YXIgYSA9IDAsIGExID0gMDtcbiAgICAgICAgaWYgKGZyb20gPT0gbnVsbCB8fCAoYSA9IGNvcm5lcihmcm9tLCBkaXJlY3Rpb24pKSAhPT0gKGExID0gY29ybmVyKHRvLCBkaXJlY3Rpb24pKSB8fCBjb21wYXJlUG9pbnRzKGZyb20sIHRvKSA8IDAgXiBkaXJlY3Rpb24gPiAwKSB7XG4gICAgICAgICAgZG8ge1xuICAgICAgICAgICAgbG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xuICAgICAgICBjbGlwLnBvaW50ID0gcG9pbnQ7XG4gICAgICAgIGlmICh2XykgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZVBvaW50KHgsIHkpIHtcbiAgICAgICAgeCA9IE1hdGgubWF4KC1kM19nZW9fY2xpcEV4dGVudE1BWCwgTWF0aC5taW4oZDNfZ2VvX2NsaXBFeHRlbnRNQVgsIHgpKTtcbiAgICAgICAgeSA9IE1hdGgubWF4KC1kM19nZW9fY2xpcEV4dGVudE1BWCwgTWF0aC5taW4oZDNfZ2VvX2NsaXBFeHRlbnRNQVgsIHkpKTtcbiAgICAgICAgdmFyIHYgPSBwb2ludFZpc2libGUoeCwgeSk7XG4gICAgICAgIGlmIChwb2x5Z29uKSByaW5nLnB1c2goWyB4LCB5IF0pO1xuICAgICAgICBpZiAoZmlyc3QpIHtcbiAgICAgICAgICB4X18gPSB4LCB5X18gPSB5LCB2X18gPSB2O1xuICAgICAgICAgIGZpcnN0ID0gZmFsc2U7XG4gICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQoeCwgeSk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICh2ICYmIHZfKSBsaXN0ZW5lci5wb2ludCh4LCB5KTsgZWxzZSB7XG4gICAgICAgICAgICB2YXIgbCA9IHtcbiAgICAgICAgICAgICAgYToge1xuICAgICAgICAgICAgICAgIHg6IHhfLFxuICAgICAgICAgICAgICAgIHk6IHlfXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGI6IHtcbiAgICAgICAgICAgICAgICB4OiB4LFxuICAgICAgICAgICAgICAgIHk6IHlcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChjbGlwTGluZShsKSkge1xuICAgICAgICAgICAgICBpZiAoIXZfKSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQobC5hLngsIGwuYS55KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChsLmIueCwgbC5iLnkpO1xuICAgICAgICAgICAgICBpZiAoIXYpIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgY2xlYW4gPSBmYWxzZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodikge1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQoeCwgeSk7XG4gICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHhfID0geCwgeV8gPSB5LCB2XyA9IHY7XG4gICAgICB9XG4gICAgICByZXR1cm4gY2xpcDtcbiAgICB9O1xuICAgIGZ1bmN0aW9uIGNvcm5lcihwLCBkaXJlY3Rpb24pIHtcbiAgICAgIHJldHVybiBhYnMocFswXSAtIHgwKSA8IM61ID8gZGlyZWN0aW9uID4gMCA/IDAgOiAzIDogYWJzKHBbMF0gLSB4MSkgPCDOtSA/IGRpcmVjdGlvbiA+IDAgPyAyIDogMSA6IGFicyhwWzFdIC0geTApIDwgzrUgPyBkaXJlY3Rpb24gPiAwID8gMSA6IDAgOiBkaXJlY3Rpb24gPiAwID8gMyA6IDI7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGNvbXBhcmUoYSwgYikge1xuICAgICAgcmV0dXJuIGNvbXBhcmVQb2ludHMoYS54LCBiLngpO1xuICAgIH1cbiAgICBmdW5jdGlvbiBjb21wYXJlUG9pbnRzKGEsIGIpIHtcbiAgICAgIHZhciBjYSA9IGNvcm5lcihhLCAxKSwgY2IgPSBjb3JuZXIoY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ZWRnZS5yLCBseCA9IGxTaXRlLngsIGx5ID0gbFNpdGUueSwgcnggPSByU2l0ZS54LCByeSA9IHJTaXRlLnksIGZ4ID0gKGx4ICsgcngpIC8gMiwgZnkgPSAobHkgKyByeSkgLyAyLCBmbSwgZmI7XG4gICAgaWYgKHJ5ID09PSBseSkge1xuICAgICAgaWYgKGZ4IDwgeDAgfHwgZnggPj0geDEpIHJldHVybjtcbiAgICAgIGlmIChseCA+IHJ4KSB7XG4gICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgIHg6IGZ4LFxuICAgICAgICAgIHk6IHkwXG4gICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPj0geTEpIHJldHVybjtcbiAgICAgICAgdmIgPSB7XG4gICAgICAgICAgeDogZngsXG4gICAgICAgICAgeTogeTFcbiAgICAgICAgfTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgIHg6IGZ4LFxuICAgICAgICAgIHk6IHkxXG4gICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPCB5MCkgcmV0dXJuO1xuICAgICAgICB2YiA9IHtcbiAgICAgICAgICB4OiBmeCxcbiAgICAgICAgICB5OiB5MFxuICAgICAgICB9O1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBmbSA9IChseCAtIHJ4KSAvIChyeSAtIGx5KTtcbiAgICAgIGZiID0gZnkgLSBmbSAqIGZ4O1xuICAgICAgaWYgKGZtIDwgLTEgfHwgZm0gPiAxKSB7XG4gICAgICAgIGlmIChseCA+IHJ4KSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiAoeTAgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkwXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueSA+PSB5MSkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogKHkxIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MVxuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiAoeTEgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkxXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueSA8IHkwKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiAoeTAgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkwXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKGx5IDwgcnkpIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6IHgwLFxuICAgICAgICAgICAgeTogZm0gKiB4MCArIGZiXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueCA+PSB4MSkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogeDEsXG4gICAgICAgICAgICB5OiBmbSAqIHgxICsgZmJcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogeDEsXG4gICAgICAgICAgICB5OiBmbSAqIHgxICsgZmJcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS54IDwgeDApIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6IHgwLFxuICAgICAgICAgICAgeTogZm0gKiB4MCArIGZiXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICBlZGdlLmEgPSB2YTtcbiAgICBlZGdlLmIgPSB2YjtcbiAgICByZXR1cm4gdHJ1ZTtcbiAgfVxuICBmdW5jdGlvbiBkM19nZW9tX3Zvcm9ub2lFZGdlKGxTaXRlLCByU2l0ZSkge1xuICAgIHRoaXMubCA9IGx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lci5MID0gbm9kZTtcbiAgICAgICAgcGFyZW50ID0gYWZ0ZXI7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBub2RlLlAgPSBub2RlLk4gPSBudWxsO1xuICAgICAgICB0aGlzLl8gPSBub2RlO1xuICAgICAgICBwYXJlbnQgPSBudWxsO1xuICAgICAgfVxuICAgICAgbm9kZS5MID0gbm9kZS5SID0gbnVsbDtcbiAgICAgIG5vZGUuVSA9IHBhcmVudDtcbiAgICAgIG5vZGUuQyA9IHRydWU7XG4gICAgICBhZnRlciA9IG5vZGU7XG4gICAgICB3aGlsZSAocGFyZW50ICYmIHBhcmVudC5DKSB7XG4gICAgICAgIGdyYW5kcGEgPSBwYXJlbnQuVTtcbiAgICAgICAgaWYgKHBhcmVudCA9PT0gZ3JhbmRwYS5MKSB7XG4gICAgICAgICAgdW5jbGUgPSBncmFuZHBhLlI7XG4gICAgICAgICAgaWYgKHVuY2xlICYmIHVuY2xlLkMpIHtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdW5jbGUuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZ3JhbmRwYS5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGFmdGVyID0gZ3JhbmRwYTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGFmdGVyID09PSBwYXJlbnQuUikge1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgICAgYWZ0ZXIgPSBwYXJlbnQ7XG4gICAgICAgICAgICAgIHBhcmVudCA9IGFmdGVyLlU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwYXJlbnQuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZ3JhbmRwYS5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgZ3JhbmRwYSk7XG4gICAgIC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FsZWZ0KSBuZXh0ID0gcmlnaHQ7IGVsc2UgaWYgKCFyaWdodCkgbmV4dCA9IGxlZnQ7IGVsc2UgbmV4dCA9IGQzX2dlb21fdm9yb25vaVJlZEJsYWNrRmlyc3QocmlnaHQpO1xuICAgICAgaWYgKHBhcmVudCkge1xuICAgICAgICBpZiAocGFyZW50LkwgPT09IG5vZGUpIHBhcmVudC5MID0gbmV4dDsgZWxzZSBwYXJlbnQuUiA9IG5leHQ7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLl8gPSBuZXh0O1xuICAgICAgfVxuICAgICAgaWYgKGxlZnQgJiYgcmlnaHQpIHtcbiAgICAgICAgcmVkID0gbmV4dC5DO1xuICAgICAgICBuZXh0LkMgPSBub2RlLkM7XG4gICAgICAgIG5leHQuTCA9IGxlZnQ7XG4gICAgICAgIGxlZnQuVSA9IG5leHQ7XG4gICAgICAgIGlmIChuZXh0ICE9PSByaWdodCkge1xuICAgICAgICAgIHBhcmVudCA9IG5leHQuVTtcbiAgICAgICAgICBuZXh0LlUgPSBub2RlLlU7XG4gICAgICAgICAgbm9kZSA9IG5leHQuUjtcbiAgICAgICAgICBwYXJlbnQuTCA9IG5vZGU7XG4gICAgICAgICAgbmV4dC5SID0gcmlnaHQ7XG4gICAgICAgICAgcmlnaHQuVSA9IG5leHQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgbmV4dC5VID0gcGFyZW50O1xuICAgICAgICAgIHBhcmVudCA9IG5leHQ7XG4gICAgICAgICAgbm9kZSA9IG5leHQuUjtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcmVkID0gbm9kZS5DO1xuICAgICAgICBub2RlID0gbmV4dDtcbiAgICAgIH1cbiAgICAgIGlmIChub2RlKSBub2RlLlUgPSBwYXJlbnQ7XG4gICAgICBpZiAocmVkKSByZXR1cm47XG4gICAgICBpZiAobm9kZSAmJiBub2RlLkMpIHtcbiAgICAgICAgbm9kZS5DID0gZmFsc2U7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIGRvIHtcbiAgICAgICAgaWYgKG5vZGUgPT09IHRoaXMuXykgYnJlYWs7XG4gICAgICAgIGlmIChub2RlID09PSBwYXJlbnQuTCkge1xuICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICBpZiAoc2libGluZy5DKSB7XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc2libGluZy5MICYmIHNpYmxpbmcuTC5DIHx8IHNpYmxpbmcuUiAmJiBzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgaWYgKCFzaWJsaW5nLlIgfHwgIXNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICAgIHNpYmxpbmcuTC5DID0gZmFsc2U7XG4gICAgICAgICAgICAgIHNpYmxpbmcuQyA9IHRydWU7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgc2libGluZyk7XG4gICAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IHBhcmVudC5DO1xuICAgICAgICAgICAgcGFyZW50LkMgPSBzaWJsaW5nLlIuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBub2RlID0gdGhpcy5fO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuTDtcbiAgICAgICAgICBpZiAoc2libGluZy5DKSB7XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuTDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNpYmxpbmcuTCAmJiBzaWJsaW5nLkwuQyB8fCBzaWJsaW5nLlIgJiYgc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgIGlmICghc2libGluZy5MIHx8ICFzaWJsaW5nLkwuQykge1xuICAgICAgICAgICAgICBzaWJsaW5nLlIuQyA9IGZhbHNlO1xuICAgICAgICAgICAgICBzaWJsaW5nLkMgPSB0cnVlO1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgc2libGluZyk7XG4gICAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuTDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IHBhcmVudC5DO1xuICAgICAgICAgICAgcGFyZW50LkMgPSBzaWJsaW5nLkwuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgbm9kZSA9IHRoaXMuXztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzaWJsaW5nLkMgPSB0cnVlO1xuICAgICAgICBub2RlID0gcGFyZW50O1xuICAgICAgICBwYXJlbnQgPSBwYXJlbnQuVTtcbiAgICAgIH0gd2hpbGUgKCF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0gW107XG4gICAgICAgIG4gPSBkYXRhLmxlbmd0aDtcbiAgICAgICAgaWYgKGNvbXBhdCkgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIGQgPSBkYXRhW2ldO1xuICAgICAgICAgIGlmIChkLnggPCB4MV8pIHgxXyA9IGQueDtcbiAgICAgICAgICBpZiAoZC55IDwgeTFfKSB5MV8gPSBkLnk7XG4gICAgICAgICAgaWYgKGQueCA+IHgyXykgeDJfID0gZC54O1xuICAgICAgICAgIGlmIChkLnkgPiB5Ml8pIHkyXyA9IGQueTtcbiAgICAgICAgICB4cy5wdXNoKGQueCk7XG4gICAgICAgICAgeXMucHVzaChkLnkpO1xuICAgICAgICB9IGVsc2UgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIHZhciB4XyA9ICtmeChkID0gZGF0YVtpXSwgaSksIHlfID0gK2Z5KGQsIGkpO1xuICAgICAgICAgIGlmICh4XyA8IHgxXykgeDFfID0geF87XG4gICAgICAgICAgaWYgKHlfIDwgeTFfKSB5MV8gPSB5XztcbiAgICAgICAgICBpZiAoeF8gPiB4Ml8pIHgyXyA9IHhfO1xuICAgICAgICAgIGlmICh5XyA+IHkyXykgeTJfID0geV87XG4gICAgICAgICAgeHMucHVzaCh4Xyk7XG4gICAgICAgICAgeXMucHVzaCh5Xyk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHZhciBkeCA9IHgyXyAtIHgxXywgZHkgPSB5Ml8gLSB5MV87XG4gICAgICBpZiAoZHggPiBkeSkgeTJfID0geTFfICsgZHg7IGVsc2UgeDJfID0geDFfICsgZHk7XG4gICAgICBmdW5jdGlvbiBpbnNlcnQobiwgZCwgeCwgeSwgeDEsIHkxLCB4MiwgeTIpIHtcbiAgICAgICAgaWYgKGlzTmFOKHgpIHx8IGlzTmFOKHkpKSByZXR1cm47XG4gICAgICAgIGlmIChuLmxlYWYpIHtcbiAgICAgICAgICB2YXIgbnggPSBuLngsIG55ID0gbi55O1xuICAgICAgICAgIGlmIChueCAhPSBudWxsKSB7XG4gICAgICAgICAgICBpZiAoYWJzKG54IC0geCkgKyBhYnMobnkgLSB5KSA8IC4wMSkge1xuICAgICAgICAgICAgICBpbnNlcnRDaGlsZChuLCBkLCB4LCB5LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgblBvaW50ID0gbi5wb2ludDtcbiAgICAgICAgICAgICAgbi54ID0gbi55ID0gbi5wb2ludCA9IG51bGw7XG4gICAgICAgICAgICAgIGluc2VydENoaWxkKG4sIG5Qb2ludCwgbngsIG55LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgICAgICAgIGluc2VydENoaWxkKG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbi54ID0geCwgbi55ID0geSwgbi5wb2ludCA9IGQ7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGluc2VydENoaWxkKG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gaW5zZXJ0Q2hpbGQobiwgZCwgeCwgeSwgeDEsIHkxLCB4MiwgeTIpIHtcbiAgICAgICAgdmFyIHhtID0gKHgxICsgeDIpICogLjUsIHltID0gKHkxICsgeTIpICogLjUsIHJpZ2h0ID0geCA+PSB4bSwgYmVsb3cgPSB5ID49IHltLCBpID0gYmVsb3cgPDwgMSB8IHJpZ2h0O1xuICAgICAgICBuLmxlYWYgPSBmYWxzZTtcbiAgICAgICAgbiA9IG4ubm9kZXNbaV0gfHwgKG4ubm9kZXNbaV0gPSBkM19nZW9tX3F1YWR0cmVlTm9kZSgpKTtcbiAgICAgICAgaWYgKHJpZ2h0KSB4MSA9IHhtOyBlbHNlIHgyID0geG07XG4gIC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0gcGFkZGluZyAqIG4pIC8gaztcbiAgICAgIHggPSAwLCBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICB4MCA9IHgsIGogPSAtMTtcbiAgICAgICAgd2hpbGUgKCsraiA8IG4pIHtcbiAgICAgICAgICB2YXIgZGkgPSBncm91cEluZGV4W2ldLCBkaiA9IHN1Ymdyb3VwSW5kZXhbZGldW2pdLCB2ID0gbWF0cml4W2RpXVtkal0sIGEwID0geCwgYTEgPSB4ICs9IHYgKiBrO1xuICAgICAgICAgIHN1Ymdyb3Vwc1tkaSArIFwiLVwiICsgZGpdID0ge1xuICAgICAgICAgICAgaW5kZXg6IGRpLFxuICAgICAgICAgICAgc3ViaW5kZXg6IGRqLFxuICAgICAgICAgICAgc3RhcnRBbmdsZTogYTAsXG4gICAgICAgICAgICBlbmRBbmdsZTogYTEsXG4gICAgICAgICAgICB2YWx1ZTogdlxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZ3JvdXBzW2RpXSA9IHtcbiAgICAgICAgICBpbmRleDogZGksXG4gICAgICAgICAgc3RhcnRBbmdsZTogeDAsXG4gICAgICAgICAgZW5kQW5nbGU6IHgsXG4gICAgICAgICAgdmFsdWU6IGdyb3VwU3Vtc1tkaV1cbiAgICAgICAgfTtcbiAgICAgICAgeCArPSBwYWRkaW5nO1xuICAgICAgfVxuICAgICAgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgaiA9IGkgLSAxO1xuICAgICAgICB3aGlsZSAoKytqIDwgbikge1xuICAgICAgICAgIHZhciBzb3VyY2UgPSBzdWJncm91cHNbaSArIFwiLVwiICsgal0sIHRhcmdldCA9IHN1Ymdyb3Vwc1tqICsgXCItXCIgKyBpXTtcbiAgICAgICAgICBpZiAoc291cmNlLnZhbHVlIHx8IHRhcmdldC52YWx1ZSkge1xuICAgICAgICAgICAgY2hvcmRzLnB1c2goc291cmNlLnZhbHVlIDwgdGFyZ2V0LnZhbHVlID8ge1xuICAgICAgICAgICAgICBzb3VyY2U6IHRhcmdldCxcbiAgICAgICAgICAgICAgdGFyZ2V0OiBzb3VyY2VcbiAgICAgICAgICAgIH0gOiB7XG4gICAgICAgICAgICAgIHNvdXJjZTogc291cmNlLFxuICAgICAgICAgICAgICB0YXJnZXQ6IHRhcmdldFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoc29ydENob3JkcykgcmVzb3J0KCk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlc29ydCgpIHtcbiAgICAgIGNob3Jkcy5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcbiAgICAgICAgcmV0dXJuIHNvcnRDaG9yZHMoKGEuc291cmNlLnZhbHVlICsgYS50YXJnZXQudmFsdWUpIC8gMiwgKGIuc291cmNlLnZhbHVlICsgYi50YXJnZXQudmFsdWUpIC8gMik7XG4gICAgICB9KTtcbiAgICB9XG4gICAgY2hvcmQubWF0cml4ID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbWF0cml4O1xuICAgICAgbiA9IChtYXRyaXggPSB4KSAmJiBtYXRyaXgubGVuZ3RoO1xuICAgICAgY2hvcmRzID0gZ3JvdXBzID0gbnVsbDtcbiAgICAgIHJldHVybiBjaG9yZDtcbiAgICB9O1xuICAgIGNob3JkLnBhZGRpbmcgPSBmdW5jdGlvbih4KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBwYWRkaW5nO1xuICAgICAgcGFkZGluZyA9IHg7XG4gICAgICBjaG9yZHMgPSBncm91cHMgPSBudWxsO1xuICAgICAgcmV0dXJuIGNob3JkO1xuICAgIH07XG4gICAgY2hvcmQuc29ydEdyb3VwcyA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIH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IGs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiAhcXVhZC5jaGFyZ2U7XG4gICAgICB9O1xuICAgIH1cbiAgICBmb3JjZS50aWNrID0gZnVuY3Rpb24oKSB7XG4gICAgICBpZiAoKGFscGhhICo9IC45OSkgPCAuMDA1KSB7XG4gICAgICAgIHRpbWVyID0gbnVsbDtcbiAgICAgICAgZXZlbnQuZW5kKHtcbiAgICAgICAgICB0eXBlOiBcImVuZFwiLFxuICAgICAgICAgIGFscGhhOiBhbHBoYSA9IDBcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgICAgdmFyIG4gPSBub2Rlcy5sZW5ndGgsIG0gPSBsaW5rcy5sZW5ndGgsIHEsIGksIG8sIHMsIHQsIGwsIGssIHgsIHk7XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbTsgKytpKSB7XG4gICAgICAgIG8gPSBsaW5rc1tpXTtcbiAgICAgICAgcyA9IG8uc291cmNlO1xuICAgICAgICB0ID0gby50YXJnZXQ7XG4gICAgICAgIHggPSB0LnggLSBzLng7XG4gICAgICAgIHkgPSB0LnkgLSBzLnk7XG4gICAgICAgIGlmIChsID0geCAqIHggKyB5ICogeSkge1xuICAgICAgICAgIGwgPSBhbHBoYSAqIHN0cmVuZ3Roc1tpXSAqICgobCA9IE1hdGguc3FydChsKSkgLSBkaXN0YW5jZXNbaV0pIC8gbDtcbiAgICAgICAgICB4ICo9IGw7XG4gICAgICAgICAgeSAqPSBsO1xuICAgICAgICAgIHQueCAtPSB4ICogKGsgPSBzLndlaWdodCArIHQud2VpZ2h0ID8gcy53ZWlnaHQgLyAocy53ZWlnaHQgKyB0LndlaWdodCkgOiAuNSk7XG4gICAgICAgICAgdC55IC09IHkgKiBrO1xuICAgICAgICAgIHMueCArPSB4ICogKGsgPSAxIC0gayk7XG4gICAgICAgICAgcy55ICs9IHkgKiBrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoayA9IGFscGhhICogZ3Jhdml0eSkge1xuICAgICAgICB4ID0gc2l6ZVswXSAvIDI7XG4gICAgICAgIHkgPSBzaXplWzFdIC8gMjtcbiAgICAgICAgaSA9IC0xO1xuICAgICAgICBpZiAoaykgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gbm9kZXNbaV07XG4gICAgICAgICAgby54ICs9ICh4IC0gby54KSAqIGs7XG4gICAgICAgICAgby55ICs9ICh5IC0gby55KSAqIGs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChjaGFyZ2UpIHtcbiAgICAgICAgZDNfbGF5b3V0X2ZvcmNlQWNjdW11bGF0ZShxID0gZDMuZ2VvbS5xdWFkdHJlZShub2RlcyksIGFscGhhLCBjaGFyZ2VzKTtcbiAgICAgICAgaSA9IC0xO1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIGlmICghKG8gPSBub2Rlc1tpXSkuZml4ZWQpIHtcbiAgICAgICAgICAgIHEudmlzaXQocmVwdWxzZShvKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBvID0gbm9kZXNbaV07XG4gICAgICAgIGlmIChvLmZpeGVkKSB7XG4gICAgICAgICAgby54ID0gby5weDtcbiAgICAgICAgICBvLnkgPSBvLnB5O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG8ueCAtPSAoby5weCAtIChvLnB4ID0gby54KSkgKiBmcmljdGlvbjtcbiAgICAgICAgICBvLnkgLT0gKG8ucHkgLSAoby5weSA9IG8ueSkpICogZnJpY3Rpb247XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGV2ZW50LnRpY2soe1xuICAgICAgICB0eXBlOiBcInRpY2tcIixcbiAgICAgICAgYWxwaGE6IGFscGhhXG4gICAgICB9KTtcbiAgICB9O1xuICAgIGZvcmNlLm5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gICAgfSBlbHNlIHtcbiAgICAgICAgICB0aW1lci5jID0gbnVsbCwgdGltZXIudCA9IE5hTiwgdGltZXIgPSBudWxsO1xuICAgICAgICAgIGV2ZW50LmVuZCh7XG4gICAgICAgICAgICB0eXBlOiBcImVuZFwiLFxuICAgICAgICAgICAgYWxwaGE6IGFscGhhID0gMFxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKHggPiAwKSB7XG4gICAgICAgIGV2ZW50LnN0YXJ0KHtcbiAgICAgICAgICB0eXBlOiBcInN0YXJ0XCIsXG4gICAgICAgICAgYWxwaGE6IGFscGhhID0geFxuICAgICAgICB9KTtcbiAgICAgICAgdGltZXIgPSBkM190aW1lcihmb3JjZS50aWNrKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBmb3JjZTtcbiAgICB9O1xuICAgIGZvcmNlLnN0YXJ0ID0gZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgaSwgbiA9IG5vZGVzLmxlbmd0aCwgbSA9IGxpbmtzLmxlbmd0aCwgdyA9IHNpemVbMF0sIGggPSBzaXplWzFdLCBuZWlnaGJvcnMsIG87XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgIChvID0gbm9kZXNbaV0pLmluZGV4ID0gaTtcbiAgICAgICAgby53ZWlnaHQgPSAwO1xuICAgICAgfVxuICAgICAgZm9yIChpID0gMDsgaSA8IG07ICsraSkge1xuICAgICAgICBvID0gbGlua3NbaV07XG4gICAgICAgIGlmICh0eXBlb2Ygby5zb3VyY2UgPT0gXCJudW1iZXJcIikgby5zb3VyY2UgPSBub2Rlc1tvLnNvdXJjZV07XG4gICAgICAgIGlmICh0eXBlb2Ygby50YXJnZXQgPT0gXCJudW1iZXJcIikgby50YXJnZXQgPSBub2Rlc1tvLnRhcmdldF07XG4gICAgICAgICsrby5zb3VyY2Uud2VpZ2h0O1xuICAgICAgICArK28udGFyZ2V0LndlaWdodDtcbiAgICAgI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IHtcbiAgICAgIHZhciBuID0gZGF0YS5sZW5ndGgsIHggPSBkYXRhWzBdLCBtID0geC5sZW5ndGgsIGksIGosIGssIHMxLCBzMiwgczMsIGR4LCBvLCBvMCwgeTAgPSBbXTtcbiAgICAgIHkwWzBdID0gbyA9IG8wID0gMDtcbiAgICAgIGZvciAoaiA9IDE7IGogPCBtOyArK2opIHtcbiAgICAgICAgZm9yIChpID0gMCwgczEgPSAwOyBpIDwgbjsgKytpKSBzMSArPSBkYXRhW2ldW2pdWzFdO1xuICAgICAgICBmb3IgKGkgPSAwLCBzMiA9IDAsIGR4ID0geFtqXVswXSAtIHhbaiAtIDFdWzBdOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgZm9yIChrID0gMCwgczMgPSAoZGF0YVtpXVtqXVsxXSAtIGRhdGFbaV1baiAtIDFdWzFdKSAvICgyICogZHgpOyBrIDwgaTsgKytrKSB7XG4gICAgICAgICAgICBzMyArPSAoZGF0YVtrXVtqXVsxXSAtIGRhdGFba11baiAtIDFdWzFdKSAvIGR4O1xuICAgICAgICAgIH1cbiAgICAgICAgICBzMiArPSBzMyAqIGRhdGFbaV1bal1bMV07XG4gICAgICAgIH1cbiAgICAgICAgeTBbal0gPSBvIC09IHMxID8gczIgLyBzMSAqIGR4IDogMDtcbiAgICAgICAgaWYgKG8gPCBvMCkgbzAgPSBvO1xuICAgICAgfVxuICAgICAgZm9yIChqID0gMDsgaiA8IG07ICsraikgeTBbal0gLT0gbzA7XG4gICAgICByZXR1cm4geTA7XG4gICAgfSxcbiAgICBleHBhbmQ6IGZ1bmN0aW9uKGRhdGEpIHtcbiAgICAgIHZhciBuID0gZGF0YS5sZW5ndGgsIG0gPSBkYXRhWzBdLmxlbmd0aCwgayA9IDEgLyBuLCBpLCBqLCBvLCB5MCA9IFtdO1xuICAgICAgZm9yIChqID0gMDsgaiA8IG07ICsraikge1xuICAgICAgICBmb3IgKGkgPSAwLCBvID0gMDsgaSA8IG47IGkrKykgbyArPSBkYXRh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tcbiAgfVxuICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja1NpYmxpbmdzKG5vZGUpIHtcbiAgICBpZiAoIShub2RlcyA9IG5vZGUuY2hpbGRyZW4pIHx8ICEobiA9IG5vZGVzLmxlbmd0aCkpIHJldHVybjtcbiAgICB2YXIgbm9kZXMsIHhNaW4gPSBJbmZpbml0eSwgeE1heCA9IC1JbmZpbml0eSwgeU1pbiA9IEluZmluaXR5LCB5TWF4ID0gLUluZmluaXR5LCBhLCBiLCBjLCBpLCBqLCBrLCBuO1xuICAgIGZ1bmN0aW9uIGJvdW5kKG5vZGUpIHtcbiAgICAgIHhNaW4gPSBNYXRoLm1pbihub2RlLnggLSBub2RlLnIsIHhNaW4pO1xuICAgICAgeE1heCA9IE1hdGgubWF4KG5vZGUueCArIG5vZGUuciwgeE1heCk7XG4gICAgICB5TWluID0gTWF0aC5taW4obm9kZS55IC0gbm9kZS5yLCB5TWluKTtcbiAgICAgIHlNYXggPSBNYXRoLm1heChub2RlLnkgKyBub2RlLnIsIHlNYXgpO1xuICAgIH1cbiAgICBub2Rlcy5mb3JFYWNoKGQzX2xheW91dF9wYWNrTGluayk7XG4gICAgYSA9IG5vZGVzWzBdO1xuICAgIGEueCA9IC1hLnI7XG4gICAgYS55ID0gMDtcbiAgICBib3VuZChhKTtcbiAgICBpZiAobiA+IDEpIHtcbiAgICAgIGIgPSBub2Rlc1sxXTtcbiAgICAgIGIueCA9IGIucjtcbiAgICAgIGIueSA9IDA7XG4gICAgICBib3VuZChiKTtcbiAgICAgIGlmIChuID4gMikge1xuICAgICAgICBjID0gbm9kZXNbMl07XG4gICAgICAgIGQzX2xheW91dF9wYWNrUGxhY2UoYSwgYiwgYyk7XG4gICAgICAgIGJvdW5kKGMpO1xuICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChhLCBjKTtcbiAgICAgICAgYS5fcGFja19wcmV2ID0gYztcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYywgYik7XG4gICAgICAgIGIgPSBhLl9wYWNrX25leHQ7XG4gICAgICAgIGZvciAoaSA9IDM7IGkgPCBuOyBpKyspIHtcbiAgICAgICAgICBkM19sYXlvdXRfcGFja1BsYWNlKGEsIGIsIGMgPSBub2Rlc1tpXSk7XG4gICAgICAgICAgdmFyIGlzZWN0ID0gMCwgczEgPSAxLCBzMiA9IDE7XG4gICAgICAgICAgZm9yIChqID0gYi5fcGFja19uZXh0OyBqICE9PSBiOyBqID0gai5fcGFja19uZXh0LCBzMSsrKSB7XG4gICAgICAgICAgICBpZiAoZDNfbGF5b3V0X3BhY2tJbnRlcnNlY3RzKGosIGMpKSB7XG4gICAgICAgICAgICAgIGlzZWN0ID0gMTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc2VjdCA9PSAxKSB7XG4gICAgICAgICAgICBmb3IgKGsgPSBhLl9wYWNrX3ByZXY7IGsgIT09IGouX3BhY2tfcHJldjsgayA9IGsuX3BhY2tfcHJldiwgczIrKykge1xuICAgICAgICAgICAgICBpZiAoZDNfbGF5b3V0X3BhY2tJbnRlcnNlY3RzKGssIGMpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzZWN0KSB7XG4gICAgICAgICAgICBpZiAoczEgPCBzMiB8fCBzMSA9PSBzMiAmJiBiLnIgPCBhLnIpIGQzX2xheW91dF9wYWNrU3BsaWNlKGEsIGIgPSBqKTsgZWxzZSBkM19sYXlvdXRfcGFja1NwbGljZShhID0gaywgYik7XG4gICAgICAgICAgICBpLS07XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGEsIGMpO1xuICAgICAgICAgICAgYiA9IGM7XG4gICAgICAgICAgICBib3VuZChjKTtcbiAgICAgICAgICB9XG4g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vdDEucGFyZW50Lm0gPSAtcm9vdDEuejtcbiAgICAgIGQzX2xheW91dF9oaWVyYXJjaHlWaXNpdEJlZm9yZShyb290MSwgc2Vjb25kV2Fsayk7XG4gICAgICBpZiAobm9kZVNpemUpIGQzX2xheW91dF9oaWVyYXJjaHlWaXNpdEJlZm9yZShyb290MCwgc2l6ZU5vZGUpOyBlbHNlIHtcbiAgICAgICAgdmFyIGxlZnQgPSByb290MCwgcmlnaHQgPSByb290MCwgYm90dG9tID0gcm9vdDA7XG4gICAgICAgIGQzX2xheW91dF9oaWVyYXJjaHlWaXNpdEJlZm9yZShyb290MCwgZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgIGlmIChub2RlLnggPCBsZWZ0LngpIGxlZnQgPSBub2RlO1xuICAgICAgICAgIGlmIChub2RlLnggPiByaWdodC54KSByaWdodCA9IG5vZGU7XG4gICAgICAgICAgaWYgKG5vZGUuZGVwdGggPiBib3R0b20uZGVwdGgpIGJvdHRvbSA9IG5vZGU7XG4gICAgICAgIH0pO1xuICAgICAgICB2YXIgdHggPSBzZXBhcmF0aW9uKGxlZnQsIHJpZ2h0KSAvIDIgLSBsZWZ0LngsIGt4ID0gc2l6ZVswXSAvIChyaWdodC54ICsgc2VwYXJhdGlvbihyaWdodCwgbGVmdCkgLyAyICsgdHgpLCBreSA9IHNpemVbMV0gLyAoYm90dG9tLmRlcHRoIHx8IDEpO1xuICAgICAgICBkM19sYXlvdXRfaGllcmFyY2h5VmlzaXRCZWZvcmUocm9vdDAsIGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICBub2RlLnggPSAobm9kZS54ICsgdHgpICoga3g7XG4gICAgICAgICAgbm9kZS55ID0gbm9kZS5kZXB0aCAqIGt5O1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBub2RlcztcbiAgICB9XG4gICAgZnVuY3Rpb24gd3JhcFRyZWUocm9vdDApIHtcbiAgICAgIHZhciByb290MSA9IHtcbiAgICAgICAgQTogbnVsbCxcbiAgICAgICAgY2hpbGRyZW46IFsgcm9vdDAgXVxuICAgICAgfSwgcXVldWUgPSBbIHJvb3QxIF0sIG5vZGUxO1xuICAgICAgd2hpbGUgKChub2RlMSA9IHF1ZXVlLnBvcCgpKSAhPSBudWxsKSB7XG4gICAgICAgIGZvciAodmFyIGNoaWxkcmVuID0gbm9kZTEuY2hpbGRyZW4sIGNoaWxkLCBpID0gMCwgbiA9IGNoaWxkcmVuLmxlbmd0aDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIHF1ZXVlLnB1c2goKGNoaWxkcmVuW2ldID0gY2hpbGQgPSB7XG4gICAgICAgICAgICBfOiBjaGlsZHJlbltpXSxcbiAgICAgICAgICAgIHBhcmVudDogbm9kZTEsXG4gICAgICAgICAgICBjaGlsZHJlbjogKGNoaWxkID0gY2hpbGRyZW5baV0uY2hpbGRyZW4pICYmIGNoaWxkLnNsaWNlKCkgfHwgW10sXG4gICAgICAgICAgICBBOiBudWxsLFxuICAgICAgICAgICAgYTogbnVsbCxcbiAgICAgICAgICAgIHo6IDAsXG4gICAgICAgICAgICBtOiAwLFxuICAgICAgICAgICAgYzogMCxcbiAgICAgICAgICAgIHM6IDAsXG4gICAgICAgICAgICB0OiBudWxsLFxuICAgICAgICAgICAgaTogaVxuICAgICAgICAgIH0pLmEgPSBjaGlsZCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiByb290MS5jaGlsZHJlblswXTtcbiAgICB9XG4gICAgZnVuY3Rpb24gZmlyc3RXYWxrKHYpIHtcbiAgICAgIHZhciBjaGlsZHJlbiA9IHYuY2hpbGRyZW4sIHNpYmxpbmdzID0gdi5wYXJlbnQuY2hpbGRyZW4sIHcgPSB2LmkgPyBzaWJsaW5nc1t2LmkgLSAxXSA6IG51bGw7XG4gICAgICBpZiAoY2hpbGRyZW4ubGVuZ3RoKSB7XG4gICAgICAgIGQzX2xheW91dF90cmVlU2hpZnQodik7XG4gICAgICAgIHZhciBtaWR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jtcbiAgICAgICAgICBzaGlmdCA9IHZpbS56ICsgc2ltIC0gdmlwLnogLSBzaXAgKyBzZXBhcmF0aW9uKHZpbS5fLCB2aXAuXyk7XG4gICAgICAgICAgaWYgKHNoaWZ0ID4gMCkge1xuICAgICAgICAgICAgZDNfbGF5b3V0X3RyZWVNb3ZlKGQzX2xheW91dF90cmVlQW5jZXN0b3IodmltLCB2LCBhbmNlc3RvciksIHYsIHNoaWZ0KTtcbiAgICAgICAgICAgIHNpcCArPSBzaGlmdDtcbiAgICAgICAgICAgIHNvcCArPSBzaGlmdDtcbiAgICAgICAgICB9XG4gICAgICAgICAgc2ltICs9IHZpbS5tO1xuICAgICAgICAgIHNpcCArPSB2aXAubTtcbiAgICAgICAgICBzb20gKz0gdm9tLm07XG4gICAgICAgICAgc29wICs9IHZvcC5tO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2aW0gJiYgIWQzX2xheW91dF90cmVlUmlnaHQodm9wKSkge1xuICAgICAgICAgIHZvcC50ID0gdmltO1xuICAgICAgICAgIHZvcC5tICs9IHNpbSAtIHNvcDtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmlwICYmICFkM19sYXlvdXRfdHJlZUxlZnQodm9tKSkge1xuICAgICAgICAgIHZvbS50ID0gdmlwO1xuICAgICAgICAgIHZvbS5tICs9IHNpcCAtIHNvbTtcbiAgICAgICAgICBhbmNlc3RvciA9IHY7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBhbmNlc3RvcjtcbiAgICB9XG4gICAgZnVuY3Rpb24gc2l6ZU5vZGUobm9kZSkge1xuICAgICAgbm9kZS54ICo9IHNpemVbMF07XG4gICAgICBub2RlLnkgPSBub2RlLmRlcHRoICogc2l6ZVsxXTtcbiAgICB9XG4gICAgdHJlZS5zZXBhcmF0aW9uID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2VwYXJhdGlvbjtcbiAgICAgIHN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gICAgIHJlbWFpbmluZy5wb3AoKTtcbiAgICAgICAgICAgIGJlc3QgPSBzY29yZTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcm93LmFyZWEgLT0gcm93LnBvcCgpLmFyZWE7XG4gICAgICAgICAgICBwb3NpdGlvbihyb3csIHUsIHJlY3QsIGZhbHNlKTtcbiAgICAgICAgICAgIHUgPSBNYXRoLm1pbihyZWN0LmR4LCByZWN0LmR5KTtcbiAgICAgICAgICAgIHJvdy5sZW5ndGggPSByb3cuYXJlYSA9IDA7XG4gICAgICAgICAgICBiZXN0ID0gSW5maW5pdHk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChyb3cubGVuZ3RoKSB7XG4gICAgICAgICAgcG9zaXRpb24ocm93LCB1LCByZWN0LCB0cnVlKTtcbiAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICB9XG4gICAgICAgIGNoaWxkcmVuLmZvckVhY2goc3F1YXJpZnkpO1xuICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiBzdGlja2lmeShub2RlKSB7XG4gICAgICB2YXIgY2hpbGRyZW4gPSBub2RlLmNoaWxkcmVuO1xuICAgICAgaWYgKGNoaWxkcmVuICYmIGNoaWxkcmVuLmxlbmd0aCkge1xuICAgICAgICB2YXIgcmVjdCA9IHBhZChub2RlKSwgcmVtYWluaW5nID0gY2hpbGRyZW4uc2xpY2UoKSwgY2hpbGQsIHJvdyA9IFtdO1xuICAgICAgICBzY2FsZShyZW1haW5pbmcsIHJlY3QuZHggKiByZWN0LmR5IC8gbm9kZS52YWx1ZSk7XG4gICAgICAgIHJvdy5hcmVhID0gMDtcbiAgICAgICAgd2hpbGUgKGNoaWxkID0gcmVtYWluaW5nLnBvcCgpKSB7XG4gICAgICAgICAgcm93LnB1c2goY2hpbGQpO1xuICAgICAgICAgIHJvdy5hcmVhICs9IGNoaWxkLmFyZWE7XG4gICAgICAgICAgaWYgKGNoaWxkLnogIT0gbnVsbCkge1xuICAgICAgICAgICAgcG9zaXRpb24ocm93LCBjaGlsZC56ID8gcmVjdC5keCA6IHJlY3QuZHksIHJlY3QsICFyZW1haW5pbmcubGVuZ3RoKTtcbiAgICAgICAgICAgIHJvdy5sZW5ndGggPSByb3cuYXJlYSA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNoaWxkcmVuLmZvckVhY2goc3RpY2tpZnkpO1xuICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiB3b3JzdChyb3csIHUpIHtcbiAgICAgIHZhciBzID0gcm93LmFyZWEsIHIsIHJtYXggPSAwLCBybWluID0gSW5maW5pdHksIGkgPSAtMSwgbiA9IHJvdy5sZW5ndGg7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBpZiAoIShyID0gcm93W2ldLmFyZWEpKSBjb250aW51ZTtcbiAgICAgICAgaWYgKHIgPCBybWluKSBybWluID0gcjtcbiAgICAgICAgaWYgKHIgPiBybWF4KSBybWF4ID0gcjtcbiAgICAgIH1cbiAgICAgIHMgKj0gcztcbiAgICAgIHUgKj0gdTtcbiAgICAgIHJldHVybiBzID8gTWF0aC5tYXgodSAqIHJtYXggKiByYXRpbyAvIHMsIHMgLyAodSAqIHJtaW4gKiByYXRpbykpIDogSW5maW5pdHk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHBvc2l0aW9uKHJvdywgdSwgcmVjdCwgZmx1c2gpIHtcbiAgICAgIHZhciBpID0gLTEsIG4gPSByb3cubGVuZ3RoLCB4ID0gcmVjdC54LCB5ID0gcmVjdC55LCB2ID0gdSA/IHJvdW5kKHJvdy5hcmVhIC8gdSkgOiAwLCBvO1xuICAgICAgaWYgKHUgPT0gcmVjdC5keCkge1xuICAgICAgICBpZiAoZmx1c2ggfHwgdiA+IHJlY3QuZHkpIHYgPSByZWN0LmR5O1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSByb3dbaV07XG4gICAgICAgICAgby54ID0geDtcbiAgICAgICAgICBvLnkgPSB5O1xuICAgICAgICAgIG8uZHkgPSB2O1xuICAgICAgICAgIHggKz0gby5keCA9IE1hdGgubWluKHJlY3QueCArIHJlY3QuZHggLSB4LCB2ID8gcm91bmQoby5hcmVhIC8gdikgOiAwKTtcbiAgICAgICAgfVxuICAgICAgICBvLnogPSB0cnVlO1xuICAgICAgICBvLmR4ICs9IHJlY3QueCArIHJlY3QuZHggLSB4O1xuICAgICAgICByZWN0LnkgKz0gdjtcbiAgICAgICAgcmVjdC5keSAtPSB2O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKGZsdXNoIHx8IHYgPiByZWN0LmR4KSB2ID0gcmVjdC5keDtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gcm93W2ldO1xuICAgICAgICAgIG8ueCA9IHg7XG4gICAgICAgICAgby55ID0geTtcbiAgICAgICAgICBvLmR4ID0gdjtcbiAgICAgICAgICB5ICs9IG8uZHkgPSBNYXRoLm1pbihyZWN0LnkgKyByZWN0LmR5IC0geSwgdiA/IHJvdW5kKG8uYXJlYSAvIHYpIDogMCk7XG4gICAgICAgIH1cbiAgICAgICAgby56ID0gZmFsc2U7XG4gICAgICAgIG8uZHkgKz0gcmVjdC55ICsgcmVjdC5keSAtIHk7XG4gICAgICAgIHJlY3QueCArPSB2O1xuICAgICAgICByZWN0LmR4IC09IHY7XG4gICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIHRyZWVtYXAoZCkge1xuICAgICAgdmFyIG5vZGVzID0gc3RpY2tpZXMgfHwgaGllcmFyY2h5KGQpLCByb290ID0gbm9kZXNbMF07XG4gICAgICByb290LnggPSByb290LnkgPSAwO1xuICAgICAgaWYgKHJvb3QudmFsdWUpIHJvb3QuZHggPSBzaXplWzBdLCByb290LmR5ID0gc2l6ZVsxXTsgZWxzZSByb290LmR4ID0gcm9vdC5keSA9IDA7XG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O1xuICAgICAgbGluZWFyLmRvbWFpbihuaWNlZCk7XG4gICAgICBkb21haW4gPSBuaWNlZC5tYXAocG93KTtcbiAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9O1xuICAgIHNjYWxlLnRpY2tzID0gZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgZXh0ZW50ID0gZDNfc2NhbGVFeHRlbnQoZG9tYWluKSwgdGlja3MgPSBbXSwgdSA9IGV4dGVudFswXSwgdiA9IGV4dGVudFsxXSwgaSA9IE1hdGguZmxvb3IobG9nKHUpKSwgaiA9IE1hdGguY2VpbChsb2codikpLCBuID0gYmFzZSAlIDEgPyAyIDogYmFzZTtcbiAgICAgIGlmIChpc0Zpbml0ZShqIC0gaSkpIHtcbiAgICAgICAgaWYgKHBvc2l0aXZlKSB7XG4gICAgICAgICAgZm9yICg7aSA8IGo7IGkrKykgZm9yICh2YXIgayA9IDE7IGsgPCBuOyBrKyspIHRpY2tzLnB1c2gocG93KGkpICogayk7XG4gICAgICAgICAgdGlja3MucHVzaChwb3coaSkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRpY2tzLnB1c2gocG93KGkpKTtcbiAgICAgICAgICBmb3IgKDtpKysgPCBqOyApIGZvciAodmFyIGsgPSBuIC0gMTsgayA+IDA7IGstLSkgdGlja3MucHVzaChwb3coaSkgKiBrKTtcbiAgICAgICAgfVxuICAgICAgICBmb3IgKGkgPSAwOyB0aWNrc1tpXSA8IHU7IGkrKykge31cbiAgICAgICAgZm9yIChqID0gdGlja3MubGVuZ3RoOyB0aWNrc1tqIC0gMV0gPiB2OyBqLS0pIHt9XG4gICAgICAgIHRpY2tzID0gdGlja3Muc2xpY2UoaSwgaik7XG4gICAgICB9XG4gICAgICByZXR1cm4gdGlja3M7XG4gICAgfTtcbiAgICBzY2FsZS50aWNrRm9ybWF0ID0gZnVuY3Rpb24obiwgZm9ybWF0KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVyb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gICBpZiAocjEpIHAxID0gZDNfYXNpbihycCAvIHIxICogTWF0aC5zaW4oYXApKTtcbiAgICAgICAgaWYgKHIwKSBwMCA9IGQzX2FzaW4ocnAgLyByMCAqIE1hdGguc2luKGFwKSk7XG4gICAgICB9XG4gICAgICBpZiAocjEpIHtcbiAgICAgICAgeDAgPSByMSAqIE1hdGguY29zKGEwICsgcDEpO1xuICAgICAgICB5MCA9IHIxICogTWF0aC5zaW4oYTAgKyBwMSk7XG4gICAgICAgIHgxID0gcjEgKiBNYXRoLmNvcyhhMSAtIHAxKTtcbiAgICAgICAgeTEgPSByMSAqIE1hdGguc2luKGExIC0gcDEpO1xuICAgICAgICB2YXIgbDEgPSBNYXRoLmFicyhhMSAtIGEwIC0gMiAqIHAxKSA8PSDPgCA/IDAgOiAxO1xuICAgICAgICBpZiAocDEgJiYgZDNfc3ZnX2FyY1N3ZWVwKHgwLCB5MCwgeDEsIHkxKSA9PT0gY3cgXiBsMSkge1xuICAgICAgICAgIHZhciBoMSA9IChhMCArIGExKSAvIDI7XG4gICAgICAgICAgeDAgPSByMSAqIE1hdGguY29zKGgxKTtcbiAgICAgICAgICB5MCA9IHIxICogTWF0aC5zaW4oaDEpO1xuICAgICAgICAgIHgxID0geTEgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB4MCA9IHkwID0gMDtcbiAgICAgIH1cbiAgICAgIGlmIChyMCkge1xuICAgICAgICB4MiA9IHIwICogTWF0aC5jb3MoYTEgLSBwMCk7XG4gICAgICAgIHkyID0gcjAgKiBNYXRoLnNpbihhMSAtIHAwKTtcbiAgICAgICAgeDMgPSByMCAqIE1hdGguY29zKGEwICsgcDApO1xuICAgICAgICB5MyA9IHIwICogTWF0aC5zaW4oYTAgKyBwMCk7XG4gICAgICAgIHZhciBsMCA9IE1hdGguYWJzKGEwIC0gYTEgKyAyICogcDApIDw9IM+AID8gMCA6IDE7XG4gICAgICAgIGlmIChwMCAmJiBkM19zdmdfYX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iwgcmFuZ2VbMF0pLmF0dHIoXCJ3aWR0aFwiLCByYW5nZVsxXSAtIHJhbmdlWzBdKTtcbiAgICAgICAgICByZWRyYXdYKGdVcGRhdGUpO1xuICAgICAgICB9XG4gICAgICAgIGlmICh5KSB7XG4gICAgICAgICAgcmFuZ2UgPSBkM19zY2FsZVJhbmdlKHkpO1xuICAgICAgICAgIGJhY2tncm91bmRVcGRhdGUuYXR0cihcInlcIiwgcmFuZ2VbMF0pLmF0dHIoXCJoZWlnaHRcIiwgcmFuZ2VbMV0gLSByYW5nZVswXSk7XG4gICAgICAgICAgcmVkcmF3WShnVXBkYXRlKTtcbiAgICAgICAgfVxuICAgICAgICByZWRyYXcoZ1VwZGF0ZSk7XG4gICAgICB9KTtcbiAgICB9XG4gICAgYnJ1c2guZXZlbnQgPSBmdW5jdGlvbihnKSB7XG4gICAgICBnLmVhY2goZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciBldmVudF8gPSBldmVudC5vZih0aGlzLCBhcmd1bWVudHMpLCBleHRlbnQxID0ge1xuICAgICAgICAgIHg6IHhFeHRlbnQsXG4gICAgICAgICAgeTogeUV4dGVudCxcbiAgICAgICAgICBpOiB4RXh0ZW50RG9tYWluLFxuICAgICAgICAgIGo6IHlFeHRlbnREb21haW5cbiAgICAgICAgfSwgZXh0ZW50MCA9IHRoaXMuX19jaGFydF9fIHx8IGV4dGVudDE7XG4gICAgICAgIHRoaXMuX19jaGFydF9fID0gZXh0ZW50MTtcbiAgICAgICAgaWYgKGQzX3RyYW5zaXRpb25Jbmhlcml0SWQpIHtcbiAgICAgICAgICBkMy5zZWxlY3QodGhpcykudHJhbnNpdGlvbigpLmVhY2goXCJzdGFydC5icnVzaFwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHhFeHRlbnREb21haW4gPSBleHRlbnQwLmk7XG4gICAgICAgICAgICB5RXh0ZW50RG9tYWluID0gZXh0ZW50MC5qO1xuICAgICAgICAgICAgeEV4dGVudCA9IGV4dGVudDAueDtcbiAgICAgICAgICAgIHlFeHRlbnQgPSBleHRlbnQwLnk7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoc3RhcnRcIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSkudHdlZW4oXCJicnVzaDpicnVzaFwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciB4aSA9IGQzX2ludGVycG9sYXRlQXJyYXkoeEV4dGVudCwgZXh0ZW50MS54KSwgeWkgPSBkM19pbnRlcnBvbGF0ZUFycmF5KHlFeHRlbnQsIGV4dGVudDEueSk7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0geUV4dGVudERvbWFpbiA9IG51bGw7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odCkge1xuICAgICAgICAgICAgICB4RXh0ZW50ID0gZXh0ZW50MS54ID0geGkodCk7XG4gICAgICAgICAgICAgIHlFeHRlbnQgPSBleHRlbnQxLnkgPSB5aSh0KTtcbiAgICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSkuZWFjaChcImVuZC5icnVzaFwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHhFeHRlbnREb21haW4gPSBleHRlbnQxLmk7XG4gICAgICAgICAgICB5RXh0ZW50RG9tYWluID0gZXh0ZW50MS5qO1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hlbmRcIlxuICAgICAgICAgICAgfSk7X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eHRlbnRbMV07XG4gICAgICAgICAgICBvcmlnaW5bMV0gLT0geUV4dGVudFsxXTtcbiAgICAgICAgICAgIGRyYWdnaW5nID0gMjtcbiAgICAgICAgICB9XG4gICAgICAgICAgZDNfZXZlbnRQcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBrZXl1cCgpIHtcbiAgICAgICAgaWYgKGQzLmV2ZW50LmtleUNvZGUgPT0gMzIgJiYgZHJhZ2dpbmcgPT0gMikge1xuICAgICAgICAgIG9yaWdpblswXSArPSB4RXh0ZW50WzFdO1xuICAgICAgICAgIG9yaWdpblsxXSArPSB5RXh0ZW50WzFdO1xuICAgICAgICAgIGRyYWdnaW5nID0gMDtcbiAgICAgICAgICBkM19ldmVudFByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGJydXNobW92ZSgpIHtcbiAgICAgICAgdmFyIHBvaW50ID0gZDMubW91c2UodGFyZ2V0KSwgbW92ZWQgPSBmYWxzZTtcbiAgICAgICAgaWYgKG9mZnNldCkge1xuICAgICAgICAgIHBvaW50WzBdICs9IG9mZnNldFswXTtcbiAgICAgICAgICBwb2ludFsxXSArPSBvZmZzZXRbMV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFkcmFnZ2luZykge1xuICAgICAgICAgIGlmIChkMy5ldmVudC5hbHRLZXkpIHtcbiAgICAgICAgICAgIGlmICghY2VudGVyKSBjZW50ZXIgPSBbICh4RXh0ZW50WzBdICsgeEV4dGVudFsxXSkgLyAyLCAoeUV4dGVudFswXSArIHlFeHRlbnRbMV0pIC8gMiBdO1xuICAgICAgICAgICAgb3JpZ2luWzBdID0geEV4dGVudFsrKHBvaW50WzBdIDwgY2VudGVyWzBdKV07XG4gICAgICAgICAgICBvcmlnaW5bMV0gPSB5RXh0ZW50WysocG9pbnRbMV0gPCBjZW50ZXJbMV0pXTtcbiAgICAgICAgICB9IGVsc2UgY2VudGVyID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICBpZiAocmVzaXppbmdYICYmIG1vdmUxKHBvaW50LCB4LCAwKSkge1xuICAgICAgICAgIHJlZHJhd1goZyk7XG4gICAgICAgICAgbW92ZWQgPSB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChyZXNpemluZ1kgJiYgbW92ZTEocG9pbnQsIHksIDEpKSB7XG4gICAgICAgICAgcmVkcmF3WShnKTtcbiAgICAgICAgICBtb3ZlZCA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1vdmVkKSB7XG4gICAgICAgICAgcmVkcmF3KGcpO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICBtb2RlOiBkcmFnZ2luZyA/IFwibW92ZVwiIDogXCJyZXNpemVcIlxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBtb3ZlMShwb2ludCwgc2NhbGUsIGkpIHtcbiAgICAgICAgdmFyIHJhbmdlID0gZDNfc2NhbGVSYW5nZShzY2FsZSksIHIwID0gcmFuZ2VbMF0sIHIxID0gcmFuZ2VbMV0sIHBvc2l0aW9uID0gb3JpZ2luW2ldLCBleHRlbnQgPSBpID8geUV4dGVudCA6IHhFeHRlbnQsIHNpemUgPSBleHRlbnRbMV0gLSBleHRlbnRbMF0sIG1pbiwgbWF4O1xuICAgICAgICBpZiAoZHJhZ2dpbmcpIHtcbiAgICAgICAgICByMCAtPSBwb3NpdGlvbjtcbiAgICAgICAgICByMSAtPSBzaXplICsgcG9zaXRpb247XG4gICAgICAgIH1cbiAgICAgICAgbWluID0gKGkgPyB5Q2xhbXAgOiB4Q2xhbXApID8gTWF0aC5tYXgocjAsIE1hdGgubWluKHIxLCBwb2ludFtpXSkpIDogcG9pbnRbaV07XG4gICAgICAgIGlmIChkcmFnZ2luZykge1xuICAgICAgICAgIG1heCA9IChtaW4gKz0gcG9zaXRpb24pICsgc2l6ZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoY2VudGVyKSBwb3NpdGlvbiA9IE1hdGgubWF4KHIwLCBNYXRoLm1pbihyMSwgMiAqIGNlbnRlcltpXSAtIG1pbikpO1xuICAgICAgICAgIGlmIChwb3NpdGlvbiA8IG1pbikge1xuICAgICAgICAgICAgbWF4ID0gbWluO1xuICAgICAgICAgICAgbWluID0gcG9zaXRpb247XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1heCA9IHBvc2l0aW9uO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoZXh0ZW50WzBdICE9IG1pbiB8fCBleHRlbnRbMV0gIT0gbWF4KSB7XG4gICAgICAgICAgaWYgKGkpIHlFeHRlbnREb21haW4gPSBudWxsOyBlbHNlIHhFeHRlbnREb21haW4gPSBudWxsO1xuICAgICAgICAgIGV4dGVudFswXSA9IG1pbjtcbiAgICAgICAgICBleHRlbnRbMV0gPSBtYXg7XG4gICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGJydXNoZW5kKCkge1xuICAgICAgICBicnVzaG1vdmUoKTtcbiAgICAgICAgZy5zdHlsZShcInBvaW50ZXItZXZlbnRzXCIsIFwiYWxsXCIpLnNlbGVjdEFsbChcIi5yZXNpemVcIikuc3R5bGUoXCJkaXNwbGF5XCIsIGJydXNoLmVtcHR5KCkgPyBcIm5vbmVcIiA6IG51bGwpO1xuICAgICAgICBkMy5zZWxlY3QoXCJib2R5XCIpLnN0eWxlKFwiY3Vyc29yXCIsIG51bGwpO1xuICAgICAgICB3Lm9uKFwibW91c2Vtb3ZlLmJydXNoXCIsIG51bGwpLm9uKFwibW91c2V1cC5icnVzaFwiLCBudWxsKS5vbihcInRvdWNobW92ZS5icnVzaFwiLCBudWxsKS5vbihcInRvdWNoZW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gICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgIGlmICh4KSB7XG4gICAgICAgICAgaWYgKHhFeHRlbnREb21haW4pIHtcbiAgICAgICAgICAgIHgwID0geEV4dGVudERvbWFpblswXSwgeDEgPSB4RXh0ZW50RG9tYWluWzFdO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB4MCA9IHhFeHRlbnRbMF0sIHgxID0geEV4dGVudFsxXTtcbiAgICAgICAgICAgIGlmICh4LmludmVydCkgeDAgPSB4LmludmVydCh4MCksIHgxID0geC5pbnZlcnQoeDEpO1xuICAgICAgICAgICAgaWYgKHgxIDwgeDApIHQgPSB4MCwgeDAgPSB4MSwgeDEgPSB0O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoeSkge1xuICAgICAgICAgIGlmICh5RXh0ZW50RG9tYWluKSB7XG4gICAgICAgICAgICB5MCA9IHlFeHRlbnREb21haW5bMF0sIHkxID0geUV4dGVudERvbWFpblsxXTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeTAgPSB5RXh0ZW50WzBdLCB5MSA9IHlFeHRlbnRbMV07XG4gICAgICAgICAgICBpZiAoeS5pbnZlcnQpIHkwID0geS5pbnZlcnQoeTApLCB5MSA9IHkuaW52ZXJ0KHkxKTtcbiAgICAgICAgICAgIGlmICh5MSA8IHkwKSB0ID0geTAsIHkwID0geTEsIHkxID0gdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHggJiYgeSA/IFsgWyB4MCwgeTAgXSwgWyB4MSwgeTEgXSBdIDogeCA/IFsgeDAsIHgxIF0gOiB5ICYmIFsgeTAsIHkxIF07XG4gICAgICB9XG4gICAgICBpZiAoeCkge1xuICAgICAgICB4MCA9IHpbMF0sIHgxID0gelsxXTtcbiAgICAgICAgaWYgKHkpIHgwID0geDBbMF0sIHgxID0geDFbMF07XG4gICAgICAgIHhFeHRlbnREb21haW4gPSBbIHgwLCB4MSBdO1xuICAgICAgICBpZiAoeC5pbnZlcnQpIHgwID0geCh4MCksIHgxID0geCh4MSk7XG4gICAgICAgIGlmICh4MSA8IHgwKSB0ID0geDAsIHgwID0geDEsIHgxID0gdDtcbiAgICAgICAgaWYgKHgwICE9IHhFeHRlbnRbMF0gfHwgeDEgIT0geEV4dGVudFsxXSkgeEV4dGVudCA9IFsgeDAsIHgxIF07XG4gICAgICB9XG4gICAgICBpZiAoeSkge1xuICAgICAgICB5MCA9IHpbMF0sIHkxID0gelsxXTtcbiAgICAgICAgaWYgKHgpIHkwID0geTBbMV0sIHkxID0geTFbMV07XG4gICAgICAgIHlFeHRlbnREb21haW4gPSBbIHkwLCB5MSBdO1xuICAgICAgICBpZiAoeS5pbnZlcnQpIHkwID0geSh5MCksIHkxID0geSh5MSk7XG4gICAgICAgIGlmICh5MSA8IHkwKSB0ID0geTAsIHkwID0geTEsIHkxID0gdDtcbiAgICAgICAgaWYgKHkwICE9IHlFeHRlbnRbMF0gfHwgeTEgIT0geUV4dGVudFsxXSkgeUV4dGVudCA9IFsgeTAsIHkxIF07XG4gICAgICB9XG4gICAgICByZXR1cm4gYnJ1c2g7XG4gICAgfTtcbiAgICBicnVzaC5jbGVhciA9IGZ1bmN0aW9uKCkge1xuICAgICAgaWYgKCFicnVzaC5lbXB0eSgpKSB7XG4gICAgICAgIHhFeHRlbnQgPSBbIDAsIDAgXSwgeUV4dGVudCA9IFsgMCwgMCBdO1xuICAgICAgICB4RXh0ZW50RG9tYWluID0geUV4dGVudERvbWFpbiA9IG51bGw7XG4gICAgICB9XG4gICAgICByZXR1cm4gYnJ1c2g7XG4gICAgfTtcbiAgICBicnVzaC5lbXB0eSA9IGZ1bmN0aW9uKCkge1xuICAgICAgcmV0dXJuICEheCAmJiB4RXh0ZW50WzBdID09IHhFeHRlbnRbMV0gfHwgISF5ICYmIHlFeHRlbnRbMF0gPT0geUV4dGVudFsxXTtcbiAgICB9O1xuICAgIHJldHVyb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gICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgYnV5ZXJfZW1haWwgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IGJ1eWVyX3Bob25lIH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57e2N1cnJlbmN5fX17eyBhbW91bnQgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IG9yZGVyX2RhdGUgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IGlkIH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD5cbiAgICAgICAgICAgICAgICA8cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj5cbiAgICAgICAgICAgICAgICAgIHt7I2lmIGFtb3VudCA9PT0gMH19XG4gICAgICAgICAgICAgICAgICAgIDxzcGFuPkZyZWUgb3JkZXI8L3NwYW4+XG4gICAgICAgICAgICAgICAgICB7e2Vsc2V9fVxuICAgICAgICAgICAgICAgICAgICA8c3Bhbj5QYWlkIG9yZGVyPC9zcGFuPlxuICAgICAgICAgICAgICAgICAge3svaWZ9fVxuICAgICAgICAgICAgICAgIDwvcD5cbiAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPjxhIGNsYXNzPVwiYm94b2ZmaWNlLWJ1dHRvbiBib3hvZmZpY2UtYnV0dG9uLWluZm9cIiBocmVmPVwiamF2YXNjcmlwdDp2b2lkKDApXCIgb24tY2xpY2s9XCJzaG93T3JkZXJcIj5MaW5lIEl0ZW1zPC9hPjwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+XG4gICAgICAgICAgICAgICA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VyfX1cbiAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cIm9yZGVyLXNsaWRlclwiIGludHJvLW91dHJvPSdmbHk6e3g6MjAwLHk6MCxkdXJhdGlvbjoyMDB9Jz5cbiAgICAgICAgICAgICAgICA8YnV0dG9uIG9uLWNsaWNrPVwiaGlkZU9yZGVyXCIgY2xhc3M9XCJjbG9zZS1idXR0b25cIj48aSBjbGFzcz1cImZhIGZhLWNsb3NlXCI+PC9pPjwvYnV0dG9uPlxuICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwib3JkZXItdGl0bGVcIj5PcmRlciBJbnZvaWNlIE5vOiB7e2ludm9pY2Vfbm99fTwvcD5cbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwibGluZS1pdGVtcy13cmFwcGVyXCI+XG4gICAgICAgICAgICAgICAgICB7eyNsaW5lX2l0ZW1zOmxpbmVfaXRlbX19XG4gICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0aWNrZXQgY29sLXNtLTYgY29sLXhzLTEyXCIgaWQ9XCJpdGVtLXt7IEBpbmRleCB9fVwiPlxuICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJoZWFkaW5nXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGlja2V0LXR5cGVcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+e3sgdGl0bGUgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGVudFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbnRlbnQtYm94XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+aWQ6PC9zcGFuPiB7eyBpZCB9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PjwvcD57ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgICB7eyNhc3NpZ25lZV9kZXRhaWxzfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPkZ1bGxuYW1lOjwvc3Bhbj4ge3sgZnVsbG5hbWUgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5FbWFpbDo8L3NwYW4+IHt7IGVtYWlsIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+UGhvbmU6PC9zcGFuPiB7eyBwaG9uZSB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7eyNkZXRhaWxzOmtleSB9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj57eyBrZXkgfX06PC9zcGFuPiB7eyAuIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHt7ZWxzZX19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PGI+Tm90IGFzc2lnbmVkPC9iPjwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3sjY2FuY2VsX3RpY2tldF91cmwgJiYgIWNhbmNlbGxlZF9hdH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYm94b2ZmaWNlLWJ1dHRvbiBib3hvZmZpY2UtYnV0dG9uLXNtYWxsIGJveG9mZmljZS1idXR0b24taW5mb1wiIGhyZWY9XCJqYXZhc2NyaXB0OnZvaWQoMClcIiBvbi1jbGljaz1cImNhbmNlbFRpY2tldFwiIHt7I2NhbmNlbGxpbmd9fWRpc2FibGVke3svfX0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbmNlbCB7eyNjYW5jZWxsaW5nfX08aSBjbGFzcz1cImZhIGZhLXNwaW5uZXIgZmEtc3BpblwiPjwvaT57ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwiZXJyb3ItbXNnIGxlZnQtYWxpZ25lZFwiPnt7Y2FuY2VsX2Vycm9yfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIHt7L3Nob3dfb3JkZXJ9fVxuICAgICAgICAgIHt7L29yZGVyc319XG4gICAgICAgICAgPC90Ym9keT5cbiAgICAgICAgICA8dGZvb3Q+XG4gICAgICAgICAgICA8dHI+XG4gICAgICAgICAgICAgIDx0ZCBjb2xzcGFuPVwiMTBcIj5cbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFnaW5hdGlvbiBwYWdpbmF0aW9uLWNlbnRlcmVkXCI+PC9kaXY+XG4gICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICA8L3RyPlxuICAgICAgICAgIDwvdGZvb3Q+XG4gICAgICAgIDwvdGFibGU+XG4gICAgICA8L2Rpdj5cbiAgICB7e2Vsc2V9fVxuICAgICAgPHAgY2xhc3M9XCJ0ZXh0LWNlbnRlclwiPkN1c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AgICAgICAgICAgIDxwIGNsYXNzPVwic2VjdGlvbi10aXRsZVwiPk9yZ2FuaXphdGlvbiBpZDwvcD5cbiAgICAgICAgICAgICAgPHAgY2xhc3M9XCJzZWN0aW9uLWNvbnRlbnRcIj57e2lkfX08L3A+XG4gICAgICAgICAgICAgIHt7I2RldGFpbHM6ayx2fX1cbiAgICAgICAgICAgICAgICB7eyNpZiBrICE9PSAnbG9nbyd9fVxuICAgICAgICAgICAgICAgICAgPHAgY2xhc3M9XCJzZWN0aW9uLXRpdGxlXCI+e3trfX08L3A+XG4gICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2VjdGlvbi1jb250ZW50XCI+e3t7ZGV0YWlsc1trXX19fTwvZGl2PlxuICAgICAgICAgICAgICAgIHt7L2lmfX1cbiAgICAgICAgICAgICAge3svZGV0YWlsc319XG4gICAgICAgICAgICAgIDxwIGNsYXNzPVwic2VjdGlvbi10aXRsZVwiPkNvbnRhY3QgZW1haWw8L3A+XG4gICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJzZWN0aW9uLWNvbnRlbnRcIj57e2NvbnRhY3RfZW1haWx9fTwvZGl2PlxuICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYnRuLXdyYXBwZXJcIj5cbiAgICAgICAgICAgICAgICA8YSBjbGFzcz1cImJveG9mZmljZS1idXR0b24gYm94b2ZmaWNlLWJ1dHRvbi1hY3Rpb25cIiBocmVmPVwiamF2YXNjcmlwdDp2b2lkKDApXCIgb24tY2xpY2s9XCJuYXZpZ2F0ZVwiPlZpZXcgaXRlbSBjb2xsZWN0aW9uczwvYT5cbiAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgIHt7I2luZm9Nc2d9fVxuICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwiaW5mby1tc2dcIj57eyBpbmZvTXNnIH19IDxpIGNsYXNzPVwiZmEgZmEtY2hlY2tcIj48L2k+PC9wPlxuICAgICAgICAgICAgICB7ey99fVxuICA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9zdCh7XG4gICAgICAgICAgICB1cmw6IGV2ZW50LmNvbnRleHQuY2FuY2VsX3RpY2tldF91cmxcbiAgICAgICAgICB9KS5kb25lKGZ1bmN0aW9uKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBtYWluX3JhY3RpdmUuc2V0KGV2ZW50LmtleXBhdGggKyAnLmNhbmNlbGxlZF9hdCcsIHJlc3BvbnNlLnJlc3VsdC5jYW5jZWxsZWRfYXQpO1xuICAgICAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5jYW5jZWxsaW5nJywgZmFsc2UpO1xuICAgICAgICAgIH0pLmZhaWwoZnVuY3Rpb24ocmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBlcnJvcl90ZXh0O1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnJlYWR5U3RhdGUgPT09IDQpIHtcbiAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnN0YXR1cyA9PT0gNTAwKSB7XG4gICAgICAgICAgICAgICAgZXJyb3JfdGV4dCA9IFwiU2VydmVyIEVycm9yXCI7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZXJyb3JfdGV4dCA9IEpTT04ucGFyc2UocmVzcG9uc2UucmVzcG9uc2VUZXh0KS5lcnJvcl9kZXNjcmlwdGlvbjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIGVycm9yX3RleHQgPSBcIlVuYWJsZSB0byBjb25uZWN0LiBQbGVhc2UgdHJ5IGFnYWluIGxhdGVyLlwiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5jYW5jZWxfZXJyb3InLCBlcnJvcl90ZXh0KTtcbiAgICAgICAgICAgIG1haW5fcmFjdGl2ZS5zZXQoZXZlbnQua2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hbHNlfSkuc3RhcnQoKTtcbiAgICAgICAgICBldmVudEJ1cy50cmlnZ2VyKCduYXZpZ2F0ZScsIGV2ZW50LmNvbnRleHQudXJsKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuICB9LFxuICByZW5kZXI6IGZ1bmN0aW9uKHZpZXcsIGljX2NvbmZpZykge1xuICAgIGlmICh0aGlzLm9uKSB7XG4gICAgICB0aGlzLnJhY3RpdmUuc2V0KHtcbiAgICAgICAgJ3NpZGViYXJJdGVtcyc6IFNpZGVCYXJNb2RlbC5nZXRJdGVtcyhpY19jb25maWcpLFxuICAgICAgICAnYWN0aXZlSXRlbSc6IHZpZXcsXG4gICAgICAgICdzaWRlYmFySGlkZSc6IGZhbHNlLFxuICAgICAgICAnc2lkZWJhck1vYmlsZU9uJzogZmFsc2VcbiAgICAgIH0pO1xuICAgIH1cbiAgICBlbHNlIHtcbiAgICAgIHRoaXMuaW5pdCh2aWV3LCBpY19jb25maWcpO1xuICAgIH1cbiAgfSxcbiAgaGlkZTogZnVuY3Rpb24oKSB7XG4gICAgaWYgKHRoaXMub24pIHtcbiAgICAgIHRoaXMucmFjdGl2ZS5zZXQoJ3NpZGViYXJIaWRlJywgdHJ1ZSk7XG4gICAgfVxuICB9XG59O1xuIl19 diff --git a/boxoffice/static/js/models/admin_report.js b/boxoffice/static/js/models/admin_report.js new file mode 100644 index 00000000..23f9c84e --- /dev/null +++ b/boxoffice/static/js/models/admin_report.js @@ -0,0 +1,21 @@ +import {fetch, post} from './util.js'; +import {IndexModel} from './index.js'; + +export const ReportModel = { + fetch: fetch, + post: post, + urlFor: function(action, config){ + let urls = { + 'index': { + 'path': IndexModel.urlFor('index')['path'] + 'ic/' + config.ic_id + '/reports', + 'relative_path': 'ic/' + config.ic_id + '/reports', + 'method': 'GET' + }, + 'orders': { + 'path': IndexModel.urlFor('index')['path'] + 'ic/' + config.ic_id + '/reports/order', + 'method': 'GET' + } + } + return urls[action]; + } +}; diff --git a/boxoffice/static/js/models/sidebar.js b/boxoffice/static/js/models/sidebar.js index feb34c8d..ef708e43 100644 --- a/boxoffice/static/js/models/sidebar.js +++ b/boxoffice/static/js/models/sidebar.js @@ -2,6 +2,7 @@ import {IndexModel} from './index.js'; import {OrgModel} from './org.js'; import {ItemCollectionModel} from './item_collection.js'; import {OrderModel} from './admin_order.js'; +import {ReportModel} from './admin_report.js'; export const SideBarModel = { getItems: function(config) { @@ -31,6 +32,12 @@ export const SideBarModel = { title: 'Orders', icon: 'fa-shopping-cart', view: 'orders' + }, + { + url: ReportModel.urlFor('index', {ic_id: config.ic_id})['relative_path'], + title: 'Reports', + icon: 'fa-file-excel-o', + view: 'reports' } ] } diff --git a/boxoffice/static/js/templates/admin_report.html.js b/boxoffice/static/js/templates/admin_report.html.js new file mode 100644 index 00000000..9aefa8ad --- /dev/null +++ b/boxoffice/static/js/templates/admin_report.html.js @@ -0,0 +1,27 @@ + +export const ReportTemplate = ` +
+

{{ title }}

+
+
+

Download reports

+
+
+
+
+
+

Report type

+ +
+
+ Download +
+

{{download_report_error}}

+
+
+
+
+
+` diff --git a/boxoffice/static/js/views/admin_report.js b/boxoffice/static/js/views/admin_report.js new file mode 100644 index 00000000..1f5eac37 --- /dev/null +++ b/boxoffice/static/js/views/admin_report.js @@ -0,0 +1,38 @@ + +import {ReportModel} from '../models/admin_report.js'; +import {ReportTemplate} from '../templates/admin_report.html.js'; +import {SideBarView} from './sidebar.js'; + +export const ReportView = { + render: function(config) { + + ReportModel.fetch({ + url: ReportModel.urlFor('index', {ic_id: config.id})['path'] + }).done((remoteData) => { + // Initial render + let main_ractive = new Ractive({ + el: '#main-content-area', + template: ReportTemplate, + data: { + title: remoteData.title, + reports_url: function() { + let report_type = this.get('report_type'); + return ReportModel.urlFor(report_type, {ic_id: config.id})['path']; + }, + reports_filename: function() { + let filename = this.get('title').replace(/ /g, '_'); + return filename + '_' + this.get('report_type') + '.csv'; + } + } + }); + + SideBarView.render('reports', {'org_name': remoteData.org_name, 'ic_id': config.id}); + + NProgress.done(); + + window.addEventListener('popstate', (event) => { + NProgress.configure({ showSpinner: false}).start(); + }); + }); + } +}; diff --git a/boxoffice/static/js/views/router.js b/boxoffice/static/js/views/router.js index 1b3bfca6..92403fd2 100644 --- a/boxoffice/static/js/views/router.js +++ b/boxoffice/static/js/views/router.js @@ -3,6 +3,7 @@ import {IndexView} from './index.js'; import {OrgView} from './org.js'; import {ItemCollectionView} from './item_collection.js'; import {OrderView} from './admin_order.js'; +import {ReportView} from './admin_report.js'; export const Router = Backbone.Router.extend({ url_root: '/admin/', @@ -10,7 +11,8 @@ export const Router = Backbone.Router.extend({ "": "index", "o/:org": "org", "ic/:icId": "item_collection", - "ic/:icId/orders": "order" + "ic/:icId/orders": "order", + "ic/:icId/reports": "report" }, index: function() { IndexView.render(); @@ -23,5 +25,8 @@ export const Router = Backbone.Router.extend({ }, order: function(icId){ OrderView.render({id: icId}); + }, + report: function(icId){ + ReportView.render({id: icId}); } }); diff --git a/boxoffice/views/__init__.py b/boxoffice/views/__init__.py index d7fff6c3..7dda6cd7 100644 --- a/boxoffice/views/__init__.py +++ b/boxoffice/views/__init__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -from . import admin, item_collection, order, participant, login, admin_item_collection, admin_order +from . import admin, item_collection, order, participant, login, admin_item_collection, admin_order, admin_report diff --git a/boxoffice/views/admin_report.py b/boxoffice/views/admin_report.py new file mode 100644 index 00000000..3c631e06 --- /dev/null +++ b/boxoffice/views/admin_report.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- + +import unicodecsv +from cStringIO import StringIO +from flask import jsonify, Response +from .. import app, lastuser +from coaster.views import load_models, render_with +from boxoffice.models import ItemCollection, Order + + +order_headers = [ + 'id', + 'paid date', + 'invoice no', + 'final amount', + 'buyer name', + 'buyer email', + 'buyer phone', + 'item title', + 'item base amount', + 'item discounted amount', + 'item final amount', + 'item status', + 'attendee name', + 'attendee email', + 'attendee phone' + ] + + +def order_data(order): + return [ + order.id, + order.paid_at, + order.invoice_no, + order.get_amounts().final_amount, + order.buyer_fullname, + order.buyer_email, + order.buyer_phone] + + +def line_item_details(line_item, col): + for k, v in line_item.current_assignee.details.items(): + col.append(v) if v else col.append('') + col.append(line_item.current_assignee.details) + return col + + +def line_item_data(line_item, col): + col.extend([ + line_item.item.title, + line_item.base_amount, + line_item.discounted_amount, + line_item.final_amount, + 'cancelled' if line_item.status else 'confirmed' + ]) + if line_item.current_assignee: + col.extend([ + line_item.current_assignee.fullname, + line_item.current_assignee.email, + line_item.current_assignee.phone, + ]) + return line_item_details(line_item, col) + else: + return col + + +def jsonify_report(data_dict): + return jsonify(org_name=data_dict['item_collection'].organization.name, title=data_dict['item_collection'].title) + + +@app.route('/admin/ic//reports') +@lastuser.requires_login +@load_models( + (ItemCollection, {'id': 'ic_id'}, 'item_collection'), + permission='org_admin' + ) +@render_with({'text/html': 'index.html', 'application/json': jsonify_report}, json=True) +def admin_report(item_collection): + return dict(title=item_collection.organization.title, item_collection=item_collection) + + +@app.route('/admin/ic//reports/order') +@lastuser.requires_login +@load_models( + (ItemCollection, {'id': 'ic_id'}, 'item_collection'), + permission='org_admin' + ) +def admin_order_report(item_collection): + orders = Order.query.filter_by(item_collection=item_collection).order_by('created_at').all() + outfile = StringIO() + out = unicodecsv.writer(outfile, encoding='utf-8') + out.writerow(order_headers) + for order in orders: + if (order.is_confirmed): + col = [] + for line_item in order.line_items: + col = order_data(order) + out.writerow(line_item_data(line_item, col)) + outfile.seek(0) + contents = outfile.getvalue() + outfile.close + return Response(unicode(contents, 'utf-8'), mimetype='text/csv') From dff4c85254ea7e7ccc9cd7ce825001613e015aa5 Mon Sep 17 00:00:00 2001 From: Vidya Ramakrishnan Date: Mon, 12 Sep 2016 11:44:59 +0530 Subject: [PATCH 02/41] Update requirements.txt --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index bc9e9dfe..d8d78412 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,3 +18,4 @@ premailer python-dateutil tabulate Flask-Admin +unicodecsv From 958a027ea80ac3ed2c84904719a367f78345e2b6 Mon Sep 17 00:00:00 2001 From: Shreyas Satish Date: Mon, 12 Sep 2016 21:47:16 +0530 Subject: [PATCH 03/41] rm admin_order_report, added admin_assignee_report --- boxoffice/views/admin_report.py | 105 ++++---------------------------- 1 file changed, 13 insertions(+), 92 deletions(-) diff --git a/boxoffice/views/admin_report.py b/boxoffice/views/admin_report.py index 3c631e06..503d84d9 100644 --- a/boxoffice/views/admin_report.py +++ b/boxoffice/views/admin_report.py @@ -1,102 +1,23 @@ # -*- coding: utf-8 -*- -import unicodecsv -from cStringIO import StringIO -from flask import jsonify, Response +from flask import Response from .. import app, lastuser -from coaster.views import load_models, render_with -from boxoffice.models import ItemCollection, Order +from coaster.views import load_models +from boxoffice.models import db, ItemCollection, Order, Item, LineItem, Assignee, LINE_ITEM_STATUS -order_headers = [ - 'id', - 'paid date', - 'invoice no', - 'final amount', - 'buyer name', - 'buyer email', - 'buyer phone', - 'item title', - 'item base amount', - 'item discounted amount', - 'item final amount', - 'item status', - 'attendee name', - 'attendee email', - 'attendee phone' - ] - - -def order_data(order): - return [ - order.id, - order.paid_at, - order.invoice_no, - order.get_amounts().final_amount, - order.buyer_fullname, - order.buyer_email, - order.buyer_phone] - - -def line_item_details(line_item, col): - for k, v in line_item.current_assignee.details.items(): - col.append(v) if v else col.append('') - col.append(line_item.current_assignee.details) - return col - - -def line_item_data(line_item, col): - col.extend([ - line_item.item.title, - line_item.base_amount, - line_item.discounted_amount, - line_item.final_amount, - 'cancelled' if line_item.status else 'confirmed' - ]) - if line_item.current_assignee: - col.extend([ - line_item.current_assignee.fullname, - line_item.current_assignee.email, - line_item.current_assignee.phone, - ]) - return line_item_details(line_item, col) - else: - return col - - -def jsonify_report(data_dict): - return jsonify(org_name=data_dict['item_collection'].organization.name, title=data_dict['item_collection'].title) - - -@app.route('/admin/ic//reports') -@lastuser.requires_login -@load_models( - (ItemCollection, {'id': 'ic_id'}, 'item_collection'), - permission='org_admin' - ) -@render_with({'text/html': 'index.html', 'application/json': jsonify_report}, json=True) -def admin_report(item_collection): - return dict(title=item_collection.organization.title, item_collection=item_collection) - - -@app.route('/admin/ic//reports/order') +@app.route('/admin/ic//reports/attendee.csv') @lastuser.requires_login @load_models( (ItemCollection, {'id': 'ic_id'}, 'item_collection'), permission='org_admin' ) -def admin_order_report(item_collection): - orders = Order.query.filter_by(item_collection=item_collection).order_by('created_at').all() - outfile = StringIO() - out = unicodecsv.writer(outfile, encoding='utf-8') - out.writerow(order_headers) - for order in orders: - if (order.is_confirmed): - col = [] - for line_item in order.line_items: - col = order_data(order) - out.writerow(line_item_data(line_item, col)) - outfile.seek(0) - contents = outfile.getvalue() - outfile.close - return Response(unicode(contents, 'utf-8'), mimetype='text/csv') +def admin_assignee_report(item_collection): + line_item_join = db.outerjoin(LineItem, Assignee).join(Item).join(Order) + line_item_stmt = db.select([LineItem.id, Item.title, Order.buyer_fullname, Order.buyer_email, Order.buyer_phone, Assignee.fullname, Assignee.email, Assignee.phone, Assignee.details]).select_from(line_item_join).where(LineItem.status == LINE_ITEM_STATUS.CONFIRMED).where(Assignee.current == True).where(Order.item_collection == item_collection).order_by('created_at') + records = db.session.execute(line_item_stmt).fetchall() + + def generate(): + for row in records: + yield ','.join([unicode(attr) for attr in row]) + '\n' + return Response(generate(), mimetype='text/csv') From 3867b57b4c5c9b6e6291a57ccdea14c69dd9f9cf Mon Sep 17 00:00:00 2001 From: Vidya Ramakrishnan Date: Mon, 12 Sep 2016 22:18:49 +0530 Subject: [PATCH 04/41] Add view for admin page for report. Change route to attendee.csv --- boxoffice/static/js/dist/bundle.js | 8 ++++---- boxoffice/static/js/models/admin_report.js | 4 ++-- .../static/js/templates/admin_report.html.js | 2 +- boxoffice/views/admin_report.py | 19 +++++++++++++++++-- requirements.txt | 1 - 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/boxoffice/static/js/dist/bundle.js b/boxoffice/static/js/dist/bundle.js index 6ead9b69..ac270b3c 100644 --- a/boxoffice/static/js/dist/bundle.js +++ b/boxoffice/static/js/dist/bundle.js @@ -75,8 +75,8 @@ var ReportModel = { relative_path: "ic/" + config.ic_id + "/reports", method: "GET" }, - orders: { - path: IndexModel.urlFor("index").path + "ic/" + config.ic_id + "/reports/order", + attendees: { + path: IndexModel.urlFor("index").path + "ic/" + config.ic_id + "/reports/attendee.csv", method: "GET" } }; @@ -31345,7 +31345,7 @@ exports.OrderTemplate = OrderTemplate; Object.defineProperty(exports, "__esModule", { value: true }); -var ReportTemplate = "\n
\n

{{ title }}

\n
\n
\n

Download reports

\n
\n
\n
\n
\n
\n

Report type

\n \n
\n
\n Download\n
\n

{{download_report_error}}

\n
\n
\n
\n
\n
\n"; +var ReportTemplate = "\n
\n

{{ title }}

\n
\n
\n

Download reports

\n
\n
\n
\n
\n
\n

Report type

\n \n
\n
\n Download\n
\n

{{download_report_error}}

\n
\n
\n
\n
\n
\n"; exports.ReportTemplate = ReportTemplate; },{}],16:[function(require,module,exports){ @@ -31886,4 +31886,4 @@ var SideBarView = { exports.SideBarView = SideBarView; },{"../models/sidebar.js":7,"../templates/sidebar.html.js":19}]},{},[1]) -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCIvVXNlcnMvdmlkeWEvRG9jdW1lbnRzL0hhc0dlZWsvYm94b2ZmaWNlL2JveG9mZmljZS9zdGF0aWMvanMvdmlld3MvbWFpbi5qcyIsIi9Vc2Vycy92aWR5YS9Eb2N1bWVudHMvSGFzR2Vlay9ib3hvZmZpY2UvYm94b2ZmaWNlL3N0YXRpYy9qcy9tb2RlbHMvYWRtaW5fb3JkZXIuanMiLCIvVXNlcnMvdmlkeWEvRG9jdW1lbnRzL0hhc0dlZWsvYm94b2ZmaWNlL2JveG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VtcyA9IFtcbiAgICAgICAge1xuICAgICAgICAgIHVybDogSW5kZXhNb2RlbC51cmxGb3IoJ2luZGV4JylbJ3JlbGF0aXZlX3BhdGgnXSxcbiAgICAgICAgICB0aXRsZTogJ0hvbWUnLFxuICAgICAgICAgIGljb246ICdmYS1ob21lJyxcbiAgICAgICAgICB2aWV3OiAnaG9tZSdcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIHVybDogT3JnTW9kZWwudXJsRm9yKCdpbmRleCcsIHtvcmdfbmFtZTogY29uZmlnLm9yZ19uYW1lfSlbJ3JlbGF0aXZlX3BhdGgnXSxcbiAgICAgICAgICB0aXRsZTogJ09yZ2FuaXphdGlvbicsXG4gICAgICAgICAgaWNvbjogJ2ZhLXNpdGVtYXAnLFxuICAgICAgICAgIHZpZXc6ICdvcmcnXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICB1cmw6IEl0ZW1Db2xsZWN0aW9uTW9kZWwudXJsRm9yKCdpbmRleCcsIHtpY19pZDogY29uZmlnLmljX2lkfSlbJ3JlbGF0aXZlX3BhdGgnXSxcbiAgICAgICAgICB0aXRsZTogJ0Rhc2hib2FyZCcsXG4gICAgICAgICAgaWNvbjogJ2ZhLWRhc2hib2FyZCcsXG4gICAgICAgICAgdmlldzogJ2Rhc2hib2FyZCdcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIHVybDogT3JkZXJNb2RlbC51cmxGb3IoJ2luZGV4Jywge2ljX2lkOiBjb25maWcuaWNfaWR9KVsncmVsYXRpdmVfcGF0aCddLFxuICAgICAgICAgIHRpdGxlOiAnT3JkZXJzJyxcbiAgICAgICAgICBpY29uOiAnZmEtc2hvcHBpbmctY2FydCcsXG4gICAgICAgICAgdmlldzogJ29yZGVycydcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIHVybDogUmVwb3J0TW9kZWwudXJsRm9yKCdpbmRleCcsIHtpY19pZDogY29uZmlnLmljX2lkfSlb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jYmlKZGZRPT0iLCIoZnVuY3Rpb24gKHdpbmRvdykge1xuICAgICd1c2Ugc3RyaWN0JztcblxuICAgIC8qZ2xvYmFsIGRlZmluZSwgbW9kdWxlLCBleHBvcnRzLCByZXF1aXJlICovXG5cbiAgICB2YXIgYzMgPSB7IHZlcnNpb246IFwiMC40LjExXCIgfTtcblxuICAgIHZhciBjM19jaGFydF9mbixcbiAgICAgICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4sXG4gICAgICAgIGMzX2NoYXJ0X2ludGVybmFsX2F4aXNfZm47XG5cbiAgICBmdW5jdGlvbiBBUEkob3duZXIpIHtcbiAgICAgICAgdGhpcy5vd25lciA9IG93bmVyO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGluaGVyaXQoYmFzZSwgZGVyaXZlZCkge1xuXG4gICAgICAgIGlmIChPYmplY3QuY3JlYXRlKSB7XG4gICAgICAgICAgICBkZXJpdmVkLnByb3RvdHlwZSA9IE9iamVjdC5jcmVhdGUoYmFzZS5wcm90b3R5cGUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIGYgPSBmdW5jdGlvbiBmKCkge307XG4gICAgICAgICAgICBmLnByb3RvdHlwZSA9IGJhc2UucHJvdG90eXBlO1xuICAgICAgICAgICAgZGVyaXZlZC5wcm90b3R5cGUgPSBuZXcgZigpO1xuICAgICAgICB9XG5cbiAgICAgICAgZGVyaXZlZC5wcm90b3R5cGUuY29uc3RydWN0b3IgPSBkZXJpdmVkO1xuXG4gICAgICAgIHJldHVybiBkZXJpdmVkO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIENoYXJ0KGNvbmZpZykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsID0gbmV3IENoYXJ0SW50ZXJuYWwodGhpcyk7XG4gICAgICAgICQkLmxvYWRDb25maWcoY29uZmlnKTtcblxuICAgICAgICAkJC5iZWZvcmVJbml0KGNvbmZpZyk7XG4gICAgICAgICQkLmluaXQoKTt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BHcmlkIGxpbmVzXG4gICAgICAgIGlmIChjb25maWcuZ3JpZF9saW5lc19mcm9udCkgeyAkJC5pbml0R3JpZExpbmVzKCk7IH1cblxuICAgICAgICAvLyBDb3ZlciB3aG9sZSB3aXRoIHJlY3RzIGZvciBldmVudHNcbiAgICAgICAgJCQuaW5pdEV2ZW50UmVjdCgpO1xuXG4gICAgICAgIC8vIERlZmluZSBnIGZvciBjaGFydFxuICAgICAgICAkJC5pbml0Q2hhcnRFbGVtZW50cygpO1xuXG4gICAgICAgIC8vIGlmIHpvb20gcHJpdmlsZWdlZCwgaW5zZXJ0IHJlY3QgdG8gZm9yZWZyb250XG4gICAgICAgIC8vIFRPRE86IGlzIHRoaXMgbmVlZGVkP1xuICAgICAgICBtYWluLmluc2VydCgncmVjdCcsIGNvbmZpZy56b29tX3ByaXZpbGVnZWQgPyBudWxsIDogJ2cuJyArIENMQVNTLnJlZ2lvbnMpXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCBDTEFTUy56b29tUmVjdClcbiAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsICQkLndpZHRoKVxuICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsICQkLmhlaWdodClcbiAgICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDApXG4gICAgICAgICAgICAub24oXCJkYmxjbGljay56b29tXCIsIG51bGwpO1xuXG4gICAgICAgIC8vIFNldCBkZWZhdWx0IGV4dGVudCBpZiBkZWZpbmVkXG4gICAgICAgIGlmIChjb25maWcuYXhpc194X2V4dGVudCkgeyAkJC5icnVzaC5leHRlbnQoJCQuZ2V0RGVmYXVsdEV4dGVudCgpKTsgfVxuXG4gICAgICAgIC8vIEFkZCBBeGlzXG4gICAgICAgICQkLmF4aXMuaW5pdCgpO1xuXG4gICAgICAgIC8vIFNldCB0YXJnZXRzXG4gICAgICAgICQkLnVwZGF0ZVRhcmdldHMoJCQuZGF0YS50YXJnZXRzKTtcblxuICAgICAgICAvLyBEcmF3IHdpdGggdGFyZ2V0c1xuICAgICAgICBpZiAoYmluZGluZykge1xuICAgICAgICAgICAgJCQudXBkYXRlRGltZW5zaW9uKCk7XG4gICAgICAgICAgICAkJC5jb25maWcub25pbml0LmNhbGwoJCQpO1xuICAgICAgICAgICAgJCQucmVkcmF3KHtcbiAgICAgICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogZmFsc2UsXG4gICAgICAgICAgICAgICAgd2l0aFRyYW5zZm9ybTogdHJ1ZSxcbiAgICAgICAgICAgICAgICB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgICAgICB3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgICAgICB3aXRoVHJhbnNpdGlvbkZvckF4aXM6IGZhbHNlXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEJpbmQgcmVzaXplIGV2ZW50XG4gICAgICAgICQkLmJpbmRSZXNpemUoKTtcblxuICAgICAgICAvLyBleHBvcnQgZWxlbWVudCBvZiB0aGUgY2hhcnRcbiAgICAgICAgJCQuYXBpLmVsZW1lbnQgPSAkJC5zZWxlY3RDaGFydC5ub2RlKCk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnNtb290aExpbmVzID0gZnVuY3Rpb24gKGVsLCB0eXBlKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXM7XG4gICAgICAgIGlmICh0eXBlID09PSAnZ3JpZCcpIHtcbiAgICAgICAgICAgIGVsLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBnID0gJCQuZDMuc2VsZWN0KHRoaXMpLFxuICAgICAgICAgICAgICAgICAgICB4MSA9IGcuYXR0cigneDEnKSxcbiAgICAgICAgICAgICAgICAgICAgeDIgPSBnLmF0dHIoJ3gyJyksXG4gICAgICAgICAgICAgICAgICAgIHkxID0gZy5hdHRyKCd5MScpLFxuICAgICAgICAgICAg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iAgICAgICAgfTtcblxuICAgICAgICAvLyBmb3Igc3ViY2hhcnRcbiAgICAgICAgJCQubWFyZ2luMiA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB7XG4gICAgICAgICAgICB0b3A6ICQkLm1hcmdpbi50b3AsXG4gICAgICAgICAgICByaWdodDogTmFOLFxuICAgICAgICAgICAgYm90dG9tOiAyMCArIGxlZ2VuZEhlaWdodEZvckJvdHRvbSxcbiAgICAgICAgICAgIGxlZnQ6ICQkLnJvdGF0ZWRfcGFkZGluZ19sZWZ0XG4gICAgICAgIH0gOiB7XG4gICAgICAgICAgICB0b3A6ICQkLmN1cnJlbnRIZWlnaHQgLSBzdWJjaGFydEhlaWdodCAtIGxlZ2VuZEhlaWdodEZvckJvdHRvbSxcbiAgICAgICAgICAgIHJpZ2h0OiBOYU4sXG4gICAgICAgICAgICBib3R0b206IHhBeGlzSGVpZ2h0ICsgbGVnZW5kSGVpZ2h0Rm9yQm90dG9tLFxuICAgICAgICAgICAgbGVmdDogJCQubWFyZ2luLmxlZnRcbiAgICAgICAgfTtcblxuICAgICAgICAvLyBmb3IgbGVnZW5kXG4gICAgICAgICQkLm1hcmdpbjMgPSB7XG4gICAgICAgICAgICB0b3A6IDAsXG4gICAgICAgICAgICByaWdodDogTmFOLFxuICAgICAgICAgICAgYm90dG9tOiAwLFxuICAgICAgICAgICAgbGVmdDogMFxuICAgICAgICB9O1xuICAgICAgICBpZiAoJCQudXBkYXRlU2l6ZUZvckxlZ2VuZCkgeyAkJC51cGRhdGVTaXplRm9yTGVnZW5kKGxlZ2VuZEhlaWdodCwgbGVnZW5kV2lkdGgpOyB9XG5cbiAgICAgICAgJCQud2lkdGggPSAkJC5jdXJyZW50V2lkdGggLSAkJC5tYXJnaW4ubGVmdCAtICQkLm1hcmdpbi5yaWdodDtcbiAgICAgICAgJCQuaGVpZ2h0ID0gJCQuY3VycmVudEhlaWdodCAtICQkLm1hcmdpbi50b3AgLSAkJC5tYXJnaW4uYm90dG9tO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ICAgICAgICAgICB0aWNrVmFsdWVzID0gJCQuYXhpcy51cGRhdGVYQXhpc1RpY2tWYWx1ZXModGFyZ2V0c1RvU2hvdyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAkJC54QXhpcy50aWNrVmFsdWVzKFtdKTtcbiAgICAgICAgICAgICQkLnN1YlhBeGlzLnRpY2tWYWx1ZXMoW10pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvbmZpZy56b29tX3Jlc2NhbGUgJiYgIW9wdGlvbnMuZmxvdykge1xuICAgICAgICAgICAgeERvbWFpbkZvclpvb20gPSAkJC54Lm9yZ0RvbWFpbigpO1xuICAgICAgICB9XG5cbiAgICAgICAgJCQueS5kb21haW4oJCQuZ2V0WURvbWFpbih0YXJnZXRzVG9TaG93LCAneScsIHhEb21haW5Gb3Jab29tKSk7XG4gICAgICAgICQkLnkyLmRvbWFpbigkJC5nZXRZRG9tYWluKHRhcmdldHNUb1Nob3csICd5MicsIHhEb21haW5Gb3Jab29tKSk7XG5cbiAgICAgICAgaWYgKCFjb25maWcuYXhpc195X3RpY2tfdmFsdWVzICYmIGNvbmZpZy5heGlzX3lfdGlja19jb3VudCkge1xuICAgICAgICAgICAgJCQueUF4aXMudGlja1ZhbHVlcygkJC5heGlzLmdlbmVyYXRlVGlja1ZhbHVlcygkJC55LmRvbWFpbigpLCBjb25maWcuYXhpc195X3RpY2tfY291bnQpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWNvbmZpZy5heGlzX3kyX3RpY2tfdmFsdWVzICYmIGNvbmZpZy5heGlzX3kyX3RpY2tfY291bnQpIHtcbiAgICAgICAgICAgICQkLnkyQXhpcy50aWNrVmFsdWVzKCQkLmF4aXMuZ2VuZXJhdGVUaWNrVmFsdWVzKCQkLnkyLmRvbWFpbigpLCBjb25maWcuYXhpc195Ml90aWNrX2NvdW50KSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBheGVzXG4gICAgICAgICQkLmF4aXMucmVkcmF3KHRyYW5zaXRpb25zLCBoaWRlQXhpcyk7XG5cbiAgICAgICAgLy8gVXBkYXRlIGF4aXMgbGFiZWxcbiAgICAgICAgJCQuYXhpcy51cGRhdGVMYWJlbHMod2l0aFRyYW5zaXRpb24pO1xuXG4gICAgICAgIC8vIHNob3cvaGlkZSBpZiBtYW51YWwgY3VsbGluZyBuZWVkZWRcbiAgICAgICAgaWYgKCh3aXRoVXBkYXRlWERvbWFpbiB8fCB3aXRoVXBkYXRlWEF4aXMpICYmIHRhcmdldHNUb1Nob3cubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoY29uZmlnLmF4aXNfeF90aWNrX2N1bGxpbmcgJiYgdGlja1ZhbHVlcykge1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPCB0aWNrVmFsdWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aWNrVmFsdWVzLmxlbmd0aCAvIGkgPCBjb25maWcuYXhpc194X3RpY2tfY3VsbGluZ19tYXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGludGVydmFsRm9yQ3VsbGluZyA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLmF4aXNYICsgJyAudGljayB0ZXh0JykuZWFjaChmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSB0aWNrVmFsdWVzLmluZGV4T2YoZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuc3R5bGUoJ2Rpc3BsYXknLCBpbmRleCAlIGludGVydmFsRm9yQ3VsbGluZyA/ICdub25lJyA6ICdibG9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3csICd5JykpO1xuICAgICAgICAgICAgJCQuc3ViWTIuZG9tYWluKCQkLmdldFlEb21haW4odGFyZ2V0c1RvU2hvdywgJ3kyJykpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8geGdyaWQgZm9jdXNcbiAgICAgICAgJCQudXBkYXRlWGdyaWRGb2N1cygpO1xuXG4gICAgICAgIC8vIERhdGEgZW1wdHkgbGFiZWwgcG9zaXRpb25pbmcgYW5kIHRleHQuXG4gICAgICAgIG1haW4uc2VsZWN0KFwidGV4dC5cIiArIENMQVNTLnRleHQgKyAnLicgKyBDTEFTUy5lbXB0eSlcbiAgICAgICAgICAgIC5hdHRyKFwieFwiLCAkJC53aWR0aCAvIDIpXG4gICAgICAgICAgICAuYXR0cihcInlcIiwgJCQuaGVpZ2h0IC8gMilcbiAgICAgICAgICAgIC50ZXh0KGNvbmZpZy5kYXRhX2VtcHR5X2xhYmVsX3RleHQpXG4gICAgICAgICAgLnRyYW5zaXRpb24oKVxuICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgdGFyZ2V0c1RvU2hvdy5sZW5ndGggPyAwIDogMSk7XG5cbiAgICAgICAgLy8gZ3JpZFxuICAgICAgICAkJC51cGRhdGVHcmlkKGR1cmF0aW9uKTtcblxuICAgICAgICAvLyByZWN0IGZvciByZWdpb25zXG4gICAgICAgICQkLnVwZGF0ZVJlZ2lvbihkdXJhdGlvbik7XG5cbiAgICAgICAgLy8gYmFyc1xuICAgICAgICAkJC51cGRhdGVCYXIoZHVyYXRpb25Gb3JFeGl0KTtcblxuICAgICAgICAvLyBsaW5lcywgYXJlYXMgYW5kIGNyaWNsZXNcbiAgICAgICAgJCQudXBkYXRlTGluZShkdXJhdGlvbkZvckV4aXQpO1xuICAgICAgICAkJC51cGRhdGVBcmVhKGR1cmF0aW9uRm9yRXhpdCk7XG4gICAgICAgICQkLnVwZGF0ZUNpcmNsZSgpO1xuXG4gICAgICAgIC8vIHRleHRcbiAgICAgICAgaWYgKCQkLmhhc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IHx8IGZsb3cpICYmICQkLmlzVGFiVmlzaWJsZSgpKSB7IC8vIE9ubHkgdXNlIHRyYW5zaXRpb24gaWYgdGFiIHZpc2libGUuIFNlZSAjOTM4LlxuICAgICAgICAgICAgLy8gdHJhbnNpdGlvbiBzaG91bGQgYmUgZGVyaXZlZCBmcm9tIG9uZSB0cmFuc2l0aW9uXG4gICAgICAgICAgICBkMy50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciB0cmFuc2l0aW9uc1RvV2FpdCA9IFtdO1xuXG4gICAgICAgICAgICAgICAgLy8gcmVkcmF3IGFuZCBnYXRoZXIgdHJhbnNpdGlvbnNcbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0JhcihkcmF3QmFyLCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3TGluZShkcmF3TGluZSwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0FyZWEoZHJhd0FyZWEsIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdDaXJjbGUoY3gsIGN5LCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3VGV4dCh4Rm9yVGV4dCwgeUZvclRleHQsIG9wdGlvbnMuZmxvdywgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd1JlZ2lvbih0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3R3JpZCh0cnVlKSxcbiAgICAgICAgICAgICAgICBdLmZvckVhY2goZnVuY3Rpb24gKHRyYW5zaXRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25zLmZvckVhY2goZnVuY3Rpb24gKHRyYW5zaXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25zVG9XYWl0LnB1c2godHJhbnNpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgLy8gV2FpdCBmb3IgZW5kIG9mIHRyYW5zaXRpb25zIHRvIGNhbGwgZmxvdyBhbmQgb25yZW5kZXJlZCBjYWxsYmFja1xuICAgICAgICAgICAgICAgIHdhaXRGb3JEcmF3ID0gJCQuZ2VuZXJhdGVXYWl0KCk7XG4gICAgICAgICAgICAgICAgdHJhbnNpdGlvbnNUb1dhaXQuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICB3YWl0Rm9yRHJhdy5hZGQodCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhbGwod2FpdEZvckRyYXcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoZmxvdykge1xuICAgICAgICAgICAgICAgICAgICBmbG93KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjb25maWcub25yZW5kZXJlZCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcub25yZW5kZXJlZC5jYWxsKCQkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICQkLnJlZHJhd0JhcihkcmF3QmFyKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0xpbmUoZHJhd0xpbmUpO1xuICAgICAgICAgICAgJCQucmVkcmF3QXJlYShkcmF3QXJlYSk7XG4gICAgICAgICAgICAkJC5yZWRyYXdDaXJjbGUoY3gsIGN5KTtcbiAgICAgICAgICAgICQkLnJlZHJhd1RleHQoeEZvclRleHQsIHlGb3JUZXh0LCBvcHRpb25zLmZsb3cpO1xuICAgICAgICAgICAgJCQucmVkcmF3UmVnaW9uKCk7XG4gICAgICAgICAgICAkJC5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24gcmVxdWlyZXMgdGhlIGFjdHVhbCBzaXplcyBkZXRlcm1pbmVkIGFmdGVyIHRoYXQgY29tcGxldGlvblxuICAgICAgICAgICAgICAgICAgICAkJC5pbnRlcnZhbEZvck9ic2VydmVJbnNlcnRlZCA9IHdpbmRvdy5zZXRJbnRlcnZhbChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBwYXJlbnROb2RlIHdpbGwgTk9UIGJlIG51bGwgd2hlbiBjb21wbGV0ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxlY3Rpb24ubm9kZSgpLnBhcmVudE5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2xlYXJJbnRlcnZhbCgkJC5pbnRlcnZhbEZvck9ic2VydmVJbnNlcnRlZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQudXBkYXRlRGltZW5zaW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmJydXNoKSB7ICQkLmJydXNoLnVwZGF0ZSgpOyB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLm9uaW5pdC5jYWxsKCQkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXcoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVHJhbnNmb3JtOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFRyYW5zaXRpb25Gb3JUcmFuc2Zvcm06IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoTGVnZW5kOiB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uLnRyYW5zaXRpb24oKS5zdHlsZSgnb3BhY2l0eScsIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9LCAxMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgICBvYnNlcnZlci5vYnNlcnZlKHNlbGVjdGlvbi5ub2RlKCksIHthdHRyaWJ1dGVzOiB0cnVlLCBjaGlsZExpc3Q6IHRydWUsIGNoYXJhY3RlckRhdGE6IHRydWV9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uYmluZFJlc2l6ZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuXG4gICAgICAgICQkLnJlc2l6ZUZ1bmN0aW9uID0gJCQuZ2VuZXJhdGVSZXNpemUoKTtcblxuICAgICAgICAkJC5yZXNpemVGdW5jdGlvbi5hZGQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgY29uZmlnLm9ucmVzaXplLmNhbGwoJCQpO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKGNvbmZpZy5yZXNpemVfYXV0bykge1xuICAgICAgICAgICAgJCQucmVzaXplRnVuY3Rpb24uYWRkKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoJCQucmVzaXplVGltZW91dCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jbGVhclRpbWVvdXQoJCQucmVzaXplVGltZW91dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLnJlc2l6ZVRpb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XNpemVGdW5jdGlvbnNbaV0gPT09IGYpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzaXplRnVuY3Rpb25zLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gY2FsbFJlc2l6ZUZ1bmN0aW9ucztcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZW5kYWxsID0gZnVuY3Rpb24gKHRyYW5zaXRpb24sIGNhbGxiYWNrKSB7XG4gICAgICAgIHZhciBuID0gMDtcbiAgICAgICAgdHJhbnNpdGlvblxuICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKCkgeyArK247IH0pXG4gICAgICAgICAgICAuZWFjaChcImVuZFwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEtLW4pIHsgY2FsbGJhY2suYXBwbHkodGhpcywgYXJndW1lbnRzKTsgfVxuICAgICAgICAgICAgfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZVdhaXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciB0cmFuc2l0aW9uc1RvV2FpdCA9IFtdLFxuICAgICAgICAgICAgZiA9IGZ1bmN0aW9uICh0cmFuc2l0aW9uLCBjYWxsYmFjaykge1xuICAgICAgICAgICAgICAgIHZhciB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRvbmUgPSAwO1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uc1RvV2FpdC5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodC5lbXB0eSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSArPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdC50cmFuc2l0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSArPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRvbmUgPT09IHRyYW5zaXRpb25zVG9XYWl0Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2spIHsgY2FsbGJhY2soKTsgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSwgMTApO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgZi5hZGQgPSBmdW5jdGlvbiAodHJhbnNpdGlvbikge1xuICAgICAgICAgICAgdHJhbnNpdGlvbnNUb1dhaXQucHVzaCh0cmFuc2l0aW9uKTtcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGY7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnBhcnNlRGF0ZSA9IGZ1bmN0aW9uIChkYXRlKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIHBhcnNlZERhdGU7XG4gICAgICAgIGlmIChkYXRlIGluc3RhbmNlb2YgRGF0ZSkge1xuICAgICAgICAgICAgcGFyc2VkRGF0ZSA9IGRhdGU7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGRhdGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBwYXJzZWREYXRlID0gJCQuZGF0YVRpbWVGb3JtYXQoJCQu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KSB7XG4gICAgICAgICAgICBoaWRkZW4gPSBcIndlYmtpdEhpZGRlblwiO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGRvY3VtZW50W2hpZGRlbl0gPyBmYWxzZSA6IHRydWU7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldERlZmF1bHRDb25maWcgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBjb25maWcgPSB7XG4gICAgICAgICAgICBiaW5kdG86ICcjY2hhcnQnLFxuICAgICAgICAgICAgc3ZnX2NsYXNzbmFtZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgc2l6ZV93aWR0aDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgc2l6ZV9oZWlnaHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBhZGRpbmdfbGVmdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGFkZGluZ19yaWdodDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGFkZGluZ190b3A6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBhZGRpbmdfYm90dG9tOiB1bmRlZmluZWQsXG4gICAgICAgICAgICByZXNpemVfYXV0bzogdHJ1ZSxcbiAgICAgICAgICAgIHpvb21fZW5hYmxlZDogZmFsc2UsXG4gICAgICAgICAgICB6b29tX2V4dGVudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgem9vbV9wcml2aWxlZ2VkOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb21fcmVzY2FsZTogZmFsc2UsXG4gICAgICAgICAgICB6b29tX29uem9vbTogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB6b29tX29uem9vbXN0YXJ0OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHpvb21fb256b29tZW5kOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHpvb21feF9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHpvb21feF9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGludGVyYWN0aW9uX2JyaWdodGVuOiB0cnVlLFxuICAgICAgICAgICAgaW50ZXJhY3Rpb25fZW5hYmxlZDogdHJ1ZSxcbiAgICAgICAgICAgIG9ubW91c2VvdmVyOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9ubW91c2VvdXQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25yZXNpemU6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25yZXNpemVkOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9uaW5pdDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbnJlbmRlcmVkOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHRyYW5zaXRpb25fZHVyYXRpb246IDM1MCxcbiAgICAgICAgICAgIGRhdGFfeDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV94czoge30sXG4gICAgICAgICAgICBkYXRhX3hGb3JtYXQ6ICclWS0lbS0lZCcsXG4gICAgICAgICAgICBkYXRhX3hMb2NhbHRpbWU6IHRydWUsXG4gICAgICAgICAgICBkYXRhX3hTb3J0OiB0cnVlLFxuICAgICAgICAgICAgZGF0YV9pZENvbnZlcnRlcjogZnVuY3Rpb24gKGlkKSB7IHJldHVybiBpZDsgfSxcbiAgICAgICAgICAgIGRhdGFfbmFtZXM6IHt9LFxuICAgICAgICAgICAgZGF0YV9jbGFzc2VzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfZ3JvdXBzOiBbXSxcbiAgICAgICAgICAgIGRhdGFfYXhlczoge30sXG4gICAgICAgICAgICBkYXRhX3R5cGU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRhdGFfdHlwZXM6IHt9LFxuICAgICAgICAgICAgZGF0YV9sYWJlbHM6IHt9LFxuICAgICAgICAgICAgZGF0YV9vcmRlcjogJ2Rlc2MnLFxuICAg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lVHlwZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV9rZXlzOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyBjb25maWd1cmF0aW9uIGZvciBubyBwbG90LWFibGUgZGF0YSBzdXBwbGllZC5cbiAgICAgICAgICAgIGRhdGFfZW1wdHlfbGFiZWxfdGV4dDogXCJcIixcbiAgICAgICAgICAgIC8vIHN1YmNoYXJ0XG4gICAgICAgICAgICBzdWJjaGFydF9zaG93OiBmYWxzZSxcbiAgICAgICAgICAgIHN1YmNoYXJ0X3NpemVfaGVpZ2h0OiA2MCxcbiAgICAgICAgICAgIHN1YmNoYXJ0X2F4aXNfeF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgc3ViY2hhcnRfb25icnVzaDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICAvLyBjb2xvclxuICAgICAgICAgICAgY29sb3JfcGF0dGVybjogW10sXG4gICAgICAgICAgICBjb2xvcl90aHJlc2hvbGQ6IHt9LFxuICAgICAgICAgICAgLy8gbGVnZW5kXG4gICAgICAgICAgICBsZWdlbmRfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGxlZ2VuZF9oaWRlOiBmYWxzZSxcbiAgICAgICAgICAgIGxlZ2VuZF9wb3NpdGlvbjogJ2JvdHRvbScsXG4gICAgICAgICAgICBsZWdlbmRfaW5zZXRfYW5jaG9yOiAndG9wLWxlZnQnLFxuICAgICAgICAgICAgbGVnZW5kX2luc2V0X3g6IDEwLFxuICAgICAgICAgICAgbGVnZW5kX2luc2V0X3k6IDAsXG4gICAgICAgICAgICBsZWdlbmRfaW5zZXRfc3RlcDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgbGVnZW5kX2l0ZW1fb25jbGljazogdW5kZWZpbmVkLFxuICAgICAgICAgICAgbGVnZW5kX2l0ZW1fb25tb3VzZW92ZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGxlZ2VuZF9pdGVtX29ubW91c2VvdXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGxlZ2VuZF9lcXVhbGx5OiBmYWxzZSxcbiAgICAgICAgICAgIGxlZ2VuZF9wYWRkaW5nOiAwLFxuICAgICAgICAgICAgbGVnZW5kX2l0ZW1fdGlsZV93aWR0aDogMTAsXG4gICAgICAgICAgICBsZWdlbmRfaXRlbV90aWxlX2hlaWdodDogMTAsXG4gICAgICAgICAgICAvLyBheGlzXG4gICAgICAgICAgICBheGlzX3JvdGF0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc194X3Nob3c6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfdHlwZTogJ2luZGV4ZWQnLFxuICAgICAgICAgICAgYXhpc194X2xvY2FsdGltZTogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF9jYXRlZ29yaWVzOiBbXSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2NlbnRlcmVkOiBmYWxzZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfY3VsbGluZzoge30sXG4gICAgICAgICAgICBheGlzX3hfdGlja19jdWxsaW5nX21heDogMTAsXG4gICAgICAgICAgICBheGlzX3hfdGlja19jb3VudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfZml0OiB0cnVlLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfdmFsdWVzOiBudWxsLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfcm90YXRlOiAwLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfb3V0ZXI6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfdGlja19tdWx0aWxpbmU6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfdGlja193aWR0aDogbnVsbCxcbiAgICAgICAgICAgIGF4aXNfeF9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF9wYWRkaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeF9oZWlnaHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF9leHRlbnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF9sYWJlbDoge30sXG4gICAgICAgICAgICBheGlzX3lfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeV90eXBlOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfbWF4OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfbWluOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfaW52ZXJ0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc195X2NlbnRlcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X2lubmVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfbGFiZWw6IHt9LFxuICAgICAgICAgICAgYXhpc195X3RpY2tfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfdGlja19vdXRlcjogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX3ZhbHVlczogbnVsbCwgICAgICAgIFxuICAgICAgICAgICAgYXhpc195X3RpY2tfcm90YXRlOiAwLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfY291bnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX3RpbWVfdmFsdWU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX3RpbWVfaW50ZXJ2YWw6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9wYWRkaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeV9kZWZhdWx0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc195Ml9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfbWluOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX2ludmVydGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGF4aXNfeTJfY2VudGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX2lubmVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX2xhYmVsOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeTJfdGlja19mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfdGlja19vdXRlcjogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeTJfdGlja192YWx1ZXM6IG51bGwsXG4gICAgICAgICAgICBheGlzX3kyX3RpY2tfY291bnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfcGFkZGluZzoge30sXG4gICAgICAgICAgICBheGlzX3kyX2RlZmF1bHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vIGdyaWRcbiAgICAgICAgICAgIGdyaWRfeF9zaG93OiBmYWxzZSxcbiAgICAgICAgICAgIGdyaWRfeF90eXBlOiAndGljaycsXG4gICAgICAgICAgICBncmlkX3hfbGluZXM6IFtdLFxuICAgICAgICAgICAgZ3JpZF95X3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgLy8gbm90IHVzZWRcbiAgICAgICAgICAgIC8vIGdyaWRfeV90eXBlOiAndGljaycsXG4gICAgICAgICAgICBncmlkX3lfbGluZXM6IFtdLFxuICAgICAgICAgICAgZ3JpZF95X3RpY2tzOiAxMCxcbiAgICAgICAgICAgIGdyaWRfZm9jdXNfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGdyaWRfbGluZXNfZnJvbnQ6IHRydWUsXG4gICAgICAgICAgICAvLyBwb2ludCAtIHBvaW50IG9mIGVhY2ggZGF0YVxuICAgICAgICAgICAgcG9pbnRfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIHBvaW50X3I6IDIuNSxcbiAgICAgICAgICAgIHBvaW50X3NlbnNpdGl2aXR5OiAxMCxcbiAgICAgICAgICAgIHBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkOiB0cnVlLFxuICAgICAgICAgICAgcG9pbnRfZm9jdXNfZXhwYW5kX3I6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBvaW50X3NlbGVjdF9yOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyBsaW5lXG4gICAgICAgICAgICBsaW5lX2Nvbm5lY3ROdWxsOiBmYWxzZSxcbiAgICAgICAgICAgIGxpbmVfc3RlcF90eXBlOiAnc3RlcCcsXG4gICAgICAgICAgICAvLyBiYXJcbiAgICAgICAgICAgIGJhcl93aWR0aDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYmFyX3dpZHRoX3JhdGlvOiAwLjYsXG4gICAgICAgICAgICBiYXJfd2lkdGhfbWF4OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBiYXJfemVyb2Jhc2VkOiB0cnVlLFxuICAgICAgICAgICAgLy8gYXJlYVxuICAgICAgICAgICAgYXJlYV96ZXJvYmFzZWQ6IHRydWUsXG4gICAgICAgICAgICBhcmVhX2Fib3ZlOiBmYWxzZSxcbiAgICAgICAgICAgIC8vIHBpZVxuICAgICAgICAgICAgcGllX2xhYmVsX3Nob3c6IHRydWUsXG4gICAgICAgICAgICBwaWVfbGFiZWxfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwaWVfbGFiZWxfdGhyZXNob2xkOiAwLjA1LFxuICAgICAgICAgICAgcGllX2xhYmVsX3JhdGlvOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwaWVfZXhwYW5kOiB7fSxcbiAgICAgICAgICAgIHBpZV9leHBhbmRfZHVyYXRpb246IDUwLFxuICAgICAgICAgICAgLy8gZ2F1Z2VcbiAgICAgICAgICAgIGdhdWdlX2Z1bGxDaXJjbGU6IGZhbHNlLFxuICAgICAgICAgICAgZ2F1Z2VfbGFiZWxfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGdhdWdlX2xhYmVsX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZ2F1Z2VfbWluOiAwLFxuICAgICAgICAgICAgZ2F1Z2VfbWF4OiAxMDAsXG4gICAgICAgICAgICBnYXVnZV9zdGFydGluZ0FuZ2xlOiAtMSAqIE1hdGguUEkvMixcbiAgICAgICAgICAgIGdhdWdlX3VuaXRzOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBnYXVnZV93aWR0aDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZ2F1Z2VfZXhwYW5kOiB7fSxcbiAgICAgICAgICAgIGdhdWdlX2V4cGFuZF9kdXJhdGlvbjogNTAsXG4gICAgICAgICAgICAvLyBkb251dFxuICAgICAgICAgICAgZG9udXRfbGFiZWxfc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGRvbnV0X2xhYmVsX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZG9udXRfbGFiZWxfdGhyZXNob2xkOiAwLjA1LFxuICAgICAgICAgICAgZG9udXRfbGFiZWxfcmF0aW86IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRvbnV0X3dpZHRoOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkb251dF90aXRsZTogXCJcIixcbiAgICAgICAgICAgIGRvbnV0X2V4cGFuZDoge30sXG4gICAgICAgICAgICBkb251dF9leHBhbmRfZHVyYXRpb246IDUwLFxuICAgICAgICAgICAgLy8gc3BsaW5lXG4gICAgICAgICAgICBzcGxpbmVfaW50ZXJwb2xhdGlvbl90eXBlOiAnY2FyZGluYWwnLFxuICAgICAgICAgICAgLy8gcmVnaW9uIC0gcmVnaW9uIHRvIGNoYW5nZSBzdHlsZVxuICAgICAgICAgICAgcmVnaW9uczogW10sXG4gICAgICAgICAgICAvLyB0b29sdGl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cbiAgICAgICAgICAgICAgICB0b3A6IDAsXG4gICAgICAgICAgICAgICAgcmlnaHQ6IDAsXG4gICAgICAgICAgICAgICAgYm90dG9tOiAwLFxuICAgICAgICAgICAgICAgIGxlZnQ6IDBcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB0aXRsZV9wb3NpdGlvbjogJ3RvcC1jZW50ZXInLFxuICAgICAgICB9O1xuXG4gICAgICAgIE9iamVjdC5rZXlzKHRoaXMuYWRkaXRpb25hbENvbmZpZykuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICBjb25maWdba2V5XSA9IHRoaXMuYWRkaXRpb25hbENvbmZpZ1trZXldO1xuICAgICAgICB9LCB0aGlzKTtcblxuICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uYWRkaXRpb25hbENvbmZpZyA9IHt9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ubG9hZENvbmZpZyA9IGZ1bmN0aW9uIChjb25maWcpIHtcbiAgICAgICAgdmFyIHRoaXNfY29uZmlnID0gdGhpcy5jb25maWcsIHRhcmdldCwga2V5cywgcmVhZDtcbiAgICAgICAgZnVuY3Rpb24gZmluZCgpIHtcbiAgICAgICAgICAgIHZhciBrZXkgPSBrZXlzLnNoaWZ0KCk7XG4gICAgLy8gICAgICAgIGNvbnNvbGUubG9nKFwia2V5ID0+XCIsIGtleSwgXCIsIHRhcmdldCA9PlwiLCB0YXJnZXQpO1xuICAgICAgICAgICAgaWYgKGtleSAmJiB0YXJnZXQgJiYgdHlwZW9mIHRhcmdldCA9PT0gJ29iamVjdCcgJiYga2V5IGluIHRhcmdldCkge1xuICAgICAgICAgICAgICAgIHRhcmdldCA9IHRhcmdldFtrZXldO1xuICAgICAgICAgICAgICAgIHJldHVybiBmaW5kKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICgha2V5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRhcmdldDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgT2JqZWN0LmtleXModGhpc19jb25maWcpLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgdGFyZ2V0ID0gY29uZmlnO1xuICAgICAgICAgICAga2V5cyA9IGtleS5zcGxpdCgnXycpO1xuICAgICAgICAgICAgcmVhZCA9IGZpbmQoKTtcbiAgICAvLyAgICAgICAgY29uc29sZS5sb2coXCJDT05GSUcgOiBcIiwga2V5LCByZWFkKTtcbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQocmVhZCkpIHtcbiAgICAgICAgICAgICAgICB0aGlzX2NvbmZpZ1trZXldID0gcmVhZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFNjYWxlID0gZnVuY3Rpb24gKG1pbiwgbWF4LCBmb3JUaW1lc2VyaWVzKSB7XG4gICAgICAgIHJldHVybiAoZm9yVGltZXNlcmllcyA/IHRoaXMuZDMudGltZS5zY2FsZSgpIDogdGhpcy5kMy5zY2FsZS5saW5lYXIoKSkucmFuZ2UoW21pbiwgbWF4XSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRYID0gZnVuY3Rpb24gKG1pbiwgbWF4LCBkb21haW4sIG9mZnNldCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgc2NhbGUgPSAkJC5nZXRTY2FsZShtaW4sIG1heCwgJCQuaXNUaW1lU2VyaWVzKCkpLFxuICAgICAgICAgICAgX3NjYWxlID0gZG9tYWluID8gc2NhbGUuZG9tYWluKGRvbWFpbikgOiBzY2FsZSwga2V5O1xuICAgICAgICAvLyBEZWZpbmUgY3VzdG9taXplZCBzY2FsZSBpZiBjYXRlZ29yaXplZCBheGlzXG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIG9mZnNldCA9IG9mZnNldCB8fCBmdW5jdGlvbiAoKSB7IHJldHVybiAwOyB9O1xuICAgICAgICAgICAgc2NhbGUgPSBmdW5jdGlvbiAoZCwgcmF3KSB7XG4gICAgICAgICAgICAgICAgdmFyIHYgPSBfc2NhbGUoZCkgKyBvZmZzZXQoZCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJhdyA/IHYgOiBNYXRoLmNlaWwodik7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc2NhbGUgPSBmdW5jdGlvbiAoZCwgcmF3KSB7XG4gICAgICAgICAgICAgICAgdmFyIHYgPSBfc2NhbGUoZCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJhdyA/IHYgOiBNYXRoLmNlaWwodik7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIC8vIGRlZmluZSBmdW5jdGlvbnNcbiAgICAgICAgZm9yIChrZXkgaW4gX3NjYWxlKSB7XG4gICAgICAgICAgICBzY2FsZVtrZXldID0gX3NjYWxlW2tleV07XG4gICAgICAgIH1cbiAgICAgICAgc2NhbGUub3JnRG9tYWluID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIF9zY2FsZS5kb21haW4oKTtcbiAgICAgICAgfTtcbiAgICAgICAgLy8gZGVmaW5lIGN1c3RvbSBkb21haW4oKSBmb3IgY2F0ZWdvcml6ZWQgYXhpc1xuICAgICAgICBpZiAoJCQuaXNDYXRlZ29yaXplZCgpKSB7XG4gICAgICAgICAgICBzY2FsZS5kb21haW4gPSBmdW5jdGlvbiAoZG9tYWluKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgIC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AgICBoYXNOZWdhdGl2ZVZhbHVlID0gJCQuaGFzTmVnYXRpdmVWYWx1ZUluVGFyZ2V0cyh0YXJnZXRzKTtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBjb25maWcuZGF0YV9ncm91cHMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAvLyBEZXRlcm1pbmUgYmFzZUlkXG4gICAgICAgICAgICAgICAgaWRzSW5Hcm91cCA9IGNvbmZpZy5kYXRhX2dyb3Vwc1tqXS5maWx0ZXIoZnVuY3Rpb24gKGlkKSB7IHJldHVybiBpZHMuaW5kZXhPZihpZCkgPj0gMDsgfSk7XG4gICAgICAgICAgICAgICAgaWYgKGlkc0luR3JvdXAubGVuZ3RoID09PSAwKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICAgICAgYmFzZUlkID0gaWRzSW5Hcm91cFswXTtcbiAgICAgICAgICAgICAgICAvLyBDb25zaWRlciBuZWdhdGl2ZSB2YWx1ZXNcbiAgICAgICAgICAgICAgICBpZiAoaGFzTmVnYXRpdmVWYWx1ZSAmJiB5c1tiYXNlSWRdKSB7XG4gICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF0uZm9yRWFjaChmdW5jdGlvbiAodiwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXVtpXSA9IHYgPCAwID8gdiA6IDA7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG1pblxuICAgICAgICAgICAgICAgIGZvciAoayA9IDE7IGsgPCBpZHNJbkdyb3VwLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlkID0gaWRzSW5Hcm91cFtrXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEgeXNbaWRdKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICAgICAgICAgIHlzW2lkXS5mb3JFYWNoKGZ1bmN0aW9uICh2LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJCQuYXhpcy5nZXRJZChpZCkgPT09ICQkLmF4aXMuZ2V0SWQoYmFzZUlkKSAmJiB5c1tiYXNlSWRdICYmICEoaGFzTmVnYXRpdmVWYWx1ZSAmJiArdiA+IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXVtpXSArPSArdjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiAkJC5kMy5taW4oT2JqZWN0LmtleXMoeXMpLm1hcChmdW5jdGlvbiAoa2V5KSB7IHJldHVybiAkJC5kMy5taW4oeXNba2V5XSk7IH0pKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFlEb21haW5NYXggPSBmdW5jdGlvbiAodGFyZ2V0cykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBpZHMgPSAkJC5tYXBUb0lkcyh0YXJnZXRzKSwgeXMgPSAkJC5nZXRWYWx1ZXNBc0lkS2V5ZWQodGFyZ2V0cyksXG4gICAgICAgICAgICBqLCBrLCBiYXNlSWQsIGlkc0luR3JvdXAsIGlkLCBoYXNQb3NpdGl2ZVZhbHVlO1xuICAgICAgICBpZiAoY29uZmlnLmRhdGFfZ3JvdXBzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGhhc1Bvc2l0aXZlVmFsdWUgPSAkJC5oYXNQb3NpdGl2ZVZhbHVlSW5UYXJnZXRzKHRhcmdldHMpO1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGNvbmZpZy5kYXRhX2dyb3Vwcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIC8vIERldGVybWluZSBiYXNlSWRcbiAgICAgICAgICAgICAgICBpZHNJbkdyb3VwID0gY29uZmlnLmRhdGFfZ3JvdXBzW2pdLmZpbHRlcihmdW5jdGlvbiAoaWQpIHsgcmV0dXJuIGlkcy5pbmRleE9mKGlkKSA+PSAwOyB9KTtcbiAgICAgICAgICAgICAgICBpZiAoaWRzSW5Hcm91cC5sZW5ndGggPT09IDApIHsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICBiYXNlSWQgPSBpZHNJbkdyb3VwWzBdO1xuICAgICAgICAgICAgICAgIC8vIENvbnNpZGVyIHBvc2l0aXZlIHZhbHVlc1xuICAgICAgICAgICAgICAgIGlmIChoYXNQb3NpdGl2ZVZhbHVlICYmIHlzW2Jhc2VJZF0pIHtcbiAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXS5mb3JFYWNoKGZ1bmN0aW9uICh2LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldID0gdiA+IDAgPyB2IDogMDtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIENvbXB1dGUgbWF4XG4gICAgICAgICAgICAgICAgZm9yIChrID0gMTsgayA8IGlkc0luR3JvdXAubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBpZHNJbkdyb3VwW2tdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISB5c1tpZF0pIHsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICAgICAgeXNbaWRdLmZvckVhY2goZnVuY3Rpb24gKHYsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkJC5heGlzLmdldElkKGlkKSA9PT0gJCQuYXhpcy5nZXRJZChiYXNlSWQpICYmIHlzW2Jhc2VJZF0gJiYgIShoYXNQb3NpdGl2ZVZhbHVlICYmICt2IDwgMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldICs9ICt2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICQkLmQzLm1heChPYmplY3Qua2V5cyh5cykubWFwKGZ1bmN0aW9uIChrZXkpIHsgcmV0dXJuICQkLmQzLm1heCh5c1trZXldKTsgfSkpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WURvbWFpbiA9IGZ1bmN0aW9uICh0YXJnZXRzLCBheGlzSWQsIHhEb21haW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgdGFyZ2V0c0J5QXhpc0lkID0gdGFyZ2V0cy5maWx0ZXIoZnVuY3Rpb24gKHQpIHsgcmV0dXJuICQkLmF4aXMuZ2V0SWQodC5pZCkgPT09IGF4aXNJZDsgfSksXG4gICAgICAgICAgICB5VGFyZ2V0cyA9IHhEb21haW4gPyAkJC5maWx0ZXJCeVhEb21haW4odGFyZ2V0c0J5QXhpc0lkLCB4RG9tYWluKSA6IHRhcmdldHNCeUF4aXNJZCxcbiAgICAgICAgICAgIHlNaW4gPSBheGlzSWQgPT09ICd5MicgPyBjb25maWcuYXhpc195Ml9taW4gOiBjb25maWcuYXhpc195X21pbixcbiAgICAgICAgICAgIHlNYXggPSBheGlzSWQgPT09ICd5MicgPyBjb25maWcuYXhpc195Ml9tYXggOiBjb25maWcuYXhpc195X21heCxcbiAgICAgICAgICAgIHlEb21haW5NaW4gPSAkJC5nZXRZRG9tYWluTWluKHlUYXJnZXRzKSxcbiAgICAgICAgICAgIHlEb21haW5NYXggPSAkJC5nZXRZRG9tYWluTWF4KHlUYXJnZXRzKSxcbiAgICAgICAgICAgIGRvbWFpbiwgZG9tYWluTGVuZ3RoLCBwYWRkaW5nLCBwYWRkaW5nX3R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5RG9tYWluTWF4IDogeU1pbiArIDEwKSA6IHlEb21haW5NYXg7XG5cbiAgICAgICAgaWYgKHlUYXJnZXRzLmxlbmd0aCA9PT0gMCkgeyAvLyB1c2UgY3VycmVudCBkb21haW4gaWYgdGFyZ2V0IG9mIGF4aXNJZCBpcyBub25lXG4gICAgICAgICAgICByZXR1cm4gYXhpc0lkID09PSAneTInID8gJCQueTIuZG9tYWluKCkgOiAkJC55LmRvbWFpbigpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc05hTih5RG9tYWluTWluKSkgeyAvLyBzZXQgbWluaW11bSB0byB6ZXJvIHdoZW4gbm90IG51bWJlclxuICAgICAgICAgICAgeURvbWFpbk1pbiA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzTmFOKHlEb21haW5NYXgpKSB7IC8vIHNldCBtYXhpbXVtIHRvIGhhdmUgc2FtZSB2YWx1ZSBhcyB5RG9tYWluTWluXG4gICAgICAgICAgICB5RG9tYWluTWF4ID0geURvbWFpbk1pbjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoeURvbWFpbk1pbiA9PT0geURvbWFpbk1heCkge1xuICAgICAgICAgICAgeURvbWFpbk1pbiA8IDAgPyB5RG9tYWluTWF4ID0gMCA6IHlEb21haW5NaW4gPSAwO1xuICAgICAgICB9XG4gICAgICAgIGlzQWxsUG9zaXRpdmUgPSB5RG9tYWluTWluID49IDAgJiYgeURvbWFpbk1heCA+PSAwO1xuICAgICAgICBpc0FsbE5lZ2F0aXZlID0geURvbWFpbk1pbiA8PSAwICYmIHlEb21haW5NYXggPD0gMDtcblxuICAgICAgICAvLyBDYW5jZWwgemVyb2Jhc2VkIGlmIGF4aXNfKl9taW4gLyBheGlzXypfbWF4IHNwZWNpZmllZFxuICAgICAgICBpZiAoKGlzVmFsdWUoeU1pbikgJiYgaXNBbGxQb3NpdGl2ZSkgfHwgKGlzVmFsdWUoeU1heCkgJiYgaXNBbGxOZWdhdGl2ZSkpIHtcbiAgICAgICA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ICAgICAgaWYgKGF4aXNJZCA9PT0gJ3kyJyAmJiBub3RFbXB0eShjb25maWcuYXhpc195Ml9wYWRkaW5nKSkge1xuICAgICAgICAgICAgcGFkZGluZ190b3AgPSAkJC5heGlzLmdldFBhZGRpbmcoY29uZmlnLmF4aXNfeTJfcGFkZGluZywgJ3RvcCcsIHBhZGRpbmdfdG9wLCBkb21haW5MZW5ndGgpO1xuICAgICAgICAgICAgcGFkZGluZ19ib3R0b20gPSAkJC5heGlzLmdldFBhZGRpbmcoY29uZmlnLmF4aXNfeTJfcGFkZGluZywgJ2JvdHRvbScsIHBhZGRpbmdfYm90dG9tLCBkb21haW5MZW5ndGgpO1xuICAgICAgICB9XG4gICAgICAgIC8vIEJhci9BcmVhIGNoYXJ0IHNob3VsZCBiZSAwLWJhc2VkIGlmIGFsbCBwb3NpdGl2ZXxuZWdhdGl2ZVxuICAgICAgICBpZiAoaXNaZXJvQmFzZWQpIHtcbiAgICAgICAgICAgIGlmIChpc0FsbFBvc2l0aXZlKSB7IHBhZGRpbmdfYm90dG9tID0geURvbWFpbk1pbjsgfVxuICAgICAgICAgICAgaWYgKGlzQWxsTmVnYXRpdmUpIHsgcGFkZGluZ190b3AgPSAteURvbWFpbk1heDsgfVxuICAgICAgICB9XG4gICAgICAgIGRvbWFpbiA9IFt5RG9tYWluTWluIC0gcGFkZGluZ19ib3R0b20sIHlEb21haW5NYXggKyBwYWRkaW5nX3RvcF07XG4gICAgICAgIHJldHVybiBpc0ludmVydGVkID8gZG9tYWluLnJldmVyc2UoKSA6IGRvbWFpbjtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFhEb21haW5NaW4gPSBmdW5jdGlvbiAodGFyZ2V0cykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIHJldHVybiBpc0RlZmluZWQoY29uZmlnLmF4aXNfeF9taW4pID9cbiAgICAgICAgICAgICgkJC5pc1Rpb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uZ2V0WERvbWFpbiA9IGZ1bmN0aW9uICh0YXJnZXRzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICB4RG9tYWluID0gWyQkLmdldFhEb21haW5NaW4odGFyZ2V0cyksICQkLmdldFhEb21haW5NYXgodGFyZ2V0cyldLFxuICAgICAgICAgICAgZmlyc3RYID0geERvbWFpblswXSwgbGFzdFggPSB4RG9tYWluWzFdLFxuICAgICAgICAgICAgcGFkZGluZyA9ICQkLmdldFhEb21haW5QYWRkaW5nKHhEb21haW4pLFxuICAgICAgICAgICAgbWluID0gMCwgbWF4ID0gMDtcbiAgICAgICAgLy8gc2hvdyBjZW50ZXIgb2YgeCBkb21haW4gaWYgbWluIGFuZCBtYXggYXJlIHRoZSBzYW1lXG4gICAgICAgIGlmICgoZmlyc3RYIC0gbGFzdFgpID09PSAwICYmICEkJC5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgIGZpcnN0WCA9IG5ldyBEYXRlKGZpcnN0WC5nZXRUaW1lKCkgKiAwLjUpO1xuICAgICAgICAgICAgICAgIGxhc3RYID0gbmV3IERhdGUobGFzdFguZ2V0VGltZSgpICogMS41KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZmlyc3RYID0gZmlyc3RYID09PSAwID8gMSA6IChmaXJzdFggKiAwLjUpO1xuICAgICAgICAgICAgICAgIGxhc3RYID0gbGFzdFggPT09IDAgPyAtMSA6IChsYXN0WCAqIDEuNSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGZpcnN0WCB8fCBmaXJzdFggPT09IDApIHtcbiAgICAgICAgICAgIG1pbiA9ICQkLmlzVGltZVNlcmllcygpID8gbmV3IERhdGUoZmlyc3RYLmdldFRpbWUoKSAtIHBhZGRpbmcubGVmdCkgOiBmaXJzdFggLSBwYWRkaW5nLmxlZnQ7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGxhc3RYIHx8IGxhc3RYID09PSAwKSB7XG4gICAgICAgICAgICBtYXggPSAkJC5pc1RpbWVTZXJpZXMoKSA/IG5ldyBEYXRlKGxhc3RYLmdldFRpbWUoKSArIHBhZGRpbmcucmlnaHQpIDogbGFzdFggKyBwYWRkaW5nLnJpZ2h0O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBbbWluLCBtYXhdO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlWERvbWFpbiA9IGZ1bmN0aW9uICh0YXJnZXRzLCB3aXRoVXBkYXRlWERvbWFpbiwgd2l0aFVwZGF0ZU9yZ1hEb21haW4sIHdpdGhUcmltLCBkb21haW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuXG4gICAgICAgIGlmICh3aXRoVXBkYXRlT3JnWERvbWFpbikge1xuICAgICAgICAgICAgJCQueC5kb21haW4oZG9tYWluID8gZG9tYWluIDogJCQuZDMuZXh0ZW50KCQkLmdldFhEb21haW4odGFyZ2V0cykpKTtcbiAgICAgICAgICAgICQkLm9yZ1hEb21haW4gPSAkJC54LmRvbWFpbigpO1xuICAgICAgICAgICAgaWYgKGNvbmZpZy56b29tX2VuYWJsZWQpIHsgJCQuem9vbS5zY2FsZSgkJC54KS51cGRhdGVTY2FsZUV4dGVudCgpOyB9XG4gICAgICAgICAgICAkJC5zdWJYLmRvbWFpbigkJC54LmRvbWFpbigpKTtcbiAgICAgICAgICAgIGlmICgkJC5icnVzaCkgeyAkJC5icnVzaC5zY2FsZSgkJC5zdWJYKTsgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh3aXRoVXBkYXRlWERvbWFpbikge1xuICAgICAgICAgICAgJCQueC5kb21haW4oZG9tYWluID8gZG9tYWluIDogKCEkJC5icnVzaCB8fCAkJC5icnVzaC5lbXB0eSgpKSA/ICQkLm9yZ1hEb21haW4gOiAkJC5icnVzaC5leHRlbnQoKSk7XG4gICAgICAgICAgICBpZiAoY29uZmlnLnpvb21fZW5hYmxlZCkgeyAkJC56b29tLnNjYWxlKCQkLngpLnVwZGF0ZVNjYWxlRXh0ZW50KCk7IH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFRyaW0gZG9tYWluIHdoZW4gdG9vIGJpZyBieSB6b29tIG1vdXNlbW92ZSBldmVudFxuICAgICAgICBpZiAod2l0aFRyaW0pIHsgJCQueC5kb21haW4oJCQudHJpbVhEb21haW4oJCQueC5vcmdEb21haW4oKSkpOyB9XG5cbiAgICAgICAgcmV0dXJuICQkLnguZG9tYWluKCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi50cmltWERvbWFpbiA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgdmFyIHpvb21Eb21haW4gPSB0aGlzLmdldFpvb21Eb21haW4oKSxcbiAgICAgICAgICAgIG1pbiA9IHpvb21Eb21haW5bMF0sIG1heCA9IHpvb21Eb21haW5bMV07XG4gICAgICAgIGlmIChkb21haW5bMF0gPD0gbWluKSB7XG4gICAgICAgICAgICBkb21haW5bMV0gPSArZG9tYWluWzFdICsgKG1pbiAtIGRvbWFpblswXSk7XG4gICAgICAgICAgICBkb21haW5bMF0gPSBtaW47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1heCA8PSBkb21haW5bMV0pIHtcbiAgICAgICAgICAgIGRvbWFpblswXSA9ICtkb21haW5bMF0gLSAoZG9tYWluWzFdIC0gbWF4KTtcbiAgICAgICAgICAgIGRvbWFpblsxXSA9IG1heDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZG9tYWluO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pc1ggPSBmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgIC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kge1xuICAgICAgICB2YXIgeCA9IHRoaXMueHNbaSAtIDFdO1xuICAgICAgICByZXR1cm4gdHlwZW9mIHggIT09ICd1bmRlZmluZWQnID8geCA6IG51bGw7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXROZXh0WCA9IGZ1bmN0aW9uIChpKSB7XG4gICAgICAgIHZhciB4ID0gdGhpcy54c1tpICsgMV07XG4gICAgICAgIHJldHVybiB0eXBlb2YgeCAhPT0gJ3VuZGVmaW5lZCcgPyB4IDogbnVsbDtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldE1heERhdGFDb3VudCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgcmV0dXJuICQkLmQzLm1heCgkJC5kYXRhLnRhcmdldHMsIGZ1bmN0aW9uICh0KSB7IHJldHVybiB0LnZhbHVlcy5sZW5ndGg7IH0pO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0TWF4RGF0YUNvdW50VGFyZ2V0ID0gZnVuY3Rpb24gKHRhcmdldHMpIHtcbiAgICAgICAgdmFyIGxlbmd0aCA9IHRhcmdldHMubGVuZ3RoLCBtYXggPSAwLCBtYXhUYXJnZXQ7XG4gICAgICAgIGlmIChsZW5ndGggPiAxKSB7XG4gICAgICAgICAgICB0YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICBpZiAodC52YWx1ZXMubGVuZ3RoID4gbWF4KSB7XG4gICAgICAgICAgICAgICAgICAgIG1heFRhcmdldCA9IHQ7XG4gICAgICAgICAgICAgICAgICAgIG1heCA9IHQudmFsdWVzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1heFRhcmdldCA9IGxlbmd0aCA/IHRhcmdldHNbMF0gO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G4gICAgICAgIHJldHVybiBkYXRhLmZpbHRlcihmdW5jdGlvbiAoZCkgeyByZXR1cm4gaXNWYWx1ZShkLnZhbHVlKTsgfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5maWx0ZXJCeVhEb21haW4gPSBmdW5jdGlvbiAodGFyZ2V0cywgeERvbWFpbikge1xuICAgICAgICByZXR1cm4gdGFyZ2V0cy5tYXAoZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgaWQ6IHQuaWQsXG4gICAgICAgICAgICAgICAgaWRfb3JnOiB0LmlkX29yZyxcbiAgICAgICAgICAgICAgICB2YWx1ZXM6IHQudmFsdWVzLmZpbHRlcihmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geERvbWFpblswXSA8PSB2LnggJiYgdi54IDw9IHhEb21haW5bMV07XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaGFzRGF0YUxhYmVsID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgY29uZmlnID0gdGhpcy5jb25maWc7XG4gICAgICAgIGlmICh0eXBlb2YgY29uZmlnLmRhdGFfbGFiZWxzID09PSAnYm9vbGVhbicgJiYgY29uZmlnLmRhdGFfbGFiZWxzKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgY29uZmlnLmRhdGFfbGFiZWxzID09PSAnb2JqZWN0JyAmJiBub3RFbXB0eShjb25maWcuZGF0YV9sYWJlbHMpKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXREYXRhTGFiZWx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bi5kaXN0ID0gZnVuY3Rpb24gKGRhdGEsIHBvcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICB4SW5kZXggPSBjb25maWcuYXhpc19yb3RhdGVkID8gMSA6IDAsXG4gICAgICAgICAgICB5SW5kZXggPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IDEsXG4gICAgICAgICAgICB5ID0gJCQuY2lyY2xlWShkYXRhLCBkYXRhLmluZGV4KSxcbiAgICAgICAgICAgIHggPSAkJC54KGRhdGEueCk7XG4gICAgICAgIHJldHVybiBNYXRoLnNxcnQoTWF0aC5wb3coeCAtIHBvc1t4SW5kZXhdLCAyKSArIE1hdGgucG93KHkgLSBwb3NbeUluZGV4XSwgMikpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydFZhbHVlc1RvU3RlcCA9IGZ1bmN0aW9uICh2YWx1ZXMpIHtcbiAgICAgICAgdmFyIGNvbnZlcnRlZCA9IFtdLmNvbmNhdCh2YWx1ZXMpLCBpO1xuXG4gICAgICAgIGlmICghdGhpcy5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIHJldHVybiB2YWx1ZXM7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKGkgPSB2YWx1ZXMubGVuZ3RoICsgMTsgMCA8IGk7IGktLSkge1xuICAgICAgICAgICAgY29udmVydGVkW2ldID0gY29udmVydGVkW2kgLSAxXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnZlcnRlZFswXSA9IHtcbiAgICAgICAgICAgIHg6IGNvbnZlcnRlZFswXS54IC0gMSxcbiAgICAgICAgICAgIHZhbHVlOiBjb252ZXJ0ZWRbMF0udmFsdWUsXG4gICAgICAgICAgICBpZDogY29udmVydGVkWzBdLmlkXG4gICAgICAgIH07XG4gICAgICAgIGNvbnZlcnRlZFt2YWx1ZXMubGVuZ3RoICsgMV0gPSB7XG4gIC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biAoaGVhZGVyKSB7XG4gICAgICAgICAgICAgICAgcmVxLmhlYWRlcihoZWFkZXIsIGhlYWRlcnNbaGVhZGVyXSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXEuZ2V0KGZ1bmN0aW9uIChlcnJvciwgZGF0YSkge1xuICAgICAgICAgICAgdmFyIGQ7XG4gICAgICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoZXJyb3IucmVzcG9uc2VVUkwgKyAnICcgKyBlcnJvci5zdGF0dXMgKyAnICgnICsgZXJyb3Iuc3RhdHVzVGV4dCArICcpJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZSA9PT0gJ2pzb24nKSB7XG4gICAgICAgICAgICAgICAgZCA9ICQkLmNvbnZlcnRKc29uVG9EYXRhKEpTT04ucGFyc2UoZGF0YS5yZXNwb25zZSksIGtleXMpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSAndHN2Jykge1xuICAgICAgICAgICAgICAgIGQgPSAkJC5jb252ZXJ0VHN2VG9EYXRhKGRhdGEucmVzcG9uc2UpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBkID0gJCQuY29udmVydENzdlRvRGF0YShkYXRhLnJlc3BvbnNlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRvbmUuY2FsbCgkJCwgZCk7XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydFhzdlRvRGF0YSA9IGZ1bmN0aW9uICh4c3YsIHBhcnNlcikge1xuICAgICAgICB2YXIgcm93cyA9IHBhcnNlci5wYXJzZVJvd3MoeHN2KSwgZDtcbiAgICAgICAgaWYgKHJvd3MubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICBkID0gW3t9XTtcbiAgICAgICAgICAgIHJvd3NbMF0uZ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TtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG5ld19yb3dzLnB1c2godGFyZ2V0S2V5cyk7XG4gICAgICAgICAgICBqc29uLmZvckVhY2goZnVuY3Rpb24gKG8pIHtcbiAgICAgICAgICAgICAgICB2YXIgbmV3X3JvdyA9IFtdO1xuICAgICAgICAgICAgICAgIHRhcmdldEtleXMuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnQgdW5kZWZpbmVkIHRvIG51bGwgYmVjYXVzZSB1bmRlZmluZWQgZGF0YSB3aWxsIGJlIHJlbW92ZWQgaW4gY29udmVydERhdGFUb1RhcmdldHMoKVxuICAgICAgICAgICAgICAgICAgICB2YXIgdiA9ICQkLmZpbmRWYWx1ZUluSnNvbihvLCBrZXkpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQodikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHYgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIG5ld19yb3cucHVzaCh2KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICBuZXdfcm93cy5wdXNoKG5ld19yb3cpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBkYXRhID0gJCQuY29udmVydFJvd3NUb0RhdGEobmV3X3Jvd3MpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgT2JqZWN0LmtleXMoanNvbikuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAgICAgbmV3X3Jvd3MucHVzaChba2V5XS5jb25jYXQoanNvbltrZXldKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGRhdGEgPSAkJC5jb252ZXJ0Q29sdW1uc1RvRGF0YShuZXdfcm93cyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGRhdGE7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5maW5kVmFsdWVJbkpzb24gPSBmdW5jdGlvbiAob2JqZWN0LCBwYXRoKSB7XG4gICAgICAgIHBhdGggPSBwYXRoLnJlcGxhY2UoL1xcWyhcXHcrKVxcXS9nLCAnLiQxJyk7IC8vIGNvbnZlcnQgaW5kZXhlcyB0byBwcm9wZXJ0aWVzIChyZXBsYWNlIFtdIHdpdGggLilcbiAgICAgICAgcGF0aCA9IHBhdGgucmVwbGFjZSgvXlxcLi8sICcnKTsgICAgICAgICAgIC8vIHN0cmlwIGEgbGVhZGluZyBkb3RcbiAgICAgICAgdmFyIHBhdGhBcnJheSA9IHBhdGguc3BsaXQoJy4nKTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwYXRoQXJyYXkubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgIHZhciBrID0gcGF0aEFycmF5W2ldO1xuICAgICAgICAgICAgaWYgKGsgaW4gb2JqZWN0KSB7XG4gICAgICAgICAgICAgICAgb2JqZWN0ID0gb2JqZWN0W2tdO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG9iamVjdDtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRSb3dzVG9EYXRhID0gZnVuY3Rpb24gKHJvd3MpIHtcbiAgICAgICAgdmFyIGtleXMgPSByb3dzWzBdLCBuZXdfcm93ID0ge30sIG5ld19yb3dzID0gW10sIGksIGo7XG4gICAgICAgIGZvciAoaSA9IDE7IGkgPCByb3dzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBuZXdfcm93ID0ge307XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgcm93c1tpXS5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChyb3dzW2ldW2pdKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJTb3VyY2UgZGF0YSBpcyBtaXNzaW5nIGEgY29tcG9uZW50IGF0IChcIiArIGkgKyBcIixcIiArIGogKyBcIikhXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBuZXdfcm93W2tleXNbal1dID0gcm93c1tpXVtqXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG5ld19yb3dzLnB1c2gobmV3X3Jvdyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ld19yb3dzO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydENvbHVtbnNUb0RhdGEgPSBmdW5jdGlvbiAoY29sdW1ucykge1xuICAgICAgICB2YXIgbmV3X3Jvd3MgPSBbXSwgaSwgaiwga2V5O1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29sdW1ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAga2V5ID0gY29sdW1uc1tpXVswXTtcbiAgICAgICAgICAgIGZvciAoaiA9IDE7IGogPCBjb2x1bW5zW2ldLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKG5ld19yb3dzW2ogLSAxXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgbmV3X3Jvd3NbaiAtIDFdID0ge307XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChjb2x1bW5zW2ldW2pdKSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJTb3VyY2UgZGF0YSBpcyBtaXNzaW5nIGEgY29tcG9uZW50IGF0IChcIiArIGkgKyBcIixcIiArIGogKyBcIikhXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBuZXdfcm93c1tqIC0gMV1ba2V5XSA9IGNvbHVtbnNbaV1bal07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG5ld19yb3dzO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydERhdGFUb1RhcmdldHMgPSBmdW5jdGlvbiAoZGF0YSwgYXBwZW5kWHMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgaWRzID0gJCQuZDMua2V5cyhkYXRhWzBdKS5maWx0ZXIoJCQuaXNOb3RYLCAkJCksXG4gICAgICAgICAgICB4cyA9ICQkLmQzLmtleXMoZGF0YVswXSkuZmlsdGVyKCQkLmlzWCwgJCQpLFxuICAgICAgICAgICAgdGFyZ2V0cztcblxuICAgICAgICAvLyBzYXZlIHggZm9yIHVwZGF0ZSBkYXRhIGJ5IGxvYWQgd2hlbiBjdXN0b20geCBhbmQgYzMueCBBUElcbiAgICAgICAgaWRzLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICB2YXIgeEtleSA9ICQkLmdldFhLZXkoaWQpO1xuXG4gICAgICAgICAgICBpZiAoJCQuaXNDdXN0b21YKCkgfHwgJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAvLyBpZiBpbmNsdWRlZCBpbiBpbnB1dCBkYXRhXG4gICAgICAgICAgICAgICAgaWYgKHhzLmluZGV4T2YoeEtleSkgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9IChhcHBlbmRYcyAmJiAkJC5kYXRhLnhzW2lkXSA/ICQkLmRhdGEueHNbaWRdIDogW10pLmNvbmNhdChcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEubWFwKGZ1bmN0aW9uIChkKSB7IHJldHVybiBkW3hLZXldOyB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoaXNWYWx1ZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKGZ1bmN0aW9uIChyYXdYLCBpKSB7IHJldHVybiAkJC5nZW5lcmF0ZVRhcmdldFgocmF3WCwgaWQsIGkpOyB9KVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBpZiBub3QgaW5jbHVkZWQgaW4gaW5wdXQgZGF0YSwgZmluZCBmcm9tIHByZWxvYWRlZCBkYXRhIG9mIG90aGVyIGlkJ3MgeFxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNvbmZpZy5kYXRhX3gpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZGF0YS54c1tpZF0gPSAkJC5nZXRPdGhlclRhcmdldFhzKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIG5vdCBpbmNsdWRlZCBpbiBpbnB1dCBkYXRhLCBmaW5kIGZyb20gcHJlbG9hZGVkIGRhdGFcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChub3RFbXB0eShjb25maWcuZGF0YV94cykpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZGF0YS54c1tpZF0gPSAkJC5nZXRYVmFsdWVzT2ZYS2V5KHhLZXksICQkLmRhdGEudGFyZ2V0cyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIE1FTU86IGlmIG5vIHggaW5jbHVkZWQsIHVzZSBzYW1lIHggb2YgY3VycmVudCB3aWxsIGJlIHVzZWRcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgJCQuZGF0YS54c1tpZF0gPSBkYXRhLm1hcChmdW5jdGlvbiAoZCwgaSkgeyByZXR1cm4gaTsgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG5cbiAgICAgICAgLy8gY2hlY2sgeCBpcyBkZWZpbmVkXG4gICAgICAgIGlkcy5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgaWYgKCEkJC5kYXRhLnhzW2lkXSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcigneCBpcyBub3QgZGVmaW5lZCBmb3IgaWQgPSBcIicgKyBpZCArICdcIi4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gY29udmVydCB0byB0YXJnZXRcbiAgICAgICAgdGFyZ2V0cyA9IGlkcy5tYXAoZnVuY3Rpb24gKGlkLCBpbmRleCkge1xuICAgICAgICAgICAgdmFyIGNvbnZlcnRlZElkID0gY29uZmlnLmRhdGFfaWRDb252ZXJ0ZXIoaWQpO1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBpZDogY29udmVydGVkSWQsXG4gICAgICAgICAgICAgICAgaWRfb3JnOiBpZCxcbiAgICAgICAgICAgICAgICB2YWx1ZXM6IGRhdGEubWFwKGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4S2V5ID0gJCQuZ2V0WEtleShpZCksIHJhd1ggPSBkW3hLZXldLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBkW2lkXSAhPT0gbnVsbCAmJiAhaXNOYU4oZFtpZF0pID8gK2RbaWRdIDogbnVsbCwgeDtcbiAgICAgICAgICAgICAgICAgICAgLy8gdXNlIHggYXMgY2F0ZWdvcmllcyBpZiBjdXN0b20geCBhbmQgY2F0ZWdvcml6ZWRcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmlzQ3VzdG9tWCgpICYmICQkLmlzQ2F0ZWdvcml6ZWQoKSAmJiBpbmRleCA9PT0gMCAmJiAhaXNVbmRlZmluZWQocmF3WCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA9PT0gMCAmJiBpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeF9jYXRlZ29yaWVzID0gW107XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB4ID0gY29uZmlnLmF4aXNfeF9jYXRlZ29yaWVzLmluZGV4T2YocmF3WCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoeCA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gY29uZmlnLmF4aXNfeF9jYXRlZ29yaWVzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuYXhpc194X2NhdGVnb3JpZXMucHVzaChyYXdYKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHggID0gJCQuZ2VuZXJhdGVUYXJnZXRYKHJhd1gsIGlkLCBpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBtYXJrIGFzIHggPSB1bmRlZmluZWQgaWYgdmFsdWUgaXMgdW5kZWZpbmVkIGFuZCBmaWx0ZXIgdG8gcmVtb3ZlIGFmdGVyIG1hcHBlZFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoZFtpZF0pIHx8ICQkLmRhdGEueHNbaWRdLmxlbmd0aCA8PSBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB4ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7eDogeCwgdmFsdWU6IHZhbHVlLCBpZDogY29udmVydGVkSWR9O1xuICAgICAgICAgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbiAodikgeyByZXR1cm4gaXNEZWZpbmVkKHYueCk7IH0pXG4gICAgICAgICAgICB9O1xuICAgICAgICB9KTtcblxuICAgICAgICAvLyBmaW5pc2ggdGFyZ2V0c1xuICAgICAgICB0YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgIHZhciBpO1xuICAgICAgICAgICAgLy8gc29ydCB2YWx1ZXMgYnkgaXRzIHhcbiAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV94U29ydCkge1xuICAgICAgICAgICAgICAgIHQudmFsdWVzID0gdC52YWx1ZXMuc29ydChmdW5jdGlvbiAodjEsIHYyKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4MSA9IHYxLnggfHwgdjEueCA9PT0gMCA/IHYxLnggOiBJbmZpbml0eSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHgyID0gdjIueCB8fCB2Mi54ID09PSAwID8gdjIueCA6IEluZmluaXR5O1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geDEgLSB4MjtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGluZGV4aW5nIGVhY2ggdmFsdWVcbiAgICAgICAgICAgIGkgPSAwO1xuICAgICAgICAgICAgdC52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgIHYuaW5kZXggPSBpKys7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIC8vIHRoaXMgbmVlZHMgdG8gYmUgc29ydGVkIGJlY2F1c2UgaXRzIGluZGV4IGFuZCB2YWx1ZS5pbmRleCBpcyBpZGVudGljYWxcbiAgICAgICAgICAgICQkLmRhdGEueHNbdC5pZF0uc29ydChmdW5jdGlvbiAodjEsIHYyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHYxIC0gdjI7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gY2FjaGUgaW5mb3JtYXRpb24gYWJvdXQgdmFsdWVzXG4gICAgICAgICQkLmhhc05lZ2F0aXZlVmFsdWUgPSAkJC5oYXNOZWdhdGl2ZVZhbHVlSW5UYXJnZXRzKHRhcmdldHMpO1xuICAgICAgICAkJC5oYXNQb3N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pb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHR5cGUgPSBhcmdzLnR5cGVzICYmIGFyZ3MudHlwZXNbdC5pZF0gPyBhcmdzLnR5cGVzW3QuaWRdIDogYXJncy50eXBlO1xuICAgICAgICAgICAgICAgICAgICAkJC5zZXRUYXJnZXRUeXBlKHQuaWQsIHR5cGUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gVXBkYXRlL0FkZCBkYXRhXG4gICAgICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGFyZ2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZC5pZCA9PT0gdGFyZ2V0c1tpXS5pZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZC52YWx1ZXMgPSB0YXJnZXRzW2ldLnZhbHVlcztcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICQkLmRhdGEudGFyZ2V0cyA9ICQkLmRhdGEudGFyZ2V0cy5jb25jYXQodGFyZ2V0cyk7IC8vIGFkZCByZW1haW5lZFxuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2V0IHRhcmdldHNcbiAgICAgICAgJCQudXBkYXRlVGFyZ2V0cygkJC5kYXRhLnRhcmdldHMpO1xuXG4gICAgICAgIC8vIFJlZHJhdyB3aXRoIG5ldyB0YXJnZXRzXG4gICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlLCB3aXRoTG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ncy5jb2x1bW5zKSksIGFyZ3MpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgJCQubG9hZChudWxsLCBhcmdzKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udW5sb2FkID0gZnVuY3Rpb24gKHRhcmdldElkcywgZG9uZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICBpZiAoIWRvbmUpIHtcbiAgICAgICAgICAgIGRvbmUgPSBmdW5jdGlvbiAoKSB7fTtcbiAgICAgICAgfVxuICAgICAgICAvLyBmaWx0ZXIgZXhpc3RpbmcgdGFyZ2V0XG4gICAgICAgIHRhcmdldElkcyA9IHRhcmdldElkcy5maWx0ZXIoZnVuY3Rpb24gKGlkKSB7IHJldHVybiAkJC5oYXNUYXJnZXQoJCQuZGF0YS50YXJnZXRzLCBpZCk7IH0pO1xuICAgICAgICAvLyBJZiBubyB0YXJnZXQsIGNhbGwgZG9uZSBhbmQgcmV0dXJuXG4gICAgICAgIGlmICghdGFyZ2V0SWRzIHx8IHRhcmdldElkcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIGRvbmUoKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKHRhcmdldElkcy5tYXAoZnVuY3Rpb24gKGlkKSB7IHJldHVybiAkJC5zZWxlY3RvclRhcmdldChpZCk7IH0pKVxuICAgICAgICAgICAgLnRyYW5zaXRpb24oKVxuICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMClcbiAgICAgICAgICAgIC5yZW1vdmUoKVxuICAgICAgICAgICAgLmNhbGwoJCQuZW5kYWxsLCBkb25lKTtcbiAgICAgICAgdGFyZ2V0SWRzLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAvLyBSZXNldCBmYWRlaW4gZm9yIGZ1dHVyZSBsb2FkXG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ldlgoZC5pbmRleCksIG5leHRYID0gJCQuZ2V0TmV4dFgoZC5pbmRleCk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlcmUgdGhpcyBpcyBhIHNpbmdsZSBkYXRhIHBvaW50IG1ha2UgdGhlIGV2ZW50UmVjdCBmdWxsIHdpZHRoIChvciBoZWlnaHQpXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2WCA9PT0gbnVsbCAmJiBuZXh0WCA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC5oZWlnaHQgOiAkJC53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2WCA9PT0gbnVsbCkgeyBwcmV2WCA9ICQkLnguZG9tYWluKClbMF07IH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRYID09PSBudWxsKSB7IG5leHRYID0gJCQueC5kb21haW4oKVsxXTsgfVxuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBNYXRoLm1heCgwLCAoJCQueChuZXh0WCkgLSAkJC54KHByZXZYKSkgLyAyKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHJlY3RYID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHByZXZYID0gJCQuZ2V0UHJldlgoZC5pbmRleCksIG5leHRYID0gJCQuZ2V0TmV4dFgoZC5pbmRleCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzWCA9ICQkLmRhdGEueHNbZC5pZF1bZC5pbmRleF07XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlcmUgdGhpcyBpcyBhIHNpbmdsZSBkYXRhIHBvaW50IHBvc2l0aW9uIHRoZSBldmVudFJlY3QgYXQgMFxuICAgICAgICAgICAgICAgICAgICBpZiAocHJldlggPT09IG51bGwgJiYgbmV4dFggPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsKSB7IHByZXZYID0gJCQueC5kb21haW4oKVswXTsgfVxuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoJCQueCh0aGlzWCkgKyAkJC54KHByZXZYKSkgLyAyO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlY3RXID0gJCQuZ2V0RXZlbnRSZWN0V2lkdGgoKTtcbiAgICAgICAgICAgICAgICByZWN0WCA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC54KGQueCkgLSAocmVjdFcgLyAyKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgeCA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogcmVjdFg7XG4gICAgICAgICAgICB5ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IHJlY3RYIDogMDtcbiAgICAgICAgICAgIHcgPSBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiByZWN0VztcbiAgICAgICAgICAgIGggPSBjb25maWcuYXhpc19yb3RhdGVkID8gcmVjdFcgOiAkJC5oZWlnaHQ7XG4gICAgICAgIH1cblxuICAgICAgICBldmVudFJlY3RVcGRhdGVcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICQkLmNsYXNzRXZlbnQuYmluZCgkJCkpXG4gICAgICAgICAgICAuYXR0cihcInhcIiwgeClcbiAgICAgICAgICAgIC5hdHRyKFwieVwiLCB5KVxuICAgICAgICAgICAgLmF0dHIoXCJ3aWR0aFwiLCB3KVxuICAgICAgICAgICAgLmF0dHIoXCJoZWlnaHRcIiwgaCk7XG4gICAgfTtcbiAgICBjM19jaGF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uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgaW5kZXgpLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW92ZXIuY2FsbCgkJC5hcGksIGQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IGQuaW5kZXg7XG4gICAgICAgICAgICAgICAgaWYgKCEkJC5jb25maWcpIHsgcmV0dXJuOyB9IC8vIGNoYXJ0IGlzIGRlc3Ryb3llZFxuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgJCQuaGlkZVhHcmlkRm9jdXMoKTtcbiAgICAgICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgIC8vIFVuZG8gZXhwYW5kZWQgc2hhcGVzXG4gICAgICAgICAgICAgICAgJCQudW5leHBhbmRDaXJjbGVzKCk7XG4gICAgICAgICAgICAgICAgJCQudW5leHBhbmRCYXJzKCk7XG4gICAgICAgICAgICAgICAgLy8gQ2FsbCBldmVudCBoYW5kbGVyXG4gICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBpbmRleCkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9vbm1vdXNlb3V0LmNhbGwoJCQuYXBpLCBkKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNlbGVjdGVkRGF0YSwgaW5kZXggPSBkLmluZGV4LFxuICAgICAgICAgICAgICAgICAgICBldmVudFJlY3QgPSAkJC5zdmcuc2VsZWN0KCcuJyArIENMQVNTLmV2ZW50UmVjdCArICctJyArIGluZGV4KTtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5kcmFnZ2luZyB8fCAkJC5mbG93aW5nKSB7IHJldHVybjsgfSAvLyBkbyBub3RoaW5nIHdoaWxlIGRyYWdnaW5nL2Zsb3dpbmdcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzU3RlcFR5cGUoZCkgJiYgJCQuY29uZmlnLmxpbmVfc3RlcF90eXBlID09PSAnc3RlcC1hZnRlcicgJiYgZDMubW91c2UodGhpcylbMF0gPCAkJC54KCQkLmdldFhWYWx1ZShkLmlkLCBpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIGluZGV4IC09IDE7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gU2hvdyB0b29sdGlwXG4gICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRhID0gJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpLm1hcChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQuYWRkTmFtZSgkJC5nZXRWYWx1ZU9uSW5kZXgodC52YWx1ZXMsIGluZGV4KSk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5zaG93VG9vbHRpcChzZWxlY3RlZERhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAkJC5zaG93WEdyaWRGb2N1cyhzZWxlY3RlZERhdGEpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChjb25maWcudG9vbHRpcF9ncm91cGVkICYmICghY29uZmlnLmRhdGFfc2VsZWN0aW9uX2VuYWJsZWQgfHwgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIGluZGV4KVxuICAgICAgICAgICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZChDTEFTUy5FWFBBTkRFRCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2VuYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFJlY3Quc3R5bGUoJ2N1cnNvcicsIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkID8gJ3BvaW50ZXInIDogbnVsbCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy50b29sdGlwX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5oaWRlWEdyaWRGb2N1cygpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmhpZGVUb29sdGlwKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC51bmV4cGFuZENpcmNsZXMoaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC51bmV4cGFuZEJhcnMoaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLmlzV2l0aGluU2hhcGUodGhpcywgZCk7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2VuYWJsZWQgJiYgKGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkIHx8IGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9pc3NlbGVjdGFibGUoZCkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRSZWN0LnN0eWxlKCdjdXJzb3InLCAncG9pbnRlcicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoW2RdLCB0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5zaG93WEdyaWRGb2N1cyhbZF0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcucG9pbnRfZm9jdXNfZXhwYW5kX2VuYWJsZWQpIHsgJCQuZXhwYW5kQ2lyY2xlcyhpbmRleCwgZC5pZCwgdHJ1ZSk7IH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5leHBhbmRCYXJzKGluZGV4LCBkLmlkLCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdjbGljaycsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gZC5pbmRleDtcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpIHx8ICEkJC50b2dnbGVTaGFwZSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICBpZiAoJCQuY2FuY2VsQ2xpY2spIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuY2FuY2VsQ2xpY2sgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNTdGVwVHlwZShkKSAmJiBjb25maWcubGluZV9zdGVwX3R5cGUgPT09ICdzdGVwLWFmdGVyJyAmJiBkMy5tb3VzZSh0aGlzKVswXSA8ICQkLngoJCQuZ2V0WFZhbHVlKGQuaWQsIGluZGV4KSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5kZXggLT0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBpbmRleCkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgfHwgJCQuaXNXaXRoaW5TaGFwZSh0aGlzLCBkKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQudG9nZ2xlU2hhcGUodGhpcywgZCwgaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25jbGljay5jYWxsKCQkLmFwaSwgZCwgdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2FsbChcbiAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9zZWx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3gnLCAwKVxuICAgICAgICAgICAgLmF0dHIoJ3knLCAwKVxuICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgJCQud2lkdGgpXG4gICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgJCQuaGVpZ2h0KVxuICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgQ0xBU1MuZXZlbnRSZWN0KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoISQkLmNvbmZpZykgeyByZXR1cm47IH0gLy8gY2hhcnQgaXMgZGVzdHJveWVkXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICBtb3VzZW91dCgpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignbW91c2Vtb3ZlJywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciB0YXJnZXRzVG9TaG93ID0gJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpO1xuICAgICAgICAgICAgICAgIHZhciBtb3VzZSwgY2xvc2VzdCwgc2FtZVhEYXRhLCBzZWxlY3RlZERhdGE7XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQuZHJhZ2dpbmcpIHsgcmV0dXJuOyB9IC8vIGRvIG5vdGhpbmcgd2hlbiBkcmFnZ2luZ1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKHRhcmdldHNUb1Nob3cpKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgbW91c2UgPSBkMy5tb3VzZSh0aGlzKTtcbiAgICAgICAgICAgICAgICBjbG9zZXN0ID0gJCQuZmluZENsb3Nlc3RGcm9tVGFyZ2V0cyh0YXJnZXRzVG9TaG93LCBtb3VzZSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQubW91c2VvdmVyICYmICghY2xvc2VzdCB8fCBjbG9zZXN0LmlkICE9PSAkJC5tb3VzZW92ZXIuaWQpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX29ubW91c2VvdXQuY2FsbCgkJC5hcGksICQkLm1vdXNlb3Zlcik7XG4gICAgICAgICAgICAgICAgICAgICQkLm1vdXNlb3ZlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoISBjbG9zZXN0KSB7XG4gICAgICAgICAgICAgICAgICAgIG1vdXNlb3V0KCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNTY2F0dGVyVHlwZShjbG9zZXN0KSB8fCAhY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICBzYW1lWERhdGEgPSBbY2xvc2VzdF07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgc2FtZVhEYXRhID0gJCQuZmlsdGVyQnlYKHRhcmdldHNUb1Nob3csIGNsb3Nlc3QueCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gc2hvdyB0b29sdGlwIHdoZW4gY3Vyc29yIGlzIGNsb3NlIHRvIHNvbWUgcG9pbnRcbiAgICAgICAgICAgICAgICBzZWxlY3RlZERhdGEgPSBzYW1lWERhdGEubWFwKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5hZGROYW1lKGQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICQkLnNob3dUb29sdGlwKHNlbGVjdGVkRGF0YSwgdGhpcyk7XG5cbiAgICAgICAgICAgICAgICAvLyBleHBhbmQgcG9pbnRzXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5wb2ludF9mb2N1c19le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aWNrLmNhbGwoJCQuYXBpLCBjbG9zZXN0LCB0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYWxsKFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9kcmFnZ2FibGUgJiYgJCQuZHJhZyA/IChcbiAgICAgICAgICAgICAgICAgICAgZDMuYmVoYXZpb3IuZHJhZygpLm9yaWdpbihPYmplY3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWcnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWcoZDMubW91c2UodGhpcykpOyB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnc3RhcnQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdzdGFydChkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdlbmQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdlbmQoKTsgfSlcbiAgICAgICAgICAgICAgICApIDogZnVuY3Rpb24gKCkge31cbiAgICAgICAgICAgICk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKHR5cGUsIGluZGV4LCBtb3VzZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgc2VsZWN0b3IgPSAnLicgKyBDTEFTUy5ldmVudFJlY3QgKyAoISQkLmlzTXVsdGlwbGVYKCkgPyAnLScgKyBpbmRleCA6ICcnKSxcbiAgICAgICAgICAgIGV2ZW50UmVjdCA9ICQkLm1haW4uc2VsZWN0KHNlbGVjdG9yKS5ub2RlKCksXG4gICAgICAgICAgICBib3ggPSBldmVudFJlY3QuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCks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Xhpc19yb3RhdGVkXG4gICAgICAgICAgICByZXR1cm4gMiArIGxlZ2VuZFdpZHRoT25SaWdodCArICgkJC5heGlzLmdldFkyQXhpc0xhYmVsUG9zaXRpb24oKS5pc091dGVyID8gMjAgOiAwKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBjZWlsMTAoJCQuZ2V0QXhpc1dpZHRoQnlBeGlzSWQoJ3kyJykpICsgbGVnZW5kV2lkdGhPblJpZ2h0O1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFBhcmVudFJlY3RWYWx1ZSA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgdmFyIHBhcmVudCA9IHRoaXMuc2VsZWN0Q2hhcnQubm9kZSgpLCB2O1xuICAgICAgICB3aGlsZSAocGFyZW50ICYmIHBhcmVudC50YWdOYW1lICE9PSAnQk9EWScpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdiA9IHBhcmVudC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKVtrZXldO1xuICAgICAgICAgICAgfSBjYXRjaChlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGtleSA9PT0gJ3dpZHRoJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBJbiBJRSBpbiBjZXJ0YWluIGNhc2VzIGdldEJvdW5kaW5nQ2xpZW50UmVjdFxuICAgICAgICAgICAgICAgICAgICAvLyB3aWxsIGNhdXNlIGFuIFwidW5zcGVjaWZpZWQgZXJyb3JcIlxuICAgICAgICAgICAgICAgICAgICB2ID0gcGFyZW50Lm9mZnNldFdpZHRoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh2KSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwYXJlbnQgPSBwYXJlbnQucGFyZW50Tm9kZTtcbiAg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d5MicgPyAtMTAgOiAwKTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0RXZlbnRSZWN0V2lkdGggPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiBNYXRoLm1heCgwLCB0aGlzLnhBeGlzLnRpY2tJbnRlcnZhbCgpKTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0U2hhcGVJbmRpY2VzID0gZnVuY3Rpb24gKHR5cGVGaWx0ZXIpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgaW5kaWNlcyA9IHt9LCBpID0gMCwgaiwgaztcbiAgICAgICAgJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMuZmlsdGVyKHR5cGVGaWx0ZXIsICQkKSkuZm9yRWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGNvbmZpZy5kYXRhX2dyb3Vwcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9ncm91cHNbal0uaW5kZXhPZihkLmlkKSA8IDApIHsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgY29uZmlnLmRhdGFfZ3JvdXBzW2pdLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9ncm91cHNbal1ba10gaW4gaW5kaWNlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5kaWNlc1tkLmlkXSA9IGluZGljZXNbY29uZmlnLmRhdGFfZ3JvdXBzW2pdW2tdXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICA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G4gICAgICAgICAgICB0YXJnZXRzID0gJCQub3JkZXJUYXJnZXRzKCQkLmZpbHRlclRhcmdldHNUb1Nob3coJCQuZGF0YS50YXJnZXRzLmZpbHRlcih0eXBlRmlsdGVyLCAkJCkpKSxcbiAgICAgICAgICAgIHRhcmdldElkcyA9IHRhcmdldHMubWFwKGZ1bmN0aW9uICh0KSB7IHJldHVybiB0LmlkOyB9KTtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICB2YXIgc2NhbGUgPSBpc1N1YiA/ICQkLmdldFN1YllTY2FsZShkLmlkKSA6ICQkLmdldFlTY2FsZShkLmlkKSxcbiAgICAgICAgICAgICAgICB5MCA9IHNjYWxlKDApLCBvZmZzZXQgPSB5MDtcbiAgICAgICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgIHZhciB2YWx1ZXMgPSAkJC5pc1N0ZXBUeXBlKGQpID8gJCQuY29udmVydFZhbHVlc1RvU3RlcCh0LnZhbHVlcykgOiB0LnZhbHVlcztcbiAgICAgICAgICAgICAgICBpZiAodC5pZCA9PT0gZC5pZCB8fCBpbmRpY2VzW3QuaWRdICE9PSBpbmRpY2VzW2QuaWRdKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIGlmICh0YXJnZXRJZHMuaW5kZXhPZih0LmlkKSA8IHRhcmdldElkcy5pbmRleE9mKGQuaWQpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHRoZSB4IHZhbHVlcyBsaW5lIHVwXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWVzW2ldID09PSAndW5kZWZpbmVkJyB8fCArdmFsdWVzW2ldLnggIT09ICtkLngpIHsgIC8vIFwiK1wiIGZvciB0aW1lc2VyaWVzXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiBub3QsIHRyeSB0byBmaW5kIHRoZSB2YWx1ZSB0aGF0IGRvZXMgbGluZSB1cFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHYsIGopIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodi54ID09PSBkLngpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgaW4gdmFsdWVzICYmIHZhbHVlc1tpXS52YWx1ZSAqIGQudmFsdWUgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ICs9IHNjYWxlKHZhbHVlc1tpXS52YWx1ZSkgLSB5MDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmV0dXJuIG9mZnNldDtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmlzV2l0aGluU2hhcGUgPSBmdW5jdGlvbiAodGhhdCwgZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgc2hhcGUgPSAkJC5kMy5zZWxlY3QodGhhdCksIGlzV2l0aGluO1xuICAgICAgICBpZiAoISQkLmlzVGFyZ2V0VG9TaG93KGQuaWQpKSB7XG4gICAgICAgICAgICBpc1dpdGhpbiA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHRoYXQubm9kZU5hbWUgPT09ICdjaXJjbGUnKSB7XG4gICAgICAgICAgICBpc1dpdGhpbiA9ICQkLmlzU3RlcFR5cGUoZCkgPyAkJC5pc1dpdGhpblN0ZXAodGhhdCwgJCQuZ2V0WVNjY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RlKCQkLmdldEludGVycG9sYXRlKGQpKSh2YWx1ZXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlc1swXSkge1xuICAgICAgICAgICAgICAgICAgICB4MCA9IHgodmFsdWVzWzBdLngpO1xuICAgICAgICAgICAgICAgICAgICB5MCA9IHkodmFsdWVzWzBdLnZhbHVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcGF0aCA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyBcIk0gXCIgKyB5MCArIFwiIFwiICsgeDAgOiBcIk0gXCIgKyB4MCArIFwiIFwiICsgeTA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcGF0aCA/IHBhdGggOiBcIk0gMCAwXCI7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUdldExpbmVQb2ludHMgPSBmdW5jdGlvbiAobGluZUluZGljZXMsIGlzU3ViKSB7IC8vIHBhcnRpYWwgZHVwbGljYXRpb24gb2YgZ2VuZXJhdGVHZXRCYXJQb2ludHNcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgbGluZVRhcmdldHNOdW0gPSBsaW5lSW5kaWNlcy5fX21heF9fICsgMSxcbiAgICAgICAgICAgIHggPSAkJC5nZXRTaGFwZVgoMCwgbGluZVRhcmdldHNOdW0sIGxpbmVJbmRpY2VzLCAhIWlzU3ViKSxcbiAgICAgICAgICAgIHkgPSAkJC5nZXRTaGFwZVkoISFpc1N1YiksXG4gICAgICAgICAgICBsaW5lT2Zmc2V0ID0gJCQuZ2V0U2hhcGVPZmZzZXQoJCQuaXNMaW5lVHlwZSwgbGluZUluZGljZXMsICEhaXNTdWIpLFxuICAgICAgICAgICAgeVNjYWxlID0gaXNTdWIgPyAkJC5nZXR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NbMF1bMF0gKyAnICcgKyBwb2ludHNbMF1bMV0gKyAnICcgKyBwb2ludHNbMV1bMF0gKyAnICcgKyBwb2ludHNbMV1bMV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICBzV2l0aFJlZ2lvbiA9IGZ1bmN0aW9uIChkMCwgZDEsIGosIGRpZmYpIHtcbiAgICAgICAgICAgICAgICB2YXIgeDAgPSBkMC54LmdldFRpbWUoKSwgeF9kaWZmID0gZDEueCAtIGQwLngsXG4gICAgICAgICAgICAgICAgICAgIHh2MCA9IG5ldyBEYXRlKHgwICsgeF9kaWZmICogaiksXG4gICAgICAgICAgICAgICAgICAgIHh2MSA9IG5ldyBEYXRlKHgwICsgeF9kaWZmICogKGogKyBkaWZmKSksXG4gICAgICAgICAgICAgICAgICAgIHBvaW50cztcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBwb2ludHMgPSBbW3koeXAoaikpLCB4KHh2MCldLCBbeSh5cChqICsgZGlmZikpLCB4KHh2MSldXTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwb2ludHMgPSBbW3goeHYwKSwgeSh5cChqKSldLCBbeCh4djEpLCB5KHlwKGogKyBkaWZmKSldXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdlbmVyYXRlTShwb2ludHMpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNXaXRoUmVnaW9uID0gZnVuY3Rpb24gKGQwLCBkMSwgaiwgZGlmZikge1xuICAgICAgICAgICAgICAgIHZhciBwb2ludHM7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5heGlzX3JvdGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzID0gW1t5KHlwKGopLCB0cnVlKSwgeCh4cChqKSldLCBbeSh5cChqICsgZGlmZiksIHRydWUpLCB4KHhwKGogKyBkaWZmKSldXTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwb2ludHMgPSBbW3goeHAoaiksIHRydWUpLCB5KHlwKGopKV0sIFt4KHhwKGogKyBkaWZmKSwgdHJ1ZSksIHkoeXAoaiArIGRpZmYpKV1dO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZ2VuZXJhdGVNKHBvaW50cyk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gR2VuZXJhdGVcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGQubGVuZ3RoOyBpKyspIHtcblxuICAgICAgICAgICAgLy8gRHJhdyBhcyBub3JtYWxcbiAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChyZWdpb25zKSB8fCAhIGlzV2l0aGluUmVnaW9ucyhkW2ldLngsIHJlZ2lvbnMpKSB7XG4gICAgICAgICAgICAgICAgcyArPSBcIiBcIiArIHhWYWx1ZShkW2ldKSArIFwiIFwiICsgeVZhbHVlKGRbaV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gRHJhdyB3aXRoIHJlZ2lvbiAvLyBUT0RPOiBGaXggZm9yIGhvcml6b3RhbCBjaGFydHNcbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHhwID0gJCQuZ2V0U2NhbGUoZFtpIC0gMV0ueCArIHhPZmZzZXQsIGRbaV0ueCArIHhPZmZzZXQsICQkLmlzVGltZVNlcmllcygpKTtcbiAgICAgICAgICAgICAgICB5cCA9ICQkLmdldFNjYWxlKGRbaSAtIDFdLnZhbHVlLCBkW2ldLnZhbHVlKTtcblxuICAgICAgICAgICAgICAgIGR4ID0geChkW2ldLngpIC0geChkW2kgLSAxXS54KTtcbiAgICAgICAgICAgICAgICBkeSA9IHkoZ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YXJJbmRpY2VzLCBpc1N1Yikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBnZXRQb2ludHMgPSAkJC5nZW5lcmF0ZUdldEJhclBvaW50cyhiYXJJbmRpY2VzLCBpc1N1Yik7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoZCwgaSkge1xuICAgICAgICAgICAgLy8gNCBwb2ludHMgdGhhdCBtYWtlIGEgYmFyXG4gICAgICAgICAgICB2YXIgcG9pbnRzID0gZ2V0UG9pbnRzKGQsIGkpO1xuXG4gICAgICAgICAgICAvLyBzd2l0Y2ggcG9pbnRzIGlmIGF4aXMgaXMgcm90YXRlZCwgbm90IGFwcGxpY2FibGUgZm9yIHN1YiBjaGFydFxuICAgICAgICAgICAgdmFyIGluZGV4WCA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAxIDogMDtcbiAgICAgICAgICAgIHZhciBpbmRleFkgPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IDE7XG5cbiAgICAgICAgICAgIHZhciBwYXRoID0gJ00gJyArIHBvaW50c1swXVtpbmRleFhdICsgJywnICsgcG9pbnRzWzBdW2luZGV4WV0gKyAnICcgK1xuICAgICAgICAgICAgICAgICAgICAnTCcgKyBwb2ludHNbMV1baW5kZXhYXSArICcsJyArIHBvaW50c1sxXVtpbmRleFldICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgJ0wnICsgcG9pbnRzWzJdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbMl1baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICdMJyArIHBvaW50c1szXVtpbmRleFhdICsgJywnICsgcG9pbnRzWzNdW2luZGV4WV0gKyAnICcgK1xuICAgICAgICAgICAgICAgICAgICAneic7XG5cbiAgICAgICAgICAgIHJldHVybiBwYXRoO1xuICAgICAgICB9O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ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uY3Rpb24gKGQpIHsgcmV0dXJuICQkLmNvbG9yKGQpOyB9KVxuICAgICAgICAgICAgLnN0eWxlKFwiZmlsbC1vcGFjaXR5XCIsIDApO1xuICAgICAgICAkJC5tYWluVGV4dFxuICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24gKGQsIGksIGopIHsgcmV0dXJuICQkLmRhdGFMYWJlbEZvcm1hdChkLmlkKShkLnZhbHVlLCBkLmlkLCBpLCBqKTsgfSk7XG4gICAgICAgICQkLm1haW5UZXh0LmV4aXQoKVxuICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbkZvckV4aXQpXG4gICAgICAgICAgICAuc3R5bGUoJ2ZpbGwtb3BhY2l0eScsIDApXG4gICAgICAgICAgICAucmVtb3ZlKCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5yZWRyYXdUZXh0ID0gZnVuY3Rpb24gKHhGb3JUZXh0LCB5Rm9yVGV4dCwgZm9yRmxvdywgd2l0aFRyYW5zaXRpb24pIHtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICh3aXRoVHJhbnNpdGlvbiA/IHRoaXMubWFpblRleHQudHJhbnNpdGlvbigpIDogdGhpcy5tYWluVGV4dClcbiAgICAgICAgICAgICAgICAuYXR0cigneCcsIHhGb3JUZXh0KVxuICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgeUZvclRleHQpXG4gICAgICAgICAgICAgICAgLnN0eWxlKFwiZmlsbFwiLCB0aGlzLmNvbG9yKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcImZpbGwtb3BhY2l0eVwiLCBmb3JGbG93ID8gMCA6IHRoaXMub3BhY2l0eUZvclRleHQuYmluZCh0aGlzKSlcbiAgICAgICAgXTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFRleHRSZWN0ID0gZnVuY3Rpb24gKHRleHQsIGNscywgZWxlbWVudCkge1xuICAgIC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8gMiA6IHBvaW50c1swXVswXTtcbiAgICAgICAgfVxuICAgICAgICAvLyBzaG93IGxhYmVscyByZWdhcmRsZXNzIG9mIHRoZSBkb21haW4gaWYgdmFsdWUgaXMgbnVsbFxuICAgICAgICBpZiAoZC52YWx1ZSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgaWYgKHhQb3MgPiAkJC53aWR0aCkge1xuICAgICAgICAgICAgICAgIHhQb3MgPSAkJC53aWR0aCAtIGJveC53aWR0aDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoeFBvcyA8IDApIHtcbiAgICAgICAgICAgICAgICB4UG9zID0gNDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geFBvcztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFlGb3JUZXh0ID0gZnVuY3Rpb24gKHBvaW50cywgZCwgdGV4dEVsZW1lbnQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIGJveCA9IHRleHRFbGVtZW50LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLFxuICAgICAgICAgICAgeVBvcztcbiAgICAgICAgaWYgKCQkLmNvbmZpZy5heGlzX3JvdGF0ZWQpIHtcbiAgICAgICAgICAgIHlQb3MgPSAocG9pbnRzWzBdWzBdICsgcG9pbnRzWzJdWzBdICsgYm94LmhlaWdodCAqIDAuNikgLyAyO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeVBvcyA9IHBvaW50c1syXVsxXTtcbiAgICAgICAgICAgIGlmIChkLnZhbHVlIDwgMCAgfHwgKGQudmFsdWUgPT09IDAgJiYgISQkLmhhc1Bvc2l0aXZlVmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgeVBvcyArPSBib3guaGVpZ2h0O1xuICAgICAgICAgICAgICAgIGlmICgkJC5pc0JhclR5cGUoZCkgJiYgJCQuaXNTYWZhcmkoKSkge1xuICAgICAgICAgICAgICAgICAgICB5UG9zIC09IDM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKCEkJC5pc0JhclR5cGUoZCkgJiYgJCQuaXNDaHJvbWUoKSkge1xuICAgICAgICAgICAgICAgICAgICB5UG9zICs9IDM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB5UG9zICs9ICQkLmlzQmFyVHlwZShkKSA/IC0zIDogLTY7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gc2hvdyBsYWJlbHMgcmVnYXJkbGVzcyBvZiB0aGUgZG9tYWluIGlmIHZhbHVlIGlzIG51bGxcbiAgICAgICAgaWYgKGQudmFsdWUgPT09IG51bGwgJiYgISQkLmNvbmZpZy5heGlzX3JvdGF0ZWQpIHtcbiAgICAgICAgICAgIGlmICh5UG9zIDwgYm94LmhlaWdodCkge1xuICAgICAgICAgICAgICAgIHlQb3MgPSBib3guaGVpZ2h0O1xuICAgICAgICAgICAgfSBlbHNlIGlmICh5UG9zID4gdGhpcy5oZWlnaHQpIHtcbiAgICAgICAgICAgICAgICB5UG9zID0gdGhpcy5oZWlnaHQgLSA0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB5UG9zO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5zZXRUYXJnZXRUeXBlID0gZnVuY3Rpb24gKHRhcmdldElkcywgdHlwZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgICQkLm1hcFRvVGFyZ2V0SWRzKHRhcmdldElkcykuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICQkLndpdGhvdXRGYWRlSW5baWRdID0gKHR5cGUgPT09IGNvbmZpZy5kYXRhX3R5cGVzW2lkXSk7XG4gICAgICAgICAgICBjb25maWcuZGF0YV90eXBlc1tpZF0gPSB0eXBlO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKCF0YXJnZXRJZHMpIHtcbiAgICAgICAgICAgIGNvbmZpZy5kYXRhX3R5cGUgPSB0eXBlO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5oYXNUeXBlID0gZnVuY3Rpb24gKHR5cGUsIHRhcmdldHMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgdHlwZXMgPSAkJC5jb25maWcuZGF0YV90eXBlcywgaGFzID0gZmFsc2U7XG4gICAgICAgIHRhcmdldHMgPSB0YXJnZXRzIHx8ICQkLmRhdGEudGFyZ2V0cztcbiAgICAgICAgaWYgKHRhcmdldHMgJiYgdGFyZ2V0cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodGFyZ2V0KSB7XG4gICAgICAgICAgICAgICAgdmFyIHQgPSB0eXBlc1t0YXJnZXQuaWRdO1xuICAgICAgICAgICAgICAgIGlmICgodCAmJiB0LmluZGV4T2YodHlwZSkgPj0gMCkgfHwgKCF0ICYmIHR5cGUgPT09ICdsaW5lJykpIHtcbiAgICAgICAgICAgICAgICAgICAgaGFzID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIGlmIChPYmplY3Qua2V5cyh0eXBlcykubGVuZ3RoKSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyh0eXBlcykuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZXNbaWRdID09PSB0eXBlKSB7IGhhcyA9IHRydWU7IH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaGFzID0gJCQuY29uZmlnLmRhdGFfdHlwZSA9PT0gdHlwZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaG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5lLmFwcGVuZCgnbGluZScpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDApO1xuICAgICAgICB4Z3JpZExpbmUuYXBwZW5kKCd0ZXh0JylcbiAgICAgICAgICAgIC5hdHRyKFwidGV4dC1hbmNob3JcIiwgJCQuZ3JpZFRleHRBbmNob3IpXG4gICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gXCJcIiA6IFwicm90YXRlKC05MClcIilcbiAgICAgICAgICAgIC5hdHRyKCdkeCcsICQkLmdyaWRUZXh0RHgpXG4gICAgICAgICAgICAuYXR0cignZHknLCAtNSlcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMCk7XG4gICAgICAgIC8vIHVkcGF0ZVxuICAgICAgICAvLyBkb25lIGluIGQzLnRyYW5zaXRpb24oKSBvZiB0aGUgZW5kIG9mIHRoaXMgZnVuY3Rpb25cbiAgICAgICAgLy8gZXhpdFxuICAgICAgICAkJC54Z3JpZExpbmVzLmV4aXQoKS50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDApXG4gICAgICAgICAgICAucmVtb3ZlKCk7XG5cbiAgICAgICAgLy8gWS1HcmlkXG4gICAgICAgIGlmIChjb25maWcuZ3JpZF95X3Nob3cpIHtcbiAgICAgICAgICAgICQkLnVwZGF0ZVlHcmlkKCk7XG4gICAgICAgIH1cbiAgICAgICAgJCQueWdyaWRMaW5lcyA9IG1haW4uc2VsZWN0KCcuJyArIENMQVNTLnlncmlkTGluZXMpLnNlbGVjdEFsbCgnLicgKyBDTEFTUy55Z3JpZExpbmUpXG4gICAgICAgICAgICAuZGF0YShjb25maWcuZ3JpZF95X2xpbmVzKTtcbiAgICAgICAgLy8gZW50ZXJcbiAgICAgICAgeWdyaWRMaW5lID0gJCQueWdyaWRMaW5lcy5lbnRlcigpLmFwc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VxuICAgICAgICAgICAgLmF0dHIoXCJ4MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiAtMTApXG4gICAgICAgICAgICAuYXR0cihcInkxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAtMTAgOiAwKVxuICAgICAgICAgICAgLmF0dHIoXCJ5MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gLTEwIDogJCQuaGVpZ2h0KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlR3JpZERhdGEgPSBmdW5jdGlvbiAodHlwZSwgc2NhbGUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIGdyaWREYXRhID0gW10sIHhEb21haW4sIGZpcnN0WWVhciwgbGFzdFllYXIsIGksXG4gICAgICAgICAgICB0aWNrTnVtID0gJCQubWFpbi5zZWxlY3QoXCIuXCIgKyBDTEFTUy5heGlzWCkuc2VsZWN0QWxsKCcudGljaycpLnNpemUoKTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICd5ZWFyJykge1xuICAgICAgICAgICAgeERvbWFpbiA9ICQkLmdldFhEb21haW4oKTtcbiAgICAgICAgICAgIGZpcnN0WWVhciA9IHhEb21haW5bMF0uZ2V0RnVsbFllYXIoKTtcbiAgICAgICAgICAgIGxhc3RZZWFyID0geERvbWFpblsxXS5nZXRGdWxsWWVhcigpO1xuICAgICAgICAgICAgZm9yIChpID0gZmlyc3RZZWFyOyBpIDw9IGxhc3RZZWFyOyBpKyspIHtcbiAgICAgICAgICAgICAgICBncmlkRGF0YS5wdXNoKG5ldyBEYXRlKGkgKyAnLTAxLTAxIDAwOjAwOjAwJykpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZ3JpZERhdGEgPSBzY2FsZS50aWNrcygxMCk7XG4gICAgICAgICAgICBpZiAoZ3JpZERhdGEubGVuZ3RoID4gdGlja051bSkgeyA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ICAgIHRvU2hvdyA9IGZ1bmN0aW9uIChsaW5lKSB7IHJldHVybiAhdG9SZW1vdmUobGluZSk7IH0sXG4gICAgICAgICAgICBjbGFzc0xpbmVzID0gZm9yWCA/IENMQVNTLnhncmlkTGluZXMgOiBDTEFTUy55Z3JpZExpbmVzLFxuICAgICAgICAgICAgY2xhc3NMaW5lID0gZm9yWCA/IENMQVNTLnhncmlkTGluZSA6IENMQVNTLnlncmlkTGluZTtcbiAgICAgICAgJCQubWFpbi5zZWxlY3QoJy4nICsgY2xhc3NMaW5lcykuc2VsZWN0QWxsKCcuJyArIGNsYXNzTGluZSkuZmlsdGVyKHRvUmVtb3ZlKVxuICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihjb25maWcudHJhbnNpdGlvbl9kdXJhdGlvbilcbiAgICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDApLnJlbW92ZSgpO1xuICAgICAgICBpZiAoZm9yWCkge1xuICAgICAgICAgICAgY29uZmlnLmdyaWRfeF9saW5lcyA9IGNvbmZpZy5ncmlkX3hfbGluZXMuZmlsdGVyKHRvU2hvdyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb25maWcuZ3JpZF95X2xpbmVzID0gY29uZmlnLmdyaWRfeV9saW5lcy5maWx0ZXIodG9TaG93KTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pbml0VG9vbHRpcCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCBpO1xuICAgICAgICAkJC50b29sdGlwID0gJCQuc2VsZWN0Q2hhcnRcbiAgICAgICAgICAgIC5zdHlsZShcInBvc2l0aW9uXCIsIFwicmVsYXRpdmVcIilcbiAgICAgICAgICAuYXBwZW5kKFwiZGl2XCIpXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCBDTEFTUy50b29sdGlwQ29udGFpbmVyKVxuICAgICAgICAgICAgLnN0eWxlKFwicG9zaXRpb25cIiwgXCJhYnNvbHV0ZVwiKVxuICAgICAgICAgICAgLnN0eWxlKFwicG9pbnRlci1ldmVudHNcIiwgXCJub25lXCIpXG4gICAgICAgICAgICAuc3R5bGUoXCJkaXNwbGF5XCIsIFwibm9uZVwiKTtcbiAgICAgICAgLy8gU2hvdyB0b29sdGlwIGlmIG5lZWRlZFxuICAgICAgICBpZiAoY29uZmlnLnRvb2x0aXBfaW5pdF9zaG93KSB7XG4gICAgICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkgJiYgaXNTdHJpbmcoY29uZmlnLnRvb2x0aXBfaW5pdF94KSkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy50b29sdGlwX2luaXRfeCA9ICQkLnBhcnNlRGF0ZShjb25maWcudG9vbHRpcF9pbml0X3gpO1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlc1tpXS54IC0gY29uZmlnLnRvb2x0aXBfaW5pdF94KSA9PT0gMCkgeyBicmVhazsgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25maWcudG9vbHRpcF9pbml0X3ggPSBpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgJCQudG9vbHRpcC5odG1sKGNvbmZpZy50b29sdGlwX2NvbnRlbnRzLmNhbGwoJCQsICQkLmRhdGEudGFyZ2V0cy5tYXAoZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJCQuYWRkTmFtZShkLnZhbHVlc1tjb25maWcudG9vbHRpcF9pbml0X3hdKTtcbiAgICAgICAgICAgIH0pLCAkJC5heGlzLmdldFhBeGlzVGlja0Zvcm1hdCgpLCAkJC5nZXRZRm9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ICAgICAgICAgICAgdmFyIHYxID0gYSA/IGEudmFsdWUgOiBudWxsLCB2MiA9IGIgPyBiLnZhbHVlIDogbnVsbDtcbiAgICAgICAgICAgICAgICByZXR1cm4gb3JkZXJBc2MgPyB2MSAtIHYyIDogdjIgLSB2MTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIGlkcyA9ICQkLm9yZGVyVGFyZ2V0cygkJC5kYXRhLnRhcmdldHMpLm1hcChmdW5jdGlvbiAoaSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpLmlkO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBkLnNvcnQoZnVuY3Rpb24oYSwgYikge1xuICAgICAgICAgICAgICAgIHZhciB2MSA9IGEgPyBhLnZhbHVlIDogbnVsbCwgdjIgPSBiID8gYi52YWx1ZSA6IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKHYxID4gMCAmJiB2MiA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdjEgPSBhID8gaWRzLmluZGV4T2YoYS5pZCkgOiBudWxsO1xuICAgICAgICAgICAgICAgICAgICB2MiA9IGIgPyBpZHMuaW5kZXhPZihiLmlkKSA6IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBvcmRlckFzYyA/IHYxIC0gdjIgOiB2MiAtIHYxO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKCEgKGRbaV0gJiYgKGRbaV0udmFsdWUgfHwgZFtpXS52YWx1ZSA9PT0gMCkpKSB7IGNvbnRpbnVlOyB9XG5cbiAgICAgICAgICAgIGlmICghIHRleHQpIHtcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHNhbml0aXNlKHRpdGxlRm9ybWF0ID8gdGl0bGVGb3JtYXQoZFtpXS54KSA6IG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ICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3RlcHNbaWRdID0gc3RlcDtcbiAgICAgICAgICAgICAgICBtYXJnaW5zW3N0ZXBdID0gJCQuaXNMZWdlbmRJbnNldCA/IDEwIDogbWFyZ2luO1xuICAgICAgICAgICAgICAgIG9mZnNldHNbaWRdID0gdG90YWxMZW5ndGg7XG4gICAgICAgICAgICAgICAgdG90YWxMZW5ndGggKz0gaXRlbUxlbmd0aDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHJlc2V0KSB7XG4gICAgICAgICAgICAgICAgdG90YWxMZW5ndGggPSAwO1xuICAgICAgICAgICAgICAgIHN0ZXAgPSAwO1xuICAgICAgICAgICAgICAgIG1heFdpZHRoID0gMDtcbiAgICAgICAgICAgICAgICBtYXhIZWlnaHQgPSAwO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY29uZmlnLmxlZ2VuZF9zaG93ICYmICEkJC5pc0xlZ2VuZFRvU2hvdyhpZCkpIHtcbiAgICAgICAgICAgICAgICB3aWR0aHNbaWRdID0gaGVpZ2h0c1tpZF0gPSBzdGVwc1tpZF0gPSBvZmZzZXRzW2lkXSA9IDA7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB3aWR0aHNbaWRdID0gaXRlbVdpZHRoO1xuICAgICAgICAgICAgaGVpZ2h0c1tpZF0gPSBpdGVtSGVpZ2h0O1xuXG4gICAgICAgICAgICBpZiAoIW1heFdpZHRoIHx8IGl0ZW1XaWR0aCA+PSBtYXhXaWR0aCkgeyBtYXhXaWR0aCA9IGl0ZW1XaWR0aDsgfVxuICAgICAgICAgICAgaWYgKCFtYXhIZWlnaHQgfHwgaXRlbUhlaWdodCA+PSBtYXhIZWlnaHQpIHsgbWF4SGVpZ2h0ID0gaXRlbUhlaWdodDsgfVxuICAgICAgICAgICAgbWF4TGVuZ3RoID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ICAgICAgICAgICAgLnN0eWxlKCdjdXJzb3InLCAncG9pbnRlcicpXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5sZWdlbmRfaXRlbV9vbmNsaWNrKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5sZWdlbmRfaXRlbV9vbmNsaWNrLmNhbGwoJCQsIGlkKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuZDMuZXZlbnQuYWx0S2V5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5hcGkuaGlkZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuYXBpLnNob3coaWQpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuYXBpLnRvZ2dsZShpZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5pc1RhcmdldFRvU2hvdyhpZCkgPyAkJC5hcGkuZm9jdXMoaWQpIDogJCQuYXBpLnJldmVydCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5sZWdlbmRfaXRlbV9vbm1vdXNlb3Zlcikge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcubGVnZW5kX2l0ZW1fb25tb3VzZW92ZXIuY2FsbCgkJCwgaWQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZDMuc2VsZWN0KHRoaXMpLmNsYXNzZWQoQ0xBU1MubGVnZW5kSXRlbUZvY3VzZWQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISQkLnRyYW5zaXRpbmcgJiYgJCQuaXNUYXJnZXRUb1Nob3coaWQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5hcGkuZm9jdXMoaWQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmxlZ2VuZF9pdGVtX29ubW91c2VvdXQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmxlZ2VuZF9pdGVtX29ubW91c2VvdXQuY2FsbCgkJCwgaWQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZDMuc2VsZWN0KHRoaXMpLmNsYXNzZWQoQ0xBU1MubGVnZW5kSXRlbUZvY3VzZWQsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuYXBpLnJldmVydCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICBsLmFwcGVuZCgndGV4dCcpXG4gICAgICAgICAgICAudGV4dChmdW5jdGlvbiAoaWQpIHsgcmV0dXJuIGlzRGVmaW5lZChjb25maWcuZGF0YV9uYW1lc1tpZF0pID8gY29uZmlnLmRhdGFfbmFtZXNbaWRdIDogaWQ7IH0pXG4gICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoaWQsIGkpIHsgdXBkYXRlUG9zaXRpb25zKHRoaXMsIGlkLCBpKTsgfSlcbiAgICAgICAgICAgIC5zdHlsZShcInBvaW50ZXItZXZlbnRzXCIsIFwibm9uZVwiKVxuICAgICAgICAgICAgLmF0dHIoJ3gnLCAkJC5pc0xlZ2VuZFJpZ2h0IHx8ICQkLmlzTGVnZW5kSW5zZXQgPyB4Rm9yTGVnZW5kVGV4dCA6IC0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ScpKVxuICAgICAgICAgICAgLnN0eWxlKFwidmlzaWJpbGl0eVwiLCBjb25maWcuYXhpc195X3Nob3cgPyAndmlzaWJsZScgOiAnaGlkZGVuJyk7XG4gICAgICAgICQkLmF4ZXMueS5hcHBlbmQoXCJ0ZXh0XCIpXG4gICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIENMQVNTLmF4aXNZTGFiZWwpXG4gICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gXCJcIiA6IFwicm90YXRlKC05MClcIilcbiAgICAgICAgICAgIC5zdHlsZShcInRleHQtYW5jaG9yXCIsIHRoaXMudGV4dEFuY2hvckZvcllBeGlzTGFiZWwuYmluZCh0aGlzKSk7XG5cbiAgICAgICAgJCQuYXhlcy55MiA9IG1haW4uYXBwZW5kKFwiZ1wiKVxuICAgICAgICAgICAgLmF0dHIoXCJjbGFzc1wiLCBDTEFTUy5heGlzICsgJyAnICsgQ0xBU1MuYXhpc1kyKVxuICAgICAgICAgICAgLy8gY2xpcC1wYXRoP1xuICAgICAgICAgICAgLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgJCQuZ2V0VHJhbnNsYXRlKCd5MicpKVxuICAgICAgICAgICAgLnN0eWxlKFwidmlzaWJpbGl0eVwiLCBjb25maWcuYXhpc195Ml9zaG93ID8gJ3Zpc2libGUnIDogJ2hpZGRlbicpO1xuICAgICAgICAkJC5heGVzLnkyLmFwcGVuZChcInRleHRcIilcbiAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgQ0xBU1MuYXhpc1kyTGFiZWwpXG4gICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gXCJcIiA6IFwicm90YXRlKC05MClcIilcbiAgICAgICAgICAgIC5zdHlsZShcInRleHQtYW5jaG9yXCIsIHRoaXMudGV4dEFuY2hvckZvclkyQXhpc0xhYmVsLmJpbmQodGhpcykpO1xuICAg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GUodik7IH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2V0IHRpY2tcbiAgICAgICAgYXhpcy50aWNrRm9ybWF0KHRpY2tGb3JtYXQpLnRpY2tWYWx1ZXModGlja1ZhbHVlcyk7XG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIGF4aXMudGlja0NlbnRlcmVkKGNvbmZpZy5heGlzX3hfdGlja19jZW50ZXJlZCk7XG4gICAgICAgICAgICBpZiAoaXNFbXB0eShjb25maWcuYXhpc194X3RpY2tfY3VsbGluZykpIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc194X3RpY2tfY3VsbGluZyA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgfTtcbiAgICBBeGlzLnByb3RvdHlwZS51cGRhdGVYQXhpc1RpY2tWYWx1ZXMgPSBmdW5jdGlvbiB1cGRhdGVYQXhpc1RpY2tWYWx1ZXModGFyZ2V0cywgYXhpcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLm93bmVyLCBjb25maWcgPSAkJC5jb25maWcsIHRpY2tWYWx1ZXM7XG4gICAgICAgIGlmIChjb25maWcuYXhpc194X3RpY2tfZml0IHx8IGNvbmZpZy5heGlzX3hfdGlja19jb3VudCkge1xuICAgICAgICAgICAgdGlja1ZhbHVlcyA9IHRoaXMuZ2VuZXJhdGVUaWNrVmFsdWVzKCQkLm1hcFRhcmdldHNUb1VuaXF1ZVhzKHRhcmdldHMpLCBjb25maWcuYXhpc194X3RpY2tfY291bnQsICQkLmlzVGltZVNlcmllcygpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYXhpcykge1xuICAgICAgICAgICAgYXhpcy50aWNrVmFsdWVzKHRpY2tWYWx1ZXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgJCQueEF4aXMudGlja1ZhbHVlcyh0aWNrVmFsdW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KSB7XG4gICAgICAgICAgICBpZiAoYXhpc0lkID09PSAneScpIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc195X2xhYmVsID0gdGV4dDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYXhpc0lkID09PSAneTInKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeTJfbGFiZWwgPSB0ZXh0O1xuICAgICAgICAgICAgfSBlbHNlIGlmIChheGlzSWQgPT09ICd4Jykge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3hfbGFiZWwgPSB0ZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKG9wdGlvbikge1xuICAgICAgICAgICAgb3B0aW9uLnRleHQgPSB0ZXh0O1xuICAgICAgICB9XG4gICAgfTtcbiAgICBBeGlzLnByb3RvdHlwZS5nZXRMYWJlbFBvc2l0aW9uID0gZnVuY3Rpb24gZ2V0TGFiZWxQb3NpdGlvbihheGlzSWQsIGRlZmF1bHRQb3NpdGlvbikge1xuICAgICAgICB2YXIgb3B0aW9uID0gdGhpcy5nZXRMYWJlbE9wdGlvbkJ5QXhpc0lkKGF4aXNJZCksXG4gICAgICAgICAgICBwb3NpdGlvbiA9IChvcHRpb24gJiYgdHlwZW9mIG9wdGlvbiA9PT0gJ29iamVjdCcgJiYgb3B0aW9uLnBvc2l0aW9uKSA/IG9wdGlvbi5wb3NpdGlvbiA6IGRlZmF1bHRQb3NpdGlvbjtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGlzSW5uZXI6IHBvc2l0aW9uLmluZGV4T2YoJ2lubmVyJykgPj0gMCxcbiAgICAgICAgICAgIGlzT3V0ZXI6IHBvc2l0aW9uLmluZGV4T2YoJ291dGVyJykgPj0gMCxcbiAgICAgICAgICAgIGlzTGVmdDogcG9zaXRpb24uaW5kZXhPZignbGVmdCcpID49IDAsXG4gICAgICAgICAgICBpc0NlbnRlcjogcG9zaXRpb24uaW5kZXhPZignY2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jYW5jZWwgdHJhbnNpdGlvblxuICAgICAgICBpZiAoJCQudHJhbnNpdGluZykge1xuICAgICAgICAgICAgaW50ZXJ2YWwgPSB3aW5kb3cuc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICghJCQudHJhbnNpdGluZykge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2xlYXJJbnRlcnZhbChpbnRlcnZhbCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC5sZWdlbmQuc2VsZWN0QWxsKCcuYzMtbGVnZW5kLWl0ZW0tZm9jdXNlZCcpLnNpemUoKSA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZEFyYyh0YXJnZXRJZHMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgMTApO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdGFyZ2V0SWRzID0gJCQubWFwVG9UYXJnZXRJZHModGFyZ2V0SWRzKTtcblxuICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCQkLnNlbGVjdG9yVGFyZ2V0cyh0YXJnZXRJZHMsICcuJyArIENMQVNTLmNoYXJ0QXJjKSkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgaWYgKCEgJCQuc2hvdWxkRXhwYW5kKGQuZGF0YS5pZCkpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAkJC5kMy5zZWxlY3QodGhpcykuc2VsZWN0QWxsKCdwYXRoJylcbiAgICAgICAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKCQkLmV4cGFuZER1cmF0aW9uKGQuZGF0YS5pZCkpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsICQkLnN2Z0FyY0V4cGFuZGVkKVxuICAgICAgICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oJCQuZXhwYW5kRHVyYXRpb24oZC5kYXRhLmlkKSAqIDIpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsICQkLnN2Z0FyY0V4cGFuZGVkU3ViKVxuICAgICAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC5pc0RvbnV0VHlwZShkLmRhdGEpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBjYWxsYmFjayBoZXJlXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnVuZXhwYW5kQXJjID0gZnVuY3Rpb24gKHRhcmdldElkcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuXG4gICAgICAgIGlmICgkJC50cmFuc2l0aW5nKSB7IHJldHVybjsgfVxuXG4gICAgICAgIHRhcmdldElkcyA9ICQkLm1hcFRvVGFyZ2V0SWRzKHRhcmdldElkcyk7XG5cbiAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgkJC5zZWxlY3RvclRhcmdldHModGFyZ2V0SWRzLCAnLicgKyBDTEFTUy5jaGFydEFyYykpLnNlbGVjdEFsbCgncGF0aCcpXG4gICAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKGZ1bmN0aW9uKGQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJCQuZXhwYW5kRHVyYXRpb24oZC5kYXRhLmlkKTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuYXR0cihcImRcIiwgJCQuc3ZnQXJjKTtcbiAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5hcmMpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDEpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5leHBhbmREdXJ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gICAgICAgICAgICAgICAgICQkLnRvZ2dsZUZvY3VzTGVnZW5kKHVwZGF0ZWQuZGF0YS5pZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29ubW91c2VvdmVyKGFyY0RhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCA/IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKSwgYXJjRGF0YSwgc2VsZWN0ZWREYXRhO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpLFxuICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZERhdGEgPSBbYXJjRGF0YV07XG4gICAgICAgICAgICAgICAgICAgICQkLnNob3dUb29sdGlwKHNlbGVjdGVkRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSA6IG51bGwpXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgY29uZmlnLmludGVyYWN0aW9uX2VuYWJsZWQgPyBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkLCBhcmNEYXRhO1xuICAgICAgICAgICAgICAgIGlmICgkJC50cmFuc2l0aW5nKSB7IC8vIHNraXAgd2hpbGUgdHJhbnNpdGluZ1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKTtcbiAgICAgICAgICAgICAgICBpZiAodXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBhcmNEYXRhID0gJCQuY29udmVydFRvQXJjRGF0YSh1cGRhdGVkKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gdHJhbnNpdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgJCQudW5leHBhbmRBcmModXBkYXRlZC5kYXRhLmlkKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuYXBpLnJldmVydCgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5yZXZlcnRMZWdlbmQoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuaGlkZVRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25tb3VzZW91dChhcmNEYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IDogbnVsbClcbiAgICAgICAgICAgIC5vbignY2xpY2snLCBjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCA/IGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKSwgYXJjRGF0YTtcbiAgICAgICAgICAgICAgICBpZiAodXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBhcmNEYXRhID0gJCQuY29udmVydFRvQXJjRGF0YSh1cGRhdGVkKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLnRvZ2dsZVNoYXBlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC50b2dnbGVTaGFwZSh0aGlzLCBhcmNEYXRhLCBpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbmNsaWNrLmNhbGwoJCQuYXBpLCBhcmNEYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IDogbnVsbClcbiAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uICgpIHsgJCQudHJhbnNpdGluZyA9IHRydWU7IH0pXG4gICAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKGR1cmF0aW9uKVxuICAgICAgICAgICAgLmF0dHJUd2VlbihcImRcIiwgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpLCBpbnRlcnBvbGF0ZTtcbiAgICAgICAgICAgICAgICBpZiAoISB1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7IHJldHVybiBcIk0gMCAwXCI7IH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50ID09PSBkKSB7XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQgPSB7XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICBzdGFydEFuZ2xlOiBNYXRoLlBJKjIsXG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgICBlbmRBbmdsZTogTWF0aC5QSSoyLFxuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNOYU4odGhpcy5fY3VycmVudC5zdGFydEFuZ2xlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50LnN0YXJ0QW5nbGUgPSAwO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNOYU4odGhpcy5fY3VycmVudC5lbmRBbmdsZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudC5lbmRBbmdsZSA9IHRoaXMuX2N1cnJlbnQuc3RhcnRBbmdsZTtcbiAgICAgICAgICAgICAgICB9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YXNUeXBlKCdnYXVnZScpID8gMSA6IDApO1xuXG4gICAgICAgIGlmICgkJC5oYXNUeXBlKCdnYXVnZScpKSB7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NCYWNrZ3JvdW5kKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogW3t2YWx1ZTogY29uZmlnLmdhdWdlX21heH1dLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRBbmdsZTogY29uZmlnLmdhdWdlX3N0YXJ0aW5nQW5nbGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBlbmRBbmdsZTogLTEgKiBjb25maWcuZ2F1Z2Vfc3RhcnRpbmdBbmdsZVxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQuZ2V0QXJjKGQsIHRydWUsIHRydWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgJCQuYXJjcy5zZWxlY3QoJy4nICsgQ0xBU1MuY2hhcnRBcmNzR2F1Z2VVbml0KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiZHlcIiwgXCIuNzVlbVwiKVxuICAgICAgICAgICAgICAgIC50ZXh0KGNvbmZpZy5nYXVnZV9sYWJlbF9zaG93ID8gY29uZmlnLmdhdWdlX3VuaXRzIDogJycpO1xuICAgICAgICAgICAgJCQuYXJjcy5zZWxlY3QoJy4nICsgQ0xBU1MuY2hhcnRBcmNzR2F1Z2VNaW4pXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJkeFwiLCAtMSAqICgkJC5pbm5lclJhZGl1cyArICgoJCQucmFkaXVzIC0gJCQuaW5uZXJSYWRpdXMpIC8gKGNvbmZpZy5nYXVnZV9mdWxsQ2lyY2xlID8gMSA6IDIpKS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nICsgQ0xBU1Muc2hhcGVzKS5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUpXG4gICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChkKSB7IHJldHVybiBjb25maWcuZGF0YV9zZWxlY3Rpb25faXNzZWxlY3RhYmxlKGQpOyB9KVxuICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICB2YXIgc2hhcGUgPSBkMy5zZWxlY3QodGhpcyksXG4gICAgICAgICAgICAgICAgICAgIGlzU2VsZWN0ZWQgPSBzaGFwZS5jbGFzc2VkKENMQVNTLlNFTEVDVEVEKSxcbiAgICAgICAgICAgICAgICAgICAgaXNJbmNsdWRlZCA9IHNoYXBlLmNsYXNzZWQoQ0xBU1MuSU5DTFVERUQpLFxuICAgICAgICAgICAgICAgICAgICBfeCwgX3ksIF93LCBfaCwgdG9nZ2xlLCBpc1dpdGhpbiA9IGZhbHNlLCBib3g7XG4gICAgICAgICAgICAgICAgaWYgKHNoYXBlLmNsYXNzZWQoQ0xBU1MuY2lyY2xlKSkge1xuICAgICAgICAgICAgICAgICAgICBfeCA9IHNoYXBlLmF0dHIoXCJjeFwiKSAqIDE7XG4gICAgICAgICAgICAgICAgICAgIF95ID0gc2hhcGUuYXR0cihcImN5XCIpICogMTtcbiAgICAgICAgICAgICAgICAgICAgdG9nZ2xlID0gJCQudG9nZ2xlUG9pbnQ7XG4gICAgICAgICAgICAgICAgICAgIGlzV2l0aGluID0gbWluWCA8IF94ICYmIF94IDwgbWF4WCAmJiBtaW5ZIDwgX3kgJiYgX3kgPCBtYXhZO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFwZS5jbGFzc2VkKENMQVNTLmJhcikpIHtcbiAgICAgICAgICAgICAgICAgICAgYm94ID0gZ2V0UGF0aEJveCh0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgX3ggPSBib3gueDtcbiAgICAgICAgICAgICAgICAgICAgX3kgPSBib3gueTtcbiAgICAgICAgICAgICAgICAgICAgX3cgPSBib3gud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIF9oID0gYm94LmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgdG9nZ2xlID0gJCQudG9nZ2xlUGF0aDtcbiAgICAgICAgICAgICAgICAgICAgaXNXaXRoaW4gPSAhKG1heFggPCBfeCB8fCBfeCArIF93IDwgbWluWCkgJiYgIShtYXhZIDwgX3kgfHwgX3kgKyBfaCA8IG1pblkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGxpbmUvYXJlYSBzZWxlY3Rpb24gbm90IHN1cHBvcnRlZCB5ZXRcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNXaXRoaW4gXiBpc0luY2x1ZGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHNoYXBlLmNsYXNzZWQoQ0xBU1MuSU5DTFVERUQsICFpc0luY2x1ZGVkKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogaW5jbHVkZWQvdW5pbmNsdWRlZCBjYWxsYmFjayBoZXJlXG4gICAgICAgICAgICAgICAgICAgIHNoYXBlLmNsYXNzZWQoQ0xBU1MuU0VMRUNURUQsICFpc1NlbGVjdGVkKTtcbiAgICAgICAgICAgICAgICAgICAgdG9nZ2xlLmNhbGwoJCQsICFpc1NlbGVjdGVkLCBzaGFwZSwgZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmRyYWdzdGFydCA9IGZ1bmN0aW9uIChtb3VzZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGlmICgkJC5oYXNBcmNUeXBlK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uICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGNsYXNzQ2hhcnRCYXIpO1xuICAgICAgICAgICAgLy8gQmFycyBmb3IgZWFjaCBkYXRhXG4gICAgICAgICAgICBjb250ZXh0QmFyRW50ZXIuYXBwZW5kKCdnJylcbiAgICAgICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIGNsYXNzQmFycyk7XG5cbiAgICAgICAgICAgIC8vLS0gTGluZSAtLS8vXG4gICAgICAgICAgICBjb250ZXh0TGluZVVwZGF0ZSA9IGNvbnRleHQuc2VsZWN0KCcuJyArIENMQVNTLmNoYXJ0TGluZXMpLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5jaGFydExpbmUpXG4gICAgICAgICAgICAgICAgLmRhdGEodGFyZ2V0cylcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCBjbGFzc0NoYXJ0TGluZSk7XG4gICAgICAgICAgICBjb250ZXh0TGluZUVudGVyID0gY29udGV4dExpbmVVcGRhdGUuZW50ZXIoKS5hcHBlbmQoJ2cnKVxuICAgICAgICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDApXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgY2xhc3NDaGFydExpbmUpO1xuICAgICAgICAgICAgLy8gTGluZXMgZm9yIGVhY2ggZGF0YVxuICAgICAgICAgICAgY29udGV4dExpbmVFbnRlci5hcHBlbmQoXCJnXCIpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJjbGFzc1wiLCBjbGFzc0xpbmVzKTtcbiAgICAgICAgICAgIC8vIEFyZWFcbiAgICAgICAgICAgIGNvbnRleHRMaW5lRW50ZXIuYXBwZW5kKFwiZ1wiKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgY2xhc3NBcmVhcyk7XG5cbiAgICAgICAgICAgIC8vLS0gQnJ1c2ggLS0vL1xuICAgICAgICAgICAgY29udGV4dC5zZWxlY3RBbGwoJy4nICsgQ0xB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WIsIGRyYXdMaW5lT25TdWI7XG5cbiAgICAgICAgJCQuY29udGV4dC5zdHlsZSgndmlzaWJpbGl0eScsIGNvbmZpZy5zdWJjaGFydF9zaG93ID8gJ3Zpc2libGUnIDogJ2hpZGRlbicpO1xuXG4gICAgICAgIC8vIHN1YmNoYXJ0XG4gICAgICAgIGlmIChjb25maWcuc3ViY2hhcnRfc2hvdykge1xuICAgICAgICAgICAgLy8gcmVmbGVjdCBtYWluIGNoYXJ0IHRvIGV4dGVudCBvbiBzdWJjaGFydCBpZiB6b29tZWRcbiAgICAgICAgICAgIGlmIChkMy5ldmVudCAmJiBkMy5ldmVudC50eXBlID09PSAnem9vbScpIHtcbiAgICAgICAgICAgICAgICAkJC5icnVzaC5leHRlbnQoJCQueC5vcmdEb21haW4oKSkudXBkYXRlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyB1cGRhdGUgc3ViY2hhcnQgZWxlbWVudHMgaWYgbmVlZGVkXG4gICAgICAgICAgICBpZiAod2l0aFN1YmNoYXJ0KSB7XG5cbiAgICAgICAgICAgICAgICAvLyBleHRlbnQgcmVjdFxuICAgICAgICAgICAgICAgIGlmICghJCQuYnJ1c2guZW1wdHkoKSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5icnVzaC5leHRlbnQoJCQueC5vcmdEb21haW4oKSkudXBkYXRlKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHNldHVwIGRyYXdlciAtIE1FTU86IHRoaXMgbXVzdCBiZSBjYWxsZWQgYWZ0ZXIgYXhpcyB1cGRhdGVkXG4gICAgICAgICAgICAgICAgZHJhd0FyZWFPblN1YiA9ICQkLmdlbmVyYXRlRHJhd0FyZWEoYXJlYUluZGljZXMsIHRydWUpO1xuICAgICAgICAgICAgICAgIGRyYXdCYXJPblN1YiA9ICQkLmdlbmVyYXRlRHJhd0JhcihiYXJJbmRpY2VzLCB0cnVlKTtcbiAgICAgICAgICAgICAgICBkcmF3TGluZU9uU3ViID0gJCQuZ2VuZXJhdGVEcmF3TGluZShsaW5lSW5kaWNlcywgdHJ1ZSk7XG5cbiAgICAgICAgICAgICAgICAkJC51cGRhdGVCYXJGb3JTdWJjaGFydChkdXJhdGlvbik7XG4gICAgICAgICAgICAgICAgJCQudXBkYXRlTGluZUZvclN1YmNoYXJ0KGR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVBcmVhRm9yU3ViY2hhcnQoZHVyYXRpb24pO1xuXG4gICAgICAgICAgICAgICAgJCQucmVkcmF3QmFyRm9yU3ViY2hhcnQoZHJhd0Jhck9uU3ViLCBkdXJhdGlvbiwgZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICQkLnJlZHJhd0xpbmVGb3JTdWJjaGFydChkcmF3TGluZU9uU3ViLCBkdXJhdGlvbiwgZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICQkLnJlZHJhd0FyZWFGb3JTdWJjaGFydChkcmF3QXJlYU9uU3ViLCBkdXJhdGlvbiwgZHVyYXRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5yZWRyYXdGb3JCcnVzaCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgeCA9ICQkLng7XG4gICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogZmFsc2UsXG4gICAgICAgICAgICB3aXRoWTogJCQuY29uZmlnLnpvb21fcmVzY2FsZSxcbiAgICAgICAgICAgIHdpdGhTdWJjaGFydDogZmFsc2UsXG4gICAgICAgICAgICB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgIHdpdGhEaW1lbnNpb246IGZhbHNlXG4gICAgICAgIH0pO1xuICAgICAgICAkJC5jb25maWcuc3ViY2hhcnRfb25icnVzaC5jYWxsKCQkLmFwaSwgeC5vcmdEb21haW4o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9IFskJC5wYXJzZURhdGUoZXh0ZW50WzBdKSwgJCQucGFyc2VEYXRlKGV4dGVudFsxXSldO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBleHRlbnQ7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmluaXRab29tID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBkMyA9ICQkLmQzLCBjb25maWcgPSAkJC5jb25maWcsIHN0YXJ0RXZlbnQ7XG5cbiAgICAgICAgJCQuem9vbSA9IGQzLmJlaGF2aW9yLnpvb20oKVxuICAgICAgICAgICAgLm9uKFwiem9vbXN0YXJ0XCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzdGFydEV2ZW50ID0gZDMuZXZlbnQuc291cmNlRXZlbnQ7XG4gICAgICAgICAgICAgICAgJCQuem9vbS5hbHREb21haW4gPSBkMy5ldmVudC5zb3VyY2VFdmVudC5hbHRLZXkgPyAkJC54Lm9yZ0RvbWFpbigpIDogbnVsbDtcbiAgICAgICAgICAgICAgICBjb25maWcuem9vbV9vbnpvb21zdGFydC5jYWxsKCQkLmFwaSwgZDMuZXZlbnQuc291cmNlRXZlbnQpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbihcInpvb21cIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICQkLnJlZHJhd0Zvclpvb20uY2FsbCgkJCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCd6b29tZW5kJywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBldmVudCA9IGQzLmV2ZW50LnNvdXJjZUV2ZW50O1xuICAgICAgICAgICAgICAgIC8vIGlmIGNsaWNrLCBkbyBub3RoaW5nLiBvdGhlcndpc2UsIGNsaWNrIGludGVyYWN0aW9uIHdpbGwgYmUgY2FuY2VsZWQuXG4gICAgICAgICAgICAgICAgaWYgKGV2ZW50ICYmIHN0YXJ0RXZlbnQuY2xpZW50WCA9PT0gZXZlbnQuY2xpZW50WCAmJiBzdGFydEV2ZW50LmNsaWVudFkgPT09IGV2ZW50LmNsaWVudFkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAkJC5yZWRyYXdFdmVudFJlY3QoKTtcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVab29tKCk7XG4gICAgICAgICAgICAgICAgY29uZmlnLnpvb21fb256b29tZW5kLmNhbGwoJCQuYXBpLCAkJC54Lm9yZ0RvbWFpbigpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAkJC56b29tLnNjYWxlID0gZnVuY3Rpb24gKHNjYWxlKSB7XG4gICAgICAgICAgICByZXR1cm4gY29uZmlnLmF4aXNfcm90YXRlZCA/IHRoaXMueShzY2FsZSkgOiB0aGlzLngoc2NhbGUpO1xuICAgICAgICB9O1xuICAgICAgICAkJC56b29tLm9yZ1NjYWxlRXh0ZW50ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGV4dGVudCA9IGNvbmZpZy56b29tX2V4dGVudCA/IGNvbmZpZy56b29tX2V4dGVudCA6IFsxLCAxMF07XG4gICAgICAgICAgICByZXR1cm4gW2V4dGVudFswXSwgTWF0aC5tYXgoJCQuZ2V0TWF4RGF0YUNvdW50KCkgLyBleHRlbnRbMV0sIGV4dGVudFsxXSldO1xuICAgICAgICB9O1xuICAgICAgICAkJC56b29tLnVwZGF0ZVNjYWxlRXh0ZW50ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHJhdGlvID0gZGlmZkRvbWFpbigkJC54Lm9yZ0RvbWFpbigpKSAvIGRpZmZEb21haW4oJCQuZ2V0Wm9vbURvbWFpbigpKSxcbiAgICAgICAgICAgICAgICBleHRlbnQgPSB0aGlzLm9yZ1NjYWxlRXh0ZW50KCk7XG4gICAgICAgICAgICB0aGlzLnNjYWxlRXh0ZW50KFtleHRlbnRbMF0gKiByYXRpbywgZXh0ZW50WzFdICogcmF0aW9dKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0Wm9vbURvbWFpbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCBkMyA9ICQkLmQzLFxuICAgICAgICAgICAgbWluID0gZDMubWluKFskJC5vcmdYRG9tYWluWzBdLCBjb25maWcuem9vbV94X21pbl0pLFxuICAgICAgICAgICAgbWF4ID0gZDMubWF4KFskJC5vcmdYRG9tYWluWzFdLCBjb25maWcuem9vbV94X21heF0pO1xuICAgICAgICByZXR1cm4gW21pbiwgbWF4XTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnVwZGF0ZVpvb20gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIHogPSAkJC5jb25maWcuem9vbV9lbmFibGVkID8gJCQuem9vbSA6IGZ1bmN0aW9uICgpIHt9O1xuICAgICAgICAkJC5tYWluLnNlbGVjdCgnLicgKyBDTEFTUy56b29tUmVjdCkuY2FsbCh6KS5vbihcImRibGNsaWNrLnpvb21cIiwgbnVsbCk7XG4gICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLmV2ZW50UmVjdCkuY2FsbCh6KS5vbihcImRibGNsaWNrLnpvb21cIiwgbnVsbCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5yZWRyYXdGb3Jab29tID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBkMyA9ICQkLmQzLCBjb25maWcgPSAkJC5jb25maWcsIHpvb20gPSAkJC56b29tLCB4ID0gJCQueDtcbiAgICAgICAgaWYgKCFjb25maWcuem9vbV9lbmFibGVkKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCQkLmZpbHRlclRhcmdldHNUb1Nob3coJCQuZGF0YS50YXJnZXRzKS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZDMuZXZlbnQuc291cmNlRXZlbnQudHlwZSA9PT0gJ21vdXNlbW92ZScgJiYgem9vbS5hbHREb21haW4pIHtcbiAgICAgICAgICAgIHguZG9tYWluKHpvb20uYWx0RG9tYWluKTtcbiAgICAgICAgICAgIHpvb20uc2NhbGUoeCkudXBkYXRlU2NhbGVFeHRlbnQoKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoJCQuaXNDYXRlZ29yaXplZCgpICYmIHgub3JnRG9tYWluKClbMF0gPT09ICQkLm9yZ1hEb21haW5bMF0pIHtcbiAgICAgICAgICAgIHguZG9tYWluKFskJC5vcmdYRG9tYWluWzBdIC0gMWUtMTAsIHgub3JnRG9tYWluKClbMV1dKTtcbiAgICAgICAgfVxuICAgICAgICAkJC5yZWRyYXcoe1xuICAgICAgICAgICAgd2l0aFRyYW5zaXRpb246IGZhbHNlLFxuICAgICAgICAgICAgd2l0aFk6IGNvbmZpZy56b29tX3Jlc2NhbGUsXG4gICAgICAgICAgICB3aXRoU3ViY2hhcnQ6IGZhbHNlLFxuICAgICAgICAgICAgd2l0aEV2ZW50UmVjdDogZmFsc2UsXG4gICAgICAgICAgICB3aXRoRGltZW5zaW9uOiBmYWxzZVxuICAgICAgICB9KTtcbiAgICAgICAgaWYgKGQzLmV2ZW50LnNvdXJjZUV2ZW50LnR5cGUgPT09ICdtb3VzZW1vdmUnKSB7XG4gICAgICAgICAgICAkJC5jYW5jZWxDbGljayA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgY29uZmlnLnpvb21fb256b29tLmNhbGwoJCQuYXBpLCB4Lm9yZ0RvbWFp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bnMpO1xuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uem9vbSA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbDtcbiAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgZG9tYWluID0gZG9tYWluLm1hcChmdW5jdGlvbiAoeCkgeyByZXR1cm4gJCQucGFyc2VEYXRlKHgpOyB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICQkLmJydXNoLmV4dGVudChkb21haW4pO1xuICAgICAgICAgICAgJCQucmVkcmF3KHt3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZSwgd2l0aFk6ICQkLmNvbmZpZy56b29tX3Jlc2NhbGV9KTtcbiAgICAgICAgICAgICQkLmNvbmZpZy56b29tX29uem9vbS5jYWxsKHRoaXMsICQkLngub3JnRG9tYWluKCkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAkJC5icnVzaC5leHRlbnQoKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuLnpvb20uZW5hYmxlID0gZnVuY3Rpb24gKGVuYWJsZWQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbDtcbiAgICAgICAgJCQuY29uZmlnLnpvb21fZW5hYmxlZCA9IGVuYWJsZWQ7XG4gICAgICAgICQkLnVwZGF0ZUFuZFJlZHJhdygpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4udW56b29tID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsO1xuICAgICAgICAkJC5icnVzaC5jbGVhcigpLnVwZGF0ZSgpO1xuICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVYRG9tYWluOiB0cnVlfSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLnpvb20ubWF4ID0gZnVuY3Rpb24gKG1heCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDM7XG4gICAgICAgIGlmIChtYXggPT09IDAgfHwgbWF4KSB7XG4gICAgICAgICAgICBjb25maWcuem9vbV94X21heCA9IGQzLm1heChbJCQub3JnWERvbWFpblsxXSwgbWF4XSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gY29uZmlnLnpvb21feF9tYXg7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uem9vbS5taW4gPSBmdW5jdGlvbiAobWluKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMztcbiAgICAgICAgaWYgKG1pbiA9PT0gMCB8fCBtaW4pIHtcbiAgICAgICAgICAgIGNvbmZpZy56b29tX3hfbWluID0gZDMubWluKFskJC5vcmdYRG9tYWluWzBdLCBtaW5dKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuem9vbV94X21pbjtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi56b29tLnJhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAoaXNEZWZpbmVkKHJhbmdlLm1heCkpIHsgdGhpcy5kb21haW4ubWF4KHJhbmdlLm1heCk7IH1cbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQocmFuZ2UubWluKSkgeyB0aGlzLmRvbWFpbi5taW4ocmFuZ2UubWluKTsgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBtYXg6IHRoaX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ZXhpc3RzXG4gICAgICAgIGlmICgnYXhlcycgaW4gYXJncykge1xuICAgICAgICAgICAgT2JqZWN0LmtleXMoYXJncy5heGVzKS5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX2F4ZXNbaWRdID0gYXJncy5heGVzW2lkXTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIC8vIHVwZGF0ZSBjb2xvcnMgaWYgZXhpc3RzXG4gICAgICAgIGlmICgnY29sb3JzJyBpbiBhcmdzKSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhhcmdzLmNvbG9ycykuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9jb2xvcnNbaWRdID0gYXJncy5jb2xvcnNbaWRdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gdXNlIGNhY2hlIGlmIGV4aXN0c1xuICAgICAgICBpZiAoJ2NhY2hlSWRzJyBpbiBhcmdzICYmICQkLmhhc0NhY2hlcyhhcmdzLmNhY2hlSWRzKSkge1xuICAgICAgICAgICAgJCQubG9hZCgkJC5nZXRDYWNoZXMoYXJncy5jYWNoZUlkcyksIGFyZ3MuZG9uZSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgLy8gdW5sb2FkIGlmIG5lZWRlZFxuICAgICAgICBpZiAoJ3VubG9hZCcgaW4gYXJncykge1xuICAgICAgICAgICAgLy8gVE9ETzogZG8gbm90IHVubG9hZCBpZiB0YXJnZXQgd2lsbCBsb2FkIChpbmNsdWRlZCBpbiB1cmwvcm93cy9jb2x1bW5zKVxuICAgICAgICAgICAgJCQudW5sb2FkKCQkLm1hcFRvVGFyZ2V0SWRzKCh0eXBlb2YgYXJncy51bmxvYWQgPT09ICdib29sZWFuJyAmJiBhcmdzLnVubG9hZCkgPyBudWxsIDogYXJncy51bmx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1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IHRhcmdldHNbaV0udmFsdWVzLmxlbmd0aDtcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgbGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldHNbaV0udmFsdWVzW2pdLmluZGV4ID0gdGFpbCArIGo7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoISQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0c1tpXS52YWx1ZXNbal0ueCA9IHRhaWwgKyBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHQudmFsdWVzID0gdC52YWx1ZXMuY29uY2F0KHRhcmdldHNbaV0udmFsdWVzKTtcblxuICAgICAgICAgICAgICAgICAgICB0YXJnZXRzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFmb3VuZCkgeyBub3Rmb3VuZElkcy5wdXNoKHQuaWQpOyB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIEFwcGVuZCBudWxsIGZvciBub3QgZm91bmQgdGFyZ2V0c1xuICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgdmFyIGksIGo7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbm90Zm91bmRJZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodC5pZCA9PT0gbm90Zm91bmRJZHNbaV0pIHtcbiAgICAgICAgICAgICAgICAgICAgdGFpbCA9IHQudmFsdWVzW3QudmFsdWVzLmxlbmd0aCAtIDFdLmluZGV4ICsgMTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0LnZhbHVlcy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogdC5pZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogdGFpbCArIGosXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeDogJCQuaXNUaW1lU2VyaWVzKCkgPyAkJC5nZXRPdGhlclRhcmdldFgodGFpbCArIGopIDogdGFpbCArIGosXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IG51bGxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBHZW5lcmF0ZSBudWxsIHZhbHVlcyBmb3IgbmV3IHRhcmdldFxuICAgICAgICBpZiAoJCQuZGF0YS50YXJnZXRzLmxlbmd0aCkge1xuICAgICAgICAgICAgdGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgdmFyIGksIG1pc3NpbmcgPSBbXTtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzWzBdLmluZGV4OyBpIDwgdGFpbDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIG1pc3NpbmcucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogdC5pZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpLFxuICAgICAgICAgICAgICAgICAgICAgICAgeDogJCQuaXNUaW1lU2VyaWVzKCkgPyAkJC5nZXRPdGhlclRhcmdldFgoaSkgOiBpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IG51bGxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHQudmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgICAgICAgICAgdi5pbmRleCArPSB0YWlsO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2LnggKz0gdGFpbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHQudmFsdWVzID0gbWlzc2luZy5jb25jYXQodC52YWx1ZXMpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgJCQuZGF0YS50YXJnZXRzID0gJCQuZGF0YS50YXJnZXRzLmNvbmNhdCh0YXJnZXRzKTsgLy8gYWRkIHJlbWFpbmVkXG5cbiAgICAgICAgLy8gY2hlY2sgZGF0YSBjb3VudCBiZWNhdXNlIGJlaGF2aW9yIG5lZWRzIHRvIGNoYW5nZSB3aGVuIGl0J3Mgb25seSBvbmVcbiAgICAgICAgZGF0YUNvdW50ID0gJCQuZ2V0TWF4RGF0YUNvdW50KCk7XG4gICAgICAgIGJhc2VUYXJnZXQgPSAkJC5kYXRhLnRhcmdldHNbMF07XG4gICAgICAgIGJhc2VWYWx1ZSA9IGJhc2VUYXJnZXQudmFsdWVzWzBdO1xuXG4gICAgICAgIC8vIFVwZGF0ZSBsZW5ndGggdG8gZmxvdyBpZiBuZWVkZWRcbiAgICAgICAgaWYgKGlzRGVmaW5lZChhcmdzLnRvKSkge1xuICAgICAgICAgICAgbGVuZ3RoID0gMDtcbiAgICAgICAgICAgIHRvID0gJCQuaXNUaW1lU2VyaWVzKCkgPyAkJC5wYXJzZURhdGUoYXJncy50bykgOiBhcmdzLnRvO1xuICAgICAgICAgICAgYmFzZVRhcmdldC52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgIGlmICh2LnggPCB0bykgeyBsZW5ndGgrKzsgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSBpZiAoaXNEZWZpbmVkKGFyZ3MubGVuZ3RoKSkge1xuICAgICAgICAgICAgbGVuZ3RoID0gYXJncy5sZW5ndGg7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBJZiBvbmx5IG9uZSBkYXRhLCB1cGRhdGUgdGhlIGRvbWFpbiB0byBmbG93IGZyb20gbGVmdCBlZGdlIG9mIHRoZSBjaGFydFxuICAgICAgICBpZiAoIW9yZ0RhdGFDb3VudCkge1xuICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgaWYgKGJhc2VUYXJnZXQudmFsdWVzLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZGlmZiA9IGJhc2VUYXJnZXQudmFsdWVzW2Jhc2VUYXJnZXQudmFsdWVzLmxlbmd0aCAtIDFdLnggLSBiYXNlVmFsdWUueDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBkaWZmID0gYmFzZVZhbHVlLnggLSAkJC5nZXRYRG9tYWluKCQkLmRhdGEudGFyZ2V0cylbMF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBkaWZmID0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRvbWFpbiA9IFtiYXNlVmFsdWUueCAtIGRpZmYsIGJhc2VWYWx1ZS54XTtcbiAgICAgICAgICAgICQkLnVwZGF0ZVhEb21haW4obnVsbCwgdHJ1ZSwgdHJ1ZSwgZmFsc2UsIGRvbWFpbik7XG4gICAgICAgIH0gZWxzZSBpZiAob3JnRGF0YUNvdW50ID09PSAxKSB7XG4gICAgICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAg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cnVlLFxuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2VuZXJhdGVGbG93ID0gZnVuY3Rpb24gKGFyZ3MpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCBkMyA9ICQkLmQzO1xuXG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgdGFyZ2V0cyA9IGFyZ3MudGFyZ2V0cyxcbiAgICAgICAgICAgICAgICBmbG93ID0gYXJncy5mbG93LFxuICAgICAgICAgICAgICAgIGRyYXdCYXIgPSBhcmdzLmRyYXdCYXIsXG4gICAgICAgICAgICAgICAgZHJhd0xpbmUgPSBhcmdzLmRyYXdMaW5lLFxuICAgICAgICAgICAgICAgIGRyYXdBcmVhID0gYXJncy5kcmF3QXJlYSxcbiAgICAgICAgICAgICAgICBjeCA9IGFyZ3MuY3gsXG4gICAgICAgICAgICAgICAgY3kgPSBhcmdzLmN5LFxuICAgICAgICAgICAgICAgIHh2ID0gYXJncy54dixcbiAgICAgICAgICAgICAgICB4Rm9yVGV4dCA9IGFyZ3MueEZvclRleHQsXG4gICAgICAgICAgICAgICAgeUZvclRleHQgPSBhcmdzLnlGb3JUZXh0LFxuICAgICAgICAgICAgICAgIGR1cmF0aW9uID0gYXJncy5kdXJhdGlvbjtcblxuICAgICAgICAgICAgdmFyIHRyYW5zbGF0ZVgsIHNjYWxlWCA9IDEsIHRyYW5zZm9ybSxcbiAgICAgICAgICAgICAgICBmbG93SW5kZXggPSBmbG93LmluZGV4LFxuICAgICAgICAgICAgICAgIGZsb3dMZW5ndGggPSBmbG93Lmxlbmd0aCxcbiAgICAgICAgICAgICAgICBmbG93U3RhcnQgPSAkJC5nZXRWYWx1ZU9uSW5kZXgoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcywgZmxvd0luZGV4KSxcbiAgICAgICAgICAgICAgICBmbG93RW5kID0gJCQuZ2V0VmFsdWVPbkluZGV4KCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMsIGZsb3dJbmRleCArIGZsb3dMZW5ndGgpLFxuICAgICAgICAgICAgICAgIG9yZ0RvbWFpbiA9ICQkLnguZG9tYWluKCksIGRvbWFpbixcbiAgICAgICAgICAgICAgICBkdXJhdGlvbkZvckZsb3cgPSBmbG93LmR1cmF0aW9uIHx8IGR1cmF0aW9uLFxuICAgICAgICAgICAgICAgIGRvbmUgPSBmbG93LmRvbmUgfHwgZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICAgICAgd2FpdCA9ICQkLmdlbmVyYXRlV2FpdCgpO1xuXG4gICAgICAgICAgICB2YXIgeGdyaWQgPSAkJC54Z3JpZCB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIHhncmlkTGluZXMgPSAkJC54Z3JpZExpbmVzIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpblJlZ2lvbiA9ICQkLm1haW5SZWdpb24gfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluVGV4dCA9ICQkLm1haW5UZXh0IHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpbkJhciA9ICQkLm1haW5CYXIgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluTGluZSA9ICQkLm1haW5MaW5lIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpbkFyZWEgPSAkJC5tYWluQXJlYSB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5DaXJjbGUgPSAkJC5tYWluQ2lyY2xlIHx8IGQzLnNlbGVjdEFsbChbXSk7XG5cbiAgICAgICAgICAgIC8vIHNldCBmbGFnXG4gICAgICAgICAgICAkJC5mbG93aW5nID0gdHJ1ZTtcblxuICAgICAgICAgICAg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F0YS50YXJnZXRzWzBdLnZhbHVlcywgJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcy5sZW5ndGggLSAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAkJC54KGZsb3dTdGFydC54KSAtICQkLngoZmxvd0VuZC54KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSBkaWZmRG9tYWluKGRvbWFpbikgLyAyO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChmbG93Lm9yZ0RhdGFDb3VudCA9PT0gMSB8fCAoZmxvd1N0YXJ0ICYmIGZsb3dTdGFydC54KSA9PT0gKGZsb3dFbmQgJiYgZmxvd0VuZC54KSkge1xuICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAkJC54KG9yZ0RvbWFpblswXSkgLSAkJC54KGRvbWFpblswXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gKCQkLngob3JnRG9tYWluWzBdKSAtICQkLngoZG9tYWluWzBdKSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICgkJC54KGZsb3dTdGFydC54KSAtICQkLngoZmxvd0VuZC54KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2NhbGVYID0gKGRpZmZEb21haW4ob3JnRG9tYWluKSAvIGRpZmZEb21haW4oZG9tYWluKSk7XG4gICAgICAgICAgICB0cmFuc2Zvcm0gPSAndHJhbnNsYXRlKCcgKyB0cmFuc2xhdGVYICsgJywwKSBzY2FsZSgnICsgc2NhbGVYICsgJywxKSc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IHRyYW5zZm9ybSkpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYWxsKHdhaXQsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgaSwgc2hhcGVzID0gW10sIHRleHRzID0gW10sIGV2ZW50UmVjdHMgPSBbXTtcblxuICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBmbG93ZWQgZWxlbWVudHNcbiAgICAgICAgICAgICAgICBpZiAoZmxvd0xlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZmxvd0xlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzaGFwZXMucHVzaCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIChmbG93SW5kZXggKyBpKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0cy5wdXNoKCcuJyArIENMQVNTLnRleHQgKyAnLScgKyAoZmxvd0luZGV4ICsgaSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRSZWN0cy5wdXNoKCcuJyArIENMQVNTLmV2ZW50UmVjdCArICctJyArIChmbG93SW5kZXggKyBpKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZXMpLnNlbGVjdEFsbChzaGFwZXMpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLnRleHRzKS5zZWxlY3RBbGwodGV4dHMpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLmV2ZW50UmVjdHMpLnNlbGVjdEFsbChldmVudFJlY3RzKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy54Z3JpZCkucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gZHJhdyBhZ2FpbiBmb3IgcmVtb3ZpbmcgZmxvd2VkIGVsZW1lbnRzIGFuZCByZXZlcnRpbmcgYXR0clxuICAgICAgICAgICAgICAgIHhncmlkXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigkJC54Z3JpZEF0dHIpO1xuICAgICAgICAgICAgICAgIHhncmlkTGluZXNcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpO1xuICAgICAgICAgICAgICAgIHhncmlkTGluZXMuc2VsZWN0KCdsaW5lJylcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IHh2KVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcIngyXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC53aWR0aCA6IHh2KTtcbiAgICAgICAgICAgICAgICB4Z3JpZExpbmVzLnNlbGVjdCgndGV4dCcpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieFwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiAwKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcInlcIiwgeHYpO1xuICAgICAgICAgICAgICAgIG1haW5CYXJcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCBkcmF3QmFyKTtcbiAgICAgICAgICAgICAgICBtYWluTGluZVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsIGRyYXdMaW5lKTtcbiAgICAgICAgICAgICAgICBtYWluQXJlYVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsIGRyYXdBcmVhKTtcbiAgICAgICAgICAgICAgICBtYWluQ2lyY2xlXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImN4XCIsIGN4KVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImN5XCIsIGN5KTtcbiAgICAgICAgICAgICAgICBtYWluVGV4dFxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCB4Rm9yVGV4dClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCB5Rm9yVGV4dClcbiAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsLW9wYWNpdHknLCAkJC5vcGFjaXR5Rm9yVGV4dC5iaW5kKCQkKSk7XG4gICAgICAgICAgICAgICAgbWFpblJlZ2lvblxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbCk7XG4gICAgICAgICAgICAgICAgbWFpblJlZ2lvbi5zZWxlY3QoJ3JlY3QnKS5maWx0ZXIoJCQuaXNSZWdpb25PblgpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieFwiLCAkJC5yZWdpb25YLmJpbmQoJCQpKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcIndpZHRoXCIsICQkLnJlZ2lvbldpZHRoLmJpbmQoJCQpKTtcblxuICAgICAgICAgICAgICAgIGlmIChjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdFdmVudFJlY3QoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBjY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uU0VMRUNURUQpO1xuICAgICAgICAgICAgLy8gbGluZS9hcmVhIHNlbGVjdGlvbiBub3Qgc3VwcG9ydGVkIHlldFxuICAgICAgICAgICAgaWYgKHNoYXBlLmNsYXNzZWQoQ0xBU1MubGluZSkgfHwgc2hhcGUuY2xhc3NlZChDTEFTUy5hcmVhKSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1RhcmdldElkICYmIGlzVGFyZ2V0SW5kZXgpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2lzc2VsZWN0YWJsZShkKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNTZWxlY3RlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdG9nZ2xlKGZhbHNlLCBzaGFwZS5jbGFzc2VkKENMQVNTLlNFTEVDVEVELCBmYWxzZSksIGQsIGkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4udHJhbnNmb3JtID0gZnVuY3Rpb24gKHR5cGUsIHRhcmdldElkcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLFxuICAgICAgICAgICAgb3B0aW9ucyA9IFsncGllJywgJ2RvbnV0J10uaW5kZXhPZih0eXBlKSA+PSAwID8ge3dpdGhUcmFuc2Zvcm06IHRydWV9IDogbnVsbDtcbiAgICAgICAgJCQudHJhbnNmb3JtVG8odGFyZ2V0SWRzLCB0eXBlLCBvcHRpb25zKTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udHJhbnNmb3JtVG8gPSBmdW5jdGlvbiAodGFyZ2V0SWRzLCB0eXBlLCBvcHRpb25zRm9yUmVkcmF3KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICA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AkJC5kYXRhLnhzO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi5heGlzID0gZnVuY3Rpb24gKCkge307XG4gICAgYzNfY2hhcnRfZm4uYXhpcy5sYWJlbHMgPSBmdW5jdGlvbiAobGFiZWxzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWw7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhsYWJlbHMpLmZvckVhY2goZnVuY3Rpb24gKGF4aXNJZCkge1xuICAgICAgICAgICAgICAgICQkLmF4aXMuc2V0TGFiZWxUZXh0KGF4aXNJZCwgbGFiZWxzW2F4aXNJZF0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAkJC5heGlzLnVwZGF0ZUxhYmVscygpO1xuICAgICAgICB9XG4gICAgICAgIC8vIFRPRE86IHJldHVybiBzb21lIHZhbHVlcz9cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuLmF4aXMubWF4ID0gZnVuY3Rpb24gKG1heCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIG1heCA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtYXgueCkpIHsgY29uZmlnLmF4aXNfeF9tYXggPSBtYXgueDsgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1heC55KSkgeyBjb25maWcuYXhpc195X21heCA9IG1heC55OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWF4LnkyKSkgeyBjb25maWcuYXhpc195Ml9tYXggPSBtYXgueTI7IH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeV9tYXggPSBjb25maWcuYXhpc195Ml9tYXggPSBtYXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLCB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZX0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB4OiBjb25maWcuYXhpc194X21heCxcbiAgICAgICAgICAgICAgICB5OiBjb25maWcuYXhpc195X21heCxcbiAgICAgICAgICAgICAgICB5MjogY29uZmlnLmF4aXNfeTJfbWF4XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi5heGlzLm1pbiA9IGZ1bmN0aW9uIChtaW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW4gPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWluLngpKSB7IGNvbmZpZy5heGlzX3hfbWluID0gbWluLng7IH1cbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtaW4ueSkpIHsgY29uZmlnLmF4aXNfeV9taW4gPSBtaW4ueTsgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1pbi55MikpIHsgY29uZmlnLmF4aXNfeTJfbWluID0gbWluLnkyOyB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3lfbWluID0gY29uZmlnLmF4aXNfeTJfbWluID0gbWluO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgJCQucmVkcmF3KHt3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSwgd2l0aFVwZGF0ZVhEb21haW46IHRydWV9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgeDogY29uZmlnLmF4aXNfeF9taW4sXG4gICAgICAgICAgICAgICAgeTogY29uZmlnLmF4aXNfeV9taW4sXG4gICAgICAgICAgICAgICAgeTI6IGNvbmZpZy5heGlzX3kyX21pblxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uYXhpcy5yYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkge1xuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyYW5nZS5tYXgpKSB7IHRoaXMuYXhpcy5tYXgocmFuZ2UubWF4KTsgfVxuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyYW5nZS5taW4pKSB7IHRoaXMuYXhpcy5taW4ocmFuZ2UubWluKTsgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBtYXg6IHRoaXMuYXhpcy5tYXgoKSxcbiAgICAgICAgICAgICAgICBtaW46IHRoaXMuYXhpcy5taW4oKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi5sZWdlbmQgPSBmdW5jdGlvbiAoKSB7fTtcbiAgICBjM19jaGFydF9mbi5sZWdlbmQuc2hvdyA9IGZ1bmN0aW9uICh0YXJnZXRJZHMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbDtcbiAgICAgICAgJCQuc2hvd0xlZ2VuZCgkJC5tYXBUb1RhcmdldElkcyh0YXJnZXRJZHMpKTtcbiAgICAgICAgJCQudXBkYXRlQW5kUmVkcmF3KHt3aXRoTGVnZW5kOiB0cnVlfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi5sZWdlbmQuaGlkZSA9IGZ1bmN0aW9uICh0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IG51bGw7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLnRvb2x0aXAgPSBmdW5jdGlvbiAoKSB7fTtcbiAgICBjM19jaGFydF9mbi50b29sdGlwLnNob3cgPSBmdW5jdGlvbiAoYXJncykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBpbmRleCwgbW91c2U7XG5cbiAgICAgICAgLy8gZGV0ZXJtaW5lIG1vdXNlIHBvc2l0aW9uIG9uIHRoZSBjaGFydFxuICAgICAgICBpZiAoYXJncy5tb3VzZSkge1xuICAgICAgICAgICAgbW91c2UgPSBhcmdzLm1vdXNlO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gZGV0ZXJtaW5lIGZvY3VzIGRhdGFcbiAgICAgICAgaWYgKGFyZ3MuZGF0YSkge1xuICAgICAgICAgICAgaWYgKCQkLmlzTXVsdGlwbGVYKCkpIHtcbiAgICAgICAgICAgICAgICAvLyBpZiBtdWx0aXBsZSB4cywgdGFyZ2V0IHBvaW50IHdpbGwgYmUgZGV0ZXJtaW5lZCBieSBtb3VzZVxuICAgICAgICAgICAgICAgIG1vdXNlID0gWyQkLngoYXJncy5kYXRhLngpLCAkJC5nZXRZU2NhbGUoYXJncy5kYXRhLmlkKShhcmdzLmRhdGEudmFsdWUpXTtcbiAgICAgICAgICAgICAgICBpbmRleCA9IG51bGw7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIFRPRE86IHdoZW4gdG9vbHRpcF9ncm91cGVkID0gZmFsc2VcbiAgICAgICAgICAgICAgICBpbmRleCA9IGlzVmFsdWUoYXJncy5kYXRhLmluZGV4KSA/IGFyZ3MuZGF0YS5pbmRleCA6ICQkLmdldEluZGV4QnlYKGFyZ3MuZGF0YS54KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgYXJncy54ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaW5kZX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N0YXJ0LCBzdG9wIF0gOiBbIHN0b3AsIHN0YXJ0IF07XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gZ2VuZXJhdGVUaWNrcyhzY2FsZSkge1xuICAgICAgICAgICAgdmFyIGksIGRvbWFpbiwgdGlja3MgPSBbXTtcbiAgICAgICAgICAgIGlmIChzY2FsZS50aWNrcykge1xuICAgICAgICAgICAgICAgIHJldHVybiBzY2FsZS50aWNrcy5hcHBseShzY2FsZSwgdGlja0FyZ3VtZW50cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkb21haW4gPSBzY2FsZS5kb21haW4oKTtcbiAgICAgICAgICAgIGZvciAoaSA9IE1hdGguY2VpbChkb21haW5bMF0pOyBpIDwgZG9tYWluWzFdOyBpKyspIHtcbiAgICAgICAgICAgICAgICB0aWNrcy5wdXNoKGkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRpY2tzLmxlbmd0aCA+IDAgJiYgdGlja3NbMF0gPiAwKSB7XG4gICAgICAgICAgICAgICAgdGlja3MudW5zaGlmdCh0aWNrc1swXSAtICh0aWNrc1sxXSAtIHRpY2tzWzBdKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGlja3M7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gY29weVNjYWxlKCkge1xuICAgICAgICAgICAgdmFyIG5ld1NjYWxlID0gc2NhbGUuY29weSgpLCBkb21haW47XG4gICAgICAgICAgICBpZiAocGFyYW1zLmlzQ2F0ZWdvcnkpIHtcbiAgICAgICAgICAgICAgICBkb21haW4gPSBzY2FsZS5kb21haW4oKTtcbiAgICAgICAgICAgICAgICBuZXdTY2FsZS5kb21haW4oW2RvbWFpblswXSwgZG9tYWluWzFdIC0gMV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIG5ld1NjYWxlO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIHRleHRGb3JtYXR0ZWQodikge1xuICAgICAgICAgICAgdmFyIGZvcm1hdHRlZCA9IHRpY2tGb3JtYXQgPyB0aWNrRm9ybWF0KHYpIDogdjtcbiAgICAgICAgICAgIHJldHVybiB0eXBlb2YgZm9ybWF0dGVkICE9PSAndW5kZWZpbmVkJyA/IGZvcm1hdHRlZCA6ICcnO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGdldFNpemVGb3IxQ2hhcih0aWNrKSB7XG4gICAgICAgICAgICBpZiAodGlja1RleHRDaGFyU2l6ZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aWNrVGV4dENoYXJTaXplO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHNpemUgPSB7XG4gICAgICAgICAgICAgICAgaDogMTEuNSxcbiAgICAgICAgICAgICAgICB3OiA1LjVcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB0aWNrLnNlbGVjdCgndGV4dCcpLnRleHQodGV4dEZvcm1hdHRlZCkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciBib3ggPSB0aGlzLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLFxuICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gdGV4dEZvcm1hdHRlZChkKSxcbiAgICAgICAgICAgICAgICAgICAgaCA9IGJveC5oZWlnaHQsXG4gICAgICAgICAgICAgICAgICAgIHcgPSB0ZXh0ID8gKGJveC53aWR0aCAvIHRleHQubGVuZ3RoKSA6IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBpZiAoaCAmJiB3KSB7XG4gICAgICAgICAgICAgICAgICAgIHNpemUuaCA9IGg7XG4gICAgICAgICAgICAgICAgICAgIHNpemUudyA9IHc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSkudGV4dCgnJyk7XG4gICAgICAgICAgICB0aWNrVGV4dENoYXJTaXplID0gc2l6ZTtcbiAgICAgICAgICAgIHJldHVybiBzaXplO1xuICAgICA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ZXhpdCgpLnJlbW92ZSgpLFxuICAgICAgICAgICAgICAgICAgICB0aWNrVXBkYXRlID0gdHJhbnNpdGlvbmlzZSh0aWNrKS5zdHlsZShcIm9wYWNpdHlcIiwgMSksXG4gICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0sIHRpY2tYLCB0aWNrWTtcblxuICAgICAgICAgICAgICAgIHZhciByYW5nZSA9IHNjYWxlLnJhbmdlRXh0ZW50ID8gc2NhbGUucmFuZ2VFeHRlbnQoKSA6IHNjYWxlRXh0ZW50KHNjYWxlLnJhbmdlKCkpLFxuICAgICAgICAgICAgICAgICAgICBwYXRoID0gZy5zZWxlY3RBbGwoXCIuZG9tYWluXCIpLmRhdGEoWyAwIF0pLFxuICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlID0gKHBhdGguZW50ZXIoKS5hcHBlbmQoXCJwYXRoXCIpLmF0dHIoXCJjbGFzc1wiLCBcImRvbWFpblwiKSwgdHJhbnNpdGlvbmlzZShwYXRoKSk7XG4gICAgICAgICAgICAgICAgdGlja0VudGVyLmFwcGVuZChcImxpbmVcIik7XG4gICAgICAgICAgICAgICAgdGlja0VudGVyLmFwcGVuZChcInRleHRcIik7XG5cbiAgICAgICAgICAgICAgICB2YXIgbGluZUVudGVyID0gdGlja0VudGVyLnNlbGVjdChcImxpbmVcIiksXG4gICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUgPSB0aWNrVXBkYXRlLnNlbGVjdChcImxpbmVcIiksXG4gICAgICAgICAgICAgICAgICAgIHRleHRFbnRlciA9IHRpY2tFbnRlci5zZWxlY3QoXCJ0ZXh0XCIpLFxuICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlID0gdGlja1VwZGF0ZS5zZWxlY3QoXCJ0ZXh0XCIpO1xuXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5pc0NhdGVnb3J5KSB7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tPZmZzZXQgPSBNYXRoLmNlaWwoKHNjYWxlMSgxKSAtIHNjYWxlMSgwKSkgLyAyKTtcbiAgICAgICAgICAgICAgICAgICAgdGlja1ggPSB0aWNrQ2VudGVyZWQgPyAwIDogdGlja09mZnNldDtcbiAgICAgICAgICAgICAgICAgICAgdGlja1kgPSB0aWNrQ2VudGVyZWQgPyB0aWNrT2Zmc2V0IDogMDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aWNrT2Zmc2V0ID0gdGlja1ggPSAwO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciB0ZXh0LCB0c3Bhbiwgc2l6ZUZvcjFDaGFyID0gZ2V0U2l6ZUZvcjFDaGFyKGcuc2VsZWN0KCcudGljaycpKSwgY291bnRzID0gW107XG4gICAgICAgICAgICAgICAgdmFyIHRpY2tMZW5ndGggPSBNYXRoLm1heChpbm5lclRpY2tTaXplLCAwKSArIHRpY2tQYWRkaW5nLFxuICAgICAgICAgICAgICAgICAgICBpc1ZlcnRpY2FsID0gb3JpZW50ID09PSAnbGVmdCcgfHwgb3JpZW50ID09PSAncmlnaHQnO1xuXG4gICAgICAgICAgICAgICAgLy8gdGhpcyBzaG91bGQgYmUgY2FsbGVkIG9ubHkgd2hlbiBjYXRlZ29yeSBheGlzXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc3BsaXRUaWNrVGV4dChkLCBtYXhXaWR0aCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdGlja1RleHQgPSB0ZXh0Rm9ybWF0dGVkKGQpLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VidGV4dCwgc3BhY2VJbmRleCwgdGV4dFdpZHRoLCBzcGxpdHRlZCA9IFtdO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwodGlja1RleHQpID09PSBcIltvYmplY3QgQXJyYXldXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWNrVGV4dDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICghbWF4V2lkdGggfHwgbWF4V2lkdGggPD0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF4V2lkdGggPSBpc1ZlcnRpY2FsID8gOTUgOiBwYXJhbXMuaXNDYXRlZ29yeSA/IChNYXRoLmNlaWwoc2NhbGUxKHRpY2tzWzFdKSAtIHNjYWxlMSh0aWNrc1swXSkpIC0gMTIpIDogMTEwO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc3BsaXQoc3BsaXR0ZWQsIHRleHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlSW5kZXggPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IHRleHQubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGV4dC5jaGFyQXQoaSkgPT09ICcgJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGFjZUluZGV4ID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidGV4dCA9IHRleHQuc3Vic3RyKDAsIGkgKyAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0V2lkdGggPSBzaXplRm9yMUNoYXIudyAqIHN1YnRleHQubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIHRleHQgd2lkdGggZ2V0cyBvdmVyIHRpY2sgd2lkdGgsIHNwbGl0IGJ5IHNwYWNlIGluZGV4IG9yIGNycmVudCBpbmRleFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXhXaWR0aCA8IHRleHRXaWR0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGxpdHRlZC5jb25jYXQodGV4dC5zdWJzdHIoMCwgc3BhY2VJbmRleCA/IHNwYWNlSW5kZXggOiBpKSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LnNsaWNlKHNwYWNlSW5kZXggPyBzcGFjZUluZGV4ICsgMSA6IGkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwbGl0dGVkLmNvbmNhdCh0ZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdChzcGxpdHRlZCwgdGlja1RleHQgKyBcIlwiKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB0c3BhbkR5KGQsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGR5ID0gc2l6ZUZvcjFDaGFyLmg7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3JpZW50ID09PSAnbGVmdCcgfHwgb3JpZW50ID09PSAncmlnaHQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZHkgPSAtKChjb3VudHNbZC5pbmRleF0gLSAxKSAqIChzaXplRm9yMUNoYXIuaCAvIDIpIC0gMyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR5ID0gXCIuNzFlbVwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkeTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB0aWNrU2l6ZShkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0aWNrUG9zaXRpb24gPSBzY2FsZShkKSArICh0aWNrQ2VudGVyZWQgPyAwIDogdGlja09mZnNldCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByYW5nZVswXSA8IHRpY2tQb3NpdGlvbiAmJiB0aWNrUG9zaXRpb24gPCByYW5nZVsxXSA/IGlubmVyVGlja1NpemUgOiAwO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRleHQgPSB0aWNrLnNlbGVjdChcInRleHRcIik7XG4gICAgICAgICAgICAgICAgdHNwYW4gPSB0ZXh0LnNlbGVjdEFsbCgndHNwYW4nKVxuICAgICAgICAgICAgICAgICAgICAuZGF0YShmdW5jdGlvbiAoZCwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNwbGl0dGVkID0gcGFyYW1zLnRpY2tNdWx0aWxpbmUgPyBzcGxpdFRpY2tUZXh0KGQsIHBhcmFtcy50aWNrV2lkdGgpIDogW10uY29uY2F0KHRleHRGb3JtYXR0ZWQoZCkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY291bnRzW2ldID0gc3BsaXR0ZWQubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwbGl0dGVkLm1hcChmdW5jdGlvbiAocykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7IGluZGV4OiBpLCBzcGxpdHRlZDogcyB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHRzcGFuLmVudGVyKCkuYXBwZW5kKCd0c3BhbicpO1xuICAgICAgICAgICAgICAgIHRzcGFuLmV4aXQoKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICB0c3Bhbi50ZXh0KGZ1bmN0aW9uIChkKSB7IHJldHVybiBkLnNwbGl0dGVkOyB9KTtcblxuICAgICAgICAgICAgICAgIHZhciByb3RhdGUgPSBwYXJhbXMudGlja1RleHRSb3RhdGU7XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB0ZXh0QW5jaG9yRm9yVGV4dChyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnbWlkZGxlJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm90YXRlID4gMCA/IFwic3RhcnRcIiA6IFwiZW5kXCI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRleHRUcmFuc2Zvcm0ocm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwicm90YXRlKFwiICsgcm90YXRlICsgXCIpXCI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGR4Rm9yVGV4dChyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA4ICogTWF0aC5zaW4oTWF0aC5QSSAqIChyb3RhdGUgLyAxODApKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24geUZvclRleHQocm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGlja0xlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTEuNSAtIDIuNSAqIChyb3RhdGUgLyAxNSkgKiAocm90YXRlID4gMCA/IDEgOiAtMSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgc3dpdGNoIChvcmllbnQpIHtcbiAgICAgICAgICAgICAgICBjYXNlIFwiYm90dG9tXCI6XG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieTJcIiwgaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RW50ZXIuYXR0cihcInlcIiwgdGlja0xlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVXBkYXRlLmF0dHIoXCJ4MVwiLCB0aWNrWCkuYXR0cihcIngyXCIsIHRpY2tYKS5hdHRyKFwieTJcIiwgdGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFVwZGF0ZS5hdHRyKFwieFwiLCAwKS5hdHRyKFwieVwiLCB5Rm9yVGV4dChyb3RhdGUpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZShcInRleHQtYW5jaG9yXCIsIHRleHRBbmNob3JGb3JUZXh0KHJvdGF0ZSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgdGV4dFRyYW5zZm9ybShyb3RhdGUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCAwKS5hdHRyKFwiZHlcIiwgdHNwYW5EeSkuYXR0cignZHgnLCBkeEZvclRleHQocm90YXRlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgcmFuZ2VbMF0gKyBcIixcIiArIG91dGVyVGlja1NpemUgKyBcIlYwSFwiICsgcmFuZ2VbMV0gKyBcIlZcIiArIG91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXNlIFwidG9wXCI6XG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IHJvdGF0ZWQgdGljayB0ZXh0XG4gICAgICAgICAgICAgICAgICAgICAgICB0aWNrVHJhbnNmb3JtID0gYXhpc1g7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lRW50ZXIuYXR0cihcInkyXCIsIC1pbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieVwiLCAtdGlja0xlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVXBkYXRlLmF0dHIoXCJ4MlwiLCAwKS5hdHRyKFwieTJcIiwgLWlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFVwZGF0ZS5hdHRyKFwieFwiLCAwKS5hdHRyKFwieVwiLCAtdGlja0xlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LnN0eWxlKFwidGV4dC1hbmNob3JcIiwgXCJtaWRkbGVcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICB0c3Bhbi5hdHRyKCd4JywgMCkuYXR0cihcImR5XCIsIFwiMGVtXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKFwiZFwiLCBcIk1cIiArIHJhbmdlWzBdICsgXCIsXCIgKyAtb3V0ZXJUaWNrU2l6ZSArIFwiVjBIXCIgKyByYW5nZVsxXSArIFwiVlwiICsgLW91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXNlIFwibGVmdFwiOlxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aWNrVHJhbnNmb3JtID0gYXhpc1k7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lRW50ZXIuYXR0cihcIngyXCIsIC1pbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieFwiLCAtdGlja0xlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVXBkYXRlLmF0dHIoXCJ4MlwiLCAtaW5uZXJUaWNrU2l6ZSkuYXR0cihcInkxXCIsIHRpY2tZKS5hdHRyKFwieTJcIiwgdGlja1kpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFVwZGF0ZS5hdHRyKFwieFwiLCAtdGlja0xlbmd0aCkuYXR0cihcInlcIiwgdGlja09mZnNldCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LnN0eWxlKFwidGV4dC1hbmNob3JcIiwgXCJlbmRcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICB0c3Bhbi5hdHRyKCd4JywgLXRpY2tMZW5ndGgpLmF0dHIoXCJkeVwiLCB0c3BhbkR5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cihcImRcIiwgXCJNXCIgKyAtb3V0ZXJUaWNrU2l6ZSArIFwiLFwiICsgcmFuZ2VbMF0gKyBcIkgwVlwiICsgcmFuZ2VbMV0gKyBcIkhcIiArIC1vdXRlclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2FzZSBcInJpZ2h0XCI6XG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieDJcIiwgaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RW50ZXIuYXR0cihcInhcIiwgdGlja0xlbmd0aCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVXBkYXRlLmF0dHIoXCJ4MlwiLCBpbm5lclRpY2tTaXplKS5hdHRyKFwieTJcIiwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIHRpY2tMZW5ndGgpLmF0dHIoXCJ5XCIsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC5zdHlsZShcInRleHQtYW5jaG9yXCIsIFwic3RhcnRcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICB0c3Bhbi5hdHRyKCd4JywgdGlja0xlbmd0aCkuYXR0cihcImR5XCIsIHRzcGFuRHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKFwiZFwiLCBcIk1cIiArIG91dGVyVGlja1NpemUgKyBcIixcIiArIHJhbmdlWzBdICsgXCJIMFZcIiArIHJhbmdlWzFdICsgXCJIXCIgKyBvdXRlclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChzY2FsZTEucmFuZ2VCYW5kKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4ID0gc2NhbGUxLCBkeCA9IHgucmFuZ2VCYW5kKCkgLyAyO1xuICAgICAgICAgICAgICAgICAgICBzY2FsZTAgPSBzY2FsZTEgPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHgoZCkgKyBkeDtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNjYWxlMC5yYW5nZUJhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgc2NhbGUwID0gc2NhbGUxO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tFeGl0LmNhbGwodGlja1RyYW5zZm9ybSwgc2NhbGUxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGlja0VudGVyLmNhbGwodGlja1RyYW5zZm9ybSwgc2NhbGUwKTtcbiAgICAgICAgICAgICAgICB0aWNrVXBkYXRlLmNhbGwodGlja1RyYW5zZm9ybSwgc2NhbGUxKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGF4aXMuc2NhbGUgPSBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiBzY2FsZTsgfVxuICAgICAgICAgICAgc2NhbGUgPSB4O1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMub3JpZW50ID0gZnVuY3Rpb24gKHgpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gb3JpZW50OyB9XG4gICAgICAgICAgICBvcmllbnQgPSB4IGluIHt0b3A6IDEsIHJpZ2h0OiAxLCBib3R0b206IDEsIGxlZnQ6IDF9ID8geCArIFwiXCIgOiBcImJvdHRvbVwiO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0Zvcm1hdCA9IGZ1bmN0aW9uIChmb3JtYXQpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja0Zvcm1hdDsgfVxuICAgICAgICAgICAgdGlja0Zvcm1hdCA9IGZvcm1hdDtcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tDZW50ZXJlZCA9IGZ1bmN0aW9uIChpc0NlbnRlcmVkKSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHRpY2tDZW50ZXJlZDsgfVxuICAgICAgICAgICAgdGlja0NlbnRlcmVkID0gaXNDZW50ZXJlZDtcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tPZmZzZXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGlja09mZnNldDtcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrSW50ZXJ2YWwgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgaW50ZXJ2YWwsIGxlbmd0aDtcbiAgICAgICAgICAgIGlmIChwYXJhbXMuaXNDYXRlZ29yeSkge1xuICAgICAgICAgICAgICAgIGludGVydmFsID0gdGlja09mZnNldCAqIDI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZW5ndGggPSBheGlzLmcuc2VsZWN0KCdwYXRoLmRvbWFpbicpLm5vZGUoKS5nZXRUb3RhbExlbmd0aCgpIC0gb3V0ZXJUaWNrU2l6ZSAqIDI7XG4gICAgICAgICAgICAgICAgaW50ZXJ2YWwgPSBsZW5ndGggLyBheGlzLmcuc2VsZWN0QWxsKCdsaW5lJykuc2l6ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGludGVydmFsID09PSBJbmZpbml0eSA/IDAgOiBpbnRlcnZhbDtcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrcyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja0FyZ3VtZW50czsgfVxuICAgICAgICAgICAgdGlja0FyZ3VtZW50cyA9IGFyZ3VtZW50cztcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tDdWxsaW5nID0gZnVuY3Rpb24gKGN1bGxpbmcpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja0N1bGxpbmc7IH1cbiAgICAgICAgICAgIHRpY2tDdWxsaW5nID0gY3VsbGluZztcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tWYWx1ZXMgPSBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB4ID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgdGlja1ZhbHVlcyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHgoc2NhbGUuZG9tYWluKCkpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHRpY2tWYWx1ZXM7IH1cbiAgICAgICAgICAgICAgICB0aWNrVmFsdWVzID0geDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gYXhpcztcbiAgICB9XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pc1NhZmFyaSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHVhID0gd2luZG93Lm5hdmlnYXRvci51c2VyQWdlbnQ7XG4gICAgICAgIHJldHVybiB1YS5pbmRleE9mKCdTYWZhcmknKSA+PSAwICYmIHVhLmluZGV4T2YoJ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R0cmlidXRlLlxuICAgICAgICAgICAgIHRoaXMuX3dyaXRlTGlzdFRvUGF0aCgpO1xuICAgICAgICAgICAgIHJldHVybiBuZXdJdGVtO1xuICAgICAgICAgfVxuXG4gICAgICAgICBTVkdQYXRoU2VnTGlzdC5fcGF0aFNlZ0FycmF5QXNTdHJpbmcgPSBmdW5jdGlvbihwYXRoU2VnQXJyYXkpIHtcbiAgICAgICAgICAgICB2YXIgc3RyaW5nID0gXCJcIjtcbiAgICAgICAgICAgICB2YXIgZmlyc3QgPSB0cnVlO1xuICAgICAgICAgICAgIHBhdGhTZWdBcnJheS5mb3JFYWNoKGZ1bmN0aW9uKHBhdGhTZWcpIHtcbiAgICAgICAgICAgICAgICAgaWYgKGZpcnN0KSB7XG4gICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IHBhdGhTZWcuX2FzUGF0aFN0cmluZygpO1xuICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IFwiIFwiICsgcGF0aFNlZy5fYXNQYXRoU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICByZXR1cm4gc3RyaW5nO1xuICAgICAgICAgfVxuXG4gICAgICAgICAvLyBUaGlzIGNsb3NlbHkgZm9sbG93cyBTVkdQYXRoUGFyc2VyOjpwYXJzZVBhdGggZnJvbSBTb3VyY2UvY29yZS9zdmcvU1ZHUGF0aFBhcnNlci5jcHAuXG4gICAgICAgICBTVkdQYXRoU2VnTGlzdC5wcm90b3R5cGUuX3BhcnNlUGF0aCA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICAgICAgIGlmICghc3RyaW5nIHx8IHN0cmluZy5sZW5ndGggPT0gMClcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuXG4gICAgICAgICAgICAgdmFyIG93bmluZ1BhdGhTZWdMaXN0ID0gdGhpcztcblxuICAgICAgICAgICAgIHZhciBCdWlsZGVyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHRoaXMucGF0aFNlZ0xpc3QgPSBbXTtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBCdWlsZGVyLnByb3RvdHlwZS5hcHBlbmRTZWdtZW50ID0gZnVuY3Rpb24ocGF0aFNlZykge1xuICAgICAgICAgICAgICAgICB0aGlzLnBhdGhTZWdMaXN0LnB1c2gocGF0aFNlZyk7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgdmFyIFNvdXJjZSA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICAgICAgICAgICB0aGlzLl9zdHJpbmcgPSBzdHJpbmc7XG4gICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCA9IDA7XG4gICAgICAgICAgICAgICAgIHRoaXMuX2VuZEluZGV4ID0gdGhpcy5fc3RyaW5nLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgdGhpcy5fcHJldmlvdXNDb21tYW5kID0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV047XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzKCk7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5faXNDdXJyZW50U3BhY2UgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdmFyIGNoYXJhY3RlciA9IHRoaXMuX3N0cmluZ1t0aGlzLl9jdXJyZW50SW5kZXhdO1xuICAgICAgICAgICAgICAgICByZXR1cm4gY2hhcmFjdGVyIDw9IFwiIFwiICYmIChjaGFyYWN0ZXIgPT0gXCIgXCIgfHwgY2hhcmFjdGVyID09IFwiXFxuXCIgfHwgY2hhcmFjdGVyID09IFwiXFx0XCIgfHwgY2hhcmFjdGVyID09IFwiXFxyXCIgfHwgY2hhcmFjdGVyID09IFwiXFxmXCIpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3NraXBPcHRpb25hbFNwYWNlcyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB3aGlsZSAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5faXNDdXJyZW50U3BhY2UoKSlcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXg7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5fc2tpcE9wdGlvbmFsU3BhY2VzT3JEZWxpbWl0ZXIgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmICF0aGlzLl9pc0N1cnJlbnRTcGFjZSgpICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSAhPSBcIixcIilcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3NraXBPcHRpb25hbFNwYWNlcygpKSB7XG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiLFwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzKCk7XG4gICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4O1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuaGFzTW9yZURhdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4O1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUucGVla1NlZ21lbnRUeXBlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHZhciBsb29rYWhlYWQgPSB0aGlzLl9zdHJpbmdbdGhpcy5fY3VycmVudEluZGV4XTtcbiAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3BhdGhTZWdUeXBlRnJvbUNoYXIobG9va2FoZWFkKTtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9wYXRoU2VnVHlwZUZyb21DaGFyID0gZnVuY3Rpb24obG9va2FoZWFkKSB7XG4gICAgICAgICAgICAgICAgIHN3aXRjaCAobG9va2FoZWFkKSB7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJaXCI6XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJ6XCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NMT1NFUEFUSDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIk1cIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcIm1cIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIkxcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcImxcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIkNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJjXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fQ1VCSUNfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiUVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX1FVQURSQVRJQ19BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJxXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIkFcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQVJDX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcImFcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQVJDX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIkhcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX0hPUklaT05UQUxfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiaFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fSE9SSVpPTlRBTF9SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJWXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19WRVJUSUNBTF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJ2XCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19WRVJUSUNBTF9SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJTXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fQ1VCSUNfU01PT1RIX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19TTU9PVEhfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiVFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX1FVQURSQVRJQ19TTU9PVEhfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwidFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX1FVQURSQVRJQ19TTU9PVEhfUkVMO1xuICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOO1xuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5fbmV4dENvbW1hbmRIZWxwZXIgPSBmdW5jdGlvbihsb29rYWhlYWQsIHByZXZpb3VzQ29tbWFuZCkge1xuICAgICAgICAgICAgICAgICAvLyBDaGVjayBmb3IgcmVtYWluaW5nIGNvb3JkaW5hdGVzIGluIHRoZSBjdXJyZW50IGNvbW1hbmQuXG4gICAgICAgICAgICAgICAgIGlmICgobG9va2FoZWFkID09IFwiK1wiIHx8IGxvb2thaGVhZCA9PSBcIi1cIiB8fCBsb29rYWhlYWQgPT0gXCIuXCIgfHwgKGxvb2thaGVhZCA+PSBcIjBcIiAmJiBsb29rYWhlYWQgPD0gXCI5XCIpKSAmJiBwcmV2aW91c0NvbW1hbmQgIT0gU1ZHUGF0aFNlZy5QQVRIU0VHX0NMT1NFUEFUSCkge1xuICAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZpb3VzQ29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX0FCUylcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19BQlM7XG4gICAgICAgICAgICAgICAgICAgICBpZiAocHJldmlvdXNDb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fUkVMKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1JFTDtcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwcmV2aW91c0NvbW1hbmQ7XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuaW5pdGlhbENvbW1hbmRJc01vdmVUbyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgcGF0aCBpcyBlbXB0eSBpdCBpcyBzdGlsbCB2YWxpZCwgc28gcmV0dXJuIHRydWUuXG4gICAgICAgICAgICAgICAgIGlmICghdGhpcy5oYXNNb3JlRGF0YSgpKVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgIHZhciBjb21tYW5kID0gdGhpcy5wZWVrU2VnbWVudFR5cGUoKTtcbiAgICAgICAgICAgICAgICAgLy8gUGF0aCBtdXN0IHN0YXJ0IHdpdGggbW92ZVRvLlxuICAgICAgICAgICAgICAgICByZXR1cm4gY29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX0FCUyB8fCBjb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fUkVMO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIC8vIFBhcnNlIGEgbnVtYmVyIGZyb20gYW4gU1ZHIHBhdGguIFRoaXMgdmVyeSBjbG9zZWx5IGZvbGxvd3MgZ2VuZXJpY1BhcnNlTnVtYmVyKC4uLikgZnJvbSBTb3VyY2UvY29yZS9zdmcvU1ZHUGFyc2VyVXRpbGl0aWVzLmNwcC5cbiAgICAgICAgICAgICAvLyBTcGVjOiBodHRwOi8vd3d3LnczLm9yZy9UUi9TVkcxMS9zaW5nbGUtcGFnZS5odG1sI3BhdGhzLVBhdGhEYXRhQk5GXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5fcGFyc2VOdW1iZXIgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdmFyIGV4cG9uZW50ID0gMDtcbiAgICAgICAgICAgICAgICAgdmFyIGludGVnZXIgPSAwO1xuICAgICAgICAgICAgICAgICB2YXIgZnJhYyA9IDE7XG4gICAgICAgICAgICAgICAgIHZhciBkZWNpbWFsID0gMDtcbiAgICAgICAgICAgICAgICAgdmFyIHNpZ24gPSAxO1xuICAgICAgICAgICAgICAgICB2YXIgZXhwc2lnbiA9IDE7XG5cbiAgICAgICAgICAgICAgICAgdmFyIHN0YXJ0SW5kZXggPSB0aGlzLl9jdXJyZW50SW5kZXg7XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzKCk7XG5cbiAgICAgICAgICAgICAgICAgLy8gUmVhZCB0aGUgc2lnbi5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIitcIilcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICBlbHNlIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCItXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgc2lnbiA9IC0xO1xuICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA9PSB0aGlzLl9lbmRJbmRleCB8fCAoKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8IFwiMFwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+IFwiOVwiKSAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgIT0gXCIuXCIpKVxuICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIGZpcnN0IGNoYXJhY3RlciBvZiBhIG51bWJlciBtdXN0IGJlIG9uZSBvZiBbMC05Ky0uXS5cbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgLy8gUmVhZCB0aGUgaW50ZWdlciBwYXJ0LCBidWlsZCByaWdodC10by1sZWZ0LlxuICAgICAgICAgICAgICAgICB2YXIgc3RhcnRJbnRQYXJ0SW5kZXggPSB0aGlzLl9jdXJyZW50SW5kZXg7XG4gICAgICAgICAgICAgICAgIHdoaWxlICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPj0gXCIwXCIgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDw9IFwiOVwiKVxuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7IC8vIEFkdmFuY2UgdG8gZmlyc3Qgbm9uLWRpZ2l0LlxuXG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggIT0gc3RhcnRJbnRQYXJ0SW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgIHZhciBzY2FuSW50UGFydEluZGV4ID0gdGhpcy5fY3VycmVudEluZGV4IC0gMTtcbiAgICAgICAgICAgICAgICAgICAgIHZhciBtdWx0aXBsaWVyID0gMTtcbiAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChzY2FuSW50UGFydEluZGV4ID49IHN0YXJ0SW50UGFydEluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgaW50ZWdlciArPSBtdWx0aXBsaWVyICogKHRoaXMuX3N0cmluZy5jaGFyQXQoc2NhbkludFBhcnRJbmRleC0tKSAtIFwiMFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICBtdWx0aXBsaWVyICo9IDEwO1xuICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgLy8gUmVhZCB0aGUgZGVjaW1hbHMuXG4gICAgIC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MuX2N1cnJlbnRJbmRleCArIDEgPCB0aGlzLl9lbmRJbmRleCAmJiAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiZVwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIkVcIikgJiYgKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4ICsgMSkgIT0gXCJ4XCIgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXggKyAxKSAhPSBcIm1cIikpIHtcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuXG4gICAgICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBzaWduIG9mIHRoZSBleHBvbmVudC5cbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCIrXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiLVwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXhwc2lnbiA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAvLyBUaGVyZSBtdXN0IGJlIGFuIGV4cG9uZW50LlxuICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA+PSB0aGlzLl9lbmRJbmRleCB8fCB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPCBcIjBcIiB8fCB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPiBcIjlcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuXG4gICAgICAgICAgICAgICAgICAgICB3aGlsZSAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID49IFwiMFwiICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8PSBcIjlcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgIGV4cG9uZW50ICo9IDEwO1xuICAgICAgICAgICAgICAgICAgICAgICAgIGV4cG9uZW50ICs9ICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgLSBcIjBcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICB2YXIgbnVtYmVyID0gaW50ZWdlciArIGRlY2ltYWw7XG4gICAgICAgICAgICAgICAgIG51bWJlciAqPSBzaWduO1xuXG4gICAgICAgICAgICAgICAgIGlmIChleHBvbmVudClcbiAgICAgICAgICAgICAgICAgICAgIG51bWJlciAqPSBNYXRoLnBvdygxMCwgZXhwc2lnbiAqIGV4cG9uZW50KTtcblxuICAgICAgICAgICAgICAgICBpZiAoc3RhcnRJbmRleCA9PSB0aGlzLl9jdXJyZW50SW5kZXgpXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3NraXBPcHRpb25hbFNwYWNlc09yRGVsaW1pdGVyKCk7XG5cbiAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9wYXJzZUFyY0ZsYWcgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA+PSB0aGlzLl9lbmRJbmRleClcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgIHZhciBmbGFnID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgIHZhciBmbGFnQ2hhciA9IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KyspO1xuICAgICAgICAgICAgICAgICBpZiAoZmxhZ0NoYXIgPT0gXCIwXCIpXG4gICAgICAgICAgICAgICAgICAgICBmbGFnID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgIGVsc2UgaWYgKGZsYWdDaGFyID09IFwiMVwiKVxuICAgICAgICAgICAgICAgICAgICAgZmxhZyA9IHRydWU7XG4gICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzT3JEZWxpbWl0ZXIoKTtcbiAgICAgICAgICAgICAgICAgcmV0dXJuIGZsYWc7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5wYXJzZVNlZ21lbnQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdmFyIGxvb2thaGVhZCA9IHRoaXMuX3N0cmluZ1t0aGlzLl9jdXJyZW50SW5kZXhdO1xuICAgICAgICAgICAgICAgICB2YXIgY29tbWFuZCA9IHRoaXMuX3BhdGhTZWdUeXBlRnJvbUNoYXIobG9va2FoZWFkKTtcbiAgICAgICAgICAgICAgICAgaWYgKGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV04pIHtcbiAgICAgICAgICAgICAgICAgICAgIC8vIFBvc3NpYmx5IGFuIGltcGxpY2l0IGNvbW1hbmQuIE5vdCBhbGxvd2VkIGlmIHRoaXMgaXMgdGhlIGZpcnN0IGNvbW1hbmQuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fcHJldmlvdXNDb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgY29tbWFuZCA9IHRoaXMuX25leHRDb21tYW5kSGVscGVyKGxvb2thaGVhZCwgdGhpcy5fcHJldmlvdXNDb21tYW5kKTtcbiAgICAgICAgICAgICAgICAgICAgIGlmIChjb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICB0aGlzLl9wcmV2aW91c0NvbW1hbmQgPSBjb21tYW5kO1xuXG4gICAgICAgICAgICAgICAgIHN3aXRjaCAoY29tbWFuZCkge1xuICAgICAgICAgICAgICAgICBjYXNlIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fUkVMOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTVkdQYXRoU2VnTW92ZXRvUmVsKG93bmluZ1BhdGhTZWdMaXN0LCB0aGlzLl9wYXJzZU51bWJlcigpLCB0aGlzLl9wYXJzZU51bWJlcigpKTtcbiAgICAgICAgICAgICAgICAgY2FzZSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX0FCUzpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU1ZHUGF0aFNlZ01vdm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cG9pbnRzLmFyY0xhcmdlLCBwb2ludHMuYXJjU3dlZXApO1xuICAgICAgICAgICAgICAgICBjYXNlIFNWR1BhdGhTZWcuUEFUSFNFR19BUkNfQUJTOlxuICAgICAgICAgICAgICAgICAgICAgdmFyIHBvaW50cyA9IHt4MTogdGhpcy5fcGFyc2VOdW1iZXIoKSwgeTE6IHRoaXMuX3BhcnNlTnVtYmVyKCksIGFyY0FuZ2xlOiB0aGlzLl9wYXJzZU51bWJlcigpLCBhcmNMYXJnZTogdGhpcy5fcGFyc2VBcmNGbGFnKCksIGFyY1N3ZWVwOiB0aGlzLl9wYXJzZUFyY0ZsYWcoKSwgeDogdGhpcy5fcGFyc2VOdW1iZXIoKSwgeTogdGhpcy5fcGFyc2VOdW1iZXIoKX07XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNWR1BhdGhTZWdBcmNBYnMob3duaW5nUGF0aFNlZ0xpc3QsIHBvaW50cy54LCBwb2ludHMueSwgcG9pbnRzLngxLCBwb2ludHMueTEsIHBvaW50cy5hcmNBbmdsZSwgcG9pbnRzLmFyY0xhcmdlLCBwb2ludHMuYXJjU3dlZXApO1xuICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgdGhyb3cgXCJVbmtub3duIHBhdGggc2VnIHR5cGUuXCJcbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIHZhciBidWlsZGVyID0gbmV3IEJ1aWxkZXIoKTtcbiAgICAgICAgICAgICB2YXIgc291cmNlID0gbmV3IFNvdXJjZShzdHJpbmcpO1xuXG4gICAgICAgICAgICAgaWYgKCFzb3VyY2UuaW5pdGlhbENvbW1hbmRJc01vdmVUbygpKVxuICAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICAgd2hpbGUgKHNvdXJjZS5oYXNNb3JlRGF0YSgpKSB7XG4gICAgICAgICAgICAgICAgIHZhciBwYXRoU2VnID0gc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FsdWVzW2ldID0ga2V5VmFsdWU7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAoaSA9IC0xOyArK2kgPCBtOyApIHtcbiAgICAgICAgICBpZiAoIShub2RlID0gbm9kZUJ5S2V5VmFsdWUuZ2V0KGtleVZhbHVlID0ga2V5LmNhbGwoZ3JvdXBEYXRhLCBub2RlRGF0YSA9IGdyb3VwRGF0YVtpXSwgaSkpKSkge1xuICAgICAgICAgICAgZW50ZXJOb2Rlc1tpXSA9IGQzX3NlbGVjdGlvbl9kYXRhTm9kZShub2RlRGF0YSk7XG4gICAgICAgICAgfSBlbHNlIGlmIChub2RlICE9PSB0cnVlKSB7XG4gICAgICAgICAgICB1cGRhdGVOb2Rlc1tpXSA9IG5vZGU7XG4gICAgICAgICAgICBub2RlLl9fZGF0YV9fID0gbm9kZURhdGE7XG4gICAgICAgICAgfVxuICAgICAgICAgIG5vZGVCeUtleVZhbHVlLnNldChrZXlWYWx1ZSwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChpID0gLTE7ICsraSA8IG47ICkge1xuICAgICAgICAgIGlmIChpIGluIGtleVZhbHVlcyAmJiBub2RlQnlLZXlWYWx1ZS5nZXQoa2V5VmFsdWVzW2ldKSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgZXhpdE5vZGVzW2ldID0gZ3JvdXBbaV07XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBmb3IgKGkgPSAtMTsgKytpIDwgbjA7ICkge1xuICAgICAgICAgIG5vZGUgPSBncm91cFtpXTtcbiAgICAgICAgICBub2RlRGF0YSA9IGdyb3VwRGF0YVtpXTtcbiAgICAgICAgICBpZiAobm9kZSkge1xuICAgICAgICAgICAgbm9kZS5fX2RhdGFfXyA9IG5vZGVEYXRhO1xuICAgICAgICAgICAgdXBkYXRlTm9kZXNbaV0gPSBub2RlO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICA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gICAgICAgICAgICAgeDogMCxcbiAgICAgICAgICAgICAgeTogMCxcbiAgICAgICAgICAgICAgazogMVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHpvb21zdGFydGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB9KS50d2VlbihcInpvb206em9vbVwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBkeCA9IHNpemVbMF0sIGR5ID0gc2l6ZVsxXSwgY3ggPSBjZW50ZXIwID8gY2VudGVyMFswXSA6IGR4IC8gMiwgY3kgPSBjZW50ZXIwID8gY2VudGVyMFsxXSA6IGR5IC8gMiwgaSA9IGQzLmludGVycG9sYXRlWm9vbShbIChjeCAtIHZpZXcueCkgLyB2aWV3LmssIChjeSAtIHZpZXcueSkgLyB2aWV3LmssIGR4IC8gdmlldy5rIF0sIFsgKGN4IC0gdmlldzEueCkgLyB2aWV3MS5rLCAoY3kgLSB2aWV3MS55KSAvIHZpZXcxLmssIGR4IC8gdmlldzEuayBdKTtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbih0KSB7XG4gICAgICAgICAgICAgIHZhciBsID0gaSh0KSwgayA9IGR4IC8gbFsyXTtcbiAgICAgICAgICAgICAgdGhpcy5fX2NoYXJ0X18gPSB2aWV3ID0ge1xuICAgICAgICAgICAgICAgIHg6IGN4IC0gbFswXSAqIGssXG4gICAgICAgICAgICAgICAgeTogY3kgLSBsWzFdICogayxcbiAgICAgICAgICAgICAgICBrOiBrXG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIHpvb21lZChkaXNwYXRjaCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pLmVhY2goXCJpbnRlcnJ1cHQuem9vbVwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSkuZWFjaChcImVuZC56b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgem9vbWVuZGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aGlzLl9fY2hhcnRfXyA9IHZpZXc7XG4gICAgICAgICAgem9vbXN0YXJ0ZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIHpvb21lZChkaXNwYXRjaCk7XG4gICAgICAgICAgem9vbWVuZGVkKGRpc3BhdGNoKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfTtcbiAgICB6b29tLnRyYW5zbGF0ZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIFsgdmlldy54LCB2aWV3LnkgXTtcbiAgICAgIHZpZXcgPSB7XG4gICAgICAgIHg6ICtfWzBdLFxuICAgICAgICB5OiArX1sxXSxcbiAgICAgICAgazogdmlldy5rXG4gICAgICB9O1xuICAgICAgcmVzY2FsZSgpO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNjYWxlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdmlldy5rO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogdmlldy54LFxuICAgICAgICB5OiB2aWV3LnksXG4gICAgICAgIGs6IG51bGxcbiAgICAgIH07XG4gICAgICBzY2FsZVRvKCtfKTtcbiAgICAgIHJlc2NhbGUoKTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5zY2FsZUV4dGVudCA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNjYWxlRXh0ZW50O1xuICAgICAgc2NhbGVFeHRlbnQgPSBfID09IG51bGwgPyBkM19iZWhhdmlvcl96b29tSW5maW5pdHkgOiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6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ICAgICAgICByID0gKGNvbG9yICYgMzg0MCkgPj4gNDtcbiAgICAgICAgciA9IHIgPj4gNCB8IHI7XG4gICAgICAgIGcgPSBjb2xvciAmIDI0MDtcbiAgICAgICAgZyA9IGcgPj4gNCB8IGc7XG4gICAgICAgIGIgPSBjb2xvciAmIDE1O1xuICAgICAgICBiID0gYiA8PCA0IHwgYjtcbiAgICAgIH0gZWxzZSBpZiAoZm9ybWF0Lmxlbmd0aCA9PT0gNykge1xuICAgICAgICByID0gKGNvbG9yICYgMTY3MTE2ODApID4+IDE2O1xuICAgICAgICBnID0gKGNvbG9yICYgNjUyODApID4+IDg7XG4gICAgICAgIGIgPSBjb2xvciAmIDI1NTtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHJnYihyLCBnLCBiKTtcbiAgfVxuICBmdW5jdGlvbiBkM19yZ2JfaHNsKHIsIGcsIGIpIHtcbiAgICB2YXIgbWluID0gTWF0aC5taW4ociAvPSAyNTUsIGcgLz0gMjU1LCBiIC89IDI1NSksIG1heCA9IE1hdGgubWF4KHIsIGcsIGIpLCBkID0gbWF4IC0gbWluLCBoLCBzLCBsID0gKG1heCArIG1pbikgLyAyO1xuICAgIGlmIChkKSB7XG4gICAgICBzID0gbCA8IC41ID8gZCAvIChtYXggKyBtaW4pIDogZCAvICgyIC0gbWF4IC0gbWluKTtcbiAgICAgIGlmIChyID09IG1heCkgaCA9IChnIC0gYikgLyBkICsgKGcgPCBiID8gNiA6IDApOyBlbHNlIGlmIChnID09IG1heCkgaCA9IChiIC0gcikgLyBkICsgMjsgZWxzZSBoID0gKHIgLSBnKSAvIGQgKyA0O1xuICAgICAgaCAqPSA2MDtcbiAgICB9IGVsc2Uge1xuICAgICAgaCA9IE5hTjtcbiAgICAgIHMgPSBsID4gMCAmJiBsIDwgMSA/IDAgOiBoO1xuICAgIH1cbiAgICByZXR1cm4gbmV3IGQzX2hzbChoLCBzLCBsKTtcbiAgfVxuICBmdW5jdGlvbiBkM19yZ2JfbGF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ge1xuICAgICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGkgKyAxKSAhPT0gMzQpIGJyZWFrO1xuICAgICAgICAgICAgICArK2k7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIEkgPSBpICsgMjtcbiAgICAgICAgICB2YXIgYyA9IHRleHQuY2hhckNvZGVBdChpICsgMSk7XG4gICAgICAgICAgaWYgKGMgPT09IDEzKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpICsgMikgPT09IDEwKSArK0k7XG4gICAgICAgICAgfSBlbHNlIGlmIChjID09PSAxMCkge1xuICAgICAgICAgICAgZW9sID0gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHRleHQuc2xpY2UoaiArIDEsIGkpLnJlcGxhY2UoL1wiXCIvZywgJ1wiJyk7XG4gICAgICAgIH1cbiAgICAgICAgd2hpbGUgKEkgPCBOKSB7XG4gICAgICAgICAgdmFyIGMgPSB0ZXh0LmNoYXJDb2RlQXQoSSsrKSwgayA9IDE7XG4gICAgICAgICAgaWYgKGMgPT09IDEwKSBlb2wgPSB0cnVlOyBlbHNlIGlmIChjID09PSAxMykge1xuICAgICAgICAgICAgZW9sID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoSSkgPT09IDEwKSArK0ksICsraztcbiAgICAgICAgICB9IGVsc2UgaWYgKGMgIT09IGRlbGltaXRlckNvZGUpIGNvbnRpbnVlO1xuICAgICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGosIEkgLSBrKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqKTtcbiAgICAgIH1cbiAgICAgIHdoaWxlICgodCA9IHRva2VuKCkpICE9PSBFT0YpIHtcbiAgICAgICAgdmFyIGEgPSBbXTtcbiAgICAgICAgd2hpbGUgKHQgIT09IEVP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gICBlOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldERhdGUoKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgSDogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRIb3VycygpLCBwLCAyKTtcbiAgICAgIH0sXG4gICAgICBJOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldEhvdXJzKCkgJSAxMiB8fCAxMiwgcCwgMik7XG4gICAgICB9LFxuICAgICAgajogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoMSArIGQzX3RpbWUuZGF5T2ZZZWFyKGQpLCBwLCAzKTtcbiAgICAgIH0sXG4gICAgICBMOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldE1pbGxpc2Vjb25kcygpLCBwLCAzKTtcbiAgICAgIH0sXG4gICAgICBtOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldE1vbnRoKCkgKyAxLCBwLCAyKTtcbiAgICAgIH0sXG4gICAgICBNOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldE1pbnV0ZXMoKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgcDogZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gbG9jYWxlX3BlcmlvZHNbKyhkLmdldEhvdXJzKCkgPj0gMTIpXTtcbiAgICAgIH0sXG4gICAgICBTOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldFNlY29uZHMoKSwgcCwgMik7X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bWVyaWRpYW4gXiAocyAqIM67XyA8IM67aSAmJiDOu2kgPCBzICogzrspKSB7XG4gICAgICAgICAgdmFyIM+GaSA9IGluZmxlY3Rpb25bMV0gKiBkM19kZWdyZWVzO1xuICAgICAgICAgIGlmICjPhmkgPiDPhjEpIM+GMSA9IM+GaTtcbiAgICAgICAgfSBlbHNlIGlmICjOu2kgPSAozrtpICsgMzYwKSAlIDM2MCAtIDE4MCwgYW50aW1lcmlkaWFuIF4gKHMgKiDOu18gPCDOu2kgJiYgzrtpIDwgcyAqIM67KSkge1xuICAgICAgICAgIHZhciDPhmkgPSAtaW5mbGVjdGlvblsxXSAqIGQzX2RlZ3JlZXM7XG4gICAgICAgICAgaWYgKM+GaSA8IM+GMCkgz4YwID0gz4ZpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICjPhiA8IM+GMCkgz4YwID0gz4Y7XG4gICAgICAgICAgaWYgKM+GID4gz4YxKSDPhjEgPSDPhjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYW50aW1lcmlkaWFuKSB7XG4gICAgICAgICAgaWYgKM67IDwgzrtfKSB7XG4gICAgICAgICAgICBpZiAoYW5nbGUozrswLCDOuykgPiBhbmdsZSjOuzAsIM67MSkpIM67MSA9IM67O1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoYW5nbGUozrssIM67MSkgPiBhbmdsZSjOuzAsIM67MSkpIM67MCA9IM67O1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAozrsxID49IM67MCkge1xuICAgICAgICAgICAgaWYgKM67IDwgzrswKSDOuzAgPSDOuztcbiAgICAgICAgICAgIGlmICjOuyA+IM67MSkgzrsxID0gzrs7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICjOuyA+IM67Xykge1xuICAgICAgICAgICAgICBpZiAoYW5nbGUozrswLCDOuykgPiBhbmdsZSjOuzAsIM67MSkpIM67MSA9IM67O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKGFuZ2xlKM67LCDOuzEpID4gYW5nbGUozrswLCDOuzEpKSDOuzAgPSDOuztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHBvaW50KM67LCDPhik7XG4gICAgICB9XG4gICAgICBwMCA9IHAsIM67XyA9IM67O1xuICAgIH1cbiAgICBmdW5jdGlvbiBsaW5lU3RhcnQoKSB7XG4gICAgICBib3VuZC5wb2ludCA9IGxpbmVQb2ludDtcbiAgICB9XG4gICAgZnVuY3Rpb24gbGluZUVuZCgpIHtcbiAgICAgIHJhbmdlWzBdID0gzrswLCByYW5nZVsxXSA9IM67MTtcbiAgICAgIGJvdW5kLnBvaW50ID0gcG9pbnQ7XG4gICAgICBwMCA9IG51bGw7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJpbmdQb2ludCjOuywgz4YpIHtcbiAgICAgIGlmIChwMCkge1xuICAgICAgICB2YXIgZM67ID0gzrsgLSDOu187XG4gICAgICAgIGTOu1N1bSArPSBhYnMoZM67KSA+IDE4MCA/IGTOuyArIChkzrsgPiAwID8gMzYwIDogLTM2MCkgOiBkzrs7XG4gICAgICB9IGVsc2UgzrtfXyA9IM67LCDPhl9fID0gz4Y7XG4gICAgICBkM19nZW9fYXJlYS5wb2ludCjOuywgz4YpO1xuICAgICAgbGluZVBvaW50KM67LCDPhik7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJpbmdTdGFydCgpIHtcbiAgICAgIGQzX2dlb19hcmVhLmxpbmVTdGFydCgpO1xuICAgIH1cbiAgICBmdW5jdGlvbiByaW5nRW5kKCkge1xuICAgICAgcmluZ1BvaW50KM67X18sIM+GX18pO1xuICAgICAgZDNfZ2VvX2FyZWEubGluZUVuZCgpO1xuICAgICAgaWYgKGFicyhkzrtTdW0pID4gzrUpIM67MCA9IC0ozrsxID0gMTgwKT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ZW5lci5wb2ludCgocG9pbnQgPSBwb2ludHNbaV0pWzBdLCBwb2ludFsxXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGludGVycG9sYXRlKGN1cnJlbnQueCwgY3VycmVudC5uLngsIDEsIGxpc3RlbmVyKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoaXNTdWJqZWN0KSB7XG4gICAgICAgICAgICBwb2ludHMgPSBjdXJyZW50LnAuejtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSBwb2ludHMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIGxpc3RlbmVyLnBvaW50KChwb2ludCA9IHBvaW50c1tpXSlbMF0sIHBvaW50WzFdKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW50ZXJwb2xhdGUoY3VycmVudC54LCBjdXJyZW50LnAueCwgLTEsIGxpc3RlbmVyKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY3VycmVudCA9IGN1cnJlbnQucDtcbiAgICAgICAgfVxuICAgICAgICBjdXJyZW50ID0gY3VycmVudC5vO1xuICAgICAgICBwb2ludHMgPSBjdXJyZW50Lno7XG4gICAgICAgIGlzU3ViamVjdCA9ICFpc1N1YmplY3Q7XG4gICAgICB9IHdoaWxlICghY3VycmVudC52KTtcbiAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICB9XG4gIH1cbiAgZnVuY3Rpb24gZDNfZ2VvX2NsaXBQb2x5Z29uTGlua0NpcmN1bGFyKGFycmF5KSB7XG4gICAgaWYgKCEobiA9IGFycmF5Lmxlbmd0aCkpIHJldHVybjtcbiAgICB2YXIgbiwgaSA9IDAsIGEgPSBhcnJheVswXSwgYjtcbiAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgYS5uID0gYiA9IGFycmF5W2ldO1xuICAgICAgYi5wID0gYT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xuICAgICAgICAgICAgd2hpbGUgKCsraSA8IG4pIGxpc3RlbmVyLnBvaW50KChwb2ludCA9IHNlZ21lbnRbaV0pWzBdLCBwb2ludFsxXSk7XG4gICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAobiA+IDEgJiYgY2xlYW4gJiAyKSByaW5nU2VnbWVudHMucHVzaChyaW5nU2VnbWVudHMucG9wKCkuY29uY2F0KHJpbmdTZWdtZW50cy5zaGlmdCgpKSk7XG4gICAgICAgIHNlZ21lbnRzLnB1c2gocmluZ1NlZ21lbnRzLmZpbHRlcihkM19nZW9fY2xpcFNlZ21lbnRMZW5ndGgxKSk7XG4gICAgICB9XG4gICAgICByZXR1cm4gY2xpcDtcbiAgICB9O1xuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19jbGlwU2VnbWVudExlbmd0aDEoc2VnbWVudCkge1xuICAgIHJldHVybiBzZWdtZW50Lmxlbmd0aCA+IDE7XG4gIH1cbiAgZnVuY3Rpb24gZDNfZ2VvX2NsaXBCdWZmZXJMaXN0ZW5lcigpIHtcbiAgICB2YXIgbGluZXMgPSBbXSwgbGluZTtcbiAgICByZXR1cm4ge1xuICAgICAgbGluZVN0YXJ0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgbGluZXMucHVzaChsaW5lID0gW10pO1xuICAgICAgfSxcbiAgICAgIHBvaW50OiBmdW5jdGlvbijOuywgz4YpIHtcbiAgICAgICAgbGluZS5wdXNoKFsgzrssIM+GIF0pO1xuICAgICAgfSxcbiAgICAgIGxpbmVFbmQ6IGQzX25vb3AsXG4gICAgICBidWZmZXI6IGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgYnVmZmVyID0gbGluZXM7XG4gICAgICAgIGxpbmVzID0gW107XG4gICAgICAgIGxpbmUgPSBudWxsO1xuICAgICAgICByZXR1cm4gYnVmZmVyO1xuICAgICAgfS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pIC8gMiA+IDAgPyBoYWxmz4AgOiAtaGFsZs+AKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrswLCDPhjApO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrsxLCDPhjApO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KM67MSwgz4YwKTtcbiAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgIH0gZWxzZSBpZiAoc867MCAhPT0gc867MSAmJiBkzrsgPj0gz4ApIHtcbiAgICAgICAgICBpZiAoYWJzKM67MCAtIHPOuzApIDwgzrUpIM67MCAtPSBzzrswICogzrU7XG4gICAgICAgICAgaWYgKGFicyjOuzEgLSBzzrsxKSA8IM61KSDOuzEgLT0gc867MSAqIM61O1xuICAgICAgICAgIM+GMCA9IGQzX2dlb19jbGlwQW50aW1lcmlkaWFuSW50ZXJzZWN0KM67MCwgz4YwLCDOuzEsIM+GMSk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MCwgz4YwKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MSwgz4YwKTtcbiAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgIH1cbiAgICAgICAgbGlzdGVuZXIucG9pbnQozrswID0gzrsxLCDPhjAgPSDPhjEpO1xuICAgICAgICBzzrswID0gc867MTtcbiAgICAgIH0sXG4gICAgICBsaW5lRW5kOiBmdW5jdGlvbigpIHtcbiAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICDOuzAgPSDPhjAgPSBOYU47XG4gICAgICB9LFxuICAgICAgY2xlYW46IGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gMiAtIGN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saW5lU3RhcnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHYwMCA9IHYwID0gZmFsc2U7XG4gICAgICAgICAgY2xlYW4gPSAxO1xuICAgICAgICB9LFxuICAgICAgICBwb2ludDogZnVuY3Rpb24ozrssIM+GKSB7XG4gICAgICAgICAgdmFyIHBvaW50MSA9IFsgzrssIM+GIF0sIHBvaW50MiwgdiA9IHZpc2libGUozrssIM+GKSwgYyA9IHNtYWxsUmFkaXVzID8gdiA/IDAgOiBjb2RlKM67LCDPhikgOiB2ID8gY29kZSjOuyArICjOuyA8IDAgPyDPgCA6IC3PgCksIM+GKSA6IDA7XG4gICAgICAgICAgaWYgKCFwb2ludDAgJiYgKHYwMCA9IHYwID0gdikpIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MCwgcG9pbnQxKTtcbiAgICAgICAgICAgIGlmIChkM19nZW9fc3BoZXJpY2FsRXF1YWwocG9pbnQwLCBwb2ludDIpIHx8IGQzX2dlb19zcGhlcmljYWxFcXVhbChwb2ludDEsIHBvaW50MikpIHtcbiAgICAgICAgICAgICAgcG9pbnQxWzBdICs9IM61O1xuICAgICAgICAgICAgICBwb2ludDFbMV0gKz0gzrU7XG4gICAgICAgICAgICAgIHYgPSB2aXNpYmxlKHBvaW50MVswXSwgcG9pbnQxWzFdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHYgIT09IHYwKSB7XG4gICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MSwgcG9pbnQwKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcG9pbnQyID0gaW50ZXJzZWN0KHBvaW50MCwgcG9pbnQxKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQocG9pbnQyWzBdLCBwb2ludDJbMV0pO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwb2ludDAgPSBwb2ludDI7XG4gICAgICAgICAgfSBlbHNlIGlmIChub3RIZW1pc3BoZXJlICYmIHBvaW50MCAmJiBzbWFsbFJhZGl1cyBeIHYpIHtcbiAgICAgICAgICAgIHZhciB0O1xuICAgICAgICAgICAgaWYgKCEoYyAmIGMwKSAmJiAodCA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCwgdHJ1ZSkpKSB7XG4gICAgICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgICAgICAgaWYgKHNtYWxsUmFkaXVzKSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFswXVswXSwgdFswXVsxXSk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMV1bMF0sIHRbMV1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzBdWzBdLCB0WzBdWzFdKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgIC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iAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9XG4gICAgICByID0geDEgLSBheDtcbiAgICAgIGlmICghZHggJiYgciA8IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHg7XG4gICAgICBpZiAoZHggPCAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeCA+IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9XG4gICAgICByID0geTAgLSBheTtcbiAgICAgIGlmICghZHkgJiYgciA+IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHk7XG4gICAgICBpZiAoZHkgPCAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeSA+IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9XG4gICAgICByID0geTEgLSBheTtcbiAgICAgIGlmICghZHkgJiYgciA8IDApIHJldHVybjtcbiAgICAgIHIgLz0gZHk7XG4gICAgICBpZiAoZHkgPCAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfSBlbHNlIGlmIChkeSA+IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9XG4gICAgICBpZiAodDAgPiAwKSBsaW5lLmEgPSB7XG4gICAgICAgIHg6IGF4ICsgdDAgKiBkeCxcbiAgICAgICAgeTogYXkgKyB0MCAqIGR5XG4gICAgICB9O1xuICAgICAgaWYgKHQxIDwgMSkgb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GludGVycG9sYXRlKG51bGwsIG51bGwsIDEsIGxpc3RlbmVyKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHZpc2libGUpIHtcbiAgICAgICAgICAgICAgZDNfZ2VvX2NsaXBQb2x5Z29uKHNlZ21lbnRzLCBjb21wYXJlLCBjbGlwU3RhcnRJbnNpZGUsIGludGVycG9sYXRlLCBsaXN0ZW5lcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsaXN0ZW5lci5wb2x5Z29uRW5kKCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNlZ21lbnRzID0gcG9seWdvbiA9IHJpbmcgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24gaW5zaWRlUG9seWdvbihwKSB7XG4gICAgICAgIHZhciB3biA9IDAsIG4gPSBwb2x5Z29uLmxlbmd0aCwgeSA9IHBbMV07XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgZm9yICh2YXIgaiA9IDEsIHYgPSBwb2x5Z29uW2ldLCBtID0gdi5sZW5ndGgsIGEgPSB2WzBdLCBiOyBqIDwgbTsgKytqKSB7XG4gICAgICAgICAgICBiID0gdltqXTtcbiAgICAgICAgICAgIGlmIChhWzFdIDw9IHkpIHtcbiAgICAgICAgICAgICAgaWYgKGJbMV0gPiB5ICYmIGQzX2Nyb3NzMmQoYSwgYiwgcCkgPiAwKSArK3duO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKGJbMV0gPD0geSAmJiBkM19jcm9zczJkKGEsIGIsIHApIDwgMCkgLS13bjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGEgPSBiO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gd24gIT09IDA7XG4gICAgICB9XG4gICAgICBmdW5jdGlv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lci5wb2ludCh4LCB5KTsgZWxzZSB7XG4gICAgICAgICAgICB2YXIgbCA9IHtcbiAgICAgICAgICAgICAgYToge1xuICAgICAgICAgICAgICAgIHg6IHhfLFxuICAgICAgICAgICAgICAgIHk6IHlfXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGI6IHtcbiAgICAgICAgICAgICAgICB4OiB4LFxuICAgICAgICAgICAgICAgIHk6IHlcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChjbGlwTGluZShsKSkge1xuICAgICAgICAgICAgICBpZiAoIXZfKSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQobC5hLngsIGwuYS55KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChsLmIueCwgbC5iLnkpO1xuICAgICAgICAgICAgICBpZiAoIXYpIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgY2xlYW4gPSBmYWxzZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodikge1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQoeCwgeSk7XG4gICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHhfID0geCwgeV8gPSB5LCB2XyA9IHY7XG4gICAgICB9XG4gICAgICByZXR1cm4gY2xpcDtcbiAgICB9O1xuICAgIGZ1bmN0aW9uIGNvcm5lcihwLCBkaXJlY3Rpb24pIHtcbiAgICAgIHJldHVybiBhYnMocFswXSAtIHgwKSA8IM61ID8gZGlyZWN0aW9uID4gMCA/IDAgOiAzIDogYWJzKHBbMF0gLSB4MSkgPCDOtSA/IGRpcmVjdGlvbi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ICAgIH1cbiAgICAgICAgICBub2RlID0gbm9kZS5SO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChkeGwgPiAtzrUpIHtcbiAgICAgICAgICAgIGxBcmMgPSBub2RlLlA7XG4gICAgICAgICAgICByQXJjID0gbm9kZTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGR4ciA+IC3OtSkge1xuICAgICAgICAgICAgbEFyYyA9IG5vZGU7XG4gICAgICAgICAgICByQXJjID0gbm9kZS5OO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsQXJjID0gckFyYyA9IG5vZGU7XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHZhciBuZXdBcmMgPSBkM19nZW9tX3Zvcm9ub2lDcmVhdGVCZWFjaChzaXRlKTtcbiAgICBkM19nZW9tX3Zvcm9ub2lCZWFjaGVzLmluc2VydChsQXJjLCBuZXdBcmMpO1xuICAgIGlmICghbEFyYyAmJiAhckFyYykgcmV0dXJuO1xuICAgIGlmIChsQXJjID09PSByQXJjKSB7XG4gICAgICBkM19nZW9tX3Zvcm9ub2lEZXRhY2hDaXJjbGUobEFyYyk7XG4gICAgICByQXJjID0gZDNfZ2VvbV92b3Jvbm9pQ3JlYXRlQmVhY2gobEFyYy5zaXRlKTtcbiAgICAgIGQzX2dlb21fdm9yb25vaUJlYWNoZXMuaW5zZXJ0KG5ld0FyYywgckFyYyk7XG4gICAgICBuZXdBcmMuZWRnZSA9IHJBcmMuZWRnZSA9IGQzX2dlb21fdm9yb25vaUNyZWF0ZUVkZ2UobEFyYy5zaXRlLCBuZXdBcmMuc2l0ZSk7XG4gICAgICBkM19nZW9tX3Zvcm9ub2lBdHRhY2hDaXJjbGUobEFyYyk7XG4gICAgICBkM19nZW9tX3Zvcm9ub2lBdHRhY2hDaXJjbGUockFyYyk7XG4gICAgICByZXR1cm47XG4gICAgfVxuICAgIGlmICghckFyYykge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AgICAgIGZiID0gZnkgLSBmbSAqIGZ4O1xuICAgICAgaWYgKGZtIDwgLTEgfHwgZm0gPiAxKSB7XG4gICAgICAgIGlmIChseCA+IHJ4KSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiAoeTAgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkwXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueSA+PSB5MSkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogKHkxIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MVxuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiAoeTEgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkxXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueSA8IHkwKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiAoeTAgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkwXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKGx5IDwgcnkpIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6IHgwLFxuICAgICAgICAgICAgeTogZm0gKiB4MCArIGZiXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueCA+PSB4MSkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogeDEsXG4gICAgICAgICAgICB5OiBmbSAqIHgxICsgZmJcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogeDEsXG4gICAgICAgICAgICB5OiBmbSAqIHgxICsgZmJcbiAgICAgICAgICB9OyBlbHNlI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vcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgICAgYWZ0ZXIgPSBwYXJlbnQ7XG4gICAgICAgICAgICAgIHBhcmVudCA9IGFmdGVyLlU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwYXJlbnQuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZ3JhbmRwYS5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgZ3JhbmRwYSk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHVuY2xlID0gZ3JhbmRwYS5MO1xuICAgICAgICAgIGlmICh1bmNsZSAmJiB1bmNsZS5DKSB7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHVuY2xlLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBhZnRlciA9IGdyYW5kcGE7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChhZnRlciA9PT0gcGFyZW50LkwpIHtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgICBhZnRlciA9IHBhcmVudDtcbiAgICAgICAgICAgICAgcGFyZW50ID0gYWZ0ZXIuVTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmVudC5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIGdyYW5kcGEpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBwYXJlbnQgPSBhZnRlci5VO1xuICAgICAgfVxuICAgICAgdGhpcy5fLk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ICAgbmV4dC5VID0gcGFyZW50O1xuICAgICAgICAgIHBhcmVudCA9IG5leHQ7XG4gICAgICAgICAgbm9kZSA9IG5leHQuUjtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcmVkID0gbm9kZS5DO1xuICAgICAgICBub2RlID0gbmV4dDtcbiAgICAgIH1cbiAgICAgIGlmIChub2RlKSBub2RlLlUgPSBwYXJlbnQ7XG4gICAgICBpZiAocmVkKSByZXR1cm47XG4gICAgICBpZiAobm9kZSAmJiBub2RlLkMpIHtcbiAgICAgICAgbm9kZS5DID0gZmFsc2U7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIGRvIHtcbiAgICAgICAgaWYgKG5vZGUgPT09IHRoaXMuXykgYnJlYWs7XG4gICAgICAgIGlmIChub2RlID09PSBwYXJlbnQuTCkge1xuICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICBpZiAoc2libGluZy5DKSB7XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc2libGluZy5MICYmIHNpYmxpbmcuTC5DIHx8IHNpYmxpbmcuUiAmJiBzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgaWYgKCFzaWJsaW5nLlIgfHwgIXNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICAgIHNpYmxpbmcuTC5DID0gZmFsc2U7XG4gICAgICAgICAgICAgIHNpYmxpbmcuQyA9IHRydWU7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgc2libGluZyk7XG4gICAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IHBhcmVudC5DO1xuICAgICAgICAgICAgcGFyZW50LkMgPSBzaWJsaW5nLlIuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBub2RlID0gdGhpcy5fO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuTDtcbiAgICAgICAgICBpZiAoc2libGluZy5DKSB7XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuTDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNpYmxpbmcuTCAmJiBzaWJsaW5nLkwuQyB8fCBzaWJsaW5nLlIgJiYgc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgIGlmICghc2libGluZy5MIHx8ICFzaWJsaW5nLkwuQykge1xuICAgICAgICAgICAgICBzaWJsaW5nLlIuQyA9IGZhbHNlO1xuICAgICAgICAgICAgICBzaWJsaW5nLkMgPSB0cnVlO1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgc2libGluZyk7XG4gICAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuTDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IHBhcmVudC5DO1xuICAgICAgICAgICAgcGFyZW50LkMgPS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Skge1xuICAgICAgdmFyIGQsIGZ4ID0gZDNfZnVuY3Rvcih4KSwgZnkgPSBkM19mdW5jdG9yKHkpLCB4cywgeXMsIGksIG4sIHgxXywgeTFfLCB4Ml8sIHkyXztcbiAgICAgIGlmICh4MSAhPSBudWxsKSB7XG4gICAgICAgIHgxXyA9IHgxLCB5MV8gPSB5MSwgeDJfID0geDIsIHkyXyA9IHkyO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgeDJfID0geTJfID0gLSh4MV8gPSB5MV8gPSBJbmZpbml0eSk7XG4gICAgICAgIHhzID0gW10sIHlzID0gW107XG4gICAgICAgIG4gPSBkYXRhLmxlbmd0aDtcbiAgICAgICAgaWYgKGNvbXBhdCkgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIGQgPSBkYXRhW2ldO1xuICAgICAgICAgIGlmIChkLnggPCB4MV8pIHgxXyA9IGQueDtcbiAgICAgICAgICBpZiAoZC55IDwgeTFfKSB5MV8gPSBkLnk7XG4gICAgICAgICAgaWYgKGQueCA+IHgyXykgeDJfID0gZC54O1xuICAgICAgICAgIGlmIChkLnkgPiB5Ml8pIHkyXyA9IGQueTtcbiAgICAgICAgICB4cy5wdXNoKGQueCk7XG4gICAgICAgICAgeXMucHVzaChkLnkpO1xuICAgICAgICB9IGVsc2UgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIHZhciB4XyA9ICtmeChkID0gZGF0YVtpXSwgaSksIHlfID0gK2Z5KGQsIGkpO1xuICAgICAgICAgIGlmICh4XyA8IHgxXykgeDFfID0geF87XG4gICAgICAgICAgaWYgKHlfIDwgeTFfKSB5MV8gPSB5XztcbiAgICAgICAgICBpZiAoeF8gPiB4Ml8pIHgyXyA9IHhfO1xuICAgICAgICAgIGlmICh5XyA+IHkyXykgeTJfID0geV87XG4gICAgICAgICAgeHMucHVzaCh4Xyk7XG4gICAgICAgICAgeXMucHVzaCh5Xyk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHZhciBkeCA9IHgyXyAtIHgxXywgZHkgPSB5Ml8gLSB5MV87XG4gICAgICBpZiAoZHggPiBkeSkgeTJfID0geTFfICsgZHg7IGVsc2UgeDJfID0geDFfICsgZHk7XG4gICAgICBmdW5jdGlvbiBpbnNlcnQobiwgZCwgeCwgeSwgeDEsIHkxLCB4MiwgeTIpIHtcbiAgICAgICAgaWYgKGlzTmFOKHgpIHx8IGlzTmFOKHkpKSByZXR1cm47XG4gICAgICAgIGlmIChuLmxlYWYpIHtcbiAgICAgICAgICB2YXIgbnggPSBuLngsIG55ID0gbi55O1xuICAgICAgICAgIGlmIChueCAhPSBudWxsKSB7XG4gICAgICAgICAgICBpZiAoYWJzKG54IC0geCkgKyBhYnMobnkgLSB5KSA8IC4wMSkge1xuICAgICAgICAgICAgICBpbnNlcnRDaGlsZChuLCBkLCB4LCB5LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB2YXIgblBvaW50ID0gbi5wb2ludDtcbiAgICAgICAgICAgICAgbi54ID0gbi55ID0gbi5wb2ludCA9IG51bGw7XG4gICAgICAgICAgICAgIGluc2VydENoaWxkKG4sIG5Qb2ludCwgbngsIG55LCB4MSwgeTEsIHgyLCB5Mik7XG4gICAgICAgICAgICAgIGluc2VydENoaWxkKG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbi54ID0geCwgbi55ID0geSwgbi5wb2ludCA9IGQ7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGluc2VydENoaWxkKG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gaW5zZXJ0Q2hpbGQobiwgZCwgeCwgeSwgeDEsIHkxLCB4MiwgeTIpIHtcbiA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O1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGlmIChzb3J0U3ViZ3JvdXBzKSB7XG4gICAgICAgIHN1Ymdyb3VwSW5kZXguZm9yRWFjaChmdW5jdGlvbihkLCBpKSB7XG4gICAgICAgICAgZC5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcbiAgICAgICAgICAgIHJldHVybiBzb3J0U3ViZ3JvdXBzKG1hdHJpeFtpXVthXSwgbWF0cml4W2ldW2JdKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBrID0gKM+EIC0gcGFkZGluZyAqIG4pIC8gaztcbiAgICAgIHggPSAwLCBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICB4MCA9IHgsIGogPSAtMTtcbiAgICAgICAgd2hpbGUgKCsraiA8IG4pIHtcbiAgICAgICAgICB2YXIgZGkgPSBncm91cEluZGV4W2ldLCBkaiA9IHN1Ymdyb3VwSW5kZXhbZGldW2pdLCB2ID0gbWF0cml4W2RpXVtkal0sIGEwID0geCwgYTEgPSB4ICs9IHYgKiBrO1xuICAgICAgICAgIHN1Ymdyb3Vwc1tkaSArIFwiLVwiICsgZGpdID0ge1xuICAgICAgICAgICAgaW5kZXg6IGRpLFxuICAgICAgICAgICAgc3ViaW5kZXg6IGRqLFxuICAgICAgICAgICAgc3RhcnRBbmdsZTogYTAsXG4gICAgICAgICAgICBlbmRBbmdsZTogYTEsXG4gICAgICAgICAgICB2YWx1ZTogdlxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgZ3JvdXBzW2RpXSA9IHtcbiAgICAgICAgICBpbmRleDogZGksXG4gICAgICAgICAgc3RhcnRBbmdsZTogeDAsXG4gICAgICAgICAgZW5kQW5nbGU6IHgsXG4gICAgICAgICAgdmFsdWU6IGdyb3VwU3Vtc1tkaV1cbiAgICAgICAgfTtcbiAgICAgICAgeCArPSBwYWRkaW5nO1xuICAgICAgfVxuICAgICAgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgaiA9IGkgLSAxO1xuICAgICAgICB3aGlsZSAoKytqIDwgbikge1xuICAgICAgICAgIHZhciBzb3VyY2UgPSBzdWJncm91cHNbaSArIFwiLVwiICsgal0sIHRhcmdldCA9IHN1Ymdyb3Vwc1tqICsgXCItXCIgKyBpXTtcbiAgICAgICAgICBpZiAoc291cmNlLnZhbHVlIHx8IHRhcmdldC52YWx1ZSkge1xuICAgICAgICAgICAgY2hvcmRzLnB1c2goc291cmNlLnZhbHVlIDwgdGFyZ2V0LnZhbHVlID8ge1xuICAgICAgICAgICAgICBzb3VyY2U6IHRhcmdldCxcbiAgICAgICAgICAgICAgdGFyZ2V0OiBzb3VyY2VcbiAgICAgICAgICAgIH0gOiB7XG4gICAgICAgICAgICAgIHNvdXJjZTogc291cmNlLFxuICAgICAgICAgICAgICB0YXJnZXQ6IHRhcmdldFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoc29ydENob3JkcykgcmVzb3J0KCk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlc29ydCgpIHtcbiAgICAgIGNob3Jkcy5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcbiAgICAgICAgcmV0dXJuIHNvcnRDaG9yZHMoKGEuc291cmNlLnZhbHVlICsgYS50YXJnZXQudmFsdWUpIC8gMiwgKGIuc291cmNlLnZhbHVlICsgYi50YXJnZXQudmFsdWUpIC8gMik7XG4gICAgICB9KTtcbiAgICB9XG4gICAgY2hvcmQubWF0cml4ID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbWF0cml4O1xuICAgICAgbiA9IChtYXRyaXggPSB4KSAmJiBtYXRyaXgubGVuZ3RoO1xuICAgICAgY2hvcmRzID0gZ3JvdXBzID0gbnVsbDtcbiAgICAgIHJldHVybiBja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BkeCAqIGs7XG4gICAgICAgICAgICAgIG5vZGUucHkgLT0gZHkgKiBrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChxdWFkLnBvaW50ICYmIGRuICYmIGRuIDwgY2hhcmdlRGlzdGFuY2UyKSB7XG4gICAgICAgICAgICB2YXIgayA9IHF1YWQucG9pbnRDaGFyZ2UgLyBkbjtcbiAgICAgICAgICAgIG5vZGUucHggLT0gZHggKiBrO1xuICAgICAgICAgICAgbm9kZS5weSAtPSBkeSAqIGs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiAhcXVhZC5jaGFyZ2U7XG4gICAgICB9O1xuICAgIH1cbiAgICBmb3JjZS50aWNrID0gZnVuY3Rpb24oKSB7XG4gICAgICBpZiAoKGFscGhhICo9IC45OSkgPCAuMDA1KSB7XG4gICAgICAgIHRpbWVyID0gbnVsbDtcbiAgICAgICAgZXZlbnQuZW5kKHtcbiAgICAgICAgICB0eXBlOiBcImVuZFwiLFxuICAgICAgICAgIGFscGhhOiBhbHBoYSA9IDBcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgICAgdmFyIG4gPSBub2Rlcy5sZW5ndGgsIG0gPSBsaW5rcy5sZW5ndGgsIHEsIGksIG8sIHMsIHQsIGwsIGssIHgsIHk7XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbTsgKytpKSB7XG4gICAgICAgIG8gPSBsaW5rc1tpXTtcbiAgICAgICAgcyA9IG8uc291cmNlO1xuICAgICAgICB0ID0gby50YXJnZXQ7XG4gICAgICAgIHggPSB0LnggLSBzLng7XG4gICAgICAgIHkgPSB0LnkgLSBzLnk7XG4gICAgICAgIGlmIChsID0geCAqIHggKyB5ICogeSkge1xuICAgICAgICAgIGwgPSBhbHBoYSAqIHN0cmVuZ3Roc1tpXSAqICgobCA9IE1hdGguc3FydChsKSkgLSBkaXN0YW5jZXNbaV0pIC8gbDtcbiAgICAgICAgICB4ICo9IGw7XG4gICAgICAgICAgeSAqPSBsO1xuICAgICAgICAgIHQueCAtPSB4ICogKGsgPSBzLndlaWdodCArIHQud2VpZ2h0ID8gcy53ZWlnaHQgLyAocy53ZWlnaHQgKyB0LndlaWdodCkgOiAuNSk7XG4gICAgICAgICAgdC55IC09IHkgKiBrO1xuICAgICAgICAgIHMueCArPSB4ICogKGsgPSAxIC0gayk7XG4gICAgICAgICAgcy55ICs9IHkgKiBrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoayA9IGFscGhhICogZ3Jhdml0eSkge1xuICAgICAgICB4ID0gc2l6ZVswXSAvIDI7XG4gICAgICAgIHkgPSBzaXplWzFdIC8gMjtcbiAgICAgICAgaSA9IC0xO1xuICAgICAgICBpZiAoaykgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gbm9kZXNbaV07XG4gICAgICAgICAgby54ICs9ICh4IC0gby54KSAqIGs7XG4gICAgICAgICAgby55ICs9ICh5IC0gby55KSAqIGs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChjaGFyZ2UpIHtcbiAgICAgICAgZDNfbGF5b3V0X2ZvcmNlQWNjdW11bGF0ZShxID0gZDMuZ2VvbS5xdWFkdHJlZShub2RlcyksIGFscGhhLCBjaGFyZ2VzKTtcbiAgICAgICAgaSA9IC0xO1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIGlmICghKG8gPSBub2Rlc1tpXSkuZml4ZWQpIHtcbiAgICAgICAgICAgIHEudmlzaXQocmVwdWxzZShvKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBvID0gbm9kZXNbaV07XG4gICAgICAgIGlmIChvLmZpeGVkKSB7XG4gICAgICAgICAgby54ID0gby5weDtcbiAg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ndW1lbnRzLmxlbmd0aCkgcmV0dXJuIE1hdGguc3FydCh0aGV0YTIpO1xuICAgICAgdGhldGEyID0geCAqIHg7XG4gICAgICByZXR1cm4gZm9yY2U7XG4gICAgfTtcbiAgICBmb3JjZS5hbHBoYSA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGFscGhhO1xuICAgICAgeCA9ICt4O1xuICAgICAgaWYgKGFscGhhKSB7XG4gICAgICAgIGlmICh4ID4gMCkge1xuICAgICAgICAgIGFscGhhID0geDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aW1lci5jID0gbnVsbCwgdGltZXIudCA9IE5hTiwgdGltZXIgPSBudWxsO1xuICAgICAgICAgIGV2ZW50LmVuZCh7XG4gICAgICAgICAgICB0eXBlOiBcImVuZFwiLFxuICAgICAgICAgICAgYWxwaGE6IGFscGhhID0gMFxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKHggPiAwKSB7XG4gICAgICAgIGV2ZW50LnN0YXJ0KHtcbiAgICAgICAgICB0eXBlOiBcInN0YXJ0XCIsXG4gICAgICAgICAgYWxwaGE6IGFscGhhID0geFxuICAgICAgICB9KTtcbiAgICAgICAgdGltZXIgPSBkM190aW1lcihmb3JjZS50aWNrKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBmb3JjZTtcbiAgICB9O1xuICAgIGZvcmNlLnN0YXJ0ID0gZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgaSwgbiA9IG5vZGVzLmxlbmd0aCwgbSA9IGxpbmtzLmxlbmd0aCwgdyA9IHNpemVbMF0sIGggPSBzaXplWzFdLCBuZWlnaGJvcnMsIG87XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgIChvID0gbm9kZXNbaV0pLmluZGV4ID0gaTtcbiAgICAgICAgby53ZWlnaHQgPSAwO1xuICAgICAgfVxuIC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1xuICAgICAgICBmb3IgKGkgPSAwLCBvID0gMDsgaSA8IG47IGkrKykgbyArPSBkYXRhW2ldW2pdWzFdO1xuICAgICAgICBpZiAobyA+IG1heCkgbWF4ID0gbztcbiAgICAgICAgc3Vtcy5wdXNoKG8pO1xuICAgICAgfVxuICAgICAgZm9yIChqID0gMDsgaiA8IG07ICsraikge1xuICAgICAgICB5MFtqXSA9IChtYXggLSBzdW1zW2pdKSAvIDI7XG4gICAgICB9XG4gICAgICByZXR1cm4geTA7XG4gICAgfSxcbiAgICB3aWdnbGU6IGZ1bmN0aW9uKGRhdGEpIHtcbiAgICAgIHZhciBuID0gZGF0YS5sZW5ndGgsIHggPSBkYXRhWzBdLCBtID0geC5sZW5ndGgsIGksIGosIGssIHMxLCBzMiwgczMsIGR4LCBvLCBvMCwgeTAgPSBbXTtcbiAgICAgIHkwWzBdID0gbyA9IG8wID0gMDtcbiAgICAgIGZvciAoaiA9IDE7IGogPCBtOyArK2opIHtcbiAgICAgICAgZm9yIChpID0gMCwgczEgPSAwOyBpIDwgbjsgKytpKSBzMSArPSBkYXRhW2ldW2pdWzFdO1xuICAgICAgICBmb3IgKGkgPSAwLCBzMiA9IDAsIGR4ID0geFtqXVswXSAtIHhbaiAtIDFdWzBdOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgZm9yIChrID0gMCwgczMgPSAoZGF0YVtpXVtqXVsxXSAtIGRhdGFbaV1baiAtIDFdWzFdKSAvICgyICogZHgpOyBrIDwgaTsgKytrKSB7XG4gICAgICAgICAgICBzMyArPSAoZGF0YVtrXVtqXVsxXSAtIGRhdGFba11baiAtIDFdWzFdKSAvIGR4O1xuICAgICAgICAgIH1cbiAgICAgICAgICBzMiArPSBzMyAqIGRhdGFbaV1bal1bMV07XG4gICAgICAgIH1cbiAgICAgICAgeTBbal0gPSBvIC09IHMxID8gczIgLyBzMSAqIGR4IDogMDtcbiAgICAgICAgaWYgKG8gPCBvMCkgbzAgPSBvO1xuICAgICAgfVxuICAgICA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c1sxXTtcbiAgICAgIGIueCA9IGIucjtcbiAgICAgIGIueSA9IDA7XG4gICAgICBib3VuZChiKTtcbiAgICAgIGlmIChuID4gMikge1xuICAgICAgICBjID0gbm9kZXNbMl07XG4gICAgICAgIGQzX2xheW91dF9wYWNrUGxhY2UoYSwgYiwgYyk7XG4gICAgICAgIGJvdW5kKGMpO1xuICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChhLCBjKTtcbiAgICAgICAgYS5fcGFja19wcmV2ID0gYztcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYywgYik7XG4gICAgICAgIGIgPSBhLl9wYWNrX25leHQ7XG4gICAgICAgIGZvciAoaSA9IDM7IGkgPCBuOyBpKyspIHtcbiAgICAgICAgICBkM19sYXlvdXRfcGFja1BsYWNlKGEsIGIsIGMgPSBub2Rlc1tpXSk7XG4gICAgICAgICAgdmFyIGlzZWN0ID0gMCwgczEgPSAxLCBzMiA9IDE7XG4gICAgICAgICAgZm9yIChqID0gYi5fcGFja19uZXh0OyBqICE9PSBiOyBqID0gai5fcGFja19uZXh0LCBzMSsrKSB7XG4gICAgICAgICAgICBpZiAoZDNfbGF5b3V0X3BhY2tJbnRlcnNlY3RzKGosIGMpKSB7XG4gICAgICAgICAgICAgIGlzZWN0ID0gMTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc2VjdCA9PSAxKSB7XG4gICAgICAgICAgICBmb3IgKGsgPSBhLl9wYWNrX3ByZXY7IGsgIT09IGouX3BhY2tfcHJldjsgayA9IGsuX3BhY2tfcHJldiwgczIrKykge1xuICAgICAgICAgICAgICBpZiAoZDNfbGF5b3V0X3BhY2tJbnRlcnNlY3RzKGssIGMpKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzZWN0KS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DEpO1xuICAgICAgICBkM19sYXlvdXRfaGllcmFyY2h5VmlzaXRCZWZvcmUocm9vdDAsIGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICBub2RlLnggPSAobm9kZS54ICsgdHgpICoga3g7XG4gICAgICAgICAgbm9kZS55ID0gbm9kZS5kZXB0aCAqIGt5O1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBub2RlcztcbiAgICB9XG4gICAgZnVuY3Rpb24gd3JhcFRyZWUocm9vdDApIHtcbiAgICAgIHZhciByb290MSA9IHtcbiAgICAgICAgQTogbnVsbCxcbiAgICAgICAgY2hpbGRyZW46IFsgcm9vdDAgXVxuICAgICAgfSwgcXVldWUgPSBbIHJvb3QxIF0sIG5vZGUxO1xuICAgICAgd2hpbGUgKChub2RlMSA9IHF1ZXVlLnBvcCgpKSAhPSBudWxsKSB7XG4gICAgICAgIGZvciAodmFyIGNoaWxkcmVuID0gbm9kZTEuY2hpbGRyZW4sIGNoaWxkLCBpID0gMCwgbiA9IGNoaWxkcmVuLmxlbmd0aDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIHF1ZXVlLnB1c2goKGNoaWxkcmVuW2ldID0gY2hpbGQgPSB7XG4gICAgICAgICAgICBfOiBjaGlsZHJlbltpXSxcbiAgICAgICAgICAgIHBhcmVudDogbm9kZTEsXG4gICAgICAgICAgICBjaGlsZHJlbjogKGNoaWxkID0gY2hpbGRyZW5baV0uY2hpbGRyZW4pICYmIGNoaWxkLnNsaWNlKCkgfHwgW10sXG4gICAgICAgICAgICBBOiBudWxsLFxuICAgICAgICAgICAgYTogbnVsbCxcbiAgICAgICAgICAgIHo6IDAsXG4gICAgICAgICAgICBtOiAwLFxuICAgICAgICAgICAgYzogMCxcbiAgICAgICAgICAgIHM6IDAsXG4gICAgICAgICAgICB0OiBudWxsLFxuICAgICAgICAgICAgaTogaVxuICAgICAgICAgIH0pLmEgPSBjaGlsZCk7XG4gICAgICAgIH1cbiAgICAgIH1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AubSwgc29wID0gdm9wLm0sIHNpbSA9IHZpbS5tLCBzb20gPSB2b20ubSwgc2hpZnQ7XG4gICAgICAgIHdoaWxlICh2aW0gPSBkM19sYXlvdXRfdHJlZVJpZ2h0KHZpbSksIHZpcCA9IGQzX2xheW91dF90cmVlTGVmdCh2aXApLCB2aW0gJiYgdmlwKSB7XG4gICAgICAgICAgdm9tID0gZDNfbGF5b3V0X3RyZWVMZWZ0KHZvbSk7XG4gICAgICAgICAgdm9wID0gZDNfbGF5b3V0X3RyZWVSaWdodCh2b3ApO1xuICAgICAgICAgIHZvcC5hID0gdjtcbiAgICAgICAgICBzaGlmdCA9IHZpbS56ICsgc2ltIC0gdmlwLnogLSBzaXAgKyBzZXBhcmF0aW9uKHZpbS5fLCB2aXAuXyk7XG4gICAgICAgICAgaWYgKHNoaWZ0ID4gMCkge1xuICAgICAgICAgICAgZDNfbGF5b3V0X3RyZWVNb3ZlKGQzX2xheW91dF90cmVlQW5jZXN0b3IodmltLCB2LCBhbmNlc3RvciksIHYsIHNoaWZ0KTtcbiAgICAgICAgICAgIHNpcCArPSBzaGlmdDtcbiAgICAgICAgICAgIHNvcCArPSBzaGlmdDtcbiAgICAgICAgICB9XG4gICAgICAgICAgc2ltICs9IHZpbS5tO1xuICAgICAgICAgIHNpcCArPSB2aXAubTtcbiAgICAgICAgICBzb20gKz0gdm9tLm07XG4gICAgICAgICAgc29wICs9IHZvcC5tO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2aW0gJiYgIWQzX2xheW91dF90cmVlUmlnaHQodm9wKSkge1xuICAgICAgICAgIHZvcC50ID0gdmltO1xuICAgICAgICAgIHZvcC5tICs9IHNpbSAtIHNvcDtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmlwICYmICFkM19sYXlvdXRfdHJlZUxlZnQodm9tKSkge1xuICAgICAgICAgIHZvbS50ID0gdmlwO1xuICAgICAgICAgIHZvbS5tICs9IHNpcCAtIHNvbTtcbiAgICAgICAgICBhbmNlc3RvciA9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KSAvIDIsIHgxID0gcmlnaHQueCArIHNlcGFyYXRpb24ocmlnaHQsIGxlZnQpIC8gMjtcbiAgICAgIGQzX2xheW91dF9oaWVyYXJjaHlWaXNpdEFmdGVyKHJvb3QsIG5vZGVTaXplID8gZnVuY3Rpb24obm9kZSkge1xuICAgICAgICBub2RlLnggPSAobm9kZS54IC0gcm9vdC54KSAqIHNpemVbMF07XG4gICAgICAgIG5vZGUueSA9IChyb290LnkgLSBub2RlLnkpICogc2l6ZVsxXTtcbiAgICAgIH0gOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICAgIG5vZGUueCA9IChub2RlLnggLSB4MCkgLyAoeDEgLSB4MCkgKiBzaXplWzBdO1xuICAgICAgICBub2RlLnkgPSAoMSAtIChyb290LnkgPyBub2RlLnkgLyByb290LnkgOiAxKSkgKiBzaXplWzFdO1xuICAgICAgfSk7XG4gICAgICByZXR1cm4gbm9kZXM7XG4gICAgfVxuICAgIGNsdXN0ZXIuc2VwYXJhdGlvbiA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNlcGFyYXRpb247XG4gICAgICBzZXBhcmF0aW9uID0geDtcbiAgICAgIHJldHVybiBjbHVzdGVyO1xuICAgIH07XG4gICAgY2x1c3Rlci5zaXplID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9kZVNpemUgPyBudWxsIDogc2l6ZTtcbiAgICAgIG5vZGVTaXplID0gKHNpemUgPSB4KSA9PSBudWxsO1xuICAgICAgcmV0dXJuIGNsdXN0ZXI7XG4gICAgfTtcbiAgICBjbHVzdGVyLm5vZGVTaXplID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9kZVNpemUgPyBzaXplIDogbnVsbDtcbiAgICAgIG5vZGVTaXplID0gKHNpemUgPSB4KSAhPSBudWxs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dC5keSAvIG5vZGUudmFsdWUpO1xuICAgICAgICByb3cuYXJlYSA9IDA7XG4gICAgICAgIHdoaWxlICgobiA9IHJlbWFpbmluZy5sZW5ndGgpID4gMCkge1xuICAgICAgICAgIHJvdy5wdXNoKGNoaWxkID0gcmVtYWluaW5nW24gLSAxXSk7XG4gICAgICAgICAgcm93LmFyZWEgKz0gY2hpbGQuYXJlYTtcbiAgICAgICAgICBpZiAobW9kZSAhPT0gXCJzcXVhcmlmeVwiIHx8IChzY29yZSA9IHdvcnN0KHJvdywgdSkpIDw9IGJlc3QpIHtcbiAgICAgICAgICAgIHJlbWFpbmluZy5wb3AoKTtcbiAgICAgICAgICAgIGJlc3QgPSBzY29yZTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcm93LmFyZWEgLT0gcm93LnBvcCgpLmFyZWE7XG4gICAgICAgICAgICBwb3NpdGlvbihyb3csIHUsIHJlY3QsIGZhbHNlKTtcbiAgICAgICAgICAgIHUgPSBNYXRoLm1pbihyZWN0LmR4LCByZWN0LmR5KTtcbiAgICAgICAgICAgIHJvdy5sZW5ndGggPSByb3cuYXJlYSA9IDA7XG4gICAgICAgICAgICBiZXN0ID0gSW5maW5pdHk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChyb3cubGVuZ3RoKSB7XG4gICAgICAgICAgcG9zaXRpb24ocm93LCB1LCByZWN0LCB0cnVlKTtcbiAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICB9XG4gICAgICAgIGNoaWxkcmVuLmZvckVhY2goc3F1YXJpZnkpO1xuICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiBzdGlja2lmeShub2RlKSB7XG4gICAgICB2YXIgY2hpbGRyZW4gPSBub2RlLmNoaWxkcmVuO1xuICAgICAgaWYgKGNoaWxkcmVuICYmIGNoaWxkcmVuLmxlbmd0aCkge1xuICAgICAgICB2YXIgcmVjdCA9IHBhZChub2RlKSwgcmVtYWluaW5nID0gY2hpbGRyZW4uc2xpY2UoKSwgY2hpbGQsIHJvdyA9IFtdO1xuICAgICAgICBzY2FsZShyZW1haW5pbmcsIHJlY3QuZHggKiByZWN0LmR5IC8gbm9kZS52YWx1ZSk7XG4gICAgICAgIHJvdy5hcmVhID0gMDtcbiAgICAgICAgd2hpbGUgKGNoaWxkID0gcmVtYWluaW5nLnBvcCgpKSB7XG4gICAgICAgICAgcm93LnB1c2goY2hpbGQpO1xuICAgICAgICAgIHJvdy5hcmVhICs9IGNoaWxkLmFyZWE7XG4gICAgICAgICAgaWYgKGNoaWxkLnogIT0gbnVsbCkge1xuICAgICAgICAgICAgcG9zaXRpb24ocm93LCBjaGlsZC56ID8gcmVjdC5keCA6IHJlY3QuZHksIHJlY3QsICFyZW1haW5pbmcubGVuZ3RoKTtcbiAgICAgICAgICAgIHJvdy5sZW5ndGggPSByb3cuYXJlYSA9IDA7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGNoaWxkcmVuLmZvckVhY2goc3RpY2tpZnkpO1xuICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiB3b3JzdChyb3csIHUpIHtcbiAgICAgIHZhciBzID0gcm93LmFyZWEsIHIsIHJtYXggPSAwLCBybWluID0gSW5maW5pdHksIGkgPSAtMSwgbiA9IHJvdy5sZW5ndGg7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBpZiAoIShyID0gcm93W2ldLmFyZWEpKSBjb250aW51ZTtcbiAgICAgICAgaWYgKHIgPCBybWluKSBybWluID0gcjtcbiAgICAgICAgaWYgKHIgPiBybWF4KSBybWF4ID0gcjtcbiAgICAgIH1cbiAgICAgIHMgKj0gcztcbiAgICAgIHUgKj0gdTtcbiAgICAgIHJldHVybiBzID8gTWF0aC5tYXgodSAqIHJtYXggKiByYXRpbyAvIHMsIHMgLyAodSAqIHJtaW4gKiByYXRpbykpIDogSW5maW5pdHk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHBvc2l0aW9uKHJvdywgdSwgcmVjdCwgZmx1c2gpIHtcbiAgICAgIHZhciBpID0gLTEsIG4gPSByb3cubGVuZ3RoLCB4ID0gcmVjdC54LCB5ID0gcmVjdC55LCB2ID0gdSA/IHJvdW5kKHJvdy5hcmVhIC8gdSkgOiAwLCBvO1xuICAgICAgaWYgKHUgPT0gcmVjdC5keCkge1xuICAgICAgICBpZiAoZmx1c2ggfHwgdiA+IHJlY3QuZHkpIHYgPSByZWN0LmR5O1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSByb3dbaV07XG4gICAgICAgICAgby54ID0geDtcbiAgICAgICAgICBvLnkgPSB5O1xuICAgICAgICAgIG8uZHkgPSB2O1xuICAgICAgICAgIHggKz0gby5keCA9IE1hdGgubWluKHJlY3QueCArIHJlY3QuZHggLSB4LCB2ID8gcm91bmQoby5hcmVhIC8gdikgOiAwKTtcbiAgICAgICAgfVxuICAgICAgICBvLnogPSB0cnVlO1xuICAgICAgICBvLmR4ICs9IHJlY3QueCArIHJlY3QuZHggLSB4O1xuICAgICAgICByZWN0LnkgKz0gdjtcbiAgICAgICAgcmVjdC5keSAtPSB2O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKGZsdXNoIHx8IHYgPiByZWN0LmR4KSB2ID0gcmVjdC5keDtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gcm93W2ldO1xuICAgICAgICAgIG8ueCA9IHg7XG4gICAgICAgICAgby55ID0geTtcbiAgICAgICAgICBvLmR4ID0gdjtcbiAgICAgICAgICB5ICs9IG8uZHkgPSBNYXRoLm1pbihyZWN0LnkgKyByZWN0LmR5IC0geSwgdiA/IHJvdW5kKG8uYXJlYSAvIHYpIDogMCk7XG4gICAgICAgIH1cbiAgICAgICAgby56ID0gZmFsc2U7XG4gICAgICAgIG8uZHkgKz0gcmVjdC55ICsgcmVjdC5keSAtIHk7XG4gICAgICAg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g7XG4gICAgICBpZiAobiA8IDIpIM+DID0gMTtcbiAgICAgIGlmIChuIDwgMSkgwrUgPSAwO1xuICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgeCwgeSwgcjtcbiAgICAgICAgZG8ge1xuICAgICAgICAgIHggPSBNYXRoLnJhbmRvbSgpICogMiAtIDE7XG4gICAgICAgICAgeSA9IE1hdGgucmFuZG9tKCkgKiAyIC0gMTtcbiAgICAgICAgICByID0geCAqIHggKyB5ICogeTtcbiAgICAgICAgfSB3aGlsZSAoIXIgfHwgciA+IDEpO1xuICAgICAgICByZXR1cm4gwrUgKyDPgyAqIHggKiBNYXRoLnNxcnQoLTIgKiBNYXRoLmxvZyhyKSAvIHIpO1xuICAgICAgfTtcbiAgICB9LFxuICAgIGxvZ05vcm1hbDogZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgcmFuZG9tID0gZDMucmFuZG9tLm5vcm1hbC5hcHBseShkMywgYXJndW1lbnRzKTtcbiAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIE1hdGguZXhwKHJhbmRvbSgpKTtcbiAgICAgIH07XG4gICAgfSxcbiAgICBiYXRlczogZnVuY3Rpb24obSkge1xuICAgICAgdmFyIHJhbmRvbSA9IGQzLnJhbmRvbS5pcndpbkhhbGwobSk7XG4gICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgIHJldHVybiByYW5kb20oKSAvIG07XG4gICAgICB9O1xuICAgIH0sXG4gICAgaXJ3aW5IYWxsOiBmdW5jdGlvbihtKSB7XG4gICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgIGZvciAodmFyIHMgPSAwLCBqID0gMDsgaiA8IG07IGorKykgcyArPSBNYXRoLnJhbmRvbSgpO1xuICAgICAgICByZXR1cm4gcztcbiAgICAgIH07XG4gICAgfVxuICB9O1xuICBkMy5zY2FsZSA9IHt9O1xuICBmdW5jdGlvbiBkM19zY2F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AgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gYmFzZTtcbiAgICAgIGJhc2UgPSArXztcbiAgICAgIGxpbmVhci5kb21haW4oZG9tYWluLm1hcChsb2cpKTtcbiAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9O1xuICAgIHNjYWxlLm5pY2UgPSBmdW5jdGlvbigpIHtcbiAgICAgIHZhciBuaWNlZCA9IGQzX3NjYWxlX25pY2UoZG9tYWluLm1hcChsb2cpLCBwb3NpdGl2ZSA/IE1hdGggOiBkM19zY2FsZV9sb2dOaWNlTmVnYXRpdmUpO1xuICAgICAgbGluZWFyLmRvbWFpbihuaWNlZCk7XG4gICAgICBkb21haW4gPSBuaWNlZC5tYXAocG93KTtcbiAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9O1xuICAgIHNjYWxlLnRpY2tzID0gZnVuY3Rpb24oKSB7XG4gICAgICB2YXIgZXh0ZW50ID0gZDNfc2NhbGVFeHRlbnQoZG9tYWluKSwgdGlja3MgPSBbXSwgdSA9IGV4dGVudFswXSwgdiA9IGV4dGVudFsxXSwgaSA9IE1hdGguZmxvb3IobG9nKHUpKSwgaiA9IE1hdGguY2VpbChsb2codikpLCBuID0gYmFzZSAlIDEgPyAyIDogYmFzZTtcbiAgICAgIGlmIChpc0Zpbml0ZShqIC0gaSkpIHtcbiAgICAgICAgaWYgKHBvc2l0aXZlKSB7XG4gICAgICAgICAgZm9yICg7aSA8IGo7IGkrKykgZm9yICh2YXIgayA9IDE7IGsgPCBuOyBrKyspIHRpY2tzLnB1c2gocG93KGkpICogayk7XG4gICAgICAgICAgdGlja3MucHVzaChwb3coaSkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRpY2tzLnB1c2gocG93KGkpKTtcbiAgICAgICAgICBmb3IgKDtpKysgPCBqOyApIGZvciAodmFyIGsgPSBuIC0gMTsgayA+IDA7IGstLSkgdGlja3MucHVzaChwb3coaSkgKiBrKTtcbiAgICAgICAgfVxuICAgIC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sIHkwLCB4MSwgeTEsIHgyLCB5MiwgeDMsIHkzLCBwYXRoID0gW107XG4gICAgICBpZiAoYXAgPSAoK3BhZEFuZ2xlLmFwcGx5KHRoaXMsIGFyZ3VtZW50cykgfHwgMCkgLyAyKSB7XG4gICAgICAgIHJwID0gcGFkUmFkaXVzID09PSBkM19zdmdfYXJjQXV0byA/IE1hdGguc3FydChyMCAqIHIwICsgcjEgKiByMSkgOiArcGFkUmFkaXVzLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgICAgIGlmICghY3cpIHAxICo9IC0xO1xuICAgICAgICBpZiAocjEpIHAxID0gZDNfYXNpbihycCAvIHIxICogTWF0aC5zaW4oYXApKTtcbiAgICAgICAgaWYgKHIwKSBwMCA9IGQzX2FzaW4ocnAgLyByMCAqIE1hdGguc2luKGFwKSk7XG4gICAgICB9XG4gICAgICBpZiAocjEpIHtcbiAgICAgICAgeDAgPSByMSAqIE1hdGguY29zKGEwICsgcDEpO1xuICAgICAgICB5MCA9IHIxICogTWF0aC5zaW4oYTAgKyBwMSk7XG4gICAgICAgIHgxID0gcjEgKiBNYXRoLmNvcyhhMSAtIHAxKTtcbiAgICAgICAgeTEgPSByMSAqIE1hdGguc2luKGExIC0gcDEpO1xuICAgICAgICB2YXIgbDEgPSBNYXRoLmFicyhhMSAtIGEwIC0gMiAqIHAxKSA8PSDPgCA/IDAgOiAxO1xuICAgICAgICBpZiAocDEgJiYgZDNfc3ZnX2FyY1N3ZWVwKHgwLCB5MCwgeDEsIHkxKSA9PT0gY3cgXiBsMSkge1xuICAgICAgICAgIHZhciBoMSA9IChhMCArIGExKSAvIDI7XG4gICAgICAgICAgeDAgPSByMSAqIE1hdGguY29zKGgxKTtcbiAgICAgICAgICB5MCA9IHIxICogTWF0aC5zaW4oaDEpO1xuICAgICAgICAgIHgxID0geTEgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB4MCA9IHkwID0gMDtcbiAgICAgIH1cbiAgICAgIGlmIChyMCkge1xuICAgICAgICB4MiA9IHIwICogTWF0aC5jb3MoYTEgLSBwMCk7XG4gICAgICAgIHkyID0gcjAgKiBNYXRoLnNpbihhMSAtIHAwKTtcbiAgICAgICAgeDMgPSByMCAqIE1hdGguY29zKGEwICsgcDApO1xuICAgICAgICB5MyA9IHIwICogTWF0aC5zaW4oYTAgKyBwMCk7XG4gICAgICAgIHZhciBsMCA9IE1hdGguYWJzKGEwIC0gYTEgKyAyICogcDApIDw9IM+AID8gMCA6IDE7XG4gICAgICAgIGlmIChwMCAmJiBkM19zdmdfYXJjU3dlZXAoeDIsIHkyLCB4MywgeTMpID09PSAxIC0gY3cgXiBsMCkge1xuICAgICAgICAgIHZhciBoMCA9IChhMCArIGExKSAvIDI7XG4gICAgICAgICAgeDIgPSByMCAqIE1hdGguY29zKGgwKTtcbiAgICAgICAgICB5MiA9IHIwICogTWF0aC5zaW4oaDApO1xuICAgICAgICAgIHgzID0geTMgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB4MiA9IHkyID0gMDtcbiAgICAgIH1cbiAgICAgIGlmIChkYSA+IM61ICYmIChyYyA9IE1hdGgubWluKE1hdGguYWJzKHIxIC0gcjApIC8gMiwgK2Nvcm5lclJhZGl1cy5hcHBseSh0aGlzLCBhcmd1bWVudHMpKSkgPiAuMDAxKSB7XG4gICAgICAgIGNyID0gcjAgPCByMSBeIGN3ID8gMCA6IDE7XG4gICAgICAgIHZhciByYzEgPSByYywgcmMwID0gcmM7XG4gICAgICAgIGlmIChkYSA8IM+AKSB7XG4gICAgICAgICAgdmFyIG9jID0geDMgPT0gbnVsbCA/IFsgeDIsIHkyIF0gOiB4MSA9PSBudWxsID8gWyB4MCwgeTAgXSA6IGQzX2dlb21fcG9seWdvbkludGVyc2VjdChbIHgwLCB5MCBdLCBbIHgzLCB5MyBdLCBbIHgxLCB5MSBdLCBbIHgyLCB5MiBdKSwgYXggPSB4MCAtIG9jWzB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7XG4gICAgICAgIHRoaXMuX19jaGFydF9fID0gZXh0ZW50MTtcbiAgICAgICAgaWYgKGQzX3RyYW5zaXRpb25Jbmhlcml0SWQpIHtcbiAgICAgICAgICBkMy5zZWxlY3QodGhpcykudHJhbnNpdGlvbigpLmVhY2goXCJzdGFydC5icnVzaFwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHhFeHRlbnREb21haW4gPSBleHRlbnQwLmk7XG4gICAgICAgICAgICB5RXh0ZW50RG9tYWluID0gZXh0ZW50MC5qO1xuICAgICAgICAgICAgeEV4dGVudCA9IGV4dGVudDAueDtcbiAgICAgICAgICAgIHlFeHRlbnQgPSBleHRlbnQwLnk7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoc3RhcnRcIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSkudHdlZW4oXCJicnVzaDpicnVzaFwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciB4aSA9IGQzX2ludGVycG9sYXRlQXJyYXkoeEV4dGVudCwgZXh0ZW50MS54KSwgeWkgPSBkM19pbnRlcnBvbGF0ZUFycmF5KHlFeHRlbnQsIGV4dGVudDEueSk7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0geUV4dGVudERvbWFpbiA9IG51bGw7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odCkge1xuICAgICAgICAgICAgICB4RXh0ZW50ID0gZXh0ZW50MS54ID0geGkodCk7XG4gICAgICAgICAgICAgIHlFeHRlbnQgPSBleHRlbnQxLnkgPSB5aSh0KTtcbiAgICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSkuZWFjaChcImVuZC5icnVzaFwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHhFeHRlbnREb21haW4gPSBleHRlbnQxLmk7XG4gICAgICAgICAgICB5RXh0ZW50RG9tYWluID0gZXh0ZW50MS5qO1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hlbmRcIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hzdGFydFwiXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hcIixcbiAgICAgICAgICAgIG1vZGU6IFwicmVzaXplXCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaGVuZFwiXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgIH07XG4gICAgZnVuY3Rpb24gcmVkcmF3KGcpIHtcbiAgICAgIGcuc2VsZWN0QWxsKFwiLnJlc2l6ZVwiKS5hdHRyKFwidHJhbnNmb3JtXCIsIGZ1bmN0aW9uKGQpIHtcbiAgICAgICAgcmV0dXJuIFwidHJhbnNsYXRlKFwiICsgeEV4dGVudFsrL2UkLy50ZXN0KGQpXSArIFwiLFwiICsgeUV4dGVudFsrL15zLy50ZXN0KGQpXSArIFwiKVwiO1xuICAgICAgfSk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJlZHJhd1goZykge1xuICAgICAgZy5zZWxlY3QoXCIuZXh0ZW50XCIpLmF0dHIoXCJ4XCIsIHhFeHRlbnRbMF0pO1xuICAg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0LnN0eWxlKFwiY3Vyc29yXCIpKTtcbiAgICAgIGV2ZW50Xyh7XG4gICAgICAgIHR5cGU6IFwiYnJ1c2hzdGFydFwiXG4gICAgICB9KTtcbiAgICAgIGJydXNobW92ZSgpO1xuICAgICAgZnVuY3Rpb24ga2V5ZG93bigpIHtcbiAgICAgICAgaWYgKGQzLmV2ZW50LmtleUNvZGUgPT0gMzIpIHtcbiAgICAgICAgICBpZiAoIWRyYWdnaW5nKSB7XG4gICAgICAgICAgICBjZW50ZXIgPSBudWxsO1xuICAgICAgICAgICAgb3JpZ2luWzBdIC09IHhFeHRlbnRbMV07XG4gICAgICAgICAgICBvcmlnaW5bMV0gLT0geUV4dGVudFsxXTtcbiAgICAgICAgICAgIGRyYWdnaW5nID0gMjtcbiAgICAgICAgICB9XG4gICAgICAgICAgZDNfZXZlbnRQcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBrZXl1cCgpIHtcbiAgICAgICAgaWYgKGQzLmV2ZW50LmtleUNvZGUgPT0gMzIgJiYgZHJhZ2dpbmcgPT0gMikge1xuICAgICAgICAgIG9yaWdpblswXSArPSB4RXh0ZW50WzFdO1xuICAgICAgICAgIG9yaWdpblsxXSArPSB5RXh0ZW50WzFdO1xuICAgICAgICAgIGRyYWdnaW5nID0gMDtcbiAgICAgICAgICBkM19ldmVudFByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGJydXNobW92ZSgpIHtcbiAgICAgICAgdmFyIHBvaW50ID0gZDMubW91c2UodGFyZ2V0KSwgbW92ZWQgPSBmYWxzZTtcbiAgICAgICAgaWYgKG9mZnNldCkge1xuICAgICAgICAgIHBvaW50WzBdICs9IG9mZnNldFswXTtcbiAgICAgICAgICBwb2ludFsxXSArPSBvZmZzZXRbMV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFkcmFnZ2luZykge1xuICAgICAgICAgIGlmIChkMy5ldmVudC5hbHRLZXkpIHtcbiAgICAgICAgICAgIGlmICghY2VudGVyKSBjZW50ZXIgPSBbICh4RXh0ZW50WzBdICsgeEV4dGVudFsxXSkgLyAyLCAoeUV4dGVudFswXSArIHlFeHRlbnRbMV0pIC8gMiBdO1xuICAgICAgICAgICAgb3JpZ2luWzBdID0geEV4dGVudFsrKHBvaW50WzBdIDwgY2VudGVyWzBdKV07XG4gICAgICAgICAgICBvcmlnaW5bMV0gPSB5RXh0ZW50WysocG9pbnRbMV0gPCBjZW50ZXJbMV0pXTtcbiAgICAgICAgICB9IGVsc2UgY2VudGVyID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICBpZiAocmVzaXppbmdYICYmIG1vdmUxKHBvaW50LCB4LCAwKSkge1xuICAgICAgICAgIHJlZHJhd1goZyk7XG4gICAgICAgICAgbW92ZWQgPSB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChyZXNpemluZ1kgJiYgbW92ZTEocG9pbnQsIHksIDEpKSB7XG4gICAgICAgICAgcmVkcmF3WShnKTtcbiAgICAgICAgICBtb3ZlZCA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1vdmVkKSB7XG4gICAgICAgICAgcmVkcmF3KGcpO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICBtb2RlOiBkcmFnZ2luZyA/IFwibW92ZVwiIDogXCJyZXNpemVcIlxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBtb3ZlMShwb2ludCwgc2NhbGUsIGkpIHtcbiAgICAgICAgdmFyIHJhbmdlID0gZDNfc2NhbGVSYW5nZShzY2FsZSksIHIwID0gcmFuZ2VbMF0sIHIxID0gcmFuZ2VbMV0sIHBvc2l0aW9uID0gb3JpZ2luW2ldLCBleHRlbnQgPSBpID8geUV4dGVudCA6IHhFeHRlbnQsIHNpemUgPSBleHRlbnRbMV0gLSBleHRlbnRbMF0sIG1pbiwgbWF4O1xuICAgICAgICBpZiAoZHJhZ2dpbmcpIHtcbiAgICAgICAgICByMCAtPSBwb3NpdGlvbjtcbiAgICAgICAgICByMSAtPSBzaXplICsgcG9zaXRpb247XG4gICAgICAgIH1cbiAgICAgICAgbWluID0gKGkgPyB5Q2xhbXAgOiB4Q2xhbXApID8gTWF0aC5tYXgocjAsIE1hdGgubWluKHIxLCBwb2ludFtpXSkpIDogcG9pbnRbaV07XG4gICAgICAgIGlmIChkcmFnZ2luZykge1xuICAgICAgICAgIG1heCA9IChtaW4gKz0gcG9zaXRpb24pICsgc2l6ZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoY2VudGVyKSBwb3NpdGlvbiA9IE1hdGgubWF4KHIwLCBNYXRoLm1pbihyMSwgMiAqIGNlbnRlcltpXSAtIG1pbikpO1xuICAgICAgICAgIGlmIChwb3NpdGlvbiA8IG1pbikge1xuICAgICAgICAgICAgbWF4ID0gbWluO1xuICAgICAgICAgICAgbWluID0gcG9zaXRpb247XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1heCA9IHBvc2l0aW9uO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoZXh0ZW50WzBdICE9IG1pbiB8fCBleHRlbnRbMV0gIT0gbWF4KSB7XG4gICAgICAgICAgaWYgKGkpIHlFeHRlbnREb21haW4gPSBudWxsOyBlbHNlIHhFeHRlbnREb21haW4gPSBudWxsO1xuICAgICAgICAgIGV4dGVudFswXSA9IG1pbjtcbiAgICAgICAgICBleHRlbnRbMV0gPSBtYXg7XG4gICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGJydXNoZW5kKCkge1xuICAgICAgICBicnVzaG1vdmUoKTtcbiAgICAgICAgZy5zdHlsZShcInBvaW50ZXItZXZlbnRzXCIsIF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sIHlDbGFtcCBdIDogeCA/IHhDbGFtcCA6IHkgPyB5Q2xhbXAgOiBudWxsO1xuICAgICAgaWYgKHggJiYgeSkgeENsYW1wID0gISF6WzBdLCB5Q2xhbXAgPSAhIXpbMV07IGVsc2UgaWYgKHgpIHhDbGFtcCA9ICEhejsgZWxzZSBpZiAoeSkgeUNsYW1wID0gISF6O1xuICAgICAgcmV0dXJuIGJydXNoO1xuICAgIH07XG4gICAgYnJ1c2guZXh0ZW50ID0gZnVuY3Rpb24oeikge1xuICAgICAgdmFyIHgwLCB4MSwgeTAsIHkxLCB0O1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgIGlmICh4KSB7XG4gICAgICAgICAgaWYgKHhFeHRlbnREb21haW4pIHtcbiAgICAgICAgICAgIHgwID0geEV4dGVudERvbWFpblswXSwgeDEgPSB4RXh0ZW50RG9tYWluWzFdO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB4MCA9IHhFeHRlbnRbMF0sIHgxID0geEV4dGVudFsxXTtcbiAgICAgICAgICAgIGlmICh4LmludmVydCkgeDAgPSB4LmludmVydCh4MCksIHgxID0geC5pbnZlcnQoeDEpO1xuICAgICAgICAgICAgaWYgKHgxIDwgeDApIHQgPSB4MCwgeDAgPSB4MSwgeDEgPSB0O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoeSkge1xuICAgICAgICAgIGlmICh5RXh0ZW50RG9tYWluKSB7XG4gICAgICAgICAgICB5MCA9IHlFeHRlbnREb21haW5bMF0sIHkxID0geUV4dGVudERvbWFpblsxXTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeTAgPSB5RXh0ZW50WzBdLCB5MSA9IHlFeHRlbnRbMV07XG4gICAgICAgICAgICBpZiAoeS5pbnZlcnQpIHkwID0geS5pbnZlcnQoeTApLCB5MSA9IHkuaW52ZXJ0KHkxKTtcbiAgICAgICAgICAgIGlmICh5MSA8IHkwKSB0ID0geTAsIHkwID0geTEsIHkxID0gdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHggJiYgeSA/IFsgWyB4MCwgeTAgXSwgWyB4MSwgeTEgXSBdIDogeCA/IFsgeDAsIHgxIF0gOiB5ICYmIFsgeTAsIHkxIF07XG4gICAgICB9XG4gICAgICBpZiAoeCkge1xuICAgICAgICB4MCA9IHpbMF0sIHgxID0gelsxXTtcbiAgICAgICAgaWYgKHkpIHgwID0geDBbMF0sIHgxID0geDFbMF07XG4gICAgICAgIHhFeHRlbnREb21haW4gPSBbIHgwLCB4MSBdO1xuICAgICAgICBpZiAoeC5pbnZlcnQpIHgwID0geCh4MCksIHgxID0geCh4MSk7XG4gICAgICAgIGlmICh4MSA8IHgwKSB0ID0geDAsIHgwID0geDEsIHgxID0gdDtcbiAgICAgICAgaWYgKHgwICE9IHhFeHRlbnRbMF0gfHwgeDEgIT0geEV4dGVudFsxXSkgeEV4dGVudCA9IFsgeDAsIHgxIF07XG4gICAgICB9XG4gICAgICBpZiAoeSkge1xuICAgICAgICB5MCA9IHpbMF0sIHkxID0gelsxXTtcbiAgICAgICAgaWYgKHgpIHkwID0geTBbMV0sIHkxID0geTFbMV07XG4gICAgICAgIHlFeHRlbnREb21haW4gPSBbIHkwLCB5MSBdO1xuICAgICAgICBpZiAoeS5pbnZlcnQpIHkwID0geSh5MCksIHkxID0geSh5MSk7XG4gICAgICAgIGlmICh5MSA8IHkwKSB0ID0geTAsIHkwID0geTEsIHkxID0gdDtcbiAgICAgICAgaWYgKHkwICE9IHlFeHRlbnRbMF0gfHwgeTEgIT0geUV4dGVudFsxXSkgeUV4dGVudCA9IFsgeTAsIHkxIF07XG4gICAgICB9XG4gICAgICByZXR1cm4gYnJ1c2g7XG4gICAgfTtcbiAgICBicnVzaC5jbGVhciA9IGZ1bmN0aW9uKCkge1xuICAgICAgaWYgKCFicnVzaC5lbXB0eSgpKSB7XG4gICAgICAgIHhFeHRl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iAgICAgICAgICB7eyNvcmRlcnM6b3JkZXJ9fVxuICAgICAgICAgICAgPHRyIGlkPVwib3JkZXIte3sgaWQgfX1cIj5cbiAgICAgICAgICAgICAgPHRkPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57eyBpbnZvaWNlX25vIH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57eyBidXllcl9mdWxsbmFtZSB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgYnV5ZXJfZW1haWwgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IGJ1eWVyX3Bob25lIH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57e2N1cnJlbmN5fX17eyBhbW91bnQgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IG9yZGVyX2RhdGUgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IGlkIH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD5cbiAgICAgICAgICAgICAgICA8cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj5cbiAgICAgICAgICAgICAgICAgIHt7I2lmIGFtb3VudCA9PT0gMH19XG4gICAgICAgICAgICAgICAgICAgIDxzcGFuPkZyZWUgb3JkZXI8L3NwYW4+XG4gICAgICAgICAgICAgICAgICB7e2Vsc2V9fVxuICAgICAgICAgICAgICAgICAgICA8c3Bhbj5QYWlkIG9yZGVyPC9zcGFuPlxuICAgICAgICAgICAgICAgICAge3svaWZ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WNsaWNrPVwiaGlkZU9yZGVyXCIgY2xhc3M9XCJjbG9zZS1idXR0b25cIj48aSBjbGFzcz1cImZhIGZhLWNsb3NlXCI+PC9pPjwvYnV0dG9uPlxuICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwib3JkZXItdGl0bGVcIj5PcmRlciBJbnZvaWNlIE5vOiB7e2ludm9pY2Vfbm99fTwvcD5cbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwibGluZS1pdGVtcy13cmFwcGVyXCI+XG4gICAgICAgICAgICAgICAgICB7eyNsaW5lX2l0ZW1zOmxpbmVfaXRlbX19XG4gICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0aWNrZXQgY29sLXNtLTYgY29sLXhzLTEyXCIgaWQ9XCJpdGVtLXt7IEBpbmRleCB9fVwiPlxuICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJoZWFkaW5nXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGlja2V0LXR5cGVcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+e3sgdGl0bGUgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGVudFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbnRlbnQtYm94XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+aWQ6PC9zcGFuPiB7eyBpZCB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5CYXNlIGFtb3VudDo8L3NwYW4+IHt7IGN1cnJlbmN5IH19e3sgYmFzZV9hbW91bnQgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+RGlzY291bnRlZCBhbW91bnQ6PC9zcGFuPiB7eyBjdXJyZW5jeSB9fXt7IGRpc2NvdW50ZWRfYW1vdW50IH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPkZpbmFsIGFtb3VudDo8L3NwYW4+IHt7IGN1cnJlbmN5IH19e3sgZmluYWxfYW1vdW50IH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICB7eyNkaXNjb3VudF9wb2xpY3l9fTxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+RGlzY291bnQgcG9saWN5Ojwvc3Bhbj4gPHNwYW4gY2xhc3M9XCJsaW5lLWl0ZW0tZGlzY291bnRcIj57eyBkaXNjb3VudF9wb2xpY3kgfX08L3NwYW4+e3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3sjZGlzY291bnRfY291cG9ufX08cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPkRpc2NvdW50IGNvdXBvbjo8L3NwYW4+IDxzcGFuIGNsYXNzPVwibGluZS1pdGVtLWRpc2NvdW50XCI+e3sgZGlzY291bnRfY291cG9uIH19PC9zcGFuPnt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHt7I2NhbmNlbGxlZF9hdH19PHA+PGI+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGUgY2FuY2VsbGVkXCI+Q2FuY2VsbGVkIGF0OiB7eyBjYW5jZWxsZWRfYXQgfX08L3NwYW4+PC9iPjwvcD57ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgICB7eyNhc3NpZ25lZV9kZXRhaWxzfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPkZ1bGxuYW1lOjwvc3Bhbj4ge3sgZnVsbG5hbWUgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5FbWFpbDo8L3NwYW4+IHt7IGVtYWlsIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+UGhvbmU6PC9zcGFuPiB7eyBwaG9uZSB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7eyNkZXRhaWxzOmtleSB9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj57eyBrZXkgfX06PC9zcGFuPiB7eyAuIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHt7ZWxzZX19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PGI+Tm90IGFzc2lnbmVkPC9iPjwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3sjY2FuY2VsX3RpY2tldF91cmwgJiYgIWNhbmNlbGxlZF9hdH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYm94b2ZmaWNlLWJ1dHRvbiBib3hvZmZpY2UtYnV0dG9uLXNtYWxsIGJveG9mZmljZS1idXR0b24taW5mb1wiIGhyZWY9XCJqYXZhc2NyaXB0OnZvaWQoMClcIiBvbi1jbGljaz1cImNhbmNlbFRpY2tldFwiIHt7I2NhbmNlbGxpbmd9fWRpc2FibGVke3svfX0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbmNlbCB7eyNjYW5jZWxsaW5nfX08aSBjbGFzcz1cImZhIGZhLXNwaW5uZXIgZmEtc3BpblwiPjwvaT57ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwiZXJyb3ItbXNnIGxlZnQtYWxpZ25lZFwiPnt7Y2FuY2VsX2Vycm9yfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIHt7L3Nob3dfb3JkZXJ9fVxuICAgICAgICAgIHt7L29yZGVyc319XG4gICAgICAgICAgPC90Ym9keT5cbiAgICAgICAgICA8dGZvb3Q+XG4gICAgICAgICAgICA8dHI+XG4gICAgICAgICAgICAgIDx0ZCBjb2xzcGFuPVwiMTBcIj5cbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFnaW5hdGlvbiBwYWdpbmF0aW9uLWNlbnRlcmVkXCI+PC9kaXY+XG4gICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICA8L3RyPlxuICAgICAgICAgIDwvdGZvb3Q+XG4gICAgICAgIDwvdGFibGU+XG4gICAgICA8L2Rpdj5cbiAgICB7e2Vsc2V9fVxuICAgICAgPHAgY2xhc3M9XCJ0ZXh0LWNlbnRlclwiPkN1cnJlbnRseSBubyBvcmRlcnMuPC9wPlxuICAgIHt7L2lmfX1cbiAgPC9kaXY+XG5gXG4iLCJcbmV4cG9ydCBjb25zdCBSZXBvcnRUZW1wbGF0ZSA9IGBcbiAgPGRpdiBjbGFzcz1cImNvbnRlbnQtd3Jh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AgICAgICAgIHt7I2RldGFpbHM6ayx2fX1cbiAgICAgICAgICAgICAgICB7eyNpZiBrICE9PSAnbG9nbyd9fVxuICAgICAgICAgICAgICAgICAgPHAgY2xhc3M9XCJzZWN0aW9uLXRpdGxlXCI+e3trfX08L3A+XG4gICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2VjdGlvbi1jb250ZW50XCI+e3t7ZGV0YWlsc1trXX19fTwvZGl2PlxuICAgICAgICAgICAgICAgIHt7L2lmfX1cbiAgICAgICAgICAgICAge3svZGV0YWlsc319XG4gICAgICAgICAgICAgIDxwIGNsYXNzPVwic2VjdGlvbi10aXRsZVwiPkNvbnRhY3QgZW1haWw8L3A+XG4gICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJzZWN0aW9uLWNvbnRlbnRcIj57e2NvbnRhY3RfZW1haWx9fTwvZGl2PlxuICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYnRuLXdyYXBwZXJcIj5cbiAgICAgICAgICAgICAgICA8YSBjbGFzcz1cImJveG9mZmljZS1idXR0b24gYm94b2ZmaWNlLWJ1dHRvbi1hY3Rpb25cIiBocmVmPVwiamF2YXNjcmlwdDp2b2lkKDApXCIgb24tY2xpY2s9XCJuYXZpZ2F0ZVwiPlZpZXcgaXRlbSBjb2xsZWN0aW9uczwvYT5cbiAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgIHt7I2luZm9Nc2d9fVxuICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwiaW5mby1tc2dcIj57eyBpbmZvTXNnIH19IDxpIGNsYXNzPVwiZmEgZmEtY2hlY2tcIj48L2k+PC9wPlxuICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvZGl2PlxuICAgICAge3svb3Jnc319XG4gICAgPC9kaXY+XG4gIDwvZGl2PlxuYFxuIiwiZXhwb3J0IGNvbnN0IFRhYmxlVGVtcGxhdGUgPSBgXG4gIDxkaXYgY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c2V0KGV2ZW50LmtleXBhdGggKyAnLmNhbmNlbGxlZF9hdCcsIHJlc3BvbnNlLnJlc3VsdC5jYW5jZWxsZWRfYXQpO1xuICAgICAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5jYW5jZWxsaW5nJywgZmFsc2UpO1xuICAgICAgICAgIH0pLmZhaWwoZnVuY3Rpb24ocmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBlcnJvcl90ZXh0O1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnJlYWR5U3RhdGUgPT09IDQpIHtcbiAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnN0YXR1cyA9PT0gNTAwKSB7XG4gICAgICAgICAgICAgICAgZXJyb3JfdGV4dCA9IFwiU2VydmVyIEVycm9yXCI7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZXJyb3JfdGV4dCA9IEpTT04ucGFyc2UocmVzcG9uc2UucmVzcG9uc2VUZXh0KS5lcnJvcl9kZXNjcmlwdGlvbjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgIGVycm9yX3RleHQgPSBcIlVuYWJsZSB0byBjb25uZWN0LiBQbGVhc2UgdHJ5IGFnYWluIGxhdGVyLlwiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5jYW5jZWxfZXJyb3InLCBlcnJvcl90ZXh0KTtcbiAgICAgICAgICAgIG1haW5fcmFjdGl2ZS5zZXQoZXZlbnQua2V5cGF0aCArICcuY2FuY2VsbGluZycsIGZhbHNlKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdwb3BzdGF0ZScsIChldmVudCkgPT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hLWhvbWUnLFxuICAgICAgICAgIHZpZXc6ICdob21lJ1xuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgdXJsOiBPcmdNb2RlbC51cmxGb3IoJ2luZGV4Jywge29yZ19uYW1lOiBjb25maWcub3JnX25hbWV9KVsncmVsYXRpdmVfcGF0aCddLFxuICAgICAgICAgIHRpdGxlOiAnT3JnYW5pemF0aW9uJyxcbiAgICAgICAgICBpY29uOiAnZmEtc2l0ZW1hcCcsXG4gICAgICAgICAgdmlldzogJ29yZydcbiAgICAgICAgfSxcbiAgICAgICAge1xuICAgICAgICAgIHVybDogSXRlbUNvbGxlY3Rpb25Nb2RlbC51cmxGb3IoJ2luZGV4Jywge2ljX2lkOiBjb25maWcuaWNfaWR9KVsncmVsYXRpdmVfcGF0aCddLFxuICAgICAgICAgIHRpdGxlOiAnRGFzaGJvYXJkJyxcbiAgICAgICAgICBpY29uOiAnZmEtZGFzaGJvYXJkJyxcbiAgICAgICAgICB2aWV3OiAnZGFzaGJvYXJkJ1xuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgdXJsOiBPcmRlck1vZGVsLnVybEZvcignaW5kZXgnLCB7aWNfaWQ6IGNvbmZpZy5pY19pZH0pWydyZWxhdGl2ZV9wYXRoJ10sXG4gICAgICAgICAgdGl0bGU6ICdPcmRlcnMnLFxuICAgICAgICAgIGljb246ICdmYS1zaG9wcGluZy1jYXJ0JyxcbiAgICAgICAgICB2aWV3OiAnb3JkZXJzJ1xuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgdXJsOiBSZXBvcnRNb2RlbC51cmxGb3IoJ2luZGV4Jywge2ljX2lkOiBjb25maWcuaWNfaWR9KVsncmVsYXRpdmVfcGF0aCddLFxuICAgICAgICAgIHRpdGxlOiAnUmVwb3J0cycsXG4gICAgICAgICAgaWNvbjogJ2ZhLWZpbGUtZXhjZWwtbycsXG4gICAgICAgICAgdmlldzogJ3JlcG9ydHMnXG4gICAgICAgIH1cbi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kge1xuICAgICAgICAvLyBjYW4gZG8gc29tZXRoaW5nXG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5hZnRlckluaXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIC8vIGNhbiBkbyBzb21ldGhpbmdcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmluaXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcblxuICAgICAgICAkJC5pbml0UGFyYW1zKCk7XG5cbiAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3VybCkge1xuICAgICAgICAgICAgJCQuY29udmVydFVybFRvRGF0YShjb25maWcuZGF0YV91cmwsIGNvbmZpZy5kYXRhX21pbWVUeXBlLCBjb25maWcuZGF0YV9oZWFkZXJzLCBjb25maWcuZGF0YV9rZXlzLCAkJC5pbml0V2l0aERhdGEpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGNvbmZpZy5kYXRhX2pzb24pIHtcbiAgICAgICAgICAgICQkLmluaXRXaXRoRGF0YSgkJC5jb252ZXJ0SnNvblRvRGF0YShjb25maWcuZGF0YV9qc29uLCBjb25maWcuZGF0YV9rZXlzKSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoY29uZmlnLmRhdGFfcm93cykge1xuICAgICAgICAgICAgJCQuaW5pdFdpdGhEYXRhKCQkLmNvbnZlcnRSb3dzVG9EYXRhKGNvbmZpZy5kYXRhX3Jvd3MpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChjb25maWcuZGF0YV9jb2x1bW5zKSB7XG4gICAgICAgICAgICAkJC5pbml0V2l0aERhdGEoJCQuY29udmVydENvbHVtbnNUb0RhdGEoY29uZmlnLmRhdGFfY29sdW1ucykpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgRXJyb3IoJ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RhX2hpZGUgPT09IHRydWUgPyAkJC5tYXBUb0lkcygkJC5kYXRhLnRhcmdldHMpIDogY29uZmlnLmRhdGFfaGlkZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbmZpZy5sZWdlbmRfaGlkZSkge1xuICAgICAgICAgICAgJCQuYWRkSGlkZGVuTGVnZW5kSWRzKGNvbmZpZy5sZWdlbmRfaGlkZSA9PT0gdHJ1ZSA/ICQkLm1hcFRvSWRzKCQkLmRhdGEudGFyZ2V0cykgOiBjb25maWcubGVnZW5kX2hpZGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gd2hlbiBnYXVnZSwgaGlkZSBsZWdlbmQgLy8gVE9ETzogZml4XG4gICAgICAgIGlmICgkJC5oYXNUeXBlKCdnYXVnZScpKSB7XG4gICAgICAgICAgICBjb25maWcubGVnZW5kX3Nob3cgPSBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEluaXQgc2l6ZXMgYW5kIHNjYWxlc1xuICAgICAgICAkJC51cGRhdGVTaXplcygpO1xuICAgICAgICAkJC51cGRhdGVTY2FsZXMoKTtcblxuICAgICAgICAvLyBTZXQgZG9tYWlucyBmb3IgZWFjaCBzY2FsZVxuICAgICAgICAkJC54LmRvbWFpbihkMy5leHRlbnQoJCQuZ2V0WERvbWFpbigkJC5kYXRhLnRhcmdldHMpKSk7XG4gICAgICAgICQkLnkuZG9tYWluKCQkLmdldFlEb21haW4oJCQuZGF0YS50YXJnZXRzLCAneScpKTtcbiAgICAgICAgJCQueTIuZG9tYWluKCQkLmdldFlEb21haW4oJCQuZGF0YS50YXJnZXRzLCAneTInKSk7XG4gICAgICAgICQkLnN1YlguZG9tYWluKCQkLnguZG9tYWluKCkpO1xuICAgICAgICAkJC5zdWJZLmRvbWFpbigkJC55LmRvbWFpbigpKTtcbiAgICAgICAgJCQuc3ViWTIuZG9tYWluKCQkLnkyLmRvbWFpbigpKTtcblxuICAgICAgICAvLyBTYXZlIG9yaWdpb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vb21SZWN0KVxuICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgJCQud2lkdGgpXG4gICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgJCQuaGVpZ2h0KVxuICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMClcbiAgICAgICAgICAgIC5vbihcImRibGNsaWNrLnpvb21cIiwgbnVsbCk7XG5cbiAgICAgICAgLy8gU2V0IGRlZmF1bHQgZXh0ZW50IGlmIGRlZmluZWRcbiAgICAgICAgaWYgKGNvbmZpZy5heGlzX3hfZXh0ZW50KSB7ICQkLmJydXNoLmV4dGVudCgkJC5nZXREZWZhdWx0RXh0ZW50KCkpOyB9XG5cbiAgICAgICAgLy8gQWRkIEF4aXNcbiAgICAgICAgJCQuYXhpcy5pbml0KCk7XG5cbiAgICAgICAgLy8gU2V0IHRhcmdldHNcbiAgICAgICAgJCQudXBkYXRlVGFyZ2V0cygkJC5kYXRhLnRhcmdldHMpO1xuXG4gICAgICAgIC8vIERyYXcgd2l0aCB0YXJnZXRzXG4gICAgICAgIGlmIChiaW5kaW5nKSB7XG4gICAgICAgICAgICAkJC51cGRhdGVEaW1lbnNpb24oKTtcbiAgICAgICAgICAgICQkLmNvbmZpZy5vbmluaXQuY2FsbCgkJCk7XG4gICAgICAgICAgICAkJC5yZWRyYXcoe1xuICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uOiBmYWxzZSxcbiAgICAgICAgICAgICAgICB3aXRoVHJhbnNmb3JtOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uRm9yQXhpczogZmFsc2VcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQmluZCByZXNpemUgZXZlbnRcbiAgICAgICAgJCQuYmluZFJlc2l6ZSgpO1xuXG4gICAgICAgIC8vIGV4cG9ydCBlbGVtZW50IG9mIHRoZSBjaGFydFxuICAgICAgICAkJC5hcGkuZWxlbWVudCA9ICQkLnNlbGVjdENoYXJ0Lm5vZGUoKTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uc21vb3RoTGluZXMgPSBmdW5jdGlvbiAoZWwsIHR5cGUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgaWYgKHR5cGUgPT09ICdncmlkJykge1xuICAgICAgICAgICAgZWwuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGcgPSAkJC5kMy5zZWxlY3QodGhpcyksXG4gICAgICAgICAgICAgICAgICAgIHgxID0gZy5hdHRyKCd4MScpLFxuICAgICAgICAgICAgICAgICAgICB4MiA9IGcuYXR0cigneDInKSxcbiAgICAgICAgICAgICAgICAgICAgeTEgPSBnLmF0dHIoJ3kxJyksXG4gICAgICAgICAgICAgICAgICAgIHkyID0gZy5hdHRyKCd5MicpO1xuICAgICAgICAgICAgICAgIGcuYXR0cih7XG4gICAgICAgICAgICAgICAgICAgICd4MSc6IE1hdGguY2VpbCh4MSksXG4gICAgICAgICAgICAgICAgICAgICd4Mic6IE1hdGguY2VpbCh4MiksXG4gICAgICAgICAgICAgICAgICAgICd5MSc6IE1hdGguY2VpbCh5MSksXG4gICAgICAgICAgICAgICAgICAgICd5Mic6IE1hdGguY2VpbCh5MilcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlU2l6ZXMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgdmFyIGxlZ2VuZEhlaWdodCA9ICQkLmxlZ2VuZCA/ICQkLm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ICAgICAgIH1cblxuICAgICAgICAvLyBNRU1POiBuZWVkZWQgZm9yIGdyaWRzIGNhbGN1bGF0aW9uXG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkgJiYgdGFyZ2V0c1RvU2hvdy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICQkLnguZG9tYWluKFswLCAkJC5heGVzLnguc2VsZWN0QWxsKCcudGljaycpLnNpemUoKV0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRhcmdldHNUb1Nob3cubGVuZ3RoKSB7XG4gICAgICAgICAgICAkJC51cGRhdGVYRG9tYWluKHRhcmdldHNUb1Nob3csIHdpdGhVcGRhdGVYRG9tYWluLCB3aXRoVXBkYXRlT3JnWERvbWFpbiwgd2l0aFRyaW1YRG9tYWluKTtcbiAgICAgICAgICAgIGlmICghY29uZmlnLmF4aXNfeF90aWNrX3ZhbHVlcykge1xuICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMgPSAkJC5heGlzLnVwZGF0ZVhBeGlzVGlja1ZhbHVlcyh0YXJnZXRzVG9TaG93KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICQkLnhBeGlzLnRpY2tWYWx1ZXMoW10pO1xuICAgICAgICAgICAgJCQuc3ViWEF4aXMudGlja1ZhbHVlcyhbXSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY29uZmlnLnpvb21fcmVzY2FsZSAmJiAhb3B0aW9ucy5mbG93KSB7XG4gICAgICAgICAgICB4RG9tYWluRm9yWm9vbSA9ICQkLngub3JnRG9tYWluKCk7XG4gICAgICAgIH1cblxuICAgICAgICAkJC55LmRvbWFpbigkJC5nZXRZRG9tYWluKHRhcmdldHNUb1Nob3csICd5JywgeERvbWFpbkZvclpvb20pKTtcbiAgICAgICAgJCQueTIuZG9tYWluKCQkLmdldFlEb21haW4odGFyZ2V0c1RvU2hvdywgJ3kyJywgeERvbWFpbkZvclpvb20pKT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3hfdGlja19jdWxsaW5nX21heCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJ2YWxGb3JDdWxsaW5nID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuYXhpc1ggKyAnIC50aWNrIHRleHQnKS5lYWNoKGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IHRpY2tWYWx1ZXMuaW5kZXhPZihlKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5zdHlsZSgnZGlzcGxheScsIGluZGV4ICUgaW50ZXJ2YWxGb3JDdWxsaW5nID8gJ25vbmUnIDogJ2Jsb2NrJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5heGlzWCArICcgLnRpY2sgdGV4dCcpLnN0eWxlKCdkaXNwbGF5JywgJ2Jsb2NrJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBzZXR1cCBkcmF3ZXIgLSBNRU1POiB0aGVzZSBtdXN0IGJlIGNhbGxlZCBhZnRlciBheGlzIHVwZGF0ZWRcbiAgICAgICAgZHJhd0FyZWEgPSAkJC5nZW5lcmF0ZURyYXdBcmVhID8gJCQuZ2VuZXJhdGVEcmF3QXJlYShhcmVhSW5kaWNlcywgZmFsc2UpIDogdW5kZWZpbmVkO1xuICAgICAgICBkcmF3QmFyID0gJCQuZ2VuZXJhdGVEcmF3QmFyID8gJCQuZ2VuZXJhdGVEcm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HtcbiAgICAgICAgICAgICAgICB0YXJnZXRzOiB0YXJnZXRzVG9TaG93LFxuICAgICAgICAgICAgICAgIGZsb3c6IG9wdGlvbnMuZmxvdyxcbiAgICAgICAgICAgICAgICBkdXJhdGlvbjogb3B0aW9ucy5mbG93LmR1cmF0aW9uLFxuICAgICAgICAgICAgICAgIGRyYXdCYXI6IGRyYXdCYXIsXG4gICAgICAgICAgICAgICAgZHJhd0xpbmU6IGRyYXdMaW5lLFxuICAgICAgICAgICAgICAgIGRyYXdBcmVhOiBkcmF3QXJlYSxcbiAgICAgICAgICAgICAgICBjeDogY3gsXG4gICAgICAgICAgICAgICAgY3k6IGN5LFxuICAgICAgICAgICAgICAgIHh2OiB4dixcbiAgICAgICAgICAgICAgICB4Rm9yVGV4dDogeEZvclRleHQsXG4gICAgICAgICAgICAgICAgeUZvclRleHQ6IHlGb3JUZXh0XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgoZHVyYXRpb24gfHwgZmxvdykgJiYgJCQuaXNUYWJWaXNpYmxlKCkpIHsgLy8gT25seSB1c2UgdHJhbnNpdGlvbiBpZiB0YWIgdmlzaWJsZS4gU2VlICM5MzguXG4gICAgICAgICAgICAvLyB0cmFuc2l0aW9uIHNob3VsZCBiZSBkZXJpdmVkIGZyb20gb25lIHRyYW5zaXRpb25cbiAgICAgICAgICAgIGQzLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbikuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRyYW5zaXRpb25zVG9XYWl0ID0gW107XG5cbiAgICAgICAgICAgICAgICAvLyByZWRyYXcgYW5kIGdhdGhlciB0cmFuc2l0aW9uc1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3QmFyKGRyYXdCYXIsIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdMaW5lKGRyYXdMaW5lLCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3QXJlYShkcmF3QXJlYSwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0NpcmNsZShjeCwgY3ksIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdUZXh0KHhGb3JUZXh0LCB5Rm9yVGV4dCwgb3B0aW9ucy5mbG93LCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3UmVnaW9uKHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdHcmlkKHRydWUpLFxuICAgICAgICAgICAgICAgIF0uZm9yRWFjaChmdW5jdGlvbiAodHJhbnNpdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAodHJhbnNpdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbnNUb1dhaXQucHVzaCh0cmFuc2l0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAvLyBXYWl0IGZvciBlbmQgb2YgdHJhbnNpdGlvbnMgdG8gY2FsbCBmbG93IGFuZCBvbnJlbmRlcmVkIGNhbGxiYWNrXG4gICAgICAgICAgICAgICAgd2FpdEZvckRyYXcgPSAkJC5nZW5lcmF0ZVdhaXQoKTtcbiAgICAgICAgICAgICAgICB0cmFuc2l0aW9uc1RvV2FpdC5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgIHdhaXRGb3JEcmF3LmFkZCh0KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2FsbCh3YWl0Rm9yRHJhdywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmIChmbG93KSB7XG4gICAgICAgICAgICAgICAgICAgIGZsb3coKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5vbnJlbmRlcmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5vbnJlbmRlcmVkLmNhbGwoJCQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgJCQucmVkcmF3QmFyKGRyYXdCYXIpO1xuICAgICAgICAgICAgJCQucmVkcmF3TGluZShkcmF3TGluZSk7XG4gICAgICAgICAgICAkJC5yZWRyYXdBcmVhKGRyYXdBcmVhKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0NpcmNsZShjeCwgY3kpO1xuICAgICAgICAgICAgJCQucmVkcmF3VGV4dCh4Rm9yVGV4dCwgeUZvclRleHQsIG9wdGlvbnMuZmxvdyk7XG4gICAgICAgICAgICAkJC5yZWRyYXdSZWdpb24oKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0dyaWQoKTtcbiAgICAgICAgICAgIGlmIChjb25maWcub25yZW5kZXJlZCkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5vbnJlbmRlcmVkLmNhbGwoJCQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gdXBkYXRlIGZhZGVpbiBjb25kaXRpb25cbiAgICAgICAgJCQubWFwVG9JZHMoJCQuZGF0YS50YXJnZXRzKS5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgJCQud2l0aG91dEZhZGVJbltpZF0gPSB0cnVlO1xuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlQW5kUmVkcmF3ID0gZnVuY3Rpb24gKG9wdGlvbnMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCB0cmFuc2l0aW9ucztcb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HNlIGlmICh0YXJnZXQgPT09ICdsZWdlbmQnKSB7XG4gICAgICAgICAgICB4ID0gJCQubWFyZ2luMy5sZWZ0O1xuICAgICAgICAgICAgeSA9ICQkLm1hcmdpbjMudG9wO1xuICAgICAgICB9IGVsc2UgaWYgKHRhcmdldCA9PT0gJ3gnKSB7XG4gICAgICAgICAgICB4ID0gMDtcbiAgICAgICAgICAgIHkgPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6ICQkLmhlaWdodDtcbiAgICAgICAgfSBlbHNlIGlmICh0YXJnZXQgPT09ICd5Jykge1xuICAgICAgICAgICAgeCA9IDA7XG4gICAgICAgICAgICB5ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmhlaWdodCA6IDA7XG4gICAgICAgIH0gZWxzZSBpZiAodGFyZ2V0ID09PSAneTInKSB7XG4gICAgICAgICAgICB4ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiAkJC53aWR0aDtcbiAgICAgICAgICAgIHkgPSBjb25maWcuYXhpc19yb3RhdGVkID8gMSA6IDA7XG4gICAgICAgIH0gZWxzZSBpZiAodGFyZ2V0ID09PSAnc3VieCcpIHtcbiAgICAgICAgICAgIHggPSAwO1xuICAgICAgICAgICAgeSA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogJCQuaGVpZ2h0MjtcbiAgICAgICAgfSBlbHNlIGlmICh0YXJnZXQgPT09ICdhcmMnKSB7XG4gICAgICAgICAgICB4ID0gJCQuYXJjV2lkdGggLyAyO1xuICAgICAgICAgICAgeSA9ICQkLmFyY0hlaWdodCAvIDI7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFwidHJhbnNsYXRlKFwiICsgeCArIFwiLFwiICsgeSArIFwiKVwiO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaW5pdGlhbE9wYWNpdHkgPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICByZXR1cm4gZC52YWx1ZSAhPT0gb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AgICAgICAgd2luZG93LmNvbnNvbGUuZXJyb3IoXCJNdXRhdGlvbk9ic2VydmVyIG5vdCBkZWZpbmVkLlwiKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBvYnNlcnZlcj0gbmV3IE11dGF0aW9uT2JzZXJ2ZXIoZnVuY3Rpb24gKG11dGF0aW9ucykge1xuICAgICAgICAgICAgbXV0YXRpb25zLmZvckVhY2goZnVuY3Rpb24gKG11dGF0aW9uKSB7XG4gICAgICAgICAgICAgICAgaWYgKG11dGF0aW9uLnR5cGUgPT09ICdjaGlsZExpc3QnICYmIG11dGF0aW9uLnByZXZpb3VzU2libGluZykge1xuICAgICAgICAgICAgICAgICAgICBvYnNlcnZlci5kaXNjb25uZWN0KCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gd2FpdCBmb3IgY29tcGxldGlvbiBvZiBsb2FkIGJlY2F1c2Ugc2l6ZSBjYWxjdWxhdGlvbiByZXF1aXJlcyB0aGUgYWN0dWFsIHNpemVzIGRldGVybWluZWQgYWZ0ZXIgdGhhdCBjb21wbGV0aW9uXG4gICAgICAgICAgICAgICAgICAgICQkLmludGVydmFsRm9yT2JzZXJ2ZUluc2VydGVkID0gd2luZG93LnNldEludGVydmFsKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHBhcmVudE5vZGUgd2lsbCBOT1QgYmUgbnVsbCB3aGVuIGNvbXBsZXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGVjdGlvbi5ub2RlKCkucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jbGVhckludGVydmFsKCQkLmludGVydmFsRm9yT2JzZXJ2ZUluc2VydGVkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC51cGRhdGVEaW1lbnNpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJCQuYnJ1c2gpIHsgJCQuYnJ1c2gudXBkYXRlKCk7IH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcub25pbml0LmNhbGwoJCQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhUcmFuc2Zvcm06IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFRyYW5zaXRpb246IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVHJhbnNpdGlvbkZvclRyYW5zZm9ybTogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhMZWdlbmQ6IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb24udHJhbnNpdGlvbigpLnN0eWxlKCdvcGFjaXR5JywgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0sIDEwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIG9ic2VydmVyLm9ic2VydmUoc2VsZWN0aW9uLm5vZGUoKSwge2F0dHJpYnV0ZXM6IHRydWUsIGNoaWxkTGlzdDogdHJ1ZSwgY2hhcmFjdGVyRGF0YTogdHJ1ZX0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5iaW5kUmVzaXplID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG5cbiAgICAgICAgJCQucmVzaXplRnVuY3Rpb24gPSAkJC5nZW5lcmF0ZVJlc2l6ZSgpO1xuXG4gICAgICAgICQkLnJlc2l6ZUZ1bmN0aW9uLmFkZChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBjb25maWcub25yZXNpemUuY2FsbCgkJCk7XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoY29uZmlnLnJlc2l6ZV9hdXRvKSB7XG4gICAgICAgICAgICAkJC5yZXNpemVGdW5jdGlvbi5hZGQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICgkJC5yZXNpemVUaW1lb3V0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNsZWFyVGltZW91dCgkJC5yZXNpemVUaW1lb3V0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQucmVzaXplVGltZW91dCA9IHdpbmRvdy5zZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlICQkLnJlc2l6ZVRpbWVvdXQ7XG4gICAgICAgICAgICAgICAgICAgICQkLmFwaS5mbHVzaCgpO1xuICAgICAgICAgICAgICAgIH0sIDEwMCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAkJC5yZXNpemVGdW5jdGlvbi5hZGQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgY29uZmlnLm9ucmVzaXplZC5jYWxsKCQkKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKHdpbmRvdy5hdHRhY2hFdmVudCkge1xuICAgICAgICAgICAgd2luZG93LmF0dGFjaEV2ZW50KCdvbnJlc2l6ZScsICQkLnJlc2l6ZUZ1bmN0aW9uKTtcbiAgICAgICAgfSBlbHNlIGlmICh3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcikge1xuICAgICAgICAgICAgd2luZG93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PSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciByZXNpemVGdW5jdGlvbnMgPSBbXTtcbiAgICAgICAgZnVuY3Rpb24gY2FsbFJlc2l6ZUZ1bmN0aW9ucygpIHtcbiAgICAgICAgICAgIHJlc2l6ZUZ1bmN0aW9ucy5mb3JFYWNoKGZ1bmN0aW9uIChmKSB7XG4gICAgICAgICAgICAgICAgZigpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgY2FsbFJlc2l6ZUZ1bmN0aW9ucy5hZGQgPSBmdW5jdGlvbiAoZikge1xuICAgICAgICAgICAgcmVzaXplRnVuY3Rpb25zLnB1c2goZik7XG4gICAgICAgIH07XG4gICAgICAgIGNhbGxSZXNpemVGdW5jdGlvbnMucmVtb3ZlID0gZnVuY3Rpb24gKGYpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcmVzaXplRnVuY3Rpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlc2l6ZUZ1bmN0aW9uc1tpXSA9PT0gZikge1xuICAgICAgICAgICAgICAgICAgICByZXNpemVGdW5jdGlvbnMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBjYWxsUmVzaXplRnVuY3Rpb25zO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5lbmRhbGwgPSBmdW5jdGlvbiAodHJhbnNpdGlvbiwgY2FsbGJhY2spIHtcbiAgICAgICAgdmFyIG4gPSAwO1xuICAgICAgICB0cmFuc2l0aW9uXG4gICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoKSB7ICsrbjsgfSlcbiAgICAgICAgICAgIC5lYWNoKFwiZW5kXCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoIS0tbikgeyBjYWxsYmFjay5hcHBseSh0aGlzLCBhcmd1bWVudHMpOyB9XG4gICAgICAgICAgICB9KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlV2FpdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHRyYW5zaXRpb25zVG9XYWl0ID0gW10sXG4gICAgICAgICAgICBmID0gZnVuY3Rpb24gKHRyYW5zaXRpb24sIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRpbWVyID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZG9uZSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25zVG9XYWl0LmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0LmVtcHR5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lICs9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0LnRyYW5zaXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lICs9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZG9uZSA9PT0gdHJhbnNpdGlvbnNUb1dhaXQubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYWxsYmFjaykgeyBjYWxsYmFjaygpOyB9XG4gICAgICAg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3JpZ2h0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwYWRkaW5nX3RvcDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGFkZGluZ19ib3R0b206IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHJlc2l6ZV9hdXRvOiB0cnVlLFxuICAgICAgICAgICAgem9vbV9lbmFibGVkOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb21fZXh0ZW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICB6b29tX3ByaXZpbGVnZWQ6IGZhbHNlLFxuICAgICAgICAgICAgem9vbV9yZXNjYWxlOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb21fb256b29tOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHpvb21fb256b29tc3RhcnQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgem9vbV9vbnpvb21lbmQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgem9vbV94X21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgem9vbV94X21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgaW50ZXJhY3Rpb25fYnJpZ2h0ZW46IHRydWUsXG4gICAgICAgICAgICBpbnRlcmFjdGlvbl9lbmFibGVkOiB0cnVlLFxuICAgICAgICAgICAgb25tb3VzZW92ZXI6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25tb3VzZW91dDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbnJlc2l6ZTogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbnJlc2l6ZWQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25pbml0OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9ucmVuZGVyZWQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgdHJhbnNpdGlvbl9kdXJhdGlvbjogMzUwLFxuICAgICAgICAgICAgZGF0YV94OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX3hzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfeEZvcm1hdDogJyVZLSVtLSVkJyxcbiAgICAgICAgICAgIGRhdGFfeExvY2FsdGltZTogdHJ1ZSxcbiAgICAgICAgICAgIGRhdGFfeFNvcnQ6IHRydWUsXG4gICAgICAgICAgICBkYXRhX2lkQ29udmVydGVyOiBmdW5jdGlvbiAoaWQpIHsgcmV0dXJuIGlkOyB9LFxuICAgICAgICAgICAgZGF0YV9uYW1lczoge30sXG4gICAgICAgICAgICBkYXRhX2NsYXNzZXM6IHt9LFxuICAgICAgICAgICAgZGF0YV9ncm91cHM6IFtdLFxuICAgICAgICAgICAgZGF0YV9heGVzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfdHlwZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV90eXBlczoge30sXG4gICAgICAgICAgICBkYXRhX2xhYmVsczoge30sXG4gICAgICAgICAgICBkYXRhX29yZGVyOiAnZGVzYycsXG4gICAgICAgICAgICBkYXRhX3JlZ2lvbnM6IHt9LFxuICAgICAgICAgICAgZGF0YV9jb2xvcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV9jb2xvcnM6IHt9LFxuICAgICAgICAgICAgZGF0YV9oaWRlOiBmYWxzZSxcbiAgICAgICAgICAgIGRhdGFfZmlsdGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX3NlbGVjdGlvbl9lbmFibGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGRhdGFfc2VsZWN0aW9uX2dyb3VwZWQ6IGZhbHNlLFxuICAgICAgICAgICAgZGF0YV9zZWxlY3Rpb25faXNzZWxlY3RhYmxlOiBmdW5jdGlvbiAoKSB7IHJldHVybiB0cnVlOyB9LFxuICAgICAgICAgICAgZGF0YV9zZWxlY3Rpb25fbXVsdGlwbGU6IHRydWUsXG4gICAgICAgICAgICBkYXRhX3NlbGVjdGlvbl9kcmFnZ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LFxuICAgICAgICAgICAgYXhpc194X3RpY2tfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfdGlja19jdWxsaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2N1bGxpbmdfbWF4OiAxMCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2NvdW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfdGlja19maXQ6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfdGlja192YWx1ZXM6IG51bGwsXG4gICAgICAgICAgICBheGlzX3hfdGlja19yb3RhdGU6IDAsXG4gICAgICAgICAgICBheGlzX3hfdGlja19vdXRlcjogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX211bHRpbGluZTogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX3dpZHRoOiBudWxsLFxuICAgICAgICAgICAgYXhpc194X21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X3BhZGRpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc194X2hlaWdodDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X2V4dGVudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X2xhYmVsOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeV9zaG93OiB0cnVlLFxuICAgICAgICAgICAgYXhpc195X3R5cGU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9pbnZlcnRlZDogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3lfY2VudGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfaW5uZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9sYWJlbDoge30sXG4gICAgICAgICAgICBheGlzX3lfdGlja19mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX291dGVyOiB0cnVlLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdmFsdWVzOiBudWxsLCAgICAgICAgXG4gICAgICAgICAgICBheGlzX3lfdGlja19yb3RhdGU6IDAsXG4gICAgICAgICAgICBheGlzX3lfdGlja19jb3VudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdGltZV92YWx1ZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdGltZV9pbnRlcnZhbDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3BhZGRpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc195X2RlZmF1bHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3kyX21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfaW52ZXJ0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc195Ml9jZW50ZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfaW5uZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfbGFiZWw6IHt9LFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX291dGVyOiB0cnVlLFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX3ZhbHVlczogbnVsbCxcbiAgICAgICAgICAgIGF4aXNfeTJfdGlja19jb3VudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9wYWRkaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeTJfZGVmYXVsdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gZ3JpZFxuICAgICAgICAgICAgZ3JpZF94X3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgZ3JpZF94X3R5cGU6ICd0aWNrJyxcbiAgICAgICAgICAgIGdyaWRfeF9saW5lczogW10sXG4gICAgICAgICAgICBncmlkX3lfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICAvLyBub3QgdXNlZFxuICAgICAgICAgICAgLy8gZ3JpZF95X3R5cGU6ICd0aWNrJyxcbiAgICAgICAgICAgIGdyaWRfeV9saW5lczogW10sXG4gICAgICAgICAgICBncmlkX3lfdGlja3M6IDEwLFxuICAgICAgICAgICAgZ3JpZF9mb2N1c19zaG93OiB0cnVlLFxuICAgICAgICAgICAgZ3JpZF9saW5lc19mcm9udDogdHJ1ZSxcbiAgICAgICAgICAgIC8vIHBvaW50IC0gcG9pbnQgb2YgZWFjaCBkYXRhXG4gICAgICAgICAgICBwb2ludF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgcG9pbnRfcjogMi41LFxuICAgICAgICAgICAgcG9pbnRfc2Vuc2l0aXZpdHk6IDEwLFxuICAgICAgICAgICAgcG9pbnRfZm9jdXNfZXhwYW5kX2VuYWJsZWQ6IHRydWUsXG4gICAgICAgICAgICBwb2ludF9mb2N1c19leHBhbmRfcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcG9pbnRfc2VsZWN0X3I6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vIGxpbmVcbiAgICAgICAgICAgIGxpbmVfY29ubmVjdE51bGw6IGZhbHNlLFxuICAgICAgICAgICAgbGluZV9zdGVwX3R5cGU6ICdzdGVwJyxcbiAgICAgICAgICAgIC8vIGJhclxuICAgICAgICAgICAgYmFyX3dpZHRoOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBiYXJfd2lkdGhfcmF0aW86IDAuNixcbiAgICAgICAgICAgIGJhcl93aWR0aF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MuZ2V0VG9vbHRpcENvbnRlbnQgPyB0aGlzLmdldFRvb2x0aXBDb250ZW50KGQsIGRlZmF1bHRUaXRsZUZvcm1hdCwgZGVmYXVsdFZhbHVlRm9ybWF0LCBjb2xvcikgOiAnJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB0b29sdGlwX2luaXRfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICB0b29sdGlwX2luaXRfeDogMCxcbiAgICAgICAgICAgIHRvb2x0aXBfaW5pdF9wb3NpdGlvbjoge3RvcDogJzBweCcsIGxlZnQ6ICc1MHB4J30sXG4gICAgICAgICAgICB0b29sdGlwX29uc2hvdzogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB0b29sdGlwX29uaGlkZTogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICAvLyB0aXRsZVxuICAgICAgICAgICAgdGl0bGVfdGV4dDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgdGl0bGVfcGFkZGluZzoge1xuICAgICAgICAgICAgICAgIHRvcDogMCxcbiAgICAgICAgICAgICAgICByaWdodDogMCxcbiAgICAgICAgICAgICAgICBib3R0b206IDAsXG4gICAgICAgICAgICAgICAgbGVmdDogMFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHRpdGxlX3Bvc2l0aW9uOiAndG9wLWNlbnRlcicsXG4gICAgICAgIH07XG5cbiAgICAgICAgT2JqZWN0LmtleXModGhpcy5hZGRpdGlvbmFsQ29uZmlnKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgIGNvbmZpZ1trZXldID0gdGhpcy5hZGRpdGlvbmFsQ29uZmlnW2tleV07XG4gICAgICAgIH0sIHRoaXMpO1xuXG4gICAgICAgIHJldHVybiBjb25maWc7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5hZGRpdGlvbmFsQ29uZmlnID0ge307XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5sb2FkQ29uZmlnID0gZnVuY3Rpb24gKGNvbmZpZykge1xuICAgICAgICB2YXIgdGhpc19jb25maWcgPSB0aGlzLmNvbmZpZywgdGFyZ2V0LCBrZXlzLCByZWFkO1xuICAgICAgICBmdW5jdGlvbiBmaW5kKCkge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXMuc2hpZnQoKTtcbiAgICAvLyAgICAgICAgY29uc29sZS5sb2coXCJrZXkgPT5cIiwga2V5LCBcIiwgdGFyZ2V0ID0+XCIsIHRhcmdldCk7XG4gICAgICAgICAgICBpZiAoa2V5ICYmIHRhcmdldCAmJiB0eXBlb2YgdGFyZ2V0ID09PSAnb2JqZWN0JyAmJiBrZXkgaW4gdGFyZ2V0KSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0ID0gdGFyZ2V0W2tleV07XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKCFrZXkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGFyZ2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBPYmplY3Qua2V5cyh0aGlzX2NvbmZpZykuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICB0YXJnZXQgPSBjb25maWc7XG4gICAgICAgICAgICBrZXlzID0ga2V5LnNwbGl0KCdfJyk7XG4gICAgICAgICAgICByZWFkID0gZmluZCgpO1xuICAgIC8vICAgICAgICBjb25zb2xlLmxvZyhcIkNPTkZJRyA6IFwiLCBrZXksIHJlYWQpO1xuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyZWFkKSkge1xuICAgICAgICAgICAgICAgIHRoaXNfY29uZmlnW2tleV0gPSByZWFkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9K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1cm4gcmF3ID8gdiA6IE1hdGguY2VpbCh2KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgLy8gZGVmaW5lIGZ1bmN0aW9uc1xuICAgICAgICBmb3IgKGtleSBpbiBfc2NhbGUpIHtcbiAgICAgICAgICAgIHNjYWxlW2tleV0gPSBfc2NhbGVba2V5XTtcbiAgICAgICAgfVxuICAgICAgICBzY2FsZS5vcmdEb21haW4gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gX3NjYWxlLmRvbWFpbigpO1xuICAgICAgICB9O1xuICAgICAgICAvLyBkZWZpbmUgY3VzdG9tIGRvbWFpbigpIGZvciBjYXRlZ29yaXplZCBheGlzXG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIHNjYWxlLmRvbWFpbiA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgZG9tYWluID0gdGhpcy5vcmdEb21haW4oKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtkb21haW5bMF0sIGRvbWFpblsxXSArIDFdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBfc2NhbGUuZG9tYWluKGRvbWFpbik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNjYWxlO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc2NhbGU7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRZID0gZnVuY3Rpb24gKG1pbiwgbWF4LCBkb21haW4pIHtcbiAgICAgICAgdmFyIHNjYWxlID0gdGhpcy5nZXRTY2FsZShtaW4sIG1heCwgdGhpcy5pc1RpbWVTZXJpZXNZKCkpO1xuICAgICAgICBpZiAoZG9tYWluKSB7IHNjYWxlLmRvbWFpbihkb21haW4pOyB9XG4gICAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFlTY2FsZSA9IGZ1bmN0aW9uIChpZCkge1xuICAgICAgICByZXR1cm4gdGhpcy5heGlzLmdldElkKGlkKSA9PT0gJ3kyJyA/IHRoaXMueTIgOiB0aGlzLnk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRTdWJZU2NhbGUgPSBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYXhpcy5nZXRJZChpZCkgPT09ICd5MicgPyB0aGlzLnN1YlkyIDogdGhpcy5zdWJZO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlU2NhbGVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBmb3JJbml0ID0gISQkLng7XG4gICAgICAgIC8vIHVwZGF0ZSBlZGdlc1xuICAgICAgICAkJC54TWluID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDEgOiAwO1xuICAgICAgICAkJC54TWF4ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmhlaWdodCA6ICQkLndpZHRoO1xuICAgICAgICAkJC55TWluID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiAkJC5oZWlnaHQ7XG4gICAgICAgICQkLnlNYXggPSBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiAxO1xuICAgICAgICAkJC5zdWJYTWluID0gJCQueE1pbjtcbiAgICAgICAgJCQuc3ViWE1heCA9ICQkLnhNYXg7XG4gICAgICAgICQkLnN1YllNaW4gPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6ICQkLmhlaWdodDI7XG4gICAgICAgICQkLnN1YllNYXggPSBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2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ZhbHVlc1xuICAgICAgICAgICAgICAgIGlmIChoYXNOZWdhdGl2ZVZhbHVlICYmIHlzW2Jhc2VJZF0pIHtcbiAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXS5mb3JFYWNoKGZ1bmN0aW9uICh2LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldID0gdiA8IDAgPyB2IDogMDtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIENvbXB1dGUgbWluXG4gICAgICAgICAgICAgICAgZm9yIChrID0gMTsgayA8IGlkc0luR3JvdXAubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBpZHNJbkdyb3VwW2tdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISB5c1tpZF0pIHsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICAgICAgeXNbaWRdLmZvckVhY2goZnVuY3Rpb24gKHYsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkJC5heGlzLmdldElkKGlkKSA9PT0gJCQuYXhpcy5nZXRJZChiYXNlSWQpICYmIHlzW2Jhc2VJZF0gJiYgIShoYXNOZWdhdGl2ZVZhbHVlICYmICt2ID4gMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldICs9ICt2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICQkLmQzLm1pbihPYmplY3Qua2V5cyh5cykubWFwKGZ1bmN0aW9uIChrZXkpIHsgcmV0dXJuICQkLmQzLm1pbih5c1trZXldKTsgfSkpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WURvbWFpbk1heCA9IGZ1b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iAwO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gQ29tcHV0ZSBtYXhcbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDwgaWRzSW5Hcm91cC5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IGlkc0luR3JvdXBba107XG4gICAgICAgICAgICAgICAgICAgIGlmICghIHlzW2lkXSkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgICAgICB5c1tpZF0uZm9yRWFjaChmdW5jdGlvbiAodiwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmF4aXMuZ2V0SWQoaWQpID09PSAkJC5heGlzLmdldElkKGJhc2VJZCkgJiYgeXNbYmFzZUlkXSAmJiAhKGhhc1Bvc2l0aXZlVmFsdWUgJiYgK3YgPCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF1baV0gKz0gK3Y7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gJCQuZDMubWF4KE9iamVjdC5rZXlzKHlzKS5tYXAoZnVuY3Rpb24gKGtleSkgeyByZXR1cm4gJCQuZDMubWF4KHlzW2tleV0pOyB9KSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRZRG9tYWluID0gZnVuY3Rpb24gKHRhcmdldHMsIGF4aXNJZCwgeERvbWFpbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICB0YXJnZXRzQnlBeGlzSWQgPSB0YXJnZXRzLmZpbHRlcihmdW5jdGlvbiAodCkgeyByZXR1cm4gJCQuYXhpcy5nZXRJZCh0LmlkKSA9P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heGlzX3hfbWF4KSA6IGNvbmZpZy5heGlzX3hfbWF4KSA6XG4gICAgICAgICQkLmQzLm1heCh0YXJnZXRzLCBmdW5jdGlvbiAodCkgeyByZXR1cm4gJCQuZDMubWF4KHQudmFsdWVzLCBmdW5jdGlvbiAodikgeyByZXR1cm4gdi54OyB9KTsgfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRYRG9tYWluUGFkZGluZyA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgZGlmZiA9IGRvbWFpblsxXSAtIGRvbWFpblswXSxcbiAgICAgICAgICAgIG1heERhdGFDb3VudCwgcGFkZGluZywgcGFkZGluZ0xlZnQsIHBhZGRpbmdSaWdodDtcbiAgICAgICAgaWYgKCQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgcGFkZGluZyA9IDA7XG4gICAgICAgIH0gZWxzZSBpZiAoJCQuaGFzVHlwZSgnYmFyJykpIHtcbiAgICAgICAgICAgIG1heERhdGFDb3VudCA9ICQkLmdldE1heERhdGFDb3VudCgpO1xuICAgICAgICAgICAgcGFkZGluZyA9IG1heERhdGFDb3VudCA+IDEgPyAoZGlmZiAvIChtYXhEYXRhQ291bnQgLSAxKSkgLyAyIDogMC41O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcGFkZGluZyA9IGRpZmYgKiAwLjAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgY29uZmlnLmF4aXNfeF9wYWRkaW5nID09PSAnb2JqZWN0JyAmJiBub3RFbXB0eShjb25maWcuYXhpc194X3BhZGRpbmcpKSB7XG4gICAgICAgICAgICBwYWRkaW5nTGVmdCA9IGlzVmFsdWUoY29uZmlnLmF4aXNfeF9wYWRkaW5nLmxlZnQpID8gY29uZmlnLmF4aXNfeF9wYWRkaW5nLmxlZnQgOi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kLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgZmlyc3RYID0gbmV3IERhdGUoZmlyc3RYLmdldFRpbWUoKSAqIDAuNSk7XG4gICAgICAgICAgICAgICAgbGFzdFggPSBuZXcgRGF0ZShsYXN0WC5nZXRUaW1lKCkgKiAxLjUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBmaXJzdFggPSBmaXJzdFggPT09IDAgPyAxIDogKGZpcnN0WCAqIDAuNSk7XG4gICAgICAgICAgICAgICAgbGFzdFggPSBsYXN0WCA9PT0gMCA/IC0xIDogKGxhc3RYICogMS41KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoZmlyc3RYIHx8IGZpcnN0WCA9PT0gMCkge1xuICAgICAgICAgICAgbWluID0gJCQuaXNUaW1lU2VyaWVzKCkgPyBuZXcgRGF0ZShmaXJzdFguZ2V0VGltZSgpIC0gcGFkZGluZy5sZWZ0KSA6IGZpcnN0WCAtIHBhZGRpbmcubGVmdDtcbiAgICAgICAgfVxuICAgICAgICBpZiAobGFzdFggfHwgbGFzdFggPT09IDApIHtcbiAgICAgICAgICAgIG1heCA9ICQkLmlzVGltZVNlcmllcygpID8gbmV3IERhdGUobGFzdFguZ2V0VGltZSgpICsgcGFkZGluZy5yaWdodCkgOiBsYXN0WCArIHBhZGRpbmcucmlnaHQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFttaW4sIG1heF07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVYRG9tYWluID0gZnVuY3Rpb24gKHRhcmdldHMsIHdpdGhVcGRhdGVYRG9tYWluLCB3aXRoVXBkYXRlT3JnWERvbWFpbiwgd2l0aFRyaW0sIGRvbWFpbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG5cbiAgICAgICAgaWYgKHdpdGhVcGRhdGVPcmdYRG9tYWluKSB7XG4gICAgICAgICAgICAkJC54LmRvbWFpbihkb21haW4gPyBkb21haW4gOiAkJC5kMy5leHRlbnQoJCQuZ2V0WERvbWFpbih0YXJnZXRzKSkpO1xuICAgICAgICAgICAgJCQub3JnWERvbWFpbiA9ICQkLnguZG9tYWluKCk7XG4gICAgICAgICAgICBpZiAoY29uZmlnLnpvb21fZW5hYmxlZCkgeyAkJC56b29tLnNjYWxlKCQkLngpLnVwZGF0ZVNjYWxlRXh0ZW50KCk7IH1cbiAgICAgICAgICAgICQkLnN1YlguZG9tYWluKCQkLnguZG9tYWluKCkpO1xuICAgICAgICAgICAgaWYgKCQkLmJydXNoKSB7ICQkLmJydXNoLnNjYWxlKCQkLnN1YlgpOyB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHdpdGhVcGRhdGVYRG9tYWluKSB7XG4gICAgICAgICAgICAkJC54LmRvbWFpbihkb21haW4gPyBkb21haW4gOiAoISQkLmJydXNoIHx8ICQkLmJydXNoLmVtcHR5KCkpID8gJCQub3JnWERvbWFpbiA6ICQkLmJydXNoLmV4dGVudCgpKTtcbiAgICAgICAgICAgIGlmIChjb25maWcuem9vbV9lbmFibGVkKSB7ICQkLnpvb20uc2NhbGUoJCQueCkudXBkYXRlU2NhbGVFeHRlbnQoKTsgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gVHJpbSBkb21haW4gd2hlbiB0b28gYmlnIGJ5IHpvb20gbW91c2Vtb3ZlIGV2ZW50XG4gICAgICAgIGlmICh3aXRoVHJpbSkgeyAkJC54LmRvbWFpbigkJC50cmltWERvbWFpbigkJC54Lm9yZ0RvbWFpbigpKSk7IH1cblxuICAgICAgICByZXR1cm4gJCQueC5kb21haW4oKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnRyaW1YRG9tYWluID0gZnVuY3Rpb24gKGRvbWFpbikge1xuICAgICAgICB2YXIgem9vbURvbWFpbiA9IHRoaXMuZ2V0Wm9vbURvbWFpbigpLFxuICAgICAgICAgICAgbWluID0gem9vbURvbWFpblswXSwgbWF4ID0gem9vbURvbWFpblsxXTtcbiAgICAgICAgaWYgKGRvbWFpblswXSA8PSBtaW4pIHtcbiAgICAgICAgICAgIGRvbWFpblsxXSA9ICtkb21haW5bMV0gKyAobWluIC0gZG9tYWluWzBdKTtcbiAgICAgICAgICAgIGRvbWFpblswXSA9IG1pbjtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWF4IDw9IGRvbWFpblsxXSkge1xuICAgICAgICAgICAgZG9tYWluWzBdID0gK2RvbWFpblswXSAtIChkb21haW5bMV0gLSBtYXgpO1xuICAgICAgICAgICAgZG9tYWluWzFdID0gbWF4O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkb21haW47XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmlzWCA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gKGNvbmZpZy5kYXRhX3ggJiYga2V5ID09PSBjb25maWcuZGF0YV94KSB8fCAobm90RW1wdHkoY29uZmlnLmRhdGFfeHMpICYmIGhhc1ZhbHVlKGNvbmZpZy5kYXRhX3hzLCBrZXkpKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmlzTm90WCA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgcmV0dXJuICF0aGlzLmlzWChrZXkpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WEtleSA9IGZ1bmN0aW9uIChpZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIHJldHVybiBjb25maWcuZGF0YV94ID8gY29uZmlnLmRhdGFfeCA6IG5vdEVtcHR5KGNvbmZpZy5kYXRhX3hzKSA/IGNvbmZpZy5kYXRhX3hzW2lk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9XG4gICAgICAgIE9iamVjdC5rZXlzKGF0dHJzKS5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgY3VycmVudFtpZF0gPSBhdHRyc1tpZF07XG4gICAgICAgIH0pO1xuICAgICAgICAkJC5yZWRyYXcoe3dpdGhMZWdlbmQ6IHRydWV9KTtcbiAgICAgICAgcmV0dXJuIGN1cnJlbnQ7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRVcmxUb0RhdGEgPSBmdW5jdGlvbiAodXJsLCBtaW1lVHlwZSwgaGVhZGVycywga2V5cywgZG9uZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCB0eXBlID0gbWltZVR5cGUgPyBtaW1lVHlwZSA6ICdjc3YnO1xuICAgICAgICB2YXIgcmVxID0gJCQuZDMueGhyKHVybCk7XG4gICAgICAgIGlmIChoZWFkZXJzKSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhoZWFkZXJzKS5mb3JFYWNoKGZ1bmN0aW9uIChoZWFkZXIpIHtcbiAgICAgICAgICAgICAgICByZXEuaGVhZGVyKGhlYWRlciwgaGVhZGVyc1toZWFkZXJdKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJlcS5nZXQoZnVuY3Rpb24gKGVycm9yLCBkYXRhKSB7XG4gICAgICAgICAgICB2YXIgZDtcbiAgICAgICAgICAgIGlmICghZGF0YSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihlcnJvci5yZXNwb25zZVVSTCArICcgJyArIGVycm9yLnN0YXR1cyArICcgKCcgKyBlcnJvci5zdGF0dXNUZXh0ICsgJyknKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0eXBlID09PSAnanNvbicpIHtcbiAgICAgICAgICAgICAgICBkID0gJCQuY29udmVydEpzb25Ub0RhdGEoSlNPTi5wYXJzZShkYXRhLnJlc3BvbnNlKSwga2V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GlzLmQzLnRzdik7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0SnNvblRvRGF0YSA9IGZ1bmN0aW9uIChqc29uLCBrZXlzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBuZXdfcm93cyA9IFtdLCB0YXJnZXRLZXlzLCBkYXRhO1xuICAgICAgICBpZiAoa2V5cykgeyAvLyB3aGVuIGtleXMgc3BlY2lmaWVkLCBqc29uIHdvdWxkIGJlIGFuIGFycmF5IHRoYXQgaW5jbHVkZXMgb2JqZWN0c1xuICAgICAgICAgICAgaWYgKGtleXMueCkge1xuICAgICAgICAgICAgICAgIHRhcmdldEtleXMgPSBrZXlzLnZhbHVlLmNvbmNhdChrZXlzLngpO1xuICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX3ggPSBrZXlzLng7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRhcmdldEtleXMgPSBrZXlzLnZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmV3X3Jvd3MucHVzaCh0YXJnZXRLZXlzKTtcbiAgICAgICAgICAgIGpzb24uZm9yRWFjaChmdW5jdGlvbiAobykge1xuICAgICAgICAgICAgICAgIHZhciBuZXdfcm93ID0gW107XG4gICAgICAgICAgICAgICAgdGFyZ2V0S2V5cy5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gY29udmVydCB1bmRlZmluZWQgdG8gbnVsbCBiZWNhdXNlIHVuZGVmaW5lZCBkYXRhIHdpbGwgYmUgcmVtb3ZlZCBpbiBjb252ZXJ0RGF0YVRvVGFyZ2V0cygpXG4gICAgICAgICAgICAgICAgICAgIHZhciB2ID0gJCQuZmluZFZhbHVlSW5Kc29uKG8sIGtleSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZCh2KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdiA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbmV3X3Jvdy5wdXNoKHYpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIG5ld19yb3dzLnB1c2gobmV3X3Jvdyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGRhdGEgPSAkJC5jb252ZXJ0Um93c1RvRGF0YShuZXdfcm93cyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhqc29uKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICBuZXdfcm93cy5wdXNoKFtrZXldLmNvbmNhdChqc29uW2tleV0pKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRDb2x1bW5zVG9EYXRhKG5ld19yb3dzKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZGF0YTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmZpbmRWYWx1ZUluSnNvbiA9IGZ1bmN0aW9uIChvYmplY3QsIHBhdGgpIHtcbiAgICAgICAgcGF0aCA9IHBhdGgucmVwbGFjZSgvXFxbKFxcdyspXFxdL2csICcuJDEnKTsgLy8gY29udmVydCBpbmRleGVzIHRvIHByb3BlcnRpZXMgKHJlcGxhY2UgW10gd2l0aCAuKVxuICAgICAgICBwYXRoID0gcGF0aC5yZXBsYWNlKC9eXFwuLywgJycpOyAgICAgICAgICAgLy8gc3RyaXAgYSBsZWFkaW5nIGRvdFxuICAgICAgICB2YXIgcGF0aEFycmF5ID0gcGF0aC5zcGxpdCgnLicpO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBhdGhBcnJheS5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgdmFyIGsgPSBwYXRoQXJyYXlbaV07XG4gICAgICAgICAgICBpZiAoayBpbiBvYmplY3QpIHtcbiAgICAgICAgICAgICAgICBvYmplY3QgPSBvYmplY3Rba107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb2JqZWN0O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydFJvd3NUb0RhdGEgPSBmdW5jdGlvbiAocm93cykge1xuICAgICAgICB2YXIga2V5cyA9IHJvd3NbMF0sIG5ld19yb3cgPSB7fSwgbmV3X3Jvd3MgPSBbXSwgaSwgajtcbiAgICAgICAgZm9yIChpID0gMTsgaSA8IHJvd3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIG5ld19yb3cgPSB7fTtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCByb3dzW2ldLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHJvd3NbaV1bal0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlNvdXJjZSBkYXRhIGlzIG1pc3NpbmcgYSBjb21wb25lbnQgYXQgKFwiICsgaSArIFwiLFwiICsgaiArIFwiKSFcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5ld19yb3dba2V5c1tqXV0gPSByb3dzW2ldW2pdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmV3X3Jvd3MucHVzaChuZXdfcm93KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3X3Jvd3M7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0Q29sdW1uc1RvRGF0YSA9IGZ1bmN0aW9uIChjb2x1bW5zKSB7XG4gICAgICAgIHZhciBuZXdfcm93cyA9IFtdLCBpLCBqLCBrZXk7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb2x1bW5zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBrZXkgPSBjb2x1bW5zW2ldWzBdO1xuICAgICAgICAgICAgZm9yIChqID0gMTsgaiA8IGNvbHVtbnNbaV0ubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQobmV3X3Jvd3NbaiAtIDFdKSkge1xuICAgICAgICAgICAgICAgICAgICBuZXdfcm93c1tqIC0gMV0gPSB7fTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGNvbHVtbnNbaV1bal0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlNvdXJjZSBkYXRhIGlzIG1pc3NpbmcgYSBjb21wb25lbnQgYXQgKFwiICsgaSArIFwiLFwiICsgaiArIFwiKSFcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5ld19yb3dzW2ogLSAxXVtrZXldID0gY29sdW1uc1tpXVtqXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3X3Jvd3M7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0RGF0YVRvVGFyZ2V0cyA9IGZ1bmN0aW9uIChkYXRhLCBhcHBlbmRYcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBpZHMgPSAkJC5kMy5rZXlzKGRhdGFbMF0pLmZpbHRlcigkJC5pc05vdFgsICQkKSxcbiAgICAgICAgICAgIHhzID0gJCQuZDMua2V5cyhkYXRhWzBdKS5maWx0ZXIoJCQuaXNYLCAkJCksXG4gICAgICAgICAgICB0YXJnZXRzO1xuXG4gICAgICAgIC8vIHNhdmUgeCBmb3IgdXBkYXRlIGRhdGEgYnkgbG9hZCB3aGVuIGN1c3RvbSB4IGFuZCBjMy54IEFQSVxuICAgICAgICBpZHMuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgIHZhciB4S2V5ID0gJCQuZ2V0WEtleShpZCk7XG5cbiAgICAgICAgICAgIGlmICgkJC5pc0N1c3RvbVgoKSB8fCAkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgIC8vIGlmIGluY2x1ZGVkIGluIGlucHV0IGRhdGFcbiAgICAgICAgICAgICAgICBpZiAoeHMuaW5kZXhPZih4S2V5KSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmRhdGEueHNbaWRdID0gKGFwcGVuZFhzICYmICQkLmRhdGEueHNbaWRdID8gJCQuZGF0YS54c1tpZF0gOiBbXSkuY29uY2F0KFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGRbeEtleV07IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihpc1ZhbHVlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoZnVuY3Rpb24gKHJhd1gsIGkpIHsgcmV0dXJuICQkLmdlbmVyYXRlVGFyZ2V0WChyYXdYLCBpZCwgaSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIG5vdCBpbmNsdWRlZCBpbiBpbnB1dCBkYXRhLCBmaW5kIGZyb20gcHJlbG9hZGVkIGRhdGEgb2Ygb3RoZXIgaWQncyB4XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoY29uZmlnLmRhdGFfeCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9ICQkLmdldE90aGVyVGFyZ2V0WHMoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gaWYgbm90IGluY2x1ZGVkIGluIGlucHV0IGRhdGEsIGZpbmQgZnJvbSBwcmVsb2FkZWQgZGF0YVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKG5vdEVtcHR5KGNvbmZpZy5kYXRhX3hzKSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9ICQkLmdldFhWYWx1ZXNPZlhLZXkoeEtleSwgJCQuZGF0YS50YXJnZXRzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gTUVNTzogaWYgbm8geCBpbmNsdWRlZCwgdXNlIHNhbWUgeCBvZiBjdXJyZW50IHdpbGwgYmUgdXNlZFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9IGRhdGEubWFwKGZ1bmN0aW9uIChkLCBpKSB7IHJldHVybiBpOyB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cblxuICAgICAgICAvLyBjaGVjayB4IGlzIGRlZmluZWRcbiAgICAgICAgaWRzLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICBpZiAoISQkLmRhdGEueHNbaWRdKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd4IGlzIG5vdCBkZWZpbmVkIGZvciBpZCA9IFwiJyArIGlkICsgJ1wiLicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBjb252ZXJ0IHRvIHRhcmdldFxuICAgICAgICB0YXJnZXRzID0gaWRzLm1hcChmdW5jdGlvbiAoaWQsIGluZGV4KSB7XG4gICAgICAgICAgICB2YXIgY29udmVydGVkSWQgPSBjb25maWcuZGF0YV9pZENvbnZlcnRlcihpZCk7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIGlkOiBjb252ZXJ0ZWRJZCxcbiAgICAgICAgICAgICAgICBpZF9vcmc6IGlkLFxuICAgICAgICAgICAgICAgIHZhbHVlczogZGF0YS5tYXAoZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHhLZXkgPSAkJC5nZXRYS2V5KGlkKSwgcmF3WCA9IGRbeEtleV0sXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGRbaWRdICE9PSBudWxsICYmICFpc05hTihkW2lkXSkgPyArZFtpZF0gOiBudWxsLCB4O1xuICAgICAgICAgICAgICAgICAgICAvLyB1c2UgeCBhcyBjYXRlZ29yaWVzIGlmIGN1c3RvbSB4IGFuZCBjYXRlZ29yaXplZFxuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuaXNDdXN0b21YKCkgJiYgJCQuaXNDYXRlZ29yaXplZCgpICYmIGluZGV4ID09PSAwICYmICFpc1VuZGVmaW5lZChyYXdYKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwICYmIGkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuYXhpc194X2NhdGVnb3JpZXMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSBjb25maWcuYXhpc194X2NhdGVnb3JpZXMuaW5kZXhPZihyYXdYKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh4ID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSBjb25maWcuYXhpc194X2NhdGVnb3JpZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3hfY2F0ZWdvcmllcy5wdXNoKHJhd1gpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgeCAgPSAkJC5nZW5lcmF0ZVRhcmdldFgocmF3WCwgaWQsIGkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIG1hcmsgYXMgeCA9IHVuZGVmaW5lZCBpZiB2YWx1ZSBpcyB1bmRlZmluZWQgYW5kIGZpbHRlciB0byByZW1vdmUgYWZ0ZXIgbWFwcGVkXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChkW2lkXSkgfHwgJCQuZGF0YS54c1tpZF0ubGVuZ3RoIDw9IGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHt4OiB4LCB2YWx1ZTogdmFsdWUsIGlkOiBjb252ZXJ0ZWRJZH07XG4gICAgICAgICAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uICh2KSB7IHJldHVybiBpc0RlZmluZWQodi54KTsgfSlcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIGZpbmlzaCB0YXJnZXRzXG4gICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgdmFyIGk7XG4gICAgICAgICAgICAvLyBzb3J0IHZhbHVlcyBieSBpdHMgeFxuICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3hTb3J0KSB7XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMgPSB0LnZhbHVlcy5zb3J0KGZ1bmN0aW9uICh2MSwgdjIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHgxID0gdjEueCB8fCB2MS54ID09PSAwID8gdjEueCA6IEluZmluaXR5LFxuICAgICAgICAgICAgICAgICAgICAgICAgeDIgPSB2Mi54IHx8IHYyLnggPT09IDAgPyB2Mi54IDogSW5maW5pdHk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB4MSAtIHgyO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gaW5kZXhpbmcgZWFjaCB2YW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KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIHRhcmdldHM7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmxvYWQgPSBmdW5jdGlvbiAodGFyZ2V0cywgYXJncykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICBpZiAodGFyZ2V0cykge1xuICAgICAgICAgICAgLy8gZmlsdGVyIGxvYWRpbmcgdGFyZ2V0cyBpZiBuZWVkZWRcbiAgICAgICAgICAgIGlmIChhcmdzLmZpbHRlcikge1xuICAgICAgICAgICAgICAgIHRhcmdldHMgPSB0YXJnZXRzLmZpbHRlcihhcmdzLmZpbHRlcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBzZXQgdHlwZSBpZiBhcmdzLnR5cGVzIHx8IGFyZ3MudHlwZSBzcGVjaWZpZWRcbiAgICAgICAgICAgIGlmIChhcmdzLnR5cGUgfHwgYXJncy50eXBlcykge1xuICAgICAgICAgICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdHlwZSA9IGFyZ3MudHlwZXMgJiYgYXJncy50eXBlc1t0LmlkXSA/IGFyZ3MudHlwZXNbdC5pZF0gOiBhcmdzLnR5cGU7XG4gICAgICAgICAgICAgICAgICAgICQkLnNldFRhcmdldFR5cGUodC5pZCwgdHlwZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBVcGRhdGUvQWRkIGRhdGFcbiAgICAgICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0YXJnZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChkLmlkID09PSB0YXJnZXRzW2ldLmlkKSB7XG4gICAgICAgICAg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gICAgaWYgKCQkLmlzTXVsdGlwbGVYKCkpIHtcbiAgICAgICAgICAgIC8vIFRPRE86IHJvdGF0ZWQgbm90IHN1cHBvcnRlZCB5ZXRcbiAgICAgICAgICAgIHggPSAwO1xuICAgICAgICAgICAgeSA9IDA7XG4gICAgICAgICAgICB3ID0gJCQud2lkdGg7XG4gICAgICAgICAgICBoID0gJCQuaGVpZ2h0O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKCgkJC5pc0N1c3RvbVgoKSB8fCAkJC5pc1RpbWVTZXJpZXMoKSkgJiYgISQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuXG4gICAgICAgICAgICAgICAgLy8gdXBkYXRlIGluZGV4IGZvciB4IHRoYXQgaXMgdXNlZCBieSBwcmV2WCBhbmQgbmV4dFhcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVYcygpO1xuXG4gICAgICAgICAgICAgICAgcmVjdFcgPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJldlggPSAkJC5nZXRQcmV2WChkLmluZGV4KSwgbmV4dFggPSAkJC5nZXROZXh0WChkLmluZGV4KTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSB0aGlzIGlzIGEgc2luZ2xlIGRhdGEgcG9pbnQgbWFrZSB0aGUgZXZlbnRSZWN0IGZ1bGwgd2lkdGggKG9yIGhlaWdodClcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsICYmIG5leHRYID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmhlaWdodCA6ICQkLndpZHRoO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsKSB7IHByZXZYID0gJCQueC5kb21haW4oKVswXTsgfVxuICAgICAgICAgICAgICAgICAgICBpZiAobmV4dFggPT09IG51bGwpIHsgbmV4dFggPSAkJC54LmRvbWFpbigpWzFdOyB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE1hdGgubWF4KDAsICgkJC54KG5leHRYKSAtICQkLngocHJldlgpKSAvIDIpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcmVjdFggPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJldlggPSAkJC5nZXRQcmV2WChkLmluZGV4KSwgbmV4dFggPSAkJC5nZXROZXh0WChkLmluZGV4KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNYID0gJCQuZGF0YS54c1tkLmlkXVtkLmluZGV4XTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSB0aGlzIGlzIGEgc2luZ2xlIGRhdGEgcG9pbnQgcG9zaXRpb24gdGhlIGV2ZW50UmVjdCBhdCAwXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2WCA9PT0gbnVsbCAmJiBuZXh0WCA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAocHJldlggPT09IG51bGwpIHsgcHJldlggPSAkJC54LmRvbWFpbigpWzBdOyB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgkJC54KHRoaXNYKSArICQkLngocHJldlgpKSAvIDI7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVjdFcgPSAkJC5nZXRFdmVudFJlY3RXaWR0aCgpO1xuICAgICAgICAgICAgICAgIHJlY3RYID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLngoZC54KSAtIChyZWN0VyAvIDIpO1xuICAgICAgICAgICAgICAgIH07XG4gIC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9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gZC5pbmRleDtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5kcmFnZ2luZyB8fCAkJC5mbG93aW5nKSB7IHJldHVybjsgfSAvLyBkbyBub3RoaW5nIHdoaWxlIGRyYWdnaW5nL2Zsb3dpbmdcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgLy8gRXhwYW5kIHNoYXBlcyBmb3Igc2VsZWN0aW9uXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZCkgeyAkJC5leHBhbmRDaXJjbGVzKGluZGV4LCBudWxsLCB0cnVlKTsgfVxuICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoaW5kZXgsIG51bGwsIHRydWUpO1xuXG4gICAgICAgICAgICAgICAgLy8gQ2FsbCBldmVudCBoYW5kbGVyXG4gICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBpbmRleCkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9vbm1vdXNlb3Zlci5jYWxsKCQkLmFwaSwgZCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gZC5pbmRleDtcbiAgICAgICAgICAgICAgICBpZiAoISQkLmNvbmZpZykgeyByZXR1cm47IH0gLy8gY2hhcnQgaXMgZGVzdHJveWVkXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICAkJC5oaWRlWEdyaWRGb2N1cygp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GV4KSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5kZXggLT0gMTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBTaG93IHRvb2x0aXBcbiAgICAgICAgICAgICAgICBzZWxlY3RlZERhdGEgPSAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cykubWFwKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5hZGROYW1lKCQkLmdldFZhbHVlT25JbmRleCh0LnZhbHVlcywgaW5kZXgpKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIGlmIChjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLnNob3dUb29sdGlwKHNlbGVjdGVkRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgICQkLnNob3dYR3JpZEZvY3VzKHNlbGVjdGVkRGF0YSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy50b29sdGlwX2dyb3VwZWQgJiYgKCFjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCB8fCBjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgaW5kZXgpXG4gICAgICAgICAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKENMQVNTLkVYUEFOREVELCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50UmVjdC5zdHlsZSgnY3Vyc29yJywgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgPyAncG9pbnRlcicgOiBudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuaGlkZVRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQ2lyY2xlcyhpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQmFycyhpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQuaXNXaXRoaW5TaGFwZSh0aGlzLCBkKTtcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCAmJiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgfHwgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2lzc2VsZWN0YWJsZShkKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFJlY3Quc3R5bGUoJ2N1cnNvcicsICdwb2ludGVyJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy50b29sdGlwX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5zaG93VG9vbHRpcChbZF0sIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnNob3dYR3JpZEZvY3VzKFtkXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZCkgeyAkJC5leHBhbmRDaXJjbGVzKGluZGV4LCBkLmlkLCB0cnVlKTsgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoaW5kZXgsIGQuaWQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBkLmluZGV4O1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkgfHwgISQkLnRvZ2dsZVNoYXBlKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIGlmICgkJC5jYW5jZWxDbGljaykge1xuICAgICAgICAgICAgICAgICAgICAkJC5jYW5jZWxDbGljayA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgkJC5pc1N0ZXBUeXBlKGQpICYmIGNvbmZpZy5saW5lX3N0ZXBfdHlwZSA9PT0gJ3N0ZXAtYWZ0ZXInICYmIGQzLm1vdXNlKHRoaXMpWzBdIDwgJCQueCgkJC5nZXRYVmFsdWUoZC5pZCwgaW5kZXgpKSkge1xuICAgICAgICAgICAgICAgICAgICBpbmRleCAtPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIGluZGV4KS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCB8fCAkJC5pc1dpdGhpblNoYXBlKHRoaXMsIGQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC50b2dnbGVTaGFwZSh0aGlzLCBkLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbmNsaWNrLmNhbGwoJCQuYXBpLCBkLCB0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYWxsKFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9kcmFnZ2FibGUgJiYgJCQuZHJhZyA/IChcbiAgICAgICAgICAgICAgICAgICAgZDMuYmVoYXZpb3IuZHJhZygpLm9yaWdpbihPYmplY3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWcnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWcoZDMubW91c2UodGhpcykpOyB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnc3RhcnQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdzdGFydChkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdlbmQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdlbmQoKTsgfSlcbiAgICAgICAgICAgICAgICApIDogZnVuY3Rpb24gKCkge31cbiAgICAgICAgICAgICk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlRXZlbnRSZWN0c0Zvck11bHRpcGxlWHMgPSBmdW5jdGlvbiAoZXZlbnRSZWN0RW50ZXIpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgZDMgPSAkJC5kMywgY29uZmlnID0gJCQuY29uZmlnO1xuXG4gICAgICAgIGZ1bmN0aW9uIG1vdXNlb3V0KCkge1xuICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy5ldmVudFJlY3QpLnN0eWxlKCdjdXJzb3InLCBudWxsKTtcbiAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG4gICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgJCQudW5leHBhbmRDaXJjbGVzKCk7XG4gICAgICAgICAgICAkJC51bmV4cGFuZEJhcnMoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGV2ZW50UmVjdEVudGVyLmFwcGVuZCgncmVjdCcpXG4gICAgICAgICAgICAuYXR0cigneCcsIDApXG4gICAgICAgICAgICAuYXR0cigneScsIDApXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCAkJC53aWR0aClcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAkJC5oZWlnaHQpXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCBDTEFTUy5ldmVudFJlY3QpXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICghJCQuY29uZmlnKSB7IHJldHVybjsgfSAvLyBjaGFydCBpcyBkZXN0cm95ZWRcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIG1vdXNlb3V0KCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRhcmdldHNUb1Nob3cgPSAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cyk7XG4gICAgICAgICAgICAgICAgdmFyIG1vdXNlLCBjbG9zZXN0LCBzYW1lWERhdGEsIHNlbGVjdGVkRGF0YTtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5kcmFnZ2luZykgeyByZXR1cm47IH0gLy8gZG8gbm90aGluZyB3aGVuIGRyYWdnaW5nXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUodGFyZ2V0c1RvU2hvdykpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICAgICAgICBtb3VzZSA9IGQzLm1vdXNlKHRoaXMpO1xuICAgICAgICAgICAgICAgIGNsb3Nlc3QgPSAkJC5maW5kQ2xvc2VzdEZyb21UYXJnZXRzKHRhcmdldHNUb1Nob3csIG1vdXNlKTtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5tb3VzZW92ZXIgJiYgKCFjbG9zZXN0IHx8IGNsb3Nlc3QuaWQgIT09ICQkLm1vdXNlb3Zlci5pZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW91dC5jYWxsKCQkLmFwaSwgJCQubW91c2VvdmVyKTtcbiAgICAgICAgICAgICAgICAgICAgJCQubW91c2VvdmVyID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICghIGNsb3Nlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgbW91c2VvdXQoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICgkJC5pc1NjYXR0ZXJUeXBlKGNsb3Nlc3QpIHx8ICFjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHNhbWVYRGF0YSA9IFtjbG9zZXN0XTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzYW1lWERhdGEgPSAkJC5maWx0ZXJCeVgodGFyZ2V0c1RvU2hvdywgY2xvc2VzdC54KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBzaG93IHRvb2x0aXAgd2hlbiBjdXJzb3IgaXMgY2xvc2UgdG8gc29tZSBwb2ludFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0YSA9IHNhbWVYRGF0YS5tYXAoZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLmFkZE5hbWUoZCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoc2VsZWN0ZWREYXRhLCB0aGlzKTtcblxuICAgICAgICAgICAgICAgIC8vIGV4cGFuZCBwb2ludHNcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZENpcmNsZXMoY2xvc2VzdC5pbmRleCwgY2xvc2VzdC5pZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoY2xvc2VzdC5pbmRleCwgY2xvc2VzdC5pZCwgdHJ1ZSk7XG5cbiAgICAgICAgICAgICAgICAvLyBTaG93IHhncmlkIGZvY3VzIGxpbmVcbiAgICAgICAgICAgICAgICAkJC5zaG93WEdyaWRGb2N1cyhzZWxlY3RlZERhdGEpO1xuXG4gICAgICAgICAgICAgICAgLy8gU2hvdyBjdXJzb3IgYXMgcG9pbnRlciBpZiBwb2ludCBpcyBjbG9zZSB0byBtb3VzZSBwb3NpdGlvblxuICAgICAgICAgICAgICAgIGlmICgkJC5pc0JhclR5cGUoY2xvc2VzdC5pZCkgfHwgJCQuZGlzdChjbG9zZXN0LCBtb3VzZSkgPCBjb25maWcucG9pbnRfc2Vuc2l0aXZpdHkpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy5ldmVudFJlY3QpLnN0eWxlKCdjdXJzb3InLCAncG9pbnRlcicpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISQkLm1vdXNlb3Zlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW92ZXIuY2FsbCgkJC5hcGksIGNsb3Nlc3QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQubW91c2VvdmVyID0gY2xvc2VzdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciB0YXJnZXRzVG9TaG93ID0gJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpO1xuICAgICAgICAgICAgICAgIHZhciBtb3VzZSwgY2xvc2VzdDtcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSh0YXJnZXRzVG9TaG93KSkgeyByZXR1cm47IH1cblxuICAgICAgICAgICAgICAgIG1vdXNlID0gZDMubW91c2UodGhpcyk7XG4gICAgICAgICAgICAgICAgY2xvc2VzdCA9ICQkLmZpbmRDbG9zZXN0RnJvbVRhcmdldHModGFyZ2V0c1RvU2hvdywgbW91c2UpO1xuICAgICAgICAgICAgICAgIGlmICghIGNsb3Nlc3QpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgLy8gc2VsZWN0IGlmIHNlbGVjdGlvbiBlbmFibGVkXG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzQmFyVHlwZShjbG9zZXN0LmlkKSB8fCAkJC5kaXN0KGNsb3Nlc3QsIG1vdXNlKSA8IGNvbmZpZy5wb2ludF9zZW5zaXRpdml0eSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZXMgKyAkJC5nZXRUYXJnZXRTZWxlY3RvclN1ZmZpeChjbG9zZXN0LmlkKSkuc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgY2xvc2VzdC5pbmRleCkuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgfHwgJCQuaXNXaXRoaW5TaGFwZSh0aGlzLCBjbG9zZXN0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZVNoYXBlKHRoaXMsIGNsb3Nlc3QsIGNsb3Nlc3QuaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29uY2xpY2suY2FsbCgkJC5hcGksIGNsb3Nlc3QsIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhbGwoXG4gICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2RyYWdnYWJsZSAmJiAkJC5kcmFnID8gKFxuICAgICAgICAgICAgICAgICAgICBkMy5iZWhhdmlvci5kcmFnKCkub3JpZ2luKE9iamVjdClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZycsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZyhkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdzdGFydCcsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZ3N0YXJ0KGQzLm1vdXNlKHRoaXMpKTsgfS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nQgJiYgcGFyZW50LnRhZ05hbWUgIT09ICdCT0RZJykge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB2ID0gcGFyZW50LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpW2tleV07XG4gICAgICAgICAgICB9IGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgICBpZiAoa2V5ID09PSAnd2lkdGgnKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEluIElFIGluIGNlcnRhaW4gY2FzZXMgZ2V0Qm91bmRpbmdDbGllbnRSZWN0XG4gICAgICAgICAgICAgICAgICAgIC8vIHdpbGwgY2F1c2UgYW4gXCJ1bnNwZWNpZmllZCBlcnJvclwiXG4gICAgICAgICAgICAgICAgICAgIHYgPSBwYXJlbnQub2Zmc2V0V2lkdGg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmVudCA9IHBhcmVudC5wYXJlbnROb2RlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0UGFyZW50V2lkdGggPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmdldFBhcmVudFJlY3RWYWx1ZSgnd2lkdGgnKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFBhcmVudEhlaWdodCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGggPSB0aGlzLnNlbGVjdENoYXJ0LnN0eWxlKCdoZWlnaHQnKTtcbiAgICAgICAgcmV0dXJuIGguaW5kZXhPZigncHgnKSA+IDAgPyAraC5yZXBsYWNlKCdweCcsICcnKSA6IDA7XG4gICAgfTtcblxuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ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x0ZXIodHlwZUZpbHRlciwgJCQpKS5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY29uZmlnLmRhdGFfZ3JvdXBzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX2dyb3Vwc1tqXS5pbmRleE9mKGQuaWQpIDwgMCkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBjb25maWcuZGF0YV9ncm91cHNbal0ubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX2dyb3Vwc1tqXVtrXSBpbiBpbmRpY2VzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRpY2VzW2QuaWRdID0gaW5kaWNlc1tjb25maWcuZGF0YV9ncm91cHNbal1ba11dO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoaW5kaWNlc1tkLmlkXSkpIHsgaW5kaWNlc1tkLmlkXSA9IGkrKzsgfVxuICAgICAgICB9KTtcbiAgICAgICAgaW5kaWNlcy5fX21heF9fID0gaSAtIDE7XG4gICAgICAgIHJldHVybiBpbmRpY2VzO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0U2hhcGVYID0gZnVuY3Rpb24gKG9mZnNldCwgdGFyZ2V0c051bSwgaW5kaWNlcywgaXNTdWIpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgc2NhbGUgPSBpc1N1YiA/ICQkLnN1YlggOiAkJC54O1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIHZhciBpbmRleCA9IGQuaWQgaW4gaW5kaWNlcyA/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dGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgdmFyIHZhbHVlcyA9ICQkLmlzU3RlcFR5cGUoZCkgPyAkJC5jb252ZXJ0VmFsdWVzVG9TdGVwKHQudmFsdWVzKSA6IHQudmFsdWVzO1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSBkLmlkIHx8IGluZGljZXNbdC5pZF0gIT09IGluZGljZXNbZC5pZF0pIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgaWYgKHRhcmdldElkcy5pbmRleE9mKHQuaWQpIDwgdGFyZ2V0SWRzLmluZGV4T2YoZC5pZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgdGhlIHggdmFsdWVzIGxpbmUgdXBcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZXNbaV0gPT09ICd1bmRlZmluZWQnIHx8ICt2YWx1ZXNbaV0ueCAhPT0gK2QueCkgeyAgLy8gXCIrXCIgZm9yIHRpbWVzZXJpZXNcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIG5vdCwgdHJ5IHRvIGZpbmQgdGhlIHZhbHVlIHRoYXQgZG9lcyBsaW5lIHVwXG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodiwgaikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2LnggPT09IGQueCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoaSBpbiB2YWx1ZXMgJiYgdmFsdWVzW2ldLnZhbHVlICogZC52YWx1ZSA+PSAwKSB7XG4gIC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AgICAgICAgICAgdmFyIHZhbHVlcyA9IGNvbmZpZy5saW5lX2Nvbm5lY3ROdWxsID8gJCQuZmlsdGVyUmVtb3ZlTnVsbChkLnZhbHVlcykgOiBkLnZhbHVlcyxcbiAgICAgICAgICAgICAgICB4ID0gaXNTdWIgPyAkJC54IDogJCQuc3ViWCwgeSA9IHlTY2FsZUdldHRlci5jYWxsKCQkLCBkLmlkKSwgeDAgPSAwLCB5MCA9IDAsIHBhdGg7XG4gICAgICAgICAgICBpZiAoJCQuaXNMaW5lVHlwZShkKSkge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9yZWdpb25zW2QuaWRdKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSAkJC5saW5lV2l0aFJlZ2lvbnModmFsdWVzLCB4LCB5LCBjb25maWcuZGF0YV9yZWdpb25zW2QuaWRdKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuaXNTdGVwVHlwZShkKSkgeyB2YWx1ZXMgPSAkJC5jb252ZXJ0VmFsdWVzVG9TdGVwKHZhbHVlcyk7IH1cbiAgICAgICAgICAgICAgICAgICAgcGF0aCA9IGxpbmUuaW50ZXJwb2xhdGUoJCQuZ2V0SW50ZXJwb2xhdGUoZCkpKHZhbHVlcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWVzWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgIHgwID0geCh2YWx1ZXNbMF0ueCk7XG4gICAgICAgICAgICAgICAgICAgIHkwID0geSh2YWx1ZXNbMF0udmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwYXRoID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IFwiTSBcIiArIHkwICsgXCIgXCIgKyB4MCA6IFwiTSBcIiArIHgwICsgXCIgXCIgKyB5MDtcbiAgICAgICAgIC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lLFxuICAgICAgICAgICAgcmVnaW9ucyA9IFtdO1xuXG4gICAgICAgIGZ1bmN0aW9uIGlzV2l0aGluUmVnaW9ucyh4LCByZWdpb25zKSB7XG4gICAgICAgICAgICB2YXIgaTtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCByZWdpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlZ2lvbnNbaV0uc3RhcnQgPCB4ICYmIHggPD0gcmVnaW9uc1tpXS5lbmQpIHsgcmV0dXJuIHRydWU7IH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENoZWNrIHN0YXJ0L2VuZCBvZiByZWdpb25zXG4gICAgICAgIGlmIChpc0RlZmluZWQoX3JlZ2lvbnMpKSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgX3JlZ2lvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICByZWdpb25zW2ldID0ge307XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKF9yZWdpb25zW2ldLnN0YXJ0KSkge1xuICAgICAgICAgICAgICAgICAgICByZWdpb25zW2ldLnN0YXJ0ID0gZFswXS54O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlZ2lvbnNbaV0uc3RhcnQgPSAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLnBhcnNlRGF0ZShfcmVnaW9uc1tpXS5zdGFydCkgOiBfcmVnaW9uc1tpXS5zdGFydDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKF9yZWdpb25zW2ldLmVuZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVnaW9uc1tpXS5lbmQgPSBkW2QubGVuZ3RoIC0gMV0ueDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZWdpb25zW2ldLmVuZCA9ICQkLmlzVGltZVNlcmllcygpID8gJCQucGFyc2VEYXRlKF9yZWdpb25zW2ldLmVuZCkgOiBfcmVnaW9uc1tpXS5lbmQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2V0IHNjYWxlc1xuICAgICAgICB4VmFsdWUgPSBjb25maWcuYXhpc19yb3RhdGVkID8gZnVuY3Rpb24gKGQpIHsgcmV0dXJuIHkoZC52YWx1ZSk7IH0gOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4geChkLngpOyB9O1xuICAgICAgICB5VmFsdWUgPSBjb25maWcuYXhpc19yb3RhdGVkID8gZnVuY3Rpb24gKGQpIHsgcmV0dXJuIHgoZC54KTsgfSA6IGZ1bmN0aW9uIChkKSB7IHJldHVybiB5KGQudmFsdWUpOyB9O1xuXG4gICAgICAgIC8vIERlZmluZSBzdmcgZ2VuZXJhdG9yIGZ1bmN0aW9uIGZvciByZWdpb25cbiAgICAgICAgZnVuY3Rpb24gZ2VuZXJhdGVNKHBvaW50cykge1xuICAgICAgICAgICAgcmV0dXJuICdNJyArIHBvaW50c1swXVswXSArICcgJyArIHBvaW50c1swXVsxXSArICcgJyArIHBvaW50c1sxXVswXSArICcgJyArIHBvaW50c1sxXVsxXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgIHNXaXRoUmVnaW9uID0gZnVuY3Rpb24gKGQwLCBkMSwgaiwgZGlmZikge1xuICAgICAgICAgICAgICAgIHZhciB4MCA9IGQwLnguZ2V0VGltZSgpLCB4X2RpZmYgPSBkMS54IC0gZDAueCxcbiAgICAgICAgICAgICAgICAgICAgeHYwID0gbmV3IERhdGUoeDAgKyB4X2RpZmYgKiBqKSxcbiAgICAgICAgICAgICAgICAgICAgeHYxID0gbmV3IERhdGUoeDAgKyB4X2RpZmYgKiAoaiArIGRpZmYpKSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzO1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeSh5cChqKSksIHgoeHYwKV0sIFt5KHlwKGogKyBkaWZmKSksIHgoeHYxKV1dO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeCh4djApLCB5KHlwKGopKV0sIFt4KHh2MSksIHkoeXAoaiArIGRpZmYpKV1dO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZ2VuZXJhdGVNKHBvaW50cyk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc1dpdGhSZWdpb24gPSBmdW5jdGlvbiAoZDAsIGQxLCBqLCBkaWZmKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBvaW50cztcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBwb2ludHMgPSBbW3koeXAoaiksIHRydWUpLCB4KHhwKGopKV0sIFt5KHlwKGogKyBkaWZmKSwgdHJ1ZSksIHgoeHAoaiArIGRpZmYpKV1dO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeCh4cChqKSwgdHJ1ZSksIHkoeXAoaikpXSwgW3goeHAoaiArIGRpZmYpLCB0cnVlKSwgeSh5cChqICsgZGlmZikpXV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBnZW5lcmF0ZU0ocG9pbnRzKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICAvLyBHZW5lcmF0ZVxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xuXG4gICAgICAgICAgICAvLyBEcmF3IGFzIG5vcm1hbFxuICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHJlZ2lvbnMpIHx8ICEgaXNXaXRoaW5SZWdpb25zKGRbaV0ueCwgcmVnaW9ucykpIHtcbiAgICAgICAgICAgICAgICBzICs9IFwiIFwiICsgeFZhbHVlKGRbaV0pICsgXCIgXCIgKyB5VmFsdWUoZFtpXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBEcmF3IHdpdGggcmVnaW9uIC8vIFRPRE86IEZpeCBmb3IgaG9yaXpvdGFsIGNoYXJ0c1xuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgeHAgPSAkJC5nZXRTY2FsZShkW2kgLSAxXS54ICsgeE9mZnNldCwgZFtpXS54ICsgeE9mZnNldCwgJCQuaXNUaW1lU2VyaWVzKCkpO1xuICAgICAgICAgICAgICAgIHlwID0gJCQuZ2V0U2NhbGUoZFtpIC0gMV0udmFsdWUsIGRbaV0udmFsdWUpO1xuXG4gICAgICAgICAgICAgICAgZHggPSB4KGRbaV0ueCkgLSB4KGRbaSAtIDFdLngpO1xuICAgICAgICAgICAgICAgIGR5ID0geShkW2ldLnZhbHVlKSAtIHkoZFtpIC0gMV0udmFsdWUpO1xuICAgICAgICAgICAgICAgIGRkID0gTWF0aC5zcXJ0KE1hdGgucG93KGR4LCAyKSArIE1hdGgucG93KGR5LCAyKSk7XG4gICAgICAgICAgICAgICAgZGlmZiA9IDIgLyBkZDtcbiAgICAgICAgICAgICAgICBkaWZmeDIgPSBkaWZmICogMjtcblxuICAgICAgICAgICAgICAgIGZvciAoaiA9IGRpZmY7IGogPD0gMTsgaiArPSBkaWZmeDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcyArPSBzV2l0aFJlZ2lvbihkW2kgLSAxXSwgZFtpXSwgaiwgZGlmZik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICA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zLFxuICAgICAgICAgICAgciA9ICQkLnBvaW50Ui5iaW5kKCQkKTtcbiAgICAgICAgJCQuZ2V0Q2lyY2xlcyhpKVxuICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAoKSB7IHJldHVybiAkJC5kMy5zZWxlY3QodGhpcykuY2xhc3NlZChDTEFTUy5FWFBBTkRFRCk7IH0pXG4gICAgICAgICAgICAuY2xhc3NlZChDTEFTUy5FWFBBTkRFRCwgZmFsc2UpXG4gICAgICAgICAgICAuYXR0cigncicsIHIpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucG9pbnRSID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gJCQuaXNTdGVwVHlwZShkKSA/IDAgOiAoaXNGdW5jdGlvbihjb25maWcucG9pbnRfcikgPyBjb25maWcucG9pbnRfcihkKSA6IGNvbmZpZy5wb2ludF9yKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnBvaW50RXhwYW5kZWRSID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gY29uZmlnLnBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkID8gKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfciA/IGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfciA6ICQkLnBvaW50UihkKSAqIDEuNzUpIDogJCQucG9pbnRSKGQpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucG9pbnRTZWxlY3RSID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gaXNGdW5jdGlvbihjb25maWcucG9pbnRfc2Vs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XG4gICAgICAgICAgICB2YXIgaW5kZXhYID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDEgOiAwO1xuICAgICAgICAgICAgdmFyIGluZGV4WSA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogMTtcblxuICAgICAgICAgICAgdmFyIHBhdGggPSAnTSAnICsgcG9pbnRzWzBdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbMF1baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICdMJyArIHBvaW50c1sxXVtpbmRleFhdICsgJywnICsgcG9pbnRzWzFdW2luZGV4WV0gKyAnICcgK1xuICAgICAgICAgICAgICAgICAgICAnTCcgKyBwb2ludHNbMl1baW5kZXhYXSArICcsJyArIHBvaW50c1syXVtpbmRleFldICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgJ0wnICsgcG9pbnRzWzNdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbM11baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICd6JztcblxuICAgICAgICAgICAgcmV0dXJuIHBhdGg7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUdldEJhclBvaW50cyA9IGZ1bmN0aW9uIChiYXJJbmRpY2VzLCBpc1N1Yikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgYXhpcyA9IGlzU3ViID8gJCQuc3ViWEF4aXMgOiAkJC54QXhpcyxcbiAgICAgICAgICAgIGJhclRhcmdldHNOdW0gPSBiYXJJbmRpY2VzLl9fbWF4X18gKyAxLFxuICAgICAgICAgICAgYmFyVyA9ICQkLmdldEJhclcoYXhpcywgYmFyVGFyZ2V0c051bSksXG4gICAgICAgICAgICBiYXJYID0gJCQuZ2V0U2hhcGVYKGJhclcsIGJhclRhcmdldHNOdW0sIGJhckluZGljZXMsICEhaXNTdWIpLFxuICAgICAgICAgICAgYmFyWSA9ICQkLm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UG9pbnRzIDogZ2V0TGluZVBvaW50cztcbiAgICAgICAgICAgIHJldHVybiBnZXR0ZXIuY2FsbCgkJCwgZ2V0UG9pbnRzKGQsIGkpLCBkLCB0aGlzKTtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFhGb3JUZXh0ID0gZnVuY3Rpb24gKHBvaW50cywgZCwgdGV4dEVsZW1lbnQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIGJveCA9IHRleHRFbGVtZW50LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLCB4UG9zLCBwYWRkaW5nO1xuICAgICAgICBpZiAoJCQuY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgcGFkZGluZyA9ICQkLmlzQmFyVHlwZShkKSA/IDQgOiA2O1xuICAgICAgICAgICAgeFBvcyA9IHBvaW50c1syXVsxXSArIHBhZGRpbmcgKiAoZC52YWx1ZSA8IDAgPyAtMSA6IDEpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeFBvcyA9ICQkLmhhc1R5cGUoJ2JhcicpID8gKHBvaW50c1syXVswXSArIHBvaW50c1swXVswXSkgLyAyIDogcG9pbnRzWzBdWzBdO1xuICAgICAgICB9XG4gICAgICAgIC8vIHNob3cgbGFiZWxzIHJlZ2FyZGxlc3Mgb2YgdGhlIGRvbWFpbiBpZiB2YWx1ZSBpcyBudWxsXG4gICAgICAgIGlmIChkLnZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICBpZiAoeFBvcyA+ICQkLndpZHRoKSB7XG4gICAgICAgICAgICAgICAgeFBvcyA9ICQkLndpZHRoIC0gYm94LndpZHRoO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh4UG9zIDwgMCkge1xuICAgICAgICAgICAgICAgIHhQb3MgPSA0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB4UG9zO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WUZvclRleHQgPSBmdW5jdGlvbiAocG9pbnRzLCBkLCB0ZXh0RWxlbWVudCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgYm94ID0gdGV4dEVsZW1lbnQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksXG4gICAgICAgICAgICB5UG9zO1xuICAgICAgICBpZiAoJCQuY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgeVBvcyA9IChwb2ludHNbMF1bMF0gKyBwb2ludHNbMl1bMF0gKyBib3guaGVpZ2h0ICogMC42KSAvIDI7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB5UG9zID0gcG9pbnRzWzJdWzFdO1xuICAgICAgICAgICAgaWYgKGQudmFsdWUgPCAwICB8fCAoZC52YWx1ZSA9PT0gMCAmJiAhJCQuaGFzUG9zaXRpdmVWYWx1ZSkpIHtcbiAgICAgICAgICAgICAgICB5UG9zICs9IGJveC5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzQmFyVHlwZShkKSAmJiAkJC5pc1NhZmFyaSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHlQb3MgLT0gMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoISQkLmlzQmFyVHlwZShkKSAmJiAkJC5pc0Nocm9tZSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHlQb3MgKz0gMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHlQb3MgKz0gJCQuaXNCYXJUeXBlKGQpID8gLTMgOiAtNjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBzaG93IGxhYmVscyByZWdhcmRsZXNzIG9mIHRoZSBkb21haW4gaWYgdmFsdWUgaXMgbnVsbFxuICAgICA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JpemVkKCkgPyAkJC54QXhpcy50aWNrT2Zmc2V0KCkgOiAwO1xuXG4gICAgICAgICQkLnhncmlkQXR0ciA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB7XG4gICAgICAgICAgICAneDEnOiAwLFxuICAgICAgICAgICAgJ3gyJzogJCQud2lkdGgsXG4gICAgICAgICAgICAneTEnOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4gJCQueChkKSAtIHRpY2tPZmZzZXQ7IH0sXG4gICAgICAgICAgICAneTInOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4gJCQueChkKSAtIHRpY2tPZmZzZXQ7IH1cbiAgICAgICAgfSA6IHtcbiAgICAgICAgICAgICd4MSc6IGZ1bmN0aW9uIChkKSB7IHJldHVybiAkJC54KGQpICsgdGlja09mZnNldDsgfSxcbiAgICAgICAgICAgICd4Mic6IGZ1bmN0aW9uIChkKSB7IHJldHVybiAkJC54KGQpICsgdGlja09mZnNldDsgfSxcbiAgICAgICAgICAgICd5MSc6IDAsXG4gICAgICAgICAgICAneTInOiAkJC5oZWlnaHRcbiAgICAgICAgfTtcblxuICAgICAgICAkJC54Z3JpZCA9ICQkLm1haW4uc2VsZWN0KCcuJyArIENMQVNTLnhncmlkcykuc2VsZWN0QWxsKCcuJyArIENMQVNTLnhncmlkKVxuICAgICAgICAgICAgLmRhdGEoeGdyaWREYXRhKTtcbiAgICAgICAgJCQueGdyaWQuZW50ZXIoKS5hcHBlbmQoJ2xpbmUnKS5hdHRyKFwiY2xhc3NcIiwgQ0xBU1MueGdyaWQpO1xuICAgICAgICBpZiAoIXdpdGhvdXRVcGRhdGUpIHtcbiAgICAgICAgICAgICQkLnhncmlkLmF0dHIoJCQueGdyaWRBdHRyKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgZnVuY3Rpb24gKCkgeyByZXR1cm4gK2QzLnNlbGVjdCh0aGlzKS5hdHRyKGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAneTEnI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AgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAwKTtcbiAgICAgICAgLy8gdWRwYXRlXG4gICAgICAgIC8vIGRvbmUgaW4gZDMudHJhbnNpdGlvbigpIG9mIHRoZSBlbmQgb2YgdGhpcyBmdW5jdGlvblxuICAgICAgICAvLyBleGl0XG4gICAgICAgICQkLnhncmlkTGluZXMuZXhpdCgpLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMClcbiAgICAgICAgICAgIC5yZW1vdmUoKTtcblxuICAgICAgICAvLyBZLUdyaWRcbiAgICAgICAgaWYgKGNvbmZpZy5ncmlkX3lfc2hvdykge1xuICAgICAgICAgICAgJCQudXBkYXRlWUdyaWQoKTtcbiAgICAgICAgfVxuICAgICAgICAkJC55Z3JpZExpbmVzID0gbWFpbi5zZWxlY3QoJy4nICsgQ0xBU1MueWdyaWRMaW5lcykuc2VsZWN0QWxsKCcuJyArIENMQVNTLnlncmlkTGluZSlcbiAgICAgICAgICAgIC5kYXRhKGNvbmZpZy5ncmlkX3lfbGluZXMpO1xuICAgICAgICAvLyBlbnRlclxuICAgICAgICB5Z3JpZExpbmUgPSAkJC55Z3JpZExpbmVzLmVudGVyKCkuYXBwZW5kKCdnJylcbiAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgZnVuY3Rpb24gKGQpIHsgcmV0dXJuIENMQVNTLnlncmlkTGluZSArIChkWydjbGFzcyddID8gJyAnICsgZFsnY2xhc3MnXSA6ICcnKTsgfSk7XG4gICAgICAgIHlncmlkTGluZS5hcHBlbmQoJ2xpbmUnKVxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAwKTtcbiAgICAgICAgeWdyaWRMaW5lLmFwcGVuZCgndGV4dCcpXG4gICAgICAgICAgICAuYXR0cihcInRleHQtYW5jaG9yXCIsICQkLmdyaWRUZXh0QW5jaG9yKVxuICAgICAgICAgICAgLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IFwicm90YXRlKC05MClcIiA6IFwiXCIpXG4gICAgICAgICAgICAuYXR0cignZHgnLCAkJC5ncmlkVGV4dER4KVxuICAgICAgICAgICAgLmF0dHIoJ2R5JywgLTUpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDApO1xuICAgICAgICAvLyB1cGRhdGVcbiAgICAgICAgeXYgPSAkJC55di5iaW5kKCQkKTtcbiAgICAgICAgJCQueWdyaWRMaW5lcy5zZWxlY3QoJ2xpbmUnKVxuICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pXG4gICAgICAgICAgICAuYXR0cihcIngxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB5diA6IDApXG4gICAgICAgICAgICAuYXR0cihcIngyXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB5diA6ICQkLndpZHRoKVxuICAgICAgICAgICAgLmF0dHIoXCJ5MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IHl2KVxuICAgICAgICAgICAgLmF0dHIoXCJ5MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQuaGVpZ2h0IDogeXYpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDEpO1xuICAgICAgICAkJC55Z3JpZExpbmVzLnNlbGVjdCgndGV4dCcpXG4gICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5hdHRyKFwieFwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQueEdyaWRUZXh0WC5iaW5kKCQkKSA6ICQkLnlHcmlkVGV4dFguYmluZCgkJCkpXG4gICAgICAgICAgICAuYXR0cihcInlcIiwgeXYpXG4gICAgICAgICAgICAudGV4dChmdW5jdGlvbiAoZCkgeyByZXR1cm4gZC50ZXh0OyB9KVxuICAgICAg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pZERhdGEgPSBbXSwgeERvbWFpbiwgZmlyc3RZZWFyLCBsYXN0WWVhciwgaSxcbiAgICAgICAgICAgIHRpY2tOdW0gPSAkJC5tYWluLnNlbGVjdChcIi5cIiArIENMQVNTLmF4aXNYKS5zZWxlY3RBbGwoJy50aWNrJykuc2l6ZSgpO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ3llYXInKSB7XG4gICAgICAgICAgICB4RG9tYWluID0gJCQuZ2V0WERvbWFpbigpO1xuICAgICAgICAgICAgZmlyc3RZZWFyID0geERvbWFpblswXS5nZXRGdWxsWWVhcigpO1xuICAgICAgICAgICAgbGFzdFllYXIgPSB4RG9tYWluWzFdLmdldEZ1bGxZZWFyKCk7XG4gICAgICAgICAgICBmb3IgKGkgPSBmaXJzdFllYXI7IGkgPD0gbGFzdFllYXI7IGkrKykge1xuICAgICAgICAgICAgICAgIGdyaWREYXRhLnB1c2gobmV3IERhdGUoaSArICctMDEtMDEgMDA6MDA6MDAnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBncmlkRGF0YSA9IHNjYWxlLnRpY2tzKDEwKTtcbiAgICAgICAgICAgIGlmIChncmlkRGF0YS5sZW5ndGggPiB0aWNrTnVtKSB7IC8vIHVzZSBvbmx5IGludFxuICAgICAgICAgICAgICAgIGdyaWREYXRhID0gZ3JpZERhdGEuZmlsdGVyKGZ1bmN0aW9uIChkKSB7IHJldHVybiAoXCJcIiArIGQpLmluZGV4T2YoJy4nKSA8IDA7IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBncmlkRGF0YTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldEdyaWRGaWx0ZXJUb1JlbW92ZSA9IGZ1bmN0aW9uIChwYXJhbXMpIHtcbiAgICAgICAgcmV0dXJuIHBhcmFtcyA/IGZ1bmN0aW9uIChsaW5lKSB7XG4gICAgICAgICAgICB2YXI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NpdGlvbigpLmR1cmF0aW9uKGNvbmZpZy50cmFuc2l0aW9uX2R1cmF0aW9uKVxuICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMCkucmVtb3ZlKCk7XG4gICAgICAgIGlmIChmb3JYKSB7XG4gICAgICAgICAgICBjb25maWcuZ3JpZF94X2xpbmVzID0gY29uZmlnLmdyaWRfeF9saW5lcy5maWx0ZXIodG9TaG93KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbmZpZy5ncmlkX3lfbGluZXMgPSBjb25maWcuZ3JpZF95X2xpbmVzLmZpbHRlcih0b1Nob3cpO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmluaXRUb29sdGlwID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGk7XG4gICAgICAgICQkLnRvb2x0aXAgPSAkJC5zZWxlY3RDaGFydFxuICAgICAgICAgICAgLnN0eWxlKFwicG9zaXRpb25cIiwgXCJyZWxhdGl2ZVwiKVxuICAgICAgICAgIC5hcHBlbmQoXCJkaXZcIilcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIENMQVNTLnRvb2x0aXBDb250YWluZXIpXG4gICAgICAgICAgICAuc3R5bGUoXCJwb3NpdGlvblwiLCBcImFic29sdXRlXCIpXG4gICAgICAgICAgICAuc3R5bGUoXCJwb2ludGVyLWV2ZW50c1wiLCBcIm5vbmVcIilcbiAgICAgICAgICAgIC5zdHlsZShcImRpc3BsYXlcIiwgXCJub25lXCIpO1xuICAgICAgICAvLyBTaG93IHRvb2x0aXAgaWYgbmVlZGVkXG4gICAgICAgIGlmIChjb25maWcudG9vbHRpcF9pbml0X3Nob3cpIHtcbiAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSAmJiBpc1N0cmluZyhjb25maWcudG9vbHRpcF9pbml0X3gpKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLnRvb2x0aXBfaW5pdF94ID0gJCQucGFyc2VEYXRlKGNvbmZpZy50b29sdGlwX2luaXRfeCk7XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8ICQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzW2ldLnggLSBjb25maWcudG9vbHRpcF9pbml0X3gpID09PSAwKSB7IGJyZWFrOyB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbmZpZy50b29sdGlwX2luaXRfeCA9IGk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkJC50b29sdGlwLmh0bWwoY29uZmlnLnRvb2x0aXBfY29udGVudHMuY2FsbCgkJCwgJCQuZGF0YS50YXJnZXRzLm1hcChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAkJC5hZGROYW1lKGQudmFsdWVzW2NvbmZpZy50b29sdGlwX2luaXRfeF0pO1xuICAgICAgICAgICAgfSksICQkLmF4aXMuZ2V0WEF4aXNUaWNrRm9ybWF0KCksICQkLmdldFlGb3JtYXQoJCQuaGFzQXJjVHlwZSgpKSwgJCQuY29sb3IpKTtcbiAgICAgICAgICAgICQkLnRvb2x0aXAuc3R5bGUoXCJ0b3BcIiwgY29uZmlnLnRvb2x0aXBfaW5pdF9wb3NpdGlvbi50b3ApXG4gICAgICAgICAgICAgICAgLnN0eWxlKFwibGVmdFwiLCBjb25maWcudG9vbHRpcF9pbml0X3Bvc2l0aW9uLmxlZnQpXG4gICAgICAgICAgICAgICAgLnN0eWxlKFwiZGlzcGxheVwiLCBcImJsb2NrXCIpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRUb29sdGlwQ29udGVudCA9IGZ1bmN0aW9uIChkLCBk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AgICAgICAgICAgICAgdmFyIHYxID0gYSA/IGEudmFsdWUgOiBudWxsLCB2MiA9IGIgPyBiLnZhbHVlIDogbnVsbDtcbiAgICAgICAgICAgICAgICBpZiAodjEgPiAwICYmIHYyID4gMCkge1xuICAgICAgICAgICAgICAgICAgICB2MSA9IGEgPyBpZHMuaW5kZXhPZihhLmlkKSA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIHYyID0gYiA/IGlkcy5pbmRleE9mKGIuaWQpIDogbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9yZGVyQXNjID8gdjEgLSB2MiA6IHYyIC0gdjE7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBkLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoISAoZFtpXSAmJiAoZFtpXS52YWx1ZSB8fCBkW2ldLnZhbHVlID09PSAwKSkpIHsgY29udGludWU7IH1cblxuICAgICAgICAgICAgaWYgKCEgdGV4dCkge1xuICAgICAgICAgICAgICAgIHRpdGxlID0gc2FuaXRpc2UodGl0bGVGb3JtYXQgPyB0aXRsZUZvcm1hdChkW2ldLngpIDogZFtpXS54KTtcbiAgICAgICAgICAgICAgICB0ZXh0ID0gXCI8dGFibGUgY2xhc3M9J1wiICsgJCQuQ0xBU1MudG9vbHRpcCArIFwiJz5cIiArICh0aXRsZSB8fCB0aXRsZSA9PT0gMCA/IFwiPHRyPjx0aCBjb2xzcGFuPScyJz5cIiArIHRpdGxlICsgXCI8L3RoPjwvdHI+XCIgOiBcIlwiKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFsdWUgPSBzYW5pdGlzZSh2YWx1ZUZvcm1hdChkW2ldLnZhbHVlLCBkW2ldLnJhdGlvLCBkW2ldLmlkLCBkW2ldLmluZGV4LCBkKSk7XG4gICAgICAgICAgICBpZiAodmFsdWUgIT09IHVuZGVmaW5l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yZWFMZW5ndGggPSAkJC5pc0xlZ2VuZFJpZ2h0IHx8ICQkLmlzTGVnZW5kSW5zZXQgPyAkJC5nZXRMZWdlbmRIZWlnaHQoKSA6ICQkLmdldExlZ2VuZFdpZHRoKCksXG4gICAgICAgICAgICAgICAgbWFyZ2luLCBtYXhMZW5ndGg7XG5cbiAgICAgICAgICAgIC8vIE1FTU86IGNhcmUgYWJvdXQgY29uZGlmaW9uIG9mIHN0ZXAsIHRvdGFsTGVuZ3RoXG4gICAgICAgICAgICBmdW5jdGlvbiB1cGRhdGVWYWx1ZXMoaWQsIHdpdGhvdXRTdGVwKSB7XG4gICAgICAgICAgICAgICAgaWYgKCF3aXRob3V0U3RlcCkge1xuICAgICAgICAgICAgICAgICAgICBtYXJnaW4gPSAoYXJlYUxlbmd0aCAtIHRvdGFsTGVuZ3RoIC0gaXRlbUxlbmd0aCkgLyAyO1xuICAgICAgICAgICAgICAgICAgICBpZiAobWFyZ2luIDwgcG9zTWluKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW4gPSAoYXJlYUxlbmd0aCAtIGl0ZW1MZW5ndGgpIC8gMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsTGVuZ3RoID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0ZXArKztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzdGVwc1tpZF0gPSBzdGVwO1xuICAgICAgICAgICAgICAgIG1hcmdpbnNbc3RlcF0gPSAkJC5pc0xlZ2VuZEluc2V0ID8gMTAgOiBtYXJnaW47XG4gICAgICAgICAgICAgICAgb2Zmc2V0c1tpZF0gPSB0b3RhbExlbmd0aDtcbiAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCArPSBpdGVtTGVuZ3RoO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAocmVzZXQpIHtcbiAgICAgICAgICAgICAgICB0b3RhbExlbmd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7XG4gICAgICAgICAgICAgICAgbWFyZ2luID0gKGFyZWFMZW5ndGggLSBtYXhMZW5ndGggKiB0YXJnZXRJZHMubGVuZ3RoKSAvIDI7XG4gICAgICAgICAgICAgICAgaWYgKG1hcmdpbiA8IHBvc01pbikge1xuICAgICAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHN0ZXAgPSAwO1xuICAgICAgICAgICAgICAgICAgICB0YXJnZXRJZHMuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHsgdXBkYXRlVmFsdWVzKGlkKTsgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB1cGRhdGVWYWx1ZXMoaWQsIHRydWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdXBkYXRlVmFsdWVzKGlkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgkJC5pc0xlZ2VuZEluc2V0KSB7XG4gICAgICAgICAgICBzdGVwID0gY29uZmlnLmxlZ2VuZF9pbnNldF9zdGVwID8gY29uZmlnLmxlZ2VuZF9pbnNldF9zdGVwIDogdGFyZ2V0SWRzLmxlbmd0aDtcbiAgICAgICAgICAgICQkLnVwZGF0ZUxlZ2VuZFN0ZXAoc3RlcCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoJCQuaXNMZWdlbmRSaWdodCkge1xuICAgICAgICAgICAgeEZvckxlZ2VuZCA9IGZ1bmN0aW9uIChpZCkgeyByZXR1cm4gbWF4V2lkdGggKiBzdGVwc1tpZF07IH07XG4gICAgICAgICAgICB5Rm9yTGVnZW5kID0gZnVuY3Rpb24gKGlkKSB7IHJldHVybiBtYXJnaW5zW3N0ZXBzW2lkXV0gKyBvZmZzZXRzW2lkXTsgfTtcbiAgICAgICAgfSBlbHNlIGlmICgkJC5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QkLmFwaS5oaWRlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5hcGkuc2hvdyhpZCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5hcGkudG9nZ2xlKGlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmlzVGFyZ2V0VG9TaG93KGlkKSA/ICQkLmFwaS5mb2N1cyhpZCkgOiAkJC5hcGkucmV2ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmxlZ2VuZF9pdGVtX29ubW91c2VvdmVyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5sZWdlbmRfaXRlbV9vbm1vdXNlb3Zlci5jYWxsKCQkLCBpZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAkJC5kMy5zZWxlY3QodGhpcykuY2xhc3NlZChDTEFTUy5sZWdlbmRJdGVtRm9jdXNlZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghJCQudHJhbnNpdGluZyAmJiAkJC5pc1RhcmdldFRvU2hvdyhpZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmFwaS5mb2N1cyhpZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcubGVnZW5kX2l0ZW1fb25tb3VzZW91dCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcubGVnZW5kX2l0ZW1fb25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JpemVkKCksXG4gICAgICAgICAgICAgICAgd2l0aE91dGVyVGljazogd2l0aE91dGVyVGljayxcbiAgICAgICAgICAgICAgICB0aWNrTXVsdGlsaW5lOiBjb25maWcuYXhpc194X3RpY2tfbXVsdGlsaW5lLFxuICAgICAgICAgICAgICAgIHRpY2tXaWR0aDogY29uZmlnLmF4aXNfeF90aWNrX3dpZHRoLFxuICAgICAgICAgICAgICAgIHRpY2tUZXh0Um90YXRlOiB3aXRob3V0Um90YXRlVGlja1RleHQgPyAwIDogY29uZmlnLmF4aXNfeF90aWNrX3JvdGF0ZSxcbiAgICAgICAgICAgICAgICB3aXRob3V0VHJhbnNpdGlvbjogd2l0aG91dFRyYW5zaXRpb24sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYXhpcyA9IGMzX2F4aXMoJCQuZDMsIGF4aXNQYXJhbXMpLnNjYWxlKHNjYWxlKS5vcmllbnQob3JpZW50KTtcblxuICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkgJiYgdGlja1ZhbHVlcyAmJiB0eXBlb2YgdGlja1ZhbHVlcyAhPT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICB0aWNrVmFsdWVzID0gdGlja1ZhbHVlcy5tYXAoZnVuY3Rpb24gKHYpIHsgcmV0dXJuICQkLnBhcnNlRGF0ZSh2KTsgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTZXQgdGlja1xuICAgICAgICBheGlzLnRpY2tGb3JtYXQodGlja0Zvcm1hdCkudGlja1ZhbHVlcyh0aWNrVmFsdWVzKTtcbiAgICAgICAgaWYgKCQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgYXhpcy50aWNrQ2VudGVyZWQoY29uZmlnLmF4aXNfeF90aWNrX2NlbnRlcmVkKTtcbiAgICAgICAgICAgIGlmIChpc0VtcHR5KGNvbmZpZy5heGlzX3hfdGlja19jdWxsaW5nKSkge1xuICAgICAgICAgICAgICAgIGNvbmZpZ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PSB0aGlzLm93bmVyLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBheGlzUGFyYW1zID0ge1xuICAgICAgICAgICAgICAgIHdpdGhPdXRlclRpY2s6IHdpdGhPdXRlclRpY2ssXG4gICAgICAgICAgICAgICAgd2l0aG91dFRyYW5zaXRpb246IHdpdGhvdXRUcmFuc2l0aW9uLFxuICAgICAgICAgICAgICAgIHRpY2tUZXh0Um90YXRlOiB3aXRob3V0Um90YXRlVGlja1RleHQgPyAwIDogY29uZmlnLmF4aXNfeV90aWNrX3JvdGF0ZVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGF4aXMgPSBjM19heGlzKCQkLmQzLCBheGlzUGFyYW1zKS5zY2FsZShzY2FsZSkub3JpZW50KG9yaWVudCkudGlja0Zvcm1hdCh0aWNrRm9ybWF0KTtcbiAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllc1koKSkge1xuICAgICAgICAgICAgYXhpcy50aWNrcygkJC5kMy50aW1lW2NvbmZpZy5heGlzX3lfdGlja190aW1lX3ZhbHVlXSwgY29uZmlnLmF4aXNfeV90aWNrX3RpbWVfaW50ZXJ2YWwpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYXhpcy50aWNrVmFsdWVzKHRpY2tWYWx1ZXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBheGlzO1xuICAgIH07XG4gICAgQXhpcy5wcm90b3R5cGUuZ2V0SWQgPSBmdW5jdGlvbiBnZXRJZChpZCkge1xuICAgICAgICB2YXIgY29uZmlnID0gdGhpcy5vd25lci5jb25maWc7XG4gICAgICAgIHJldHVybiBpZCBpbiBjb25maWcuZGF0YV9heGVzID8gY29uZmlnLmRhdGFfYXhlc1tpZF0gOiAneSc7XG4gICAgfTtcbiAgICBBeGlzLnByb3RvdHlwZS5nZXRYQXhpc1RpY2tGb3JtYXQgPSBmdW5jdGlvbiBnZXRYQXhpc1RpY2tGb3JtYXQoKSB7XG4gICAgICAgIH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G90eXBlLmdlbmVyYXRlVGlja1ZhbHVlcyA9IGZ1bmN0aW9uIGdlbmVyYXRlVGlja1ZhbHVlcyh2YWx1ZXMsIHRpY2tDb3VudCwgZm9yVGltZVNlcmllcykge1xuICAgICAgICB2YXIgdGlja1ZhbHVlcyA9IHZhbHVlcywgdGFyZ2V0Q291bnQsIHN0YXJ0LCBlbmQsIGNvdW50LCBpbnRlcnZhbCwgaSwgdGlja1ZhbHVlO1xuICAgICAgICBpZiAodGlja0NvdW50KSB7XG4gICAgICAgICAgICB0YXJnZXRDb3VudCA9IGlzRnVuY3Rpb24odGlja0NvdW50KSA/IHRpY2tDb3VudCgpIDogdGlja0NvdW50O1xuICAgICAgICAgICAgLy8gY29tcHV0ZSB0aWNrcyBhY2NvcmRpbmcgdG8gdGlja0NvdW50XG4gICAgICAgICAgICBpZiAodGFyZ2V0Q291bnQgPT09IDEpIHtcbiAgICAgICAgICAgICAgICB0aWNrVmFsdWVzID0gW3ZhbHVlc1swXV07XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRhcmdldENvdW50ID09PSAyKSB7XG4gICAgICAgICAgICAgICAgdGlja1ZhbHVlcyA9IFt2YWx1ZXNbMF0sIHZhbHVlc1t2YWx1ZXMubGVuZ3RoIC0gMV1dO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0YXJnZXRDb3VudCA+IDIpIHtcbiAgICAgICAgICAgICAgICBjb3VudCA9IHRhcmdldENvdW50IC0gMjtcbiAgICAgICAgICAgICAgICBzdGFydCA9IHZhbHVlc1swXTtcbiAgICAgICAgICAgICAgICBlbmQgPSB2YWx1ZXNbdmFsdWVzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgICAgIGludGVydmFsID0gKGVuZCAtIHN0YXJ0KSAvIChjb3VudCArIDEpO1xuICAgICAgICAgICAgICAgIC8vIHJlLWNvbnN0cnVjdCB1bmlxdWUgdmFsdWVzXG4gICAgICAgICAgICAgICAgdGlja1ZhbHVlcyA9IFtzdGFydF07XG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xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuZXhwYW5kQXJjKHRhcmdldElkcyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCAxMCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB0YXJnZXRJZHMgPSAkJC5tYXBUb1RhcmdldElkcyh0YXJnZXRJZHMpO1xuXG4gICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJCQuc2VsZWN0b3JUYXJnZXRzKHRhcmdldElkcywgJy4nICsgQ0xBU1MuY2hhcnRBcmMpKS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICBpZiAoISAkJC5zaG91bGRFeHBhbmQoZC5kYXRhLmlkKSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICQkLmQzLnNlbGVjdCh0aGlzKS5zZWxlY3RBbGwoJ3BhdGgnKVxuICAgICAgICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oJCQuZXhwYW5kRHVyYXRpb24oZC5kYXRhLmlkKSlcbiAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgJCQuc3ZnQXJjRXhwYW5kZWQpXG4gICAgICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbigkJC5leHBhbmREdXJhdGlvbihkLmRhdGEuaWQpICogMilcbiAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgJCQuc3ZnQXJjRXhwYW5kZWRTdWIpXG4gICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmlzRG9udXRUeXBlKGQuZGF0YSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbGxiYWNrIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYzNfY2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lwZShpZCkpIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcucGllX2V4cGFuZF9kdXJhdGlvbjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiA1MDtcbiAgICAgICAgfVxuXG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnNob3VsZEV4cGFuZCA9IGZ1bmN0aW9uIChpZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIHJldHVybiAoJCQuaXNEb251dFR5cGUoaWQpICYmIGNvbmZpZy5kb251dF9leHBhbmQpIHx8XG4gICAgICAgICAgICAgICAoJCQuaXNHYXVnZVR5cGUoaWQpICYmIGNvbmZpZy5nYXVnZV9leHBhbmQpIHx8XG4gICAgICAgICAgICAgICAoJCQuaXNQaWVUeXBlKGlkKSAmJiBjb25maWcucGllX2V4cGFuZCk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnNob3VsZFNob3dBcmNMYWJlbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCBzaG91bGRTaG93ID0gdHJ1ZTtcbiAgICAgICAgaWYgKCQkLmhhc1R5cGUoJ2RvbnV0JykpIHtcbiAgICAgICAgICAgIHNob3VsZFNob3cgPSBjb25maWcuZG9udXRfbGFiZWxfc2hvdztcbiAgICAgICAgfSBlbHNlIGlmICgkJC5oYXNUeXBlKCdwaWUnKSkge1xuICAgICAgICAgICAgc2hvdWxkU2hvdyA9IGNvbmZpZy5waWVfbGFiZWxfc2hvdztcbiAgICAgICAgfVxuICAgICAgICAvLyB3aGVuIGdhdWdlLCBhbHdheXMgdHJ1ZVxuICAgICAgICByZXR1cm4gc2hvdWxkU2hvdztcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ubWVldHNBcmNMYWJlbFRocm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XCIsIGZ1bmN0aW9uIChkKSB7IHJldHVybiBkID09PSB0aGlzLl9jdXJyZW50ID8gMCA6IDE7IH0pXG4gICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCwgYXJjRGF0YTtcbiAgICAgICAgICAgICAgICBpZiAoJCQudHJhbnNpdGluZykgeyAvLyBza2lwIHdoaWxlIHRyYW5zaXRpbmdcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCk7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIHRyYW5zaXRpb25zXG4gICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZEFyYyh1cGRhdGVkLmRhdGEuaWQpO1xuICAgICAgICAgICAgICAgICAgICAkJC5hcGkuZm9jdXModXBkYXRlZC5kYXRhLmlkKTtcbiAgICAgICAgICAgICAgICAgICAgJCQudG9nZ2xlRm9jdXNMZWdlbmQodXBkYXRlZC5kYXRhLmlkLCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25tb3VzZW92ZXIoYXJjRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSA6IG51bGwpXG4gICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpLCBhcmNEYXRhLCBzZWxlY3RlZERhdGE7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCksXG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0YSA9IFthcmNEYXRhXTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoc2VsZWN0ZWREYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IDogbnVsbClcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCA/IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQsIGFyY0RhdGE7XG4gICAgICAgICAgICAgICAgaWYgKCQkLnRyYW5zaXRpbmcpIHsgLy8gc2tpcCB3aGlsZSB0cmFuc2l0aW5nXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgICAgICAvLyB0cmFuc2l0aW9uc1xuICAgICAgICAgICAgICAgICAgICAkJC51bmV4cGFuZEFyYyh1cGRhdGVkLmRhdGEuaWQpO1xuICAgICAgICAgICAgICAgICAgICAkJC5hcGkucmV2ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnJldmVydExlZ2VuZCgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbm1vdXNlb3V0KGFyY0RhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLm9uKCdjbGljaycsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpLCBhcmNEYXRhO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQudG9nZ2xlU2hhcGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZVNoYXBlKHRoaXMsIGFyY0RhdGEsIGkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29uY2xpY2suY2FsbCgkJC5hcGksIGFyY0RhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKCkgeyAkJC50cmFuc2l0aW5nID0gdHJ1ZTsgfSlcbiAgICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pXG4gICAgICAgICAgICAuYXR0clR3ZWVuKFwiZFwiLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCksIGludGVycG9sYXRlO1xuICAgICAgICAgICAgICAgIGlmICghIHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHsgcmV0dXJuIFwiTSAwIDBcIjsgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnQgPT09IGQpIHtcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudCA9IHtcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0QW5nbGU6IE1hdGguUEkqMixcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIGVuZEFuZ2xlOiBNYXRoLlBJKjIsXG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc05hTih0aGlzLl9jdXJyZW50LnN0YXJ0QW5nbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQuc3RhcnRBbmdsZSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc05hTih0aGlzLl9jdXJyZW50LmVuZEFuZ2xlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50LmVuZEFuZ2xlID0gdGhpcy5fY3VycmVudC5zdGFydEFuZ2xlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpbnRlcnBvbGF0ZSA9IGQzLmludGVycG9sYXRlKHRoaXMuX2N1cnJlbnQsIHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQgPSBpbnRlcnBvbGF0ZSgwKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGludGVycG9sYXRlZCA9IGludGVycG9sYXRlKHQpO1xuICAgICAgICAgICAgICAgICAgICBpbnRlcnBvbGF0ZWQuZGF0YSA9IGQuZGF0YTsgL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gICAgICAgICAgICAgICAgICAgICBzdGFydEFuZ2xlOiBjb25maWcuZ2F1Z2Vfc3RhcnRpbmdBbmdsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVuZEFuZ2xlOiAtMSAqIGNvbmZpZy5nYXVnZV9zdGFydGluZ0FuZ2xlXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5nZXRBcmMoZCwgdHJ1ZSwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NHYXVnZVVuaXQpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJkeVwiLCBcIi43NWVtXCIpXG4gICAgICAgICAgICAgICAgLnRleHQoY29uZmlnLmdhdWdlX2xhYmVsX3Nob3cgPyBjb25maWcuZ2F1Z2VfdW5pdHMgOiAnJyk7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NHYXVnZU1pbilcbiAgICAgICAgICAgICAgICAuYXR0cihcImR4XCIsIC0xICogKCQkLmlubmVyUmFkaXVzICsgKCgkJC5yYWRpdXMgLSAkJC5pbm5lclJhZGl1cykgLyAoY29uZmlnLmdhdWdlX2Z1bGxDaXJjbGUgPyAxIDogMikpKSArIFwicHhcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImR5XCIsIFwiMS4yZW1cIilcbiAgICAgICAgICAgICAgICAudGV4dChjb25maWcuZ2F1Z2VfbGFiZWxfc2hvdyA/IGNvbmZpZy5nYXVnZV9taW4gOiAnJyk7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NHYXVnZU1heClcbiAgICAgICAgICAgICAgICAuYXR0cihcImR4XCIsICQkLmlubmVyUmFkaXVzICsgKCgkJC5yYWRpdXMgLSAkJC5pbm5lclJhZGl1cykgLyA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kZSkuZGF0dW0oKTtcbiAgICAgICAgICAgICAgICAkJC5kMy5zZWxlY3QodGhpcykuZGF0dW0ocGFyZW50RGF0YSk7XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIHggPSAkJC5yZWdpb25YLmJpbmQoJCQpLFxuICAgICAgICAgICAgeSA9ICQkLnJlZ2lvblkuYmluZCgkJCksXG4gICAgICAgICAgICB3ID0gJCQucmVnaW9uV2lkdGguYmluZCgkJCksXG4gICAgICAgICAgICBoID0gJCQucmVnaW9uSGVpZ2h0LmJpbmQoJCQpO1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgKHdpdGhUcmFuc2l0aW9uID8gcmVnaW9ucy50cmFuc2l0aW9uKCkgOiByZWdpb25zKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieFwiLCB4KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieVwiLCB5KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgdylcbiAgICAgICAgICAgICAgICAuYXR0cihcImhlaWdodFwiLCBoKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcImZpbGwtb3BhY2l0eVwiLCBmdW5jdGlvbiAoZCkgeyByZXR1cm4gaXNWYWx1ZShkLm9wYWNpdHkpID8gZC5vcGFjaXR5IDogMC4xOyB9KVxuICAgICAgICBdO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucmVnaW9uWCA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIHhQb3MsIHlTY2FsZSA9IGQuYXhpcyA9PT0gJ3knID8gJCQueSA6ICQkLnkyO1xuICAgICAgICBpZiAoZC5heGlzID09PSAneScgfHwgZC5heGlzID09PSAneTInKSB7XG4gICAgICAgICAgICB4UG9zID0gY29uZmlnLmF4aXNfcm90YXRlZCA/ICgnc3RhcnQnIGluIGQgPyB5U2N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xBU1MuU0VMRUNURUQpLFxuICAgICAgICAgICAgICAgICAgICBpc0luY2x1ZGVkID0gc2hhcGUuY2xhc3NlZChDTEFTUy5JTkNMVURFRCksXG4gICAgICAgICAgICAgICAgICAgIF94LCBfeSwgX3csIF9oLCB0b2dnbGUsIGlzV2l0aGluID0gZmFsc2UsIGJveDtcbiAgICAgICAgICAgICAgICBpZiAoc2hhcGUuY2xhc3NlZChDTEFTUy5jaXJjbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIF94ID0gc2hhcGUuYXR0cihcImN4XCIpICogMTtcbiAgICAgICAgICAgICAgICAgICAgX3kgPSBzaGFwZS5hdHRyKFwiY3lcIikgKiAxO1xuICAgICAgICAgICAgICAgICAgICB0b2dnbGUgPSAkJC50b2dnbGVQb2ludDtcbiAgICAgICAgICAgICAgICAgICAgaXNXaXRoaW4gPSBtaW5YIDwgX3ggJiYgX3ggPCBtYXhYICYmIG1pblkgPCBfeSAmJiBfeSA8IG1heFk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNoYXBlLmNsYXNzZWQoQ0xBU1MuYmFyKSkge1xuICAgICAgICAgICAgICAgICAgICBib3ggPSBnZXRQYXRoQm94KHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICBfeCA9IGJveC54O1xuICAgICAgICAgICAgICAgICAgICBfeSA9IGJveC55O1xuICAgICAgICAgICAgICAgICAgICBfdyA9IGJveC53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgX2ggPSBib3guaGVpZ2h0O1xuICAgICAgICAgICAgICAgICAgICB0b2dnbGUgPSAkJC50b2dnbGVQYXRoO1xuICAgICAgICAgICAgICAgICAgICBpc1dpdGhpbiA9ICEobWF4WCA8IF94IHx8IF94ICsgX3cgPCBtaW5YKSAmJiAhKG1heFkgPCBfeSB8fCBfeSArIF9oIDwgbWluWSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy8g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Y2hhcnRMaW5lcykuc2VsZWN0QWxsKCcuJyArIENMQVNTLmNoYXJ0TGluZSlcbiAgICAgICAgICAgICAgICAuZGF0YSh0YXJnZXRzKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGNsYXNzQ2hhcnRMaW5lKTtcbiAgICAgICAgICAgIGNvbnRleHRMaW5lRW50ZXIgPSBjb250ZXh0TGluZVVwZGF0ZS5lbnRlcigpLmFwcGVuZCgnZycpXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMClcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCBjbGFzc0NoYXJ0TGluZSk7XG4gICAgICAgICAgICAvLyBMaW5lcyBmb3IgZWFjaCBkYXRhXG4gICAgICAgICAgICBjb250ZXh0TGluZUVudGVyLmFwcGVuZChcImdcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIGNsYXNzTGluZXMpO1xuICAgICAgICAgICAgLy8gQXJlYVxuICAgICAgICAgICAgY29udGV4dExpbmVFbnRlci5hcHBlbmQoXCJnXCIpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJjbGFzc1wiLCBjbGFzc0FyZWFzKTtcblxuICAgICAgICAgICAgLy8tLSBCcnVzaCAtLS8vXG4gICAgICAgICAgICBjb250ZXh0LnNlbGVjdEFsbCgnLicgKyBDTEFTUy5icnVzaCArICcgcmVjdCcpXG4gICAgICAgICAgICAgICAgLmF0dHIoY29uZmlnLmF4aXNfcm90YXRlZCA/IFwid2lkdGhcIiA6IFwiaGVpZ2h0XCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC53aWR0aDIgOiAkJC5oZWlnaHQyKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlQmFyRm9yU3ViY2hhcnQgPSBmdW5jdGlvbiAoZHVyYXRpb25Gb3JFeGl0KSB7XG4gICAgICAgIHZhciAkJCA9IHRo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ICYmIGQzLmV2ZW50LnR5cGUgPT09ICd6b29tJykge1xuICAgICAgICAgICAgICAgICQkLmJydXNoLmV4dGVudCgkJC54Lm9yZ0RvbWFpbigpKS51cGRhdGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIHVwZGF0ZSBzdWJjaGFydCBlbGVtZW50cyBpZiBuZWVkZWRcbiAgICAgICAgICAgIGlmICh3aXRoU3ViY2hhcnQpIHtcblxuICAgICAgICAgICAgICAgIC8vIGV4dGVudCByZWN0XG4gICAgICAgICAgICAgICAgaWYgKCEkJC5icnVzaC5lbXB0eSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmJydXNoLmV4dGVudCgkJC54Lm9yZ0RvbWFpbigpKS51cGRhdGUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gc2V0dXAgZHJhd2VyIC0gTUVNTzogdGhpcyBtdXN0IGJlIGNhbGxlZCBhZnRlciBheGlzIHVwZGF0ZWRcbiAgICAgICAgICAgICAgICBkcmF3QXJlYU9uU3ViID0gJCQuZ2VuZXJhdGVEcmF3QXJlYShhcmVhSW5kaWNlcywgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgZHJhd0Jhck9uU3ViID0gJCQuZ2VuZXJhdGVEcmF3QmFyKGJhckluZGljZXMsIHRydWUpO1xuICAgICAgICAgICAgICAgIGRyYXdMaW5lT25TdWIgPSAkJC5nZW5lcmF0ZURyYXdMaW5lKGxpbmVJbmRpY2VzLCB0cnVlKTtcblxuICAgICAgICAgICAgICAgICQkLnVwZGF0ZUJhckZvclN1YmNoYXJ0KGR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVMaW5lRm9yU3ViY2hhcnQoZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICQkLnVwZGF0ZUFyZWFGb3JTdWJjaGFydChkdXJhdGlvbik7XG5cbiAgICAgICAgICAgICAgICAkJC5yZWRyYXdCYXJGb3JTdWJjaGFyd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ZDMuYmVoYXZpb3Iuem9vbSgpXG4gICAgICAgICAgICAub24oXCJ6b29tc3RhcnRcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN0YXJ0RXZlbnQgPSBkMy5ldmVudC5zb3VyY2VFdmVudDtcbiAgICAgICAgICAgICAgICAkJC56b29tLmFsdERvbWFpbiA9IGQzLmV2ZW50LnNvdXJjZUV2ZW50LmFsdEtleSA/ICQkLngub3JnRG9tYWluKCkgOiBudWxsO1xuICAgICAgICAgICAgICAgIGNvbmZpZy56b29tX29uem9vbXN0YXJ0LmNhbGwoJCQuYXBpLCBkMy5ldmVudC5zb3VyY2VFdmVudCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKFwiem9vbVwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgJCQucmVkcmF3Rm9yWm9vbS5jYWxsKCQkKTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ3pvb21lbmQnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGV2ZW50ID0gZDMuZXZlbnQuc291cmNlRXZlbnQ7XG4gICAgICAgICAgICAgICAgLy8gaWYgY2xpY2ssIGRvIG5vdGhpbmcuIG90aGVyd2lzZSwgY2xpY2sgaW50ZXJhY3Rpb24gd2lsbCBiZSBjYW5jZWxlZC5cbiAgICAgICAgICAgICAgICBpZiAoZXZlbnQgJiYgc3RhcnRFdmVudC5jbGllbnRYID09PSBldmVudC5jbGllbnRYICYmIHN0YXJ0RXZlbnQuY2xpZW50WSA9PT0gZXZlbnQuY2xpZW50WSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLnJlZHJhd0V2ZW50UmVjdCgpO1xuICAgICAgICAgICAgICAgICQkLnVwZGF0ZVpvb20oKTtcbiAgICAgICAgICAgICAgICBjb25maWcuem9vbV9vbnpvb21lbmQuY2FsbCgkJC5hcGksICQkLngub3JnRG9tYWluKCkpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICQkLnpvb20uc2NhbGUgPSBmdW5jdGlvbiAoc2NhbGUpIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuYXhpc19yb3RhdGVkID8gdGhpcy55KHNjYWxlKSA6IHRoaXMueChzY2FsZSk7XG4gICAgICAgIH07XG4gICAgICAgICQkLnpvb20ub3JnU2NhbGVFeHRlbnQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgZXh0ZW50ID0gY29uZmlnLnpvb21fZXh0ZW50ID8gY29uZmlnLnpvb21fZXh0ZW50IDogWzEsIDEwXTtcbiAgICAgICAgICAgIHJldHVybiBbZXh0ZW50WzBdLCBNYXRoLm1heCgkJC5nZXRNYXhEYXRhQ291bnQoKSAvIGV4dGVudFsxXSwgZXh0ZW50WzFdKV07XG4gICAgICAgIH07XG4gICAgICAgICQkLnpvb20udXBkYXRlU2NhbGVFeHRlbnQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgcmF0aW8gPSBkaWZmRG9tYWluKCQkLngub3JnRG9tYWluKCkpIC8gZGlmZkRvbWFpbigkJC5nZXRab29tRG9tYWluKCkpLFxuICAgICAgICAgICAgICAgIGV4dGVudCA9IHRoaXMub3JnU2NhbGVFeHRlbnQoKTtcbiAgICAgICAgICAgIHRoaXMuc2NhbGVFeHRlbnQoW2V4dGVudFswXSAqIHJhdGlvLCBleHRlbnRbMV0gKiByYXRpb10pO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRab29tRG9tYWluID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDMsXG4gICAgICAgICAgICBtaW4gPSBkMy5taW4oWyQkLm9yZ1hEb21haW5bMF0sIGNvbmZpZy56b29tX3hfbWluXSksXG4gICAgICAgICAgICBtYXggPSBkMy5tYXgoWyQkLm9yZ1hEb21haW5bMV0sIGNvbmZpZy56b29tX3hfbWF4XSk7XG4gICAgICAgIHJldHVybiBbbWluLCBtYXhdO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlWm9vbSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgeiA9ICQkLmNvbmZpZy56b29tX2VuYWJsZWQgPyAkJC56b29tIDogZnVuY3Rpb24gKCkge307XG4gICAgICAgICQkLm1haW4uc2VsZWN0KCcuJyArIENMQVNTLnpvb21SZWN0KS5jYWxsKHopLm9uKFwiZGJsY2xpY2suem9vbVwiLCBudWxsKTtcbiAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuZXZlbnRSZWN0KS5jYWxsKHopLm9uKFwiZGJsY2xpY2suem9vbVwiLCBudWxsKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnJlZHJhd0Zvclpvb20gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGQzID0gJCQuZDMsIGNvbmZpZyA9ICQkLmNvbmZpZywgem9vbSA9ICQkLnpvb20sIHggPSAkJC54O1xuICAgICAgICBpZiAoIWNvbmZpZy56b29tX2VuYWJsZWQpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChkMy5ldmVudC5zb3VyY2VFdmVudC50eXBlID09PSAnbW91c2Vtb3ZlJyAmJiB6b29tLmFsdERvbWFpbikge1xuICAgICAgICAgICAgeC5kb21haW4oem9vbS5hbHREb21haW4pO1xuICAgICAgICAgICAgem9vbS5zY2FsZSh4KS51cGRhdGVTY2FsZUV4dGVudCgpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkgJiYgeC5vcmdEb21haW4oKVswXSA9PT0gJCQub3JnWERvbWFpblswXSkge1xuICAgICAgICAgICAgeC5kb21haW4oWyQkLm9yZ1hEb21haW5bMF0gLSAxZS0xMCwgeC5vcmdEb21haW4oKVsxXV0pO1xuICAgICAgICB9XG4gICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogZmFsc2UsXG4gICAgICAgICAgICB3aXRoWTogY29uZmlnLnpvb21fcmVzY2FsZSxcbiAgICAgICAgICAgIHdpdGhTdWJjaGFydDogZmFsc2UsXG4gICAgICAgICAgICB3aXRoRXZlbnRSZWN0OiBmYWxzZSxcbiAgICAgICAgICAgIHdpdGhEaW1lbnNpb246IGZhbHNlXG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoZDMuZXZlbnQuc291cmNlRXZlbnQudHlwZSA9PT0gJ21vdXNlbW92ZScpIHtcbiAgICAgICAgICAgICQkLmNhbmNlbENsaWNrID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBjb25maWcuem9vbV9vbnpvb20uY2FsbCgkJC5hcGksIHgub3JnRG9tYWluKCkpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUNvbG9yID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDMsXG4gICAgICAgICAgICBjb2xvcnMgPSBjb25maWcuZGF0YV9jb2xvcnMsXG4gICAgICAgICAgICBwYXR0ZXJuID0gbm90RW1wdHkoY29uZmlnLmNvbG9yX3BhdHRlcm4pID8gY29uZmlnLmNvbG9yX3BhdHRlcm4gOiBkMy5zY2FsZS5jYXRlZ29yeTEwKCkucmFuZ2UoKSxcbiAgICAgICAgICAgIGNhbGxiYWNrID0gY29uZmlnLmRhdGFfY29sb3IsXG4gICAgICAgICAgICBpZHMgPSBbXTtcblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIHZhciBpZCA9IGQuaWQgfHwgKGQuZGF0YSAmJiBkLmRhdGEuaWQpIHx8IGQsIGNvbG9yO1xuXG4gICAgICAgICAgICAvLyBpZiBjYWxsYmFjayBmdW5jdGlvbiBpcyBwcm92aWRlZFxuICAgICAgICAgICAgaWYgKGNvbG9yc1tpZF0gaW5zdGFuY2VvZiBGdW5jdGlvbikge1xuICAgICAgICAgICAgICAgIGNvbG9yID0gY29sb3JzW2lkXShkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGlmIHNwZWNpZmllZCwgY2hvb3NlIHRoYXQgY29sb3JcbiAgICAgICAgICAgIGVsc2UgaWYgKGNvbG9yc1tpZF0pIHtcbiAgICAgICAgICAgICAgICBjb2xvciA9IGNvbG9yc1tpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBpZiBub3Qgc3BlY2lmaWVkLCBjaG9vc2UgZnJvbSBwYXR0ZXJuXG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoaWRzLmluZGV4T2YoaWQpIDwgMCkgeyBpZHMucHVzaChpZCk7IH1cbiAgICAgICAgICAgICAgICBjb2xvciA9IHBhdHRlcm5baWRzLmluZGV4T2YoaWQpICUgcGF0dGVybi5sZW5ndGhdO1xuICAgICAgICAgICAgICAgIGNvbG9yc1tpZF0gPSBjb2xvcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayBpbnN0YW5jZW9mIEZ1bmN0aW9uID8gY2FsbGJhY2soY29sb3IsIGQpIDogY29sb3I7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUxldmVsQ29sb3IgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIGNvbG9ycyA9IGNvbmZpZy5jb2xvcl9wYXR0ZXJuLFxuICAgICAgICAgICAgdGhyZXNob2xkID0gY29uZmlnLmNvbG9yX3RocmVzaG9sZCxcbiAgICAgICAgICAgIGFzVmFsdWUgPSB0aHJlc2hvbGQudW5pdCA9PT0gJ3ZhbHVlJyxcbiAgICAgICAgICAgIHZhbHVlcyA9IHRocmVzaG9sZC52YWx1ZXMgJiYgdGhyZXNob2xkLnZhbHVlcy5sZW5ndGggPyB0aHJlc2hvbGQudmFsdWVzIDogW10sXG4gICAgICAgICAgICBtYXggPSB0aHJlc2hvbGQubWF4IHx8IDEwMDtcbiAgICAgICAgcmV0dXJuIG5vdEVtcHR5KGNvbmZpZy5jb2xvcl90aHJlc2hvbGQpID8gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB2YXIgaSwgdiwgY29sb3IgPSBjb2xvcnNbY29sb3JzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHZhbHVlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHYgPSBhc1ZhbHVlID8gdmFsdWUgOiAodmFsdWUgKiAxMDAgLyBtYXgpO1xuICAgICAgICAgICAgICAgIGlmICh2IDwgdmFsdWVzW2ldKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbG9yID0gY29sb3JzW2ldO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gY29sb3I7XG4gICAgICAgIH0gOiBudWxsO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5n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AgfVxuICAgICAgICAgICAgJCQuYnJ1c2guZXh0ZW50KGRvbWFpbik7XG4gICAgICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVYRG9tYWluOiB0cnVlLCB3aXRoWTogJCQuY29uZmlnLnpvb21fcmVzY2FsZX0pO1xuICAgICAgICAgICAgJCQuY29uZmlnLnpvb21fb256b29tLmNhbGwodGhpcywgJCQueC5vcmdEb21haW4oKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICQkLmJydXNoLmV4dGVudCgpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uem9vbS5lbmFibGUgPSBmdW5jdGlvbiAoZW5hYmxlZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsO1xuICAgICAgICAkJC5jb25maWcuem9vbV9lbmFibGVkID0gZW5hYmxlZDtcbiAgICAgICAgJCQudXBkYXRlQW5kUmVkcmF3KCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi51bnpvb20gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWw7XG4gICAgICAgICQkLmJydXNoLmNsZWFyKCkudXBkYXRlKCk7XG4gICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZVhEb21haW46IHRydWV9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uem9vbS5tYXggPSBmdW5jdGlvbiAobWF4KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMztcbiAgICAgICAgaWYgKG1heCA9PT0gMCB8fCBtYXgpIHtcbiAgICAgICAgICAgIGNvbmZpZy56b29tX3hfbWF4ID0gZDMubWF4KFskJC5vcmdYRG9tYWluWzFdLCBtYXhdKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuem9vbV94X21heDtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi56b29tLm1pbiA9IGZ1bmN0aW9uIChtaW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnLCBkMyA9ICQkLmQzO1xuICAgICAgICBpZiAobWluID09PSAwIHx8IG1pbikge1xuICAgICAgICAgICAgY29uZmlnLnpvb21feF9taW4gPSBkMy5taW4oWyQkLm9yZ1hEb21haW5bMF0sIG1pbl0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGNvbmZpZy56b29tX3hfbWluO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLnpvb20ucmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHtcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQocmFuZ2UubWF4KSkgeyB0aGlzLmRvbWFpbi5tYXgocmFuZ2UubWF4KTsgfVxuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyYW5nZS5taW4pKSB7IHRoaXMuZG9tYWluLm1pbihyYW5nZS5taW4pOyB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIG1heDogdGhpcy5kb21haW4ubWF4KCksXG4gICAgICAgICAgICAgICAgbWluOiB0aGlzLmRvbWFpbi5taW4oKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi5sb2FkID0gZnVuY3Rpb24gKGFyZ3MpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICAvLyB1cGRhdGUgeHMgaWYgc3BlY2lmaWVkXG4gICAgICAgIGlmIChhcmdzLnhzKSB7XG4gICAgICA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0YShhcmdzLnJvd3MpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGFyZ3MuY29sdW1ucykge1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRDb2x1bW5zVG9EYXRhKGFyZ3MuY29sdW1ucyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGFyZ2V0cyA9ICQkLmNvbnZlcnREYXRhVG9UYXJnZXRzKGRhdGEsIHRydWUpO1xuXG4gICAgICAgIC8vIFVwZGF0ZS9BZGQgZGF0YVxuICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgdmFyIGZvdW5kID0gZmFsc2UsIGksIGo7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdGFyZ2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSB0YXJnZXRzW2ldLmlkKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodC52YWx1ZXNbdC52YWx1ZXMubGVuZ3RoIC0gMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhaWwgPSB0LnZhbHVlc1t0LnZhbHVlcy5sZW5ndGggLSAxXS5pbmRleCArIDE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gdGFyZ2V0c1tpXS52YWx1ZXMubGVuZ3RoO1xuXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBsZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0c1tpXS52YWx1ZXNbal0uaW5kZXggPSB0YWlsICsgajtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRzW2ldLnZhbHVlc1tqXS54ID0gdGFpbCArIGo7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdC52YWx1ZXMgPSB0LnZhbHVlcy5jb25jYXQodGFyZ2V0c1tpXS52YWx1ZXMpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWZvdW5kKSB7IG5vdGZvdW5kSWRzLnB1c2godC5pZCk7IH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gQXBwZW5kIG51bGwgZm9yIG5vdCBmb3VuZCB0YXJnZXRzXG4gICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICB2YXIgaSwgajtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBub3Rmb3VuZElkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSBub3Rmb3VuZElkc1tpXSkge1xuICAgICAgICAgICAgICAgICAgICB0YWlsID0gdC52YWx1ZXNbdC52YWx1ZXMubGVuZ3RoIC0gMV0uaW5kZXggKyAxO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgbGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHQudmFsdWVzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0LmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiB0YWlsICsgaixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB4OiAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLmdldE90aGVyVGFyZ2V0WCh0YWlsICsgaikgOiB0YWlsICsgaixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogbnVsbFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIEdlbmVyYXRlIG51bGwgdmFsdWVzIGZvciBuZXcgdGFyZ2V0XG4gICAgICAgIGlmICgkJC5kYXRhLnRhcmdldHMubGVuZ3RoKSB7XG4gICAgICAgICAgICB0YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaSwgbWlzc2luZyA9IFtdO1xuICAgICAgICAgICAgICAgIGZvciAoaSA9ICQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXNbMF0uaW5kZXg7IGkgPCB0YWlsOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbWlzc2luZy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0LmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksXG4gICAgICAgICAgICAgICAgICAgICAgICB4OiAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLmdldE90aGVyVGFyZ2V0WChpKSA6IGksXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogbnVsbFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgICAgICB2LmluZGV4ICs9IHRhaWw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHYueCArPSB0YWlsO1xuICAgICAgICAgICAgICAgICAgIC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nJvbSBsZWZ0IGVkZ2Ugb2YgdGhlIGNoYXJ0XG4gICAgICAgIGlmICghb3JnRGF0YUNvdW50KSB7XG4gICAgICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoYmFzZVRhcmdldC52YWx1ZXMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgICAgICBkaWZmID0gYmFzZVRhcmdldC52YWx1ZXNbYmFzZVRhcmdldC52YWx1ZXMubGVuZ3RoIC0gMV0ueCAtIGJhc2VWYWx1ZS54O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGRpZmYgPSBiYXNlVmFsdWUueCAtICQkLmdldFhEb21haW4oJCQuZGF0YS50YXJnZXRzKVswXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGRpZmYgPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZG9tYWluID0gW2Jhc2VWYWx1ZS54IC0gZGlmZiwgYmFzZVZhbHVlLnhdO1xuICAgICAgICAgICAgJCQudXBkYXRlWERvbWFpbihudWxsLCB0cnVlLCB0cnVlLCBmYWxzZSwgZG9tYWluKTtcbiAgICAgICAgfSBlbHNlIGlmIChvcmdEYXRhQ291bnQgPT09IDEpIHtcbiAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgIGRpZmYgPSAoYmFzZVRhcmdldC52YWx1ZXNbYmFzZVRhcmdldC52YWx1ZXMubGVuZ3RoIC0gMV0ueCAtIGJhc2VWYWx1ZS54KSAvIDI7XG4gICAgICAgICAgICAgICAgZG9tYWluID0gW25ldyBEYXRlKCtiYXNlVmFsdWUueCAtIGRpZmYpLCBuZXcgRGF0ZSgrYmFzZVZhbHVlLnggKyBkaWZmKV07XG4gICAgICAgICAgICAgICAgJCQudXBkYXRlWERvbWFpbihudWxsLCB0cnVlLCB0cnVlLCBmYWxzZSwgZG9tYWluKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFNldCB0YXJnZXRzXG4gICAgICAgICQkLnVwZGF0ZVRhcmdldHMoJCQuZGF0YS50YXJnZXRzKTtcblxuICAgICAgICAvLyBSZWRyYXcgd2l0aCBuZXcgdGFyZ2V0c1xuICAgICAgICAkJC5yZWRyYXcoe1xuICAgICAgICAgICAgZmxvdzoge1xuICAgICAgICAgICAgICAgIGluZGV4OiBiYXNlVmFsdWUuaW5kZXgsXG4gICAgICAgICAgICAgICAgbGVuZ3RoOiBsZW5ndGgsXG4gICAgICAgICAgICAgICAgZHVyYXRpb246IGlzVmFsdWUoYXJncy5kdXJhdGlvbikgPyBhcmdzLmR1cmF0aW9uIDogJCQuY29uZmlnLnRyYW5zaXRpb25fZHVyYXRpb24sXG4gICAgICAgICAgICAgICAgZG9uZTogYXJncy5kb25lLFxuICAgICAgICAgICAgICAgIG9yZ0RhdGFDb3VudDogb3JnRGF0YUNvdW50LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHdpdGhMZWdlbmQ6IHRydWUsXG4gICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogb3JnRGF0YUNvdW50ID4gMSxcbiAgICAgICAgICAgIHdpdGhUcmltWERvbWFpbjogZmFsc2UsXG4gICAgICAgICAgICB3aXRoVXBkYXRlWEF4aXM6IHRydWUsXG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUZsb3cgPSBmdW5jdGlvbiAoYXJncykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDM7XG5cbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB0YXJnZXRzID0gYXJncy50YXJnZXRzLFxuICAgICAgICAgICAgICAgIGZsb3cgPSBhcmdzLmZsb3csXG4gICAgICAgICAgICAgICAgZHJhd0JhciA9IGFyZ3MuZHJhd0JhcixcbiAgICAgICAgICAgICAgICBkcmF3TGluZSA9IGFyZ3MuZHJhd0xpbmUsXG4gICAgICAgICAgICAgICAgZHJhd0FyZWEgPSBhcmdzLmRyYXdBcmVhLFxuICAgICAgICAgICAgICAgIGN4ID0gYXJncy5jeCxcbiAgICAgICAgICAgICAgICBjeSA9IGFyZ3MuY3ksXG4gICAgICAgICAgICAgICAgeHYgPSBhcmdzLnh2LFxuICAgICAgICAgICAgICAgIHhGb3JUZXh0ID0gYXJncy54Rm9yVGV4dCxcbiAgICAgICAgICAgICAgICB5Rm9yVGV4dCA9IGFyZ3MueUZvclRleHQsXG4gICAgICAgICAgICAgICAgZHVyYXRpb24gPSBhcmdzLmR1cmF0aW9uO1xuXG4gICAgICAgICAgICB2YXIgdHJhbnNsYXRlWCwgc2NhbGVYID0gMSwgdHJhbnNmb3JtLFxuICAgICAgICAgICAgICAgIGZsb3dJbmRleCA9IGZsb3cuaW5kZXgsXG4gICAgICAgICAgICAgICAgZmxvd0xlbmd0aCA9IGZsb3cubGVuZ3RoLFxuICAgICAgICAgICAgICAgIGZsb3dTdGFydCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCBmbG93SW5kZXgpLFxuICAgICAgICAgICAgICAgIGZsb3dFbmQgPSAkJC5nZXRWYWx1ZU9uSW5kZXgoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcywgZmxvd0luZGV4ICsgZmxvd0xlbmd0aCksXG4gICAgICAgICAgICAgICAgb3JnRG9tYWluID0gJCQueC5kb21haW4oKSwgZG9tYWluLFxuICAgICAgICAgICAgICAgIGR1cmF0aW9uRm9yRmxvdyA9IGZsb3cuZHVyYXRpb24gfHwgZHVyYXRpb24sXG4gICAgICAgICAgICAgICAgZG9uZSA9IGZsb3cuZG9uZSB8fCBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgICAgICB3YWl0ID0gJCQuZ2VuZXJhdGVXYWl0KCk7XG5cbiAgICAgICAgICAgIHZhciB4Z3JpZCA9ICQkLnhncmlkIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lcyA9ICQkLnhncmlkTGluZXMgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uID0gJCQubWFpblJlZ2lvbiB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5UZXh0ID0gJCQubWFpblRleHQgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluQmFyID0gJCQubWFpbkJhciB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5MaW5lID0gJCQubWFpbkxpbmUgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluQXJlYSA9ICQkLm1haW5BcmVhIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpbkNpcmNsZSA9ICQkLm1haW5DaXJjbGUgfHwgZDMuc2VsZWN0QWxsKFtdKTtcblxuICAgICAgICAgICAgLy8gc2V0IGZsYWdcbiAgICAgICAgICAgICQkLmZsb3dpbmcgPSB0cnVlO1xuXG4gICAgICAgICAgICAvLyByZW1vdmUgaGVhZCBkYXRhIGFmdGVyIHJlbmRlcmVkXG4gICAgICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIGQudmFsdWVzLnNwbGljZSgwLCBmbG93TGVuZ3RoKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAvLyB1cGRhdGUgeCBkb21haW4gdG8gZ2VuZXJhdGUgYXhpcyBlbGVtZW50cyBmb3IgZmxvd1xuICAgICAgICAgICAgZG9tYWluID0gJCQudXBkYXRlWERvbWFpbih0YXJnZXRzLCB0cnVlLCB0cnVlKTtcbiAgICAgICAgICAgIC8vIHVwZGF0ZSBlbGVtZW50cyByZWxhdGVkIHRvIHggc2NhbGVcbiAgICAgICAgICAgIGlmICgkJC51cGRhdGVYR3JpZCkgeyAkJC51cGRhdGVYR3JpZCh0cnVlKTsgfVxuXG4gICAgICAgICAgICAvLyBnZW5lcmF0ZSB0cmFuc2Zvcm0gdG8gZmxvd1xuICAgICAgICAgICAgaWYgKCFmbG93Lm9yZ0RhdGFDb3VudCkgeyAvLyBpZiBlbXB0eVxuICAgICAgICAgICAgICAgIGlmICgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmxlbmd0aCAhPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gJCQueChvcmdEb21haW5bMF0pIC0gJCQueChkb21haW5bMF0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmxvd1N0YXJ0ID0gJCQuZ2V0VmFsdWVPbkluZGV4KCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmxvd0VuZCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCAkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICQkLngoZmxvd1N0YXJ0LngpIC0gJCQueChmbG93RW5kLngpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9IGRpZmZEb21haW4oZG9tYWluKSAvIDI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGZsb3cub3JnRGF0YUNvdW50ID09PSAxIHx8IChmbG93U3RhcnQgJiYgZmxvd1N0YXJ0LngpID09PSAoZmxvd0VuZCAmJiBmbG93RW5kLngpKSB7XG4gICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICQkLngob3JnRG9tYWluWzBdKSAtICQkLngoZG9tYWluWzBdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAoJCQueChvcmdEb21haW5bMF0pIC0gJCQueChkb21haW5bMF0pKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gKCQkLngoZmxvd1N0YXJ0LngpIC0gJCQueChmbG93RW5kLngpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzY2FsZVggPSAoZGlmZkRvbWFpbihvcmdEb21haW4pIC8gZGlmZkRvbWFpbihkb21haW4pKTtcbiAgICAgICAgICAgIHRyYW5zZm9ybSA9ICd0cmFuc2xhdGUoJyArIHRyYW5zbGF0ZVggKyAnLDApIHNjYWxlKCcgKyBzY2FsZVggKyAnLDEpJztcblxuICAgICAgICAgICAgJCQuaGlkZVhHcmlkRm9jdXMoKTtcblxuICAgICAgICAgICAgZDMudHJhbnNpdGlvbigpLmVhc2UoJ2xpbmVhcicpLmR1cmF0aW9uKGR1cmF0aW9uRm9yRmxvdykuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgd2FpdC5hZGQoJCQuYXhlcy54LnRyYW5zaXRpb24oKS5jYWxsKCQkLnhBeGlzKSk7XG4gICAgICAgICAgICAgICAgd2FpdC5hZGQobWFpbkJhci50cmFuc2l0aW9uKCkuYXR0cig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IDA7IGkgPCBmbG93TGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNoYXBlcy5wdXNoKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgKGZsb3dJbmRleCArIGkpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRzLnB1c2goJy4nICsgQ0xBU1MudGV4dCArICctJyArIChmbG93SW5kZXggKyBpKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudFJlY3RzLnB1c2goJy4nICsgQ0xBU1MuZXZlbnRSZWN0ICsgJy0nICsgKGZsb3dJbmRleCArIGkpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlcykuc2VsZWN0QWxsKHNoYXBlcykucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MudGV4dHMpLnNlbGVjdEFsbCh0ZXh0cykucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuZXZlbnRSZWN0cykuc2VsZWN0QWxsKGV2ZW50UmVjdHMpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0KCcuJyArIENMQVNTLnhncmlkKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBkcmF3IGFnYWluIGZvciByZW1vdmluZyBmbG93ZWQgZWxlbWVudHMgYW5kIHJldmVydGluZyBhdHRyXG4gICAgICAgICAgICAgICAgeGdyaWRcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCQkLnhncmlkQXR0cik7XG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lc1xuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbCk7XG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lcy5zZWxlY3QoJ2xpbmUnKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcIngxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogeHYpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieDJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoIDogeHYpO1xuICAgICAgICAgICAgICAgIHhncmlkTGluZXMuc2VsZWN0KCd0ZXh0JylcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4XCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC53aWR0aCA6IDApXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieVwiLCB4dik7XG4gICAgICAgICAgICAgICAgbWFpbkJhclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsIGRyYXdCYXIpO1xuICAgICAgICAgICAgICAgIG1haW5MaW5lXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZHJhd0xpbmUpO1xuICAgICAgICAgICAgICAgIG1haW5BcmVhXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZHJhd0FyZWEpO1xuICAgICAgICAgICAgICAgIG1haW5DaXJjbGVcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiY3hcIiwgY3gpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiY3lcIiwgY3kpO1xuICAgICAgICAgICAgICAgIG1haW5UZXh0XG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIHhGb3JUZXh0KVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIHlGb3JUZXh0KVxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwtb3BhY2l0eScsICQkLm9wYWNpdHlGb3JUZXh0LmJpbmQoJCQpKTtcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKTtcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uLnNlbGVjdCgncmVjdCcpLmZpbHRlcigkJC5pc1JlZ2lvbk9uWClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4XCIsICQkLnJlZ2lvblguYmluZCgkJCkpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgJCQucmVnaW9uV2lkdGguYmluZCgkJCkpO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0V2ZW50UmVjdCgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIGNhbGxiYWNrIGZvciBlbmQgb2YgZmxvd1xuICAgICAgICAgICAgICAgIGRvbmUoKTtcblxuICAgICAgICAgICAgICAgICQkLmZsb3dpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi5zZWxlY3RlZCA9IGZ1bmN0aW9uICh0YXJnZXRJZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBkMyA9ICQkLmQzO1xuICAgICAgICByZXR1cm4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zX2NoYXJ0X2ZuLnJlZ2lvbnMgPSBmdW5jdGlvbiAocmVnaW9ucykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGlmICghcmVnaW9ucykgeyByZXR1cm4gY29uZmlnLnJlZ2lvbnM7IH1cbiAgICAgICAgY29uZmlnLnJlZ2lvbnMgPSByZWdpb25zO1xuICAgICAgICAkJC5yZWRyYXdXaXRob3V0UmVzY2FsZSgpO1xuICAgICAgICByZXR1cm4gY29uZmlnLnJlZ2lvbnM7XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi5yZWdpb25zLmFkZCA9IGZ1bmN0aW9uIChyZWdpb25zKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgaWYgKCFyZWdpb25zKSB7IHJldHVybiBjb25maWcucmVnaW9uczsgfVxuICAgICAgICBjb25maWcucmVnaW9ucyA9IGNvbmZpZy5yZWdpb25zLmNvbmNhdChyZWdpb25zKTtcbiAgICAgICAgJCQucmVkcmF3V2l0aG91dFJlc2NhbGUoKTtcbiAgICAgICAgcmV0dXJuIGNvbmZpZy5yZWdpb25zO1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4ucmVnaW9ucy5yZW1vdmUgPSBmdW5jdGlvbiAob3B0aW9ucykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBkdXJhdGlvbiwgY2xhc3NlcywgcmVnaW9ucztcblxuICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fTtcbiAgICAgICAgZHVyYXRpb24gPSAkJC5nZXRPcHRpb24ob3B0aW9ucywgXCJkdXJhdGlvblwiLCBjb25maWcudHJhbnNpdGlvbl9kdXJhdGlvbik7XG4gICAgICAgIGNsYXNzZXMgPSAkJC5nZXRPcHRpb24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mVscykuZm9yRWFjaChmdW5jdGlvbiAoYXhpc0lkKSB7XG4gICAgICAgICAgICAgICAgJCQuYXhpcy5zZXRMYWJlbFRleHQoYXhpc0lkLCBsYWJlbHNbYXhpc0lkXSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICQkLmF4aXMudXBkYXRlTGFiZWxzKCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETzogcmV0dXJuIHNvbWUgdmFsdWVzP1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uYXhpcy5tYXggPSBmdW5jdGlvbiAobWF4KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWF4ID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1heC54KSkgeyBjb25maWcuYXhpc194X21heCA9IG1heC54OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWF4LnkpKSB7IGNvbmZpZy5heGlzX3lfbWF4ID0gbWF4Lnk7IH1cbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtYXgueTIpKSB7IGNvbmZpZy5heGlzX3kyX21heCA9IG1heC55MjsgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc195X21heCA9IGNvbmZpZy5heGlzX3kyX21heCA9IG1heDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHg6IGNvbmZpZy5heGlzX3hfbWF4LFxuICAgICAgICAgICAgICAgIHk6IGNvbmZpZy5heGlzX3lfbWF4LFxuICAgICAgICAgICAgICAgIHkyOiBjb25maWcuYXhpc195Ml9tYXhcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuLmF4aXMubWluID0gZnVuY3Rpb24gKG1pbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIG1pbiA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtaW4ueCkpIHsgY29uZmlnLmF4aXNfeF9taW4gPSBtaW4ueDsgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1pbi55KSkgeyBjb25maWcuYXhpc195X21pbiA9IG1pbi55OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWluLnkyKSkgeyBjb25maWcuYXhpc195Ml9taW4gPSBtaW4ueTI7IH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeV9taW4gPSBjb25maWcuYXhpc195Ml9taW4gPSBtaW47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLCB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZX0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB4OiBjb25maWcuYXhpc194X21pbixcbiAgICAgICAgICAgICAgICB5OiBjb25maWcuYXhpc195X21pbixcbiAgICAgICAgICAgICAgICB5MjogY29uZmlnLmF4aXNfeTJfbWluXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi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oYXJ0XG4gICAgICAgIGlmIChhcmdzLm1vdXNlKSB7XG4gICAgICAgICAgICBtb3VzZSA9IGFyZ3MubW91c2U7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBkZXRlcm1pbmUgZm9jdXMgZGF0YVxuICAgICAgICBpZiAoYXJncy5kYXRhKSB7XG4gICAgICAgICAgICBpZiAoJCQuaXNNdWx0aXBsZVgoKSkge1xuICAgICAgICAgICAgICAgIC8vIGlmIG11bHRpcGxlIHhzLCB0YXJnZXQgcG9pbnQgd2lsbCBiZSBkZXRlcm1pbmVkIGJ5IG1vdXNlXG4gICAgICAgICAgICAgICAgbW91c2UgPSBbJCQueChhcmdzLmRhdGEueCksICQkLmdldFlTY2FsZShhcmdzLmRhdGEuaWQpKGFyZ3MuZGF0YS52YWx1ZSldO1xuICAgICAgICAgICAgICAgIGluZGV4ID0gbnVsbDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETzogd2hlbiB0b29sdGlwX2dyb3VwZWQgPSBmYWxzZVxuICAgICAgICAgICAgICAgIGluZGV4ID0gaXNWYWx1ZShhcmdzLmRhdGEuaW5kZXgpID8gYXJncy5kYXRhLmluZGV4IDogJCQuZ2V0SW5kZXhCeVgoYXJncy5kYXRhLngpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHR5cGVvZiBhcmdzLnggIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpbmRleCA9ICQkLmdldEluZGV4QnlYKGFyZ3MueCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodHlwZW9mIGFyZ3MuaW5kZXggIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpbmRleCA9IGFyZ3MuaW5kZXg7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBlbXVsYXRlIG1vdXNlIGV2ZW50cyB0byBzaG93XG4gICAgICAgICQkLmRpc3BhdGNoRXZlbnQ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mFwcGx5KHNjYWxlLCB0aWNrQXJndW1lbnRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRvbWFpbiA9IHNjYWxlLmRvbWFpbigpO1xuICAgICAgICAgICAgZm9yIChpID0gTWF0aC5jZWlsKGRvbWFpblswXSk7IGkgPCBkb21haW5bMV07IGkrKykge1xuICAgICAgICAgICAgICAgIHRpY2tzLnB1c2goaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGlja3MubGVuZ3RoID4gMCAmJiB0aWNrc1swXSA+IDApIHtcbiAgICAgICAgICAgICAgICB0aWNrcy51bnNoaWZ0KHRpY2tzWzBdIC0gKHRpY2tzWzFdIC0gdGlja3NbMF0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aWNrcztcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBjb3B5U2NhbGUoKSB7XG4gICAgICAgICAgICB2YXIgbmV3U2NhbGUgPSBzY2FsZS5jb3B5KCksIGRvbWFpbjtcbiAgICAgICAgICAgIGlmIChwYXJhbXMuaXNDYXRlZ29yeSkge1xuICAgICAgICAgICAgICAgIGRvbWFpbiA9IHNjYWxlLmRvbWFpbigpO1xuICAgICAgICAgICAgICAgIG5ld1NjYWxlLmRvbWFpbihbZG9tYWluWzBdLCBkb21haW5bMV0gLSAxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbmV3U2NhbGU7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdGV4dEZvcm1hdHRlZCh2KSB7XG4gICAgICAgICAgICB2YXIgZm9ybWF0dGVkID0gdGlja0Zvcm1hdCA/IHRpY2tGb3JtYXQodikgOiB2O1xuICAgICAgICAgICAgcmV0dXJuIHR5cGVvZiBmb3JtYXR0ZWQgIT09ICd1bmRlZmluZWQnID8gZm9ybWF0dGVkIDogJyc7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gZ2V0U2l6ZUZvcjFDaGFyKHRpY2spIHtcbiAgICAgICAgICAgIGlmICh0aWNrVGV4dENoYXJTaXplKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRpY2tUZXh0Q2hhclNpemU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgc2l6ZSA9IHtcbiAgICAgICAgICAgICAgICBoOiAxMS41LFxuICAgICAgICAgICAgICAgIHc6IDUuNVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHRpY2suc2VsZWN0KCd0ZXh0JykudGV4dCh0ZXh0Rm9ybWF0dGVkKS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGJveCA9IHRoaXMuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksXG4gICAgICAgICAgICAgICAgICAgIHRleHQgPSB0ZXh0Rm9ybWF0dGVkKGQpLFxuICAgICAgICAgICAgICAgICAgICBoID0gYm94LmhlaWdodCxcbiAgICAgICAgICAgICAgICAgICAgdyA9IHRleHQgPyAoYm94LndpZHRoIC8gdGV4dC5sZW5ndGgpIDogdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmIChoICYmIHcpIHtcbiAgICAgICAgICAgICAgICAgICAgc2l6ZS5oID0gaDtcbiAgICAgICAgICAgICAgICAgICAgc2l6ZS53ID0gdztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS50ZXh0KCcnKTtcbiAgICAgICAgICAgIHRpY2tUZXh0Q2hhclNpemUgPSBzaXplO1xuICAgICAgICAgICAgcmV0dXJuIHNpemU7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdHJhbnNpdGlvbmlzZShzZWxlY3Rpb24pIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJhbXMud2l0aG91dFRyYW5zaXRpb24gPyBzZWxlY3Rpb24gOiBkMy50cmFuc2l0aW9uKHNlbGVjdGlvbik7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gYXh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JhbmdlID0gc2NhbGUucmFuZ2VFeHRlbnQgPyBzY2FsZS5yYW5nZUV4dGVudCgpIDogc2NhbGVFeHRlbnQoc2NhbGUucmFuZ2UoKSksXG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSBnLnNlbGVjdEFsbChcIi5kb21haW5cIikuZGF0YShbIDAgXSksXG4gICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUgPSAocGF0aC5lbnRlcigpLmFwcGVuZChcInBhdGhcIikuYXR0cihcImNsYXNzXCIsIFwiZG9tYWluXCIpLCB0cmFuc2l0aW9uaXNlKHBhdGgpKTtcbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuYXBwZW5kKFwibGluZVwiKTtcbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuYXBwZW5kKFwidGV4dFwiKTtcblxuICAgICAgICAgICAgICAgIHZhciBsaW5lRW50ZXIgPSB0aWNrRW50ZXIuc2VsZWN0KFwibGluZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZSA9IHRpY2tVcGRhdGUuc2VsZWN0KFwibGluZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyID0gdGlja0VudGVyLnNlbGVjdChcInRleHRcIiksXG4gICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUgPSB0aWNrVXBkYXRlLnNlbGVjdChcInRleHRcIik7XG5cbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmlzQ2F0ZWdvcnkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja09mZnNldCA9IE1hdGguY2VpbCgoc2NhbGUxKDEpIC0gc2NhbGUxKDApKSAvIDIpO1xuICAgICAgICAgICAgICAgICAgICB0aWNrWCA9IHRpY2tDZW50ZXJlZCA/IDAgOiB0aWNrT2Zmc2V0O1xuICAgICAgICAgICAgICAgICAgICB0aWNrWSA9IHRpY2tDZW50ZXJlZCA/IHRpY2tPZmZzZXQgOiAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tPZmZzZXQgPSB0aWNrWCA9IDA7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIHRleHQsIHRzcGFuLCBzaXplRm9yMUNoYXIgPSBnZXRTaXplRm9yMUNoYXIoZy5zZWxlY3QoJy50aWNrJykpLCBjb3VudHMgPSBbXTtcbiAgICAgICAgICAgICAgICB2YXIgdGlja0xlbmd0aCA9IE1hdGgubWF4KGlubmVyVGlja1NpemUsIDApICsgdGlja1BhZGRpbmcsXG4gICAgICAgICAgICAgICAgICAgIGlzVmVydGljYWwgPSBvcmllbnQgPT09ICdsZWZ0JyB8fCBvcmllbnQgPT09ICdyaWdodCc7XG5cbiAgICAgICAgICAgICAgICAvLyB0aGlzIHNob3VsZCBiZSBjYWxsZWQgb25seSB3aGVuIGNhdGVnb3J5IGF4aXNcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzcGxpdFRpY2tUZXh0KGQsIG1heFdpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0aWNrVGV4dCA9IHRleHRGb3JtYXR0ZWQoZCksXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJ0ZXh0LCBzcGFjZUluZGV4LCB0ZXh0V2lkdGgsIHNwbGl0dGVkID0gW107XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh0aWNrVGV4dCkgPT09IFwiW29iamVjdCBBcnJheV1cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRpY2tUZXh0O1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFtYXhXaWR0aCB8fCBtYXhXaWR0aCA8PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXhXaWR0aCA9IGlzVmVydGljYWwgPyA5NSA6IHBhcmFtcy5pc0NhdGVnb3J5ID8gKE1hdGguY2VpbChzY2FsZTEodGlja3NbMV0pIC0gc2NhbGUxKHRpY2tzWzBdKSkgLSAxMikgOiAxMTA7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBzcGxpdChzcGxpdHRlZCwgdGV4dCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3BhY2VJbmRleCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgdGV4dC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJBdChpKSA9PT0gJyAnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlSW5kZXggPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0ZXh0ID0gdGV4dC5zdWJzdHIoMCwgaSArIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRXaWR0aCA9IHNpemVGb3IxQ2hhci53ICogc3VidGV4dC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGV4dCB3aWR0aCBnZXRzIG92ZXIgdGljayB3aWR0aCwgc3BsaXQgYnkgc3BhY2UgaW5kZXggb3IgY3JyZW50IGluZGV4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1heFdpZHRoIDwgdGV4dFdpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwbGl0dGVkLmNvbmNhdCh0ZXh0LnN1YnN0cigwLCBzcGFjZUluZGV4ID8gc3BhY2VJbmRleCA6IGkpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc2xpY2Uoc3BhY2VJbmRleCA/IHNwYWNlSW5kZXggKyAxIDogaSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXR0ZWQuY29uY2F0KHRleHQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwbGl0KHNwbGl0dGVkLCB0aWNrVGV4dCArIFwiXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRzcGFuRHkoZCwgaSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZHkgPSBzaXplRm9yMUNoYXIuaDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcmllbnQgPT09ICdsZWZ0JyB8fCBvcmllbnQgPT09ICdyaWdodCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkeSA9IC0oKGNvdW50c1tkLmluZGV4XSAtIDEpICogKHNpemVGb3IxQ2hhci5oIC8gMikgLSAzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZHkgPSBcIi43MWVtXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGR5O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRpY2tTaXplKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpY2tQb3NpdGlvbiA9IHNjYWxlKGQpICsgKHRpY2tDZW50ZXJlZCA/IDAgOiB0aWNrT2Zmc2V0KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJhbmdlWzBdIDwgdGlja1Bvc2l0aW9uICYmIHRpY2tQb3NpdGlvbiA8IHJhbmdlWzFdID8gaW5uZXJUaWNrU2l6ZSA6IDA7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdGV4dCA9IHRpY2suc2VsZWN0KFwidGV4dFwiKTtcbiAgICAgICAgICAgICAgICB0c3BhbiA9IHRleHQuc2VsZWN0QWxsKCd0c3BhbicpXG4gICAgICAgICAgICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3BsaXR0ZWQgPSBwYXJhbXMudGlja011bHRpbGluZSA/IHNwbGl0VGlja1RleHQoZCwgcGFyYW1zLnRpY2tXaWR0aCkgOiBbXS5jb25jYXQodGV4dEZvcm1hdHRlZChkKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb3VudHNbaV0gPSBzcGxpdHRlZC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXR0ZWQubWFwKGZ1bmN0aW9uIChzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgaW5kZXg6IGksIHNwbGl0dGVkOiBzIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdHNwYW4uZW50ZXIoKS5hcHBlbmQoJ3RzcGFuJyk7XG4gICAgICAgICAgICAgICAgdHNwYW4uZXhpdCgpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIHRzcGFuLnRleHQoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGQuc3BsaXR0ZWQ7IH0pO1xuXG4gICAgICAgICAgICAgICAgdmFyIHJvdGF0ZSA9IHBhcmFtcy50aWNrVGV4dFJvdGF0ZTtcblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRleHRBbmNob3JGb3JUZXh0KHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdtaWRkbGUnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGUgPiAwID8gXCJzdGFydFwiIDogXCJlbmRcIjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdGV4dFRyYW5zZm9ybShyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJyb3RhdGUoXCIgKyByb3RhdGUgKyBcIilcIjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gZHhGb3JUZXh0KHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDggKiBNYXRoLnNpbihNYXRoLlBJICogKHJvdGF0ZSAvIDE4MCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB5Rm9yVGV4dChyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWNrTGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxMS41IC0gMi41ICogKHJvdGF0ZSAvIDE1KSAqIChyb3RhdGUgPiAwID8gMSA6IC0xKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBzd2l0Y2ggKG9yaWVudCkge1xuICAgICAgICAgICAgICAgIGNhc2UgXCJib3R0b21cIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNYO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ5MlwiLCBpbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieVwiLCB0aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngxXCIsIHRpY2tYKS5hdHRyKFwieDJcIiwgdGlja1gpLmF0dHIoXCJ5MlwiLCB0aWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIDApLmF0dHIoXCJ5XCIsIHlGb3JUZXh0KHJvdGF0ZSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKFwidGV4dC1hbmNob3JcIiwgdGV4dEFuY2hvckZvclRleHQocm90YXRlKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCB0ZXh0VHJhbnNmb3JtKHJvdGF0ZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHNwYW4uYXR0cigneCcsIDApLmF0dHIoXCJkeVwiLCB0c3BhbkR5KS5hdHRyKCdkeCcsIGR4Rm9yVGV4dChyb3RhdGUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cihcImRcIiwgXCJNXCIgKyByYW5nZVswXSArIFwiLFwiICsgb3V0ZXJUaWNrU2l6ZSArIFwiVjBIXCIgKyByYW5nZVsxXSArIFwiVlwiICsgb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhc2UgXCJ0b3BcIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogcm90YXRlZCB0aWNrIHRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieTJcIiwgLWlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ5XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIDApLmF0dHIoXCJ5MlwiLCAtaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIDApLmF0dHIoXCJ5XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcIm1pZGRsZVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCAwKS5hdHRyKFwiZHlcIiwgXCIwZW1cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgcmFuZ2VbMF0gKyBcIixcIiArIC1vdXRlclRpY2tTaXplICsgXCJWMEhcIiArIHJhbmdlWzFdICsgXCJWXCIgKyAtb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhc2UgXCJsZWZ0XCI6XG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieDJcIiwgLWlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ4XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIC1pbm5lclRpY2tTaXplKS5hdHRyKFwieTFcIiwgdGlja1kpLmF0dHIoXCJ5MlwiLCB0aWNrWSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIC10aWNrTGVuZ3RoKS5hdHRyKFwieVwiLCB0aWNrT2Zmc2V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcImVuZFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCAtdGlja0xlbmd0aCkuYXR0cihcImR5XCIsIHRzcGFuRHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKFwiZFwiLCBcIk1cIiArIC1vdXRlclRpY2tTaXplICsgXCIsXCIgKyByYW5nZVswXSArIFwiSDBWXCIgKyByYW5nZVsxXSArIFwiSFwiICsgLW91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXNlIFwicmlnaHRcIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNZO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ4MlwiLCBpbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieFwiLCB0aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIGlubmVyVGlja1NpemUpLmF0dHIoXCJ5MlwiLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cihcInhcIiwgdGlja0xlbmd0aCkuYXR0cihcInlcIiwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LnN0eWxlKFwidGV4dC1hbmNob3JcIiwgXCJzdGFydFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCB0aWNrTGVuZ3RoKS5hdHRyKFwiZHlcIiwgdHNwYW5EeSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgb3V0ZXJUaWNrU2l6ZSArIFwiLFwiICsgcmFuZ2VbMF0gKyBcIkgwVlwiICsgcmFuZ2VbMV0gKyBcIkhcIiArIG91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHNjYWxlMS5yYW5nZUJhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHggPSBzY2FsZTEsIGR4ID0geC5yYW5nZUJhbmQoKSAvIDI7XG4gICAgICAgICAgICAgICAgICAgIHNjYWxlMCA9IHNjYWxlMSA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geChkKSArIGR4O1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2NhbGUwLnJhbmdlQmFuZCkge1xuICAgICAgICAgICAgICAgICAgICBzY2FsZTAgPSBzY2FsZTE7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja0V4aXQuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTApO1xuICAgICAgICAgICAgICAgIHRpY2tVcGRhdGUuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTEpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgYXhpcy5zY2FsZSA9IGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHNjYWxlOyB9XG4gICAgICAgICAgICBzY2FsZSA9IHg7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy5vcmllbnQgPSBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiBvcmllbnQ7IH1cbiAgICAgICAgICAgIG9yaWVudCA9IHggaW4ge3RvcDogMSwgcmlnaHQ6IDEsIGJvdHRvbTogMSwgbGVmdDogMX0gPyB4ICsgXCJcIiA6IFwiYm90dG9tXCI7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrRm9ybWF0ID0gZnVuY3Rpb24gKGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrRm9ybWF0OyB9XG4gICAgICAgICAgICB0aWNrRm9ybWF0ID0gZm9ybWF0O1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0NlbnRlcmVkID0gZnVuY3Rpb24gKGlzQ2VudGVyZWQpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja0NlbnRlcmVkOyB9XG4gICAgICAgICAgICB0aWNrQ2VudGVyZWQgPSBpc0NlbnRlcmVkO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja09mZnNldCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aWNrT2Zmc2V0O1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tJbnRlcnZhbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBpbnRlcnZhbCwgbGVuZ3RoO1xuICAgICAgICAgICAgaWYgKHBhcmFtcy5pc0NhdGVnb3J5KSB7XG4gICAgICAgICAgICAgICAgaW50ZXJ2YWwgPSB0aWNrT2Zmc2V0ICogMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGxlbmd0aCA9IGF4aXMuZy5zZWxlY3QoJ3BhdGguZG9tYWluJykubm9kZSgpLmdldFRvdGFsTGVuZ3RoKCkgLSBvdXRlclRpY2tTaXplICogMjtcbiAgICAgICAgICAgICAgICBpbnRlcnZhbCA9IGxlbmd0aCAvIGF4aXMuZy5zZWxlY3RBbGwoJ2xpbmUnKS5zaXplKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gaW50ZXJ2YWwgPT09IEluZmluaXR5ID8gMCA6IGludGVydmFsO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrQXJndW1lbnRzOyB9XG4gICAgICAgICAgICB0aWNrQXJndW1lbnRzID0gYXJndW1lbnRzO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0N1bGxpbmcgPSBmdW5jdGlvbiAoY3VsbGluZykge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrQ3VsbGluZzsgfVxuICAgICAgICAgICAgdGlja0N1bGxpbmcgPSBjdWxsaW5nO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja1ZhbHVlcyA9IGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHggPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICB0aWNrVmFsdWVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geChzY2FsZS5kb21haW4oKSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja1ZhbHVlczsgfVxuICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMgPSB4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBheGlzO1xuICAgIH1cblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmlzU2FmYXJpID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgdWEgPSB3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudDtcbiAgICAgICAgcmV0dXJuIHVhLmluZGV4T2YoJ1NhZmFyaScpID49IDAgJiYgdWEuaW5kZXhPZignQ2hyb21lJykgPCAwO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaXNDaHJvbWUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciB1YSA9IHdpbmRvdy5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vd25pbmdQYXRoU2VnTGlzdCkge1xuICAgICAgICAgICAgICAgICAvLyBTVkcyIHNwZWMgc2F5cyB0byBtYWtlIGEgY29weS5cbiAgICAgICAgICAgICAgICAgbmV3SXRlbSA9IG5ld0l0ZW0uY2xvbmUoKTtcbiAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgdGhpcy5fbGlzdC5zcGxpY2UoaW5kZXgsIDAsIG5ld0l0ZW0pO1xuICAgICAgICAgICAgIG5ld0l0ZW0uX293bmluZ1BhdGhTZWdMaXN0ID0gdGhpcztcbiAgICAgICAgICAgICB0aGlzLl93cml0ZUxpc3RUb1BhdGgoKTtcbiAgICAgICAgICAgICByZXR1cm4gbmV3SXRlbTtcbiAgICAgICAgIH1cblxuICAgICAgICAgU1ZHUGF0aFNlZ0xpc3QucHJvdG90eXBlLnJlcGxhY2VJdGVtID0gZnVuY3Rpb24obmV3SXRlbSwgaW5kZXgpIHtcbiAgICAgICAgICAgICB0aGlzLl9jaGVja1BhdGhTeW5jaHJvbml6ZWRUb0xpc3QoKTtcblxuICAgICAgICAgICAgIGlmIChuZXdJdGVtLl9vd25pbmdQYXRoU2VnTGlzdCkge1xuICAgICAgICAgICAgICAgICAvLyBTVkcyIHNwZWMgc2F5cyB0byBtYWtlIGEgY29weS5cbiAgICAgICAgICAgICAgICAgbmV3SXRlbSA9IG5ld0l0ZW0uY2xvbmUoKTtcbiAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgdGhpcy5fY2hlY2tWYWxpZEluZGV4KGluZGV4KTtcbiAgICAgICAgICAgICB0aGlzLl9saXN0W2luZGV4XSA9IG5ld0l0ZW07XG4gICAgICAgICAgICAgbmV3SXRlbS5fb3duaW5nUGF0aFNlZ0xpc3QgPSB0aGlzO1xuICAgICAgICAgICAgIHRoaXMuX3dyaXRlTGlzdFRvUGF0aCgpO1xuICAgICAgICAgICAgIHJldHVybiBuZXdJdGVtO1xuICAgICAgICAgfVxuXG4gICAgICAgICBTVkdQYXRoU2VnTGl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XG5cbiAgICAgICAgIFNWR1BhdGhTZWdMaXN0Ll9wYXRoU2VnQXJyYXlBc1N0cmluZyA9IGZ1bmN0aW9uKHBhdGhTZWdBcnJheSkge1xuICAgICAgICAgICAgIHZhciBzdHJpbmcgPSBcIlwiO1xuICAgICAgICAgICAgIHZhciBmaXJzdCA9IHRydWU7XG4gICAgICAgICAgICAgcGF0aFNlZ0FycmF5LmZvckVhY2goZnVuY3Rpb24ocGF0aFNlZykge1xuICAgICAgICAgICAgICAgICBpZiAoZmlyc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gcGF0aFNlZy5fYXNQYXRoU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gXCIgXCIgKyBwYXRoU2VnLl9hc1BhdGhTdHJpbmcoKTtcbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgIHJldHVybiBzdHJpbmc7XG4gICAgICAgICB9XG5cbiAgICAgICAgIC8vIFRoaXMgY2xvc2VseSBmb2xsb3dzIFNWR1BhdGhQYXJzZXI6OnBhcnNlUGF0aCBmcm9tIFNvdXJjZS9jb3JlL3N2Zy9TVkdQYXRoUGFyc2VyLmNwcC5cbiAgICAgICAgIFNWR1BhdGhTZWdMaXN0LnByb3RvdHlwZS5fcGFyc2VQYXRoID0gZnVuY3Rpb24oc3RyaW5nKSB7XG4gICAgICAgICAgICAgaWYgKCFzdHJpbmcgfHwgc3RyaW5nLmxlbmd0aCA9PSAwKVxuICAgICAgICAgICAgICAgICByZXR1cm4gW107XG5cbiAgICAgICAgICAgICB2YXIgb3duaW5nUGF0aFNlZ0xpc3QgPSB0aGlzO1xuXG4gICAgICAgICAgICAgdmFyIEJ1aWxkZXIgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICA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fc2tpcE9wdGlvbmFsU3BhY2VzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHdoaWxlICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9pc0N1cnJlbnRTcGFjZSgpKVxuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleDtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9za2lwT3B0aW9uYWxTcGFjZXNPckRlbGltaXRlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgIXRoaXMuX2lzQ3VycmVudFNwYWNlKCkgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpICE9IFwiLFwiKVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCIsXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXg7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5oYXNNb3JlRGF0YSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXg7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5wZWVrU2VnbWVudFR5cGUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdmFyIGxvb2thaGVhZCA9IHRoaXMuX3N0cmluZ1t0aGlzLl9jdXJyZW50SW5kZXhdO1xuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fcGF0aFNlZ1R5cGVGcm9tQ2hhcihsb29rYWhlYWQpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3BhdGhTZWdUeXBlRnJvbUNoYXIgPSBmdW5jdGlvbihsb29rYWhlYWQpIHtcbiAgICAgICAgICAgICAgICAgc3dpdGNoIChsb29rYWhlYWQpIHtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlpcIjpcbiAgICAgICAgICAgICAgICAgY2FzZSBcInpcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ0xPU0VQQVRIO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiTVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwibVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiTFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwibFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiQ1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcImNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJRXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInFcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19RVUFEUkFUSUNfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiQVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19BUkNfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiYVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19BUkNfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiSFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fSE9SSVpPTlRBTF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJoXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19IT1JJWk9OVEFMX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlZcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1ZFUlRJQ0FMX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInZcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1ZFUlRJQ0FMX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19TTU9PVEhfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwic1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX1NNT09USF9SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJUXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX1NNT09USF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJ0XCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX1NNT09USF9SRUw7XG4gICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV047XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9uZXh0Q29tbWFuZEhlbHBlciA9IGZ1bmN0aW9uKGxvb2thaGVhZCwgcHJldmlvdXNDb21tYW5kKSB7XG4gICAgICAgICAgICAgICAgIC8vIENoZWNrIGZvciByZW1haW5pbmcgY29vcmRpbmF0ZXMgaW4gdGhlIGN1cnJlbnQgY29tbWFuZC5cbiAgICAgICAgICAgICAgICAgaWYgKChsb29rYWhlYWQgPT0gXCIrXCIgfHwgbG9va2FoZWFkID09IFwiLVwiIHx8IGxvb2thaGVhZCA9PSBcIi5cIiB8fCAobG9va2FoZWFkID49IFwiMFwiICYmIGxvb2thaGVhZCA8PSBcIjlcIikpICYmIHByZXZpb3VzQ29tbWFuZCAhPSBTVkdQYXRoU2VnLlBBVEhTRUdfQ0xPU0VQQVRIKSB7XG4gICAgICAgICAgICAgICAgICAgICBpZiAocHJldmlvdXNDb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX0FCUztcbiAgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2aW91c0NvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUwpXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fUkVMO1xuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByZXZpb3VzQ29tbWFuZDtcbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV047XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5pbml0aWFsQ29tbWFuZElzTW92ZVRvID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIC8vIElmIHRoZSBwYXRoIGlzIGVtcHR5IGl0IGlzIHN0aWxsIHZhbGlkLCBzbyByZXR1cm4gdHJ1ZS5cbiAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmhhc01vcmVEYXRhKCkpXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgdmFyIGNvbW1hbmQgPSB0aGlzLnBlZWtTZWdtZW50VHlwZSgpO1xuICAgICAgICAgICAgICAgICAvLyBQYXRoIG11c3Qgc3RhcnQgd2l0aCBtb3ZlVG8uXG4gICAgICAgICAgICAgICAgIHJldHVybiBjb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTIHx8IGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUw7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgLy8gUGFyc2UgYSBudW1iZXIgZnJvbSBhbiBTVkcgcGF0aC4gVGhpcyB2ZXJ5IGNsb3NlbHkgZm9sbG93cyBnZW5lcmljUGFyc2VOdW1iZXIoLi4uKSBmcm9tIFNvdXJjZS9jb3JlL3N2Zy9TVkdQYXJzZXJVdGlsaXRpZXMuY3BwLlxuICAgICAgICAgICAgIC8vIFNwZWM6IGh0dHA6Ly93d3cudzMub3JnL1RSL1NWRzExL3NpbmdsZS1wYWdlLmh0bWwjcGF0aHMtUGF0aERhdGFCTkZcbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9wYXJzZU51bWJlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB2YXIgZXhwb25lbnQgPSAwO1xuICAgICAgICAgICAgICAgICB2YXIgaW50ZWdlciA9IDA7XG4gICAgICAgICAgICAgICAgIHZhciBmcmFjID0gMTtcbiAgICAgICAgICAgICAgICAgdmFyIGRlY2ltYWwgPSAwO1xuICAgICAgICAgICAgICAgICB2YXIgc2lnbiA9IDE7XG4gICAgICAgICAgICAgICAgIHZhciBleHBzaWduID0gMTtcblxuICAgICAgICAgICAgICAgICB2YXIgc3RhcnRJbmRleCA9IHRoaXMuX2N1cnJlbnRJbmRleDtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKTtcblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBzaWduLlxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiK1wiKVxuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIi1cIikge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICBzaWduID0gLTE7XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID09IHRoaXMuX2VuZEluZGV4IHx8ICgodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDwgXCIwXCIgfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID4gXCI5XCIpICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSAhPSBcIi5cIikpXG4gICAgICAgICAgICAgICAgICAgICAvLyBUaGUgZmlyc3QgY2hhcmFjdGVyIG9mIGEgbnVtYmVyIG11c3QgYmUgb25lIG9mIFswLTkrLS5dLlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBpbnRlZ2VyIHBhcnQsIGJ1aWxkIHJpZ2h0LXRvLWxlZnQuXG4gICAgICAgICAgICAgICAgIHZhciBzdGFydEludFBhcnRJbmRleCA9IHRoaXMuX2N1cnJlbnRJbmRleDtcbiAgICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+PSBcIjBcIiAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPD0gXCI5XCIpXG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKzsgLy8gQWR2YW5jZSB0byBmaXJzdCBub24tZGlnaXQuXG5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCAhPSBzdGFydEludFBhcnRJbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgdmFyIHNjYW5JbnRQYXJ0SW5kZXggPSB0aGlzLl9jdXJyZW50SW5kZXggLSAxO1xuICAgICAgICAgICAgICAgICAgICAgdmFyIG11bHRpcGxpZXIgPSAxO1xuICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHNjYW5JbnRQYXJ0SW5kZXggPj0gc3RhcnRJbnRQYXJ0SW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlZ2VyICs9IG11bHRpcGxpZXIgKiAodGhpcy5fc3RyaW5nLmNoYXJBdChzY2FuSW50UGFydEluZGV4LS0pIC0gXCIwXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRpcGxpZXIgKj0gMTA7XG4gICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBkZWNpbWFscy5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIi5cIikge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIG11c3QgYmUgYSBsZWFzdCBvbmUgZGlnaXQgZm9sbG93aW5nIHRoZSAuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4IHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8IFwiMFwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+IFwiOVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgICB3aGlsZSAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID49IFwiMFwiICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8PSBcIjlcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICBkZWNpbWFsICs9ICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCsrKSAtIFwiMFwiKSAqIChmcmFjICo9IDAuMSk7XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBleHBvbmVudCBwYXJ0LlxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ICE9IHN0YXJ0SW5kZXggJiYgdGhpcy5fY3VycmVudEluZGV4ICsgMSA8IHRoaXMuX2VuZEluZGV4ICYmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCJlXCIgfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiRVwiKSAmJiAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXggKyAxKSAhPSBcInhcIiAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCArIDEpICE9IFwibVwiKSkge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFJlYWQgdGhlIHNpZ24gb2YgdGhlIGV4cG9uZW50LlxuICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIitcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCItXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHBzaWduID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIG11c3QgYmUgYW4gZXhwb25lbnQuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4IHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8IFwiMFwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+IFwiOVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgICAgIHdoaWxlICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPj0gXCIwXCIgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDw9IFwiOVwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXhwb25lbnQgKj0gMTA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXhwb25lbnQgKz0gKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSAtIFwiMFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIHZhciBudW1iZXIgPSBpbnRlZ2VyICsgZGVjaW1hbDtcbiAgICAgICAgICAgICAgICAgbnVtYmVyICo9IHNpZ247XG5cbiAgICAgICAgICAgICAgICAgaWYgKGV4cG9uZW50KVxuICAgICAgICAgICAgICAgICAgICAgbnVtYmVyICo9IE1hdGgucG93KDEwLCBleHBzaWduICogZXhwb25lbnQpO1xuXG4gICAgICAgICAgICAgICAgIGlmIChzdGFydEluZGV4ID09IHRoaXMuX2N1cnJlbnRJbmRleClcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzT3JEZWxpbWl0ZXIoKTtcblxuICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3BhcnNlQXJjRmxhZyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4KVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgdmFyIGZsYWcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgdmFyIGZsYWdDaGFyID0gdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgrKyk7XG4gICAgICAgICAgICAgICAgIGlmIChmbGFnQ2hhciA9PSBcIjBcIilcbiAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZmxhZ0NoYXIgPT0gXCIxXCIpXG4gICAgICAgICAgICAgICAgICAgICBmbGFnID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXNPckRlbGltaXRlcigpO1xuICAgICAgICAgICAgICAgICByZXR1cm4gZmxhZztcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLnBhcnNlU2VnbWVudCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB2YXIgbG9va2FoZWFkID0gdGhpcy5fc3RyaW5nW3RoaXMuX2N1cnJlbnRJbmRleF07XG4gICAgICAgICAgICAgICAgIHZhciBjb21tYW5kID0gdGhpcy5fcGF0aFNlZ1R5cGVGcm9tQ2hhcihsb29rYWhlYWQpO1xuICAgICAgICAgICAgICAgICBpZiAoY29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTikge1xuICAgICAgICAgICAgICAgICAgICAgLy8gUG9zc2libHkgYW4gaW1wbGljaXQgY29tbWFuZC4gTm90IGFsbG93ZWQgaWYgdGhpcyBpcyB0aGUgZmlyc3QgY29tbWFuZC5cbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9wcmV2aW91c0NvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV04pXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgICBjb21tYW5kID0gdGhpcy5fbmV4dENvbW1hbmRIZWxwZXIobG9va2FoZWFkLCB0aGlzLl9wcmV2aW91c0NvbW1hbmQpO1xuICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV04pXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3ByZXZpb3VzQ29tbWFuZCA9IGNvbW1hbmQ7XG5cbiAgICAgICAgICAgICAgICAgc3dpdGNoIChjb21tYW5kKSB7XG4gICAgICAgICAgICAgICAgIGNhc2UgU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUw6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNWR1BhdGhTZWdNb3ZldG9SZWwob3duaW5nUGF0aFNlZ0xpc3QsIHRoaXMuX3BhcnNlTnVtYmVyKCksIHRoaXMuX3BhcnNlTnVtYmVyKCkpO1xuICAgICAgICAgICAgICAgICBjYXNlIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTVkdQYXRoU2VnTW92ZXRvQWJzKG93bmluZ1BhdGhTZWdMaXN0LCB0aGlzLl9wYXJzZU51bWJlcigpLCB0aGlzLl9wYXJzZU51bWJlcigpKTtcbiAgICAgICAgICAgICAgICAgY2FzZSBTVkd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G4gICAgICAgICAgICAgICAgICAgICB2YXIgcG9pbnRzID0ge3gxOiB0aGlzLl9wYXJzZU51bWJlcigpLCB5MTogdGhpcy5fcGFyc2VOdW1iZXIoKSwgYXJjQW5nbGU6IHRoaXMuX3BhcnNlTnVtYmVyKCksIGFyY0xhcmdlOiB0aGlzLl9wYXJzZUFyY0ZsYWcoKSwgYXJjU3dlZXA6IHRoaXMuX3BhcnNlQXJjRmxhZygpLCB4OiB0aGlzLl9wYXJzZU51bWJlcigpLCB5OiB0aGlzLl9wYXJzZU51bWJlcigpfTtcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU1ZHUGF0aFNlZ0FyY0Ficyhvd25pbmdQYXRoU2VnTGlzdCwgcG9pbnRzLngsIHBvaW50cy55LCBwb2ludHMueDEsIHBvaW50cy55MSwgcG9pbnRzLmFyY0FuZ2xlLCBwb2ludHMuYXJjTGFyZ2UsIHBvaW50cy5hcmNTd2VlcCk7XG4gICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICB0aHJvdyBcIlVua25vd24gcGF0aCBzZWcgdHlwZS5cIlxuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgdmFyIGJ1aWxkZXIgPSBuZXcgQnVpbGRlcigpO1xuICAgICAgICAgICAgIHZhciBzb3VyY2UgPSBuZXcgU291cmNlKHN0cmluZyk7XG5cbiAgICAgICAgICAgICBpZiAoIXNvdXJjZS5pbml0aWFsQ29tbWFuZElzTW92ZVRvKCkpXG4gICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgICB3aGlsZSAoc291cmNlLmhhc01vcmVEYXRhKCkpIHtcbiAgICAgICAgICAgICAgICAgdmFyIHBhdGhTZWcgPSBzb3VyY2UucGFyc2VTZWdtZW50KCk7XG4gICAgICAgICAgICAgICAgIGlmICghcGF0aFNlZylcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXT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gKCsraSA8IG4pIGlmICgoYiA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSAhPSBudWxsICYmIGIgPj0gYikge1xuICAgICAgICBhID0gYjtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gZi5jYWxsKGFycmF5LCBhcnJheVtpXSwgaSkpICE9IG51bGwgJiYgYiA+IGEpIGEgPSBiO1xuICAgIH1cbiAgICByZXR1cm4gYTtcbiAgfTtcbiAgZDMuZXh0ZW50ID0gZnVuY3Rpb24oYXJyYXksIGYpIHtcbiAgICB2YXIgaSA9IC0xLCBuID0gYXJyYXkubGVuZ3RoLCBhLCBiLCBjO1xuICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxKSB7XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gYXJyYXlbaV0pICE9IG51bGwgJiYgYiA+PSBiKSB7XG4gICAgICAgIGEgPSBjID0gYjtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gYXJyYXlbaV0pICE9IG51bGwpIHtcbiAgICAgICAgaWYgKGEgPiBiKSBhID0gYjtcbiAgICAgICAgaWYgKGMgPCBiKSBjID0gYjtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSAhPSBudWxsICYmIGIgPj0gYikge1xuICAgICAgICBhID0gYyA9IGI7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSAhPSBudWxsKSB7XG4gICAgICAgIGlmIChhID4gYikgYSA9IGI7XG4gICAgICAgIGlmIChjIDwgYikgYyA9IGI7XG4gICAgICB9XG4gICAgfVxuICAgI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ZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pLnR3ZWVuKFwiem9vbTp6b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIGR4ID0gc2l6ZVswXSwgZHkgPSBzaXplWzFdLCBjeCA9IGNlbnRlcjAgPyBjZW50ZXIwWzBdIDogZHggLyAyLCBjeSA9IGNlbnRlcjAgPyBjZW50ZXIwWzFdIDogZHkgLyAyLCBpID0gZDMuaW50ZXJwb2xhdGVab29tKFsgKGN4IC0gdmlldy54KSAvIHZpZXcuaywgKGN5IC0gdmlldy55KSAvIHZpZXcuaywgZHggLyB2aWV3LmsgXSwgWyAoY3ggLSB2aWV3MS54KSAvIHZpZXcxLmssIChjeSAtIHZpZXcxLnkpIC8gdmlldzEuaywgZHggLyB2aWV3MS5rIF0pO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgICAgdmFyIGwgPSBpKHQpLCBrID0gZHggLyBsWzJdO1xuICAgICAgICAgICAgICB0aGlzLl9fY2hhcnRfXyA9IHZpZXcgPSB7XG4gICAgICAgICAgICAgICAgeDogY3ggLSBsWzBdICogayxcbiAgICAgICAgICAgICAgICB5OiBjeSAtIGxbMV0gKiBrLFxuICAgICAgICAgICAgICAgIGs6IGtcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgem9vbWVkKGRpc3BhdGNoKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSkuZWFjaChcImludGVycnVwdC56b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgem9vbWVuZGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB9KS5lYWNoKFwiZW5kLnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRoaXMuX19jaGFydF9fID0gdmlldztcbiAgICAgICAgICB6b29tc3RhcnRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgem9vbWVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuICAgIHpvb20udHJhbnNsYXRlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gWyB2aWV3LngsIHZpZXcueSBdO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogK19bMF0sXG4gICAgICAgIHk6ICtfWzFdLFxuICAgICAgICBrOiB2aWV3LmtcbiAgICAgIH07XG4gICAgICByZXNjYWxlKCk7XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2NhbGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB2aWV3Lms7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiB2aWV3LngsXG4gICAgICAgIHk6IHZpZXcueSxcbiAgICAgICAgazogbnVsbFxuICAgICAgfTtcbiAgICAgIHNjYWxlVG8oK18pO1xuICAgICAgcmVzY2FsZSgpO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNjYWxlRXh0ZW50ID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2NhbGVFeHRlbnQ7XG4gICAgICBzY2FsZUV4dGVudCA9IF8gPT0gbnVsbCA/IGQzX2JlaGF2aW9yX3pvb21JbmZpbml0eSA6IFsgK19bMF0sICtfWzFdIF07XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uY2VudGVyID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY2VudGVyO1xuICAgICAgY2VudGVyID0gXyAmJiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNpemUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaXplO1xuICAgICAgc2l6ZSA9IF8gJiYgWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5kdXJhdGlvbiA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGR1cmF0aW9uO1xuICAgICAgZHVyYXRpb24gPSArXztcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS54ID0gZnVuY3Rpb24oeikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDE7XG4gICAgICB4MSA9IHo7XG4gICAgICB4MCA9IHouY29weSgpO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogMCxcbiAgICAgICAgeTogMCxcbiAgICAgICAgazogMVxuICAgICAgfTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS55ID0gZnVuY3Rpb24oeikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTE7XG4gICAgICB5MSA9IHo7XG4gICAgICB5MCA9IHouY29weSgpO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogMCxcbiAgICAgICAgeTogMCxcbiAgICAgICAgazogMVxuICAgICAgfTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgZnVuY3Rpb24gbG9jYXRpb24ocCkge1xuICAgICAgcmV0dXJuIFsgKHBbMF0gLSB2aWV3LngpIC8gdmlldy5rLCAocFsxXSAtIHZpZXcueSkgLyB2aWV3LmsgXTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcG9pbnQobCkge1xuICAg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aSArIDEpICE9PSAzNCkgYnJlYWs7XG4gICAgICAgICAgICAgICsraTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgSSA9IGkgKyAyO1xuICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KGkgKyAxKTtcbiAgICAgICAgICBpZiAoYyA9PT0gMTMpIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGkgKyAyKSA9PT0gMTApICsrSTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGMgPT09IDEwKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqICsgMSwgaSkucmVwbGFjZSgvXCJcIi9nLCAnXCInKTtcbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAoSSA8IE4pIHtcbiAgICAgICAgICB2YXIgYyA9IHRleHQuY2hhckNvZGVBdChJKyspLCBrID0gMTtcbiAgICAgICAgICBpZiAoYyA9PT0gMTApIGVvbCA9IHRydWU7IGVsc2UgaWYgKGMgPT09IDEzKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChJKSA9PT0gMTApICsrSSwgKytrO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYyAhPT0gZGVsaW1pdGVyQ29kZSkgY29udGludWU7XG4gICAgICAgICAgcmV0dXJuIHRleHQuc2xpY2UoaiwgSSAtIGspO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGopO1xuICAgICAgfVxuICAgICAgd2hpbGUgKCh0ID0gdG9rZW4oKSkgIT09IEVPRikge1xuICAgICAgICB2YXIgYSA9IFtdO1xuICAgICAgICB3aGlsZSAodCAhPT0gRU9MICYmIHQgIT09IEVPRikge1xuICAgICAgICAgIGEucHVzaCh0KTtcbi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vcnRNb250aHMgPSBsb2NhbGUuc2hvcnRNb250aHM7XG4gICAgZnVuY3Rpb24gZDNfdGltZV9mb3JtYXQodGVtcGxhdGUpIHtcbiAgICAgIHZhciBuID0gdGVtcGxhdGUubGVuZ3RoO1xuICAgICAgZnVuY3Rpb24gZm9ybWF0KGRhdGUpIHtcbiAgICAgICAgdmFyIHN0cmluZyA9IFtdLCBpID0gLTEsIGogPSAwLCBjLCBwLCBmO1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIGlmICh0ZW1wbGF0ZS5jaGFyQ29kZUF0KGkpID09PSAzNykge1xuICAgICAgICAgICAgc3RyaW5nLnB1c2godGVtcGxhdGUuc2xpY2UoaiwgaSkpO1xuICAgICAgICAgICAgaWYgKChwID0gZDNfdGltZV9mb3JtYXRQYWRzW2MgPSB0ZW1wbGF0ZS5jaGFyQXQoKytpKV0pICE9IG51bGwpIGMgPSB0ZW1wbGF0ZS5jaGFyQXQoKytpKTtcbiAgICAgICAgICAgIGlmIChmID0gZDNfdGltZV9mb3JtYXRzW2NdKSBjID0gZihkYXRlLCBwID09IG51bGwgPyBjID09PSBcImVcIiA/IFwiIFwiIDogXCIwXCIgOiBwKTtcbiAgICAgICAgICAgIHN0cmluZy5wdXNoKGMpO1xuICAgICAgICAgICAgaiA9IGkgKyAxO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdHJpbmcucHVzaCh0ZW1wbGF0ZS5zbGljZShqLCBpKSk7XG4gICAgICAgIHJldHVybiBzdHJpbmcuam9pbihcIlwiKTtcbiAgICAgIH1cbiAgICAgIGZvcm1hdC5wYXJzZSA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICB2YXIgZCA9IHtcbiAgICAgICAgICB5OiAxOTAwLFxuICAgICAgICAgIG06IDAsXG4gICAgICAgICAgZDogMSxcbiAgICAgICAgICBIOiAwLFxuICAgICAgICAgIE06IDAsXG4gICAgICAgICAgUzogMCxcbiAgICAgICAgICB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ybiBkM190aW1lX2Zvcm1hdFBhZChkM190aW1lLnN1bmRheU9mWWVhcihkKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgdzogZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gZC5nZXREYXkoKTtcbiAgICAgIH0sXG4gICAgICBXOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkM190aW1lLm1vbmRheU9mWWVhcihkKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgeDogZDNfdGltZV9mb3JtYXQobG9jYWxlX2RhdGUpLFxuICAgICAgWDogZDNfdGltZV9mb3JtYXQobG9jYWxlX3RpbWUpLFxuICAgICAgeTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRGdWxsWWVhcigpICUgMTAwLCBwLCAyKTtcbiAgICAgIH0sXG4gICAgICBZOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldEZ1bGxZZWFyKCkgJSAxZTQsIHAsIDQpO1xuICAgICAgfSxcbiAgICAgIFo6IGQzX3RpbWVfem9uZSxcbiAgICAgIFwiJVwiOiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIFwiJVwiO1xuICAgICAgfVxuICAgIH07XG4gICAgdmFyIGQzX3RpbWVfcGFyc2VycyA9IHtcbiAgICAgIGE6IGQzX3RpbWVfcGFyc2VXZWVrZGF5QWJicmV2LFxuICAgICAgQTogZDNfdGltZV9wYXJzZVdlZWtkYXksXG4gICAgICBiOiBkM190aW1lX3BhcnNlTW9udGhBYmJyZXYsXG4gICAgICBCOiBkM190aW1lX3BhcnNlTW9udGgsXG4gICAgICBjOiBkM190aW1lX3BhcnNlTG9jYWxlRnVsbCxcbiAgICAgIGQ6IGQzX3RpbWVfcGFyc2VEYXksXG4gICAgICBlOiBkM190aW1lX3Bhcn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DOuykpIHtcbiAgICAgICAgICB2YXIgz4ZpID0gaW5mbGVjdGlvblsxXSAqIGQzX2RlZ3JlZXM7XG4gICAgICAgICAgaWYgKM+GaSA+IM+GMSkgz4YxID0gz4ZpO1xuICAgICAgICB9IGVsc2UgaWYgKM67aSA9ICjOu2kgKyAzNjApICUgMzYwIC0gMTgwLCBhbnRpbWVyaWRpYW4gXiAocyAqIM67XyA8IM67aSAmJiDOu2kgPCBzICogzrspKSB7XG4gICAgICAgICAgdmFyIM+GaSA9IC1pbmZsZWN0aW9uWzFdICogZDNfZGVncmVlcztcbiAgICAgICAgICBpZiAoz4ZpIDwgz4YwKSDPhjAgPSDPhmk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKM+GIDwgz4YwKSDPhjAgPSDPhjtcbiAgICAgICAgICBpZiAoz4YgPiDPhjEpIM+GMSA9IM+GO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhbnRpbWVyaWRpYW4pIHtcbiAgICAgICAgICBpZiAozrsgPCDOu18pIHtcbiAgICAgICAgICAgIGlmIChhbmdsZSjOuzAsIM67KSA+IGFuZ2xlKM67MCwgzrsxKSkgzrsxID0gzrs7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChhbmdsZSjOuywgzrsxKSA+IGFuZ2xlKM67MCwgzrsxKSkgzrswID0gzrs7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICjOuzEgPj0gzrswKSB7XG4gICAgICAgICAgICBpZiAozrsgPCDOuzApIM67MCA9IM67O1xuICAgICAgICAgICAgaWYgKM67ID4gzrsxKSDOuzEgPSDOuztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKM67ID4gzrtfKSB7XG4gICAgICAgICAgICAgIGlmIChhbmdsZSjOuzAsIM67KSA+IGFuZ2xlKM67MCwgzrsxKSkgzrsxID0gzrs7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYW5nbGUozrssIM67MSkgPiBhbmdsZSjOuzAsIM67MSkpIM67MCA9IM67O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcG9pbnQozrssIM+GKTtcbiAgICAgIH1cbiAgICAgIHAwID0gcCwgzrtfID0gzrs7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGxpbmVTdGFydCgpIHtcbiAgICAgIGJvdW5kLnBvaW50ID0gbGluZVBvaW50O1xuICAgIH1cbiAgICBmdW5jdGlvbiBsaW5lRW5kKCkge1xuICAgICAgcmFuZ2VbMF0gPSDOuzAsIHJhbmdlWzFdID0gzrsxO1xuICAgICAgYm91bmQucG9pbnQgPSBwb2ludDtcbiAgICAgIHAwID0gbnVsbDtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmluZ1BvaW50KM67LCDPhikge1xuICAgICAgaWYgKHAwKSB7XG4gICAgICAgIHZhciBkzrsgPSDOuyAtIM67XztcbiAgICAgICAgZM67U3VtICs9IGFicyhkzrspID4gMTgwID8gZM67ICsgKGTOuyA+IDAgPyAzNjAgOiAtMzYwKSA6IGTOuztcbiAgICAgIH0gZWxzZSDOu19fID0gzrssIM+GX18gPSDPhjtcbiAgICAgIGQzX2dlb19hcmVhLnBvaW50KM67LCDPhik7XG4gICAgICBsaW5lUG9pbnQozrssIM+GKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmluZ1N0YXJ0KCkge1xuICAgICAgZDNfZ2VvX2FyZWEubGluZVN0YXJ0KCk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJpbmdFbmQoKSB7XG4gICAgICByaW5nUG9pbnQozrtfXywgz4ZfXyk7XG4gICAgICBkM19nZW9fYXJlYS5saW5lRW5kKCk7XG4gICAgICBpZiAoYWJzKGTOu1N1bSkgPiDOtSkgzrswID0gLSjOuzEgPSAxODApO1xuICAgICAgcmFuZ2VbMF0gPSDOuzAsIH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hciB4MCwgeTAsIHowO1xuICAgIGQzX2dlb19jZW50cm9pZC5wb2ludCA9IGZ1bmN0aW9uKM67LCDPhikge1xuICAgICAgzrsgKj0gZDNfcmFkaWFucztcbiAgICAgIHZhciBjb3PPhiA9IE1hdGguY29zKM+GICo9IGQzX3JhZGlhbnMpO1xuICAgICAgeDAgPSBjb3PPhiAqIE1hdGguY29zKM67KTtcbiAgICAgIHkwID0gY29zz4YgKiBNYXRoLnNpbijOuyk7XG4gICAgICB6MCA9IE1hdGguc2luKM+GKTtcbiAgICAgIGQzX2dlb19jZW50cm9pZC5wb2ludCA9IG5leHRQb2ludDtcbiAgICAgIGQzX2dlb19jZW50cm9pZFBvaW50WFlaKHgwLCB5MCwgejApO1xuICAgIH07XG4gICAgZnVuY3Rpb24gbmV4dFBvaW50KM67LCDPhikge1xuICAgICAgzrsgKj0gZDNfcmFkaWFucztcbiAgICAgIHZhciBjb3PPhiA9IE1hdGguY29zKM+GICo9IGQzX3JhZGlhbnMpLCB4ID0gY29zz4YgKiBNYXRoLmNvcyjOuyksIHkgPSBjb3PPhiAqIE1hdGguc2luKM67KSwgeiA9IE1hdGguc2luKM+GKSwgdyA9IE1hdGguYXRhbjIoTWF0aC5zcXJ0KCh3ID0geTAgKiB6IC0gejAgKiB5KSAqIHcgKyAodyA9IHowICogeCAtIHgwICogeikgKiB3ICsgKHcgPSB4MCAqIHkgLSB5MCAqIHgpICogdyksIHgwICogeCArIHkwICogeSArIHowICogeik7XG4gICAgICBkM19nZW9fY2VudHJvaWRXMSArPSB3O1xuICAgICAgZDNfZ2VvX2NlbnRyb2lkWDEgKz0gdyAqICh4MCArICh4MCA9IHgpKTtcbiAgICAgIGQzX2dlb19jZW50cm9pZFkxICs9IHcgKiAoeTAgKyAoeTAgPSB5KSk7XG4gICAgICBkM19nZW9fY2VudHJvaWRaMSArPSB3ICogKHowICsgKHowID0geikpO1xuICAgICAgZDNfZ2VvX2NlbnRyb2lkUG9pbnRYWVooeDAsIHkwLCB6M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ludCA9IHBvaW50c1tpXSlbMF0sIHBvaW50WzFdKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW50ZXJwb2xhdGUoY3VycmVudC54LCBjdXJyZW50Lm4ueCwgMSwgbGlzdGVuZXIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC5uO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChpc1N1YmplY3QpIHtcbiAgICAgICAgICAgIHBvaW50cyA9IGN1cnJlbnQucC56O1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IHBvaW50cy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gcG9pbnRzW2ldKVswXSwgcG9pbnRbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpbnRlcnBvbGF0ZShjdXJyZW50LngsIGN1cnJlbnQucC54LCAtMSwgbGlzdGVuZXIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC5wO1xuICAgICAgICB9XG4gICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm87XG4gICAgICAgIHBvaW50cyA9IGN1cnJlbnQuejtcbiAgICAgICAgaXNTdWJqZWN0ID0gIWlzU3ViamVjdDtcbiAgICAgIH0gd2hpbGUgKCFjdXJyZW50LnYpO1xuICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgIH1cbiAgfVxuICBmdW5jdGlvbiBkM19nZW9fY2xpcFBvbHlnb25MaW5rQ2lyY3VsYXIoYXJyYXkpIHtcbiAgICBpZiAoIShuID0gYXJyYXkubGVuZ3RoKSkgcmV0dXJuO1xuICAgIHZhciBuLCBpID0gMCwgYSA9IGFycmF5WzBdLCBiO1xuICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICBhLm4gPSBiID0gYXJyYXlbaV07XG4gICAgICBiLnAgPSBhO1xuICAgICAgYSA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ZnVuY3Rpb24gcG9pbnRSaW5nKM67LCDPhikge1xuICAgICAgICByaW5nLnB1c2goWyDOuywgz4YgXSk7XG4gICAgICAgIHZhciBwb2ludCA9IHJvdGF0ZSjOuywgz4YpO1xuICAgICAgICByaW5nTGlzdGVuZXIucG9pbnQocG9pbnRbMF0sIHBvaW50WzFdKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHJpbmdTdGFydCgpIHtcbiAgICAgICAgcmluZ0xpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICByaW5nID0gW107XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiByaW5nRW5kKCkge1xuICAgICAgICBwb2ludFJpbmcocmluZ1swXVswXSwgcmluZ1swXVsxXSk7XG4gICAgICAgIHJpbmdMaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgIHZhciBjbGVhbiA9IHJpbmdMaXN0ZW5lci5jbGVhbigpLCByaW5nU2VnbWVudHMgPSBidWZmZXIuYnVmZmVyKCksIHNlZ21lbnQsIG4gPSByaW5nU2VnbWVudHMubGVuZ3RoO1xuICAgICAgICByaW5nLnBvcCgpO1xuICAgICAgICBwb2x5Z29uLnB1c2gocmluZyk7XG4gICAgICAgIHJpbmcgPSBudWxsO1xuICAgICAgICBpZiAoIW4pIHJldHVybjtcbiAgICAgICAgaWYgKGNsZWFuICYgMSkge1xuICAgICAgICAgIHNlZ21lbnQgPSByaW5nU2VnbWVudHNbMF07XG4gICAgICAgICAgdmFyIG4gPSBzZWdtZW50Lmxlbmd0aCAtIDEsIGkgPSAtMSwgcG9pbnQ7XG4gICAgICAgICAgaWYgKG4gPiAwKSB7XG4gICAgICAgICAgICBpZiAoIXBvbHlnb25TdGFydGVkKSBsaXN0ZW5lci5wb2x5Z29uU3RhcnQoKSwgcG9seWdvblN0YXJ0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICB3aGlsZSAoKytpIDwgbikg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PgCA6IC1oYWxmz4ApO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzAsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzEsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQozrsxLCDPhjApO1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgfSBlbHNlIGlmIChzzrswICE9PSBzzrsxICYmIGTOuyA+PSDPgCkge1xuICAgICAgICAgIGlmIChhYnMozrswIC0gc867MCkgPCDOtSkgzrswIC09IHPOuzAgKiDOtTtcbiAgICAgICAgICBpZiAoYWJzKM67MSAtIHPOuzEpIDwgzrUpIM67MSAtPSBzzrsxICogzrU7XG4gICAgICAgICAgz4YwID0gZDNfZ2VvX2NsaXBBbnRpbWVyaWRpYW5JbnRlcnNlY3QozrswLCDPhjAsIM67MSwgz4YxKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrswLCDPhjApO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrsxLCDPhjApO1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgfVxuICAgICAgICBsaXN0ZW5lci5wb2ludCjOuzAgPSDOuzEsIM+GMCA9IM+GMSk7XG4gICAgICAgIHPOuzAgPSBzzrsxO1xuICAgICAgfSxcbiAgICAgIGxpbmVFbmQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgIM67MCA9IM+GMCA9IE5hTjtcbiAgICAgIH0sXG4gICAgICBjbGVhbjogZnVuY3Rpb24oKSB7XG4gICAgICAgIHJldHVybiAyIC0gY2xlYW47XG4gICA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ICAgICAgdjAwID0gdjAgPSBmYWxzZTtcbiAgICAgICAgICBjbGVhbiA9IDE7XG4gICAgICAgIH0sXG4gICAgICAgIHBvaW50OiBmdW5jdGlvbijOuywgz4YpIHtcbiAgICAgICAgICB2YXIgcG9pbnQxID0gWyDOuywgz4YgXSwgcG9pbnQyLCB2ID0gdmlzaWJsZSjOuywgz4YpLCBjID0gc21hbGxSYWRpdXMgPyB2ID8gMCA6IGNvZGUozrssIM+GKSA6IHYgPyBjb2RlKM67ICsgKM67IDwgMCA/IM+AIDogLc+AKSwgz4YpIDogMDtcbiAgICAgICAgICBpZiAoIXBvaW50MCAmJiAodjAwID0gdjAgPSB2KSkgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgaWYgKHYgIT09IHYwKSB7XG4gICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgICAgaWYgKGQzX2dlb19zcGhlcmljYWxFcXVhbChwb2ludDAsIHBvaW50MikgfHwgZDNfZ2VvX3NwaGVyaWNhbEVxdWFsKHBvaW50MSwgcG9pbnQyKSkge1xuICAgICAgICAgICAgICBwb2ludDFbMF0gKz0gzrU7XG4gICAgICAgICAgICAgIHBvaW50MVsxXSArPSDOtTtcbiAgICAgICAgICAgICAgdiA9IHZpc2libGUocG9pbnQxWzBdLCBwb2ludDFbMV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgICAgIGlmICh2KSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDApO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBvaW50MCA9IHBvaW50MjtcbiAgICAgICAgICB9IGVsc2UgaWYgKG5vdEhlbWlzcGhlcmUgJiYgcG9pbnQwICYmIHNtYWxsUmFkaXVzIF4gdikge1xuICAgICAgICAgICAgdmFyIHQ7XG4gICAgICAgICAgICBpZiAoIShjICYgYzApICYmICh0ID0gaW50ZXJzZWN0KHBvaW50MSwgcG9pbnQwLCB0cnVlKSkpIHtcbiAgICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgICBpZiAoc21hbGxSYWRpdXMpIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzBdWzBdLCB0WzBdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh2ICYmICghcG9pbnQwIHx8ICFkM19nZW9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B4MSAtIGF4O1xuICAgICAgaWYgKCFkeCAmJiByIDwgMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeDtcbiAgICAgIGlmIChkeCA8IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR4ID4gMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH1cbiAgICAgIHIgPSB5MCAtIGF5O1xuICAgICAgaWYgKCFkeSAmJiByID4gMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeTtcbiAgICAgIGlmIChkeSA8IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR5ID4gMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH1cbiAgICAgIHIgPSB5MSAtIGF5O1xuICAgICAgaWYgKCFkeSAmJiByIDwgMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeTtcbiAgICAgIGlmIChkeSA8IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR5ID4gMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH1cbiAgICAgIGlmICh0MCA+IDApIGxpbmUuYSA9IHtcbiAgICAgICAgeDogYXggKyB0MCAqIGR4LFxuICAgICAgICB5OiBheSArIHQwICogZHlcbiAgICAgIH07XG4gICAgICBpZiAodDEgPCAxKSBsaW5lLmIgPSB7XG4gICAgICAgIHg6IGF4ICsgd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0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodmlzaWJsZSkge1xuICAgICAgICAgICAgICBkM19nZW9fY2xpcFBvbHlnb24oc2VnbWVudHMsIGNvbXBhcmUsIGNsaXBTdGFydEluc2lkZSwgaW50ZXJwb2xhdGUsIGxpc3RlbmVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25FbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgc2VnbWVudHMgPSBwb2x5Z29uID0gcmluZyA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBpbnNpZGVQb2x5Z29uKHApIHtcbiAgICAgICAgdmFyIHduID0gMCwgbiA9IHBvbHlnb24ubGVuZ3RoLCB5ID0gcFsxXTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICBmb3IgKHZhciBqID0gMSwgdiA9IHBvbHlnb25baV0sIG0gPSB2Lmxlbmd0aCwgYSA9IHZbMF0sIGI7IGogPCBtOyArK2opIHtcbiAgICAgICAgICAgIGIgPSB2W2pdO1xuICAgICAgICAgICAgaWYgKGFbMV0gPD0geSkge1xuICAgICAgICAgICAgICBpZiAoYlsxXSA+IHkgJiYgZDNfY3Jvc3MyZChhLCBiLCBwKSA+IDApICsrd247XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYlsxXSA8PSB5ICYmIGQzX2Nyb3NzMmQoYSwgYiwgcCkgPCAwKSAtLXduO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB3biAhPT0gMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGludGVycG9sYXRlKGZyb20sIHRvLCBkaXJlY3Rpb24sIGxpc3RlbmVyKSB7XG4gICAgIC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lvbiBsaW5lRW5kKCkge1xuICAgICAgICBpZiAoc2VnbWVudHMpIHtcbiAgICAgICAgICBsaW5lUG9pbnQoeF9fLCB5X18pO1xuICAgICAgICAgIGlmICh2X18gJiYgdl8pIGJ1ZmZlckxpc3RlbmVyLnJlam9pbigpO1xuICAgICAgICAgIHNlZ21lbnRzLnB1c2goYnVmZmVyTGlzdGVuZXIuYnVmZmVyKCkpO1xuICAgICAgICB9XG4gICAgICAgIGNsaXAucG9pbnQgPSBwb2ludDtcbiAgICAgICAgaWYgKHZfKSBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBsaW5lUG9pbnQoeCwgeSkge1xuICAgICAgICB4ID0gTWF0aC5tYXgoLWQzX2dlb19jbGlwRXh0ZW50TUFYLCBNYXRoLm1pbihkM19nZW9fY2xpcEV4dGVudE1BWCwgeCkpO1xuICAgICAgICB5ID0gTWF0aC5tYXgoLWQzX2dlb19jbGlwRXh0ZW50TUFYLCBNYXRoLm1pbihkM19nZW9fY2xpcEV4dGVudE1BWCwgeSkpO1xuICAgICAgICB2YXIgdiA9IHBvaW50VmlzaWJsZSh4LCB5KTtcbiAgICAgICAgaWYgKHBvbHlnb24pIHJpbmcucHVzaChbIHgsIHkgXSk7XG4gICAgICAgIGlmIChmaXJzdCkge1xuICAgICAgICAgIHhfXyA9IHgsIHlfXyA9IHksIHZfXyA9IHY7XG4gICAgICAgICAgZmlyc3QgPSBmYWxzZTtcbiAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh4LCB5KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKHYgJiYgdl8pIGxpc3RlbmVyLnBvaW50KHgsIHkpOyBlbHNlIHtcbiAgICAgICAgICAgIHZhciBsID0ge1xuICAgICAgICAgICAgICBhOiB7XG4gICAgICAgICAgICAgICAgeDogeF8sXG4gICAgICAgICAgICAgICAgeTogeV9cbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgYjoge1xuICAgICAgICAgICAgICAgIHg6IHgsXG4gICAgICAgICAgICAgICAgeTogeVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGNsaXBMaW5lKGwpKSB7XG4gICAgICAgICAgICAgIGlmICghdl8pIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChsLmEueCwgbC5hLnkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KGwuYi54LCBsLmIueSk7XG4gICAgICAgICAgICAgIGlmICghdikgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh2KSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh4LCB5KTtcbiAgICAgICAgICAgICAgY2xlYW4gPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgeF8gPSB4LCB5XyA9IHksIHZfID0gdjtcbiAgICAgIH1cbiAgICAgIHJldHVybiBjbGlwO1xuICAgIH07XG4gICAgZnVuY3Rpb24gY29ybmVyKHAsIGRpcmVjdGlvbikge1xuICAgICAgcmV0dXJuIGFicyhwWzBdIC0geDApIDwgzrUgPyBkaXJlY3Rpb24gPiAwID8gMCA6IDMgOiBhYnMocFswXSAtIHgxKSA8IM61ID8gZGlyZWN0aW9uID4gMCA/IDIgOiAxIDogYWJzKHBbMV0gLSB5MCkgPCDOtSA/IGRpcmVjdGlvbiA+IDAgPyAxIDogMCA6IGRpcmVjdGlvbi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IHtcbiAgICAgICAgaWYgKGx4ID4gcngpIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6ICh5MCAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTBcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS55ID49IHkxKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiAoeTEgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkxXG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6ICh5MSAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTFcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS55IDwgeTApIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6ICh5MCAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTBcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAobHkgPCByeSkge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogeDAsXG4gICAgICAgICAgICB5OiBmbSAqIHgwICsgZmJcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS54ID49IHgxKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiB4MSxcbiAgICAgICAgICAgIHk6IGZtICogeDEgKyBmYlxuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiB4MSxcbiAgICAgICAgICAgIHk6IGZtICogeDEgKyBmYlxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnggPCB4MCkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogeDAsXG4gICA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nRlciA9IHBhcmVudDtcbiAgICAgICAgICAgICAgcGFyZW50ID0gYWZ0ZXIuVTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmVudC5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBncmFuZHBhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdW5jbGUgPSBncmFuZHBhLkw7XG4gICAgICAgICAgaWYgKHVuY2xlICYmIHVuY2xlLkMpIHtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdW5jbGUuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZ3JhbmRwYS5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGFmdGVyID0gZ3JhbmRwYTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGFmdGVyID09PSBwYXJlbnQuTCkge1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICAgIGFmdGVyID0gcGFyZW50O1xuICAgICAgICAgICAgICBwYXJlbnQgPSBhZnRlci5VO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGFyZW50LkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgZ3JhbmRwYSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHBhcmVudCA9IGFmdGVyLlU7XG4gICAgICB9XG4gICAgICB0aGlzLl8uQyA9IGZhbHNlO1xuICAgIH0sXG4gICAgcmVtb3ZlOiBmdW5jdGlvbihub2RlKSB7XG4gICAgICBpZiAobm9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1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZWQgPSBub2RlLkM7XG4gICAgICAgIG5vZGUgPSBuZXh0O1xuICAgICAgfVxuICAgICAgaWYgKG5vZGUpIG5vZGUuVSA9IHBhcmVudDtcbiAgICAgIGlmIChyZWQpIHJldHVybjtcbiAgICAgIGlmIChub2RlICYmIG5vZGUuQykge1xuICAgICAgICBub2RlLkMgPSBmYWxzZTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgZG8ge1xuICAgICAgICBpZiAobm9kZSA9PT0gdGhpcy5fKSBicmVhaztcbiAgICAgICAgaWYgKG5vZGUgPT09IHBhcmVudC5MKSB7XG4gICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgIGlmIChzaWJsaW5nLkMpIHtcbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IGZhbHNlO1xuICAgICAgICAgICAgcGFyZW50LkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzaWJsaW5nLkwgJiYgc2libGluZy5MLkMgfHwgc2libGluZy5SICYmIHNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICBpZiAoIXNpYmxpbmcuUiB8fCAhc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgICAgc2libGluZy5MLkMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBzaWJsaW5nKTtcbiAgICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2libGluZy5DID0gcGFyZW50LkM7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHNpYmxpbmcuUi5DID0gZmFsc2U7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIG5vZGUgPSB0aGlzLl87XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgIGlmIChzaWJsaW5nLkMpIHtcbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IGZhbHNlO1xuICAgICAgICAgICAgcGFyZW50LkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc2libGluZy5MICYmIHNpYmxpbmcuTC5DIHx8IHNpYmxpbmcuUiAmJiBzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgaWYgKCFzaWJsaW5nLkwgfHwgIXNpYmxpbmcuTC5DKSB7XG4gICAgICAgICAgICAgIHNpYmxpbmcuUi5DID0gZmFsc2U7XG4gICAgICAgICAgICAgIHNpYmxpbmcuQyA9IHRydWU7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBzaWJsaW5nKTtcbiAgICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2libGluZy5DID0gcGFyZW50LkM7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHNpYmxpbmcuTC5DID0gZmFsc2U7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmV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cbiAgICAgICAgICBkLnNvcnQoZnVuY3Rpb24oYSwgYikge1xuICAgICAgICAgICAgcmV0dXJuIHNvcnRTdWJncm91cHMobWF0cml4W2ldW2FdLCBtYXRyaXhbaV1bYl0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGsgPSAoz4QgLSBwYWRkaW5nICogbikgLyBrO1xuICAgICAgeCA9IDAsIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIHgwID0geCwgaiA9IC0xO1xuICAgICAgICB3aGlsZSAoKytqIDwgbikge1xuICAgICAgICAgIHZhciBkaSA9IGdyb3VwSW5kZXhbaV0sIGRqID0gc3ViZ3JvdXBJbmRleFtkaV1bal0sIHYgPSBtYXRyaXhbZGldW2RqXSwgYTAgPSB4LCBhMSA9IHggKz0gdiAqIGs7XG4gICAgICAgICAgc3ViZ3JvdXBzW2RpICsgXCItXCIgKyBkal0gPSB7XG4gICAgICAgICAgICBpbmRleDogZGksXG4gICAgICAgICAgICBzdWJpbmRleDogZGosXG4gICAgICAgICAgICBzdGFydEFuZ2xlOiBhMCxcbiAgICAgICAgICAgIGVuZEFuZ2xlOiBhMSxcbiAgICAgICAgICAgIHZhbHVlOiB2XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBncm91cHNbZGldID0ge1xuICAgICAgICAgIGluZGV4OiBkaSxcbiAgICAgICAgICBzdGFydEFuZ2xlOiB4MCxcbiAgICAgICAgICBlbmRBbmdsZTogeCxcbiAgICAgICAgICB2YWx1ZTogZ3JvdXBTdW1zW2RpXVxuICAgICAgICB9O1xuICAgICAgICB4ICs9IHBhZGRpbmc7XG4gICAgICB9XG4gICAgICBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBqID0gaSAtIDE7XG4gICAgICAgIHdoaWxlICgrK2ogPCBuKSB7XG4gICAgICAgICAgdmFyIHNvdXJjZSA9IHN1Ymd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HF1YWQucG9pbnQgJiYgZG4gJiYgZG4gPCBjaGFyZ2VEaXN0YW5jZTIpIHtcbiAgICAgICAgICAgIHZhciBrID0gcXVhZC5wb2ludENoYXJnZSAvIGRuO1xuICAgICAgICAgICAgbm9kZS5weCAtPSBkeCAqIGs7XG4gICAgICAgICAgICBub2RlLnB5IC09IGR5ICogaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICFxdWFkLmNoYXJnZTtcbiAgICAgIH07XG4gICAgfVxuICAgIGZvcmNlLnRpY2sgPSBmdW5jdGlvbigpIHtcbiAgICAgIGlmICgoYWxwaGEgKj0gLjk5KSA8IC4wMDUpIHtcbiAgICAgICAgdGltZXIgPSBudWxsO1xuICAgICAgICBldmVudC5lbmQoe1xuICAgICAgICAgIHR5cGU6IFwiZW5kXCIsXG4gICAgICAgICAgYWxwaGE6IGFscGhhID0gMFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9XG4gICAgICB2YXIgbiA9IG5vZGVzLmxlbmd0aCwgbSA9IGxpbmtzLmxlbmd0aCwgcSwgaSwgbywgcywgdCwgbCwgaywgeCwgeTtcbiAgICAgIGZvciAoaSA9IDA7IGkgPCBtOyArK2kpIHtcbiAgICAgICAgbyA9IGxpbmtzW2ldO1xuICAgICAgICBzID0gby5zb3VyY2U7XG4gICAgICAgIHQgPSBvLnRhcmdldDtcbiAgICAgICAgeCA9IHQueCAtIHMueDtcbiAgICAgICAgeSA9IHQueSAtIHMueTtcbiAgICAgICAgaWYgKGwgPSB4ICogeCArIHkgKiB5KSB7XG4gICAgICAgICAgbCA9IGFscGhhICogc3RyZW5ndGhzW2ldICogKChsID0gTWF0aC5zcXJ0KGwpKSAtIGRpc3RhbmNlc1tpXSkgLyBsO1xuICAgICAgICAgIHggKj0gbDtcbiAgICAgICAgICB5ICo9IGw7XG4gICAgICAgICAgdC54IC09IHggKiAoayA9IHMud2VpZ2h0ICsgdC53ZWlnaHQgPyBzLndlaWdodCAvIChzLndlaWdodCArIHQud2VpZ2h0KSA6IC41KTtcbiAgICAgICAgICB0LnkgLT0geSAqIGs7XG4gICAgICAgICAgcy54ICs9IHggKiAoayA9IDEgLSBrKTtcbiAgICAgICAgICBzLnkgKz0geSAqIGs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChrID0gYWxwaGEgKiBncmF2aXR5KSB7XG4gICAgICAgIHggPSBzaXplWzBdIC8gMjtcbiAgICAgICAgeSA9IHNpemVbMV0gLyAyO1xuICAgICAgICBpID0gLTE7XG4gICAgICAgIGlmIChrKSB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSBub2Rlc1tpXTtcbiAgICAgICAgICBvLnggKz0gKHggLSBvLngpICogaztcbiAgICAgICAgICBvLnkgKz0gKHkgLSBvLnkpICogaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGNoYXJnZSkge1xuICAgICAgICBkM19sYXlvdXRfZm9yY2VBY2N1bXVsYXRlKHEgPSBkMy5nZW9tLnF1YWR0cmVlKG5vZGVzKSwgYWxwaGEsIGNoYXJnZXMpO1xuICAgICAgICBpID0gLTE7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgaWYgKCEobyA9IG5vZGVzW2ldKS5maXhlZCkge1xuICAgICAgICAgICAgcS52aXNpdChyZXB1bHNlKG8pKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIG8gPSBub2Rlc1tpXTtcbiAgICAgICAgaWYgKG8uZml4ZWQpIHtcbiAgICAgICAgICBvLnggPSBvLnB4O1xuICAgICAgICAgIG8ueSA9IG8ucHk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgby54IC09IChvLnB4IC0gKG8ucHggPSBvLngpKSAqIGZyaWN0aW9uO1xuICAgICAgICAgI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YTtcbiAgfVxuICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja0ludGVyc2VjdHMoYSwgYikge1xuICAgIHZhciBkeCA9IGIueCAtIGEueCwgZHkgPSBiLnkgLSBhLnksIGRyID0gYS5yICsgYi5yO1xuICAgIHJldHVybiAuOTk5ICogZHIgKiBkciA+IGR4ICogZHggKyBkeSAqIGR5O1xuICB9XG4gIGZ1bmN0aW9uIGQzX2xheW91dF9wYWNrU2libGluZ3Mobm9kZSkge1xuICAgIGlmICghKG5vZGVzID0gbm9kZS5jaGlsZHJlbikgfHwgIShuID0gbm9kZXMubGVuZ3RoKSkgcmV0dXJuO1xuICAgIHZhciBub2RlcywgeE1pbiA9IEluZmluaXR5LCB4TWF4ID0gLUluZmluaXR5LCB5TWluID0gSW5maW5pdHksIHlNYXggPSAtSW5maW5pdHksIGEsIGIsIGMsIGksIGosIGssIG47XG4gICAgZnVuY3Rpb24gYm91bmQobm9kZSkge1xuICAgICAgeE1pbiA9IE1hdGgubWluKG5vZGUueCAtIG5vZGUuciwgeE1pbik7XG4gICAgICB4TWF4ID0gTWF0aC5tYXgobm9kZS54ICsgbm9kZS5yLCB4TWF4KTtcbiAgICAgIHlNaW4gPSBNYXRoLm1pbihub2RlLnkgLSBub2RlLnIsIHlNaW4pO1xuICAgICAgeU1heCA9IE1hdGgubWF4KG5vZGUueSArIG5vZGUuciwgeU1heCk7XG4gICAgfVxuICAgIG5vZGVzLmZvckVhY2goZDNfbGF5b3V0X3BhY2tMaW5rKTtcbiAgICBhID0gbm9kZXNbMF07XG4gICAgYS54ID0gLWEucjtcbiAgICBhLnkgPSAwO1xuICAgIGJvdW5kKGEpO1xuICAgIGlmIChuID4gMSkge1xuICAgICAgYiA9IG5vZGVzWzFdO1xuICAgICAgYi54ID0gYi5yO1xuICAgICAgYi55ID0gMDtcbiAgICAgIGJvdW5kKGIpO1xuICAgICAgaWYgKG4gPiAyKSB7XG4gICAgICAgIGMgPSBub2Rlc1syXTtcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tQbGFjZShhLCBiLCBjKTtcbiAgICAgICAgYm91bmQoYyk7XG4gICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGEsIGMpO1xuICAgICAgICBhLl9wYWNrX3ByZXYgPSBjO1xuICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChjLCBiKTtcbiAgICAgICAgYiA9IGEuX3BhY2tfbmV4dDtcbiAgICAgICAgZm9yIChpID0gMzsgaSA8IG47IGkrKykge1xuICAgICAgICAgIGQzX2xheW91dF9wYWNrUGxhY2UoYSwgYiwgYyA9IG5vZGVzW2ldKTtcbiAgICAgICAgICB2YXIgaXNlY3QgPSAwLCBzMSA9IDEsIHMyID0gMTtcbiAgICAgICAgICBmb3IgKGogPSBiLl9wYWNrX25leHQ7IGogIT09IGI7IGogPSBqLl9wYWNrX25leHQsIHMxKyspIHtcbiAgICAgICAgICAgIGlmIChkM19sYXlvdXRfcGFja0ludGVyc2VjdHMoaiwgYykpIHtcbiAgICAgICAgICAgICAgaXNlY3QgPSAxO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzZWN0ID09IDEpIHtcbiAgICAgICAgICAgIGZvciAoayA9IGEuX3BhY2tfcHJldjsgayAhPT0gai5fcGFja19wcmV2OyBrID0gay5fcGFja19wcmV2LCBzMisrKSB7XG4gICAgICAgICAgICAgIGlmIChkM19sYXlvdXRfcGFja0ludGVyc2VjdHMoaywgYykpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNlY3QpIHtcbiAgICAgICAgICAgIGlmIChzMSA8IHMyIHx8IHMxID09IHMyICYmIGIuciA8IGEucikgZDNfbGF5b3V0X3BhY2tTcGxpY2UoYSwgYiA9IGopOyBlbHNlIGQzX2xheW91dF9wYWNrU3BsaWNlKGEgP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kgKiBreDtcbiAgICAgICAgICBub2RlLnkgPSBub2RlLmRlcHRoICoga3k7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgcmV0dXJuIG5vZGVzO1xuICAgIH1cbiAgICBmdW5jdGlvbiB3cmFwVHJlZShyb290MCkge1xuICAgICAgdmFyIHJvb3QxID0ge1xuICAgICAgICBBOiBudWxsLFxuICAgICAgICBjaGlsZHJlbjogWyByb290MCBdXG4gICAgICB9LCBxdWV1ZSA9IFsgcm9vdDEgXSwgbm9kZTE7XG4gICAgICB3aGlsZSAoKG5vZGUxID0gcXVldWUucG9wKCkpICE9IG51bGwpIHtcbiAgICAgICAgZm9yICh2YXIgY2hpbGRyZW4gPSBub2RlMS5jaGlsZHJlbiwgY2hpbGQsIGkgPSAwLCBuID0gY2hpbGRyZW4ubGVuZ3RoOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgcXVldWUucHVzaCgoY2hpbGRyZW5baV0gPSBjaGlsZCA9IHtcbiAgICAgICAgICAgIF86IGNoaWxkcmVuW2ldLFxuICAgICAgICAgICAgcGFyZW50OiBub2RlMSxcbiAgICAgICAgICAgIGNoaWxkcmVuOiAoY2hpbGQgPSBjaGlsZHJlbltpXS5jaGlsZHJlbikgJiYgY2hpbGQuc2xpY2UoKSB8fCBbXSxcbiAgICAgICAgICAgIEE6IG51bGwsXG4gICAgICAgICAgICBhOiBudWxsLFxuICAgICAgICAgICAgejogMCxcbiAgICAgICAgICAgIG06IDAsXG4gICAgICAgICAgICBjOiAwLFxuICAgICAgICAgICAgczogMCxcbiAgICAgICAgICAgIHQ6IG51bGwsXG4gICAgICAgICAgICBpOiBpXG4gICAgICAgICAgfSkuYSA9IGNoaWxkKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHJvb3QxLmNoaWxkcmVuWzBdO1xuICAgIH1cbiAgICBmdW5jdGlvbiBmaXJzdFdhbGsodikge1xuICAgICAgdmFyIGNoaWxkcmVuID0gdi5jaGlsZHJ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mlnaHQodmltKSwgdmlwID0gZDNfbGF5b3V0X3RyZWVMZWZ0KHZpcCksIHZpbSAmJiB2aXApIHtcbiAgICAgICAgICB2b20gPSBkM19sYXlvdXRfdHJlZUxlZnQodm9tKTtcbiAgICAgICAgICB2b3AgPSBkM19sYXlvdXRfdHJlZVJpZ2h0KHZvcCk7XG4gICAgICAgICAgdm9wLmEgPSB2O1xuICAgICAgICAgIHNoaWZ0ID0gdmltLnogKyBzaW0gLSB2aXAueiAtIHNpcCArIHNlcGFyYXRpb24odmltLl8sIHZpcC5fKTtcbiAgICAgICAgICBpZiAoc2hpZnQgPiAwKSB7XG4gICAgICAgICAgICBkM19sYXlvdXRfdHJlZU1vdmUoZDNfbGF5b3V0X3RyZWVBbmNlc3Rvcih2aW0sIHYsIGFuY2VzdG9yKSwgdiwgc2hpZnQpO1xuICAgICAgICAgICAgc2lwICs9IHNoaWZ0O1xuICAgICAgICAgICAgc29wICs9IHNoaWZ0O1xuICAgICAgICAgIH1cbiAgICAgICAgICBzaW0gKz0gdmltLm07XG4gICAgICAgICAgc2lwICs9IHZpcC5tO1xuICAgICAgICAgIHNvbSArPSB2b20ubTtcbiAgICAgICAgICBzb3AgKz0gdm9wLm07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZpbSAmJiAhZDNfbGF5b3V0X3RyZWVSaWdodCh2b3ApKSB7XG4gICAgICAgICAgdm9wLnQgPSB2aW07XG4gICAgICAgICAgdm9wLm0gKz0gc2ltIC0gc29wO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2aXAgJiYgIWQzX2xheW91dF90cmVlTGVmdCh2b20pKSB7XG4gICAgICAgICAgdm9tLnQgPSB2aXA7XG4gICAgICAgICAgdm9tLm0gKz0gc2lwIC0gc29tO1xuICAgICAgICAgIGFuY2VzdG9yID0gdjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIGFuY2VzdG9yO1xuICAgIH1cbiAgICBmdW5jdGlvbiBzaXplTm9kZShub2RlK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lbWFpbmluZywgcmVjdC5keCAqIHJlY3QuZHkgLyBub2RlLnZhbHVlKTtcbiAgICAgICAgcm93LmFyZWEgPSAwO1xuICAgICAgICB3aGlsZSAoY2hpbGQgPSByZW1haW5pbmcucG9wKCkpIHtcbiAgICAgICAgICByb3cucHVzaChjaGlsZCk7XG4gICAgICAgICAgcm93LmFyZWEgKz0gY2hpbGQuYXJlYTtcbiAgICAgICAgICBpZiAoY2hpbGQueiAhPSBudWxsKSB7XG4gICAgICAgICAgICBwb3NpdGlvbihyb3csIGNoaWxkLnogPyByZWN0LmR4IDogcmVjdC5keSwgcmVjdCwgIXJlbWFpbmluZy5sZW5ndGgpO1xuICAgICAgICAgICAgcm93Lmxlbmd0aCA9IHJvdy5hcmVhID0gMDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY2hpbGRyZW4uZm9yRWFjaChzdGlja2lmeSk7XG4gICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIHdvcnN0KHJvdywgdSkge1xuICAgICAgdmFyIHMgPSByb3cuYXJlYSwgciwgcm1heCA9IDAsIHJtaW4gPSBJbmZpbml0eSwgaSA9IC0xLCBuID0gcm93Lmxlbmd0aDtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGlmICghKHIgPSByb3dbaV0uYXJlYSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAociA8IHJtaW4pIHJtaW4gPSByO1xuICAgICAgICBpZiAociA+IHJtYXgpIHJtYXggPSByO1xuICAgICAgfVxuICAgICAgcyAqPSBzO1xuICAgICAgdSAqPSB1O1xuICAgICAgcmV0dXJuIHMgPyBNYXRoLm1heCh1ICogcm1heCAqIHJhdGlvIC8gcywgcyAvICh1ICogcm1pbiAqIHJhdGlvKSkgOiBJbmZpbml0eTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcG9zaXRpb24ocm93LCB1LCByZWN0LCBmbHVzaCkge1xuICAgICAgdmFyIGkgPSAtMSwgbiA9IHJvdy5sZW5ndGgsIHggPSByZWN0LngsIHkgPSByZWN0LnksIHYgPSB1ID8gcm91bmQocm93LmFyZWEgLyB1KSA6IDAsIG87XG4gICAgICBpZiAodSA9PSByZWN0LmR4KSB7XG4gICAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keSkgdiA9IHJlY3QuZHk7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IHJvd1tpXTtcbiAgICAgICAgICBvLnggPSB4O1xuICAgICAgICAgIG8ueSA9IHk7XG4gICAgICAgICAgby5keSA9IHY7XG4gICAgICAgICAgeCArPSBvLmR4ID0gTWF0aC5taW4ocmVjdC54ICsgcmVjdC5keCAtIHgsIHYgPyByb3VuZChvLmFyZWEgLyB2KSA6IDApO1xuICAgICAgICB9XG4gICAgICAgIG8ueiA9IHRydWU7XG4gICAgICAgIG8uZHggKz0gcmVjdC54ICsgcmVjdC5keCAtIHg7XG4gICAgICAgIHJlY3QueSArPSB2O1xuICAgICAgICByZWN0LmR5IC09IHY7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoZmx1c2ggfHwgdiA+IHJlY3QuZHgpIHYgPSByZWN0LmR4O1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSByb3dbaV07XG4gICAgICAgICAgby54ID0geDtcbiAgICAgICAgICBvLnkgPSB5O1xuICAgICAgICAgIG8uZHggPSB2O1xuICAgICAgICAgIHkgKz0gby5keSA9IE1hdGgubWluKHJlY3QueSArIHJlY3QuZHkgLSB5LCB2ID8gcm91bmQoby5hcmVhIC8gdikgOiAwKTtcbiAgICAgICAgfVxuICAgICAgICBvLnogPSBmYWxzZTtcbiAgICAgICAgby5keSArPSByZWN0LnkgKyByZWN0LmR5IC0geTtcbiAgICAgICAgcmVjdC54ICs9IHY7XG4gICAgICAgIHJlY3QuZHggLT0gdjtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gdHJlZW1hc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rpb24oKSB7XG4gICAgICAgIHZhciB4LCB5LCByO1xuICAgICAgICBkbyB7XG4gICAgICAgICAgeCA9IE1hdGgucmFuZG9tKCkgKiAyIC0gMTtcbiAgICAgICAgICB5ID0gTWF0aC5yYW5kb20oKSAqIDIgLSAxO1xuICAgICAgICAgIHIgPSB4ICogeCArIHkgKiB5O1xuICAgICAgICB9IHdoaWxlICghciB8fCByID4gMSk7XG4gICAgICAgIHJldHVybiDCtSArIM+DICogeCAqIE1hdGguc3FydCgtMiAqIE1hdGgubG9nKHIpIC8gcik7XG4gICAgICB9O1xuICAgIH0sXG4gICAgbG9nTm9ybWFsOiBmdW5jdGlvbigpIHtcbiAgICAgIHZhciByYW5kb20gPSBkMy5yYW5kb20ubm9ybWFsLmFwcGx5KGQzLCBhcmd1bWVudHMpO1xuICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gTWF0aC5leHAocmFuZG9tKCkpO1xuICAgICAgfTtcbiAgICB9LFxuICAgIGJhdGVzOiBmdW5jdGlvbihtKSB7XG4gICAgICB2YXIgcmFuZG9tID0gZDMucmFuZG9tLmlyd2luSGFsbChtKTtcbiAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIHJhbmRvbSgpIC8gbTtcbiAgICAgIH07XG4gICAgfSxcbiAgICBpcndpbkhhbGw6IGZ1bmN0aW9uKG0pIHtcbiAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgZm9yICh2YXIgcyA9IDAsIGogPSAwOyBqIDwgbTsgaisrKSBzICs9IE1hdGgucmFuZG9tKCk7XG4gICAgICAgIHJldHVybiBzO1xuICAgICAgfTtcbiAgICB9XG4gIH07XG4gIGQzLnNjYWxlID0ge307XG4gIGZ1bmN0aW9uIGQzX3NjYWxlRXh0ZW50KGRvbWFpbikge1xuICAgIHZhciBzdGFydCA9IGRvbWFpblswXSwgc3RvcCA9IGRvbWFpbltkb21haW4ubGVuZ3Ro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yZ3VtZW50cy5sZW5ndGgpIHJldHVybiBiYXNlO1xuICAgICAgYmFzZSA9ICtfO1xuICAgICAgbGluZWFyLmRvbWFpbihkb21haW4ubWFwKGxvZykpO1xuICAgICAgcmV0dXJuIHNjYWxlO1xuICAgIH07XG4gICAgc2NhbGUubmljZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgdmFyIG5pY2VkID0gZDNfc2NhbGVfbmljZShkb21haW4ubWFwKGxvZyksIHBvc2l0aXZlID8gTWF0aCA6IGQzX3NjYWxlX2xvZ05pY2VOZWdhdGl2ZSk7XG4gICAgICBsaW5lYXIuZG9tYWluKG5pY2VkKTtcbiAgICAgIGRvbWFpbiA9IG5pY2VkLm1hcChwb3cpO1xuICAgICAgcmV0dXJuIHNjYWxlO1xuICAgIH07XG4gICAgc2NhbGUudGlja3MgPSBmdW5jdGlvbigpIHtcbiAgICAgIHZhciBleHRlbnQgPSBkM19zY2FsZUV4dGVudChkb21haW4pLCB0aWNrcyA9IFtdLCB1ID0gZXh0ZW50WzBdLCB2ID0gZXh0ZW50WzFdLCBpID0gTWF0aC5mbG9vcihsb2codSkpLCBqID0gTWF0aC5jZWlsKGxvZyh2KSksIG4gPSBiYXNlICUgMSA/IDIgOiBiYXNlO1xuICAgICAgaWYgKGlzRmluaXRlKGogLSBpKSkge1xuICAgICAgICBpZiAocG9zaXRpdmUpIHtcbiAgICAgICAgICBmb3IgKDtpIDwgajsgaSsrKSBmb3IgKHZhciBrID0gMTsgayA8IG47IGsrKykgdGlja3MucHVzaChwb3coaSkgKiBrKTtcbiAgICAgICAgICB0aWNrcy5wdXNoKHBvdyhpKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGlja3MucHVzaChwb3coaSkpO1xuICAgICAgICAgIGZvciAoO2krKyA8IGo7ICkgZm9yICh2YXIgayA9IG4gLSAxOyBrID4gMDsgay0tKSB0aWNrcy5wdXNoKHBvdyhpKSAqIGspO1xuICAgICAgICB9XG4gICAgICAgIGZvciA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dLCBkLCBhLCBiLCBzLCBtID0gZDNfc3ZnX2xpbmVGaW5pdGVEaWZmZXJlbmNlcyhwb2ludHMpLCBpID0gLTEsIGogPSBwb2ludHMubGVuZ3RoIC0gMTtcbiAgICB3aGlsZSAoKytpIDwgaikge1xuICAgICAgZCA9IGQzX3N2Z19saW5lU2xvcGUocG9pbnRzW2ldLCBwb2ludHNbaSArIDFdKTtcbiAgICAgIGlmIChhYnMoZCkgPCDOtSkge1xuICAgICAgICBtW2ldID0gbVtpICsgMV0gPSAwO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYSA9IG1baV0gLyBkO1xuICAgICAgICBiID0gbVtpICsgMV0gLyBkO1xuICAgICAgICBzID0gYSAqIGEgKyBiICogYjtcbiAgICAgICAgaWYgKHMgPiA5KSB7XG4gICAgICAgICAgcyA9IGQgKiAzIC8gTWF0aC5zcXJ0KHMpO1xuICAgICAgICAgIG1baV0gPSBzICogYTtcbiAgICAgICAgICBtW2kgKyAxXSA9IHMgKiBiO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGkgPSAtMTtcbiAgICB3aGlsZSAoKytpIDw9IGopIHtcbiAgICAgIHMgPSAocG9pbnRzW01hdGgubWluKGosIGkgKyAxKV1bMF0gLSBwb2ludHNbTWF0aC5tYXgoMCwgaSAtIDEpXVswXSkgLyAoNiAqICgxICsgbVtpXSAqIG1baV0pKTtcbiAgICAgIHRhbmdlbnRzLnB1c2goWyBzIHx8IDAsIG1baV0gKiBzIHx8IDAgXSk7XG4gICAgfVxuICAgIHJldHVybiB0YW5nZW50cztcbiAgfVxuICBmdW5jdGlvbiBkM19zdmdfbGluZU1vbm90b25lKHBvaW50cykge1xuICAgIHJldHVybiBwb2ludHMubGVuZ3RoIDwgMyA/IGQzX3N2Z19saW5lTGluZWFyKHBvaW50cykgOiBwb2ludHNbMF0gKyBkM19zdmdfbGluZUhlcm1pdGUocG9pbnRzLCBkM19zdmdfbGluZU1vbm90b25lVGFuZ2VudHMoc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YWwoZCwgaSkge1xuICAgICAgdmFyIHAwID0gc291cmNlLmNhbGwodGhpcywgZCwgaSksIHAzID0gdGFyZ2V0LmNhbGwodGhpcywgZCwgaSksIG0gPSAocDAueSArIHAzLnkpIC8gMiwgcCA9IFsgcDAsIHtcbiAgICAgICAgeDogcDAueCxcbiAgICAgICAgeTogbVxuICAgICAgfSwge1xuICAgICAgICB4OiBwMy54LFxuICAgICAgICB5OiBtXG4gICAgICB9LCBwMyBdO1xuICAgICAgcCA9IHAubWFwKHByb2plY3Rpb24pO1xuICAgICAgcmV0dXJuIFwiTVwiICsgcFswXSArIFwiQ1wiICsgcFsxXSArIFwiIFwiICsgcFsyXSArIFwiIFwiICsgcFszXTtcbiAgICB9XG4gICAgZGlhZ29uYWwuc291cmNlID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc291cmNlO1xuICAgICAgc291cmNlID0gZDNfZnVuY3Rvcih4KTtcbiAgICAgIHJldHVybiBkaWFnb25hbDtcbiAgICB9O1xuICAgIGRpYWdvbmFsLnRhcmdldCA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRhcmdldDtcbiAgICAgIHRhcmdldCA9IGQzX2Z1bmN0b3IoeCk7XG4gICAgICByZXR1cm4gZGlhZ29uYWw7XG4gICAgfTtcbiAgICBkaWFnb25hbC5wcm9qZWN0aW9uID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcHJvamVjdGlvbjtcbiAgICAgIHByb2plY3Rpb24gPSB4O1xuICAgICAgcmV0dXJuIGRpYWdvbmFsO1xuICAgIH07XG4gICAgcmV0dXJuIGRpYWdvbmFsO1xuICB9O1xuICBmdW5jdGlvbiBkM19zdmdfZGlhZ29uYWxQcm9qZWN0aW9uKGQpIHtcbiAgICByZXR1cm4gWyBkLngsIGQueS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leHRlbnQxO1xuICAgICAgICBpZiAoZDNfdHJhbnNpdGlvbkluaGVyaXRJZCkge1xuICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS50cmFuc2l0aW9uKCkuZWFjaChcInN0YXJ0LmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IGV4dGVudDAuaTtcbiAgICAgICAgICAgIHlFeHRlbnREb21haW4gPSBleHRlbnQwLmo7XG4gICAgICAgICAgICB4RXh0ZW50ID0gZXh0ZW50MC54O1xuICAgICAgICAgICAgeUV4dGVudCA9IGV4dGVudDAueTtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hzdGFydFwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KS50d2VlbihcImJydXNoOmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIHhpID0gZDNfaW50ZXJwb2xhdGVBcnJheSh4RXh0ZW50LCBleHRlbnQxLngpLCB5aSA9IGQzX2ludGVycG9sYXRlQXJyYXkoeUV4dGVudCwgZXh0ZW50MS55KTtcbiAgICAgICAgICAgIHhFeHRlbnREb21haW4gPSB5RXh0ZW50RG9tYWluID0gbnVsbDtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbih0KSB7XG4gICAgICAgICAgICAgIHhFeHRlbnQgPSBleHRlbnQxLnggPSB4aSh0KTtcbiAgICAgICAgICAgICAgeUV4dGVudCA9IGV4dGVudDEueSA9IHlpKHQpO1xuICAgICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hcIixcbiAgICAgICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KS5lYWNoKFwiZW5kLmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IGV4dGVudDEuaTtcbiAgICAgICAgICAgIHlFeHRlbnREb21haW4gPSBleHRlbnQxLmo7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICAgIG1vZGU6IFwicmVzaXplXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaGVuZFwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaHN0YXJ0XCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgIH0pO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoZW5kXCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfTtcbiAgICBmdW5jdGlvbiByZWRyYXcoZykge1xuICAgICAgZy5zZWxlY3RBbGwoXCIucmVzaXplXCIpLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gXCJ0cmFuc2xhdGUoXCIgKyB4RXh0ZW50WysvZSQvLnRlc3QoZCldICsgXCIsXCIgKyB5RXh0ZW50WysvXnMvLnRlc3QoZCldICsgXCIpXCI7XG4gICAgICB9KTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmVkcmF3WChnKSB7XG4gICAgICBnLnNlbGVjdChcIi5leHRlbnRcIikuYXR0cihcInhcIiwgeEV4dGVudFswXSk7XG4gICAgICBnLnNlbGVjdEFsbChcIi5leHRlbnQsLm4+cmVjdCwucz5yZW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iAgICAgIH0pO1xuICAgICAgYnJ1c2htb3ZlKCk7XG4gICAgICBmdW5jdGlvbiBrZXlkb3duKCkge1xuICAgICAgICBpZiAoZDMuZXZlbnQua2V5Q29kZSA9PSAzMikge1xuICAgICAgICAgIGlmICghZHJhZ2dpbmcpIHtcbiAgICAgICAgICAgIGNlbnRlciA9IG51bGw7XG4gICAgICAgICAgICBvcmlnaW5bMF0gLT0geEV4dGVudFsxXTtcbiAgICAgICAgICAgIG9yaWdpblsxXSAtPSB5RXh0ZW50WzFdO1xuICAgICAgICAgICAgZHJhZ2dpbmcgPSAyO1xuICAgICAgICAgIH1cbiAgICAgICAgICBkM19ldmVudFByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGtleXVwKCkge1xuICAgICAgICBpZiAoZDMuZXZlbnQua2V5Q29kZSA9PSAzMiAmJiBkcmFnZ2luZyA9PSAyKSB7XG4gICAgICAgICAgb3JpZ2luWzBdICs9IHhFeHRlbnRbMV07XG4gICAgICAgICAgb3JpZ2luWzFdICs9IHlFeHRlbnRbMV07XG4gICAgICAgICAgZHJhZ2dpbmcgPSAwO1xuICAgICAgICAgIGQzX2V2ZW50UHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gYnJ1c2htb3ZlKCkge1xuICAgICAgICB2YXIgcG9pbnQgPSBkMy5tb3VzZSh0YXJnZXQpLCBtb3ZlZCA9IGZhbHNlO1xuICAgICAgICBpZiAob2Zmc2V0KSB7XG4gICAgICAgICAgcG9pbnRbMF0gKz0gb2Zmc2V0WzBdO1xuICAgICAgICAgIHBvaW50WzFdICs9IG9mZnNldFsxXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWRyYWdnaW5nKSB7XG4gICAgICAgICAgaWYgKGQzLmV2ZW50LmFsdEtleSkge1xuICAgICAgICAgICAgaWYgKCFjZW50ZXIpIGNlbnRlciA9IFsgKH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GlmIChkcmFnZ2luZykge1xuICAgICAgICAgIHIwIC09IHBvc2l0aW9uO1xuICAgICAgICAgIHIxIC09IHNpemUgKyBwb3NpdGlvbjtcbiAgICAgICAgfVxuICAgICAgICBtaW4gPSAoaSA/IHlDbGFtcCA6IHhDbGFtcCkgPyBNYXRoLm1heChyMCwgTWF0aC5taW4ocjEsIHBvaW50W2ldKSkgOiBwb2ludFtpXTtcbiAgICAgICAgaWYgKGRyYWdnaW5nKSB7XG4gICAgICAgICAgbWF4ID0gKG1pbiArPSBwb3NpdGlvbikgKyBzaXplO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChjZW50ZXIpIHBvc2l0aW9uID0gTWF0aC5tYXgocjAsIE1hdGgubWluKHIxLCAyICogY2VudGVyW2ldIC0gbWluKSk7XG4gICAgICAgICAgaWYgKHBvc2l0aW9uIDwgbWluKSB7XG4gICAgICAgICAgICBtYXggPSBtaW47XG4gICAgICAgICAgICBtaW4gPSBwb3NpdGlvbjtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbWF4ID0gcG9zaXRpb247XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChleHRlbnRbMF0gIT0gbWluIHx8IGV4dGVudFsxXSAhPSBtYXgpIHtcbiAgICAgICAgICBpZiAoaSkgeUV4dGVudERvbWFpbiA9IG51bGw7IGVsc2UgeEV4dGVudERvbWFpbiA9IG51bGw7XG4gICAgICAgICAgZXh0ZW50WzBdID0gbWluO1xuICAgICAgICAgIGV4dGVudFsxXSA9IG1heDtcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gYnJ1c2hlbmQoKSB7XG4gICAgICAgIGJydXNobW92ZSgpO1xuICAgICAgICBnLnN0eWxlKFwicG9pbnRlci1ldmVudHNcIiwgXCJhbGxcIikuc2VsZWN0QWxsKFwiLnJlc2l6ZVwiKS5zdHlsZShcImRpc3B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51bGw7XG4gICAgICBpZiAoeCAmJiB5KSB4Q2xhbXAgPSAhIXpbMF0sIHlDbGFtcCA9ICEhelsxXTsgZWxzZSBpZiAoeCkgeENsYW1wID0gISF6OyBlbHNlIGlmICh5KSB5Q2xhbXAgPSAhIXo7XG4gICAgICByZXR1cm4gYnJ1c2g7XG4gICAgfTtcbiAgICBicnVzaC5leHRlbnQgPSBmdW5jdGlvbih6KSB7XG4gICAgICB2YXIgeDAsIHgxLCB5MCwgeTEsIHQ7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgaWYgKHgpIHtcbiAgICAgICAgICBpZiAoeEV4dGVudERvbWFpbikge1xuICAgICAgICAgICAgeDAgPSB4RXh0ZW50RG9tYWluWzBdLCB4MSA9IHhFeHRlbnREb21haW5bMV07XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHgwID0geEV4dGVudFswXSwgeDEgPSB4RXh0ZW50WzFdO1xuICAgICAgICAgICAgaWYgKHguaW52ZXJ0KSB4MCA9IHguaW52ZXJ0KHgwKSwgeDEgPSB4LmludmVydCh4MSk7XG4gICAgICAgICAgICBpZiAoeDEgPCB4MCkgdCA9IHgwLCB4MCA9IHgxLCB4MSA9IHQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh5KSB7XG4gICAgICAgICAgaWYgKHlFeHRlbnREb21haW4pIHtcbiAgICAgICAgICAgIHkwID0geUV4dGVudERvbWFpblswXSwgeTEgPSB5RXh0ZW50RG9tYWluWzFdO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB5MCA9IHlFeHRlbnRbMF0sIHkxID0geUV4dGVudFsxXTtcbiAgICAgICAgICAgIGlmICh5LmludmVydCkgeTAgPSB5LmludmVydCh5MCksIHkxID0geS5pbnZlcnQoeTEpO1xuICAgICAgICAgICAgaWYgKHkxIDwgeTApIHQgPSB5MCwgeTAgPSB5MSwgeTEgPSB0O1xuICAgICA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9pY2Vfbm8gfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IGJ1eWVyX2Z1bGxuYW1lIH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57eyBidXllcl9lbWFpbCB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgYnV5ZXJfcGhvbmUgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7Y3VycmVuY3l9fXt7IGFtb3VudCB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgb3JkZXJfZGF0ZSB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgaWQgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPlxuICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPlxuICAgICAgICAgICAgICAgICAge3sjaWYgYW1vdW50ID09PSAwfX1cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4+RnJlZSBvcmRlcjwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgIHt7ZWxzZX19XG4gICAgICAgICAgICAgICAgICAgIDxzcGFuPlBhaWQgb3JkZXI8L3NwYW4+XG4gICAgICAgICAgICAgICAgICB7ey9pZn19XG4gICAgICAgICAgICAgICAgPC9wPlxuICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+PGEgY2xhc3M9XCJib3hvZmZpY2UtYnV0dG9uIGJveG9mZmljZS1idXR0b24taW5mb1wiIGhy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PC9wPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJsaW5lLWl0ZW1zLXdyYXBwZXJcIj5cbiAgICAgICAgICAgICAgICAgIHt7I2xpbmVfaXRlbXM6bGluZV9pdGVtfX1cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRpY2tldCBjb2wtc20tNiBjb2wteHMtMTJcIiBpZD1cIml0ZW0te3sgQGluZGV4IH19XCI+XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImhlYWRpbmdcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0aWNrZXQtdHlwZVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD57eyB0aXRsZSB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250ZW50XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGVudC1ib3hcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5pZDo8L3NwYW4+IHt7IGlkIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPkJhc2UgYW1vdW50Ojwvc3Bhbj4ge3sgY3VycmVuY3kgfX17eyBiYXNlX2Ftb3VudCB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5EaXNjb3VudGVkIGFtb3VudDo8L3NwYW4+IHt7IGN1cnJlbmN5IH19e3sgZGlzY291bnRlZF9hbW91bnQgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsY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Y2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5QaG9uZTo8L3NwYW4+IHt7IHBob25lIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7I2RldGFpbHM6a2V5IH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPnt7IGtleSB9fTo8L3NwYW4+IHt7IC4gfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3tlbHNlfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48Yj5Ob3QgYXNzaWduZWQ8L2I+PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgICB7eyNjYW5jZWxfdGlja2V0X3VybCAmJiAhY2FuY2VsbGVkX2F0fX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJib3hvZmZpY2UtYnV0dG9uIGJveG9mZmljZS1idXR0b24tc21hbGwgYm94b2ZmaWNlLWJ1dHRvbi1pbmZvXCIgaHJlZj1cImphdmFzY3JpcHQ6dm9pZCgwKVwiIG9uLWNsaWNrPVwiY2FuY2VsVGlja2V0XCIge3sjY2FuY2VsbGluZ319ZGlzYWJsZWR7ey99fT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FuY2VsIHt7I2NhbmNlbGxpbmd9fTxpIGNsYXNzPVwiZmEgZmEtc3Bpbm5lciBmYS1zcGluXCI+PC9pPnt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHAgY2xhc3M9XCJlcnJvci1tc2cgbGVmdC1hbGlnbmVkXCI+e3tjYW5jZWxfZXJyb3J9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgIHt7L319XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAge3svc2hvd19vcmRlcn19XG4gICAgICAgICAge3svb3JkZXJzfX1cbiAgICAgICAgICA8L3Rib2R5PlxuICAgICAgICAgIDx0Zm9vdD5cbiAgICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgICAgPHRkIGNvbHNwYW49XCIxMFwiPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYWdpbmF0aW9uIHBhZ2luYXRpb24tY2VudGVyZWRcIj48L2Rpdj5cbiAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgIDwvdHI+XG4gICAgICAgICAgPC90Zm9vdD5cbiAgICAgICAgPC90YWJsZT5cbiAgICAgIDwvZGl2PlxuICAgIHt7ZWxzZX19XG4gICAgICA8cCBjbGFzcz1cInRleHQtY2VudGVyXCI+Q3VycmVudGx5IG5vIG9yZGVycy48L3A+XG4gICAge3svaWZ9fVxuICA8L2Rpdj5cbmBcbiIsIlxuZXhwb3J0IGNvbnN0IFJlcG9ydFRlbXBsYXRlID0gYFxuICA8ZGl2IGNsYXNzPVwiY29udGVudC13cmFwcGVyXCI+XG4gICAgPGgxIGNsYXNzPVwiaGVhZGVyXCI+e3sgdGl0bGUgfX08L2gxPlxuICAgIDxkaXYgY2xhc3M9XCJib3ggY29sLXNtLTYgY29sLXNtLW9mZnNldC0zIGNvbC14cy0xMlwiPlxuICAgICAgPGRpdiBjbGFzcz1cImhlYWRpbmdcIj5cbiAgICAgICAgPHAgY2xhc3M9XCJoZWFkaW5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gICAgIDx0aGVhZD5cbiAgICAgICAgICA8dHIgY2xhc3M9XCJpbmZvXCI+XG4gICAgICAgICAgICA8dGg+IzwvdGg+XG4gICAgICAgICAgICA8dGg+SXRlbTwvdGg+XG4gICAgICAgICAgICA8dGg+QXZhaWxhYmxlPC90aD5cbiAgICAgICAgICAgIDx0aD5Tb2xkPC90aD5cbiAgICAgICAgICAgIDx0aD5GcmVlPC90aD5cbiAgICAgICAgICAgIDx0aD5DYW5jZWxsZWQ8L3RoPlxuICAgICAgICAgICAgPHRoPkN1cnJlbnQgUHJpY2U8L3RoPlxuICAgICAgICAgICAgPHRoPk5ldCBTYWxlczwvdGg+XG4gICAgICAgICAgPC90cj5cbiAgICAgICAgPC90aGVhZD5cbiAgICAgICAgPHRib2R5PlxuICAgICAgICAgIHt7I2l0ZW1zfX1cbiAgICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgICAgPHRkPnt7IEBpbmRleCArIDEgfX08L3RkPlxuICAgICAgICAgICAgICA8dGQ+e3sgdGl0bGUgfX08L3RkPlxuICAgICAgICAgICAgICA8dGQ+e3sgYXZhaWxhYmxlIH19PC90ZD5cbiAgICAgICAgICAgICAgPHRkPnt7IHNvbGQgfX08L3RkPlxuICAgICAgICAgICAgICA8dGQ+e3sgZnJlZSB9fTwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD57eyBjYW5jZWxsZWQgfX08L3RkPlxuICAgICAgICAgICAgICA8dGQ+e3sgY3VycmVudF9wcmljZSB9fTwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD57eyBuZXRfc2FsZXMgfX08L3RkPlxuICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICB7ey99fVxuICAgICAgICA8L3Rib2R5PlxuICAgICAgPC90YWJsZT5cbiAgICA8L2Rpdj5cbiAgPC9kaXY+XG5gXG5cbmV4cG9ydCBjb25zdCBBZ2dDaGFydFRlbXBsYXRlID0gYFxuICA8ZGl2IGNsYXNzPVwiY2hhcnQtd3JhcHBlciBjYXJk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GNvbmZpZykge1xuXG4gICAgT3JkZXJNb2RlbC5mZXRjaCh7XG4gICAgICB1cmw6IE9yZGVyTW9kZWwudXJsRm9yKCdpbmRleCcsIHtpY19pZDogY29uZmlnLmlkfSlbJ3BhdGgnXVxuICAgIH0pLmRvbmUoKHJlbW90ZURhdGEpID0+IHtcbiAgICAgIC8vIEluaXRpYWwgcmVuZGVyXG4gICAgICBsZXQgbWFpbl9yYWN0aXZlID0gbmV3IFJhY3RpdmUoe1xuICAgICAgICBlbDogJyNtYWluLWNvbnRlbnQtYXJlYScsXG4gICAgICAgIHRlbXBsYXRlOiBPcmRlclRlbXBsYXRlLFxuICAgICAgICBkYXRhOiAge1xuICAgICAgICAgIHRpdGxlOiByZW1vdGVEYXRhLnRpdGxlLFxuICAgICAgICAgIG9yZGVyczogcmVtb3RlRGF0YS5vcmRlcnNcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIFNpZGVCYXJWaWV3LnJlbmRlcignb3JkZXJzJywgeydvcmdfbmFtZSc6IHJlbW90ZURhdGEub3JnX25hbWUsICdpY19pZCc6IGNvbmZpZy5pZH0pO1xuXG4gICAgICBOUHJvZ3Jlc3MuZG9uZSgpO1xuXG4gICAgICAkKCcjb3JkZXJzLXRhYmxlJykuZm9vdGFibGUoe1xuICAgICAgICBicmVha3BvaW50czoge1xuICAgICAgICAgIHBob25lOiA2MDAsXG4gICAgICAgICAgdGFibGV0OiA3NjgsXG4gICAgICAgICAgZGVza3RvcDogMTIwMCxcbiAgICAgICAgICBsYXJnZXNjcmVlbjogMTkwMFxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgJCgnI29yZGVycy10YWJsZScpLm9uKCdmb290YWJsZV9maWx0ZXJpbmcnLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICBsZXQgc2VsZWN0ZWQgPSAkKCcjZmlsdGVyLXN0YXR1cycpLmZpbmQoJzpzZWxlY3RlZCcpLnZhbCgpO1xuICAgICAgICBpZiAoc2VsZWN0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mFpbChmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGVycm9yX3RleHQ7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2UucmVhZHlTdGF0ZSA9PT0gNCkge1xuICAgICAgICAgICAgICBpZiAocmVzcG9uc2Uuc3RhdHVzID09PSA1MDApIHtcbiAgICAgICAgICAgICAgICBlcnJvcl90ZXh0ID0gXCJTZXJ2ZXIgRXJyb3JcIjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBlcnJvcl90ZXh0ID0gSlNPTi5wYXJzZShyZXNwb25zZS5yZXNwb25zZVRleHQpLmVycm9yX2Rlc2NyaXB0aW9uO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgZXJyb3JfdGV4dCA9IFwiVW5hYmxlIHRvIGNvbm5lY3QuIFBsZWFzZSB0cnkgYWdhaW4gbGF0ZXIuXCI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBtYWluX3JhY3RpdmUuc2V0KGV2ZW50LmtleXBhdGggKyAnLmNhbmNlbF9lcnJvcicsIGVycm9yX3RleHQpO1xuICAgICAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5jYW5jZWxsaW5nJywgZmFsc2UpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ3BvcHN0YXRlJywgKGV2ZW50KSA9PiB7XG4gICAgICAgIE5Qcm9ncmVzcy5jb25maWd1cmUoeyBzaG93U3Bpbm5lcjogZmFsc2V9KS5zdGFydCgpO1xuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cbn07XG4iLCJcbmltcG9ydCB7UmVwb3J0TW9kZWx9IGZyb20gJy4uL21vZGVscy9hZG1pbl9yZXBvcnQuanMnO1xu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IaWRlJzogZmFsc2UsXG4gICAgICAgICdzaWRlYmFyTW9iaWxlT24nOiBmYWxzZVxuICAgICAgfSk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgdGhpcy5pbml0KHZpZXcsIGljX2NvbmZpZyk7XG4gICAgfVxuICB9LFxuICBoaWRlOiBmdW5jdGlvbigpIHtcbiAgICBpZiAodGhpcy5vbikge1xuICAgICAgdGhpcy5yYWN0aXZlLnNldCgnc2lkZWJhckhpZGUnLCB0cnVlKTtcbiAgICB9XG4gIH1cbn07XG4iXX0= diff --git a/boxoffice/static/js/models/admin_report.js b/boxoffice/static/js/models/admin_report.js index 23f9c84e..596847e3 100644 --- a/boxoffice/static/js/models/admin_report.js +++ b/boxoffice/static/js/models/admin_report.js @@ -11,8 +11,8 @@ export const ReportModel = { 'relative_path': 'ic/' + config.ic_id + '/reports', 'method': 'GET' }, - 'orders': { - 'path': IndexModel.urlFor('index')['path'] + 'ic/' + config.ic_id + '/reports/order', + 'attendees': { + 'path': IndexModel.urlFor('index')['path'] + 'ic/' + config.ic_id + '/reports/attendee.csv', 'method': 'GET' } } diff --git a/boxoffice/static/js/templates/admin_report.html.js b/boxoffice/static/js/templates/admin_report.html.js index 9aefa8ad..8431a2a0 100644 --- a/boxoffice/static/js/templates/admin_report.html.js +++ b/boxoffice/static/js/templates/admin_report.html.js @@ -12,7 +12,7 @@ export const ReportTemplate = `

Report type

diff --git a/boxoffice/views/admin_report.py b/boxoffice/views/admin_report.py index 503d84d9..3f7c2c45 100644 --- a/boxoffice/views/admin_report.py +++ b/boxoffice/views/admin_report.py @@ -1,11 +1,26 @@ # -*- coding: utf-8 -*- -from flask import Response +from flask import Response, jsonify from .. import app, lastuser -from coaster.views import load_models +from coaster.views import load_models, render_with from boxoffice.models import db, ItemCollection, Order, Item, LineItem, Assignee, LINE_ITEM_STATUS +def jsonify_report(data_dict): + return jsonify(org_name=data_dict['item_collection'].organization.name, title=data_dict['item_collection'].title) + + +@app.route('/admin/ic//reports') +@lastuser.requires_login +@load_models( + (ItemCollection, {'id': 'ic_id'}, 'item_collection'), + permission='org_admin' + ) +@render_with({'text/html': 'index.html', 'application/json': jsonify_report}, json=True) +def admin_report(item_collection): + return dict(title=item_collection.organization.title, item_collection=item_collection) + + @app.route('/admin/ic//reports/attendee.csv') @lastuser.requires_login @load_models( diff --git a/requirements.txt b/requirements.txt index d8d78412..bc9e9dfe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,4 +18,3 @@ premailer python-dateutil tabulate Flask-Admin -unicodecsv From 2b9922f24b5be19060d4716d2a21f547fa80c7af Mon Sep 17 00:00:00 2001 From: Shreyas Satish Date: Mon, 12 Sep 2016 23:45:35 +0530 Subject: [PATCH 05/41] added headers --- boxoffice/views/admin_report.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boxoffice/views/admin_report.py b/boxoffice/views/admin_report.py index 3f7c2c45..17c83fab 100644 --- a/boxoffice/views/admin_report.py +++ b/boxoffice/views/admin_report.py @@ -31,8 +31,9 @@ def admin_assignee_report(item_collection): line_item_join = db.outerjoin(LineItem, Assignee).join(Item).join(Order) line_item_stmt = db.select([LineItem.id, Item.title, Order.buyer_fullname, Order.buyer_email, Order.buyer_phone, Assignee.fullname, Assignee.email, Assignee.phone, Assignee.details]).select_from(line_item_join).where(LineItem.status == LINE_ITEM_STATUS.CONFIRMED).where(Assignee.current == True).where(Order.item_collection == item_collection).order_by('created_at') records = db.session.execute(line_item_stmt).fetchall() + headers = [['line item id', 'item title', 'buyer fullname', 'buyer email', 'buyer phone', 'attendee fullname', 'attendee email', 'attendee phone', 'attendee details']] def generate(): - for row in records: + for row in headers + records: yield ','.join([unicode(attr) for attr in row]) + '\n' return Response(generate(), mimetype='text/csv') From c4992c9cef364bd6cc7ef87d1f212ba0cd9d9d7a Mon Sep 17 00:00:00 2001 From: Shreyas Satish Date: Tue, 13 Sep 2016 18:23:00 +0530 Subject: [PATCH 06/41] 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 07/41] 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCIvVXNlcnMvdmlke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pbnRlcm5hbF9mbi5iZWZvcmVJbml0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAvLyBjYW4gZG8gc29tZXRoaW5nXG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5hZnRlckluaXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIC8vIGNhbiBkbyBzb21ldGhpbmdcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmluaXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcblxuICAgICAgICAkJC5pbml0UGFyYW1zKCk7XG5cbiAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3VybCkge1xuICAgICAgICAgICAgJCQuY29udmVydFVybFRvRGF0YShjb25maWcuZGF0YV91cmwsIGNvbmZpZy5kYXRhX21pbWVUeXBlLCBjb25maWcuZGF0YV9oZWFkZXJzLCBjb25maWcuZGF0YV9rZXlzLCAkJC5pbml0V2l0aERhdGEpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGNvbmZpZy5kYXRhX2pzb24pIHtcbiAgICAgICAgICAgICQkLmluaXRXaXRoRGF0YSgkJC5jb252ZXJ0SnNvblRvRGF0YShjb25maWcuZGF0YV9qc29uLCBjb25maWcuZGF0YV9rZXlzKSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoY29uZmlnLmRhdGFfcm93cykge1xuICAgICAgICAgICAgJCQuaW5pdFdpdGhEYXRhKCQkLmNvbnZlcnRSb3dzVG9EYXRhKGNvbmZpZy5kYXRhX3Jvd3MpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChjb25maWcuZGF0YV9jb2x1bW5zKSB7XG4gICAgICAgICAgICAkJC5pbml0V2l0aERhdGEoJCQuY29udmVydENvbHVtbnNUb0RhdGEoY29uZmlnLmRhdGFfY29sdW1ucykpO1xuICAgICAgICB9XG4gICA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ucylcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIENMQVNTLnpvb21SZWN0KVxuICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgJCQud2lkdGgpXG4gICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgJCQuaGVpZ2h0KVxuICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMClcbiAgICAgICAgICAgIC5vbihcImRibGNsaWNrLnpvb21cIiwgbnVsbCk7XG5cbiAgICAgICAgLy8gU2V0IGRlZmF1bHQgZXh0ZW50IGlmIGRlZmluZWRcbiAgICAgICAgaWYgKGNvbmZpZy5heGlzX3hfZXh0ZW50KSB7ICQkLmJydXNoLmV4dGVudCgkJC5nZXREZWZhdWx0RXh0ZW50KCkpOyB9XG5cbiAgICAgICAgLy8gQWRkIEF4aXNcbiAgICAgICAgJCQuYXhpcy5pbml0KCk7XG5cbiAgICAgICAgLy8gU2V0IHRhcmdldHNcbiAgICAgICAgJCQudXBkYXRlVGFyZ2V0cygkJC5kYXRhLnRhcmdldHMpO1xuXG4gICAgICAgIC8vIERyYXcgd2l0aCB0YXJnZXRzXG4gICAgICAgIGlmIChiaW5kaW5nKSB7XG4gICAgICAgICAgICAkJC51cGRhdGVEaW1lbnNpb24oKTtcbiAgICAgICAgICAgICQkLmNvbmZpZy5vbmluaXQuY2FsbCgkJCk7XG4gICAgICAgICAgICAkJC5yZWRyYXcoe1xuICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uOiBmYWxzZSxcbiAgICAgICAgICAgICAgICB3aXRoVHJhbnNmb3JtOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uRm9yQXhpczogZmFsc2VcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQmluZCByZXNpemUgZXZlbnRcbiAgICAgICAgJCQuYmluZFJlc2l6ZSgpO1xuXG4gICAgICAgIC8vIGV4cG9ydCBlbGVtZW50IG9mIHRoZSBjaGFydFxuICAgICAgICAkJC5hcGkuZWxlbWVudCA9ICQkLnNlbGVjdENoYXJ0Lm5vZGUoKTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uc21vb3RoTGluZXMgPSBmdW5jdGlvbiAoZWwsIHR5cGUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgaWYgKHR5cGUgPT09ICdncmlkJykge1xuICAgICAgICAgICAgZWwuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGcgPSAkJC5kMy5zZWxlY3QodGhpcyksXG4gICAgICAgICAgICAgICAgICAgIHgxID0gZy5hdHRyKCd4MScpLFxuICAgICAgICAgICAgICAgICAgICB4MiA9IGcuYXR0cigneDInKSxcbiAgICAgICAgICAgICAgICAgICAgeTEgPSBnLmF0dHIoJ3kxJyksXG4gICAgICAgICAgICAgICAgICAgIHkyID0gZy5hdHRyKCd5MicpO1xuICAgICAgICAgICAgICAgIGcuYXR0cih7XG4gICAgICAgICAgICAgICAgICAgICd4MSc6IE1hdGguY2VpbCh4MSksXG4gICAgICAgICAgICAgICAgICAgICd4Mic6IE1hdGguY2VpbCh4MiksXG4gICAgICAgICAgICAgICAgICAgICd5MSc6IE1hdGguY2VpbCh5MSksXG4gICAgICAgICAgICAgICAgICAgICd5Mic6IE1hdGguY2VpbCh5MilcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlU2l6ZXMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgd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AgICAgICAgICAkJC51cGRhdGVEaW1lbnNpb24odHJ1ZSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBNRU1POiBuZWVkZWQgZm9yIGdyaWRzIGNhbGN1bGF0aW9uXG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkgJiYgdGFyZ2V0c1RvU2hvdy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICQkLnguZG9tYWluKFswLCAkJC5heGVzLnguc2VsZWN0QWxsKCcudGljaycpLnNpemUoKV0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRhcmdldHNUb1Nob3cubGVuZ3RoKSB7XG4gICAgICAgICAgICAkJC51cGRhdGVYRG9tYWluKHRhcmdldHNUb1Nob3csIHdpdGhVcGRhdGVYRG9tYWluLCB3aXRoVXBkYXRlT3JnWERvbWFpbiwgd2l0aFRyaW1YRG9tYWluKTtcbiAgICAgICAgICAgIGlmICghY29uZmlnLmF4aXNfeF90aWNrX3ZhbHVlcykge1xuICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMgPSAkJC5heGlzLnVwZGF0ZVhBeGlzVGlja1ZhbHVlcyh0YXJnZXRzVG9TaG93KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICQkLnhBeGlzLnRpY2tWYWx1ZXMoW10pO1xuICAgICAgICAgICAgJCQuc3ViWEF4aXMudGlja1ZhbHVlcyhbXSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY29uZmlnLnpvb21fcmVzY2FsZSAmJiAhb3B0aW9ucy5mbG93KSB7XG4gICAgICAgICAgICB4RG9tYWluRm9yWm9vbSA9ICQkLngub3JnRG9tYWluKCk7XG4gICAgICAgIH1cblxuICAgICAgICAkJC55LmRvbWFpbigkJC5nZXRZRG9tYWluKHRhcmdldHNUb1Nob3csICd5JywgeERvbWFpbkZvclpvb20pKTtcbiAgICAgICAgJCQueTIuZG9tYWluKCQkLmdldFlEb21haW4od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pY2tWYWx1ZXMubGVuZ3RoIC8gaSA8IGNvbmZpZy5heGlzX3hfdGlja19jdWxsaW5nX21heCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJ2YWxGb3JDdWxsaW5nID0gaTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuYXhpc1ggKyAnIC50aWNrIHRleHQnKS5lYWNoKGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IHRpY2tWYWx1ZXMuaW5kZXhPZihlKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5zdHlsZSgnZGlzcGxheScsIGluZGV4ICUgaW50ZXJ2YWxGb3JDdWxsaW5nID8gJ25vbmUnIDogJ2Jsb2NrJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5heGlzWCArICcgLnRpY2sgdGV4dCcpLnN0eWxlKCdkaXNwbGF5JywgJ2Jsb2NrJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBzZXR1cCBkcmF3ZXIgLSBNRU1POiB0aGVzZSBtdXN0IGJlIGNhbGxlZCBhZnRlciBheGlzIHVwZGF0ZWRcbiAgICAgICAgZHJhd0FyZWEgPSAkJC5nZW5lcmF0ZURyYXdBcmVhID8gJCQuZ2VuZXJhdGVEcmF3QXJlYShhcmVhSW5kaWNlcywgZmFsc2UpIDogdW5kZWZpbmVkO1xuICAgICAgICBkcmF3QmFyID0gJ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B7XG4gICAgICAgICAgICBmbG93ID0gJCQuZ2VuZXJhdGVGbG93KHtcbiAgICAgICAgICAgICAgICB0YXJnZXRzOiB0YXJnZXRzVG9TaG93LFxuICAgICAgICAgICAgICAgIGZsb3c6IG9wdGlvbnMuZmxvdyxcbiAgICAgICAgICAgICAgICBkdXJhdGlvbjogb3B0aW9ucy5mbG93LmR1cmF0aW9uLFxuICAgICAgICAgICAgICAgIGRyYXdCYXI6IGRyYXdCYXIsXG4gICAgICAgICAgICAgICAgZHJhd0xpbmU6IGRyYXdMaW5lLFxuICAgICAgICAgICAgICAgIGRyYXdBcmVhOiBkcmF3QXJlYSxcbiAgICAgICAgICAgICAgICBjeDogY3gsXG4gICAgICAgICAgICAgICAgY3k6IGN5LFxuICAgICAgICAgICAgICAgIHh2OiB4dixcbiAgICAgICAgICAgICAgICB4Rm9yVGV4dDogeEZvclRleHQsXG4gICAgICAgICAgICAgICAgeUZvclRleHQ6IHlGb3JUZXh0XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgoZHVyYXRpb24gfHwgZmxvdykgJiYgJCQuaXNUYWJWaXNpYmxlKCkpIHsgLy8gT25seSB1c2UgdHJhbnNpdGlvbiBpZiB0YWIgdmlzaWJsZS4gU2VlICM5MzguXG4gICAgICAgICAgICAvLyB0cmFuc2l0aW9uIHNob3VsZCBiZSBkZXJpdmVkIGZyb20gb25lIHRyYW5zaXRpb25cbiAgICAgICAgICAgIGQzLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbikuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRyYW5zaXRpb25zVG9XYWl0ID0gW107XG5cbiAgICAgICAgICAgICAgICAvLyByZWRyYXcgYW5kIGdhdGhlciB0cmFuc2l0aW9uc1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3QmFyKGRyYXdCYXIsIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdMaW5lKGRyYXdMaW5lLCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3QXJlYShkcmF3QXJlYSwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0NpcmNsZShjeCwgY3ksIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdUZXh0KHhGb3JUZXh0LCB5Rm9yVGV4dCwgb3B0aW9ucy5mbG93LCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3UmVnaW9uKHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdHcmlkKHRydWUpLFxuICAgICAgICAgICAgICAgIF0uZm9yRWFjaChmdW5jdGlvbiAodHJhbnNpdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAodHJhbnNpdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbnNUb1dhaXQucHVzaCh0cmFuc2l0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAvLyBXYWl0IGZvciBlbmQgb2YgdHJhbnNpdGlvbnMgdG8gY2FsbCBmbG93IGFuZCBvbnJlbmRlcmVkIGNhbGxiYWNrXG4gICAgICAgICAgICAgICAgd2FpdEZvckRyYXcgPSAkJC5nZW5lcmF0ZVdhaXQoKTtcbiAgICAgICAgICAgICAgICB0cmFuc2l0aW9uc1RvV2FpdC5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgIHdhaXRGb3JEcmF3LmFkZCh0KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2FsbCh3YWl0Rm9yRHJhdywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmIChmbG93KSB7XG4gICAgICAgICAgICAgICAgICAgIGZsb3coKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5vbnJlbmRlcmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5vbnJlbmRlcmVkLmNhbGwoJCQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgJCQucmVkcmF3QmFyKGRyYXdCYXIpO1xuICAgICAgICAgICAgJCQucmVkcmF3TGluZShkcmF3TGluZSk7XG4gICAgICAgICAgICAkJC5yZWRyYXdBcmVhKGRyYXdBcmVhKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0NpcmNsZShjeCwgY3kpO1xuICAgICAgICAgICAgJCQucmVkcmF3VGV4dCh4Rm9yVGV4dCwgeUZvclRleHQsIG9wdGlvbnMuZmxvdyk7XG4gICAgICAgICAgICAkJC5yZWRyYXdSZWdpb24oKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0dyaWQoKTtcbiAgICAgICAgICAgIGlmIChjb25maWcub25yZW5kZXJlZCkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5vbnJlbmRlcmVkLmNhbGwoJCQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gdXBkYXRlIGZhZGVpbiBjb25kaXRpb25cbiAgICAgICAgJCQubWFwVG9JZHMoJCQuZGF0YS50YXJnZXRzKS5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgJCQud2l0aG91dEZhZGVJbltpZF0gPSB0cnVlO1xuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlQW5kUmVkcmF3ID0gZnVuY3Rpb24gKG9wdGlvbnMpIHtcbiAgICAgICAgdmFyICQkID0gdG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dXRhdGlvbk9ic2VydmVyID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgd2luZG93LmNvbnNvbGUuZXJyb3IoXCJNdXRhdGlvbk9ic2VydmVyIG5vdCBkZWZpbmVkLlwiKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBvYnNlcnZlcj0gbmV3IE11dGF0aW9uT2JzZXJ2ZXIoZnVuY3Rpb24gKG11dGF0aW9ucykge1xuICAgICAgICAgICAgbXV0YXRpb25zLmZvckVhY2goZnVuY3Rpb24gKG11dGF0aW9uKSB7XG4gICAgICAgICAgICAgICAgaWYgKG11dGF0aW9uLnR5cGUgPT09ICdjaGlsZExpc3QnICYmIG11dGF0aW9uLnByZXZpb3VzU2libGluZykge1xuICAgICAgICAgICAgICAgICAgICBvYnNlcnZlci5kaXNjb25uZWN0KCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gd2FpdCBmb3IgY29tcGxldGlvbiBvZiBsb2FkIGJlY2F1c2Ugc2l6ZSBjYWxjdWxhdGlvbiByZXF1aXJlcyB0aGUgYWN0dWFsIHNpemVzIGRldGVybWluZWQgYWZ0ZXIgdGhhdCBjb21wbGV0aW9uXG4gICAgICAgICAgICAgICAgICAgICQkLmludGVydmFsRm9yT2JzZXJ2ZUluc2VydGVkID0gd2luZG93LnNldEludGVydmFsKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHBhcmVudE5vZGUgd2lsbCBOT1QgYmUgbnVsbCB3aGVuIGNvbXBsZXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGVjdGlvbi5ub2RlKCkucGFyZW50Tm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jbGVhckludGVydmFsKCQkLmludGVydmFsRm9yT2JzZXJ2ZUluc2VydGVkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC51cGRhdGVEaW1lbnNpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJCQuYnJ1c2gpIHsgJCQuYnJ1c2gudXBkYXRlKCk7IH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcub25pbml0LmNhbGwoJCQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhUcmFuc2Zvcm06IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFRyYW5zaXRpb246IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVHJhbnNpdGlvbkZvclRyYW5zZm9ybTogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhMZWdlbmQ6IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3Rpb24udHJhbnNpdGlvbigpLnN0eWxlKCdvcGFjaXR5JywgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0sIDEwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIG9ic2VydmVyLm9ic2VydmUoc2VsZWN0aW9uLm5vZGUoKSwge2F0dHJpYnV0ZXM6IHRydWUsIGNoaWxkTGlzdDogdHJ1ZSwgY2hhcmFjdGVyRGF0YTogdHJ1ZX0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5iaW5kUmVzaXplID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG5cbiAgICAgICAgJCQucmVzaXplRnVuY3Rpb24gPSAkJC5nZW5lcmF0ZVJlc2l6ZSgpO1xuXG4gICAgICAgICQkLnJlc2l6ZUZ1bmN0aW9uLmFkZChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBjb25maWcub25yZXNpemUuY2FsbCgkJCk7XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoY29uZmlnLnJlc2l6ZV9hdXRvKSB7XG4gICAgICAgICAgICAkJC5yZXNpemVGdW5jdGlvbi5hZGQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICgkJC5yZXNpemVUaW1lb3V0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNsZWFyVGltZW91dCgkJC5yZXNpemVUaW1lb3V0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQucmVzaXplVGltZW91dCA9IHdpbmRvdy5zZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlICQkLnJlc2l6ZVRpbWVvdXQ7XG4gICAgICAgICAgICAgICAgICAgICQkLmFwaS5mbHVzaCgpO1xuICAgICAgICAgICAgICAgIH0sIDEwMCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAkJC5yZXNpemVGdW5jdGlvbi5hZGQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgY29uZmlnLm9ucmVzaXplZC5jYWxsKCQkKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKHdpbmRvdy5hdHRhY2hFdmVudCkge1xuICAgICAgICAgICAgd2luZG93LmF0dGFjaEV2ZW50KCdvbnJlc2l6ZScsICQkLnJlc2l6ZUZ1bmN0aW9uKTtcbiAgICAgICAgfSBlbHNlIGlmICh3aW5kb3c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IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAoIS0tbikgeyBjYWxsYmFjay5hcHBseSh0aGlzLCBhcmd1bWVudHMpOyB9XG4gICAgICAgICAgICB9KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlV2FpdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHRyYW5zaXRpb25zVG9XYWl0ID0gW10sXG4gICAgICAgICAgICBmID0gZnVuY3Rpb24gKHRyYW5zaXRpb24sIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRpbWVyID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZG9uZSA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25zVG9XYWl0LmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0LmVtcHR5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lICs9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0LnRyYW5zaXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lICs9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZG9uZSA9PT0gdHJhbnNpdGlvbnNUb1dhaXQubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgI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sZWZ0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwYWRkaW5nX3JpZ2h0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwYWRkaW5nX3RvcDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGFkZGluZ19ib3R0b206IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHJlc2l6ZV9hdXRvOiB0cnVlLFxuICAgICAgICAgICAgem9vbV9lbmFibGVkOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb21fZXh0ZW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICB6b29tX3ByaXZpbGVnZWQ6IGZhbHNlLFxuICAgICAgICAgICAgem9vbV9yZXNjYWxlOiBmYWxzZSxcbiAgICAgICAgICAgIHpvb21fb256b29tOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHpvb21fb256b29tc3RhcnQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgem9vbV9vbnpvb21lbmQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgem9vbV94X21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgem9vbV94X21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgaW50ZXJhY3Rpb25fYnJpZ2h0ZW46IHRydWUsXG4gICAgICAgICAgICBpbnRlcmFjdGlvbl9lbmFibGVkOiB0cnVlLFxuICAgICAgICAgICAgb25tb3VzZW92ZXI6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25tb3VzZW91dDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbnJlc2l6ZTogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbnJlc2l6ZWQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25pbml0OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9ucmVuZGVyZWQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgdHJhbnNpdGlvbl9kdXJhdGlvbjogMzUwLFxuICAgICAgICAgICAgZGF0YV94OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX3hzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfeEZvcm1hdDogJyVZLSVtLSVkJyxcbiAgICAgICAgICAgIGRhdGFfeExvY2FsdGltZTogdHJ1ZSxcbiAgICAgICAgICAgIGRhdGFfeFNvcnQ6IHRydWUsXG4gICAgICAgICAgICBkYXRhX2lkQ29udmVydGVyOiBmdW5jdGlvbiAoaWQpIHsgcmV0dXJuIGlkOyB9LFxuICAgICAgICAgICAgZGF0YV9uYW1lczoge30sXG4gICAgICAgICAgICBkYXRhX2NsYXNzZXM6IHt9LFxuICAgICAgICAgICAgZGF0YV9ncm91cHM6IFtdLFxuICAgICAgICAgICAgZGF0YV9heGVzOiB7fSxcbiAgICAgICAgICAgIGRhdGFfdHlwZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV90eXBlczoge30sXG4gICAgICAgICAgICBkYXRhX2xhYmVsczoge30sXG4gICAgICAgICAgICBkYXRhX29yZGVyOiAnZGVzYycsXG4gICAgICAgICAgICBkYXRhX3JlZ2lvbnM6IHt9LFxuICAgICAgICAgICAgZGF0YV9jb2xvcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV9jb2xvcnM6IHt9LFxuICAgICAgICAgICAgZGF0YV9oaWRlOiBmYWxzZSxcbiAgICAgICAgICAgIGRhdGFfZmlsdGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX3NlbGVjdGlvbl9lbmFibGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGRhdGFfc2VsZWN0aW9uX2dyb3VwZWQ6IGZhbHNlLFxuICAgICAgICAgICAgZGF0YV9zZWxlY3Rpb25faXNzZWxlY3RhYmxlOiBmdW5jdGlvbiAoKSB7IHJldHVybiB0cnVlOyB9LFxuICAgICAgICAgICAgZGF0YV9zZWxlY3Rpb25fbXVsdGlwbGU6IHRydWUsXG4gICAgICAgICAgICBkYXRhX3NlbGVjdGlvbl9kcmFnZ2FibGU6IGZhbHNlLFxuICAgICAgICAgICAgZGF0YV9vbmNsaWNrOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIGRhdGFfb25tb3VzZW92ZXI6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgZGF0YV9vbm1vdXNlb3V0OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIGRhdGFfb25zZWxlY3RlZDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBkYXRhX29udW5zZWxlY3RlZDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBkYXRhX3VybDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV9oZWFkZXJzOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX2pzb246IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGRhdGFfcm93czogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZGF0YV9jb2x1bW5zOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX21pbWVUeXBlOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBkYXRhX2tleXM6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vIGNvbmZpZ3VyYXRpb24gZm9yIG5vIHBsb3QtYWJsZSBkYXRhIHN1cHBsaWVkLlxuICAgICAgICAgICAgZGF0YV9lbXB0eV9sYWJlbF90ZXh0OiBcIlwiLFxuICAgICAgICAgICAgLy8gc3ViY2hhcnRcbiAgICAgICAgICAgIHN1YmNoYXJ0X3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgc3ViY2hhcnRfc2l6ZV9oZWlnaHQ6IDYwLFxuICAgICAgICAgICAgc3ViY2hhcnRfYXhpc194X3Nob3c6IHRydWUsXG4gICAgICAgICAgICBzdWJjaGFydF9vbmJydXNoOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIC8vIGNvbG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ICAgICAgICAgICAgYXhpc194X3RpY2tfY2VudGVyZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfdGlja19jdWxsaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2N1bGxpbmdfbWF4OiAxMCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2NvdW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfdGlja19maXQ6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfdGlja192YWx1ZXM6IG51bGwsXG4gICAgICAgICAgICBheGlzX3hfdGlja19yb3RhdGU6IDAsXG4gICAgICAgICAgICBheGlzX3hfdGlja19vdXRlcjogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX211bHRpbGluZTogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX3dpZHRoOiBudWxsLFxuICAgICAgICAgICAgYXhpc194X21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X3BhZGRpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc194X2hlaWdodDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X2V4dGVudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc194X2xhYmVsOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeV9zaG93OiB0cnVlLFxuICAgICAgICAgICAgYXhpc195X3R5cGU6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9tYXg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9pbnZlcnRlZDogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3lfY2VudGVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfaW5uZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9sYWJlbDoge30sXG4gICAgICAgICAgICBheGlzX3lfdGlja19mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX291dGVyOiB0cnVlLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdmFsdWVzOiBudWxsLCAgICAgICAgXG4gICAgICAgICAgICBheGlzX3lfdGlja19yb3RhdGU6IDAsXG4gICAgICAgICAgICBheGlzX3lfdGlja19jb3VudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdGltZV92YWx1ZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfdGltZV9pbnRlcnZhbDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3BhZGRpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc195X2RlZmF1bHQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3kyX21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9taW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfaW52ZXJ0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgYXhpc195Ml9jZW50ZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfaW5uZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeTJfbGFiZWw6IHt9LFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX291dGVyOiB0cnVlLFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX3ZhbHVlczogbnVsbCxcbiAgICAgICAgICAgIGF4aXNfeTJfdGlja19jb3VudDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9wYWRkaW5nOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeTJfZGVmYXVsdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gZ3JpZFxuICAgICAgICAgICAgZ3JpZF94X3Nob3c6IGZhbHNlLFxuICAgICAgICAgICAgZ3JpZF94X3R5cGU6ICd0aWNrJyxcbiAgICAgICAgICAgIGdyaWRfeF9saW5lczogW10sXG4gICAgICAgICAgICBncmlkX3lfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICAvLyBub3QgdXNlZFxuICAgICAgICAgICAgLy8gZ3JpZF95X3R5cGU6ICd0aWNrJyxcbiAgICAgICAgICAgIGdyaWRfeV9saW5lczogW10sXG4gICAgICAgICAgICBncmlkX3lfdGlja3M6IDEwLFxuICAgICAgICAgICAgZ3JpZF9mb2N1c19zaG93OiB0cnVlLFxuICAgICAgICAgICAgZ3JpZF9saW5lc19mcm9udDogdHJ1ZSxcbiAgICAgICAgICAgIC8vIHBvaW50IC0gcG9pbnQgb2YgZWFjaCBkYXRhXG4gICAgICAgICAgICBwb2ludF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgcG9pbnRfcjogMi41LFxuICAgICAgICAgICAgcG9pbnRfc2Vuc2l0aXZpdHk6IDEwLFxuICAgICAgICAgICAgcG9pbnRfZm9jdXNfZXhwYW5kX2VuYWJsZWQ6IHRydWUsXG4gICAgICAgICAgICBwb2ludF9mb2N1c19leHBhbmRfcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcG9pbnRfc2VsZWN0X3I6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vIGxpbmVcbiAgICAgICAgICAgIGxpbmVfY29ubmVjdE51bGw6IGZhbHNlLFxuICAgICAgICAgICAgbGluZV9zdGVwX3R5cGU6ICdzdGVwJyxcbiAgICAgICAgICAgIC8vIGJhclxuICAgICAgICAgICAgYmFyX3dpZHRoOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBiYXJfd2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sIGNvbG9yKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0VG9vbHRpcENvbnRlbnQgPyB0aGlzLmdldFRvb2x0aXBDb250ZW50KGQsIGRlZmF1bHRUaXRsZUZvcm1hdCwgZGVmYXVsdFZhbHVlRm9ybWF0LCBjb2xvcikgOiAnJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB0b29sdGlwX2luaXRfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICB0b29sdGlwX2luaXRfeDogMCxcbiAgICAgICAgICAgIHRvb2x0aXBfaW5pdF9wb3NpdGlvbjoge3RvcDogJzBweCcsIGxlZnQ6ICc1MHB4J30sXG4gICAgICAgICAgICB0b29sdGlwX29uc2hvdzogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB0b29sdGlwX29uaGlkZTogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICAvLyB0aXRsZVxuICAgICAgICAgICAgdGl0bGVfdGV4dDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgdGl0bGVfcGFkZGluZzoge1xuICAgICAgICAgICAgICAgIHRvcDogMCxcbiAgICAgICAgICAgICAgICByaWdodDogMCxcbiAgICAgICAgICAgICAgICBib3R0b206IDAsXG4gICAgICAgICAgICAgICAgbGVmdDogMFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHRpdGxlX3Bvc2l0aW9uOiAndG9wLWNlbnRlcicsXG4gICAgICAgIH07XG5cbiAgICAgICAgT2JqZWN0LmtleXModGhpcy5hZGRpdGlvbmFsQ29uZmlnKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgIGNvbmZpZ1trZXldID0gdGhpcy5hZGRpdGlvbmFsQ29uZmlnW2tleV07XG4gICAgICAgIH0sIHRoaXMpO1xuXG4gICAgICAgIHJldHVybiBjb25maWc7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5hZGRpdGlvbmFsQ29uZmlnID0ge307XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5sb2FkQ29uZmlnID0gZnVuY3Rpb24gKGNvbmZpZykge1xuICAgICAgICB2YXIgdGhpc19jb25maWcgPSB0aGlzLmNvbmZpZywgdGFyZ2V0LCBrZXlzLCByZWFkO1xuICAgICAgICBmdW5jdGlvbiBmaW5kKCkge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXMuc2hpZnQoKTtcbiAgICAvLyAgICAgICAgY29uc29sZS5sb2coXCJrZXkgPT5cIiwga2V5LCBcIiwgdGFyZ2V0ID0+XCIsIHRhcmdldCk7XG4gICAgICAgICAgICBpZiAoa2V5ICYmIHRhcmdldCAmJiB0eXBlb2YgdGFyZ2V0ID09PSAnb2JqZWN0JyAmJiBrZXkgaW4gdGFyZ2V0KSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0ID0gdGFyZ2V0W2tleV07XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKCFrZXkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGFyZ2V0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBPYmplY3Qua2V5cyh0aGlzX2NvbmZpZykuZm9yRWFjaChmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICB0YXJnZXQgPSBjb25maWc7XG4gICAgICAgICAgICBrZXlzID0ga2V5LnNwbGl0KCdfJyk7XG4gICAgICAgICAgICByZWFkID0gZmluZCgpO1xuICAgIC8vICAgICAgICBjb25zb2xlLmxvZyhcIkNPTkZJRyA6IFwiLCBrZXksIHJlYWQpO1xuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyZWFkKSkge1xuICAgICAgICAgICAgICAgIHRoaXNfY29uZm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B2YXIgdiA9IF9zY2FsZShkKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmF3ID8gdiA6IE1hdGguY2VpbCh2KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgLy8gZGVmaW5lIGZ1bmN0aW9uc1xuICAgICAgICBmb3IgKGtleSBpbiBfc2NhbGUpIHtcbiAgICAgICAgICAgIHNjYWxlW2tleV0gPSBfc2NhbGVba2V5XTtcbiAgICAgICAgfVxuICAgICAgICBzY2FsZS5vcmdEb21haW4gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gX3NjYWxlLmRvbWFpbigpO1xuICAgICAgICB9O1xuICAgICAgICAvLyBkZWZpbmUgY3VzdG9tIGRvbWFpbigpIGZvciBjYXRlZ29yaXplZCBheGlzXG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkpIHtcbiAgICAgICAgICAgIHNjYWxlLmRvbWFpbiA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgZG9tYWluID0gdGhpcy5vcmdEb21haW4oKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtkb21haW5bMF0sIGRvbWFpblsxXSArIDFdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBfc2NhbGUuZG9tYWluKGRvbWFpbik7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNjYWxlO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc2NhbGU7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRZID0gZnVuY3Rpb24gKG1pbiwgbWF4LCBkb21haW4pIHtcbiAgICAgICAgdmFyIHNjYWxlID0gdGhpcy5nZXRTY2FsZShtaW4sIG1heCwgdGhpcy5pc1RpbWVTZXJpZXNZKCkpO1xuICAgICAgICBpZiAoZG9tYWluKSB7IHNjYWxlLmRvbWFpbihkb21haW4pOyB9XG4gICAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFlTY2FsZSA9IGZ1bmN0aW9uIChpZCkge1xuICAgICAgICByZXR1cm4gdGhpcy5heGlzLmdldElkKGlkKSA9PT0gJ3kyJyA/IHRoaXMueTIgOiB0aGlzLnk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRTdWJZU2NhbGUgPSBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYXhpcy5nZXRJZChpZCkgPT09ICd5MicgPyB0aGlzLnN1YlkyIDogdGhpcy5zdWJZO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlU2NhbGVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBmb3JJbml0ID0gISQkLng7XG4gICAgICAgIC8vIHVwZGF0ZSBlZGdlc1xuICAgICAgICAkJC54TWluID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDEgOiAwO1xuICAgICAgICAkJC54TWF4ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmhlaWdodCA6ICQkLndpZHRoO1xuICAgICAgICAkJC55TWluID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiAkJC5oZWlnaHQ7XG4gICAgICAgICQkLnlNYXggPSBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiAxO1xuICAgICAgICAkJC5zdWJYTWluID0gJCQueE1pbjtcbiAgICAgICAgJCQuc3ViWE1heCA9ICQkLnhNYXg7XG4gICAgICAgICQkLnN1YllNaW4gPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6ICQkLmhlaWdodDI7XG4gICAgICAg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uICAgICAgICAgICAgICAgIC8vIENvbnNpZGVyIG5lZ2F0aXZlIHZhbHVlc1xuICAgICAgICAgICAgICAgIGlmIChoYXNOZWdhdGl2ZVZhbHVlICYmIHlzW2Jhc2VJZF0pIHtcbiAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXS5mb3JFYWNoKGZ1bmN0aW9uICh2LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldID0gdiA8IDAgPyB2IDogMDtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIENvbXB1dGUgbWluXG4gICAgICAgICAgICAgICAgZm9yIChrID0gMTsgayA8IGlkc0luR3JvdXAubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBpZHNJbkdyb3VwW2tdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISB5c1tpZF0pIHsgY29udGludWU7IH1cbiAgICAgICAgICAgICAgICAgICAgeXNbaWRdLmZvckVhY2goZnVuY3Rpb24gKHYsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkJC5heGlzLmdldElkKGlkKSA9PT0gJCQuYXhpcy5nZXRJZChiYXNlSWQpICYmIHlzW2Jhc2VJZF0gJiYgIShoYXNOZWdhdGl2ZVZhbHVlICYmICt2ID4gMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdW2ldICs9ICt2O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICQkLmQzLm1pbihPYmplY3Qua2V5cyh5cykubWFwKGZ1bmN0aW9uIChrZXkpIHsgcmV0dXJuICQkLmQzLm1pbih5c1trZXldKTsgfSkpO1xuICAgIH07XG4gICAgYzNfY2h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ICAgICAgICAgIHlzW2Jhc2VJZF1baV0gPSB2ID4gMCA/IHYgOiAwO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gQ29tcHV0ZSBtYXhcbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDwgaWRzSW5Hcm91cC5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IGlkc0luR3JvdXBba107XG4gICAgICAgICAgICAgICAgICAgIGlmICghIHlzW2lkXSkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgICAgICB5c1tpZF0uZm9yRWFjaChmdW5jdGlvbiAodiwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmF4aXMuZ2V0SWQoaWQpID09PSAkJC5heGlzLmdldElkKGJhc2VJZCkgJiYgeXNbYmFzZUlkXSAmJiAhKGhhc1Bvc2l0aXZlVmFsdWUgJiYgK3YgPCAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF1baV0gKz0gK3Y7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gJCQuZDMubWF4KE9iamVjdC5rZXlzKHlzKS5tYXAoZnVuY3Rpb24gKGtleSkgeyByZXR1cm4gJCQuZDMubWF4KHlzW2tleV0pOyB9KSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRZRG9tYWluID0gZnVuY3Rpb24gKHRhcmdldHMsIGF4aXNJZCwgeERvbWFpbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICB0YXJnZXRzQnlBeGlzSWQgPSB0YXJnZXRzLmZpbHRlcihmdW5jdGlvb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bWVTZXJpZXMoKSA/IHRoaXMucGFyc2VEYXRlKGNvbmZpZy5heGlzX3hfbWF4KSA6IGNvbmZpZy5heGlzX3hfbWF4KSA6XG4gICAgICAgICQkLmQzLm1heCh0YXJnZXRzLCBmdW5jdGlvbiAodCkgeyByZXR1cm4gJCQuZDMubWF4KHQudmFsdWVzLCBmdW5jdGlvbiAodikgeyByZXR1cm4gdi54OyB9KTsgfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRYRG9tYWluUGFkZGluZyA9IGZ1bmN0aW9uIChkb21haW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgZGlmZiA9IGRvbWFpblsxXSAtIGRvbWFpblswXSxcbiAgICAgICAgICAgIG1heERhdGFDb3VudCwgcGFkZGluZywgcGFkZGluZ0xlZnQsIHBhZGRpbmdSaWdodDtcbiAgICAgICAgaWYgKCQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgcGFkZGluZyA9IDA7XG4gICAgICAgIH0gZWxzZSBpZiAoJCQuaGFzVHlwZSgnYmFyJykpIHtcbiAgICAgICAgICAgIG1heERhdGFDb3VudCA9ICQkLmdldE1heERhdGFDb3VudCgpO1xuICAgICAgICAgICAgcGFkZGluZyA9IG1heERhdGFDb3VudCA+IDEgPyAoZGlmZiAvIChtYXhEYXRhQ291bnQgLSAxKSkgLyAyIDogMC41O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcGFkZGluZyA9IGRpZmYgKiAwLjAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgY29uZmlnLmF4aXNfeF9wYWRkaW5nID09PSAnb2JqZWN0JyAmJiBub3RFbXB0eShjb25maWcuYXhpc194X3BhZGRpbmcpKSB7XG4gICAgICAgICAgICBwYWRkaW5nTGVmdCA9IGlzVmFsdWUoY29uZmlnLmF4aXNfeF9wYWRkaW5nLm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lzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgZmlyc3RYID0gbmV3IERhdGUoZmlyc3RYLmdldFRpbWUoKSAqIDAuNSk7XG4gICAgICAgICAgICAgICAgbGFzdFggPSBuZXcgRGF0ZShsYXN0WC5nZXRUaW1lKCkgKiAxLjUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBmaXJzdFggPSBmaXJzdFggPT09IDAgPyAxIDogKGZpcnN0WCAqIDAuNSk7XG4gICAgICAgICAgICAgICAgbGFzdFggPSBsYXN0WCA9PT0gMCA/IC0xIDogKGxhc3RYICogMS41KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoZmlyc3RYIHx8IGZpcnN0WCA9PT0gMCkge1xuICAgICAgICAgICAgbWluID0gJCQuaXNUaW1lU2VyaWVzKCkgPyBuZXcgRGF0ZShmaXJzdFguZ2V0VGltZSgpIC0gcGFkZGluZy5sZWZ0KSA6IGZpcnN0WCAtIHBhZGRpbmcubGVmdDtcbiAgICAgICAgfVxuICAgICAgICBpZiAobGFzdFggfHwgbGFzdFggPT09IDApIHtcbiAgICAgICAgICAgIG1heCA9ICQkLmlzVGltZVNlcmllcygpID8gbmV3IERhdGUobGFzdFguZ2V0VGltZSgpICsgcGFkZGluZy5yaWdodCkgOiBsYXN0WCArIHBhZGRpbmcucmlnaHQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFttaW4sIG1heF07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVYRG9tYWluID0gZnVuY3Rpb24gKHRhcmdldHMsIHdpdGhVcGRhdGVYRG9tYWluLCB3aXRoVXBkYXRlT3JnWERvbWFpbiwgd2l0aFRyaW0sIGRvbWFpbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG5cbiAgICAgICAgaWYgKHdpdGhVcGRhdGVPcmdYRG9tYWluKSB7XG4gICAgICAgICAgICAkJC54LmRvbWFpbihkb21haW4gPyBkb21haW4gOiAkJC5kMy5leHRlbnQoJCQuZ2V0WERvbWFpbih0YXJnZXRzKSkpO1xuICAgICAgICAgICAgJCQub3JnWERvbWFpbiA9ICQkLnguZG9tYWluKCk7XG4gICAgICAgICAgICBpZiAoY29uZmlnLnpvb21fZW5hYmxlZCkgeyAkJC56b29tLnNjYWxlKCQkLngpLnVwZGF0ZVNjYWxlRXh0ZW50KCk7IH1cbiAgICAgICAgICAgICQkLnN1YlguZG9tYWluKCQkLnguZG9tYWluKCkpO1xuICAgICAgICAgICAgaWYgKCQkLmJydXNoKSB7ICQkLmJydXNoLnNjYWxlKCQkLnN1YlgpOyB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHdpdGhVcGRhdGVYRG9tYWluKSB7XG4gICAgICAgICAgICAkJC54LmRvbWFpbihkb21haW4gPyBkb21haW4gOiAoISQkLmJydXNoIHx8ICQkLmJydXNoLmVtcHR5KCkpID8gJCQub3JnWERvbWFpbiA6ICQkLmJydXNoLmV4dGVudCgpKTtcbiAgICAgICAgICAgIGlmIChjb25maWcuem9vbV9lbmFibGVkKSB7ICQkLnpvb20uc2NhbGUoJCQueCkudXBkYXRlU2NhbGVFeHRlbnQoKTsgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gVHJpbSBkb21haW4gd2hlbiB0b28gYmlnIGJ5IHpvb20gbW91c2Vtb3ZlIGV2ZW50XG4gICAgICAgIGlmICh3aXRoVHJpbSkgeyAkJC54LmRvbWFpbigkJC50cmltWERvbWFpbigkJC54Lm9yZ0RvbWFpbigpKSk7IH1cblxuICAgICAgICByZXR1cm4gJCQueC5kb21haW4oKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnRyaW1YRG9tYWluID0gZnVuY3Rpb24gKGRvbWFpbikge1xuICAgICAgICB2YXIgem9vbURvbWFpbiA9IHRoaXMuZ2V0Wm9vbURvbWFpbigpLFxuICAgICAgICAgICAgbWluID0gem9vbURvbWFpblswXSwgbWF4ID0gem9vbURvbWFpblsxXTtcbiAgICAgICAgaWYgKGRvbWFpblswXSA8PSBtaW4pIHtcbiAgICAgICAgICAgIGRvbWFpblsxXSA9ICtkb21haW5bMV0gKyAobWluIC0gZG9tYWluWzBdKTtcbiAgICAgICAgICAgIGRvbWFpblswXSA9IG1pbjtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWF4IDw9IGRvbWFpblsxXSkge1xuICAgICAgICAgICAgZG9tYWluWzBdID0gK2RvbWFpblswXSAtIChkb21haW5bMV0gLSBtYXgpO1xuICAgICAgICAgICAgZG9tYWluWzFdID0gbWF4O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkb21haW47XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmlzWCA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gKGNvbmZpZy5kYXRhX3ggJiYga2V5ID09PSBjb25maWcuZGF0YV94KSB8fCAobm90RW1wdHkoY29uZmlnLmRhdGFfeHMpICYmIGhhc1ZhbHVlKGNvbmZpZy5kYXRhX3hzLCBrZXkpKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmlzTm90WCA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgcmV0dXJuICF0aGlzLmlzWChrZXkpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WEtleSA9IGZ1bmN0aW9uIChpZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIHJldHVybiBjb25maWcuZGF0YV94ID8gY29uZmlnLmRhdGFfeCA6IG5vdEVtcHR5KG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CAmJiB2LnggPD0geERvbWFpblsxXTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5oYXNEYXRhTGFiZWwgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciBjb25maWcgPSB0aGlzLmNvbmZpZztcbiAgICAgICAgaWYgKHR5cGVvZiBjb25maWcuZGF0YV9sYWJlbHMgPT09ICdib29sZWFuJyAmJiBjb25maWcuZGF0YV9sYWJlbHMpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBjb25maWcuZGF0YV9sYWJlbHMgPT09ICdvYmplY3QnICYmIG5vdEVtcHR5KGNvbmZpZy5kYXRhX2xhYmVscykpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldERhdGFMYWJlbExlbmd0aCA9IGZ1bmN0aW9uIChtaW4sIG1heCwga2V5KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBsZW5ndGhzID0gWzAsIDBdLCBwYWRkaW5nQ29lZiA9IDEuMztcbiAgICAgICAgJCQuc2VsZWN0Q2hhcnQuc2VsZWN0KCdzdmcnKS5zZWxlY3RBbGwoJy5kdW1teScpXG4gICAgICAgICAgICAuZGF0YShbbWluLCBtYXhdKVxuICAgICAgICAgICAgLmVudGVyKCkuYXBwZW5kKCd0ZXh0JylcbiAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uIChkKSB7IHJldHVybiAkJC5kYXRhTGFiZWxGb3JtYXQoZC5pZCkoZCk7IH0pXG4gICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoZCwgaSkge1xuICAgICAgICAgICAgICAgIGxlbmd0aHNbaV0g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cnMgPT09ICd1bmRlZmluZWQnKSB7IHJldHVybiBjdXJyZW50OyB9XG4gICAgICAgIE9iamVjdC5rZXlzKGF0dHJzKS5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgY3VycmVudFtpZF0gPSBhdHRyc1tpZF07XG4gICAgICAgIH0pO1xuICAgICAgICAkJC5yZWRyYXcoe3dpdGhMZWdlbmQ6IHRydWV9KTtcbiAgICAgICAgcmV0dXJuIGN1cnJlbnQ7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRVcmxUb0RhdGEgPSBmdW5jdGlvbiAodXJsLCBtaW1lVHlwZSwgaGVhZGVycywga2V5cywgZG9uZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCB0eXBlID0gbWltZVR5cGUgPyBtaW1lVHlwZSA6ICdjc3YnO1xuICAgICAgICB2YXIgcmVxID0gJCQuZDMueGhyKHVybCk7XG4gICAgICAgIGlmIChoZWFkZXJzKSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhoZWFkZXJzKS5mb3JFYWNoKGZ1bmN0aW9uIChoZWFkZXIpIHtcbiAgICAgICAgICAgICAgICByZXEuaGVhZGVyKGhlYWRlciwgaGVhZGVyc1toZWFkZXJdKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJlcS5nZXQoZnVuY3Rpb24gKGVycm9yLCBkYXRhKSB7XG4gICAgICAgICAgICB2YXIgZDtcbiAgICAgICAgICAgIGlmICghZGF0YSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihlcnJvci5yZXNwb25zZVVSTCArICcgJyArIGVycm9yLnN0YXR1cyArICcgKCcgKyBlcnJvci5zdGF0dXNUZXh0ICsgJyknKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0eXBlID09PSAnanNvbicpIHtcbiAgICAgICAgICAgICAgICBkID0gJCQuY29udmVydEpzb25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HJldHVybiB0aGlzLmNvbnZlcnRYc3ZUb0RhdGEodHN2LCB0aGlzLmQzLnRzdik7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0SnNvblRvRGF0YSA9IGZ1bmN0aW9uIChqc29uLCBrZXlzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBuZXdfcm93cyA9IFtdLCB0YXJnZXRLZXlzLCBkYXRhO1xuICAgICAgICBpZiAoa2V5cykgeyAvLyB3aGVuIGtleXMgc3BlY2lmaWVkLCBqc29uIHdvdWxkIGJlIGFuIGFycmF5IHRoYXQgaW5jbHVkZXMgb2JqZWN0c1xuICAgICAgICAgICAgaWYgKGtleXMueCkge1xuICAgICAgICAgICAgICAgIHRhcmdldEtleXMgPSBrZXlzLnZhbHVlLmNvbmNhdChrZXlzLngpO1xuICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX3ggPSBrZXlzLng7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRhcmdldEtleXMgPSBrZXlzLnZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmV3X3Jvd3MucHVzaCh0YXJnZXRLZXlzKTtcbiAgICAgICAgICAgIGpzb24uZm9yRWFjaChmdW5jdGlvbiAobykge1xuICAgICAgICAgICAgICAgIHZhciBuZXdfcm93ID0gW107XG4gICAgICAgICAgICAgICAgdGFyZ2V0S2V5cy5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gY29udmVydCB1bmRlZmluZWQgdG8gbnVsbCBiZWNhdXNlIHVuZGVmaW5lZCBkYXRhIHdpbGwgYmUgcmVtb3ZlZCBpbiBjb252ZXJ0RGF0YVRvVGFyZ2V0cygpXG4gICAgICAgICAgICAgICAgICAgIHZhciB2ID0gJCQuZmluZFZhbHVlSW5Kc29uKG8sIGtleSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZCh2KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdiA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbmV3X3Jvdy5wdXNoKHYpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIG5ld19yb3dzLnB1c2gobmV3X3Jvdyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGRhdGEgPSAkJC5jb252ZXJ0Um93c1RvRGF0YShuZXdfcm93cyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhqc29uKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICBuZXdfcm93cy5wdXNoKFtrZXldLmNvbmNhdChqc29uW2tleV0pKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRDb2x1bW5zVG9EYXRhKG5ld19yb3dzKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZGF0YTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmZpbmRWYWx1ZUluSnNvbiA9IGZ1bmN0aW9uIChvYmplY3QsIHBhdGgpIHtcbiAgICAgICAgcGF0aCA9IHBhdGgucmVwbGFjZSgvXFxbKFxcdyspXFxdL2csICcuJDEnKTsgLy8gY29udmVydCBpbmRleGVzIHRvIHByb3BlcnRpZXMgKHJlcGxhY2UgW10gd2l0aCAuKVxuICAgICAgICBwYXRoID0gcGF0aC5yZXBsYWNlKC9eXFwuLywgJycpOyAgICAgICAgICAgLy8gc3RyaXAgYSBsZWFkaW5nIGRvdFxuICAgICAgICB2YXIgcGF0aEFycmF5ID0gcGF0aC5zcGxpdCgnLicpO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHBhdGhBcnJheS5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgdmFyIGsgPSBwYXRoQXJyYXlbaV07XG4gICAgICAgICAgICBpZiAoayBpbiBvYmplY3QpIHtcbiAgICAgICAgICAgICAgICBvYmplY3QgPSBvYmplY3Rba107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb2JqZWN0O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uY29udmVydFJvd3NUb0RhdGEgPSBmdW5jdGlvbiAocm93cykge1xuICAgICAgICB2YXIga2V5cyA9IHJvd3NbMF0sIG5ld19yb3cgPSB7fSwgbmV3X3Jvd3MgPSBbXSwgaSwgajtcbiAgICAgICAgZm9yIChpID0gMTsgaSA8IHJvd3MubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIG5ld19yb3cgPSB7fTtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCByb3dzW2ldLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHJvd3NbaV1bal0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlNvdXJjZSBkYXRhIGlzIG1pc3NpbmcgYSBjb21wb25lbnQgYXQgKFwiICsgaSArIFwiLFwiICsgaiArIFwiKSFcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5ld19yb3dba2V5c1tqXV0gPSByb3dzW2ldW2pdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbmV3X3Jvd3MucHVzaChuZXdfcm93KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3X3Jvd3M7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0Q29sdW1uc1RvRGF0YSA9IGZ1bmN0aW9uIChjb2x1bW5zKSB7XG4gICAgICAgIHZhciBuZXdfcm93cyA9IFtdLCBpLCBqLCBrZXk7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBjb2x1bW5zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBrZXkgPSBjb2x1bW5zW2ldWzBdO1xuICAgICAgICAgICAgZm9yIChqID0gMTsgaiA8IGNvbHVtbnNbaV0ubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQobmV3X3Jvd3NbaiAtIDFdKSkge1xuICAgICAgICAgICAgICAgICAgICBuZXdfcm93c1tqIC0gMV0gPSB7fTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGNvbHVtbnNbaV1bal0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlNvdXJjZSBkYXRhIGlzIG1pc3NpbmcgYSBjb21wb25lbnQgYXQgKFwiICsgaSArIFwiLFwiICsgaiArIFwiKSFcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5ld19yb3dzW2ogLSAxXVtrZXldID0gY29sdW1uc1tpXVtqXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbmV3X3Jvd3M7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0RGF0YVRvVGFyZ2V0cyA9IGZ1bmN0aW9uIChkYXRhLCBhcHBlbmRYcykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBpZHMgPSAkJC5kMy5rZXlzKGRhdGFbMF0pLmZpbHRlcigkJC5pc05vdFgsICQkKSxcbiAgICAgICAgICAgIHhzID0gJCQuZDMua2V5cyhkYXRhWzBdKS5maWx0ZXIoJCQuaXNYLCAkJCksXG4gICAgICAgICAgICB0YXJnZXRzO1xuXG4gICAgICAgIC8vIHNhdmUgeCBmb3IgdXBkYXRlIGRhdGEgYnkgbG9hZCB3aGVuIGN1c3RvbSB4IGFuZCBjMy54IEFQSVxuICAgICAgICBpZHMuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgIHZhciB4S2V5ID0gJCQuZ2V0WEtleShpZCk7XG5cbiAgICAgICAgICAgIGlmICgkJC5pc0N1c3RvbVgoKSB8fCAkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgIC8vIGlmIGluY2x1ZGVkIGluIGlucHV0IGRhdGFcbiAgICAgICAgICAgICAgICBpZiAoeHMuaW5kZXhPZih4S2V5KSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmRhdGEueHNbaWRdID0gKGFwcGVuZFhzICYmICQkLmRhdGEueHNbaWRdID8gJCQuZGF0YS54c1tpZF0gOiBbXSkuY29uY2F0KFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGRbeEtleV07IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlcihpc1ZhbHVlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoZnVuY3Rpb24gKHJhd1gsIGkpIHsgcmV0dXJuICQkLmdlbmVyYXRlVGFyZ2V0WChyYXdYLCBpZCwgaSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGlmIG5vdCBpbmNsdWRlZCBpbiBpbnB1dCBkYXRhLCBmaW5kIGZyb20gcHJlbG9hZGVkIGRhdGEgb2Ygb3RoZXIgaWQncyB4XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoY29uZmlnLmRhdGFfeCkge1xuICAgICAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9ICQkLmdldE90aGVyVGFyZ2V0WHMoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gaWYgbm90IGluY2x1ZGVkIGluIGlucHV0IGRhdGEsIGZpbmQgZnJvbSBwcmVsb2FkZWQgZGF0YVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKG5vdEVtcHR5KGNvbmZpZy5kYXRhX3hzKSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9ICQkLmdldFhWYWx1ZXNPZlhLZXkoeEtleSwgJCQuZGF0YS50YXJnZXRzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gTUVNTzogaWYgbm8geCBpbmNsdWRlZCwgdXNlIHNhbWUgeCBvZiBjdXJyZW50IHdpbGwgYmUgdXNlZFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAkJC5kYXRhLnhzW2lkXSA9IGRhdGEubWFwKGZ1bmN0aW9uIChkLCBpKSB7IHJldHVybiBpOyB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cblxuICAgICAgICAvLyBjaGVjayB4IGlzIGRlZmluZWRcbiAgICAgICAgaWRzLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICBpZiAoISQkLmRhdGEueHNbaWRdKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd4IGlzIG5vdCBkZWZpbmVkIGZvciBpZCA9IFwiJyArIGlkICsgJ1wiLicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBjb252ZXJ0IHRvIHRhcmdldFxuICAgICAgICB0YXJnZXRzID0gaWRzLm1hcChmdW5jdGlvbiAoaWQsIGluZGV4KSB7XG4gICAgICAgICAgICB2YXIgY29udmVydGVkSWQgPSBjb25maWcuZGF0YV9pZENvbnZlcnRlcihpZCk7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIGlkOiBjb252ZXJ0ZWRJZCxcbiAgICAgICAgICAgICAgICBpZF9vcmc6IGlkLFxuICAgICAgICAgICAgICAgIHZhbHVlczogZGF0YS5tYXAoZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHhLZXkgPSAkJC5nZXRYS2V5KGlkKSwgcmF3WCA9IGRbeEtleV0sXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGRbaWRdICE9PSBudWxsICYmICFpc05hTihkW2lkXSkgPyArZFtpZF0gOiBudWxsLCB4O1xuICAgICAgICAgICAgICAgICAgICAvLyB1c2UgeCBhcyBjYXRlZ29yaWVzIGlmIGN1c3RvbSB4IGFuZCBjYXRlZ29yaXplZFxuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuaXNDdXN0b21YKCkgJiYgJCQuaXNDYXRlZ29yaXplZCgpICYmIGluZGV4ID09PSAwICYmICFpc1VuZGVmaW5lZChyYXdYKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwICYmIGkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuYXhpc194X2NhdGVnb3JpZXMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSBjb25maWcuYXhpc194X2NhdGVnb3JpZXMuaW5kZXhPZihyYXdYKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh4ID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSBjb25maWcuYXhpc194X2NhdGVnb3JpZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3hfY2F0ZWdvcmllcy5wdXNoKHJhd1gpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgeCAgPSAkJC5nZW5lcmF0ZVRhcmdldFgocmF3WCwgaWQsIGkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIC8vIG1hcmsgYXMgeCA9IHVuZGVmaW5lZCBpZiB2YWx1ZSBpcyB1bmRlZmluZWQgYW5kIGZpbHRlciB0byByZW1vdmUgYWZ0ZXIgbWFwcGVkXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChkW2lkXSkgfHwgJCQuZGF0YS54c1tpZF0ubGVuZ3RoIDw9IGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHggPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHt4OiB4LCB2YWx1ZTogdmFsdWUsIGlkOiBjb252ZXJ0ZWRJZH07XG4gICAgICAgICAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uICh2KSB7IHJldHVybiBpc0RlZmluZWQodi54KTsgfSlcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIGZpbmlzaCB0YXJnZXRzXG4gICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgdmFyIGk7XG4gICAgICAgICAgICAvLyBzb3J0IHZhbHVlcyBieSBpdHMgeFxuICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3hTb3J0KSB7XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMgPSB0LnZhbHVlcy5zb3J0KGZ1bmN0aW9uICh2MSwgdjIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHgxID0gdjEueCB8fCB2MS54ID09PSAwID8gdjEueCA6IEluZmluaXR5LFxuICAgICAgICAgICAgICAgICAgICAgICAgeDIgPSB2Mi54IHx8IHYyLnggPT09IDAgPyB2Mi54IDogSW5maW5pdHk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB4MSAtIHgyO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICA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HtcbiAgICAgICAgICAgICQkLmFkZENhY2hlKGQuaWRfb3JnLCBkKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIHRhcmdldHM7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmxvYWQgPSBmdW5jdGlvbiAodGFyZ2V0cywgYXJncykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICBpZiAodGFyZ2V0cykge1xuICAgICAgICAgICAgLy8gZmlsdGVyIGxvYWRpbmcgdGFyZ2V0cyBpZiBuZWVkZWRcbiAgICAgICAgICAgIGlmIChhcmdzLmZpbHRlcikge1xuICAgICAgICAgICAgICAgIHRhcmdldHMgPSB0YXJnZXRzLmZpbHRlcihhcmdzLmZpbHRlcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBzZXQgdHlwZSBpZiBhcmdzLnR5cGVzIHx8IGFyZ3MudHlwZSBzcGVjaWZpZWRcbiAgICAgICAgICAgIGlmIChhcmdzLnR5cGUgfHwgYXJncy50eXBlcykge1xuICAgICAgICAgICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdHlwZSA9IGFyZ3MudHlwZXMgJiYgYXJncy50eXBlc1t0LmlkXSA/IGFyZ3MudHlwZXNbdC5pZF0gOiBhcmdzLnR5cGU7XG4gICAgICAgICAgICAgICAgICAgICQkLnNldFRhcmdldFR5cGUodC5pZCwgdHlwZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBVcGRhdGUvQWRkIGRhdGFcbiAgICAgICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0YXJnZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlm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mdW5jdGlvbiAoZCkgeyByZXR1cm4gZDsgfSk7XG5cbiAgICAgICAgaWYgKCQkLmlzTXVsdGlwbGVYKCkpIHtcbiAgICAgICAgICAgIC8vIFRPRE86IHJvdGF0ZWQgbm90IHN1cHBvcnRlZCB5ZXRcbiAgICAgICAgICAgIHggPSAwO1xuICAgICAgICAgICAgeSA9IDA7XG4gICAgICAgICAgICB3ID0gJCQud2lkdGg7XG4gICAgICAgICAgICBoID0gJCQuaGVpZ2h0O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKCgkJC5pc0N1c3RvbVgoKSB8fCAkJC5pc1RpbWVTZXJpZXMoKSkgJiYgISQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuXG4gICAgICAgICAgICAgICAgLy8gdXBkYXRlIGluZGV4IGZvciB4IHRoYXQgaXMgdXNlZCBieSBwcmV2WCBhbmQgbmV4dFhcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVYcygpO1xuXG4gICAgICAgICAgICAgICAgcmVjdFcgPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJldlggPSAkJC5nZXRQcmV2WChkLmluZGV4KSwgbmV4dFggPSAkJC5nZXROZXh0WChkLmluZGV4KTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSB0aGlzIGlzIGEgc2luZ2xlIGRhdGEgcG9pbnQgbWFrZSB0aGUgZXZlbnRSZWN0IGZ1bGwgd2lkdGggKG9yIGhlaWdodClcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsICYmIG5leHRYID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLmhlaWdodCA6ICQkLndpZHRoO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsKSB7IHByZXZYID0gJCQueC5kb21haW4oKVswXTsgfVxuICAgICAgICAgICAgICAgICAgICBpZiAobmV4dFggPT09IG51bGwpIHsgbmV4dFggPSAkJC54LmRvbWFpbigpWzFdOyB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE1hdGgubWF4KDAsICgkJC54KG5leHRYKSAtICQkLngocHJldlgpKSAvIDIpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgcmVjdFggPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcHJldlggPSAkJC5nZXRQcmV2WChkLmluZGV4KSwgbmV4dFggPSAkJC5nZXROZXh0WChkLmluZGV4KSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNYID0gJCQuZGF0YS54c1tkLmlkXVtkLmluZGV4XTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSB0aGlzIGlzIGEgc2luZ2xlIGRhdGEgcG9pbnQgcG9zaXRpb24gdGhlIGV2ZW50UmVjdCBhdCAwXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2WCA9PT0gbnVsbCAmJiBuZXh0WCA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAocHJldlggPT09IG51bGwpIHsgcHJldlggPSAkJC54LmRvbWFpbigpWzBdOyB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgkJC54KHRoaXNYKSArICQkLngocHJldlgpKSAvIDI7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVjdFcgPSAkJC5nZXRFdmVudFJlY3RXaWR0aCgpO1xuICAgICAgICAgICAgICAgIHJlY3RYID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLngoZC54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pXG4gICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gZC5pbmRleDtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5kcmFnZ2luZyB8fCAkJC5mbG93aW5nKSB7IHJldHVybjsgfSAvLyBkbyBub3RoaW5nIHdoaWxlIGRyYWdnaW5nL2Zsb3dpbmdcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgLy8gRXhwYW5kIHNoYXBlcyBmb3Igc2VsZWN0aW9uXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZCkgeyAkJC5leHBhbmRDaXJjbGVzKGluZGV4LCBudWxsLCB0cnVlKTsgfVxuICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoaW5kZXgsIG51bGwsIHRydWUpO1xuXG4gICAgICAgICAgICAgICAgLy8gQ2FsbCBldmVudCBoYW5kbGVyXG4gICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBpbmRleCkuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9vbm1vdXNlb3Zlci5jYWxsKCQkLmFwaSwgZCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gZC5pbmRleDtcbiAgICAgICAgICAgICAgICBpZiAoISQkLmNvbmZpZykgeyByZXR1cm47IH0gLy8gY2hhcnQgaXMgZGVzdHJveWVkXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICAkJC5oaWRlWEdyaWRGb2N1cygpO1xuICAgICAgICAgICAgICAgICQkLmhpZGVUb29sdGlwKCk7XG4gICAgICAgICAgICAgICAgLy8gVW5kbyBleHBhbmRlZCBzaGFwZXNcbiAgICAgICAgICAgICAgICAkJC51bmV4cGFuZENpcmNsZXMoKTtcbiAgICAgICAgICAgICAgICAkJC51bmV4cGFuZEJhcnMoKTtcbiAgICAgICAgICAgICAgICAvLyBDYWxsIGV2ZW50IGhhbmRsZXJcbiAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIGluZGV4KS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX29ubW91c2VvdXQuY2FsbCgkJC5hcGksIGQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignbW91c2Vtb3ZlJywgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWREYXRhLCBpbmRleCA9IGQuaW5kZXgsXG4gICAgICAgICAgICAgICAgICAgIGV2ZW50UmVjdCA9ICQkLnN2Zy5zZWxlY3QoJy4nICsgQ0xBU1MuZXZlbnRSZWN0ICsgJy0nICsgaW5kZXgpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCQkLmRyYWdnaW5nIHx8ICQkLmZsb3dpbmcpIHsgcmV0dXJuOyB9IC8vIGRvIG5vdGhpbmcgd2hpbGUgZHJhZ2dpbmcvZmxvd2luZ1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNTdGVwVHlwZShkKSAmJiAkJC5jb25maWcubGluZV9zdGVwX3R5cGUgPT09ICdzdGVwLWFmdGVyJyAmJiBkMy5tb3VzZSh0aGlzKVswXSA8ICQkLngoJCQuZ2V0WFZhbHVlKGQuaWQsIGluZGV4KSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5kZXggLT0gMTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBTaG93IHRvb2x0aXBcbiAgICAgICAgICAgICAgICBzZWxlY3RlZERhdGEgPSAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cykubWFwKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5hZGROYW1lKCQkLmdldFZhbHVlT25JbmRleCh0LnZhbHVlcywgaW5kZXgpKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIGlmIChjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLnNob3dUb29sdGlwKHNlbGVjdGVkRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgICQkLnNob3dYR3JpZEZvY3VzKHNlbGVjdGVkRGF0YSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy50b29sdGlwX2dyb3VwZWQgJiYgKCFjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCB8fCBjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgaW5kZXgpXG4gICAgICAgICAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKENMQVNTLkVYUEFOREVELCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50UmVjdC5zdHlsZSgnY3Vyc29yJywgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgPyAncG9pbnRlcicgOiBudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuaGlkZVRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQ2lyY2xlcyhpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQmFycyhpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQuaXNXaXRoaW5TaGFwZSh0aGlzLCBkKTtcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCAmJiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgfHwgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2lzc2VsZWN0YWJsZShkKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFJlY3Quc3R5bGUoJ2N1cnNvcicsICdwb2ludGVyJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy50b29sdGlwX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5zaG93VG9vbHRpcChbZF0sIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnNob3dYR3JpZEZvY3VzKFtkXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5wb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZCkgeyAkJC5leHBhbmRDaXJjbGVzKGluZGV4LCBkLmlkLCB0cnVlKTsgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoaW5kZXgsIGQuaWQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBkLmluZGV4O1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkgfHwgISQkLnRvZ2dsZVNoYXBlKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIGlmICgkJC5jYW5jZWxDbGljaykge1xuICAgICAgICAgICAgICAgICAgICAkJC5jYW5jZWxDbGljayA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgkJC5pc1N0ZXBUeXBlKGQpICYmIGNvbmZpZy5saW5lX3N0ZXBfdHlwZSA9PT0gJ3N0ZXAtYWZ0ZXInICYmIGQzLm1vdXNlKHRoaXMpWzBdIDwgJCQueCgkJC5nZXRYVmFsdWUoZC5pZCwgaW5kZXgpKSkge1xuICAgICAgICAgICAgICAgICAgICBpbmRleCAtPSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIGluZGV4KS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCB8fCAkJC5pc1dpdGhpblNoYXBlKHRoaXMsIGQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC50b2dnbGVTaGFwZSh0aGlzLCBkLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbmNsaWNrLmNhbGwoJCQuYXBpLCBkLCB0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYWxsKFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9kcmFnZ2FibGUgJiYgJCQuZHJhZyA/IChcbiAgICAgICAgICAgICAgICAgICAgZDMuYmVoYXZpb3IuZHJhZygpLm9yaWdpbihPYmplY3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWcnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWcoZDMubW91c2UodGhpcykpOyB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnc3RhcnQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdzdGFydChkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdlbmQnLCBmdW5jdGlvbiAoKSB7ICQkLmRyYWdlbmQoKTsgfSlcbiAgICAgICAgICAgICAgICApIDogZnVuY3Rpb24gKCkge31cbiAgICAgICAgICAgICk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlRXZlbnRSZWN0c0Zvck11bHRpcGxlWHMgPSBmdW5jdGlvbiAoZXZlbnRSZWN0RW50ZXIpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgZDMgPSAkJC5kMywgY29uZmlnID0gJCQuY29uZmlnO1xuXG4gICAgICAgIGZ1bmN0aW9uIG1vdXNlb3V0KCkge1xuICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy5ldmVudFJlY3QpLnN0eWxlKCdjdXJzb3InLCBudWxsKTtcbiAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG4gICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgJCQudW5leHBhbmRDaXJjbGVzKCk7XG4gICAgICAgICAgICAkJC51bmV4cGFuZEJhcnMoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGV2ZW50UmVjdEVudGVyLmFwcGVuZCgncmVjdCcpXG4gICAgICAgICAgICAuYXR0cigneCcsIDApXG4gICAgICAgICAgICAuYXR0cigneScsIDApXG4gICAgICAgICAgICAuYXR0cignd2lkdGgnLCAkJC53aWR0aClcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAkJC5oZWlnaHQpXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCBDTEFTUy5ldmVudFJlY3QpXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICghJCQuY29uZmlnKSB7IHJldHVybjsgfSAvLyBjaGFydCBpcyBkZXN0cm95ZWRcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgIG1vdXNlb3V0KCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRhcmdldHNUb1Nob3cgPSAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cyk7XG4gICAgICAgICAgICAgICAgdmFyIG1vdXNlLCBjbG9zZXN0LCBzYW1lWERhdGEsIHNlbGVjdGVkRGF0YTtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5kcmFnZ2luZykgeyByZXR1cm47IH0gLy8gZG8gbm90aGluZyB3aGVuIGRyYWdnaW5nXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUodGFyZ2V0c1RvU2hvdykpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICAgICAgICBtb3VzZSA9IGQzLm1vdXNlKHRoaXMpO1xuICAgICAgICAgICAgICAgIGNsb3Nlc3QgPSAkJC5maW5kQ2xvc2VzdEZyb21UYXJnZXRzKHRhcmdldHNUb1Nob3csIG1vdXNlKTtcblxuICAgICAgICAgICAgICAgIGlmICgkJC5tb3VzZW92ZXIgJiYgKCFjbG9zZXN0IHx8IGNsb3Nlc3QuaWQgIT09ICQkLm1vdXNlb3Zlci5pZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW91dC5jYWxsKCQkLmFwaSwgJCQubW91c2VvdmVyKTtcbiAgICAgICAgICAgICAgICAgICAgJCQubW91c2VvdmVyID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICghIGNsb3Nlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgbW91c2VvdXQoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICgkJC5pc1NjYXR0ZXJUeXBlKGNsb3Nlc3QpIHx8ICFjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHNhbWVYRGF0YSA9IFtjbG9zZXN0XTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzYW1lWERhdGEgPSAkJC5maWx0ZXJCeVgodGFyZ2V0c1RvU2hvdywgY2xvc2VzdC54KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBzaG93IHRvb2x0aXAgd2hlbiBjdXJzb3IgaXMgY2xvc2UgdG8gc29tZSBwb2ludFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0YSA9IHNhbWVYRGF0YS5tYXAoZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLmFkZE5hbWUoZCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoc2VsZWN0ZWREYXRhLCB0aGlzKTtcblxuICAgICAgICAgICAgICAgIC8vIGV4cGFuZCBwb2ludHNcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZENpcmNsZXMoY2xvc2VzdC5pbmRleCwgY2xvc2VzdC5pZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLmV4cGFuZEJhcnMoY2xvc2VzdC5pbmRleCwgY2xvc2VzdC5pZCwgdHJ1ZSk7XG5cbiAgICAgICAgICAgICAgICAvLyBTaG93IHhncmlkIGZvY3VzIGxpbmVcbiAgICAgICAgICAgICAgICAkJC5zaG93WEdyaWRGb2N1cyhzZWxlY3RlZERhdGEpO1xuXG4gICAgICAgICAgICAgICAgLy8gU2hvdyBjdXJzb3IgYXMgcG9pbnRlciBpZiBwb2ludCBpcyBjbG9zZSB0byBtb3VzZSBwb3NpdGlvblxuICAgICAgICAgICAgICAgIGlmICgkJC5pc0JhclR5cGUoY2xvc2VzdC5pZCkgfHwgJCQuZGlzdChjbG9zZXN0LCBtb3VzZSkgPCBjb25maWcucG9pbnRfc2Vuc2l0aXZpdHkpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy5ldmVudFJlY3QpLnN0eWxlKCdjdXJzb3InLCAncG9pbnRlcicpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoISQkLm1vdXNlb3Zlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW92ZXIuY2FsbCgkJC5hcGksIGNsb3Nlc3QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQubW91c2VvdmVyID0gY2xvc2VzdDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciB0YXJnZXRzVG9TaG93ID0gJCQuZmlsdGVyVGFyZ2V0c1RvU2hvdygkJC5kYXRhLnRhcmdldHMpO1xuICAgICAgICAgICAgICAgIHZhciBtb3VzZSwgY2xvc2VzdDtcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSh0YXJnZXRzVG9TaG93KSkgeyByZXR1cm47IH1cblxuICAgICAgICAgICAgICAgIG1vdXNlID0gZDMubW91c2UodGhpcyk7XG4gICAgICAgICAgICAgICAgY2xvc2VzdCA9ICQkLmZpbmRDbG9zZXN0RnJvbVRhcmdldHModGFyZ2V0c1RvU2hvdywgbW91c2UpO1xuICAgICAgICAgICAgICAgIGlmICghIGNsb3Nlc3QpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgLy8gc2VsZWN0IGlmIHNlbGVjdGlvbiBlbmFibGVkXG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzQmFyVHlwZShjbG9zZXN0LmlkKSB8fCAkJC5kaXN0KGNsb3Nlc3QsIG1vdXNlKSA8IGNvbmZpZy5wb2ludF9zZW5zaXRpdml0eSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZXMgKyAkJC5nZXRUYXJnZXRTZWxlY3RvclN1ZmZpeChjbG9zZXN0LmlkKSkuc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgY2xvc2VzdC5pbmRleCkuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQgfHwgJCQuaXNXaXRoaW5TaGFwZSh0aGlzLCBjbG9zZXN0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZVNoYXBlKHRoaXMsIGNsb3Nlc3QsIGNsb3Nlc3QuaW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29uY2xpY2suY2FsbCgkJC5hcGksIGNsb3Nlc3QsIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhbGwoXG4gICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2RyYWdnYWJsZSAmJiAkJC5kcmFnID8gKFxuICAgICAgICAgICAgICAgICAgICBkMy5iZWhhdmlvci5kcmFnKCkub3JpZ2luKE9iamVjdClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZycsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZyhkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdzdGFydCcsIGZ1bmN0aW9uICgpIH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RDaGFydC5ub2RlKCksIHY7XG4gICAgICAgIHdoaWxlIChwYXJlbnQgJiYgcGFyZW50LnRhZ05hbWUgIT09ICdCT0RZJykge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB2ID0gcGFyZW50LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpW2tleV07XG4gICAgICAgICAgICB9IGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgICBpZiAoa2V5ID09PSAnd2lkdGgnKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEluIElFIGluIGNlcnRhaW4gY2FzZXMgZ2V0Qm91bmRpbmdDbGllbnRSZWN0XG4gICAgICAgICAgICAgICAgICAgIC8vIHdpbGwgY2F1c2UgYW4gXCJ1bnNwZWNpZmllZCBlcnJvclwiXG4gICAgICAgICAgICAgICAgICAgIHYgPSBwYXJlbnQub2Zmc2V0V2lkdGg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmVudCA9IHBhcmVudC5wYXJlbnROb2RlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0UGFyZW50V2lkdGggPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmdldFBhcmVudFJlY3RWYWx1ZSgnd2lkdGgnKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFBhcmVudEhlaWdodCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGggPSB0aGlzLnNlbGVjdENoYXJ0LnN0eWxlKCdoZWlnaHQnKTtcbiAgICAgICAgcmV0dXJuIGguaW5kZXhPZigncHgnKSA+IDAgPyAraC5yZXBsYWNlKCdweCcsICcnKSA6IDA7XG4g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0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cy5maWx0ZXIodHlwZUZpbHRlciwgJCQpKS5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgY29uZmlnLmRhdGFfZ3JvdXBzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX2dyb3Vwc1tqXS5pbmRleE9mKGQuaWQpIDwgMCkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBjb25maWcuZGF0YV9ncm91cHNbal0ubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX2dyb3Vwc1tqXVtrXSBpbiBpbmRpY2VzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRpY2VzW2QuaWRdID0gaW5kaWNlc1tjb25maWcuZGF0YV9ncm91cHNbal1ba11dO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoaW5kaWNlc1tkLmlkXSkpIHsgaW5kaWNlc1tkLmlkXSA9IGkrKzsgfVxuICAgICAgICB9KTtcbiAgICAgICAgaW5kaWNlcy5fX21heF9fID0gaSAtIDE7XG4gICAgICAgIHJldHVybiBpbmRpY2VzO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0U2hhcGVYID0gZnVuY3Rpb24gKG9mZnNldCwgdGFyZ2V0c051bSwgaW5kaWNlcywgaXNTdWIpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgc2NhbGUgPSBpc1N1YiA/ICQkLnN1YlggOiAkJC54O1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGQpIHtcbiAgIC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wID0gc2NhbGUoMCksIG9mZnNldCA9IHkwO1xuICAgICAgICAgICAgdGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICAgICAgdmFyIHZhbHVlcyA9ICQkLmlzU3RlcFR5cGUoZCkgPyAkJC5jb252ZXJ0VmFsdWVzVG9TdGVwKHQudmFsdWVzKSA6IHQudmFsdWVzO1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSBkLmlkIHx8IGluZGljZXNbdC5pZF0gIT09IGluZGljZXNbZC5pZF0pIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgaWYgKHRhcmdldElkcy5pbmRleE9mKHQuaWQpIDwgdGFyZ2V0SWRzLmluZGV4T2YoZC5pZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgdGhlIHggdmFsdWVzIGxpbmUgdXBcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZXNbaV0gPT09ICd1bmRlZmluZWQnIHx8ICt2YWx1ZXNbaV0ueCAhPT0gK2QueCkgeyAgLy8gXCIrXCIgZm9yIHRpbWVzZXJpZXNcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIG5vdCwgdHJ5IHRvIGZpbmQgdGhlIHZhbHVlIHRoYXQgZG9lcyBsaW5lIHVwXG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodiwgaikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2LnggPT09IGQueCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gajtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoaSBpbiB2YWx1ZXMgJiYgd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0pOyB9XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgdmFyIHZhbHVlcyA9IGNvbmZpZy5saW5lX2Nvbm5lY3ROdWxsID8gJCQuZmlsdGVyUmVtb3ZlTnVsbChkLnZhbHVlcykgOiBkLnZhbHVlcyxcbiAgICAgICAgICAgICAgICB4ID0gaXNTdWIgPyAkJC54IDogJCQuc3ViWCwgeSA9IHlTY2FsZUdldHRlci5jYWxsKCQkLCBkLmlkKSwgeDAgPSAwLCB5MCA9IDAsIHBhdGg7XG4gICAgICAgICAgICBpZiAoJCQuaXNMaW5lVHlwZShkKSkge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9yZWdpb25zW2QuaWRdKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSAkJC5saW5lV2l0aFJlZ2lvbnModmFsdWVzLCB4LCB5LCBjb25maWcuZGF0YV9yZWdpb25zW2QuaWRdKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuaXNTdGVwVHlwZShkKSkgeyB2YWx1ZXMgPSAkJC5jb252ZXJ0VmFsdWVzVG9TdGVwKHZhbHVlcyk7IH1cbiAgICAgICAgICAgICAgICAgICAgcGF0aCA9IGxpbmUuaW50ZXJwb2xhdGUoJCQuZ2V0SW50ZXJwb2xhdGUoZCkpKHZhbHVlcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWVzWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgIHgwID0geCh2YWx1ZXNbMF0ueCk7XG4gICAgICAgICAgICAgICAgICAgIHkwID0geSh2YWx1ZXNbMF0udmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwYXRoID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IFwiTSBcIiArIHkwICsgXCIgXCIgKyB4MCA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ID8gMC41IDogMCxcbiAgICAgICAgICAgIHhWYWx1ZSwgeVZhbHVlLFxuICAgICAgICAgICAgcmVnaW9ucyA9IFtdO1xuXG4gICAgICAgIGZ1bmN0aW9uIGlzV2l0aGluUmVnaW9ucyh4LCByZWdpb25zKSB7XG4gICAgICAgICAgICB2YXIgaTtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCByZWdpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlZ2lvbnNbaV0uc3RhcnQgPCB4ICYmIHggPD0gcmVnaW9uc1tpXS5lbmQpIHsgcmV0dXJuIHRydWU7IH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENoZWNrIHN0YXJ0L2VuZCBvZiByZWdpb25zXG4gICAgICAgIGlmIChpc0RlZmluZWQoX3JlZ2lvbnMpKSB7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgX3JlZ2lvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICByZWdpb25zW2ldID0ge307XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKF9yZWdpb25zW2ldLnN0YXJ0KSkge1xuICAgICAgICAgICAgICAgICAgICByZWdpb25zW2ldLnN0YXJ0ID0gZFswXS54O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlZ2lvbnNbaV0uc3RhcnQgPSAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLnBhcnNlRGF0ZShfcmVnaW9uc1tpXS5zdGFydCkgOiBfcmVnaW9uc1tpXS5zdGFydDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKF9yZWdpb25zW2ldLmVuZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVnaW9uc1tpXS5lbmQgPSBkW2QubGVuZ3RoIC0gMV0ueDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZWdpb25zW2ldLmVuZCA9ICQkLmlzVGltZVNlcmllcygpID8gJCQucGFyc2VEYXRlKF9yZWdpb25zW2ldLmVuZCkgOiBfcmVnaW9uc1tpXS5lbmQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2V0IHNjYWxlc1xuICAgICAgICB4VmFsdWUgPSBjb25maWcuYXhpc19yb3RhdGVkID8gZnVuY3Rpb24gKGQpIHsgcmV0dXJuIHkoZC52YWx1ZSk7IH0gOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4geChkLngpOyB9O1xuICAgICAgICB5VmFsdWUgPSBjb25maWcuYXhpc19yb3RhdGVkID8gZnVuY3Rpb24gKGQpIHsgcmV0dXJuIHgoZC54KTsgfSA6IGZ1bmN0aW9uIChkKSB7IHJldHVybiB5KGQudmFsdWUpOyB9O1xuXG4gICAgICAgIC8vIERlZmluZSBzdmcgZ2VuZXJhdG9yIGZ1bmN0aW9uIGZvciByZWdpb25cbiAgICAgICAgZnVuY3Rpb24gZ2VuZXJhdGVNKHBvaW50cykge1xuICAgICAgICAgICAgcmV0dXJuICdNJyArIHBvaW50c1swXVswXSArICcgJyArIHBvaW50c1swXVsxXSArICcgJyArIHBvaW50c1sxXVswXSArICcgJyArIHBvaW50c1sxXVsxXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgIHNXaXRoUmVnaW9uID0gZnVuY3Rpb24gKGQwLCBkMSwgaiwgZGlmZikge1xuICAgICAgICAgICAgICAgIHZhciB4MCA9IGQwLnguZ2V0VGltZSgpLCB4X2RpZmYgPSBkMS54IC0gZDAueCxcbiAgICAgICAgICAgICAgICAgICAgeHYwID0gbmV3IERhdGUoeDAgKyB4X2RpZmYgKiBqKSxcbiAgICAgICAgICAgICAgICAgICAgeHYxID0gbmV3IERhdGUoeDAgKyB4X2RpZmYgKiAoaiArIGRpZmYpKSxcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzO1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeSh5cChqKSksIHgoeHYwKV0sIFt5KHlwKGogKyBkaWZmKSksIHgoeHYxKV1dO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeCh4djApLCB5KHlwKGopKV0sIFt4KHh2MSksIHkoeXAoaiArIGRpZmYpKV1dO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZ2VuZXJhdGVNKHBvaW50cyk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc1dpdGhSZWdpb24gPSBmdW5jdGlvbiAoZDAsIGQxLCBqLCBkaWZmKSB7XG4gICAgICAgICAgICAgICAgdmFyIHBvaW50cztcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBwb2ludHMgPSBbW3koeXAoaiksIHRydWUpLCB4KHhwKGopKV0sIFt5KHlwKGogKyBkaWZmKSwgdHJ1ZSksIHgoeHAoaiArIGRpZmYpKV1dO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeCh4cChqKSwgdHJ1ZSksIHkoeXAoaikpXSwgW3goeHAoaiArIGRpZmYpLCB0cnVlKSwgeSh5cChqICsgZGlmZikpXV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBnZW5lcmF0ZU0ocG9pbnRzKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICAvLyBHZW5lcmF0ZVxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xuXG4gICAgICAgICAgICAvLyBEcmF3IGFzIG5vcm1hbFxuICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHJlZ2lvbnMpIHx8ICEgaXNXaXRoaW5SZWdpb25zKGRbaV0ueCwgcmVnaW9ucykpIHtcbiAgICAgICAgICAgICAgICBzICs9IFwiIFwiICsgeFZhbHVlKGRbaV0pICsgXCIgXCIgKyB5VmFsdWUoZFtpXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBEcmF3IHdpdGggcmVnaW9uIC8vIFRPRE86IEZpeCBmb3IgaG9yaXpvdGFsIGNoYXJ0c1xuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgeHAgPSAkJC5nZXRTY2FsZShkW2kgLSAxXS54ICsgeE9mZnNldCwgZFtpXS54ICsgeE9mZnNldCwgJCQuaXNUaW1lU2VyaWVzKCkpO1xuICAgICAgICAgICAgICAgIHlwID0gJCQuZ2V0U2NhbGUoZFtpIC0gMV0udmFsdWUsIGRbaV0udmFsdWUpO1xuXG4gICAgICAgICAgICAgICAgZHggPSB4KGRbaV0ueCkgLSB4KGRbaSAtIDFdLngpO1xuICAgICAgICAgICAgICAgIGR5ID0geShkW2ldLnZhbHVlKSAtIHkoZFtpIC0gMV0udmFsdWUpO1xuICAgICAgICAgICAgICAgIGRkID0gTWF0aC5zcXJ0KE1hdGgucG93KGR4LCAyKSArIE1hdGgucG93KGR5LCAyKSk7XG4gICAgICAgICAgICAgICAgZGlmZiA9IDIgLyBkZDtcbiAgICAgICAgICAgICAgICBkaWZmeDIgPSBkaWZmICogMjtcblxuICAgICAgICAgICAgICAgIGZvciAoaiA9IGRpZmY7IGogPD0gMTsgaiArPSBkaWZmeDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcyArPSBzV2l0aFJlZ2lvbihkW2kgLSAxXSwgZFtpXSw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3RhdGVkLCBub3QgYXBwbGljYWJsZSBmb3Igc3ViIGNoYXJ0XG4gICAgICAgICAgICB2YXIgaW5kZXhYID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDEgOiAwO1xuICAgICAgICAgICAgdmFyIGluZGV4WSA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogMTtcblxuICAgICAgICAgICAgdmFyIHBhdGggPSAnTSAnICsgcG9pbnRzWzBdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbMF1baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICdMJyArIHBvaW50c1sxXVtpbmRleFhdICsgJywnICsgcG9pbnRzWzFdW2luZGV4WV0gKyAnICcgK1xuICAgICAgICAgICAgICAgICAgICAnTCcgKyBwb2ludHNbMl1baW5kZXhYXSArICcsJyArIHBvaW50c1syXVtpbmRleFldICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgJ0wnICsgcG9pbnRzWzNdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbM11baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICd6JztcblxuICAgICAgICAgICAgcmV0dXJuIHBhdGg7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUdldEJhclBvaW50cyA9IGZ1bmN0aW9uIChiYXJJbmRpY2VzLCBpc1N1Yikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgYXhpcyA9IGlzU3ViID8gJCQuc3ViWEF4aXMgOiAkJC54QXhpcyxcbiAgICAgICAgICAgIGJhclRhcmdldHNOdW0gPSBiYXJJbmRpY2VzLl9fbWF4X18gKyAxLFxuICAgICAgICAgICAgYmFyVyA9ICQkLmdldEJhclcoYXhpcywgYmFyVGFyZ2V0c051bSksXG4gICAgICAgICAgICBiYXJYID0gJCQuZ2V0U2hhcGVYKGJhclcsIGJhclRhcmdldHNOdW0sIGJhckluZG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AgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB4UG9zO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WUZvclRleHQgPSBmdW5jdGlvbiAocG9pbnRzLCBkLCB0ZXh0RWxlbWVudCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgYm94ID0gdGV4dEVsZW1lbnQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksXG4gICAgICAgICAgICB5UG9zO1xuICAgICAgICBpZiAoJCQuY29uZmlnLmF4aXNfcm90YXRlZCkge1xuICAgICAgICAgICAgeVBvcyA9IChwb2ludHNbMF1bMF0gKyBwb2ludHNbMl1bMF0gKyBib3guaGVpZ2h0ICogMC42KSAvIDI7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB5UG9zID0gcG9pbnRzWzJdWzFdO1xuICAgICAgICAgICAgaWYgKGQudmFsdWUgPCAwICB8fCAoZC52YWx1ZSA9PT0gMCAmJiAhJCQuaGFzUG9zaXRpdmVWYWx1ZSkpIHtcbiAgICAgICAgICAgICAgICB5UG9zICs9IGJveC5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzQmFyVHlwZShkKSAmJiAkJC5pc1NhZmFyaSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHlQb3MgLT0gMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoISQkLmlzQmFyVHlwZShkKSAmJiAkJC5pc0Nocm9tZSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHlQb3MgKz0gMztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHlQb3MgKz0gJCQuaXNCYXJUeXBlKGQpID8gLTMgOiAtNjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBzaG93IGxhYmVscyByZWdhcmRsZXNzI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iAgICAgICAgICAgIHRpY2tPZmZzZXQgPSAkJC5pc0NhdGVnb3JpemVkKCkgPyAkJC54QXhpcy50aWNrT2Zmc2V0KCkgOiAwO1xuXG4gICAgICAgICQkLnhncmlkQXR0ciA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB7XG4gICAgICAgICAgICAneDEnOiAwLFxuICAgICAgICAgICAgJ3gyJzogJCQud2lkdGgsXG4gICAgICAgICAgICAneTEnOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4gJCQueChkKSAtIHRpY2tPZmZzZXQ7IH0sXG4gICAgICAgICAgICAneTInOiBmdW5jdGlvbiAoZCkgeyByZXR1cm4gJCQueChkKSAtIHRpY2tPZmZzZXQ7IH1cbiAgICAgICAgfSA6IHtcbiAgICAgICAgICAgICd4MSc6IGZ1bmN0aW9uIChkKSB7IHJldHVybiAkJC54KGQpICsgdGlja09mZnNldDsgfSxcbiAgICAgICAgICAgICd4Mic6IGZ1bmN0aW9uIChkKSB7IHJldHVybiAkJC54KGQpICsgdGlja09mZnNldDsgfSxcbiAgICAgICAgICAgICd5MSc6IDAsXG4gICAgICAgICAgICAneTInOiAkJC5oZWlnaHRcbiAgICAgICAgfTtcblxuICAgICAgICAkJC54Z3JpZCA9ICQkLm1haW4uc2VsZWN0KCcuJyArIENMQVNTLnhncmlkcykuc2VsZWN0QWxsKCcuJyArIENMQVNTLnhncmlkKVxuICAgICAgICAgICAgLmRhdGEoeGdyaWREYXRhKTtcbiAgICAgICAgJCQueGdyaWQuZW50ZXIoKS5hcHBlbmQoJ2xpbmUnKS5hdHRyKFwiY2xhc3NcIiwgQ0xBU1MueGdyaWQpO1xuICAgICAgICBpZiAoIXdpdGhvdXRVcGRhdGUpIHtcbiAgICAgICAgICAgICQkLnhncmlkLmF0dHIoJCQueGdyaWRBdHRyKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgZnVuY3Rpb24gKCkgeyByZXR1cm4gK2QzLnNlbGVjdCh0aG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REeClcbiAgICAgICAgICAgIC5hdHRyKCdkeScsIC01KVxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAwKTtcbiAgICAgICAgLy8gdWRwYXRlXG4gICAgICAgIC8vIGRvbmUgaW4gZDMudHJhbnNpdGlvbigpIG9mIHRoZSBlbmQgb2YgdGhpcyBmdW5jdGlvblxuICAgICAgICAvLyBleGl0XG4gICAgICAgICQkLnhncmlkTGluZXMuZXhpdCgpLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMClcbiAgICAgICAgICAgIC5yZW1vdmUoKTtcblxuICAgICAgICAvLyBZLUdyaWRcbiAgICAgICAgaWYgKGNvbmZpZy5ncmlkX3lfc2hvdykge1xuICAgICAgICAgICAgJCQudXBkYXRlWUdyaWQoKTtcbiAgICAgICAgfVxuICAgICAgICAkJC55Z3JpZExpbmVzID0gbWFpbi5zZWxlY3QoJy4nICsgQ0xBU1MueWdyaWRMaW5lcykuc2VsZWN0QWxsKCcuJyArIENMQVNTLnlncmlkTGluZSlcbiAgICAgICAgICAgIC5kYXRhKGNvbmZpZy5ncmlkX3lfbGluZXMpO1xuICAgICAgICAvLyBlbnRlclxuICAgICAgICB5Z3JpZExpbmUgPSAkJC55Z3JpZExpbmVzLmVudGVyKCkuYXBwZW5kKCdnJylcbiAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgZnVuY3Rpb24gKGQpIHsgcmV0dXJuIENMQVNTLnlncmlkTGluZSArIChkWydjbGFzcyddID8gJyAnICsgZFsnY2xhc3MnXSA6ICcnKTsgfSk7XG4gICAgICAgIHlncmlkTGluZS5hcHBlbmQoJ2xpbmUnKVxuICAgICAgICAgICAgLnN0eWxlKFwib3BhY2l0eVwiLCAwKTtcbiAgICAgICAgeWdyaWRMaW5lLmFwcGVuZCgndGV4dCcpXG4gICAgICAgICAgICAuYXR0cihcInRleHQtYW5jaG9yXCIsICQkLmdyaWRUZXh0QW5jaG9yKVxuICAgICAgICAgICAgLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IFwicm90YXRlKC05MClcIiA6IFwiXCIpXG4gICAgICAgICAgICAuYXR0cignZHgnLCAkJC5ncmlkVGV4dER4KVxuICAgICAgICAgICAgLmF0dHIoJ2R5JywgLTUpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDApO1xuICAgICAgICAvLyB1cGRhdGVcbiAgICAgICAgeXYgPSAkJC55di5iaW5kKCQkKTtcbiAgICAgICAgJCQueWdyaWRMaW5lcy5zZWxlY3QoJ2xpbmUnKVxuICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pXG4gICAgICAgICAgICAuYXR0cihcIngxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB5diA6IDApXG4gICAgICAgICAgICAuYXR0cihcIngyXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB5diA6ICQkLndpZHRoKVxuICAgICAgICAgICAgLmF0dHIoXCJ5MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IHl2KVxuICAgICAgICAgICAgLmF0dHIoXCJ5MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQuaGVpZ2h0IDogeXYpXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDEpO1xuICAgICAgICAkJC55Z3JpZExpbmVzLnNlbGVjdCgndGV4dCcpXG4gICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5hdHRyKFwieFwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQueEdyaWRUZXh0WC5iaW5kKCQkKSA6ICQkLnlHcmlkVGV4dFguYmluZCgkJCkpXG4gICAgICAgICAgICAuYXR0cihcInlcIiwgeXYpXG4gICAgICAgICAgICAudGV4dChmdW5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uICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgZ3JpZERhdGEgPSBbXSwgeERvbWFpbiwgZmlyc3RZZWFyLCBsYXN0WWVhciwgaSxcbiAgICAgICAgICAgIHRpY2tOdW0gPSAkJC5tYWluLnNlbGVjdChcIi5cIiArIENMQVNTLmF4aXNYKS5zZWxlY3RBbGwoJy50aWNrJykuc2l6ZSgpO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ3llYXInKSB7XG4gICAgICAgICAgICB4RG9tYWluID0gJCQuZ2V0WERvbWFpbigpO1xuICAgICAgICAgICAgZmlyc3RZZWFyID0geERvbWFpblswXS5nZXRGdWxsWWVhcigpO1xuICAgICAgICAgICAgbGFzdFllYXIgPSB4RG9tYWluWzFdLmdldEZ1bGxZZWFyKCk7XG4gICAgICAgICAgICBmb3IgKGkgPSBmaXJzdFllYXI7IGkgPD0gbGFzdFllYXI7IGkrKykge1xuICAgICAgICAgICAgICAgIGdyaWREYXRhLnB1c2gobmV3IERhdGUoaSArICctMDEtMDEgMDA6MDA6MDAnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBncmlkRGF0YSA9IHNjYWxlLnRpY2tzKDEwKTtcbiAgICAgICAgICAgIGlmIChncmlkRGF0YS5sZW5ndGggPiB0aWNrTnVtKSB7IC8vIHVzZSBvbmx5IGludFxuICAgICAgICAgICAgICAgIGdyaWREYXRhID0gZ3JpZERhdGEuZmlsdGVyKGZ1bmN0aW9uIChkKSB7IHJldHVybiAoXCJcIiArIGQpLmluZGV4T2YoJy4nKSA8IDA7IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBncmlkRGF0YTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldEdyaWRGaWx0ZXJUb1JlbW92ZSA9IGZ1bmN0aW9uIChwYXJhbXMpIHtcbiAgICAgICAgcmV0dXJuIHBhcmFtc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5lKS5maWx0ZXIodG9SZW1vdmUpXG4gICAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKGNvbmZpZy50cmFuc2l0aW9uX2R1cmF0aW9uKVxuICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMCkucmVtb3ZlKCk7XG4gICAgICAgIGlmIChmb3JYKSB7XG4gICAgICAgICAgICBjb25maWcuZ3JpZF94X2xpbmVzID0gY29uZmlnLmdyaWRfeF9saW5lcy5maWx0ZXIodG9TaG93KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbmZpZy5ncmlkX3lfbGluZXMgPSBjb25maWcuZ3JpZF95X2xpbmVzLmZpbHRlcih0b1Nob3cpO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmluaXRUb29sdGlwID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGk7XG4gICAgICAgICQkLnRvb2x0aXAgPSAkJC5zZWxlY3RDaGFydFxuICAgICAgICAgICAgLnN0eWxlKFwicG9zaXRpb25cIiwgXCJyZWxhdGl2ZVwiKVxuICAgICAgICAgIC5hcHBlbmQoXCJkaXZcIilcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIENMQVNTLnRvb2x0aXBDb250YWluZXIpXG4gICAgICAgICAgICAuc3R5bGUoXCJwb3NpdGlvblwiLCBcImFic29sdXRlXCIpXG4gICAgICAgICAgICAuc3R5bGUoXCJwb2ludGVyLWV2ZW50c1wiLCBcIm5vbmVcIilcbiAgICAgICAgICAgIC5zdHlsZShcImRpc3BsYXlcIiwgXCJub25lXCIpO1xuICAgICAgICAvLyBTaG93IHRvb2x0aXAgaWYgbmVlZGVkXG4gICAgICAgIGlmIChjb25maWcudG9vbHRpcF9pbml0X3Nob3cpIHtcbiAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSAmJiBpc1N0cmluZyhjb25maWcudG9vbHRpcF9pbml0X3gpKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLnRvb2x0aXBfaW5pdF94ID0gJCQucGFyc2VEYXRlKGNvbmZpZy50b29sdGlwX2luaXRfeCk7XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8ICQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzW2ldLnggLSBjb25maWcudG9vbHRpcF9pbml0X3gpID09PSAwKSB7IGJyZWFrOyB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbmZpZy50b29sdGlwX2luaXRfeCA9IGk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkJC50b29sdGlwLmh0bWwoY29uZmlnLnRvb2x0aXBfY29udGVudHMuY2FsbCgkJCwgJCQuZGF0YS50YXJnZXRzLm1hcChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAkJC5hZGROYW1lKGQudmFsdWVzW2NvbmZpZy50b29sdGlwX2luaXRfeF0pO1xuICAgICAgICAgICAgfSksICQkLmF4aXMuZ2V0WEF4aXNUaWNrRm9ybWF0KCksICQkLmdldFlGb3JtYXQoJCQuaGFzQXJjVHlwZSgpKSwgJCQuY29sb3IpKTtcbiAgICAgICAgICAgICQkLnRvb2x0aXAuc3R5bGUoXCJ0b3BcIiwgY29uZmlnLnRvb2x0aXBfaW5pdF9wb3NpdGlvbi50b3ApXG4gICAgICAgICAgICAgICAgLnN0eWxlKFwibGVmdFwiLCBjb25maWcudG9vbHRpcF9pbml0X3Bvc2l0aW9uLmxlZnQpXG4gICAgICAgICAgICAgICAgLnN0eWxlKFwiZGlzcGxheVwiLCBcImJsb2NrXCIpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9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iAgICAgICAgICAgIGQuc29ydChmdW5jdGlvbihhLCBiKSB7XG4gICAgICAgICAgICAgICAgdmFyIHYxID0gYSA/IGEudmFsdWUgOiBudWxsLCB2MiA9IGIgPyBiLnZhbHVlIDogbnVsbDtcbiAgICAgICAgICAgICAgICBpZiAodjEgPiAwICYmIHYyID4gMCkge1xuICAgICAgICAgICAgICAgICAgICB2MSA9IGEgPyBpZHMuaW5kZXhPZihhLmlkKSA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIHYyID0gYiA/IGlkcy5pbmRleE9mKGIuaWQpIDogbnVsbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9yZGVyQXNjID8gdjEgLSB2MiA6IHYyIC0gdjE7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBkLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoISAoZFtpXSAmJiAoZFtpXS52YWx1ZSB8fCBkW2ldLnZhbHVlID09PSAwKSkpIHsgY29udGludWU7IH1cblxuICAgICAgICAgICAgaWYgKCEgdGV4dCkge1xuICAgICAgICAgICAgICAgIHRpdGxlID0gc2FuaXRpc2UodGl0bGVGb3JtYXQgPyB0aXRsZUZvcm1hdChkW2ldLngpIDogZFtpXS54KTtcbiAgICAgICAgICAgICAgICB0ZXh0ID0gXCI8dGFibGUgY2xhc3M9J1wiICsgJCQuQ0xBU1MudG9vbHRpcCArIFwiJz5cIiArICh0aXRsZSB8fCB0aXRsZSA9PT0gMCA/IFwiPHRyPjx0aCBjb2xzcGFuPScyJz5cIiArIHRpdGxlICsgXCI8L3RoPjwvdHI+XCIgOiBcIlwiKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFsdWUgPSBzYW5pdGlzZSh2YWx1ZUZvcm1hdChkW2ldLnZhbHVlLCBkW2ldLnJhdGlvLCBkW2ldLmlkLCBkW2ldLmluZGV4LCBk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BpZiAocmVzZXQpIHtcbiAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCA9IDA7XG4gICAgICAgICAgICAgICAgc3RlcCA9IDA7XG4gICAgICAgICAgICAgICAgbWF4V2lkdGggPSAwO1xuICAgICAgICAgICAgICAgIG1heEhlaWdodCA9IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChjb25maWcubGVnZW5kX3Nob3cgJiYgISQkLmlzTGVnZW5kVG9TaG93KGlkKSkge1xuICAgICAgICAgICAgICAgIHdpZHRoc1tpZF0gPSBoZWlnaHRzW2lkXSA9IHN0ZXBzW2lkXSA9IG9mZnNldHNbaWRdID0gMDtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHdpZHRoc1tpZF0gPSBpdGVtV2lkdGg7XG4gICAgICAgICAgICBoZWlnaHRzW2lkXSA9IGl0ZW1IZWlnaHQ7XG5cbiAgICAgICAgICAgIGlmICghbWF4V2lkdGggfHwgaXRlbVdpZHRoID49IG1heFdpZHRoKSB7IG1heFdpZHRoID0gaXRlbVdpZHRoOyB9XG4gICAgICAgICAgICBpZiAoIW1heEhlaWdodCB8fCBpdGVtSGVpZ2h0ID49IG1heEhlaWdodCkgeyBtYXhIZWlnaHQgPSBpdGVtSGVpZ2h0OyB9XG4gICAgICAgICAgICBtYXhMZW5ndGggPSAkJC5pc0xlZ2VuZFJpZ2h0IHx8ICQkLmlzTGVnZW5kSW5zZXQgPyBtYXhIZWlnaHQgOiBtYXhXaWR0aDtcblxuICAgICAgICAgICAgaWYgKGNvbmZpZy5sZWdlbmRfZXF1YWxseSkge1xuICAgICAgICAgICAgICAgIE9iamVjdC5rZXlzKHdpZHRocykuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHsgd2lkdGhzW2lkXSA9IG1heFdpZHRoOyB9KTtcbiAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyhoZWlnaHRzKS5mb3JFYWNoKGZ1bmN0aW9uIChpZCkgeyBoZWlnaHRzW2lkXSA9IG1heEhlaWdodDsgfSk7XG4gICAgICAgICAgICAgICAgbWFyZ2luID0gKGFyZWFMZW5ndGggLSBtYXhMZW5ndGggKiB0YXJnZXRJZHMubGVuZ3RoKSAvIDI7XG4gICAgICAgICAgICAgICAgaWYgKG1hcmdpbiA8IHBvc01pbikge1xuICAgICAgICAgICAgICAgICAgICB0b3RhbExlbmd0aCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHN0ZXAgPSAwO1xuICAgICAgICAgICAgICAgICAgICB0YXJnZXRJZHMuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHsgdXBkYXRlVmFsdWVzKGlkKTsgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB1cGRhdGVWYWx1ZXMoaWQsIHRydWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdXBkYXRlVmFsdWVzKGlkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgkJC5pc0xlZ2VuZEluc2V0KSB7XG4gICAgICAgICAgICBzdGVwID0gY29uZmlnLmxlZ2VuZF9pbnNldF9zdGVwID8gY29uZmlnLmxlZ2VuZF9pbnNldF9zdGVwIDogdGFyZ2V0SWRzLmxlbmd0aDtcbiAgICAgICAgICAgICQkLnVwZGF0ZUxlZ2VuZFN0ZXAoc3RlcCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoJCQuaXNMZWdlbmRSaWdodCkge1xuICAgICAgICAgICAgeEZvckxlZ2VuZCA9IGZ1bmN0aW9uIChpZCkgeyByZXR1cm4gbWF4V2lkdGggKiBzdGVwc1tpZF07IH07XG4gICAgICAgICAgICB5Rm9yTGVnZW5kID0gZnVuY3Rpb24gKGlkKSB7IHJldHVybiBtYXJnaW5zW3N0ZXBzW2lkXV0gKyBvZm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ldmVudC5hbHRLZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmFwaS5oaWRlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5hcGkuc2hvdyhpZCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5hcGkudG9nZ2xlKGlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmlzVGFyZ2V0VG9TaG93KGlkKSA/ICQkLmFwaS5mb2N1cyhpZCkgOiAkJC5hcGkucmV2ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmxlZ2VuZF9pdGVtX29ubW91c2VvdmVyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5sZWdlbmRfaXRlbV9vbm1vdXNlb3Zlci5jYWxsKCQkLCBpZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAkJC5kMy5zZWxlY3QodGhpcykuY2xhc3NlZChDTEFTUy5sZWdlbmRJdGVtRm9jdXNlZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghJCQudHJhbnNpdGluZyAmJiAkJC5pc1RhcmdldFRvU2hvdyhpZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmFwaS5mb2N1cyhpZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcubGVnZW5kX2l0ZW1fb25tb3VzZW91dCkge1x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gICAgICAgICAgICAgICBpc0NhdGVnb3J5OiAkJC5pc0NhdGVnb3JpemVkKCksXG4gICAgICAgICAgICAgICAgd2l0aE91dGVyVGljazogd2l0aE91dGVyVGljayxcbiAgICAgICAgICAgICAgICB0aWNrTXVsdGlsaW5lOiBjb25maWcuYXhpc194X3RpY2tfbXVsdGlsaW5lLFxuICAgICAgICAgICAgICAgIHRpY2tXaWR0aDogY29uZmlnLmF4aXNfeF90aWNrX3dpZHRoLFxuICAgICAgICAgICAgICAgIHRpY2tUZXh0Um90YXRlOiB3aXRob3V0Um90YXRlVGlja1RleHQgPyAwIDogY29uZmlnLmF4aXNfeF90aWNrX3JvdGF0ZSxcbiAgICAgICAgICAgICAgICB3aXRob3V0VHJhbnNpdGlvbjogd2l0aG91dFRyYW5zaXRpb24sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYXhpcyA9IGMzX2F4aXMoJCQuZDMsIGF4aXNQYXJhbXMpLnNjYWxlKHNjYWxlKS5vcmllbnQob3JpZW50KTtcblxuICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkgJiYgdGlja1ZhbHVlcyAmJiB0eXBlb2YgdGlja1ZhbHVlcyAhPT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICB0aWNrVmFsdWVzID0gdGlja1ZhbHVlcy5tYXAoZnVuY3Rpb24gKHYpIHsgcmV0dXJuICQkLnBhcnNlRGF0ZSh2KTsgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTZXQgdGlja1xuICAgICAgICBheGlzLnRpY2tGb3JtYXQodGlja0Zvcm1hdCkudGlja1ZhbHVlcyh0aWNrVmFsdWVzKTtcbiAgICAgICAgaWYgKCQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgYXhpcy50aWNrQ2VudGVyZWQoY29uZmlnLmF4aXNfeF90aWNrX2NlbnRlcmVkKTtcbiAgICAgICAgICAgIGlmIChpc0VtcHR5KGNvbmZpZy5heGlzX3h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hvdXRSb3RhdGVUaWNrVGV4dCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLm93bmVyLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBheGlzUGFyYW1zID0ge1xuICAgICAgICAgICAgICAgIHdpdGhPdXRlclRpY2s6IHdpdGhPdXRlclRpY2ssXG4gICAgICAgICAgICAgICAgd2l0aG91dFRyYW5zaXRpb246IHdpdGhvdXRUcmFuc2l0aW9uLFxuICAgICAgICAgICAgICAgIHRpY2tUZXh0Um90YXRlOiB3aXRob3V0Um90YXRlVGlja1RleHQgPyAwIDogY29uZmlnLmF4aXNfeV90aWNrX3JvdGF0ZVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGF4aXMgPSBjM19heGlzKCQkLmQzLCBheGlzUGFyYW1zKS5zY2FsZShzY2FsZSkub3JpZW50KG9yaWVudCkudGlja0Zvcm1hdCh0aWNrRm9ybWF0KTtcbiAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllc1koKSkge1xuICAgICAgICAgICAgYXhpcy50aWNrcygkJC5kMy50aW1lW2NvbmZpZy5heGlzX3lfdGlja190aW1lX3ZhbHVlXSwgY29uZmlnLmF4aXNfeV90aWNrX3RpbWVfaW50ZXJ2YWwpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYXhpcy50aWNrVmFsdWVzKHRpY2tWYWx1ZXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBheGlzO1xuICAgIH07XG4gICAgQXhpcy5wcm90b3R5cGUuZ2V0SWQgPSBmdW5jdGlvbiBnZXRJZChpZCkge1xuICAgICAgICB2YXIgY29uZmlnID0gdGhpcy5vd25lci5jb25maWc7XG4gICAgICAgIHJldHVybiBpZCBpbiBjb25maWcuZGF0YV9heGVzID8gY29uZmlnLmRhdGFfYXhlc1tpZF0gOiAneSc7XG4gICAgfTtcbiAgICBBeGlzLnByb3RvdHlwZS5nZXRYQXhpc1RpY2tGb3JtYXQgPSBmdW5jdG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09PSAneTInKSB7XG4gICAgICAgICAgICBvcHRpb24gPSBjb25maWcuYXhpc195Ml9sYWJlbDtcbiAgICAgICAgfSBlbHNlIGlmIChheGlzSWQgPT09ICd4Jykge1xuICAgICAgICAgICAgb3B0aW9uID0gY29uZmlnLmF4aXNfeF9sYWJlbDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb3B0aW9uO1xuICAgIH07XG4gICAgQXhpcy5wcm90b3R5cGUuZ2V0TGFiZWxUZXh0ID0gZnVuY3Rpb24gZ2V0TGFiZWxUZXh0KGF4aXNJZCkge1xuICAgICAgICB2YXIgb3B0aW9uID0gdGhpcy5nZXRMYWJlbE9wdGlvbkJ5QXhpc0lkKGF4aXNJZCk7XG4gICAgICAgIHJldHVybiBpc1N0cmluZyhvcHRpb24pID8gb3B0aW9uIDogb3B0aW9uID8gb3B0aW9uLnRleHQgOiBudWxsO1xuICAgIH07XG4gICAgQXhpcy5wcm90b3R5cGUuc2V0TGFiZWxUZXh0ID0gZnVuY3Rpb24gc2V0TGFiZWxUZXh0KGF4aXNJZCwgdGV4dCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLm93bmVyLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBvcHRpb24gPSB0aGlzLmdldExhYmVsT3B0aW9uQnlBeGlzSWQoYXhpc0lkKTtcbiAgICAgICAgaWYgKGlzU3RyaW5nKG9wdGlvbikpIHtcbiAgICAgICAgICAgIGlmIChheGlzSWQgPT09ICd5Jykge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3lfbGFiZWwgPSB0ZXh0O1xuICAgICAgICAgICAgfSBlbHNlIGlmIChheGlzSWQgPT09ICd5MicpIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc195Ml9sYWJlbCA9IHRleHQ7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGF4aXNJZCA9PT0gJ3gnKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeF9sYWJlbCA9IHRleHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAob3B0aW9uKSB7XG4gICAgICAgICAgICBvcHRpb24udGV4dCA9IHRleHQ7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIEF4aXMucHJvdG90eXBlLmdldExhYmVsUG9zaXRpb24gPSBmdW5jdGlvbiBnZXRMYWJlbFBvc2l0aW9uKGF4aXNJZCwgZGVmYXVsdFBvc2l0aW9uKSB7XG4gICAgICAgIHZhciBvcHRpb24gPSB0aGlzLmdldExhYmVsT3B0aW9uQnlBeGlzSWQoYXhpc0lkKSxcbiAgICAgICAgICAgIHBvc2l0aW9uID0gKG9wdGlvbiAmJiB0eXBlb2Ygb3B0aW9uID09PSAnb2JqZWN0JyAmJiBvcHRpb24ucG9zaXRpb24pID8gb3B0aW9uLnBvc2l0aW9uIDogZGVmYXVsdFBvc2l0aW9uO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgaXNJbm5lcjogcG9zaXRpb24uaW5kZXhPZignaW5uZXInKSA+PSAwLFxuICAgICAgICAgICAgaXNPdXRlcjogcG9zaXRpb24uaW5kZXhPZignb3V0ZXInKSA+PSAwLFxuICAgICAgICAgICAgaXNMZWZ0OiBwb3NpdGlvbi5pbmRleE9mKCdsZWZ0JykgPj0gMCxcbiAgICAgICAgICAgIGlzQ2VudGVyOiBwb3NpdGlvbi5pbmRleE9mKCdjZW50ZXInKSA+PSAwLFxuICAgICAgICAgICAgaXNSaWdodDogcG9zaXRpb24uaW5kZXhPZigncmlnaHQnKSA+PSAwLFxuICAgICAgICAgICAgaXNUb3A6IHBvc2l0aW9uLmluZGV4T2YoJ3RvcCcpID49IDAsXG4gICAgICAgICAgICBpc01pZGRsZTogcG9zaXRpb24uaW5kZXhPZignbWlkZGxlJykgPj0gMCxcbiAgICAgICAgICAgIGlzQm90dG9tOiBwb3NpdGlvbi5pbmRleE9mKCdib3R0b20nKSA+PSAwXG4gICAgICAgIH07XG4gICAgfTt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1sZWdlbmQtaXRlbS1mb2N1c2VkJykuc2l6ZSgpID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuZXhwYW5kQXJjKHRhcmdldElkcyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCAxMCk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB0YXJnZXRJZHMgPSAkJC5tYXBUb1RhcmdldElkcyh0YXJnZXRJZHMpO1xuXG4gICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJCQuc2VsZWN0b3JUYXJnZXRzKHRhcmdldElkcywgJy4nICsgQ0xBU1MuY2hhcnRBcmMpKS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICBpZiAoISAkJC5zaG91bGRFeHBhbmQoZC5kYXRhLmlkKSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICQkLmQzLnNlbGVjdCh0aGlzKS5zZWxlY3RBbGwoJ3BhdGgnKVxuICAgICAgICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oJCQuZXhwYW5kRHVyYXRpb24oZC5kYXRhLmlkKSlcbiAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgJCQuc3ZnQXJjRXhwYW5kZWQpXG4gICAgICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbigkJC5leHBhbmREdXJhdGlvbihkLmRhdGEuaWQpICogMilcbiAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgJCQuc3ZnQXJjRXhwYW5kZWRTdWIpXG4gICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmlzRG9udXRUeXBlKGQuZGF0YSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNhbGxiYWNrIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICA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cmF0aW9uO1xuICAgICAgICB9IGVsc2UgaWYgKCQkLmlzUGllVHlwZShpZCkpIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcucGllX2V4cGFuZF9kdXJhdGlvbjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiA1MDtcbiAgICAgICAgfVxuXG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnNob3VsZEV4cGFuZCA9IGZ1bmN0aW9uIChpZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIHJldHVybiAoJCQuaXNEb251dFR5cGUoaWQpICYmIGNvbmZpZy5kb251dF9leHBhbmQpIHx8XG4gICAgICAgICAgICAgICAoJCQuaXNHYXVnZVR5cGUoaWQpICYmIGNvbmZpZy5nYXVnZV9leHBhbmQpIHx8XG4gICAgICAgICAgICAgICAoJCQuaXNQaWVUeXBlKGlkKSAmJiBjb25maWcucGllX2V4cGFuZCk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnNob3VsZFNob3dBcmNMYWJlbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCBzaG91bGRTaG93ID0gdHJ1ZTtcbiAgICAgICAgaWYgKCQkLmhhc1R5cGUoJ2RvbnV0JykpIHtcbiAgICAgICAgICAgIHNob3VsZFNob3cgPSBjb25maWcuZG9udXRfbGFiZWxfc2hvdztcbiAgICAgICAgfSBlbHNlIGlmICgkJC5oYXNUeXBlKCdwaWUnKSkge1xuICAgICAgICAgICAgc2hvdWxkU2hvdyA9IGNvbmZpZy5waWVfbGFiZWxfc2hvdztcbiAgICAgICAgfVxuICAgICAgICAvLyB3aGVuIGdhdWdlLCBhbHdheXMgdHJ1ZVxuICAgICAgICByZXR1cm4gc2hvdWxkU2hvdztcbiAgICB9O1xuXG4gICAgYz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wiXCI7IH0pXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIGZ1bmN0aW9uIChkKSB7IHJldHVybiBkID09PSB0aGlzLl9jdXJyZW50ID8gMCA6IDE7IH0pXG4gICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCwgYXJjRGF0YTtcbiAgICAgICAgICAgICAgICBpZiAoJCQudHJhbnNpdGluZykgeyAvLyBza2lwIHdoaWxlIHRyYW5zaXRpbmdcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCk7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIHRyYW5zaXRpb25zXG4gICAgICAgICAgICAgICAgICAgICQkLmV4cGFuZEFyYyh1cGRhdGVkLmRhdGEuaWQpO1xuICAgICAgICAgICAgICAgICAgICAkJC5hcGkuZm9jdXModXBkYXRlZC5kYXRhLmlkKTtcbiAgICAgICAgICAgICAgICAgICAgJCQudG9nZ2xlRm9jdXNMZWdlbmQodXBkYXRlZC5kYXRhLmlkLCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25tb3VzZW92ZXIoYXJjRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSA6IG51bGwpXG4gICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpLCBhcmNEYXRhLCBzZWxlY3RlZERhdGE7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCksXG4gICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0YSA9IFthcmNEYXRhXTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoc2VsZWN0ZWREYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IDogbnVsbClcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBjb25maWcuaW50ZXJhY3Rpb25fZW5hYmxlZCA/IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQsIGFyY0RhdGE7XG4gICAgICAgICAgICAgICAgaWYgKCQkLnRyYW5zaXRpbmcpIHsgLy8gc2tpcCB3aGlsZSB0cmFuc2l0aW5nXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgICAgICAvLyB0cmFuc2l0aW9uc1xuICAgICAgICAgICAgICAgICAgICAkJC51bmV4cGFuZEFyYyh1cGRhdGVkLmRhdGEuaWQpO1xuICAgICAgICAgICAgICAgICAgICAkJC5hcGkucmV2ZXJ0KCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnJldmVydExlZ2VuZCgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbm1vdXNlb3V0KGFyY0RhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLm9uKCdjbGljaycsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCA9ICQkLnVwZGF0ZUFuZ2xlKGQpLCBhcmNEYXRhO1xuICAgICAgICAgICAgICAgIGlmICh1cGRhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyY0RhdGEgPSAkJC5jb252ZXJ0VG9BcmNEYXRhKHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQudG9nZ2xlU2hhcGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZVNoYXBlKHRoaXMsIGFyY0RhdGEsIGkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29uY2xpY2suY2FsbCgkJC5hcGksIGFyY0RhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKCkgeyAkJC50cmFuc2l0aW5nID0gdHJ1ZTsgfSlcbiAgICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pXG4gICAgICAgICAgICAuYXR0clR3ZWVuKFwiZFwiLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCksIGludGVycG9sYXRlO1xuICAgICAgICAgICAgICAgIGlmICghIHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHsgcmV0dXJuIFwiTSAwIDBcIjsgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnQgPT09IGQpIHtcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudCA9IHtcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0QW5nbGU6IE1hdGguUEkqMixcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgIGVuZEFuZ2xlOiBNYXRoLlBJKjIsXG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc05hTih0aGlzLl9jdXJyZW50LnN0YXJ0QW5nbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQuc3RhcnRBbmdsZSA9IDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc05hTih0aGlzLl9jdXJyZW50LmVuZEFuZ2xlKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50LmVuZEFuZ2xlID0gdGhpcy5fY3VycmVudC5zdGFydEFuZ2xlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpbnRlcnBvbGF0ZSA9IGQzLmludGVycG9sYXRlKHRoaXMuX2N1cnJlbnQsIHVwZGF0ZWQpO1xuICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQgPSBpbnRlcnBvbGF0ZSgwKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGludGVycG9sYXRlZCA9IGludGVycG9sYXRlKHQpO1xuICAgICAgICAgICAgIC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iBbe3ZhbHVlOiBjb25maWcuZ2F1Z2VfbWF4fV0sXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydEFuZ2xlOiBjb25maWcuZ2F1Z2Vfc3RhcnRpbmdBbmdsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVuZEFuZ2xlOiAtMSAqIGNvbmZpZy5nYXVnZV9zdGFydGluZ0FuZ2xlXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5nZXRBcmMoZCwgdHJ1ZSwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NHYXVnZVVuaXQpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJkeVwiLCBcIi43NWVtXCIpXG4gICAgICAgICAgICAgICAgLnRleHQoY29uZmlnLmdhdWdlX2xhYmVsX3Nob3cgPyBjb25maWcuZ2F1Z2VfdW5pdHMgOiAnJyk7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NHYXVnZU1pbilcbiAgICAgICAgICAgICAgICAuYXR0cihcImR4XCIsIC0xICogKCQkLmlubmVyUmFkaXVzICsgKCgkJC5yYWRpdXMgLSAkJC5pbm5lclJhZGl1cykgLyAoY29uZmlnLmdhdWdlX2Z1bGxDaXJjbGUgPyAxIDogMikpKSArIFwicHhcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImR5XCIsIFwiMS4yZW1cIilcbiAgICAgICAgICAgICAgICAudGV4dChjb25maWcuZ2F1Z2VfbGFiZWxfc2hvdyA/IGNvbmZpZy5nYXVnZV9taW4gOiAnJyk7XG4gICAgICAgICAgICAkJC5hcmNzLnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEFyY3NHYXVnZU1heClcbiAgICAgICAgICAgICAgICAuYXR0cihcImR4XCIsICQkLmlubmVyUmFkaX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JlbnREYXRhID0gJCQuZDMuc2VsZWN0KHRoaXMucGFyZW50Tm9kZSkuZGF0dW0oKTtcbiAgICAgICAgICAgICAgICAkJC5kMy5zZWxlY3QodGhpcykuZGF0dW0ocGFyZW50RGF0YSk7XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIHggPSAkJC5yZWdpb25YLmJpbmQoJCQpLFxuICAgICAgICAgICAgeSA9ICQkLnJlZ2lvblkuYmluZCgkJCksXG4gICAgICAgICAgICB3ID0gJCQucmVnaW9uV2lkdGguYmluZCgkJCksXG4gICAgICAgICAgICBoID0gJCQucmVnaW9uSGVpZ2h0LmJpbmQoJCQpO1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgKHdpdGhUcmFuc2l0aW9uID8gcmVnaW9ucy50cmFuc2l0aW9uKCkgOiByZWdpb25zKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieFwiLCB4KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieVwiLCB5KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgdylcbiAgICAgICAgICAgICAgICAuYXR0cihcImhlaWdodFwiLCBoKVxuICAgICAgICAgICAgICAgIC5zdHlsZShcImZpbGwtb3BhY2l0eVwiLCBmdW5jdGlvbiAoZCkgeyByZXR1cm4gaXNWYWx1ZShkLm9wYWNpdHkpID8gZC5vcGFjaXR5IDogMC4xOyB9KVxuICAgICAgICBdO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucmVnaW9uWCA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIHhQb3MsIHlTY2FsZSA9IGQuYXhpcyA9PT0gJ3knID8gJCQueSA6ICQkLnkyO1xuICAgICAgICBpZiAoZC5heGlzID09PSAneScgfHwgZC5heGlzID09PSAneTInKSB7XG4gICAgICAgICAgICB4UG9zID0gY29uZml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gICAgICAgaXNTZWxlY3RlZCA9IHNoYXBlLmNsYXNzZWQoQ0xBU1MuU0VMRUNURUQpLFxuICAgICAgICAgICAgICAgICAgICBpc0luY2x1ZGVkID0gc2hhcGUuY2xhc3NlZChDTEFTUy5JTkNMVURFRCksXG4gICAgICAgICAgICAgICAgICAgIF94LCBfeSwgX3csIF9oLCB0b2dnbGUsIGlzV2l0aGluID0gZmFsc2UsIGJveDtcbiAgICAgICAgICAgICAgICBpZiAoc2hhcGUuY2xhc3NlZChDTEFTUy5jaXJjbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIF94ID0gc2hhcGUuYXR0cihcImN4XCIpICogMTtcbiAgICAgICAgICAgICAgICAgICAgX3kgPSBzaGFwZS5hdHRyKFwiY3lcIikgKiAxO1xuICAgICAgICAgICAgICAgICAgICB0b2dnbGUgPSAkJC50b2dnbGVQb2ludDtcbiAgICAgICAgICAgICAgICAgICAgaXNXaXRoaW4gPSBtaW5YIDwgX3ggJiYgX3ggPCBtYXhYICYmIG1pblkgPCBfeSAmJiBfeSA8IG1heFk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNoYXBlLmNsYXNzZWQoQ0xBU1MuYmFyKSkge1xuICAgICAgICAgICAgICAgICAgICBib3ggPSBnZXRQYXRoQm94KHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICBfeCA9IGJveC54O1xuICAgICAgICAgICAgICAgICAgICBfeSA9IGJveC55O1xuICAgICAgICAgICAgICAgICAgICBfdyA9IGJveC53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgX2ggPSBib3guaGVpZ2h0O1xuICAgICAgICAgICAgICAgICAgICB0b2dnbGUgPSAkJC50b2dnbGVQYXRoO1xuICAgICAgICAgICAgICAgICAgICBpc1dpdGhpbiA9ICEobWF4WCA8IF94IHx8IF94ICsgX3cgPCBtaW5YKSAmJiAhKG1heFkgPCBfeSB8fCBfeSArIF9oIDwgbWluWSk7XG4gICAgICAgIC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lVXBkYXRlID0gY29udGV4dC5zZWxlY3QoJy4nICsgQ0xBU1MuY2hhcnRMaW5lcykuc2VsZWN0QWxsKCcuJyArIENMQVNTLmNoYXJ0TGluZSlcbiAgICAgICAgICAgICAgICAuZGF0YSh0YXJnZXRzKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGNsYXNzQ2hhcnRMaW5lKTtcbiAgICAgICAgICAgIGNvbnRleHRMaW5lRW50ZXIgPSBjb250ZXh0TGluZVVwZGF0ZS5lbnRlcigpLmFwcGVuZCgnZycpXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMClcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCBjbGFzc0NoYXJ0TGluZSk7XG4gICAgICAgICAgICAvLyBMaW5lcyBmb3IgZWFjaCBkYXRhXG4gICAgICAgICAgICBjb250ZXh0TGluZUVudGVyLmFwcGVuZChcImdcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIGNsYXNzTGluZXMpO1xuICAgICAgICAgICAgLy8gQXJlYVxuICAgICAgICAgICAgY29udGV4dExpbmVFbnRlci5hcHBlbmQoXCJnXCIpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJjbGFzc1wiLCBjbGFzc0FyZWFzKTtcblxuICAgICAgICAgICAgLy8tLSBCcnVzaCAtLS8vXG4gICAgICAgICAgICBjb250ZXh0LnNlbGVjdEFsbCgnLicgKyBDTEFTUy5icnVzaCArICcgcmVjdCcpXG4gICAgICAgICAgICAgICAgLmF0dHIoY29uZmlnLmF4aXNfcm90YXRlZCA/IFwid2lkdGhcIiA6IFwiaGVpZ2h0XCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC53aWR0aDIgOiAkJC5oZWlnaHQyKTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlQmFyRm9yU3ViY2hhcnQgPSBmdW5jdGlvbiAoZHV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0IGlmIHpvb21lZFxuICAgICAgICAgICAgaWYgKGQzLmV2ZW50ICYmIGQzLmV2ZW50LnR5cGUgPT09ICd6b29tJykge1xuICAgICAgICAgICAgICAgICQkLmJydXNoLmV4dGVudCgkJC54Lm9yZ0RvbWFpbigpKS51cGRhdGUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIHVwZGF0ZSBzdWJjaGFydCBlbGVtZW50cyBpZiBuZWVkZWRcbiAgICAgICAgICAgIGlmICh3aXRoU3ViY2hhcnQpIHtcblxuICAgICAgICAgICAgICAgIC8vIGV4dGVudCByZWN0XG4gICAgICAgICAgICAgICAgaWYgKCEkJC5icnVzaC5lbXB0eSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmJydXNoLmV4dGVudCgkJC54Lm9yZ0RvbWFpbigpKS51cGRhdGUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gc2V0dXAgZHJhd2VyIC0gTUVNTzogdGhpcyBtdXN0IGJlIGNhbGxlZCBhZnRlciBheGlzIHVwZGF0ZWRcbiAgICAgICAgICAgICAgICBkcmF3QXJlYU9uU3ViID0gJCQuZ2VuZXJhdGVEcmF3QXJlYShhcmVhSW5kaWNlcywgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgZHJhd0Jhck9uU3ViID0gJCQuZ2VuZXJhdGVEcmF3QmFyKGJhckluZGljZXMsIHRydWUpO1xuICAgICAgICAgICAgICAgIGRyYXdMaW5lT25TdWIgPSAkJC5nZW5lcmF0ZURyYXdMaW5lKGxpbmVJbmRpY2VzLCB0cnVlKTtcblxuICAgICAgICAgICAgICAgICQkLnVwZGF0ZUJhckZvclN1YmNoYXJ0KGR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVMaW5lRm9yU3ViY2hhcnQoZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICQkLnVwZGF0ZUFyZWFGb3JTdWJjaGFydChkdXJhdGlvbik7XG5cb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mNvbmZpZywgc3RhcnRFdmVudDtcblxuICAgICAgICAkJC56b29tID0gZDMuYmVoYXZpb3Iuem9vbSgpXG4gICAgICAgICAgICAub24oXCJ6b29tc3RhcnRcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN0YXJ0RXZlbnQgPSBkMy5ldmVudC5zb3VyY2VFdmVudDtcbiAgICAgICAgICAgICAgICAkJC56b29tLmFsdERvbWFpbiA9IGQzLmV2ZW50LnNvdXJjZUV2ZW50LmFsdEtleSA/ICQkLngub3JnRG9tYWluKCkgOiBudWxsO1xuICAgICAgICAgICAgICAgIGNvbmZpZy56b29tX29uem9vbXN0YXJ0LmNhbGwoJCQuYXBpLCBkMy5ldmVudC5zb3VyY2VFdmVudCk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKFwiem9vbVwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgJCQucmVkcmF3Rm9yWm9vbS5jYWxsKCQkKTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ3pvb21lbmQnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGV2ZW50ID0gZDMuZXZlbnQuc291cmNlRXZlbnQ7XG4gICAgICAgICAgICAgICAgLy8gaWYgY2xpY2ssIGRvIG5vdGhpbmcuIG90aGVyd2lzZSwgY2xpY2sgaW50ZXJhY3Rpb24gd2lsbCBiZSBjYW5jZWxlZC5cbiAgICAgICAgICAgICAgICBpZiAoZXZlbnQgJiYgc3RhcnRFdmVudC5jbGllbnRYID09PSBldmVudC5jbGllbnRYICYmIHN0YXJ0RXZlbnQuY2xpZW50WSA9PT0gZXZlbnQuY2xpZW50WSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLnJlZHJhd0V2ZW50UmVjdCgpO1xuICAgICAgICAgICAgICAgICQkLnVwZGF0ZVpvb20oKTtcbiAgICAgICAgICAgICAgICBjb25maWcuem9vbV9vbnpvb21lbmQuY2FsbCgkJC5hcGksICQkLngub3JnRG9tYWluKCkpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICQkLnpvb20uc2NhbGUgPSBmdW5jdGlvbiAoc2NhbGUpIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuYXhpc19yb3RhdGVkID8gdGhpcy55KHNjYWxlKSA6IHRoaXMueChzY2FsZSk7XG4gICAgICAgIH07XG4gICAgICAgICQkLnpvb20ub3JnU2NhbGVFeHRlbnQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgZXh0ZW50ID0gY29uZmlnLnpvb21fZXh0ZW50ID8gY29uZmlnLnpvb21fZXh0ZW50IDogWzEsIDEwXTtcbiAgICAgICAgICAgIHJldHVybiBbZXh0ZW50WzBdLCBNYXRoLm1heCgkJC5nZXRNYXhEYXRhQ291bnQoKSAvIGV4dGVudFsxXSwgZXh0ZW50WzFdKV07XG4gICAgICAgIH07XG4gICAgICAgICQkLnpvb20udXBkYXRlU2NhbGVFeHRlbnQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgcmF0aW8gPSBkaWZmRG9tYWluKCQkLngub3JnRG9tYWluKCkpIC8gZGlmZkRvbWFpbigkJC5nZXRab29tRG9tYWluKCkpLFxuICAgICAgICAgICAgICAgIGV4dGVudCA9IHRoaXMub3JnU2NhbGVFeHRlbnQoKTtcbiAgICAgICAgICAgIHRoaXMuc2NhbGVFeHRlbnQoW2V4dGVudFswXSAqIHJhdGlvLCBleHRlbnRbMV0gKiByYXRpb10pO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRab29tRG9tYWluID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDMs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iB6b29tLmFsdERvbWFpbikge1xuICAgICAgICAgICAgeC5kb21haW4oem9vbS5hbHREb21haW4pO1xuICAgICAgICAgICAgem9vbS5zY2FsZSh4KS51cGRhdGVTY2FsZUV4dGVudCgpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICgkJC5pc0NhdGVnb3JpemVkKCkgJiYgeC5vcmdEb21haW4oKVswXSA9PT0gJCQub3JnWERvbWFpblswXSkge1xuICAgICAgICAgICAgeC5kb21haW4oWyQkLm9yZ1hEb21haW5bMF0gLSAxZS0xMCwgeC5vcmdEb21haW4oKVsxXV0pO1xuICAgICAgICB9XG4gICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogZmFsc2UsXG4gICAgICAgICAgICB3aXRoWTogY29uZmlnLnpvb21fcmVzY2FsZSxcbiAgICAgICAgICAgIHdpdGhTdWJjaGFydDogZmFsc2UsXG4gICAgICAgICAgICB3aXRoRXZlbnRSZWN0OiBmYWxzZSxcbiAgICAgICAgICAgIHdpdGhEaW1lbnNpb246IGZhbHNlXG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoZDMuZXZlbnQuc291cmNlRXZlbnQudHlwZSA9PT0gJ21vdXNlbW92ZScpIHtcbiAgICAgICAgICAgICQkLmNhbmNlbENsaWNrID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBjb25maWcuem9vbV9vbnpvb20uY2FsbCgkJC5hcGksIHgub3JnRG9tYWluKCkpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUNvbG9yID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDMsXG4gICAgICAgICAgICBjb2xvcnMgPSBjb25maWcuZGF0YV9jb2xvcnMsXG4gICAgICAgICAgICBwYXR0ZXJuID0gbm90RW1wdHkoY29uZmlnLmNvbG9yX3BhdHRlcm4pID8gY29uZmlnLmNvbG9yX3BhdHRlcm4gOiBkMy5zY2FsZS5jYXRlZ29yeTEwKCkucmFuZ2UoKSxcbiAgICAgICAgICAgIGNhbGxiYWNrID0gY29uZmlnLmRhdGFfY29sb3IsXG4gICAgICAgICAgICBpZHMgPSBbXTtcblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIHZhciBpZCA9IGQuaWQgfHwgKGQuZGF0YSAmJiBkLmRhdGEuaWQpIHx8IGQsIGNvbG9yO1xuXG4gICAgICAgICAgICAvLyBpZiBjYWxsYmFjayBmdW5jdGlvbiBpcyBwcm92aWRlZFxuICAgICAgICAgICAgaWYgKGNvbG9yc1tpZF0gaW5zdGFuY2VvZiBGdW5jdGlvbikge1xuICAgICAgICAgICAgICAgIGNvbG9yID0gY29sb3JzW2lkXShkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGlmIHNwZWNpZmllZCwgY2hvb3NlIHRoYXQgY29sb3JcbiAgICAgICAgICAgIGVsc2UgaWYgKGNvbG9yc1tpZF0pIHtcbiAgICAgICAgICAgICAgICBjb2xvciA9IGNvbG9yc1tpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBpZiBub3Qgc3BlY2lmaWVkLCBjaG9vc2UgZnJvbSBwYXR0ZXJuXG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoaWRzLmluZGV4T2YoaWQpIDwgMCkgeyBpZHMucHVzaChpZCk7IH1cbiAgICAgICAgICAgICAgICBjb2xvciA9IHBhdHRlcm5baWRzLmluZGV4T2YoaWQpICUgcGF0dGVybi5sZW5ndGhdO1xuICAgICAgICAgICAgICAgIGNvbG9yc1tpZF0gPSBjb2xvcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayBpbnN0YW5jZW9mIEZ1bmN0aW9uID8gY2FsbGJhY2soY29sb3IsIGQpIDogY29sb3I7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUxldmVsQ29sb3IgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIGNvbG9ycyA9IGNvbmZpZy5jb2xvcl9wYXR0ZXJuLFxuICAgICAgICAgICAgdGhyZXNob2xkID0gY29uZmlnLmNvbG9yX3RocmVzaG9sZCxcbiAgICAgICAgICAgIGFzVmFsdWUgPSB0aHJlc2hvbGQudW5pdCA9PT0gJ3ZhbHVlJyxcbiAgICAgICAgICAgIHZhbHVlcyA9IHRocmVzaG9sZC52YWx1ZXMgJiYgdGhyZXNob2xkLnZhbHVlcy5sZW5ndGggPyB0aHJlc2hvbGQudmFsdWVzIDogW10sXG4gICAgICAgICAgICBtYXggPSB0aHJlc2hvbGQubWF4IHx8IDEwMDtcbiAgICAgICAgcmV0dXJuIG5vdEVtcHR5KGNvbmZpZy5jb2xvcl90aHJlc2hvbGQpID8gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB2YXIgaSwgdiwgY29sb3IgPSBjb2xvcnNbY29sb3JzLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHZhbHVlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHYgPSBhc1ZhbHVlID8gdmFsdWUgOiAodmFsdWUgKiAxMDAgLyBtYXgpO1xuICAgICAgICAgICAgICAgIGlmICh2IDwgdmFsdWVzW2ldKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbG9yID0gY29sb3JzW2ldO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gY29sb3I7XG4gICAgICAgIH0gOiBudWxsO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HJldHVybiAkJC5wYXJzZURhdGUoeCk7IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgJCQuYnJ1c2guZXh0ZW50KGRvbWFpbik7XG4gICAgICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVYRG9tYWluOiB0cnVlLCB3aXRoWTogJCQuY29uZmlnLnpvb21fcmVzY2FsZX0pO1xuICAgICAgICAgICAgJCQuY29uZmlnLnpvb21fb256b29tLmNhbGwodGhpcywgJCQueC5vcmdEb21haW4oKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICQkLmJydXNoLmV4dGVudCgpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uem9vbS5lbmFibGUgPSBmdW5jdGlvbiAoZW5hYmxlZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsO1xuICAgICAgICAkJC5jb25maWcuem9vbV9lbmFibGVkID0gZW5hYmxlZDtcbiAgICAgICAgJCQudXBkYXRlQW5kUmVkcmF3KCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi51bnpvb20gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWw7XG4gICAgICAgICQkLmJydXNoLmNsZWFyKCkudXBkYXRlKCk7XG4gICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZVhEb21haW46IHRydWV9KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uem9vbS5tYXggPSBmdW5jdGlvbiAobWF4KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMztcbiAgICAgICAgaWYgKG1heCA9PT0gMCB8fCBtYXgpIHtcbiAgICAgICAgICAgIGNvbmZpZy56b29tX3hfbWF4ID0gZDMubWF4KFskJC5vcmdYRG9tYWluWzFdLCBtYXhdKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBjb25maWcuem9vbV94X21heDtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi56b29tLm1pbiA9IGZ1bmN0aW9uIChtaW4pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnLCBkMyA9ICQkLmQzO1xuICAgICAgICBpZiAobWluID09PSAwIHx8IG1pbikge1xuICAgICAgICAgICAgY29uZmlnLnpvb21feF9taW4gPSBkMy5taW4oWyQkLm9yZ1hEb21haW5bMF0sIG1pbl0pO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGNvbmZpZy56b29tX3hfbWluO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLnpvb20ucmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHtcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQocmFuZ2UubWF4KSkgeyB0aGlzLmRvbWFpbi5tYXgocmFuZ2UubWF4KTsgfVxuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyYW5nZS5taW4pKSB7IHRoaXMuZG9tYWluLm1pbihyYW5nZS5taW4pOyB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIG1heDogdGhpcy5kb21haW4ubWF4KCksXG4gICAgICAgICAgICAgICAgbWluOiB0aGlzLmRvbWFpbi5taW4oKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi5sb2FkID0gZnVuY3Rpb24gKGFyZ3MpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICAvLyB1cGRhdGUgeHMgaWYgc3Bl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iAgICAgICAgICAgIGRhdGEgPSAkJC5jb252ZXJ0Um93c1RvRGF0YShhcmdzLnJvd3MpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGFyZ3MuY29sdW1ucykge1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRDb2x1bW5zVG9EYXRhKGFyZ3MuY29sdW1ucyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGFyZ2V0cyA9ICQkLmNvbnZlcnREYXRhVG9UYXJnZXRzKGRhdGEsIHRydWUpO1xuXG4gICAgICAgIC8vIFVwZGF0ZS9BZGQgZGF0YVxuICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgdmFyIGZvdW5kID0gZmFsc2UsIGksIGo7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdGFyZ2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSB0YXJnZXRzW2ldLmlkKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodC52YWx1ZXNbdC52YWx1ZXMubGVuZ3RoIC0gMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhaWwgPSB0LnZhbHVlc1t0LnZhbHVlcy5sZW5ndGggLSAxXS5pbmRleCArIDE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gdGFyZ2V0c1tpXS52YWx1ZXMubGVuZ3RoO1xuXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBsZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0c1tpXS52YWx1ZXNbal0uaW5kZXggPSB0YWlsICsgajtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRzW2ldLnZhbHVlc1tqXS54ID0gdGFpbCArIGo7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdC52YWx1ZXMgPSB0LnZhbHVlcy5jb25jYXQodGFyZ2V0c1tpXS52YWx1ZXMpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWZvdW5kKSB7IG5vdGZvdW5kSWRzLnB1c2godC5pZCk7IH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gQXBwZW5kIG51bGwgZm9yIG5vdCBmb3VuZCB0YXJnZXRzXG4gICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICB2YXIgaSwgajtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBub3Rmb3VuZElkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICh0LmlkID09PSBub3Rmb3VuZElkc1tpXSkge1xuICAgICAgICAgICAgICAgICAgICB0YWlsID0gdC52YWx1ZXNbdC52YWx1ZXMubGVuZ3RoIC0gMV0uaW5kZXggKyAxO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgbGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHQudmFsdWVzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0LmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiB0YWlsICsgaixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB4OiAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLmdldE90aGVyVGFyZ2V0WCh0YWlsICsgaikgOiB0YWlsICsgaixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogbnVsbFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIEdlbmVyYXRlIG51bGwgdmFsdWVzIGZvciBuZXcgdGFyZ2V0XG4gICAgICAgIGlmICgkJC5kYXRhLnRhcmdldHMubGVuZ3RoKSB7XG4gICAgICAgICAgICB0YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaSwgbWlzc2luZyA9IFtdO1xuICAgICAgICAgICAgICAgIGZvciAoaSA9ICQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXNbMF0uaW5kZXg7IGkgPCB0YWlsOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbWlzc2luZy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB0LmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksXG4gICAgICAgICAgICAgICAgICAgICAgICB4OiAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLmdldE90aGVyVGFyZ2V0WChpKSA6IGksXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogbnVsbFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbiAodikge1xuICAgICAgICAgICAgICAgICAgICB2LmluZGV4ICs9IHRhaWw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHYueCArPSB0YWlsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdC52YWx1ZXMgPSBtaXNzaW5nLmNvbmNhdCh0LnZhbHVlcyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAkJC5kYXRhLnRhcmdldHMgPSAkJC5kYXRhLnRhcmdldHMuY29uY2F0KHRhcmdldHMpOyAvLyBhZGQgcmVtYWluZWRcblxuICAgICAgICAvLyBjaGVjayBkYXRhIGNvdW50IGJlY2F1c2UgYmVoYXZpb3IgbmVlZHMgdG8gY2hhbmdlIHdoZW4gaXQncyBvbmx5IG9uZVxuICAgICAgICBkYXRhQ291bnQgPSAkJC5nZXRNYXhEYXRhQ291bnQoKTtcbiAgICAgICAgYmFzZVRhcmdldCA9ICQkLmRhdGEudGFyZ2V0c1swXTtcbiAgICAgICAgYmFzZVZhbHVlID0gYmFzZVRhcmdldC52YWx1ZXNbMF07XG5cbiAgICAgICAgLy8gVXBkYXRlIGxlbmd0aCB0byBmbG93IGlmIG5lZWRlZFxuICAgICAgICBpZiAoaXNEZWZpbmVkKGFyZ3MudG8pKSB7XG4gICAgICAgICAgICBsZW5ndGggPSAwO1xuICAgICAgICAgICAgdG8gPSAkJC5pc1RpbWVTZXJpZXMoKSA/ICQkLnBhcnNlRGF0ZShhcmdzLnRvKSA6IGFyZ3MudG87XG4gICAgICAgICAgICBiYXNlVGFyZ2V0LnZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICAgICAgaWYgKHYueCA8IHRvKSB7IGxlbmd0aCsrOyB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIGlmIChpc0RlZmluZWQoYXJncy5sZW5ndGgpKSB7XG4gICAgICAgICAgICBsZW5ndGggPSBhcmdzLmxlbmd0aDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIElmIG9ubHkgb25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ZmKV07XG4gICAgICAgICAgICAgICAgJCQudXBkYXRlWERvbWFpbihudWxsLCB0cnVlLCB0cnVlLCBmYWxzZSwgZG9tYWluKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFNldCB0YXJnZXRzXG4gICAgICAgICQkLnVwZGF0ZVRhcmdldHMoJCQuZGF0YS50YXJnZXRzKTtcblxuICAgICAgICAvLyBSZWRyYXcgd2l0aCBuZXcgdGFyZ2V0c1xuICAgICAgICAkJC5yZWRyYXcoe1xuICAgICAgICAgICAgZmxvdzoge1xuICAgICAgICAgICAgICAgIGluZGV4OiBiYXNlVmFsdWUuaW5kZXgsXG4gICAgICAgICAgICAgICAgbGVuZ3RoOiBsZW5ndGgsXG4gICAgICAgICAgICAgICAgZHVyYXRpb246IGlzVmFsdWUoYXJncy5kdXJhdGlvbikgPyBhcmdzLmR1cmF0aW9uIDogJCQuY29uZmlnLnRyYW5zaXRpb25fZHVyYXRpb24sXG4gICAgICAgICAgICAgICAgZG9uZTogYXJncy5kb25lLFxuICAgICAgICAgICAgICAgIG9yZ0RhdGFDb3VudDogb3JnRGF0YUNvdW50LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHdpdGhMZWdlbmQ6IHRydWUsXG4gICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogb3JnRGF0YUNvdW50ID4gMSxcbiAgICAgICAgICAgIHdpdGhUcmltWERvbWFpbjogZmFsc2UsXG4gICAgICAgICAgICB3aXRoVXBkYXRlWEF4aXM6IHRydWUsXG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZW5lcmF0ZUZsb3cgPSBmdW5jdGlvbiAoYXJncykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDM7XG5cbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB0YXJnZXRzID0gYXJncy50YXJnZXRzLFxuICAgICAgICAgICAgICAgIGZsb3cgPSBhcmdzLmZsb3csXG4gICAgICAgICAgICAgICAgZHJhd0JhciA9IGFyZ3MuZHJhd0JhcixcbiAgICAgICAgICAgICAgICBkcmF3TGluZSA9IGFyZ3MuZHJhd0xpbmUsXG4gICAgICAgICAgICAgICAgZHJhd0FyZWEgPSBhcmdzLmRyYXdBcmVhLFxuICAgICAgICAgICAgICAgIGN4ID0gYXJncy5jeCxcbiAgICAgICAgICAgICAgICBjeSA9IGFyZ3MuY3ksXG4gICAgICAgICAgICAgICAgeHYgPSBhcmdzLnh2LFxuICAgICAgICAgICAgICAgIHhGb3JUZXh0ID0gYXJncy54Rm9yVGV4dCxcbiAgICAgICAgICAgICAgICB5Rm9yVGV4dCA9IGFyZ3MueUZvclRleHQsXG4gICAgICAgICAgICAgICAgZHVyYXRpb24gPSBhcmdzLmR1cmF0aW9uO1xuXG4gICAgICAgICAgICB2YXIgdHJhbnNsYXRlWCwgc2NhbGVYID0gMSwgdHJhbnNmb3JtLFxuICAgICAgICAgICAgICAgIGZsb3dJbmRleCA9IGZsb3cuaW5kZXgsXG4gICAgICAgICAgICAgICAgZmxvd0xlbmd0aCA9IGZsb3cubGVuZ3RoLFxuICAgICAgICAgICAgICAgIGZsb3dTdGFydCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCBmbG93SW5kZXgpLFxuICAgICAgICAgICAgICAgIGZsb3dFbmQgPSAkJC5nZXRWYWx1ZU9uSW5kZXgoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcywgZmxvd0luZGV4ICsgZmxvd0xlbmd0aCksXG4gICAgICAgICAgICAgICAgb3JnRG9tYWluID0gJCQueC5kb21haW4oKSwgZG9tYWluLFxuICAgICAgICAgICAgICAgIGR1cmF0aW9uRm9yRmxvdyA9IGZsb3cuZHVyYXRpb24gfHwgZHVyYXRpb24sXG4gICAgICAgICAgICAgICAgZG9uZSA9IGZsb3cuZG9uZSB8fCBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgICAgICB3YWl0ID0gJCQuZ2VuZXJhdGVXYWl0KCk7XG5cbiAgICAgICAgICAgIHZhciB4Z3JpZCA9ICQkLnhncmlkIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lcyA9ICQkLnhncmlkTGluZXMgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uID0gJCQubWFpblJlZ2lvbiB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5UZXh0ID0gJCQubWFpblRleHQgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluQmFyID0gJCQubWFpbkJhciB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5MaW5lID0gJCQubWFpbkxpbmUgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluQXJlYSA9ICQkLm1haW5BcmVhIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpbkNpcmNsZSA9ICQkLm1haW5DaXJjbGUgfHwgZDMuc2VsZWN0QWxsKFtdKTtcblxuICAgICAgICAgICAgLy8gc2V0IGZsYWdcbiAgICAgICAgICAgICQkLmZsb3dpbmcgPSB0cnVlO1xuXG4gICAgICAgICAgICAvLyByZW1vdmUgaGVhZCBkYXRhIGFmdGVyIHJlbmRlcmVkXG4gICAgICAgICAgICAkJC5kYXRhLnRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIGQudmFsdWVzLnNwbGljZSgwLCBmbG93TGVuZ3RoKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAvLyB1cGRhdGUgeCBkb21haW4gdG8gZ2VuZXJhdGUgYXhpcyBlbGVtZW50cyBmb3IgZmxvd1xuICAgICAgICAgICAgZG9tYWluID0gJCQudXBkYXRlWERvbWFpbih0YXJnZXRzLCB0cnVlLCB0cnVlKTtcbiAgICAgICAgICAgIC8vIHVwZGF0ZSBlbGVtZW50cyByZWxhdGVkIHRvIHggc2NhbGVcbiAgICAgICAgICAgIGlmICgkJC51cGRhdGVYR3JpZCkgeyAkJC51cGRhdGVYR3JpZCh0cnVlKTsgfVxuXG4gICAgICAgICAgICAvLyBnZW5lcmF0ZSB0cmFuc2Zvcm0gdG8gZmxvd1xuICAgICAgICAgICAgaWYgKCFmbG93Lm9yZ0RhdGFDb3VudCkgeyAvLyBpZiBlbXB0eVxuICAgICAgICAgICAgICAgIGlmICgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmxlbmd0aCAhPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gJCQueChvcmdEb21haW5bMF0pIC0gJCQueChkb21haW5bMF0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmxvd1N0YXJ0ID0gJCQuZ2V0VmFsdWVPbkluZGV4KCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmxvd0VuZCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCAkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICQkLngoZmxvd1N0YXJ0LngpIC0gJCQueChmbG93RW5kLngpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9IGRpZmZEb21haW4oZG9tYWluKSAvIDI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGZsb3cub3JnRGF0YUNvdW50ID09PSAxIHx8IChmbG93U3RhcnQgJiYgZmxvd1N0YXJ0LngpID09PSAoZmxvd0VuZCAmJiBmbG93RW5kLngpKSB7XG4gICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICQkLngob3JnRG9tYWluWzBdKSAtICQkLngoZG9tYWluWzBdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAoJCQueChvcmdEb21haW5bMF0pIC0gJCQueChkb21haW5bMF0pKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gKCQkLngoZmxvd1N0YXJ0LngpIC0gJCQueChmbG93RW5kLngpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzY2FsZVggPSAoZGlmZkRvbWFpbihvcmdEb21haW4pIC8gZGlmZkRvbWFpbihkb21haW4pKTtcbiAgICAgICAgICAgIHRyYW5zZm9ybSA9ICd0cmFuc2xhdGUoJyArIHRyYW5zbGF0ZVggKyAnLDApIHNjYWxlKCcgKyBzY2FsZVggKyAnLDEpJztcblxuICAgICAgICAgICAgJCQuaGlkZVhHcmlkRm9jdXMoKTtcblxuICAgICAgICAgICAgZDMudHJhbnNpdGlvbigpLmVhc2UoJ2xpbmVhcicpLmR1cmF0aW9uKGR1cmF0aW9uRm9yRmxvdykuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgd2FpdC5hZGQoJCQuYXhlcy54LnRyYW5zaXRpb24oKS5jYWxsKCQkLnhBeGlzKSk7XG4gICAgICAgICAgICAg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TGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBmbG93TGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNoYXBlcy5wdXNoKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgKGZsb3dJbmRleCArIGkpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRzLnB1c2goJy4nICsgQ0xBU1MudGV4dCArICctJyArIChmbG93SW5kZXggKyBpKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudFJlY3RzLnB1c2goJy4nICsgQ0xBU1MuZXZlbnRSZWN0ICsgJy0nICsgKGZsb3dJbmRleCArIGkpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlcykuc2VsZWN0QWxsKHNoYXBlcykucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MudGV4dHMpLnNlbGVjdEFsbCh0ZXh0cykucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuZXZlbnRSZWN0cykuc2VsZWN0QWxsKGV2ZW50UmVjdHMpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0KCcuJyArIENMQVNTLnhncmlkKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvLyBkcmF3IGFnYWluIGZvciByZW1vdmluZyBmbG93ZWQgZWxlbWVudHMgYW5kIHJldmVydGluZyBhdHRyXG4gICAgICAgICAgICAgICAgeGdyaWRcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCQkLnhncmlkQXR0cik7XG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lc1xuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbCk7XG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lcy5zZWxlY3QoJ2xpbmUnKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcIngxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogeHYpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieDJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoIDogeHYpO1xuICAgICAgICAgICAgICAgIHhncmlkTGluZXMuc2VsZWN0KCd0ZXh0JylcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4XCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC53aWR0aCA6IDApXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieVwiLCB4dik7XG4gICAgICAgICAgICAgICAgbWFpbkJhclxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJkXCIsIGRyYXdCYXIpO1xuICAgICAgICAgICAgICAgIG1haW5MaW5lXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZHJhd0xpbmUpO1xuICAgICAgICAgICAgICAgIG1haW5BcmVhXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZHJhd0FyZWEpO1xuICAgICAgICAgICAgICAgIG1haW5DaXJjbGVcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiY3hcIiwgY3gpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiY3lcIiwgY3kpO1xuICAgICAgICAgICAgICAgIG1haW5UZXh0XG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneCcsIHhGb3JUZXh0KVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigneScsIHlGb3JUZXh0KVxuICAgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwtb3BhY2l0eScsICQkLm9wYWNpdHlGb3JUZXh0LmJpbmQoJCQpKTtcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKTtcbiAgICAgICAgICAgICAgICBtYWluUmVnaW9uLnNlbGVjdCgncmVjdCcpLmZpbHRlcigkJC5pc1JlZ2lvbk9uWClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4XCIsICQkLnJlZ2lvblguYmluZCgkJCkpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgJCQucmVnaW9uV2lkdGguYmluZCgkJCkpO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0V2ZW50UmVjdCgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIGNhbGxiYWNrIGZvciBlbmQgb2YgZmxvd1xuICAgICAgICAgICAgICAgIGRvbmUoKTtcblxuICAgICAgICAgICAgICAgICQkLmZsb3dpbmcgPSBmYWxzZTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgIH07XG5cbiAgICBjM19jaGFydF9mbi5zZWxlY3RlZCA9IGZ1bmN0aW9uICh0YXJnZXRJZCkge1xuICAgICAgICB2YXIgJCQgPSB0aG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TGluZXMocGFyYW1zLCBmYWxzZSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLnJlZ2lvbnMgPSBmdW5jdGlvbiAocmVnaW9ucykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGlmICghcmVnaW9ucykgeyByZXR1cm4gY29uZmlnLnJlZ2lvbnM7IH1cbiAgICAgICAgY29uZmlnLnJlZ2lvbnMgPSByZWdpb25zO1xuICAgICAgICAkJC5yZWRyYXdXaXRob3V0UmVzY2FsZSgpO1xuICAgICAgICByZXR1cm4gY29uZmlnLnJlZ2lvbnM7XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi5yZWdpb25zLmFkZCA9IGZ1bmN0aW9uIChyZWdpb25zKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgaWYgKCFyZWdpb25zKSB7IHJldHVybiBjb25maWcucmVnaW9uczsgfVxuICAgICAgICBjb25maWcucmVnaW9ucyA9IGNvbmZpZy5yZWdpb25zLmNvbmNhdChyZWdpb25zKTtcbiAgICAgICAgJCQucmVkcmF3V2l0aG91dFJlc2NhbGUoKTtcbiAgICAgICAgcmV0dXJuIGNvbmZpZy5yZWdpb25zO1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4ucmVnaW9ucy5yZW1vdmUgPSBmdW5jdGlvbiAob3B0aW9ucykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBkdXJhdGlvbiwgY2xhc3NlcywgcmVnaW9ucztcblxuICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fTtcbiAgICAgICAgZHVyYXRpb24gPSAkJC5nZXRPcHRpb24ob3B0aW9ucywgXCJkdXJhdGlvblwiLCBjb25maWcudHJhbnNpdGlvbl9kdXJhd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sZW5ndGgpIHtcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKGxhYmVscykuZm9yRWFjaChmdW5jdGlvbiAoYXhpc0lkKSB7XG4gICAgICAgICAgICAgICAgJCQuYXhpcy5zZXRMYWJlbFRleHQoYXhpc0lkLCBsYWJlbHNbYXhpc0lkXSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICQkLmF4aXMudXBkYXRlTGFiZWxzKCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gVE9ETzogcmV0dXJuIHNvbWUgdmFsdWVzP1xuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uYXhpcy5tYXggPSBmdW5jdGlvbiAobWF4KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWF4ID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1heC54KSkgeyBjb25maWcuYXhpc194X21heCA9IG1heC54OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWF4LnkpKSB7IGNvbmZpZy5heGlzX3lfbWF4ID0gbWF4Lnk7IH1cbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtYXgueTIpKSB7IGNvbmZpZy5heGlzX3kyX21heCA9IG1heC55MjsgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc195X21heCA9IGNvbmZpZy5heGlzX3kyX21heCA9IG1heDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHg6IGNvbmZpZy5heGlzX3hfbWF4LFxuICAgICAgICAgICAgICAgIHk6IGNvbmZpZy5heGlzX3lfbWF4LFxuICAgICAgICAgICAgICAgIHkyOiBjb25maWcuYXhpc195Ml9tYXhcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuLmF4aXMubWluID0gZnVuY3Rpb24gKG1pbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIG1pbiA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtaW4ueCkpIHsgY29uZmlnLmF4aXNfeF9taW4gPSBtaW4ueDsgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1pbi55KSkgeyBjb25maWcuYXhpc195X21pbiA9IG1pbi55OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWluLnkyKSkgeyBjb25maWcuYXhpc195Ml9taW4gPSBtaW4ueTI7IH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeV9taW4gPSBjb25maWcuYXhpc195Ml9taW4gPSBtaW47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLCB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZX0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICB4OiBjb25maWcuYXhpc194X21pbixcbiAgICAgICAgICAgICAgICB5OiBjb25maWcuYXhpc195X21pbixcbiAgICAgICAgICAgICAgICB5MjogY29uZmlnLmF4aXNfeTJfbWluXG4gICAgICAgICAg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AvLyBkZXRlcm1pbmUgbW91c2UgcG9zaXRpb24gb24gdGhlIGNoYXJ0XG4gICAgICAgIGlmIChhcmdzLm1vdXNlKSB7XG4gICAgICAgICAgICBtb3VzZSA9IGFyZ3MubW91c2U7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBkZXRlcm1pbmUgZm9jdXMgZGF0YVxuICAgICAgICBpZiAoYXJncy5kYXRhKSB7XG4gICAgICAgICAgICBpZiAoJCQuaXNNdWx0aXBsZVgoKSkge1xuICAgICAgICAgICAgICAgIC8vIGlmIG11bHRpcGxlIHhzLCB0YXJnZXQgcG9pbnQgd2lsbCBiZSBkZXRlcm1pbmVkIGJ5IG1vdXNlXG4gICAgICAgICAgICAgICAgbW91c2UgPSBbJCQueChhcmdzLmRhdGEueCksICQkLmdldFlTY2FsZShhcmdzLmRhdGEuaWQpKGFyZ3MuZGF0YS52YWx1ZSldO1xuICAgICAgICAgICAgICAgIGluZGV4ID0gbnVsbDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETzogd2hlbiB0b29sdGlwX2dyb3VwZWQgPSBmYWxzZVxuICAgICAgICAgICAgICAgIGluZGV4ID0gaXNWYWx1ZShhcmdzLmRhdGEuaW5kZXgpID8gYXJncy5kYXRhLmluZGV4IDogJCQuZ2V0SW5kZXhCeVgoYXJncy5kYXRhLngpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHR5cGVvZiBhcmdzLnggIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpbmRleCA9ICQkLmdldEluZGV4QnlYKGFyZ3MueCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodHlwZW9mIGFyZ3MuaW5kZXggIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpbmRleCA9IGFyZ3MuaW5kZXg7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBlbXVsYXRlIG1vdXNlIGV2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B7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNjYWxlLnRpY2tzLmFwcGx5KHNjYWxlLCB0aWNrQXJndW1lbnRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRvbWFpbiA9IHNjYWxlLmRvbWFpbigpO1xuICAgICAgICAgICAgZm9yIChpID0gTWF0aC5jZWlsKGRvbWFpblswXSk7IGkgPCBkb21haW5bMV07IGkrKykge1xuICAgICAgICAgICAgICAgIHRpY2tzLnB1c2goaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGlja3MubGVuZ3RoID4gMCAmJiB0aWNrc1swXSA+IDApIHtcbiAgICAgICAgICAgICAgICB0aWNrcy51bnNoaWZ0KHRpY2tzWzBdIC0gKHRpY2tzWzFdIC0gdGlja3NbMF0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aWNrcztcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBjb3B5U2NhbGUoKSB7XG4gICAgICAgICAgICB2YXIgbmV3U2NhbGUgPSBzY2FsZS5jb3B5KCksIGRvbWFpbjtcbiAgICAgICAgICAgIGlmIChwYXJhbXMuaXNDYXRlZ29yeSkge1xuICAgICAgICAgICAgICAgIGRvbWFpbiA9IHNjYWxlLmRvbWFpbigpO1xuICAgICAgICAgICAgICAgIG5ld1NjYWxlLmRvbWFpbihbZG9tYWluWzBdLCBkb21haW5bMV0gLSAxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbmV3U2NhbGU7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdGV4dEZvcm1hdHRlZCh2KSB7XG4gICAgICAgICAgICB2YXIgZm9ybWF0dGVkID0gdGlja0Zvcm1hdCA/IHRpY2tGb3JtYXQodikgOiB2O1xuICAgICAgICAgICAgcmV0dXJuIHR5cGVvZiBmb3JtYXR0ZWQgIT09ICd1bmRlZmluZWQnID8gZm9ybWF0dGVkIDogJyc7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gZ2V0U2l6ZUZvcjFDaGFyKHRpY2spIHtcbiAgICAgICAgICAgIGlmICh0aWNrVGV4dENoYXJTaXplKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRpY2tUZXh0Q2hhclNpemU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgc2l6ZSA9IHtcbiAgICAgICAgICAgICAgICBoOiAxMS41LFxuICAgICAgICAgICAgICAgIHc6IDUuNVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHRpY2suc2VsZWN0KCd0ZXh0JykudGV4dCh0ZXh0Rm9ybWF0dGVkKS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIGJveCA9IHRoaXMuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksXG4gICAgICAgICAgICAgICAgICAgIHRleHQgPSB0ZXh0Rm9ybWF0dGVkKGQpLFxuICAgICAgICAgICAgICAgICAgICBoID0gYm94LmhlaWdodCxcbiAgICAgICAgICAgICAgICAgICAgdyA9IHRleHQgPyAoYm94LndpZHRoIC8gdGV4dC5sZW5ndGgpIDogdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmIChoICYmIHcpIHtcbiAgICAgICAgICAgICAgICAgICAgc2l6ZS5oID0gaDtcbiAgICAgICAgICAgICAgICAgICAgc2l6ZS53ID0gdztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KS50ZXh0KCcnKTtcbiAgICAgICAgICAgIHRpY2tUZXh0Q2hhclNpemUgPSBzaXplO1xuICAgICAgICAgICAgcmV0dXJuIHNpemU7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gdHJhbnNpdGlvbmlzZShzZWxlY3Rpb24pIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJhbXMud2l0aG91dFRyYW5zaXRpb24gPyBzZWxlY3Rpb24gOiBkMy50cmFuc2l0aW9uKHNlbGVj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wgdGlja1gsIHRpY2tZO1xuXG4gICAgICAgICAgICAgICAgdmFyIHJhbmdlID0gc2NhbGUucmFuZ2VFeHRlbnQgPyBzY2FsZS5yYW5nZUV4dGVudCgpIDogc2NhbGVFeHRlbnQoc2NhbGUucmFuZ2UoKSksXG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSBnLnNlbGVjdEFsbChcIi5kb21haW5cIikuZGF0YShbIDAgXSksXG4gICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUgPSAocGF0aC5lbnRlcigpLmFwcGVuZChcInBhdGhcIikuYXR0cihcImNsYXNzXCIsIFwiZG9tYWluXCIpLCB0cmFuc2l0aW9uaXNlKHBhdGgpKTtcbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuYXBwZW5kKFwibGluZVwiKTtcbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuYXBwZW5kKFwidGV4dFwiKTtcblxuICAgICAgICAgICAgICAgIHZhciBsaW5lRW50ZXIgPSB0aWNrRW50ZXIuc2VsZWN0KFwibGluZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZSA9IHRpY2tVcGRhdGUuc2VsZWN0KFwibGluZVwiKSxcbiAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyID0gdGlja0VudGVyLnNlbGVjdChcInRleHRcIiksXG4gICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUgPSB0aWNrVXBkYXRlLnNlbGVjdChcInRleHRcIik7XG5cbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmlzQ2F0ZWdvcnkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja09mZnNldCA9IE1hdGguY2VpbCgoc2NhbGUxKDEpIC0gc2NhbGUxKDApKSAvIDIpO1xuICAgICAgICAgICAgICAgICAgICB0aWNrWCA9IHRpY2tDZW50ZXJlZCA/IDAgOiB0aWNrT2Zmc2V0O1xuICAgICAgICAgICAgICAgICAgICB0aWNrWSA9IHRpY2tDZW50ZXJlZCA/IHRpY2tPZmZzZXQgOiAwO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tPZmZzZXQgPSB0aWNrWCA9IDA7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIHRleHQsIHRzcGFuLCBzaXplRm9yMUNoYXIgPSBnZXRTaXplRm9yMUNoYXIoZy5zZWxlY3QoJy50aWNrJykpLCBjb3VudHMgPSBbXTtcbiAgICAgICAgICAgICAgICB2YXIgdGlja0xlbmd0aCA9IE1hdGgubWF4KGlubmVyVGlja1NpemUsIDApICsgdGlja1BhZGRpbmcsXG4gICAgICAgICAgICAgICAgICAgIGlzVmVydGljYWwgPSBvcmllbnQgPT09ICdsZWZ0JyB8fCBvcmllbnQgPT09ICdyaWdodCc7XG5cbiAgICAgICAgICAgICAgICAvLyB0aGlzIHNob3VsZCBiZSBjYWxsZWQgb25seSB3aGVuIGNhdGVnb3J5IGF4aXNcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzcGxpdFRpY2tUZXh0KGQsIG1heFdpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0aWNrVGV4dCA9IHRleHRGb3JtYXR0ZWQoZCksXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJ0ZXh0LCBzcGFjZUluZGV4LCB0ZXh0V2lkdGgsIHNwbGl0dGVkID0gW107XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh0aWNrVGV4dCkgPT09IFwiW29iamVjdCBBcnJheV1cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRpY2tUZXh0O1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFtYXhXaWR0aCB8fCBtYXhXaWR0aCA8PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXhXaWR0aCA9IGlzVmVydGljYWwgPyA5NSA6IHBhcmFtcy5pc0NhdGVnb3J5ID8gKE1hdGguY2VpbChzY2FsZTEodGlja3NbMV0pIC0gc2NhbGUxKHRpY2tzWzBdKSkgLSAxMikgOiAxMTA7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBzcGxpdChzcGxpdHRlZCwgdGV4dCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3BhY2VJbmRleCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgdGV4dC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJBdChpKSA9PT0gJyAnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlSW5kZXggPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0ZXh0ID0gdGV4dC5zdWJzdHIoMCwgaSArIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRXaWR0aCA9IHNpemVGb3IxQ2hhci53ICogc3VidGV4dC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGV4dCB3aWR0aCBnZXRzIG92ZXIgdGljayB3aWR0aCwgc3BsaXQgYnkgc3BhY2UgaW5kZXggb3IgY3JyZW50IGluZGV4XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1heFdpZHRoIDwgdGV4dFdpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwbGl0dGVkLmNvbmNhdCh0ZXh0LnN1YnN0cigwLCBzcGFjZUluZGV4ID8gc3BhY2VJbmRleCA6IGkpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc2xpY2Uoc3BhY2VJbmRleCA/IHNwYWNlSW5kZXggKyAxIDogaSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXR0ZWQuY29uY2F0KHRleHQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwbGl0KHNwbGl0dGVkLCB0aWNrVGV4dCArIFwiXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRzcGFuRHkoZCwgaSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZHkgPSBzaXplRm9yMUNoYXIuaDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcmllbnQgPT09ICdsZWZ0JyB8fCBvcmllbnQgPT09ICdyaWdodCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkeSA9IC0oKGNvdW50c1tkLmluZGV4XSAtIDEpICogKHNpemVGb3IxQ2hhci5oIC8gMikgLSAzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZHkgPSBcIi43MWVtXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGR5O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRpY2tTaXplKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpY2tQb3NpdGlvbiA9IHNjYWxlKGQpICsgKHRpY2tDZW50ZXJlZCA/IDAgOiB0aWNrT2Zmc2V0KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJhbmdlWzBdIDwgdGlja1Bvc2l0aW9uICYmIHRpY2tQb3NpdGlvbiA8IHJhbmdlWzFdID8gaW5uZXJUaWNrU2l6ZSA6IDA7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdGV4dCA9IHRpY2suc2VsZWN0KFwidGV4dFwiKTtcbiAgICAgICAgICAgICAgICB0c3BhbiA9IHRleHQuc2VsZWN0QWxsKCd0c3BhbicpXG4gICAgICAgICAgICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uIChkLCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3BsaXR0ZWQgPSBwYXJhbXMudGlja011bHRpbGluZSA/IHNwbGl0VGlja1RleHQoZCwgcGFyYW1zLnRpY2tXaWR0aCkgOiBbXS5jb25jYXQodGV4dEZvcm1hdHRlZChkKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb3VudHNbaV0gPSBzcGxpdHRlZC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXR0ZWQubWFwKGZ1bmN0aW9uIChzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgaW5kZXg6IGksIHNwbGl0dGVkOiBzIH07XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdHNwYW4uZW50ZXIoKS5hcHBlbmQoJ3RzcGFuJyk7XG4gICAgICAgICAgICAgICAgdHNwYW4uZXhpdCgpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIHRzcGFuLnRleHQoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGQuc3BsaXR0ZWQ7IH0pO1xuXG4gICAgICAgICAgICAgICAgdmFyIHJvdGF0ZSA9IHBhcmFtcy50aWNrVGV4dFJvdGF0ZTtcblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRleHRBbmNob3JGb3JUZXh0KHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdtaWRkbGUnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByb3RhdGUgPiAwID8gXCJzdGFydFwiIDogXCJlbmRcIjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdGV4dFRyYW5zZm9ybShyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJyb3RhdGUoXCIgKyByb3RhdGUgKyBcIilcIjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gZHhGb3JUZXh0KHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDggKiBNYXRoLnNpbihNYXRoLlBJICogKHJvdGF0ZSAvIDE4MCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB5Rm9yVGV4dChyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyb3RhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aWNrTGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxMS41IC0gMi41ICogKHJvdGF0ZSAvIDE1KSAqIChyb3RhdGUgPiAwID8gMSA6IC0xKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBzd2l0Y2ggKG9yaWVudCkge1xuICAgICAgICAgICAgICAgIGNhc2UgXCJib3R0b21cIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNYO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ5MlwiLCBpbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieVwiLCB0aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngxXCIsIHRpY2tYKS5hdHRyKFwieDJcIiwgdGlja1gpLmF0dHIoXCJ5MlwiLCB0aWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIDApLmF0dHIoXCJ5XCIsIHlGb3JUZXh0KHJvdGF0ZSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKFwidGV4dC1hbmNob3JcIiwgdGV4dEFuY2hvckZvclRleHQocm90YXRlKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCB0ZXh0VHJhbnNmb3JtKHJvdGF0ZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHNwYW4uYXR0cigneCcsIDApLmF0dHIoXCJkeVwiLCB0c3BhbkR5KS5hdHRyKCdkeCcsIGR4Rm9yVGV4dChyb3RhdGUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cihcImRcIiwgXCJNXCIgKyByYW5nZVswXSArIFwiLFwiICsgb3V0ZXJUaWNrU2l6ZSArIFwiVjBIXCIgKyByYW5nZVsxXSArIFwiVlwiICsgb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhc2UgXCJ0b3BcIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogcm90YXRlZCB0aWNrIHRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieTJcIiwgLWlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ5XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIDApLmF0dHIoXCJ5MlwiLCAtaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIDApLmF0dHIoXCJ5XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcIm1pZGRsZVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCAwKS5hdHRyKFwiZHlcIiwgXCIwZW1cIik7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgcmFuZ2VbMF0gKyBcIixcIiArIC1vdXRlclRpY2tTaXplICsgXCJWMEhcIiArIHJhbmdlWzFdICsgXCJWXCIgKyAtb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhc2UgXCJsZWZ0XCI6XG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBheGlzWTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKFwieDJcIiwgLWlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ4XCIsIC10aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIC1pbm5lclRpY2tTaXplKS5hdHRyKFwieTFcIiwgdGlja1kpLmF0dHIoXCJ5MlwiLCB0aWNrWSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VXBkYXRlLmF0dHIoXCJ4XCIsIC10aWNrTGVuZ3RoKS5hdHRyKFwieVwiLCB0aWNrT2Zmc2V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcImVuZFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCAtdGlja0xlbmd0aCkuYXR0cihcImR5XCIsIHRzcGFuRHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKFwiZFwiLCBcIk1cIiArIC1vdXRlclRpY2tTaXplICsgXCIsXCIgKyByYW5nZVswXSArIFwiSDBWXCIgKyByYW5nZVsxXSArIFwiSFwiICsgLW91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXNlIFwicmlnaHRcIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNZO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ4MlwiLCBpbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKFwieFwiLCB0aWNrTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cihcIngyXCIsIGlubmVyVGlja1NpemUpLmF0dHIoXCJ5MlwiLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cihcInhcIiwgdGlja0xlbmd0aCkuYXR0cihcInlcIiwgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0LnN0eWxlKFwidGV4dC1hbmNob3JcIiwgXCJzdGFydFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRzcGFuLmF0dHIoJ3gnLCB0aWNrTGVuZ3RoKS5hdHRyKFwiZHlcIiwgdHNwYW5EeSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgb3V0ZXJUaWNrU2l6ZSArIFwiLFwiICsgcmFuZ2VbMF0gKyBcIkgwVlwiICsgcmFuZ2VbMV0gKyBcIkhcIiArIG91dGVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHNjYWxlMS5yYW5nZUJhbmQpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHggPSBzY2FsZTEsIGR4ID0geC5yYW5nZUJhbmQoKSAvIDI7XG4gICAgICAgICAgICAgICAgICAgIHNjYWxlMCA9IHNjYWxlMSA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geChkKSArIGR4O1xuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2NhbGUwLnJhbmdlQmFuZCkge1xuICAgICAgICAgICAgICAgICAgICBzY2FsZTAgPSBzY2FsZTE7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja0V4aXQuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aWNrRW50ZXIuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTApO1xuICAgICAgICAgICAgICAgIHRpY2tVcGRhdGUuY2FsbCh0aWNrVHJhbnNmb3JtLCBzY2FsZTEpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgYXhpcy5zY2FsZSA9IGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHNjYWxlOyB9XG4gICAgICAgICAgICBzY2FsZSA9IHg7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy5vcmllbnQgPSBmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiBvcmllbnQ7IH1cbiAgICAgICAgICAgIG9yaWVudCA9IHggaW4ge3RvcDogMSwgcmlnaHQ6IDEsIGJvdHRvbTogMSwgbGVmdDogMX0gPyB4ICsgXCJcIiA6IFwiYm90dG9tXCI7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrRm9ybWF0ID0gZnVuY3Rpb24gKGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrRm9ybWF0OyB9XG4gICAgICAgICAgICB0aWNrRm9ybWF0ID0gZm9ybWF0O1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0NlbnRlcmVkID0gZnVuY3Rpb24gKGlzQ2VudGVyZWQpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja0NlbnRlcmVkOyB9XG4gICAgICAgICAgICB0aWNrQ2VudGVyZWQgPSBpc0NlbnRlcmVkO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja09mZnNldCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aWNrT2Zmc2V0O1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tJbnRlcnZhbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBpbnRlcnZhbCwgbGVuZ3RoO1xuICAgICAgICAgICAgaWYgKHBhcmFtcy5pc0NhdGVnb3J5KSB7XG4gICAgICAgICAgICAgICAgaW50ZXJ2YWwgPSB0aWNrT2Zmc2V0ICogMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGxlbmd0aCA9IGF4aXMuZy5zZWxlY3QoJ3BhdGguZG9tYWluJykubm9kZSgpLmdldFRvdGFsTGVuZ3RoKCkgLSBvdXRlclRpY2tTaXplICogMjtcbiAgICAgICAgICAgICAgICBpbnRlcnZhbCA9IGxlbmd0aCAvIGF4aXMuZy5zZWxlY3RBbGwoJ2xpbmUnKS5zaXplKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gaW50ZXJ2YWwgPT09IEluZmluaXR5ID8gMCA6IGludGVydmFsO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrQXJndW1lbnRzOyB9XG4gICAgICAgICAgICB0aWNrQXJndW1lbnRzID0gYXJndW1lbnRzO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0N1bGxpbmcgPSBmdW5jdGlvbiAoY3VsbGluZykge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrQ3VsbGluZzsgfVxuICAgICAgICAgICAgdGlja0N1bGxpbmcgPSBjdWxsaW5nO1xuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja1ZhbHVlcyA9IGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHggPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICB0aWNrVmFsdWVzID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geChzY2FsZS5kb21haW4oKSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gdGlja1ZhbHVlczsgfVxuICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMgPSB4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBheGlzO1xuICAgIH1cblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmlzU2FmYXJpID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgdWEgPSB3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudDtcbiAgICAgICAgcmV0dXJuIHVhLmluZGV4T2YoJ1NhZmFyaScpID49IDAgJiYgdWEuaW5kZXhPZignQ2hyb21lJykgPCAwO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaXNDaHJvbWUgPSBmdW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XJPZkl0ZW1zO1xuICAgICAgICAgICAgIGlmIChuZXdJdGVtLl9vd25pbmdQYXRoU2VnTGlzdCkge1xuICAgICAgICAgICAgICAgICAvLyBTVkcyIHNwZWMgc2F5cyB0byBtYWtlIGEgY29weS5cbiAgICAgICAgICAgICAgICAgbmV3SXRlbSA9IG5ld0l0ZW0uY2xvbmUoKTtcbiAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgdGhpcy5fbGlzdC5zcGxpY2UoaW5kZXgsIDAsIG5ld0l0ZW0pO1xuICAgICAgICAgICAgIG5ld0l0ZW0uX293bmluZ1BhdGhTZWdMaXN0ID0gdGhpcztcbiAgICAgICAgICAgICB0aGlzLl93cml0ZUxpc3RUb1BhdGgoKTtcbiAgICAgICAgICAgICByZXR1cm4gbmV3SXRlbTtcbiAgICAgICAgIH1cblxuICAgICAgICAgU1ZHUGF0aFNlZ0xpc3QucHJvdG90eXBlLnJlcGxhY2VJdGVtID0gZnVuY3Rpb24obmV3SXRlbSwgaW5kZXgpIHtcbiAgICAgICAgICAgICB0aGlzLl9jaGVja1BhdGhTeW5jaHJvbml6ZWRUb0xpc3QoKTtcblxuICAgICAgICAgICAgIGlmIChuZXdJdGVtLl9vd25pbmdQYXRoU2VnTGlzdCkge1xuICAgICAgICAgICAgICAgICAvLyBTVkcyIHNwZWMgc2F5cyB0byBtYWtlIGEgY29weS5cbiAgICAgICAgICAgICAgICAgbmV3SXRlbSA9IG5ld0l0ZW0uY2xvbmUoKTtcbiAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgdGhpcy5fY2hlY2tWYWxpZEluZGV4KGluZGV4KTtcbiAgICAgICAgICAgICB0aGlzLl9saXN0W2luZGV4XSA9IG5ld0l0ZW07XG4gICAgICAgICAgICAgbmV3SXRlbS5fb3duaW5nUGF0aFNlZ0xpc3QgPSB0aGlzO1xuICAgICAgICAgICAgIHRoaXMuX3dyaXRlTGlzdFRvUGF0aCgpO1xuICAgICAgICAgICAgIHJldHVybiBuZXdJdGV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gICAgICAgICAgICAgcmV0dXJuIG5ld0l0ZW07XG4gICAgICAgICB9XG5cbiAgICAgICAgIFNWR1BhdGhTZWdMaXN0Ll9wYXRoU2VnQXJyYXlBc1N0cmluZyA9IGZ1bmN0aW9uKHBhdGhTZWdBcnJheSkge1xuICAgICAgICAgICAgIHZhciBzdHJpbmcgPSBcIlwiO1xuICAgICAgICAgICAgIHZhciBmaXJzdCA9IHRydWU7XG4gICAgICAgICAgICAgcGF0aFNlZ0FycmF5LmZvckVhY2goZnVuY3Rpb24ocGF0aFNlZykge1xuICAgICAgICAgICAgICAgICBpZiAoZmlyc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gcGF0aFNlZy5fYXNQYXRoU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gXCIgXCIgKyBwYXRoU2VnLl9hc1BhdGhTdHJpbmcoKTtcbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgIHJldHVybiBzdHJpbmc7XG4gICAgICAgICB9XG5cbiAgICAgICAgIC8vIFRoaXMgY2xvc2VseSBmb2xsb3dzIFNWR1BhdGhQYXJzZXI6OnBhcnNlUGF0aCBmcm9tIFNvdXJjZS9jb3JlL3N2Zy9TVkdQYXRoUGFyc2VyLmNwcC5cbiAgICAgICAgIFNWR1BhdGhTZWdMaXN0LnByb3RvdHlwZS5fcGFyc2VQYXRoID0gZnVuY3Rpb24oc3RyaW5nKSB7XG4gICAgICAgICAgICAgaWYgKCFzdHJpbmcgfHwgc3RyaW5nLmxlbmd0aCA9PSAwKVxuICAgICAgICAgICAgICAgICByZXR1cm4gW107XG5cbiAgICAgICAgICAgICB2YXIgb3duaW5nUGF0aFNlZ0xpc3QgPSB0aGlzO1xuXG4gICAgICAgICAgICAgdmFyIEJ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ICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5fc2tpcE9wdGlvbmFsU3BhY2VzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHdoaWxlICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9pc0N1cnJlbnRTcGFjZSgpKVxuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleDtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9za2lwT3B0aW9uYWxTcGFjZXNPckRlbGltaXRlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgIXRoaXMuX2lzQ3VycmVudFNwYWNlKCkgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpICE9IFwiLFwiKVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCIsXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXg7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5oYXNNb3JlRGF0YSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXg7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5wZWVrU2VnbWVudFR5cGUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgdmFyIGxvb2thaGVhZCA9IHRoaXMuX3N0cmluZ1t0aGlzLl9jdXJyZW50SW5kZXhdO1xuICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fcGF0aFNlZ1R5cGVGcm9tQ2hhcihsb29rYWhlYWQpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3BhdGhTZWdUeXBlRnJvbUNoYXIgPSBmdW5jdGlvbihsb29rYWhlYWQpIHtcbiAgICAgICAgICAgICAgICAgc3dpdGNoIChsb29rYWhlYWQpIHtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlpcIjpcbiAgICAgICAgICAgICAgICAgY2FzZSBcInpcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ0xPU0VQQVRIO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiTVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwibVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiTFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwibFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiQ1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcImNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJRXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInFcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19RVUFEUkFUSUNfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiQVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19BUkNfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiYVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19BUkNfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiSFwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fSE9SSVpPTlRBTF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJoXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19IT1JJWk9OVEFMX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlZcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1ZFUlRJQ0FMX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInZcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX1ZFUlRJQ0FMX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlNcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19DVUJJQ19TTU9PVEhfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwic1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX1NNT09USF9SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJUXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX1NNT09USF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJ0XCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fUVVBRFJBVElDX1NNT09USF9SRUw7XG4gICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV047XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9uZXh0Q29tbWFuZEhlbHBlciA9IGZ1bmN0aW9uKGxvb2thaGVhZCwgcHJldmlvdXNDb21tYW5kKSB7XG4gICAgICAgICAgICAgICAgIC8vIENoZWNrIGZvciByZW1haW5pbmcgY29vcmRpbmF0ZXMgaW4gdGhlIGN1cnJlbnQgY29tbWFuZC5cbiAgICAgICAgICAgICAgICAgaWYgKChsb29rYWhlYWQgPT0gXCIrXCIgfHwgbG9va2FoZWFkID09IFwiLVwiIHx8IGxvb2thaGVhZCA9PSBcIi5cIiB8fCAobG9va2FoZWFkID49IFwiMFwiICYmIGxvb2thaGVhZCA8PSBcIjlcIikpICYmIHByZXZpb3VzQ29tbWFuZCAhPSBTVkdQYXRoU2VnLlBBVEhTRUdfQ0xPU0VQQVRIKSB7XG4gICAgICAgICAgICAgICAgICAgICBpZiAocHJldmlvdXNDb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX0FCUztcbiAgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2aW91c0NvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUwpXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fUkVMO1xuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByZXZpb3VzQ29tbWFuZDtcbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV047XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5pbml0aWFsQ29tbWFuZElzTW92ZVRvID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIC8vIElmIHRoZSBwYXRoIGlzIGVtcHR5IGl0IGlzIHN0aWxsIHZhbGlkLCBzbyByZXR1cm4gdHJ1ZS5cbiAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmhhc01vcmVEYXRhKCkpXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgdmFyIGNvbW1hbmQgPSB0aGlzLnBlZWtTZWdtZW50VHlwZSgpO1xuICAgICAgICAgICAgICAgICAvLyBQYXRoIG11c3Qgc3RhcnQgd2l0aCBtb3ZlVG8uXG4gICAgICAgICAgICAgICAgIHJldHVybiBjb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTIHx8IGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUw7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgLy8gUGFyc2UgYSBudW1iZXIgZnJvbSBhbiBTVkcgcGF0aC4gVGhpcyB2ZXJ5IGNsb3NlbHkgZm9sbG93cyBnZW5lcmljUGFyc2VOdW1iZXIoLi4uKSBmcm9tIFNvdXJjZS9jb3JlL3N2Zy9TVkdQYXJzZXJVdGlsaXRpZXMuY3BwLlxuICAgICAgICAgICAgIC8vIFNwZWM6IGh0dHA6Ly93d3cudzMub3JnL1RSL1NWRzExL3NpbmdsZS1wYWdlLmh0bWwjcGF0aHMtUGF0aERhdGFCTkZcbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9wYXJzZU51bWJlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB2YXIgZXhwb25lbnQgPSAwO1xuICAgICAgICAgICAgICAgICB2YXIgaW50ZWdlciA9IDA7XG4gICAgICAgICAgICAgICAgIHZhciBmcmFjID0gMTtcbiAgICAgICAgICAgICAgICAgdmFyIGRlY2ltYWwgPSAwO1xuICAgICAgICAgICAgICAgICB2YXIgc2lnbiA9IDE7XG4gICAgICAgICAgICAgICAgIHZhciBleHBzaWduID0gMTtcblxuICAgICAgICAgICAgICAgICB2YXIgc3RhcnRJbmRleCA9IHRoaXMuX2N1cnJlbnRJbmRleDtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKTtcblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBzaWduLlxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiK1wiKVxuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIi1cIikge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICBzaWduID0gLTE7XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID09IHRoaXMuX2VuZEluZGV4IHx8ICgodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDwgXCIwXCIgfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID4gXCI5XCIpICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSAhPSBcIi5cIikpXG4gICAgICAgICAgICAgICAgICAgICAvLyBUaGUgZmlyc3QgY2hhcmFjdGVyIG9mIGEgbnVtYmVyIG11c3QgYmUgb25lIG9mIFswLTkrLS5dLlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBpbnRlZ2VyIHBhcnQsIGJ1aWxkIHJpZ2h0LXRvLWxlZnQuXG4gICAgICAgICAgICAgICAgIHZhciBzdGFydEludFBhcnRJbmRleCA9IHRoaXMuX2N1cnJlbnRJbmRleDtcbiAgICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+PSBcIjBcIiAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPD0gXCI5XCIpXG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKzsgLy8gQWR2YW5jZSB0byBmaXJzdCBub24tZGlnaXQuXG5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCAhPSBzdGFydEludFBhcnRJbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgdmFyIHNjYW5JbnRQYXJ0SW5kZXggPSB0aGlzLl9jdXJyZW50SW5kZXggLSAxO1xuICAgICAgICAgICAgICAgICAgICAgdmFyIG11bHRpcGxpZXIgPSAxO1xuICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHNjYW5JbnRQYXJ0SW5kZXggPj0gc3RhcnRJbnRQYXJ0SW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlZ2VyICs9IG11bHRpcGxpZXIgKiAodGhpcy5fc3RyaW5nLmNoYXJBdChzY2FuSW50UGFydEluZGV4LS0pIC0gXCIwXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRpcGxpZXIgKj0gMTA7XG4gICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBkZWNpbWFscy5cbiAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIi5cIikge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIG11c3QgYmUgYSBsZWFzdCBvbmUgZGlnaXQgZm9sbG93aW5nIHRoZSAuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4IHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8IFwiMFwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+IFwiOVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgICB3aGlsZSAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID49IFwiMFwiICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8PSBcIjlcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICBkZWNpbWFsICs9ICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCsrKSAtIFwiMFwiKSAqIChmcmFjICo9IDAuMSk7XG4gICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAvLyBSZWFkIHRoZSBleHBvbmVudCBwYXJ0LlxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ICE9IHN0YXJ0SW5kZXggJiYgdGhpcy5fY3VycmVudEluZGV4ICsgMSA8IHRoaXMuX2VuZEluZGV4ICYmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCJlXCIgfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiRVwiKSAmJiAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXggKyAxKSAhPSBcInhcIiAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCArIDEpICE9IFwibVwiKSkge1xuICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFJlYWQgdGhlIHNpZ24gb2YgdGhlIGV4cG9uZW50LlxuICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIitcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCItXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHBzaWduID0gLTE7XG4gICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlIG11c3QgYmUgYW4gZXhwb25lbnQuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4IHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA8IFwiMFwiIHx8IHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+IFwiOVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgICAgIHdoaWxlICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPj0gXCIwXCIgJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDw9IFwiOVwiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXhwb25lbnQgKj0gMTA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgZXhwb25lbnQgKz0gKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSAtIFwiMFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIHZhciBudW1iZXIgPSBpbnRlZ2VyICsgZGVjaW1hbDtcbiAgICAgICAgICAgICAgICAgbnVtYmVyICo9IHNpZ247XG5cbiAgICAgICAgICAgICAgICAgaWYgKGV4cG9uZW50KVxuICAgICAgICAgICAgICAgICAgICAgbnVtYmVyICo9IE1hdGgucG93KDEwLCBleHBzaWduICogZXhwb25lbnQpO1xuXG4gICAgICAgICAgICAgICAgIGlmIChzdGFydEluZGV4ID09IHRoaXMuX2N1cnJlbnRJbmRleClcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fc2tpcE9wdGlvbmFsU3BhY2VzT3JEZWxpbWl0ZXIoKTtcblxuICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3BhcnNlQXJjRmxhZyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ID49IHRoaXMuX2VuZEluZGV4KVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgdmFyIGZsYWcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgdmFyIGZsYWdDaGFyID0gdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgrKyk7XG4gICAgICAgICAgICAgICAgIGlmIChmbGFnQ2hhciA9PSBcIjBcIilcbiAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZmxhZ0NoYXIgPT0gXCIxXCIpXG4gICAgICAgICAgICAgICAgICAgICBmbGFnID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXNPckRlbGltaXRlcigpO1xuICAgICAgICAgICAgICAgICByZXR1cm4gZmxhZztcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLnBhcnNlU2VnbWVudCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB2YXIgbG9va2FoZWFkID0gdGhpcy5fc3RyaW5nW3RoaXMuX2N1cnJlbnRJbmRleF07XG4gICAgICAgICAgICAgICAgIHZhciBjb21tYW5kID0gdGhpcy5fcGF0aFNlZ1R5cGVGcm9tQ2hhcihsb29rYWhlYWQpO1xuICAgICAgICAgICAgICAgICBpZiAoY29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTikge1xuICAgICAgICAgICAgICAgICAgICAgLy8gUG9zc2libHkgYW4gaW1wbGljaXQgY29tbWFuZC4gTm90IGFsbG93ZWQgaWYgdGhpcyBpcyB0aGUgZmlyc3QgY29tbWFuZC5cbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9wcmV2aW91c0NvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV04pXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgICBjb21tYW5kID0gdGhpcy5fbmV4dENvbW1hbmRIZWxwZXIobG9va2FoZWFkLCB0aGlzLl9wcmV2aW91c0NvbW1hbmQpO1xuICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX1VOS05PV04pXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3ByZXZpb3VzQ29tbWFuZCA9IGNvbW1hbmQ7XG5cbiAgICAgICAgICAgICAgICAgc3dpdGNoIChjb21tYW5kKSB7XG4gICAgICAgICAgICAgICAgIGNhc2UgU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUw6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNWR1BhdGhTZWdNb3ZldG9SZWwob3duaW5nUGF0aFNlZ0xpc3QsIHRoaXMuX3BhcnNlTnVtYmVyKCksIHRoaXMuX3BhcnNlTnVtYmVyKCkpO1xuICAgICAgICAgICAgICAgICBjYXNlIFNWR1BhdGhTZWcuUEFUSFNFR19NT1ZFVE9fQUJTOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTVkdQYXRoU2VnTW92ZXRvQWJzKG93bmluZ1BhdGhTZWdMaXN0LCB0aGlzLl9wYXJzZU51bWJlcigpLCB0aGlzLl9wYX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iBhKSBhID0gYjtcbiAgICB9IGVsc2Uge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSAhPSBudWxsICYmIGIgPj0gYikge1xuICAgICAgICBhID0gYjtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gZi5jYWxsKGFycmF5LCBhcnJheVtpXSwgaSkpICE9IG51bGwgJiYgYiA+IGEpIGEgPSBiO1xuICAgIH1cbiAgICByZXR1cm4gYTtcbiAgfTtcbiAgZDMuZXh0ZW50ID0gZnVuY3Rpb24oYXJyYXksIGYpIHtcbiAgICB2YXIgaSA9IC0xLCBuID0gYXJyYXkubGVuZ3RoLCBhLCBiLCBjO1xuICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxKSB7XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gYXJyYXlbaV0pICE9IG51bGwgJiYgYiA+PSBiKSB7XG4gICAgICAgIGEgPSBjID0gYjtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gYXJyYXlbaV0pICE9IG51bGwpIHtcbiAgICAgICAgaWYgKGEgPiBiKSBhID0gYjtcbiAgICAgICAgaWYgKGMgPCBiKSBjID0gYjtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSAhPSBudWxsICYmIGIgPj0gYikge1xuICAgICAgICBhID0gYyA9IGI7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICgoYiA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSAhPSBudWxsKSB7XG4gICAgICAgIGlmIChhID4gYikgYSA9IGI7XG4gICAgICAgI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xXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgem9vbXN0YXJ0ZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pLnR3ZWVuKFwiem9vbTp6b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIGR4ID0gc2l6ZVswXSwgZHkgPSBzaXplWzFdLCBjeCA9IGNlbnRlcjAgPyBjZW50ZXIwWzBdIDogZHggLyAyLCBjeSA9IGNlbnRlcjAgPyBjZW50ZXIwWzFdIDogZHkgLyAyLCBpID0gZDMuaW50ZXJwb2xhdGVab29tKFsgKGN4IC0gdmlldy54KSAvIHZpZXcuaywgKGN5IC0gdmlldy55KSAvIHZpZXcuaywgZHggLyB2aWV3LmsgXSwgWyAoY3ggLSB2aWV3MS54KSAvIHZpZXcxLmssIChjeSAtIHZpZXcxLnkpIC8gdmlldzEuaywgZHggLyB2aWV3MS5rIF0pO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgICAgdmFyIGwgPSBpKHQpLCBrID0gZHggLyBsWzJdO1xuICAgICAgICAgICAgICB0aGlzLl9fY2hhcnRfXyA9IHZpZXcgPSB7XG4gICAgICAgICAgICAgICAgeDogY3ggLSBsWzBdICogayxcbiAgICAgICAgICAgICAgICB5OiBjeSAtIGxbMV0gKiBrLFxuICAgICAgICAgICAgICAgIGs6IGtcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgem9vbWVkKGRpc3BhdGNoKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSkuZWFjaChcImludGVycnVwdC56b29tXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgem9vbWVuZGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB9KS5lYWNoKFwiZW5kLnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRoaXMuX19jaGFydF9fID0gdmlldztcbiAgICAgICAgICB6b29tc3RhcnRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgem9vbWVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuICAgIHpvb20udHJhbnNsYXRlID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gWyB2aWV3LngsIHZpZXcueSBdO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogK19bMF0sXG4gICAgICAgIHk6ICtfWzFdLFxuICAgICAgICBrOiB2aWV3LmtcbiAgICAgIH07XG4gICAgICByZXNjYWxlKCk7XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2NhbGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB2aWV3Lms7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiB2aWV3LngsXG4gICAgICAgIHk6IHZpZXcueSxcbiAgICAgICAgazogbnVsbFxuICAgICAgfTtcbiAgICAgIHNjYWxlVG8oK18pO1xuICAgICAgcmVzY2FsZSgpO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNjYWxlRXh0ZW50ID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2NhbGVFeHRlbnQ7XG4gICAgICBzY2FsZUV4dGVudCA9IF8gPT0gbnVsbCA/IGQzX2JlaGF2aW9yX3pvb21JbmZpbml0eSA6IFsgK19bMF0sICtfWzFdIF07XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uY2VudGVyID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY2VudGVyO1xuICAgICAgY2VudGVyID0gXyAmJiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnNpemUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaXplO1xuICAgICAgc2l6ZSA9IF8gJiYgWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5kdXJhdGlvbiA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGR1cmF0aW9uO1xuICAgICAgZHVyYXRpb24gPSArXztcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS54ID0gZnVuY3Rpb24oeikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDE7XG4gICAgICB4MSA9IHo7XG4gICAgICB4MCA9IHouY29weSgpO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogMCxcbiAgICAgICAgeTogMCxcbiAgICAgICAgazogMVxuICAgICAgfTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS55ID0gZnVuY3Rpb24oeikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTE7XG4gICAgICB5MSA9IHo7XG4gICAgICB5MCA9IHouY29weSgpO1xuICAgICAgdmlldyA9IHtcbiAgICAgICAgeDogMCxcbiAgICAgICAgeTogMCxcbiAgICAgICAgazogMVxuICAgICAgfTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgZnVuY3Rpb24gbG9jYXRpb24ocCkge1xuICAgICAgcmV0dXJuIFsgKHBbMF0gLSB2aWV3LngpIC8gdmlldy5rLCAocFsxXSAtIHZpZXcueSkgLyB2aWV3LmsgX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B7XG4gICAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaSArIDEpICE9PSAzNCkgYnJlYWs7XG4gICAgICAgICAgICAgICsraTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgSSA9IGkgKyAyO1xuICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KGkgKyAxKTtcbiAgICAgICAgICBpZiAoYyA9PT0gMTMpIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGkgKyAyKSA9PT0gMTApICsrSTtcbiAgICAgICAgICB9IGVsc2UgaWYgKGMgPT09IDEwKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqICsgMSwgaSkucmVwbGFjZSgvXCJcIi9nLCAnXCInKTtcbiAgICAgICAgfVxuICAgICAgICB3aGlsZSAoSSA8IE4pIHtcbiAgICAgICAgICB2YXIgYyA9IHRleHQuY2hhckNvZGVBdChJKyspLCBrID0gMTtcbiAgICAgICAgICBpZiAoYyA9PT0gMTApIGVvbCA9IHRydWU7IGVsc2UgaWYgKGMgPT09IDEzKSB7XG4gICAgICAgICAgICBlb2wgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChJKSA9PT0gMTApICsrSSwgKytrO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYyAhPT0gZGVsaW1pdGVyQ29kZSkgY29udGludWU7XG4gICAgICAgICAgcmV0dXJuIHRleHQuc2xpY2UoaiwgSSAtIGspO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGopO1xuICAgICAgfVxuICAgICAgd2hpbGUgKCh0ID0gdG9rZW4oKSkgIT09IEVPRikge1xuICAgICAgICB2YXIgYSA9IFtdO1xuICAgICAgICB3aGlsZSAodCAhPT0gRU9MICYmIHQgIT09IEVPRikge1xuICAgICAgICAgIGEucHVzaCh0KTtcbiAgICAgICAgICB0ID0gdG9rZW4oKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoZiAmJiAoYSA9IGYoYSwgbisrKSkgPT0gbnVsbCkgY29udGludWU7XG4gICAgICAgIHJvd3MucHVzaChhKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiByb3dzO1xuICAgIH07XG4gICAgZHN2LmZvcm1hdCA9IGZ1bmN0aW9uKHJvd3MpIHtcbiAgICAgIGlmIChBcnJheS5pc0FycmF5KHJvd3NbMF0pKSByZXR1cm4gZHN2LmZvcm1hdFJvd3Mocm93cyk7XG4gICAgICB2YXIgZmllbGRTZXQgPSBuZXcgZDNfU2V0KCksIGZpZWxkcyA9IFtdO1xuICAgICAgcm93cy5mb3JFYWNoKGZ1bmN0aW9uKHJvdykge1xuICAgICAgICBmb3IgKHZhciBmaWVsZCBpbiByb3cpIHtcbiAgICAgICAgICBpZiAoIWZpZWxkU2V0LmhhcyhmaWVsZCkpIHtcbiAgICAgICAgICAgIGZpZWxkcy5wdXNoKGZpZWxkU2V0LmFkZChmaWVsZCkpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICByZXR1cm4gWyBmaWVsZHMubWFwKGZvcm1hdFZhbHVlKS5qb2luKGRlbGltaXRlcikgXS5jb25jYXQocm93cy5tYXAoZnVuY3Rpb24ocm93KSB7XG4gICAgICAgIHJldHVybiBmaWVsZHMubWFwKGZ1bmN0aW9uKGZpZWxkKSB7XG4gICAgICAgICAgcmV0dXJuIGZvcm1hdFZhbHVlKHJvd1tmaWVsZF0pO1xuICAgICAgICB9KS5qb2luKGRlbGltaXRlcik7XG4gICAgICB9KSkuam9pbihcIlxcblwiKTtcbiAgICB9O1xuICAgIGRzdi5mb3JtYXRSb3dzID0gZnVuY3Rpb24ocm93cykge1xuICAgICAgcmV0dXJuIHJvd3MubWFwKGZvcm1hdFJvdykuam9pbihcIl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2FsZV9tb250aHMgPSBsb2NhbGUubW9udGhzLCBsb2NhbGVfc2hvcnRNb250aHMgPSBsb2NhbGUuc2hvcnRNb250aHM7XG4gICAgZnVuY3Rpb24gZDNfdGltZV9mb3JtYXQodGVtcGxhdGUpIHtcbiAgICAgIHZhciBuID0gdGVtcGxhdGUubGVuZ3RoO1xuICAgICAgZnVuY3Rpb24gZm9ybWF0KGRhdGUpIHtcbiAgICAgICAgdmFyIHN0cmluZyA9IFtdLCBpID0gLTEsIGogPSAwLCBjLCBwLCBmO1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIGlmICh0ZW1wbGF0ZS5jaGFyQ29kZUF0KGkpID09PSAzNykge1xuICAgICAgICAgICAgc3RyaW5nLnB1c2godGVtcGxhdGUuc2xpY2UoaiwgaSkpO1xuICAgICAgICAgICAgaWYgKChwID0gZDNfdGltZV9mb3JtYXRQYWRzW2MgPSB0ZW1wbGF0ZS5jaGFyQXQoKytpKV0pICE9IG51bGwpIGMgPSB0ZW1wbGF0ZS5jaGFyQXQoKytpKTtcbiAgICAgICAgICAgIGlmIChmID0gZDNfdGltZV9mb3JtYXRzW2NdKSBjID0gZihkYXRlLCBwID09IG51bGwgPyBjID09PSBcImVcIiA/IFwiIFwiIDogXCIwXCIgOiBwKTtcbiAgICAgICAgICAgIHN0cmluZy5wdXNoKGMpO1xuICAgICAgICAgICAgaiA9IGkgKyAxO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBzdHJpbmcucHVzaCh0ZW1wbGF0ZS5zbGljZShqLCBpKSk7XG4gICAgICAgIHJldHVybiBzdHJpbmcuam9pbihcIlwiKTtcbiAgICAgIH1cbiAgICAgIGZvcm1hdC5wYXJzZSA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICB2YXIgZCA9IHtcbiAgICAgICAgICB5OiAxOTAwLFxuICAgICAgICAgIG06IDAsXG4gICAgICAgICAgZDogMSxcbiAgICAgICAgICBIOiAwLFxuICA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gICAgICBVOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkM190aW1lLnN1bmRheU9mWWVhcihkKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgdzogZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gZC5nZXREYXkoKTtcbiAgICAgIH0sXG4gICAgICBXOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkM190aW1lLm1vbmRheU9mWWVhcihkKSwgcCwgMik7XG4gICAgICB9LFxuICAgICAgeDogZDNfdGltZV9mb3JtYXQobG9jYWxlX2RhdGUpLFxuICAgICAgWDogZDNfdGltZV9mb3JtYXQobG9jYWxlX3RpbWUpLFxuICAgICAgeTogZnVuY3Rpb24oZCwgcCkge1xuICAgICAgICByZXR1cm4gZDNfdGltZV9mb3JtYXRQYWQoZC5nZXRGdWxsWWVhcigpICUgMTAwLCBwLCAyKTtcbiAgICAgIH0sXG4gICAgICBZOiBmdW5jdGlvbihkLCBwKSB7XG4gICAgICAgIHJldHVybiBkM190aW1lX2Zvcm1hdFBhZChkLmdldEZ1bGxZZWFyKCkgJSAxZTQsIHAsIDQpO1xuICAgICAgfSxcbiAgICAgIFo6IGQzX3RpbWVfem9uZSxcbiAgICAgIFwiJVwiOiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIFwiJVwiO1xuICAgICAgfVxuICAgIH07XG4gICAgdmFyIGQzX3RpbWVfcGFyc2VycyA9IHtcbiAgICAgIGE6IGQzX3RpbWVfcGFyc2VXZWVrZGF5QWJicmV2LFxuICAgICAgQTogZDNfdGltZV9wYXJzZVdlZWtkYXksXG4gICAgICBiOiBkM190aW1lX3BhcnNlTW9udGhBYmJyZXYsXG4gICAgICBCOiBkM190aW1lX3BhcnNlTW9udGgsXG4gICAgICBjOiBkM190aW1lX3BhcnNlTG9jYWxlRnVsbCxcbiAgICAgIGQ6IGQ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ltZXJpZGlhbiBeIChzICogzrtfIDwgzrtpICYmIM67aSA8IHMgKiDOuykpIHtcbiAgICAgICAgICB2YXIgz4ZpID0gaW5mbGVjdGlvblsxXSAqIGQzX2RlZ3JlZXM7XG4gICAgICAgICAgaWYgKM+GaSA+IM+GMSkgz4YxID0gz4ZpO1xuICAgICAgICB9IGVsc2UgaWYgKM67aSA9ICjOu2kgKyAzNjApICUgMzYwIC0gMTgwLCBhbnRpbWVyaWRpYW4gXiAocyAqIM67XyA8IM67aSAmJiDOu2kgPCBzICogzrspKSB7XG4gICAgICAgICAgdmFyIM+GaSA9IC1pbmZsZWN0aW9uWzFdICogZDNfZGVncmVlcztcbiAgICAgICAgICBpZiAoz4ZpIDwgz4YwKSDPhjAgPSDPhmk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKM+GIDwgz4YwKSDPhjAgPSDPhjtcbiAgICAgICAgICBpZiAoz4YgPiDPhjEpIM+GMSA9IM+GO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhbnRpbWVyaWRpYW4pIHtcbiAgICAgICAgICBpZiAozrsgPCDOu18pIHtcbiAgICAgICAgICAgIGlmIChhbmdsZSjOuzAsIM67KSA+IGFuZ2xlKM67MCwgzrsxKSkgzrsxID0gzrs7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChhbmdsZSjOuywgzrsxKSA+IGFuZ2xlKM67MCwgzrsxKSkgzrswID0gzrs7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICjOuzEgPj0gzrswKSB7XG4gICAgICAgICAgICBpZiAozrsgPCDOuzApIM67MCA9IM67O1xuICAgICAgICAgICAgaWYgKM67ID4gzrsxKSDOuzEgPSDOuztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKM67ID4gzrtfKSB7XG4gICAgICAgICAgICAgIGlmIChhbmdsZSjOuzAsIM67KSA+IGFuZ2xlKM67MCwgzrsxKSkgzrsxID0gzrs7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYW5nbGUozrssIM67MSkgPiBhbmdsZSjOuzAsIM67MSkpIM67MCA9IM67O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcG9pbnQozrssIM+GKTtcbiAgICAgIH1cbiAgICAgIHAwID0gcCwgzrtfID0gzrs7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGxpbmVTdGFydCgpIHtcbiAgICAgIGJvdW5kLnBvaW50ID0gbGluZVBvaW50O1xuICAgIH1cbiAgICBmdW5jdGlvbiBsaW5lRW5kKCkge1xuICAgICAgcmFuZ2VbMF0gPSDOuzAsIHJhbmdlWzFdID0gzrsxO1xuICAgICAgYm91bmQucG9pbnQgPSBwb2ludDtcbiAgICAgIHAwID0gbnVsbDtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmluZ1BvaW50KM67LCDPhikge1xuICAgICAgaWYgKHAwKSB7XG4gICAgICAgIHZhciBkzrsgPSDOuyAtIM67XztcbiAgICAgICAgZM67U3VtICs9IGFicyhkzrspID4gMTgwID8gZM67ICsgKGTOuyA+IDAgPyAzNjAgOiAtMzYwKSA6IGTOuztcbiAgICAgIH0gZWxzZSDOu19fID0gzrssIM+GX18gPSDPhjtcbiAgICAgIGQzX2dlb19hcmVhLnBvaW50KM67LCDPhik7XG4gICAgICBsaW5lUG9pbnQozrssIM+GKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmluZ1N0YXJ0KCkge1xuICAgICAgZDNfZ2VvX2FyZWEubGluZVN0YXJ0KCk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHJpbmdFbmQoKSB7XG4gICAgICByaW5nUG9pbnQozrtfXywgz4ZfXyk7XG4gICAgICBkM19nZW9fYXJlYS5saW5lRW5kKCk7XG4gICAgICBpZiAoYWJzKGTOu1N1bSkgPiDOtSkgzrswID0gL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ZDNfZ2VvX2NlbnRyb2lkTGluZVN0YXJ0KCkge1xuICAgIHZhciB4MCwgeTAsIHowO1xuICAgIGQzX2dlb19jZW50cm9pZC5wb2ludCA9IGZ1bmN0aW9uKM67LCDPhikge1xuICAgICAgzrsgKj0gZDNfcmFkaWFucztcbiAgICAgIHZhciBjb3PPhiA9IE1hdGguY29zKM+GICo9IGQzX3JhZGlhbnMpO1xuICAgICAgeDAgPSBjb3PPhiAqIE1hdGguY29zKM67KTtcbiAgICAgIHkwID0gY29zz4YgKiBNYXRoLnNpbijOuyk7XG4gICAgICB6MCA9IE1hdGguc2luKM+GKTtcbiAgICAgIGQzX2dlb19jZW50cm9pZC5wb2ludCA9IG5leHRQb2ludDtcbiAgICAgIGQzX2dlb19jZW50cm9pZFBvaW50WFlaKHgwLCB5MCwgejApO1xuICAgIH07XG4gICAgZnVuY3Rpb24gbmV4dFBvaW50KM67LCDPhikge1xuICAgICAgzrsgKj0gZDNfcmFkaWFucztcbiAgICAgIHZhciBjb3PPhiA9IE1hdGguY29zKM+GICo9IGQzX3JhZGlhbnMpLCB4ID0gY29zz4YgKiBNYXRoLmNvcyjOuyksIHkgPSBjb3PPhiAqIE1hdGguc2luKM67KSwgeiA9IE1hdGguc2luKM+GKSwgdyA9IE1hdGguYXRhbjIoTWF0aC5zcXJ0KCh3ID0geTAgKiB6IC0gejAgKiB5KSAqIHcgKyAodyA9IHowICogeCAtIHgwICogeikgKiB3ICsgKHcgPSB4MCAqIHkgLSB5MCAqIHgpICogdyksIHgwICogeCArIHkwICogeSArIHowICogeik7XG4gICAgICBkM19nZW9fY2VudHJvaWRXMSArPSB3O1xuICAgICAgZDNfZ2VvX2NlbnRyb2lkWDEgKz0gdyAqICh4MCArICh4MCA9IHgpKTtcbiAgICAgIGQzX2dlb19jZW50cm9pZFkxICs9IHcgKiAoeTAgKyAoeTAgPSB5KSk7XG4gICAgICBkM19nZW9fY2VudHJvaWRaMSArPSB3ICogKHowICsgKHowID0geikpO1xuICAgICA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5ndGg7IGkgPCBuOyArK2kpIGxpc3RlbmVyLnBvaW50KChwb2ludCA9IHBvaW50c1tpXSlbMF0sIHBvaW50WzFdKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW50ZXJwb2xhdGUoY3VycmVudC54LCBjdXJyZW50Lm4ueCwgMSwgbGlzdGVuZXIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC5uO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChpc1N1YmplY3QpIHtcbiAgICAgICAgICAgIHBvaW50cyA9IGN1cnJlbnQucC56O1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IHBvaW50cy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkgbGlzdGVuZXIucG9pbnQoKHBvaW50ID0gcG9pbnRzW2ldKVswXSwgcG9pbnRbMV0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpbnRlcnBvbGF0ZShjdXJyZW50LngsIGN1cnJlbnQucC54LCAtMSwgbGlzdGVuZXIpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC5wO1xuICAgICAgICB9XG4gICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm87XG4gICAgICAgIHBvaW50cyA9IGN1cnJlbnQuejtcbiAgICAgICAgaXNTdWJqZWN0ID0gIWlzU3ViamVjdDtcbiAgICAgIH0gd2hpbGUgKCFjdXJyZW50LnYpO1xuICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgIH1cbiAgfVxuICBmdW5jdGlvbiBkM19nZW9fY2xpcFBvbHlnb25MaW5rQ2lyY3VsYXIoYXJyYXkpIHtcbiAgICBpZiAoIShuID0gYXJyYXkubGVuZ3RoKSkgcmV0dXJuO1xuICAgIHZhciBuLCBpID0gMCwgYSA9IGFycmF5WzBdLCBiO1xuICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICBhLm4gPSB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hcnRlZCA9IGZhbHNlLCBwb2x5Z29uLCByaW5nO1xuICAgICAgZnVuY3Rpb24gcG9pbnRSaW5nKM67LCDPhikge1xuICAgICAgICByaW5nLnB1c2goWyDOuywgz4YgXSk7XG4gICAgICAgIHZhciBwb2ludCA9IHJvdGF0ZSjOuywgz4YpO1xuICAgICAgICByaW5nTGlzdGVuZXIucG9pbnQocG9pbnRbMF0sIHBvaW50WzFdKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIHJpbmdTdGFydCgpIHtcbiAgICAgICAgcmluZ0xpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICByaW5nID0gW107XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiByaW5nRW5kKCkge1xuICAgICAgICBwb2ludFJpbmcocmluZ1swXVswXSwgcmluZ1swXVsxXSk7XG4gICAgICAgIHJpbmdMaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgIHZhciBjbGVhbiA9IHJpbmdMaXN0ZW5lci5jbGVhbigpLCByaW5nU2VnbWVudHMgPSBidWZmZXIuYnVmZmVyKCksIHNlZ21lbnQsIG4gPSByaW5nU2VnbWVudHMubGVuZ3RoO1xuICAgICAgICByaW5nLnBvcCgpO1xuICAgICAgICBwb2x5Z29uLnB1c2gocmluZyk7XG4gICAgICAgIHJpbmcgPSBudWxsO1xuICAgICAgICBpZiAoIW4pIHJldHVybjtcbiAgICAgICAgaWYgKGNsZWFuICYgMSkge1xuICAgICAgICAgIHNlZ21lbnQgPSByaW5nU2VnbWVudHNbMF07XG4gICAgICAgICAgdmFyIG4gPSBzZWdtZW50Lmxlbmd0aCAtIDEsIGkgPSAtMSwgcG9pbnQ7XG4gICAgICAgICAgaWYgKG4gPiAwKSB7XG4gICAgICAgICAgICBpZiAoIXBvbHlnb25TdGFydGVkKSBsaXN0ZW5lci5wb2x5Z29uU3RhcnQoKSwgcG9seWdvblN0YXJ0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgbGlzdGVuZXIubGluZ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M67MCwgz4YwID0gKM+GMCArIM+GMSkgLyAyID4gMCA/IGhhbGbPgCA6IC1oYWxmz4ApO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzAsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzEsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQozrsxLCDPhjApO1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgfSBlbHNlIGlmIChzzrswICE9PSBzzrsxICYmIGTOuyA+PSDPgCkge1xuICAgICAgICAgIGlmIChhYnMozrswIC0gc867MCkgPCDOtSkgzrswIC09IHPOuzAgKiDOtTtcbiAgICAgICAgICBpZiAoYWJzKM67MSAtIHPOuzEpIDwgzrUpIM67MSAtPSBzzrsxICogzrU7XG4gICAgICAgICAgz4YwID0gZDNfZ2VvX2NsaXBBbnRpbWVyaWRpYW5JbnRlcnNlY3QozrswLCDPhjAsIM67MSwgz4YxKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrswLCDPhjApO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludChzzrsxLCDPhjApO1xuICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgfVxuICAgICAgICBsaXN0ZW5lci5wb2ludCjOuzAgPSDOuzEsIM+GMCA9IM+GMSk7XG4gICAgICAgIHPOuzAgPSBzzrsxO1xuICAgICAgfSxcbiAgICAgIGxpbmVFbmQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgIM67MCA9IM+GMCA9IE5hTjtcbiAgICAgIH0sXG4gICAgICBjbGVhbjogZnVuY3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G4gICAgICAgIGxpbmVTdGFydDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdjAwID0gdjAgPSBmYWxzZTtcbiAgICAgICAgICBjbGVhbiA9IDE7XG4gICAgICAgIH0sXG4gICAgICAgIHBvaW50OiBmdW5jdGlvbijOuywgz4YpIHtcbiAgICAgICAgICB2YXIgcG9pbnQxID0gWyDOuywgz4YgXSwgcG9pbnQyLCB2ID0gdmlzaWJsZSjOuywgz4YpLCBjID0gc21hbGxSYWRpdXMgPyB2ID8gMCA6IGNvZGUozrssIM+GKSA6IHYgPyBjb2RlKM67ICsgKM67IDwgMCA/IM+AIDogLc+AKSwgz4YpIDogMDtcbiAgICAgICAgICBpZiAoIXBvaW50MCAmJiAodjAwID0gdjAgPSB2KSkgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgaWYgKHYgIT09IHYwKSB7XG4gICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgICAgaWYgKGQzX2dlb19zcGhlcmljYWxFcXVhbChwb2ludDAsIHBvaW50MikgfHwgZDNfZ2VvX3NwaGVyaWNhbEVxdWFsKHBvaW50MSwgcG9pbnQyKSkge1xuICAgICAgICAgICAgICBwb2ludDFbMF0gKz0gzrU7XG4gICAgICAgICAgICAgIHBvaW50MVsxXSArPSDOtTtcbiAgICAgICAgICAgICAgdiA9IHZpc2libGUocG9pbnQxWzBdLCBwb2ludDFbMV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICAgIGNsZWFuID0gMDtcbiAgICAgICAgICAgIGlmICh2KSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDApO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwb2ludDIgPSBpbnRlcnNlY3QocG9pbnQwLCBwb2ludDEpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChwb2ludDJbMF0sIHBvaW50MlsxXSk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBvaW50MCA9IHBvaW50MjtcbiAgICAgICAgICB9IGVsc2UgaWYgKG5vdEhlbWlzcGhlcmUgJiYgcG9pbnQwICYmIHNtYWxsUmFkaXVzIF4gdikge1xuICAgICAgICAgICAgdmFyIHQ7XG4gICAgICAgICAgICBpZiAoIShjICYgYzApICYmICh0ID0gaW50ZXJzZWN0KHBvaW50MSwgcG9pbnQwLCB0cnVlKSkpIHtcbiAgICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgICBpZiAoc21hbGxSYWRpdXMpIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzBdWzBdLCB0WzBdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFsxXVswXSwgdFsxXVsxXSk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfV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lmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH1cbiAgICAgIHIgPSB4MSAtIGF4O1xuICAgICAgaWYgKCFkeCAmJiByIDwgMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeDtcbiAgICAgIGlmIChkeCA8IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR4ID4gMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH1cbiAgICAgIHIgPSB5MCAtIGF5O1xuICAgICAgaWYgKCFkeSAmJiByID4gMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeTtcbiAgICAgIGlmIChkeSA8IDApIHtcbiAgICAgICAgaWYgKHIgPCB0MCkgcmV0dXJuO1xuICAgICAgICBpZiAociA8IHQxKSB0MSA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR5ID4gMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH1cbiAgICAgIHIgPSB5MSAtIGF5O1xuICAgICAgaWYgKCFkeSAmJiByIDwgMCkgcmV0dXJuO1xuICAgICAgciAvPSBkeTtcbiAgICAgIGlmIChkeSA8IDApIHtcbiAgICAgICAgaWYgKHIgPiB0MSkgcmV0dXJuO1xuICAgICAgICBpZiAociA+IHQwKSB0MCA9IHI7XG4gICAgICB9IGVsc2UgaWYgKGR5ID4gMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH1cbiAgICAgIGlmICh0MCA+IDApIGxpbmUuYSA9IHtcbiAgICAgICAgeDogYXggKyB0MCAqIGR4LFxuICAgICAgICB5OiBheSArIHQwICogZHlcbiAgICAgIH07XG4gICAgICBpZiAod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bnVsbCwgMSwgbGlzdGVuZXIpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodmlzaWJsZSkge1xuICAgICAgICAgICAgICBkM19nZW9fY2xpcFBvbHlnb24oc2VnbWVudHMsIGNvbXBhcmUsIGNsaXBTdGFydEluc2lkZSwgaW50ZXJwb2xhdGUsIGxpc3RlbmVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpc3RlbmVyLnBvbHlnb25FbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgc2VnbWVudHMgPSBwb2x5Z29uID0gcmluZyA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgICBmdW5jdGlvbiBpbnNpZGVQb2x5Z29uKHApIHtcbiAgICAgICAgdmFyIHduID0gMCwgbiA9IHBvbHlnb24ubGVuZ3RoLCB5ID0gcFsxXTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICBmb3IgKHZhciBqID0gMSwgdiA9IHBvbHlnb25baV0sIG0gPSB2Lmxlbmd0aCwgYSA9IHZbMF0sIGI7IGogPCBtOyArK2opIHtcbiAgICAgICAgICAgIGIgPSB2W2pdO1xuICAgICAgICAgICAgaWYgKGFbMV0gPD0geSkge1xuICAgICAgICAgICAgICBpZiAoYlsxXSA+IHkgJiYgZDNfY3Jvc3MyZChhLCBiLCBwKSA+IDApICsrd247XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYlsxXSA8PSB5ICYmIGQzX2Nyb3NzMmQoYSwgYiwgcCkgPCAwKSAtLXduO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYSA9IGI7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB3biAhPT0gMDtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGludGVycG9sYXRlKGZyb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ICAgIHhfID0geV8gPSBOYU47XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBsaW5lRW5kKCkge1xuICAgICAgICBpZiAoc2VnbWVudHMpIHtcbiAgICAgICAgICBsaW5lUG9pbnQoeF9fLCB5X18pO1xuICAgICAgICAgIGlmICh2X18gJiYgdl8pIGJ1ZmZlckxpc3RlbmVyLnJlam9pbigpO1xuICAgICAgICAgIHNlZ21lbnRzLnB1c2goYnVmZmVyTGlzdGVuZXIuYnVmZmVyKCkpO1xuICAgICAgICB9XG4gICAgICAgIGNsaXAucG9pbnQgPSBwb2ludDtcbiAgICAgICAgaWYgKHZfKSBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBsaW5lUG9pbnQoeCwgeSkge1xuICAgICAgICB4ID0gTWF0aC5tYXgoLWQzX2dlb19jbGlwRXh0ZW50TUFYLCBNYXRoLm1pbihkM19nZW9fY2xpcEV4dGVudE1BWCwgeCkpO1xuICAgICAgICB5ID0gTWF0aC5tYXgoLWQzX2dlb19jbGlwRXh0ZW50TUFYLCBNYXRoLm1pbihkM19nZW9fY2xpcEV4dGVudE1BWCwgeSkpO1xuICAgICAgICB2YXIgdiA9IHBvaW50VmlzaWJsZSh4LCB5KTtcbiAgICAgICAgaWYgKHBvbHlnb24pIHJpbmcucHVzaChbIHgsIHkgXSk7XG4gICAgICAgIGlmIChmaXJzdCkge1xuICAgICAgICAgIHhfXyA9IHgsIHlfXyA9IHksIHZfXyA9IHY7XG4gICAgICAgICAgZmlyc3QgPSBmYWxzZTtcbiAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh4LCB5KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKHYgJiYgdl8pIGxpc3RlbmVyLnBvaW50KHgsIHkpOyBlbHNlIHtcbiAgICAgICAgICAgIHZhciBsID0ge1xuICAgICAgICAgICAgICBhOiB7XG4gICAgICAgICAgICAgICAgeDogeF8sXG4gICAgICAgICAgICAgICAgeTogeV9cbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgYjoge1xuICAgICAgICAgICAgICAgIHg6IHgsXG4gICAgICAgICAgICAgICAgeTogeVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGNsaXBMaW5lKGwpKSB7XG4gICAgICAgICAgICAgIGlmICghdl8pIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludChsLmEueCwgbC5hLnkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KGwuYi54LCBsLmIueSk7XG4gICAgICAgICAgICAgIGlmICghdikgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh2KSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh4LCB5KTtcbiAgICAgICAgICAgICAgY2xlYW4gPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgeF8gPSB4LCB5XyA9IHksIHZfID0gdjtcbiAgICAgIH1cbiAgICAgIHJldHVybiBjbGlwO1xuICAgIH07XG4gICAgZnVuY3Rpb24gY29ybmVyKHAsIGRpcmVjdGlvbikge1xuICAgICAgcmV0dXJuIGFicyhwWzBdIC0geDApIDwgzrUgPyBkaXJlY3Rpb24gPiAwID8gMCA6IDMgOiBhYnMocFswXSAtIHgxKSA8IM61ID8gZGlyZWN0aW9uID4gMCA/IDIgOiAxIDogYWJzKHBbMV0gLSB5MCkgPCDOtSA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GZtICogZng7XG4gICAgICBpZiAoZm0gPCAtMSB8fCBmbSA+IDEpIHtcbiAgICAgICAgaWYgKGx4ID4gcngpIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6ICh5MCAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTBcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS55ID49IHkxKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiAoeTEgLSBmYikgLyBmbSxcbiAgICAgICAgICAgIHk6IHkxXG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6ICh5MSAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTFcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS55IDwgeTApIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6ICh5MCAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTBcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAobHkgPCByeSkge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogeDAsXG4gICAgICAgICAgICB5OiBmbSAqIHgwICsgZmJcbiAgICAgICAgICB9OyBlbHNlIGlmICh2YS54ID49IHgxKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiB4MSxcbiAgICAgICAgICAgIHk6IGZtICogeDEgKyBmYlxuICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiB4MSxcbiAgICAgICAgICAgIHk6IGZtICogeDEgKyBmYlxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnggPCB4MCkgcmV0dXJuO1x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RlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgICBhZnRlciA9IHBhcmVudDtcbiAgICAgICAgICAgICAgcGFyZW50ID0gYWZ0ZXIuVTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmVudC5DID0gZmFsc2U7XG4gICAgICAgICAgICBncmFuZHBhLkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBncmFuZHBhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdW5jbGUgPSBncmFuZHBhLkw7XG4gICAgICAgICAgaWYgKHVuY2xlICYmIHVuY2xlLkMpIHtcbiAgICAgICAgICAgIHBhcmVudC5DID0gdW5jbGUuQyA9IGZhbHNlO1xuICAgICAgICAgICAgZ3JhbmRwYS5DID0gdHJ1ZTtcbiAgICAgICAgICAgIGFmdGVyID0gZ3JhbmRwYTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGFmdGVyID09PSBwYXJlbnQuTCkge1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICAgIGFmdGVyID0gcGFyZW50O1xuICAgICAgICAgICAgICBwYXJlbnQgPSBhZnRlci5VO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGFyZW50LkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgZ3JhbmRwYSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHBhcmVudCA9IGFmdGVyLlU7XG4gICAgICB9XG4gICAgICB0aGlzLl8uQyA9IGZhbHNlO1xuICAgIH0sXG4gICAgc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GFyZW50ID0gbmV4dDtcbiAgICAgICAgICBub2RlID0gbmV4dC5SO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZWQgPSBub2RlLkM7XG4gICAgICAgIG5vZGUgPSBuZXh0O1xuICAgICAgfVxuICAgICAgaWYgKG5vZGUpIG5vZGUuVSA9IHBhcmVudDtcbiAgICAgIGlmIChyZWQpIHJldHVybjtcbiAgICAgIGlmIChub2RlICYmIG5vZGUuQykge1xuICAgICAgICBub2RlLkMgPSBmYWxzZTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgZG8ge1xuICAgICAgICBpZiAobm9kZSA9PT0gdGhpcy5fKSBicmVhaztcbiAgICAgICAgaWYgKG5vZGUgPT09IHBhcmVudC5MKSB7XG4gICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgIGlmIChzaWJsaW5nLkMpIHtcbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IGZhbHNlO1xuICAgICAgICAgICAgcGFyZW50LkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzaWJsaW5nLkwgJiYgc2libGluZy5MLkMgfHwgc2libGluZy5SICYmIHNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICBpZiAoIXNpYmxpbmcuUiB8fCAhc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgICAgc2libGluZy5MLkMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBzaWJsaW5nKTtcbiAgICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5SO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2libGluZy5DID0gcGFyZW50LkM7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHNpYmxpbmcuUi5DID0gZmFsc2U7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIG5vZGUgPSB0aGlzLl87XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgIGlmIChzaWJsaW5nLkMpIHtcbiAgICAgICAgICAgIHNpYmxpbmcuQyA9IGZhbHNlO1xuICAgICAgICAgICAgcGFyZW50LkMgPSB0cnVlO1xuICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVSaWdodCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc2libGluZy5MICYmIHNpYmxpbmcuTC5DIHx8IHNpYmxpbmcuUiAmJiBzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgaWYgKCFzaWJsaW5nLkwgfHwgIXNpYmxpbmcuTC5DKSB7XG4gICAgICAgICAgICAgIHNpYmxpbmcuUi5DID0gZmFsc2U7XG4gICAgICAgICAgICAgIHNpYmxpbmcuQyA9IHRydWU7XG4gICAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBzaWJsaW5nKTtcbiAgICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5MO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2libGluZy5DID0gcGFyZW50LkM7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHNpYmxpbmcuTC5DID0gZmFsc2U7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm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wgbiwgeDFfLCB5MV8sIHgyXywgeTJfO1xuICAgICAgaWYgKHgxICE9IG51bGwpIHtcbiAgICAgICAgeDFfID0geDEsIHkxXyA9IHkxLCB4Ml8gPSB4MiwgeTJfID0geTI7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB4Ml8gPSB5Ml8gPSAtKHgxXyA9IHkxXyA9IEluZmluaXR5KTtcbiAgICAgICAgeHMgPSBbXSwgeXMgPSBbXTtcbiAgICAgICAgbiA9IGRhdGEubGVuZ3RoO1xuICAgICAgICBpZiAoY29tcGF0KSBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgZCA9IGRhdGFbaV07XG4gICAgICAgICAgaWYgKGQueCA8IHgxXykgeDFfID0gZC54O1xuICAgICAgICAgIGlmIChkLnkgPCB5MV8pIHkxXyA9IGQueTtcbiAgICAgICAgICBpZiAoZC54ID4geDJfKSB4Ml8gPSBkLng7XG4gICAgICAgICAgaWYgKGQueSA+IHkyXykgeTJfID0gZC55O1xuICAgICAgICAgIHhzLnB1c2goZC54KTtcbiAgICAgICAgICB5cy5wdXNoKGQueSk7XG4gICAgICAgIH0gZWxzZSBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgdmFyIHhfID0gK2Z4KGQgPSBkYXRhW2ldLCBpKSwgeV8gPSArZnkoZCwgaSk7XG4gICAgICAgICAgaWYgKHhfIDwgeDFfKSB4MV8gPSB4XztcbiAgICAgICAgICBpZiAoeV8gPCB5MV8pIHkxXyA9IHlfO1xuICAgICAgICAgIGlmICh4XyA+IHgyXykgeDJfID0geF87XG4gICAgICAgICAgaWYgKHlfID4geTJfKSB5Ml8gPSB5XztcbiAgICAgICAgICB4cy5wdXNoKHhfKTtcbiAgICAgICAgICB5cy5wdXNoKHlfKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIGR4ID0geDJfIC0geDFfLCBkeSA9IHkyXyAtIHkxXztcbiAgICAgIGlmIChkeCA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3JvdXBJbmRleC5mb3JFYWNoKGZ1bmN0aW9uKGQsIGkpIHtcbiAgICAgICAgICBkLnNvcnQoZnVuY3Rpb24oYSwgYikge1xuICAgICAgICAgICAgcmV0dXJuIHNvcnRTdWJncm91cHMobWF0cml4W2ldW2FdLCBtYXRyaXhbaV1bYl0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICAgIGsgPSAoz4QgLSBwYWRkaW5nICogbikgLyBrO1xuICAgICAgeCA9IDAsIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIHgwID0geCwgaiA9IC0xO1xuICAgICAgICB3aGlsZSAoKytqIDwgbikge1xuICAgICAgICAgIHZhciBkaSA9IGdyb3VwSW5kZXhbaV0sIGRqID0gc3ViZ3JvdXBJbmRleFtkaV1bal0sIHYgPSBtYXRyaXhbZGldW2RqXSwgYTAgPSB4LCBhMSA9IHggKz0gdiAqIGs7XG4gICAgICAgICAgc3ViZ3JvdXBzW2RpICsgXCItXCIgKyBkal0gPSB7XG4gICAgICAgICAgICBpbmRleDogZGksXG4gICAgICAgICAgICBzdWJpbmRleDogZGosXG4gICAgICAgICAgICBzdGFydEFuZ2xlOiBhMCxcbiAgICAgICAgICAgIGVuZEFuZ2xlOiBhMSxcbiAgICAgICAgICAgIHZhbHVlOiB2XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBncm91cHNbZGldID0ge1xuICAgICAgICAgIGluZGV4OiBkaSxcbiAgICAgICAgICBzdGFydEFuZ2xlOiB4MCxcbiAgICAgICAgICBlbmRBbmdsZTogeCxcbiAgICAgICAgICB2YWx1ZTogZ3JvdXBTdW1zW2RpXVxuICAgICAgICB9O1xuICAgICAgICB4ICs9IHBhZGRpbmc7XG4gICAgICB9XG4gICAgICBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICBqID0gaSAtIDE7XG4gICAgICAgIHdoaWxlICgrK2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1cm4gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHF1YWQucG9pbnQgJiYgZG4gJiYgZG4gPCBjaGFyZ2VEaXN0YW5jZTIpIHtcbiAgICAgICAgICAgIHZhciBrID0gcXVhZC5wb2ludENoYXJnZSAvIGRuO1xuICAgICAgICAgICAgbm9kZS5weCAtPSBkeCAqIGs7XG4gICAgICAgICAgICBub2RlLnB5IC09IGR5ICogaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICFxdWFkLmNoYXJnZTtcbiAgICAgIH07XG4gICAgfVxuICAgIGZvcmNlLnRpY2sgPSBmdW5jdGlvbigpIHtcbiAgICAgIGlmICgoYWxwaGEgKj0gLjk5KSA8IC4wMDUpIHtcbiAgICAgICAgdGltZXIgPSBudWxsO1xuICAgICAgICBldmVudC5lbmQoe1xuICAgICAgICAgIHR5cGU6IFwiZW5kXCIsXG4gICAgICAgICAgYWxwaGE6IGFscGhhID0gMFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9XG4gICAgICB2YXIgbiA9IG5vZGVzLmxlbmd0aCwgbSA9IGxpbmtzLmxlbmd0aCwgcSwgaSwgbywgcywgdCwgbCwgaywgeCwgeTtcbiAgICAgIGZvciAoaSA9IDA7IGkgPCBtOyArK2kpIHtcbiAgICAgICAgbyA9IGxpbmtzW2ldO1xuICAgICAgICBzID0gby5zb3VyY2U7XG4gICAgICAgIHQgPSBvLnRhcmdldDtcbiAgICAgICAgeCA9IHQueCAtIHMueDtcbiAgICAgICAgeSA9IHQueSAtIHMueTtcbiAgICAgICAgaWYgKGwgPSB4ICogeCArIHkgKiB5KSB7XG4gICAgICAgICAgbCA9IGFscGhhICogc3RyZW5ndGhzW2ldICogKChsID0gTWF0aC5zcXJ0KGwpKSAtIGRpc3RhbmNlc1tpXSkgLyBsO1xuICAgICAgICAgIHggKj0gbDtcbiAgICAgICAgICB5ICo9IGw7XG4gICAgICAgICAgdC54IC09IHggKiAoayA9IHMud2VpZ2h0ICsgdC53ZWlnaHQgPyBzLndlaWdodCAvIChzLndlaWdodCArIHQud2VpZ2h0KSA6IC41KTtcbiAgICAgICAgICB0LnkgLT0geSAqIGs7XG4gICAgICAgICAgcy54ICs9IHggKiAoayA9IDEgLSBrKTtcbiAgICAgICAgICBzLnkgKz0geSAqIGs7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGlmIChrID0gYWxwaGEgKiBncmF2aXR5KSB7XG4gICAgICAgIHggPSBzaXplWzBdIC8gMjtcbiAgICAgICAgeSA9IHNpemVbMV0gLyAyO1xuICAgICAgICBpID0gLTE7XG4gICAgICAgIGlmIChrKSB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSBub2Rlc1tpXTtcbiAgICAgICAgICBvLnggKz0gKHggLSBvLngpICogaztcbiAgICAgICAgICBvLnkgKz0gKHkgLSBvLnkpICogaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGNoYXJnZSkge1xuICAgICAgICBkM19sYXlvdXRfZm9yY2VBY2N1bXVsYXRlKHEgPSBkMy5nZW9tLnF1YWR0cmVlKG5vZGVzKSwgYWxwaGEsIGNoYXJnZXMpO1xuICAgICAgICBpID0gLTE7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgaWYgKCEobyA9IG5vZGVzW2ldKS5maXhlZCkge1xuICAgICAgICAgICAgcS52aXNpdChyZXB1bHNlKG8pKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIG8gPSBub2Rlc1tpXTtcbiAgICAgICAgaWYgKG8uZml4ZWQpIHtcbiAgICAgICAgICBvLnggPSBvLnB4O1xuICAgICAgICAgIG8ueSA9IG8ucHk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgby54IC09IChvLnB4IC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iAgICAgIHJldHVybiBmb3JjZTtcbiAgICB9O1xuICAgIGZvcmNlLmFscGhhID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gYWxwaGE7XG4gICAgICB4ID0gK3g7XG4gICAgICBpZiAoYWxwaGEpIHtcbiAgICAgICAgaWYgKHggPiAwKSB7XG4gICAgICAgICAgYWxwaGEgPSB4O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRpbWVyLmMgPSBudWxsLCB0aW1lci50ID0gTmFOLCB0aW1lciA9IG51bGw7XG4gICAgICAgICAgZXZlbnQuZW5kKHtcbiAgICAgICAgICAgIHR5cGU6IFwiZW5kXCIsXG4gICAgICAgICAgICBhbHBoYTogYWxwaGEgPSAwXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAoeCA+IDApIHtcbiAgICAgICAgZXZlbnQuc3RhcnQoe1xuICAgICAgICAgIHR5cGU6IFwic3RhcnRcIixcbiAgICAgICAgICBhbHBoYTogYWxwaGEgPSB4XG4gICAgICAgIH0pO1xuICAgICAgICB0aW1lciA9IGQzX3RpbWVyKGZvcmNlLnRpY2spO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGZvcmNlO1xuICAgIH07XG4gICAgZm9yY2Uuc3RhcnQgPSBmdW5jdGlvbigpIHtcbiAgICAgIHZhciBpLCBuID0gbm9kZXMubGVuZ3RoLCBtID0gbGlua3MubGVuZ3RoLCB3ID0gc2l6ZVswXSwgaCA9IHNpemVbMV0sIG5laWdoYm9ycywgbztcbiAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgKG8gPSBub2Rlc1tpXSkuaW5kZXggPSBpO1xuICAgICAgICBvLndlaWdodCA9IDA7XG4gICAgICB9XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbTsgKytpKSB7XG4gICAgICAgIG8gPSBsaW5rc1tpXTtcbiAgICAgIC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uX3BhY2tfbmV4dCA9IGI7XG4gICAgYi5fcGFja19wcmV2ID0gYTtcbiAgfVxuICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja0ludGVyc2VjdHMoYSwgYikge1xuICAgIHZhciBkeCA9IGIueCAtIGEueCwgZHkgPSBiLnkgLSBhLnksIGRyID0gYS5yICsgYi5yO1xuICAgIHJldHVybiAuOTk5ICogZHIgKiBkciA+IGR4ICogZHggKyBkeSAqIGR5O1xuICB9XG4gIGZ1bmN0aW9uIGQzX2xheW91dF9wYWNrU2libGluZ3Mobm9kZSkge1xuICAgIGlmICghKG5vZGVzID0gbm9kZS5jaGlsZHJlbikgfHwgIShuID0gbm9kZXMubGVuZ3RoKSkgcmV0dXJuO1xuICAgIHZhciBub2RlcywgeE1pbiA9IEluZmluaXR5LCB4TWF4ID0gLUluZmluaXR5LCB5TWluID0gSW5maW5pdHksIHlNYXggPSAtSW5maW5pdHksIGEsIGIsIGMsIGksIGosIGssIG47XG4gICAgZnVuY3Rpb24gYm91bmQobm9kZSkge1xuICAgICAgeE1pbiA9IE1hdGgubWluKG5vZGUueCAtIG5vZGUuciwgeE1pbik7XG4gICAgICB4TWF4ID0gTWF0aC5tYXgobm9kZS54ICsgbm9kZS5yLCB4TWF4KTtcbiAgICAgIHlNaW4gPSBNYXRoLm1pbihub2RlLnkgLSBub2RlLnIsIHlNaW4pO1xuICAgICAgeU1heCA9IE1hdGgubWF4KG5vZGUueSArIG5vZGUuciwgeU1heCk7XG4gICAgfVxuICAgIG5vZGVzLmZvckVhY2goZDNfbGF5b3V0X3BhY2tMaW5rKTtcbiAgICBhID0gbm9kZXNbMF07XG4gICAgYS54ID0gLWEucjtcbiAgICBhLnkgPSAwO1xuICAgIGJvdW5kKGEpO1xuICAgIGlmIChuID4gMSkge1xuICAgICAgYiA9IG5vZGVzWzFdO1xuICAgICAgYi54ID0gYi5yO1xuICAgICAgYi55ID0gMDtcbiAgICAgIGJvdW5kKGIpO1xuICAgICAgaWYgKG4gPiAyKSB7XG4gICAgICAgIGMgPSBub2Rlc1syXTtcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tQbGFjZShhLCBiLCBjKTtcbiAgICAgICAgYm91bmQoYyk7XG4gICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGEsIGMpO1xuICAgICAgICBhLl9wYWNrX3ByZXYgPSBjO1xuICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChjLCBiKTtcbiAgICAgICAgYiA9IGEuX3BhY2tfbmV4dDtcbiAgICAgICAgZm9yIChpID0gMzsgaSA8IG47IGkrKykge1xuICAgICAgICAgIGQzX2xheW91dF9wYWNrUGxhY2UoYSwgYiwgYyA9IG5vZGVzW2ldKTtcbiAgICAgICAgICB2YXIgaXNlY3QgPSAwLCBzMSA9IDEsIHMyID0gMTtcbiAgICAgICAgICBmb3IgKGogPSBiLl9wYWNrX25leHQ7IGogIT09IGI7IGogPSBqLl9wYWNrX25leHQsIHMxKyspIHtcbiAgICAgICAgICAgIGlmIChkM19sYXlvdXRfcGFja0ludGVyc2VjdHMoaiwgYykpIHtcbiAgICAgICAgICAgICAgaXNlY3QgPSAxO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzZWN0ID09IDEpIHtcbiAgICAgICAgICAgIGZvciAoayA9IGEuX3BhY2tfcHJldjsgayAhPT0gai5fcGFja19wcmV2OyBrID0gay5fcGFja19wcmV2LCBzMisrKSB7XG4gICAgICAgICAgICAgIGlmIChkM19sYXlvdXRfcGFja0ludGVyc2VjdHMoaywgYykpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNlY3QpIHtcbiAgICAgICAgICAgIGlmIChzMSA8IHMyIHx8IHMxID09IHMyICYmIGIuciA8IGEucikgZDNfbGF5b3V0X3BhY2tTcGxpY2UoYSwg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obm9kZSkge1xuICAgICAgICAgIG5vZGUueCA9IChub2RlLnggKyB0eCkgKiBreDtcbiAgICAgICAgICBub2RlLnkgPSBub2RlLmRlcHRoICoga3k7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgcmV0dXJuIG5vZGVzO1xuICAgIH1cbiAgICBmdW5jdGlvbiB3cmFwVHJlZShyb290MCkge1xuICAgICAgdmFyIHJvb3QxID0ge1xuICAgICAgICBBOiBudWxsLFxuICAgICAgICBjaGlsZHJlbjogWyByb290MCBdXG4gICAgICB9LCBxdWV1ZSA9IFsgcm9vdDEgXSwgbm9kZTE7XG4gICAgICB3aGlsZSAoKG5vZGUxID0gcXVldWUucG9wKCkpICE9IG51bGwpIHtcbiAgICAgICAgZm9yICh2YXIgY2hpbGRyZW4gPSBub2RlMS5jaGlsZHJlbiwgY2hpbGQsIGkgPSAwLCBuID0gY2hpbGRyZW4ubGVuZ3RoOyBpIDwgbjsgKytpKSB7XG4gICAgICAgICAgcXVldWUucHVzaCgoY2hpbGRyZW5baV0gPSBjaGlsZCA9IHtcbiAgICAgICAgICAgIF86IGNoaWxkcmVuW2ldLFxuICAgICAgICAgICAgcGFyZW50OiBub2RlMSxcbiAgICAgICAgICAgIGNoaWxkcmVuOiAoY2hpbGQgPSBjaGlsZHJlbltpXS5jaGlsZHJlbikgJiYgY2hpbGQuc2xpY2UoKSB8fCBbXSxcbiAgICAgICAgICAgIEE6IG51bGwsXG4gICAgICAgICAgICBhOiBudWxsLFxuICAgICAgICAgICAgejogMCxcbiAgICAgICAgICAgIG06IDAsXG4gICAgICAgICAgICBjOiAwLFxuICAgICAgICAgICAgczogMCxcbiAgICAgICAgICAgIHQ6IG51bGwsXG4gICAgICAgICAgICBpOiBpXG4gICAgICAgICAgfSkuYSA9IGNoaWxkKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHJvb3QxLmNoaWxkcmVuWzBdO1xuICAgIH1cbiAgICBmdW5jdGlvbiBmaXJzdFd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tcbiAgICAgICAgd2hpbGUgKHZpbSA9IGQzX2xheW91dF90cmVlUmlnaHQodmltKSwgdmlwID0gZDNfbGF5b3V0X3RyZWVMZWZ0KHZpcCksIHZpbSAmJiB2aXApIHtcbiAgICAgICAgICB2b20gPSBkM19sYXlvdXRfdHJlZUxlZnQodm9tKTtcbiAgICAgICAgICB2b3AgPSBkM19sYXlvdXRfdHJlZVJpZ2h0KHZvcCk7XG4gICAgICAgICAgdm9wLmEgPSB2O1xuICAgICAgICAgIHNoaWZ0ID0gdmltLnogKyBzaW0gLSB2aXAueiAtIHNpcCArIHNlcGFyYXRpb24odmltLl8sIHZpcC5fKTtcbiAgICAgICAgICBpZiAoc2hpZnQgPiAwKSB7XG4gICAgICAgICAgICBkM19sYXlvdXRfdHJlZU1vdmUoZDNfbGF5b3V0X3RyZWVBbmNlc3Rvcih2aW0sIHYsIGFuY2VzdG9yKSwgdiwgc2hpZnQpO1xuICAgICAgICAgICAgc2lwICs9IHNoaWZ0O1xuICAgICAgICAgICAgc29wICs9IHNoaWZ0O1xuICAgICAgICAgIH1cbiAgICAgICAgICBzaW0gKz0gdmltLm07XG4gICAgICAgICAgc2lwICs9IHZpcC5tO1xuICAgICAgICAgIHNvbSArPSB2b20ubTtcbiAgICAgICAgICBzb3AgKz0gdm9wLm07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZpbSAmJiAhZDNfbGF5b3V0X3RyZWVSaWdodCh2b3ApKSB7XG4gICAgICAgICAgdm9wLnQgPSB2aW07XG4gICAgICAgICAgdm9wLm0gKz0gc2ltIC0gc29wO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2aXAgJiYgIWQzX2xheW91dF90cmVlTGVmdCh2b20pKSB7XG4gICAgICAgICAgdm9tLnQgPSB2aXA7XG4gICAgICAgICAgdm9tLm0gKz0gc2lwIC0gc29tO1xuICAgICAgICAgIGFuY2VzdG9yID0gdjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIGFuY2VzdG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ZSgpLCBjaGlsZCwgcm93ID0gW107XG4gICAgICAgIHNjYWxlKHJlbWFpbmluZywgcmVjdC5keCAqIHJlY3QuZHkgLyBub2RlLnZhbHVlKTtcbiAgICAgICAgcm93LmFyZWEgPSAwO1xuICAgICAgICB3aGlsZSAoY2hpbGQgPSByZW1haW5pbmcucG9wKCkpIHtcbiAgICAgICAgICByb3cucHVzaChjaGlsZCk7XG4gICAgICAgICAgcm93LmFyZWEgKz0gY2hpbGQuYXJlYTtcbiAgICAgICAgICBpZiAoY2hpbGQueiAhPSBudWxsKSB7XG4gICAgICAgICAgICBwb3NpdGlvbihyb3csIGNoaWxkLnogPyByZWN0LmR4IDogcmVjdC5keSwgcmVjdCwgIXJlbWFpbmluZy5sZW5ndGgpO1xuICAgICAgICAgICAgcm93Lmxlbmd0aCA9IHJvdy5hcmVhID0gMDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgY2hpbGRyZW4uZm9yRWFjaChzdGlja2lmeSk7XG4gICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIHdvcnN0KHJvdywgdSkge1xuICAgICAgdmFyIHMgPSByb3cuYXJlYSwgciwgcm1heCA9IDAsIHJtaW4gPSBJbmZpbml0eSwgaSA9IC0xLCBuID0gcm93Lmxlbmd0aDtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGlmICghKHIgPSByb3dbaV0uYXJlYSkpIGNvbnRpbnVlO1xuICAgICAgICBpZiAociA8IHJtaW4pIHJtaW4gPSByO1xuICAgICAgICBpZiAociA+IHJtYXgpIHJtYXggPSByO1xuICAgICAgfVxuICAgICAgcyAqPSBzO1xuICAgICAgdSAqPSB1O1xuICAgICAgcmV0dXJuIHMgPyBNYXRoLm1heCh1ICogcm1heCAqIHJhdGlvIC8gcywgcyAvICh1ICogcm1pbiAqIHJhdGlvKSkgOiBJbmZpbml0eTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcG9zaXRpb24ocm93LCB1LCByZWN0LCBmbHVzaCkge1xuICAgICAgdmFyIGkgPSAtMSwgbiA9IHJvdy5sZW5ndGgsIHggPSByZWN0LngsIHkgPSByZWN0LnksIHYgPSB1ID8gcm91bmQocm93LmFyZWEgLyB1KSA6IDAsIG87XG4gICAgICBpZiAodSA9PSByZWN0LmR4KSB7XG4gICAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keSkgdiA9IHJlY3QuZHk7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IHJvd1tpXTtcbiAgICAgICAgICBvLnggPSB4O1xuICAgICAgICAgIG8ueSA9IHk7XG4gICAgICAgICAgby5keSA9IHY7XG4gICAgICAgICAgeCArPSBvLmR4ID0gTWF0aC5taW4ocmVjdC54ICsgcmVjdC5keCAtIHgsIHYgPyByb3VuZChvLmFyZWEgLyB2KSA6IDApO1xuICAgICAgICB9XG4gICAgICAgIG8ueiA9IHRydWU7XG4gICAgICAgIG8uZHggKz0gcmVjdC54ICsgcmVjdC5keCAtIHg7XG4gICAgICAgIHJlY3QueSArPSB2O1xuICAgICAgICByZWN0LmR5IC09IHY7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoZmx1c2ggfHwgdiA+IHJlY3QuZHgpIHYgPSByZWN0LmR4O1xuICAgICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICAgIG8gPSByb3dbaV07XG4gICAgICAgICAgby54ID0geDtcbiAgICAgICAgICBvLnkgPSB5O1xuICAgICAgICAgIG8uZHggPSB2O1xuICAgICAgICAgIHkgKz0gby5keSA9IE1hdGgubWluKHJlY3QueSArIHJlY3QuZHkgLSB5LCB2ID8gcm91bmQoby5hcmVhIC8gdikgOiAwKTtcbiAgICAgICAgfVxuICAgICAgICBvLnogPSBmYWxzZTtcbiAgICAgICAgby5keSArPSByZWN0LnkgKyByZWN0LmR5IC0geTtcbiAgICAgICAgcmVjdC54ICs9IHY7XG4gICAgICAgIHJlY3QuZHggLT0gdjtc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YgKG4gPCAxKSDCtSA9IDA7XG4gICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciB4LCB5LCByO1xuICAgICAgICBkbyB7XG4gICAgICAgICAgeCA9IE1hdGgucmFuZG9tKCkgKiAyIC0gMTtcbiAgICAgICAgICB5ID0gTWF0aC5yYW5kb20oKSAqIDIgLSAxO1xuICAgICAgICAgIHIgPSB4ICogeCArIHkgKiB5O1xuICAgICAgICB9IHdoaWxlICghciB8fCByID4gMSk7XG4gICAgICAgIHJldHVybiDCtSArIM+DICogeCAqIE1hdGguc3FydCgtMiAqIE1hdGgubG9nKHIpIC8gcik7XG4gICAgICB9O1xuICAgIH0sXG4gICAgbG9nTm9ybWFsOiBmdW5jdGlvbigpIHtcbiAgICAgIHZhciByYW5kb20gPSBkMy5yYW5kb20ubm9ybWFsLmFwcGx5KGQzLCBhcmd1bWVudHMpO1xuICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gTWF0aC5leHAocmFuZG9tKCkpO1xuICAgICAgfTtcbiAgICB9LFxuICAgIGJhdGVzOiBmdW5jdGlvbihtKSB7XG4gICAgICB2YXIgcmFuZG9tID0gZDMucmFuZG9tLmlyd2luSGFsbChtKTtcbiAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIHJhbmRvbSgpIC8gbTtcbiAgICAgIH07XG4gICAgfSxcbiAgICBpcndpbkhhbGw6IGZ1bmN0aW9uKG0pIHtcbiAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgZm9yICh2YXIgcyA9IDAsIGogPSAwOyBqIDwgbTsgaisrKSBzICs9IE1hdGgucmFuZG9tKCk7XG4gICAgICAgIHJldHVybiBzO1xuICAgICAgfTtcbiAgICB9XG4gIH07XG4gIGQzLnNjYWxlID0ge307XG4gIGZ1bmN0aW9uIGQzX3NjYWxlRXh0ZW50KGRvbWFpbikge1xuICAgIHZhciBzdGFydCA9IG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hbmdlbnRzKHBvaW50cykge1xuICAgIHZhciB0YW5nZW50cyA9IFtdLCBkLCBhLCBiLCBzLCBtID0gZDNfc3ZnX2xpbmVGaW5pdGVEaWZmZXJlbmNlcyhwb2ludHMpLCBpID0gLTEsIGogPSBwb2ludHMubGVuZ3RoIC0gMTtcbiAgICB3aGlsZSAoKytpIDwgaikge1xuICAgICAgZCA9IGQzX3N2Z19saW5lU2xvcGUocG9pbnRzW2ldLCBwb2ludHNbaSArIDFdKTtcbiAgICAgIGlmIChhYnMoZCkgPCDOtSkge1xuICAgICAgICBtW2ldID0gbVtpICsgMV0gPSAwO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYSA9IG1baV0gLyBkO1xuICAgICAgICBiID0gbVtpICsgMV0gLyBkO1xuICAgICAgICBzID0gYSAqIGEgKyBiICogYjtcbiAgICAgICAgaWYgKHMgPiA5KSB7XG4gICAgICAgICAgcyA9IGQgKiAzIC8gTWF0aC5zcXJ0KHMpO1xuICAgICAgICAgIG1baV0gPSBzICogYTtcbiAgICAgICAgICBtW2kgKyAxXSA9IHMgKiBiO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGkgPSAtMTtcbiAgICB3aGlsZSAoKytpIDw9IGopIHtcbiAgICAgIHMgPSAocG9pbnRzW01hdGgubWluKGosIGkgKyAxKV1bMF0gLSBwb2ludHNbTWF0aC5tYXgoMCwgaSAtIDEpXVswXSkgLyAoNiAqICgxICsgbVtpXSAqIG1baV0pKTtcbiAgICAgIHRhbmdlbnRzLnB1c2goWyBzIHx8IDAsIG1baV0gKiBzIHx8IDAgXSk7XG4gICAgfVxuICAgIHJldHVybiB0YW5nZW50cztcbiAgfVxuICBmdW5jdGlvbiBkM19zdmdfbGluZU1vbm90b25lKHBvaW50cykge1xuICAgIHJldHVybiBwb2ludHMubGVuZ3RoIDwgMyA/IGQzX3N2Z19saW5lTGluZWFyKHBvaW50cykgOiBwb2ludHNbMF0gKyBkM19zdmdfbGluZUhlcm1pd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WFnb25hbFByb2plY3Rpb247XG4gICAgZnVuY3Rpb24gZGlhZ29uYWwoZCwgaSkge1xuICAgICAgdmFyIHAwID0gc291cmNlLmNhbGwodGhpcywgZCwgaSksIHAzID0gdGFyZ2V0LmNhbGwodGhpcywgZCwgaSksIG0gPSAocDAueSArIHAzLnkpIC8gMiwgcCA9IFsgcDAsIHtcbiAgICAgICAgeDogcDAueCxcbiAgICAgICAgeTogbVxuICAgICAgfSwge1xuICAgICAgICB4OiBwMy54LFxuICAgICAgICB5OiBtXG4gICAgICB9LCBwMyBdO1xuICAgICAgcCA9IHAubWFwKHByb2plY3Rpb24pO1xuICAgICAgcmV0dXJuIFwiTVwiICsgcFswXSArIFwiQ1wiICsgcFsxXSArIFwiIFwiICsgcFsyXSArIFwiIFwiICsgcFszXTtcbiAgICB9XG4gICAgZGlhZ29uYWwuc291cmNlID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc291cmNlO1xuICAgICAgc291cmNlID0gZDNfZnVuY3Rvcih4KTtcbiAgICAgIHJldHVybiBkaWFnb25hbDtcbiAgICB9O1xuICAgIGRpYWdvbmFsLnRhcmdldCA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRhcmdldDtcbiAgICAgIHRhcmdldCA9IGQzX2Z1bmN0b3IoeCk7XG4gICAgICByZXR1cm4gZGlhZ29uYWw7XG4gICAgfTtcbiAgICBkaWFnb25hbC5wcm9qZWN0aW9uID0gZnVuY3Rpb24oeCkge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcHJvamVjdGlvbjtcbiAgICAgIHByb2plY3Rpb24gPSB4O1xuICAgICAgcmV0dXJuIGRpYWdvbmFsO1xuICAgIH07XG4gICAgcmV0dXJuIGRpYWdvbmFsO1xuICB9O1xuICBmdW5jdGlvbiBkM19zdmdfZGlhZ29uYWxQ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gZXh0ZW50MTtcbiAgICAgICAgdGhpcy5fX2NoYXJ0X18gPSBleHRlbnQxO1xuICAgICAgICBpZiAoZDNfdHJhbnNpdGlvbkluaGVyaXRJZCkge1xuICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS50cmFuc2l0aW9uKCkuZWFjaChcInN0YXJ0LmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IGV4dGVudDAuaTtcbiAgICAgICAgICAgIHlFeHRlbnREb21haW4gPSBleHRlbnQwLmo7XG4gICAgICAgICAgICB4RXh0ZW50ID0gZXh0ZW50MC54O1xuICAgICAgICAgICAgeUV4dGVudCA9IGV4dGVudDAueTtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hzdGFydFwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KS50d2VlbihcImJydXNoOmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIHhpID0gZDNfaW50ZXJwb2xhdGVBcnJheSh4RXh0ZW50LCBleHRlbnQxLngpLCB5aSA9IGQzX2ludGVycG9sYXRlQXJyYXkoeUV4dGVudCwgZXh0ZW50MS55KTtcbiAgICAgICAgICAgIHhFeHRlbnREb21haW4gPSB5RXh0ZW50RG9tYWluID0gbnVsbDtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbih0KSB7XG4gICAgICAgICAgICAgIHhFeHRlbnQgPSBleHRlbnQxLnggPSB4aSh0KTtcbiAgICAgICAgICAgICAgeUV4dGVudCA9IGV4dGVudDEueSA9IHlpKHQpO1xuICAgICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hcIixcbiAgICAgICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KS5lYWNoKFwiZW5kLmJydXNoXCIsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IGV4dGVudDEuaTtcbiAgICAgICAgICAgIHlFeHRlbnREb21haW4gPSBleHRlbnQxLmo7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICAgIG1vZGU6IFwicmVzaXplXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaGVuZFwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaHN0YXJ0XCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgIH0pO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoZW5kXCJcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfTtcbiAgICBmdW5jdGlvbiByZWRyYXcoZykge1xuICAgICAgZy5zZWxlY3RBbGwoXCIucmVzaXplXCIpLmF0dHIoXCJ0cmFuc2Zvcm1cIiwgZnVuY3Rpb24oZCkge1xuICAgICAgICByZXR1cm4gXCJ0cmFuc2xhdGUoXCIgKyB4RXh0ZW50WysvZSQvLnRlc3QoZCldICsgXCIsXCIgKyB5RXh0ZW50WysvXnMvLnRlc3QoZCldICsgXCIpXCI7XG4gICAgICB9KTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmVkcmF3WChnKSB7XG4gICAgICBnLnNlbGVjdChcIi5leHRlbnRcIikuYXR0cihcInhcIiwgeEV4dGVudFswXSk7XG4gICAg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bnRfKHtcbiAgICAgICAgdHlwZTogXCJicnVzaHN0YXJ0XCJcbiAgICAgIH0pO1xuICAgICAgYnJ1c2htb3ZlKCk7XG4gICAgICBmdW5jdGlvbiBrZXlkb3duKCkge1xuICAgICAgICBpZiAoZDMuZXZlbnQua2V5Q29kZSA9PSAzMikge1xuICAgICAgICAgIGlmICghZHJhZ2dpbmcpIHtcbiAgICAgICAgICAgIGNlbnRlciA9IG51bGw7XG4gICAgICAgICAgICBvcmlnaW5bMF0gLT0geEV4dGVudFsxXTtcbiAgICAgICAgICAgIG9yaWdpblsxXSAtPSB5RXh0ZW50WzFdO1xuICAgICAgICAgICAgZHJhZ2dpbmcgPSAyO1xuICAgICAgICAgIH1cbiAgICAgICAgICBkM19ldmVudFByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGtleXVwKCkge1xuICAgICAgICBpZiAoZDMuZXZlbnQua2V5Q29kZSA9PSAzMiAmJiBkcmFnZ2luZyA9PSAyKSB7XG4gICAgICAgICAgb3JpZ2luWzBdICs9IHhFeHRlbnRbMV07XG4gICAgICAgICAgb3JpZ2luWzFdICs9IHlFeHRlbnRbMV07XG4gICAgICAgICAgZHJhZ2dpbmcgPSAwO1xuICAgICAgICAgIGQzX2V2ZW50UHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gYnJ1c2htb3ZlKCkge1xuICAgICAgICB2YXIgcG9pbnQgPSBkMy5tb3VzZSh0YXJnZXQpLCBtb3ZlZCA9IGZhbHNlO1xuICAgICAgICBpZiAob2Zmc2V0KSB7XG4gICAgICAgICAgcG9pbnRbMF0gKz0gb2Zmc2V0WzBdO1xuICAgICAgICAgIHBvaW50WzFdICs9IG9mZnNldFsxXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWRyYWdnaW5nKSB7XG4gICAgICAgICAgaWYgKGQzLmV2ZW50LmFsdEtleSkge1x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GVudFsxXSAtIGV4dGVudFswXSwgbWluLCBtYXg7XG4gICAgICAgIGlmIChkcmFnZ2luZykge1xuICAgICAgICAgIHIwIC09IHBvc2l0aW9uO1xuICAgICAgICAgIHIxIC09IHNpemUgKyBwb3NpdGlvbjtcbiAgICAgICAgfVxuICAgICAgICBtaW4gPSAoaSA/IHlDbGFtcCA6IHhDbGFtcCkgPyBNYXRoLm1heChyMCwgTWF0aC5taW4ocjEsIHBvaW50W2ldKSkgOiBwb2ludFtpXTtcbiAgICAgICAgaWYgKGRyYWdnaW5nKSB7XG4gICAgICAgICAgbWF4ID0gKG1pbiArPSBwb3NpdGlvbikgKyBzaXplO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmIChjZW50ZXIpIHBvc2l0aW9uID0gTWF0aC5tYXgocjAsIE1hdGgubWluKHIxLCAyICogY2VudGVyW2ldIC0gbWluKSk7XG4gICAgICAgICAgaWYgKHBvc2l0aW9uIDwgbWluKSB7XG4gICAgICAgICAgICBtYXggPSBtaW47XG4gICAgICAgICAgICBtaW4gPSBwb3NpdGlvbjtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbWF4ID0gcG9zaXRpb247XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChleHRlbnRbMF0gIT0gbWluIHx8IGV4dGVudFsxXSAhPSBtYXgpIHtcbiAgICAgICAgICBpZiAoaSkgeUV4dGVudERvbWFpbiA9IG51bGw7IGVsc2UgeEV4dGVudERvbWFpbiA9IG51bGw7XG4gICAgICAgICAgZXh0ZW50WzBdID0gbWluO1xuICAgICAgICAgIGV4dGVudFsxXSA9IG1heDtcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24gYnJ1c2hlbmQoKSB7XG4gICAgICAgIGJydXNobW92ZSgpO1xuICAgICAgICBnLnN0eWxlKFwicG9pbnRlci1ldmVudHNcIiwgXCJhbGxcIiku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UNsYW1wIF0gOiB4ID8geENsYW1wIDogeSA/IHlDbGFtcCA6IG51bGw7XG4gICAgICBpZiAoeCAmJiB5KSB4Q2xhbXAgPSAhIXpbMF0sIHlDbGFtcCA9ICEhelsxXTsgZWxzZSBpZiAoeCkgeENsYW1wID0gISF6OyBlbHNlIGlmICh5KSB5Q2xhbXAgPSAhIXo7XG4gICAgICByZXR1cm4gYnJ1c2g7XG4gICAgfTtcbiAgICBicnVzaC5leHRlbnQgPSBmdW5jdGlvbih6KSB7XG4gICAgICB2YXIgeDAsIHgxLCB5MCwgeTEsIHQ7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgaWYgKHgpIHtcbiAgICAgICAgICBpZiAoeEV4dGVudERvbWFpbikge1xuICAgICAgICAgICAgeDAgPSB4RXh0ZW50RG9tYWluWzBdLCB4MSA9IHhFeHRlbnREb21haW5bMV07XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHgwID0geEV4dGVudFswXSwgeDEgPSB4RXh0ZW50WzFdO1xuICAgICAgICAgICAgaWYgKHguaW52ZXJ0KSB4MCA9IHguaW52ZXJ0KHgwKSwgeDEgPSB4LmludmVydCh4MSk7XG4gICAgICAgICAgICBpZiAoeDEgPCB4MCkgdCA9IHgwLCB4MCA9IHgxLCB4MSA9IHQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh5KSB7XG4gICAgICAgICAgaWYgKHlFeHRlbnREb21haW4pIHtcbiAgICAgICAgICAgIHkwID0geUV4dGVudERvbWFpblswXSwgeTEgPSB5RXh0ZW50RG9tYWluWzFdO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB5MCA9IHlFeHRlbnRbMF0sIHkxID0geUV4dGVudFsxXTtcbiAgICAgICAgICAgIGlmICh5LmludmVydCkgeTAgPSB5LmludmVydCh5MCksIHkxID0geS5pbnZlcnQoeTEpO1xuICAgICAgICAgICAgaWYgKHkxID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ICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IGludm9pY2Vfbm8gfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IGJ1eWVyX2Z1bGxuYW1lIH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57eyBidXllcl9lbWFpbCB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgYnV5ZXJfcGhvbmUgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7Y3VycmVuY3l9fXt7IGFtb3VudCB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgb3JkZXJfZGF0ZSB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgaWQgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPlxuICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPlxuICAgICAgICAgICAgICAgICAge3sjaWYgYW1vdW50ID09PSAwfX1cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4+RnJlZSBvcmRlcjwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgIHt7ZWxzZX19XG4gICAgICAgICAgICAgICAgICAgIDxzcGFuPlBhaWQgb3JkZXI8L3NwYW4+XG4gICAgICAgICAgICAgICAgICB7ey9pZn19XG4gICAgICAgICAgICAgICAgPC9wPlxuICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+PGEgY2xhc3M9XCJib3hvZ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aXRsZVwiPk9yZGVyIEludm9pY2UgTm86IHt7aW52b2ljZV9ub319PC9wPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJsaW5lLWl0ZW1zLXdyYXBwZXJcIj5cbiAgICAgICAgICAgICAgICAgIHt7I2xpbmVfaXRlbXM6bGluZV9pdGVtfX1cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRpY2tldCBjb2wtc20tNiBjb2wteHMtMTJcIiBpZD1cIml0ZW0te3sgQGluZGV4IH19XCI+XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImhlYWRpbmdcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0aWNrZXQtdHlwZVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD57eyB0aXRsZSB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250ZW50XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGVudC1ib3hcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5pZDo8L3NwYW4+IHt7IGlkIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPkJhc2UgYW1vdW50Ojwvc3Bhbj4ge3sgY3VycmVuY3kgfX17eyBiYXNlX2Ftb3VudCB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5EaXNjb3VudGVkIGFtb3VudDo8L3NwYW4+IHt7IGN1cnJlbmN5IH19e3sgZGlzY291bnRlZF9hbW91bnQgfX08L3A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3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+PHNwYW4gY2xhc3M9XCJpdGFsaWMtdGl0bGVcIj5QaG9uZTo8L3NwYW4+IHt7IHBob25lIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7I2RldGFpbHM6a2V5IH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPnt7IGtleSB9fTo8L3NwYW4+IHt7IC4gfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3tlbHNlfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48Yj5Ob3QgYXNzaWduZWQ8L2I+PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgICB7eyNjYW5jZWxfdGlja2V0X3VybCAmJiAhY2FuY2VsbGVkX2F0fX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJib3hvZmZpY2UtYnV0dG9uIGJveG9mZmljZS1idXR0b24tc21hbGwgYm94b2ZmaWNlLWJ1dHRvbi1pbmZvXCIgaHJlZj1cImphdmFzY3JpcHQ6dm9pZCgwKVwiIG9uLWNsaWNrPVwiY2FuY2VsVGlja2V0XCIge3sjY2FuY2VsbGluZ319ZGlzYWJsZWR7ey99fT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FuY2VsIHt7I2NhbmNlbGxpbmd9fTxpIGNsYXNzPVwiZmEgZmEtc3Bpbm5lciBmYS1zcGluXCI+PC9pPnt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHAgY2xhc3M9XCJlcnJvci1tc2cgbGVmdC1hbGlnbmVkXCI+e3tjYW5jZWxfZXJyb3J9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgIHt7L319XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAge3svc2hvd19vcmRlcn19XG4gICAgICAgICAge3svb3JkZXJzfX1cbiAgICAgICAgICA8L3Rib2R5PlxuICAgICAgICAgIDx0Zm9vdD5cbiAgICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgICAgPHRkIGNvbHNwYW49XCIxMFwiPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYWdpbmF0aW9uIHBhZ2luYXRpb24tY2VudGVyZWRcIj48L2Rpdj5cbiAgICAgICAgICAgICAgPC90ZD5cbiAgICAgICAgICAgIDwvdHI+XG4gICAgICAgICAgPC90Zm9vdD5cbiAgICAgICAgPC90YWJsZT5cbiAgICAgIDwvZGl2PlxuICAgIHt7ZWxzZX19XG4gICAgICA8cCBjbGFzcz1cInRleHQtY2VudGVyXCI+Q3VycmVudGx5IG5vIG9yZGVycy48L3A+XG4gICAge3svaWZ9fVxuICA8L2Rpdj5cbmBcbiIsImV4cG9ydCBjb25zdCBJbmRleFRlbXBsYXRlID0gYFxuICA8ZGl2IGNsYXNzPVwiY29udGFpbmVyXCI+XG4gICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgPGgxIGNsYXNzPVwiaGVhZGVyXCI+T3JnYW5pemF0aW9uczwvaDE+XG4gICAgICB7eyNvcmdzOm9yZ319XG4gICAgICAgIDxkaXYgY2xhc3M9XCJib3ggY29sLXNtLTYgY29sLXhzLTEyXCIgaWQ9XCJvcmcte3sgQGluZGV4IH19XCI+XG4gICAgICAgICAgPGRpdiBjbGFzcz1cImhlYWRpbmdcIj5cbiAgICAgICAgICAgIHt7I3RpdGxlfX1cbiAgICAgICAgICAgICAgPHAgY2xhc3M9XCJoZWFkaW5nLXRpdGxlXCI+e3sgdGl0bGUgfX08L3A+XG4gICAgICAgICAgICB7ey90aXRsZX19XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgPGRpdiBjbGFzcz1cImNvbnRlbnRcIj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250ZW50LWJveCBjbGVhcmZpeFwiIGludHJvPSdmbHk6e1wieFwiOjIwLFwieVwiOlwiMFwifSc+XG4gICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJvcmctbG9nb1wiPjxpbWcgc3JjPVwie3tkZXRhaWxzWydsb2dvJ119fVwiLz48L2Rpdj5cbiAgICAgICAgICAgICAgPHAgY2xhc3M9XCJzZWN0aW9uLXRpdGxlXCI+T3JnYW5pemF0aW9uIGlkPC9wPlxuICAgICAgICAgICAgICA8cCBjbGFzcz1cInNlY3Rpb24tY29udGVudFwiPnt7aWR9fTwvcD5cbiAgICAgICAgICAgICAge3sjZGV0YWlsczprLHZ9fVxuICAgICAgICAgICAgICAgIHt7I2lmIGsgIT09ICdsb2dvJ319XG4gICAgICAgICAgICAgICAgICA8cCBjbGFzcz1cInNlY3Rpb24tdGl0bGVcIj57e2t9fTwvcD5cbiAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJzZWN0aW9uLWNvbnRlbnRcIj57e3tkZXRhaWxzW2tdfX19PC9kaXY+XG4gICAgICAgICAgICAgICAge3svaWZ9fVxuICAgICAgICAgICAgICB7ey9kZXRhaWxzfX1cbiAgICAgICAgICAgICAgPHAgY2xhc3M9XCJzZWN0aW9uLXRpdGxlXCI+Q29udGFjdCBlbWFpbDwvcD5cbiAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNlY3R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XQgbWFpbl9yYWN0aXZlID0gbmV3IFJhY3RpdmUoe1xuICAgICAgICBlbDogJyNtYWluLWNvbnRlbnQtYXJlYScsXG4gICAgICAgIHRlbXBsYXRlOiBPcmRlclRlbXBsYXRlLFxuICAgICAgICBkYXRhOiAge1xuICAgICAgICAgIHRpdGxlOiByZW1vdGVEYXRhLnRpdGxlLFxuICAgICAgICAgIG9yZGVyczogcmVtb3RlRGF0YS5vcmRlcnNcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIFNpZGVCYXJWaWV3LnJlbmRlcignb3JkZXJzJywgeydvcmdfbmFtZSc6IHJlbW90ZURhdGEub3JnX25hbWUsICdpY19pZCc6IGNvbmZpZy5pZH0pO1xuXG4gICAgICBOUHJvZ3Jlc3MuZG9uZSgpO1xuXG4gICAgICAkKCcjb3JkZXJzLXRhYmxlJykuZm9vdGFibGUoe1xuICAgICAgICBicmVha3BvaW50czoge1xuICAgICAgICAgIHBob25lOiA2MDAsXG4gICAgICAgICAgdGFibGV0OiA3NjgsXG4gICAgICAgICAgZGVza3RvcDogMTIwMCxcbiAgICAgICAgICBsYXJnZXNjcmVlbjogMTkwMFxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgJCgnI29yZGVycy10YWJsZScpLm9uKCdmb290YWJsZV9maWx0ZXJpbmcnLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICBsZXQgc2VsZWN0ZWQgPSAkKCcjZmlsdGVyLXN0YXR1cycpLmZpbmQoJzpzZWxlY3RlZCcpLnZhbCgpO1xuICAgICAgICBpZiAoc2VsZWN0ZWQgJiYgc2VsZWN0ZWQubGVuZ3RoID4gMCkge1xuICAgICAgICAgIGUuZmlsdGVyICs9IChlLmZpbHRlciAmJiBlLmZpbHRlci5sZW5ndGggPiAwKSA/ICcgJyArIHNlbGVjdGVkIDogc2VsZWN0ZWQ7XG4gICAgICAgICAgZS5jbGVhciA9ICFlLmZpbHRlcjtcbiAgICAgICAgfVxuICAgICAgfSk7X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ybWF0X2NvbHVtbnMoKSxcbiAgICAgICAgdHlwZTogJ2JhcicsXG4gICAgICAgIHR5cGVzOiB7XG4gICAgICAgICAgc2FsZXM6ICdsaW5lJ1xuICAgICAgICB9LFxuICAgICAgICBncm91cHM6IFtcbiAgICAgICAgICBiYXJfZ3JhcGhfaGVhZGVyc1xuICAgICAgICBdLFxuICAgICAgICBheGVzOiB7XG4gICAgICAgICAgc2FsZXM6ICd5MidcbiAgICAgICAgfVxuICAgICAgfSxcbiAgICAgIGJhcjoge1xuICAgICAgICB3aWR0aDoge1xuICAgICAgICAgIHJhdGlvOiAwLjUgLy8gdGhpcyBtYWtlcyBiYXIgd2lkdGggNTAlIG9mIGxlbmd0aCBiZXR3ZWVuIHRpY2tzXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBheGlzOiB7XG4gICAgICAgIHg6IHtcbiAgICAgICAgICB0eXBlOiAndGltZXNlcmllcycsXG4gICAgICAgICAgdGljazoge1xuICAgICAgICAgICAgZm9ybWF0OiAnJWQtJW0nXG4gICAgICAgICAgfSxcbiAgICAgICAgICBsYWJlbDogJ0RhdGUnXG4gICAgICAgIH0sXG4gICAgICAgIHk6IHtcbiAgICAgICAgICBsYWJlbDogJ05vLiBvZiB0aWNrZXRzJ1xuICAgICAgICB9LFxuICAgICAgICB5Mjoge1xuICAgICAgICAgIHNob3c6IHRydWUsXG4gICAgICAgICAgbGFiZWw6ICdTYWxlcydcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgdGhpcy5wYXJlbnQub24oJ2RhdGFfdXBkYXRlJywgKCkgPT4ge1xuICAgICAgdGhpcy5jaGFydC5sb2FkKHtcbiAgICAgICAgY29sdW1uczogdGhpcy5mb3JtYXRfY29sdW1ucygpXG4gICAgICB9KTtcbiAgICB9KTtcblxuICB9XG59KVxuXG5leHBvcnQgY29uc3QgSXRlbUNvbGxlY3Rpb25WaWV3ID0ge1xuICByZW5kZXI6IGZ1bmN0aW9uKGNvbmZpZ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AgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBmID0gZnVuY3Rpb24gZigpIHt9O1xuICAgICAgICAgICAgZi5wcm90b3R5cGUgPSBiYXNlLnByb3RvdHlwZTtcbiAgICAgICAgICAgIGRlcml2ZWQucHJvdG90eXBlID0gbmV3IGYoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGRlcml2ZWQucHJvdG90eXBlLmNvbnN0cnVjdG9yID0gZGVyaXZlZDtcblxuICAgICAgICByZXR1cm4gZGVyaXZlZDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBDaGFydChjb25maWcpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCA9IG5ldyBDaGFydEludGVybmFsKHRoaXMpO1xuICAgICAgICAkJC5sb2FkQ29uZmlnKGNvbmZpZyk7XG5cbiAgICAgICAgJCQuYmVmb3JlSW5pdChjb25maWcpO1xuICAgICAgICAkJC5pbml0KCk7XG4gICAgICAgICQkLmFmdGVySW5pdChjb25maWcpO1xuXG4gICAgICAgIC8vIGJpbmQgXCJ0aGlzXCIgdG8gbmVzdGVkIEFQSVxuICAgICAgICAoZnVuY3Rpb24gYmluZFRoaXMoZm4sIHRhcmdldCwgYXJnVGhpcykge1xuICAgICAgICAgICAgT2JqZWN0LmtleXMoZm4pLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgICAgIHRhcmdldFtrZXldID0gZm5ba2V5XS5iaW5kKGFyZ1RoaXMpO1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyhmbltrZXldKS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGJpbmRUaGlzKGZuW2tleV0sIHRhcmdldFtrZXldLCBhcmdUaGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSkoYzNfY2hhcnRfZm4sIHRoaXMsIHRoaXMpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9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C53aWR0aClcbiAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAkJC5oZWlnaHQpXG4gICAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAwKVxuICAgICAgICAgICAgLm9uKFwiZGJsY2xpY2suem9vbVwiLCBudWxsKTtcblxuICAgICAgICAvLyBTZXQgZGVmYXVsdCBleHRlbnQgaWYgZGVmaW5lZFxuICAgICAgICBpZiAoY29uZmlnLmF4aXNfeF9leHRlbnQpIHsgJCQuYnJ1c2guZXh0ZW50KCQkLmdldERlZmF1bHRFeHRlbnQoKSk7IH1cblxuICAgICAgICAvLyBBZGQgQXhpc1xuICAgICAgICAkJC5heGlzLmluaXQoKTtcblxuICAgICAgICAvLyBTZXQgdGFyZ2V0c1xuICAgICAgICAkJC51cGRhdGVUYXJnZXRzKCQkLmRhdGEudGFyZ2V0cyk7XG5cbiAgICAgICAgLy8gRHJhdyB3aXRoIHRhcmdldHNcbiAgICAgICAgaWYgKGJpbmRpbmcpIHtcbiAgICAgICAgICAgICQkLnVwZGF0ZURpbWVuc2lvbigpO1xuICAgICAgICAgICAgJCQuY29uZmlnLm9uaW5pdC5jYWxsKCQkKTtcbiAgICAgICAgICAgICQkLnJlZHJhdyh7XG4gICAgICAgICAgICAgICAgd2l0aFRyYW5zaXRpb246IGZhbHNlLFxuICAgICAgICAgICAgICAgIHdpdGhUcmFuc2Zvcm06IHRydWUsXG4gICAgICAgICAgICAgICAgd2l0aFVwZGF0ZVhEb21haW46IHRydWUsXG4gICAgICAgICAgICAgICAgd2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsXG4gICAgICAgICAgICAgICAgd2l0aFRyYW5zaXRpb25Gb3JBeGlzOiBmYWxzZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBCaW5kIHJlc2l6ZSBldmVudFxuICAgICAgICAkJC5iaW5kUmVzaXplKCk7XG5cbiAgICAgICAgLy8gZXhwb3J0IGVsZW1lbnQgb2YgdGhlIGNoYXJ0XG4gICAgICAgICQkLmFwaS5lbGVtZW50ID0gJCQuc2VsZWN0Q2hhcnQubm9kZSgpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5zbW9vdGhMaW5lcyA9IGZ1bmN0aW9uIChlbCwgdHlwZSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ2dyaWQnKSB7XG4gICAgICAgICAgICBlbC5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgZyA9ICQkLmQzLnNlbGVjdCh0aGlzKSxcbiAgICAgICAgICAgICAgICAgICAgeDEgPSBnLmF0dHIoJ3gxJyksXG4gICAgICAgICAgICAgICAgICAgIHgyID0gZy5hdHRyKCd4MicpLFxuICAgICAgICAgICAgICAgICAgICB5MSA9IGcuYXR0cigneTEnKSxcbiAgICAgICAgICAgICAgICAgICAgeTIgPSBnLmF0dHIoJ3kyJyk7XG4gICAgICAgICAgICAgICAgZy5hdHRyKHtcbiAgICAgICAgICAgICAgICAgICAgJ3gxJzogTWF0aC5jZWlsKHgxKSxcbiAgICAgICAgICAgICAgICAgICAgJ3gyJzogTWF0aC5jZWlsKHgyKSxcbiAgICAgICAgICAgICAgICAgICAgJ3kxJzogTWF0aC5jZWlsKHkxKSxcbiAgICAgICAgICAgICAgICAgICAgJ3kyJzogTWF0aC5jZWlsKHkyKVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9O1xuXG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVTaXplcyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICB2YXIgbGVnZW5kSGVpZ2h0ID0gJCQubGVnZW5kID8gJCQuZ2V0TGVnZW5kSGVpZ2h0KCkgOiAwLFxuICAgICAgIC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gICAgICAgIC8vIE1FTU86IG5lZWRlZCBmb3IgZ3JpZHMgY2FsY3VsYXRpb25cbiAgICAgICAgaWYgKCQkLmlzQ2F0ZWdvcml6ZWQoKSAmJiB0YXJnZXRzVG9TaG93Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgJCQueC5kb21haW4oWzAsICQkLmF4ZXMueC5zZWxlY3RBbGwoJy50aWNrJykuc2l6ZSgpXSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGFyZ2V0c1RvU2hvdy5sZW5ndGgpIHtcbiAgICAgICAgICAgICQkLnVwZGF0ZVhEb21haW4odGFyZ2V0c1RvU2hvdywgd2l0aFVwZGF0ZVhEb21haW4sIHdpdGhVcGRhdGVPcmdYRG9tYWluLCB3aXRoVHJpbVhEb21haW4pO1xuICAgICAgICAgICAgaWYgKCFjb25maWcuYXhpc194X3RpY2tfdmFsdWVzKSB7XG4gICAgICAgICAgICAgICAgdGlja1ZhbHVlcyA9ICQkLmF4aXMudXBkYXRlWEF4aXNUaWNrVmFsdWVzKHRhcmdldHNUb1Nob3cpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgJCQueEF4aXMudGlja1ZhbHVlcyhbXSk7XG4gICAgICAgICAgICAkJC5zdWJYQXhpcy50aWNrVmFsdWVzKFtdKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjb25maWcuem9vbV9yZXNjYWxlICYmICFvcHRpb25zLmZsb3cpIHtcbiAgICAgICAgICAgIHhEb21haW5Gb3Jab29tID0gJCQueC5vcmdEb21haW4oKTtcbiAgICAgICAgfVxuXG4gICAgICAgICQkLnkuZG9tYWluKCQkLmdldFlEb21haW4odGFyZ2V0c1RvU2hvdywgJ3knLCB4RG9tYWluRm9yWm9vbSkpO1xuICAgICAgICAkJC55Mi5kb21haW4oJCQuZ2V0WURvbWFpbih0YXJnZXRzVG9TaG93LCAneTInLCB4RG9tYWluRm9yWm9vbSkpO1xuXG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pbmdfbWF4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnZhbEZvckN1bGxpbmcgPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5heGlzWCArICcgLnRpY2sgdGV4dCcpLmVhY2goZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gdGlja1ZhbHVlcy5pbmRleE9mKGUpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnN0eWxlKCdkaXNwbGF5JywgaW5kZXggJSBpbnRlcnZhbEZvckN1bGxpbmcgPyAnbm9uZScgOiAnYmxvY2snKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0QWxsKCcuJyArIENMQVNTLmF4aXNYICsgJyAudGljayB0ZXh0Jykuc3R5bGUoJ2Rpc3BsYXknLCAnYmxvY2snKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHNldHVwIGRyYXdlciAtIE1FTU86IHRoZXNlIG11c3QgYmUgY2FsbGVkIGFmdGVyIGF4aXMgdXBkYXRlZFxuICAgICAgICBkcmF3QXJlYSA9ICQkLmdlbmVyYXRlRHJhd0FyZWEgPyAkJC5nZW5lcmF0ZURyYXdBcmVhKGFyZWFJbmRpY2VzLCBmYWxzZSkgOiB1bmRlZmluZWQ7XG4gICAgICAgIGRyYXdCYXIgPSAkJC5nZW5lcmF0ZURyYXdCYXIgPyAkJC5nZW5lcmF0ZURyYXdCYXIoYmFySW5kaWNl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ldHM6IHRhcmdldHNUb1Nob3csXG4gICAgICAgICAgICAgICAgZmxvdzogb3B0aW9ucy5mbG93LFxuICAgICAgICAgICAgICAgIGR1cmF0aW9uOiBvcHRpb25zLmZsb3cuZHVyYXRpb24sXG4gICAgICAgICAgICAgICAgZHJhd0JhcjogZHJhd0JhcixcbiAgICAgICAgICAgICAgICBkcmF3TGluZTogZHJhd0xpbmUsXG4gICAgICAgICAgICAgICAgZHJhd0FyZWE6IGRyYXdBcmVhLFxuICAgICAgICAgICAgICAgIGN4OiBjeCxcbiAgICAgICAgICAgICAgICBjeTogY3ksXG4gICAgICAgICAgICAgICAgeHY6IHh2LFxuICAgICAgICAgICAgICAgIHhGb3JUZXh0OiB4Rm9yVGV4dCxcbiAgICAgICAgICAgICAgICB5Rm9yVGV4dDogeUZvclRleHRcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKChkdXJhdGlvbiB8fCBmbG93KSAmJiAkJC5pc1RhYlZpc2libGUoKSkgeyAvLyBPbmx5IHVzZSB0cmFuc2l0aW9uIGlmIHRhYiB2aXNpYmxlLiBTZWUgIzkzOC5cbiAgICAgICAgICAgIC8vIHRyYW5zaXRpb24gc2hvdWxkIGJlIGRlcml2ZWQgZnJvbSBvbmUgdHJhbnNpdGlvblxuICAgICAgICAgICAgZDMudHJhbnNpdGlvbigpLmR1cmF0aW9uKGR1cmF0aW9uKS5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgdHJhbnNpdGlvbnNUb1dhaXQgPSBbXTtcblxuICAgICAgICAgICAgICAgIC8vIHJlZHJhdyBhbmQgZ2F0aGVyIHRyYW5zaXRpb25zXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdCYXIoZHJhd0JhciwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0xpbmUoZHJhd0xpbmUsIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdBcmVhKGRyYXdBcmVhLCB0cnVlKSxcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3Q2lyY2xlKGN4LCBjeSwgdHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd1RleHQoeEZvclRleHQsIHlGb3JUZXh0LCBvcHRpb25zLmZsb3csIHRydWUpLFxuICAgICAgICAgICAgICAgICAgICAkJC5yZWRyYXdSZWdpb24odHJ1ZSksXG4gICAgICAgICAgICAgICAgICAgICQkLnJlZHJhd0dyaWQodHJ1ZSksXG4gICAgICAgICAgICAgICAgXS5mb3JFYWNoKGZ1bmN0aW9uICh0cmFuc2l0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9ucy5mb3JFYWNoKGZ1bmN0aW9uICh0cmFuc2l0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uc1RvV2FpdC5wdXNoKHRyYW5zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIC8vIFdhaXQgZm9yIGVuZCBvZiB0cmFuc2l0aW9ucyB0byBjYWxsIGZsb3cgYW5kIG9ucmVuZGVyZWQgY2FsbGJhY2tcbiAgICAgICAgICAgICAgICB3YWl0Rm9yRHJhdyA9ICQkLmdlbmVyYXRlV2FpdCgpO1xuICAgICAgICAgICAgICAgIHRyYW5zaXRpb25zVG9XYWl0LmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgd2FpdEZvckRyYXcuYWRkKHQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5jYWxsKHdhaXRGb3JEcmF3LCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKGZsb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgZmxvdygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLm9ucmVuZGVyZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLm9ucmVuZGVyZWQuY2FsbCgkJCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAkJC5yZWRyYXdCYXIoZHJhd0Jhcik7XG4gICAgICAgICAgICAkJC5yZWRyYXdMaW5lKGRyYXdMaW5lKTtcbiAgICAgICAgICAgICQkLnJlZHJhd0FyZWEoZHJhd0FyZWEpO1xuICAgICAgICAgICAgJCQucmVkcmF3Q2lyY2xlKGN4LCBjeSk7XG4gICAgICAgICAgICAkJC5yZWRyYXdUZXh0KHhGb3JUZXh0LCB5Rm9yVGV4dCwgb3B0aW9ucy5mbG93KTtcbiAgICAgICAgICAgICQkLnJlZHJhd1JlZ2lvbigpO1xuICAgICAgICAgICAgJCQucmVkcmF3R3JpZCgpO1xuICAgICAgICAgICAgaWYgKGNvbmZpZy5vbnJlbmRlcmVkKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLm9ucmVuZGVyZWQuY2FsbCgkJCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyB1cGRhdGUgZmFkZWluIGNvbmRpdGlvblxuICAgICAgICAkJC5tYXBUb0lkcygkJC5kYXRhLnRhcmdldHMpLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAkJC53aXRob3V0RmFkZUluW2lkXSA9IHRydWU7XG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVBbmRSZWRyYXcgPSBmdW5jdGlvbiAob3B0aW9ucykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsIHRyYW5zaXRpb25zO1xuICAgICAgICBvcHRpb25zID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AgIGlmICgkJC5icnVzaCkgeyAkJC5icnVzaC51cGRhdGUoKTsgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5vbmluaXQuY2FsbCgkJCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFRyYW5zZm9ybTogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFVwZGF0ZVhEb21haW46IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoVHJhbnNpdGlvbjogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhUcmFuc2l0aW9uRm9yVHJhbnNmb3JtOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aExlZ2VuZDogdHJ1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGlvbi50cmFuc2l0aW9uKCkuc3R5bGUoJ29wYWNpdHknLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSwgMTApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICAgICAgb2JzZXJ2ZXIub2JzZXJ2ZShzZWxlY3Rpb24ubm9kZSgpLCB7YXR0cmlidXRlczogdHJ1ZSwgY2hpbGRMaXN0OiB0cnVlLCBjaGFyYWN0ZXJEYXRhOiB0cnVlfSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmJpbmRSZXNpemUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcblxuICAgICAgICAkJC5yZXNpemVGdW5jdGlvbiA9ICQkLmdlbmVyYXRlUmVzaXplKCk7XG5cbiAgICAgICAgJCQucmVzaXplRnVuY3Rpb24uYWRkKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNvbmZpZy5vbnJlc2l6ZS5jYWxsKCQkKTtcbiAgICAgICAgfSk7XG4gICAgICAgIGlmIChjb25maWcucmVzaXplX2F1dG8pIHtcbiAgICAgICAgICAgICQkLnJlc2l6ZUZ1bmN0aW9uLmFkZChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCQkLnJlc2l6ZVRpbWVvdXQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2xlYXJUaW1lb3V0KCQkLnJlc2l6ZVRpbWVvdXQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAkJC5yZXNpemVUaW1lb3V0ID0gd2luZG93LnNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgJCQucmVzaXplVGltZW91dDtcbiAgICAgICAgICAgICAgICAgICAgJCQuYXBpLmZsdXNoKCk7XG4gICAgICAgICAgICAgICAgfSwgMTAwKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgICQkLnJlc2l6ZUZ1bmN0aW9uLmFkZChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBjb25maWcub25yZXNpemVkLmNhbGwoJCQpO1xuICAgICAgICB9KTtcblxuICAgICAgICBpZiAod2luZG93LmF0dGFjaEV2ZW50KSB7XG4gICAgICAgICAgICB3aW5kb3cuYXR0YWNoRXZlbnQoJ29ucmVzaXplJywgJCQucmVzaXplRnVuY3Rpb24pO1xuICAgICAgICB9IGVsc2UgaWYgKHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKSB7XG4gICA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GZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHJlc2l6ZUZ1bmN0aW9ucyA9IFtdO1xuICAgICAgICBmdW5jdGlvbiBjYWxsUmVzaXplRnVuY3Rpb25zKCkge1xuICAgICAgICAgICAgcmVzaXplRnVuY3Rpb25zLmZvckVhY2goZnVuY3Rpb24gKGYpIHtcbiAgICAgICAgICAgICAgICBmKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBjYWxsUmVzaXplRnVuY3Rpb25zLmFkZCA9IGZ1bmN0aW9uIChmKSB7XG4gICAgICAgICAgICByZXNpemVGdW5jdGlvbnMucHVzaChmKTtcbiAgICAgICAgfTtcbiAgICAgICAgY2FsbFJlc2l6ZUZ1bmN0aW9ucy5yZW1vdmUgPSBmdW5jdGlvbiAoZikge1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCByZXNpemVGdW5jdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzaXplRnVuY3Rpb25zW2ldID09PSBmKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc2l6ZUZ1bmN0aW9ucy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGNhbGxSZXNpemVGdW5jdGlvbnM7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmVuZGFsbCA9IGZ1bmN0aW9uICh0cmFuc2l0aW9uLCBjYWxsYmFjaykge1xuICAgICAgICB2YXIgbiA9IDA7XG4gICAgICAgIHRyYW5zaXRpb25cbiAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uICgpIHsgKytuOyB9KVxuICAgICAgICAgICAgLmVhY2goXCJlbmRcIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGlmICghLS1uKSB7IGNhbGxiYWNrLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7IH1cbiAgICAgICAgICAgIH0pO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2VuZXJhdGVXYWl0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgdHJhbnNpdGlvbnNUb1dhaXQgPSBbXSxcbiAgICAgICAgICAgIGYgPSBmdW5jdGlvbiAodHJhbnNpdGlvbiwgY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICB2YXIgdGltZXIgPSBzZXRJbnRlcnZhbChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkb25lID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbnNUb1dhaXQuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHQuZW1wdHkoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQudHJhbnNpdGlvbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChkb25lID09PSB0cmFuc2l0aW9uc1RvV2FpdC5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNhbGxiYWNrKSB7IGNhbGxiYWNrKCk7IH1cbiAgICAgICAg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Q6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHBhZGRpbmdfdG9wOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwYWRkaW5nX2JvdHRvbTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcmVzaXplX2F1dG86IHRydWUsXG4gICAgICAgICAgICB6b29tX2VuYWJsZWQ6IGZhbHNlLFxuICAgICAgICAgICAgem9vbV9leHRlbnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIHpvb21fcHJpdmlsZWdlZDogZmFsc2UsXG4gICAgICAgICAgICB6b29tX3Jlc2NhbGU6IGZhbHNlLFxuICAgICAgICAgICAgem9vbV9vbnpvb206IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgem9vbV9vbnpvb21zdGFydDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB6b29tX29uem9vbWVuZDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB6b29tX3hfbWluOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB6b29tX3hfbWF4OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBpbnRlcmFjdGlvbl9icmlnaHRlbjogdHJ1ZSxcbiAgICAgICAgICAgIGludGVyYWN0aW9uX2VuYWJsZWQ6IHRydWUsXG4gICAgICAgICAgICBvbm1vdXNlb3ZlcjogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbm1vdXNlb3V0OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9ucmVzaXplOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIG9ucmVzaXplZDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICBvbmluaXQ6IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgb25yZW5kZXJlZDogZnVuY3Rpb24gKCkge30sXG4gICAgICAgICAgICB0cmFuc2l0aW9uX2R1cmF0aW9uOiAzNTAsXG4gICAgICAgICAgICBkYXRhX3g6IHVuZGVmaW5lZ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gICAgICAgICAgY29sb3JfdGhyZXNob2xkOiB7fSxcbiAgICAgICAgICAgIC8vIGxlZ2VuZFxuICAgICAgICAgICAgbGVnZW5kX3Nob3c6IHRydWUsXG4gICAgICAgICAgICBsZWdlbmRfaGlkZTogZmFsc2UsXG4gICAgICAgICAgICBsZWdlbmRfcG9zaXRpb246ICdib3R0b20nLFxuICAgICAgICAgICAgbGVnZW5kX2luc2V0X2FuY2hvcjogJ3RvcC1sZWZ0JyxcbiAgICAgICAgICAgIGxlZ2VuZF9pbnNldF94OiAxMCxcbiAgICAgICAgICAgIGxlZ2VuZF9pbnNldF95OiAwLFxuICAgICAgICAgICAgbGVnZW5kX2luc2V0X3N0ZXA6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGxlZ2VuZF9pdGVtX29uY2xpY2s6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGxlZ2VuZF9pdGVtX29ubW91c2VvdmVyOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBsZWdlbmRfaXRlbV9vbm1vdXNlb3V0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBsZWdlbmRfZXF1YWxseTogZmFsc2UsXG4gICAgICAgICAgICBsZWdlbmRfcGFkZGluZzogMCxcbiAgICAgICAgICAgIGxlZ2VuZF9pdGVtX3RpbGVfd2lkdGg6IDEwLFxuICAgICAgICAgICAgbGVnZW5kX2l0ZW1fdGlsZV9oZWlnaHQ6IDEwLFxuICAgICAgICAgICAgLy8gYXhpc1xuICAgICAgICAgICAgYXhpc19yb3RhdGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGF4aXNfeF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgYXhpc194X3R5cGU6ICdpbmRleGVkJyxcbiAgICAgICAgICAgIGF4aXNfeF9sb2NhbHRpbWU6IHRydWUsXG4gICAgICAgICAgICBheGlzX3hfY2F0ZWdvcmllczogW10sXG4gICAgICAgICAgICBheGlzX3hfdGlja19jZW50ZXJlZDogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3hfdGlja19mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2N1bGxpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc194X3RpY2tfY3VsbGluZ19tYXg6IDEwLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfY291bnQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX2ZpdDogdHJ1ZSxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX3ZhbHVlczogbnVsbCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX3JvdGF0ZTogMCxcbiAgICAgICAgICAgIGF4aXNfeF90aWNrX291dGVyOiB0cnVlLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfbXVsdGlsaW5lOiB0cnVlLFxuICAgICAgICAgICAgYXhpc194X3RpY2tfd2lkdGg6IG51bGwsXG4gICAgICAgICAgICBheGlzX3hfbWF4OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfbWluOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfcGFkZGluZzoge30sXG4gICAgICAgICAgICBheGlzX3hfaGVpZ2h0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfZXh0ZW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3hfbGFiZWw6IHt9LFxuICAgICAgICAgICAgYXhpc195X3Nob3c6IHRydWUsXG4gICAgICAgICAgICBheGlzX3lfdHlwZTogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X2ludmVydGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGF4aXNfeV9jZW50ZXI6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGF4aXNfeV9pbm5lcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X2xhYmVsOiB7fSxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195X3RpY2tfb3V0ZXI6IHRydWUsXG4gICAgICAgICAgICBheGlzX3lfdGlja192YWx1ZXM6IG51bGwsICAgICAgICBcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX3JvdGF0ZTogMCxcbiAgICAgICAgICAgIGF4aXNfeV90aWNrX2NvdW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfdGlja190aW1lX3ZhbHVlOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfdGlja190aW1lX2ludGVydmFsOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3lfcGFkZGluZzoge30sXG4gICAgICAgICAgICBheGlzX3lfZGVmYXVsdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9zaG93OiBmYWxzZSxcbiAgICAgICAgICAgIGF4aXNfeTJfbWF4OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX21pbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9pbnZlcnRlZDogZmFsc2UsXG4gICAgICAgICAgICBheGlzX3kyX2NlbnRlcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9pbm5lcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYXhpc195Ml9sYWJlbDoge30sXG4gICAgICAgICAgICBheGlzX3kyX3RpY2tfZm9ybWF0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX3RpY2tfb3V0ZXI6IHRydWUsXG4gICAgICAgICAgICBheGlzX3kyX3RpY2tfdmFsdWVzOiBudWxsLFxuICAgICAgICAgICAgYXhpc195Ml90aWNrX2NvdW50OiB1bmRlZmluZWQsXG4gICAgICAgICAgICBheGlzX3kyX3BhZGRpbmc6IHt9LFxuICAgICAgICAgICAgYXhpc195Ml9kZWZhdWx0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyBncmlkXG4gICAgICAgICAgICBncmlkX3hfc2hvdzogZmFsc2UsXG4gICAgICAgICAgICBncmlkX3hfdHlwZTogJ3RpY2snLFxuICAgICAgICAgICAgZ3JpZF94X2xpbmVzOiBbXSxcbiAgICAgICAgICAgIGdyaWRfeV9zaG93OiBmYWxzZSxcbiAgICAgICAgICAgIC8vIG5vdCB1c2VkXG4gICAgICAgICAgICAvLyBncmlkX3lfdHlwZTogJ3RpY2snLFxuICAgICAgICAgICAgZ3JpZF95X2xpbmVzOiBbXSxcbiAgICAgICAgICAgIGdyaWRfeV90aWNrczogMTAsXG4gICAgICAgICAgICBncmlkX2ZvY3VzX3Nob3c6IHRydWUsXG4gICAgICAgICAgICBncmlkX2xpbmVzX2Zyb250OiB0cnVlLFxuICAgICAgICAgICAgLy8gcG9pbnQgLSBwb2ludCBvZiBlYWNoIGRhdGFcbiAgICAgICAgICAgIHBvaW50X3Nob3c6IHRydWUsXG4gICAgICAgICAgICBwb2ludF9yOiAyLjUsXG4gICAgICAgICAgICBwb2ludF9zZW5zaXRpdml0eTogMTAsXG4gICAgICAgICAgICBwb2ludF9mb2N1c19leHBhbmRfZW5hYmxlZDogdHJ1ZSxcbiAgICAgICAgICAgIHBvaW50X2ZvY3VzX2V4cGFuZF9yOiB1bmRlZmluZWQsXG4gICAgICAgICAgICBwb2ludF9zZWxlY3RfcjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gbGluZVxuICAgICAgICAgICAgbGluZV9jb25uZWN0TnVsbDogZmFsc2UsXG4gICAgICAgICAgICBsaW5lX3N0ZXBfdHlwZTogJ3N0ZXAnLFxuICAgICAgICAgICAgLy8gYmFyXG4gICAgICAgICAgICBiYXJfd2lkdGg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGJhcl93aWR0aF9yYXRpbzogMC42LFxuICAgICAgICAgICAgYmFyX3dpZHRoX21heDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgYmFyX3plcm9iYXNlZDogdHJ1ZSxcbiAgICAgICAgICAgIC8vIGFyZWFcbiAgICAgICAgICAgIGFyZWFfemVyb2Jhc2VkOiB0cnVlLFxuICAgICAgICAgICAgYXJlYV9hYm92ZTogZmFsc2UsXG4gICAgICAgICAgICAvLyBwaWVcbiAgICAgICAgICAgIHBpZV9sYWJlbF9zaG93OiB0cnVlLFxuICAgICAgICAgICAgcGllX2xhYmVsX2Zvcm1hdDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGllX2xhYmVsX3RocmVzaG9sZDogMC4wNSxcbiAgICAgICAgICAgIHBpZV9sYWJlbF9yYXRpbzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgcGllX2V4cGFuZDoge30sXG4gICAgICAgICAgICBwaWVfZXhwYW5kX2R1cmF0aW9uOiA1MCxcbiAgICAgICAgICAgIC8vIGdhdWdlXG4gICAgICAgICAgICBnYXVnZV9mdWxsQ2lyY2xlOiBmYWxzZSxcbiAgICAgICAgICAgIGdhdWdlX2xhYmVsX3Nob3c6IHRydWUsXG4gICAgICAgICAgICBnYXVnZV9sYWJlbF9mb3JtYXQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGdhdWdlX21pbjogMCxcbiAgICAgICAgICAgIGdhdWdlX21heDogMTAwLFxuICAgICAgICAgICAgZ2F1Z2Vfc3RhcnRpbmdBbmdsZTogLTEgKiBNYXRoLlBJLzIsXG4gICAgICAgICAgICBnYXVnZV91bml0czogdW5kZWZpbmVkLFxuICAgICAgICAgICAgZ2F1Z2Vfd2lkdGg6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIGdhdWdlX2V4cGFuZDoge30sXG4gICAgICAgICAgICBnYXVnZV9leHBhbmRfZHVyYXRpb246IDUwLFxuICAgICAgICAgICAgLy8gZG9udXRcbiAgICAgICAgICAgIGRvbnV0X2xhYmVsX3Nob3c6IHRydWUsXG4gICAgICAgICAgICBkb251dF9sYWJlbF9mb3JtYXQ6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2V0VG9vbHRpcENvbnRlbnQoZCwgZGVmYXVsdFRpdGxlRm9ybWF0LCBkZWZhdWx0VmFsdWVGb3JtYXQsIGNvbG9yKSA6ICcnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHRvb2x0aXBfaW5pdF9zaG93OiBmYWxzZSxcbiAgICAgICAgICAgIHRvb2x0aXBfaW5pdF94OiAwLFxuICAgICAgICAgICAgdG9vbHRpcF9pbml0X3Bvc2l0aW9uOiB7dG9wOiAnMHB4JywgbGVmdDogJzUwcHgnfSxcbiAgICAgICAgICAgIHRvb2x0aXBfb25zaG93OiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIHRvb2x0aXBfb25oaWRlOiBmdW5jdGlvbiAoKSB7fSxcbiAgICAgICAgICAgIC8vIHRpdGxlXG4gICAgICAgICAgICB0aXRsZV90ZXh0OiB1bmRlZmluZWQsXG4gICAgICAgICAgICB0aXRsZV9wYWRkaW5nOiB7XG4gICAgICAgICAgICAgICAgdG9wOiAwLFxuICAgICAgICAgICAgICAgIHJpZ2h0OiAwLFxuICAgICAgICAgICAgICAgIGJvdHRvbTogMCxcbiAgICAgICAgICAgICAgICBsZWZ0OiAwXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdGl0bGVfcG9zaXRpb246ICd0b3AtY2VudGVyJyxcbiAgICAgICAgfTtcblxuICAgICAgICBPYmplY3Qua2V5cyh0aGlzLmFkZGl0aW9uYWxDb25maWcpLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgY29uZmlnW2tleV0gPSB0aGlzLmFkZGl0aW9uYWxDb25maWdba2V5XTtcbiAgICAgICAgfSwgdGhpcyk7XG5cbiAgICAgICAgcmV0dXJuIGNvbmZpZztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmFkZGl0aW9uYWxDb25maWcgPSB7fTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmxvYWRDb25maWcgPSBmdW5jdGlvbiAoY29uZmlnKSB7XG4gICAgICAgIHZhciB0aGlzX2NvbmZpZyA9IHRoaXMuY29uZmlnLCB0YXJnZXQsIGtleXMsIHJlYWQ7XG4gICAgICAgIGZ1bmN0aW9uIGZpbmQoKSB7XG4gICAgICAgICAgICB2YXIga2V5ID0ga2V5cy5zaGlmdCgpO1xuICAgIC8vICAgICAgICBjb25zb2xlLmxvZyhcImtleSA9PlwiLCBrZXksIFwiLCB0YXJnZXQgPT5cIiwgdGFyZ2V0KTtcbiAgICAgICAgICAgIGlmIChrZXkgJiYgdGFyZ2V0ICYmIHR5cGVvZiB0YXJnZXQgPT09ICdvYmplY3QnICYmIGtleSBpbiB0YXJnZXQpIHtcbiAgICAgICAgICAgICAgICB0YXJnZXQgPSB0YXJnZXRba2V5XTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmluZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoIWtleSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0YXJnZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIE9iamVjdC5rZXlzKHRoaXNfY29uZmlnKS5mb3JFYWNoKGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgIHRhcmdldCA9IGNvbmZpZztcbiAgICAgICAgICAgIGtleXMgPSBrZXkuc3BsaXQoJ18nKTtcbiAgICAgICAgICAgIHJlYWQgPSBmaW5kKCk7XG4gICAgLy8gICAgICAgIGNvbnNvbGUubG9nKFwiQ09ORklHIDogXCIsIGtleSwgcmVhZCk7XG4gICAgICAgICAgICBpZiAoaXNEZWZpbmVkKHJlYWQpKSB7XG4gICAgICAgICAgICAgICAgdGhpc19jb25maWdba2V5XSA9IHJlYWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICA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ogTWF0aC5jZWlsKHYpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICAvLyBkZWZpbmUgZnVuY3Rpb25zXG4gICAgICAgIGZvciAoa2V5IGluIF9zY2FsZSkge1xuICAgICAgICAgICAgc2NhbGVba2V5XSA9IF9zY2FsZVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIHNjYWxlLm9yZ0RvbWFpbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiBfc2NhbGUuZG9tYWluKCk7XG4gICAgICAgIH07XG4gICAgICAgIC8vIGRlZmluZSBjdXN0b20gZG9tYWluKCkgZm9yIGNhdGVnb3JpemVkIGF4aXNcbiAgICAgICAgaWYgKCQkLmlzQ2F0ZWdvcml6ZWQoKSkge1xuICAgICAgICAgICAgc2NhbGUuZG9tYWluID0gZnVuY3Rpb24gKGRvbWFpbikge1xuICAgICAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBkb21haW4gPSB0aGlzLm9yZ0RvbWFpbigpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gW2RvbWFpblswXSwgZG9tYWluWzFdICsgMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF9zY2FsZS5kb21haW4oZG9tYWluKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gc2NhbGU7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzY2FsZTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFkgPSBmdW5jdGlvbiAobWluLCBtYXgsIGRvbWFpbikge1xuICAgICAgICB2YXIgc2NhbGUgPSB0aGlzLmdldFNjYWxlKG1pbiwgbWF4LCB0aGlzLmlzVGltZVNlcmllc1koKSk7XG4gICAgICAgIGlmIChkb21haW4pIHsgc2NhbGUuZG9tYWluKGRvbWFpbik7IH1cbiAgICAgICAgcmV0dXJ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YgKGhhc05lZ2F0aXZlVmFsdWUgJiYgeXNbYmFzZUlkXSkge1xuICAgICAgICAgICAgICAgICAgICB5c1tiYXNlSWRdLmZvckVhY2goZnVuY3Rpb24gKHYsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF1baV0gPSB2IDwgMCA/IHYgOiAwO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gQ29tcHV0ZSBtaW5cbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDwgaWRzSW5Hcm91cC5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IGlkc0luR3JvdXBba107XG4gICAgICAgICAgICAgICAgICAgIGlmICghIHlzW2lkXSkgeyBjb250aW51ZTsgfVxuICAgICAgICAgICAgICAgICAgICB5c1tpZF0uZm9yRWFjaChmdW5jdGlvbiAodiwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmF4aXMuZ2V0SWQoaWQpID09PSAkJC5heGlzLmdldElkKGJhc2VJZCkgJiYgeXNbYmFzZUlkXSAmJiAhKGhhc05lZ2F0aXZlVmFsdWUgJiYgK3YgPiAwKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlzW2Jhc2VJZF1baV0gKz0gK3Y7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gJCQuZDMubWluKE9iamVjdC5rZXlzKHlzKS5tYXAoZnVuY3Rpb24gKGtleSkgeyByZXR1cm4gJCQuZDMubWluKHlzW2tleV0pOyB9KSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRZRG9tYWluTWF4ID0gZnVuY3Rpb24gKHRhcmdldHMpIHtcbiAg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gIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG1heFxuICAgICAgICAgICAgICAgIGZvciAoayA9IDE7IGsgPCBpZHNJbkdyb3VwLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlkID0gaWRzSW5Hcm91cFtrXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEgeXNbaWRdKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICAgICAgICAgIHlzW2lkXS5mb3JFYWNoKGZ1bmN0aW9uICh2LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJCQuYXhpcy5nZXRJZChpZCkgPT09ICQkLmF4aXMuZ2V0SWQoYmFzZUlkKSAmJiB5c1tiYXNlSWRdICYmICEoaGFzUG9zaXRpdmVWYWx1ZSAmJiArdiA8IDApKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeXNbYmFzZUlkXVtpXSArPSArdjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiAkJC5kMy5tYXgoT2JqZWN0LmtleXMoeXMpLm1hcChmdW5jdGlvbiAoa2V5KSB7IHJldHVybiAkJC5kMy5tYXgoeXNba2V5XSk7IH0pKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFlEb21haW4gPSBmdW5jdGlvbiAodGFyZ2V0cywgYXhpc0lkLCB4RG9tYWluKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIHRhcmdldHNCeUF4aXNJZCA9IHRhcmdldHMuZmlsdGVyKGZ1bmN0aW9uICh0KSB7IHJldHVybiAkJC5heGlzLmdldElkKHQuaWQpID09PSBheGlzSWQ7IH0pL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heCA9IHlEb21haW5NaW47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHlEb21haW5NaW4gPT09IHlEb21haW5NYXgpIHtcbiAgICAgICAgICAgIHlEb21haW5NaW4gPCAwID8geURvbWFpbk1heCA9IDAgOiB5RG9tYWluTWluID0gMDtcbiAgICAgICAgfVxuICAgICAgICBpc0FsbFBvc2l0aXZlID0geURvbWFpbk1pbiA+PSAwICYmIHlEb21haW5NYXggPj0gMDtcbiAgICAgICAgaXNBbGxOZWdhdGl2ZSA9IHlEb21haW5NaW4gPD0gMCAmJiB5RG9tYWluTWF4IDw9IDA7XG5cbiAgICAgICAgLy8gQ2FuY2VsIHplcm9iYXNlZCBpZiBheGlzXypfbWluIC8gYXhpc18qX21heCBzcGVjaWZpZWRcbiAgICAgICAgaWYgKChpc1ZhbHVlKHlNaW4pICYmIGlzQWxsUG9zaXRpdmUpIHx8IChpc1ZhbHVlKHlNYXgpICYmIGlzQWxsTmVnYXRpdmUpKSB7XG4gICAgICAgICAgICBpc1plcm9CYXNlZCA9IGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQmFyL0FyZWEgY2hhcnQgc2hvdWxkIGJlIDAtYmFzZWQgaWYgYWxsIHBvc2l0aXZlfG5lZ2F0aXZlXG4gICAgICAgIGlmIChpc1plcm9CYXNlZCkge1xuICAgICAgICAgICAgaWYgKGlzQWxsUG9zaXRpdmUpIHsgeURvbWFpbk1pbiA9IDA7IH1cbiAgICAgICAgICAgIGlmIChpc0FsbE5lZ2F0aXZlKSB7IHlEb21haW5NYXggPSAwOyB9XG4gICAgICAgIH1cblxuICAgICAgICBkb21haW5MZW5ndGggPSBNYXRoLmFicyh5RG9tYWluTWF4IC0geURvbWFpbk1pbik7XG4gICAgICAgIHBhZGRpbmcgPSBwYWRkaW5nX3RvcCA9IHBhZGRpbmdfYm90dG9tID0gZG9tYWluTGVuZ3RoICogMC4xO1xuXG4gICAgICAgIGlmICh0eXBlb2YgY2VudGVyICE9PSAndW5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eyBwYWRkaW5nX2JvdHRvbSA9IHlEb21haW5NaW47IH1cbiAgICAgICAgICAgIGlmIChpc0FsbE5lZ2F0aXZlKSB7IHBhZGRpbmdfdG9wID0gLXlEb21haW5NYXg7IH1cbiAgICAgICAgfVxuICAgICAgICBkb21haW4gPSBbeURvbWFpbk1pbiAtIHBhZGRpbmdfYm90dG9tLCB5RG9tYWluTWF4ICsgcGFkZGluZ190b3BdO1xuICAgICAgICByZXR1cm4gaXNJbnZlcnRlZCA/IGRvbWFpbi5yZXZlcnNlKCkgOiBkb21haW47XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRYRG9tYWluTWluID0gZnVuY3Rpb24gKHRhcmdldHMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICByZXR1cm4gaXNEZWZpbmVkKGNvbmZpZy5heGlzX3hfbWluKSA/XG4gICAgICAgICAgICAoJCQuaXNUaW1lU2VyaWVzKCkgPyB0aGlzLnBhcnNlRGF0ZShjb25maWcuYXhpc194X21pbikgOiBjb25maWcuYXhpc194X21pbikgOlxuICAgICAgICAkJC5kMy5taW4odGFyZ2V0cywgZnVuY3Rpb24gKHQpIHsgcmV0dXJuICQkLmQzLm1pbih0LnZhbHVlcywgZnVuY3Rpb24gKHYpIHsgcmV0dXJuIHYueDsgfSk7IH0pO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WERvbWFpbk1heCA9IGZ1bmN0aW9uICh0YXJnZXRzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgcmV0dXJuIGlzRGVmaW5lZChjb25maWcuYXhpc194X21heCkgP1xuICAgICAgICAgICAgKCQkLmlzVGltZVNlcmllcygpID8gdGhpcy5wYXJzZURhdGUoY29uZmlnLmF4aXNfeF9tYXgpIDogY29uZmlnLmF4aXNfeF9tYXgp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ICAgICAgICQkLnguZG9tYWluKGRvbWFpbiA/IGRvbWFpbiA6ICQkLmQzLmV4dGVudCgkJC5nZXRYRG9tYWluKHRhcmdldHMpKSk7XG4gICAgICAgICAgICAkJC5vcmdYRG9tYWluID0gJCQueC5kb21haW4oKTtcbiAgICAgICAgICAgIGlmIChjb25maWcuem9vbV9lbmFibGVkKSB7ICQkLnpvb20uc2NhbGUoJCQueCkudXBkYXRlU2NhbGVFeHRlbnQoKTsgfVxuICAgICAgICAgICAgJCQuc3ViWC5kb21haW4oJCQueC5kb21haW4oKSk7XG4gICAgICAgICAgICBpZiAoJCQuYnJ1c2gpIHsgJCQuYnJ1c2guc2NhbGUoJCQuc3ViWCk7IH1cbiAgICAgICAgfVxuICAgICAgICBpZiAod2l0aFVwZGF0ZVhEb21haW4pIHtcbiAgICAgICAgICAgICQkLnguZG9tYWluKGRvbWFpbiA/IGRvbWFpbiA6ICghJCQuYnJ1c2ggfHwgJCQuYnJ1c2guZW1wdHkoKSkgPyAkJC5vcmdYRG9tYWluIDogJCQuYnJ1c2guZXh0ZW50KCkpO1xuICAgICAgICAgICAgaWYgKGNvbmZpZy56b29tX2VuYWJsZWQpIHsgJCQuem9vbS5zY2FsZSgkJC54KS51cGRhdGVTY2FsZUV4dGVudCgpOyB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBUcmltIGRvbWFpbiB3aGVuIHRvbyBiaWcgYnkgem9vbSBtb3VzZW1vdmUgZXZlbnRcbiAgICAgICAgaWYgKHdpdGhUcmltKSB7ICQkLnguZG9tYWluKCQkLnRyaW1YRG9tYWluKCQkLngub3JnRG9tYWluKCkpKTsgfVxuXG4gICAgICAgIHJldHVybiAkJC54LmRvbWFpbigpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udHJpbVhEb21haW4gPSBmdW5jdGlvbiAoZG9tYWluKSB7XG4gICAgICAgIHZhciB6b29tRG9tYWluID0gdGhpcy5nZXRab29tRG9tYWluKCksXG4gICAgICAgICAgICBtaW4gPSB6b29tRG9tYWluWzBdLCBtYXggPSB6b29tRG9tYWluWzFdO1xuICAgICAgICBpZiAoZG9tYWluWzBdIDw9IG1pbikge1xuICAgICAgICAgICAgZG9tYWluWzFdID0gK2RvbWFpblsxXSArIChtaW4gLSBkb21haW5bMF0pO1xuICAgICAgICAgICAgZG9tYWluWzBdID0gbWluO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXggPD0gZG9tYWluWzFdKSB7XG4gICAgICAgICAgICBkb21haW5bMF0gPSArZG9tYWluWzBdIC0gKGRvbWFpblsxXSAtIG1heCk7XG4gICAgICAgICAgICBkb21haW5bMV0gPSBtYXg7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGRvbWFpbjtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaXNYID0gZnVuY3Rpb24gKGtleSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIHJldHVybiAoY29uZmlnLmRhdGFfeCAmJiBrZXkgPT09IGNvbmZpZy5kYXRhX3gpIHx8IChub3RFbXB0eShjb25maWcuZGF0YV94cykgJiYgaGFzVmFsdWUoY29uZmlnLmRhdGFfeHMsIGtleSkpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaXNOb3RYID0gZnVuY3Rpb24gKGtleSkge1xuICAgICAgICByZXR1cm4gIXRoaXMuaXNYKGtleSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRYS2V5ID0gZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgcmV0dXJuIGNvbmZpZy5kYXRhX3ggPyBjb25maWcuZGF0YV94IDogbm90RW1wdHkoY29uZmlnLmRhdGFfeHMpID8gY29uZmlnLmRhdGFfeHNbaWRdIDogbnVsbDt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pbkJhcihzaGFwZSkpIHtcbiAgICAgICAgICAgICAgICBjbG9zZXN0ID0gdjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gZmluZCBjbG9zZXN0IHBvaW50IGZyb20gbm9uLWJhclxuICAgICAgICB2YWx1ZXMuZmlsdGVyKGZ1bmN0aW9uICh2KSB7IHJldHVybiB2ICYmICEkJC5pc0JhclR5cGUodi5pZCk7IH0pLmZvckVhY2goZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICAgIHZhciBkID0gJCQuZGlzdCh2LCBwb3MpO1xuICAgICAgICAgICAgaWYgKGQgPCBtaW5EaXN0KSB7XG4gICAgICAgICAgICAgICAgbWluRGlzdCA9IGQ7XG4gICAgICAgICAgICAgICAgY2xvc2VzdCA9IHY7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBjbG9zZXN0O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZGlzdCA9IGZ1bmN0aW9uIChkYXRhLCBwb3MpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgeEluZGV4ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDEgOiAwLFxuICAgICAgICAgICAgeUluZGV4ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiAxLFxuICAgICAgICAgICAgeSA9ICQkLmNpcmNsZVkoZGF0YSwgZGF0YS5pbmRleCksXG4gICAgICAgICAgICB4ID0gJCQueChkYXRhLngpO1xuICAgICAgICByZXR1cm4gTWF0aC5zcXJ0KE1hdGgucG93KHggLSBwb3NbeEluZGV4XSwgMikgKyBNYXRoLnBvdyh5IC0gcG9zW3lJbmRleF0sIDIpKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRWYWx1ZXNUb1N0ZXAgPSBmdW5jdGlvbiAodm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hzdlRvRGF0YSh0c3YsIHRoaXMuZDMudHN2KTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRKc29uVG9EYXRhID0gZnVuY3Rpb24gKGpzb24sIGtleXMpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIG5ld19yb3dzID0gW10sIHRhcmdldEtleXMsIGRhdGE7XG4gICAgICAgIGlmIChrZXlzKSB7IC8vIHdoZW4ga2V5cyBzcGVjaWZpZWQsIGpzb24gd291bGQgYmUgYW4gYXJyYXkgdGhhdCBpbmNsdWRlcyBvYmplY3RzXG4gICAgICAgICAgICBpZiAoa2V5cy54KSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0S2V5cyA9IGtleXMudmFsdWUuY29uY2F0KGtleXMueCk7XG4gICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfeCA9IGtleXMueDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0S2V5cyA9IGtleXMudmFsdWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBuZXdfcm93cy5wdXNoKHRhcmdldEtleXMpO1xuICAgICAgICAgICAganNvbi5mb3JFYWNoKGZ1bmN0aW9uIChvKSB7XG4gICAgICAgICAgICAgICAgdmFyIG5ld19yb3cgPSBbXTtcbiAgICAgICAgICAgICAgICB0YXJnZXRLZXlzLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBjb252ZXJ0IHVuZGVmaW5lZCB0byBudWxsIGJlY2F1c2UgdW5kZWZpbmVkIGRhdGEgd2lsbCBiZSByZW1vdmVkIGluIGNvbnZlcnREYXRhVG9UYXJnZXRzKClcbiAgICAgICAgICAgICAgICAgICAgdmFyIHYgPSAkJC5maW5kVmFsdWVJbkpzb24obywga2V5KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHYpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2ID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuZXdfcm93LnB1c2godik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgbmV3X3Jvd3MucHVzaChuZXdfcm93KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZGF0YSA9ICQkLmNvbnZlcnRSb3dzVG9EYXRhKG5ld19yb3dzKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKGpzb24pLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgICAgIG5ld19yb3dzLnB1c2goW2tleV0uY29uY2F0KGpzb25ba2V5XSkpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBkYXRhID0gJCQuY29udmVydENvbHVtbnNUb0RhdGEobmV3X3Jvd3MpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBkYXRhO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZmluZFZhbHVlSW5Kc29uID0gZnVuY3Rpb24gKG9iamVjdCwgcGF0aCkge1xuICAgICAgICBwYXRoID0gcGF0aC5yZXBsYWNlKC9cXFsoXFx3KylcXF0vZywgJy4kMScpOyAvLyBjb252ZXJ0IGluZGV4ZXMgdG8gcHJvcGVydGllcyAocmVwbGFjZSBbXSB3aXRoIC4pXG4gICAgICAgIHBhdGggPSBwYXRoLnJlcGxhY2UoL15cXC4vLCAnJyk7ICAgICAgICAgICAvLyBzdHJpcCBhIGxlYWRpbmcgZG90XG4gICAgICAgIHZhciBwYXRoQXJyYXkgPSBwYXRoLnNwbGl0KCcuJyk7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcGF0aEFycmF5Lmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICB2YXIgayA9IHBhdGhBcnJheVtpXTtcbiAgICAgICAgICAgIGlmIChrIGluIG9iamVjdCkge1xuICAgICAgICAgICAgICAgIG9iamVjdCA9IG9iamVjdFtrXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5jb252ZXJ0Um93c1RvRGF0YSA9IGZ1bmN0aW9uIChyb3dzKSB7XG4gICAgICAgIHZhciBrZXlzID0gcm93c1swXSwgbmV3X3JvdyA9IHt9LCBuZXdfcm93cyA9IFtdLCBpLCBqO1xuICAgICAgICBmb3IgKGkgPSAxOyBpIDwgcm93cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbmV3X3JvdyA9IHt9O1xuICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IHJvd3NbaV0ubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQocm93c1tpXVtqXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiU291cmNlIGRhdGEgaXMgbWlzc2luZyBhIGNvbXBvbmVudCBhdCAoXCIgKyBpICsgXCIsXCIgKyBqICsgXCIpIVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbmV3X3Jvd1trZXlzW2pdXSA9IHJvd3NbaV1bal07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBuZXdfcm93cy5wdXNoKG5ld19yb3cpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXdfcm93cztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnRDb2x1bW5zVG9EYXRhID0gZnVuY3Rpb24gKGNvbHVtbnMpIHtcbiAgICAgICAgdmFyIG5ld19yb3dzID0gW10sIGksIGosIGtleTtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvbHVtbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGtleSA9IGNvbHVtbnNbaV1bMF07XG4gICAgICAgICAgICBmb3IgKGogPSAxOyBqIDwgY29sdW1uc1tpXS5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChuZXdfcm93c1tqIC0gMV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIG5ld19yb3dzW2ogLSAxXSA9IHt9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoY29sdW1uc1tpXVtqXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiU291cmNlIGRhdGEgaXMgbWlzc2luZyBhIGNvbXBvbmVudCBhdCAoXCIgKyBpICsgXCIsXCIgKyBqICsgXCIpIVwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbmV3X3Jvd3NbaiAtIDFdW2tleV0gPSBjb2x1bW5zW2ldW2pdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXdfcm93cztcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmNvbnZlcnREYXRhVG9UYXJnZXRzID0gZnVuY3Rpb24gKGRhdGEsIGFwcGVuZFhzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIGlkcyA9ICQkLmQzLmtleXMoZGF0YVswXSkuZmlsdGVyKCQkLmlzTm90WCwgJCQpLFxuICAgICAgICAgICAgeHMgPSAkJC5kMy5rZXlzKGRhdGFbMF0pLmZpbHRlcigkJC5pc1gsICQkKSxcbiAgICAgICAgICAgIHRhcmdldHM7XG5cbiAgICAgICAgLy8gc2F2ZSB4IGZvciB1cGRhdGUgZGF0YSBieSBsb2FkIHdoZW4gY3VzdG9tIHggYW5kIGMzLnggQVBJXG4gICAgICAgIGlkcy5mb3JFYWNoKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgdmFyIHhLZXkgPSAkJC5nZXRYS2V5KGlkKTtcblxuICAgICAgICAgICAgaWYgKCQkLmlzQ3VzdG9tWCgpIHx8ICQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgLy8gaWYgaW5jbHVkZWQgaW4gaW5wdXQgZGF0YVxuICAgICAgICAgICAgICAgIGlmICh4cy5pbmRleE9mKHhLZXkpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZGF0YS54c1tpZF0gPSAoYXBwZW5kWHMgJiYgJCQuZGF0YS54c1tpZF0gPyAkJC5kYXRhLnhzW2lkXSA6IFtdKS5jb25jYXQoXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLm1hcChmdW5jdGlvbiAoZCkgeyByZXR1cm4gZFt4S2V5XTsgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGlzVmFsdWUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAocmF3WCwgaSkgeyByZXR1cm4gJCQuZ2VuZXJhdGVUYXJnZXRYKHJhd1gsIGlkLCBpKTsgfSlcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gaWYgbm90IGluY2x1ZGVkIGluIGlucHV0IGRhdGEsIGZpbmQgZnJvbSBwcmVsb2FkZWQgZGF0YSBvZiBvdGhlciBpZCdzIHhcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChjb25maWcuZGF0YV94KSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmRhdGEueHNbaWRdID0gJCQuZ2V0T3RoZXJUYXJnZXRYcygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBpZiBub3QgaW5jbHVkZWQgaW4gaW5wdXQgZGF0YSwgZmluZCBmcm9tIHByZWxvYWRlZCBkYXRhXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAobm90RW1wdHkoY29uZmlnLmRhdGFfeHMpKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmRhdGEueHNbaWRdID0gJCQuZ2V0WFZhbHVlc09mWEtleSh4S2V5LCAkJC5kYXRhLnRhcmdldHMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBNRU1POiBpZiBubyB4IGluY2x1ZGVkLCB1c2Ugc2FtZSB4IG9mIGN1cnJlbnQgd2lsbCBiZSB1c2VkXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICQkLmRhdGEueHNbaWRdID0gZGF0YS5tYXAoZnVuY3Rpb24gKGQsIGkpIHsgcmV0dXJuIGk7IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuXG4gICAgICAgIC8vIGNoZWNrIHggaXMgZGVmaW5lZFxuICAgICAgICBpZHMuZm9yRWFjaChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgIGlmICghJCQuZGF0YS54c1tpZF0pIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ3ggaXMgbm90IGRlZmluZWQgZm9yIGlkID0gXCInICsgaWQgKyAnXCIuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIGNvbnZlcnQgdG8gdGFyZ2V0XG4gICAgICAgIHRhcmdldHMgPSBpZHMubWFwKGZ1bmN0aW9uIChpZCwgaW5kZXgpIHtcbiAgICAgICAgICAgIHZhciBjb252ZXJ0ZWRJZCA9IGNvbmZpZy5kYXRhX2lkQ29udmVydGVyKGlkKTtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgaWQ6IGNvbnZlcnRlZElkLFxuICAgICAgICAgICAgICAgIGlkX29yZzogaWQsXG4gICAgICAgICAgICAgICAgdmFsdWVzOiBkYXRhLm1hcChmdW5jdGlvbiAoZCwgaSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgeEtleSA9ICQkLmdldFhLZXkoaWQpLCByYXdYID0gZFt4S2V5XSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gZFtpZF0gIT09IG51bGwgJiYgIWlzTmFOKGRbaWRdKSA/ICtkW2lkXSA6IG51bGwsIHg7XG4gICAgICAgICAgICAgICAgICAgIC8vIHVzZSB4IGFzIGNhdGVnb3JpZXMgaWYgY3VzdG9tIHggYW5kIGNhdGVnb3JpemVkXG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC5pc0N1c3RvbVgoKSAmJiAkJC5pc0NhdGVnb3JpemVkKCkgJiYgaW5kZXggPT09IDAgJiYgIWlzVW5kZWZpbmVkKHJhd1gpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPT09IDAgJiYgaSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3hfY2F0ZWdvcmllcyA9IFtdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGNvbmZpZy5heGlzX3hfY2F0ZWdvcmllcy5pbmRleE9mKHJhd1gpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHggPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGNvbmZpZy5heGlzX3hfY2F0ZWdvcmllcy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLmF4aXNfeF9jYXRlZ29yaWVzLnB1c2gocmF3WCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB4ICA9ICQkLmdlbmVyYXRlVGFyZ2V0WChyYXdYLCBpZCwgaSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gbWFyayBhcyB4ID0gdW5kZWZpbmVkIGlmIHZhbHVlIGlzIHVuZGVmaW5lZCBhbmQgZmlsdGVyIHRvIHJlbW92ZSBhZnRlciBtYXBwZWRcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGRbaWRdKSB8fCAkJC5kYXRhLnhzW2lkXS5sZW5ndGggPD0gaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgeCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge3g6IHgsIHZhbHVlOiB2YWx1ZSwgaWQ6IGNvbnZlcnRlZElkfTtcbiAgICAgICAgICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24gKHYpIHsgcmV0dXJuIGlzRGVmaW5lZCh2LngpOyB9KVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gZmluaXNoIHRhcmdldHNcbiAgICAgICAgdGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICB2YXIgaTtcbiAgICAgICAgICAgIC8vIHNvcnQgdmFsdWVzIGJ5IGl0cyB4XG4gICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfeFNvcnQpIHtcbiAgICAgICAgICAgICAgICB0LnZhbHVlcyA9IHQudmFsdWVzLnNvcnQoZnVuY3Rpb24gKHYxLCB2Mikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgeDEgPSB2MS54IHx8IHYxLnggPT09IDAgPyB2MS54IDogSW5maW5pdHksXG4gICAgICAgICAgICAgICAgICAgICAgICB4MiA9IHYyLnggfHwgdjIueCA9PT0gMCA/IHYyLnggOiBJbmZpbml0eTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHgxIC0geDI7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAg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gKGQuaWQgPT09IHRhcmdldHNbaV0uaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQudmFsdWVzID0gdGFyZ2V0c1tpXS52YWx1ZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAkJC5kYXRhLnRhcmdldHMgPSAkJC5kYXRhLnRhcmdldHMuY29uY2F0KHRhcmdldHMpOyAvLyBhZGQgcmVtYWluZWRcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFNldCB0YXJnZXRzXG4gICAgICAgICQkLnVwZGF0ZVRhcmdldHMoJCQuZGF0YS50YXJnZXRzKTtcblxuICAgICAgICAvLyBSZWRyYXcgd2l0aCBuZXcgdGFyZ2V0c1xuICAgICAgICAkJC5yZWRyYXcoe3dpdGhVcGRhdGVPcmdYRG9tYWluOiB0cnVlLCB3aXRoVXBkYXRlWERvbWFpbjogdHJ1ZSwgd2l0aExlZ2VuZDogdHJ1ZX0pO1xuXG4gICAgICAgIGlmIChhcmdzLmRvbmUpIHsgYXJncy5kb25lKCk7IH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmxvYWRGcm9tQXJncyA9IGZ1bmN0aW9uIChhcmdzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXM7XG4gICAgICAgIGlmIChhcmdzLmRhdGEpIHtcbiAgICAgICAgICAgICQkLmxvYWQoJCQuY29udmVydERhdGFUb1RhcmdldHMoYXJncy5kYXRhKSwgYXJncyk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoYXJncy51cmwpIHtcbiAgICAgICAgICAgICQkLmNvbnZlcnRVcmxUb0RhdGEoYXJncy51cmwsIGFyZ3MubWltZVR5cGUsIGFyZ3MuaGVhZGV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OyB9KTtcblxuICAgICAgICBpZiAoJCQuaXNNdWx0aXBsZVgoKSkge1xuICAgICAgICAgICAgLy8gVE9ETzogcm90YXRlZCBub3Qgc3VwcG9ydGVkIHlldFxuICAgICAgICAgICAgeCA9IDA7XG4gICAgICAgICAgICB5ID0gMDtcbiAgICAgICAgICAgIHcgPSAkJC53aWR0aDtcbiAgICAgICAgICAgIGggPSAkJC5oZWlnaHQ7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBpZiAoKCQkLmlzQ3VzdG9tWCgpIHx8ICQkLmlzVGltZVNlcmllcygpKSAmJiAhJCQuaXNDYXRlZ29yaXplZCgpKSB7XG5cbiAgICAgICAgICAgICAgICAvLyB1cGRhdGUgaW5kZXggZm9yIHggdGhhdCBpcyB1c2VkIGJ5IHByZXZYIGFuZCBuZXh0WFxuICAgICAgICAgICAgICAgICQkLnVwZGF0ZVhzKCk7XG5cbiAgICAgICAgICAgICAgICByZWN0VyA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcmV2WCA9ICQkLmdldFByZXZYKGQuaW5kZXgpLCBuZXh0WCA9ICQkLmdldE5leHRYKGQuaW5kZXgpO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZXJlIHRoaXMgaXMgYSBzaW5nbGUgZGF0YSBwb2ludCBtYWtlIHRoZSBldmVudFJlY3QgZnVsbCB3aWR0aCAob3IgaGVpZ2h0KVxuICAgICAgICAgICAgICAgICAgICBpZiAocHJldlggPT09IG51bGwgJiYgbmV4dFggPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb25maWcuYXhpc19yb3RhdGVkID8gJCQuaGVpZ2h0IDogJCQud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAocHJldlggPT09IG51bGwpIHsgcHJldlggPSAkJC54LmRvbWFpbigpWzBdOyB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChuZXh0WCA9PT0gbnVsbCkgeyBuZXh0WCA9ICQkLnguZG9tYWluKClbMV07IH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gTWF0aC5tYXgoMCwgKCQkLngobmV4dFgpIC0gJCQueChwcmV2WCkpIC8gMik7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICByZWN0WCA9IGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwcmV2WCA9ICQkLmdldFByZXZYKGQuaW5kZXgpLCBuZXh0WCA9ICQkLmdldE5leHRYKGQuaW5kZXgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1ggPSAkJC5kYXRhLnhzW2QuaWRdW2QuaW5kZXhdO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZXJlIHRoaXMgaXMgYSBzaW5nbGUgZGF0YSBwb2ludCBwb3NpdGlvbiB0aGUgZXZlbnRSZWN0IGF0IDBcbiAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZYID09PSBudWxsICYmIG5leHRYID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2WCA9PT0gbnVsbCkgeyBwcmV2WCA9ICQkLnguZG9tYWluKClbMF07IH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCQkLngodGhpc1gpICsgJCQueChwcmV2WCkpIC8gMjtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZWN0VyA9ICQkLmdldEV2ZW50UmVjdFdpZHRoKCk7XG4gICAgICAgICAgICAgICAgcmVjdFggPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQueChkLngpIC0gKHJlY3RXIC8gMik7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHggPSBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IHJlY3RYO1xuICAgICAgICAgICAgeSA9IGNvbmZpZy5heGlzX3JvdGF0ZWQgPyByZWN0WCA6IDA7XG4gICAgICAgICAgICB3ID0gY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoIDogcmVjdFc7XG4gICAgICAgICAgICBoID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IHJlY3RXIDogJCQuaGVpZ2h0O1xuICAgICAgICB9XG5cbiAgICAgICAgZXZlbnRSZWN0VXBkYXRlXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAkJC5jbGFzc0V2ZW50LmJpbmQoJCQpKVxuICAgICAgICAgICAgLmF0dHIoXCJ4XCIsIHgpXG4gICAgICAgICAgICAuYXR0cihcInlcIiwgeSlcbiAgICAgICAgICAgIC5hdHRyKFwid2lkdGhcIiwgdylcbiAgICAgICAgICAgIC5hdHRyKFwiaGVpZ2h0XCIsIGgpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2VuZXJhdGVFdmVudFJlY3RzRm9yU2luZ2xlWCA9IGZ1bmN0aW9uIChldmVudFJlY3RFbnRlcikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBkMyA9ICQkLmQzLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIGV2ZW50UmVjdEVudGVyLmFwcGVuZChcInJlY3RcIilcbiAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgJCQuY2xhc3NFdmVudC5iaW5kKCQkKSlcbiAgICAgICAgICAgIC5zdHlsZShcImN1cnNvclwiLCBjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCAmJiBjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCA/IFwicG9pbnRlclwiIDogbnVsbClcbiAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBkLmluZGV4O1xuXG4gICAgICAgICAgICAgICAgaWYgKCQkLmRyYWdnaW5nIHx8ICQkLmZsb3dpbmcpIHsgcmV0dXJuOyB9IC8vIGRvIG5vdGhpbmcgd2hpbGUgZHJhZ2dpbmcvZmxvd2luZ1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICAgICAgICAvLyBFeHBhbmQgc2hhcGVzIGZvciBzZWxlY3Rpb25cbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkKSB7ICQkLmV4cGFuZENpcmNsZXMoaW5kZXgsIG51bGwsIHRydWUpOyB9XG4gICAgICAgICAgICAgICAgJCQuZXhwYW5kQmFycyhpbmRleCwgbnVsbCwgdHJ1ZSk7XG5cbiAgICAgICAgICAgICAgICAvLyBDYWxsIGV2ZW50IGhhbmRsZXJcbiAgICAgICAgICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5zaGFwZSArICctJyArIGluZGV4KS5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhX29ubW91c2VvdmVyLmNhbGwoJCQuYXBpLCBkKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBkLmluZGV4O1xuICAgICAgICAgICAgICAgIGlmICghJCQuY29uZmlnKSB7IHJldHVybjsgfSAvLyBjaGFydCBpcyBkZXN0cm95ZWRcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgICAgICQkLmhpZGVYR3JpZEZvY3VzKCk7XG4gICAgICAgICAgICAgICAgJCQuaGlkZVRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAvLyBVbmRvIGV4cGFuZGVkIHNoYXBlc1xuICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQ2lyY2xlcygpO1xuICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQmFycygpO1xuICAgICAgICAgICAgICAgIC8vIENhbGwgZXZlbnQgaGFuZGxlclxuICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgaW5kZXgpLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfb25tb3VzZW91dC5jYWxsKCQkLmFwaSwgZCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLm9uKCdtb3VzZW1vdmUnLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZERhdGEsIGluZGV4ID0gZC5pbmRleCxcbiAgICAgICAgICAgICAgICAgICAgZXZlbnRSZWN0ID0gJCQuc3ZnLnNlbGVjdCgnLicgKyBDTEFTUy5ldmVudFJlY3QgKyAnLScgKyBpbmRleCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoJCQuZHJhZ2dpbmcgfHwgJCQuZmxvd2luZykgeyByZXR1cm47IH0gLy8gZG8gbm90aGluZyB3aGlsZSBkcmFnZ2luZy9mbG93aW5nXG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cblxuICAgICAgICAgICAgICAgIGlmICgkJC5pc1N0ZXBUeXBlKGQpICYmICQkLmNvbmZpZy5saW5lX3N0ZXBfdHlwZSA9PT0gJ3N0ZXAtYWZ0ZXInICYmIGQzLm1vdXNlKHRoaXMpWzBdIDwgJCQueCgkJC5nZXRYVmFsdWUoZC5pZCwgaW5kZXgpKSkge1xuICAgICAgICAgICAgICAgICAgICBpbmRleCAtPSAxO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIFNob3cgdG9vbHRpcFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0YSA9ICQkLmZpbHRlclRhcmdldHNUb1Nob3coJCQuZGF0YS50YXJnZXRzKS5tYXAoZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQkLmFkZE5hbWUoJCQuZ2V0VmFsdWVPbkluZGV4KHQudmFsdWVzLCBpbmRleCkpO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy50b29sdGlwX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1Rvb2x0aXAoc2VsZWN0ZWREYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1hHcmlkRm9jdXMoc2VsZWN0ZWREYXRhKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCAmJiAoIWNvbmZpZy5kYXRhX3NlbGVjdGlvbl9lbmFibGVkIHx8IGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgJCQubWFpbi5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBpbmRleClcbiAgICAgICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLmNsYXNzZWQoQ0xBU1MuRVhQQU5ERUQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRSZWN0LnN0eWxlKCdjdXJzb3InLCBjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCA/ICdwb2ludGVyJyA6IG51bGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25maWcudG9vbHRpcF9ncm91cGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuaGlkZVhHcmlkRm9jdXMoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5oaWRlVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29uZmlnLmRhdGFfc2VsZWN0aW9uX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQudW5leHBhbmRDaXJjbGVzKGluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQudW5leHBhbmRCYXJzKGluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkJC5pc1dpdGhpblNoYXBlKHRoaXMsIGQpO1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9lbmFibGVkICYmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCB8fCBjb25maWcuZGF0YV9zZWxlY3Rpb25faXNzZWxlY3RhYmxlKGQpKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50UmVjdC5zdHlsZSgnY3Vyc29yJywgJ3BvaW50ZXInKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29uZmlnLnRvb2x0aXBfZ3JvdXBlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnNob3dUb29sdGlwKFtkXSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2hvd1hHcmlkRm9jdXMoW2RdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnBvaW50X2ZvY3VzX2V4cGFuZF9lbmFibGVkKSB7ICQkLmV4cGFuZENpcmNsZXMoaW5kZXgsIGQuaWQsIHRydWUpOyB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuZXhwYW5kQmFycyhpbmRleCwgZC5pZCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IGQuaW5kZXg7XG4gICAgICAgICAgICAgICAgaWYgKCQkLmhhc0FyY1R5cGUoKSB8fCAhJCQudG9nZ2xlU2hhcGUpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgaWYgKCQkLmNhbmNlbENsaWNrKSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmNhbmNlbENsaWNrID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzU3RlcFR5cGUoZCkgJiYgY29uZmlnLmxpbmVfc3RlcF90eXBlID09PSAnc3RlcC1hZnRlcicgJiYgZDMubW91c2UodGhpcylbMF0gPCAkJC54KCQkLmdldFhWYWx1ZShkLmlkLCBpbmRleCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIGluZGV4IC09IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlICsgJy0nICsgaW5kZXgpLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kYXRhX3NlbGVjdGlvbl9ncm91cGVkIHx8ICQkLmlzV2l0aGluU2hhcGUodGhpcywgZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLnRvZ2dsZVNoYXBlKHRoaXMsIGQsIGluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29uY2xpY2suY2FsbCgkJC5hcGksIGQsIHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmNhbGwoXG4gICAgICAgICAgICAgICAgY29uZmlnLmRhdGFfc2VsZWN0aW9uX2RyYWdnYWJsZSAmJiAkJC5kcmFnID8gKFxuICAgICAgICAgICAgICAgICAgICBkMy5iZWhhdmlvci5kcmFnKCkub3JpZ2luKE9iamVjdClcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZycsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZyhkMy5tb3VzZSh0aGlzKSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdzdGFydCcsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZ3N0YXJ0KGQzLm1vdXNlKHRoaXMpKTsgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZ2VuZCcsIGZ1bmN0aW9uICgpIHsgJCQuZHJhZ2VuZCgpOyB9KVxuICAgICAgICAgICAgICAgICkgOiBmdW5jdGlvbiAoKSB7fVxuICAgICAgICAgICAgKTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2VuZXJhdGVFdmVudFJlY3RzRm9yTXVsdGlwbGVYcyA9IGZ1bmN0aW9uIChldmVudFJlY3RFbnRlcikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBkMyA9ICQkLmQzLCBjb25maWcgPSAkJC5jb25maWc7XG5cbiAgICAgICAgZnVuY3Rpb24gbW91c2VvdXQoKSB7XG4gICAgICAgICAgICAkJC5zdmcuc2VsZWN0KCcuJyArIENMQVNTLmV2ZW50UmVjdCkuc3R5bGUoJ2N1cnNvcicsIG51bGwpO1xuICAgICAgICAgICAgJCQuaGlkZVhHcmlkRm9jdXMoKTtcbiAgICAgICAgICAgICQkLmhpZGVUb29sdGlwKCk7XG4gICAgICAgICAgICAkJC51bmV4cGFuZENpcmNsZXMoKTtcbiAgICAgICAgICAgICQkLnVuZXhwYW5kQmFycygpO1xuICAgICAgICB9XG5cbiAgICAgICAgZXZlbnRSZWN0RW50ZXIuYXBwZW5kKCdyZWN0JylcbiAgICAgICAgICAgIC5hdHRyKCd4JywgMClcbiAgICAgICAgICAgIC5hdHRyKCd5JywgMClcbiAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsICQkLndpZHRoKVxuICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsICQkLmhlaWdodClcbiAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIENMQVNTLmV2ZW50UmVjdClcbiAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEkJC5jb25maWcpIHsgcmV0dXJuOyB9IC8vIGNoYXJ0IGlzIGRlc3Ryb3llZFxuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKCkpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgbW91c2VvdXQoKTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ21vdXNlbW92ZScsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgdGFyZ2V0c1RvU2hvdyA9ICQkLmZpbHRlclRhcmdldHNUb1Nob3coJCQuZGF0YS50YXJnZXRzKTtcbiAgICAgICAgICAgICAgICB2YXIgbW91c2UsIGNsb3Nlc3QsIHNhbWVYRGF0YSwgc2VsZWN0ZWREYXRhO1xuXG4gICAgICAgICAgICAgICAgaWYgKCQkLmRyYWdnaW5nKSB7IHJldHVybjsgfSAvLyBkbyBub3RoaW5nIHdoZW4gZHJhZ2dpbmdcbiAgICAgICAgICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSh0YXJnZXRzVG9TaG93KSkgeyByZXR1cm47IH1cblxuICAgICAgICAgICAgICAgIG1vdXNlID0gZDMubW91c2UodGhpcyk7XG4gICAgICAgICAgICAgICAgY2xvc2VzdCA9ICQkLmZpbmRDbG9zZXN0RnJvbVRhcmdldHModGFyZ2V0c1RvU2hvdywgbW91c2UpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCQkLm1vdXNlb3ZlciAmJiAoIWNsb3Nlc3QgfHwgY2xvc2VzdC5pZCAhPT0gJCQubW91c2VvdmVyLmlkKSkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9vbm1vdXNlb3V0LmNhbGwoJCQuYXBpLCAkJC5tb3VzZW92ZXIpO1xuICAgICAgICAgICAgICAgICAgICAkJC5tb3VzZW92ZXIgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKCEgY2xvc2VzdCkge1xuICAgICAgICAgICAgICAgICAgICBtb3VzZW91dCgpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzU2NhdHRlclR5cGUoY2xvc2VzdCkgfHwgIWNvbmZpZy50b29sdGlwX2dyb3VwZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgc2FtZVhEYXRhID0gW2Nsb3Nlc3RdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHNhbWVYRGF0YSA9ICQkLmZpbHRlckJ5WCh0YXJnZXRzVG9TaG93LCBjbG9zZXN0LngpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIHNob3cgdG9vbHRpcCB3aGVuIGN1cnNvciBpcyBjbG9zZSB0byBzb21lIHBvaW50XG4gICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRhID0gc2FtZVhEYXRhLm1hcChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCQuYWRkTmFtZShkKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAkJC5zaG93VG9vbHRpcChzZWxlY3RlZERhdGEsIHRoaXMpO1xuXG4gICAgICAgICAgICAgICAgLy8gZXhwYW5kIHBvaW50c1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcucG9pbnRfZm9jdXNfZXhwYW5kX2VuYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuZXhwYW5kQ2lyY2xlcyhjbG9zZXN0LmluZGV4LCBjbG9zZXN0LmlkLCB0cnVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQuZXhwYW5kQmFycyhjbG9zZXN0LmluZGV4LCBjbG9zZXN0LmlkLCB0cnVlKTtcblxuICAgICAgICAgICAgICAgIC8vIFNob3cgeGdyaWQgZm9jdXMgbGluZVxuICAgICAgICAgICAgICAgICQkLnNob3dYR3JpZEZvY3VzKHNlbGVjdGVkRGF0YSk7XG5cbiAgICAgICAgICAgICAgICAvLyBTaG93IGN1cnNvciBhcyBwb2ludGVyIGlmIHBvaW50IGlzIGNsb3NlIHRvIG1vdXNlIHBvc2l0aW9uXG4gICAgICAgICAgICAgICAgaWYgKCQkLmlzQmFyVHlwZShjbG9zZXN0LmlkKSB8fCAkJC5kaXN0KGNsb3Nlc3QsIG1vdXNlKSA8IGNvbmZpZy5wb2ludF9zZW5zaXRpdml0eSkge1xuICAgICAgICAgICAgICAgICAgICAkJC5zdmcuc2VsZWN0KCcuJyArIENMQVNTLmV2ZW50UmVjdCkuc3R5bGUoJ2N1cnNvcicsICdwb2ludGVyJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghJCQubW91c2VvdmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9vbm1vdXNlb3Zlci5jYWxsKCQkLmFwaSwgY2xvc2VzdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5tb3VzZW92ZXIgPSBjbG9zZXN0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRhcmdldHNUb1Nob3cgPSAkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cyk7XG4gICAgICAgICAgICAgICAgdmFyIG1vdXNlLCBjbG9zZXN0O1xuICAgICAgICAgICAgICAgIGlmICgkJC5oYXNBcmNUeXBlKHRhcmdldHNUb1Nob3cpKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgbW91c2UgPSBkMy5tb3VzZSh0aGlzKTtcbiAgICAgICAgICAgICAgICBjbG9zZXN0ID0gJCQuZmluZENsb3Nlc3RGcm9tVGFyZ2V0cyh0YXJnZXRzVG9TaG93LCBtb3VzZSk7XG4gICAgICAgICAgICAgICAgaWYgKCEgY2xvc2VzdCkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICAvLyBzZWxlY3QgaWYgc2VsZWN0aW9uIGVuYWJsZWRcbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNCYXJUeXBlKGNsb3Nlc3QuaWQpIHx8ICQkLmRpc3QoY2xvc2VzdCwgbW91c2UpIDwgY29uZmlnLnBvaW50X3NlbnNpdGl2aXR5KSB7XG4gICAgICAgICAgICAgICAgICAgICQkLm1haW4uc2VsZWN0QWxsKCcuJyArIENMQVNTLnNoYXBlcyArICQkLmdldFRhcmdldFNlbGVjdG9yU3VmZml4KGNsb3Nlc3QuaWQpKS5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyBjbG9zZXN0LmluZGV4KS5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGF0YV9zZWxlY3Rpb25fZ3JvdXBlZCB8fCAkJC5pc1dpdGhpblNoYXBlKHRoaXMsIGNsb3Nlc3QpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQudG9nZ2xlU2hhcGUodGhpcywgY2xvc2VzdCwgY2xvc2VzdC5pbmRleCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25jbGljay5jYWxsKCQkLmFwaSwgY2xvc2VzdCwgdGhpcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuY2FsbChcbiAgICAgICAgICAgICAgICBjb25maWcuZGF0YV9zZWxlY3Rpb25fZHJhZ2dhYmxlICYmICQkLmRyYWcgPyAoXG4gICAgICAgICAgICAgICAgICAgIGQzLmJlaGF2aW9yLmRyYWcoKS5vcmlnaW4oT2JqZWN0KVxuICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnJywgZnVuY3Rpb24gKCkgeyAkJC5kcmFnKGQzLm1vdXNlKHRoaXMpKTsgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZ3N0YXJ0JywgZnVuY3Rpb24gKCkgeyAkJC5kcmFnc3RhcnQoZDMubW91c2UodGhpcykpOyB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnZW5kJywgZnVuY3Rpb24gKCkgeyAkJC5kcmFnZW5kKCk7IH0pXG4gICAgICAgICAgICAgICAgKSA6IGZ1bmN0aW9uICgpIHt9XG4gICAgICAgICAgICApO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZGlzcGF0Y2hFdmVudCA9IGZ1bmN0aW9uICh0eXBlLCBpbmRleCwgbW91c2UpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIHNlbGVjdG9yID0gJy4nICsgQ0xBU1MuZXZlbnRSZWN0ICsgKCEkJC5pc011bHRpcGxlWCgpID8gJy0nICsgaW5kZXggOiAnJyksXG4gICAgICAgICAgICBldmVudFJlY3QgPSAkJC5tYWluLnNlbGVjdChzZWxlY3Rvcikubm9kZSgpLFxuICAgICAgICAgICAgYm94ID0gZXZlbnRSZWN0LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLFxuICAgICAgICAgICAgeCA9IGJveC5sZWZ0ICsgKG1vdXNlID8gbW91c2VbMF0gOiAwKSxcbiAgICAgICAgICAgIHkgPSBib3gudG9wICsgKG1vdXNlID8gbW91c2VbMV0gOiAwKSxcbiAgICAgICAgICAgIGV2ZW50ID0gZG9jdW1lbnQuY3JlYXRlRXZlbnQoXCJNb3VzZUV2ZW50c1wiKTtcblxuICAgICAgICBldmVudC5pbml0TW91c2VFdmVudCh0eXBlLCB0cnVlLCB0cnVlLCB3aW5kb3csIDAsIHgsIHksIHgsIHksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLCBmYWxzZSwgZmFsc2UsIGZhbHNlLCAwLCBudWxsKTtcbiAgICAgICAgZXZlbnRSZWN0LmRpc3BhdGNoRXZlbnQoZXZlbnQpO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRDdXJ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pbGUgKHBhcmVudCAmJiBwYXJlbnQudGFnTmFtZSAhPT0gJ0JPRFknKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHYgPSBwYXJlbnQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KClba2V5XTtcbiAgICAgICAgICAgIH0gY2F0Y2goZSkge1xuICAgICAgICAgICAgICAgIGlmIChrZXkgPT09ICd3aWR0aCcpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gSW4gSUUgaW4gY2VydGFpbiBjYXNlcyBnZXRCb3VuZGluZ0NsaWVudFJlY3RcbiAgICAgICAgICAgICAgICAgICAgLy8gd2lsbCBjYXVzZSBhbiBcInVuc3BlY2lmaWVkIGVycm9yXCJcbiAgICAgICAgICAgICAgICAgICAgdiA9IHBhcmVudC5vZmZzZXRXaWR0aDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodikge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGFyZW50ID0gcGFyZW50LnBhcmVudE5vZGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHY7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRQYXJlbnRXaWR0aCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0UGFyZW50UmVjdFZhbHVlKCd3aWR0aCcpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0UGFyZW50SGVpZ2h0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgaCA9IHRoaXMuc2VsZWN0Q2hhcnQuc3R5bGUoJ2hlaWdodCcpO1xuICAgICAgICByZXR1cm4gaC5pbmRleE9mKCdweCcpID4gMCA/ICtoLnJlcGxhY2UoJ3B4JywgJycpIDogMDtcbiAgICB9O1xuXG5cbiAgICBjM19jaGFydF9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1dGUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgcG9zaXRpb24gPSAkJC5heGlzLmdldExhYmVsUG9zaXRpb25CeUlkKGlkKTtcbiAgICAgICAgcmV0dXJuICQkLmF4aXMuZ2V0TWF4VGlja1dpZHRoKGlkLCB3aXRob3V0UmVjb21wdXRlKSArIChwb3NpdGlvbi5pc0lubmVyID8gMjAgOiA0MCk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRIb3Jpem9udGFsQXhpc0hlaWdodCA9IGZ1bmN0aW9uIChheGlzSWQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCBoID0gMzA7XG4gICAgICAgIGlmIChheGlzSWQgPT09ICd4JyAmJiAhY29uZmlnLmF4aXNfeF9zaG93KSB7IHJldHVybiA4OyB9XG4gICAgICAgIGlmIChheGlzSWQgPT09ICd4JyAmJiBjb25maWcuYXhpc194X2hlaWdodCkgeyByZXR1cm4gY29uZmlnLmF4aXNfeF9oZWlnaHQ7IH1cbiAgICAgICAgaWYgKGF4aXNJZCA9PT0gJ3knICYmICFjb25maWcuYXhpc195X3Nob3cpIHsgXG4gICAgICAgICAgICByZXR1cm4gY29uZmlnLmxlZ2VuZF9zaG93ICYmICEkJC5pc0xlZ2VuZFJpZ2h0ICYmICEkJC5pc0xlZ2VuZEluc2V0ID8gMTAgOiAxOyBcbiAgICAgICAgfVxuICAgICAgICBpZiAoYXhpc0lkID09PSAneTInICYmICFjb25maWcuYXhpc195Ml9zaG93KSB7IHJldHVybiAkJC5yb3RhdGVkX3BhZGRpbmdfdG9wOyB9XG4gICAgICAgIC8vIENhbGN1bGF0ZSB4IGF4aXMgaGVpZ2h0IHdoZW4gdGljayByb3RhdGVkXG4gICAgICAgIGlmIChheGlzSWQgPT09ICd4JyAmJiAhY29uZmlnLmF4aXNfcm90YXRlZCAmJiBjb25maWcuYXhpc194X3RpY2tfcm90YXRlKSB7XG4gICAgICAgICAgICBoID0gMzAgKyAkJC5heGlzLmdldE1heFRpY2tXaWR0aChheGlzSWQpICogTWF0aC5jb3MoTWF0aC5QSSAqICg5MCAtIGNvbmZpZy5heGlzX3hfdGlja19yb3RhdGUpIC8gMTgwKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBDYWxjdWxhdGUgeSBheGlzIGhlaWdodCB3aGVuIHRpY2sgcm90YXRlZFxuICAgICAgICBpZiAoYXhpc0lkID09PSAneScgJiYgY29uZmlnLmF4aXNfcm90YXRlZCAmJiBjb25maWcuYXhpc195X3RpY2tfcm90YXRlKSB7XG4gICAgICAgICAgICBoID0gMzAgKyAkJC5heGlzLmdldE1heFRpY2tXaWR0aChheGlzSWQpICogTWF0aC5jb3MoTWF0aC5QSSAqICg5MCAtIGNvbmZpZy5heGlzX3lfdGlja19yb3RhdGUpIC8gMTgwKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaCArICgkJC5heGlzLmdldExhYmVsUG9zaXRpb25CeUlkKGF4aXNJZCkuaXNJbm5lciA/IDAgOiAxMCkgKyAoYXhpc0lkID09PSAneTInID8gLTEwIDogMCk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldEV2ZW50UmVjdFdpZHRoID0gZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gTWF0aC5tYXgoMCwgdGhpcy54QXhpcy50aWNrSW50ZXJ2YWwoKSk7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFNoYXBlSW5kaWNlcyA9IGZ1bmN0aW9uICh0eXBlRmlsdGVyKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIGluZGljZXMgPSB7fSwgaSA9IDAsIGosIGs7XG4gICAgICAgICQkLmZpbHRlclRhcmdldHNUb1Nob3coJCQuZGF0YS50YXJnZXRzLmZpbHRlcih0eXBlRmlsdGVyLCAkJCkpLmZvckVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBjb25maWcuZGF0YV9ncm91cHMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfZ3JvdXBzW2pdLmluZGV4T2YoZC5pZCkgPCAwKSB7IGNvbnRpbnVlOyB9XG4gICAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IGNvbmZpZy5kYXRhX2dyb3Vwc1tqXS5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmRhdGFfZ3JvdXBzW2pdW2tdIGluIGluZGljZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZGljZXNbZC5pZF0gPSBpbmRpY2VzW2NvbmZpZy5kYXRhX2dyb3Vwc1tqXVtrXV07XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZChpbmRpY2VzW2QuaWRdKSkgeyBpbmRpY2VzW2QuaWRdID0gaSsrOyB9XG4gICAgICAgIH0pO1xuICAgICAgICBpbmRpY2VzLl9fbWF4X18gPSBpIC0gMTtcbiAgICAgICAgcmV0dXJuIGluZGljZXM7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRTaGFwZVggPSBmdW5jdGlvbiAob2Zmc2V0LCB0YXJnZXRzTnVtLCBpbmRpY2VzLCBpc1N1Yikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBzY2FsZSA9IGlzU3ViID8gJCQuc3ViWCA6ICQkLng7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gZC5pZCBpbiBpbmRpY2VzID8gaW5kaWNlc1tkLmlkXSA6I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pb24gKHQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdmFsdWVzID0gJCQuaXNTdGVwVHlwZShkKSA/ICQkLmNvbnZlcnRWYWx1ZXNUb1N0ZXAodC52YWx1ZXMpIDogdC52YWx1ZXM7XG4gICAgICAgICAgICAgICAgaWYgKHQuaWQgPT09IGQuaWQgfHwgaW5kaWNlc1t0LmlkXSAhPT0gaW5kaWNlc1tkLmlkXSkgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICBpZiAodGFyZ2V0SWRzLmluZGV4T2YodC5pZCkgPCB0YXJnZXRJZHMuaW5kZXhPZihkLmlkKSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBjaGVjayBpZiB0aGUgeCB2YWx1ZXMgbGluZSB1cFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHZhbHVlc1tpXSA9PT0gJ3VuZGVmaW5lZCcgfHwgK3ZhbHVlc1tpXS54ICE9PSArZC54KSB7ICAvLyBcIitcIiBmb3IgdGltZXNlcmllc1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgbm90LCB0cnkgdG8gZmluZCB0aGUgdmFsdWUgdGhhdCBkb2VzIGxpbmUgdXBcbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uICh2LCBqKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHYueCA9PT0gZC54KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChpIGluIHZhbHVlcyAmJiB2YWx1ZXNbaV0udmFsdWUgKiBkLnZhbHVlID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCArPSBzY2FsZSh2YWx1ZXNbaV0udmFsdWUpIC0geTA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiBvZmZzZXQ7XG4gICAgICAgIH07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pc1dpdGhpblNoYXBlID0gZnVuY3Rpb24gKHRoYXQsIGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIHNoYXBlID0gJCQuZDMuc2VsZWN0KHRoYXQpLCBpc1dpdGhpbjtcbiAgICAgICAgaWYgKCEkJC5pc1RhcmdldFRvU2hvdyhkLmlkKSkge1xuICAgICAgICAgICAgaXNXaXRoaW4gPSBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0aGF0Lm5vZGVOYW1lID09PSAnY2lyY2xlJykge1xuICAgICAgICAgICAgaXNXaXRoaW4gPSAkJC5pc1N0ZXBUeXBlKGQpID8gJCQuaXNXaXRoaW5TdGVwKHRoYXQsICQkLmdldFlTY2FsZShkLmlkKShkLnZhbHVlKSkgOiAkJC5pc1dpdGhpbkNpcmNsZSh0aGF0LCAkJC5wb2ludFNlbGVjdFIoZCkgKiAxLjUpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHRoYXQubm9kZU5hbWUgPT09ICdwYXRoJykge1xuICAgICAgICAgICAgaXNXaXRoaW4gPSBzaGFwZS5jbGFzc2VkKENMQVNTLmJhcikgPyAkJC5pc1dpdGhpbkJhcih0aGF0KSA6IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGlzV2l0aGluO1xuICAgIH07XG5cblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldEludGVycG9sYXRlID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcyxcbiAgICAgICAgICAgIGludGVycG9s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GF0ZWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoKDAgPCBkLnZhbHVlICYmIHBvc1kgPCB5MCkgfHwgKGQudmFsdWUgPCAwICYmIHkwIDwgcG9zWSkpIHsgcG9zWSA9IHkwOyB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyAxIHBvaW50IHRoYXQgbWFya3MgdGhlIGxpbmUgcG9zaXRpb25cbiAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgICAgW3Bvc1gsIHBvc1kgLSAoeTAgLSBvZmZzZXQpXSxcbiAgICAgICAgICAgICAgICBbcG9zWCwgcG9zWSAtICh5MCAtIG9mZnNldCldLCAvLyBuZWVkZWQgZm9yIGNvbXBhdGliaWxpdHlcbiAgICAgICAgICAgICAgICBbcG9zWCwgcG9zWSAtICh5MCAtIG9mZnNldCldLCAvLyBuZWVkZWQgZm9yIGNvbXBhdGliaWxpdHlcbiAgICAgICAgICAgICAgICBbcG9zWCwgcG9zWSAtICh5MCAtIG9mZnNldCldICAvLyBuZWVkZWQgZm9yIGNvbXBhdGliaWxpdHlcbiAgICAgICAgICAgIF07XG4gICAgICAgIH07XG4gICAgfTtcblxuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ubGluZVdpdGhSZWdpb25zID0gZnVuY3Rpb24gKGQsIHgsIHksIF9yZWdpb25zKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZyxcbiAgICAgICAgICAgIHByZXYgPSAtMSwgaSwgaixcbiAgICAgICAgICAgIHMgPSBcIk1cIiwgc1dpdGhSZWdpb24sXG4gICAgICAgICAgICB4cCwgeXAsIGR4LCBkeSwgZGQsIGRpZmYsIGRpZmZ4MixcbiAgICAgICAgICAgIHhPZmZzZXQgPSAkJC5pc0NhdGVnb3JpemVkKCkgPyAwLjUgOiAwLFxuICAgICAgICAgICAgeFZhbHVlLCB5VmFsdWUsXG4gICAgICAgICAgICByZWdpb25zID0gW107XG5cbiAgICAgICAgZnVuY3Rpb24gaXNXaXRoaW5SZWdpb25zKHgsIHJlZ2lvbnMpIHtcbiAgICAgICAgICAgIHZhciBpO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHJlZ2lvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAocmVnaW9uc1tpXS5zdGFydCA8IHggJiYgeCA8PSByZWdpb25zW2ldLmVuZCkgeyByZXR1cm4gdHJ1ZTsgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQ2hlY2sgc3RhcnQvZW5kIG9mIHJlZ2lvbnNcbiAgICAgICAgaWYgKGlzRGVmaW5lZChfcmVnaW9ucykpIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBfcmVnaW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHJlZ2lvbnNbaV0gPSB7fTtcbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoX3JlZ2lvbnNbaV0uc3RhcnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlZ2lvbnNbaV0uc3RhcnQgPSBkWzBdLng7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVnaW9uc1tpXS5zdGFydCA9ICQkLmlzVGltZVNlcmllcygpID8gJCQucGFyc2VEYXRlKF9yZWdpb25zW2ldLnN0YXJ0KSA6IF9yZWdpb25zW2ldLnN0YXJ0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQoX3JlZ2lvbnNbaV0uZW5kKSkge1xuICAgICAgICAgICAgICAgICAgICByZWdpb25zW2ldLmVuZCA9IGRbZC5sZW5ndGggLSAxXS54O1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlZ2lvbn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ZiAqIChqICsgZGlmZikpLFxuICAgICAgICAgICAgICAgICAgICBwb2ludHM7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5heGlzX3JvdGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzID0gW1t5KHlwKGopKSwgeCh4djApXSwgW3koeXAoaiArIGRpZmYpKSwgeCh4djEpXV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzID0gW1t4KHh2MCksIHkoeXAoaikpXSwgW3goeHYxKSwgeSh5cChqICsgZGlmZikpXV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBnZW5lcmF0ZU0ocG9pbnRzKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzV2l0aFJlZ2lvbiA9IGZ1bmN0aW9uIChkMCwgZDEsIGosIGRpZmYpIHtcbiAgICAgICAgICAgICAgICB2YXIgcG9pbnRzO1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50cyA9IFtbeSh5cChqKSwgdHJ1ZSksIHgoeHAoaikpXSwgW3koeXAoaiArIGRpZmYpLCB0cnVlKSwgeCh4cChqICsgZGlmZikpXV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcG9pbnRzID0gW1t4KHhwKGopLCB0cnVlKSwgeSh5cChqKSldLCBbeCh4cChqICsgZGlmZiksIHRydWUpLCB5KHlwKGogKyBkaWZmKSldXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGdlbmVyYXRlTShwb2ludHMpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEdlbmVyYXRlXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBkLmxlbmd0aDsgaSsrKSB7XG5cbiAgICAgICAgICAgIC8vIERyYXcgYXMgbm9ybWFsXG4gICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQocmVnaW9ucykgfHwgISBpc1dpdGhpblJlZ2lvbnMoZFtpXS54LCByZWdpb25zKSkge1xuICAgICAgICAgICAgICAgIHMgKz0gXCIgXCIgKyB4VmFsdWUoZFtpXSkgKyBcIiBcIiArIHlWYWx1ZShkW2ldKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIERyYXcgd2l0aCByZWdpb24gLy8gVE9ETzogRml4IGZvciBob3Jpem90YWwgY2hhcnRzXG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB4cCA9ICQkLmdldFNjYWxlKGRbaSAtIDFdLnggKyB4T2Zmc2V0LCBkW2ldLnggKyB4T2Zmc2V0LCAkJC5pc1RpbWVTZXJpZXMoKSk7XG4gICAgICAgICAgICAgICAgeXAgPSAkJC5nZXRTY2FsZShkW2kgLSAxXS52YWx1ZSwgZFtpXS52YWx1ZSk7XG5cbiAgICAgICAgICAgICAgICBkeCA9IHgoZFtpXS54KSAtIHgoZFtpIC0gMV0ueCk7XG4gICAgICAgICAgICAgICAgZHkgPSB5KGRbaV0udmFsdWUpIC0geShkW2kgLSAxXS52YWx1ZSk7XG4gICAgICAgICAgICAgICAgZGQgPSBNYXRoLnNxcnQoTWF0aC5wb3coZHgsIDIpICsgTWF0aC5wb3coZHksIDIpKTtcbiAgICAgICAgICAgICAgICBkaWZmID0gMiAvIGRkO1xuICAgICAgICAgICAgICAgIGRpZmZ4MiA9IGRpZmYgKiAyO1xuXG4gICAgICAgICAgICAgICAgZm9yIChqID0gZGlmZjsgaiA8PSAxOyBqICs9IGRpZmZ4Mikge1xuICAgICAgICAgICAgICAgICAgICBzICs9IHNXaXRoUmVnaW9uKGRbaSAtIDFdLCBkW2ldLCBqLCBkaWZmKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgIC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cuYXhpc19yb3RhdGVkID8gMSA6IDA7XG4gICAgICAgICAgICB2YXIgaW5kZXhZID0gY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiAxO1xuXG4gICAgICAgICAgICB2YXIgcGF0aCA9ICdNICcgKyBwb2ludHNbMF1baW5kZXhYXSArICcsJyArIHBvaW50c1swXVtpbmRleFldICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgJ0wnICsgcG9pbnRzWzFdW2luZGV4WF0gKyAnLCcgKyBwb2ludHNbMV1baW5kZXhZXSArICcgJyArXG4gICAgICAgICAgICAgICAgICAgICdMJyArIHBvaW50c1syXVtpbmRleFhdICsgJywnICsgcG9pbnRzWzJdW2luZGV4WV0gKyAnICcgK1xuICAgICAgICAgICAgICAgICAgICAnTCcgKyBwb2ludHNbM11baW5kZXhYXSArICcsJyArIHBvaW50c1szXVtpbmRleFldICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgJ3onO1xuXG4gICAgICAgICAgICByZXR1cm4gcGF0aDtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlR2V0QmFyUG9pbnRzID0gZnVuY3Rpb24gKGJhckluZGljZXMsIGlzU3ViKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBheGlzID0gaXNTdWIgPyAkJC5zdWJYQXhpcyA6ICQkLnhBeGlzLFxuICAgICAgICAgICAgYmFyVGFyZ2V0c051bSA9IGJhckluZGljZXMuX19tYXhfXyArIDEsXG4gICAgICAgICAgICBiYXJXID0gJCQuZ2V0QmFyVyhheGlzLCBiYXJUYXJnZXRzTnVtKSxcbiAgICAgICAgICAgIGJhclggPSAkJC5nZXRTaGFwZVgoYmFyVywgYmFyVGFyZ2V0c051bSwgYmFySW5kaWNlcywgISFpc1N1YiksXG4gICAgICAgICAgICBiYXJZID0gJCQuZ2V0U2hhcGVZKCEhaXNTdWIpLFxuICAgICAgICAgICAg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BnZXRMaW5lUG9pbnRzO1xuICAgICAgICAgICAgcmV0dXJuIGdldHRlci5jYWxsKCQkLCBnZXRQb2ludHMoZCwgaSksIGQsIHRoaXMpO1xuICAgICAgICB9O1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0WEZvclRleHQgPSBmdW5jdGlvbiAocG9pbnRzLCBkLCB0ZXh0RWxlbWVudCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLFxuICAgICAgICAgICAgYm94ID0gdGV4dEVsZW1lbnQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksIHhQb3MsIHBhZGRpbmc7XG4gICAgICAgIGlmICgkJC5jb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICBwYWRkaW5nID0gJCQuaXNCYXJUeXBlKGQpID8gNCA6IDY7XG4gICAgICAgICAgICB4UG9zID0gcG9pbnRzWzJdWzFdICsgcGFkZGluZyAqIChkLnZhbHVlIDwgMCA/IC0xIDogMSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB4UG9zID0gJCQuaGFzVHlwZSgnYmFyJykgPyAocG9pbnRzWzJdWzBdICsgcG9pbnRzWzBdWzBdKSAvIDIgOiBwb2ludHNbMF1bMF07XG4gICAgICAgIH1cbiAgICAgICAgLy8gc2hvdyBsYWJlbHMgcmVnYXJkbGVzcyBvZiB0aGUgZG9tYWluIGlmIHZhbHVlIGlzIG51bGxcbiAgICAgICAgaWYgKGQudmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgIGlmICh4UG9zID4gJCQud2lkdGgpIHtcbiAgICAgICAgICAgICAgICB4UG9zID0gJCQud2lkdGggLSBib3gud2lkdGg7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHhQb3MgPCAwKSB7XG4gICAgICAgICAgICAgICAgeFBvcyA9IDQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHhQb3M7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXRZRm9yVGV4dCA9IGZ1bmN0aW9uIChwb2ludHMsIGQsIHRleHRFbGVtZW50KSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsXG4gICAgICAgICAgICBib3ggPSB0ZXh0RWxlbWVudC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSxcbiAgICAgICAgICAgIHlQb3M7XG4gICAgICAgIGlmICgkJC5jb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICB5UG9zID0gKHBvaW50c1swXVswXSArIHBvaW50c1syXVswXSArIGJveC5oZWlnaHQgKiAwLjYpIC8gMjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHlQb3MgPSBwb2ludHNbMl1bMV07XG4gICAgICAgICAgICBpZiAoZC52YWx1ZSA8IDAgIHx8IChkLnZhbHVlID09PSAwICYmICEkJC5oYXNQb3NpdGl2ZVZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHlQb3MgKz0gYm94LmhlaWdodDtcbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNCYXJUeXBlKGQpICYmICQkLmlzU2FmYXJpKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgeVBvcyAtPSAzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmICghJCQuaXNCYXJUeXBlKGQpICYmICQkLmlzQ2hyb21lKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgeVBvcyArPSAzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgeVBvcyArPSAkJC5pc0JhclR5cGUoZCkgPyAtMyA6IC02O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIHNob3cgbGFiZWxzIHJlZ2FyZGxlc3Mgb2YgdGhlIGRvbWFpbiBpZiB2YWx1ZSBpcyBudWxsXG4gICAgICAgIGlmIChkLnZhbHVlID09PSBudWxsICYmICEkJC5jb25maWcuYXhpc19yb3RhdGVkKSB7XG4gICAgICAgICAgICBpZiAoeVBvcyA8IGJveC5oZWlnaHQpIHtcbiAgICAgICAgICAgICAgICB5UG9zID0gYm94LmhlaWdodDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoeVBvcyA+IHRoaXMuaGVpZ2h0KSB7XG4gICAgICAgICAgICAgICAgeVBvcyA9IHRoaXMuaGVpZ2h0IC0gNDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geVBvcztcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uc2V0VGFyZ2V0VHlwZSA9IGZ1bmN0aW9uICh0YXJnZXRJZHMsIHR5cGUpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICAkJC5tYXBUb1RhcmdldElkcyh0YXJnZXRJZHMpLmZvckVhY2goZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAkJC53aXRob3V0RmFkZUluW2lkXSA9ICh0eXBlID09PSBjb25maWcuZGF0YV90eXBlc1tpZF0pO1xuICAgICAgICAgICAgY29uZmlnLmRhdGFfdHlwZXNbaWRdID0gdHlwZTtcbiAgICAgICAgfSk7XG4gICAgICAgIGlmICghdGFyZ2V0SWRzKSB7XG4gICAgICAgICAgICBjb25maWcuZGF0YV90eXBlID0gdHlwZTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaGFzVHlwZSA9IGZ1bmN0aW9uICh0eXBlLCB0YXJnZXRzKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIHR5cGVzID0gJCQuY29uZmlnLmRhdGFfdHlwZXMsIGhhcyA9IGZhbHNlO1xuICAgICAgICB0YXJnZXRzID0gdGFyZ2V0cyB8fCAkJC5kYXRhLnRhcmdldHM7XG4gICAgICAgIGlmICh0YXJnZXRzIC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bmNob3IpXG4gICAgICAgICAgICAuYXR0cihcInRyYW5zZm9ybVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gXCJyb3RhdGUoLTkwKVwiIDogXCJcIilcbiAgICAgICAgICAgIC5hdHRyKCdkeCcsICQkLmdyaWRUZXh0RHgpXG4gICAgICAgICAgICAuYXR0cignZHknLCAtNSlcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMCk7XG4gICAgICAgIC8vIHVwZGF0ZVxuICAgICAgICB5diA9ICQkLnl2LmJpbmQoJCQpO1xuICAgICAgICAkJC55Z3JpZExpbmVzLnNlbGVjdCgnbGluZScpXG4gICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5hdHRyKFwieDFcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IHl2IDogMClcbiAgICAgICAgICAgIC5hdHRyKFwieDJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IHl2IDogJCQud2lkdGgpXG4gICAgICAgICAgICAuYXR0cihcInkxXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAwIDogeXYpXG4gICAgICAgICAgICAuYXR0cihcInkyXCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC5oZWlnaHQgOiB5dilcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMSk7XG4gICAgICAgICQkLnlncmlkTGluZXMuc2VsZWN0KCd0ZXh0JylcbiAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKGR1cmF0aW9uKVxuICAgICAgICAgICAgLmF0dHIoXCJ4XCIsIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyAkJC54R3JpZFRleHRYLmJpbmQoJCQpIDogJCQueUdyaWRUZXh0WC5iaW5kKCQkKSlcbiAgICAgICAgICAgIC5hdHRyKFwieVwiLCB5dilcbiAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uIChkKSB7IHJldHVybiBkLnRleHQ7IH0pXG4gICAgICAgICAgICAuc3R5bGUoXCJvcGFjaXR5XCIsIDEpO1xuICAgICAgICAvLyBleGl0XG4gICAgICAgICQkLnlncmlkTGluZXMuZXhpdCgpLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMClcbiAgICAgICAgICAgIC5yZW1vdmUoKTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnJlZHJhd0dyaWQgPSBmdW5jdGlvbiAod2l0aFRyYW5zaXRpb24pIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLCB4diA9ICQkLnh2LmJpbmQoJCQpLFxuICAgICAgICAgICAgbGluZXMgPSAkJC54Z3JpZExpbmVzLnNlbGVjdCgnbGluZScpLFxuICAgICAgICAgICAgdGV4dHMgPSAkJC54Z3JpZExpbmVzLnNlbGVjdCgndGV4dCcpO1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgKHdpdGhUcmFuc2l0aW9uID8gbGluZXMudHJhbnNpdGlvbigpIDogbGluZXMpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ4MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gMCA6IHh2KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieDJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoIDogeHYpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ5MVwiLCBjb25maWcuYXhpc19yb3RhdGVkID8geHYgOiAwKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieTJcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IHh2IDogJCQuaGVpZ2h0KVxuICAgICAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMSksXG4gICAgICAgICAgICAod2l0aFRyYW5zaXRpb24gPyB0ZXh0cy50cmFuc2l0aW9uKCkgOiB0ZXh0cylcbiAgICAgICAgICAgICAgICAuYXR0cihcInhcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLnlHcmlkVGV4dFguYmluZCgkJCkgOiAkJC54R3JpZFRleHRYLmJpbmQoJCQpKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwieVwiLCB4dilcbiAgICAgICAgICAgICAgICAudGV4dChmdW5jdGlvbiAoZCkgeyByZXR1cm4gZC50ZXh0OyB9KVxuICAgICAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgMSlcbiAgICAgICAgXTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLnNob3dYR3JpZEZvY3VzID0gZnVuY3Rpb24gKHNlbGVjdGVkRGF0YSkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBkYXRhVG9TaG93ID0gc2VsZWN0ZWREYXRhLmZpbHRlcihmdW5jdGlvbiAoZCkgeyByZXR1cm4gZCAmJiBpc1ZhbHVlKGQudmFsdWUpOyB9KSxcbiAgICAgICAgICAgIGZvY3VzRWwgPSAkJC5tYWluLnNlbGVjdEFsbCgnbGluZS4nICsgQ0xBU1MueGdyaWRGb2N1cyksXG4gICAgICAgICAgICB4eCA9ICQkLnh4LmJpbmQoJCQpO1xuICAgICAgICBpZiAoISBjb25maWcudG9vbHRpcF9zaG93KSB7IHJldHVybjsgfVxuICAgICAgICAvLyBIaWRlIHdoZW4gc2NhdHRlciBwbG90IGV4aXN0c1xuICAgICAgICBpZiAoJCQuaGFzVHlwZSgnc2NhdHRlcicpIHx8ICQkLmhhc0FyY1R5cGUoKSkgeyByZXR1cm47IH1cbiAgICAgICAgZm9jdXNFbFxuICAgICAgICAgICAgLnN0eWxlKFwidmlzaWJpbGl0eVwiLCBcInZpc2libGVcIilcbiAgICAgICAgICAgIC5kYXRhKFtkYXRhVG9TaG93WzBdXSlcbiAgIC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lkRGF0YSA9IFtdLCB4RG9tYWluLCBmaXJzdFllYXIsIGxhc3RZZWFyLCBpLFxuICAgICAgICAgICAgdGlja051bSA9ICQkLm1haW4uc2VsZWN0KFwiLlwiICsgQ0xBU1MuYXhpc1gpLnNlbGVjdEFsbCgnLnRpY2snKS5zaXplKCk7XG4gICAgICAgIGlmICh0eXBlID09PSAneWVhcicpIHtcbiAgICAgICAgICAgIHhEb21haW4gPSAkJC5nZXRYRG9tYWluKCk7XG4gICAgICAgICAgICBmaXJzdFllYXIgPSB4RG9tYWluWzBdLmdldEZ1bGxZZWFyKCk7XG4gICAgICAgICAgICBsYXN0WWVhciA9IHhEb21haW5bMV0uZ2V0RnVsbFllYXIoKTtcbiAgICAgICAgICAgIGZvciAoaSA9IGZpcnN0WWVhcjsgaSA8PSBsYXN0WWVhcjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgZ3JpZERhdGEucHVzaChuZXcgRGF0ZShpICsgJy0wMS0wMSAwMDowMDowMCcpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGdyaWREYXRhID0gc2NhbGUudGlja3MoMTApO1xuICAgICAgICAgICAgaWYgKGdyaWREYXRhLmxlbmd0aCA+IHRpY2tOdW0pIHsgLy8gdXNlIG9ubHkgaW50XG4gICAgICAgICAgICAgICAgZ3JpZERhdGEgPSBncmlkRGF0YS5maWx0ZXIoZnVuY3Rpb24gKGQpIHsgcmV0dXJuIChcIlwiICsgZCkuaW5kZXhPZignLicpIDwgMDsgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGdyaWREYXRhO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uZ2V0R3JpZEZpbHRlclRvUmVtb3ZlID0gZnVuY3Rpb24gKHBhcmFtcykge1xuICAgICAgICByZXR1cm4gcGFyYW1zID8gZnVuY3Rpb24gKGxpbmUpIHtcbiAgICAgICAgICAgIH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luaXRfeCkpIHtcbiAgICAgICAgICAgICAgICBjb25maWcudG9vbHRpcF9pbml0X3ggPSAkJC5wYXJzZURhdGUoY29uZmlnLnRvb2x0aXBfaW5pdF94KTtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXNbaV0ueCAtIGNvbmZpZy50b29sdGlwX2luaXRfeCkgPT09IDApIHsgYnJlYWs7IH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY29uZmlnLnRvb2x0aXBfaW5pdF94ID0gaTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICQkLnRvb2x0aXAuaHRtbChjb25maWcudG9vbHRpcF9jb250ZW50cy5jYWxsKCQkLCAkJC5kYXRhLnRhcmdldHMubWFwKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICQkLmFkZE5hbWUoZC52YWx1ZXNbY29uZmlnLnRvb2x0aXBfaW5pdF94XSk7XG4gICAgICAgICAgICB9KSwgJCQuYXhpcy5nZXRYQXhpc1RpY2tGb3JtYXQoKSwgJCQuZ2V0WUZvcm1hdCgkJC5oYXNBcmNUeXBlKCkpLCAkJC5jb2xvcikpO1xuICAgICAgICAgICAgJCQudG9vbHRpcC5zdHlsZShcInRvcFwiLCBjb25maWcudG9vbHRpcF9pbml0X3Bvc2l0aW9uLnRvcClcbiAgICAgICAgICAgICAgICAuc3R5bGUoXCJsZWZ0XCIsIGNvbmZpZy50b29sdGlwX2luaXRfcG9zaXRpb24ubGVmdClcbiAgICAgICAgICAgICAgICAuc3R5bGUoXCJkaXNwbGF5XCIsIFwiYmxvY2tcIik7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFRvb2x0aXBDb250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gZC5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcbiAgICAgICAgICAgICAgICB2YXIgdjEgPSBhID8gYS52YWx1ZSA6IG51bGwsIHYyID0gYiA/IGIudmFsdWUgOiBudWxsO1xuICAgICAgICAgICAgICAgIGlmICh2MSA+IDAgJiYgdjIgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHYxID0gYSA/IGlkcy5pbmRleE9mKGEuaWQpIDogbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgdjIgPSBiID8gaWRzLmluZGV4T2YoYi5pZCkgOiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gb3JkZXJBc2MgPyB2MSAtIHYyIDogdjIgLSB2MTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGQubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmICghIChkW2ldICYmIChkW2ldLnZhbHVlIHx8IGRbaV0udmFsdWUgPT09IDApKSkgeyBjb250aW51ZTsgfVxuXG4gICAgICAgICAgICBpZiAoISB0ZXh0KSB7XG4gICAgICAgICAgICAgICAgdGl0bGUgPSBzYW5pdGlzZSh0aXRsZUZvcm1hdCA/IHRpdGxlRm9ybWF0KGRbaV0ueCkgOiBkW2ldLngpO1xuICAgICAgICAgICAgICAgIHRleHQgPSBcIjx0YWJsZSBjbGFzcz0nXCIgKyAkJC5DTEFTUy50b29sdGlwICsgXCInPlwiICsgKHRpdGxlIHx8IHRpdGxlID09PSAwID8gXCI8dHI+PHRoIGNvbHNwYW49JzInPlwiICsgdGl0bGUgKyBcIjwvdGg+PC90cj5cIiA6IFwiXCIpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YWx1ZSA9IHNhbml0aXNlKHZhbHVlRm9ybWF0KGRbaV0udmFsdWUsIGRbaV0ucmF0aW8sIGRbaV0uaWQsIGRbaV0uaW5kZXgsIGQpKTtcbiAgIC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YgKCQkLmQzLmV2ZW50LmFsdEtleSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuYXBpLmhpZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmFwaS5zaG93KGlkKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICQkLmFwaS50b2dnbGUoaWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuaXNUYXJnZXRUb1Nob3coaWQpID8gJCQuYXBpLmZvY3VzKGlkKSA6ICQkLmFwaS5yZXZlcnQoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgICAgIGlmIChjb25maWcubGVnZW5kX2l0ZW1fb25tb3VzZW92ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmxlZ2VuZF9pdGVtX29ubW91c2VvdmVyLmNhbGwoJCQsIGlkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICQkLmQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKENMQVNTLmxlZ2VuZEl0ZW1Gb2N1c2VkLCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEkJC50cmFuc2l0aW5nICYmICQkLmlzVGFyZ2V0VG9TaG93KGlkKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQuYXBpLmZvY3VzKGlkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5sZWdlbmRfaXRlbV9vbm1vdXN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AoYXhpc0lkID09PSAneCcpIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc194X2xhYmVsID0gdGV4dDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChvcHRpb24pIHtcbiAgICAgICAgICAgIG9wdGlvbi50ZXh0ID0gdGV4dDtcbiAgICAgICAgfVxuICAgIH07XG4gICAgQXhpcy5wcm90b3R5cGUuZ2V0TGFiZWxQb3NpdGlvbiA9IGZ1bmN0aW9uIGdldExhYmVsUG9zaXRpb24oYXhpc0lkLCBkZWZhdWx0UG9zaXRpb24pIHtcbiAgICAgICAgdmFyIG9wdGlvbiA9IHRoaXMuZ2V0TGFiZWxPcHRpb25CeUF4aXNJZChheGlzSWQpLFxuICAgICAgICAgICAgcG9zaXRpb24gPSAob3B0aW9uICYmIHR5cGVvZiBvcHRpb24gPT09ICdvYmplY3QnICYmIG9wdGlvbi5wb3NpdGlvbikgPyBvcHRpb24ucG9zaXRpb24gOiBkZWZhdWx0UG9zaXRpb247XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBpc0lubmVyOiBwb3NpdGlvbi5pbmRleE9mKCdpbm5lcicpID49IDAsXG4gICAgICAgICAgICBpc091dGVyOiBwb3NpdGlvbi5pbmRleE9mKCdvdXRlcicpID49IDAsXG4gICAgICAgICAgICBpc0xlZnQ6IHBvc2l0aW9uLmluZGV4T2YoJ2xlZnQnKSA+PSAwLFxuICAgICAgICAgICAgaXNDZW50ZXI6IHBvc2l0aW9uLmluZGV4T2YoJ2NlbnRlcicpID49IDAsXG4gICAgICAgICAgICBpc1JpZ2h0OiBwb3NpdGlvbi5pbmRleE9mKCdyaWdodCcpID49IDAsXG4gICAgICAgICAgICBpc1RvcDogcG9zaXRpb24uaW5kZXhPZigndG9wJykgPj0gMCxcbiAgICAgICAgICAgIGlzTWlkZGxlOiBwb3NpdGlvbi5pbmRleE9mKCdtaWRkbGUnKSA+PSAwLFxuICAgICAgICAgICAgaXNCb3R0b206IHBv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LCAwKS5zdHlsZSgnbGVmdCcsIDApLFxuICAgICAgICAgICAgc3ZnLmFwcGVuZCgnZycpLmNhbGwoYXhpcykuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgJCQuZDMuc2VsZWN0KHRoaXMpLnNlbGVjdEFsbCgndGV4dCcpLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYm94ID0gdGhpcy5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1heFdpZHRoIDwgYm94LndpZHRoKSB7IG1heFdpZHRoID0gYm94LndpZHRoOyB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgZHVtbXkucmVtb3ZlKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAkJC5jdXJyZW50TWF4VGlja1dpZHRoc1tpZF0gPSBtYXhXaWR0aCA8PSAwID8gJCQuY3VycmVudE1heFRpY2tXaWR0aHNbaWRdIDogbWF4V2lkdGg7XG4gICAgICAgIHJldHVybiAkJC5jdXJyZW50TWF4VGlja1dpZHRoc1tpZF07XG4gICAgfTtcblxuICAgIEF4aXMucHJvdG90eXBlLnVwZGF0ZUxhYmVscyA9IGZ1bmN0aW9uIHVwZGF0ZUxhYmVscyh3aXRoVHJhbnNpdGlvbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLm93bmVyO1xuICAgICAgICB2YXIgYXhpc1hMYWJlbCA9ICQkLm1haW4uc2VsZWN0KCcuJyArIENMQVNTLmF4aXNYICsgJyAuJyArIENMQVNTLmF4aXNYTGFiZWwpLFxuICAgICAgICAgICAgYXhpc1lMYWJlbCA9ICQkLm1haW4uc2VsZWN0KCcuJyArIENMQVNTLmF4aXNZICsgJyAuJyArIENMQVNTLmF4aXNZTGFiZWwpLFxuICAgICAgICAgICAgYXhpc1kyTGFiZWwgPSAkJC5tYWluLnNlbGVjdCgnLicgK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9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgJCQuc3ZnQXJjID0gJCQuZ2V0U3ZnQXJjKCk7XG4gICAgICAgICQkLnN2Z0FyY0V4cGFuZGVkID0gJCQuZ2V0U3ZnQXJjRXhwYW5kZWQoKTtcbiAgICAgICAgJCQuc3ZnQXJjRXhwYW5kZWRTdWIgPSAkJC5nZXRTdmdBcmNFeHBhbmRlZCgwLjk4KTtcbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4udXBkYXRlQW5nbGUgPSBmdW5jdGlvbiAoZCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBmb3VuZCA9IGZhbHNlLCBpbmRleCA9IDAsXG4gICAgICAgICAgICBnTWluLCBnTWF4LCBnVGljLCBnVmFsdWU7XG5cbiAgICAgICAgaWYgKCFjb25maWcpIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgJCQucGllKCQkLmZpbHRlclRhcmdldHNUb1Nob3coJCQuZGF0YS50YXJnZXRzKSkuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgaWYgKCEgZm91bmQgJiYgdC5kYXRhLmlkID09PSBkLmRhdGEuaWQpIHtcbiAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgZCA9IHQ7XG4gICAgICAgICAgICAgICAgZC5pbmRleCA9IGluZGV4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaW5kZXgrKztcbiAgICAgICAgfSk7XG4gICAgICAgIGlmIChpc05hTihkLnN0YXJ0QW5nbGUpKSB7XG4gICAgICAgICAgICBkLnN0YXJ0QW5nbGUgPSAwO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc05hTihkLmVuZEFuZ2xlKSkge1xuICAgICAgICAgICAgZC5lbmRBbm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LmMzLWxlZ2VuZC1pdGVtLWZvY3VzZWQnKS5zaXplKCkgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkJC5leHBhbmRBcmModGFyZ2V0SWRzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sIDEwKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRhcmdldElkcyA9ICQkLm1hcFRvVGFyZ2V0SWRzKHRhcmdldElkcyk7XG5cbiAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgkJC5zZWxlY3RvclRhcmdldHModGFyZ2V0SWRzLCAnLicgKyBDTEFTUy5jaGFydEFyYykpLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgIGlmICghICQkLnNob3VsZEV4cGFuZChkLmRhdGEuaWQpKSB7IHJldHVybjsgfVxuICAgICAgICAgICAgJCQuZDMuc2VsZWN0KHRoaXMpLnNlbGVjdEFsbCgncGF0aCcpXG4gICAgICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbigkJC5leHBhbmREdXJhdGlvbihkLmRhdGEuaWQpKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCAkJC5zdmdBcmNFeHBhbmRlZClcbiAgICAgICAgICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKCQkLmV4cGFuZER1cmF0aW9uKGQuZGF0YS5pZCkgKiAyKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCAkJC5zdmdBcmNFeHBhbmRlZFN1YilcbiAgICAgICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJCQuaXNEb251dFR5cGUoZC5kYXRhKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2FsbGJhY2sgaGVyZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIC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sZSgwKVwiIDogXCJcIjsgfSlcbiAgICAgICAgICAgIC5zdHlsZShcIm9wYWNpdHlcIiwgZnVuY3Rpb24gKGQpIHsgcmV0dXJuIGQgPT09IHRoaXMuX2N1cnJlbnQgPyAwIDogMTsgfSlcbiAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgY29uZmlnLmludGVyYWN0aW9uX2VuYWJsZWQgPyBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkLCBhcmNEYXRhO1xuICAgICAgICAgICAgICAgIGlmICgkJC50cmFuc2l0aW5nKSB7IC8vIHNraXAgd2hpbGUgdHJhbnNpdGluZ1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKTtcbiAgICAgICAgICAgICAgICBpZiAodXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBhcmNEYXRhID0gJCQuY29udmVydFRvQXJjRGF0YSh1cGRhdGVkKTtcbiAgICAgICAgICAgICAgICAgICAgLy8gdHJhbnNpdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgJCQuZXhwYW5kQXJjKHVwZGF0ZWQuZGF0YS5pZCk7XG4gICAgICAgICAgICAgICAgICAgICQkLmFwaS5mb2N1cyh1cGRhdGVkLmRhdGEuaWQpO1xuICAgICAgICAgICAgICAgICAgICAkJC50b2dnbGVGb2N1c0xlZ2VuZCh1cGRhdGVkLmRhdGEuaWQsIHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAkJC5jb25maWcuZGF0YV9vbm1vdXNlb3ZlcihhcmNEYXRhLCB0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IDogbnVsbClcbiAgICAgICAgICAgIC5vbignbW91c2Vtb3ZlJywgY29uZmlnLmludGVyYWN0aW9uX2VuYWJsZWQgPyBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCksIGFyY0RhdGEsIHNlbGVjdGVkRGF0YTtcbiAgICAgICAgICAgICAgICBpZiAodXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICBhcmNEYXRhID0gJCQuY29udmVydFRvQXJjRGF0YSh1cGRhdGVkKSxcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRhID0gW2FyY0RhdGFdO1xuICAgICAgICAgICAgICAgICAgICAkJC5zaG93VG9vbHRpcChzZWxlY3RlZERhdGEsIHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gOiBudWxsKVxuICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGNvbmZpZy5pbnRlcmFjdGlvbl9lbmFibGVkID8gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgdXBkYXRlZCwgYXJjRGF0YTtcbiAgICAgICAgICAgICAgICBpZiAoJCQudHJhbnNpdGluZykgeyAvLyBza2lwIHdoaWxlIHRyYW5zaXRpbmdcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCk7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIHRyYW5zaXRpb25zXG4gICAgICAgICAgICAgICAgICAgICQkLnVuZXhwYW5kQXJjKHVwZGF0ZWQuZGF0YS5pZCk7XG4gICAgICAgICAgICAgICAgICAgICQkLmFwaS5yZXZlcnQoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQucmV2ZXJ0TGVnZW5kKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLmhpZGVUb29sdGlwKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLmNvbmZpZy5kYXRhX29ubW91c2VvdXQoYXJjRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSA6IG51bGwpXG4gICAgICAgICAgICAub24oJ2NsaWNrJywgY29uZmlnLmludGVyYWN0aW9uX2VuYWJsZWQgPyBmdW5jdGlvbiAoZCwgaSkge1xuICAgICAgICAgICAgICAgIHZhciB1cGRhdGVkID0gJCQudXBkYXRlQW5nbGUoZCksIGFyY0RhdGE7XG4gICAgICAgICAgICAgICAgaWYgKHVwZGF0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXJjRGF0YSA9ICQkLmNvbnZlcnRUb0FyY0RhdGEodXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkJC50b2dnbGVTaGFwZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJCQudG9nZ2xlU2hhcGUodGhpcywgYXJjRGF0YSwgaSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgJCQuY29uZmlnLmRhdGFfb25jbGljay5jYWxsKCQkLmFwaSwgYXJjRGF0YSwgdGhpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSA6IG51bGwpXG4gICAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoKSB7ICQkLnRyYW5zaXRpbmcgPSB0cnVlOyB9KVxuICAgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkdXJhdGlvbilcbiAgICAgICAgICAgIC5hdHRyVHdlZW4oXCJkXCIsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVwZGF0ZWQgPSAkJC51cGRhdGVBbmdsZShkKSwgaW50ZXJwb2xhdGU7XG4gICAgICAgICAgICAgICAgaWYgKCEgdXBkYXRlZCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkgeyByZXR1cm4gXCJNIDAgMFwiOyB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudCA9PT0gZCkge1xuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50ID0ge1xuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRBbmdsZTogTWF0aC5QSSoyLFxuICAgICAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICAgZW5kQW5nbGU6IE1hdGguUEkqMixcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAvLyAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKHRoaXMuX2N1cnJlbnQuc3RhcnRBbmdsZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudC5zdGFydEFuZ2xlID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKHRoaXMuX2N1cnJlbnQuZW5kQW5nbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQuZW5kQW5nbGUgPSB0aGlzLl9jdXJyZW50LnN0YXJ0QW5nbGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGludGVycG9sYXRlID0gZDMuaW50ZXJwb2xhdGUodGhpcy5fY3VycmVudCwgdXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudCA9IGludGVycG9sYXRlKDApO1xuICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgaW50ZXJwb2xhdGVkID0gaW50ZXJwb2xhdGUodCk7XG4gICAgICAgICAgICAgICAgICAgIGludGVycG9sYXRlZC5kYXRhID0gZC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odGhpcy5wYXJlbnROb2RlKS5kYXR1bSgpO1xuICAgICAgICAgICAgICAgICQkLmQzLnNlbGVjdCh0aGlzKS5kYXR1bShwYXJlbnREYXRhKTtcbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgeCA9ICQkLnJlZ2lvblguYmluZCgkJCksXG4gICAgICAgICAgICB5ID0gJCQucmVnaW9uWS5iaW5kKCQkKSxcbiAgICAgICAgICAgIHcgPSAkJC5yZWdpb25XaWR0aC5iaW5kKCQkKSxcbiAgICAgICAgICAgIGggPSAkJC5yZWdpb25IZWlnaHQuYmluZCgkJCk7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAod2l0aFRyYW5zaXRpb24gPyByZWdpb25zLnRyYW5zaXRpb24oKSA6IHJlZ2lvbnMpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ4XCIsIHgpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ5XCIsIHkpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJ3aWR0aFwiLCB3KVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiaGVpZ2h0XCIsIGgpXG4gICAgICAgICAgICAgICAgLnN0eWxlKFwiZmlsbC1vcGFjaXR5XCIsIGZ1bmN0aW9uIChkKSB7IHJldHVybiBpc1ZhbHVlKGQub3BhY2l0eSkgPyBkLm9wYWNpdHkgOiAwLjE7IH0pXG4gICAgICAgIF07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5yZWdpb25YID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgeFBvcywgeVNjYWxlID0gZC5heGlzID09PSAneScgPyAkJC55IDogJCQueTI7XG4gICAgICAgIGlmIChkLmF4aXMgPT09ICd5JyB8fCBkLmF4aXMgPT09ICd5MicpIHtcbiAgICAgICAgICAgIHhQb3MgPSBjb25maWcuYXhpc19yb3RhdGVkID8gK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UxFQ1RFRCksXG4gICAgICAgICAgICAgICAgICAgIGlzSW5jbHVkZWQgPSBzaGFwZS5jbGFzc2VkKENMQVNTLklOQ0xVREVEKSxcbiAgICAgICAgICAgICAgICAgICAgX3gsIF95LCBfdywgX2gsIHRvZ2dsZSwgaXNXaXRoaW4gPSBmYWxzZSwgYm94O1xuICAgICAgICAgICAgICAgIGlmIChzaGFwZS5jbGFzc2VkKENMQVNTLmNpcmNsZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgX3ggPSBzaGFwZS5hdHRyKFwiY3hcIikgKiAxO1xuICAgICAgICAgICAgICAgICAgICBfeSA9IHNoYXBlLmF0dHIoXCJjeVwiKSAqIDE7XG4gICAgICAgICAgICAgICAgICAgIHRvZ2dsZSA9ICQkLnRvZ2dsZVBvaW50O1xuICAgICAgICAgICAgICAgICAgICBpc1dpdGhpbiA9IG1pblggPCBfeCAmJiBfeCA8IG1heFggJiYgbWluWSA8IF95ICYmIF95IDwgbWF4WTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hhcGUuY2xhc3NlZChDTEFTUy5iYXIpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJveCA9IGdldFBhdGhCb3godGhpcyk7XG4gICAgICAgICAgICAgICAgICAgIF94ID0gYm94Lng7XG4gICAgICAgICAgICAgICAgICAgIF95ID0gYm94Lnk7XG4gICAgICAgICAgICAgICAgICAgIF93ID0gYm94LndpZHRoO1xuICAgICAgICAgICAgICAgICAgICBfaCA9IGJveC5oZWlnaHQ7XG4gICAgICAgICAgICAgICAgICAgIHRvZ2dsZSA9ICQkLnRvZ2dsZVBhdGg7XG4gICAgICAgICAgICAgICAgICAgIGlzV2l0aGluID0gIShtYXhYIDwgX3ggfHwgX3ggKyBfdyA8IG1pblgpICYmICEobWF4WSA8IF95IHx8IF95ICsgX2ggPCBtaW5ZKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBsaW5lL2FyZWEgc2VsZWN0aW9uIG5vdCBzdXBwb3J0ZWQgeWV0XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGlzV2l0aGluIF4gaXNJbmNsdWRlZCkge1xuICAgICAgICAgICAgICAgICAgICBzaGFwZS5jbGFzc2VkKENMQVNTLklOQ0xVREVELCAhaXNJbmNsdWRlZCk7XG4gICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IGluY2x1ZGVkL3VuaW5jbHVkZWQgY2FsbGJhY2sgaGVyZVxuICAgICAgICAgICAgICAgICAgICBzaGFwZS5jbGFzc2VkKENMQVNTLlNFTEVDVEVELCAhaXNTZWxlY3RlZCk7XG4gICAgICAgICAgICAgICAgICAgIHRvZ2dsZS5jYWxsKCQkLCAhaXNTZWxlY3RlZCwgc2hhcGUsIGQsIGkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5kcmFnc3RhcnQgPSBmdW5jdGlvbiAobW91c2UpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICBpZiAoJCQuaGFzQXJjVHlwZSgpKSB7IHJldHVybjsgfVxuICAgICAgICBpZiAoISBjb25maWcuZGF0YV9zZWxlY3Rpb25fZW5hYmxlZCkgeyByZXR1cm47IH0gLy8gZG8gbm90aGluZyBpZiBub3Qgc2VsZWN0YWJsZVxuICAgICAgICAkJC5kcmFnU3RhcnQgPSBtb3VzZTtcbiAgICAgICAgJCQubWFpbi5zZWxlY3QoJy4nICsgQ0xBU1MuY2hhcnQpLmFwcGVuZCgncmVjdCcpXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCBDTEFTUy5kcmFnYXJlYSlcbiAgICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDAuMSk7XG4gICAgIC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NsYXNzQ2hhcnRCYXIuYmluZCgkJCksXG4gICAgICAgICAgICBjbGFzc0JhcnMgPSAkJC5jbGFzc0JhcnMuYmluZCgkJCksXG4gICAgICAgICAgICBjbGFzc0NoYXJ0TGluZSA9ICQkLmNsYXNzQ2hhcnRMaW5lLmJpbmQoJCQpLFxuICAgICAgICAgICAgY2xhc3NMaW5lcyA9ICQkLmNsYXNzTGluZXMuYmluZCgkJCksXG4gICAgICAgICAgICBjbGFzc0FyZWFzID0gJCQuY2xhc3NBcmVhcy5iaW5kKCQkKTtcblxuICAgICAgICBpZiAoY29uZmlnLnN1YmNoYXJ0X3Nob3cpIHtcbiAgICAgICAgICAgIC8vLS0gQmFyIC0tLy9cbiAgICAgICAgICAgIGNvbnRleHRCYXJVcGRhdGUgPSBjb250ZXh0LnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydEJhcnMpLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5jaGFydEJhcilcbiAgICAgICAgICAgICAgICAuZGF0YSh0YXJnZXRzKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGNsYXNzQ2hhcnRCYXIpO1xuICAgICAgICAgICAgY29udGV4dEJhckVudGVyID0gY29udGV4dEJhclVwZGF0ZS5lbnRlcigpLmFwcGVuZCgnZycpXG4gICAgICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMClcbiAgICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCBjbGFzc0NoYXJ0QmFyKTtcbiAgICAgICAgICAgIC8vIEJhcnMgZm9yIGVhY2ggZGF0YVxuICAgICAgICAgICAgY29udGV4dEJhckVudGVyLmFwcGVuZCgnZycpXG4gICAgICAgICAgICAgICAgLmF0dHIoXCJjbGFzc1wiLCBjbGFzc0JhcnMpO1xuXG4gICAgICAgICAgICAvLy0tIExpbmUgLS0vL1xuICAgICAgICAgICAgY29udGV4dExpbmVVcGRhdGUgPSBjb250ZXh0LnNlbGVjdCgnLicgKyBDTEFTUy5jaGFydExpbmVzKS5zZWxlY3RBbGwoJy4nICsgQ0xBU1MuY2hhcnRMaW5lKVxuICAgICAgICAgICAgICAgIC5kYXRhKHRhcmdldHMpXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgY2xhc3NDaGFydExpbmUpO1xuICAgICAgICAgICAgY29udGV4dExpbmVFbnRlciA9IGNvbnRleHRMaW5lVXBkYXRlLmVudGVyKCkuYXBwZW5kKCdnJylcbiAgICAgICAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAwKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGNsYXNzQ2hhcnRMaW5lKTtcbiAgICAgICAgICAgIC8vIExpbmVzIGZvciBlYWNoIGRhdGFcbiAgICAgICAgICAgIGNvbnRleHRMaW5lRW50ZXIuYXBwZW5kKFwiZ1wiKVxuICAgICAgICAgICAgICAgIC5hdHRyKFwiY2xhc3NcIiwgY2xhc3NMaW5lcyk7XG4gICAgICAgICAgICAvLyBBcmVhXG4gICAgICAgICAgICBjb250ZXh0TGluZUVudGVyLmFwcGVuZChcImdcIilcbiAgICAgICAgICAgICAgICAuYXR0cihcImNsYXNzXCIsIGNsYXNzQXJlYXMpO1xuXG4gICAgICAgICAgICAvLy0tIEJydXNoIC0tLy9cbiAgICAgICAgICAgIGNvbnRleHQuc2VsZWN0QWxsKCcuJyArIENMQVNTLmJydXNoICsgJyByZWN0JylcbiAgICAgICAgICAgICAgICAuYXR0cihjb25maWcuYXhpc19yb3RhdGVkID8gXCJ3aWR0aFwiIDogXCJoZWlnaHRcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoMiA6ICQkLmhlaWdodDIpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVCYXJGb3JTdWJjaGFydCA9IGZ1bmN0aW9uIChkdXJhdGlvbkZvckV4aXQpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcztcbiAgICAgICAgJ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7XG4gICAgICAgICAgICAgICAgJCQuYnJ1c2guZXh0ZW50KCQkLngub3JnRG9tYWluKCkpLnVwZGF0ZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gdXBkYXRlIHN1YmNoYXJ0IGVsZW1lbnRzIGlmIG5lZWRlZFxuICAgICAgICAgICAgaWYgKHdpdGhTdWJjaGFydCkge1xuXG4gICAgICAgICAgICAgICAgLy8gZXh0ZW50IHJlY3RcbiAgICAgICAgICAgICAgICBpZiAoISQkLmJydXNoLmVtcHR5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQuYnJ1c2guZXh0ZW50KCQkLngub3JnRG9tYWluKCkpLnVwZGF0ZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBzZXR1cCBkcmF3ZXIgLSBNRU1POiB0aGlzIG11c3QgYmUgY2FsbGVkIGFmdGVyIGF4aXMgdXBkYXRlZFxuICAgICAgICAgICAgICAgIGRyYXdBcmVhT25TdWIgPSAkJC5nZW5lcmF0ZURyYXdBcmVhKGFyZWFJbmRpY2VzLCB0cnVlKTtcbiAgICAgICAgICAgICAgICBkcmF3QmFyT25TdWIgPSAkJC5nZW5lcmF0ZURyYXdCYXIoYmFySW5kaWNlcywgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgZHJhd0xpbmVPblN1YiA9ICQkLmdlbmVyYXRlRHJhd0xpbmUobGluZUluZGljZXMsIHRydWUpO1xuXG4gICAgICAgICAgICAgICAgJCQudXBkYXRlQmFyRm9yU3ViY2hhcnQoZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICQkLnVwZGF0ZUxpbmVGb3JTdWJjaGFydChkdXJhdGlvbik7XG4gICAgICAgICAgICAgICAgJCQudXBkYXRlQXJlYUZvclN1YmNoYXJ0KGR1cmF0aW9uKTtcblxuICAgICAgICAgICAgICAgICQkLnJlZHJhd0JhckZvclN1YmNoYXJ0KGRyYXdCYXJPblN1YiwgZHVyYXRpb24sIGR1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YlhBeGlzID0gJCQuY29udGV4dC5zZWxlY3QoJy4nICsgQ0xBU1MuYXhpc1gpO1xuICAgICAgICAgICAgaWYgKHdpdGhUcmFuc2l0aW9uKSB7IHN1YlhBeGlzID0gc3ViWEF4aXMudHJhbnNpdGlvbigpOyB9XG4gICAgICAgIH1cbiAgICAgICAgJCQuY29udGV4dC5hdHRyKFwidHJhbnNmb3JtXCIsICQkLmdldFRyYW5zbGF0ZSgnY29udGV4dCcpKTtcbiAgICAgICAgc3ViWEF4aXMuYXR0cihcInRyYW5zZm9ybVwiLCAkJC5nZXRUcmFuc2xhdGUoJ3N1YngnKSk7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5nZXREZWZhdWx0RXh0ZW50ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCBjb25maWcgPSAkJC5jb25maWcsXG4gICAgICAgICAgICBleHRlbnQgPSBpc0Z1bmN0aW9uKGNvbmZpZy5heGlzX3hfZXh0ZW50KSA/IGNvbmZpZy5heGlzX3hfZXh0ZW50KCQkLmdldFhEb21haW4oJCQuZGF0YS50YXJnZXRzKSkgOiBjb25maWcuYXhpc194X2V4dGVudDtcbiAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICBleHRlbnQgPSBbJCQucGFyc2VEYXRlKGV4dGVudFswXSksICQkLnBhcnNlRGF0ZShleHRlbnRbMV0pXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZXh0ZW50O1xuICAgIH07XG5cbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pbml0Wm9vbSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgZDMgPSAkJC5kMywgY29uZmlnID0gJCQuY29uZmlnLCBzdGFydEV2ZW50O1xuXG4gICAgICAgICQkLnpvb20gPSBkMy5iZWhhdmlvci56b29tKClcbiAgICAgICAgICAgIC5vbihcInpvb21zdGFydFwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3RhcnRFdmVudCA9IGQzLmV2ZW50LnNvdXJjZUV2ZW50O1xuICAgICAgICAgICAgICAgICQkLnpvb20uYWx0RG9tYWluID0gZDMuZXZlbnQuc291cmNlRXZlbnQuYWx0S2V5ID8gJCQueC5vcmdEb21haW4oKSA6IG51bGw7XG4gICAgICAgICAgICAgICAgY29uZmlnLnpvb21fb256b29tc3RhcnQuY2FsbCgkJC5hcGksIGQzLmV2ZW50LnNvdXJjZUV2ZW50KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAub24oXCJ6b29tXCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAkJC5yZWRyYXdGb3Jab29tLmNhbGwoJCQpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIC5vbignem9vbWVuZCcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgZXZlbnQgPSBkMy5ldmVudC5zb3VyY2VFdmVudDtcbiAgICAgICAgICAgICAgICAvLyBpZiBjbGljaywgZG8gbm90aGluZy4gb3RoZXJ3aXNlLCBjbGljayBpbnRlcmFjdGlvbiB3aWxsIGJlIGNhbmNlbGVkLlxuICAgICAgICAgICAgICAgIGlmIChldmVudCAmJiBzdGFydEV2ZW50LmNsaWVudFggPT09IGV2ZW50LmNsaWVudFggJiYgc3RhcnRFdmVudC5jbGllbnRZID09PSBldmVudC5jbGllbnRZKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgJCQucmVkcmF3RXZlbnRSZWN0KCk7XG4gICAgICAgICAgICAgICAgJCQudXBkYXRlWm9vbSgpO1xuICAgICAgICAgICAgICAgIGNvbmZpZy56b29tX29uem9vbWVuZC5jYWxsKCQkLmFwaSwgJCQueC5vcmdEb21haW4oKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgJCQuem9vbS5zY2FsZSA9IGZ1bmN0aW9uIChzY2FsZSkge1xuICAgICAgICAgICAgcmV0dXJuIGNvbmZpZy5heGlzX3JvdGF0ZWQgPyB0aGlzLnkoc2NhbGUpIDogdGhpcy54KHNjYWxlKTtcbiAgICAgICAgfTtcbiAgICAgICAgJCQuem9vbS5vcmdTY2FsZUV4dGVudCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBleHRlbnQgPSBjb25maWcuem9vbV9leHRlbnQgPyBjb25maWcuem9vbV9leHRlbnQgOiBbMSwgMTBdO1xuICAgICAgICAgICAgcmV0dXJuIFtleHRlbnRbMF0sIE1hdGgubWF4KCQkLmdldE1heERhdGFDb3VudCgpIC8gZXh0ZW50WzFdLCBleHRlbnRbMV0pXTtcbiAgICAgICAgfTtcbiAgICAgICAgJCQuem9vbS51cGRhdGVTY2FsZUV4dGVudCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciByYXRpbyA9IGRpZmZEb21haW4oJCQueC5vcmdEb21haW4oKSkgLyBkaWZmRG9tYWluKCQkLmdldFpvb21Eb21haW4oKSksXG4gICAgICAgICAgICAgICAgZXh0ZW50ID0gdGhpcy5vcmdTY2FsZUV4dGVudCgpO1xuICAgICAgICAgICAgdGhpcy5zY2FsZUV4dGVudChbZXh0ZW50WzBdICogcmF0aW8sIGV4dGVudFsxXSAqIHJhdGlvXSk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFpvb21Eb21haW4gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMsIGNvbmZpZyA9ICQkLmNvbmZpZywgZDMgPSAkJC5kMyxcbiAgICAgICAgICAgIG1pbiA9IGQzLm1pbihbJCQub3JnWERvbWFpblswXSwgY29uZmlnLnpvb21feF9taW5dKSxcbiAgICAgICAgICAgIG1heCA9IGQzLm1heChbJCQub3JnWERvbWFpblsxXSwgY29uZmlnLnpvb21feF9tYXhdKTtcbiAgICAgICAgcmV0dXJuIFttaW4sIG1heF07XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi51cGRhdGVab29tID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLCB6ID0gJCQuY29uZmlnLnpvb21fZW5hYmxlZCA/ICQkLnpvb20gOiBmdW5jdGlvbiAoKSB7fTtcbiAgICAgICAgJCQubWFpbi5zZWxlY3QoJy4nICsgQ0xBU1Muem9vbVJlY3QpLmNhbGwoeikub24oXCJkYmxjbGljay56b29tXCIsIG51bGwpO1xuICAgICAgICAkJC5tYWluLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5ldmVudFJlY3QpLmNhbGwoeikub24oXCJkYmxjbGljay56b29tXCIsIG51bGwpO1xuICAgIH07XG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4ucmVkcmF3Rm9yWm9vbSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgZDMgPSAkJC5kMywgY29uZmlnID0gJCQuY29uZmlnLCB6b29tID0gJCQuem9vbSwgeCA9ICQkLng7XG4gICAgICAgIGlmICghY29uZmlnLnpvb21fZW5hYmxlZCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmICgkJC5maWx0ZXJUYXJnZXRzVG9TaG93KCQkLmRhdGEudGFyZ2V0cykubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGQzLmV2ZW50LnNvdXJjZUV2ZW50LnR5cGUgPT09ICdtb3VzZW1vdmUnICYmIHpvb20uYWx0RG9tYWluKSB7XG4gICAgICAgICAgICB4LmRvbWFpbih6b29tLmFsdERvbWFpbik7XG4gICAgICAgICAgICB6b29tLnNjYWxlKHgpLnVwZGF0ZVNjYWxlRXh0ZW50KC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pLFxuICAgICAgICAgICAgY2FsbGJhY2sgPSBjb25maWcuZGF0YV9jb2xvcixcbiAgICAgICAgICAgIGlkcyA9IFtdO1xuXG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgdmFyIGlkID0gZC5pZCB8fCAoZC5kYXRhICYmIGQuZGF0YS5pZCkgfHwgZCwgY29sb3I7XG5cbiAgICAgICAgICAgIC8vIGlmIGNhbGxiYWNrIGZ1bmN0aW9uIGlzIHByb3ZpZGVkXG4gICAgICAgICAgICBpZiAoY29sb3JzW2lkXSBpbnN0YW5jZW9mIEZ1bmN0aW9uKSB7XG4gICAgICAgICAgICAgICAgY29sb3IgPSBjb2xvcnNbaWRdKGQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gaWYgc3BlY2lmaWVkLCBjaG9vc2UgdGhhdCBjb2xvclxuICAgICAgICAgICAgZWxzZSBpZiAoY29sb3JzW2lkXSkge1xuICAgICAgICAgICAgICAgIGNvbG9yID0gY29sb3JzW2lkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGlmIG5vdCBzcGVjaWZpZWQsIGNob29zZSBmcm9tIHBhdHRlcm5cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChpZHMuaW5kZXhPZihpZCkgPCAwKSB7IGlkcy5wdXNoKGlkKTsgfVxuICAgICAgICAgICAgICAgIGNvbG9yID0gcGF0dGVybltpZHMuaW5kZXhPZihpZCkgJSBwYXR0ZXJuLmxlbmd0aF07XG4gICAgICAgICAgICAgICAgY29sb3JzW2lkXSA9IGNvbG9yO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrIGluc3RhbmNlb2YgRnVuY3Rpb24gPyBjYWxsYmFjayhjb2xvciwgZCkgOiBjb2xvcjtcbiAgICAgICAgfTtcbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdlbmVyYXRlTGV2ZWxDb2xvciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcywgY29uZmlnID0gJCQuY29uZmlnLFxuICAgICAgICAgICAgY29sb3JzID0gY29uZmlnLmNvbG9yX3BhdHRlcm4sXG4gICAgICAgICAgICB0aHJlc2hvbGQgPSBjb25maWcuY29sb3JfdGhyZXNob2xkLFxuICAgICAgICAgICAgYXNWYWx1ZSA9IHRocmVzaG9sZC51bml0ID09PSAndmFsdWUnLFxuICAgICAgICAgICAgdmFsdWVzID0gdGhyZXNob2xkLnZhbHVlcyAmJiB0aHJlc2hvbGQudmFsdWVzLmxlbmd0aCA/IHRocmVzaG9sZC52YWx1ZXMgOiBbXSxcbiAgICAgICAgICAgIG1heCA9IHRocmVzaG9sZC5tYXggfHwgMTAwO1xuICAgICAgICByZXR1cm4gbm90RW1wdHkoY29uZmlnLmNvbG9yX3RocmVzaG9sZCkgPyBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIHZhciBpLCB2LCBjb2xvciA9IGNvbG9yc1tjb2xvcnMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdmFsdWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdiA9IGFzVmFsdWUgPyB2YWx1ZSA6ICh2YWx1ZSAqIDEwMCAvIG1heCk7XG4gICAgICAgICAgICAgICAgaWYgKHYgPCB2YWx1ZXNbaV0pIHtcbiAgICAgICAgICAgICAgICAgICAgY29sb3IgPSBjb2xvcnNbaV07XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBjb2xvcjtcbiAgICAgICAgfSA6IG51bGw7XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ludGVybmFsX2ZuLmdldFlGb3JtYXQgPSBmdW5jdGlvbiAoZm9yQXJjKSB7XG4gICAgIC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VuY3Rpb24gKG1pbikge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWcsIGQzID0gJCQuZDM7XG4gICAgICAgIGlmIChtaW4gPT09IDAgfHwgbWluKSB7XG4gICAgICAgICAgICBjb25maWcuem9vbV94X21pbiA9IGQzLm1pbihbJCQub3JnWERvbWFpblswXSwgbWluXSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gY29uZmlnLnpvb21feF9taW47XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgYzNfY2hhcnRfZm4uem9vbS5yYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkge1xuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChyYW5nZS5tYXgpKSB7IHRoaXMuZG9tYWluLm1heChyYW5nZS5tYXgpOyB9XG4gICAgICAgICAgICBpZiAoaXNEZWZpbmVkKHJhbmdlLm1pbikpIHsgdGhpcy5kb21haW4ubWluKHJhbmdlLm1pbik7IH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgbWF4OiB0aGlzLmRvbWFpbi5tYXgoKSxcbiAgICAgICAgICAgICAgICBtaW46IHRoaXMuZG9tYWluLm1pbigpXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLmxvYWQgPSBmdW5jdGlvbiAoYXJncykge1xuICAgICAgICB2YXIgJCQgPSB0aGlzLmludGVybmFsLCBjb25maWcgPSAkJC5jb25maWc7XG4gICAgICAgIC8vIHVwZGF0ZSB4cyBpZiBzcGVjaWZpZWRcbiAgICAgICAgaWYgKGFyZ3MueHMpIHtcbiAgICAgICAgICAgICQkLmFkZFhzKGFyZ3MueHMpO1xuICAgICAgICB9XG4gICAgICAgIC8vIHVwZGF0Z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x1bW5zKSB7XG4gICAgICAgICAgICBkYXRhID0gJCQuY29udmVydENvbHVtbnNUb0RhdGEoYXJncy5jb2x1bW5zKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICB0YXJnZXRzID0gJCQuY29udmVydERhdGFUb1RhcmdldHMoZGF0YSwgdHJ1ZSk7XG5cbiAgICAgICAgLy8gVXBkYXRlL0FkZCBkYXRhXG4gICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uICh0KSB7XG4gICAgICAgICAgICB2YXIgZm91bmQgPSBmYWxzZSwgaSwgajtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0YXJnZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHQuaWQgPT09IHRhcmdldHNbaV0uaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgZm91bmQgPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0LnZhbHVlc1t0LnZhbHVlcy5sZW5ndGggLSAxXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGFpbCA9IHQudmFsdWVzW3QudmFsdWVzLmxlbmd0aCAtIDFdLmluZGV4ICsgMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSB0YXJnZXRzW2ldLnZhbHVlcy5sZW5ndGg7XG5cbiAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRzW2ldLnZhbHVlc1tqXS5pbmRleCA9IHRhaWwgKyBqO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldHNbaV0udmFsdWVzW2pdLnggPSB0YWlsICsgajtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0LnZhbHVlcyA9IHQudmFsdWVzLmNvbmNhdCh0YXJnZXRzW2ldLnZhbHVlcyk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0cy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghZm91bmQpIHsgbm90Zm91bmRJZHMucHVzaCh0LmlkKTsgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBBcHBlbmQgbnVsbCBmb3Igbm90IGZvdW5kIHRhcmdldHNcbiAgICAgICAgJCQuZGF0YS50YXJnZXRzLmZvckVhY2goZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICAgIHZhciBpLCBqO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG5vdGZvdW5kSWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHQuaWQgPT09IG5vdGZvdW5kSWRzW2ldKSB7XG4gICAgICAgICAgICAgICAgICAgIHRhaWwgPSB0LnZhbHVlc1t0LnZhbHVlcy5sZW5ndGggLSAxXS5pbmRleCArIDE7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBsZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdC52YWx1ZXMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQuaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IHRhaWwgKyBqLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHg6ICQkLmlzVGltZVNlcmllcygpID8gJCQuZ2V0T3RoZXJUYXJnZXRYKHRhaWwgKyBqKSA6IHRhaWwgKyBqLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBudWxsXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gR2VuZXJhdGUgbnVsbCB2YWx1ZXMgZm9yIG5ldyB0YXJnZXRcbiAgICAgICAgaWYgKCQkLmRhdGEudGFyZ2V0cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRhcmdldHMuZm9yRWFjaChmdW5jdGlvbiAodCkge1xuICAgICAgICAgICAgICAgIHZhciBpLCBtaXNzaW5nID0gW107XG4gICAgICAgICAgICAgICAgZm9yIChpID0gJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlc1swXS5pbmRleDsgaSA8IHRhaWw7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBtaXNzaW5nLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQuaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHg6ICQkLmlzVGltZVNlcmllcygpID8gJCQuZ2V0T3RoZXJUYXJnZXRYKGkpIDogaSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBudWxsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0LnZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uICh2KSB7XG4gICAgICAgICAgICAgICAgICAgIHYuaW5kZXggKz0gdGFpbDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdi54ICs9IHRhaWw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB0LnZhbHVlcyA9IG1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IHtcbiAgICAgICAgICAgIGlmICgkJC5pc1RpbWVTZXJpZXMoKSkge1xuICAgICAgICAgICAgICAgIGlmIChiYXNlVGFyZ2V0LnZhbHVlcy5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGRpZmYgPSBiYXNlVGFyZ2V0LnZhbHVlc1tiYXNlVGFyZ2V0LnZhbHVlcy5sZW5ndGggLSAxXS54IC0gYmFzZVZhbHVlLng7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZGlmZiA9IGJhc2VWYWx1ZS54IC0gJCQuZ2V0WERvbWFpbigkJC5kYXRhLnRhcmdldHMpWzBdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZGlmZiA9IDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBkb21haW4gPSBbYmFzZVZhbHVlLnggLSBkaWZmLCBiYXNlVmFsdWUueF07XG4gICAgICAgICAgICAkJC51cGRhdGVYRG9tYWluKG51bGwsIHRydWUsIHRydWUsIGZhbHNlLCBkb21haW4pO1xuICAgICAgICB9IGVsc2UgaWYgKG9yZ0RhdGFDb3VudCA9PT0gMSkge1xuICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgZGlmZiA9IChiYXNlVGFyZ2V0LnZhbHVlc1tiYXNlVGFyZ2V0LnZhbHVlcy5sZW5ndGggLSAxXS54IC0gYmFzZVZhbHVlLngpIC8gMjtcbiAgICAgICAgICAgICAgICBkb21haW4gPSBbbmV3IERhdGUoK2Jhc2VWYWx1ZS54IC0gZGlmZiksIG5ldyBEYXRlKCtiYXNlVmFsdWUueCArIGRpZmYpXTtcbiAgICAgICAgICAgICAgICAkJC51cGRhdGVYRG9tYWluKG51bGwsIHRydWUsIHRydWUsIGZhbHNlLCBkb21haW4pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5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y5kcmF3QmFyLFxuICAgICAgICAgICAgICAgIGRyYXdMaW5lID0gYXJncy5kcmF3TGluZSxcbiAgICAgICAgICAgICAgICBkcmF3QXJlYSA9IGFyZ3MuZHJhd0FyZWEsXG4gICAgICAgICAgICAgICAgY3ggPSBhcmdzLmN4LFxuICAgICAgICAgICAgICAgIGN5ID0gYXJncy5jeSxcbiAgICAgICAgICAgICAgICB4diA9IGFyZ3MueHYsXG4gICAgICAgICAgICAgICAgeEZvclRleHQgPSBhcmdzLnhGb3JUZXh0LFxuICAgICAgICAgICAgICAgIHlGb3JUZXh0ID0gYXJncy55Rm9yVGV4dCxcbiAgICAgICAgICAgICAgICBkdXJhdGlvbiA9IGFyZ3MuZHVyYXRpb247XG5cbiAgICAgICAgICAgIHZhciB0cmFuc2xhdGVYLCBzY2FsZVggPSAxLCB0cmFuc2Zvcm0sXG4gICAgICAgICAgICAgICAgZmxvd0luZGV4ID0gZmxvdy5pbmRleCxcbiAgICAgICAgICAgICAgICBmbG93TGVuZ3RoID0gZmxvdy5sZW5ndGgsXG4gICAgICAgICAgICAgICAgZmxvd1N0YXJ0ID0gJCQuZ2V0VmFsdWVPbkluZGV4KCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMsIGZsb3dJbmRleCksXG4gICAgICAgICAgICAgICAgZmxvd0VuZCA9ICQkLmdldFZhbHVlT25JbmRleCgkJC5kYXRhLnRhcmdldHNbMF0udmFsdWVzLCBmbG93SW5kZXggKyBmbG93TGVuZ3RoKSxcbiAgICAgICAgICAgICAgICBvcmdEb21haW4gPSAkJC54LmRvbWFpbigpLCBkb21haW4sXG4gICAgICAgICAgICAgICAgZHVyYXRpb25Gb3JGbG93ID0gZmxvdy5kdXJhdGlvbiB8fCBkdXJhdGlvbixcbiAgICAgICAgICAgICAgICBkb25lID0gZmxvdy5kb25lIHx8IGZ1bmN0aW9uICgpIHt9LFxuICAgICAgICAgICAgICAgIHdhaXQgPSAkJC5nZW5lcmF0ZVdhaXQoKTtcblxuICAgICAgICAgICAgdmFyIHhncmlkID0gJCQueGdyaWQgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICB4Z3JpZExpbmVzID0gJCQueGdyaWRMaW5lcyB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5SZWdpb24gPSAkJC5tYWluUmVnaW9uIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpblRleHQgPSAkJC5tYWluVGV4dCB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5CYXIgPSAkJC5tYWluQmFyIHx8IGQzLnNlbGVjdEFsbChbXSksXG4gICAgICAgICAgICAgICAgbWFpbkxpbmUgPSAkJC5tYWluTGluZSB8fCBkMy5zZWxlY3RBbGwoW10pLFxuICAgICAgICAgICAgICAgIG1haW5BcmVhID0gJCQubWFpbkFyZWEgfHwgZDMuc2VsZWN0QWxsKFtdKSxcbiAgICAgICAgICAgICAgICBtYWluQ2lyY2xlID0gJCQubWFpbkNpcmNsZSB8fCBkMy5zZWxlY3RBbGwoW10pO1xuXG4gICAgICAgICAgICAvLyBzZXQgZmxhZ1xuICAgICAgICAgICAgJCQuZmxvd2luZyA9IHRydWU7XG5cbiAgICAgICAgICAgIC8vIHJlbW92ZSBoZWFkIGRhdGEgYWZ0ZXIgcmVuZGVyZWRcbiAgICAgICAgICAgICQkLmRhdGEudGFyZ2V0cy5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgZC52YWx1ZXMuc3BsaWNlKDAsIGZsb3dMZW5ndGgpO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIC8vIHVwZGF0ZSB4IGRvbWFpbiB0byBnZW5lcmF0ZSBheGlzIGVsZW1lbnRzIGZvciBmbG93XG4gICAgICAgICAgICBkb21haW4gPSAkJC51cGRhdGVYRG9tYWluKHRhcmdldHMsIHRydWUsIHRydWUpO1xuICAgICAgICAgICAgLy8gdXBkYXRlIGVsZW1lbnRzIHJlbGF0ZWQgdG8geCBzY2FsZVxuICAgICAgICAgICAgaWYgKCQkLnVwZGF0ZVhHcmlkKSB7ICQkLnVwZGF0ZVhHcmlkKHRydWUpOyB9XG5cbiAgICAgICAgICAgIC8vIGdlbmVyYXRlIHRyYW5zZm9ybSB0byBmbG93XG4gICAgICAgICAgICBpZiAoIWZsb3cub3JnRGF0YUNvdW50KSB7IC8vIGlmIGVtcHR5XG4gICAgICAgICAgICAgICAgaWYgKCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMubGVuZ3RoICE9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAkJC54KG9yZ0RvbWFpblswXSkgLSAkJC54KGRvbWFpblswXSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQkLmlzVGltZVNlcmllcygpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmbG93U3RhcnQgPSAkJC5nZXRWYWx1ZU9uSW5kZXgoJCQuZGF0YS50YXJnZXRzWzBdLnZhbHVlcywgMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBmbG93RW5kID0gJCQuZ2V0VmFsdWVPbkluZGV4KCQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMsICQkLmRhdGEudGFyZ2V0c1swXS52YWx1ZXMubGVuZ3RoIC0gMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gJCQueChmbG93U3RhcnQueCkgLSAkJC54KGZsb3dFbmQueCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gZGlmZkRvbWFpbihkb21haW4pIC8gMjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxvdy5vcmdEYXRhQ291bnQgPT09IDEgfHwgKGZsb3dTdGFydCAmJiBmbG93U3RhcnQueCkgPT09IChmbG93RW5kICYmIGZsb3dFbmQueCkpIHtcbiAgICAgICAgICAgICAgICB0cmFuc2xhdGVYID0gJCQueChvcmdEb21haW5bMF0pIC0gJCQueChkb21haW5bMF0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoJCQuaXNUaW1lU2VyaWVzKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRlWCA9ICgkJC54KG9yZ0RvbWFpblswXSkgLSAkJC54KGRvbWFpblswXSkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZVggPSAoJCQueChmbG93U3RhcnQueCkgLSAkJC54KGZsb3dFbmQueCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNjYWxlWCA9IChkaWZmRG9tYWluKG9yZ0RvbWFpbikgLyBkaWZmRG9tYWluKGRvbWFpbikpO1xuICAgICAgICAgICAgdHJhbnNmb3JtID0gJ3RyYW5zbGF0ZSgnICsgdHJhbnNsYXRlWCArICcsMCkgc2NhbGUoJyArIHNjYWxlWCArICcsMSknO1xuXG4gICAgICAgICAgICAkJC5oaWRlWEdyaWRGb2N1cygpO1xuXG4gICAgICAgICAgICBkMy50cmFuc2l0aW9uKCkuZWFzZSgnbGluZWFyJykuZHVyYXRpb24oZHVyYXRpb25Gb3JGbG93KS5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB3YWl0LmFkZCgkJC5heGVzLngudHJhbnNpdGlvbigpLmNhbGwoJCQueEF4aXMpKTtcbiAgICAgICAgICAgICAgICB3YWl0LmFkZChtYWluQmFyLnRyYW5zaXRpb24oKS5hdHRyKCd0cmFuc2Zvcm0nLCB0cmFuc2Zvcm0pKTtcbiAgICAgICAgICAgICAgICB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ICAgICAgICAgc2hhcGVzLnB1c2goJy4nICsgQ0xBU1Muc2hhcGUgKyAnLScgKyAoZmxvd0luZGV4ICsgaSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dHMucHVzaCgnLicgKyBDTEFTUy50ZXh0ICsgJy0nICsgKGZsb3dJbmRleCArIGkpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50UmVjdHMucHVzaCgnLicgKyBDTEFTUy5ldmVudFJlY3QgKyAnLScgKyAoZmxvd0luZGV4ICsgaSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3RBbGwoJy4nICsgQ0xBU1Muc2hhcGVzKS5zZWxlY3RBbGwoc2hhcGVzKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy50ZXh0cykuc2VsZWN0QWxsKHRleHRzKS5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgJCQuc3ZnLnNlbGVjdEFsbCgnLicgKyBDTEFTUy5ldmVudFJlY3RzKS5zZWxlY3RBbGwoZXZlbnRSZWN0cykucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgICAgICQkLnN2Zy5zZWxlY3QoJy4nICsgQ0xBU1MueGdyaWQpLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIGRyYXcgYWdhaW4gZm9yIHJlbW92aW5nIGZsb3dlZCBlbGVtZW50cyBhbmQgcmV2ZXJ0aW5nIGF0dHJcbiAgICAgICAgICAgICAgICB4Z3JpZFxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJCQueGdyaWRBdHRyKTtcbiAgICAgICAgICAgICAgICB4Z3JpZExpbmVzXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKTtcbiAgICAgICAgICAgICAgICB4Z3JpZExpbmVzLnNlbGVjdCgnbGluZScpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwieDFcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/IDAgOiB4dilcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ4MlwiLCBjb25maWcuYXhpc19yb3RhdGVkID8gJCQud2lkdGggOiB4dik7XG4gICAgICAgICAgICAgICAgeGdyaWRMaW5lcy5zZWxlY3QoJ3RleHQnKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcInhcIiwgY29uZmlnLmF4aXNfcm90YXRlZCA/ICQkLndpZHRoIDogMClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ5XCIsIHh2KTtcbiAgICAgICAgICAgICAgICBtYWluQmFyXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBudWxsKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcImRcIiwgZHJhd0Jhcik7XG4gICAgICAgICAgICAgICAgbWFpbkxpbmVcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCBkcmF3TGluZSk7XG4gICAgICAgICAgICAgICAgbWFpbkFyZWFcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKFwiZFwiLCBkcmF3QXJlYSk7XG4gICAgICAgICAgICAgICAgbWFpbkNpcmNsZVxuICAgICAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJjeFwiLCBjeClcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJjeVwiLCBjeSk7XG4gICAgICAgICAgICAgICAgbWFpblRleHRcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgeEZvclRleHQpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgeUZvclRleHQpXG4gICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbC1vcGFjaXR5JywgJCQub3BhY2l0eUZvclRleHQuYmluZCgkJCkpO1xuICAgICAgICAgICAgICAgIG1haW5SZWdpb25cbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIG51bGwpO1xuICAgICAgICAgICAgICAgIG1haW5SZWdpb24uc2VsZWN0KCdyZWN0JykuZmlsdGVyKCQkLmlzUmVnaW9uT25YKVxuICAgICAgICAgICAgICAgICAgICAuYXR0cihcInhcIiwgJCQucmVnaW9uWC5iaW5kKCQkKSlcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoXCJ3aWR0aFwiLCAkJC5yZWdpb25XaWR0aC5iaW5kKCQkKSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmludGVyYWN0aW9uX2VuYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgJCQucmVkcmF3RXZlbnRSZWN0KCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gY2FsbGJhY2sgZm9yIGVuZCBvZiBmbG93XG4gICAgICAgICAgICAgICAgZG9uZSgpO1xuXG4gICAgICAgICAgICAgICAgJCQuZmxvd2luZyA9IGZhbHNlO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH07XG4gICAgfTtcblxuICAgIGMzX2NoYXJ0X2ZuLnNlbGVjdGVkID0gZnVuY3Rpb24gKHRhcmdldElkKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGQzID0gJCQuZDM7XG4gICAgICAgIHJldHVybiBkMy5tZXJnZShcbiAgICAgICAgICAgICQkLm1haW4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aW9uIChheGlzSWQpIHtcbiAgICAgICAgICAgICAgICAkJC5heGlzLnNldExhYmVsVGV4dChheGlzSWQsIGxhYmVsc1theGlzSWRdKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgJCQuYXhpcy51cGRhdGVMYWJlbHMoKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBUT0RPOiByZXR1cm4gc29tZSB2YWx1ZXM/XG4gICAgfTtcbiAgICBjM19jaGFydF9mbi5heGlzLm1heCA9IGZ1bmN0aW9uIChtYXgpIHtcbiAgICAgICAgdmFyICQkID0gdGhpcy5pbnRlcm5hbCwgY29uZmlnID0gJCQuY29uZmlnO1xuICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtYXggPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWF4LngpKSB7IGNvbmZpZy5heGlzX3hfbWF4ID0gbWF4Lng7IH1cbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtYXgueSkpIHsgY29uZmlnLmF4aXNfeV9tYXggPSBtYXgueTsgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1heC55MikpIHsgY29uZmlnLmF4aXNfeTJfbWF4ID0gbWF4LnkyOyB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5heGlzX3lfbWF4ID0gY29uZmlnLmF4aXNfeTJfbWF4ID0gbWF4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgJCQucmVkcmF3KHt3aXRoVXBkYXRlT3JnWERvbWFpbjogdHJ1ZSwgd2l0aFVwZGF0ZVhEb21haW46IHRydWV9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgeDogY29uZmlnLmF4aXNfeF9tYXgsXG4gICAgICAgICAgICAgICAgeTogY29uZmlnLmF4aXNfeV9tYXgsXG4gICAgICAgICAgICAgICAgeTI6IGNvbmZpZy5heGlzX3kyX21heFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgYzNfY2hhcnRfZm4uYXhpcy5taW4gPSBmdW5jdGlvbiAobWluKSB7XG4gICAgICAgIHZhciAkJCA9IHRoaXMuaW50ZXJuYWwsIGNvbmZpZyA9ICQkLmNvbmZpZztcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWluID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgIGlmIChpc1ZhbHVlKG1pbi54KSkgeyBjb25maWcuYXhpc194X21pbiA9IG1pbi54OyB9XG4gICAgICAgICAgICAgICAgaWYgKGlzVmFsdWUobWluLnkpKSB7IGNvbmZpZy5heGlzX3lfbWluID0gbWluLnk7IH1cbiAgICAgICAgICAgICAgICBpZiAoaXNWYWx1ZShtaW4ueTIpKSB7IGNvbmZpZy5heGlzX3kyX21pbiA9IG1pbi55MjsgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25maWcuYXhpc195X21pbiA9IGNvbmZpZy5heGlzX3kyX21pbiA9IG1pbjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICQkLnJlZHJhdyh7d2l0aFVwZGF0ZU9yZ1hEb21haW46IHRydWUsIHdpdGhVcGRhdGVYRG9tYWluOiB0cnVlfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIHg6IGNvbmZpZy5heGlzX3hfbWluLFxuICAgICAgICAgICAgICAgIHk6IGNvbmZpZy5heGlzX3lfbWluLFxuICAgICAgICAgICAgICAgIHkyOiBjb25maWcuYXhpc195Ml9taW5cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9O1xuICAgIGMzX2NoYXJ0X2ZuLmF4aXMucmFuZ2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AgcGFyYW1zID0gcGFyYW1zIHx8IHt9O1xuICAgICAgICBvdXRlclRpY2tTaXplID0gcGFyYW1zLndpdGhPdXRlclRpY2sgPyA2IDogMDtcblxuICAgICAgICBmdW5jdGlvbiBheGlzWChzZWxlY3Rpb24sIHgpIHtcbiAgICAgICAgICAgIHNlbGVjdGlvbi5hdHRyKFwidHJhbnNmb3JtXCIsIGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFwidHJhbnNsYXRlKFwiICsgTWF0aC5jZWlsKHgoZCkgKyB0aWNrT2Zmc2V0KSArIFwiLCAwKVwiO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gYXhpc1koc2VsZWN0aW9uLCB5KSB7XG4gICAgICAgICAgICBzZWxlY3Rpb24uYXR0cihcInRyYW5zZm9ybVwiLCBmdW5jdGlvbiAoZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBcInRyYW5zbGF0ZSgwLFwiICsgTWF0aC5jZWlsKHkoZCkpICsgXCIpXCI7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBzY2FsZUV4dGVudChkb21haW4pIHtcbiAgICAgICAgICAgIHZhciBzdGFydCA9IGRvbWFpblswXSwgc3RvcCA9IGRvbWFpbltkb21haW4ubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICByZXR1cm4gc3RhcnQgPCBzdG9wID8gWyBzdGFydCwgc3RvcCBdIDogWyBzdG9wLCBzdGFydCBdO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGdlbmVyYXRlVGlja3Moc2NhbGUpIHtcbiAgICAgICAgICAgIHZhciBpLCBkb21haW4sIHRpY2tzID0gW107XG4gICAgICAgICAgICBpZiAoc2NhbGUudGlja3MpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gc2NhbGUudGlja3MuYXBwbHkoc2NhbGUsIHRpY2tBcmd1bWVudHMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZG9tYWluID0gc2NhbGUuZG9tYWluKCk7XG4gICAgICAgICAgICBmb3IgKGkgPSBNYXRoLmNlaWwoZG9tYWluWzBdKTsgaSA8IGRvbWFpblsxXTsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdGlja3MucHVzaChpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aWNrcy5sZW5ndGggPiAwICYmIHRpY2tzWzBdID4gMCkge1xuICAgICAgICAgICAgICAgIHRpY2tzLnVuc2hpZnQodGlja3NbMF0gLSAodGlja3NbMV0gLSB0aWNrc1swXSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRpY2tzO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGNvcHlTY2FsZSgpIHtcbiAgICAgICAgICAgIHZhciBuZXdTY2FsZSA9IHNjYWxlLmNvcHkoKSwgZG9tYWluO1xuICAgICAgICAgICAgaWYgKHBhcmFtcy5pc0NhdGVnb3J5KSB7XG4gICAgICAgICAgICAgICAgZG9tYWluID0gc2NhbGUuZG9tYWluKCk7XG4gICAgICAgICAgICAgICAgbmV3U2NhbGUuZG9tYWluKFtkb21haW5bMF0sIGRvbWFpblsxXSAtIDFdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBuZXdTY2FsZTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiB0ZXh0Rm9ybWF0dGVkKHYpIHtcbiAgICAgICAgICAgIHZhciBmb3JtYXR0ZWQgPSB0aWNrRm9ybWF0ID8gdGlja0Zvcm1hdCh2KSA6IHY7XG4gICAgICAgICAgICByZXR1cm4gdHlwZW9mIGZvcm1hdHRlZCAhPT0gJ3VuZGVmaW5lZCcgPyBmb3JtYXR0ZWQgOiAnJztcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBnZXRTaXplRm9yMUNoYXIodGljaykge1xuICAgICAgICAgICAgaWYgKHRpY2tUZXh0Q2hhclNpemUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGlja1RleHRDaGFyU2l6ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBzaXplID0ge1xuICAgICAgICAgICAgICAgIGg6IDExLjUsXG4gICAgICAgICAgICAgICAgdzogNS41XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgdGljay5zZWxlY3QoJ3RleHQnKS50ZXh0KHRleHRGb3JtYXR0ZWQpLmVhY2goZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICB2YXIgYm94ID0gdGhpcy5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSxcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHRleHRGb3JtYXR0ZWQoZCksXG4gICAgICAgICAgICAgICAgICAgIGggPSBib3guaGVpZ2h0LFxuICAgICAgICAgICAgICAgICAgICB3ID0gdGV4dCA/IChib3gud2lkdGggLyB0ZXh0Lmxlbmd0aCkgOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKGggJiYgdykge1xuICAgICAgICAgICAgICAgICAgICBzaXplLmggPSBoO1xuICAgICAgICAgICAgICAgICAgICBzaXplLncgPSB3O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLnRleHQoJycpO1xuICAgICAgICAgICAgdGlja1RleHRDaGFyU2l6ZSA9IHNpemU7XG4gICAgICAgICAgICByZXR1cm4gc2l6ZTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiB0cmFuc2l0aW9uaXNlKHNlbGVjdGlvbikge1xuICAgICAgICAgICAgcmV0dXJuIHBhcmFtcy53aXRob3V0VHJhbnNpdGlvbiA/IHNlbGVjdGlvbiA6IGQzLnRyYW5zaXRpb24oc2VsZWN0aW9uKTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBheGlzKGcpIHtcbiAgICAgICAgICAgIGcuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGcgPSBheGlzLmcgPSBkMy5zZWxlY3QodGhpcyk7XG5cbiAgICAgICAgICAgICAgICB2YXIgc2NhbGUwID0gdGhpcy5fX2NoYXJ0X18gfHwgc2NhbGUsIHNjYWxlMSA9IHRoaXMuX19jaGFydF9fID0gY29weVNjYWxlKCk7XG5cbiAgICAgICAgICAgICAgICB2YXIgdGlja3MgPSB0aWNrVmFsdWVzID8gdGlja1ZhbHVlcyA6IGdlbmVyYXRlVGlja3Moc2NhbGUxKSxcbiAgICAgICAgICAgICAgICAgICAgdGljayA9IGcuc2VsZWN0QWxsKFwiLnRpY2tcIikuZGF0YSh0aWNrcywgc2NhbGUxKSxcbiAgICAgICAgICAgICAgICAgICAgdGlja0VudGVyID0gdGljay5lbnRlcigpLmluc2VydChcImdcIiwgXCIuZG9tYWluXCIpLmF0dHIoXCJjbGFzc1wiLCBcInRpY2tcIikuc3R5bGUoXCJvcGFjaXR5XCIsIDFlLTYpLFxuICAgICAgICAgICAgICAgICAgICAvLyBNRU1POiBObyBleGl0IHRyYW5zaXRpb24uIFRoZSByZWFzb24gaXMgdGhpcyB0cmFuc2l0aW9uIGFmZmVjdHMgbWF4IHRpY2sgd2lkdGggY2FsY3VsYXRpb24gYmVjYXVzZSBvbGQgdGljayB3aWxsIGJlIGluY2x1ZGVkIGluIHRoZSB0aWNrcy5cbiAgICAgICAgICAgICAgICAgICAgdGlja0V4aXQgPSB0aWNrLmV4aXQoKS5yZW1vdmUoKSxcbiAgICAgICAgICAgICAgICAgICAgdGlja1VwZGF0ZSA9IHRyYW5zaXRpb25pc2UodGljaykuc3R5bGUoXCJvcGFjaXR5XCIsIDEpLFxuICAgICAgICAgICAgICAgICAgICB0aWNrVHJhbnNmb3JtLCB0aWNrWCwgdGlja1k7XG5cbiAgICAgICAgICAgICAgICB2YXIgcmFuZ2UgPSBzY2FsZS5yYW5nZUV4dGVudCA/IHNjYWxlLnJhbmdlRXh0ZW50KCkgOiBzY2FsZUV4dGVudChzY2FsZS5yYW5nZSgpKSxcbiAgICAgICAgICAgICAgICAgICAgcGF0aCA9IGcuc2VsZWN0QWxsKFwiLmRvbWFpblwiKS5kYXRhKFsgMCBdKSxcbiAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZSA9IChwYXRoLmVudGVyKCkuYXBwZW5kKFwicGF0aFwiKS5hdHRyKFwiY2xhc3NcIiwgXCJkb21haW5cIiksIHRyYW5zaXRpb25pc2UocGF0aCkpO1xuICAgICAgICAgICAgICAgIHRpY2tFbnRlci5hcHBlbmQoXCJsaW5lXCIpO1xuICAgICAgICAgICAgICAgIHRpY2tFbnRlci5hcHBlbmQoXCJ0ZXh0XCIpO1xuXG4gICAgICAgICAgICAgICAgdmFyIGxpbmVFbnRlciA9IHRpY2tFbnRlci5zZWxlY3QoXCJsaW5lXCIpLFxuICAgICAgICAgICAgICAgICAgICBsaW5lVXBkYXRlID0gdGlja1VwZGF0ZS5zZWxlY3QoXCJsaW5lXCIpLFxuICAgICAgICAgICAgICAgICAgICB0ZXh0RW50ZXIgPSB0aWNrRW50ZXIuc2VsZWN0KFwidGV4dFwiKSxcbiAgICAgICAgICAgICAgICAgICAgdGV4dFVwZGF0ZSA9IHRpY2tVcGRhdGUuc2VsZWN0KFwidGV4dFwiKTtcblxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuaXNDYXRlZ29yeSkge1xuICAgICAgICAgICAgICAgICAgICB0aWNrT2Zmc2V0ID0gTWF0aC5jZWlsKChzY2FsZTEoMSkgLSBzY2FsZTEoMCkpIC8gMik7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tYID0gdGlja0NlbnRlcmVkID8gMCA6IHRpY2tPZmZzZXQ7XG4gICAgICAgICAgICAgICAgICAgIHRpY2tZID0gdGlja0NlbnRlcmVkID8gdGlja09mZnNldCA6IDA7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja09mZnNldCA9IHRpY2tYID0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BzY2FsZTEodGlja3NbMF0pKSAtIDEyKSA6IDExMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNwbGl0KHNwbGl0dGVkLCB0ZXh0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzcGFjZUluZGV4ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDE7IGkgPCB0ZXh0Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRleHQuY2hhckF0KGkpID09PSAnICcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BhY2VJbmRleCA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YnRleHQgPSB0ZXh0LnN1YnN0cigwLCBpICsgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFdpZHRoID0gc2l6ZUZvcjFDaGFyLncgKiBzdWJ0ZXh0Lmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB0ZXh0IHdpZHRoIGdldHMgb3ZlciB0aWNrIHdpZHRoLCBzcGxpdCBieSBzcGFjZSBpbmRleCBvciBjcnJlbnQgaW5kZXhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF4V2lkdGggPCB0ZXh0V2lkdGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNwbGl0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BsaXR0ZWQuY29uY2F0KHRleHQuc3Vic3RyKDAsIHNwYWNlSW5kZXggPyBzcGFjZUluZGV4IDogaSkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC5zbGljZShzcGFjZUluZGV4ID8gc3BhY2VJbmRleCArIDEgOiBpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdHRlZC5jb25jYXQodGV4dCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3BsaXQoc3BsaXR0ZWQsIHRpY2tUZXh0ICsgXCJcIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdHNwYW5EeShkLCBpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkeSA9IHNpemVGb3IxQ2hhci5oO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9yaWVudCA9PT0gJ2xlZnQnIHx8IG9yaWVudCA9PT0gJ3JpZ2h0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR5ID0gLSgoY291bnRzW2QuaW5kZXhdIC0gMSkgKiAoc2l6ZUZvcjFDaGFyLmggLyAyKSAtIDMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkeSA9IFwiLjcxZW1cIjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZHk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdGlja1NpemUoZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdGlja1Bvc2l0aW9uID0gc2NhbGUoZCkgKyAodGlja0NlbnRlcmVkID8gMCA6IHRpY2tPZmZzZXQpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmFuZ2VbMF0gPCB0aWNrUG9zaXRpb24gJiYgdGlja1Bvc2l0aW9uIDwgcmFuZ2VbMV0gPyBpbm5lclRpY2tTaXplIDogMDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0ZXh0ID0gdGljay5zZWxlY3QoXCJ0ZXh0XCIpO1xuICAgICAgICAgICAgICAgIHRzcGFuID0gdGV4dC5zZWxlY3RBbGwoJ3RzcGFuJylcbiAgICAgICAgICAgICAgICAgICAgLmRhdGEoZnVuY3Rpb24gKGQsIGkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzcGxpdHRlZCA9IHBhcmFtcy50aWNrTXVsdGlsaW5lID8gc3BsaXRUaWNrVGV4dChkLCBwYXJhbXMudGlja1dpZHRoKSA6IFtdLmNvbmNhdCh0ZXh0Rm9ybWF0dGVkKGQpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50c1tpXSA9IHNwbGl0dGVkLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcGxpdHRlZC5tYXAoZnVuY3Rpb24gKHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyBpbmRleDogaSwgc3BsaXR0ZWQ6IHMgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB0c3Bhbi5lbnRlcigpLmFwcGVuZCgndHNwYW4nKTtcbiAgICAgICAgICAgICAgICB0c3Bhbi5leGl0KCkucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgdHNwYW4udGV4dChmdW5jdGlvbiAoZCkgeyByZXR1cm4gZC5zcGxpdHRlZDsgfSk7XG5cbiAgICAgICAgICAgICAgICB2YXIgcm90YXRlID0gcGFyYW1zLnRpY2tUZXh0Um90YXRlO1xuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdGV4dEFuY2hvckZvclRleHQocm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ21pZGRsZSc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdGF0ZSA+IDAgPyBcInN0YXJ0XCIgOiBcImVuZFwiO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiB0ZXh0VHJhbnNmb3JtKHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcInJvdGF0ZShcIiArIHJvdGF0ZSArIFwiKVwiO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBkeEZvclRleHQocm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcm90YXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gOCAqIE1hdGguc2luKE1hdGguUEkgKiAocm90YXRlIC8gMTgwKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHlGb3JUZXh0KHJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXJvdGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRpY2tMZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDExLjUgLSAyLjUgKiAocm90YXRlIC8gMTUpICogKHJvdGF0ZSA+IDAgPyAxIDogLTEpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHN3aXRjaCAob3JpZW50KSB7XG4gICAgICAgICAgICAgICAgY2FzZSBcImJvdHRvbVwiOlxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aWNrVHJhbnNmb3JtID0gYXhpc1g7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lRW50ZXIuYXR0cihcInkyXCIsIGlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ5XCIsIHRpY2tMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZS5hdHRyKFwieDFcIiwgdGlja1gpLmF0dHIoXCJ4MlwiLCB0aWNrWCkuYXR0cihcInkyXCIsIHRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cihcInhcIiwgMCkuYXR0cihcInlcIiwgeUZvclRleHQocm90YXRlKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCB0ZXh0QW5jaG9yRm9yVGV4dChyb3RhdGUpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKFwidHJhbnNmb3JtXCIsIHRleHRUcmFuc2Zvcm0ocm90YXRlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0c3Bhbi5hdHRyKCd4JywgMCkuYXR0cihcImR5XCIsIHRzcGFuRHkpLmF0dHIoJ2R4JywgZHhGb3JUZXh0KHJvdGF0ZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKFwiZFwiLCBcIk1cIiArIHJhbmdlWzBdICsgXCIsXCIgKyBvdXRlclRpY2tTaXplICsgXCJWMEhcIiArIHJhbmdlWzFdICsgXCJWXCIgKyBvdXRlclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2FzZSBcInRvcFwiOlxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPOiByb3RhdGVkIHRpY2sgdGV4dFxuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNYO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ5MlwiLCAtaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RW50ZXIuYXR0cihcInlcIiwgLXRpY2tMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZS5hdHRyKFwieDJcIiwgMCkuYXR0cihcInkyXCIsIC1pbm5lclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cihcInhcIiwgMCkuYXR0cihcInlcIiwgLXRpY2tMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC5zdHlsZShcInRleHQtYW5jaG9yXCIsIFwibWlkZGxlXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHNwYW4uYXR0cigneCcsIDApLmF0dHIoXCJkeVwiLCBcIjBlbVwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cihcImRcIiwgXCJNXCIgKyByYW5nZVswXSArIFwiLFwiICsgLW91dGVyVGlja1NpemUgKyBcIlYwSFwiICsgcmFuZ2VbMV0gKyBcIlZcIiArIC1vdXRlclRpY2tTaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgY2FzZSBcImxlZnRcIjpcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGF4aXNZO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoXCJ4MlwiLCAtaW5uZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RW50ZXIuYXR0cihcInhcIiwgLXRpY2tMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZS5hdHRyKFwieDJcIiwgLWlubmVyVGlja1NpemUpLmF0dHIoXCJ5MVwiLCB0aWNrWSkuYXR0cihcInkyXCIsIHRpY2tZKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cihcInhcIiwgLXRpY2tMZW5ndGgpLmF0dHIoXCJ5XCIsIHRpY2tPZmZzZXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC5zdHlsZShcInRleHQtYW5jaG9yXCIsIFwiZW5kXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHNwYW4uYXR0cigneCcsIC10aWNrTGVuZ3RoKS5hdHRyKFwiZHlcIiwgdHNwYW5EeSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoVXBkYXRlLmF0dHIoXCJkXCIsIFwiTVwiICsgLW91dGVyVGlja1NpemUgKyBcIixcIiArIHJhbmdlWzBdICsgXCJIMFZcIiArIHJhbmdlWzFdICsgXCJIXCIgKyAtb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNhc2UgXCJyaWdodFwiOlxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aWNrVHJhbnNmb3JtID0gYXhpc1k7XG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lRW50ZXIuYXR0cihcIngyXCIsIGlubmVyVGlja1NpemUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoXCJ4XCIsIHRpY2tMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVVwZGF0ZS5hdHRyKFwieDJcIiwgaW5uZXJUaWNrU2l6ZSkuYXR0cihcInkyXCIsIDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFVwZGF0ZS5hdHRyKFwieFwiLCB0aWNrTGVuZ3RoKS5hdHRyKFwieVwiLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQuc3R5bGUoXCJ0ZXh0LWFuY2hvclwiLCBcInN0YXJ0XCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHNwYW4uYXR0cigneCcsIHRpY2tMZW5ndGgpLmF0dHIoXCJkeVwiLCB0c3BhbkR5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cihcImRcIiwgXCJNXCIgKyBvdXRlclRpY2tTaXplICsgXCIsXCIgKyByYW5nZVswXSArIFwiSDBWXCIgKyByYW5nZVsxXSArIFwiSFwiICsgb3V0ZXJUaWNrU2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc2NhbGUxLnJhbmdlQmFuZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgeCA9IHNjYWxlMSwgZHggPSB4LnJhbmdlQmFuZCgpIC8gMjtcbiAgICAgICAgICAgICAgICAgICAgc2NhbGUwID0gc2NhbGUxID0gZnVuY3Rpb24gKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4KGQpICsgZHg7XG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzY2FsZTAucmFuZ2VCYW5kKSB7XG4gICAgICAgICAgICAgICAgICAgIHNjYWxlMCA9IHNjYWxlMTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aWNrRXhpdC5jYWxsKHRpY2tUcmFuc2Zvcm0sIHNjYWxlMSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRpY2tFbnRlci5jYWxsKHRpY2tUcmFuc2Zvcm0sIHNjYWxlMCk7XG4gICAgICAgICAgICAgICAgdGlja1VwZGF0ZS5jYWxsKHRpY2tUcmFuc2Zvcm0sIHNjYWxlMSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBheGlzLnNjYWxlID0gZnVuY3Rpb24gKHgpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeyByZXR1cm4gc2NhbGU7IH1cbiAgICAgICAgICAgIHNjYWxlID0geDtcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLm9yaWVudCA9IGZ1bmN0aW9uICh4KSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIG9yaWVudDsgfVxuICAgICAgICAgICAgb3JpZW50ID0geCBpbiB7dG9wOiAxLCByaWdodDogMSwgYm90dG9tOiAxLCBsZWZ0OiAxfSA/IHggKyBcIlwiIDogXCJib3R0b21cIjtcbiAgICAgICAgICAgIHJldHVybiBheGlzO1xuICAgICAgICB9O1xuICAgICAgICBheGlzLnRpY2tGb3JtYXQgPSBmdW5jdGlvbiAoZm9ybWF0KSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHRpY2tGb3JtYXQ7IH1cbiAgICAgICAgICAgIHRpY2tGb3JtYXQgPSBmb3JtYXQ7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrQ2VudGVyZWQgPSBmdW5jdGlvbiAoaXNDZW50ZXJlZCkge1xuICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrQ2VudGVyZWQ7IH1cbiAgICAgICAgICAgIHRpY2tDZW50ZXJlZCA9IGlzQ2VudGVyZWQ7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrT2Zmc2V0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRpY2tPZmZzZXQ7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja0ludGVydmFsID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGludGVydmFsLCBsZW5ndGg7XG4gICAgICAgICAgICBpZiAocGFyYW1zLmlzQ2F0ZWdvcnkpIHtcbiAgICAgICAgICAgICAgICBpbnRlcnZhbCA9IHRpY2tPZmZzZXQgKiAyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbGVuZ3RoID0gYXhpcy5nLnNlbGVjdCgncGF0aC5kb21haW4nKS5ub2RlKCkuZ2V0VG90YWxMZW5ndGgoKSAtIG91dGVyVGlja1NpemUgKiAyO1xuICAgICAgICAgICAgICAgIGludGVydmFsID0gbGVuZ3RoIC8gYXhpcy5nLnNlbGVjdEFsbCgnbGluZScpLnNpemUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBpbnRlcnZhbCA9PT0gSW5maW5pdHkgPyAwIDogaW50ZXJ2YWw7XG4gICAgICAgIH07XG4gICAgICAgIGF4aXMudGlja3MgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHRpY2tBcmd1bWVudHM7IH1cbiAgICAgICAgICAgIHRpY2tBcmd1bWVudHMgPSBhcmd1bWVudHM7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrQ3VsbGluZyA9IGZ1bmN0aW9uIChjdWxsaW5nKSB7XG4gICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsgcmV0dXJuIHRpY2tDdWxsaW5nOyB9XG4gICAgICAgICAgICB0aWNrQ3VsbGluZyA9IGN1bGxpbmc7XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgYXhpcy50aWNrVmFsdWVzID0gZnVuY3Rpb24gKHgpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgeCA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgIHRpY2tWYWx1ZXMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB4KHNjYWxlLmRvbWFpbigpKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSB7IHJldHVybiB0aWNrVmFsdWVzOyB9XG4gICAgICAgICAgICAgICAgdGlja1ZhbHVlcyA9IHg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYXhpcztcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIGF4aXM7XG4gICAgfVxuXG4gICAgYzNfY2hhcnRfaW50ZXJuYWxfZm4uaXNTYWZhcmkgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHZhciB1YSA9IHdpbmRvdy5uYXZpZ2F0b3IudXNlckFnZW50O1xuICAgICAgICByZXR1cm4gdWEuaW5kZXhPZignU2FmYXJpJykgPj0gMCAmJiB1YS5pbmRleE9mKCdDaHJvbWUnKSA8IDA7XG4gICAgfTtcbiAgICBjM19jaGFydF9pbnRlcm5hbF9mbi5pc0Nocm9tZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIHVhID0gd2luZG93Lm5hdmlnYXRvci51c2VyQWdlbnQ7XG4gICAgICAgIHJldHVybiB1YS5pbmRleE9mKCdDaHJvb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RoU2VnQXJyYXkuZm9yRWFjaChmdW5jdGlvbihwYXRoU2VnKSB7XG4gICAgICAgICAgICAgICAgIGlmIChmaXJzdCkge1xuICAgICAgICAgICAgICAgICAgICAgZmlyc3QgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBwYXRoU2VnLl9hc1BhdGhTdHJpbmcoKTtcbiAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBcIiBcIiArIHBhdGhTZWcuX2FzUGF0aFN0cmluZygpO1xuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgcmV0dXJuIHN0cmluZztcbiAgICAgICAgIH1cblxuICAgICAgICAgLy8gVGhpcyBjbG9zZWx5IGZvbGxvd3MgU1ZHUGF0aFBhcnNlcjo6cGFyc2VQYXRoIGZyb20gU291cmNlL2NvcmUvc3ZnL1NWR1BhdGhQYXJzZXIuY3BwLlxuICAgICAgICAgU1ZHUGF0aFNlZ0xpc3QucHJvdG90eXBlLl9wYXJzZVBhdGggPSBmdW5jdGlvbihzdHJpbmcpIHtcbiAgICAgICAgICAgICBpZiAoIXN0cmluZyB8fCBzdHJpbmcubGVuZ3RoID09IDApXG4gICAgICAgICAgICAgICAgIHJldHVybiBbXTtcblxuICAgICAgICAgICAgIHZhciBvd25pbmdQYXRoU2VnTGlzdCA9IHRoaXM7XG5cbiAgICAgICAgICAgICB2YXIgQnVpbGRlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB0aGlzLnBhdGhTZWdMaXN0ID0gW107XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgQnVpbGRlci5wcm90b3R5cGUuYXBwZW5kU2VnbWVudCA9IGZ1bmN0aW9uKHBhdGhTZWcpIHtcbiAgICAgICAgICAgICAgICAgdGhpcy5wYXRoU2VnTGlzdC5wdXNoKHBhdGhTZWcpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIHZhciBTb3VyY2UgPSBmdW5jdGlvbihzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICAgdGhpcy5fc3RyaW5nID0gc3RyaW5nO1xuICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXggPSAwO1xuICAgICAgICAgICAgICAgICB0aGlzLl9lbmRJbmRleCA9IHRoaXMuX3N0cmluZy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgIHRoaXMuX3ByZXZpb3VzQ29tbWFuZCA9IFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOO1xuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3NraXBPcHRpb25hbFNwYWNlcygpO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX2lzQ3VycmVudFNwYWNlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHZhciBjaGFyYWN0ZXIgPSB0aGlzLl9zdHJpbmdbdGhpcy5fY3VycmVudEluZGV4XTtcbiAgICAgICAgICAgICAgICAgcmV0dXJuIGNoYXJhY3RlciA8PSBcIiBcIiAmJiAoY2hhcmFjdGVyID09IFwiIFwiIHx8IGNoYXJhY3RlciA9PSBcIlxcblwiIHx8IGNoYXJhY3RlciA9PSBcIlxcdFwiIHx8IGNoYXJhY3RlciA9PSBcIlxcclwiIHx8IGNoYXJhY3RlciA9PSBcIlxcZlwiKTtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLl9za2lwT3B0aW9uYWxTcGFjZXMgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX2lzQ3VycmVudFNwYWNlKCkpXG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4O1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3NraXBPcHRpb25hbFNwYWNlc09yRGVsaW1pdGVyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiAhdGhpcy5faXNDdXJyZW50U3BhY2UoKSAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgIT0gXCIsXCIpXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIixcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3NraXBPcHRpb25hbFNwYWNlcygpO1xuICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleDtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLmhhc01vcmVEYXRhID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleDtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLnBlZWtTZWdtZW50VHlwZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICB2YXIgbG9va2FoZWFkID0gdGhpcy5fc3RyaW5nW3RoaXMuX2N1cnJlbnRJbmRleF07XG4gICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9wYXRoU2VnVHlwZUZyb21DaGFyKGxvb2thaGVhZCk7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5fcGF0aFNlZ1R5cGVGcm9tQ2hhciA9IGZ1bmN0aW9uKGxvb2thaGVhZCkge1xuICAgICAgICAgICAgICAgICBzd2l0Y2ggKGxvb2thaGVhZCkge1xuICAgICAgICAgICAgICAgICBjYXNlIFwiWlwiOlxuICAgICAgICAgICAgICAgICBjYXNlIFwielwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DTE9TRVBBVEg7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJNXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJtXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJMXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJsXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJDXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fQ1VCSUNfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiY1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlFcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19RVUFEUkFUSUNfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwicVwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX1FVQURSQVRJQ19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJBXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0FSQ19BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJhXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0FSQ19SRUw7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJIXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19IT1JJWk9OVEFMX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcImhcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfTElORVRPX0hPUklaT05UQUxfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiVlwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fVkVSVElDQUxfQUJTO1xuICAgICAgICAgICAgICAgICBjYXNlIFwidlwiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fVkVSVElDQUxfUkVMO1xuICAgICAgICAgICAgICAgICBjYXNlIFwiU1wiOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19DVVJWRVRPX0NVQklDX1NNT09USF9BQlM7XG4gICAgICAgICAgICAgICAgIGNhc2UgXCJzXCI6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0NVUlZFVE9fQ1VCSUNfU01PT1RIX1JFTDtcbiAgICAgICAgICAgICAgICAgY2FzZSBcIlRcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19RVUFEUkFUSUNfU01PT1RIX0FCUztcbiAgICAgICAgICAgICAgICAgY2FzZSBcInRcIjpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfQ1VSVkVUT19RVUFEUkFUSUNfU01PT1RIX1JFTDtcbiAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTjtcbiAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX25leHRDb21tYW5kSGVscGVyID0gZnVuY3Rpb24obG9va2FoZWFkLCBwcmV2aW91c0NvbW1hbmQpIHtcbiAgICAgICAgICAgICAgICAgLy8gQ2hlY2sgZm9yIHJlbWFpbmluZyBjb29yZGluYXRlcyBpbiB0aGUgY3VycmVudCBjb21tYW5kLlxuICAgICAgICAgICAgICAgICBpZiAoKGxvb2thaGVhZCA9PSBcIitcIiB8fCBsb29rYWhlYWQgPT0gXCItXCIgfHwgbG9va2FoZWFkID09IFwiLlwiIHx8IChsb29rYWhlYWQgPj0gXCIwXCIgJiYgbG9va2FoZWFkIDw9IFwiOVwiKSkgJiYgcHJldmlvdXNDb21tYW5kICE9IFNWR1BhdGhTZWcuUEFUSFNFR19DTE9TRVBBVEgpIHtcbiAgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2aW91c0NvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19BQlMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fQUJTO1xuICAgICAgICAgICAgICAgICAgICAgaWYgKHByZXZpb3VzQ29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX1JFTClcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1ZHUGF0aFNlZy5QQVRIU0VHX0xJTkVUT19SRUw7XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJldmlvdXNDb21tYW5kO1xuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgIHJldHVybiBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTjtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICBTb3VyY2UucHJvdG90eXBlLmluaXRpYWxDb21tYW5kSXNNb3ZlVG8gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHBhdGggaXMgZW1wdHkgaXQgaXMgc3RpbGwgdmFsaWQsIHNvIHJldHVybiB0cnVlLlxuICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuaGFzTW9yZURhdGEoKSlcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgICB2YXIgY29tbWFuZCA9IHRoaXMucGVla1NlZ21lbnRUeXBlKCk7XG4gICAgICAgICAgICAgICAgIC8vIFBhdGggbXVzdCBzdGFydCB3aXRoIG1vdmVUby5cbiAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbW1hbmQgPT0gU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19BQlMgfHwgY29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX1JFTDtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAvLyBQYXJzZSBhIG51bWJlciBmcm9tIGFuIFNWRyBwYXRoLiBUaGlzIHZlcnkgY2xvc2VseSBmb2xsb3dzIGdlbmVyaWNQYXJzZU51bWJlciguLi4pIGZyb20gU291cmNlL2NvcmUvc3ZnL1NWR1BhcnNlclV0aWxpdGllcy5jcHAuXG4gICAgICAgICAgICAgLy8gU3BlYzogaHR0cDovL3d3dy53My5vcmcvVFIvU1ZHMTEvc2luZ2xlLXBhZ2UuaHRtbCNwYXRocy1QYXRoRGF0YUJORlxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUuX3BhcnNlTnVtYmVyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHZhciBleHBvbmVudCA9IDA7XG4gICAgICAgICAgICAgICAgIHZhciBpbnRlZ2VyID0gMDtcbiAgICAgICAgICAgICAgICAgdmFyIGZyYWMgPSAxO1xuICAgICAgICAgICAgICAgICB2YXIgZGVjaW1hbCA9IDA7XG4gICAgICAgICAgICAgICAgIHZhciBzaWduID0gMTtcbiAgICAgICAgICAgICAgICAgdmFyIGV4cHNpZ24gPSAxO1xuXG4gICAgICAgICAgICAgICAgIHZhciBzdGFydEluZGV4ID0gdGhpcy5fY3VycmVudEluZGV4O1xuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3NraXBPcHRpb25hbFNwYWNlcygpO1xuXG4gICAgICAgICAgICAgICAgIC8vIFJlYWQgdGhlIHNpZ24uXG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPCB0aGlzLl9lbmRJbmRleCAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPT0gXCIrXCIpXG4gICAgICAgICAgICAgICAgICA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QXQodGhpcy5fY3VycmVudEluZGV4KSA8PSBcIjlcIilcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrOyAvLyBBZHZhbmNlIHRvIGZpcnN0IG5vbi1kaWdpdC5cblxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4ICE9IHN0YXJ0SW50UGFydEluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgICB2YXIgc2NhbkludFBhcnRJbmRleCA9IHRoaXMuX2N1cnJlbnRJbmRleCAtIDE7XG4gICAgICAgICAgICAgICAgICAgICB2YXIgbXVsdGlwbGllciA9IDE7XG4gICAgICAgICAgICAgICAgICAgICB3aGlsZSAoc2NhbkludFBhcnRJbmRleCA+PSBzdGFydEludFBhcnRJbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgIGludGVnZXIgKz0gbXVsdGlwbGllciAqICh0aGlzLl9zdHJpbmcuY2hhckF0KHNjYW5JbnRQYXJ0SW5kZXgtLSkgLSBcIjBcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgbXVsdGlwbGllciAqPSAxMDtcbiAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgIC8vIFJlYWQgdGhlIGRlY2ltYWxzLlxuICAgICAgICAgICAgICAgICBpZiAodGhpcy5fY3VycmVudEluZGV4IDwgdGhpcy5fZW5kSW5kZXggJiYgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiLlwiKSB7XG4gICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcblxuICAgICAgICAgICAgICAgICAgICAgLy8gVGhlcmUgbXVzdCBiZSBhIGxlYXN0IG9uZSBkaWdpdCBmb2xsb3dpbmcgdGhlIC5cbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPj0gdGhpcy5f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AgICAgICB0aGlzLl9jdXJyZW50SW5kZXgrKztcblxuICAgICAgICAgICAgICAgICAgICAgLy8gUmVhZCB0aGUgc2lnbiBvZiB0aGUgZXhwb25lbnQuXG4gICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID09IFwiK1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA9PSBcIi1cIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgIGV4cHNpZ24gPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgLy8gVGhlcmUgbXVzdCBiZSBhbiBleHBvbmVudC5cbiAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPj0gdGhpcy5fZW5kSW5kZXggfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIDwgXCIwXCIgfHwgdGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpID4gXCI5XCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuX2N1cnJlbnRJbmRleCA8IHRoaXMuX2VuZEluZGV4ICYmIHRoaXMuX3N0cmluZy5jaGFyQXQodGhpcy5fY3VycmVudEluZGV4KSA+PSBcIjBcIiAmJiB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCkgPD0gXCI5XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHBvbmVudCAqPSAxMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICBleHBvbmVudCArPSAodGhpcy5fc3RyaW5nLmNoYXJBdCh0aGlzLl9jdXJyZW50SW5kZXgpIC0gXCIwXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgdmFyIG51bWJlciA9IGludGVnZXIgKyBkZWNpbWFsO1xuICAgICAgICAgICAgICAgICBudW1iZXIgKj0gc2lnbjtcblxuICAgICAgICAgICAgICAgICBpZiAoZXhwb25lbnQpXG4gICAgICAgICAgICAgICAgICAgICBudW1iZXIgKj0gTWF0aC5wb3coMTAsIGV4cHNpZ24gKiBleHBvbmVudCk7XG5cbiAgICAgICAgICAgICAgICAgaWYgKHN0YXJ0SW5kZXggPT0gdGhpcy5fY3VycmVudEluZGV4KVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgICAgICB0aGlzLl9za2lwT3B0aW9uYWxTcGFjZXNPckRlbGltaXRlcigpO1xuXG4gICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgU291cmNlLnByb3RvdHlwZS5fcGFyc2VBcmNGbGFnID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIGlmICh0aGlzLl9jdXJyZW50SW5kZXggPj0gdGhpcy5fZW5kSW5kZXgpXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICB2YXIgZmxhZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICB2YXIgZmxhZ0NoYXIgPSB0aGlzLl9zdHJpbmcuY2hhckF0KHRoaXMuX2N1cnJlbnRJbmRleCsrKTtcbiAgICAgICAgICAgICAgICAgaWYgKGZsYWdDaGFyID09IFwiMFwiKVxuICAgICAgICAgICAgICAgICAgICAgZmxhZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICBlbHNlIGlmIChmbGFnQ2hhciA9PSBcIjFcIilcbiAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSB0cnVlO1xuICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuXG4gICAgICAgICAgICAgICAgIHRoaXMuX3NraXBPcHRpb25hbFNwYWNlc09yRGVsaW1pdGVyKCk7XG4gICAgICAgICAgICAgICAgIHJldHVybiBmbGFnO1xuICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgIFNvdXJjZS5wcm90b3R5cGUucGFyc2VTZWdtZW50ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgIHZhciBsb29rYWhlYWQgPSB0aGlzLl9zdHJpbmdbdGhpcy5fY3VycmVudEluZGV4XTtcbiAgICAgICAgICAgICAgICAgdmFyIGNvbW1hbmQgPSB0aGlzLl9wYXRoU2VnVHlwZUZyb21DaGFyKGxvb2thaGVhZCk7XG4gICAgICAgICAgICAgICAgIGlmIChjb21tYW5kID09IFNWR1BhdGhTZWcuUEFUSFNFR19VTktOT1dOKSB7XG4gICAgICAgICAgICAgICAgICAgICAvLyBQb3NzaWJseSBhbiBpbXBsaWNpdCBjb21tYW5kLiBOb3QgYWxsb3dlZCBpZiB0aGlzIGlzIHRoZSBmaXJzdCBjb21tYW5kLlxuICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX3ByZXZpb3VzQ29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTilcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQgPSB0aGlzLl9uZXh0Q29tbWFuZEhlbHBlcihsb29rYWhlYWQsIHRoaXMuX3ByZXZpb3VzQ29tbWFuZCk7XG4gICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWFuZCA9PSBTVkdQYXRoU2VnLlBBVEhTRUdfVU5LTk9XTilcbiAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnRJbmRleCsrO1xuICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgdGhpcy5fcHJldmlvdXNDb21tYW5kID0gY29tbWFuZDtcblxuICAgICAgICAgICAgICAgICBzd2l0Y2ggKGNvbW1hbmQpIHtcbiAgICAgICAgICAgICAgICAgY2FzZSBTVkdQYXRoU2VnLlBBVEhTRUdfTU9WRVRPX1JFTDpcbiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU1ZHUGF0aFNlZ01vdmV0b1JlbChvd25pbmdQYXRoU2VnTGlzdCwgdGhpcy5fcGFyc2VOdW1iZXIoKSwgdGhpcy5fcGFyc2VOdW1iZXIoKSk7XG4gICAgICAgICAgICAgICAgIGNhc2UgU1ZHUGF0aFNlZy5QQVRIU0VHX01PVkVUT19BQlM6XG4gICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFNWR1BhdGhTZWdNb3ZldG9BYnMob3duaW5nUGF0aFNlZ0xpc3QsIHRoaXMuX3BhcnNlTnVtYmVyKCksIHRoaXMuX3BhcnNlTnVtYmVyKCkpO1xuICAgICAgICAgICAgICAgICBjYXNlIFNWR1BhdGhTZWcuUEFUSFNFR19MSU5FVE9fUkVMOlxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTVkdQYXRoU2VnTGluZXRvUmVsKG93bmluZ1BhdGhTZWdMaXN0LCB0aGlzLl9wYXJzZU51bWJlcigpLCB0aGlzLl9wYXJzZU51bWJlcigpKTtcbiAgICAgICAgICAgICAgICAgY2FzZSBTVkdQYXR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Td2VlcDogdGhpcy5fcGFyc2VBcmNGbGFnKCksIHg6IHRoaXMuX3BhcnNlTnVtYmVyKCksIHk6IHRoaXMuX3BhcnNlTnVtYmVyKCl9O1xuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBTVkdQYXRoU2VnQXJjQWJzKG93bmluZ1BhdGhTZWdMaXN0LCBwb2ludHMueCwgcG9pbnRzLnksIHBvaW50cy54MSwgcG9pbnRzLnkxLCBwb2ludHMuYXJjQW5nbGUsIHBvaW50cy5hcmNMYXJnZSwgcG9pbnRzLmFyY1N3ZWVwKTtcbiAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgIHRocm93IFwiVW5rbm93biBwYXRoIHNlZyB0eXBlLlwiXG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICB2YXIgYnVpbGRlciA9IG5ldyBCdWlsZGVyKCk7XG4gICAgICAgICAgICAgdmFyIHNvdXJjZSA9IG5ldyBTb3VyY2Uoc3RyaW5nKTtcblxuICAgICAgICAgICAgIGlmICghc291cmNlLmluaXRpYWxDb21tYW5kSXNNb3ZlVG8oKSlcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICAgICAgIHdoaWxlIChzb3VyY2UuaGFzTW9yZURhdGEoKSkge1xuICAgICAgICAgICAgICAgICB2YXIgcGF0aFNlZyA9IHNvdXJjZS5wYXJzZVNlZ21lbnQoKTtcbiAgICAgICAgICAgICAgICAgaWYgKCFwYXRoU2VnKVxuICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICAgICAgICAgICBidWlsZGVyLmFwcGVuZFNlZ21lbnQocGF0aFNlZyk7XG4gICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgcmV0dXJuIGJ1aWxkZXIucGF0aFNlZ0xpc3Q7XG4gICAgICAgICB9XG4gICAgIH1cbiAgICB9KCkpO1xuXG4gICAgLyogan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H0gZWxzZSBpZiAobm9kZSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgdXBkYXRlTm9kZXNbaV0gPSBub2RlO1xuICAgICAgICAgICAgbm9kZS5fX2RhdGFfXyA9IG5vZGVEYXRhO1xuICAgICAgICAgIH1cbiAgICAgICAgICBub2RlQnlLZXlWYWx1ZS5zZXQoa2V5VmFsdWUsIHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoaSA9IC0xOyArK2kgPCBuOyApIHtcbiAgICAgICAgICBpZiAoaSBpbiBrZXlWYWx1ZXMgJiYgbm9kZUJ5S2V5VmFsdWUuZ2V0KGtleVZhbHVlc1tpXSkgIT09IHRydWUpIHtcbiAgICAgICAgICAgIGV4aXROb2Rlc1tpXSA9IGdyb3VwW2ldO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZm9yIChpID0gLTE7ICsraSA8IG4wOyApIHtcbiAgICAgICAgICBub2RlID0gZ3JvdXBbaV07XG4gICAgICAgICAgbm9kZURhdGEgPSBncm91cERhdGFbaV07XG4gICAgICAgICAgaWYgKG5vZGUpIHtcbiAgICAgICAgICAgIG5vZGUuX19kYXRhX18gPSBub2RlRGF0YTtcbiAgICAgICAgICAgIHVwZGF0ZU5vZGVzW2ldID0gbm9kZTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZW50ZXJOb2Rlc1tpXSA9IGQzX3NlbGVjdGlvbl9kYXRhTm9kZShub2RlRGF0YSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAoO2kgPCBtOyArK2kpIHtcbiAgICAgICAgICBlbnRlck5vZGVzW2ldID0gZDNfc2VsZWN0aW9uX2RhdGFOb2RlKGdyb3VwRGF0YVtpXSk7XG4gICAgICAgIH1cbiAgICAgICAgZm9yICg7aSA8IG47ICsraSkge1xuICAgICAgICAgIGV4aXROb2Rlc1tpXSA9IGdyb3VwW2ldO1xuICAgICAgIC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ID0gY2VudGVyMCA/IGNlbnRlcjBbMF0gOiBkeCAvIDIsIGN5ID0gY2VudGVyMCA/IGNlbnRlcjBbMV0gOiBkeSAvIDIsIGkgPSBkMy5pbnRlcnBvbGF0ZVpvb20oWyAoY3ggLSB2aWV3LngpIC8gdmlldy5rLCAoY3kgLSB2aWV3LnkpIC8gdmlldy5rLCBkeCAvIHZpZXcuayBdLCBbIChjeCAtIHZpZXcxLngpIC8gdmlldzEuaywgKGN5IC0gdmlldzEueSkgLyB2aWV3MS5rLCBkeCAvIHZpZXcxLmsgXSk7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odCkge1xuICAgICAgICAgICAgICB2YXIgbCA9IGkodCksIGsgPSBkeCAvIGxbMl07XG4gICAgICAgICAgICAgIHRoaXMuX19jaGFydF9fID0gdmlldyA9IHtcbiAgICAgICAgICAgICAgICB4OiBjeCAtIGxbMF0gKiBrLFxuICAgICAgICAgICAgICAgIHk6IGN5IC0gbFsxXSAqIGssXG4gICAgICAgICAgICAgICAgazoga1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB6b29tZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KS5lYWNoKFwiaW50ZXJydXB0Lnpvb21cIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB6b29tZW5kZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIH0pLmVhY2goXCJlbmQuem9vbVwiLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGhpcy5fX2NoYXJ0X18gPSB2aWV3O1xuICAgICAgICAgIHpvb21zdGFydGVkKGRpc3BhdGNoKTtcbiAgICAgICAgICB6b29tZWQoZGlzcGF0Y2gpO1xuICAgICAgICAgIHpvb21lbmRlZChkaXNwYXRjaCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgIH07XG4gICAgem9vbS50cmFuc2xhdGUgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBbIHZpZXcueCwgdmlldy55IF07XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiArX1swXSxcbiAgICAgICAgeTogK19bMV0sXG4gICAgICAgIGs6IHZpZXcua1xuICAgICAgfTtcbiAgICAgIHJlc2NhbGUoKTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5zY2FsZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHZpZXcuaztcbiAgICAgIHZpZXcgPSB7XG4gICAgICAgIHg6IHZpZXcueCxcbiAgICAgICAgeTogdmlldy55LFxuICAgICAgICBrOiBudWxsXG4gICAgICB9O1xuICAgICAgc2NhbGVUbygrXyk7XG4gICAgICByZXNjYWxlKCk7XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2NhbGVFeHRlbnQgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzY2FsZUV4dGVudDtcbiAgICAgIHNjYWxlRXh0ZW50ID0gXyA9PSBudWxsID8gZDNfYmVoYXZpb3Jfem9vbUluZmluaXR5IDogWyArX1swXSwgK19bMV0gXTtcbiAgICAgIHJldHVybiB6b29tO1xuICAgIH07XG4gICAgem9vbS5jZW50ZXIgPSBmdW5jdGlvbihfKSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjZW50ZXI7XG4gICAgICBjZW50ZXIgPSBfICYmIFsgK19bMF0sICtfWzFdIF07XG4gICAgICByZXR1cm4gem9vbTtcbiAgICB9O1xuICAgIHpvb20uc2l6ZSA9IGZ1bmN0aW9uKF8pIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNpemU7XG4gICAgICBzaXplID0gXyAmJiBbICtfWzBdLCArX1sxXSBdO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLmR1cmF0aW9uID0gZnVuY3Rpb24oXykge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZHVyYXRpb247XG4gICAgICBkdXJhdGlvbiA9ICtfO1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnggPSBmdW5jdGlvbih6KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4MTtcbiAgICAgIHgxID0gejtcbiAgICAgIHgwID0gei5jb3B5KCk7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiAwLFxuICAgICAgICB5OiAwLFxuICAgICAgICBrOiAxXG4gICAgICB9O1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICB6b29tLnkgPSBmdW5jdGlvbih6KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5MTtcbiAgICAgIHkxID0gejtcbiAgICAgIHkwID0gei5jb3B5KCk7XG4gICAgICB2aWV3ID0ge1xuICAgICAgICB4OiAwLFxuICAgICAgICB5OiAwLFxuICAgICAgICBrOiAxXG4gICAgICB9O1xuICAgICAgcmV0dXJuIHpvb207XG4gICAgfTtcbiAgICBmdW5jdGlvbiBsb2NhdGlvbihwKSB7XG4gICAgICByZXR1cm4gWyAocFswXSAtIHZpZXcueCkgLyB2aWV3LmssIChwWzFdIC0gdmlldy55KSAvIHZpZXcuayBdO1xuICAgIH1cbiAgICBmdW5jdGlvbiBwb2ludChsKSB7XG4gICAgICByZXR1cm4gWyBsWzBdICogdmlldy5rICsgdmlldy54LCBsWzFdICogdmlldy5rICsgdmlldy55IF07XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNjYWxlVG8ocykge1xuICAgICAgdmlld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G4gICAgICBtMiA9IG0xWzJdLnNwbGl0KFwiLFwiKTtcbiAgICAgIHN3aXRjaCAobTFbMV0pIHtcbiAgICAgICBjYXNlIFwiaHNsXCI6XG4gICAgICAgIHtcbiAgICAgICAgICByZXR1cm4gaHNsKHBhcnNlRmxvYXQobTJbMF0pLCBwYXJzZUZsb2F0KG0yWzFdKSAvIDEwMCwgcGFyc2VGbG9hdChtMlsyXSkgLyAxMDApO1xuICAgICAgICB9XG5cbiAgICAgICBjYXNlIFwicmdiXCI6XG4gICAgICAgIHtcbiAgICAgICAgICByZXR1cm4gcmdiKGQzX3JnYl9wYXJzZU51bWJlcihtMlswXSksIGQzX3JnYl9wYXJzZU51bWJlcihtMlsxXSksIGQzX3JnYl9wYXJzZU51bWJlcihtMlsyXSkpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGlmIChjb2xvciA9IGQzX3JnYl9uYW1lcy5nZXQoZm9ybWF0KSkge1xuICAgICAgcmV0dXJuIHJnYihjb2xvci5yLCBjb2xvci5nLCBjb2xvci5iKTtcbiAgICB9XG4gICAgaWYgKGZvcm1hdCAhPSBudWxsICYmIGZvcm1hdC5jaGFyQXQoMCkgPT09IFwiI1wiICYmICFpc05hTihjb2xvciA9IHBhcnNlSW50KGZvcm1hdC5zbGljZSgxKSwgMTYpKSkge1xuICAgICAgaWYgKGZvcm1hdC5sZW5ndGggPT09IDQpIHtcbiAgICAgICAgciA9IChjb2xvciAmIDM4NDApID4+IDQ7XG4gICAgICAgIHIgPSByID4+IDQgfCByO1xuICAgICAgICBnID0gY29sb3IgJiAyNDA7XG4gICAgICAgIGcgPSBnID4+IDQgfCBnO1xuICAgICAgICBiID0gY29sb3IgJiAxNTtcbiAgICAgICAgYiA9IGIgPDwgNCB8IGI7XG4gICAgICB9IGVsc2UgaWYgKGZvcm1hdC5sZW5ndGggPT09IDcpIHtcbiAgICAgICAgciA9IChjb2xvciAmIDE2NzExNjgwKSA+PiAxNjtcbiAgICAgICAgZyA9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24ocm93LCBpKSB7XG4gICAgICAgIGlmIChvKSByZXR1cm4gbyhyb3csIGkgLSAxKTtcbiAgICAgICAgdmFyIGEgPSBuZXcgRnVuY3Rpb24oXCJkXCIsIFwicmV0dXJuIHtcIiArIHJvdy5tYXAoZnVuY3Rpb24obmFtZSwgaSkge1xuICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShuYW1lKSArIFwiOiBkW1wiICsgaSArIFwiXVwiO1xuICAgICAgICB9KS5qb2luKFwiLFwiKSArIFwifVwiKTtcbiAgICAgICAgbyA9IGYgPyBmdW5jdGlvbihyb3csIGkpIHtcbiAgICAgICAgICByZXR1cm4gZihhKHJvdyksIGkpO1xuICAgICAgICB9IDogYTtcbiAgICAgIH0pO1xuICAgIH07XG4gICAgZHN2LnBhcnNlUm93cyA9IGZ1bmN0aW9uKHRleHQsIGYpIHtcbiAgICAgIHZhciBFT0wgPSB7fSwgRU9GID0ge30sIHJvd3MgPSBbXSwgTiA9IHRleHQubGVuZ3RoLCBJID0gMCwgbiA9IDAsIHQsIGVvbDtcbiAgICAgIGZ1bmN0aW9uIHRva2VuKCkge1xuICAgICAgICBpZiAoSSA+PSBOKSByZXR1cm4gRU9GO1xuICAgICAgICBpZiAoZW9sKSByZXR1cm4gZW9sID0gZmFsc2UsIEVPTDtcbiAgICAgICAgdmFyIGogPSBJO1xuICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGopID09PSAzNCkge1xuICAgICAgICAgIHZhciBpID0gajtcbiAgICAgICAgICB3aGlsZSAoaSsrIDwgTikge1xuICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpKSA9PT0gMzQpIHtcbiAgICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpICsgMSkgIT09IDM0KSBicmVhaztcbiAgICAgICAgICAgICAgKytpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBJID0gaSArIDI7XG4gICAgICAgICAgdmFyIGMgPSB0ZXh0LmNoYXJDb2RlQXQoaSArIDEpO1xuICAgICAgICAgIGlmIChjID09PSAxMykge1xuICAgICAgICAgICAgZW9sID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaSArIDIpID09PSAxMCkgKytJO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYyA9PT0gMTApIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB0ZXh0LnNsaWNlKGogKyAxLCBpKS5yZXBsYWNlKC9cIlwiL2csICdcIicpO1xuICAgICAgICB9XG4gICAgICAgIHdoaWxlIChJIDwgTikge1xuICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KEkrKyksIGsgPSAxO1xuICAgICAgICAgIGlmIChjID09PSAxMCkgZW9sID0gdHJ1ZTsgZWxzZSBpZiAoYyA9PT0gMTMpIHtcbiAgICAgICAgICAgIGVvbCA9IHRydWU7XG4gICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KEkpID09PSAxMCkgKytJLCArK2s7XG4gICAgICAgICAgfSBlbHNlIGlmIChjICE9PSBkZWxpbWl0ZXJDb2RlKSBjb250aW51ZTtcbiAgICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqLCBJIC0gayk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRleHQuc2xpY2Uoaik7XG4gICAgICB9XG4gICAgICB3aGlsZSAoKHQgPSB0b2tlbigpKSAhPT0gRU9GKSB7XG4gICAgICAgIHZhciBhID0gW107XG4gICAgICAgIHdoaWxlICh0ICE9PSBFT0wgJiYgdCAhPT0gRU9GKSB7XG4gICAgICAgICAgYS5wdXNoKHQpO1xuICAgICAgICAgIHQgPSB0b2tlbigpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChmICYmIChhID0gZihhLCBuKyspKSA9PSBudWxsKSBjb250aW51ZTtcbiAgICAgICAgcm93cy5wdXNoKGEpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHJvd3M7XG4gICAgfTtcbiAgICBkc3YuZm9ybWF0ID0gZnVuY3Rpb24ocm93cykge1xuICAgICAgaWYgKEFycmF5LmlzQXJyYXkocm93c1swXSkpIHJldHVybiBkc3YuZm9ybWF0Um93cyhyb3dzKTtcbiAgICAgIHZhciBmaWVsZFNldCA9IG5ldyBkM19TZXQoKSwgZmllbGRzID0gW107XG4gICAgICByb3dzLmZvckVhY2goZnVuY3Rpb24ocm93KSB7XG4gICAgICAgIGZvciAodmFyIGZpZWxkIGluIHJvdykge1xuICAgICAgICAgIGlmICghZmllbGRTZXQuaGFzKGZpZWxkKSkge1xuICAgICAgICAgICAgZmllbGRzLnB1c2goZmllbGRTZXQuYWRkKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIHJldHVybiBbIGZpZWxkcy5tYXAoZm9ybWF0VmFsdWUpLmpvaW4oZGVsaW1pdGVyKSBdLmNvbmNhdChyb3dzLm1hcChmdW5jdGlvbihyb3cpIHtcbiAgICAgICAgcmV0dXJuIGZpZWxkcy5tYXAoZnVuY3Rpb24oZmllbGQpIHtcbiAgICAgICAgICByZXR1cm4gZm9ybWF0VmFsdWUocm93W2ZpZWxkXSk7XG4gICAgICAgIH0pLmpvaW4oZGVsaW1pdGVyKTtcbiAgICAgIH0pKS5qb2luKFwiXFxuXCIpO1xuICAgIH07XG4gICAgZHN2LmZvcm1hdFJvd3MgPSBmdW5jdGlvbihyb3dzKSB7XG4gICAgICByZXR1cm4gcm93cy5tYXAoZm9ybWF0Um93KS5qb2luKFwiXFxuXCIpO1xuICAgIH07XG4gICAgZnVuY3Rpb24gZm9ybWF0Um93KHJvdykge1xuICAgICAgcmV0dXJuIHJvdy5tYXAoZm9ybWF0VmFsdWUpLmpvaW4oZGVsaW1pdGVyKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gZm9ybWF0VmFsdWUodGV4dCkge1xuICAgICAgcm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4gICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgZDNfZGF0ZSA9IERhdGU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGZvcm1hdC5wYXJzZSA9IGZ1bmN0aW9uKHN0cmluZykge1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGQzX2RhdGUgPSBkM19kYXRlX3V0YztcbiAgICAgICAgICB2YXIgZGF0ZSA9IGxvY2FsLnBhcnNlKHN0cmluZyk7XG4gICAgICAgICAgcmV0dXJuIGRhdGUgJiYgZGF0ZS5fO1xuICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgIGQzX2RhdGUgPSBEYXRlO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZm9ybWF0LnRvU3RyaW5nID0gbG9jYWwudG9TdHJpbmc7XG4gICAgICByZXR1cm4gZm9ybWF0O1xuICAgIH07XG4gICAgZDNfdGltZV9mb3JtYXQubXVsdGkgPSBkM190aW1lX2Zvcm1hdC51dGMubXVsdGkgPSBkM190aW1lX2Zvcm1hdE11bHRpO1xuICAgIHZhciBkM190aW1lX3BlcmlvZExvb2t1cCA9IGQzLm1hcCgpLCBkM190aW1lX2RheVJlID0gZDNfdGltZV9mb3JtYXRSZShsb2NhbGVfZGF5cyksIGQzX3RpbWVfZGF5TG9va3VwID0gZDNfdGltZV9mb3JtYXRMb29rdXAobG9jYWxlX2RheXMpLCBkM190aW1lX2RheUFiYnJldlJlID0gZDNfdGltZV9mb3JtYXRSZShsb2NhbGVfc2hvcnREYXlzKSwgZDNfdGltZV9kYXlBYmJyZXZMb29rdXAgPSBkM190aW1lX2Zvcm1hdExvb2t1cChsb2NhbGVfc2hvcnREYXlzKSwgZDNfdGltZV9tb250aFJlID0gZDNfdGltZV9mb3JtYXRSZShsb2NhbGVfbW9udGhzKSwgZDNfdGltZV9tb250aExvb2t1cCA9IGQzX3RpbWVfZm9ybWF0TG9va3VwKGxvY2FsZV9tb250aHMpLCBkM190aW1lX21vbnRoQWJicmV2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DPhjEgPSDPhmk7XG4gICAgICAgIH0gZWxzZSBpZiAozrtpID0gKM67aSArIDM2MCkgJSAzNjAgLSAxODAsIGFudGltZXJpZGlhbiBeIChzICogzrtfIDwgzrtpICYmIM67aSA8IHMgKiDOuykpIHtcbiAgICAgICAgICB2YXIgz4ZpID0gLWluZmxlY3Rpb25bMV0gKiBkM19kZWdyZWVzO1xuICAgICAgICAgIGlmICjPhmkgPCDPhjApIM+GMCA9IM+GaTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoz4YgPCDPhjApIM+GMCA9IM+GO1xuICAgICAgICAgIGlmICjPhiA+IM+GMSkgz4YxID0gz4Y7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFudGltZXJpZGlhbikge1xuICAgICAgICAgIGlmICjOuyA8IM67Xykge1xuICAgICAgICAgICAgaWYgKGFuZ2xlKM67MCwgzrspID4gYW5nbGUozrswLCDOuzEpKSDOuzEgPSDOuztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGFuZ2xlKM67LCDOuzEpID4gYW5nbGUozrswLCDOuzEpKSDOuzAgPSDOuztcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKM67MSA+PSDOuzApIHtcbiAgICAgICAgICAgIGlmICjOuyA8IM67MCkgzrswID0gzrs7XG4gICAgICAgICAgICBpZiAozrsgPiDOuzEpIM67MSA9IM67O1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAozrsgPiDOu18pIHtcbiAgICAgICAgICAgICAgaWYgKGFuZ2xlKM67MCwgzrspID4gYW5nbGUozrswLCDOuzEpKSDOuzEgPSDOuztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChhbmdsZSjOuywgzrsxKSA+IGFuZ2xlKM67MCwgzrsxKSkgzrswID0gzrs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG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7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50Lm47XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGlzU3ViamVjdCkge1xuICAgICAgICAgICAgcG9pbnRzID0gY3VycmVudC5wLno7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gcG9pbnRzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSBsaXN0ZW5lci5wb2ludCgocG9pbnQgPSBwb2ludHNbaV0pWzBdLCBwb2ludFsxXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGludGVycG9sYXRlKGN1cnJlbnQueCwgY3VycmVudC5wLngsIC0xLCBsaXN0ZW5lcik7XG4gICAgICAgICAgfVxuICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50LnA7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVudCA9IGN1cnJlbnQubztcbiAgICAgICAgcG9pbnRzID0gY3VycmVudC56O1xuICAgICAgICBpc1N1YmplY3QgPSAhaXNTdWJqZWN0O1xuICAgICAgfSB3aGlsZSAoIWN1cnJlbnQudik7XG4gICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgfVxuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19jbGlwUG9seWdvbkxpbmtDaXJjdWxhcihhcnJheSkge1xuICAgIGlmICghKG4gPSBhcnJheS5sZW5ndGgpKSByZXR1cm47XG4gICAgdmFyIG4sIGkgPSAwLCBhID0gYXJyYXlbMF0sIGI7XG4gICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgIGEubiA9IGIgPSBhcnJheVtpXTtcbiAgICAgIGIucCA9IGE7XG4gICAgICBhID0gYjtcbiAgICB9XG4gICAgYS5uID0gYiA9IGFycmF5WzBdO1xuICAgIGIucCA9IGE7XG4gIH1cbiAgZnVuY3Rpb24gZDNfZ2VvX2NsaXBQb2x5Z29uSW50ZXJzZWN0aW9uKHBvaW50LCBwb2ludHM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G51bGwsIDEsIGxpc3RlbmVyKTtcbiAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9seWdvbkVuZCgpO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgZnVuY3Rpb24gcG9pbnQozrssIM+GKSB7XG4gICAgICAgIHZhciBwb2ludCA9IHJvdGF0ZSjOuywgz4YpO1xuICAgICAgICBpZiAocG9pbnRWaXNpYmxlKM67ID0gcG9pbnRbMF0sIM+GID0gcG9pbnRbMV0pKSBsaXN0ZW5lci5wb2ludCjOuywgz4YpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gcG9pbnRMaW5lKM67LCDPhikge1xuICAgICAgICB2YXIgcG9pbnQgPSByb3RhdGUozrssIM+GKTtcbiAgICAgICAgbGluZS5wb2ludChwb2ludFswXSwgcG9pbnRbMV0pO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZVN0YXJ0KCkge1xuICAgICAgICBjbGlwLnBvaW50ID0gcG9pbnRMaW5lO1xuICAgICAgICBsaW5lLmxpbmVTdGFydCgpO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gbGluZUVuZCgpIHtcbiAgICAgICAgY2xpcC5wb2ludCA9IHBvaW50O1xuICAgICAgICBsaW5lLmxpbmVFbmQoKTtcbiAgICAgIH1cbiAgICAgIHZhciBzZWdtZW50cztcbiAgICAgIHZhciBidWZmZXIgPSBkM19nZW9fY2xpcEJ1ZmZlckxpc3RlbmVyKCksIHJpbmdMaXN0ZW5lciA9IGNsaXBMaW5lKGJ1ZmZlciksIHBvbHlnb25TdGFydGVkID0gZmFsc2UsIHBvbHlnb24sIHJpbmc7XG4gICAgICBmdW5jdGlvbiBwb2ludFJpbmcozrssIM+GKSB7XG4gICAgICAgIHJpbmcucHVzaChbIM67LCDPhiBdKTtcbiAgICAgICAgdmFyIHBvaW50ID0gcm90YXRlKM67LCDPhik7XG4gICAgICAgIHJpbmdMaXN0ZW5lci5w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XJ0KCk7XG4gICAgICAgICAgbGlzdGVuZXIucG9pbnQoc867MSwgz4YwKTtcbiAgICAgICAgICBsaXN0ZW5lci5wb2ludCjOuzEsIM+GMCk7XG4gICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICB9IGVsc2UgaWYgKHPOuzAgIT09IHPOuzEgJiYgZM67ID49IM+AKSB7XG4gICAgICAgICAgaWYgKGFicyjOuzAgLSBzzrswKSA8IM61KSDOuzAgLT0gc867MCAqIM61O1xuICAgICAgICAgIGlmIChhYnMozrsxIC0gc867MSkgPCDOtSkgzrsxIC09IHPOuzEgKiDOtTtcbiAgICAgICAgICDPhjAgPSBkM19nZW9fY2xpcEFudGltZXJpZGlhbkludGVyc2VjdCjOuzAsIM+GMCwgzrsxLCDPhjEpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzAsIM+GMCk7XG4gICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHPOuzEsIM+GMCk7XG4gICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICB9XG4gICAgICAgIGxpc3RlbmVyLnBvaW50KM67MCA9IM67MSwgz4YwID0gz4YxKTtcbiAgICAgICAgc867MCA9IHPOuzE7XG4gICAgICB9LFxuICAgICAgbGluZUVuZDogZnVuY3Rpb24oKSB7XG4gICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgzrswID0gz4YwID0gTmFOO1xuICAgICAgfSxcbiAgICAgIGNsZWFuOiBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIDIgLSBjbGVhbjtcbiAgICAgIH1cbiAgICB9O1xuICB9XG4gIGZ1bmN0aW9uIGQzX2dlb19jbGlwQW50aW1lcmlkaWFuSW50ZXJzZWN0KM67MCwgz4YwLCDOuzEsIM+GMSkge1xuICAgIHZhciBjb3PPhjAsIGNvc8+G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gICAgIHZhciBwb2ludDEgPSBbIM67LCDPhiBdLCBwb2ludDIsIHYgPSB2aXNpYmxlKM67LCDPhiksIGMgPSBzbWFsbFJhZGl1cyA/IHYgPyAwIDogY29kZSjOuywgz4YpIDogdiA/IGNvZGUozrsgKyAozrsgPCAwID8gz4AgOiAtz4ApLCDPhikgOiAwO1xuICAgICAgICAgIGlmICghcG9pbnQwICYmICh2MDAgPSB2MCA9IHYpKSBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICBpZiAodiAhPT0gdjApIHtcbiAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICBpZiAoZDNfZ2VvX3NwaGVyaWNhbEVxdWFsKHBvaW50MCwgcG9pbnQyKSB8fCBkM19nZW9fc3BoZXJpY2FsRXF1YWwocG9pbnQxLCBwb2ludDIpKSB7XG4gICAgICAgICAgICAgIHBvaW50MVswXSArPSDOtTtcbiAgICAgICAgICAgICAgcG9pbnQxWzFdICs9IM61O1xuICAgICAgICAgICAgICB2ID0gdmlzaWJsZShwb2ludDFbMF0sIHBvaW50MVsxXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh2ICE9PSB2MCkge1xuICAgICAgICAgICAgY2xlYW4gPSAwO1xuICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDEsIHBvaW50MCk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBvaW50MiA9IGludGVyc2VjdChwb2ludDAsIHBvaW50MSk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHBvaW50MlswXSwgcG9pbnQyWzFdKTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZUVuZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcG9pbnQwID0gcG9pbnQyO1xuICAgICAgICAgIH0gZWxzZSBpZiAobm90SGVtaXNwaGVyZSAmJiBwb2ludDAgJiYgc21hbGxSYWRpdXMgXiB2KSB7XG4gICAgICAgICAgICB2YXIgdDtcbiAgICAgICAgICAgIGlmICghKGMgJiBjMCkgJiYgKHQgPSBpbnRlcnNlY3QocG9pbnQxLCBwb2ludDAsIHRydWUpKSkge1xuICAgICAgICAgICAgICBjbGVhbiA9IDA7XG4gICAgICAgICAgICAgIGlmIChzbWFsbFJhZGl1cykge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMF1bMF0sIHRbMF1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHRbMV1bMF0sIHRbMV1bMV0pO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5wb2ludCh0WzFdWzBdLCB0WzFdWzFdKTtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQodFswXVswXSwgdFswXVsxXSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHYgJiYgKCFwb2ludDAgfHwgIWQzX2dlb19zcGhlcmljYWxFcXVhbChwb2ludDAsIHBvaW50MSkpKSB7XG4gICAgICAgICAgICBsaXN0ZW5lci5wb2ludChwb2ludDFbMF0sIHBvaW50MVsxXSk7XG4gICAgICAgICAgfVxuICA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lb19zcGhlcmljYWwocTEpIF07XG4gICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIGNvZGUozrssIM+GKSB7XG4gICAgICB2YXIgciA9IHNtYWxsUmFkaXVzID8gcmFkaXVzIDogz4AgLSByYWRpdXMsIGNvZGUgPSAwO1xuICAgICAgaWYgKM67IDwgLXIpIGNvZGUgfD0gMTsgZWxzZSBpZiAozrsgPiByKSBjb2RlIHw9IDI7XG4gICAgICBpZiAoz4YgPCAtcikgY29kZSB8PSA0OyBlbHNlIGlmICjPhiA+IHIpIGNvZGUgfD0gODtcbiAgICAgIHJldHVybiBjb2RlO1xuICAgIH1cbiAgfVxuICBmdW5jdGlvbiBkM19nZW9tX2NsaXBMaW5lKHgwLCB5MCwgeDEsIHkxKSB7XG4gICAgcmV0dXJuIGZ1bmN0aW9uKGxpbmUpIHtcbiAgICAgIHZhciBhID0gbGluZS5hLCBiID0gbGluZS5iLCBheCA9IGEueCwgYXkgPSBhLnksIGJ4ID0gYi54LCBieSA9IGIueSwgdDAgPSAwLCB0MSA9IDEsIGR4ID0gYnggLSBheCwgZHkgPSBieSAtIGF5LCByO1xuICAgICAgciA9IHgwIC0gYXg7XG4gICAgICBpZiAoIWR4ICYmIHIgPiAwKSByZXR1cm47XG4gICAgICByIC89IGR4O1xuICAgICAgaWYgKGR4IDwgMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHggPiAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfVxuICAgICAgciA9IHgxIC0gYXg7XG4gICAgICBpZiAoIWR4ICYmIHIgPCAwKSByZXR1cm47XG4gICAgICByIC89IGR4O1xuICAgICAgaWYgKGR4IDwgMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHggPiAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfVxuICAgICAgciA9IHkwIC0gYXk7XG4gICAgICBpZiAoIWR5ICYmIHIgPiAwKSByZXR1cm47XG4gICAgICByIC89IGR5O1xuICAgICAgaWYgKGR5IDwgMCkge1xuICAgICAgICBpZiAociA8IHQwKSByZXR1cm47XG4gICAgICAgIGlmIChyIDwgdDEpIHQxID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHkgPiAwKSB7XG4gICAgICAgIGlmIChyID4gdDEpIHJldHVybjtcbiAgICAgICAgaWYgKHIgPiB0MCkgdDAgPSByO1xuICAgICAgfVxuICAgICAgciA9IHkxIC0gYXk7XG4gICAgICBpZiAoIWR5ICYmIHIgPCAwKSByZXR1cm47XG4gICAgICByIC89IGR5O1xuICAgICAgaWYgKGR5IDwgMCkge1xuICAgICAgICBpZiAociA+IHQxKSByZXR1cm47XG4gICAgICAgIGlmIChyID4gdDApIHQwID0gcjtcbiAgICAgIH0gZWxzZSBpZiAoZHkgPiAwKSB7XG4gICAgICAgIGlmIChyIDwgdDApIHJldHVybjtcbiAgICAgICAgaWYgKHIgPCB0MSkgdDEgPSByO1xuICAgICAgfVxuICAgICAgaWYgKHQwID4gMCkgbGluZS5hID0ge1xuICAgICAgICB4OiBheCArIHQwICogZHgsXG4gICAgICAgIHk6IGF5ICsgdDAgKiBkeVxuICAgICAgfTtcbiAgICAgIGlmICh0MSA8IDEpIGxpbmUuYiA9IHtcbiAgICAgICAgeDogYXggKyB0MSAqIGR4LFxuICAgICAgICB5OiBheSArIHQxICogZHlcbiAgICAgIH07XG4gICAgICByZXR1cm4gbGluZTtcbiAgICB9O1xuICB9XG4gIHZhciBkM19nZW9fY2xpcEV4dGVudE1BWCA9IDFlOTtcbiAgZDMuZ2VvLmNsaXBFeHRlbnQ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seWdvbiwgcmluZztcbiAgICAgIHZhciBjbGlwID0ge1xuICAgICAgICBwb2ludDogcG9pbnQsXG4gICAgICAgIGxpbmVTdGFydDogbGluZVN0YXJ0LFxuICAgICAgICBsaW5lRW5kOiBsaW5lRW5kLFxuICAgICAgICBwb2x5Z29uU3RhcnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGxpc3RlbmVyID0gYnVmZmVyTGlzdGVuZXI7XG4gICAgICAgICAgc2VnbWVudHMgPSBbXTtcbiAgICAgICAgICBwb2x5Z29uID0gW107XG4gICAgICAgICAgY2xlYW4gPSB0cnVlO1xuICAgICAgICB9LFxuICAgICAgICBwb2x5Z29uRW5kOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBsaXN0ZW5lciA9IGxpc3RlbmVyXztcbiAgICAgICAgICBzZWdtZW50cyA9IGQzLm1lcmdlKHNlZ21lbnRzKTtcbiAgICAgICAgICB2YXIgY2xpcFN0YXJ0SW5zaWRlID0gaW5zaWRlUG9seWdvbihbIHgwLCB5MSBdKSwgaW5zaWRlID0gY2xlYW4gJiYgY2xpcFN0YXJ0SW5zaWRlLCB2aXNpYmxlID0gc2VnbWVudHMubGVuZ3RoO1xuICAgICAgICAgIGlmIChpbnNpZGUgfHwgdmlzaWJsZSkge1xuICAgICAgICAgICAgbGlzdGVuZXIucG9seWdvblN0YXJ0KCk7XG4gICAgICAgICAgICBpZiAoaW5zaWRlKSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICBpbnRlcnBvbGF0ZShudWxsLCBudWxsLCAxLCBsaXN0ZW5lcik7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh2aXNpYmxlKSB7XG4gICAgICAgICAgICAgIGQzX2dlb19jbGlwUG9seWdvbihzZWdtZW50cywgY29tcGFyZSwgY2xpcFN0YXJ0SW5zaWRlLCBpbnRlcnBvbGF0ZSwgbGlzdGVuZXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGlzdGVuZXIucG9seWdvbkVuZCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBzZWdtZW50cyA9IHBvbHlnb24gPSByaW5nID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIGZ1bmN0aW9uIGluc2lkZVBvbHlnb24ocCkge1xuICAgICAgICB2YXIgd24gPSAwLCBuID0gcG9seWdvbi5sZW5ndGgsIHkgPSBwWzFdO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAgIGZvciAodmFyIGogPSAxLCB2ID0gcG9seWdvbltpXSwgbSA9IHYubGVuZ3RoLCBhID0gdlswXSwgYjsgaiA8IG07ICsraikge1xuICAgICAgICAgICAgYiA9IHZbal07XG4gICAgICAgICAgICBpZiAoYVsxXSA8PSB5KSB7XG4gICAgICAgICAgICAgIGlmIChiWzFdID4geSAmJiBkM19jcm9zczJkKGEsIGIsIHApID4gMCkgKyt3bjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGlmIChiWzFdIDw9IHkgJiYgZDNfY3Jvc3MyZChhLCBiLCBwKSA8IDApIC0td247XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhID0gYjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHduICE9PSAwO1xuICAgICAgfVxuICAgICAgZnVuY3Rpb24gaW50ZXJwb2xhdGUoZnJvbSwgdG8sIGRpcmVjdGlvbiwgbGlzdGVuZXIpIHtcbiAgICAgICAgdmFyIGEgPSAwLCBhMSA9IDA7XG4gICAgICAgIGlmIChmcm9tID09IG51bGwgfHwgKGEgPSBjb3JuZXIoZnJvbSwgZGlyZWN0aW9uKSkgIT09IChhMSA9IGNvcm5lcih0bywgZGlyZWN0aW9uKSkgfHwgY29tcGFyZVBvaW50cyhmcm9tLCB0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WVudHMucHVzaChidWZmZXJMaXN0ZW5lci5idWZmZXIoKSk7XG4gICAgICAgIH1cbiAgICAgICAgY2xpcC5wb2ludCA9IHBvaW50O1xuICAgICAgICBpZiAodl8pIGxpc3RlbmVyLmxpbmVFbmQoKTtcbiAgICAgIH1cbiAgICAgIGZ1bmN0aW9uIGxpbmVQb2ludCh4LCB5KSB7XG4gICAgICAgIHggPSBNYXRoLm1heCgtZDNfZ2VvX2NsaXBFeHRlbnRNQVgsIE1hdGgubWluKGQzX2dlb19jbGlwRXh0ZW50TUFYLCB4KSk7XG4gICAgICAgIHkgPSBNYXRoLm1heCgtZDNfZ2VvX2NsaXBFeHRlbnRNQVgsIE1hdGgubWluKGQzX2dlb19jbGlwRXh0ZW50TUFYLCB5KSk7XG4gICAgICAgIHZhciB2ID0gcG9pbnRWaXNpYmxlKHgsIHkpO1xuICAgICAgICBpZiAocG9seWdvbikgcmluZy5wdXNoKFsgeCwgeSBdKTtcbiAgICAgICAgaWYgKGZpcnN0KSB7XG4gICAgICAgICAgeF9fID0geCwgeV9fID0geSwgdl9fID0gdjtcbiAgICAgICAgICBmaXJzdCA9IGZhbHNlO1xuICAgICAgICAgIGlmICh2KSB7XG4gICAgICAgICAgICBsaXN0ZW5lci5saW5lU3RhcnQoKTtcbiAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHgsIHkpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAodiAmJiB2XykgbGlzdGVuZXIucG9pbnQoeCwgeSk7IGVsc2Uge1xuICAgICAgICAgICAgdmFyIGwgPSB7XG4gICAgICAgICAgICAgIGE6IHtcbiAgICAgICAgICAgICAgICB4OiB4XyxcbiAgICAgICAgICAgICAgICB5OiB5X1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBiOiB7XG4gICAgICAgICAgICAgICAgeDogeCxcbiAgICAgICAgICAgICAgICB5OiB5XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoY2xpcExpbmUobCkpIHtcbiAgICAgICAgICAgICAgaWYgKCF2Xykge1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLmxpbmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KGwuYS54LCBsLmEueSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgbGlzdGVuZXIucG9pbnQobC5iLngsIGwuYi55KTtcbiAgICAgICAgICAgICAgaWYgKCF2KSBsaXN0ZW5lci5saW5lRW5kKCk7XG4gICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYpIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIubGluZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIGxpc3RlbmVyLnBvaW50KHgsIHkpO1xuICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB4XyA9IHgsIHlfID0geSwgdl8gPSB2O1xuICAgICAgfVxuICAgICAgcmV0dXJuIGNsaXA7XG4gICAgfTtcbiAgICBmdW5jdGlvbiBjb3JuZXIocCwgZGlyZWN0aW9uKSB7XG4gICAgICByZXR1cm4gYWJzKHBbMF0gLSB4MCkgPCDOtSA/IGRpcmVjdGlvbiA+IDAgPyAwIDogMyA6IGFicyhwWzBdIC0geDEpIDwgzrUgPyBkaXJlY3Rpb24gPiAwID8gMiA6IDEgOiBhYnMocFsxXSAtIHkwKSA8IM61ID8gZGlyZWN0aW9uID4gMCA/IDEgOiAwIDogZGlyZWN0aW9uID4gMCA/IDMgOiAyO1xuICAgIH1cbiAgICBmdW5jdGlvbiBjb21wYXJlKGEsIGIpIHtcbiAgICAgIHJldHVybiBjb21wYXJlUG9pbnRzKGEueCwgYi54KTtcbiAgICB9XG4gICAgZnVuY3Rpb24gY29tcGFyZVBvaW50cyhhLCB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MV1bMV0sIGxTaXRlID0gZWRnZS5sLCByU2l0ZSA9IGVkZ2UuciwgbHggPSBsU2l0ZS54LCBseSA9IGxTaXRlLnksIHJ4ID0gclNpdGUueCwgcnkgPSByU2l0ZS55LCBmeCA9IChseCArIHJ4KSAvIDIsIGZ5ID0gKGx5ICsgcnkpIC8gMiwgZm0sIGZiO1xuICAgIGlmIChyeSA9PT0gbHkpIHtcbiAgICAgIGlmIChmeCA8IHgwIHx8IGZ4ID49IHgxKSByZXR1cm47XG4gICAgICBpZiAobHggPiByeCkge1xuICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICB4OiBmeCxcbiAgICAgICAgICB5OiB5MFxuICAgICAgICB9OyBlbHNlIGlmICh2YS55ID49IHkxKSByZXR1cm47XG4gICAgICAgIHZiID0ge1xuICAgICAgICAgIHg6IGZ4LFxuICAgICAgICAgIHk6IHkxXG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICB4OiBmeCxcbiAgICAgICAgICB5OiB5MVxuICAgICAgICB9OyBlbHNlIGlmICh2YS55IDwgeTApIHJldHVybjtcbiAgICAgICAgdmIgPSB7XG4gICAgICAgICAgeDogZngsXG4gICAgICAgICAgeTogeTBcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgZm0gPSAobHggLSByeCkgLyAocnkgLSBseSk7XG4gICAgICBmYiA9IGZ5IC0gZm0gKiBmeDtcbiAgICAgIGlmIChmbSA8IC0xIHx8IGZtID4gMSkge1xuICAgICAgICBpZiAobHggPiByeCkge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogKHkwIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MFxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPj0geTEpIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6ICh5MSAtIGZiKSAvIGZtLFxuICAgICAgICAgICAgeTogeTFcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICghdmEpIHZhID0ge1xuICAgICAgICAgICAgeDogKHkxIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MVxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnkgPCB5MCkgcmV0dXJuO1xuICAgICAgICAgIHZiID0ge1xuICAgICAgICAgICAgeDogKHkwIC0gZmIpIC8gZm0sXG4gICAgICAgICAgICB5OiB5MFxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChseSA8IHJ5KSB7XG4gICAgICAgICAgaWYgKCF2YSkgdmEgPSB7XG4gICAgICAgICAgICB4OiB4MCxcbiAgICAgICAgICAgIHk6IGZtICogeDAgKyBmYlxuICAgICAgICAgIH07IGVsc2UgaWYgKHZhLnggPj0geDEpIHJldHVybjtcbiAgICAgICAgICB2YiA9IHtcbiAgICAgICAgICAgIHg6IHgxLFxuICAgICAgICAgICAgeTogZm0gKiB4MSArIGZiXG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoIXZhKSB2YSA9IHtcbiAgICAgICAgICAgIHg6IHgxLFxuICAgICAgICAgICAgeTogZm0gKiB4MSArIGZiXG4gICAgICAgICAgfTsgZWxzZSBpZiAodmEueCA8IHgwKSByZXR1cm47XG4gICAgICAgICAgdmIgPSB7XG4gICAgICAgICAgICB4OiB4MCxcbiAgICAgICAgICAgIHk6IGZtICogeDAgKyBmYlxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gICAgZWRnZS5hID0gdmE7XG4gICAgZWRnZS5iID0gdmI7XG4gICAgcmV0dXJuIHRydWU7XG4gIH1cbiAgZnVuY3Rpb24gZDNfZ2VvbV92b3Jvbm9pRWRnZShsU2l0ZSwgclNpdGU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mdGVyO1xuICAgICAgICBhZnRlci5QID0gYWZ0ZXIuTCA9IG5vZGU7XG4gICAgICAgIHBhcmVudCA9IGFmdGVyO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgbm9kZS5QID0gbm9kZS5OID0gbnVsbDtcbiAgICAgICAgdGhpcy5fID0gbm9kZTtcbiAgICAgICAgcGFyZW50ID0gbnVsbDtcbiAgICAgIH1cbiAgICAgIG5vZGUuTCA9IG5vZGUuUiA9IG51bGw7XG4gICAgICBub2RlLlUgPSBwYXJlbnQ7XG4gICAgICBub2RlLkMgPSB0cnVlO1xuICAgICAgYWZ0ZXIgPSBub2RlO1xuICAgICAgd2hpbGUgKHBhcmVudCAmJiBwYXJlbnQuQykge1xuICAgICAgICBncmFuZHBhID0gcGFyZW50LlU7XG4gICAgICAgIGlmIChwYXJlbnQgPT09IGdyYW5kcGEuTCkge1xuICAgICAgICAgIHVuY2xlID0gZ3JhbmRwYS5SO1xuICAgICAgICAgIGlmICh1bmNsZSAmJiB1bmNsZS5DKSB7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHVuY2xlLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBhZnRlciA9IGdyYW5kcGE7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChhZnRlciA9PT0gcGFyZW50LlIpIHtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICAgIGFmdGVyID0gcGFyZW50O1xuICAgICAgICAgICAgICBwYXJlbnQgPSBhZnRlci5VO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcGFyZW50LkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGdyYW5kcGEuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJ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5vZGUgJiYgbm9kZS5DKSB7XG4gICAgICAgIG5vZGUuQyA9IGZhbHNlO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBkbyB7XG4gICAgICAgIGlmIChub2RlID09PSB0aGlzLl8pIGJyZWFrO1xuICAgICAgICBpZiAobm9kZSA9PT0gcGFyZW50LkwpIHtcbiAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgaWYgKHNpYmxpbmcuQykge1xuICAgICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZUxlZnQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQuUjtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNpYmxpbmcuTCAmJiBzaWJsaW5nLkwuQyB8fCBzaWJsaW5nLlIgJiYgc2libGluZy5SLkMpIHtcbiAgICAgICAgICAgIGlmICghc2libGluZy5SIHx8ICFzaWJsaW5nLlIuQykge1xuICAgICAgICAgICAgICBzaWJsaW5nLkwuQyA9IGZhbHNlO1xuICAgICAgICAgICAgICBzaWJsaW5nLkMgPSB0cnVlO1xuICAgICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHNpYmxpbmcpO1xuICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LlI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBwYXJlbnQuQztcbiAgICAgICAgICAgIHBhcmVudC5DID0gc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlTGVmdCh0aGlzLCBwYXJlbnQpO1xuICAgICAgICAgICAgbm9kZSA9IHRoaXMuXztcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgaWYgKHNpYmxpbmcuQykge1xuICAgICAgICAgICAgc2libGluZy5DID0gZmFsc2U7XG4gICAgICAgICAgICBwYXJlbnQuQyA9IHRydWU7XG4gICAgICAgICAgICBkM19nZW9tX3Zvcm9ub2lSZWRCbGFja1JvdGF0ZVJpZ2h0KHRoaXMsIHBhcmVudCk7XG4gICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzaWJsaW5nLkwgJiYgc2libGluZy5MLkMgfHwgc2libGluZy5SICYmIHNpYmxpbmcuUi5DKSB7XG4gICAgICAgICAgICBpZiAoIXNpYmxpbmcuTCB8fCAhc2libGluZy5MLkMpIHtcbiAgICAgICAgICAgICAgc2libGluZy5SLkMgPSBmYWxzZTtcbiAgICAgICAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgICAgICAgZDNfZ2VvbV92b3Jvbm9pUmVkQmxhY2tSb3RhdGVMZWZ0KHRoaXMsIHNpYmxpbmcpO1xuICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50Lkw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzaWJsaW5nLkMgPSBwYXJlbnQuQztcbiAgICAgICAgICAgIHBhcmVudC5DID0gc2libGluZy5MLkMgPSBmYWxzZTtcbiAgICAgICAgICAgIGQzX2dlb21fdm9yb25vaVJlZEJsYWNrUm90YXRlUmlnaHQodGhpcywgcGFyZW50KTtcbiAgICAgICAgICAgIG5vZGUgPSB0aGlzLl87XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgc2libGluZy5DID0gdHJ1ZTtcbiAgICAgICAgbm9kZSA9IHBhcmVudDtcbiAgICAgICAgcGFyZW50ID0gcGFyZW50Ll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gZGF0YS5sZW5ndGg7XG4gICAgICAgIGlmIChjb21wYXQpIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICBkID0gZGF0YVtpXTtcbiAgICAgICAgICBpZiAoZC54IDwgeDFfKSB4MV8gPSBkLng7XG4gICAgICAgICAgaWYgKGQueSA8IHkxXykgeTFfID0gZC55O1xuICAgICAgICAgIGlmIChkLnggPiB4Ml8pIHgyXyA9IGQueDtcbiAgICAgICAgICBpZiAoZC55ID4geTJfKSB5Ml8gPSBkLnk7XG4gICAgICAgICAgeHMucHVzaChkLngpO1xuICAgICAgICAgIHlzLnB1c2goZC55KTtcbiAgICAgICAgfSBlbHNlIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHtcbiAgICAgICAgICB2YXIgeF8gPSArZngoZCA9IGRhdGFbaV0sIGkpLCB5XyA9ICtmeShkLCBpKTtcbiAgICAgICAgICBpZiAoeF8gPCB4MV8pIHgxXyA9IHhfO1xuICAgICAgICAgIGlmICh5XyA8IHkxXykgeTFfID0geV87XG4gICAgICAgICAgaWYgKHhfID4geDJfKSB4Ml8gPSB4XztcbiAgICAgICAgICBpZiAoeV8gPiB5Ml8pIHkyXyA9IHlfO1xuICAgICAgICAgIHhzLnB1c2goeF8pO1xuICAgICAgICAgIHlzLnB1c2goeV8pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB2YXIgZHggPSB4Ml8gLSB4MV8sIGR5ID0geTJfIC0geTFfO1xuICAgICAgaWYgKGR4ID4gZHkpIHkyXyA9IHkxXyArIGR4OyBlbHNlIHgyXyA9IHgxXyArIGR5O1xuICAgICAgZnVuY3Rpb24gaW5zZXJ0KG4sIGQsIHgsIHksIHgxLCB5MSwgeDIsIHkyKSB7XG4gICAgICAgIGlmIChpc05hTih4KSB8fCBpc05hTih5KSkgcmV0dXJuO1xuICAgICAgICBpZiAobi5sZWFmKSB7XG4gICAgICAgICAgdmFyIG54ID0gbi54LCBueSA9IG4ueTtcbiAgICAgICA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iAgICAgIGlmIChwb2ludCA9IG5vZGUucG9pbnQpIHtcbiAgICAgICAgdmFyIHBvaW50LCBkeCA9IHggLSBub2RlLngsIGR5ID0geSAtIG5vZGUueSwgZGlzdGFuY2UyID0gZHggKiBkeCArIGR5ICogZHk7XG4gICAgICAgIGlmIChkaXN0YW5jZTIgPCBtaW5EaXN0YW5jZTIpIHtcbiAgICAgICAgICB2YXIgZGlzdGFuY2UgPSBNYXRoLnNxcnQobWluRGlzdGFuY2UyID0gZGlzdGFuY2UyKTtcbiAgICAgICAgICB4MCA9IHggLSBkaXN0YW5jZSwgeTAgPSB5IC0gZGlzdGFuY2U7XG4gICAgICAgICAgeDMgPSB4ICsgZGlzdGFuY2UsIHkzID0geSArIGRpc3RhbmNlO1xuICAgICAgICAgIGNsb3Nlc3RQb2ludCA9IHBvaW50O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB2YXIgY2hpbGRyZW4gPSBub2RlLm5vZGVzLCB4bSA9ICh4MSArIHgyKSAqIC41LCB5bSA9ICh5MSArIHkyKSAqIC41LCByaWdodCA9IHggPj0geG0sIGJlbG93ID0geSA+PSB5bTtcbiAgICAgIGZvciAodmFyIGkgPSBiZWxvdyA8PCAxIHwgcmlnaHQsIGogPSBpICsgNDsgaSA8IGo7ICsraSkge1xuICAgICAgICBpZiAobm9kZSA9IGNoaWxkcmVuW2kgJiAzXSkgc3dpdGNoIChpICYgMykge1xuICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgIGZpbmQobm9kZSwgeDEsIHkxLCB4bSwgeW0pO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgZmluZChub2RlLCB4bSwgeTEsIHgyLCB5bSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICBmaW5kKG5vZGUsIHgxLCB5bSwgeG0sIHkyKTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICAgY2FzZSAzO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0U3ViZ3JvdXBzLCBzb3J0Q2hvcmRzO1xuICAgIGZ1bmN0aW9uIHJlbGF5b3V0KCkge1xuICAgICAgdmFyIHN1Ymdyb3VwcyA9IHt9LCBncm91cFN1bXMgPSBbXSwgZ3JvdXBJbmRleCA9IGQzLnJhbmdlKG4pLCBzdWJncm91cEluZGV4ID0gW10sIGssIHgsIHgwLCBpLCBqO1xuICAgICAgY2hvcmRzID0gW107XG4gICAgICBncm91cHMgPSBbXTtcbiAgICAgIGsgPSAwLCBpID0gLTE7XG4gICAgICB3aGlsZSAoKytpIDwgbikge1xuICAgICAgICB4ID0gMCwgaiA9IC0xO1xuICAgICAgICB3aGlsZSAoKytqIDwgbikge1xuICAgICAgICAgIHggKz0gbWF0cml4W2ldW2pdO1xuICAgICAgICB9XG4gICAgICAgIGdyb3VwU3Vtcy5wdXNoKHgpO1xuICAgICAgICBzdWJncm91cEluZGV4LnB1c2goZDMucmFuZ2UobikpO1xuICAgICAgICBrICs9IHg7XG4gICAgICB9XG4gICAgICBpZiAoc29ydEdyb3Vwcykge1xuICAgICAgICBncm91cEluZGV4LnNvcnQoZnVuY3Rpb24oYSwgYikge1xuICAgICAgICAgIHJldHVybiBzb3J0R3JvdXBzKGdyb3VwU3Vtc1thXSwgZ3JvdXBTdW1zW2JdKTtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICBpZiAoc29ydFN1Ymdyb3Vwcykge1xuICAgICAgICBzdWJncm91cEluZGV4LmZvckVhY2goZnVuY3Rpb24oZCwgaSkge1xuICAgICAgICAgIGQuc29ydChmdW5jdGlvbihhLCBiKSB7XG4gICAgICAgICAgICByZXR1cm4gc29ydFN1Ymdyb3VwcyhtYXRyaXhbaV1bYV0sIG1hdHJpeFtpXVtiXSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgayA9ICjPhCAtIHBhZGRpbmcgKiBuKSAvIGs7XG4gICAgICB4ID0gMCwgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgeDAgPSB4LCBqID0gLTE7XG4gICAgICAgIHdoaWxlICgrK2ogPCBuKSB7XG4gICAgICAgICAgdmFyIGRpID0gZ3JvdXBJbmRleFtpXSwgZGogPSBzdWJncm91cEluZGV4W2RpXVtqXSwgdiA9IG1hdHJpeFtkaV1bZGpdLCBhMCA9IHgsIGExID0geCArPSB2ICogaztcbiAgICAgICAgICBzdWJncm91cHNbZGkgKyBcIi1cIiArIGRqXSA9IHtcbiAgICAgICAgICAgIGluZGV4OiBkaSxcbiAgICAgICAgICAgIHN1YmluZGV4OiBkaixcbiAgICAgICAgICAgIHN0YXJ0QW5nbGU6IGEwLFxuICAgICAgICAgICAgZW5kQW5nbGU6IGExLFxuICAgICAgICAgICAgdmFsdWU6IHZcbiAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGdyb3Vwc1tkaV0gPSB7XG4gICAgICAgICAgaW5kZXg6IGRpLFxuICAgICAgICAgIHN0YXJ0QW5nbGU6IHgwLFxuICAgICAgICAgIGVuZEFuZ2xlOiB4LFxuICAgICAgICAgIHZhbHVlOiBncm91cFN1bXNbZGldXG4gICAgICAgIH07XG4gICAgICAgIHggKz0gcGFkZGluZztcbiAgICAgIH1cbiAgICAgIGkgPSAtMTtcbiAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgIGogPSBpIC0gMTtcbiAgICAgICAgd2hpbGUgKCsraiA8IG4pIHtcbiAgICAgICAgICB2YXIgc291cmNlID0gc3ViZ3JvdXBzW2kgKyBcIi1cIiArIGpdLCB0YXJnZXQgPSBzdWJncm91cHNbaiArIFwiLVwiICsgaV07XG4gICAgICAgICAgaWYgKHNvdXJjZS52YWx1ZSB8fCB0YXJnZXQudmFsdWUpIHtcbiAgICAgICAgICAgIGNob3Jkcy5wdXNoKHNvdXJjZS52YWx1ZSA8IHRhcmdldC52YWx1ZSA/IHtcbiAgICAgICAgICAgICAgc291cmNlOiB0YXJnZX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DNfbGF5b3V0X2ZvcmNlTGlua1N0cmVuZ3RoLCBjaGFyZ2UgPSAtMzAsIGNoYXJnZURpc3RhbmNlMiA9IGQzX2xheW91dF9mb3JjZUNoYXJnZURpc3RhbmNlMiwgZ3Jhdml0eSA9IC4xLCB0aGV0YTIgPSAuNjQsIG5vZGVzID0gW10sIGxpbmtzID0gW10sIGRpc3RhbmNlcywgc3RyZW5ndGhzLCBjaGFyZ2VzO1xuICAgIGZ1bmN0aW9uIHJlcHVsc2Uobm9kZSkge1xuICAgICAgcmV0dXJuIGZ1bmN0aW9uKHF1YWQsIHgxLCBfLCB4Mikge1xuICAgICAgICBpZiAocXVhZC5wb2ludCAhPT0gbm9kZSkge1xuICAgICAgICAgIHZhciBkeCA9IHF1YWQuY3ggLSBub2RlLngsIGR5ID0gcXVhZC5jeSAtIG5vZGUueSwgZHcgPSB4MiAtIHgxLCBkbiA9IGR4ICogZHggKyBkeSAqIGR5O1xuICAgICAgICAgIGlmIChkdyAqIGR3IC8gdGhldGEyIDwgZG4pIHtcbiAgICAgICAgICAgIGlmIChkbiA8IGNoYXJnZURpc3RhbmNlMikge1xuICAgICAgICAgICAgICB2YXIgayA9IHF1YWQuY2hhcmdlIC8gZG47XG4gICAgICAgICAgICAgIG5vZGUucHggLT0gZHggKiBrO1xuICAgICAgICAgICAgICBub2RlLnB5IC09IGR5ICogaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAocXVhZC5wb2ludCAmJiBkbiAmJiBkbiA8IGNoYXJnZURpc3RhbmNlMikge1xuICAgICAgICAgICAgdmFyIGsgPSBxdWFkLnBvaW50Q2hhcmdlIC8gZG47XG4gICAgICAgICAgICBub2RlLnB4IC09IGR4ICogaztcbiAgICAgICAgICAgIG5vZGUucHkgLT0gZHkgKiBrO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gIXF1YWQuY2hhcmdlO1xuICAgICAgfTtcbiAgICB9XG4gICAgZm9yY2UudGljayA9IGZ1bmN0aW9uKCkge1xuICAgICAgaWYgKChhbHBoYSAqPSAuOTkpIDwgLjAwNSkge1xuICAgICAgICB0aW1lciA9IG51bGw7XG4gICAgICAgIGV2ZW50LmVuZCh7XG4gICAgICAgICAgdHlwZTogXCJlbmRcIixcbiAgICAgICAgICBhbHBoYTogYWxwaGEgPSAwXG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH1cbiAgICAgIHZhciBuID0gbm9kZXMubGVuZ3RoLCBtID0gbGlua3MubGVuZ3RoLCBxLCBpLCBvLCBzLCB0LCBsLCBrLCB4LCB5O1xuICAgICAgZm9yIChpID0gMDsgaSA8IG07ICsraSkge1xuICAgICAgICBvID0gbGlua3NbaV07XG4gICAgICAgIHMgPSBvLnNvdXJjZTtcbiAgICAgICAgdCA9IG8udGFyZ2V0O1xuICAgICAgICB4ID0gdC54IC0gcy54O1xuICAgICAgICB5ID0gdC55IC0gcy55O1xuICAgICAgICBpZiAobCA9IHggKiB4ICsgeSAqIHkpIHtcbiAgICAgICAgICBsID0gYWxwaGEgKiBzdHJlbmd0aHNbaV0gKiAoKGwgPSBNYXRoLnNxcnQobCkpIC0gZGlzdGFuY2VzW2ldKSAvIGw7XG4gICAgICAgICAgeCAqPSBsO1xuICAgICAgICAgIHkgKj0gbDtcbiAgICAgICAgICB0LnggLT0geCAqIChrID0gcy53ZWlnaHQgKyB0LndlaWdodCA/IHMud2VpZ2h0IC8gKHMud2VpZ2h0ICsgdC53ZWlnaHQpIDogLjUpO1xuICAgICAgICAgIHQueSAtPSB5ICogaztcbiAgICAgICAgICBzLnggKz0geCAqIChrID0gMSAtIGspO1xuICAgICAgICAgIHMueSArPSB5ICogaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGsgPSBhbHBoYSAqIGdyYXZpdHkpIHtcbiAgICAgICAgeCA9IHNpemVbMF0gLyAyO1xuICAgICAgICB5ID0gc2l6ZVsxXSAvIDI7XG4gICAgICAgIGkgPSAtMTtcbiAgICAgICAgaWYgKGspIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IG5vZGVzW2ldO1xuICAgICAgICAgIG8ueCArPSAoeCAtIG8ueCkgKiBrO1xuICAgICAgICAgIG8ueSArPSAoeSAtIG8ueSkgKiBrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAoY2hhcmdlKSB7XG4gICAgICAgIGQzX2xheW91dF9mb3JjZUFjY3VtdWxhdGUocSA9IGQzLmdlb20ucXVhZHRyZWUobm9kZXMpLCBhbHBoYSwgY2hhcmdlcyk7XG4gICAgICAgIGkgPSAtMTtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBpZiAoIShvID0gbm9kZXNbaV0pLmZpeGVkKSB7XG4gICAgICAgICAgICBxLnZpc2l0KHJlcHVsc2UobykpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaSA9IC0xO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgbyA9IG5vZGVzW2ldO1xuICAgICAgICBpZiAoby5maXhlZCkge1xuICAgICAgICAgIG8ueCA9IG8ucHg7XG4gICAgICAgICAgby55ID0gby5weTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBvLnggLT0gKG8ucHggLSAoby5weCA9IG8ueCkpICogZnJpY3Rpb247XG4gICAgICAgICAgby55IC09IChvLnB5IC0gKG8ucHkgPSBvLnkpKSAqIGZyaWN0aW9uO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBldmVudC50aWNrKHtcbiAgICAgICAgdHlwZTogXCJ0aWNrXCIsXG4gICAgICAgIGFscGhhOiBhbHBoYVxuICAgICAgfSk7XG4gICAgfTtcbiAgICBmb3JjZS5ub2RlcyA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxl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gbnVsbDtcbiAgICAgICAgICBldmVudC5lbmQoe1xuICAgICAgICAgICAgdHlwZTogXCJlbmRcIixcbiAgICAgICAgICAgIGFscGhhOiBhbHBoYSA9IDBcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIGlmICh4ID4gMCkge1xuICAgICAgICBldmVudC5zdGFydCh7XG4gICAgICAgICAgdHlwZTogXCJzdGFydFwiLFxuICAgICAgICAgIGFscGhhOiBhbHBoYSA9IHhcbiAgICAgICAgfSk7XG4gICAgICAgIHRpbWVyID0gZDNfdGltZXIoZm9yY2UudGljayk7XG4gICAgICB9XG4gICAgICByZXR1cm4gZm9yY2U7XG4gICAgfTtcbiAgICBmb3JjZS5zdGFydCA9IGZ1bmN0aW9uKCkge1xuICAgICAgdmFyIGksIG4gPSBub2Rlcy5sZW5ndGgsIG0gPSBsaW5rcy5sZW5ndGgsIHcgPSBzaXplWzBdLCBoID0gc2l6ZVsxXSwgbmVpZ2hib3JzLCBvO1xuICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkge1xuICAgICAgICAobyA9IG5vZGVzW2ldKS5pbmRleCA9IGk7XG4gICAgICAgIG8ud2VpZ2h0ID0gMDtcbiAgICAgIH1cbiAgICAgIGZvciAoaSA9IDA7IGkgPCBtOyArK2kpIHtcbiAgICAgICAgbyA9IGxpbmtzW2ldO1xuICAgICAgICBpZiAodHlwZW9mIG8uc291cmNlID09IFwibnVtYmVyXCIpIG8uc291cmNlID0gbm9kZXNbby5zb3VyY2VdO1xuICAgICAgICBpZiAodHlwZW9mIG8udGFyZ2V0ID09IFwibnVtYmVyXCIpIG8udGFyZ2V0ID0gbm9kZXNbby50YXJnZXRdO1xuICAgICAgICArK28uc291cmNlLndlaWdodDtcbiAgICAgICAgKytvLnRhcmdldC53ZWlnaHQ7XG4gICAgICB9XG4gICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7XG4gICAgICAgIG8gPSBub2Rlc1tpXTtcbiAgICA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yhub2RlKSB7XG4gICAgaWYgKCEobm9kZXMgPSBub2RlLmNoaWxkcmVuKSB8fCAhKG4gPSBub2Rlcy5sZW5ndGgpKSByZXR1cm47XG4gICAgdmFyIG5vZGVzLCB4TWluID0gSW5maW5pdHksIHhNYXggPSAtSW5maW5pdHksIHlNaW4gPSBJbmZpbml0eSwgeU1heCA9IC1JbmZpbml0eSwgYSwgYiwgYywgaSwgaiwgaywgbjtcbiAgICBmdW5jdGlvbiBib3VuZChub2RlKSB7XG4gICAgICB4TWluID0gTWF0aC5taW4obm9kZS54IC0gbm9kZS5yLCB4TWluKTtcbiAgICAgIHhNYXggPSBNYXRoLm1heChub2RlLnggKyBub2RlLnIsIHhNYXgpO1xuICAgICAgeU1pbiA9IE1hdGgubWluKG5vZGUueSAtIG5vZGUuciwgeU1pbik7XG4gICAgICB5TWF4ID0gTWF0aC5tYXgobm9kZS55ICsgbm9kZS5yLCB5TWF4KTtcbiAgICB9XG4gICAgbm9kZXMuZm9yRWFjaChkM19sYXlvdXRfcGFja0xpbmspO1xuICAgIGEgPSBub2Rlc1swXTtcbiAgICBhLnggPSAtYS5yO1xuICAgIGEueSA9IDA7XG4gICAgYm91bmQoYSk7XG4gICAgaWYgKG4gPiAxKSB7XG4gICAgICBiID0gbm9kZXNbMV07XG4gICAgICBiLnggPSBiLnI7XG4gICAgICBiLnkgPSAwO1xuICAgICAgYm91bmQoYik7XG4gICAgICBpZiAobiA+IDIpIHtcbiAgICAgICAgYyA9IG5vZGVzWzJdO1xuICAgICAgICBkM19sYXlvdXRfcGFja1BsYWNlKGEsIGIsIGMpO1xuICAgICAgICBib3VuZChjKTtcbiAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYSwgYyk7XG4gICAgICAgIGEuX3BhY2tfcHJldiA9IGM7XG4gICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGMsIGIpO1xuICAgICAgICBiID0gYS5fcGFja19uZXh0O1xuICAgICAgICBmb3IgKGkgPSAzOyBpIDwgbjsgaSsrKSB7XG4gICAgICAgICAgZDNfbGF5b3V0X3BhY2tQbGFjZShhLCBiLCBjID0gbm9kZXNbaV0pO1xuICAgICAgICAgIHZhciBpc2VjdCA9IDAsIHMxID0gMSwgczIgPSAxO1xuICAgICAgICAgIGZvciAoaiA9IGIuX3BhY2tfbmV4dDsgaiAhPT0gYjsgaiA9IGouX3BhY2tfbmV4dCwgczErKykge1xuICAgICAgICAgICAgaWYgKGQzX2xheW91dF9wYWNrSW50ZXJzZWN0cyhqLCBjKSkge1xuICAgICAgICAgICAgICBpc2VjdCA9IDE7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNlY3QgPT0gMSkge1xuICAgICAgICAgICAgZm9yIChrID0gYS5fcGFja19wcmV2OyBrICE9PSBqLl9wYWNrX3ByZXY7IGsgPSBrLl9wYWNrX3ByZXYsIHMyKyspIHtcbiAgICAgICAgICAgICAgaWYgKGQzX2xheW91dF9wYWNrSW50ZXJzZWN0cyhrLCBjKSkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc2VjdCkge1xuICAgICAgICAgICAgaWYgKHMxIDwgczIgfHwgczEgPT0gczIgJiYgYi5yIDwgYS5yKSBkM19sYXlvdXRfcGFja1NwbGljZShhLCBiID0gaik7IGVsc2UgZDNfbGF5b3V0X3BhY2tTcGxpY2UoYSA9IGssIGIpO1xuICAgICAgICAgICAgaS0tO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChhLCBjKTtcbiAgICAgICAgICAgIGIgPSBjO1xuICAgICAgICAgICAgYm91bmQoYyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIHZhciBjeCA9ICh4TWluICsgeE1heCkg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VwYXJhdGlvbih2aW0uXywgdmlwLl8pO1xuICAgICAgICAgIGlmIChzaGlmdCA+IDApIHtcbiAgICAgICAgICAgIGQzX2xheW91dF90cmVlTW92ZShkM19sYXlvdXRfdHJlZUFuY2VzdG9yKHZpbSwgdiwgYW5jZXN0b3IpLCB2LCBzaGlmdCk7XG4gICAgICAgICAgICBzaXAgKz0gc2hpZnQ7XG4gICAgICAgICAgICBzb3AgKz0gc2hpZnQ7XG4gICAgICAgICAgfVxuICAgICAgICAgIHNpbSArPSB2aW0ubTtcbiAgICAgICAgICBzaXAgKz0gdmlwLm07XG4gICAgICAgICAgc29tICs9IHZvbS5tO1xuICAgICAgICAgIHNvcCArPSB2b3AubTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodmltICYmICFkM19sYXlvdXRfdHJlZVJpZ2h0KHZvcCkpIHtcbiAgICAgICAgICB2b3AudCA9IHZpbTtcbiAgICAgICAgICB2b3AubSArPSBzaW0gLSBzb3A7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZpcCAmJiAhZDNfbGF5b3V0X3RyZWVMZWZ0KHZvbSkpIHtcbiAgICAgICAgICB2b20udCA9IHZpcDtcbiAgICAgICAgICB2b20ubSArPSBzaXAgLSBzb207XG4gICAgICAgICAgYW5jZXN0b3IgPSB2O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gYW5jZXN0b3I7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNpemVOb2RlKG5vZGUpIHtcbiAgICAgIG5vZGUueCAqPSBzaXplWzBdO1xuICAgICAgbm9kZS55ID0gbm9kZS5kZXB0aCAqIHNpemVbMV07XG4gICAgfVxuICAgIHRyZWUuc2VwYXJhdGlvbiA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNlcGFyYXRpb247XG4gICAgICBzZXBhcmF0aW9uID0geDtcbiAgICAgIHJldHVybiB0cmVlO1xuICAgIH07XG4gICA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ICBiZXN0ID0gc2NvcmU7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJvdy5hcmVhIC09IHJvdy5wb3AoKS5hcmVhO1xuICAgICAgICAgICAgcG9zaXRpb24ocm93LCB1LCByZWN0LCBmYWxzZSk7XG4gICAgICAgICAgICB1ID0gTWF0aC5taW4ocmVjdC5keCwgcmVjdC5keSk7XG4gICAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICAgICAgYmVzdCA9IEluZmluaXR5O1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAocm93Lmxlbmd0aCkge1xuICAgICAgICAgIHBvc2l0aW9uKHJvdywgdSwgcmVjdCwgdHJ1ZSk7XG4gICAgICAgICAgcm93Lmxlbmd0aCA9IHJvdy5hcmVhID0gMDtcbiAgICAgICAgfVxuICAgICAgICBjaGlsZHJlbi5mb3JFYWNoKHNxdWFyaWZ5KTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gc3RpY2tpZnkobm9kZSkge1xuICAgICAgdmFyIGNoaWxkcmVuID0gbm9kZS5jaGlsZHJlbjtcbiAgICAgIGlmIChjaGlsZHJlbiAmJiBjaGlsZHJlbi5sZW5ndGgpIHtcbiAgICAgICAgdmFyIHJlY3QgPSBwYWQobm9kZSksIHJlbWFpbmluZyA9IGNoaWxkcmVuLnNsaWNlKCksIGNoaWxkLCByb3cgPSBbXTtcbiAgICAgICAgc2NhbGUocmVtYWluaW5nLCByZWN0LmR4ICogcmVjdC5keSAvIG5vZGUudmFsdWUpO1xuICAgICAgICByb3cuYXJlYSA9IDA7XG4gICAgICAgIHdoaWxlIChjaGlsZCA9IHJlbWFpbmluZy5wb3AoKSkge1xuICAgICAgICAgIHJvdy5wdXNoKGNoaWxkKTtcbiAgICAgICAgICByb3cuYXJlYSArPSBjaGlsZC5hcmVhO1xuICAgICAgICAgIGlmIChjaGlsZC56ICE9IG51bGwpIHtcbiAgICAgICAgICAgIHBvc2l0aW9uKHJvdywgY2hpbGQueiA/IHJlY3QuZHggOiByZWN0LmR5LCByZWN0LCAhcmVtYWluaW5nLmxlbmd0aCk7XG4gICAgICAgICAgICByb3cubGVuZ3RoID0gcm93LmFyZWEgPSAwO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBjaGlsZHJlbi5mb3JFYWNoKHN0aWNraWZ5KTtcbiAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gd29yc3Qocm93LCB1KSB7XG4gICAgICB2YXIgcyA9IHJvdy5hcmVhLCByLCBybWF4ID0gMCwgcm1pbiA9IEluZmluaXR5LCBpID0gLTEsIG4gPSByb3cubGVuZ3RoO1xuICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgaWYgKCEociA9IHJvd1tpXS5hcmVhKSkgY29udGludWU7XG4gICAgICAgIGlmIChyIDwgcm1pbikgcm1pbiA9IHI7XG4gICAgICAgIGlmIChyID4gcm1heCkgcm1heCA9IHI7XG4gICAgICB9XG4gICAgICBzICo9IHM7XG4gICAgICB1ICo9IHU7XG4gICAgICByZXR1cm4gcyA/IE1hdGgubWF4KHUgKiBybWF4ICogcmF0aW8gLyBzLCBzIC8gKHUgKiBybWluICogcmF0aW8pKSA6IEluZmluaXR5O1xuICAgIH1cbiAgICBmdW5jdGlvbiBwb3NpdGlvbihyb3csIHUsIHJlY3QsIGZsdXNoKSB7XG4gICAgICB2YXIgaSA9IC0xLCBuID0gcm93Lmxlbmd0aCwgeCA9IHJlY3QueCwgeSA9IHJlY3QueSwgdiA9IHUgPyByb3VuZChyb3cuYXJlYSAvIHUpIDogMCwgbztcbiAgICAgIGlmICh1ID09IHJlY3QuZHgpIHtcbiAgICAgICAgaWYgKGZsdXNoIHx8IHYgPiByZWN0LmR5KSB2ID0gcmVjdC5keTtcbiAgICAgICAgd2hpbGUgKCsraSA8IG4pIHtcbiAgICAgICAgICBvID0gcm93W2ldO1xuICAgICAgICAgIG8ueCA9IHg7XG4gICAgICAgICAgby55ID0geTtcbiAgICAgICAgICBvLmR5ID0gdjtcbiAgICAgICAgICB4ICs9IG8uZHggPSBNYXRoLm1pbihyZWN0LnggKyByZWN0LmR4IC0geCwgdiA/IHJvdW5kKG8uYXJlYSAvIHYpIDogMCk7XG4gICAgICAgIH1cbiAgICAgICAgby56ID0gdHJ1ZTtcbiAgICAgICAgby5keCArPSByZWN0LnggKyByZWN0LmR4IC0geDtcbiAgICAgICAgcmVjdC55ICs9IHY7XG4gICAgICAgIHJlY3QuZHkgLT0gdjtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keCkgdiA9IHJlY3QuZHg7XG4gICAgICAgIHdoaWxlICgrK2kgPCBuKSB7XG4gICAgICAgICAgbyA9IHJvd1tpXTtcbiAgICAgICAgICBvLnggPSB4O1xuICAgICAgICAgIG8ueSA9IHk7XG4gICAgICAgICAgby5keCA9IHY7XG4gICAgICAgICAgeSArPSBvLmR5ID0gTWF0aC5taW4ocmVjdC55ICsgcmVjdC5keSAtIHksIHYgPyByb3VuZChvLmFyZWEgLyB2KSA6IDApO1xuICAgICAgICB9XG4gICAgICAgIG8ueiA9IGZhbHNlO1xuICAgICAgICBvLmR5ICs9IHJlY3QueSArIHJlY3QuZHkgLSB5O1xuICAgICAgICByZWN0LnggKz0gdjtcbiAgICAgICAgcmVjdC5keCAtPSB2O1xuICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiB0cmVlbWFwKGQpIHtcbiAgICAgIHZhciBub2RlcyA9IHN0aWNraWVzIHx8IGhpZXJhcmNoeShkKSwgcm9vdCA9IG5vZGVzWzBdO1xuICAgICAgcm9vdC54ID0gcm9vdC55ID0gMDtcbiAgICAgIGlmIChyb290LnZhbHVlKSByb290LmR4ID0gc2l6ZVswXSwgcm9vdC5keSA9IHNpemVbMV07IGVsc2Ugcm9vdC5keCA9IHJvb3QuZHkgPSAwO1xuICAgICAgaWYgKHN0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oYWxmz4AsIGExID0gZW5kQW5nbGUuY2FsbChzZWxmLCBzdWJncm91cCwgaSkgLSBoYWxmz4A7XG4gICAgICByZXR1cm4ge1xuICAgICAgICByOiByLFxuICAgICAgICBhMDogYTAsXG4gICAgICAgIGExOiBhMSxcbiAgICAgICAgcDA6IFsgciAqIE1hdGguY29zKGEwKSwgciAqIE1hdGguc2luKGEwKSBdLFxuICAgICAgICBwMTogWyByICogTWF0aC5jb3MoYTEpLCByICogTWF0aC5zaW4oYTEpIF1cbiAgICAgIH07XG4gICAgfVxuICAgIGZ1bmN0aW9uIGVxdWFscyhhLCBiKSB7XG4gICAgICByZXR1cm4gYS5hMCA9PSBiLmEwICYmIGEuYTEgPT0gYi5hMTtcbiAgICB9XG4gICAgZnVuY3Rpb24gYXJjKHIsIHAsIGEpIHtcbiAgICAgIHJldHVybiBcIkFcIiArIHIgKyBcIixcIiArIHIgKyBcIiAwIFwiICsgKyhhID4gz4ApICsgXCIsMSBcIiArIHA7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGN1cnZlKHIwLCBwMCwgcjEsIHAxKSB7XG4gICAgICByZXR1cm4gXCJRIDAsMCBcIiArIHAxO1xuICAgIH1cbiAgICBjaG9yZC5yYWRpdXMgPSBmdW5jdGlvbih2KSB7XG4gICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByYWRpdXM7XG4gICAgICByYWRpdXMgPSBkM19mdW5jdG9yKHYpO1xuICAgICAgcmV0dXJuIGNob3JkO1xuICAgIH07XG4gICAgY2hvcmQuc291cmNlID0gZnVuY3Rpb24odikge1xuICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc291cmNlO1xuICAgICAgc291cmNlID0gZDNfZnVuY3Rvcih2KTtcbiAgICAgIHJldHVybiBjaG9yZDtcbiAgICB9O1xuICAgIGNob3JkLnRhcmdldCA9IGZ1bmN0aW9uKHYpIHtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCk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gICAgICAgICAgIHhFeHRlbnQgPSBleHRlbnQwLng7XG4gICAgICAgICAgICB5RXh0ZW50ID0gZXh0ZW50MC55O1xuICAgICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgICAgdHlwZTogXCJicnVzaHN0YXJ0XCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLnR3ZWVuKFwiYnJ1c2g6YnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgeGkgPSBkM19pbnRlcnBvbGF0ZUFycmF5KHhFeHRlbnQsIGV4dGVudDEueCksIHlpID0gZDNfaW50ZXJwb2xhdGVBcnJheSh5RXh0ZW50LCBleHRlbnQxLnkpO1xuICAgICAgICAgICAgeEV4dGVudERvbWFpbiA9IHlFeHRlbnREb21haW4gPSBudWxsO1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHtcbiAgICAgICAgICAgICAgeEV4dGVudCA9IGV4dGVudDEueCA9IHhpKHQpO1xuICAgICAgICAgICAgICB5RXh0ZW50ID0gZXh0ZW50MS55ID0geWkodCk7XG4gICAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgICAgdHlwZTogXCJicnVzaFwiLFxuICAgICAgICAgICAgICAgIG1vZGU6IFwicmVzaXplXCJcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pLmVhY2goXCJlbmQuYnJ1c2hcIiwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB4RXh0ZW50RG9tYWluID0gZXh0ZW50MS5pO1xuICAgICAgICAgICAgeUV4dGVudERvbWFpbiA9IGV4dGVudDEuajtcbiAgICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hcIixcbiAgICAgICAgICAgICAgbW9kZTogXCJyZXNpemVcIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBldmVudF8oe1xuICAgICAgICAgICAgICB0eXBlOiBcImJydXNoZW5kXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoc3RhcnRcIlxuICAgICAgICAgIH0pO1xuICAgICAgICAgIGV2ZW50Xyh7XG4gICAgICAgICAgICB0eXBlOiBcImJydXNoXCIsXG4gICAgICAgICAgICBtb2RlOiBcInJlc2l6ZVwiXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgZXZlbnRfKHtcbiAgICAgICAgICAgIHR5cGU6IFwiYnJ1c2hlbmRcIlxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuICAgIGZ1bmN0aW9uIHJlZHJhdyhnKSB7XG4gICAgICBnLnNlbGVjdEFsbChcIi5yZXNpemVcIikuYXR0cihcInRyYW5zZm9ybVwiLCBmdW5jdGlvbihkKSB7XG4gICAgICAgIHJldHVybiBcInRyYW5zbGF0ZShcIiArIHhFeHRlbnRbKy9lJC8udGVzdChkKV0gKyBcIixcIiArIHlFeHRlbnRbKy9ecy8udGVzdChkKV0gKyBcIilcIjtcbiAgICAgIH0pO1xuICAgIH1cbiAgICBmdW5jdGlvbiByZWRyYXdYKGcpIHtcbiAgICAgIGcuc2VsZWN0KFwiLmV4dGVudFwiKS5hdHRyKFwieFwiLCB4RXh0ZW50WzBdKTtcbiAgICAgIGcuc2VsZWN0QWxsKFwiLmV4dGVudCwubj5yZWN0LC5zPnJlY3RcIikuYXR0cihcIndpZHRoXCIsIHhFeHRlbnRbMV0gLSB4RXh0ZW50WzBdKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gcmVkcmF3WShnKSB7XG4gICAgICBnLnNlbGVjdChcIi5leHRlbnRcIikuYXR0cihcInlcIiwgeUV4dGVudFswXSk7XG4gICAgICBnLnNlbGVjdEFsbChcIi5leHRlbnQsLmU+cmVjdCwudz5yZWN0XCI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xuICAgICAgICAgICAgb3JpZ2luWzFdIC09IHlFeHRlbnRbMV07XG4gICAgICAgICAgICBkcmFnZ2luZyA9IDI7XG4gICAgICAgICAgfVxuICAgICAgICAgIGQzX2V2ZW50UHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgZnVuY3Rpb24ga2V5dXAoKSB7XG4gICAgICAgIGlmIChkMy5ldmVudC5rZXlDb2RlID09IDMyICYmIGRyYWdnaW5nID09IDIpIHtcbiAgICAgICAgICBvcmlnaW5bMF0gKz0geEV4dGVudFsxXTtcbiAgICAgICAgICBvcmlnaW5bMV0gKz0geUV4dGVudFsxXTtcbiAgICAgICAgICBkcmFnZ2luZyA9IDA7XG4gICAgICAgICAgZDNfZXZlbnRQcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBicnVzaG1vdmUoKSB7XG4gICAgICAgIHZhciBwb2ludCA9IGQzLm1vdXNlKHRhcmdldCksIG1vdmVkID0gZmFsc2U7XG4gICAgICAgIGlmIChvZmZzZXQpIHtcbiAgICAgICAgICBwb2ludFswXSArPSBvZmZzZXRbMF07XG4gICAgICAgICAgcG9pbnRbMV0gKz0gb2Zmc2V0WzFdO1xuICAgICAgICB9XG4gICAgICAgIGlmICghZHJhZ2dpbmcpIHtcbiAgICAgICAgICBpZiAoZDMuZXZlbnQuYWx0S2V5KSB7XG4gICAgICAgICAgICBpZiAoIWNlbnRlcikgY2VudGVyID0gWyAoeEV4dGVudFswXSArIHhFeHRlbnRbMV0pIC8gMiwgKHlFeHRlbnRbMF0gKyB5RXh0ZW50WzFdKSAvIDIgXTtcbiAgICAgICAgICAgIG9yaWdpblswXSA9IHhFeHRlbnRbKyhwb2ludFswXSA8IGNlbnRlclswXSldO1xuICAgICAgICAgICAgb3JpZ2luWzFdID0geUV4dGVudFsrKHBvaW50WzFdIDwgY2VudGVyWzFdKV07XG4gICAgICAgICAgfSBlbHNlIGNlb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AgICBtYXggPSAobWluICs9IHBvc2l0aW9uKSArIHNpemU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGNlbnRlcikgcG9zaXRpb24gPSBNYXRoLm1heChyMCwgTWF0aC5taW4ocjEsIDIgKiBjZW50ZXJbaV0gLSBtaW4pKTtcbiAgICAgICAgICBpZiAocG9zaXRpb24gPCBtaW4pIHtcbiAgICAgICAgICAgIG1heCA9IG1pbjtcbiAgICAgICAgICAgIG1pbiA9IHBvc2l0aW9uO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtYXggPSBwb3NpdGlvbjtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGV4dGVudFswXSAhPSBtaW4gfHwgZXh0ZW50WzFdICE9IG1heCkge1xuICAgICAgICAgIGlmIChpKSB5RXh0ZW50RG9tYWluID0gbnVsbDsgZWxzZSB4RXh0ZW50RG9tYWluID0gbnVsbDtcbiAgICAgICAgICBleHRlbnRbMF0gPSBtaW47XG4gICAgICAgICAgZXh0ZW50WzFdID0gbWF4O1xuICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBmdW5jdGlvbiBicnVzaGVuZCgpIHtcbiAgICAgICAgYnJ1c2htb3ZlKCk7XG4gICAgICAgIGcuc3R5bGUoXCJwb2ludGVyLWV2ZW50c1wiLCBcImFsbFwiKS5zZWxlY3RBbGwoXCIucmVzaXplXCIpLnN0eWxlKFwiZGlzcGxheVwiLCBicnVzaC5lbXB0eSgpID8gXCJub25lXCIgOiBudWxsKTtcbiAgICAgICAgZDMuc2VsZWN0KFwiYm9keVwiKS5zdHlsZShcImN1cnNvclwiLCBudWxsKTtcbiAgICAgICAgdy5vbihcIm1vdXNlbW92ZS5icnVzaFwiLCBudWxsKS5vbihcIm1vdXNldXAuYnJ1c2hcIiwgbnVsbCkub24oXCJ0b3VjaG1vdmUuYnJ1c2hcIiwgbnVsbCkub24oXCJ0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MSwgdDtcbiAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICBpZiAoeCkge1xuICAgICAgICAgIGlmICh4RXh0ZW50RG9tYWluKSB7XG4gICAgICAgICAgICB4MCA9IHhFeHRlbnREb21haW5bMF0sIHgxID0geEV4dGVudERvbWFpblsxXTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgeDAgPSB4RXh0ZW50WzBdLCB4MSA9IHhFeHRlbnRbMV07XG4gICAgICAgICAgICBpZiAoeC5pbnZlcnQpIHgwID0geC5pbnZlcnQoeDApLCB4MSA9IHguaW52ZXJ0KHgxKTtcbiAgICAgICAgICAgIGlmICh4MSA8IHgwKSB0ID0geDAsIHgwID0geDEsIHgxID0gdDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHkpIHtcbiAgICAgICAgICBpZiAoeUV4dGVudERvbWFpbikge1xuICAgICAgICAgICAgeTAgPSB5RXh0ZW50RG9tYWluWzBdLCB5MSA9IHlFeHRlbnREb21haW5bMV07XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHkwID0geUV4dGVudFswXSwgeTEgPSB5RXh0ZW50WzFdO1xuICAgICAgICAgICAgaWYgKHkuaW52ZXJ0KSB5MCA9IHkuaW52ZXJ0KHkwKSwgeTEgPSB5LmludmVydCh5MSk7XG4gICAgICAgICAgICBpZiAoeTEgPCB5MCkgdCA9IHkwLCB5MCA9IHkxLCB5MSA9IHQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB4ICYmIHkgPyBbIFsgeDAsIHkwIF0sIFsgeDEsIHkxIF0gXSA6IHggPyBbIHgwLCB4MSBdIDogeSAmJiBbIHkwLCB5MSBdO1xuICAgICAgfVxuICAgICAgaWYgKHgpIHtcbiAgICAgICAgeDAgPSB6WzBdLCB4MSA9IHpbMV07XG4gICAgICAgIGlmICh5KSB4MCA9IHgwWzBdLCB4MSA9IHgxWzBd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ZW50XCI+e3sgaW52b2ljZV9ubyB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3sgYnV5ZXJfZnVsbG5hbWUgfX08L3A+PC90ZD5cbiAgICAgICAgICAgICAgPHRkPjxwIGNsYXNzPVwidGFibGUtY29udGVudFwiPnt7IGJ1eWVyX2VtYWlsIH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57eyBidXllcl9waG9uZSB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+PHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+e3tjdXJyZW5jeX19e3sgYW1vdW50IH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57eyBvcmRlcl9kYXRlIH19PC9wPjwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj57eyBpZCB9fTwvcD48L3RkPlxuICAgICAgICAgICAgICA8dGQ+XG4gICAgICAgICAgICAgICAgPHAgY2xhc3M9XCJ0YWJsZS1jb250ZW50XCI+XG4gICAgICAgICAgICAgICAgICB7eyNpZiBhbW91bnQgPT09IDB9fVxuICAgICAgICAgICAgICAgICAgICA8c3Bhbj5GcmVlIG9yZGVyPC9zcGFuPlxuICAgICAgICAgICAgICAgICAge3tlbHNlfX1cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4+UGFpZCBvcmRlcjwvc3Bhbj5cbiAgICAgICAgICAgICAgICAgIHt7L2lmfX1cbiAgICAgICAgICAgICAgICA8L3A+XG4gICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgIDx0ZD48cCBjbGFzcz1cInRhYmxlLWNvbnRlbnRcIj48YSBjbGFzcz1cImJveG9mZmljZS1idXR0b24gYm94b2ZmaWNlLW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b2ljZSBObzoge3tpbnZvaWNlX25vfX08L3A+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImxpbmUtaXRlbXMtd3JhcHBlclwiPlxuICAgICAgICAgICAgICAgICAge3sjbGluZV9pdGVtczpsaW5lX2l0ZW19fVxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidGlja2V0IGNvbC1zbS02IGNvbC14cy0xMlwiIGlkPVwiaXRlbS17eyBAaW5kZXggfX1cIj5cbiAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiaGVhZGluZ1wiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRpY2tldC10eXBlXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxwPnt7IHRpdGxlIH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbnRlbnRcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250ZW50LWJveFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPmlkOjwvc3Bhbj4ge3sgaWQgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+QmFzZSBhbW91bnQ6PC9zcGFuPiB7eyBjdXJyZW5jeSB9fXt7IGJhc2VfYW1vdW50IH19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPkRpc2NvdW50ZWQgYW1vdW50Ojwvc3Bhbj4ge3sgY3VycmVuY3kgfX17eyBkaXNjb3VudGVkX2Ftb3VudCB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICA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gICAgICA8cD48c3BhbiBjbGFzcz1cIml0YWxpYy10aXRsZVwiPlBob25lOjwvc3Bhbj4ge3sgcGhvbmUgfX08L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAge3sjZGV0YWlsczprZXkgfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxzcGFuIGNsYXNzPVwiaXRhbGljLXRpdGxlXCI+e3sga2V5IH19Ojwvc3Bhbj4ge3sgLiB9fTwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgICB7e2Vsc2V9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxiPk5vdCBhc3NpZ25lZDwvYj48L3A+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHt7L319XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHt7I2NhbmNlbF90aWNrZXRfdXJsICYmICFjYW5jZWxsZWRfYXR9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJveG9mZmljZS1idXR0b24gYm94b2ZmaWNlLWJ1dHRvbi1zbWFsbCBib3hvZmZpY2UtYnV0dG9uLWluZm9cIiBocmVmPVwiamF2YXNjcmlwdDp2b2lkKDApXCIgb24tY2xpY2s9XCJjYW5jZWxUaWNrZXRcIiB7eyNjYW5jZWxsaW5nfX1kaXNhYmxlZHt7L319PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW5jZWwge3sjY2FuY2VsbGluZ319PGkgY2xhc3M9XCJmYSBmYS1zcGlubmVyIGZhLXNwaW5cIj48L2k+e3svfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cCBjbGFzcz1cImVycm9yLW1zZyBsZWZ0LWFsaWduZWRcIj57e2NhbmNlbF9lcnJvcn19PC9wPlxuICAgICAgICAgICAgICAgICAgICAgICAgICB7ey99fVxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAge3svfX1cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICB7ey9zaG93X29yZGVyfX1cbiAgICAgICAgICB7ey9vcmRlcnN9fVxuICAgICAgICAgIDwvdGJvZHk+XG4gICAgICAgICAgPHRmb290PlxuICAgICAgICAgICAgPHRyPlxuICAgICAgICAgICAgICA8dGQgY29sc3Bhbj1cIjEwXCI+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhZ2luYXRpb24gcGFnaW5hdGlvbi1jZW50ZXJlZFwiPjwvZGl2PlxuICAgICAgICAgICAgICA8L3RkPlxuICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICA8L3Rmb290PlxuICAgICAgICA8L3RhYmxlPlxuICAgICAgPC9kaXY+XG4gICAge3tlbHNlfX1cbiAgICAgIDxwIGNsYXNzPVwidGV4dC1jZW50ZXJcIj5DdXJyZW50bHkgbm8gb3JkZXJzLjwvcD5cbiAgICB7ey9pZn19XG4gIDwvZGl2PlxuYFxuIiwiZXhwb3J0IGNvbnN0IEluZGV4VGVtcGxhdGUgPSBgXG4gIDxkaXYgY2xhc3M9XCJjb250YWluZXJcIj5cbiAgICA8ZGl2IGNsYXNzPVwicm93XCI+XG4gICAgICA8aDEgY2xhc3M9XCJoZWFkZXJcIj5Pcmdhbml6YXRpb25zPC9oMT5cbiAgICAgIHt7I29yZ3M6b3JnfX1cbiAgICAgICAgPGRpdiBjbGFzcz1cImJveCBjb2wtc20tNiBjb2wteHMtMTJcIiBpZD1cIm9yZy17eyBAaW5kZXggfX1cIj5cbiAgICAgICAgICA8ZGl2IGNsYXNzPVwiaGVhZGluZ1wiPlxuICAgICAgICAgICAge3sjdGl0bGV9fVxuICAgICAgICAgICAgICA8cCBjbGFzcz1cImhlYWRpbmctdGl0bGVcIj57eyB0aXRsZSB9fTwvcD5cbiAgICAgICAgICAgIHt7L3RpdGxlfX1cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29udGVudFwiPlxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbnRlbnQtYm94IGNsZWFyZml4XCIgaW50cm89J2ZseTp7XCJ4XCI6MjAsXCJ5XCI6XCIwXCJ9Jz5cbiAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cIm9yZy1sb2dvXCI+PGltZyBzcmM9XCJ7e2RldGFpbHNbJ2xvZ28nXX19XCIvPjwvZGl2PlxuICAgICAgICAgICAgICA8cCBjbGFzcz1cInNlY3Rpb24tdGl0bGVcIj5Pcmdhbml6YXRpb24gaWQ8L3A+XG4gICAgICAgICAgICAgIDxwIGNsYXNzPVwic2VjdGlvbi1jb250ZW50XCI+e3tpZH19PC9wPlxuICAgICAgICAgICAgICB7eyNkZXRhaWxzOmssdn19XG4gICAgICAgICAgICAgICAge3sjaWYgayAhPT0gJ2xvZ28nfX1cbiAgICAgICAgICAgICAgICAgIDxwIGNsYXNzPVwic2VjdGlvbi10aXRsZVwiPnt7a319PC9wPlxuICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNlY3Rpb24tY29udGVudFwiPnt7e2RldGFpbHNba119fX08L2Rpdj5cbiAgICAgICAgICAgICAgICB7ey9pZn19XG4gICAgICAgICAgICAgIHt7L2RldGFpbHN9fVxuICAgICAgICAgICAgICA8cCBjbGFzcz1cInNlY3Rpb24tdGl0bGVcIj5Db250YWN0IGVtYWlsPC9wPlxuICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2VjdGlvbi1jb250ZW50XCI+e3tjb250YWN0X2VtYWls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nNldChldmVudC5rZXlwYXRoICsgJy5zaG93X29yZGVyJywgZmFsc2UpO1xuICAgICAgfSk7XG5cbiAgICAgIG1haW5fcmFjdGl2ZS5vbignY2FuY2VsVGlja2V0JywgZnVuY3Rpb24oZXZlbnQsIG1ldGhvZCkge1xuICAgICAgICBpZiAod2luZG93LmNvbmZpcm0oXCJBcmUgeW91IHN1cmUgeW91IHdhbnQgdG8gY2FuY2VsIHRoaXMgdGlja2V0P1wiKSkge1xuICAgICAgICAgIG1haW5fcmFjdGl2ZS5zZXQoZXZlbnQua2V5cGF0aCArICcuY2FuY2VsX2Vycm9yJywgXCJcIik7XG4gICAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5jYW5jZWxsaW5nJywgdHJ1ZSk7XG5cbiAgICAgICAgICBPcmRlck1vZGVsLnBvc3Qoe1xuICAgICAgICAgICAgdXJsOiBldmVudC5jb250ZXh0LmNhbmNlbF90aWNrZXRfdXJsXG4gICAgICAgICAgfSkuZG9uZShmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAgbWFpbl9yYWN0aXZlLnNldChldmVudC5rZXlwYXRoICsgJy5jYW5jZWxsZWRfYXQnLCByZXNwb25zZS5yZXN1bHQuY2FuY2VsbGVkX2F0KTtcbiAgICAgICAgICAgIG1haW5fcmFjdGl2ZS5zZXQoZXZlbnQua2V5cGF0aCArICcuY2FuY2VsbGluZycsIGZhbHNlKTtcbiAgICAgICAgICB9KS5mYWlsKGZ1bmN0aW9uKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBsZXQgZXJyb3JfdGV4dDtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZS5yZWFkeVN0YXRlID09PSA0KSB7XG4gICAgICAgICAgICAgIGlmIChyZXNwb25zZS5zdGF0dXMgPT09IDUwMCkge1xuICAgICAgICAgICAgICAgIGVycm9yX3RleHQgPSBcIlNlcnZlciBFcnJvclwiO1xuICAgICAgICAgICAgICB9XG4gICAgICAg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zaWRlYmFySXRlbXMnOiBTaWRlQmFyTW9kZWwuZ2V0SXRlbXMoaWNfY29uZmlnKSxcbiAgICAgICAgJ2FjdGl2ZUl0ZW0nOiB2aWV3LFxuICAgICAgICAnc2lkZWJhckhpZGUnOiBmYWxzZSxcbiAgICAgICAgJ3NpZGViYXJNb2JpbGVPbic6IGZhbHNlXG4gICAgICB9KTtcbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICB0aGlzLmluaXQodmlldywgaWNfY29uZmlnKTtcbiAgICB9XG4gIH0sXG4gIGhpZGU6IGZ1bmN0aW9uKCkge1xuICAgIGlmICh0aGlzLm9uKSB7XG4gICAgICB0aGlzLnJhY3RpdmUuc2V0KCdzaWRlYmFySGlkZScsIHRydWUpO1xuICAgIH1cbiAgfVxufTtcbiJdfQ== 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 08/41] 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 %}