var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function c(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,c)}s((r=r.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:[]},r,i,o,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(a){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./index-c820db66.system.js","./index-b0fe4e4c.system.js","./index-dc84aac6.system.js","./index-2d937df8.system.js","./index-9ceb7f8c.system.js","./_commonjsHelpers-c8881874.system.js"],(function(e){"use strict";var t,n,r,i,o,a,c;return{setters:[function(e){t=e.r;n=e.j;r=e.h;i=e.g},function(e){o=e.I},function(e){a=e.K},function(e){c=e.d},function(){},function(){}],execute:function(){var s={Submit:"Skicka","No valid API key.":"Ingen giltig API-nyckel."};function u(e){return c.create({sv:s},e)}var l=".sc-payfunc-onboard-h{display:block;max-width:40em}";var f=e("payfunc_onboard",function(){function e(e){t(this,e);this.create=n(this,"create",7)}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,a.unpack(this.apiKey,"public","customer","private")];case 1:e.merchant=t.sent();this.t=u(this.element);if(!this.number)this.number=o.generate(16);return[2]}}))}))};e.prototype.onCreate=function(e){this.create.emit(e.detail)};e.prototype.render=function(){var e=this.t;return!this.merchant?r("p",null,this.t("No valid API key.")):[r("smoothly-notifier",null,r("ig-onboard-form",{cosmetic:this.cosmetic,merchant:this.merchant,customer:this.customer,"api-key":this.apiKey,number:this.number,"response-timer":this.responseTimer}),r("merchant-terms",{merchant:this.merchant,buttonName:e("Submit")}),r("card-logotypes",null))]};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());f.style=l}}}));