System.register(["./index-c820db66.system.js","./index-dc84aac6.system.js","./index-2d937df8.system.js","./index-9ceb7f8c.system.js","./_commonjsHelpers-c8881874.system.js","./index-b0fe4e4c.system.js"],(function(e){"use strict";var t,i,n,m,a,s;return{setters:[function(e){t=e.r;i=e.j;n=e.h;m=e.g},function(e){a=e.I},function(e){s=e.d},function(){},function(){},function(){}],execute:function(){var o={Qty:"Antal",Unit:"Enhet",Name:"Namn",Price:"Pris",VAT:"Moms","Clear/remove item":"Töm/ta bort artikel"};function r(e){return s.create({sv:o},e)}var u=".sc-ig-item-input-h{display:block}[hidden].sc-ig-item-input-h{display:none}*.sc-ig-item-input{z-index:0}.sc-ig-item-input-h>form.sc-ig-item-input{display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.sc-ig-item-input-h>form.sc-ig-item-input>smoothly-input.sc-ig-item-input{border:1px solid rgb(var(--smoothly-medium-color));margin-left:-1px;-ms-flex-positive:1;flex-grow:1}.sc-ig-item-input-h>form.sc-ig-item-input>smoothly-input.sc-ig-item-input>#itemName.sc-ig-item-input{-ms-flex-positive:2;flex-grow:2}.sc-ig-item-input-h>form.sc-ig-item-input>smoothly-trigger.sc-ig-item-input{float:right;padding-top:.3em}";var l=e("ig_item_input",function(){function e(e){t(this,e);this.itemChanged=i(this,"itemChanged",7);this.itemCleared=i(this,"itemCleared",7);this.item={}}e.prototype.componentWillLoad=function(){this.t=r(this.element)};e.prototype.clearInputs=function(e){if(e.detail.name=="clear"){e.stopPropagation();e.preventDefault();var t=document.getElementById("itemQuantity");var i=document.getElementById("itemUnit");var n=document.getElementById("itemName");var m=document.getElementById("itemPrice");var a=document.getElementById("itemVat");var s=[t,i,n,m,a];for(var o=0,r=s;o<r.length;o++){var u=r[o];if(d(u)||c(u))u.value=""}this.updateItem();this.itemCleared.emit()}};e.prototype.updateItem=function(){var e=document.getElementById("itemQuantity");var t=document.getElementById("itemUnit");var i=document.getElementById("itemName");var n=document.getElementById("itemPrice");var m=document.getElementById("itemVat");var s=a.fromVatInclusivePrice(c(n)?n.value:0,c(m)?m.value:undefined,undefined,d(i)?i.value:undefined,d(e)&&Number(e.value)>0?Number(e.value):undefined,d(t)?t.value:undefined,undefined);this.itemChanged.emit(s)};e.prototype.render=function(){var e=this.t;return[n("form",{name:"item"},n("smoothly-input",{class:"left small",onKeyDown:this.updateItem.bind(this),id:"itemQuantity",value:this.item.quantity,type:"text",name:"quantity"},e("Qty")),n("smoothly-input",{class:"small",onKeyDown:this.updateItem.bind(this),id:"itemUnit",value:this.item.unit,type:"text",name:"unit"},e("Unit")),n("smoothly-input",{class:"big",onKeyDown:this.updateItem.bind(this),id:"itemName",value:this.item.name,type:"text",name:"name"},e("Name")),n("smoothly-input",{class:"medium",onKeyDown:this.updateItem.bind(this),id:"itemPrice",value:this.inclusivePrice,type:"price",name:"price"},e("Price")),n("smoothly-input",{class:"medium",onKeyDown:this.updateItem.bind(this),id:"itemVat",value:this.vatPercentage,type:"percent",name:"vat"},e("VAT")),n("smoothly-trigger",{fill:"clear",name:"clear"},n("smoothly-icon",{toolTip:e("Clear/remove item"),size:"small",name:"trash"})))]};Object.defineProperty(e.prototype,"element",{get:function(){return m(this)},enumerable:false,configurable:true});return e}());function d(e){return typeof e.value==="string"}function c(e){return typeof e.value==="number"}l.style=u}}}));