var __awaiter=this&&this.__awaiter||function(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r["throw"](t))}catch(t){o(t)}}function c(t){t.done?n(t.value):i(t.value).then(s,a)}c((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return c([t,e])}}function c(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=e.call(t,n)}catch(t){s=[6,t];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-af035210.system.js","./p-a3c7b64b.system.js","./p-fba672db.system.js","./p-bad9e52e.system.js","./p-74208c80.system.js","./p-abfa4880.system.js","./p-eedf4977.system.js","./p-5ccdd889.system.js","./p-f887c8bb.system.js","./p-8a0a3550.system.js"],(function(t){"use strict";var e,n,r;return{setters:[function(t){e=t.I},function(){},function(t){n=t.a},function(t){r=t.S},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var i=function(){function t(t){this.connection=t}t.prototype.list=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,this.connection.get("settlement"+(t&&e?"?date="+t+"&days="+e:t?"?date="+t:e?"?days="+e:""))];case 1:return[2,n.sent()]}}))}))};t.prototype.report=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.connection.post("settlement/report?language="+e,t)]}))}))};t.prototype.load=function(t){return __awaiter(this,void 0,void 0,(function(){var n;var i=this;return __generator(this,(function(o){switch(o.label){case 0:if(!e.is(t))return[3,2];return[4,this.connection.get("settlement/"+t)];case 1:n=o.sent();return[3,4];case 2:return[4,Promise.all(t.map((function(t){return i.connection.get("settlement/"+t)})))];case 3:n=o.sent().filter(r.is);o.label=4;case 4:return[2,n]}}))}))};t.open=function(e,r){var i=n.open(e,r);return i&&new t(i)};return t}();t("Settlement",i)}}}));