var __spreadArray=this&&this.__spreadArray||function(e,t){for(var o=0,i=t.length,s=e.length;o<i;o++,s++)e[s]=t[o];return e};System.register(["./index-c820db66.system.js","./index-2d937df8.system.js","./_commonjsHelpers-c8881874.system.js"],(function(e){"use strict";var t,o,i,s,n;return{setters:[function(e){t=e.r;o=e.j;i=e.h;s=e.g},function(e){n=e.d},function(){}],execute:function(){var d={Scheme:"System","Card number":"Kortnummer",Expires:"Giltigt t.o.m.",Close:"Stäng","Add method":"Lägg till metod","The customer has no payment method.":"Kunden har ingen betalningsmetod."};function m(e){return n.create({sv:d},e)}var r="[hidden].sc-ig-payment-methods-h{display:none}section.sc-ig-payment-methods{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-weight:bold}section.sc-ig-payment-methods>*.sc-ig-payment-methods{width:10em}section.sc-ig-payment-methods>*.sc-ig-payment-methods:nth-of-type(2){width:15em}@media only screen and (min-width: 1000px){smoothly-icon.sc-ig-payment-methods{visibility:hidden}smoothly-reorder.sc-ig-payment-methods{float:left}smoothly-reorder.sc-ig-payment-methods>*.sc-ig-payment-methods{margin-top:10px}ig-payment-method-add.sc-ig-payment-methods{position:relative;display:block;visibility:visible;width:50%;float:right}}@media only screen and (max-width: 1000px){smoothly-icon.sc-ig-payment-methods{visibility:visible;position:fixed;right:5%;cursor:pointer}ig-payment-method-add.sc-ig-payment-methods,#desktop.sc-ig-payment-methods{display:none}ig-payment-method-add.sc-ig-payment-methods,#phone.sc-ig-payment-methods{display:block;width:25rem;max-width:90%;margin:0 auto}.sc-ig-payment-methods-h>smoothly-reorder.sc-ig-payment-methods>*.sc-ig-payment-methods,table.sc-ig-payment-methods{max-width:60%;margin:0 auto;margin-top:10px}}";var h=e("ig_payment_methods",function(){function e(e){t(this,e);this.update=o(this,"update",7);this.delete=o(this,"delete",7);this.addable=false;this.deletable=false;this.mode="card";this.opened=false}e.prototype.componentWillLoad=function(){this.t=m(this.element)};e.prototype.renderMethods=function(){this.methods=__spreadArray([],this.methods)};e.prototype.deleteMethod=function(e){var t=this;window.setTimeout((function(){t.methods.splice(e,1);t.renderMethods();t.delete.emit(t.methods)}),500)};e.prototype.reorderMethods=function(e){var t;var o=e.detail[0];var i=e.detail[1];var s=this.methods.splice(o,1);(t=this.methods).splice.apply(t,__spreadArray([i,0],s));this.update.emit(this.methods)};e.prototype.render=function(){var e=this;return[this.addable?[i("smoothly-icon",{name:this.opened?"close-circle":"add-circle",toolTip:this.opened?this.t("Close"):this.t("Add method"),size:"large",onClick:function(){return e.opened=!e.opened}}),i("ig-payment-method-add",{id:this.opened?"phone":"desktop",customer:this.customer,"api-key":this.apiKey,onAdd:function(){return e.renderMethods()}})]:null,this.mode=="table"&&(this.methods.length>0?i("section",null,i("label",null,this.t("Scheme")),i("label",null,this.t("Card number")),i("label",null,this.t("Expires"))):i("p",null,this.t("The customer has no payment method."))),i("smoothly-reorder",{onReorder:function(t){return e.reorderMethods(t)}},this.methods.map((function(t,o){return[i("ig-payment-method",{mode:e.mode,method:t,deletable:e.deletable,onDeleteMethod:function(){return e.deleteMethod(o)}})]})))]};Object.defineProperty(e.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());h.style=r}}}));