Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-modal-service

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-modal-service - npm Package Compare versions

Comparing version 0.15.1 to 0.15.2

test/close.spec.js

4

bower.json

@@ -32,7 +32,7 @@ {

"dependencies": {
"angular": "1.5.0 - 1.6.x"
"angular": "1.5.0 - 1.7.x"
},
"devDependencies": {
"angular-mocks": "1.5.0 - 1.6.x"
"angular-mocks": "1.5.0 - 1.7.x"
}
}

@@ -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,a,i,s){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)},r.showModal=function(e){var u=angular.element(o[0].body),p=a.defer();return e.controller?(function(e,n){var o=a.defer();return e?o.resolve(e):n?i(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(i){var f={},d=(e.scope||c).$new(),m=null,g=e.locationChangeSuccess;!1===g?m=angular.noop:angular.isNumber(g)&&g>=0?s(function(){m=c.$on("$locationChangeSuccess",j)},g):s(function(){m=c.$on("$locationChangeSuccess",j)},r.configOptions.closeDelay);var v=a.defer(),y=a.defer(),b=!1,h={$scope:d,close:function(n,o){o=o||r.configOptions.closeDelay,"function"==typeof e.preClose&&e.preClose(f,n,o),void 0!==o&&null!==o||(o=0),b||(b=!0,s(function(){j(n)},o))}};e.inputs&&angular.extend(h,e.inputs);var $=t(i)(d);h.$element=$;var M=d[e.controllerAs],S=l(e.controller,h,!1,e.controllerAs);e.controllerAs&&M&&angular.extend(S,M);var O=u;function j(o){v.resolve(o),e.bodyClass&&u[0].classList.remove(e.bodyClass),n.leave($).then(function(){if($){y.resolve(o),d.$destroy();for(var e=0;e<r.openModals.length;e++)if(r.openModals[e].modal===f){r.openModals.splice(e,1);break}h.close=null,p=null,v=null,f=null,h=null,$=null,d=null}}),m&&m()}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&&u[0].classList.add(e.bodyClass),f.controller=S,f.scope=d,f.element=$,f.close=v.promise,f.closed=y.promise,angular.isFunction(f.controller.$onInit)&&f.controller.$onInit(),p.resolve(f),document.activeElement.blur(),r.openModals.push({modal:f,close:h.close})}).then(null,function(e){p.reject(e)}),p.promise):(p.reject("No controller has been specified."),p.promise)}}(e)}]})}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2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RhbmltYXRlLCAkZG9jdW1lbnQsICRjb21waWxlLCAkY29udHJvbGxlciwgJGh0dHAsICRyb290U2NvcGUsICRxLCAkdGVtcGxhdGVSZXF1ZXN0LCAkdGltZW91dCkge1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBNb2RhbFNlcnZpY2UoY29uZmlnT3B0aW9ucykge1xuXG4gICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuXG4gICAgICAgICAgICAgICAgLy9zdGFzaCBjb25maWdPcHRpb25zXG4gICAgICAgICAgICAgICAgc2VsZi5jb25maWdPcHRpb25zID0gY29uZmlnT3B0aW9ucztcblxuICAgICAgICAgICAgICAgIC8vICBUcmFjayBvcGVuIG1vZGFscy5cbiAgICAgICAgICAgICAgICBzZWxmLm9wZW5Nb2RhbHMgPSBbXTtcblxuICAgICAgICAgICAgICAgIC8vICBSZXR1cm5zIGEgcHJvbWlzZSB3aGljaCBnZXRzIHRoZSB0ZW1wbGF0ZSwgZWl0aGVyXG4gICAgICAgICAgICAgICAgLy8gIGZyb20gdGhlIHRlbXBsYXRlIHBhcmFtZXRlciBvciB2aWEgYSByZXF1ZXN0IHRvIHRoZVxuICAgICAgICAgICAgICAgIC8vICB0ZW1wbGF0ZSB1cmwgcGFyYW1ldGVyLlxuICAgICAgICAgICAgICAgIHZhciBnZXRUZW1wbGF0ZSA9IGZ1bmN0aW9uICh0ZW1wbGF0ZSwgdGVtcGxhdGVVcmwpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRlbXBsYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHRlbXBsYXRlKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0ZW1wbGF0ZVVybCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRlbXBsYXRlUmVxdWVzdCh0ZW1wbGF0ZVVybCwgdHJ1ZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAodGVtcGxhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZSh0ZW1wbGF0ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoXCJObyB0ZW1wbGF0ZSBvciB0ZW1wbGF0ZVVybCBoYXMgYmVlbiBzcGVjaWZpZWQuXCIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZC5wcm9taXNlO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAvLyAgQWRkcyBhbiBlbGVtZW50IHRvIHRoZSBET00gYXMgdGhlIGxhc3QgY2hpbGQgb2YgaXRzIGNvbnRhaW5lclxuICAgICAgICAgICAgICAgIC8vICBsaWtlIGFwcGVuZCwgYnV0IHVzZXMgJGFuaW1hdGUgdG8gaGFuZGxlIGFuaW1hdGlvbnMuIFJldHVybnMgYVxuICAgICAgICAgICAgICAgIC8vICBwcm9taXNlIHRoYXQgaXMgcmVzb2x2ZWQgb25jZSBhbGwgYW5pbWF0aW9uIGlzIGNvbXBsZXRlLlxuICAgICAgICAgICAgICAgIHZhciBhcHBlbmRDaGlsZCA9IGZ1bmN0aW9uIChwYXJlbnQsIGNoaWxkKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjaGlsZHJlbiA9IHBhcmVudC5jaGlsZHJlbigpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGRyZW4ubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRhbmltYXRlLmVudGVyKGNoaWxkLCBwYXJlbnQsIGNoaWxkcmVuW2NoaWxkcmVuLmxlbmd0aCAtIDFdKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJGFuaW1hdGUuZW50ZXIoY2hpbGQsIHBhcmVudCk7XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIC8vICBDbG9zZSBhbGwgbW9kYWxzLCBwcm92aWRpbmcgdGhlIGdpdmVuIHJlc3VsdCB0byB0aGUgY2xvc2UgcHJvbWlzZS5cbiAgICAgICAgICAgICAgICBzZWxmLmNsb3NlTW9kYWxzID0gZnVuY3Rpb24gKHJlc3VsdCwgZGVsYXkpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsYXkgPSBkZWxheSB8fCBzZWxmLmNvbmZpZ09wdGlvbnMuY2xvc2VEZWxheTtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHNlbGYub3Blbk1vZGFscy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYub3Blbk1vZGFsc1swXS5jbG9zZShyZXN1bHQsIGRlbGF5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYub3Blbk1vZGFscy5zcGxpY2UoMCwgMSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgc2VsZi5zaG93TW9kYWwgPSBmdW5jdGlvbiAob3B0aW9ucykge1xuXG4gICAgICAgICAgICAgICAgICAgIC8vICBHZXQgdGhlIGJvZHkgb2YgdGhlIGRvY3VtZW50LCB3ZSdsbCBhZGQgdGhlIG1vZGFsIHRvIHRoaXMuXG4gICAgICAgICAgICAgICAgICAgIHZhciBib2R5ID0gYW5ndWxhci5lbGVtZW50KCRkb2N1bWVudFswXS5ib2R5KTtcblxuICAgICAgICAgICAgICAgICAgICAvLyAgQ3JlYXRlIGEgZGVmZXJyZWQgd2UnbGwgcmVzb2x2ZSB3aGVuIHRoZSBtb2RhbCBpcyByZWFkeS5cbiAgICAgICAgICAgICAgICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKTtcblxuICAgICAgICAgICAgICAgICAgICAvLyAgVmFsaWRhdGUgdGhlIGlucHV0IHBhcmFtZXRlcnMuXG4gICAgICAgICAgICAgICAgICAgIHZhciBjb250cm9sbGVyTmFtZSA9IG9wdGlvbnMuY29udHJvbGxlcjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFjb250cm9sbGVyTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KFwiTm8gY29udHJvbGxlciBoYXMgYmVlbiBzcGVjaWZpZWQuXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAvLyAgR2V0IHRoZSBhY3R1YWwgaHRtbCBvZiB0aGUgdGVtcGxhdGUuXG4gICAgICAgICAgICAgICAgICAgIGdldFRlbXBsYXRlKG9wdGlvbnMudGVtcGxhdGUsIG9wdGlvbnMudGVtcGxhdGVVcmwpXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAodGVtcGxhdGUpIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBUaGUgbWFpbiBtb2RhbCBvYmplY3Qgd2Ugd2lsbCBidWlsZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kYWwgPSB7fTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBDcmVhdGUgYSBuZXcgc2NvcGUgZm9yIHRoZSBtb2RhbC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kYWxTY29wZSA9IChvcHRpb25zLnNjb3BlIHx8ICRyb290U2NvcGUpLiRuZXcoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9vdFNjb3BlT25DbG9zZSA9IG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uQ2hhbmdlU3VjY2VzcyA9IG9wdGlvbnMubG9jYXRpb25DaGFuZ2VTdWNjZXNzO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIEFsbG93IGxvY2F0aW9uQ2hhbmdlU3VjY2VzcyBldmVudCByZWdpc3RyYXRpb24gdG8gYmUgY29uZmlndXJhYmxlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBUcnVlIChkZWZhdWx0KSA9IGV2ZW50IHJlZ2lzdGVyZWQgd2l0aCBkZWZhdWx0Q2xvc2VEZWxheVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAjIChncmVhdGVyIHRoYW4gMCkgPSBldmVudCByZWdpc3RlcmVkIHdpdGggZGVsYXlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgRmFsc2UgPSBkaXNhYmxlZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MgPT09IGZhbHNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvb3RTY29wZU9uQ2xvc2UgPSBhbmd1bGFyLm5vb3A7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGFuZ3VsYXIuaXNOdW1iZXIobG9jYXRpb25DaGFuZ2VTdWNjZXNzKSAmJiBsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb290U2NvcGVPbkNsb3NlID0gJHJvb3RTY29wZS4kb24oJyRsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MnLCBjbGVhblVwQ2xvc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9vdFNjb3BlT25DbG9zZSA9ICRyb290U2NvcGUuJG9uKCckbG9jYXRpb25DaGFuZ2VTdWNjZXNzJywgY2xlYW5VcENsb3NlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2VsZi5jb25maWdPcHRpb25zLmNsb3NlRGVsYXkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIENyZWF0ZSB0aGUgaW5wdXRzIG9iamVjdCB0byB0aGUgY29udHJvbGxlciAtIHRoaXMgd2lsbCBpbmNsdWRlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHRoZSBzY29wZSwgYXMgd2VsbCBhcyBhbGwgaW5wdXRzIHByb3ZpZGVkLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBXZSB3aWxsIGFsc28gY3JlYXRlIGEgZGVmZXJyZWQgdGhhdCBpcyByZXNvbHZlZCB3aXRoIGEgcHJvdmlkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgY2xvc2UgZnVuY3Rpb24uIFRoZSBjb250cm9sbGVyIGNhbiB0aGVuIGNhbGwgJ2Nsb3NlKHJlc3VsdCknLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBUaGUgY29udHJvbGxlciBjYW4gYWxzbyBwcm92aWRlIGEgZGVsYXkgZm9yIGNsb3NpbmcgLSB0aGlzIGlzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIGhlbHBmdWwgaWYgdGhlcmUgYXJlIGNsb3NpbmcgYW5pbWF0aW9ucyB3aGljaCBtdXN0IGZpbmlzaCBmaXJzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2xvc2VEZWZlcnJlZCA9ICRxLmRlZmVyKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNsb3NlZERlZmVycmVkID0gJHEuZGVmZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaGFzQWxyZWFkeUJlZW5DbG9zZWQgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbnB1dHMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZTogbW9kYWxTY29wZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2U6IGZ1bmN0aW9uIChyZXN1bHQsIGRlbGF5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxheSA9IGRlbGF5IHx8IHNlbGYuY29uZmlnT3B0aW9ucy5jbG9zZURlbGF5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIElmIHdlIGhhdmUgYSBwcmUtY2xvc2UgZnVuY3Rpb24sIGNhbGwgaXQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMucHJlQ2xvc2UgPT09ICdmdW5jdGlvbicpIG9wdGlvbnMucHJlQ2xvc2UobW9kYWwsIHJlc3VsdCwgZGVsYXkpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVsYXkgPT09IHVuZGVmaW5lZCB8fCBkZWxheSA9PT0gbnVsbCkgZGVsYXkgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc0FscmVhZHlCZWVuQ2xvc2VkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzQWxyZWFkeUJlZW5DbG9zZWQgPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhblVwQ2xvc2UocmVzdWx0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZGVsYXkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBJZiB3ZSBoYXZlIHByb3ZpZGVkIGFueSBpbnB1dHMsIHBhc3MgdGhlbSB0byB0aGUgY29udHJvbGxlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5pbnB1dHMpIGFuZ3VsYXIuZXh0ZW5kKGlucHV0cywgb3B0aW9ucy5pbnB1dHMpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIENvbXBpbGUgdGhlbiBsaW5rIHRoZSB0ZW1wbGF0ZSBlbGVtZW50LCBidWlsZGluZyB0aGUgYWN0dWFsIGVsZW1lbnQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFNldCB0aGUgJGVsZW1lbnQgb24gdGhlIGlucHV0cyBzbyB0aGF0IGl0IGNhbiBiZSBpbmplY3RlZCBpZiByZXF1aXJlZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGlua0ZuID0gJGNvbXBpbGUodGVtcGxhdGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtb2RhbEVsZW1lbnQgPSBsaW5rRm4obW9kYWxTY29wZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRzLiRlbGVtZW50ID0gbW9kYWxFbGVtZW50O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIENyZWF0ZSB0aGUgY29udHJvbGxlciwgZXhwbGljaXRseSBzcGVjaWZ5aW5nIHRoZSBzY29wZSB0byB1c2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRyb2xsZXJPYmpCZWZvcmUgPSBtb2RhbFNjb3BlW29wdGlvbnMuY29udHJvbGxlckFzXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kYWxDb250cm9sbGVyID0gJGNvbnRyb2xsZXIob3B0aW9ucy5jb250cm9sbGVyLCBpbnB1dHMsIGZhbHNlLCBvcHRpb25zLmNvbnRyb2xsZXJBcyk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jb250cm9sbGVyQXMgJiYgY29udHJvbGxlck9iakJlZm9yZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZChtb2RhbENvbnRyb2xsZXIsIGNvbnRyb2xsZXJPYmpCZWZvcmUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBUaGVuLCBhcHBlbmQgdGhlIG1vZGFsIHRvIHRoZSBkb20uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFwcGVuZFRhcmdldCA9IGJvZHk7IC8vIGFwcGVuZCB0byBib2R5IHdoZW4gbm8gY3VzdG9tIGFwcGVuZCBlbGVtZW50IGlzIHNwZWNpZmllZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzU3RyaW5nKG9wdGlvbnMuYXBwZW5kRWxlbWVudCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcXVlcnkgdGhlIGRvY3VtZW50IGZvciB0aGUgZmlyc3QgZWxlbWVudCB0aGF0IG1hdGNoZXMgdGhlIHNlbGVjdG9yXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIGNyZWF0ZSBhbiBhbmd1bGFyIGVsZW1lbnQgb3V0IG9mIGl0LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRUYXJnZXQgPSBhbmd1bGFyLmVsZW1lbnQoJGRvY3VtZW50WzBdLnF1ZXJ5U2VsZWN0b3Iob3B0aW9ucy5hcHBlbmRFbGVtZW50KSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdGlvbnMuYXBwZW5kRWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhcHBlbmQgdG8gY3VzdG9tIGFwcGVuZCBlbGVtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZFRhcmdldCA9IG9wdGlvbnMuYXBwZW5kRWxlbWVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRDaGlsZChhcHBlbmRUYXJnZXQsIG1vZGFsRWxlbWVudCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGaW5hbGx5LCBhcHBlbmQgYW55IGN1c3RvbSBjbGFzc2VzIHRvIHRoZSBib2R5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuYm9keUNsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHlbMF0uY2xhc3NMaXN0LmFkZChvcHRpb25zLmJvZHlDbGFzcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFBvcHVsYXRlIHRoZSBtb2RhbCBvYmplY3QuLi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbC5jb250cm9sbGVyID0gbW9kYWxDb250cm9sbGVyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLnNjb3BlID0gbW9kYWxTY29wZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbC5lbGVtZW50ID0gbW9kYWxFbGVtZW50O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmNsb3NlID0gY2xvc2VEZWZlcnJlZC5wcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmNsb3NlZCA9IGNsb3NlZERlZmVycmVkLnByb21pc2U7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAkb25Jbml0IGlzIHBhcnQgb2YgdGhlIGNvbXBvbmVudCBsaWZlY3ljbGUgaW50cm9kdWNlZCBpbiBBbmd1bGFySlMgMS42LnhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBCZWNhdXNlIGl0IG1heSBub3QgYmUgZGVmaW5lZCBvbiBhbGwgY29udHJvbGxlcnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgbXVzdCBjaGVjayBmb3IgaXQgYmVmb3JlIGF0dGVtcHRpbmcgdG8gaW52b2tlIGl0LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGh0dHBzOi8vZG9jcy5hbmd1bGFyanMub3JnL2d1aWRlL2NvbXBvbmVudCNjb21wb25lbnQtYmFzZWQtYXBwbGljYXRpb24tYXJjaGl0ZWN0dXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNGdW5jdGlvbihtb2RhbC5jb250cm9sbGVyLiRvbkluaXQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmNvbnRyb2xsZXIuJG9uSW5pdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAuLi53aGljaCBpcyBwYXNzZWQgdG8gdGhlIGNhbGxlciB2aWEgdGhlIHByb21pc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShtb2RhbCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyBpbnB1dCBmb2N1cyB0byBhdm9pZCBvcGVuIG11bHRpcGxlIG1vZGFscyBvbiBlbnRlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQuYmx1cigpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFdlIGNhbiB0cmFjayB0aGlzIG1vZGFsIGluIG91ciBvcGVuIG1vZGFscy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZW5Nb2RhbHMucHVzaCh7bW9kYWw6IG1vZGFsLCBjbG9zZTogaW5wdXRzLmNsb3NlfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjbGVhblVwQ2xvc2UocmVzdWx0KSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFJlc29sdmUgdGhlICdjbG9zZScgcHJvbWlzZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2VEZWZlcnJlZC5yZXNvbHZlKHJlc3VsdCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFJlbW92ZSB0aGUgY3VzdG9tIGNsYXNzIGZyb20gdGhlIGJvZHlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuYm9keUNsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5WzBdLmNsYXNzTGlzdC5yZW1vdmUob3B0aW9ucy5ib2R5Q2xhc3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIExldCBhbmd1bGFyIHJlbW92ZSB0aGUgZWxlbWVudCBhbmQgd2FpdCBmb3IgYW5pbWF0aW9ucyB0byBmaW5pc2guXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRhbmltYXRlLmxlYXZlKG1vZGFsRWxlbWVudClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBwcmV2ZW50IGVycm9yIGlmIG1vZGFsIGlzIGFscmVhZHkgZGVzdHJveWVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtb2RhbEVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBSZXNvbHZlIHRoZSAnY2xvc2VkJyBwcm9taXNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb3NlZERlZmVycmVkLnJlc29sdmUocmVzdWx0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBXZSBjYW4gbm93IGNsZWFuIHVwIHRoZSBzY29wZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsU2NvcGUuJGRlc3Ryb3koKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBSZW1vdmUgdGhlIG1vZGFsIGZyb20gdGhlIHNldCBvZiBvcGVuIG1vZGFscy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNlbGYub3Blbk1vZGFscy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi5vcGVuTW9kYWxzW2ldLm1vZGFsID09PSBtb2RhbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVuTW9kYWxzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFVubGVzcyB3ZSBudWxsIG91dCBhbGwgb2YgdGhlc2Ugb2JqZWN0cyB3ZSBzZWVtIHRvIHN1ZmZlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBmcm9tIG1lbW9yeSBsZWFrcywgaWYgYW55b25lIGNhbiBleHBsYWluIHdoeSB0aGVuIEknZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBiZSB2ZXJ5IGludGVyZXN0ZWQgdG8ga25vdy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dHMuY2xvc2UgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZURlZmVycmVkID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRzID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbEVsZW1lbnQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsU2NvcGUgPSBudWxsO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3ZlIGV2ZW50IHdhdGNoZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9vdFNjb3BlT25DbG9zZSAmJiByb290U2NvcGVPbkNsb3NlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4obnVsbCwgZnVuY3Rpb24gKGVycm9yKSB7IC8vICdjYXRjaCcgZG9lc24ndCB3b3JrIGluIElFOC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gbmV3IE1vZGFsU2VydmljZShfb3B0aW9ucyk7XG4gICAgICAgIH1dO1xuICAgIH0pO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==
!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,a,s,i){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)},r.showModal=function(e){var u=angular.element(o[0].body),p=a.defer();return e.controller?(function(e,n){var o=a.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 f={},d=(e.scope||c).$new(),m=null,g=e.locationChangeSuccess;!1===g?m=angular.noop:angular.isNumber(g)&&g>=0?i(function(){m=c.$on("$locationChangeSuccess",h.close)},g):i(function(){m=c.$on("$locationChangeSuccess",h.close)},r.configOptions.closeDelay);var v=a.defer(),y=a.defer(),b=!1,h={$scope:d,close:function(o,t){b||(b=!0,t=t||r.configOptions.closeDelay,"function"==typeof e.preClose&&e.preClose(f,o,t),void 0!==t&&null!==t||(t=0),i(function(){!function(o){v.resolve(o),e.bodyClass&&u[0].classList.remove(e.bodyClass),n.leave($).then(function(){if($){y.resolve(o),d.$destroy();for(var e=0;e<r.openModals.length;e++)if(r.openModals[e].modal===f){r.openModals.splice(e,1);break}h.close=null,p=null,v=null,f=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],S=l(e.controller,h,!1,e.controllerAs);e.controllerAs&&M&&angular.extend(S,M);var O=u;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&&u[0].classList.add(e.bodyClass),f.controller=S,f.scope=d,f.element=$,f.close=v.promise,f.closed=y.promise,angular.isFunction(f.controller.$onInit)&&f.controller.$onInit(),p.resolve(f),document.activeElement.blur(),r.openModals.push({modal:f,close:h.close})}).then(null,function(e){p.reject(e)}),p.promise):(p.reject("No controller has been specified."),p.promise)}}(e)}]})}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vLy4vc3JjL2FuZ3VsYXItbW9kYWwtc2VydmljZS5qcyJdLCJuYW1lcyI6WyJpbnN0YWxsZWRNb2R1bGVzIiwiX193ZWJwYWNrX3JlcXVpcmVfXyIsIm1vZHVsZUlkIiwiZXhwb3J0cyIsIm1vZHVsZSIsImkiLCJsIiwibW9kdWxlcyIsImNhbGwiLCJtIiwiYyIsImQiLCJuYW1lIiwiZ2V0dGVyIiwibyIsIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZW51bWVyYWJsZSIsImdldCIsInIiLCJ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gb3BlbiBtb2RhbHMuXG4gICAgICAgICAgICAgICAgc2VsZi5vcGVuTW9kYWxzID0gW107XG5cbiAgICAgICAgICAgICAgICAvLyAgUmV0dXJucyBhIHByb21pc2Ugd2hpY2ggZ2V0cyB0aGUgdGVtcGxhdGUsIGVpdGhlclxuICAgICAgICAgICAgICAgIC8vICBmcm9tIHRoZSB0ZW1wbGF0ZSBwYXJhbWV0ZXIgb3IgdmlhIGEgcmVxdWVzdCB0byB0aGVcbiAgICAgICAgICAgICAgICAvLyAgdGVtcGxhdGUgdXJsIHBhcmFtZXRlci5cbiAgICAgICAgICAgICAgICB2YXIgZ2V0VGVtcGxhdGUgPSBmdW5jdGlvbiAodGVtcGxhdGUsIHRlbXBsYXRlVXJsKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkZWZlcnJlZCA9ICRxLmRlZmVyKCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0ZW1wbGF0ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZSh0ZW1wbGF0ZSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGVtcGxhdGVVcmwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wbGF0ZVJlcXVlc3QodGVtcGxhdGVVcmwsIHRydWUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHRlbXBsYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUodGVtcGxhdGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KFwiTm8gdGVtcGxhdGUgb3IgdGVtcGxhdGVVcmwgaGFzIGJlZW4gc3BlY2lmaWVkLlwiKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTtcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgLy8gIEFkZHMgYW4gZWxlbWVudCB0byB0aGUgRE9NIGFzIHRoZSBsYXN0IGNoaWxkIG9mIGl0cyBjb250YWluZXJcbiAgICAgICAgICAgICAgICAvLyAgbGlrZSBhcHBlbmQsIGJ1dCB1c2VzICRhbmltYXRlIHRvIGhhbmRsZSBhbmltYXRpb25zLiBSZXR1cm5zIGFcbiAgICAgICAgICAgICAgICAvLyAgcHJvbWlzZSB0aGF0IGlzIHJlc29sdmVkIG9uY2UgYWxsIGFuaW1hdGlvbiBpcyBjb21wbGV0ZS5cbiAgICAgICAgICAgICAgICB2YXIgYXBwZW5kQ2hpbGQgPSBmdW5jdGlvbiAocGFyZW50LCBjaGlsZCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2hpbGRyZW4gPSBwYXJlbnQuY2hpbGRyZW4oKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkcmVuLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkYW5pbWF0ZS5lbnRlcihjaGlsZCwgcGFyZW50LCBjaGlsZHJlbltjaGlsZHJlbi5sZW5ndGggLSAxXSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRhbmltYXRlLmVudGVyKGNoaWxkLCBwYXJlbnQpO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAvLyAgQ2xvc2UgYWxsIG1vZGFscywgcHJvdmlkaW5nIHRoZSBnaXZlbiByZXN1bHQgdG8gdGhlIGNsb3NlIHByb21pc2UuXG4gICAgICAgICAgICAgICAgc2VsZi5jbG9zZU1vZGFscyA9IGZ1bmN0aW9uIChyZXN1bHQsIGRlbGF5KSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGF5ID0gZGVsYXkgfHwgc2VsZi5jb25maWdPcHRpb25zLmNsb3NlRGVsYXk7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChzZWxmLm9wZW5Nb2RhbHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZW5Nb2RhbHNbMF0uY2xvc2UocmVzdWx0LCBkZWxheSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZW5Nb2RhbHMuc3BsaWNlKDAsIDEpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHNlbGYuc2hvd01vZGFsID0gZnVuY3Rpb24gKG9wdGlvbnMpIHtcblxuICAgICAgICAgICAgICAgICAgICAvLyAgR2V0IHRoZSBib2R5IG9mIHRoZSBkb2N1bWVudCwgd2UnbGwgYWRkIHRoZSBtb2RhbCB0byB0aGlzLlxuICAgICAgICAgICAgICAgICAgICB2YXIgYm9keSA9IGFuZ3VsYXIuZWxlbWVudCgkZG9jdW1lbnRbMF0uYm9keSk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gIENyZWF0ZSBhIGRlZmVycmVkIHdlJ2xsIHJlc29sdmUgd2hlbiB0aGUgbW9kYWwgaXMgcmVhZHkuXG4gICAgICAgICAgICAgICAgICAgIHZhciBkZWZlcnJlZCA9ICRxLmRlZmVyKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gIFZhbGlkYXRlIHRoZSBpbnB1dCBwYXJhbWV0ZXJzLlxuICAgICAgICAgICAgICAgICAgICB2YXIgY29udHJvbGxlck5hbWUgPSBvcHRpb25zLmNvbnRyb2xsZXI7XG4gICAgICAgICAgICAgICAgICAgIGlmICghY29udHJvbGxlck5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChcIk5vIGNvbnRyb2xsZXIgaGFzIGJlZW4gc3BlY2lmaWVkLlwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZC5wcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gIEdldCB0aGUgYWN0dWFsIGh0bWwgb2YgdGhlIHRlbXBsYXRlLlxuICAgICAgICAgICAgICAgICAgICBnZXRUZW1wbGF0ZShvcHRpb25zLnRlbXBsYXRlLCBvcHRpb25zLnRlbXBsYXRlVXJsKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHRlbXBsYXRlKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgVGhlIG1haW4gbW9kYWwgb2JqZWN0IHdlIHdpbGwgYnVpbGQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGFsID0ge307XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgQ3JlYXRlIGEgbmV3IHNjb3BlIGZvciB0aGUgbW9kYWwuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGFsU2NvcGUgPSAob3B0aW9ucy5zY29wZSB8fCAkcm9vdFNjb3BlKS4kbmV3KCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvb3RTY29wZU9uQ2xvc2UgPSBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MgPSBvcHRpb25zLmxvY2F0aW9uQ2hhbmdlU3VjY2VzcztcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBBbGxvdyBsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MgZXZlbnQgcmVnaXN0cmF0aW9uIHRvIGJlIGNvbmZpZ3VyYWJsZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgVHJ1ZSAoZGVmYXVsdCkgPSBldmVudCByZWdpc3RlcmVkIHdpdGggZGVmYXVsdENsb3NlRGVsYXlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgIyAoZ3JlYXRlciB0aGFuIDApID0gZXZlbnQgcmVnaXN0ZXJlZCB3aXRoIGRlbGF5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIEZhbHNlID0gZGlzYWJsZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobG9jYXRpb25DaGFuZ2VTdWNjZXNzID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb290U2NvcGVPbkNsb3NlID0gYW5ndWxhci5ub29wO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChhbmd1bGFyLmlzTnVtYmVyKGxvY2F0aW9uQ2hhbmdlU3VjY2VzcykgJiYgbG9jYXRpb25DaGFuZ2VTdWNjZXNzID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9vdFNjb3BlT25DbG9zZSA9ICRyb290U2NvcGUuJG9uKCckbG9jYXRpb25DaGFuZ2VTdWNjZXNzJywgaW5wdXRzLmNsb3NlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbG9jYXRpb25DaGFuZ2VTdWNjZXNzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvb3RTY29wZU9uQ2xvc2UgPSAkcm9vdFNjb3BlLiRvbignJGxvY2F0aW9uQ2hhbmdlU3VjY2VzcycsIGlucHV0cy5jbG9zZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNlbGYuY29uZmlnT3B0aW9ucy5jbG9zZURlbGF5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBDcmVhdGUgdGhlIGlucHV0cyBvYmplY3QgdG8gdGhlIGNvbnRyb2xsZXIgLSB0aGlzIHdpbGwgaW5jbHVkZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICB0aGUgc2NvcGUsIGFzIHdlbGwgYXMgYWxsIGlucHV0cyBwcm92aWRlZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgV2Ugd2lsbCBhbHNvIGNyZWF0ZSBhIGRlZmVycmVkIHRoYXQgaXMgcmVzb2x2ZWQgd2l0aCBhIHByb3ZpZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIGNsb3NlIGZ1bmN0aW9uLiBUaGUgY29udHJvbGxlciBjYW4gdGhlbiBjYWxsICdjbG9zZShyZXN1bHQpJy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgVGhlIGNvbnRyb2xsZXIgY2FuIGFsc28gcHJvdmlkZSBhIGRlbGF5IGZvciBjbG9zaW5nIC0gdGhpcyBpc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBoZWxwZnVsIGlmIHRoZXJlIGFyZSBjbG9zaW5nIGFuaW1hdGlvbnMgd2hpY2ggbXVzdCBmaW5pc2ggZmlyc3QuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNsb3NlRGVmZXJyZWQgPSAkcS5kZWZlcigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjbG9zZWREZWZlcnJlZCA9ICRxLmRlZmVyKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhhc0FscmVhZHlCZWVuQ2xvc2VkID0gZmFsc2U7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5wdXRzID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGU6IG1vZGFsU2NvcGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb3NlOiBmdW5jdGlvbiAocmVzdWx0LCBkZWxheSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc0FscmVhZHlCZWVuQ2xvc2VkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzQWxyZWFkeUJlZW5DbG9zZWQgPSB0cnVlO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxheSA9IGRlbGF5IHx8IHNlbGYuY29uZmlnT3B0aW9ucy5jbG9zZURlbGF5O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIElmIHdlIGhhdmUgYSBwcmUtY2xvc2UgZnVuY3Rpb24sIGNhbGwgaXQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMucHJlQ2xvc2UgPT09ICdmdW5jdGlvbicpIG9wdGlvbnMucHJlQ2xvc2UobW9kYWwsIHJlc3VsdCwgZGVsYXkpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVsYXkgPT09IHVuZGVmaW5lZCB8fCBkZWxheSA9PT0gbnVsbCkgZGVsYXkgPSAwO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhblVwQ2xvc2UocmVzdWx0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZGVsYXkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBJZiB3ZSBoYXZlIHByb3ZpZGVkIGFueSBpbnB1dHMsIHBhc3MgdGhlbSB0byB0aGUgY29udHJvbGxlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5pbnB1dHMpIGFuZ3VsYXIuZXh0ZW5kKGlucHV0cywgb3B0aW9ucy5pbnB1dHMpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIENvbXBpbGUgdGhlbiBsaW5rIHRoZSB0ZW1wbGF0ZSBlbGVtZW50LCBidWlsZGluZyB0aGUgYWN0dWFsIGVsZW1lbnQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFNldCB0aGUgJGVsZW1lbnQgb24gdGhlIGlucHV0cyBzbyB0aGF0IGl0IGNhbiBiZSBpbmplY3RlZCBpZiByZXF1aXJlZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGlua0ZuID0gJGNvbXBpbGUodGVtcGxhdGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtb2RhbEVsZW1lbnQgPSBsaW5rRm4obW9kYWxTY29wZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRzLiRlbGVtZW50ID0gbW9kYWxFbGVtZW50O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIENyZWF0ZSB0aGUgY29udHJvbGxlciwgZXhwbGljaXRseSBzcGVjaWZ5aW5nIHRoZSBzY29wZSB0byB1c2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRyb2xsZXJPYmpCZWZvcmUgPSBtb2RhbFNjb3BlW29wdGlvbnMuY29udHJvbGxlckFzXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbW9kYWxDb250cm9sbGVyID0gJGNvbnRyb2xsZXIob3B0aW9ucy5jb250cm9sbGVyLCBpbnB1dHMsIGZhbHNlLCBvcHRpb25zLmNvbnRyb2xsZXJBcyk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jb250cm9sbGVyQXMgJiYgY29udHJvbGxlck9iakJlZm9yZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZChtb2RhbENvbnRyb2xsZXIsIGNvbnRyb2xsZXJPYmpCZWZvcmUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBUaGVuLCBhcHBlbmQgdGhlIG1vZGFsIHRvIHRoZSBkb20uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFwcGVuZFRhcmdldCA9IGJvZHk7IC8vIGFwcGVuZCB0byBib2R5IHdoZW4gbm8gY3VzdG9tIGFwcGVuZCBlbGVtZW50IGlzIHNwZWNpZmllZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzU3RyaW5nKG9wdGlvbnMuYXBwZW5kRWxlbWVudCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcXVlcnkgdGhlIGRvY3VtZW50IGZvciB0aGUgZmlyc3QgZWxlbWVudCB0aGF0IG1hdGNoZXMgdGhlIHNlbGVjdG9yXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIGNyZWF0ZSBhbiBhbmd1bGFyIGVsZW1lbnQgb3V0IG9mIGl0LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRUYXJnZXQgPSBhbmd1bGFyLmVsZW1lbnQoJGRvY3VtZW50WzBdLnF1ZXJ5U2VsZWN0b3Iob3B0aW9ucy5hcHBlbmRFbGVtZW50KSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wdGlvbnMuYXBwZW5kRWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhcHBlbmQgdG8gY3VzdG9tIGFwcGVuZCBlbGVtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZFRhcmdldCA9IG9wdGlvbnMuYXBwZW5kRWxlbWVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRDaGlsZChhcHBlbmRUYXJnZXQsIG1vZGFsRWxlbWVudCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGaW5hbGx5LCBhcHBlbmQgYW55IGN1c3RvbSBjbGFzc2VzIHRvIHRoZSBib2R5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuYm9keUNsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHlbMF0uY2xhc3NMaXN0LmFkZChvcHRpb25zLmJvZHlDbGFzcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFBvcHVsYXRlIHRoZSBtb2RhbCBvYmplY3QuLi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbC5jb250cm9sbGVyID0gbW9kYWxDb250cm9sbGVyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLnNjb3BlID0gbW9kYWxTY29wZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbC5lbGVtZW50ID0gbW9kYWxFbGVtZW50O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmNsb3NlID0gY2xvc2VEZWZlcnJlZC5wcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmNsb3NlZCA9IGNsb3NlZERlZmVycmVkLnByb21pc2U7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAkb25Jbml0IGlzIHBhcnQgb2YgdGhlIGNvbXBvbmVudCBsaWZlY3ljbGUgaW50cm9kdWNlZCBpbiBBbmd1bGFySlMgMS42LnhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBCZWNhdXNlIGl0IG1heSBub3QgYmUgZGVmaW5lZCBvbiBhbGwgY29udHJvbGxlcnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgbXVzdCBjaGVjayBmb3IgaXQgYmVmb3JlIGF0dGVtcHRpbmcgdG8gaW52b2tlIGl0LlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGh0dHBzOi8vZG9jcy5hbmd1bGFyanMub3JnL2d1aWRlL2NvbXBvbmVudCNjb21wb25lbnQtYmFzZWQtYXBwbGljYXRpb24tYXJjaGl0ZWN0dXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNGdW5jdGlvbihtb2RhbC5jb250cm9sbGVyLiRvbkluaXQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsLmNvbnRyb2xsZXIuJG9uSW5pdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAuLi53aGljaCBpcyBwYXNzZWQgdG8gdGhlIGNhbGxlciB2aWEgdGhlIHByb21pc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShtb2RhbCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDbGVhciBwcmV2aW91cyBpbnB1dCBmb2N1cyB0byBhdm9pZCBvcGVuIG11bHRpcGxlIG1vZGFscyBvbiBlbnRlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQuYmx1cigpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFdlIGNhbiB0cmFjayB0aGlzIG1vZGFsIGluIG91ciBvcGVuIG1vZGFscy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLm9wZW5Nb2RhbHMucHVzaCh7bW9kYWw6IG1vZGFsLCBjbG9zZTogaW5wdXRzLmNsb3NlfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjbGVhblVwQ2xvc2UocmVzdWx0KSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFJlc29sdmUgdGhlICdjbG9zZScgcHJvbWlzZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2VEZWZlcnJlZC5yZXNvbHZlKHJlc3VsdCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFJlbW92ZSB0aGUgY3VzdG9tIGNsYXNzIGZyb20gdGhlIGJvZHlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuYm9keUNsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5WzBdLmNsYXNzTGlzdC5yZW1vdmUob3B0aW9ucy5ib2R5Q2xhc3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIExldCBhbmd1bGFyIHJlbW92ZSB0aGUgZWxlbWVudCBhbmQgd2FpdCBmb3IgYW5pbWF0aW9ucyB0byBmaW5pc2guXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRhbmltYXRlLmxlYXZlKG1vZGFsRWxlbWVudClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBwcmV2ZW50IGVycm9yIGlmIG1vZGFsIGlzIGFscmVhZHkgZGVzdHJveWVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFtb2RhbEVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBSZXNvbHZlIHRoZSAnY2xvc2VkJyBwcm9taXNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb3NlZERlZmVycmVkLnJlc29sdmUocmVzdWx0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBXZSBjYW4gbm93IGNsZWFuIHVwIHRoZSBzY29wZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsU2NvcGUuJGRlc3Ryb3koKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBSZW1vdmUgdGhlIG1vZGFsIGZyb20gdGhlIHNldCBvZiBvcGVuIG1vZGFscy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNlbGYub3Blbk1vZGFscy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi5vcGVuTW9kYWxzW2ldLm1vZGFsID09PSBtb2RhbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5vcGVuTW9kYWxzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIFVubGVzcyB3ZSBudWxsIG91dCBhbGwgb2YgdGhlc2Ugb2JqZWN0cyB3ZSBzZWVtIHRvIHN1ZmZlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBmcm9tIG1lbW9yeSBsZWFrcywgaWYgYW55b25lIGNhbiBleHBsYWluIHdoeSB0aGVuIEknZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBiZSB2ZXJ5IGludGVyZXN0ZWQgdG8ga25vdy5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dHMuY2xvc2UgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZURlZmVycmVkID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRzID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RhbEVsZW1lbnQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGFsU2NvcGUgPSBudWxsO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVtb3ZlIGV2ZW50IHdhdGNoZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9vdFNjb3BlT25DbG9zZSAmJiByb290U2NvcGVPbkNsb3NlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4obnVsbCwgZnVuY3Rpb24gKGVycm9yKSB7IC8vICdjYXRjaCcgZG9lc24ndCB3b3JrIGluIElFOC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gbmV3IE1vZGFsU2VydmljZShfb3B0aW9ucyk7XG4gICAgICAgIH1dO1xuICAgIH0pO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==

@@ -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,S,O,j,e,C,x,t,_){return new function(e){var $=this;$.configOptions=e,$.openModals=[],$.closeModals=function(e,n){for(n=n||$.configOptions.closeDelay;$.openModals.length;)$.openModals[0].close(e,n),$.openModals.splice(0,1)},$.showModal=function(y){var e,n,o,b=angular.element(S[0].body),h=x.defer();return y.controller?(e=y.template,n=y.templateUrl,o=x.defer(),e?o.resolve(e):n?t(n,!0).then(function(e){o.resolve(e)},function(e){o.reject(e)}):o.reject("No template or templateUrl has been specified."),o.promise).then(function(e){var o={},t=(y.scope||C).$new(),l=null,n=y.locationChangeSuccess;!1===n?l=angular.noop:angular.isNumber(n)&&0<=n?_(function(){l=C.$on("$locationChangeSuccess",v)},n):_(function(){l=C.$on("$locationChangeSuccess",v)},$.configOptions.closeDelay);var r=x.defer(),c=x.defer(),a=!1,s={$scope:t,close:function(e,n){n=n||$.configOptions.closeDelay,"function"==typeof y.preClose&&y.preClose(o,e,n),null!=n||(n=0),a||(a=!0,_(function(){v(e)},n))}};y.inputs&&angular.extend(s,y.inputs);var i=O(e)(t);s.$element=i;var u=t[y.controllerAs],p=j(y.controller,s,!1,y.controllerAs);y.controllerAs&&u&&angular.extend(p,u);var f,d,m,g=b;function v(n){r.resolve(n),y.bodyClass&&b[0].classList.remove(y.bodyClass),M.leave(i).then(function(){if(i){c.resolve(n),t.$destroy();for(var e=0;e<$.openModals.length;e++)if($.openModals[e].modal===o){$.openModals.splice(e,1);break}s.close=null,t=i=s=o=r=h=null}}),l&&l()}angular.isString(y.appendElement)?g=angular.element(S[0].querySelector(y.appendElement)):y.appendElement&&(g=y.appendElement),d=i,0<(m=(f=g).children()).length?M.enter(d,f,m[m.length-1]):M.enter(d,f),y.bodyClass&&b[0].classList.add(y.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(),h.resolve(o),document.activeElement.blur(),$.openModals.push({modal:o,close:s.close})}).then(null,function(e){h.reject(e)}):h.reject("No controller has been specified."),h.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,S,O,e,j,C,t,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,y=angular.element(M[0].body),b=C.defer();return v.controller?(e=v.template,n=v.templateUrl,o=C.defer(),e?o.resolve(e):n?t(n,!0).then(function(e){o.resolve(e)},function(e){o.reject(e)}):o.reject("No template or templateUrl has been specified."),o.promise).then(function(e){var o={},t=(v.scope||j).$new(),l=null,n=v.locationChangeSuccess;!1===n?l=angular.noop:angular.isNumber(n)&&0<=n?x(function(){l=j.$on("$locationChangeSuccess",s.close)},n):x(function(){l=j.$on("$locationChangeSuccess",s.close)},h.configOptions.closeDelay);var r=C.defer(),c=C.defer(),a=!1,s={$scope:t,close:function(e,n){a||(a=!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&&y[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}s.close=null,t=i=s=o=r=b=null}}),l&&l()},n))}};v.inputs&&angular.extend(s,v.inputs);var i=S(e)(t);s.$element=i;var u=t[v.controllerAs],p=O(v.controller,s,!1,v.controllerAs);v.controllerAs&&u&&angular.extend(p,u);var f,d,m,g=y;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&&y[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(),b.resolve(o),document.activeElement.blur(),h.openModals.push({modal:o,close:s.close})}).then(null,function(e){b.reject(e)}):b.reject("No controller has been specified."),b.promise}}(n)}]})}]);
{
"name": "angular-modal-service",
"version": "0.15.1",
"version": "0.15.2",
"description": "AngularJS Service for showing Modals and Popups",

@@ -31,8 +31,8 @@ "main": "./index.js",

"@babel/preset-env": "^7.1.0",
"angular": "1.6.x",
"angular-mocks": "1.6.x",
"angular": "1.7.x",
"angular-mocks": "1.7.x",
"babel-loader": "^8.0.4",
"chai": "^4.2.0",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^3.1.0",
"karma": "^4.0.1",
"karma-chai": "^0.1.0",

@@ -46,3 +46,3 @@ "karma-chrome-launcher": "^2.2.0",

"karma-webpack": "^2.0.9",
"mocha": "^5.2.0",
"mocha": "^6.0.0",
"sinon": "^7.0.0",

@@ -49,0 +49,0 @@ "uglify-js": "^3.3.9",

@@ -102,3 +102,3 @@ 'use strict';

$timeout(function () {
rootScopeOnClose = $rootScope.$on('$locationChangeSuccess', cleanUpClose);
rootScopeOnClose = $rootScope.$on('$locationChangeSuccess', inputs.close);
}, locationChangeSuccess);

@@ -108,3 +108,3 @@ }

$timeout(function () {
rootScopeOnClose = $rootScope.$on('$locationChangeSuccess', cleanUpClose);
rootScopeOnClose = $rootScope.$on('$locationChangeSuccess', inputs.close);
}, self.configOptions.closeDelay);

@@ -127,2 +127,7 @@ }

close: function (result, delay) {
if (hasAlreadyBeenClosed) {
return;
}
hasAlreadyBeenClosed = true;
delay = delay || self.configOptions.closeDelay;

@@ -133,6 +138,2 @@ // If we have a pre-close function, call it.

if (delay === undefined || delay === null) delay = 0;
if (hasAlreadyBeenClosed) {
return;
}
hasAlreadyBeenClosed = true;

@@ -139,0 +140,0 @@ $timeout(function () {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc