System.register(["./p-14b5f59f.system.js","./p-542acf0d.system.js","./p-91362d42.system.js","./p-9565041b.system.js"],(function(t){"use strict";var i,e,n,s,r,a,o,u;return{setters:[function(t){i=t.r;e=t.c;n=t.h;s=t.H;r=t.g},function(t){a=t.L},function(t){o=t.I},function(t){u=t.c}],execute:function(){var h="x-quantity.invalid x-chip{border-color:var(--color-danger, #DC3545) !important;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 0 3px rgba(var(--color-danger-rgb, 220, 53, 69), 0.3) !important;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 0 3px rgba(var(--color-danger-rgb, 220, 53, 69), 0.3) !important}x-quantity x-chip x-button button{background-color:transparent !important}x-quantity x-button:focus{border-radius:50%;background-color:rgba(var(--color-primary-rgb, 66, 117, 242), 0.3);outline:0;-webkit-box-shadow:none !important;box-shadow:none !important}x-quantity input{width:2rem;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-weight:bold;text-align:center;display:inline-block;position:relative;margin:0 0.25rem;border:none;background:transparent;outline:none;-moz-appearance:textfield;border-radius:0.25rem}x-quantity input::-webkit-outer-spin-button,x-quantity input::-webkit-inner-spin-button{-webkit-appearance:none}.is-dark-mode x-quantity input{color:var(--color-text-light, #FEFEFE)}";var c=h;var b=t("x_quantity",function(){function t(t){i(this,t);this.onSubInputEvent=e(this,"sub",3);this.onSumInputEvent=e(this,"sum",3);this.onValidateInputEvent=e(this,"validated",3);if(t.$hostElement$["s-ei"]){this.internals=t.$hostElement$["s-ei"]}else{this.internals=t.$hostElement$.attachInternals();t.$hostElement$["s-ei"]=this.internals}this.name=undefined;this.min=undefined;this.max=undefined;this.value=1;this.required=undefined;this.number=undefined;this.isValid=true;this.isDisabled=undefined}t.prototype.watchValue=function(t){var i;this.number=typeof t==="number"?t:parseInt(t);this.internals.setFormValue(this.number.toString());this.el.dispatchEvent(new InputEvent("input",{bubbles:false}));this.formValidateCallback(true);(i=this.internals.form)===null||i===void 0?void 0:i.dispatchEvent(new InputEvent("input",{bubbles:false}))};t.prototype.formDisabledCallback=function(t){this.isDisabled=t};t.prototype.formResetCallback=function(){this.isValid=true;this.value=0};t.prototype.formValidateCallback=function(t){if(this.required&&Number.isNaN(this.value)){this.internals.setValidity({valueMissing:true},a.get("fields.validation.value-missing"))}else if(!Number.isNaN(this.max)&&this.value>this.max){this.internals.setValidity({rangeOverflow:true},a.get("fields.validation.range-overflow",{max:this.max}))}else if(!Number.isNaN(this.min)&&this.value<this.min){this.internals.setValidity({rangeUnderflow:true},a.get("fields.validation.range-underflow",{min:this.min}))}else{this.internals.setValidity({})}if(t){this.isValid=this.internals.validity.valid;this.onValidateInputEvent.emit(this.internals)}};t.prototype.componentWillLoad=function(){if(this.min&&this.min>this.value){this.value=this.min}this.number=this.value};t.prototype.componentDidLoad=function(){var t=this;o(this.input,{mask:Number});setTimeout((function(){return t.formValidateCallback()}),0)};t.prototype.onBlurInput=function(){var t=this;setTimeout((function(){return t.formValidateCallback(true)}),50)};t.prototype.handleChange=function(t){var i=t.target;this.value=parseInt(i.value)};t.prototype.onPlusClick=function(){if(!Number.isNaN(this.number)&&this.number+1>this.max){return}this.number++;this.value=this.number;this.onSumInputEvent.emit(this.number)};t.prototype.onMinusClick=function(){if(!Number.isNaN(this.number)&&this.number-1<this.min){return}this.number--;this.value=this.number;this.onSubInputEvent.emit(this.number)};t.prototype.render=function(){var t=this;return n(s,{key:"d7f7edcfcda8197101484dce6ed797dd03e868d4",class:u({invalid:!this.isValid,disabled:this.isDisabled,required:this.required}),"data-for":this.name},n("x-chip",{key:"104713aaa7a8bf74adc8ca364bb7395ee0e358d8",hoverable:true},n("x-button",{key:"5922991128250e2f4226e0d307bc9b00c5af232c",icon:"plus",tabindex:"-1",onClick:this.onPlusClick.bind(this)}),n("input",{key:"7d3acbda8e80a2ce96a9c1440b7b69ecb7956e47",ref:function(i){return t.input=i},min:this.min,max:this.max,required:this.required,inputMode:"numeric",value:this.number,onInput:function(i){return t.handleChange(i)}}),n("x-button",{key:"c3d45c2406d6d752455c0b3047576fdc1e7ae191",icon:"minus",tabindex:"-1",onClick:this.onMinusClick.bind(this)})))};Object.defineProperty(t,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["watchValue"]}},enumerable:false,configurable:true});return t}());b.style=c}}}));