var __awaiter=this&&this.__awaiter||function(t,i,n,a){function e(t){return t instanceof n?t:new n((function(i){i(t)}))}return new(n||(n=Promise))((function(n,o){function r(t){try{l(a.next(t))}catch(t){o(t)}}function s(t){try{l(a["throw"](t))}catch(t){o(t)}}function l(t){t.done?n(t.value):e(t.value).then(r,s)}l((a=a.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,e,o,r;return r={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(t){return function(i){return l([t,i])}}function l(r){if(a)throw new TypeError("Generator is already executing.");while(n)try{if(a=1,e&&(o=r[0]&2?e["return"]:r[0]?e["throw"]||((o=e["return"])&&o.call(e),0):e.next)&&!(o=o.call(e,r[1])).done)return o;if(e=0,o)r=[r[0]&2,o.value];switch(r[0]){case 0:case 1:o=r;break;case 4:n.label++;return{value:r[1],done:false};case 5:n.label++;e=r[1];r=[0];continue;case 7:r=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(r[0]===6||r[0]===2)){n=0;continue}if(r[0]===3&&(!o||r[1]>o[0]&&r[1]