PageSourceSearch

https://bezlimit.ru/_next/static/chunks/2434-8802d377de228ac8.js

js bezlimit.ru collected 2026-10-01 15:36:32 UTC 15,752 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkbezlimit=self.webpackChunkbezlimit||[]).push([[2434],{32434:function(t,e,r){var o=r(73884),a=r.n(o);function noop(){}function charIsNumber(t){return!!(t||"").match(/\d/)}function escapeRegExp(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function splitDecimal(t,e){void 0===e&&(e=!0);var r="-"===t[0],o=r&&e,a=(t=t.replace("-","")).split(".");return{beforeDecimal:a[0],afterDecimal:a[1]||"",hasNagation:r,addNegation:o}}function limitToScale(t,e,r){for(var o="",a=r?"0":"",n=0;n<=e-1;n++)o+=t[n]||a;return o}function repeat(t,e){return Array(e+1).join(t)}function setCaretPosition(t,e){if(t.value=t.value,null!==t){if(t.createTextRange){var r=t.createTextRange();return r.move("character",e),r.select(),!0}return t.selectionStart||0===t.selectionStart?(t.focus(),t.setSelectionRange(e,e),!0):(t.focus(),!1)}}function clamp(t,e,r){return Math.min(Math.max(t,e),r)}function getCurrentCaretPosition(t){return Math.max(t.selectionStart,t.selectionEnd)}var n=function(t){function NumberFormat(e){t.call(this,e);var r=e.defaultValue;this.validateProps();var o=this.formatValueProp(r);this.state={value:o,numAsString:this.removeFormatting(o),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return t&&(NumberFormat.__proto__=t),NumberFormat.prototype=Object.create(t&&t.prototype),NumberFormat.prototype.constructor=NumberFormat,NumberFormat.prototype.componentDidMount=function(){this.setState({mounted:!0})},NumberFormat.prototype.componentDidUpdate=function(t){this.updateValueIfRequired(t)},NumberFormat.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},NumberFormat.prototype.updateValueIfRequired=function(t){var e=this.props,r=this.state,o=this.focusedElm,a=r.value,n=r.numAsString;if(void 0===n&&(n=""),t!==e){this.validateProps();var i=this.formatNumString(n),s=null==e.value?i:this.formatValueProp(),u=this.removeFormatting(s),l=parseFloat(u),p=parseFloat(n);(isNaN(l)&&isNaN(p)||l===p)&&i===a&&(null!==o||s===a)||this.updateValue({formattedValue:s,numAsString:u,input:o,source:"prop",event:null})}},NumberFormat.prototype.getFloatString=function(t){void 0===t&&(t="");var e=this.props.decimalScale,r=this.getSeparators().decimalSeparator,o=this.getNumberRegex(!0),a="-"===t[0];a&&(t=t.replace("-","")),r&&0===e&&(t=t.split(r)[0]);var n=(t=(t.match(o)||[]).join("").replace(r,".")).indexOf(".");return -1!==n&&(t=t.substring(0,n)+"."+t.substring(n+1,t.length).replace(RegExp(escapeRegExp(r),"g"),"")),a&&(t="-"+t),t},NumberFormat.prototype.getNumberRegex=function(t,e){var r=this.props,o=r.format,a=r.decimalScale,n=r.customNumerals,i=this.getSeparators().decimalSeparator;return RegExp("[0-9"+(n?n.join(""):"")+"]"+(!i||0===a||e||o?"":"|"+escapeRegExp(i)),t?"g":void 0)},NumberFormat.prototype.getSeparators=function(){var t=this.props.decimalSeparator,e=this.props,r=e.thousandSeparator,o=e.allowedDecimalSeparators;return!0===r&&(r=","),o||(o=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:o}},NumberFormat.prototype.getMaskAtIndex=function(t){var e=this.props.mask;return(void 0===e&&(e=" "),"string"==typeof e)?e:e[t]||" "},NumberFormat.prototype.getValueObject=function(t,e){var r=parseFloat(e);return{formattedValue:t,value:e,floatValue:isNaN(r)?void 0:r}},NumberFormat.prototype.validateProps=function(){var t=this.props.mask,e=this.getSeparators(),r=e.decimalSeparator,o=e.thousandSeparator;if(r===o)throw Error("\n          Decimal separator can't be same as thousand separator.\n          thousandSeparator: "+o+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n          decimalSeparator: '+r+" (default value for decimalSeparator is .)\n       ");if(t&&("string"===t?t:t.toString()).match(/\d/g))throw Error("\n          Mask "+t+" should not contain numeric character;\n        ")},NumberFormat.prototype.setPatchedCaretPosition=function(t,e,r){setCaretPosition(t,e),this.caretPositionTimeout=setTimeout(function(){t.value===r&&setCaretPosition(t,e)},0)},NumberFormat.prototype.correctCaretPosition=function(t,e,r){var o=this.props,a=o.prefix,n=o.suffix,i=o.format;if(""===t)return 0;if(e=clamp(e,0,t.length),!i){var s="-"===t[0];return clamp(e,a.length+(s?1:0),t.length-n.length)}if("function"==typeof i||"#"===i[e]&&charIsNumber(t[e])||"#"===i[e-1]&&charIsNumber(t[e-1]))return e;var u=i.indexOf("#");e=clamp(e,u,i.lastIndexOf("#")+1);for(var l=i.substring(e,i.length).indexOf("#"),p=e,m=e+(-1===l?0:l);p>u&&("#"!==i[p]||!charIsNumber(t[p]));)p-=1;return!charIsNumber(t[m])||"left"===r&&e!==u||e-p<m-e?charIsNumber(t[p])?p+1:p:m},NumberFormat.prototype.getCaretPosition=function(t,e,r){var o,a,n=this.props.format,i=this.state.value,s=this.getNumberRegex(!0),u=(t.match(s)||[]).join(""),l=(e.match(s)||[]).join("");for(a=0,o=0;a<r;a++){var p=t[a]||"",m=e[o]||"";if(!(!p.match(s)&&p!==m||"0"===p&&m.match(s)&&"0"!==m&&u.length!==l.length)){for(;p!==e[o]&&o<e.length;)o++;o++}}return"string"!=typeof n||i||(o=e.length),o=this.correctCaretPosition(e,o)},NumberFormat.prototype.removePrefixAndSuffix=function(t){var e=this.props,r=e.format,o=e.prefix,a=e.suffix;if(!r&&t){var n="-"===t[0];n&&(t=t.substring(1,t.length));var i=(t=o&&0===t.indexOf(o)?t.substring(o.length,t.length):t).lastIndexOf(a);t=a&&-1!==i&&i===t.length-a.length?t.substring(0,i):t,n&&(t="-"+t)}return t},NumberFormat.prototype.removePatternFormatting=function(t){for(var e=this.props.format.split("#").filter(function(t){return""!==t}),r=0,o="",a=0,n=e.length;a<=n;a++){var i=e[a]||"",s=a===n?t.length:t.indexOf(i,r);if(-1===s){o=t;break}o+=t.substring(r,s),r=s+i.length}return(o.match(this.getNumberRegex(!0))||[]).join("")},NumberFormat.prototype.removeFormatting=function(t){var e=this.props,r=e.format,o=e.removeFormatting;return t&&(r?t="string"==typeof r?this.removePatternFormatting(t):"function"==typeof o?o(t):(t.match(this.getNumberRegex(!0))||[]).join(""):(t=this.removePrefixAndSuffix(t),t=this.getFloatString(t))),t},NumberFormat.prototype.formatWithPattern=function(t){for(var e=this.props.format,r=0,o=e.split(""),a=0,n=e.length;a<n;a++)"#"===e[a]&&(o[a]=t[r]||this.getMaskAtIndex(r),r+=1);return o.join("")},NumberFormat.prototype.formatAsNumber=function(t){var e,r,o,a=this.props,n=a.decimalScale,i=a.fixedDecimalScale,s=a.prefix,u=a.suffix,l=a.allowNegative,p=a.thousandsGroupStyle,m=this.getSeparators(),c=m.thousandSeparator,f=m.decimalSeparator,h=-1!==t.indexOf(".")||n&&i,g=splitDecimal(t,l),d=g.beforeDecimal,v=g.afterDecimal,b=g.addNegation;return void 0!==n&&(v=limitToScale(v,n,i)),c&&(e=d,r=function(t){switch(t){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}(p),o=-1===(o=e.search(/[1-9]/))?e.length:o,d=e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+c)),s&&(d=s+d),u&&(v+=u),b&&(d="-"+d),t=d+(h&&f||"")+v},NumberFormat.prototype.formatNumString=function(t){void 0===t&&(t="");var e=this.props,r=e.format,o=e.allowEmptyFormatting,a=e.customNumerals,n=t;if(a&&10===a.length){var i=RegExp("["+a.join("")+"]","g");n=t.replace(i,function(t){return a.indexOf(t).toString()})}return""!==t||o?"-"!==t||r?"string"==typeof r?this.formatWithPattern(n):"function"==typeof r?r(n):this.formatAsNumber(n):"-":""},NumberFormat.prototype.formatValueProp=function(t){var e=this.props,r=e.format,o=e.decimalScale,a=e.fixedDecimalScale,n=e.allowEmptyFormatting,i=this.props,s=i.value,u=i.isNumericString,l=!(s=null==s?t:s)&&0!==s;return(l&&n&&(s=""),l&&!n)?"":("number"==typeof s&&(s=function(t){var e="-"===(t+="")[0]?"-":"";e&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],a=r[1];if(!(a=Number(a)))return e+o;o=o.replace(".","");var n=1+a,i=o.length;return n<0?o="0."+repeat("0",Math.abs(n))+o:n>=i?o+=repeat("0",n-i):o=(o.substring(0,n)||"0")+"."+o.substring(n),e+o}(s),u=!0),"Infinity"===s&&u&&(s=""),u&&!r&&"number"==typeof o&&(s=function(t,e,r){if(-1!==["","-"].indexOf(t))return t;var o=-1!==t.indexOf(".")&&e,a=splitDecimal(t),n=a.beforeDecimal,i=a.afterDecimal,s=a.hasNagation,u=parseFloat("0."+(i||"0")),l=(i.length<=e?"0."+i:u.toFixed(e)).split(".");return(s?"-":"")+n.split("").reverse().reduce(function(t,e,r){return t.length>r?(Number(t[0])+Number(e)).toString()+t.substring(1,t.length):e+t},l[0])+(o?".":"")+limitToScale(l[1]||"",Math.min(e,i.length),r)}(s,o,a)),u?this.formatNumString(s):this.formatInput(s))},NumberFormat.prototype.formatNegation=function(t){void 0===t&&(t="");var e=this.props.allowNegative,r=RegExp("(-)(.)*(-)"),o=/(-)/.test(t),a=r.test(t);return t=t.replace(/-/g,""),o&&!a&&e&&(t="-"+t),t},NumberFormat.prototype.formatInput=function(t){return void 0===t&&(t=""),this.props.format||(t=this.removePrefixAndSuffix(t),t=this.formatNegation(t)),t=this.removeFormatting(t),this.formatNumString(t)},NumberFormat.prototype.isCharacterAFormat=function(t,e){var r=this.props,o=r.format,a=r.prefix,n=r.suffix,i=r.decimalScale,s=r.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof o&&"#"!==o[t]||!o&&(t<a.length||t>=e.length-n.length||!!i&&!!s&&e[t]===u)},NumberFormat.prototype.correctInputValue=function(t,e,r){var o=this,a=this.props,n=a.format,i=a.allowNegative,s=a.prefix,u=a.suffix,l=a.decimalScale,p=this.getSeparators(),m=p.allowedDecimalSeparators,c=p.decimalSeparator,f=this.state.numAsString||"",h=this.selectionBeforeInput,g=h.selectionStart,d=h.selectionEnd,v=function(t,e){for(var r=0,o=0,a=t.length,n=e.length;t[r]===e[r]&&r<a;)r++;for(;t[a-1-o]===e[n-1-o]&&n-o>r&&a-o>r;)o++;return{start:r,end:a-o}}(e,r),b=v.start,S=v.end;if(!n&&b===S&&-1!==m.indexOf(r[g])){var N=0===l?"":c;return r.substr(0,g)+N+r.substr(g+1,r.length)}var y=n?0:s.length,F=e.length-(n?0:u.length);if(r.length>e.length||!r.length||b===S||0===g&&d===e.length||0===b&&S===e.length||g===y&&d===F)return r;var x=e.substr(b,S-b);
1if([].concat(x).find(function(t,r){return o.isCharacterAFormat(r+b,e)})){var P=e.substr(b),w={},C=[];[].concat(P).forEach(function(t,r){o.isCharacterAFormat(r+b,e)?w[r]=t:r>x.length-1&&C.push(t)}),Object.keys(w).forEach(function(t){C.length>t?C.splice(t,0,w[t]):C.push(w[t])}),r=e.substr(0,b)+C.join("")}if(!n){var D=this.removeFormatting(r),V=splitDecimal(D,i),A=V.beforeDecimal,E=V.afterDecimal,O=V.addNegation,I=t<r.indexOf(c)+1;if(D.length<f.length&&I&&""===A&&!parseFloat(E))return O?"-":""}return r},NumberFormat.prototype.updateValue=function(t){var e=t.formattedValue,r=t.input,o=t.setCaretPosition;void 0===o&&(o=!0);var a=t.source,n=t.event,i=t.numAsString,s=t.caretPos,u=this.props.onValueChange,l=this.state.value;if(r){if(void 0===s&&o){var p=t.inputValue||r.value,m=getCurrentCaretPosition(r);r.value=e,s=this.getCaretPosition(p,e,m)}r.value=e,o&&this.setPatchedCaretPosition(r,s,e)}void 0===i&&(i=this.removeFormatting(e)),e!==l&&(this.setState({value:e,numAsString:i}),u(this.getValueObject(e,i),{event:n,source:a}))},NumberFormat.prototype.onChange=function(t){var e=t.target,r=e.value,o=this.state,a=this.props,n=a.isAllowed,i=o.value||"",s=getCurrentCaretPosition(e);r=this.correctInputValue(s,i,r);var u=this.formatInput(r)||"",l=this.removeFormatting(u),p=n(this.getValueObject(u,l));p||(u=i),this.updateValue({formattedValue:u,numAsString:l,inputValue:r,input:e,event:t,source:"event"}),p&&a.onChange(t)},NumberFormat.prototype.onBlur=function(t){var e=this.props,r=this.state,o=e.format,a=e.onBlur,n=e.allowLeadingZeros,i=r.numAsString,s=r.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!o){isNaN(parseFloat(i))&&(i=""),n||(i=function(t){if(!t)return t;var e="-"===t[0];e&&(t=t.substring(1,t.length));var r=t.split("."),o=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(e?"-":"")+o+(a?"."+a:"")}(i));var u=this.formatNumString(i);if(u!==s){this.updateValue({formattedValue:u,numAsString:i,input:t.target,setCaretPosition:!1,event:t,source:"event"}),a(t);return}}a(t)},NumberFormat.prototype.onKeyDown=function(t){var e,r=t.target,o=t.key,a=r.selectionStart,n=r.selectionEnd,i=r.value;void 0===i&&(i="");var s=this.props,u=s.decimalScale,l=s.fixedDecimalScale,p=s.prefix,m=s.suffix,c=s.format,f=s.onKeyDown,h=this.getNumberRegex(!1,void 0!==u&&l),g=/-/,d="string"==typeof c;if(this.selectionBeforeInput={selectionStart:a,selectionEnd:n},"ArrowLeft"===o||"Backspace"===o?e=a-1:"ArrowRight"===o?e=a+1:"Delete"===o&&(e=a),void 0===e||a!==n){f(t);return}var v=e,b=d?c.indexOf("#"):p.length,S=d?c.lastIndexOf("#")+1:i.length-m.length;if("ArrowLeft"===o||"ArrowRight"===o)v=this.correctCaretPosition(i,e,"ArrowLeft"===o?"left":"right");else if("Delete"!==o||h.test(i[e])||g.test(i[e])){if("Backspace"===o&&!h.test(i[e])){if(a<=b+1&&"-"===i[0]&&void 0===c){var N=i.substring(1);this.updateValue({formattedValue:N,caretPos:v,input:r,event:t,source:"event"})}else if(!g.test(i[e])){for(;!h.test(i[v-1])&&v>b;)v--;v=this.correctCaretPosition(i,v,"left")}}}else for(;!h.test(i[v])&&v<S;)v++;(v!==e||e<b||e>S)&&(t.preventDefault(),this.setPatchedCaretPosition(r,v,i)),t.isUnitTestRun&&this.setPatchedCaretPosition(r,v,i),f(t)},NumberFormat.prototype.onMouseUp=function(t){var e=t.target,r=e.selectionStart,o=e.selectionEnd,a=e.value;if(void 0===a&&(a=""),r===o){var n=this.correctCaretPosition(a,r);n!==r&&this.setPatchedCaretPosition(e,n,a)}this.props.onMouseUp(t)},NumberFormat.prototype.onFocus=function(t){var e=this;t.persist(),this.focusedElm=t.target,this.focusTimeout=setTimeout(function(){var r=t.target,o=r.selectionStart,a=r.selectionEnd,n=r.value;void 0===n&&(n="");var i=e.correctCaretPosition(n,o);i===o||0===o&&a===n.length||e.setPatchedCaretPosition(r,i,n),e.props.onFocus(t)},0)},NumberFormat.prototype.render=function(){var t=this.props,e=t.type,r=t.displayType,o=t.customInput,n=t.renderText,i=t.getInputRef,s=t.format;t.thousandSeparator,t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle,t.decimalScale,t.fixedDecimalScale,t.prefix,t.suffix,t.removeFormatting,t.mask,t.defaultValue,t.isNumericString,t.allowNegative,t.allowEmptyFormatting,t.allowLeadingZeros,t.onValueChange,t.isAllowed,t.customNumerals,t.onChange,t.onKeyDown,t.onMouseUp,t.onFocus,t.onBlur,t.value;var u=function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}(t,["type","displayType","customInput","renderText","getInputRef","format","thous
1andSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"]),l=this.state,p=l.value,m=Object.assign({inputMode:l.mounted&&(s||"undefined"!=typeof navigator&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform)))?"numeric":void 0},u,{type:e,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});return"text"===r?n?n(p,u)||null:a().createElement("span",Object.assign({},u,{ref:i}),p):o?a().createElement(o,Object.assign({},m,{ref:i})):a().createElement("input",Object.assign({},m,{ref:i}))},NumberFormat}(a().Component);n.defaultProps={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:noop,onChange:noop,onKeyDown:noop,onMouseUp:noop,onFocus:noop,onBlur:noop,isAllowed:function(){return!0}},e.A=n}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.