System.register(["./index-c820db66.system.js","./index-542a2c72.system.js","./index-2d937df8.system.js","./_commonjsHelpers-c8881874.system.js"],(function(t){"use strict";var e,n,a,s,i,r;return{setters:[function(t){e=t.r;n=t.j;a=t.h;s=t.g},function(t){i=t.d},function(t){r=t.d},function(){}],execute:function(){var o={create:"skapad",order:"beställa",cancel:"avbryt",charge:"debitera",pay:"betala",refund:"återbetala",deny:"neka",pending:"väntande",defer:"skicka",Quantity:"Antal",Amount:"Summa"};function u(t){return r.create({sv:o},t)}var c=".sc-ig-status-change-h{display:inline-block}[hidden].sc-ig-status-change-h{display:none}button.sc-ig-status-change{display:block;padding:.2em .3em;border:none;font-size:inherit}button.sc-ig-status-change:focus{outline:unset}content.sc-ig-status-change>*.sc-ig-status-change{text-align:center;height:2.5em;min-width:2.5em}content.sc-ig-status-change>.sc-ig-status-change:first-child{border-top-left-radius:5px;border-bottom-left-radius:5px}content.sc-ig-status-change>.sc-ig-status-change:last-child{border-top-right-radius:5px;border-bottom-right-radius:5px}#charge.sc-ig-status-change{background-color:rgb(var(--smoothly-success-color))}#cancel.sc-ig-status-change{background-color:rgb(var(--smoothly-danger-color))}#refund.sc-ig-status-change{background-color:rgb(var(--smoothly-danger-color))}#synchronize.sc-ig-status-change{background-color:rgb(var(--smoothly-dark-color))}#amount.sc-ig-status-change{min-width:6em;padding:0;background-color:rgb(var(--smoothly-dark-color))}content.sc-ig-status-change{display:-ms-flexbox;display:flex}.sc-ig-status-change-h>smoothly-popup.sc-ig-status-change{display:inline}";var l=t("ig_status_change",function(){function t(t){e(this,t);this.changeStatus=n(this,"changeStatus",7)}Object.defineProperty(t.prototype,"mode",{get:function(){return this.amount&&i.Currency.is(this.currency)?"amount":"quantity"},enumerable:false,configurable:true});t.prototype.componentWillLoad=function(){this.t=u(this.element)};t.prototype.emitChangeStatus=function(t){var e,n,a;var s=!((e=this.inputElement)===null||e===void 0?void 0:e.value)?1:this.mode=="quantity"?Number.parseInt((n=this.inputElement)===null||n===void 0?void 0:n.value):Number.parseFloat((a=this.inputElement)===null||a===void 0?void 0:a.value);this.changeStatus.emit({type:t,items:this.mode=="quantity"?{quantity:s}:s});if(this.popupElement)this.popupElement.visible=false};t.prototype.render=function(){var t=this;var e;var n=this.t;var s;switch(this.status){case"created":case"deferred":case"pending":s=[];break;case"ordered":s=[];break;case"charged":case"paid":s=["refund"];break;default:case"denied":case"cancelled":case"refunded":case"synchronized":s=[];break}return[s.length!=0?a("smoothly-popup",{ref:function(e){return t.popupElement=e}},a("main",null,a("ig-status",{quantity:this.quantity,unit:this.unit,status:this.status})),a("content",{slot:"popup"},this.quantity==1?"":this.mode=="quantity"?a("smoothly-select",{color:"dark",identifier:"quantity",ref:function(e){return t.inputElement=e}},d((e=this.quantity)!==null&&e!==void 0?e:1).map((function(e){return e=t.quantity?a("option",{value:e},e):a("option",{value:e,selected:true},e)}))):a("smoothly-input",{type:"price",name:"amount",id:"amount",value:this.amount,ref:function(e){return t.inputElement=e}},n("Amount")," (",this.currency,")"),s.map((function(e){return a("button",{onClick:function(){return t.emitChangeStatus(e)},id:e,name:e},a("smoothly-icon",{toolTip:n(e),name:e=="cancel"?"close":e=="charge"?"checkmark":e=="refund"?"arrow-undo":"",color:e=="cancel"?"danger":e=="charge"?"success":e=="refund"?"danger":"medium"}))})))):a("div",null,a("span",null,a("ig-status",{quantity:this.quantity,unit:this.unit,status:this.status})))]};Object.defineProperty(t.prototype,"element",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());function d(t){var e=[];for(var n=1;n<=t;n++)e.push(n);return e}l.style=c}}}));