{"version":3,"sources":["webpack:///./node_modules/@ionic/core/dist/esm-es5/theme-18cbe2cc.js","webpack:///./node_modules/@ionic/core/dist/esm-es5/ion-range-ios.entry.js"],"names":["hostContext","selector","el","closest","createColorClasses","color","_a","length","undefined","getClassList","classes","array","Array","isArray","split","filter","c","map","trim","getClassMap","forEach","SCHEME","openURL","url","ev","direction","router","this","test","document","querySelector","preventDefault","push","Range","class_1","hostRef","_this","noUpdate","hasFocus","ratioA","ratioB","debounce","name","dualKnobs","min","max","pin","snaps","step","ticks","disabled","value","clampBounds","ensureValueInBounds","lower","upper","handleKeyboard","knob","isIncrease","updateValue","onBlur","ionBlur","emit","emitStyle","onFocus","ionFocus","ionChange","ionStyle","prototype","debounceChanged","minChanged","updateRatio","maxChanged","disabledChanged","gesture","setDisabled","valueChanged","connectedCallback","disconnectedCallback","destroy","componentDidLoad","rangeSlider","_b","label","sent","createGesture","gestureName","gesturePriority","threshold","onStart","onMove","onEnd","getValue","detail","rect","getBoundingClientRect","currentX","ratio","left","width","dir","pressedKnob","Math","abs","setFocus","update","valueToRatio","ratioToValue","Object","defineProperty","get","enumerable","configurable","valA","valB","shadowRoot","knobEl","focus","render","_c","ratioLower","ratioUpper","mode","barStart","barEnd","doc","isRTL","start","end","tickStyle","tick","barStyle","active","JSON","stringify","onFocusin","onFocusout","class","assign","ref","rangeEl","style","role","renderKnob","pressed","knobStyle","onKeyDown","key","stopPropagation","tabindex","round"],"mappings":"kHAAA,wJACIA,EAAc,SAAUC,EAAUC,GAClC,OAAgC,OAAzBA,EAAGC,QAAQF,IAKlBG,EAAqB,SAAUC,GAC/B,IAAIC,EACJ,MAAyB,kBAAVD,GAAsBA,EAAME,OAAS,GAAMD,EAAK,CACvD,aAAa,GAEjBA,EAAG,aAAeD,IAAS,EAC3BC,QAAME,GAEVC,EAAe,SAAUC,GACzB,QAAgBF,IAAZE,EAAuB,CACvB,IAAIC,EAAQC,MAAMC,QAAQH,GAAWA,EAAUA,EAAQI,MAAM,KAC7D,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GkD,eAChKuE,EAAQD,EAAQ,QAAU,OAC1BmB,EAAY,WACZ,IAAIJ,EAAQ,GAEZ,OADAA,EAAMd,GAAiB,IAAR9B,EAAc,IACtB4C,GAEX,OAAQ,cAAD,CAAG,MAAO,CAAEK,UAAW,SAAU1H,GAChC,IAAI2H,EAAM3H,EAAG2H,IACD,cAARA,GAA+B,cAARA,GACvB3F,EAAeC,GAAM,GACrBjC,EAAGO,iBACHP,EAAG4H,mBAEU,eAARD,GAAgC,YAARA,IAC7B3F,EAAeC,GAAM,GACrBjC,EAAGO,iBACHP,EAAG4H,oBAERX,MAAO,CACN,qBAAqB,EACrB,eAAyB,MAAThF,EAChB,eAAyB,MAATA,EAChB,qBAAsBuF,EACtB,iBAAkB7F,IAAUP,EAC5B,iBAAkBO,IAAUN,GAC7BgG,MAAOI,IAAaH,KAAM,SAAUO,SAAUnG,GAAY,EAAI,EAAG,gBAAiBN,EAAK,gBAAiBC,EAAK,gBAAiBK,EAAW,OAAS,KAAM,gBAAiBC,GAASL,GAAO,eAAE,MAAO,CAAE2F,MAAO,YAAaK,KAAM,gBAAkBxC,KAAKgD,MAAMnG,IAAS,eAAE,MAAO,CAAEsF,MAAO,aAAcK,KAAM,mBAEjTnC,EAAe,SAAUV,EAAOrD,EAAKC,EAAKG,GAC1C,IAAIG,GAASN,EAAMD,GAAOqD,EAI1B,OAHIjD,EAAO,IACPG,EAAQmD,KAAKgD,MAAMnG,EAAQH,GAAQA,EAAOJ,GAEvC,eAAMA,EAAKO,EAAON,IAEzB6D,EAAe,SAAUvD,EAAOP,EAAKC,GACrC,OAAO,eAAM,GAAIM,EAAQP,IAAQC,EAAMD,GAAM","file":"js/chunk-23d04875.c7ea5b8c.js","sourcesContent":["import { __awaiter, __generator } from \"tslib\";\nvar hostContext = function (selector, el) {\n return el.closest(selector) !== null;\n};\n/**\n * Create the mode and color classes for the component based on the classes passed in\n */\nvar createColorClasses = function (color) {\n var _a;\n return (typeof color === 'string' && color.length > 0) ? (_a = {\n 'ion-color': true\n },\n _a[\"ion-color-\" + color] = true,\n _a) : undefined;\n};\nvar getClassList = function (classes) {\n if (classes !== undefined) {\n var array = Array.isArray(classes) ? classes : classes.split(' ');\n return array\n .filter(function (c) { return c != null; })\n .map(function (c) { return c.trim(); })\n .filter(function (c) { return c !== ''; });\n }\n return [];\n};\nvar getClassMap = function (classes) {\n var map = {};\n getClassList(classes).forEach(function (c) { return map[c] = true; });\n return map;\n};\nvar SCHEME = /^[a-z][a-z0-9+\\-.]*:/;\nvar openURL = function (url, ev, direction) { return __awaiter(void 0, void 0, void 0, function () {\n var router;\n return __generator(this, function (_a) {\n if (url != null && url[0] !== '#' && !SCHEME.test(url)) {\n router = document.querySelector('ion-router');\n if (router) {\n if (ev != null) {\n ev.preventDefault();\n }\n return [2 /*return*/, router.push(url, direction)];\n }\n }\n return [2 /*return*/, false];\n });\n}); };\nexport { createColorClasses as c, getClassMap as g, hostContext as h, openURL as o };\n","import { __awaiter, __generator } from \"tslib\";\nimport { r as registerInstance, d as createEvent, c as getIonMode, h, H as Host, e as getElement } from './core-feeeff0d.js';\nimport './config-3c7f3790.js';\nimport { c as clamp, d as debounceEvent, a as renderHiddenInput } from './helpers-46f4a262.js';\nimport { c as createColorClasses, h as hostContext } from './theme-18cbe2cc.js';\nvar Range = /** @class */ (function () {\n function class_1(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n this.noUpdate = false;\n this.hasFocus = false;\n this.ratioA = 0;\n this.ratioB = 0;\n /**\n * How long, in milliseconds, to wait to trigger the\n * `ionChange` event after each change in the range value.\n */\n this.debounce = 0;\n /**\n * The name of the control, which is submitted with the form data.\n */\n this.name = '';\n /**\n * Show two knobs.\n */\n this.dualKnobs = false;\n /**\n * Minimum integer value of the range.\n */\n this.min = 0;\n /**\n * Maximum integer value of the range.\n */\n this.max = 100;\n /**\n * If `true`, a pin with integer value is shown when the knob\n * is pressed.\n */\n this.pin = false;\n /**\n * If `true`, the knob snaps to tick marks evenly spaced based\n * on the step property value.\n */\n this.snaps = false;\n /**\n * Specifies the value granularity.\n */\n this.step = 1;\n /**\n * If `true`, tick marks are displayed based on the step value.\n * Only applies when `snaps` is `true`.\n */\n this.ticks = true;\n /**\n * If `true`, the user cannot interact with the range.\n */\n this.disabled = false;\n /**\n * the value of the range.\n */\n this.value = 0;\n this.clampBounds = function (value) {\n return clamp(_this.min, value, _this.max);\n };\n this.ensureValueInBounds = function (value) {\n if (_this.dualKnobs) {\n return {\n lower: _this.clampBounds(value.lower),\n upper: _this.clampBounds(value.upper)\n };\n }\n else {\n return _this.clampBounds(value);\n }\n };\n this.handleKeyboard = function (knob, isIncrease) {\n var step = _this.step;\n step = step > 0 ? step : 1;\n step = step / (_this.max - _this.min);\n if (!isIncrease) {\n step *= -1;\n }\n if (knob === 'A') {\n _this.ratioA = clamp(0, _this.ratioA + step, 1);\n }\n else {\n _this.ratioB = clamp(0, _this.ratioB + step, 1);\n }\n _this.updateValue();\n };\n this.onBlur = function () {\n if (_this.hasFocus) {\n _this.hasFocus = false;\n _this.ionBlur.emit();\n _this.emitStyle();\n }\n };\n this.onFocus = function () {\n if (!_this.hasFocus) {\n _this.hasFocus = true;\n _this.ionFocus.emit();\n _this.emitStyle();\n }\n };\n this.ionChange = createEvent(this, \"ionChange\", 7);\n this.ionStyle = createEvent(this, \"ionStyle\", 7);\n this.ionFocus = createEvent(this, \"ionFocus\", 7);\n this.ionBlur = createEvent(this, \"ionBlur\", 7);\n }\n class_1.prototype.debounceChanged = function () {\n this.ionChange = debounceEvent(this.ionChange, this.debounce);\n };\n class_1.prototype.minChanged = function () {\n if (!this.noUpdate) {\n this.updateRatio();\n }\n };\n class_1.prototype.maxChanged = function () {\n if (!this.noUpdate) {\n this.updateRatio();\n }\n };\n class_1.prototype.disabledChanged = function () {\n if (this.gesture) {\n this.gesture.setDisabled(this.disabled);\n }\n this.emitStyle();\n };\n class_1.prototype.valueChanged = function (value) {\n if (!this.noUpdate) {\n this.updateRatio();\n }\n value = this.ensureValueInBounds(value);\n this.ionChange.emit({ value: value });\n };\n class_1.prototype.connectedCallback = function () {\n this.updateRatio();\n this.debounceChanged();\n this.disabledChanged();\n };\n class_1.prototype.disconnectedCallback = function () {\n if (this.gesture) {\n this.gesture.destroy();\n this.gesture = undefined;\n }\n };\n class_1.prototype.componentDidLoad = function () {\n return __awaiter(this, void 0, void 0, function () {\n var rangeSlider, _a;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n rangeSlider = this.rangeSlider;\n if (!rangeSlider) return [3 /*break*/, 2];\n _a = this;\n return [4 /*yield*/, import('./index-624eea58.js')];\n case 1:\n _a.gesture = (_b.sent()).createGesture({\n el: rangeSlider,\n gestureName: 'range',\n gesturePriority: 100,\n threshold: 0,\n onStart: function (ev) { return _this.onStart(ev); },\n onMove: function (ev) { return _this.onMove(ev); },\n onEnd: function (ev) { return _this.onEnd(ev); },\n });\n this.gesture.setDisabled(this.disabled);\n _b.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n class_1.prototype.getValue = function () {\n var value = this.value || 0;\n if (this.dualKnobs) {\n if (typeof value === 'object') {\n return value;\n }\n return {\n lower: 0,\n upper: value\n };\n }\n else {\n if (typeof value === 'object') {\n return value.upper;\n }\n return value;\n }\n };\n class_1.prototype.emitStyle = function () {\n this.ionStyle.emit({\n 'interactive': true,\n 'interactive-disabled': this.disabled\n });\n };\n class_1.prototype.onStart = function (detail) {\n var rect = this.rect = this.rangeSlider.getBoundingClientRect();\n var currentX = detail.currentX;\n // figure out which knob they started closer to\n var ratio = clamp(0, (currentX - rect.left) / rect.width, 1);\n if (document.dir === 'rtl') {\n ratio = 1 - ratio;\n }\n this.pressedKnob =\n !this.dualKnobs ||\n Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio)\n ? 'A'\n : 'B';\n this.setFocus(this.pressedKnob);\n // update the active knob's position\n this.update(currentX);\n };\n class_1.prototype.onMove = function (detail) {\n this.update(detail.currentX);\n };\n class_1.prototype.onEnd = function (detail) {\n this.update(detail.currentX);\n this.pressedKnob = undefined;\n };\n class_1.prototype.update = function (currentX) {\n // figure out where the pointer is currently at\n // update the knob being interacted with\n var rect = this.rect;\n var ratio = clamp(0, (currentX - rect.left) / rect.width, 1);\n if (document.dir === 'rtl') {\n ratio = 1 - ratio;\n }\n if (this.snaps) {\n // snaps the ratio to the current value\n ratio = valueToRatio(ratioToValue(ratio, this.min, this.max, this.step), this.min, this.max);\n }\n // update which knob is pressed\n if (this.pressedKnob === 'A') {\n this.ratioA = ratio;\n }\n else {\n this.ratioB = ratio;\n }\n // Update input value\n this.updateValue();\n };\n Object.defineProperty(class_1.prototype, \"valA\", {\n get: function () {\n return ratioToValue(this.ratioA, this.min, this.max, this.step);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1.prototype, \"valB\", {\n get: function () {\n return ratioToValue(this.ratioB, this.min, this.max, this.step);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1.prototype, \"ratioLower\", {\n get: function () {\n if (this.dualKnobs) {\n return Math.min(this.ratioA, this.ratioB);\n }\n return 0;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1.prototype, \"ratioUpper\", {\n get: function () {\n if (this.dualKnobs) {\n return Math.max(this.ratioA, this.ratioB);\n }\n return this.ratioA;\n },\n enumerable: true,\n configurable: true\n });\n class_1.prototype.updateRatio = function () {\n var value = this.getValue();\n var _a = this, min = _a.min, max = _a.max;\n if (this.dualKnobs) {\n this.ratioA = valueToRatio(value.lower, min, max);\n this.ratioB = valueToRatio(value.upper, min, max);\n }\n else {\n this.ratioA = valueToRatio(value, min, max);\n }\n };\n class_1.prototype.updateValue = function () {\n this.noUpdate = true;\n var _a = this, valA = _a.valA, valB = _a.valB;\n this.value = !this.dualKnobs\n ? valA\n : {\n lower: Math.min(valA, valB),\n upper: Math.max(valA, valB)\n };\n this.noUpdate = false;\n };\n class_1.prototype.setFocus = function (knob) {\n if (this.el.shadowRoot) {\n var knobEl = this.el.shadowRoot.querySelector(knob === 'A' ? '.range-knob-a' : '.range-knob-b');\n if (knobEl) {\n knobEl.focus();\n }\n }\n };\n class_1.prototype.render = function () {\n var _a, _b;\n var _this = this;\n var _c = this, min = _c.min, max = _c.max, step = _c.step, el = _c.el, handleKeyboard = _c.handleKeyboard, pressedKnob = _c.pressedKnob, disabled = _c.disabled, pin = _c.pin, ratioLower = _c.ratioLower, ratioUpper = _c.ratioUpper;\n var mode = getIonMode(this);\n var barStart = ratioLower * 100 + \"%\";\n var barEnd = 100 - ratioUpper * 100 + \"%\";\n var doc = document;\n var isRTL = doc.dir === 'rtl';\n var start = isRTL ? 'right' : 'left';\n var end = isRTL ? 'left' : 'right';\n var tickStyle = function (tick) {\n var _a;\n return _a = {},\n _a[start] = tick[start],\n _a;\n };\n var barStyle = (_a = {},\n _a[start] = barStart,\n _a[end] = barEnd,\n _a);\n var ticks = [];\n if (this.snaps && this.ticks) {\n for (var value = min; value <= max; value += step) {\n var ratio = valueToRatio(value, min, max);\n var tick = {\n ratio: ratio,\n active: ratio >= ratioLower && ratio <= ratioUpper,\n };\n tick[start] = ratio * 100 + \"%\";\n ticks.push(tick);\n }\n }\n renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);\n return (h(Host, { onFocusin: this.onFocus, onFocusout: this.onBlur, class: Object.assign(Object.assign({}, createColorClasses(this.color)), (_b = {}, _b[mode] = true, _b['in-item'] = hostContext('ion-item', el), _b['range-disabled'] = disabled, _b['range-pressed'] = pressedKnob !== undefined, _b['range-has-pin'] = pin, _b)) }, h(\"slot\", { name: \"start\" }), h(\"div\", { class: \"range-slider\", ref: function (rangeEl) { return _this.rangeSlider = rangeEl; } }, ticks.map(function (tick) { return (h(\"div\", { style: tickStyle(tick), role: \"presentation\", class: {\n 'range-tick': true,\n 'range-tick-active': tick.active\n } })); }), h(\"div\", { class: \"range-bar\", role: \"presentation\" }), h(\"div\", { class: \"range-bar range-bar-active\", role: \"presentation\", style: barStyle }), renderKnob(isRTL, {\n knob: 'A',\n pressed: pressedKnob === 'A',\n value: this.valA,\n ratio: this.ratioA,\n pin: pin,\n disabled: disabled,\n handleKeyboard: handleKeyboard,\n min: min,\n max: max\n }), this.dualKnobs && renderKnob(isRTL, {\n knob: 'B',\n pressed: pressedKnob === 'B',\n value: this.valB,\n ratio: this.ratioB,\n pin: pin,\n disabled: disabled,\n handleKeyboard: handleKeyboard,\n min: min,\n max: max\n })), h(\"slot\", { name: \"end\" })));\n };\n Object.defineProperty(class_1.prototype, \"el\", {\n get: function () { return getElement(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"watchers\", {\n get: function () {\n return {\n \"debounce\": [\"debounceChanged\"],\n \"min\": [\"minChanged\"],\n \"max\": [\"maxChanged\"],\n \"disabled\": [\"disabledChanged\"],\n \"value\": [\"valueChanged\"]\n };\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"style\", {\n get: function () { return \":host{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family,inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.range-disabled){pointer-events:none}::slotted(ion-label){-ms-flex:initial;flex:initial}::slotted(ion-icon[slot]){font-size:24px}.range-slider{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab;-ms-touch-action:pan-y;touch-action:pan-y}:host(.range-pressed) .range-slider{cursor:-webkit-grabbing;cursor:grabbing}.range-pin{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);-webkit-box-sizing:border-box;box-sizing:border-box}.range-knob-handle{left:0;top:calc((var(--height) - var(--knob-handle-size)) / 2);margin-left:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}:host-context([dir=rtl]) .range-knob-handle,[dir=rtl] .range-knob-handle{right:unset;right:0}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.range-knob-handle{margin-left:unset;-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2)}}:host-context([dir=rtl]) .range-knob-handle,[dir=rtl] .range-knob-handle{left:unset}.range-knob-handle:active,.range-knob-handle:focus{outline:none}.range-bar{border-radius:var(--bar-border-radius);left:0;top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}:host-context([dir=rtl]) .range-bar,[dir=rtl] .range-bar{right:unset;right:0;left:unset}.range-knob{border-radius:var(--knob-border-radius);left:calc(50% - var(--knob-size) / 2);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}:host-context([dir=rtl]) .range-knob,[dir=rtl] .range-knob{right:unset;right:calc(50% - var(--knob-size) / 2);left:unset}:host(.range-pressed) .range-bar-active{will-change:left,right}:host(.in-item){width:100%}:host(.in-item) ::slotted(ion-label){-ms-flex-item-align:center;align-self:center}:host{--knob-border-radius:50%;--knob-background:#fff;--knob-box-shadow:0 3px 1px rgba(0,0,0,0.1),0 4px 8px rgba(0,0,0,0.13),0 0 0 1px rgba(0,0,0,0.02);--knob-size:28px;--bar-height:2px;--bar-background:rgba(var(--ion-text-color-rgb,0,0,0),0.1);--bar-background-active:var(--ion-color-primary,#3880ff);--bar-border-radius:0;--height:42px;padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:8px}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host(.ion-color) .range-bar-active,:host(.ion-color) .range-tick-active{background:var(--ion-color-base)}::slotted([slot=start]){margin-left:0;margin-right:16px;margin-top:0;margin-bottom:0}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}}::slotted([slot=end]){margin-left:16px;margin-right:0;margin-top:0;margin-bottom:0}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){::slotted([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}}:host(.range-has-pin){padding-top:20px}.range-bar-active{bottom:0;width:auto;background:var(--bar-background-active)}.range-tick{margin-left:-1px;border-radius:0;position:absolute;top:18px;width:2px;height:8px;background:rgba(var(--ion-text-color-rgb,0,0,0),.1);pointer-events:none}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.range-tick{margin-left:unset;-webkit-margin-start:-1px;margin-inline-start:-1px}}.range-tick-active{background:var(--bar-background-active)}.range-pin{-webkit-transform:translate3d(0,28px,0) scale(.01);transform:translate3d(0,28px,0) scale(.01);padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;display:inline-block;position:relative;top:-20px;min-width:28px;-webkit-transition:-webkit-transform .12s ease;transition:-webkit-transform .12s ease;transition:transform .12s ease;transition:transform .12s ease,-webkit-transform .12s ease;background:transparent;color:var(--ion-text-color,#000);font-size:12px;text-align:center}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.range-pin{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.range-knob-pressed .range-pin{-webkit-transform:translateZ(0) scale(1);transform:translateZ(0) scale(1)}:host(.range-disabled){opacity:.5}\"; },\n enumerable: true,\n configurable: true\n });\n return class_1;\n}());\nvar renderKnob = function (isRTL, _a) {\n var knob = _a.knob, value = _a.value, ratio = _a.ratio, min = _a.min, max = _a.max, disabled = _a.disabled, pressed = _a.pressed, pin = _a.pin, handleKeyboard = _a.handleKeyboard;\n var start = isRTL ? 'right' : 'left';\n var knobStyle = function () {\n var style = {};\n style[start] = ratio * 100 + \"%\";\n return style;\n };\n return (h(\"div\", { onKeyDown: function (ev) {\n var key = ev.key;\n if (key === 'ArrowLeft' || key === 'ArrowDown') {\n handleKeyboard(knob, false);\n ev.preventDefault();\n ev.stopPropagation();\n }\n else if (key === 'ArrowRight' || key === 'ArrowUp') {\n handleKeyboard(knob, true);\n ev.preventDefault();\n ev.stopPropagation();\n }\n }, class: {\n 'range-knob-handle': true,\n 'range-knob-a': knob === 'A',\n 'range-knob-b': knob === 'B',\n 'range-knob-pressed': pressed,\n 'range-knob-min': value === min,\n 'range-knob-max': value === max\n }, style: knobStyle(), role: \"slider\", tabindex: disabled ? -1 : 0, \"aria-valuemin\": min, \"aria-valuemax\": max, \"aria-disabled\": disabled ? 'true' : null, \"aria-valuenow\": value }, pin && h(\"div\", { class: \"range-pin\", role: \"presentation\" }, Math.round(value)), h(\"div\", { class: \"range-knob\", role: \"presentation\" })));\n};\nvar ratioToValue = function (ratio, min, max, step) {\n var value = (max - min) * ratio;\n if (step > 0) {\n value = Math.round(value / step) * step + min;\n }\n return clamp(min, value, max);\n};\nvar valueToRatio = function (value, min, max) {\n return clamp(0, (value - min) / (max - min), 1);\n};\nexport { Range as ion_range };\n"],"sourceRoot":""}