var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function c(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i["throw"](e))}catch(e){o(e)}}function u(e){e.done?n(e.value):r(e.value).then(c,s)}u((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,c;return c={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function s(e){return function(t){return u([e,t])}}function u(c){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=c[0]&2?r["return"]:c[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;if(r=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:n.label++;return{value:c[1],done:false};case 5:n.label++;r=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1];o=c;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(c);break}if(o[2])n.ops.pop();n.trys.pop();continue}c=t.call(e,n)}catch(e){c=[6,e];r=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-2172a2da.system.js","./p-8c01ffbc.system.js","./p-94251bc6.system.js","./p-784b2579.system.js","./p-b5dd9b68.system.js"],(function(e){"use strict";var t,n,i,r,o,c,s;return{setters:[function(e){t=e.r;n=e.h;i=e.g},function(e){r=e.d},function(e){o=e.a},function(e){c=e.p},function(e){s=e.d}],execute:function(){var u={"The selected invoice choice costs $0.":"Avgiften för den valda fakturan är $0.","Due within $0 days":"Betalas inom $0 dagar.","Due before $0.":"Betalas före $0"};function a(e){return s.create({sv:u},e)}var l=".sc-ig-invoice-details-h>p.sc-ig-invoice-details{padding-left:0.4em;padding-right:0.4em}smoothly-radio.sc-ig-invoice-details{width:calc(100% - 2px)}";var f=e("I",function(){function e(e){t(this,e)}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.t=a(this.element);return[2]}))}))};e.prototype.getPayment=function(e,t){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){if(this.option&&this.selected){if(!e.items||!e.currency||!e.customer)console.log("Error: must have items, currency, customer");else{t={type:this.option.type,terms:this.selected,verify:{mode:"iframe",parent:window.location.origin}}}}return[2,t]}))}))};e.prototype.render=function(){var e=this;var t=this.t;if(!this.selected&&this.option)this.selected=this.option.terms[0];return[this.option?this.option.terms.map((function(i){return n("smoothly-radio",{onSmoothlySelected:function(){return e.selected=i},checked:e.selected==i,name:"invoice-terms",value:i.due.toString()},typeof i.due=="number"?t("Due within $0 days",i.due):t("Due before $0.",i.due))})):[],this.selected?n("p",null,t("The selected invoice choice costs $0.",r.format(this.selected.fee,"price",this.currency))):[]]};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());c("invoice",(function(e){var t={type:"invoice",name:"Invoice",brand:e.service,component:n("ig-invoice-details",{option:o(e)?e:undefined,currency:e.currency,ref:function(e){return t.element=e}})};return t}));f.style=l}}}));