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,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function c(e){try{s(r["throw"](e))}catch(e){a(e)}}function s(e){e.done?n(e.value):i(e.value).then(o,c)}s((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return s([e,t])}}function s(o){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;i=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-2172a2da.system.js","./p-1a333ccd.system.js","./p-af035210.system.js","./p-94251bc6.system.js","./p-784b2579.system.js"],(function(e){"use strict";var t,n,r,i,a,o;return{setters:[function(e){t=e.r;n=e.h},function(e){r=e.d},function(e){i=e.a},function(e){a=e.p},function(e){o=e.p}],execute:function(){var c=":host{display:block}:host[hidden]{display:none}:host{display:-ms-flexbox;display:flex;-ms-flex-flow:row;flex-flow:row;-ms-flex-wrap:wrap;flex-wrap:wrap}";var s=e("I",function(){function e(e){t(this,e);this.created=false}e.prototype.getPayment=function(e,t){return __awaiter(this,void 0,void 0,(function(){var t,n,r,a;return __generator(this,(function(o){switch(o.label){case 0:if(!(this.option&&e.items&&e.currency))return[3,2];return[4,this.cardInput.submit((n=(t=e.payment)===null||t===void 0?void 0:t.card)!==null&&n!==void 0?n:undefined)];case 1:a=o.sent();if(!this.created)this.created=i.is(a);r=i.is(a)?{type:"card",card:a,client:this.getClientData()}:undefined;o.label=2;case 2:return[2,r]}}))}))};e.prototype.confirmPayment=function(e,t,n,r){return __awaiter(this,void 0,void 0,(function(){var n,a;return __generator(this,(function(o){switch(o.label){case 0:if(!(e.items&&e.currency))return[3,2];return[4,this.cardInput.submit("card"in t?t.card:undefined,r)];case 1:a=o.sent();n=i.is(a)?{type:"card",card:a,client:this.getClientData()}:undefined;o.label=2;case 2:return[2,n]}}))}))};e.prototype.getClientData=function(){return{browser:{colorDepth:screen.colorDepth,resolution:[screen.width,screen.height],java:navigator.javaEnabled(),javascript:true,locale:r.Locale.is(navigator.language)?navigator.language:"en-GB",timezone:(new Date).getTimezoneOffset(),parent:window.location.origin}}};e.prototype.render=function(){var e=this;return this.option?n("intergiro-card-input",{"api-key":this.option.apiKey,ref:function(t){return e.cardInput=t},cosmetic:this.cosmetic}):[]};return e}());o("card",(function(e,t){var r={type:"card",name:"Card",brand:e.service,component:n("ig-card-details",{option:a(e)?e:undefined,cosmetic:t,ref:function(e){return r.element=e}})};return r}));s.style=c}}}));