angular-modal-service
Advanced tools
Comparing version 0.15.3 to 0.15.6
{ | ||
"name": "angular-modal-service", | ||
"version": "0.12.2", | ||
"version": "0.15.6", | ||
"homepage": "https://github.com/dwmkerr/angular-modal-service", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -0,1 +1,11 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
### [0.15.6](https://github.com/dwmkerr/angular-modal-service/compare/v0.15.5...v0.15.6) (2020-04-28) | ||
### [0.15.5](https://github.com/dwmkerr/angular-modal-service/compare/v0.15.4...v0.15.5) (2020-04-28) | ||
### [0.15.4](https://github.com/dwmkerr/angular-modal-service/compare/v0.15.3...v0.15.4) (2020-04-28) | ||
## v0.15.0 | ||
@@ -2,0 +12,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e){var n={};function o(t){if(n[t])return n[t].exports;var l=n[t]={i:t,l:!1,exports:{}};return e[t].call(l.exports,l,l.exports,o),l.l=!0,l.exports}o.m=e,o.c=n,o.d=function(e,n,t){o.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,n){if(1&n&&(e=o(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var l in e)o.d(t,l,function(n){return e[n]}.bind(null,l));return t},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="",o(o.s=0)}([function(e,n,o){"use strict";angular.module("angularModalService",[]).provider("ModalService",function(){var e={closeDelay:0};this.configureOptions=function(n){angular.extend(e,n)},this.$get=["$animate","$document","$compile","$controller","$http","$rootScope","$q","$templateRequest","$timeout",function(n,o,t,l,r,c,i,s,u){return new function(e){var r=this;r.configOptions=e,r.openModals=[],r.closeModals=function(e,n){for(n=n||r.configOptions.closeDelay;r.openModals.length;)r.openModals[0].close(e,n),r.openModals.splice(0,1)};var a=function(e){e.controller=function(e){return["$scope","close",function(n,o){n.close=o,n.bindings=e.bindings}]}(e),e.template=function(e){var n=function(e){return e.replace(/([a-z0-9])([A-Z])/g,function(e,n,o){return[n,o].join("-").toLowerCase()})},o=n(e.component),t="<"+o+' close="close"',l=Object.keys(e.bindings||{});return l.length>0&&(t+=" "+l.map(function(e){return n(e)+'="bindings.'+e+'"'}).join(" ")),t+="></"+o+">"}(e)};r.showModal=function(e){e.component&&a(e);var p=angular.element(o[0].body),f=i.defer();return e.controller?(function(e,n){var o=i.defer();return e?o.resolve(e):n?s(n,!0).then(function(e){o.resolve(e)},function(e){o.reject(e)}):o.reject("No template or templateUrl has been specified."),o.promise}(e.template,e.templateUrl).then(function(s){var a={},d=(e.scope||c).$new(),m=null,g=e.locationChangeSuccess;!1===g?m=angular.noop:angular.isNumber(g)&&g>=0?u(function(){m=c.$on("$locationChangeSuccess",h.close)},g):u(function(){m=c.$on("$locationChangeSuccess",h.close)},r.configOptions.closeDelay);var v=i.defer(),b=i.defer(),y=!1,h={$scope:d,close:function(o,t){y||(y=!0,t=t||r.configOptions.closeDelay,"function"==typeof e.preClose&&e.preClose(a,o,t),void 0!==t&&null!==t||(t=0),u(function(){!function(o){v.resolve(o),e.bodyClass&&p[0].classList.remove(e.bodyClass),n.leave($).then(function(){if($){b.resolve(o),d.$destroy();for(var e=0;e<r.openModals.length;e++)if(r.openModals[e].modal===a){r.openModals.splice(e,1);break}h.close=null,f=null,v=null,a=null,h=null,$=null,d=null}}),m&&m()}(o)},t))}};e.inputs&&angular.extend(h,e.inputs);var $=t(s)(d);h.$element=$;var M=d[e.controllerAs],j=l(e.controller,h,!1,e.controllerAs);e.controllerAs&&M&&angular.extend(j,M);var O=p;angular.isString(e.appendElement)?O=angular.element(o[0].querySelector(e.appendElement)):e.appendElement&&(O=e.appendElement),function(e,o){var t=e.children();t.length>0?n.enter(o,e,t[t.length-1]):n.enter(o,e)}(O,$),e.bodyClass&&p[0].classList.add(e.bodyClass),a.controller=j,a.scope=d,a.element=$,a.close=v.promise,a.closed=b.promise,angular.isFunction(a.controller.$onInit)&&a.controller.$onInit(),f.resolve(a),document.activeElement.blur(),r.openModals.push({modal:a,close:h.close})}).then(null,function(e){f.reject(e)}),f.promise):(f.reject("No controller has been specified."),f.promise)}}(e)}]})}]); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vLy4vc3JjL2FuZ3VsYXItbW9kYWwtc2VydmljZS5qcyJdLCJuYW1lcyI6WyJpbnN0YWxsZWRNb2R1bGVzIiwiX193ZWJwYWNrX3JlcXVpcmVfXyIsIm1vZHVsZUlkIiwiZXhwb3J0cyIsIm1vZHVsZSIsImkiLCJsIiwibW9kdWxlcyIsImNhbGwiLCJtIiwiYyIsImQiLCJuYW1lIiwiZ2V0dGVyIiwibyIsIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZW51bWVyYWJsZSIsImdldCIsInIiLCJTeW1ib2wiLCJ0b1N0cmluZ1RhZyIsInZhbHVlIiwidCIsIm1vZGUiLCJfX2VzTW9kdWxlIiwibnMiLCJjcmVhdGUiLCJrZXkiLCJiaW5kIiwibiIsIm9iamVjdCIsInByb3BlcnR5IiwicHJvdG90eXBlIiwiaGFzT3duUHJvcGVydHkiLCJwIiwicyIsImFuZ3VsYXIiLCJwcm92aWRlciIsIl9vcHRpb25zIiwiY2xvc2VEZWxheSIsInRoaXMiLCJjb25maWd1cmVPcHRpb25zIiwiY29uZmlnIiwiZXh0ZW5kIiwiJGdldCIsIiRhbmltYXRlIiwiJGR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cbiAgICAgICAgY2xvc2VEZWxheTogMFxuICAgIH07XG5cbiAgICB0aGlzLmNvbmZpZ3VyZU9wdGlvbnMgPSBmdW5jdGlvbiAoY29uZmlnKSB7XG4gICAgICAgIGFuZ3VsYXIuZXh0ZW5kKF9vcHRpb25zLCBjb25maWcpO1xuICAgIH07XG4gICAgdGhpcy4kZ2V0ID0gWyckYW5pbWF0ZScsICckZG9jdW1lbnQnLCAnJGNvbXBpbGUnLCAnJGNvbnRyb2xsZXInLCAnJGh0dHAnLCAnJHJvb3RTY29wZScsICckcScsICckdGVtcGxhdGVSZXF1ZXN0JywgJyR0aW1lb3V0JyxcbiAgICAgICAgZnVuY3Rpb24gKCRhbmltYXRlLCAkZG9jdW1lbnQsICRjb21waWxlLCAkY29udHJvbGxlciwgJGh0dHAsICRyb290U2NvcGUsICRxLCAkdGVtcGxhdGVSZXF1ZXN0LCAkdGltZW91dCkge1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBNb2RhbFNlcnZpY2UoY29uZmlnT3B0aW9ucykge1xuXG4gICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuXG4gICAgICAgICAgICAgICAgLy9zdGFzaCBjb25maWdPcHRpb25zXG4gICAgICAgICAgICAgICAgc2VsZi5jb25maWdPcHRpb25zID0gY29uZmlnT3B0aW9ucztcblxuICAgICAgICAgICAgICAgIC8vICBUcmFjayBvcGVuIG1vZGFscy5cbiAgICAgICAgICAgICAgICBzZWxmLm9wZW5Nb2RhbHMgPSBbXTtcblxuICAgICAgICAgICAgICAgIC8vICBSZXR1cm5zIGEgcHJvbWlzZSB3aGljaCBnZXRzIHRoZSB0ZW1wbGF0ZSwgZWl0aGVyXG4gICAgICAgICAgICAgICAgLy8gIGZyb20gdGhlIHRlbXBsYXRlIHBhcmFtZXRlciBvciB2aWEgYSByZXF1ZXN0IHRvIHRoZVxuICAgICAgICAgICAgICAgIC8vICB0ZW1wbGF0ZSB1cmwgcGFyYW1ldGVyLlxuICAgICAgICAgICAgICAgIHZhciBnZXRUZW1wbGF0ZSA9IGZ1bmN0aW9uICh0ZW1wbGF0ZSwgdGVtcGxhdGVVcmwpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRlbXBsYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHRlbXBsYXRlKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0ZW1wbGF0ZVVybCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRlbXBsYXRlUmVxdWVzdCh0ZW1wbGF0ZVVybCwgdHJ1ZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAodGVtcGxhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZSh0ZW1wbGF0ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoXCJObyB0ZW1wbGF0ZSBvciB0ZW1wbGF0ZVVybCBoYXMgYmVlbiBzcGVjaWZpZWQuXCIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZC5wcm9taXNlO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAvLyAgQWRkcyBhbiBlbGVtZW50IHRvIHRoZSBET00gYXMgdGhlIGxhc3QgY2hpbGQgb2YgaXRzIGNvbnRhaW5lclxuICAgICAgICAgICAgICAgIC8vICBsaWtlIGFwcGVuZCwgYnV0IHVzZXMgJGFuaW1hdGUgdG8gaGFuZGxlIGFuaW1hdGlvbnMuIFJldHVybnMgYVxuICAgICAgICAgICAgICAgIC8vICBwcm9taXNlIHRoYXQgaXMgcmVzb2x2ZWQgb25jZSBhbGwgYW5pbWF0aW9uIGlzIGNvbXBsZXRlLlxuICAgICAgICAgICAgICAgIHZhciBhcHBlbmRDaGlsZCA9IGZ1bmN0aW9uIChwYXJlbnQsIGNoaWxkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjaGlsZHJlbiA9IHBhcmVudC5jaGlsZHJlbigpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGRyZW4ubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRhbmltYXRlLmVudGVyKGNoaWxkLCBwYXJlbnQsIGNoaWxkcmVuW2NoaWxkcmVuLmxlbmd0aCAtIDFdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJGFuaW1hdGUuZW50ZXIoY2hpbGQsIHBhcmVudCk7XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIC8vICBDbG9zZSBhbGwgbW9kYWxzLCBwcm92aWRpbmcgdGhlIGdpdmVuIHJlc3VsdCB0byB0aGUgY2xvc2UgcHJvbWlzZS5cbiAgICAgICAgICAgICAgICBzZWxmLmNsb3NlTW9kYWxzID0gZnVuY3Rpb24gKHJlc3VsdCwgZGVsYXkpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsYXkgPSBkZWxheSB8fCBzZWxmLmNvbmZpZ09wdGlvbnMuY2xvc2VEZWxheTtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHNlbGYub3Blbk1vZGFscy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYub3Blbk1vZGFsc1swXS5jbG9zZShyZXN1bHQsIGRlbGF5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYub3Blbk1vZGFscy5zcGxpY2UoMCwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgLypcbiAgICAgICAgICAgICAgICAgKiAgQ3JlYXRlcyBhIGNvbnRyb2xsZXIgd2l0aCBzY29wZSBiaW5kaW5nc1xuICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgIHZhciBidWlsZENvbXBvbmVudENvbnRyb2xsZXIgPSBmdW5jdGlvbihvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gWyckc2NvcGUnLCAnY2xvc2UnLCBmdW5jdGlvbigkc2NvcGUsIGNsb3NlKSB7XG4gICAgICAgICAgICAgICAgICAgICRzY29wZS5jbG9zZSA9IGNsb3NlO1xuICAgICAgICAgICAgICAgICAgICAkc2NvcGUuYmluZGluZ3MgPSBvcHRpb25zLmJpbmRpbmdzO1xuICAgICAgICAgICAgICAgICAgfV07XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIC8qXG4gICAgICAgICAgICAgICAgICogIENyZWF0ZXMgYSBjb21wb25lbnQgdGVtcGxhdGVcbiAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAqICBJbnB1dDpcbiAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAqICAgIHtcbiAgICAgICAgICAgICAgICAgKiAgICAgICBjb21wb25lbnQ6ICdteUNvbXBvbmVudCcsXG4gICAgICAgICAgICAgICAgICogICAgICAgYmluZGluZ3M6IHtcbiAgICAgICAgICAgICAgICAgKiAgICAgICAgIG5hbWU6ICdGb28nLFxuICAgICAgICAgICAgICAgICAqICAgICAgICAgcGhvbmVOdW1iZXI6ICcxMjMtNDU2LTc4OTAnXG4gICAgICAgICAgICAgICAgICogICAgICAgfVxuICAgICAgICAgICAgICAgICAqICAgIH1cbiAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAqICBPdXRwdXQ6XG4gICAgICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAgICAgKiAgICAnPG15LWNvbXBvbmVudCBjbG9zZT1cImNsb3NlXCIgbmFtZT1cImJpbmRpbmdzLm5hbWVcIiBwaG9uZS1udW1iZXI9XCJiaW5kaW5ncy5waG9uZU51bWJlclwiPjwvbXktY29tcG9uZW50PidcbiAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICB2YXIgYnVpbGRDb21wb25lbnRUZW1wbGF0ZSA9IGZ1bmN0aW9uKG9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgIHZhciBrZWJhYkNhc2UgPSBmdW5jdGlvbihjYW1lbENhc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNrZXdlciA9IGZ1bmN0aW9uKF9tLCBjMSwgYzIpIHsgcmV0dXJuIFtjMSwgYzJdLmpvaW4oJy0nKS50b0xvd2VyQ2FzZSgpOyB9O1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FtZWxDYXNlLnJlcGxhY2UoLyhbYS16MC05XSkoW0EtWl0pL2csIHNrZXdlcik7XG4gICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICB2YXIgY29tcG9uZW50SGFuZGxlID0ga2ViYWJDYXNlKG9wdGlvbnMuY29tcG9uZW50KTtcbiAgICAgICAgICAgICAgICAgIHZhciB0ZW1wbGF0ZSA9ICc8JyArIGNvbXBvbmVudEhhbmRsZSArICcgY2xvc2U9XCJjbG9zZVwiJztcbiAgICAgICAgICAgICAgICAgIHZhciBpbnB1dEtleXMgPSBPYmplY3Qua2V5cyhvcHRpb25zLmJpbmRpbmdzIHx8IHt9KVxuICAgICAgICAgICAgICAgICAgaWYgKGlucHV0S2V5cy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBiaW5kaW5nQXR0cmlidXRlcyA9IGlucHV0S2V5cy5tYXAoZnVuY3Rpb24oaW5wdXRLZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ga2ViYWJDYXNlKGlucHV0S2V5KSArICc9XCJiaW5kaW5ncy4nICsgaW5wdXRLZXkgKyAnXCInO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGUgKz0gJyAnICsgYmluZGluZ0F0dHJpYnV0ZXMuam9pbignICcpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgdGVtcGxhdGUgKz0gJz48LycgKyBjb21wb25lbnRIYW5kbGUgKyAnPic7XG5cbiAgICAgICAgICAgICAgICAgIHJldHVybiB0ZW1wbGF0ZTtcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgdmFyIHNldHVwQ29tcG9uZW50T3B0aW9ucyA9IGZ1bmN0aW9uKG9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgIG9wdGlvbnMuY29udHJvbGxlciA9IGJ1aWxkQ29tcG9uZW50Q29udHJvbGxlcihvcHRpb25zKTtcbiAgICAgICAgICAgICAgICAgIG9wdGlvbnMudGVtcGxhdGUgPSBidWlsZENvbXBvbmVudFRlbXBsYXRlKG9wdGlvbnMpO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICBzZWxmLnNob3dNb2RhbCA9IGZ1bmN0aW9uIChvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmNvbXBvbmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgIHNldHVwQ29tcG9uZW50T3B0aW9ucyhvcHRpb25zKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIC8vICBHZXQgdGhlIGJvZHkgb2YgdGhlIGRvY3VtZW50LCB3ZSdsbCBhZGQgdGhlIG1vZGFsIHRvIHRoaXMuXG4gICAgICAgICAgICAgICAgICAgIHZhciBib2R5ID0gYW5ndWxhci5lbGVtZW50KCRkb2N1bWVudFswXS5ib2R5KTtcblxuICAgICAgICAgICAgICAgICAgICAvLyAgQ3JlYXRlIGEgZGVmZXJyZWQgd2UnbGwgcmVzb2x2ZSB3aGVuIHRoZSBtb2RhbCBpcyByZWFkeS5cbiAgICAgICAgICAgICAgICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKTtcblxuICAgICAgICAgICAgICAgICAgICAvLyAgVmFsaWRhdGUgdGhlIGlucHV0IHBhcmFtZXRlcnMuXG4gICAgICAgICAgICAgICAgICAgIHZhciBjb250cm9sbGVyTmFtZSA9IG9wdGlvbnMuY29udHJvbGxlcjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFjb250cm9sbGVyTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KFwiTm8gY29udHJvbGxlciBoYXMgYmVlbiBzcGVjaWZpZWQuXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAvLyAgR2V0IHRoZSBhY3R1YWwgaHRtbCBvZiB0aGUgdGVtcGxhdGUuXG4gICAgICAgICAgICAgICAgICAgIGdldFRlbXBsYXRlKG9wdGlvbnMudGVtcGxhdGUsIG9wdGlvbnMudGVtcGxhdGVVcmwpXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAodGVtcGxhdGUpIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBUaGUgbWFpbiBtb2RhbCBvYmplY3Qgd2Ugd2lsbCBidWlsZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kYWwgPSB7fTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBDcmVhdGUgYSBuZXcgc2NvcGUgZm9yIHRoZSBtb2RhbC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kYWxTY29wZSA9IChvcHRpb25zLnNjb3BlIHx8ICRyb290U2NvcGUpLiRuZXcoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9vdFNjb3BlT25DbG9zZSA9IG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uQ2hhbmdlU3VjY2VzcyA9IG9wdGlvbnMubG9jYXRpb25DaGFuZ2VTdWNjZXNzO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIEFsbG93IGxvY2F0aW9uQ2hhbmdlU3VjY2VzcyBldmVudCByZWdpc3RyYXRpb24gdG8gYmUgY29uZmlndXJhYmxlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBUcnVlIChkZWZhdWx0KSA9IGV2ZW50IHJlZ2lzdGVyZWQgd2l0aCBkZWZhdWx0Q2xvc2VEZWxheVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAjIChncmVhdGVyIHRoYW4gMCkgPSBldmVudCByZWdpc3RlcmVkIHdpdGggZGVsYXlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgRmFsc2UgPSBkaXNhYmxlZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MgPT09IGZhbHNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvb3RTY29wZU9uQ2xvc2UgPSBhbmd1bGFyLm5vb3A7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGFuZ3VsYXIuaXNOdW1iZXIobG9jYXRpb25DaGFuZ2VTdWNjZXNzKSAmJiBsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb290U2NvcGVPbkNsb3NlID0gJHJvb3RTY29wZS4kb24oJyRsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MnLCBpbnB1dHMuY2xvc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9vdFNjb3BlT25DbG9zZSA9ICRyb290U2NvcGUuJG9uKCckbG9jYXRpb25DaGFuZ2VTdWNjZXNzJywgaW5wdXRzLmNsb3NlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2VsZi5jb25maWdPcHRpb25zLmNsb3NlRGVsYXkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIENyZWF0ZSB0aGUgaW5wdXRzIG9iamVjdCB0byB0aGUgY29udHJvbGxlciAtIHRoaXMgd2lsbCBpbmNsdWRlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHRoZSBzY29wZSwgYXMgd2VsbCBhcyBhbGwgaW5wdXRzIHByb3ZpZGVkLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBXZSB3aWxsIGFsc28gY3JlYXRlIGEgZGVmZXJyZWQgdGhhdCBpcyByZXNvbHZlZCB3aXRoIGEgcHJvdmlkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgY2xvc2UgZnVuY3Rpb24uIFRoZSBjb250cm9sbGVyIGNhbiB0aGVuIGNhbGwgJ2Nsb3NlKHJlc3VsdCknLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBUaGUgY29udHJvbGxlciBjYW4gYWxzbyBwcm92aWRlIGEgZGVsYXkgZm9yIGNsb3NpbmcgLSB0aGlzIGlzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIGhlbHBmdWwgaWYgdGhlcmUgYXJlIGNsb3NpbmcgYW5pbWF0aW9ucyB3aGljaCBtdXN0IGZpbmlzaCBmaXJzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2xvc2VEZWZlcnJlZCA9ICRxLmRlZmVyKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNsb3NlZERlZmVycmVkID0gJHEuZGVmZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaGFzQWxyZWFkeUJlZW5DbG9zZWQgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbnB1dHMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZTogbW9kYWxTY29wZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uIChyZXN1bHQsIGRlbGF5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzQWxyZWFkeUJlZW5DbG9zZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNBbHJlYWR5QmVlbkNsb3NlZCA9IHRydWU7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGF5ID0gZGVsYXkgfHwgc2VsZi5jb25maWdPcHRpb25zLmNsb3NlRGVsYXk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgSWYgd2UgaGF2ZSBhIHByZS1jbG9zZSBmdW5jdGlvbiwgY2FsbCBpdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3B0aW9ucy5wcmVDbG9zZSA9PT0gJ2Z1bmN0aW9uJykgb3B0aW9ucy5wcmVDbG9zZShtb2RhbCwgcmVzdWx0LCBkZWxheSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWxheSA9PT0gdW5kZWZpbmVkIHx8IGRlbGF5ID09PSBudWxsKSBkZWxheSA9IDA7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFuVXBDbG9zZShyZXN1bHQpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBkZWxheSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIElmIHdlIGhhdmUgcHJvdmlkZWQgYW55IGlucHV0cywgcGFzcyB0aGVtIHRvIHRoZSBjb250cm9sbGVyLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmlucHV0cykgYW5ndWxhci5leHRlbmQoaW5wdXRzLCBvcHRpb25zLmlucHV0cyk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgQ29tcGlsZSB0aGVuIGxpbmsgdGhlIHRlbXBsYXRlIGVsZW1lbnQsIGJ1aWxkaW5nIHRoZSBhY3R1YWwgZWxlbWVudC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgU2V0IHRoZSAkZWxlbWVudCBvbiB0aGUgaW5wdXRzIHNvIHRoYXQgaXQgY2FuIGJlIGluamVjdGVkIGlmIHJlcXVpcmVkLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rRm4gPSAkY29tcGlsZSh0ZW1wbGF0ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGFsRWxlbWVudCA9IGxpbmtGbihtb2RhbFNjb3BlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dHMuJGVsZW1lbnQgPSBtb2RhbEVsZW1lbnQ7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgQ3JlYXRlIHRoZSBjb250cm9sbGVyLCBleHBsaWNpdGx5IHNwZWNpZnlpbmcgdGhlIHNjb3BlIHRvIHVzZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udHJvbGxlck9iakJlZm9yZSA9IG1vZGFsU2NvcGVbb3B0aW9ucy5jb250cm9sbGVyQXNdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtb2RhbENvbnRyb2xsZXIgPSAkY29udHJvbGxlcihvcHRpb25zLmNvbnRyb2xsZXIsIGlucHV0cywgZmFsc2UsIG9wdGlvbnMuY29udHJvbGxlckFzKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmNvbnRyb2xsZXJBcyAmJiBjb250cm9sbGVyT2JqQmVmb3JlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZXh0ZW5kKG1vZGFsQ29udHJvbGxlciwgY29udHJvbGxlck9iakJlZm9yZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFRoZW4sIGFwcGVuZCB0aGUgbW9kYWwgdG8gdGhlIGRvbS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXBwZW5kVGFyZ2V0ID0gYm9keTsgLy8gYXBwZW5kIHRvIGJvZHkgd2hlbiBubyBjdXN0b20gYXBwZW5kIGVsZW1lbnQgaXMgc3BlY2lmaWVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNTdHJpbmcob3B0aW9ucy5hcHBlbmRFbGVtZW50KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBxdWVyeSB0aGUgZG9jdW1lbnQgZm9yIHRoZSBmaXJzdCBlbGVtZW50IHRoYXQgbWF0Y2hlcyB0aGUgc2VsZWN0b3JcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhbmQgY3JlYXRlIGFuIGFuZ3VsYXIgZWxlbWVudCBvdXQgb2YgaXQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZFRhcmdldCA9IGFuZ3VsYXIuZWxlbWVudCgkZG9jdW1lbnRbMF0ucXVlcnlTZWxlY3RvcihvcHRpb25zLmFwcGVuZEVsZW1lbnQpKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3B0aW9ucy5hcHBlbmRFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFwcGVuZCB0byBjdXN0b20gYXBwZW5kIGVsZW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBwZW5kVGFyZ2V0ID0gb3B0aW9ucy5hcHBlbmRFbGVtZW50O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZENoaWxkKGFwcGVuZFRhcmdldCwgbW9kYWxFbGVtZW50KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZpbmFsbHksIGFwcGVuZCBhbnkgY3VzdG9tIGNsYXNzZXMgdG8gdGhlIGJvZHlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5ib2R5Q2xhc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keVswXS5jbGFzc0xpc3QuYWRkKG9wdGlvbnMuYm9keUNsYXNzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgUG9wdWxhdGUgdGhlIG1vZGFsIG9iamVjdC4uLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmNvbnRyb2xsZXIgPSBtb2RhbENvbnRyb2xsZXI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kYWwuc2NvcGUgPSBtb2RhbFNjb3BlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmVsZW1lbnQgPSBtb2RhbEVsZW1lbnQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kYWwuY2xvc2UgPSBjbG9zZURlZmVycmVkLnByb21pc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kYWwuY2xvc2VkID0gY2xvc2VkRGVmZXJyZWQucHJvbWlzZTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICRvbkluaXQgaXMgcGFydCBvZiB0aGUgY29tcG9uZW50IGxpZmVjeWNsZSBpbnRyb2R1Y2VkIGluIEFuZ3VsYXJKUyAxLjYueFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEJlY2F1c2UgaXQgbWF5IG5vdCBiZSBkZWZpbmVkIG9uIGFsbCBjb250cm9sbGVycyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSBtdXN0IGNoZWNrIGZvciBpdCBiZWZvcmUgYXR0ZW1wdGluZyB0byBpbnZva2UgaXQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaHR0cHM6Ly9kb2NzLmFuZ3VsYXJqcy5vcmcvZ3VpZGUvY29tcG9uZW50I2NvbXBvbmVudC1iYXNlZC1hcHBsaWNhdGlvbi1hcmNoaXRlY3R1cmVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKG1vZGFsLmNvbnRyb2xsZXIuJG9uSW5pdCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kYWwuY29udHJvbGxlci4kb25Jbml0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIC4uLndoaWNoIGlzIHBhc3NlZCB0byB0aGUgY2FsbGVyIHZpYSB0aGUgcHJvbWlzZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKG1vZGFsKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIENsZWFyIHByZXZpb3VzIGlucHV0IGZvY3VzIHRvIGF2b2lkIG9wZW4gbXVsdGlwbGUgbW9kYWxzIG9uIGVudGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuYWN0aXZlRWxlbWVudC5ibHVyKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgV2UgY2FuIHRyYWNrIHRoaXMgbW9kYWwgaW4gb3VyIG9wZW4gbW9kYWxzLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYub3Blbk1vZGFscy5wdXNoKHttb2RhbDogbW9kYWwsIGNsb3NlOiBpbnB1dHMuY2xvc2V9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNsZWFuVXBDbG9zZShyZXN1bHQpIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgUmVzb2x2ZSB0aGUgJ2Nsb3NlJyBwcm9taXNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZURlZmVycmVkLnJlc29sdmUocmVzdWx0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgUmVtb3ZlIHRoZSBjdXN0b20gY2xhc3MgZnJvbSB0aGUgYm9keVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5ib2R5Q2xhc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHlbMF0uY2xhc3NMaXN0LnJlbW92ZShvcHRpb25zLmJvZHlDbGFzcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgTGV0IGFuZ3VsYXIgcmVtb3ZlIHRoZSBlbGVtZW50IGFuZCB3YWl0IGZvciBhbmltYXRpb25zIHRvIGZpbmlzaC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGFuaW1hdGUubGVhdmUobW9kYWxFbGVtZW50KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHByZXZlbnQgZXJyb3IgaWYgbW9kYWwgaXMgYWxyZWFkeSBkZXN0cm95ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1vZGFsRWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFJlc29sdmUgdGhlICdjbG9zZWQnIHByb21pc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2VkRGVmZXJyZWQucmVzb2x2ZShyZXN1bHQpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFdlIGNhbiBub3cgY2xlYW4gdXAgdGhlIHNjb3BlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kYWxTY29wZS4kZGVzdHJveSgpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFJlbW92ZSB0aGUgbW9kYWwgZnJvbSB0aGUgc2V0IG9mIG9wZW4gbW9kYWxzLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2VsZi5vcGVuTW9kYWxzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wZW5Nb2RhbHNbaV0ubW9kYWwgPT09IG1vZGFsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZW5Nb2RhbHMuc3BsaWNlKGksIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgVW5sZXNzIHdlIG51bGwgb3V0IGFsbCBvZiB0aGVzZSBvYmplY3RzIHdlIHNlZW0gdG8gc3VmZmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIGZyb20gbWVtb3J5IGxlYWtzLCBpZiBhbnlvbmUgY2FuIGV4cGxhaW4gd2h5IHRoZW4gSSdkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIGJlIHZlcnkgaW50ZXJlc3RlZCB0byBrbm93LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0cy5jbG9zZSA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb3NlRGVmZXJyZWQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dHMgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsRWxlbWVudCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kYWxTY29wZSA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZW1vdmUgZXZlbnQgd2F0Y2hlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb290U2NvcGVPbkNsb3NlICYmIHJvb3RTY29wZU9uQ2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbihudWxsLCBmdW5jdGlvbiAoZXJyb3IpIHsgLy8gJ2NhdGNoJyBkb2Vzbid0IHdvcmsgaW4gSUU4LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBuZXcgTW9kYWxTZXJ2aWNlKF9vcHRpb25zKTtcbiAgICAgICAgfV07XG4gICAgfSk7XG4iXSwic291cmNlUm9vdCI6IiJ9 | ||
!function(e){var n={};function o(t){if(n[t])return n[t].exports;var l=n[t]={i:t,l:!1,exports:{}};return e[t].call(l.exports,l,l.exports,o),l.l=!0,l.exports}o.m=e,o.c=n,o.d=function(e,n,t){o.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,n){if(1&n&&(e=o(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var l in e)o.d(t,l,function(n){return e[n]}.bind(null,l));return t},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="",o(o.s=0)}([function(e,n,o){"use strict";angular.module("angularModalService",[]).provider("ModalService",(function(){var e={closeDelay:0};this.configureOptions=function(n){angular.extend(e,n)},this.$get=["$animate","$document","$compile","$controller","$http","$rootScope","$q","$templateRequest","$timeout",function(n,o,t,l,r,c,i,s,u){return new function(e){var r=this;r.configOptions=e,r.openModals=[],r.closeModals=function(e,n){for(n=n||r.configOptions.closeDelay;r.openModals.length;)r.openModals[0].close(e,n),r.openModals.splice(0,1)};var a=function(e){e.controller=function(e){return["$scope","close",function(n,o){n.close=o,n.bindings=e.bindings}]}(e),e.template=function(e){var n=function(e){return e.replace(/([a-z0-9])([A-Z])/g,(function(e,n,o){return[n,o].join("-").toLowerCase()}))},o=n(e.component),t="<"+o+' close="close"',l=Object.keys(e.bindings||{});l.length>0&&(t+=" "+l.map((function(e){return n(e)+'="bindings.'+e+'"'})).join(" "));return t+="></"+o+">"}(e)};r.showModal=function(e){e.component&&a(e);var p=angular.element(o[0].body),f=i.defer();return e.controller?(function(e,n){var o=i.defer();return e?o.resolve(e):n?s(n,!0).then((function(e){o.resolve(e)}),(function(e){o.reject(e)})):o.reject("No template or templateUrl has been specified."),o.promise}(e.template,e.templateUrl).then((function(s){var a={},d=(e.scope||c).$new(),m=null,g=e.locationChangeSuccess;!1===g?m=angular.noop:angular.isNumber(g)&&g>=0?u((function(){m=c.$on("$locationChangeSuccess",h.close)}),g):u((function(){m=c.$on("$locationChangeSuccess",h.close)}),r.configOptions.closeDelay);var v=i.defer(),b=i.defer(),y=!1,h={$scope:d,close:function(o,t){y||(y=!0,t=t||r.configOptions.closeDelay,"function"==typeof e.preClose&&e.preClose(a,o,t),null==t&&(t=0),u((function(){!function(o){v.resolve(o),e.bodyClass&&p[0].classList.remove(e.bodyClass);n.leave($).then((function(){if($){b.resolve(o),d.$destroy();for(var e=0;e<r.openModals.length;e++)if(r.openModals[e].modal===a){r.openModals.splice(e,1);break}h.close=null,f=null,v=null,a=null,h=null,$=null,d=null}})),m&&m()}(o)}),t))}};e.inputs&&angular.extend(h,e.inputs);var $=t(s)(d);h.$element=$;var M=d[e.controllerAs],j=l(e.controller,h,!1,e.controllerAs);e.controllerAs&&M&&angular.extend(j,M);var O,S,C,x=p;angular.isString(e.appendElement)?x=angular.element(o[0].querySelector(e.appendElement)):e.appendElement&&(x=e.appendElement),S=$,(C=(O=x).children()).length>0?n.enter(S,O,C[C.length-1]):n.enter(S,O),e.bodyClass&&p[0].classList.add(e.bodyClass),a.controller=j,a.scope=d,a.element=$,a.close=v.promise,a.closed=b.promise,angular.isFunction(a.controller.$onInit)&&a.controller.$onInit(),f.resolve(a),document.activeElement.blur(),r.openModals.push({modal:a,close:h.close})})).then(null,(function(e){f.reject(e)})),f.promise):(f.reject("No controller has been specified."),f.promise)}}(e)}]}))}]); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY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JyZWQucmVzb2x2ZSh0ZW1wbGF0ZSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGVtcGxhdGVVcmwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wbGF0ZVJlcXVlc3QodGVtcGxhdGVVcmwsIHRydWUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHRlbXBsYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUodGVtcGxhdGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KFwiTm8gdGVtcGxhdGUgb3IgdGVtcGxhdGVVcmwgaGFzIGJlZW4gc3BlY2lmaWVkLlwiKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgLy8gIEFkZHMgYW4gZWxlbWVudCB0byB0aGUgRE9NIGFzIHRoZSBsYXN0IGNoaWxkIG9mIGl0cyBjb250YWluZXJcbiAgICAgICAgICAgICAgICAvLyAgbGlrZSBhcHBlbmQsIGJ1dCB1c2VzICRhbmltYXRlIHRvIGhhbmRsZSBhbmltYXRpb25zLiBSZXR1cm5zIGFcbiAgICAgICAgICAgICAgICAvLyAgcHJvbWlzZSB0aGF0IGlzIHJlc29sdmVkIG9uY2UgYWxsIGFuaW1hdGlvbiBpcyBjb21wbGV0ZS5cbiAgICAgICAgICAgICAgICB2YXIgYXBwZW5kQ2hpbGQgPSBmdW5jdGlvbiAocGFyZW50LCBjaGlsZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2hpbGRyZW4gPSBwYXJlbnQuY2hpbGRyZW4oKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkcmVuLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkYW5pbWF0ZS5lbnRlcihjaGlsZCwgcGFyZW50LCBjaGlsZHJlbltjaGlsZHJlbi5sZW5ndGggLSAxXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRhbmltYXRlLmVudGVyKGNoaWxkLCBwYXJlbnQpO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAvLyAgQ2xvc2UgYWxsIG1vZGFscywgcHJvdmlkaW5nIHRoZSBnaXZlbiByZXN1bHQgdG8gdGhlIGNsb3NlIHByb21pc2UuXG4gICAgICAgICAgICAgICAgc2VsZi5jbG9zZU1vZGFscyA9IGZ1bmN0aW9uIChyZXN1bHQsIGRlbGF5KSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGF5ID0gZGVsYXkgfHwgc2VsZi5jb25maWdPcHRpb25zLmNsb3NlRGVsYXk7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChzZWxmLm9wZW5Nb2RhbHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZW5Nb2RhbHNbMF0uY2xvc2UocmVzdWx0LCBkZWxheSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZW5Nb2RhbHMuc3BsaWNlKDAsIDEpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIC8qXG4gICAgICAgICAgICAgICAgICogIENyZWF0ZXMgYSBjb250cm9sbGVyIHdpdGggc2NvcGUgYmluZGluZ3NcbiAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICB2YXIgYnVpbGRDb21wb25lbnRDb250cm9sbGVyID0gZnVuY3Rpb24ob3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIFsnJHNjb3BlJywgJ2Nsb3NlJywgZnVuY3Rpb24oJHNjb3BlLCBjbG9zZSkge1xuICAgICAgICAgICAgICAgICAgICAkc2NvcGUuY2xvc2UgPSBjbG9zZTtcbiAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmJpbmRpbmdzID0gb3B0aW9ucy5iaW5kaW5ncztcbiAgICAgICAgICAgICAgICAgIH1dO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAvKlxuICAgICAgICAgICAgICAgICAqICBDcmVhdGVzIGEgY29tcG9uZW50IHRlbXBsYXRlXG4gICAgICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAgICAgKiAgSW5wdXQ6XG4gICAgICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAgICAgKiAgICB7XG4gICAgICAgICAgICAgICAgICogICAgICAgY29tcG9uZW50OiAnbXlDb21wb25lbnQnLFxuICAgICAgICAgICAgICAgICAqICAgICAgIGJpbmRpbmdzOiB7XG4gICAgICAgICAgICAgICAgICogICAgICAgICBuYW1lOiAnRm9vJyxcbiAgICAgICAgICAgICAgICAgKiAgICAgICAgIHBob25lTnVtYmVyOiAnMTIzLTQ1Ni03ODkwJ1xuICAgICAgICAgICAgICAgICAqICAgICAgIH1cbiAgICAgICAgICAgICAgICAgKiAgICB9XG4gICAgICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAgICAgKiAgT3V0cHV0OlxuICAgICAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgICAgICogICAgJzxteS1jb21wb25lbnQgY2xvc2U9XCJjbG9zZVwiIG5hbWU9XCJiaW5kaW5ncy5uYW1lXCIgcGhvbmUtbnVtYmVyPVwiYmluZGluZ3MucGhvbmVOdW1iZXJcIj48L215LWNvbXBvbmVudD4nXG4gICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgdmFyIGJ1aWxkQ29tcG9uZW50VGVtcGxhdGUgPSBmdW5jdGlvbihvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICB2YXIga2ViYWJDYXNlID0gZnVuY3Rpb24oY2FtZWxDYXNlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBza2V3ZXIgPSBmdW5jdGlvbihfbSwgYzEsIGMyKSB7IHJldHVybiBbYzEsIGMyXS5qb2luKCctJykudG9Mb3dlckNhc2UoKTsgfTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbWVsQ2FzZS5yZXBsYWNlKC8oW2EtejAtOV0pKFtBLVpdKS9nLCBza2V3ZXIpO1xuICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgdmFyIGNvbXBvbmVudEhhbmRsZSA9IGtlYmFiQ2FzZShvcHRpb25zLmNvbXBvbmVudCk7XG4gICAgICAgICAgICAgICAgICB2YXIgdGVtcGxhdGUgPSAnPCcgKyBjb21wb25lbnRIYW5kbGUgKyAnIGNsb3NlPVwiY2xvc2VcIic7XG4gICAgICAgICAgICAgICAgICB2YXIgaW5wdXRLZXlzID0gT2JqZWN0LmtleXMob3B0aW9ucy5iaW5kaW5ncyB8fCB7fSlcbiAgICAgICAgICAgICAgICAgIGlmIChpbnB1dEtleXMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYmluZGluZ0F0dHJpYnV0ZXMgPSBpbnB1dEtleXMubWFwKGZ1bmN0aW9uKGlucHV0S2V5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGtlYmFiQ2FzZShpbnB1dEtleSkgKyAnPVwiYmluZGluZ3MuJyArIGlucHV0S2V5ICsgJ1wiJztcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlICs9ICcgJyArIGJpbmRpbmdBdHRyaWJ1dGVzLmpvaW4oJyAnKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIHRlbXBsYXRlICs9ICc+PC8nICsgY29tcG9uZW50SGFuZGxlICsgJz4nO1xuXG4gICAgICAgICAgICAgICAgICByZXR1cm4gdGVtcGxhdGU7XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHZhciBzZXR1cENvbXBvbmVudE9wdGlvbnMgPSBmdW5jdGlvbihvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICBvcHRpb25zLmNvbnRyb2xsZXIgPSBidWlsZENvbXBvbmVudENvbnRyb2xsZXIob3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgICBvcHRpb25zLnRlbXBsYXRlID0gYnVpbGRDb21wb25lbnRUZW1wbGF0ZShvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgc2VsZi5zaG93TW9kYWwgPSBmdW5jdGlvbiAob3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jb21wb25lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICBzZXR1cENvbXBvbmVudE9wdGlvbnMob3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAvLyAgR2V0IHRoZSBib2R5IG9mIHRoZSBkb2N1bWVudCwgd2UnbGwgYWRkIHRoZSBtb2RhbCB0byB0aGlzLlxuICAgICAgICAgICAgICAgICAgICB2YXIgYm9keSA9IGFuZ3VsYXIuZWxlbWVudCgkZG9jdW1lbnRbMF0uYm9keSk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gIENyZWF0ZSBhIGRlZmVycmVkIHdlJ2xsIHJlc29sdmUgd2hlbiB0aGUgbW9kYWwgaXMgcmVhZHkuXG4gICAgICAgICAgICAgICAgICAgIHZhciBkZWZlcnJlZCA9ICRxLmRlZmVyKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gIFZhbGlkYXRlIHRoZSBpbnB1dCBwYXJhbWV0ZXJzLlxuICAgICAgICAgICAgICAgICAgICB2YXIgY29udHJvbGxlck5hbWUgPSBvcHRpb25zLmNvbnRyb2xsZXI7XG4gICAgICAgICAgICAgICAgICAgIGlmICghY29udHJvbGxlck5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChcIk5vIGNvbnRyb2xsZXIgaGFzIGJlZW4gc3BlY2lmaWVkLlwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZC5wcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gIEdldCB0aGUgYWN0dWFsIGh0bWwgb2YgdGhlIHRlbXBsYXRlLlxuICAgICAgICAgICAgICAgICAgICBnZXRUZW1wbGF0ZShvcHRpb25zLnRlbXBsYXRlLCBvcHRpb25zLnRlbXBsYXRlVXJsKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHRlbXBsYXRlKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgVGhlIG1haW4gbW9kYWwgb2JqZWN0IHdlIHdpbGwgYnVpbGQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGFsID0ge307XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgQ3JlYXRlIGEgbmV3IHNjb3BlIGZvciB0aGUgbW9kYWwuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGFsU2NvcGUgPSAob3B0aW9ucy5zY29wZSB8fCAkcm9vdFNjb3BlKS4kbmV3KCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvb3RTY29wZU9uQ2xvc2UgPSBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MgPSBvcHRpb25zLmxvY2F0aW9uQ2hhbmdlU3VjY2VzcztcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBBbGxvdyBsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MgZXZlbnQgcmVnaXN0cmF0aW9uIHRvIGJlIGNvbmZpZ3VyYWJsZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgVHJ1ZSAoZGVmYXVsdCkgPSBldmVudCByZWdpc3RlcmVkIHdpdGggZGVmYXVsdENsb3NlRGVsYXlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgIyAoZ3JlYXRlciB0aGFuIDApID0gZXZlbnQgcmVnaXN0ZXJlZCB3aXRoIGRlbGF5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIEZhbHNlID0gZGlzYWJsZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobG9jYXRpb25DaGFuZ2VTdWNjZXNzID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb290U2NvcGVPbkNsb3NlID0gYW5ndWxhci5ub29wO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChhbmd1bGFyLmlzTnVtYmVyKGxvY2F0aW9uQ2hhbmdlU3VjY2VzcykgJiYgbG9jYXRpb25DaGFuZ2VTdWNjZXNzID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9vdFNjb3BlT25DbG9zZSA9ICRyb290U2NvcGUuJG9uKCckbG9jYXRpb25DaGFuZ2VTdWNjZXNzJywgaW5wdXRzLmNsb3NlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbG9jYXRpb25DaGFuZ2VTdWNjZXNzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvb3RTY29wZU9uQ2xvc2UgPSAkcm9vdFNjb3BlLiRvbignJGxvY2F0aW9uQ2hhbmdlU3VjY2VzcycsIGlucHV0cy5jbG9zZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNlbGYuY29uZmlnT3B0aW9ucy5jbG9zZURlbGF5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBDcmVhdGUgdGhlIGlucHV0cyBvYmplY3QgdG8gdGhlIGNvbnRyb2xsZXIgLSB0aGlzIHdpbGwgaW5jbHVkZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICB0aGUgc2NvcGUsIGFzIHdlbGwgYXMgYWxsIGlucHV0cyBwcm92aWRlZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgV2Ugd2lsbCBhbHNvIGNyZWF0ZSBhIGRlZmVycmVkIHRoYXQgaXMgcmVzb2x2ZWQgd2l0aCBhIHByb3ZpZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIGNsb3NlIGZ1bmN0aW9uLiBUaGUgY29udHJvbGxlciBjYW4gdGhlbiBjYWxsICdjbG9zZShyZXN1bHQpJy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgVGhlIGNvbnRyb2xsZXIgY2FuIGFsc28gcHJvdmlkZSBhIGRlbGF5IGZvciBjbG9zaW5nIC0gdGhpcyBpc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBoZWxwZnVsIGlmIHRoZXJlIGFyZSBjbG9zaW5nIGFuaW1hdGlvbnMgd2hpY2ggbXVzdCBmaW5pc2ggZmlyc3QuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNsb3NlRGVmZXJyZWQgPSAkcS5kZWZlcigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjbG9zZWREZWZlcnJlZCA9ICRxLmRlZmVyKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhhc0FscmVhZHlCZWVuQ2xvc2VkID0gZmFsc2U7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5wdXRzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGU6IG1vZGFsU2NvcGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb3NlOiBmdW5jdGlvbiAocmVzdWx0LCBkZWxheSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc0FscmVhZHlCZWVuQ2xvc2VkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzQWxyZWFkeUJlZW5DbG9zZWQgPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxheSA9IGRlbGF5IHx8IHNlbGYuY29uZmlnT3B0aW9ucy5jbG9zZURlbGF5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIElmIHdlIGhhdmUgYSBwcmUtY2xvc2UgZnVuY3Rpb24sIGNhbGwgaXQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMucHJlQ2xvc2UgPT09ICdmdW5jdGlvbicpIG9wdGlvbnMucHJlQ2xvc2UobW9kYWwsIHJlc3VsdCwgZGVsYXkpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVsYXkgPT09IHVuZGVmaW5lZCB8fCBkZWxheSA9PT0gbnVsbCkgZGVsYXkgPSAwO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhblVwQ2xvc2UocmVzdWx0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZGVsYXkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBJZiB3ZSBoYXZlIHByb3ZpZGVkIGFueSBpbnB1dHMsIHBhc3MgdGhlbSB0byB0aGUgY29udHJvbGxlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5pbnB1dHMpIGFuZ3VsYXIuZXh0ZW5kKGlucHV0cywgb3B0aW9ucy5pbnB1dHMpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIENvbXBpbGUgdGhlbiBsaW5rIHRoZSB0ZW1wbGF0ZSBlbGVtZW50LCBidWlsZGluZyB0aGUgYWN0dWFsIGVsZW1lbnQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFNldCB0aGUgJGVsZW1lbnQgb24gdGhlIGlucHV0cyBzbyB0aGF0IGl0IGNhbiBiZSBpbmplY3RlZCBpZiByZXF1aXJlZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGlua0ZuID0gJGNvbXBpbGUodGVtcGxhdGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtb2RhbEVsZW1lbnQgPSBsaW5rRm4obW9kYWxTY29wZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRzLiRlbGVtZW50ID0gbW9kYWxFbGVtZW50O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIENyZWF0ZSB0aGUgY29udHJvbGxlciwgZXhwbGljaXRseSBzcGVjaWZ5aW5nIHRoZSBzY29wZSB0byB1c2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRyb2xsZXJPYmpCZWZvcmUgPSBtb2RhbFNjb3BlW29wdGlvbnMuY29udHJvbGxlckFzXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kYWxDb250cm9sbGVyID0gJGNvbnRyb2xsZXIob3B0aW9ucy5jb250cm9sbGVyLCBpbnB1dHMsIGZhbHNlLCBvcHRpb25zLmNvbnRyb2xsZXJBcyk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jb250cm9sbGVyQXMgJiYgY29udHJvbGxlck9iakJlZm9yZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZChtb2RhbENvbnRyb2xsZXIsIGNvbnRyb2xsZXJPYmpCZWZvcmUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBUaGVuLCBhcHBlbmQgdGhlIG1vZGFsIHRvIHRoZSBkb20uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFwcGVuZFRhcmdldCA9IGJvZHk7IC8vIGFwcGVuZCB0byBib2R5IHdoZW4gbm8gY3VzdG9tIGFwcGVuZCBlbGVtZW50IGlzIHNwZWNpZmllZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzU3RyaW5nKG9wdGlvbnMuYXBwZW5kRWxlbWVudCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcXVlcnkgdGhlIGRvY3VtZW50IGZvciB0aGUgZmlyc3QgZWxlbWVudCB0aGF0IG1hdGNoZXMgdGhlIHNlbGVjdG9yXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIGNyZWF0ZSBhbiBhbmd1bGFyIGVsZW1lbnQgb3V0IG9mIGl0LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRUYXJnZXQgPSBhbmd1bGFyLmVsZW1lbnQoJGRvY3VtZW50WzBdLnF1ZXJ5U2VsZWN0b3Iob3B0aW9ucy5hcHBlbmRFbGVtZW50KSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdGlvbnMuYXBwZW5kRWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhcHBlbmQgdG8gY3VzdG9tIGFwcGVuZCBlbGVtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZFRhcmdldCA9IG9wdGlvbnMuYXBwZW5kRWxlbWVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRDaGlsZChhcHBlbmRUYXJnZXQsIG1vZGFsRWxlbWVudCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGaW5hbGx5LCBhcHBlbmQgYW55IGN1c3RvbSBjbGFzc2VzIHRvIHRoZSBib2R5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuYm9keUNsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHlbMF0uY2xhc3NMaXN0LmFkZChvcHRpb25zLmJvZHlDbGFzcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFBvcHVsYXRlIHRoZSBtb2RhbCBvYmplY3QuLi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbC5jb250cm9sbGVyID0gbW9kYWxDb250cm9sbGVyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLnNjb3BlID0gbW9kYWxTY29wZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbC5lbGVtZW50ID0gbW9kYWxFbGVtZW50O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmNsb3NlID0gY2xvc2VEZWZlcnJlZC5wcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmNsb3NlZCA9IGNsb3NlZERlZmVycmVkLnByb21pc2U7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAkb25Jbml0IGlzIHBhcnQgb2YgdGhlIGNvbXBvbmVudCBsaWZlY3ljbGUgaW50cm9kdWNlZCBpbiBBbmd1bGFySlMgMS42LnhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBCZWNhdXNlIGl0IG1heSBub3QgYmUgZGVmaW5lZCBvbiBhbGwgY29udHJvbGxlcnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgbXVzdCBjaGVjayBmb3IgaXQgYmVmb3JlIGF0dGVtcHRpbmcgdG8gaW52b2tlIGl0LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGh0dHBzOi8vZG9jcy5hbmd1bGFyanMub3JnL2d1aWRlL2NvbXBvbmVudCNjb21wb25lbnQtYmFzZWQtYXBwbGljYXRpb24tYXJjaGl0ZWN0dXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNGdW5jdGlvbihtb2RhbC5jb250cm9sbGVyLiRvbkluaXQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmNvbnRyb2xsZXIuJG9uSW5pdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAuLi53aGljaCBpcyBwYXNzZWQgdG8gdGhlIGNhbGxlciB2aWEgdGhlIHByb21pc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShtb2RhbCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyBpbnB1dCBmb2N1cyB0byBhdm9pZCBvcGVuIG11bHRpcGxlIG1vZGFscyBvbiBlbnRlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQuYmx1cigpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFdlIGNhbiB0cmFjayB0aGlzIG1vZGFsIGluIG91ciBvcGVuIG1vZGFscy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZW5Nb2RhbHMucHVzaCh7bW9kYWw6IG1vZGFsLCBjbG9zZTogaW5wdXRzLmNsb3NlfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjbGVhblVwQ2xvc2UocmVzdWx0KSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFJlc29sdmUgdGhlICdjbG9zZScgcHJvbWlzZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2VEZWZlcnJlZC5yZXNvbHZlKHJlc3VsdCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFJlbW92ZSB0aGUgY3VzdG9tIGNsYXNzIGZyb20gdGhlIGJvZHlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuYm9keUNsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5WzBdLmNsYXNzTGlzdC5yZW1vdmUob3B0aW9ucy5ib2R5Q2xhc3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIExldCBhbmd1bGFyIHJlbW92ZSB0aGUgZWxlbWVudCBhbmQgd2FpdCBmb3IgYW5pbWF0aW9ucyB0byBmaW5pc2guXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRhbmltYXRlLmxlYXZlKG1vZGFsRWxlbWVudClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBwcmV2ZW50IGVycm9yIGlmIG1vZGFsIGlzIGFscmVhZHkgZGVzdHJveWVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtb2RhbEVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBSZXNvbHZlIHRoZSAnY2xvc2VkJyBwcm9taXNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb3NlZERlZmVycmVkLnJlc29sdmUocmVzdWx0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBXZSBjYW4gbm93IGNsZWFuIHVwIHRoZSBzY29wZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsU2NvcGUuJGRlc3Ryb3koKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBSZW1vdmUgdGhlIG1vZGFsIGZyb20gdGhlIHNldCBvZiBvcGVuIG1vZGFscy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNlbGYub3Blbk1vZGFscy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi5vcGVuTW9kYWxzW2ldLm1vZGFsID09PSBtb2RhbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVuTW9kYWxzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFVubGVzcyB3ZSBudWxsIG91dCBhbGwgb2YgdGhlc2Ugb2JqZWN0cyB3ZSBzZWVtIHRvIHN1ZmZlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBmcm9tIG1lbW9yeSBsZWFrcywgaWYgYW55b25lIGNhbiBleHBsYWluIHdoeSB0aGVuIEknZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBiZSB2ZXJ5IGludGVyZXN0ZWQgdG8ga25vdy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dHMuY2xvc2UgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZURlZmVycmVkID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRzID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbEVsZW1lbnQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsU2NvcGUgPSBudWxsO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3ZlIGV2ZW50IHdhdGNoZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9vdFNjb3BlT25DbG9zZSAmJiByb290U2NvcGVPbkNsb3NlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4obnVsbCwgZnVuY3Rpb24gKGVycm9yKSB7IC8vICdjYXRjaCcgZG9lc24ndCB3b3JrIGluIElFOC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gbmV3IE1vZGFsU2VydmljZShfb3B0aW9ucyk7XG4gICAgICAgIH1dO1xuICAgIH0pO1xuIl0sInNvdXJjZVJvb3QiOiIifQ== |
@@ -1,1 +0,1 @@ | ||
!function(o){var t={};function l(e){if(t[e])return t[e].exports;var n=t[e]={i:e,l:!1,exports:{}};return o[e].call(n.exports,n,n.exports,l),n.l=!0,n.exports}l.m=o,l.c=t,l.d=function(e,n,o){l.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(n,e){if(1&e&&(n=l(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var o=Object.create(null);if(l.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var t in n)l.d(o,t,function(e){return n[e]}.bind(null,t));return o},l.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(n,"a",n),n},l.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},l.p="",l(l.s=0)}([function(e,n,o){"use strict";angular.module("angularModalService",[]).provider("ModalService",function(){var n={closeDelay:0};this.configureOptions=function(e){angular.extend(n,e)},this.$get=["$animate","$document","$compile","$controller","$http","$rootScope","$q","$templateRequest","$timeout",function($,M,j,O,e,S,C,u,x){return new function(e){var h=this;h.configOptions=e,h.openModals=[],h.closeModals=function(e,n){for(n=n||h.configOptions.closeDelay;h.openModals.length;)h.openModals[0].close(e,n),h.openModals.splice(0,1)};h.showModal=function(v){var e,n,o,t,l,r,c;v.component&&((e=v).controller=(c=e,["$scope","close",function(e,n){e.close=n,e.bindings=c.bindings}]),e.template=(t=(o=function(e){return e.replace(/([a-z0-9])([A-Z])/g,function(e,n,o){return[n,o].join("-").toLowerCase()})})((n=e).component),l="<"+t+' close="close"',0<(r=Object.keys(n.bindings||{})).length&&(l+=" "+r.map(function(e){return o(e)+'="bindings.'+e+'"'}).join(" ")),l+"></"+t+">"));var s,a,i,b=angular.element(M[0].body),y=C.defer();return v.controller?(s=v.template,a=v.templateUrl,i=C.defer(),s?i.resolve(s):a?u(a,!0).then(function(e){i.resolve(e)},function(e){i.reject(e)}):i.reject("No template or templateUrl has been specified."),i.promise).then(function(e){var o={},t=(v.scope||S).$new(),l=null,n=v.locationChangeSuccess;!1===n?l=angular.noop:angular.isNumber(n)&&0<=n?x(function(){l=S.$on("$locationChangeSuccess",a.close)},n):x(function(){l=S.$on("$locationChangeSuccess",a.close)},h.configOptions.closeDelay);var r=C.defer(),c=C.defer(),s=!1,a={$scope:t,close:function(e,n){s||(s=!0,n=n||h.configOptions.closeDelay,"function"==typeof v.preClose&&v.preClose(o,e,n),null!=n||(n=0),x(function(){var n;n=e,r.resolve(n),v.bodyClass&&b[0].classList.remove(v.bodyClass),$.leave(i).then(function(){if(i){c.resolve(n),t.$destroy();for(var e=0;e<h.openModals.length;e++)if(h.openModals[e].modal===o){h.openModals.splice(e,1);break}a.close=null,t=i=a=o=r=y=null}}),l&&l()},n))}};v.inputs&&angular.extend(a,v.inputs);var i=j(e)(t);a.$element=i;var u=t[v.controllerAs],p=O(v.controller,a,!1,v.controllerAs);v.controllerAs&&u&&angular.extend(p,u);var f,d,m,g=b;angular.isString(v.appendElement)?g=angular.element(M[0].querySelector(v.appendElement)):v.appendElement&&(g=v.appendElement),d=i,0<(m=(f=g).children()).length?$.enter(d,f,m[m.length-1]):$.enter(d,f),v.bodyClass&&b[0].classList.add(v.bodyClass),o.controller=p,o.scope=t,o.element=i,o.close=r.promise,o.closed=c.promise,angular.isFunction(o.controller.$onInit)&&o.controller.$onInit(),y.resolve(o),document.activeElement.blur(),h.openModals.push({modal:o,close:a.close})}).then(null,function(e){y.reject(e)}):y.reject("No controller has been specified."),y.promise}}(n)}]})}]); | ||
!function(o){var t={};function l(e){if(t[e])return t[e].exports;var n=t[e]={i:e,l:!1,exports:{}};return o[e].call(n.exports,n,n.exports,l),n.l=!0,n.exports}l.m=o,l.c=t,l.d=function(e,n,o){l.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(n,e){if(1&e&&(n=l(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var o=Object.create(null);if(l.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var t in n)l.d(o,t,function(e){return n[e]}.bind(null,t));return o},l.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(n,"a",n),n},l.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},l.p="",l(l.s=0)}([function(e,n,o){"use strict";angular.module("angularModalService",[]).provider("ModalService",function(){var n={closeDelay:0};this.configureOptions=function(e){angular.extend(n,e)},this.$get=["$animate","$document","$compile","$controller","$http","$rootScope","$q","$templateRequest","$timeout",function($,M,j,O,e,S,C,u,x){return new function(e){var h=this;h.configOptions=e,h.openModals=[],h.closeModals=function(e,n){for(n=n||h.configOptions.closeDelay;h.openModals.length;)h.openModals[0].close(e,n),h.openModals.splice(0,1)};h.showModal=function(v){var e,n,o,t,l,r,c;v.component&&((e=v).controller=(c=e,["$scope","close",function(e,n){e.close=n,e.bindings=c.bindings}]),e.template=(t=(o=function(e){return e.replace(/([a-z0-9])([A-Z])/g,function(e,n,o){return[n,o].join("-").toLowerCase()})})((n=e).component),l="<"+t+' close="close"',0<(r=Object.keys(n.bindings||{})).length&&(l+=" "+r.map(function(e){return o(e)+'="bindings.'+e+'"'}).join(" ")),l+"></"+t+">"));var s,a,i,b=angular.element(M[0].body),y=C.defer();return v.controller?(s=v.template,a=v.templateUrl,i=C.defer(),s?i.resolve(s):a?u(a,!0).then(function(e){i.resolve(e)},function(e){i.reject(e)}):i.reject("No template or templateUrl has been specified."),i.promise).then(function(e){var o={},t=(v.scope||S).$new(),l=null,n=v.locationChangeSuccess;!1===n?l=angular.noop:angular.isNumber(n)&&0<=n?x(function(){l=S.$on("$locationChangeSuccess",a.close)},n):x(function(){l=S.$on("$locationChangeSuccess",a.close)},h.configOptions.closeDelay);var r=C.defer(),c=C.defer(),s=!1,a={$scope:t,close:function(e,n){s||(s=!0,n=n||h.configOptions.closeDelay,"function"==typeof v.preClose&&v.preClose(o,e,n),null==n&&(n=0),x(function(){var n;n=e,r.resolve(n),v.bodyClass&&b[0].classList.remove(v.bodyClass),$.leave(i).then(function(){if(i){c.resolve(n),t.$destroy();for(var e=0;e<h.openModals.length;e++)if(h.openModals[e].modal===o){h.openModals.splice(e,1);break}a.close=null,t=i=a=o=r=y=null}}),l&&l()},n))}};v.inputs&&angular.extend(a,v.inputs);var i=j(e)(t);a.$element=i;var u=t[v.controllerAs],p=O(v.controller,a,!1,v.controllerAs);v.controllerAs&&u&&angular.extend(p,u);var f,d,m,g=b;angular.isString(v.appendElement)?g=angular.element(M[0].querySelector(v.appendElement)):v.appendElement&&(g=v.appendElement),d=i,0<(m=(f=g).children()).length?$.enter(d,f,m[m.length-1]):$.enter(d,f),v.bodyClass&&b[0].classList.add(v.bodyClass),o.controller=p,o.scope=t,o.element=i,o.close=r.promise,o.closed=c.promise,angular.isFunction(o.controller.$onInit)&&o.controller.$onInit(),y.resolve(o),document.activeElement.blur(),h.openModals.push({modal:o,close:a.close})}).then(null,function(e){y.reject(e)}):y.reject("No controller has been specified."),y.promise}}(n)}]})}]); |
{ | ||
"name": "angular-modal-service", | ||
"version": "0.15.3", | ||
"version": "0.15.6", | ||
"description": "AngularJS Service for showing Modals and Popups", | ||
@@ -10,3 +10,4 @@ "main": "./index.js", | ||
"test": "karma start --single-run --browsers ChromeHeadless karma.conf.js", | ||
"test-debug": "karma start --no-single-run --browsers ChromeHeadless karma.conf.js" | ||
"test-debug": "karma start --no-single-run --browsers ChromeHeadless karma.conf.js", | ||
"release": "standard-version" | ||
}, | ||
@@ -32,3 +33,3 @@ "repository": { | ||
"@babel/preset-env": "^7.1.0", | ||
"angular": "1.7.x", | ||
"angular": "^1.7.9", | ||
"angular-mocks": "1.7.x", | ||
@@ -38,18 +39,19 @@ "babel-loader": "^8.0.4", | ||
"istanbul-instrumenter-loader": "^3.0.1", | ||
"karma": "^4.0.1", | ||
"karma": "^5.0.2", | ||
"karma-chai": "^0.1.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-coverage": "^1.1.2", | ||
"karma-chrome-launcher": "^3.0.0", | ||
"karma-coverage": "^2.0.2", | ||
"karma-coverage-istanbul-reporter": "^2.0.4", | ||
"karma-junit-reporter": "2.0.x", | ||
"karma-mocha": "^1.3.0", | ||
"karma-junit-reporter": "^2.0.1", | ||
"karma-mocha": "^2.0.0", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^2.0.9", | ||
"mocha": "^6.0.0", | ||
"karma-webpack": "^4.0.2", | ||
"mocha": "^7.1.2", | ||
"sinon": "^7.0.0", | ||
"standard-version": "^7.1.0", | ||
"uglify-js": "^3.3.9", | ||
"webpack": "^4.20.2", | ||
"webpack-cli": "^3.1.2", | ||
"webpack-dev-server": "^3.1.9" | ||
"webpack": "^4.43.0", | ||
"webpack-cli": "^3.3.11", | ||
"webpack-dev-server": "^3.10.3" | ||
} | ||
} |
@@ -304,3 +304,3 @@ # angular-modal-service | ||
- Merge your work to master | ||
- Use `npm version` to bump, e.g. `npm version patch` | ||
- Use `npm run release` to tag, bump the version numbers and update the changelog | ||
- Push and deploy `git push --follow-tags && npm publish` | ||
@@ -307,0 +307,0 @@ |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1527351
49
23
1