All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.butterfaces-dist-bundle-js.butterfaces-js-bundle.min.js Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
!function(){var t=!1,e=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(n){function i(){!t&&this.init&&this.init.apply(this,arguments)}var o=this.prototype;t=!0;var s=new this;t=!1;for(var r in n)s[r]="function"==typeof n[r]&&"function"==typeof o[r]&&e.test(n[r])?function(t,e){return function(){var n=this._super;this._super=o[t];var i=e.apply(this,arguments);return this._super=n,i}}(r,n[r]):n[r];return i.prototype=s,i.prototype.constructor=i,i.extend=arguments.callee,i}}(),function(t){t.fn._butterAutoCompleteInit=function(){return this.each(function(){new e(this)})};var e=Class.extend({init:function(e){this.SEARCH_REQUEST_DELAY=300;var n=t(e);this.$input=n.prev(),this.$input.parent().css({position:"relative"}),this.autocompleteId=n.attr("id"),this.$selectedOption=null,this.ignoreKeyupEvent=!1,this.requestDelayTimerId=null,this.isRequestRunning=!1,this.areChangesMadeWhileRequestWasRunning=!1,this._keyCodes={tab:9,enter:13,shift:16,ctrl:17,alt:18,pause:19,caps_lock:20,escape:27,page_up:33,page_down:34,end:35,home:36,arrow_left:37,arrow_up:38,arrow_right:39,arrow_down:40,insert:45,delete_key:46,left_window_key:91,right_window_key:92,select_key:93,num_lock:144,scroll_lock:145};var i=this;i.$input.on("keydown",function(t){t.which===i._keyCodes.enter?i._handleEnterKeyDown(t):t.which===i._keyCodes.arrow_up||t.which===i._keyCodes.arrow_down?i._handleArrowUpAndDownKeyDown(t):t.which===i._keyCodes.escape&&i._handleEscapeKeyDown(t)}).on("keyup",function(t){for(keyName in i._keyCodes)if(i._keyCodes[keyName]===t.which)return void i._stopEvent(t);return i.ignoreKeyupEvent?(i._stopEvent(t),void(i.ignoreKeyupEvent=!1)):0===i.$input.val().length?(i._stopEvent(t),void i._hideAutocompleteResultList()):void i._trySendJsfAjaxRequest()}).on("blur",function(t){window.setTimeout(function(){i._hideAutocompleteResultList()},100)})},_handleEnterKeyDown:function(t){null!==this.$selectedOption&&(this._stopEvent(t),this._setSelectedValue())},_handleArrowUpAndDownKeyDown:function(t){this._stopEvent(t);var e=this._getAutocompleteElement();!e.is(":visible")&&this.$input.val().length>0?this._trySendJsfAjaxRequest():e.is(":visible")&&e.find("li").length>0&&(null===this.$selectedOption?this._selectResultOptionElement(e.find("li")[0]):this._moveResultOptionElementSelectionCursor(e,t.which===this._keyCodes.arrow_up?-1:1))},_handleEscapeKeyDown:function(t){this._stopEvent(t),this._hideAutocompleteResultList()},_trySendJsfAjaxRequest:function(){var t=this;t.isRequestRunning&&(t.areChangesMadeWhileRequestWasRunning=!0),null!==t.requestDelayTimerId&&window.clearTimeout(t.requestDelayTimerId),t.requestDelayTimerId=window.setTimeout(function(){t.requestDelayTimerId=null,t._sendJsfAjaxRequest()},t.SEARCH_REQUEST_DELAY)},_sendJsfAjaxRequest:function(){var t=this;if(!t.isRequestRunning){t.isRequestRunning=!0,t.areChangesMadeWhileRequestWasRunning=!1,t._showLoadingSpinner();var e=t.$input.parent().parent().attr("id"),n=t.$input.val();jsf.ajax.request(e,"autocomplete",{"javax.faces.behavior.event":"autocomplete",render:t.autocompleteId,params:n,"butterfaces.params":n,onevent:function(e){"success"===e.status&&(t.$input.is(":focus")&&t._handleAutocompleteResultListVisibility(),t._hideLoadingSpinner(),t.isRequestRunning=!1,t.areChangesMadeWhileRequestWasRunning&&t._sendJsfAjaxRequest())}})}},_handleAutocompleteResultListVisibility:function(){var t=this;t._getAutocompleteElement().find("li").length>0?t._initAndShowAutocompleteResultList():t._hideAutocompleteResultList()},_showLoadingSpinner:function(){t('
').appendTo(this.$input.parent())},_hideLoadingSpinner:function(){this.$input.parent().find(".butter-dropdownlist-spinner").remove()},_initAndShowAutocompleteResultList:function(){var t=this,e=t._getAutocompleteElement();e.show().css({width:t.$input.innerWidth()}).highlight(t.$input.val()),e.find("ul").on("mouseleave",function(){t._clearResultOptionSelection()}),e.find("li").on("mousedown",function(){t._setSelectedValue()}).on("mouseenter",function(){t._selectResultOptionElement(this)})},_selectResultOptionElement:function(e){this._clearResultOptionSelection();var n=t(e);n.addClass("butter-dropdownlist-resultItem-selected"),this.$selectedOption=n},_clearResultOptionSelection:function(){this.$selectedOption=null,this._getAutocompleteElement().find(".butter-dropdownlist-resultItem-selected").removeClass("butter-dropdownlist-resultItem-selected")},_moveResultOptionElementSelectionCursor:function(t,e){if(e>0){var n=this.$selectedOption.next();n.length>0?this._selectResultOptionElement(n[0]):this._selectResultOptionElement(t.find("li")[0])}else{var i=this.$selectedOption.prev();if(i.length>0)this._selectResultOptionElement(i[0]);else{var o=t.find("li");this._selectResultOptionElement(o[o.length-1])}}},_setSelectedValue:function(){null!==this.$selectedOption&&(this.ignoreKeyupEvent=!0,this.$input.val(this.$selectedOption.attr("data-select-value")).change().focus().keyup(),this._hideAutocompleteResultList())},_hideAutocompleteResultList:function(){null!==this.requestDelayTimerId&&window.clearTimeout(this.requestDelayTimerId),this.$selectedOption=null,this._getAutocompleteElement().hide()},_getAutocompleteElement:function(){return t(document.getElementById(this.autocompleteId))},_stopEvent:function(t){t.stopPropagation(),t.preventDefault()}})}(jQuery),function(t){t.fn.fixBootstrapDropDown=function(){return this.each(function(){t(".dropdown-menu").on("click",function(e){t(this).hasClass("dropdown-menu-form")&&e.stopPropagation()})})}}(jQuery),function(t){var e=function(){var t=0;return function(e,n){clearTimeout(t),t=setTimeout(e,n)}}();t.fn.butterItemFilterField=function(n){return this.each(function(){var i=t(this);i.keyup(function(){e(function(){var e,o=i.val();if(n)e=t(n);else{var s=i.attr("data-filterable-item-container");e=t(s)}e.find(".filterable-item").each(function(e,n){var i=t(n);i.is(":containsIgnoreCase("+o+")")?(i.removeAttr("hidden"),i.highlight(o)):i.attr("hidden","hidden")})},300)})})}}(jQuery),function(t){t.expr[":"].containsIgnoreCase=t.expr.createPseudo(function(e){return function(n){return!e||t(n).text().toUpperCase().indexOf(e.toUpperCase())>=0}})}(jQuery),function(t){var e=null;t.fn.startDots=function(){return this.each(function(){var n=t(this);n.html(""),e=setInterval(function(){n.append("."),n.html().length>5&&n.html("")},200)})},t.fn.stopDots=function(){return this.each(function(){t(this).html(""),window.clearInterval(e)})}}(jQuery),function(t){t.fn.highlight=function(e){var n=new RegExp(e,"gi"),i=this.find("*");return this.each(function(){i.push(this),t(this).find(".search-highlighted").contents().unwrap(),this.normalize()}),i.each(function(){var i=t(this);e&&""!==e&&i.contents().filter(function(){return 3===this.nodeType&&n.test(this.nodeValue)}).replaceWith(function(){return(this.nodeValue||"").replace(n,function(t){return''+t+""})})})}}(jQuery),function(t){t.fn.markdownReadonly=function(){var e=t(this).find(".butter-component-value-readonly-wrapper"),n=e.html().replace("&","&").replace("<","<").replace(">",">"),i=(new showdown.Converter).makeHtml(n);e.empty(),e.append(i)}}(jQuery),"undefined"==typeof butter&&(butter={}),butter.modal={},butter.modal.open=function(t){$(".butter-modal[data-modal-id="+t+"]").modal({show:!0,keyboard:!1,backdrop:"static"})},butter.modal.close=function(t){$(".butter-modal[data-modal-id="+t+"]").modal("hide")},function(t){t.fn.butterNumberSpinner=function(t){return this.each(function(){new e(this,t)})};var e=Class.extend({init:function(e,n){this.$input=t(e).find("input"),this._initInput(),this._initOptions(n),this._initCounter(),this._initButtons(),this._initArrowKeys(),this._initMouseWheel()},_initInput:function(){var t=this;this.$input.addClass("butter-component-number-input").blur(function(){t._setValueOnBlur()}).parent().addClass("input-group")},_initOptions:function(e){var n={step:1,disabled:!1};this._options=t.extend({},n,e),void 0!==this._options.step&&(this._options.step=1*this._options.step),void 0!==this._options.min&&(this._options.min=1*this._options.min),void 0!==this._options.max&&(this._options.max=1*this._options.max)},_initButtons:function(){var e=t("
").addClass("input-group-append").insertAfter(this.$input),n=t("").addClass("input-group-text").addClass("butter-component-number-buttons").appendTo(e),i=this;t("").addClass("glyphicon glyphicon-chevron-up").addClass("butter-component-number-button").addClass(function(){return i._options.disabled?"disabled":""}).click(function(){i._options.disabled||i.increaseCounter()}).appendTo(n),t("").addClass("glyphicon glyphicon-chevron-down").addClass("butter-component-number-button").addClass(function(){return i._options.disabled?"disabled":""}).click(function(){i._options.disabled||i.decreaseCounter()}).appendTo(n)},_initArrowKeys:function(){var t=this;this.$input.keydown(function(e){38===e.which?(e.stopPropagation(),e.preventDefault(),t.increaseCounter()):40===e.which&&(e.stopPropagation(),e.preventDefault(),t.decreaseCounter())})},_initMouseWheel:function(){var t=this;this.$input.on("mousewheel DOMMouseScroll",function(e){if(t.$input.is(":focus")){var n=e.originalEvent.wheelDelta||-e.originalEvent.deltaY||-e.originalEvent.detail;e.stopPropagation(),e.preventDefault(),n<0?t.decreaseCounter():t.increaseCounter()}})},_initCounter:function(){this._counter=null,this._isValueSet=!1;var t=this.$input.val();if(!this._isStringEmpty(t)){var e=parseInt(t);isNaN(e)||(this.setCounter(e),this._isValueSet=!0)}this._isValueSet||this.setCounter(0)},_setValueOnBlur:function(){var t=this.$input.val();if(this._isStringEmpty(t))this.$input.val(""),this.setCounter(0),this._isValueSet=!1;else{var e=parseInt(t);isNaN(e)?this._isValueSet?this.$input.val(this._counter):(this.$input.val(""),this.setCounter(0),this._isValueSet=!1):(this.setCounter(e),this.$input.val(this._counter),this._isValueSet=!0)}},increaseCounter:function(){this._isValueSet?this.setCounter(this._counter+this._options.step):this._isValueSet=!0,this.$input.val(this._counter),this.$input.change()},decreaseCounter:function(){this._isValueSet?this.setCounter(this._counter-this._options.step):this._isValueSet=!0,this.$input.val(this._counter),this.$input.change()},_isStringEmpty:function(t){return 0===t.length||!t.trim()},setCounter:function(t){void 0!==this._options.min&&tthis._options.max?this._counter=this._options.max:this._counter=t}})}(jQuery),"undefined"==typeof butter&&(butter={}),butter.prettyprint={},butter.prettyprint.cleanup=function(){prettyPrint(),jQuery(".butter-component-prettyprint").each(function(){var t=jQuery(this).find("pre span").first(),e=jQuery(this).find("pre span").last();void 0!==t.html()&&(t.html().trim()||t.remove()),void 0!==e.html()&&(e.html().trim()||e.remove())})},function(t){t.fn.butterScrollToFirst=function(e){var n=void 0===e?t(this).first().offset().top:t(this).first().offset().top+e;t("html, body").animate({scrollTop:n+"px"},"fast")},t.fn.butterScrollToLast=function(e){var n=void 0===e?t(this).last().offset().top:t(this).last().offset().top+e;t("html, body").animate({scrollTop:n+"px"},"fast")}}(jQuery),function(t){t.fn.toggleColumnVisibilty=function(e,n){function i(e){var n=[];return e.find(".butter-table-toolbar-column-option input[type=checkbox]").each(function(e,i){var o=t(i).parent(".butter-table-toolbar-column-option");n.push({identifier:o.attr("data-column-model-identifier"),visible:o.find("input[type=checkbox]").is(":checked")})}),n}return this.each(function(){var o=t(this),s=JSON.stringify(i(o));ButterFaces.Ajax.sendRequest(o.attr("id"),"toggle",e,s,n)})},t.fn.orderColumn=function(e,n,i,o){function s(e){var n=[];return e.find(".butter-table-toolbar-column-option input[type=checkbox]").each(function(e,i){var o=t(i).parent(".butter-table-toolbar-column-option");n.push({identifier:o.attr("data-column-model-identifier"),position:e})}),n}function r(t,e){var n=t.find('li[data-original-column="'+e+'"]'),i=n.prev(),o=n.detach();i.before(o)}function u(t,e){var n=t.find('li[data-original-column="'+e+'"]'),i=n.next(),o=n.detach();i.after(o)}return this.each(function(){var a=t(this);i?r(a,o):u(a,o);var l=JSON.stringify(s(a));ButterFaces.Ajax.sendRequest(a.attr("id"),"order",e,l,n)})}}(jQuery),function(t){t.fn._closePopoverOnBlur=function(e){return this.each(function(){var e=t(this);e.find(".butter-input-component").on("blur",function(){e.popover("hide")})})},t.fn._butterTooltip=function(e){var n=t(this),i=jQuery("[name="+e.contentByName+"]"),o={trigger:e.trigger,title:e.title,placement:e.placement,placementFunction:e.placementFunction,minVerticalOffset:e.minVerticalOffset,minHorizontalOffset:e.minHorizontalOffset,content:i.html().trim()};i.remove(),n.butterTooltip(o)},t.fn.butterTooltip=function(e){return this.each(function(){var n=t(this),i=e.trigger?e.trigger:"hover";e.minVerticalOffset&&n.attr("data-tooltip-min-vertical-offset",e.minVerticalOffset),e.minHorizontalOffset&&n.attr("data-tooltip-min-horizontal-offset",e.minHorizontalOffset),n.next().hasClass("popover")&&n.next().remove(),n.popover({trigger:i,placement:function(t,n){return e.placement?e.placement:e.placementFunction?e.placementFunction:(new ButterFaces.Tooltip).calculateTooltipPosition(t,n)},title:e.title,html:!0,content:e.content,viewport:e.viewport})})}}(jQuery); //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRlcmZhY2VzLTAxLWJhc2VDbGFzcy5qcyIsImJ1dHRlcmZhY2VzLWF1dG9jb21wbGV0ZS5qcXVlcnkuanMiLCJidXR0ZXJmYWNlcy1ib290c3RyYXAtZml4ZXMuanF1ZXJ5LmpzIiwiYnV0dGVyZmFjZXMtY2xpZW50U2lkZUZpbHRlci5qcXVlcnkuanMiLCJidXR0ZXJmYWNlcy1kb3RzLmpxdWVyeS5qcyIsImJ1dHRlcmZhY2VzLWhpZ2hsaWdodC5qcXVlcnkuanMiLCJidXR0ZXJmYWNlcy1tYXJrZG93bi5qcXVlcnkuanMiLCJidXR0ZXJmYWNlcy1tb2RhbC5qcyIsImJ1dHRlcmZhY2VzLW51bWJlclNwaW5uZXIuanF1ZXJ5LmpzIiwiYnV0dGVyZmFjZXMtcHJldHR5cHJpbnQuanMiLCJidXR0ZXJmYWNlcy1zY3JvbGwuanF1ZXJ5LmpzIiwiYnV0dGVyZmFjZXMtdGFibGUtdG9vbGJhci5qcXVlcnkuanMiLCJidXR0ZXJmYWNlcy10b29sdGlwLmpxdWVyeS5qcyJdLCJuYW1lcyI6WyJpbml0aWFsaXppbmciLCJmblRlc3QiLCJ0ZXN0IiwieHl6IiwidGhpcyIsIkNsYXNzIiwiZXh0ZW5kIiwicHJvcCIsImluaXQiLCJhcHBseSIsImFyZ3VtZW50cyIsIl9zdXBlciIsInByb3RvdHlwZSIsIm5hbWUiLCJmbiIsInRtcCIsInJldCIsImNvbnN0cnVjdG9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GlhbGl6aW5nID0gZmFsc2U7XG5cbiAgICAgICAgLy8gQ29weSB0aGUgcHJvcGVydGllcyBvdmVyIG9udG8gdGhlIG5ldyBwcm90b3R5cGVcbiAgICAgICAgZm9yICh2YXIgbmFtZSBpbiBwcm9wKSB7XG4gICAgICAgICAgICAvLyBDaGVjayBpZiB3ZSdyZSBvdmVyd3JpdGluZyBhbiBleGlzdGluZyBmdW5jdGlvblxuICAgICAgICAgICAgcHJvdG90eXBlW25hbWVdID0gdHlwZW9mIHByb3BbbmFtZV0gPT0gXCJmdW5jdGlvblwiICYmXG4gICAgICAgICAgICB0eXBlb2YgX3N1cGVyW25hbWVdID09IFwiZnVuY3Rpb25cIiAmJiBmblRlc3QudGVzdChwcm9wW25hbWVdKSA/XG4gICAgICAgICAgICAgICAgICAgIChmdW5jdGlvbihuYW1lLCBmbil7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRtcCA9IHRoaXMuX3N1cGVyO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWRkIGEgbmV3IC5fc3VwZXIoKSBtZXRob2QgdGhhdCBpcyB0aGUgc2FtZSBtZXRob2RcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBidXQgb24gdGhlIHN1cGVyLWNsYXNzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fc3VwZXIgPSBfc3VwZXJbbmFtZV07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgbWV0aG9kIG9ubHkgbmVlZCB0byBiZSBib3VuZCB0ZW1wb3JhcmlseSwgc28gd2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZW1vdmUgaXQgd2hlbiB3ZSdyZSBkb25lIGV4ZWN1dGluZ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXQgPSBmbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3N1cGVyID0gdG1wO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH0pKG5hbWUsIHByb3BbbmFtZV0pIDpcbiAgICAgICAgICAgICAgICAgICAgcHJvcFtuYW1lXTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFRoZSBkdW1teSBjbGFzcyBjb25zdHJ1Y3RvclxuICAgICAgICBmdW5jdGlvbiBDbGFzcygpIHtcbiAgICAgICAgICAgIC8vIEFsbCBjb25zdHJ1Y3Rpb24gaXMgYWN0dWFsbHkgZG9uZSBpbiB0aGUgaW5pdCBtZXRob2RcbiAgICAgICAgICAgIGlmICggIWluaXRpYWxpemluZyAmJiB0aGlzLmluaXQgKVxuICAgICAgICAgICAgICAgIHRoaXMuaW5pdC5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gUG9wdWxhdGUgb3VyIGNvbnN0cnVjdGVkIHByb3RvdHlwZSBvYmplY3RcbiAgICAgICAgQ2xhc3MucHJvdG90eXBlID0gcHJvdG90eXBlO1xuXG4gICAgICAgIC8vIEVuZm9yY2UgdGhlIGNvbnN0cnVjdG9yIHRvIGJlIHdoYXQgd2UgZXhwZWN0XG4gICAgICAgIENsYXNzLnByb3RvdHlwZS5jb25zdHJ1Y3RvciA9IENsYXNzO1xuXG4gICAgICAgIC8vIEFuZCBtYWtlIHRoaXMgY2xhc3MgZXh0ZW5kYWJsZVxuICAgICAgICBDbGFzcy5leHRlbmQgPSBhcmd1bWVudHMuY2FsbGVlO1xuXG4gICAgICAgIHJldHVybiBDbGFzcztcbiAgICB9O1xufSkoKTsiLCIvKipcbiAqIGpRdWVyeS1QbHVnaW4gXCJidXR0ZXJIYW5kbGVBdXRvQ29tcGxldGVcI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yh7cG9zaXRpb246IFwicmVsYXRpdmVcIn0pO1xuICAgICAgICAgICAgdGhpcy5hdXRvY29tcGxldGVJZCA9ICRhdXRvY29tcGxldGVUbXAuYXR0cihcImlkXCIpO1xuICAgICAgICAgICAgdGhpcy4kc2VsZWN0ZWRPcHRpb24gPSBudWxsO1xuICAgICAgICAgICAgdGhpcy5pZ25vcmVLZXl1cEV2ZW50ID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLnJlcXVlc3REZWxheVRpbWVySWQgPSBudWxsO1xuICAgICAgICAgICAgdGhpcy5pc1JlcXVlc3RSdW5uaW5nID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLmFyZUNoYW5nZXNNYWRlV2hpbGVSZXF1ZXN0V2FzUnVubmluZyA9IGZhbHNlO1xuXG4gICAgICAgICAgICB0aGlzLl9rZXlDb2RlcyA9IHtcbiAgICAgICAgICAgICAgICAvL2JhY2tzcGFjZTogOCxcbiAgICAgICAgICAgICAgICB0YWI6IDksXG4gICAgICAgICAgICAgICAgZW50ZXI6IDEzLFxuICAgICAgICAgICAgICAgIHNoaWZ0OiAxNixcbiAgICAgICAgICAgICAgICBjdHJsOiAxNyxcbiAgICAgICAgICAgICAgICBhbHQ6IDE4LFxuICAgICAgICAgICAgICAgIHBhdXNlOiAxOSxcbiAgICAgICAgICAgICAgICBjYXBzX2xvY2s6IDIwLFxuICAgICAgICAgICAgICAgIGVzY2FwZTogMjcsXG4gICAgICAgICAgICAgICAgcGFnZV91cDogMzMsXG4gICAgICAgICAgICAgICAgcGFnZV9kb3duOiAzNCxcbiAgICAgICAgICAgICAgICBlbmQ6IDM1LFxuICAgICAgICAgICAgICAgIGhvbWU6IDM2LFxuICAgICAgICAgICAgICAgIGFycm93X2xlZnQ6IDM3LFxuICAgICAgICAgICAgICAgIGFycm93X3VwOiAzOCxcbiAgICAgICAgICAgICAgICBhcnJvd19yaWdodDogMzksXG4gICAgICAgICAgICAgICAgYXJyb3dfZG93bjogNDAsXG4gICAgICAgICAgICAgICAgaW5zZXJ0OiA0NSxcbiAgICAgICAgICAgICAgICAvLyAnZGVsZXRlJyBpcyBhIHJlc2VydmVkIGtleSB3b3JkXG4gICAgICAgICAgICAgICAgZGVsZXRlX2tleTogNDYsXG4gICAgICAgICAgICAgICAgbGVmdF93aW5kb3dfa2V5OiA5MSxcbiAgICAgICAgICAgICAgICByaWdodF93aW5kb3dfa2V5OiA5MixcbiAgICAgICAgICAgICAgICBzZWxlY3Rfa2V5OiA5MyxcbiAgICAgICAgICAgICAgICBudW1fbG9jazogMTQ0LFxuICAgICAgICAgICAgICAgIHNjcm9sbF9sb2NrOiAxNDVcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICAgIHNlbGYuJGlucHV0XG4gICAgICAgICAgICAgICAgICAgIC5vbihcImtleWRvd25cIiwgZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnQud2hpY2ggPT09IHNlbGYuX2tleUNvZGVzLmVudGVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5faGFuZGxlRW50ZXJLZXlEb3duKGV2ZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQud2hpY2ggPT09IHNlbGYuX2tleUNvZGVzLmFycm93X3VwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGV2ZW50LndoaWNoID09PSBzZWxmLl9rZXlDb2Rlcy5hcnJvd19kb3duKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5faGFuZGxlQXJyb3dVcEFuZERvd25LZXlEb3duKGV2ZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQud2hpY2ggPT09IHNlbGYuX2tleUNvZGVzLmVzY2FwZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2hhbmRsZUVzY2FwZUtleURvd24oZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAub24oXCJrZXl1cFwiLCBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvbid0IGhhbmRsZSBvdGhlciBrZXlzIHRoYW4gY2hhcmFjdGVyIGtleXNcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoa2V5TmFtZSBpbiBzZWxmLl9rZXlDb2Rlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLl9rZXlDb2Rlc1trZXlOYW1lXSA9PT0gZXZlbnQud2hpY2gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fc3RvcEV2ZW50KGV2ZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuaWdub3JlS2V5dXBFdmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX3N0b3BFdmVudChldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5pZ25vcmVLZXl1cEV2ZW50ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi4kaW5wdXQudmFsKCkubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fc3RvcEV2ZW50KGV2ZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9oaWRlQXV0b2NvbXBsZXRlUmVzdWx0TGlzdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fdHJ5U2VuZEpzZkFqYXhSZXF1ZXN0KCk7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5vbihcImJsdXJcIiwgZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5faGlkZUF1dG9jb21wbGV0ZVJlc3VsdExpc3QoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEwMCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9oYW5kbGVFbnRlcktleURvd246IGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuJHNlbGVjdGVkT3B0aW9uICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fc3RvcEV2ZW50KGV2ZW50KTtcbiAgICAgICAgICAgICAgICB0aGlzLl9zZXRTZWxlY3RlZFZhbHVlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2hhbmRsZUFycm93VXBBbmREb3duS2V5RG93bjogZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICB0aGlzLl9zdG9wRXZlbnQoZXZlbnQpO1xuICAgICAgICAgICAgdmFyICRhdXRvY29tcGxldGUgPSB0aGlzLl9nZXRBdXRvY29tcGxldGVFbGVtZW50KCk7XG4gICAgICAgICAgICBpZiAoISRhdXRvY29tcGxldGUuaXMoXCI6dmlzaWJsZVwiKSAmJiB0aGlzLiRpbnB1dC52YWwoKS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fdHJ5U2VuZEpzZkFqYXhSZXF1ZXN0KCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCRhdXRvY29tcGxldGUuaXMoXCI6dmlzaWJsZVwiKSAmJiAkYXV0b2NvbXBsZXRlLmZpbmQoXCJsaVwiKS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuJHNlbGVjdGVkT3B0aW9uID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQoJGF1dG9jb21wbGV0ZS5maW5kKFwibGlcIilbMF0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX21vdmVSZXN1bHRPcHRpb25FbGVtZW50U2VsZWN0aW9uQ3Vyc29yKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRhdXRvY29tcGxldGUsIGV2ZW50LndoaWNoID09PSB0aGlzLl9rZXlDb2Rlcy5hcnJvd191cCA/IC0xIDogMSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIF9oYW5kbGVFc2NhcGVLZXlEb3duOiBmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgIHRoaXMuX3N0b3BFdmVudChldmVudCk7XG4gICAgICAgICAgICB0aGlzLl9oaWRlQXV0b2NvbXBsZXRlUmVzdWx0TGlzdCgpO1xuICAgICAgICB9LFxuXG4gICAgICAgIF90cnlTZW5kSnNmQWpheFJlcXVlc3Q6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcblxuICAgICAgICAgICAgaWYgKHNlbGYuaXNSZXF1ZXN0UnVubmluZykge1xuICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwicmVxdWVzdCBpcyBhY3RpdmUsIHNvIHJlbWVtY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gICAgICAgICBzZWxmLl9zaG93TG9hZGluZ1NwaW5uZXIoKTtcblxuICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXCJzdGFydGluZyByZXF1ZXN0XCIpO1xuXG4gICAgICAgICAgICB2YXIgaWQgPSBzZWxmLiRpbnB1dC5wYXJlbnQoKS5wYXJlbnQoKS5hdHRyKCdpZCcpO1xuICAgICAgICAgICAgdmFyIHBhcmFtcyA9IHNlbGYuJGlucHV0LnZhbCgpO1xuXG4gICAgICAgICAgICBqc2YuYWpheC5yZXF1ZXN0KGlkLCBcImF1dG9jb21wbGV0ZVwiLCB7XG4gICAgICAgICAgICAgICAgXCJqYXZheC5mYWNlcy5iZWhhdmlvci5ldmVudFwiOiBcImF1dG9jb21wbGV0ZVwiLFxuICAgICAgICAgICAgICAgIHJlbmRlcjogc2VsZi5hdXRvY29tcGxldGVJZCxcbiAgICAgICAgICAgICAgICBwYXJhbXM6IHBhcmFtcyxcbiAgICAgICAgICAgICAgICBcImJ1dHRlcmZhY2VzLnBhcmFtc1wiOiBwYXJhbXMsXG4gICAgICAgICAgICAgICAgb25ldmVudDogZnVuY3Rpb24gKGRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRhdGEuc3RhdHVzID09PSBcInN1Y2Nlc3NcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29uc29sZS5sb2coXCJyZXF1ZXN0IGZpbmlzaGVkXCIpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IHNob3cgcmVzdWx0IGlmIGlucHV0IGZpZWxkIHN0aWxsIGhhcyBmb2N1c1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuJGlucHV0LmlzKFwiOmZvY3VzXCIpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5faGFuZGxlQXV0b2NvbXBsZXRlUmVzdWx0TGlzdFZpc2liaWxpdHkoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2hpZGVMb2FkaW5nU3Bpbm5lcigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5pc1JlcXVlc3RSdW5uaW5nID0gZmFsc2U7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLmFyZUNoYW5nZXNNYWRlV2hpbGVSZXF1ZXN0V2FzUnVubmluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwiY2hhbmdlcyBtYWRlIHdoaWxlIHJlcXVlc3Qgd2FzIHJ1bm5pbmcsIHN0YXJ0IG5ldyByZXF1ZXN0IGF1dG9tYXRpY2FsbHlcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fc2VuZEpzZkFqYXhSZXF1ZXN0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaGFuZGxlQXV0b2NvbXBsZXRlUmVzdWx0TGlzdFZpc2liaWxpdHk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICAgIHZhciAkYXV0b2NvbXBsZXRlID0gc2VsZi5fZ2V0QXV0b2NvbXBsZXRlRWxlbWVudCgpO1xuXG4gICAgICAgICAgICBpZiAoJGF1dG9jb21wbGV0ZS5maW5kKFwibGlcIikubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIHNlbGYuX2luaXRBbmRTaG93QXV0b2NvbXBsZXRlUmVzdWx0TGlzdCgpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzZWxmLl9oaWRlQXV0b2NvbXBsZXRlUmVzdWx0TGlzdCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIF9zaG93TG9hZGluZ1NwaW5uZXI6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICQoJzxkaXYgY2xhc3M9XCJidXR0ZXItZHJvcGRvd25saXN0LXNwaW5uZXItY29udGFpbmVyXCI+PGRpdiBjbGFzcz1cImJ1dHRlci1kcm9wZG93bmxpc3Qtc3Bpbm5lclwiPjwvZGl2PjwvZGl2PicpXG4gICAgICAgICAgICAgICAgICAgIC5hcHBlbmRUbyh0aGlzLiRpbnB1dC5wYXJlbnQoKSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2hpZGVMb2FkaW5nU3Bpbm5lcjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGhpcy4kaW5wdXQucGFyZW50KCkuZmluZChcIi5idXR0ZXItZHJvcGRvd25saXN0LXNwaW5uZXJcIikucmVtb3ZlKCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2luaXRBbmRTaG93QXV0b2NvbXBsZXRlUmVzdWx0TGlzdDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgdmFyICRhdXRvY29tcGxldGUgPSBzZWxmLl9nZXRBdXRvY29tcGxldGVFbGVtZW50KCk7XG4gICAgICAgICAgICAkYXV0b2NvbXBsZXRlXG4gICAgICAgICAgICAgICAgICAgIC5zaG93KClcbiAgICAgICAgICAgICAgICAgICAgLmNzcyh7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogc2VsZi4kaW5wdXQuaW5uZXJXaWR0aCgpXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5oaWdobGlnaHQoc2VsZi4kaW5wdXQudmFsKCkpO1xuXG4gICAgICAgICAgICAkYXV0b2NvbXBsZXRlLmZpbmQoXCJ1bFwiKVxuICAgICAgICAgICAgICAgICAgICAub24oXCJtb3VzZWxlYXZlXCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX2NsZWFyUmVzdWx0T3B0aW9uU2VsZWN0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAkYXV0b2NvbXBsZXRlLmZpbmQoXCJsaVwiKVxuICAgICAgICAgICAgICAgICAgICAub24oXCJtb3VzZWRvd25cIiwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fc2V0U2VsZWN0ZWRWYWx1ZSgpO1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAub24oXCJtb3VzZWVudGVyXCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQodGhpcyk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9zZWxlY3RSZXN1bHRPcHRpb25FbGVtZW50OiBmdW5jdGlvbiAob3B0aW9uRWxlbWVudCkge1xuICAgICAgICAgICAgdGhpcy5fY2xlYXJSZXN1bHRPcHRpb25TZWxlY3Rpb24oKTtcbiAgICAgICAgICAgIHZhciAkc2VsZWN0ZWRPcHRpb25FbGVtZW50ID0gJChvcHRpb25FbGVtZW50KTtcbiAgICAgICAgICAgICRzZWxlY3RlZE9wdGlvbkVsZW1lbnQuYWRkQ2xhc3MoXCJidXR0ZXItZHJvcGRvd25saXN0LXJlc3VsdEl0ZW0tc2VsZWN0ZWRcIik7XG4gICAgICAgICAgICB0aGlzLiRzZWxlY3RlZE9wdGlvbiA9ICRzZWxlY3RlZE9wdGlvbkVsZW1lbnQ7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2NsZWFyUmVzdWx0T3B0aW9uU2VsZWN0aW9uOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB0aGlzLiRzZWxlY3RlZE9wdGlvbiA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLl9nZXRBdXRvY29tcGxldGVFbGVtZW50KClcbiAgICAgICAgICAgICAgICAgICAgLmZpbmQoXCIuYnV0dGVyLWRyb3Bkb3dubGlzdC1yZXN1bHRJdGVtLXNlbGVjdGVkXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZW1vdmVDbGFzcyhcImJ1dHRlci1kcm9wZG93bmxpc3QtcmVzdWx0SXRlbS1zZWxlY3RlZFwiKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfbW92ZVJlc3VsdE9wdGlvbkVsZW1lbnRTZWxlY3Rpb25DdXJzb3I6IGZ1bmN0aW9uICgkYXV0b2NvbXBsZXRlLCBkaXJlY3Rpb24pIHtcbiAgICAgICAgICAgIGlmIChkaXJlY3Rpb24gPiAwKSB7XG4gICAgICAgICAgICAgICAgdmFyICRuZXh0ID0gdGhpcy4kc2VsZWN0ZWRPcHRpb24ubmV4dCgpO1xuICAgICAgICAgICAgICAgIGlmICgkbmV4dC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbGVjdFJlc3VsdE9wdGlvbkVsZW1lbnQoJG5leHRbMF0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vdGhlcmUgaXMgbm8gbmV4dFxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZWxlY3RSZXN1bHRPcHRpb25FbGVtZW50KCRhdXRvY29tcGxldGUuZmluZChcImxpXCIpWzBdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciAkcHJldiA9IHRoaXMuJHNlbGVjdGVkT3B0aW9uLnByZXYoKTtcbiAgICAgICAgICAgICAgICBpZiAoJHByZXYubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZWxlY3RSZXN1bHRPcHRpb25FbGVtZW50KCRwcmV2WzBdKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvL3RoZXJlIGlzIG5vIHByZXZpb3VzXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHRMaXN0T3B0aW9ucyA9ICRhdXRvY29tcGxldGUuZmluZChcImxpXCIpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZWxlY3RSZXN1bHRPcHRpb25FbGVtZW50KHJlc3VsdExpc3RPcHRpb25zW3Jlc3VsdExpc3RPcHRpb25zLmxlbmd0aCAtIDFdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgX3NldFNlbGVjdGVkVmFsdWU6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLiRzZWxlY3RlZE9wdGlvbiAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHRoaXMuaWdub3JlS2V5dXBFdmVudCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhpcy4kaW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICAgIC52YWwodGhpcy4kc2VsZWN0ZWRPcHRpb24uYXR0cihcImRhdGEtc2VsZWN0LXZhbHVlXCIpKVxuICAgICAgICAgICAgICAgICAgICAgICAgLmNoYW5nZSgpXG4gICAgICAgICAgICAgICAgICAgICAgICAuZm9jdXMoKVxuICAgICAgICAgICAgICAgICAgICAgICAgLmtleXVwKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5faGlkZUF1dG9jb21wbGV0ZVJlc3VsdExpc3QoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBfaGlkZUF1dG9jb21wbGV0ZVJlc3VsdExpc3Q6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnJlcXVlc3REZWxheVRpbWVySWQgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICB3aW5kb3cuY2xlYXJUaW1lb3V0KHRoaXMucmVxdWVzdERlb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gfVxuXG4gICAgICAgICAgICAgICAgICAgIHZhciBmaWx0ZXJhYmxlSXRlbXMgPSAkZmlsdGVyYWJsZUl0ZW1Db250YWluZXIuZmluZCgnLmZpbHRlcmFibGUtaXRlbScpO1xuXG4gICAgICAgICAgICAgICAgICAgIGZpbHRlcmFibGVJdGVtcy5lYWNoKGZ1bmN0aW9uIChpLCBlbGVtKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgJGZpbHRlcmFibGVJdGVtID0gJChlbGVtKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkZmlsdGVyYWJsZUl0ZW0uaXMoJzpjb250YWluc0lnbm9yZUNhc2UoJyArIGZpbHRlclZhbHVlICsgJyknKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRmaWx0ZXJhYmxlSXRlbS5yZW1vdmVBdHRyKFwiaGlkZGVuXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICRmaWx0ZXJhYmxlSXRlbS5oaWdobGlnaHQoZmlsdGVyVmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZmlsdGVyYWJsZUl0ZW0uYXR0cihcImhpZGRlblwiLCBcImhpZGRlblwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9LCAzMDApO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgIH07XG59KGpRdWVyeSkpO1xuXG4oZnVuY3Rpb24gKCQpIHtcbiAgICAkLmV4cHJbXCI6XCJdLmNvbnRhaW5zSWdub3JlQ2FzZSA9ICQuZXhwci5jcmVhdGVQc2V1ZG8oZnVuY3Rpb24gKGFyZykge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGVsZW0pIHtcbiAgICAgICAgICAgIHJldHVybiAhYXJnIHx8ICQoZWxlbSkudGV4dC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KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIGVsZW1lbnRzLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyICR0aGlzID0gJCh0aGlzKTtcblxuICAgICAgICAgICAgaWYgKHNlYXJjaFN0cmluZyAmJiBzZWFyY2hTdHJpbmcgIT09ICcnKSB7XG4gICAgICAgICAgICAgICAgJHRoaXMuY29udGVudHMoKVxuICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm5vZGVUeXBlID09PSAzICYmIHJlZ2V4LnRlc3QodGhpcy5ub2RlVmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAucmVwbGFjZVdpdGgoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICh0aGlzLm5vZGVWYWx1ZSB8fCBcIlwiKS5yZXBsYWNlKHJlZ2V4LCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCI8c3BhbiBjbGFzcz1cXFwiXCIgKyBoaWdobGlnaHRDbGFzc05hbWUgKyBcIlxcXCI+XCIgKyBtYXRjaCArIFwiPC9zcGFuPlwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9O1xufShqUXVlcnkpKTsiLCIoZnVuY3Rpb24gKCQpIHtcbiAgICAvLyBleHRlbmQgalF1ZXJ5IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG4gICAgJC5mbi5tYXJrZG93blJlYWRvbmx5ID0gZnVuY3Rpb24gKCkge1xuICAgICAgIC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gICAgaW5pdDogZnVuY3Rpb24gKGVsZW1lbnQsIG9wdGlvbnMpIHtcbiAgICAgICAgICAgIHRoaXMuJGlucHV0ID0gJChlbGVtZW50KS5maW5kKFwiaW5wdXRcIik7XG4gICAgICAgICAgICB0aGlzLl9pbml0SW5wdXQoKTtcbiAgICAgICAgICAgIHRoaXMuX2luaXRPcHRpb25zKG9wdGlvbnMpO1xuICAgICAgICAgICAgdGhpcy5faW5pdENvdW50ZXIoKTtcbiAgICAgICAgICAgIHRoaXMuX2luaXRCdXR0b25zKCk7XG4gICAgICAgICAgICB0aGlzLl9pbml0QXJyb3dLZXlzKCk7XG4gICAgICAgICAgICB0aGlzLl9pbml0TW91c2VXaGVlbCgpO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9pbml0SW5wdXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICAgIHRoaXMuJGlucHV0XG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiYnV0dGVyLWNvbXBvbmVudC1udW1iZXItaW5wdXRcIilcbiAgICAgICAgICAgICAgICAuYmx1cihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYuX3NldFZhbHVlT25CbHVyKCk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAucGFyZW50KCkuYWRkQ2xhc3MoXCJpbnB1dC1ncm91cFwiKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaW5pdE9wdGlvbnM6IGZ1bmN0aW9uIChvcHRpb25zKSB7XG4gICAgICAgICAgICB2YXIgZGVmYXVsdE9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgc3RlcDogMSxcbiAgICAgICAgICAgICAgICBkaXNhYmxlZDogZmFsc2VcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB0aGlzLl9vcHRpb25zID0gJC5leHRlbmQoe30sIGRlZmF1bHRPcHRpb25zLCBvcHRpb25zKTtcblxuICAgICAgICAgICAgLy8gZW5zdXJlIHRoYXQgdGhpcyB2YWx1ZXMgYXJlIG51bWJlcnNcbiAgICAgICAgICAgIGlmICh0aGlzLl9vcHRpb25zLnN0ZXAgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX29wdGlvbnMuc3RlcCA9IHRoaXMuX29wdGlvbnMuc3RlcCAqIDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGhpcy5fb3B0aW9ucy5taW4gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX29wdGlvbnMubWluID0gdGhpcy5fb3B0aW9ucy5taW4gKiAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRoaXMuX29wdGlvbnMubWF4ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9vcHRpb25zLm1heCA9IHRoaXMuX29wdGlvbnMubWF4ICogMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBfaW5pdEJ1dHRvbnM6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAkb3V0ZXJBZGRvbiA9ICQoXCI8ZGl2PlwiKVxuICAgICAgICAgICAgICAgIC5hZGRDbGFzcyhcImlucHV0LWdyb3VwLWFwcGVuZFwiKVxuICAgICAgICAgICAgICAgIC5pbnNlcnRBZnRlcih0aGlzLiRpbnB1dCk7XG5cbiAgICAgICAgICAgIHZhciAkYWRkb24gPSAkKFwiPHNwYW4+XCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiaW5wdXQtZ3JvdXAtdGV4dFwiKVxuICAgICAgICAgICAgICAgIC5hZGRDbGFzcyhcImJ1dHRlci1jb21wb25lbnQtbnVtYmVyLWJ1dHRvbnNcIilcbiAgICAgICAgICAgICAgICAuYXBwZW5kVG8oJG91dGVyQWRkb24pO1xuXG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICAkKFwiPHNwYW4+XCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiZ2x5cGhpY29uIGdseXBoaWNvbi1jaGV2cm9uLXVwXCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiYnV0dGVyLWNvbXBvbmVudC1udW1iZXItYnV0dG9uXCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGYuX29wdGlvbnMuZGlzYWJsZWQgPyBcImRpc2FibGVkXCIgOiBcIlwiO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLmNsaWNrKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzZWxmLl9vcHRpb25zLmRpc2FibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmluY3JlYXNlQ291bnRlcigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuYXBwZW5kVG8oJGFkZG9uKTtcblxuICAgICAgICAgICAgJChcIjxzcGFuPlwiKVxuICAgICAgICAgICAgICAgIC5hZGRDbGFzcyhcImdseXBoaWNvbiBnbHlwaGljb24tY2hldnJvbi1kb3duXCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiYnV0dGVyLWNvbXBvbmVudC1udW1iZXItYnV0dG9uXCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGYuX29wdGlvbnMuZGlzYWJsZWQgPyBcImRpc2FibGVkXCIgOiBcIlwiO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLmNsaWNrKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzZWxmLl9vcHRpb25zLmRpc2FibGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmRlY3JlYXNlQ291bnRlcigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuYXBwZW5kVG8oJGFkZG9uKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaW5pdEFycm93S2V5czogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgdGhpcy4kaW5wdXQua2V5ZG93bihmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXZlbnQud2hpY2ggPT09IDM4KSB7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmluY3JlYXNlQ291bnRlcigpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXZlbnQud2hpY2ggPT09IDQwKSB7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmRlY3JlYXNlQ291bnRlcigpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9pbml0TW91c2VXaGVlbDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgdGhpcy4kaW5wdXQub24oXCJtb3VzZXdoZWVsIERPTU1vdXNlU2Nyb2xsXCIsIGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgIGlmICghc2VsZi4kaW5wdXQuaXMoJzpmb2N1cycpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB2YXIgZGVsdGEgPSBldmVudC5vcmlnaW5hbEV2ZW50LndoZWVsRGVsdGEgfHwgLWV2ZW50Lm9yaWdpbmFsRXZlbnQuZGVsdGFZIHx8IC1ldmVudC5vcmlnaW5hbEV2ZW50LmRldGFpbDtcblxuICAgICAgICAgICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoZGVsdGEgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYuZGVjcmVhc2VDb3VudGVyKCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5pbmNyZWFzZUNvdW50ZXIoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcblxuICAgICAgICBfaW5pdENvdW50ZXI6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdGhpcy5fY291bnRlciA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLl9pc1ZhbHVlU2V0ID0gZmFsc2U7XG5cbiAgICAgICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuJGlucHV0LnZhbCgpO1xuICAgICAgICAgICAgaWYgKCF0aGlzLl9pc1N0cmluZ0VtcHR5KHZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHZhciBwYXJzZWRJbnQgPSBwYXJzZUludCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgaWYgKCFpc05hTihwYXJzZWRJbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0Q291bnRlcihwYXJzZWRJbnQpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9pc1ZhbHVlU2V0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghdGhpcy5faXNWYWx1ZVNldCkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0Q291bnRlcigwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBfc2V0VmFsdWVPbkJsdXI6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuJGlucHV0LnZhbCgpO1xuICAgICAgICAgICAgaWYgKHRoaXMuX2lzU3RyaW5nRW1wdHkodmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy4kaW5wdXQudmFsKFwiXCIpO1xuICAgICAgICAgICAgICAgIHRoaXMuc2V0Q291bnRlcigwKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9pc1ZhbHVlU2V0ID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBwYXJzZWRJbnQgPSBwYXJzZUludCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKHBhcnNlZEludCkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2lzVmFsdWVTZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuJGlucHV0LnZhbCh0aGlzLl9jb3VudGVyKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuJGlucHV0LnZhbChcIlwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0Q291bnRlcigwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2lzVmFsdWVTZXQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0Q291bnRlcihwYXJzZWRJbnQpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLiRpbnB1dC52YWwodGhpcy5fY291bnRlcik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2lzVmFsdWVTZXQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBpbmNyZWFzZUNvdW50ZXI6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLl9pc1ZhbHVlU2V0KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRDb3VudGVyKHRoaXMuX2NvdW50ZXIgKyB0aGlzLl9vcHRpb25zLnN0ZXApO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9pc1ZhbHVlU2V0ID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuJGlucHV0LnZhbCh0aGlzLl9jb3VudGVyKTtcbiAgICAgICAgICAgIHRoaXMuJGlucHV0LmNoYW5nZSgpO1xuICAgICAgICB9LFxuXG4gICAgICAgIGRlY3JlYXNlQ291bnRlcjogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuX2lzVmFsdWVTZXQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNldENvdW50ZXIodGhpcy5fY291bnRlciAtIHRoaXMuX29wdGlvbnMuc3RlcCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuX2lzVmFsdWVTZXQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy4kaW5wdXQudmFsKHRoaXMuX2NvdW50ZXIpO1xuICAgICAgICAgICAgdGhpcy4kaW5wdXQuY2hhbmdlKCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX2lzU3RyaW5nRW1wdHk6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAg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dsZUNvbHVtblZpc2liaWx0eSA9IGZ1bmN0aW9uIChyZW5kZXJJZHMsIGRpc2FibGVSZW5kZXJJZHMpIHtcblxuICAgICAgICByZXR1cm4gdGhpcy5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciAkdG9vbGJhciA9ICQodGhpcyk7XG5cbiAgICAgICAgICAgIHZhciBqc29uID0gSlNPTi5zdHJpbmdpZnkoY3JlYXRlQ29sdW1uVmlzaWJpbHR5KCR0b29sYmFyKSk7XG4gICAgICAgICAgICBCdXR0ZXJGYWNlcy5BamF4LnNlbmRSZXF1ZXN0KCR0b29sYmFyLmF0dHIoJ2lkJyksICd0b2dnbGUnLCByZW5kZXJJZHMsIGpzb24sIGRpc2FibGVSZW5kZXJJZHMpO1xuICAgICAgICB9KTtcblxuICAgICAgICBmdW5jdGlvbiBjcmVhdGVDb2x1bW5WaXNpYmlsdHkoJHRvb2xiYXIpIHtcbiAgICAgICAgICAgIHZhciBjb2x1bW5zID0gW107XG5cbiAgICAgICAgICAgICR0b29sYmFyLmZpbmQoJy5idXR0ZXItdGFibGUtdG9vbGJhci1jb2x1bW4tb3B0aW9uIGlucHV0W3R5cGU9Y2hlY2tib3hdJykuZWFjaChmdW5jdGlvbiAoaW5kZXgsIGNoZWNrYm94KSB7XG4gICAgICAgICAgICAgICAgdmFyICRjaGVja2JveCA9ICQoY2hlY2tib3gpLnBhcmVudCgnLmJ1dHRlci10YWJsZS10b29sYmFyLWNvbHVtbi1vcHRpb24nKTtcbiAgICAgICAgICAgICAgICBjb2x1bW5zLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBpZGVudGlmaWVyOiAkY2hlY2tib3guYXR0cignZGF0YS1jb2x1bW4tbW9kZWwtaWRlbnRpZmllcicpLFxuICAgICAgICAgICAgICAgICAgICB2aXNpYmxlOiAkY2hlY2tib3guZmluZCgnaW5wdXRbdHlwZT1jaGVja2JveF0nKS5pcygnOmNoZWNrZWQnKVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiBjb2x1bW5zO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgICQuZm4ub3JkZXJDb2x1bW4gPSBmdW5jdGlvbiAocmVuZGVySWRzLCBkaXNhYmxlUmVuZGVySWRzLCB0b0xlZnQsIGNvbHVtbk51bWJlcikge1xuXG4gICAgICAgIHJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyICR0b29sYmFyID0gJCh0aGlzKTtcblxuICAgICAgICAgICAgaWYgKHRvTGVmdCkge1xuICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2coJ29yZGVyIGNvbHVtbiAnICsgY29sdW1uTnVtYmVyICsgJyB0byBsZWZ0Jyk7XG4gICAgICAgICAgICAgICAgb3JkZXJDb2x1bW5MZWZ0KCR0b29sYmFyLCBjb2x1bW5OdW1iZXIpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKCdvcmRlciBjb2x1bW4gJyArIGNvbHVtbk51bWJlciArICcgdG8gcmlnaHQnKTtcbiAgICAgICAgICAgICAgICBvcmRlckNvbHVtblJpZ2h0KCR0b29sYmFyLCBjb2x1bW5OdW1iZXIpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIganNvbiA9IEpTT04uc3RyaW5naWZ5KGNyZWF0ZUNvbHVtbk9yZGVyKCR0b29sYmFyKSk7XG4gICAgICAgICAgICBCdXR0ZXJGYWNlcy5BamF4LnNlbmRSZXF1ZXN0KCR0b29sYmFyLmF0dHIoJ2lkJyksICdvcmRlcicsIHJlbmRlcklkcywganNvbiwgZGlzYWJsZVJlbmRlcklkcyk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGZ1bmN0aW9uIGNyZWF0ZUNvbHVtbk9yZGVyKCR0b29sYmFyKSB7XG4gICAgICAgICAgICB2YXIgY29sdW1ucyA9IFtdO1xuXG4gICAgICAgICAgICAkdG9vbGJhci5maW5kKCcuYnV0dGVyLXRhYmxlLXRvb2xiYXItY29sdW1uLW9wdGlvbiBpbnB1dFt0eXBlPWNoZWNrYm94XScpLmVhY2goZnVuY3Rpb24gKGluZGV4LCBjaGVja2JveCkge1xuICAgICAgICAgICAgICAgIHZhciAkY2hlY2tib3ggPSAkKGNoZWNrYm94KS5wYXJlbnQoJy5idXR0ZXItdGFibGUtdG9vbGJhci1jb2x1bW4tb3B0aW9uJyk7XG4gICAgICAgICAgICAgICAgY29sdW1ucy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgaWRlbnRpZmllcjogJGNoZWNrYm94LmF0dHIoJ2RhdGEtY29sdW1uLW1vZGVsLWlkZW50aWZpZXInKSxcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IGluZGV4XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIGNvbHVtbnM7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBvcmRlckNvbHVtbkxlZnQoLyoganF1ZXJ5IHRvb2xiYXIgKi8gJHRvb2xiYXIsIGNvbHVtbk51bWJlcikge1xuICAgICAgICAgICAgLy9jb25zb2xlLmxvZygkdG9vbGJhcik7XG5cbiAgICAgICAgICAgIHZhciAkY29sdW1uID0gJHRvb2xiYXIuZmluZCgnbGlbZGF0YS1vcmlnaW5hbC1jb2x1bW49XCInICsgY29sdW1uTnVtYmVyICsgJ1wiXScpO1xuICAgICAgICAgICAgdmFyICRuZXh0Q29sdW1uID0gJGNvbHVtbi5wcmV2KCk7XG5cbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coJGNvbHVtbik7XG4gICAgICAgICAgICAvL2NvbnNvbGUubG9nKCRuZXh0Q29sdW1uKTtcblxuICAgICAgICAgICAgdmFyICRkZXRhY2h0ZWRDb2x1bW4gPSAkY29sdW1uLmRldGFjaCgpO1xuICAgICAgICAgICAgJG5leHRDb2x1bW4uYmVmb3JlKCRkZXRhY2h0ZWRDb2x1bW4pO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gb3JkZXJDb2x1bW5SaWdodCgvKiBqcXVlcnkgdG9vbGJhciAqLyAkdG9vbGJhciwgY29sdW1uTnVtYmVyKSB7XG4gICAgICAgICAgICAvL2NvbnNvbGUubG9nKCR0b29sYmFyKTtcblxuICAgICAgICAgICAgdmFyICRjb2x1bW4gPSAkdG9vbGJhci5maW5kKCdsaVtkYXRhLW9yaWdpbmFsLWNvbHVtbj1cIicgKyBjb2x1bW5OdW1iZXIgKyAnXCJdJyk7XG4gICAgICAgICAgICB2YXIgJG5leHRDb2x1bW4gPSAkY29sdW1uLm5leHQoKTtcblxuICAgICAgICAgICAgLy9jb25zb2xlLmxvZygkY29sdW1uKTtcbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coJG5leHRDb2x1bW4pO1xuXG4gICAgICAgICAgICB2YXIgJGRldGFjaHRlZENvbHVtbiA9ICRjb2x1bW4uZGV0YWNoKCk7XG4gICAgICAgICAgICAkbmV4dENvbHVtbi5hZnRlcigkZGV0YWNodGVkQ29sdW1uKTtcbiAgICAgICAgfVxuICAgIH07XG59KGpRdWVyeSkpOyIsIihmdW5jdGlvbiAoJCkge1xuXG4gICAgJC5mbi5fY2xvc2VQb3BvdmVyT25CbHVyID0gZnVuY3Rpb24gKC8qIG9iamVjdCAqLyBkYXRhKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHJvb3QgPSAkKHRoaXMpO1xuXG4gICAgICAgICAgICByb290LmZpbmQoJy5idXR0ZXItaW5wdXQtY29tcG9uZW50Jykub24oJ2JsdXInLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcm9vdC5wb3BvdmVyKCdoaWRlJylcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgJC5mbi5fYnV0dGVyVG9vbHRpcCA9IGZ1bmN0aW9uICgvKiBvYmplY3QgKi8gZGF0YSkge1xuICAgICAgICB2YXIgcm9vdCA9ICQodGhpcyk7XG5cbiAgICAgICAgLy9jb25zb2xlLmxvZyhkYXRhKTtcblxuICAgICAgICB2YXIgY29udGVudCA9IGpRdWVyeSgnW25hbWU9JyArIGRhdGEuY29udGVudEJ5TmFtZSArICddJyk7XG5cbiAgICAgICAgdmFyIG5ld0RhdGEgPSB7XG4gICAgICAgICAgICB0cmlnZ2VyOiBkYXRhLnRyaWdnZXIsXG4gICAgICAgICAgICB0aXRsZTogZGF0YS50aXRsZSxcbiAgICAgICAgICAgIHBsYWNlbWVudDogZGF0YS5wbGFjZW1lbnQsXG4gICAgICAgICAgICBwbGFjZW1lbnRGdW5jdGlvbjogZGF0YS5wbGFjZW1lbnRGdW5jdGlvbixcbiAgICAgICAgICAgIG1pblZlcnRpY2FsT2Zmc2V0OiBkYXRhLm1pblZlcnRpY2FsT2Zmc2V0LFxuICAgICAgICAgICAgbWluSG9yaXpvbnRhbE9mZnNldDogZGF0YS5taW5Ib3Jpem9udGFsT2Zmc2V0LFxuICAgICAgICAgICAgY29udGVudDogY29udGVudC5odG1sKCkudHJpbSgpXG4gICAgICAgIH07XG5cbiAgICAgICAgLy9jb25zb2xlLmxvZyhuZXdEYXRhKTtcblxuICAgICAgICBjb250ZW50LnJlbW92ZSgpO1xuXG4gICAgICAgIHJvb3QuYnV0dGVyVG9vbHRpcChuZXdEYXRhKTtcbiAgICB9O1xuXG4gICAgJC5mbi5idXR0ZXJUb29sdGlwID0gZnVuY3Rpb24gKC8qIG9iamVjdCAqLyBkYXRhKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHJvb3QgPSAkKHRoaXMpO1xuICAgICAgICAgICAgdmFyIHRyaWdnZXIgPSBkYXRhLnRyaWdnZXIgPyBkYXRhLnRyaWdnZXIgOiAnaG92ZXInO1xuXG4gICAgICAgICAgICAvL2NvbnNvbGUubG9nKGRhdGEpO1xuICAgICAgICAgICAgLy9jb25zb2xlLmxvZygncGxhY2VtZW50OiAnICsgcGxhY2VtZW50KTtcbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coJ3RyaWdnZXI6ICcgKyB0cmlnZ2VyKTtcbiAgICAgICAgICAgIC8vY29uc29sZS5sb2coJ3ZpZXdwb3J0OiAnICsgZGF0YS52aWV3cG9ydCk7XG5cbiAgICAgICAgICAgIGlmIChkYXRhLm1pblZlcnRpY2FsT2Zmc2V0KSB7XG4gICAgICAgICAgICAgICAgcm9vdC5hdHRyKCdkYXRhLXRvb2x0aXAtbWluLXZlcnRpY2FsLW9mZnNldCcsIGRhdGEubWluVmVydGljYWxPZmZzZXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGRhdGEubWluSG9yaXpvbnRhbE9mZnNldCkge1xuICAgICAgICAgICAgICAgIHJvb3QuYXR0cignZGF0YS10b29sdGlwLW1pbi1ob3Jpem9udGFsLW9mZnNldCcsIGRhdGEubWluSG9yaXpvbnRhbE9mZnNldCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocm9vdC5uZXh0KCkuaGFzQ2xhc3MoJ3BvcG92ZXInKSkge1xuICAgICAgICAgICAgICAgIHJvb3QubmV4dCgpLnJlbW92ZSgpO1xuICAgICAgICAgICAgfVxuXG5cbiAgICAgICAgICAgIHJvb3QucG9wb3Zlcih7XG4gICAgICAgICAgICAgICAgdHJpZ2dlcjogdHJpZ2dlcixcbiAgICAgICAgICAgICAgICBwbGFjZW1lbnQ6IGZ1bmN0aW9uIChwb3BvdmVyLCBzb3VyY2UpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRhdGEucGxhY2VtZW50ID8gZGF0YS5wbGFjZW1lbnQgOiAoZGF0YS5wbGFjZW1lbnRGdW5jdGlvbiA/IGRhdGEucGxhY2VtZW50RnVuY3Rpb24gOiBuZXcgQnV0dGVyRmFjZXMuVG9vbHRpcCgpLmNhbGN1bGF0ZVRvb2x0aXBQb3NpdGlvbihwb3BvdmVyLCBzb3VyY2UpKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHRpdGxlOiBkYXRhLnRpdGxlLFxuICAgICAgICAgICAgICAgIGh0bWw6IHRydWUsXG4gICAgICAgICAgICAgICAgY29udGVudDogZGF0YS5jb250ZW50LFxuICAgICAgICAgICAgICAgIHZpZXdwb3J0OiBkYXRhLnZpZXdwb3J0XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgfTtcbn0oalF1ZXJ5KSk7Il19




© 2015 - 2024 Weber Informatics LLC | Privacy Policy