var __awaiter=this&&this.__awaiter||function(e,t,n,r){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r["throw"](e))}catch(e){i(e)}}function l(e){e.done?n(e.value):a(e.value).then(o,s)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,a,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(s){if(r)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(n=0)),n)try{if(r=1,a&&(i=s[0]&2?a["return"]:s[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;if(a=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;a=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]0?r:1;r=r/(a.max-a.min);if(!t){r*=-1}if(e==="A"){a.ratioA=d(0,a.ratioA+r,1)}else{a.ratioB=d(0,a.ratioB+r,1)}a.ionKnobMoveStart.emit({value:n(a.value)});a.updateValue();a.emitValueChange();a.ionKnobMoveEnd.emit({value:n(a.value)})};this.onBlur=function(){if(a.hasFocus){a.hasFocus=false;a.ionBlur.emit()}};this.onFocus=function(){if(!a.hasFocus){a.hasFocus=true;a.ionFocus.emit()}};this.ratioA=0;this.ratioB=0;this.pressedKnob=undefined;this.color=undefined;this.debounce=undefined;this.name=this.rangeId;this.label=undefined;this.dualKnobs=false;this.min=0;this.max=100;this.pin=false;this.pinFormatter=function(e){return Math.round(e)};this.snaps=false;this.step=1;this.ticks=true;this.activeBarStart=undefined;this.disabled=false;this.value=0;this.labelPlacement="start"}e.prototype.debounceChanged=function(){var e=this,t=e.ionInput,n=e.debounce,r=e.originalIonInput;this.ionInput=n===undefined?r!==null&&r!==void 0?r:t:c(t,n)};e.prototype.minChanged=function(){if(!this.noUpdate){this.updateRatio()}};e.prototype.maxChanged=function(){if(!this.noUpdate){this.updateRatio()}};e.prototype.activeBarStartChanged=function(){var e=this.activeBarStart;if(e!==undefined){if(e>this.max){p("Range: The value of activeBarStart (".concat(e,") is greater than the max (").concat(this.max,"). Valid values are greater than or equal to the min value and less than or equal to the max value."),this.el);this.activeBarStart=this.max}else if(e=O&&S<=C};_[x]="".concat(S*100,"%");j.push(_)}}return a("div",{class:"range-slider",ref:function(e){return t.rangeSlider=e},onPointerUp:function(e){if(t.pressedKnob===undefined){t.onStart();t.onEnd(e)}}},j.map((function(e){return a("div",{style:y(e),role:"presentation",class:{"range-tick":true,"range-tick-active":e.active},part:e.active?"tick-active":"tick"})})),a("div",{class:"range-bar-container"},a("div",{class:"range-bar",role:"presentation",part:"bar"}),a("div",{class:{"range-bar":true,"range-bar-active":true,"has-ticks":j.length>0},role:"presentation",style:z,part:"bar-active"})),A(v,{knob:"A",pressed:b==="A",value:this.valA,ratio:this.ratioA,pin:c,pinFormatter:p,disabled:d,handleKeyboard:l,min:i,max:o,inheritedAttributes:u}),this.dualKnobs&&A(v,{knob:"B",pressed:b==="B",value:this.valB,ratio:this.ratioB,pin:c,pinFormatter:p,disabled:d,handleKeyboard:l,min:i,max:o,inheritedAttributes:u}))};e.prototype.render=function(){var e;var t=this,n=t.disabled,r=t.el,o=t.hasLabel,s=t.rangeId,l=t.pin,b=t.pressedKnob,d=t.labelPlacement,c=t.label;var h=u("ion-item",r);var p=o&&(d==="start"||d==="fixed")||this.hasStartSlotContent;var f=h&&!p;var v=o&&d==="end"||this.hasEndSlotContent;var x=h&&!v;var w=k(this);g(true,r,this.name,JSON.stringify(this.getValue()),n);return a(i,{key:"201677b1146738b96d74081e59d3e13a8472326e",onFocusin:this.onFocus,onFocusout:this.onBlur,id:s,class:m(this.color,(e={},e[w]=true,e["in-item"]=h,e["range-disabled"]=n,e["range-pressed"]=b!==undefined,e["range-has-pin"]=l,e["range-label-placement-".concat(d)]=true,e["range-item-start-adjustment"]=f,e["range-item-end-adjustment"]=x,e))},a("label",{key:"055dda4f2673432e639b7efdbb01b2794c91e705",class:"range-wrapper",id:"range-label"},a("div",{key:"3efe1eda1f68810a739a42b7655f2dd71beccf1e",class:{"label-text-wrapper":true,"label-text-wrapper-hidden":!o},part:"label"},c!==undefined?a("div",{class:"label-text"},c):a("slot",{name:"label"})),a("div",{key:"31458b02c2973f4ecf4a10de4c0ae1c4befda37a",class:"native-wrapper"},a("slot",{key:"21c78b192f312396bd86bf52a0888312ffefea8a",name:"start"}),this.renderRangeSlider(),a("slot",{key:"843193879728ccfec62b4becb1b57d64b6d96804",name:"end"}))))};Object.defineProperty(e.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{debounce:["debounceChanged"],min:["minChanged"],max:["maxChanged"],activeBarStart:["activeBarStartChanged"],disabled:["disabledChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return e}());var A=function(e,t){var n=t.knob,r=t.value,i=t.ratio,o=t.min,s=t.max,l=t.disabled,b=t.pressed,d=t.pin,c=t.handleKeyboard,h=t.pinFormatter,g=t.inheritedAttributes;var p=e?"right":"left";var f=function(){var e={};e[p]="".concat(i*100,"%");return e};var u=g["aria-label"];return a("div",{onKeyDown:function(e){var t=e.key;if(t==="ArrowLeft"||t==="ArrowDown"){c(n,false);e.preventDefault();e.stopPropagation()}else if(t==="ArrowRight"||t==="ArrowUp"){c(n,true);e.preventDefault();e.stopPropagation()}},class:{"range-knob-handle":true,"range-knob-a":n==="A","range-knob-b":n==="B","range-knob-pressed":b,"range-knob-min":r===o,"range-knob-max":r===s,"ion-activatable":true,"ion-focusable":true},style:f(),role:"slider",tabindex:l?-1:0,"aria-label":u!==undefined?u:null,"aria-labelledby":u===undefined?"range-label":null,"aria-valuemin":o,"aria-valuemax":s,"aria-disabled":l?"true":null,"aria-valuenow":r},d&&a("div",{class:"range-pin",role:"presentation",part:"pin"},h(r)),a("div",{class:"range-knob",role:"presentation",part:"knob"}))};var S=function(e,t,n,r){var a=(n-t)*e;if(r>0){a=Math.round(a/r)*r+t}var i=d(t,a,n);return x(i,t,n,r)};var B=function(e,t,n){return d(0,(e-t)/(n-t),1)};var O=0;M.style={ios:y,md:j}}}}));