!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=191)}([function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";e.exports=n(66)},function(e,t,n){var r=n(37),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(7),o=n(87),a=n(88),i="[object Null]",u="[object Undefined]",s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?u:i:s&&s in Object(e)?o(e):a(e)}},function(e,t,n){var r=n(113),o=n(116);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(2).Symbol;e.exports=r},function(e,t,n){var r=n(39),o=n(95),a=n(11);e.exports=function(e){return a(e)?r(e):o(e)}},function(e,t,n){e.exports=n(68)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(71);Object.defineProperty(t,"captialize",{enumerable:!0,get:function(){return l(r).default}});var o=n(72);Object.defineProperty(t,"clamp",{enumerable:!0,get:function(){return l(o).default}});var a=n(73);Object.defineProperty(t,"distanceTo",{enumerable:!0,get:function(){return l(a).default}});var i=n(74);Object.defineProperty(t,"isDefined",{enumerable:!0,get:function(){return l(i).default}});var u=n(75);Object.defineProperty(t,"isNumber",{enumerable:!0,get:function(){return l(u).default}});var s=n(76);Object.defineProperty(t,"isObject",{enumerable:!0,get:function(){return l(s).default}});var c=n(77);function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"length",{enumerable:!0,get:function(){return l(c).default}})},function(e,t,n){var r=n(44),o=n(23);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(103),o=n(104),a=n(105),i=n(106),u=n(107);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=n}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(37),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,u=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=u}).call(this,n(22)(e))},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(43)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(12),o=n(108),a=n(109),i=n(110),u=n(111),s=n(112);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=u,c.prototype.set=s,e.exports=c},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(5)(n(2),"Map");e.exports=r},function(e,t,n){var r=n(117),o=n(124),a=n(126),i=n(127),u=n(128);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&ep))return!1;var h=l.get(e);if(h&&l.get(t))return h==t;var v=-1,y=!0,m=n&u?new r:void 0;for(l.set(e,t),l.set(t,e);++v1?t-1:0),i=1;i=this.props.step||(0,v.length)(e.max,t.max)>=this.props.step}},{key:"isMultiValue",value:function(){return(0,v.isObject)(this.props.value)}},{key:"isWithinRange",value:function(e){return this.isMultiValue()?e.min>=this.props.minValue&&e.max<=this.props.maxValue&&this.props.allowSameValues?e.min<=e.max:e.min=this.props.minValue&&e.max<=this.props.maxValue}},{key:"shouldUpdate",value:function(e){return this.isWithinRange(e)&&this.hasStepDifference(e)}},{key:"updatePosition",value:function(e,t){var n=s.getValueFromProps(this.props,this.isMultiValue()),r=s.getPositionsFromValues(n,this.props.minValue,this.props.maxValue,this.getTrackClientRect());r[e]=t,this.lastKeyMoved=e,this.updatePositions(r)}},{key:"updatePositions",value:function(e){var t={min:s.getValueFromPosition(e.min,this.props.minValue,this.props.maxValue,this.getTrackClientRect()),max:s.getValueFromPosition(e.max,this.props.minValue,this.props.maxValue,this.getTrackClientRect())},n={min:s.getStepValueFromValue(t.min,this.props.step),max:s.getStepValueFromValue(t.max,this.props.step)};this.updateValues(n)}},{key:"updateValue",value:function(e,t){var n=s.getValueFromProps(this.props,this.isMultiValue());n[e]=t,this.updateValues(n)}},{key:"updateValues",value:function(e){this.shouldUpdate(e)&&this.props.onChange(this.isMultiValue()?e:e.max)}},{key:"incrementValue",value:function(e){var t=s.getValueFromProps(this.props,this.isMultiValue())[e]+this.props.step;this.updateValue(e,t)}},{key:"decrementValue",value:function(e){var t=s.getValueFromProps(this.props,this.isMultiValue())[e]-this.props.step;this.updateValue(e,t)}},{key:"addDocumentMouseUpListener",value:function(){this.removeDocumentMouseUpListener(),this.node.ownerDocument.addEventListener("mouseup",this.handleMouseUp)}},{key:"addDocumentTouchEndListener",value:function(){this.removeDocumentTouchEndListener(),this.node.ownerDocument.addEventListener("touchend",this.handleTouchEnd)}},{key:"removeDocumentMouseUpListener",value:function(){this.node.ownerDocument.removeEventListener("mouseup",this.handleMouseUp)}},{key:"removeDocumentTouchEndListener",value:function(){this.node.ownerDocument.removeEventListener("touchend",this.handleTouchEnd)}},{key:"handleSliderDrag",value:function(e,t){var n=this;if(!this.props.disabled){var r=s.getPositionFromEvent(e,this.getTrackClientRect());this.isSliderDragging=!0,requestAnimationFrame((function(){return n.updatePosition(t,r)}))}}},{key:"handleTrackDrag",value:function(e,t){if(!this.props.disabled&&this.props.draggableTrack&&!this.isSliderDragging){var n=this.props,r=n.maxValue,o=n.minValue,a=n.value,i=a.max,u=a.min,c=s.getPositionFromEvent(e,this.getTrackClientRect()),l=s.getValueFromPosition(c,o,r,this.getTrackClientRect()),f=s.getStepValueFromValue(l,this.props.step),p=s.getPositionFromEvent(t,this.getTrackClientRect()),d=s.getValueFromPosition(p,o,r,this.getTrackClientRect()),h=s.getStepValueFromValue(d,this.props.step)-f,v={min:u-h,max:i-h};this.updateValues(v)}}},{key:"handleSliderKeyDown",value:function(e,t){if(!this.props.disabled)switch(e.keyCode){case y.LEFT_ARROW:case y.DOWN_ARROW:e.preventDefault(),this.decrementValue(t);break;case y.RIGHT_ARROW:case y.UP_ARROW:e.preventDefault(),this.incrementValue(t)}}},{key:"handleTrackMouseDown",value:function(e,t){if(!this.props.disabled){var n=this.props,r=n.maxValue,o=n.minValue,a=n.value,i=a.max,u=a.min;e.preventDefault();var c=s.getValueFromPosition(t,o,r,this.getTrackClientRect()),l=s.getStepValueFromValue(c,this.props.step);(!this.props.draggableTrack||l>i||lT.length&&T.push(e)}function R(e,t,n){return null==e?0:function e(t,n,r,o){var u=typeof t;"undefined"!==u&&"boolean"!==u||(t=null);var s=!1;if(null===t)s=!0;else switch(u){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case a:case i:s=!0}}if(s)return r(o,t,""===n?"."+L(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c=t)return new Error('"minValue" must be smaller than "maxValue"')};var r=n(10);e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=e.maxValue,o=e.minValue,a=e[t];if(!((0,r.isNumber)(a)||(0,r.isObject)(a)&&(0,r.isNumber)(a.min)&&(0,r.isNumber)(a.max)))return new Error('"'+t+'" must be a number or a range object');if((0,r.isNumber)(a)&&(an))return new Error('"'+t+'" must be in between "minValue" and "maxValue"');if((0,r.isObject)(a)&&(a.minn||a.maxn))return new Error('"'+t+'" must be in between "minValue" and "maxValue"')};var r=n(10);e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[],n=[];return(0,i.default)(t,(function(t){Array.isArray(t)?e(t).map((function(e){return n.push(e)})):(0,a.default)(t)?(0,o.default)(t,(function(e,t){!0===e&&n.push(t),n.push(t+"-"+e)})):(0,r.default)(t)&&n.push(t)})),n};t.default=s},function(e,t,n){var r=n(4),o=n(0),a=n(3),i="[object String]";e.exports=function(e){return"string"==typeof e||!o(e)&&a(e)&&r(e)==i}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(7),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[u]=n:delete e[u]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(90)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,a=Object(t),i=r(t),u=i.length;u--;){var s=i[e?u:++o];if(!1===n(a[s],s,a))break}return t}}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n-1}},function(e,t,n){var r=n(13);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(12);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(12),o=n(30),a=n(31),i=200;e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var u=n.__data__;if(!o||u.length1&&void 0!==arguments[1]?arguments[1]:[],n=e.default&&(0,o.default)(e.default)||{};return t.map((function(t){var o=e[t];return o&&(0,r.default)(o,(function(e,t){n[t]||(n[t]={}),n[t]=a({},n[t],o[t])})),t})),n};t.default=u},function(e,t,n){var r=n(163),o=1,a=4;e.exports=function(e){return r(e,o|a)}},function(e,t,n){var r=n(28),o=n(164),a=n(59),i=n(166),u=n(167),s=n(170),c=n(171),l=n(172),f=n(173),p=n(51),d=n(174),h=n(16),v=n(175),y=n(176),m=n(181),b=n(0),g=n(21),x=n(183),O=n(6),_=n(185),j=n(8),w=1,S=2,k=4,P="[object Arguments]",M="[object Function]",D="[object GeneratorFunction]",E="[object Object]",T={};T[P]=T["[object Array]"]=T["[object ArrayBuffer]"]=T["[object DataView]"]=T["[object Boolean]"]=T["[object Date]"]=T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Map]"]=T["[object Number]"]=T[E]=T["[object RegExp]"]=T["[object Set]"]=T["[object String]"]=T["[object Symbol]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T["[object Error]"]=T[M]=T["[object WeakMap]"]=!1,e.exports=function e(t,n,V,C,R,L){var A,N=n&w,F=n&S,U=n&k;if(V&&(A=R?V(t,C,R,L):V(t)),void 0!==A)return A;if(!O(t))return t;var I=b(t);if(I){if(A=v(t),!N)return c(t,A)}else{var z=h(t),B=z==M||z==D;if(g(t))return s(t,N);if(z==E||z==P||B&&!R){if(A=F||B?{}:m(t),!N)return F?f(t,u(A,t)):l(t,i(A,t))}else{if(!T[z])return R?t:{};A=y(t,z,N)}}L||(L=new r);var K=L.get(t);if(K)return K;L.set(t,A),_(t)?t.forEach((function(r){A.add(e(r,n,V,r,t,L))})):x(t)&&t.forEach((function(r,o){A.set(o,e(r,n,V,o,t,L))}));var W=U?F?d:p:F?keysIn:j,$=I?void 0:W(t);return o($||t,(function(r,o){$&&(r=t[o=r]),a(A,o,e(r,n,V,o,t,L))})),A}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var n,a,c;u(this,r);for(var l=arguments.length,f=Array(l),p=0;p1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var n,a,c;u(this,r);for(var l=arguments.length,f=Array(l),p=0;p1&&void 0!==arguments[1])||arguments[1];n[e]=t};return 0===e&&r("first-child"),e===t-1&&r("last-child"),(0===e||e%2==0)&&r("even"),1===Math.abs(e%2)&&r("odd"),r("nth-child",e),n}},function(e,t,n){"use strict";n.r(t);var r=n(63),o=n.n(r),a=n(64),i=n.n(a),u=n(1),s=n.n(u);function c(e,t){for(var n=0;n1&&void 0!==arguments[1])||arguments[1],n="-"===e[0],r=n&&t,o=(e=e.replace("-","")).split(".");return{beforeDecimal:o[0],afterDecimal:o[1]||"",hasNagation:n,addNegation:r}}function _(e,t,n){for(var r="",o=n?"0":"",a=0;a<=t-1;a++)r+=e[a]||o;return r}function j(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function w(e,t,n){return Math.min(Math.max(e,t),n)}function S(e){return Math.max(e.selectionStart,e.selectionEnd)}var k={thousandSeparator:m.oneOfType([m.string,m.oneOf([!0])]),decimalSeparator:m.string,allowedDecimalSeparators:m.arrayOf(m.string),thousandsGroupStyle:m.oneOf(["thousand","lakh","wan"]),decimalScale:m.number,fixedDecimalScale:m.bool,displayType:m.oneOf(["input","text"]),prefix:m.string,suffix:m.string,format:m.oneOfType([m.string,m.func]),removeFormatting:m.func,mask:m.oneOfType([m.string,m.arrayOf(m.string)]),value:m.oneOfType([m.number,m.string]),defaultValue:m.oneOfType([m.number,m.string]),isNumericString:m.bool,customInput:m.elementType,allowNegative:m.bool,allowEmptyFormatting:m.bool,allowLeadingZeros:m.bool,onValueChange:m.func,onKeyDown:m.func,onMouseUp:m.func,onChange:m.func,onFocus:m.func,onBlur:m.func,type:m.oneOf(["text","tel","password"]),isAllowed:m.func,renderText:m.func,getInputRef:m.func},P={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:b,onChange:b,onKeyDown:b,onMouseUp:b,onFocus:b,onBlur:b,isAllowed:function(){return!0}},M=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?d(e):t}(this,f(t).call(this,e));var r=e.defaultValue;n.validateProps();var o=n.formatValueProp(r);return n.state={value:o,numAsString:n.removeFormatting(o)},n.selectionBeforeInput={selectionStart:0,selectionEnd:0},n.onChange=n.onChange.bind(d(d(n))),n.onKeyDown=n.onKeyDown.bind(d(d(n))),n.onMouseUp=n.onMouseUp.bind(d(d(n))),n.onFocus=n.onFocus.bind(d(d(n))),n.onBlur=n.onBlur.bind(d(d(n))),n}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),n=t,(r=[{key:"componentDidUpdate",value:function(e){this.updateValueIfRequired(e)}},{key:"updateValueIfRequired",value:function(e){var t=this.props,n=this.state,r=this.focusedElm,o=n.value,a=n.numAsString,i=void 0===a?"":a;if(e!==t){this.validateProps();var u=this.formatNumString(i),s=void 0===t.value?u:this.formatValueProp(),c=this.removeFormatting(s),l=parseFloat(c),f=parseFloat(i);(isNaN(l)&&isNaN(f)||l===f)&&u===o&&(null!==r||s===o)||this.updateValue({formattedValue:s,numAsString:c,input:r})}}},{key:"getFloatString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.decimalScale,n=this.getSeparators(),r=n.decimalSeparator,o=this.getNumberRegex(!0),a="-"===e[0];a&&(e=e.replace("-","")),r&&0===t&&(e=e.split(r)[0]);var i=(e=(e.match(o)||[]).join("").replace(r,".")).indexOf(".");return-1!==i&&(e="".concat(e.substring(0,i),".").concat(e.substring(i+1,e.length).replace(new RegExp(x(r),"g"),""))),a&&(e="-"+e),e}},{key:"getNumberRegex",value:function(e,t){var n=this.props,r=n.format,o=n.decimalScale,a=this.getSeparators().decimalSeparator;return new RegExp("\\d"+(!a||0===o||t||r?"":"|"+x(a)),e?"g":void 0)}},{key:"getSeparators",value:function(){var e=this.props.decimalSeparator,t=this.props,n=t.thousandSeparator,r=t.allowedDecimalSeparators;return!0===n&&(n=","),r||(r=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:r}}},{key:"getMaskAtIndex",value:function(e){var t=this.props.mask,n=void 0===t?" ":t;return"string"==typeof n?n:n[e]||" "}},{key:"getValueObject",value:function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}}},{key:"validateProps",value:function(){var e=this.props.mask,t=this.getSeparators(),n=t.decimalSeparator,r=t.thousandSeparator;if(n===r)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: ".concat(r,' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: ').concat(n," (default value for decimalSeparator is .)\n "));if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n Mask ".concat(e," should not contain numeric character;\n "))}},{key:"setPatchedCaretPosition",value:function(e,t,n){j(e,t),setTimeout((function(){e.value===n&&j(e,t)}),0)}},{key:"correctCaretPosition",value:function(e,t,n){var r=this.props,o=r.prefix,a=r.suffix,i=r.format;if(""===e)return 0;if(t=w(t,0,e.length),!i){var u="-"===e[0];return w(t,o.length+(u?1:0),e.length-a.length)}if("function"==typeof i)return t;if("#"===i[t]&&g(e[t]))return t;if("#"===i[t-1]&&g(e[t-1]))return t;var s=i.indexOf("#");t=w(t,s,i.lastIndexOf("#")+1);for(var c=i.substring(t,i.length).indexOf("#"),l=t,f=t+(-1===c?0:c);l>s&&("#"!==i[l]||!g(e[l]));)l-=1;return!g(e[f])||"left"===n&&t!==s||t-l0&&void 0!==arguments[0]?arguments[0]:"",t=this.props,n=t.format,r=t.allowEmptyFormatting,o=e;return o=""!==e||r?"-"!==e||n?"string"==typeof n?this.formatWithPattern(o):"function"==typeof n?n(o):this.formatAsNumber(o):"-":""}},{key:"formatValueProp",value:function(e){var t=this.props,n=t.format,r=t.decimalScale,o=t.fixedDecimalScale,a=t.allowEmptyFormatting,i=this.props,u=i.value,s=void 0===u?e:u,c=i.isNumericString,l=!s&&0!==s;return l&&a&&(s=""),l&&!a?"":("number"==typeof s&&(s=s.toString(),c=!0),"Infinity"===s&&c&&(s=""),c&&!n&&"number"==typeof r&&(s=function(e,t,n){if(-1!==["","-"].indexOf(e))return e;var r=-1!==e.indexOf(".")&&t,o=O(e),a=o.beforeDecimal,i=o.afterDecimal,u=o.hasNagation,s=parseFloat("0.".concat(i||"0")).toFixed(t).split("."),c=a.split("").reverse().reduce((function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),s[0]),l=_(s[1]||"",Math.min(t,i.length),n),f=r?".":"";return"".concat(u?"-":"").concat(c).concat(f).concat(l)}(s,r,o)),c?this.formatNumString(s):this.formatInput(s))}},{key:"formatNegation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.allowNegative,n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),a=r.test(e);return e=e.replace(/-/g,""),o&&!a&&t&&(e="-"+e),e}},{key:"formatInput",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.props.format;return t||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)}},{key:"isCharacterAFormat",value:function(e,t){var n=this.props,r=n.format,o=n.prefix,a=n.suffix,i=n.decimalScale,u=n.fixedDecimalScale,s=this.getSeparators().decimalSeparator;return"string"==typeof r&&"#"!==r[e]||!(r||!(e=t.length-a.length||i&&u&&t[e]===s))}},{key:"checkIfFormatGotDeleted",value:function(e,t,n){for(var r=e;rn&&o-r>n;)r++;return{start:n,end:o-r}}(t,n),y=v.start,m=v.end;if(!o&&y===m&&-1!==c.indexOf(n[d]))return n.substr(0,d)+l+n.substr(d+1,n.length);var b=o?0:i.length,g=t.length-(o?0:u.length);if(n.length>t.length||!n.length||y===m||0===d&&h===t.length||d===b&&h===g)return n;if(this.checkIfFormatGotDeleted(y,m,t)&&(n=t),!o){var x=this.removeFormatting(n),_=O(x,a),j=_.beforeDecimal,w=_.afterDecimal,S=_.addNegation,k=e1&&void 0!==arguments[1]?arguments[1]:b,r=e.formattedValue,o=e.input,a=e.numAsString,i=e.caretPos,u=this.props.onValueChange,s=this.state.value;if(o){if(!i){var c=e.inputValue||o.value,l=S(o);i=this.getCaretPosition(c,r,l)}o.value=r,this.setPatchedCaretPosition(o,i,r)}void 0===a&&(a=this.removeFormatting(r)),r!==s?this.setState({value:r,numAsString:a},(function(){u(t.getValueObject(r,a)),n()})):n()}},{key:"onChange",value:function(e){e.persist();var t=e.target,n=t.value,r=this.state,o=this.props,a=o.isAllowed,i=r.value||"",u=S(t);n=this.correctInputValue(u,i,n);var s=this.formatInput(n)||"",c=this.removeFormatting(s);a(this.getValueObject(s,c))||(s=i),this.updateValue({formattedValue:s,numAsString:c,inputValue:n,input:t},(function(){o.onChange(e)}))}},{key:"onBlur",value:function(e){var t=this.props,n=this.state,r=t.format,o=t.onBlur,a=t.allowLeadingZeros,i=n.numAsString,u=n.value;if(this.focusedElm=null,this.focusTimeout&&clearTimeout(this.focusTimeout),!r){a||(i=function(e){if(!e)return e;var t="-"===e[0];t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return"".concat(t?"-":"").concat(r).concat(o?".".concat(o):"")}(i));var s=this.formatNumString(i);if(s!==u)return e.persist(),void this.updateValue({formattedValue:s,numAsString:i},(function(){o(e)}))}o(e)}},{key:"onKeyDown",value:function(e){var t,n=e.target,r=e.key,o=n.selectionStart,a=n.selectionEnd,i=n.value,u=void 0===i?"":i,s=this.props,c=s.decimalScale,l=s.fixedDecimalScale,f=s.prefix,p=s.suffix,d=s.format,h=s.onKeyDown,v=(s.onValueChange,void 0!==c&&l),y=this.getNumberRegex(!1,v),m=new RegExp("-"),b="string"==typeof d;if(this.selectionBeforeInput={selectionStart:o,selectionEnd:a},"ArrowLeft"===r||"Backspace"===r?t=o-1:"ArrowRight"===r?t=o+1:"Delete"===r&&(t=o),void 0!==t&&o===a){var g=t,x=b?d.indexOf("#"):f.length,O=b?d.lastIndexOf("#")+1:u.length-p.length;if("ArrowLeft"===r||"ArrowRight"===r){var _="ArrowLeft"===r?"left":"right";g=this.correctCaretPosition(u,t,_)}else if("Delete"!==r||y.test(u[t])||m.test(u[t])){if("Backspace"===r&&!y.test(u[t]))if(o<=x+1&&"-"===u[0]&&void 0===d){var j=u.substring(1);e.persist(),this.updateValue({formattedValue:j,caretPos:g,input:n})}else if(!m.test(u[t])){for(;!y.test(u[g-1])&&g>x;)g--;g=this.correctCaretPosition(u,g,"left")}}else for(;!y.test(u[g])&&gO)&&(e.preventDefault(),this.setPatchedCaretPosition(n,g,u)),e.isUnitTestRun&&this.setPatchedCaretPosition(n,g,u),this.props.onKeyDown(e)}else h(e)}},{key:"onMouseUp",value:function(e){var t=e.target,n=t.selectionStart,r=t.selectionEnd,o=t.value,a=void 0===o?"":o;if(n===r){var i=this.correctCaretPosition(a,n);i!==n&&this.setPatchedCaretPosition(t,i,a)}this.props.onMouseUp(e)}},{key:"onFocus",value:function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var n=e.target,r=n.selectionStart,o=n.selectionEnd,a=n.value,i=void 0===a?"":a,u=t.correctCaretPosition(i,r);u===r||0===r&&o===i.length||t.setPatchedCaretPosition(n,u,i),t.props.onFocus(e)}),0)}},{key:"render",value:function(){var e,t,n,r=this.props,o=r.type,a=r.displayType,i=r.customInput,u=r.renderText,c=r.getInputRef,f=this.state.value,p=(e=this.props,t=k,n={},Object.keys(e).forEach((function(r){t[r]||(n[r]=e[r])})),n),d=l({},p,{type:o,value:f,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===a)return u?u(f)||null:s.a.createElement("span",l({},p,{ref:c}),f);if(i){var h=i;return s.a.createElement(h,l({},d,{ref:c}))}return s.a.createElement("input",l({},d,{ref:c}))}}])&&c(n.prototype,r),o&&c(n,o),t}(s.a.Component);M.propTypes=k,M.defaultProps=P;var D=M,E=function(e){var t=function(t){var n=Math.pow(10,e.choices.step.toString().split(".")[1]?e.choices.step.toString().split(".")[1].length:0);return Math.round(t*n)/n},n=function(n){return Math.min(e.choices.max,Math.max(e.choices.min,t(n)))};e.choices.min=t(e.choices.min),e.choices.max=t(e.choices.max),e.choices.step=t(e.choices.step),e.choices.prefix=e.choices.prefix||"",e.choices.suffix=e.choices.suffix||"";var r=i()({default:{labelsWrapper:{display:"flex",justifyContent:"space-between",color:"#aaaaaa",fontSize:"10px"},valueLabel:{color:"#555d66",fontWeight:"700",fontSize:"13px"}}});return React.createElement("div",null,React.createElement("label",{className:"customize-control-title"},e.label),React.createElement("span",{className:"description customize-control-description",dangerouslySetInnerHTML:{__html:e.description}}),React.createElement("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),React.createElement("div",{className:"range-input-wrapper"},React.createElement("div",{style:r.labelsWrapper,className:"manual-input-field"},React.createElement("span",null,e.choices.prefix,e.choices.min,e.choices.suffix),React.createElement("span",{style:r.valueLabel},React.createElement(D,{value:n(e.value),displayType:"input",prefix:e.choices.prefix,suffix:e.choices.suffix,onValueChange:function(t){t.formattedValue;var r=t.value;wp.customize.control(e.customizerSetting.id).setting.set(n(r))}})),React.createElement("span",null,e.choices.prefix,e.choices.max,e.choices.suffix)),React.createElement(o.a,{maxValue:e.choices.max,minValue:e.choices.min,step:e.choices.step,value:n(e.value),onChange:function(t){wp.customize.control(e.customizerSetting.id).setting.set(n(t))}})))};function T(){return(T=Object.assign||function(e){for(var t=1;t